Package VASSAL.build.module
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
Nested ClassesModifier and TypeClassDescriptionprotected classCompare two CounterNodes based on the alphanumerical order of their SortKeys.protected classBase class for comparing two CounterNodes.protected classCompare two CounterNodes based on the length of their SortKeys and alphanumerical sorting.protected classCompare two CounterNodes based on the first integer value found in their SortKeys. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected List<Inventory.CounterNode>protected final Inventory.Counterprotected final Stringprotected int -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCounterNode(String entry, Inventory.Counter counter) CounterNode(String entry, Inventory.Counter counter, int level) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddChild(int i, Inventory.CounterNode counterNode, boolean sort) voidaddChild(Inventory.CounterNode counterNode, boolean sort) intCompare this CounterNode to another one based on the respective SortKeys.voidvoidcutLevel(int cut) getChild(int index) intgetEntry()intgetIndexOfChild(Object child) intgetLevel()booleanisLeaf()iterator()voidremoveChild(Inventory.CounterNode child) protected StringPlaces a separator between elements.voidsetLevel(int level) protected voidprotected StringSort 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:
compareToin 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
-