JavaTM 2 Platform
Standard Ed. 5.0

javax.swing.text
Ŭ·¡½º ElementIterator

java.lang.Object 
  »óÀ§¸¦ È®Àå javax.swing.text.ElementIterator
¸ðµç ±¸ÇöµÈ ÀÎÅÍÆäÀ̽º:
Cloneable

public class ElementIterator
extends Object
implements Cloneable

ElementIterator´Â ±× À̸§ÀÌ °¡¸®Å°´Â ´ë·Î ¿ä¼Ò Æ®¸®¸¦ ¹Ýº¹ ó¸® ÇÕ´Ï´Ù. »ý¼ºÀÚ¸¦ È£ÃâÇÏ·Á¸é, ¹®¼­ ¶Ç´Â ¿ä¼Ò¸¦ Àμö¿¡ »ç¿ëÇÕ´Ï´Ù. ¹®¼­¸¦ Àμö·Î¼­ »ý¼ºÀÚ¸¦ È£ÃâÇϸé, ¹Ýº¹ÀÇ ·çÆ®´Â document.getDefaultRootElement()ÀÇ ¹Ýȯ°ªÀÌ µË´Ï´Ù. ±íÀÌ ¿ì¼± ¹æ½Ä¿¡¼­ ¹Ýº¹ÇÕ´Ï´Ù. °æ°èÀÇ Ã³¸®¹ýÀº ´ÙÀ½°ú °°½À´Ï´Ù. a) first() ¶Ç´Â current()º¸´Ù ¸ÕÀú next()°¡ ºÒ·Á °¬À» °æ¿ì´Â ·çÆ®¸¦ ¸®ÅÏÇÕ´Ï´Ù. b) next()´Â nullÀ» µ¹·ÁÁÖ°í ¸®½ºÆ®ÀÇ ¸»¹Ì¸¦ ³ªÅ¸³À´Ï´Ù. c) ÇöÀçÀÇ ¿ä¼Ò°¡ ·çÆ®ÀÇ °æ¿ì, ¶Ç´Â next()°¡ nullÀ» µ¹·ÁÁÖ¾úÀ» °æ¿ì´Â previous()´Â nullÀ» ¸®ÅÏÇÕ´Ï´Ù. ElementIterator´Â ¿ä¼Ò Æ®¸®¸¦ Àá±×Áö ¾Ê½À´Ï´Ù. Áï, ElementIterator´Â ¾î¶°ÇÑ º¯°æµµ ÃßÀûÇÏÁö ¾Ê½À´Ï´Ù. ÀÌ Å¬·¡½ºÀÇ »ç¿ëÀÚ°¡ ¿ä¼ÒÀÇ ¹Ýº¹ 󸮷Πº¯°æÀÌ »ý±âÁö ¾ÊÀº °ÍÀ» È®ÀÎÇÒ ÇÊ¿ä°¡ ÀÖ½À´Ï´Ù. ´ÙÀ½¿¡ °£´ÜÇÑ »ç¿ë¿¹¸¦ ³ªÅ¸³À´Ï´Ù. public void iterate() { ElementIterator it = new ElementIterator(root); Element elem; while (true) { if ((elem = next()) ! = null) { // process element System.out.println("elem: " + elem.getName()); } else { break; } } }


»ý¼ºÀÚ °³¿ä
ElementIterator (Document  document)
          »õ·Î¿î ElementIterator¸¦ ÀÛ¼ºÇÕ´Ï´Ù.
ElementIterator (Element  root)
          »õ·Î¿î ElementIterator¸¦ ÀÛ¼ºÇÕ´Ï´Ù.
 
¸Þ¼­µå °³¿ä
 Object clone ()
          ElementIterator¸¦ º¹Á¦ÇÕ´Ï´Ù.
 Element current ()
          ÇöÀçÀÇ Element¸¦ ²¨³À´Ï´Ù.
 int depth ()
          ¿ä¼Ò Æ®¸®ÀÇ ÇöÀçÀÇ ±íÀ̸¦ ²¨³À´Ï´Ù.
 Element first ()
          ¼±µÎÀÇ ¿ä¼Ò¸¦ ²¨³À´Ï´Ù.
 Element next ()
          ´ÙÀ½ÀÇ Element¸¦ ²¨³À´Ï´Ù.
 Element previous ()
          Á÷ÀüÀÇ Element¸¦ ²¨³À´Ï´Ù.
 
Ŭ·¡½º java.lang. Object ·ÎºÎÅÍ »ó¼ÓµÈ ¸Þ¼­µå
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

»ý¼ºÀÚ »ó¼¼

ElementIterator

public ElementIterator(Document  document)
»õ·Î¿î ElementIterator¸¦ ÀÛ¼ºÇÕ´Ï´Ù. ·çÆ® ¿ä¼Ò¸¦ ¼öÁß¿¡ ³ÖÀ¸¸é, ¹®¼­ÀÇ µðÆúÆ®ÀÇ ·çÆ® ¿ä¼Ò¸¦ ÃëµæÇÒ ¼ö ÀÖ½À´Ï´Ù.

ÆĶó¹ÌÅÍ:
document - Document

ElementIterator

public ElementIterator(Element  root)
»õ·Î¿î ElementIterator¸¦ ÀÛ¼ºÇÕ´Ï´Ù.

ÆĶó¹ÌÅÍ:
root - ·çÆ® Element
¸Þ¼­µåÀÇ »ó¼¼

clone

public Object  clone()
ElementIterator¸¦ º¹Á¦ÇÕ´Ï´Ù.

¿À¹ö¶óÀ̵å(override):
Ŭ·¡½º Object ³»ÀÇ clone
¹Ýȯ°ª:
º¹Á¦ÇÑ ElementIterator Object
°ü·Ã Ç׸ñ:
Cloneable

first

public Element  first()
¼±µÎÀÇ ¿ä¼Ò¸¦ ²¨³À´Ï´Ù.

¹Ýȯ°ª:
Element

depth

public int depth()
¿ä¼Ò Æ®¸®ÀÇ ÇöÀçÀÇ ±íÀ̸¦ ²¨³À´Ï´Ù.

¹Ýȯ°ª:
±íÀÌ

current

public Element  current()
ÇöÀçÀÇ Element¸¦ ²¨³À´Ï´Ù.

¹Ýȯ°ª:
½ºÅûóÀÇ ¿ä¼Ò. ·çÆ® ¿ä¼Ò°¡ nullÀÎ °æ¿ì´Â null

next

public Element  next()
´ÙÀ½ÀÇ Element¸¦ ²¨³À´Ï´Ù. ´ÙÀ½ÀÇ ¿ä¼Ò¸¦ ã¾Æ³»±â¿¡´Â ±íÀÌ ¿ì¼± Ž»öÀÌ »ç¿ëµË´Ï´Ù.

¹Ýȯ°ª:
´ÙÀ½ÀÇ ¿ä¼Ò. ¸®½ºÆ® ¸»¹Ì¿¡¼­´Â null

previous

public Element  previous()
Á÷ÀüÀÇ Element¸¦ ²¨³À´Ï´Ù. ÇöÀçÀÇ ¿ä¼Ò°¡ ¸¶Áö¸· ¿ä¼Ò³ª nullÀÎ °æ¿ì´Â nullÀÌ ¸®Åϵ˴ϴ٠.

¹Ýȯ°ª:
ÀÌ¿ëÇÒ ¼ö ÀÖ´Â °æ¿ì´Â ÀüÀÇ Element

JavaTM 2 Platform
Standard Ed. 5.0

Copyright 2004 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms . Documentation Redistribution Policy µµ ÂüÁ¶ÇϽʽÿÀ.