|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
ÀÌÀü Ŭ·¡½º ´ÙÀ½ Ŭ·¡½º | ÇÁ·¹ÀÓÀ¸·Î ÇÁ·¹ÀÓ ¾øÀÌ | |||||||||
°³¿ä: NESTED | Çʵå | constructor | ¸Þ¼µå | »ó¼¼: Çʵå | »ý¼ºÀÚ | ¸Þ¼µå |
java.lang.Objectjavax.swing.tree.TreePath
public class TreePath
³ëµå¿¡ÀÇ ÆÐ½º¸¦ ³ªÅ¸³À´Ï´Ù. TreePath¿Í´Â TreeModel ·ÎºÎÅÍ »ý¼ºµÇ´Â Object ¹è¿ÀÔ´Ï´Ù. ¹è¿ÀÇ ¿ä¼Ò´Â Ç×»ó ·çÆ®°¡ ¹è¿ÀÇ ¼±µÎÀÇ ¿ä¼Ò (À妽º 0)°¡ µÇµµ·Ï Á¤·Ä µË´Ï´Ù. TreePath´Â Serializable ÀÔ´Ï´Ù¸¸, ÆÐ½ºÀÇ ÄÄÆÛ³ÍÆ®°¡ Á÷·ÄÈ °¡´ÉÇÏÁö ¾ÊÀº °æ¿ì´Â ½á³»ÁöÁö ¾Ê½À´Ï´Ù.
Æ®¸® ÆÐ½ºÀÇ »ó¼¼ ¹× »ç¿ë¿¹´Â ¡¸The Java Tutorial¡¹ÀÇ ¡¸How to Use Trees¡¹¼½¼ÇÀ» ÂüÁ¶ÇϽʽÿÀ.
°æ°í: ÀÌ Å¬·¡½ºÀÇ Á÷·ÄÈ µÈ °´Ã¼´Â ÇâÈÄÀÇ Swing ¸±¸®Áî¿Í
ȣȯµÇÁö ¾ÊÀ» ¿¹Á¤ÀÔ´Ï´Ù. ÇöÀçÀÇ Á÷·ÄÈÀÇ Áö¿øÀº
´Ü±â°£ÀÇ ¿î¿ëÀ̳ª, °°Àº ¹öÀüÀÇ Swing¸¦ ½ÇÇàÇÏ´Â ¾îÇø®ÄÉÀ̼ǰ£ÀÇ RMI¿¡ ÀûÀýÇϰí ÀÖ½À´Ï´Ù. JDK ¹öÀü
1.4 ÀÌÈÄ, ¸ðµç JavaBeans™
Àå±â°£ÀÇ ¿î¿ë Áö¿øÀº
java.beans
ÆÐŰÁö¿¡ Ãß°¡µÇ°í ÀÖ½À´Ï´Ù. ÀÚ¼¼ÇÑ ³»¿ëÀº XMLEncoder
¸¦
ÂüÁ¶ÇϽʽÿÀ.
»ý¼ºÀÚ °³¿ä | |
---|---|
protected |
TreePath ()
ÁÖ·Î ÆÐ½º¸¦ ´Ù¾çÇÑ ¹æ¹ýÀ¸·Î ³ªÅ¸³»´Â ¼ºê Ŭ·¡½º¿ëÀ¸·Î Á¦°øµË´Ï´Ù. |
|
TreePath (Object singlePath)
´ÜÀÏ ¿ä¼Ò¸¸À» °¡Áö´Â TreePath¸¦ ±¸ÃàÇÕ´Ï´Ù. |
|
TreePath (Object [] path)
Object ¹è¿·ÎºÎÅÍ ÆÐ½º¸¦ ±¸ÃàÇØ, Æ®¸®ÀÇ µ¥ÀÌÅÍ ¸ðµ¨¿¡ ÀÇÇØ ¸®ÅÏµÈ Æ®¸®ÀÇ ·çÆ®·ÎºÎÅÍ Æ¯Á¤ÀÇ ³ëµå±îÁöÀÇ ÆÐ½º¸¦ ÀÏÀÇ¿¡ ½Äº°ÇÕ´Ï´Ù. |
protected |
TreePath (Object [] path,
int length)
±æÀÌ length
½Äº° ÆÄ½ºÄÜÆ÷³ÙÆ®°¡ ÀÖ´Â »õ·Î¿î TreePath¸¦ ±¸ÃàÇÕ´Ï´Ù. |
protected |
TreePath (TreePath parent,
Object lastElement)
lastElement ·Î
Á¾·áÇÏ´Â parent ÀÌ ½Äº°ÇÏ´Â ÆÐ½ºÀÎ, »õ·Î¿î TreePath¸¦ ±¸ÃàÇÕ´Ï´Ù. |
¸Þ¼µå °³¿ä | |
---|---|
boolean |
equals (Object o)
°¢ ÆÐ½ºÀÇ ¿ä¼Ò°¡ °°Àº°¡ ¾î¶²°¡¸¦ ÆÇÁ¤ÇØ, 2°³ÀÇ TreePath°¡ °°Àº°¡ ¾î¶²°¡¸¦ ÆÇÁ¤ÇÕ´Ï´Ù. |
Object |
getLastPathComponent ()
ÀÌ ÆÐ½ºÀÇ ¸»¹Ì ÄÄÆÛ³ÍÆ®¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
TreePath |
getParentPath ()
°´Ã¼ÀÇ ¸ðµç ¿ä¼Ò¸¦ Æ÷ÇÔÇÏ´Â ÆÐ½º¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
Object [] |
getPath ()
ÀÌ TreePath ÄÄÆÛ³ÍÆ®¸¦ Æ÷ÇÔÇÏ´Â Object ¼ø¼ ÷ºÎ ¹è¿À» ¸®ÅÏÇÕ´Ï´Ù. |
Object |
getPathComponent (int element)
ÁöÁ¤µÈ À妽º¿¡ ÀÖ´Â ÆÄ½ºÄÜÆ÷³ÙÆ®¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
int |
getPathCount ()
ÆÐ½º³»ÀÇ ¿ä¼Ò¼ö¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
int |
hashCode ()
°´Ã¼ÀÇ hashCode¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
boolean |
isDescendant (TreePath aTreePath)
aTreePath °¡ ÀÌ TreePath
ÇÏÀ§ °´Ã¼ÀÎ °æ¿ì´Â true¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
TreePath |
pathByAddingChild (Object child)
ÀÌ °´Ã¼ÀÇ ¸ðµç ¿ä¼Ò¿¡ ´õÇØ child
¿ä¼Ò¸¦ Æ÷ÇÔÇÏ´Â »õ·Î¿î ÆÐ½º¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
String |
toString ()
ÀÌ °´Ã¼ÀÇ ÇÁ·ÎÆÛƼ¸¦ Ç¥½Ã ¹× ½Äº°Çϴ ij¸¯ÅÍ ¶óÀÎÀ» ¸®ÅÏÇÕ´Ï´Ù. |
Ŭ·¡½º java.lang. Object ·ÎºÎÅÍ »ó¼ÓµÈ ¸Þ¼µå |
---|
clone,
finalize,
getClass,
notify,
notifyAll,
wait,
wait,
wait |
»ý¼ºÀÚ »ó¼¼ |
---|
public TreePath(Object [] path)
¸ðµ¨Àº ±×°ÍÀÌ ÆÐ½º¸¦ ³ªÅ¸³»´Âµ¥ ÇÊ¿ä·Î ÇÏ´Â ÀÓÀÇÀÇ Object ¹è¿À» ÀÚÀ¯·Ó°Ô ¸®ÅÏÇÕ´Ï´Ù. DefaultTreeModel´Â TreeNode °´Ã¼ÀÇ ¹è¿À» ¸®ÅÏÇÕ´Ï´Ù. ÆÐ½ºÀÇ ÃÖÃÊÀÇ TreeNode´Â Æ®¸®ÀÇ ·çÆ®·Î ¸¶Áö¸· TreeNode´Â ÆÐ½º·Î ½Äº°µÇ´Â ³ëµåÀÔ´Ï´Ù.
path
- ³ëµå¿¡ÀÇ ÆÐ½º¸¦ ³ªÅ¸³»´Â Object
¹è¿public TreePath(Object singlePath)
singlePath
- ³ëµå¿¡ÀÇ ÆÐ½º¸¦ ³ªÅ¸³»´Â ObjectTreePath(Object[])
protected TreePath(TreePath parent, Object lastElement)
lastElement
·Î
Á¾·áÇÏ´Â parent
ÀÌ ½Äº°ÇÏ´Â ÆÐ½ºÀÎ, »õ·Î¿î TreePath¸¦ ±¸ÃàÇÕ´Ï´Ù.
protected TreePath(Object [] path, int length)
length
½Äº° ÆÄ½ºÄÜÆ÷³ÙÆ®°¡ ÀÖ´Â »õ·Î¿î TreePath¸¦ ±¸ÃàÇÕ´Ï´Ù.
protected TreePath()
getPath
, getPathCount
, code>getPathComponent, °æ¿ì¿¡ µû¶ó¼´Â equals
¸Þ¼µå¸¦ ¿À¹ö¶óÀ̵å(override) ÇÒ Çʿ䰡 ÀÖ½À´Ï´Ù.
¸Þ¼µåÀÇ »ó¼¼ |
---|
public Object [] getPath()
TreePath(Object[])
public Object getLastPathComponent()
TreePath(Object[])
public int getPathCount()
public Object getPathComponent(int element)
element
- ÆÐ½º³»ÀÇ ¿ä¼Ò¸¦ ÁöÁ¤ÇÏ´Â int°ª
. ´Ù¸¸, ÆÐ½ºÀÇ ÃÖÃÊÀÇ ¿ä¼Ò´Â 0
IllegalArgumentException
- À妽º°¡ ÆÐ½ºÀÇ ±æÀ̸¦ ³Ñ´Â °æ¿ìTreePath(Object[])
public boolean equals(Object o)
. equals
)´Â 2 »ìÀÇ ÆÐ½º´Â µ¿µîÀ̶ó°í º¸¿©Áý´Ï´Ù.
Object
³»ÀÇ equals
o
- ºñ±³ ´ë»óÀÇ Object
true
, ±×·¸Áö ¾ÊÀº °æ¿ì´Â false
Object.hashCode()
,
Hashtable
public int hashCode()
Object
³»ÀÇ hashCode
Object.equals(java.lang.Object)
,
Hashtable
public boolean isDescendant(TreePath aTreePath)
aTreePath
°¡ ÀÌ TreePath
ÇÏÀ§ °´Ã¼ÀÎ °æ¿ì´Â true¸¦ ¸®ÅÏÇÕ´Ï´Ù. P1°¡ P2
ÆÐ½º¸¦ ±¸¼ºÇÏ´Â ¸ðµç ÄÄÆÛ³ÍÆ®¸¦ Æ÷ÇÔÇϰí ÀÖ´Â °æ¿ì´Â TreePath P1´Â TreePath P2
ÇÏÀ§ °´Ã¼°¡ µË´Ï´Ù. ¿¹¸¦ µé¾îÀÌ °´Ã¼¿¡ ÆÐ½º [a, b]°¡ ÀÖ¾î, aTreePath
¿¡ ÆÐ½º [a, b, c]°¡ ÀÖ´Â °æ¿ì´Â aTreePath
´Â ÀÌ °´Ã¼ÀÇ ÇÏÀ§ °´Ã¼°¡ µË´Ï´Ù. ´Ù¸¸, aTreePath
¿¡ ÆÐ½º [a]°¡ ÀÖ´Â °æ¿ì´Â ÀÌ °´Ã¼ÀÇ ÇÏÀ§ °´Ã¼°¡ ¾Æ´Õ´Ï´Ù.
aTreePath
°¡ ÀÌ ÆÐ½ºÀÇ ÇÏÀ§ °´Ã¼ÀÎ °æ¿ì´Â truepublic TreePath pathByAddingChild(Object child)
child
¿ä¼Ò¸¦ Æ÷ÇÔÇÏ´Â »õ·Î¿î ÆÐ½º¸¦ ¸®ÅÏÇÕ´Ï´Ù. child
´Â »õ·Ó°Ô »ý¼ºµÈ TreePath
¸¶Áö¸· ¿ä¼Ò°¡ µË´Ï´Ù. ÀÚ½ÄÀÌ nullÀÎ °æ¿ì´Â NullPointerExceptionÀ»
Throw ÇÕ´Ï´Ù.
public TreePath getParentPath()
public String toString()
Object
³»ÀÇ toString
|
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 µµ ÂüÁ¶ÇϽʽÿÀ.