public class DefaultLeafKeyList extends Object implements Key
The GNU Lesser General Public License for details.
,
Serialized FormModifier and Type | Field and Description |
---|---|
private String |
name
The human readable string that this key represents
|
private String |
osisName
The OSIS version of this Key
|
private Key |
parent
The parent of this key
|
private static long |
serialVersionUID |
Constructor and Description |
---|
DefaultLeafKeyList(String name)
Default ctor
|
DefaultLeafKeyList(String name,
String osisName)
Default ctor
|
DefaultLeafKeyList(String name,
String osisName,
Key parent)
Default ctor
|
Modifier and Type | Method and Description |
---|---|
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).
|
DefaultLeafKeyList |
clone()
This needs to be declared here so that it is visible as a method on a
derived Key.
|
int |
compareTo(Key obj) |
boolean |
contains(Key key)
Returns true if this set contains the specified element.
|
boolean |
equals(Object obj)
This needs to be declared here so that it is visible as a method on a
derived Key.
|
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 |
getName()
A Human readable version of the Key.
|
String |
getName(Key base)
Translate the Key into a human readable string, with the assumption that
the specified Key has just been output, so if we are in the same region,
we do not need to display the region name, and so on.
|
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 |
hashCode()
This needs to be declared here so that it is visible as a method on a
derived Key.
|
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.
|
void |
retainAll(Key key)
Removes all but the specified element from this set.
|
String |
toString() |
private Key parent
private String name
private String osisName
private static final long serialVersionUID
public DefaultLeafKeyList(String name)
name
- public DefaultLeafKeyList(String name, String osisName)
name
- osisName
- public boolean canHaveChildren()
Key
canHaveChildren
in interface Key
public int getChildCount()
Key
getChildCount
in interface Key
public String getName()
Key
public String getName(Key base)
Key
public String getRootName()
Key
getRootName
in interface Key
public String getOsisRef()
Key
getOsisRef
in interface Key
public String getOsisID()
Key
public Key getParent()
Key
public int getCardinality()
Key
This method is potentially expensive, as it often requires cycling through all the keys in the set.
getCardinality
in interface Key
public boolean isEmpty()
Key
public boolean contains(Key key)
Key
public void addAll(Key key)
Key
public void removeAll(Key key)
Key
public void retainAll(Key key)
Key
public void clear()
Key
public Key get(int index)
Key
public int indexOf(Key that)
Key
public void blur(int by, RestrictionType restrict)
Key
public boolean equals(Object obj)
Key
public int hashCode()
Key
public int compareTo(Key obj)
compareTo
in interface Comparable<Key>