Class Inventory.CounterNode
java.lang.Object
VASSAL.build.module.Inventory.CounterNode
- All Implemented Interfaces:
Comparable<Inventory.CounterNode>
- Enclosing class:
Inventory
CounterNode for the result tree.
- Author:
- spindler
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected class
Compare two CounterNodes based on the alphanumerical order of their SortKeys.protected class
Base class for comparing two CounterNodes.protected class
Compare two CounterNodes based on the length of their SortKeys and alphanumerical sorting.protected class
Compare two CounterNodes based on the first integer value found in their SortKeys. -
Field Summary
Modifier and TypeFieldDescriptionprotected List
<Inventory.CounterNode> protected final Inventory.Counter
protected final String
protected int
-
Constructor Summary
ModifierConstructorDescriptionprotected
CounterNode
(String entry, Inventory.Counter counter) CounterNode
(String entry, Inventory.Counter counter, int level) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addChild
(int i, Inventory.CounterNode counterNode, boolean sort) void
addChild
(Inventory.CounterNode counterNode, boolean sort) int
Compare this CounterNode to another one based on the respective SortKeys.void
void
cutLevel
(int cut) getChild
(int index) int
getEntry()
int
getIndexOfChild
(Object child) int
getLevel()
boolean
isLeaf()
iterator()
void
removeChild
(Inventory.CounterNode child) protected String
Places a separator between elements.void
setLevel
(int level) protected void
protected String
Sort this CounterNode by the counters key, if no counter use the label.toString()
int
-
Field Details
-
entry
-
counter
-
children
-
level
protected int level
-
-
Constructor Details
-
CounterNode
-
CounterNode
-
-
Method Details
-
toString
-
separator
Places a separator between elements. The separator consists of an indent and a linebreak.- Returns:
-
toResultString
-
getEntry
-
getCounter
-
addChild
-
addChild
-
sortChildren
protected void sortChildren() -
removeChild
-
getChildCount
public int getChildCount() -
isLeaf
public boolean isLeaf() -
getChild
-
getIndexOfChild
-
getLevel
public int getLevel() -
setLevel
public void setLevel(int level) -
updateValues
public int updateValues() -
iterator
-
cutLevel
public void cutLevel(int cut) -
cutLeaves
public void cutLeaves() -
compareTo
Compare this CounterNode to another one based on the respective SortKeys.- Specified by:
compareTo
in interfaceComparable<Inventory.CounterNode>
-
toSortKey
Sort this CounterNode by the counters key, if no counter use the label. If no children, use the name of the counterNode, probably could be $PropertyValue$ as well?- Returns:
- key as String
-