|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
ÀÌÀü Ŭ·¡½º ´ÙÀ½ Ŭ·¡½º | ÇÁ·¹ÀÓÀ¸·Î ÇÁ·¹ÀÓ ¾øÀÌ | |||||||||
°³¿ä: NESTED | Çʵå | »ý¼ºÀÚ | ¸Þ¼µå | »ó¼¼: Çʵå | »ý¼ºÀÚ | ¸Þ¼µå |
public interface Enumeration<E>
Enumeration ÀÎÅÍÆäÀ̽º¸¦ ±¸ÇöÇÏ´Â °´Ã¼´Â ÀÏ·ÃÀÇ ¿ä¼Ò¸¦ 1ȸ¿¡ 1°³
¾¿ »ý¼ºÇÕ´Ï´Ù. nextElement
¸Þ¼µå¸¦ ¿¬¼ÓÇØ È£ÃâÇÏ´Â °Í¿¡ÀÇÇØ ¿¬¼ÓÇÏ´Â ±×·¯ÇÑ ¿ä¼Ò°¡ ¸®Åϵ˴ϴÙ
.
¿¹¸¦ µé¾î º¤ÅÍ v ¸ðµç ¿ä¼Ò¸¦ Ãâ·ÂÇÏ·Á¸é, ´ÙÀ½°ú °°ÀÌ ÇÕ´Ï´Ù.
for (Enumeration e = v.elements() ; e.hasMoreElements() ;) { System.out.println(e.nextElement());
}
¸Þ¼µå´Â º¤ÅÍÀÇ ¿ä¼Ò, ÇØ½Ã Å×À̺íÀÇ Å° ¹× ÇØ½Ã Å×À̺íÀÇ °ªÀ» ¿°ÅÇϱâ À§ÇÑ
°ÍÀÔ´Ï´Ù. °Ô´Ù°¡ ¿°Å´Â ÀÔ·Â ½ºÆ®¸²À» SequenceInputStream
·Î
ÁöÁ¤Çϱâ À§Çؼµµ »ç¿ëµË´Ï´Ù.
ÁÖ: ÀÌ ÀÎÅÍÆäÀ̽ºÀÇ ±â´ÉÀº Iterator ÀÎÅÍÆäÀ̽º¿¡µµ ÀÖ½À´Ï´Ù. Iterator ÀÎÅÍÆäÀ̽º(ºÐ)Æí¿¡´Â ÀÓÀÇ ÁöÁ¤ÀÇ »èÁ¦ÀÇ ¿ÀÆÛ·¹À̼ÇÀÌ Ãß°¡µÇ°í ÀÖ¾î ¸Þ¼µåÀÇ À̸§µµ ª¾ÆÁö°í ÀÖ½À´Ï´Ù. »õ·Ó°Ô ±¸ÇöÇÏ´Â °æ¿ì´Â Enumeration´Â ¾Æ´Ï°í Iterator¸¦ »ç¿ëÇϵµ·ÏÀÇÇØ ÁÖ¼¼¿ä.
Iterator
,
SequenceInputStream
,
nextElement()
,
Hashtable
,
Hashtable.elements()
,
Hashtable.keys()
,
Vector
,
Vector.elements()
¸Þ¼µå °³¿ä | |
---|---|
boolean |
hasMoreElements ()
¿°Å¿¡ ¶ÇÇÑ ¿ä¼Ò°¡ ÀÖÀ»Áö ¾î¶³Áö¸¦ ÆÇÁ¤ÇÕ´Ï´Ù. |
E |
nextElement ()
¿°Å¿¡ 1°³ ÀÌ»óÀÇ ¿ä¼Ò°¡ ³²¾Æ ÀÖ´Â °æ¿ì´Â ´ÙÀ½ÀÇ ¿ä¼Ò¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
¸Þ¼µåÀÇ »ó¼¼ |
---|
boolean hasMoreElements()
true
, ±×·¸Áö ¾ÊÀº °æ¿ì´Â false
E nextElement()
NoSuchElementException
- ¿ä¼Ò°¡ ±× ÀÌ»ó ¾ø´Â °æ¿ì
|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
ÀÌÀü Ŭ·¡½º ´ÙÀ½ Ŭ·¡½º | ÇÁ·¹ÀÓÀ¸·Î ÇÁ·¹ÀÓ ¾øÀÌ | |||||||||
°³¿ä: NESTED | Çʵå | »ý¼ºÀÚ | ¸Þ¼µå | »ó¼¼: Çʵå | »ý¼ºÀÚ | ¸Þ¼µå |
Copyright 2004 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms . Documentation Redistribution Policy µµ ÂüÁ¶ÇϽʽÿÀ.