Class Inventory.CounterNode.Numerical
java.lang.Object
VASSAL.build.module.Inventory.CounterNode.CompareCounterNodes
VASSAL.build.module.Inventory.CounterNode.Numerical
- All Implemented Interfaces:
Comparator<Inventory.CounterNode>
- Enclosing class:
Inventory.CounterNode
protected class Inventory.CounterNode.Numerical
extends Inventory.CounterNode.CompareCounterNodes
implements Comparator<Inventory.CounterNode>
Compare two CounterNodes based on the first integer value found in
their SortKeys. If a CounterNodes SortKey does not contain an integer
at all it is assigned the lowest available integer.
- Author:
- spindler
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
compare
(Inventory.CounterNode left, Inventory.CounterNode right) Compare two CounterNodes based on the first integer found in their SortKeys.protected int
Get first integer in key, if any.Methods inherited from class VASSAL.build.module.Inventory.CounterNode.CompareCounterNodes
argsOK, compareStrangeArgs
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Field Details
-
regex
- See Also:
-
p
-
-
Constructor Details
-
Numerical
protected Numerical()
-
-
Method Details
-
getInt
Get first integer in key, if any. Otherwise return lowest possible integer.- Parameters:
key
- is a string that may or may not contain an integer value- Returns:
- the value of the integer found, min(Integer) otherwise
-
compare
Compare two CounterNodes based on the first integer found in their SortKeys.- Specified by:
compare
in interfaceComparator<Inventory.CounterNode>
-