Package VASSAL.build.module
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
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcompare(Inventory.CounterNode left, Inventory.CounterNode right)Compare two CounterNodes based on the first integer found in their SortKeys.protected intGet first integer in key, if any.Methods inherited from class VASSAL.build.module.Inventory.CounterNode.CompareCounterNodes
argsOK, compareStrangeArgsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Field Details
-
regex
- See Also:
- Constant Field Values
-
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:
comparein interfaceComparator<Inventory.CounterNode>
-