JavaTM 2
Platform
Std.  Ed.  v1. 4.0

javax.swing.text
Ŭ·¡½º ElementIterator

java.lang.Object 
  |
  +--javax.swing.text.ElementIterator
¸ðµç ±¸Çö ÀÎÅÍÆäÀ̽º:
Cloneable

public class ElementIterator
extends Object
implements Cloneable

ElementIterator ´Â ±× À̸§ÀÌ °¡¸®Å°´Â ´ë·Î, Element Æ®¸®¸¦ ¹Ýº¹ ó¸® ÇÕ´Ï´Ù. constructor¸¦ È£ÃâÇÏ·Á¸é , Document ¶Ç´Â Element ¸¦ Àμö¿¡ »ç¿ëÇÕ´Ï´Ù. Document ¸¦ Àμö·Î¼­ constructor¸¦ È£ÃâÇϸé(ÀÚ), ¹Ýº¹ÀÇ ·çÆ®´Â document.getDefaultRootElement()ÀÇ ¹Ýȯ°ªÀÌ µË´Ï´Ù. ±íÀÌ ¿ì¼± ¹æ½Ä¿¡¼­ ¹Ýº¹ÇÕ´Ï´Ù. °æ°èÀÇ Ã³¸®¹ýÀº ´ÙÀ½°ú °°½À´Ï´Ù. a) first() ¶Ç´Â current()º¸´Ù ¸ÕÀú next()°¡ ºÒ·Á °¬À» °æ¿ì´Â ·çÆ®¸¦ µ¹·ÁÁÝ´Ï´Ù. b) next()´Â null ¸¦ µ¹·ÁÁÖ¾î ¸®½ºÆ®ÀÇ ¸»¹Ì¸¦ ³ªÅ¸³À´Ï´Ù. c) ÇöÀçÀÇ ¿ä¼Ò°¡ ·çÆ®ÀÇ °æ¿ì, ¶Ç´Â next()°¡ null ¸¦ µ¹·ÁÁÖ¾úÀ» °æ¿ì´Â previous()´Â null ¸¦ µ¹·ÁÁÝ´Ï´Ù. ElementIterator ´Â Element Æ®¸®¸¦ Àá±×Áö ¾Ê½À´Ï´Ù. Áï, ElementIteration ´Â ¾î¶°ÇÑ º¯°æµµ ÃßÀûÇÏÁö ¾Ê½À´Ï´Ù. ÀÌ Å¬·¡½ºÀÇ À¯Àú°¡, ¿ä¼ÒÀÇ ¹Ýº¹ 󸮷Πº¯°æÀÌ »ý±âÁö ¾ÊÀº °ÍÀ» È®ÀÎÇÒ Çʿ䰡 ÀÖ½À´Ï´Ù. ´ÙÀ½¿¡, °£´ÜÇÑ »ç¿ë¿¹¸¦ ³ªÅ¸³À´Ï´Ù. 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 ¸¦ ÀÛ¼ºÇÕ´Ï´Ù. ·çÆ® ¿ä¼Ò¸¦ ¼öÁß¿¡ ³ÖÀ¸¸é(ÀÚ), ¹®¼­ÀÇ µðÆúÆ®ÀÇ ·çÆ® ¿ä¼Ò¸¦ ÃëµæÇÒ ¼ö ÀÖ½À´Ï´Ù.


ElementIterator

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

¸Þ¼ÒµåÀÇ »ó¼¼

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
Std.  Ed.  v1. 4.0

¹ö±×ÀÇ º¸°í¿Í ±â´ÉÀÇ ¸®Äù½ºÆ®
ÀÌ¿ÜÀÇ API ·¹ÆÛ·±½º ¹× °³¹ßÀÚ¿ë ¹®¼­¿¡ ´ëÇØ¼­´Â Java 2 SDK SE °³¹ßÀÚ¿ë ¹®¼­¸¦ ÂüÁ¶ÇØ ÁÖ¼¼¿ä. °³¹ßÀÚÀü¿ëÀÇ »ó¼¼ÇÑ ÇØ¼³, °³³äÀÇ °³¿ä, ¿ë¾îÀÇ Á¤ÀÇ, ¹ö±×ÀÇ È¸ÇÇÃ¥, ¹× ÄÚµå ½Ç·Ê°¡ Æ÷ÇԵǾî ÀÖ½À´Ï´Ù.

Java, Java 2 D, ¹× JDBC ´Â ¹Ì±¹ ¹× ±× ¿ÜÀÇ ³ª¶ó¿¡ À־ÀÇ ¹Ì±¹ Sun Microsystems, Inc. ÀÇ »óÇ¥ ȤÀº µî·Ï»óÇ¥ÀÔ´Ï´Ù.
Copyright 1993-2002 Sun Microsystems, Inc. 901 San Antonio Road
Palo Alto, California, 94303, U.S.A. All Rights Reserved.