|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.crosswire.jsword.passage.AbstractKeyList
org.crosswire.jsword.passage.TreeKey
public class TreeKey
A Key that knows where the data is in the real file.
The GNU Lesser General Public License for details.
,
Serialized FormNested Class Summary |
---|
Nested classes/interfaces inherited from class org.crosswire.jsword.passage.AbstractKeyList |
---|
AbstractKeyList.NameVisitor, AbstractKeyList.OsisIDVisitor, AbstractKeyList.OsisRefVisitor |
Field Summary | |
---|---|
private List<Key> |
children
The immediate children of this tree node. |
private static org.slf4j.Logger |
log
The log stream |
private Key |
parent
The parent of this key. |
private static long |
serialVersionUID
Serialization ID |
Constructor Summary | |
---|---|
TreeKey(String text)
Setup with the key name. |
|
TreeKey(String name,
Key parent)
Setup with the key name and positions of data in the file |
Method Summary | |
---|---|
void |
addAll(Key key)
Adds the specified element to this set if it is not already present. |
void |
blur(int by,
RestrictionType restrict)
Widen the range of the verses/keys in this list. |
boolean |
canHaveChildren()
Returns false if the receiver is a leaf node and can not have children. |
void |
clear()
Removes all of the elements from this set (optional operation). |
TreeKey |
clone()
This needs to be declared here so that it is visible as a method on a derived Key. |
boolean |
contains(Key key)
Returns true if this set contains the specified element. |
boolean |
equals(Object obj)
equality is tricky if comparing TreeKeys (as used by GenBooks) because some child keys can have the same name but different parents |
Key |
get(int index)
Gets a key from a specific point in this list of children. |
int |
getCardinality()
Returns the number of elements in this set (its cardinality). |
int |
getChildCount()
Returns the number of children that this node has. |
String |
getOsisID()
The OSIS defined id specification for this Key. |
String |
getOsisRef()
The OSIS defined reference specification for this Key. |
Key |
getParent()
All keys have parents unless they are the root of a Key. |
String |
getRootName()
A Human readable version of the Key's top level name. |
int |
indexOf(Key that)
Reverse a Key into the position the key holds in the list of children |
boolean |
isEmpty()
Does this Key have 0 members |
Iterator<Key> |
iterator()
|
void |
removeAll(Key key)
Removes the specified elements from this set if it is present. |
Methods inherited from class org.crosswire.jsword.passage.AbstractKeyList |
---|
compareTo, getName, getName, hashCode, retain, retainAll, setName, toString |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private Key parent
private List<Key> children
private static final org.slf4j.Logger log
private static final long serialVersionUID
Constructor Detail |
---|
public TreeKey(String name, Key parent)
name
- the key for this TreeKeyparent
- the parent node for this TreeKeypublic TreeKey(String text)
text
- the key for this TreeKeyMethod Detail |
---|
public boolean canHaveChildren()
Key
public int getChildCount()
Key
public int getCardinality()
Key
This method is potentially expensive, as it often requires cycling through all the keys in the set.
public boolean isEmpty()
Key
isEmpty
in interface Key
isEmpty
in class AbstractKeyList
public boolean contains(Key key)
Key
contains
in interface Key
contains
in class AbstractKeyList
key
- element whose presence in this set is to be tested.
public Iterator<Key> iterator()
public void addAll(Key key)
Key
key
- element to be added to this set.public void removeAll(Key key)
Key
key
- object to be removed from this set, if present.public void clear()
Key
public Key get(int index)
Key
index
- The index of the Key to retrieve
public int indexOf(Key that)
Key
that
- The Key to find
public Key getParent()
Key
public boolean equals(Object obj)
equals
in interface Key
equals
in class AbstractKeyList
public void blur(int by, RestrictionType restrict)
Key
by
- The number of verses/keys to widen byrestrict
- How should we restrict the blurring?Passage
public TreeKey clone()
Key
clone
in interface Key
clone
in class AbstractKeyList
public String getRootName()
Key
getRootName
in interface Key
getRootName
in class AbstractKeyList
public String getOsisRef()
Key
getOsisRef
in interface Key
getOsisRef
in class AbstractKeyList
public String getOsisID()
Key
getOsisID
in interface Key
getOsisID
in class AbstractKeyList
|
Copyright ยจ 2003-2015 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |