|
JavaTM 2 Platform Std. Ed. v1. 4.0 |
||||||||||
ÀüÀÇ Å¬·¡½º ´ÙÀ½ÀÇ Å¬·¡½º | ÇÁ·¹ÀÓ ÀÖ¾î ÇÁ·¹ÀÓ ¾øÀ½ | ||||||||||
°³¿ä: »óÀÚ | Çʵå | constructor | ¸Þ¼Òµå | »ó¼¼: Çʵå | constructor | ¸Þ¼Òµå |
java.lang.Object | +--javax.swing.text.ElementIterator
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 |
»ý¼ºÀÚÀÇ »ó¼¼ |
public ElementIterator(Document document)
public ElementIterator(Element root)
¸Þ¼ÒµåÀÇ »ó¼¼ |
public Object clone()
Object
³»ÀÇ clone
Cloneable
public Element first()
public int depth()
public Element current()
null
ÀÇ °æ¿ì´Â null
public Element next()
null
public Element previous()
Element
|
JavaTM 2 Platform Std. Ed. v1. 4.0 |
||||||||||
ÀüÀÇ Å¬·¡½º ´ÙÀ½ÀÇ Å¬·¡½º | ÇÁ·¹ÀÓ ÀÖ¾î ÇÁ·¹ÀÓ ¾øÀ½ | ||||||||||
°³¿ä: »óÀÚ | Çʵå | constructor | ¸Þ¼Òµå | »ó¼¼: Çʵå | constructor | ¸Þ¼Òµå |
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.