|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
ÀÌÀü Ŭ·¡½º ´ÙÀ½ Ŭ·¡½º | ÇÁ·¹ÀÓÀ¸·Î ÇÁ·¹ÀÓ ¾øÀÌ | |||||||||
°³¿ä: NESTED | Çʵå | constructor¡¡ ¡¡ | ¸Þ¼µå | »ó¼¼: Çʵå | constructor¡¡ ¡¡ | ¸Þ¼µå |
java.lang.Objectjava.text.CollationElementIterator
public final class CollationElementIterator
CollationElementIterator
Ŭ·¡½º´Â °¢±¹¾î ij¸¯ÅÍ ¶óÀÎÀÇ °¢ ¹®ÀÚ¸¦ ó¸®ÇÒ ¶§ÀÇ ¹Ýº¹Àڷμ »ç¿ëÇÕ´Ï´Ù. ¹Ýº¹ÀÚ´Â ÀÚ¸® ¸Å±èÀ» ÇÏ°í µÈ ¹®ÀÚÀÇ ¼ø¼ÀÇ ¿ì¼± ¼øÀ§¸¦ µ¹·ÁÁִµ¥ »ç¿ëµË´Ï´Ù. ¼ø¼ÀÇ ¿ì¼± ¼øÀ§ (۶ó°í ºÎ¸¥´Ù)´Â ÁöÁ¤µÈ Á¶ÇÕ °´Ã¼¿¡ ´ëÇØ, ¾î´À ¹®ÀÚ°¡ ¾î¶»°Ô Á¶ÇյǴÂÁö¸¦ Á¤ÀÇÇÏ´Â °ÍÀÔ´Ï´Ù.
½ºÆäÀξîÀÇ ¿¹¸¦ ³ªÅ¸³À´Ï´Ù.
°Ô´Ù°¡ µ¶ÀϾîÀÇ ¿¹¸¦ ³ªÅ¸³À´Ï´Ù."ca" -> the first key is key('c') and second key is key('a'). "cha" -> the first key is key('ch') and second key is key('a').
¹®ÀÚÀÇ Å°´Â Á¦ 1 ¼ø¼ (short), Á¦ 2 ¼ø¼ (byte), Á¦ 3 ¼ø¼ (byte)·ÎºÎÅÍ µÇ´Â Á¤¼öÀÔ´Ï´Ù. Java ¿¡¼´Â ±× ±âº» µ¥ÀÌÅÍÇüÀÇ »çÀÌÁî¿Í ºÎÈ£ÀÇ À¯¹«°¡ ¾ö¹ÐÇÏ°Ô Á¤Àǵ˴ϴÙ. µû¶ó¼, static ÇÔ¼ö"äb" -> the first key is key('a'), the second key is key('e'), and the third key is key('b').
primaryOrder
, secondaryOrder
, tertiaryOrder
´Â
ŰġÀÇ Á¤È®¼ºÀ» È®º¸Çϱâ À§Çؼ
°¢°¢ int
, short
, short
¸¦ ¸®ÅÏÇÕ´Ï´Ù.
¹Ýº¹ÀÚÀÇ »ç¿ë¿¹
String testString = "This is a test"; RuleBasedCollator ruleBasedCollator = (RuleBasedCollator) Collator.getInstance(); CollationElementIterator collationElementIterator = ruleBasedCollator.getCollationElementIterator(testString); int primaryOrder = CollationElementIterator.primaryOrder(collationElementIterator.next());
CollationElementIterator.next
´Â
´ÙÀ½ÀÇ ¹®ÀÚÀÇ Á¶ÇÕ ¼ø¼¸¦ ¸®ÅÏÇÕ´Ï´Ù. Á¶ÇÕ ¼ø¼´Â Á¦ 1 ¼ø¼, Á¦ 2 ¼ø¼, Á¦ 3 ¼ø¼·ÎºÎÅÍ µË´Ï´Ù. Á¶ÇÕ ¼ø¼ÀÇ µ¥ÀÌÅÍÇüÀº int ÀÔ´Ï´Ù. Á¶ÇÕ ¼ø¼ÀÇ ÃÖÃÊÀÇ 16 ºñÆ®°¡ ±× Á¦ 1 ¼ø¼, ´ÙÀ½ÀÇ 8 ºñÆ®°¡ Á¦ 2 ¼ø¼, ¸¶Áö¸· 8 ºñÆ®°¡ Á¦ 3 ¼ø¼ÀÔ´Ï´Ù.
Collator
,
RuleBasedCollator
ÇÊµå °³¿ä | |
---|---|
static int |
NULLORDER
Ä¿¼°¡ ij¸¯ÅÍ ¶óÀÎÀÇ ¸¶Áö¸·¿¡ À̸¥ °ÍÀ» ³ªÅ¸³»´Â null ¼ø¼ÀÔ´Ï´Ù. |
¸Þ¼µå °³¿ä | |
---|---|
int |
getMaxExpansion (int order)
ÁöÁ¤µÈ ºñ±³ ¼ø¼·Î ³¡³ª´Â ¸ðµç Àü°³ ¼ø¼ÀÇ ÃÖ´ëÀåÀ» ¸®ÅÏÇÕ´Ï´Ù. |
int |
getOffset ()
´ÙÀ½ÀÇ Á¶ÇÕ ¿ä¼Ò¿¡ ´ëÀÀÇÏ´Â ¿øÀÇ ÅØ½ºÆ®³»ÀÇ ¹®ÀÚ ¿ÀÇÁ¼Â(offset)¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
int |
next ()
ij¸¯ÅÍ ¶óÀÎÀÇ ´ÙÀ½ÀÇ Á¶ÇÕ ¿ä¼Ò¸¦ ÃëµæÇÕ´Ï´Ù. |
int |
previous ()
ij¸¯ÅÍ ¶óÀÎÀÇ ÀüÀÇ Á¶ÇÕ ¿ä¼Ò¸¦ ÃëµæÇÕ´Ï´Ù. |
static int |
primaryOrder (int order)
Á¶ÇÕ ¿ä¼ÒÀÇ Á¦ 1 ¼ººÐÀ» ¸®ÅÏÇÕ´Ï´Ù. |
void |
reset ()
Ä¿¼¸¦ ij¸¯ÅÍ ¶óÀÎÀÇ ¼±µÎ¿¡ ¸®¼Â ÇÕ´Ï´Ù. |
static short |
secondaryOrder (int order)
Á¶ÇÕ ¿ä¼ÒÀÇ Á¦ 2 ¼ººÐÀ» ¸®ÅÏÇÕ´Ï´Ù. |
void |
setOffset (int newOffset)
¹Ýº¹ÀÚ°¡ ÁöÁ¤µÈ ¹®ÀÚ¿¡ ´ëÀÀÇÏ´Â Á¶ÇÕ ¿ä¼Ò¸¦ ³ªÅ¸³»µµ·Ï ¼³Á¤ÇÕ´Ï´Ù. |
void |
setText (CharacterIterator source)
¹Ýº¹ ó¸®ÀÇ ´ë»óÀÌ µÇ´Â »õ·Î¿î ij¸¯ÅÍ ¶óÀÎÀ» ¼³Á¤ÇÕ´Ï´Ù. |
void |
setText (String source)
¹Ýº¹ ó¸®ÀÇ ´ë»óÀÌ µÇ´Â »õ·Î¿î ij¸¯ÅÍ ¶óÀÎÀ» ¼³Á¤ÇÕ´Ï´Ù. |
static short |
tertiaryOrder (int order)
Á¶ÇÕ ¿ä¼ÒÀÇ Á¦ 3 ¼ººÐÀ» ¸®ÅÏÇÕ´Ï´Ù. |
Ŭ·¡½º java.lang. Object ·ÎºÎÅÍ »ó¼ÓµÈ ¸Þ¼µå |
---|
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
ÇʵåÀÇ »ó¼¼ |
---|
public static final int NULLORDER
¸Þ¼µåÀÇ »ó¼¼ |
---|
public void reset()
public int next()
ÀÌ ¹Ýº¹ÀÚ´Â ±× ij¸¯ÅÍ ¶óÀÎÀ¸·Î ÀÛ¼ºµÈ Á¶ÇÕ ¿ä¼ÒÀÇ ¼ø¼ ´ëÇØ ¹Ýº¹ 󸮸¦ ½ÇÇàÇÕ´Ï´Ù. ¹®ÀڷκÎÅÍ Á¶ÇÕ ¿ä¼Ò¿¡ÀÇ 1 ´ë 1 ¸ÅÇÎÀÌ ¹Ýµå½Ã Á¸ÀçÇÏÁö ¾Ê±â ¶§¹®¿¡ À̰ÍÀº ¡¸Ä³¸¯ÅÍ ¶óÀÎÀÇ ´ÙÀ½ÀÇ ¹®ÀÚÀÇ Á¶ÇÕ ¿ä¼Ò [¼ø¼ÀÇ ¿ì¼± ¼øÀ§]¸¦ µ¹·ÁÁش١¹Àϰú´Â ´Ù¸¨´Ï´Ù.
ÀÌ ÇÔ¼ö´Â ¹Ýº¹ÀÚ°¡ ÇöÀç °¡¸®Å°°í ÀÖ´Â Á¶ÇÕ ¿ä¼Ò¸¦ µ¹·ÁÁÖ°í ³ª¼, ³»ºÎ Æ÷ÀÎÅ͸¦ °»½ÅÇØ ´ÙÀ½ÀÇ ¿ä¼Ò¸¦ ³ªÅ¸³À´Ï´Ù. ±×¿¡ ´ëÇØ, previous()´Â ÃÖÃÊ·Î Æ÷ÀÎÅ͸¦ °»½ÅÇÏ°í ³ª¼ ¿ä¼Ò¸¦ ¸®ÅÏÇÕ´Ï´Ù. À̰ÍÀº ¹Ýº¹ ó¸®ÁßÀ¸·Î ¹æÇâÀ» º¯°æÇϸé (Áï, next()¸¦ È£ÃâÇÏ°í ³ª¼ previous()¸¦ È£ÃâÇÏ´ÂÁö, previous()¸¦ È£ÃâÇÏ°í ³ª¼ next()¸¦ È£ÃâÇÑ´Ù), °°Àº ¿ä¼Ò¸¦ 2ȸ µÇµ¹¸®´Â °ÍÀ»ÀǹÌÇÕ´Ï´Ù.
public int previous()
ÀÌ ¹Ýº¹ÀÚ´Â ±× ij¸¯ÅÍ ¶óÀÎÀ¸·Î ÀÛ¼ºµÈ Á¶ÇÕ ¿ä¼ÒÀÇ ¼ø¼ ´ëÇØ ¹Ýº¹ 󸮸¦ ½ÇÇàÇÕ´Ï´Ù. ¹®ÀڷκÎÅÍ Á¶ÇÕ ¿ä¼Ò¿¡ÀÇ 1 ´ë 1 ¸ÅÇÎÀÌ ¹Ýµå½Ã Á¸ÀçÇÏÁö ¾Ê±â ¶§¹®¿¡ À̰ÍÀº ¡¸Ä³¸¯ÅÍ ¶óÀÎÀÇ 1°³ ÀüÀÇ ¹®ÀÚÀÇ Á¶ÇÕ ¿ä¼Ò [¼ø¼ÀÇ ¿ì¼± ¼øÀ§]¸¦ µ¹·ÁÁش١¹Àϰú´Â ´Ù¸¨´Ï´Ù.
ÀÌ ÇÔ¼ö´Â ¹Ýº¹ÀÚÀÇ ³»ºÎ Æ÷ÀÎÅ͸¦ °»½ÅÇØ ÇöÀç °¡¸®Å°°í ÀÖ´Â Á¶ÇÕ ¿ä¼ÒÀÇ ÀüÀÇ Á¶ÇÕ ¿ä¼Ò¸¦ ³ªÅ¸³»°í ³ª¼, ¿ä¼Ò¸¦ ¸®ÅÏÇÕ´Ï´Ù. ±×¿¡ ´ëÇØ, next()´Â ÇöÀçÀÇ ¿ä¼Ò¸¦ µ¹·ÁÁÖ°í ³ª¼ Æ÷ÀÎÅ͸¦ °»½ÅÇÕ´Ï´Ù. À̰ÍÀº ¹Ýº¹ ó¸®ÁßÀ¸·Î ¹æÇâÀ» º¯°æÇÏ´Â °æ¿ì (Áï, next()¸¦ È£ÃâÇÏ°í ³ª¼ previous()¸¦ È£ÃâÇÏ´ÂÁö, previous()¸¦ È£ÃâÇÏ°í ³ª¼ next()¸¦ È£ÃâÇÑ´Ù), °°Àº ¿ä¼Ò¸¦ 2ȸ µÇµ¹¸®´Â °ÍÀ»ÀǹÌÇÕ´Ï´Ù.
public static final int primaryOrder(int order)
order
- Á¶ÇÕ ¿ä¼Ò
public static final short secondaryOrder(int order)
order
- Á¶ÇÕ ¿ä¼Ò
public static final short tertiaryOrder(int order)
order
- Á¶ÇÕ ¿ä¼Ò
public void setOffset(int newOffset)
newOffset
- ¿øÀÇ ÅØ½ºÆ®¿¡ÀÇ »õ·Î¿î ¹®ÀÚ ¿ÀÇÁ¼Â(offset)public int getOffset()
public int getMaxExpansion(int order)
order
- previous ¶Ç´Â next°¡ µ¹·ÁÁÖ´Â Á¶ÇÕ ¼ø¼
public void setText(String source)
source
- »õ·Î¿î ¼Ò½º ÅØ½ºÆ®public void setText(CharacterIterator source)
source
- »õ·Î¿î ¼Ò½º ÅØ½ºÆ®
|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
ÀÌÀü Ŭ·¡½º ´ÙÀ½ Ŭ·¡½º | ÇÁ·¹ÀÓÀ¸·Î ÇÁ·¹ÀÓ ¾øÀÌ | |||||||||
°³¿ä: NESTED | Çʵå | constructor¡¡ ¡¡ | ¸Þ¼µå | »ó¼¼: Çʵå | constructor¡¡ ¡¡ | ¸Þ¼µå |
Copyright 2004 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms . Documentation Redistribution Policy µµ ÂüÁ¶ÇϽʽÿÀ.