|
GeoSoft API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object | +--DirectoryEntry | +--Folder
A class representing a generic folder node within a directory structure. A folder may contain DirectoryEnty children and may have a client specified item back-end object.
Constructor Summary | |
Folder()
Create a namelsee and itemless folder entry. |
|
Folder(Object item)
Create a folder with name according to item toString(). |
|
Folder(Object item,
String name)
Create a new folder entry. |
Method Summary | |
void |
add(Collection entries)
Add a set of entries to this folder. |
void |
add(DirectoryEntry entry)
Add an entry to the end of this folder. |
void |
add(DirectoryEntry entry,
int index)
Add an entry to this folder at a specific position. |
void |
addSorted(Collection entries)
Add a set of entries sorted alphabetically according to the entries' toString() method. |
void |
addSorted(DirectoryEntry entry)
Add an entry sorted alphabetically according to the entrys toString() method. |
void |
collapse()
Identify this folder as "collapsed". |
void |
collapseAll()
Identify this folder and all sub folders as "collapsed". |
boolean |
contains(DirectoryEntry entry)
Recursively check if an entry is descendant of this folder. |
void |
expand()
Identify this folder as "expanded". |
void |
expandAll()
Identify this folder and all sub folders as "expanded". |
DirectoryEntry |
find(String name)
Find a given node among the immediate children of this folder. |
DirectoryEntry |
findEntry(Object item)
Return entry based on item value. |
Folder |
findFolder(Object item)
Return sub folder based on item value. |
Folder |
findFolder(String name)
Find a given folder among the immediate children of this folder. |
DirectoryEntry |
findGlobal(String name)
Find a given node within the entire subtree of this folder. |
List |
getEntries()
Get the entries of this folder. |
DirectoryEntry |
getEntry(int index)
Return the child entry at the specific position. |
DirectoryEntry |
getGlobalEntry(int entryNo)
Staring from this node, return the index'th element in the tree, traversing depth first. |
int |
getGlobalIndexOfEntry(DirectoryEntry entry)
Starting from here, return the entry number of the specified entry traversing depth first. |
int |
getIndexOfEntry(DirectoryEntry entry)
Return position of the specified entry. |
int |
getNEntries()
Return number of entries in this folder. |
boolean |
isEmpty()
Check if the folder is empty (has no children). |
boolean |
isLeaf()
Return true if this is a leaf node. |
boolean |
isRoot()
Return true if this is a root node. |
void |
print(int indent)
|
void |
remove(DirectoryEntry entry)
Remove entry from this folder. |
Methods inherited from class DirectoryEntry |
compareTo, equals, getItem, getName, getParent, getPath, isFolder, setItem, setName, toString |
Methods inherited from class Object |
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Folder(Object item, String name)
item
- Client specific item of the folder.name
- Name of the folder.public Folder(Object item)
item
- Client specific item of the folder.public Folder()
Method Detail |
public void add(DirectoryEntry entry, int index)
entry
- Entry to add.index
- Entry position, 0 is first, etc.public void add(DirectoryEntry entry)
entry
- Entry to add.public void add(Collection entries)
entries
- Entries to add.public void addSorted(DirectoryEntry entry)
entry
- Entry to add.public void addSorted(Collection entries)
public void remove(DirectoryEntry entry)
entry
- Entry to remove.public boolean isLeaf()
isLeaf
in class DirectoryEntry
public boolean isRoot()
public DirectoryEntry getEntry(int index)
index
- Position of entry to return.
public DirectoryEntry getGlobalEntry(int entryNo)
entryNo
- Entry number to find.
public int getGlobalIndexOfEntry(DirectoryEntry entry)
entry
- Entry to find entry number of.
public int getIndexOfEntry(DirectoryEntry entry)
entry
- Entry to find index of.
public boolean isEmpty()
public int getNEntries()
public List getEntries()
public boolean contains(DirectoryEntry entry)
entry
- Entry to check.
public DirectoryEntry find(String name)
name
- Name of child to find.
public DirectoryEntry findGlobal(String name)
name
- Name of node to find.
public Folder findFolder(String name)
name
- Name of folder to find.
public Folder findFolder(Object item)
item
- Item of the folder to find.
public DirectoryEntry findEntry(Object item)
item
- Item of the entry to find.
public void expand()
public void expandAll()
public void collapse()
public void collapseAll()
public void print(int indent)
print
in class DirectoryEntry
|
GeoSoft API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |