|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
| ÀÌÀü Ŭ·¡½º ´ÙÀ½ Ŭ·¡½º | ÇÁ·¹ÀÓÀ¸·Î ÇÁ·¹ÀÓ ¾øÀÌ | |||||||||
| °³¿ä: NESTED | Çʵå | constructor | ¸Þ¼µå | »ó¼¼: Çʵå | »ý¼ºÀÚ | ¸Þ¼µå | |||||||||
java.lang.Objectjava.util.concurrent.CopyOnWriteArrayList<E>
E - Ä÷º¼Ç³»¿¡ Á¸ÀçÇÏ´Â ¿ä¼ÒÀÇ ÇüÅÂpublic class CopyOnWriteArrayList<E>
±âº»À¸·Î µÇ´Â ¹è¿ÀÇ »õ·Î¿î º¹»çº»À» ÀÛ¼ºÇÔÀ¸·Î½á
¸ðµç º¯°æ Á¶ÀÛ (Ãß°¡ ¼³Á¤µî)ÀÌ ±¸ÇöµÇ´Â ArrayList
thread ¼¼ÀÌÇÁÀÎ º¯¼öÀÔ´Ï´Ù.
º¸Åë, À̰ÍÀº ¸Å¿ì È¿À²ÀÌ ³ª»Þ´Ï´Ù¸¸, traversal Á¶ÀÛÀÌ º¯°æÀ» ¼öÀÇ Á¡À¸·Î½á Å«ÆøÀ¸·Î ¿ôµµ´Â °æ¿ì¿¡´Â ´ëü ¼ö´Üº¸´Ù È¿À²ÀÌ ÁÁÀº °æ¿ì°¡ ÀÖ½À´Ï´Ù. ¶Ç, À̰ÍÀº traversalÀ» µ¿±â ÇÒ ¼ö ¾ø´ÂÁö, ±×·¸°Ô ÇÏ´Â °ÍÀ» ¹Ù¶óÁö ¾ÊÁö¸¸, º´Çà thread°£ÀÇ °£¼·À» ¹èÁ¦ÇÒ Çʿ䰡 ÀÖ´Â °æ¿ì¿¡ À¯¿ëÇÕ´Ï´Ù. ¡¸snapshot¡¹½ºÅ¸ÀÏÀÇ ¹Ýº¹ÀÚ ¸Þ¼µå´Â ¹Ýº¹ÀÚÀÇ ÀÛ¼º ½ÃÁ¡¿¡¼ÀÇ ¹è¿ »óÅ¿¡ÀÇ ÂüÁ¶¸¦ »ç¿ëÇÕ´Ï´Ù. ÀÌ ¹è¿ÀÌ, ¹Ýº¹ÀÚÀÇ À¯È¿±â°£³»·Î º¯°æµÇ´Â °ÍÀº °áÄÚ ¾ø±â ¶§¹®¿¡ °£¼·Àº ºÒ°¡´ÉÇϰí, ¹Ýº¹ÀÚ´Â ConcurrentModificationExceptionÀ» Throw ÇÏÁö ¾Ê´Â °ÍÀÌ º¸ÁõµË´Ï´Ù. ¹Ýº¹ÀÚ´Â ¹Ýº¹ÀÚÀÇ ÀÛ¼º ÀÌÈÄÀÇ ¸®½ºÆ®¿¡ÀÇ Ãß°¡ »èÁ¦, ¶Ç´Â º¯°æÀ» ¹Ý¿µÇÏÁö ¾Ê½À´Ï´Ù. ¹Ýº¹ÀÚ Àڽſ¡ ´ëÇÑ ¿ä¼Ò º¯°æ Á¶ÀÛ (»èÁ¦, ¼³Á¤ ¹× Ãß°¡)Àº Áö¿ø µÇÁö ¾Ê½À´Ï´Ù. ÀÌ·¯ÇÑ ¸Þ¼µå´Â UnsupportedOperationExceptionÀ» Throw ÇÕ´Ï´Ù.
ÀÌ Å¬·¡½º´Â Java Collections Framework ¸â¹öÀÔ´Ï´Ù.
| »ý¼ºÀÚ °³¿ä | |
|---|---|
CopyOnWriteArrayList ()
ºñ¾îÀÖ´Â ¸®½ºÆ®¸¦ ÀÛ¼ºÇÕ´Ï´Ù. |
|
CopyOnWriteArrayList (Collection <? extends E > c)
ÁöÁ¤µÈ Collection ¿ä¼Ò¸¦ Æ÷ÇÔÇÑ ¸®½ºÆ®¸¦, Collection ¹Ýº¹ÀÚ¿¡ ÀÇÇØ ¸®ÅÏµÈ ¼ø¼·Î ÀÛ¼ºÇÕ´Ï´Ù. |
|
CopyOnWriteArrayList (E [] toCopyIn)
ÁöÁ¤µÈ ¹è¿ÀÇ º¹»çº»À» º¸°ü À¯ÁöÇÏ´Â CopyOnWriteArrayList¸¦ »õ·Ó°Ô ÀÛ¼ºÇÕ´Ï´Ù. |
|
| ¸Þ¼µå °³¿ä | ||
|---|---|---|
boolean |
add (E element)
¸®½ºÆ®ÀÇ ¸¶Áö¸·À¸·Î ÁöÁ¤µÈ ¿ä¼Ò¸¦ Ãß°¡ÇÕ´Ï´Ù. |
|
void |
add (int index,
E element)
¸®½ºÆ®ÀÇ ÁöÁ¤µÈ À§Ä¡¿¡ ÁöÁ¤µÈ ¿ä¼Ò¸¦ »ðÀÔÇÕ´Ï´Ù. |
|
boolean |
addAll (Collection <? extends E > c)
ÁöÁ¤µÈ Collection ³»ÀÇ ¸ðµç ¿ä¼Ò¸¦, ÁöÁ¤µÈ Collection ¹Ýº¹ÀÚ¿¡ ÀÇÇØ ¸®ÅÏµÈ ¼ø¼·Î ÀÌ ¸®½ºÆ®ÀÇ ¸¶Áö¸·¿¡ Ãß°¡ÇÕ´Ï´Ù. |
|
boolean |
addAll (int index,
Collection <? extends E > c)
¸®½ºÆ®³»ÀÇ ÁöÁ¤µÈ À§Ä¡·ÎºÎÅÍ, ÁöÁ¤µÈ Collection ¸ðµç ¿ä¼Ò¸¦ »ðÀÔÇÕ´Ï´Ù. |
|
int |
addAllAbsent (Collection <? extends E > c)
ÀÌ ¸®½ºÆ®¿¡ Æ÷ÇÔµÇÁö ¾ÊÀº ÁöÁ¤µÈ Collection ³»ÀÇ ¸ðµç ¿ä¼Ò¸¦, ÁöÁ¤µÈ Collection ¹Ýº¹ÀÚ¿¡ ÀÇÇØ ¸®ÅÏµÈ ¼ø¼·Î ÀÌ ¸®½ºÆ®ÀÇ ¸¶Áö¸·¿¡ Ãß°¡ÇÕ´Ï´Ù. |
|
boolean |
addIfAbsent (E element)
¿ä¼Ò°¡ Á¸ÀçÇÏÁö ¾Ê´Â °æ¿ì, ¿ä¼Ò¸¦ Ãß°¡ÇÕ´Ï´Ù. |
|
void |
clear ()
¸®½ºÆ®·ÎºÎÅÍ ¸ðµç ¿ä¼Ò¸¦ »èÁ¦ÇÕ´Ï´Ù. |
|
Object |
clone ()
¸®½ºÆ®ÀÇ »þ·ÎÄÚÇǸ¦ ¸®ÅÏÇÕ´Ï´Ù. |
|
boolean |
contains (Object elem)
¸®½ºÆ®·Î ÁöÁ¤µÈ ¿ä¼Ò°¡ ÀÖ´Â °æ¿ì¿¡ true¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
|
boolean |
containsAll (Collection <? > c)
ÀÌ Collection ³»¿¡ ÁöÁ¤µÈ Collection ¸ðµç ¿ä¼Ò°¡ ÀÖ´Â °æ¿ì¿¡ true¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
|
boolean |
equals (Object o)
ÁöÁ¤µÈ Object°¡ List¿Í µ¿ÀÏÇÑÁö ¾î¶²Áö¸¦ ºñ±³ÇÕ´Ï´Ù. |
|
E |
get (int index)
¸®½ºÆ®³»ÀÇ ÁöÁ¤µÈ À§Ä¡¿¡ ÀÖ´Â ¿ä¼Ò¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
|
int |
hashCode ()
ÀÌ List ÇØ½Ã Äڵ尪À» ¸®ÅÏÇÕ´Ï´Ù. |
|
int |
indexOf (E elem,
int index)
equals ¸Þ¼µå¸¦ »ç¿ëÇØ µ¿ÀÏÇÑÁö ¾î¶²Áö¸¦ ÆÇÁ¤Çϸé¼, ÁöÁ¤µÈ Àμö¿Í °°Àº ³»¿ëÀÇ ¿ä¼Ò°¡ ÁöÁ¤µÈ index·Î ºÎÅÍ °Ë»öÇÕ´Ï´Ù. |
|
int |
indexOf (Object elem)
equals ¸Þ¼µå¸¦ »ç¿ëÇØ µ¿ÀÏÇÑÁö ¾î¶²Áö¸¦ ÆÇÁ¤Çϸé¼, ÁöÁ¤µÈ Àμö¿Í °°Àº ³»¿ëÀÇ ¿ä¼Ò¸¦ ¼±µÎ·ÎºÎÅÍ °Ë»öÇÕ´Ï´Ù. |
|
boolean |
isEmpty ()
¸®½ºÆ®¿¡ ¿ä¼Ò°¡ ÀÖ´ÂÁö ¾ø´ÂÁö¸¦ ÆÇÁ¤ÇÕ´Ï´Ù. |
|
Iterator <E > |
iterator ()
ÀÌ Ä÷º¼Ç¿¡ Æ÷ÇԵǴ ¿ä¼ÒÀÇ Iterator¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
|
int |
lastIndexOf (E elem,
int index)
ÁöÁ¤µÈ À妽º·ÎºÎÅÍ ÈÄ ¹æÇâÀ¸·Î ÁöÁ¤µÈ °´Ã¼¸¦ °Ë»öÇØ, °ËÃâµÈ À妽º¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
|
int |
lastIndexOf (Object elem)
ÁöÁ¤µÈ °´Ã¼°¡ ¸®½ºÆ®³»¿¡¼ ¸¶Áö¸·¿¡ ³ªÅ¸³ª´Â À妽º¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
|
ListIterator <E > |
listIterator ()
ÀÌ List ³»ÀÇ ¿ä¼ÒÀÇ Iterator¸¦ ÀûÀýÇÑ ¼ø¼·Î ¸®ÅÏÇÕ´Ï´Ù. |
|
ListIterator <E > |
listIterator (int index)
ÀÌ List ³»ÀÇ ¿ä¼ÒÀÇ ListIterator¸¦, List ³»ÀÇ ÁöÁ¤µÈ À§Ä¡·ÎºÎÅÍ ½ÃÀ۵Ǿî ÀûÀýÇÑ ¼ø¼·Î ¸®ÅÏÇÕ´Ï´Ù. |
|
E |
remove (int index)
¸®½ºÆ®³»ÀÇ ÁöÁ¤µÈ À§Ä¡·ÎºÎÅÍ ¿ä¼Ò¸¦ »èÁ¦ÇÕ´Ï´Ù. |
|
boolean |
remove (Object o)
ÁöÁ¤µÈ ¿ä¼ÒÀÇ ÀνºÅϽº°¡ ÀÌ ¸®½ºÆ®¿¡ ÀÖÀ¸¸é, ±× ÀνºÅϽº¸¦ ¸®½ºÆ®·ÎºÎÅÍ 1°³ »èÁ¦ÇÕ´Ï´Ù (ÀÓÀÇÀÇ ¿ÀÆÛ·¹À̼Ç). |
|
boolean |
removeAll (Collection <? > c)
ÁöÁ¤µÈ Collection¿¡ Æ÷ÇԵǴ ¸ðµç ¿ä¼Ò¸¦, ÀÌ Collection ·ÎºÎÅÍ »èÁ¦ÇÕ´Ï´Ù. |
|
boolean |
retainAll (Collection <? > c)
ÀÌ Collection¿¡ ´ëÇØ, ÁöÁ¤µÈ Collection¿¡ Æ÷ÇԵǰí ÀÖ´Â ¿ä¼Ò¸¸À» º¸°ü À¯ÁöÇÕ´Ï´Ù (ÀÓÀÇÀÇ ¿ÀÆÛ·¹À̼Ç). |
|
E |
set (int index,
E element)
¸®½ºÆ®ÀÇ ÁöÁ¤µÈ À§Ä¡¿¡ ÀÖ´Â ¿ä¼Ò¸¦, ÁöÁ¤µÈ ¿ä¼Ò·Î ¿Å°Ü³õ½À´Ï´Ù. |
|
int |
size ()
¸®½ºÆ®³»¿¡ ÀÖ´Â ¿ä¼ÒÀÇ ¼ö¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
|
List <E > |
subList (int fromIndex,
int toIndex)
ÀÌ List fromIndex (À̰ÍÀ» Æ÷ÇÔÇÑ´Ù)¿Í toIndex (À̰ÍÀ» Æ÷ÇÔÇÏÁö ¾Ê´Â´Ù)ÀÇ »çÀÌÀÇ ºÎºÐÀÇ ºä¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
|
Object [] |
toArray ()
¸®½ºÆ®³»ÀÇ ¸ðµç ¿ä¼Ò°¡ ¿Ã¹Ù¸¥ ¼ø¼·Î Æ÷ÇԵǰí ÀÖ´Â ¹è¿À» ¸®ÅÏÇÕ´Ï´Ù. |
|
|
toArray (T[] a)
¸®½ºÆ®³»ÀÇ ¸ðµç ¿ä¼Ò°¡ ¿Ã¹Ù¸¥ ¼ø¼·Î Æ÷ÇԵǰí ÀÖ´Â ¹è¿À» ¸®ÅÏÇÕ´Ï´Ù. |
|
String |
toString ()
°¢ ¿ä¼ÒÀÇ String Ç¥ÇöÀ» º¸°ü À¯ÁöÇϰí ÀÖ´Â Collection ij¸¯ÅÍ ¶óÀΠǥÇöÀ» ¸®ÅÏÇÕ´Ï´Ù. |
|
| Ŭ·¡½º java.lang. Object ·ÎºÎÅÍ »ó¼ÓµÈ ¸Þ¼µå |
|---|
finalize,
getClass,
notify,
notifyAll,
wait,
wait,
wait |
| »ý¼ºÀÚ »ó¼¼ |
|---|
public CopyOnWriteArrayList()
public CopyOnWriteArrayList(Collection <? extends E > c)
c - ÃÖÃÊ·Î º¸°ü À¯ÁöÇϰí ÀÖ´ø ¿ä¼ÒÀÇ Ä÷º¼Çpublic CopyOnWriteArrayList(E [] toCopyIn)
toCopyIn - ¹è¿ (ÀÌ ¹è¿ÀÇ Ä«ÇÇ´Â ³»ºÎ ¹è¿·Î¼ »ç¿ëµÈ´Ù)| ¸Þ¼µåÀÇ »ó¼¼ |
|---|
public int size()
Collection <E > ³»ÀÇ size List <E > ³»ÀÇ size public boolean isEmpty()
Collection <E > ³»ÀÇ isEmpty List <E > ³»ÀÇ isEmpty public boolean contains(Object elem)
Collection <E > ³»ÀÇ contains List <E > ³»ÀÇ contains elem - ¸®½ºÆ®¿¡ ÀÖÀ»Áö ¾î¶³Áö¸¦ Á¶»çÇÏ´Â ¿ä¼Ò
true, ±×·¸Áö ¾ÊÀº °æ¿ì´Â falsepublic int indexOf(Object elem)
List <E > ³»ÀÇ indexOf elem - °´Ã¼
Object.equals(Object)
public int indexOf(E elem,
int index)
elem - °´Ã¼index - °Ë»öÀ» °³½ÃÇÏ´Â À§Ä¡ÀÇ À妽º
Object.equals(Object) public int lastIndexOf(Object elem)
List <E > ³»ÀÇ lastIndexOf elem - ¸ñÀûÀÇ ¿ä¼Ò
public int lastIndexOf(E elem,
int index)
elem - ¸ñÀûÀÇ ¿ä¼Òindex - °Ë»öÀ» °³½ÃÇÏ´Â À§Ä¡ÀÇ À妽º
public Object clone()
Object ³»ÀÇ clone Cloneable public Object [] toArray()
Collection <E > ³»ÀÇ toArray List <E > ³»ÀÇ toArray Arrays.asList(Object[]) public <T> T[] toArray(T[] a)
ÁöÁ¤µÈ ¹è¿¿¡ ¸®½ºÆ®°¡ µé¾î°¡µµ ¶ÇÇÑ ½ºÆäÀ̽º°¡ ÀÖ´Â °æ¿ì, Áï ¹è¿¿¡ ¸®½ºÆ®º¸´Ù ¸¹Àº ¿ä¼Ò°¡ ÀÖ´Â °æ¿ì´Â Ä÷º¼ÇÀÇ ¸¶Áö¸· Á÷ÈÄ¿¡ ÀÖ´Â ¹è¿³»ÀÇ ¿ä¼Ò´Â null ·Î ¼³Á¤µË´Ï´Ù. À̰ÍÀº È£ÃâÃøÀÌ ¸®½ºÆ®¿¡ null ¿ä¼Ò°¡ Æ÷ÇÔµÇÁö ¾ÊÀº °ÍÀ» ¾Ë°í ÀÖ´Â °æ¿ì¿¡´Â ¸®½ºÆ®ÀÇ ±æÀ̸¦ ÆÇÁ¤Çϴµ¥ ÀÌ¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù.
Collection <E > ³»ÀÇ toArray List <E > ³»ÀÇ toArray a - ¹è¿ÀÌ ÃæºÐÇÑ Å©±â¸¦ °¡Áö´Â °æ¿ì´Â ¸®½ºÆ®ÀÇ ¿ä¼Ò°¡ Æ÷ÇԵǴ ¹è¿. ±×·¸Áö ¾ÊÀº °æ¿ì´Â ¿ä¼Ò¸¦ Æ÷ÇÔÇϱâ À§Çؼ °°Àº ½ÇÇà½ÃÀÇ ÇüÅÂÀÇ »õ·Î¿î ¹è¿À» ÇÒ´çÇÒ ¼ö ÀÖ´Ù
ArrayStoreException - a
½ÇÇà½ÃÀÇ ÇüŰ¡ ¸®½ºÆ®³»ÀÇ °¢ ¿ä¼ÒÀÇ ½ÇÇà½ÃÀÇ ÇüÅÂÀÇ ½´ÆÛŸÀÔÀÌ ¾Æ´Ñ °æ¿ìpublic E get(int index)
List <E > ³»ÀÇ get index - ¸®ÅϵÈ
¿ä¼ÒÀÇ À妽º
IndexOutOfBoundsException - À妽º°¡ ¹üÀ§¿ÜÀÇ °æ¿ì (index < 0 || index >= size())
public E set(int index,
E element)
List <E > ³»ÀÇ set index - ġȯµÇ´Â ¿ä¼ÒÀÇ À妽ºelement - ÁöÁ¤µÈ À§Ä¡¿¡ Æ÷ÇԵǴ ¿ä¼Ò
IndexOutOfBoundsException - À妽º°¡ ¹üÀ§¿ÜÀÇ °æ¿ì (index < 0 || index >= size())public boolean add(E element)
Collection <E > ³»ÀÇ add List <E > ³»ÀÇ add element - ¸®½ºÆ®¿¡ Ãß°¡µÇ´Â ¿ä¼Ò
public void add(int index,
E element)
List <E > ³»ÀÇ add index - ÁöÁ¤µÈ ¿ä¼Ò°¡ »ðÀԵǴ À妽ºelement - »ðÀԵǴ ¿ä¼Ò
IndexOutOfBoundsException - À妽º°¡ ¹üÀ§¿ÜÀÇ °æ¿ì (index < 0 || index > size())public E remove(int index)
List <E > ³»ÀÇ remove index - »èÁ¦µÇ´Â ¿ä¼ÒÀÇ À妽º
IndexOutOfBoundsException - À妽º°¡ ¹üÀ§¿ÜÀÇ °æ¿ì (index < 0 || index >= size())public boolean remove(Object o)
Collection <E > ³»ÀÇ remove List <E > ³»ÀÇ remove o - ¸®½ºÆ®·ÎºÎÅÍ »èÁ¦µÇ´Â ¿ä¼Ò (±× ¿ä¼Ò°¡ ÀÖ´Â °æ¿ì)
public boolean addIfAbsent(E element)
element - Collection¿¡ Ãß°¡µÇ´Â ¿ä¼Ò (¿ä¼Ò°¡ Á¸ÀçÇÏÁö ¾Ê´Â °æ¿ì)
public boolean containsAll(Collection <? > c)
ÀÌ ±¸ÇöÀº ÁöÁ¤µÈ Collection ³»¿ëÀ» Â÷·ÊÂ÷·Ê Á¶»çÇØ Iterator¿¡ ÀÇÇØ ¸®ÅÏµÈ °¢ ¿ä¼Ò¿¡ ´ëÇØ, ÀÌ Collection¿¡ Æ÷ÇÔµÉÁö ¾î¶³Áö¸¦ Â÷·Ê·Î È®ÀÎÇÕ´Ï´Ù. ¸ðµç ¿ä¼Ò°¡ ÀÌ Collection¿¡ ÀÖ´Â °æ¿ì´Â true¸¦ µ¹·ÁÁÖ°í, ±×·¸Áö ¾ÊÀº °æ¿ì´Â false¸¦ ¸®ÅÏÇÕ´Ï´Ù.
Collection <E > ³»ÀÇ containsAll List <E > ³»ÀÇ containsAll c - Ä÷º¼Ç
Collection.contains(Object) public boolean removeAll(Collection <? > c)
Collection <E > ³»ÀÇ removeAll List <E > ³»ÀÇ removeAll c - Ä÷º¼Ç
Collection.remove(Object),
Collection.contains(Object) public boolean retainAll(Collection <? > c)
Collection <E > ³»ÀÇ retainAll List <E > ³»ÀÇ retainAll c - Ä÷º¼Ç
Collection.remove(Object),
Collection.contains(Object) public int addAllAbsent(Collection <? extends E > c)
c - ¸®½ºÆ®¿¡ Ãß°¡µÇ´Â ¿ä¼Ò
public void clear()
Collection <E > ³»ÀÇ clear List <E > ³»ÀÇ clear public boolean addAll(Collection <? extends E > c)
Collection <E > ³»ÀÇ addAll List <E > ³»ÀÇ addAll c - ¸®½ºÆ®¿¡ »ðÀԵǴ ¿ä¼Ò
Collection.add(Object)
public boolean addAll(int index,
Collection <? extends E > c)
List <E > ³»ÀÇ addAll index - ÁöÁ¤µÈ Ä÷º¼ÇÀ¸·ÎºÎÅÍ ÃÖÃÊÀÇ ¿ä¼Ò¸¦ »ðÀÔÇÏ´Â À§Ä¡ÀÇ À妽ºc - ¸®½ºÆ®¿¡ »ðÀԵǴ ¿ä¼Ò
IndexOutOfBoundsException - À妽º°¡ ¹üÀ§¿ÜÀÇ °æ¿ì (index < 0 || index > size())public String toString()
Object ³»ÀÇ toString public boolean equals(Object o)
ÀÌ ±¸ÇöÀº ÃÖÃÊ·Î ÁöÁ¤µÈ °´Ã¼°¡ ÀÌ List ÀÏÁö ¾î¶³Áö¸¦ Á¶»çÇÕ´Ï´Ù. ÀÌ List ÀÎ °æ¿ì, ±¸ÇöÀº true¸¦ ¸®ÅÏÇÕ´Ï´Ù. ±×·¸Áö ¾ÊÀº °æ¿ì´Â ÁöÁ¤µÈ °´Ã¼°¡ List ȵµÀÎÁö¸¦ Á¶»çÇØ List°¡ ¾Æ´Ï¸é false¸¦ ¸®ÅÏÇÕ´Ï´Ù. ÁöÁ¤µÈ °´Ã¼°¡ ListÀÎ °æ¿ì´Â ¾çÂÊ ¸ðµÎÀÇ ¸®½ºÆ®ÀÇ ³»¿ëÀ» Â÷·ÊÂ÷·Ê Á¶»çÇØ, ¿ä¼ÒÀÇ ´ëÀÀÇÏ´Â Æä¾î¸¦ ºñ±³ÇÕ´Ï´Ù. ºñ±³ÀÇ °á°ú false°¡ ¸®ÅÏµÈ ÀÏÀÌ ÀÖÀ¸¸é, ÀÌ ¸Þ¼µåµµ false¸¦ ¸®ÅÏÇÕ´Ï´Ù. ¾î´À ÂÊÀΰ¡ÀÇ Iterator ¿ä¼Ò°¡ ¸ÕÀú ¾ø¾îÁ³À» °æ¿ì´Â 2°³ÀÇ List ±æÀ̰¡ µ¿ÀÏÇÏÁö ¾Ê±â ¶§¹®¿¡ false¸¦ ¸®ÅÏÇÕ´Ï´Ù. ±×·¸Áö ¾ÊÀº °æ¿ì´Â ¹Ýº¹ÀÌ ¿Ï·áÇÑ ½ÃÁ¡¿¡¼ true¸¦ ¸®ÅÏÇÕ´Ï´Ù.
Collection <E > ³»ÀÇ equals List <E > ³»ÀÇ equals Object ³»ÀÇ equals o - List¿Í
µ¿ÀÏÇÑÁö ¾î¶²Áö¸¦ ºñ±³ÇÏ´Â Object
Object.hashCode(),
Hashtable public int hashCode()
ÀÌ ±¸ÇöÀº, List.hashCode() ³»ÀÇ Á¤ÀǸ¦ »ç¿ëÇÕ´Ï´Ù.
Collection <E > ³»ÀÇ hashCode List <E > ³»ÀÇ hashCode Object ³»ÀÇ hashCode Object.equals(java.lang.Object),
Hashtable public Iterator <E > iterator()
Iterable <E > ³»ÀÇ iterator Collection <E > ³»ÀÇ iterator List <E > ³»ÀÇ iterator public ListIterator <E > listIterator()
List <E > ³»ÀÇ listIterator public ListIterator <E > listIterator(int index)
List <E > ³»ÀÇ listIterator index - getNext
È£Ãâ¿¡ ÀÇÇØ ListIterator ·ÎºÎÅÍ ¸®ÅϵÈ
ÃÖÃÊÀÇ ¿ä¼ÒÀÇ À妽º
IndexOutOfBoundsException - À妽º°¡ ¹üÀ§¿ÜÀÇ °æ¿ì (index < 0 || index > size())
public List <E > subList(int fromIndex,
int toIndex)
±âÃʸ¦ µÎ´Â ¸®½ºÆ® (Áï ÀÌ List)°¡ ¸®ÅÏµÈ List¸¦ °³Áµµ¿¡ ¡¸±¸Á¶ÀûÀ¸·Î º¯°æ¡¹µÇ¾úÀ» °æ¿ì, ÀÌ ¸Þ¼µå¿¡ ÀÇÇØ ¸®ÅÏµÈ List ½Ã¸àƽ½º´Â º¸ÁõµÇÁö ¾Ê½À´Ï´Ù. ±¸Á¶ÀûÀÎ º¯°æÀ̶õ List »çÀÌÁî°¡ º¯°æµÇ¾úÀ» °æ¿ì³ª, ÁøÇàÁßÀÇ ¹Ýº¹¿¡ ÀÇÇØ ºÎÁ¤ÇÑ °á°ú°¡ »ý°å´Ù´Â µîÀÇ ÀÌÀ¯·Î½á List°¡ È寮·¯Á³À» °æ¿ìÀÔ´Ï´Ù.
List <E > ³»ÀÇ subList fromIndex - subList
ÇÏ´ÜÁ¡ (À̰ÍÀ» Æ÷ÇÔÇÑ´Ù)toIndex - subList
»ó´ÜÁ¡ (À̰ÍÀ» Æ÷ÇÔÇÏÁö ¾Ê´Â´Ù)
IndexOutOfBoundsException - ºÎÁ¤ÇÑ ´Ü Á¡ÀÇ À妽ºÄ¡ (fromIndex < 0 || toIndex > size || fromIndex > toIndex)
|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
| ÀÌÀü Ŭ·¡½º ´ÙÀ½ Ŭ·¡½º | ÇÁ·¹ÀÓÀ¸·Î ÇÁ·¹ÀÓ ¾øÀÌ | |||||||||
| °³¿ä: NESTED | Çʵå | constructor | ¸Þ¼µå | »ó¼¼: Çʵå | »ý¼ºÀÚ | ¸Þ¼µå | |||||||||
Copyright 2004 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms . Documentation Redistribution Policy µµ ÂüÁ¶ÇϽʽÿÀ.