|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectti.chimera.registry.DirectoryTable
A directory node is simply a regular node whose contents is a directory
table. A directory table is an immutable table, which maps node names to
nodes. A directory table can only be created empty, and only way to
mutate one (ie. add or remove a child) is by using the #add
or
#remove
methods, which return a new directory table. The table
also implements notIn(ti.chimera.registry.DirectoryTable)
to compare two directory tables and
determine the differences between the two. (Note the notIn(ti.chimera.registry.DirectoryTable)
comparision does not need to be made between successive versions of a
directory table, but can be made between arbitrary directory tables.)
The directory table is mainly used internally by the registry.
Note that the current table implementation isn't particularly clever
and basically all operations are O(n) where n is number of children,
except notIn(ti.chimera.registry.DirectoryTable)
which is O(n^2).
Constructor Summary | |
DirectoryTable()
Class Constructor, create an empty directory table. |
Method Summary | |
Node |
get(java.lang.String name)
Get the node in this table with the specified name. |
int |
getChildCount()
Get the number of children of this directory node. |
java.util.Iterator |
getChildNames()
Get an iterator of child names of the contents of this directory. |
java.util.Iterator |
notIn(DirectoryTable otherTable)
Determine the differences between directory tables, by returning an array of files that are only contained in this table. |
java.lang.String |
toString()
for debug... |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public DirectoryTable()
Method Detail |
public java.util.Iterator getChildNames()
public int getChildCount()
#getChildName
,
#getChildNode
public Node get(java.lang.String name)
null
if none.
name
- name of node to find
null
if nonepublic java.util.Iterator notIn(DirectoryTable otherTable)
Iterator added = newDirTable.notIn(oldDirTable); Iterator removed = oldDirTable.notIn(newDirTable);If
otherTable
is null
, this returns
the same thing as getChildNames()
.
otherTable
- the other table to compare to, or null
otherTable
public java.lang.String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |