Class AbstractLabeledIntMap
java.lang.Object
it.univr.di.labeledvalue.AbstractLabeledIntMap
- All Implemented Interfaces:
LabeledIntMap
,Serializable
- Direct Known Subclasses:
LabeledIntHierarchyMap
,LabeledIntSimpleMap
,LabeledIntTreeMap
Abstract class for
LabeledIntMap
interface.- Version:
- $Rev: 851 $
- Author:
- Roberto Posenato
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface it.univr.di.labeledvalue.LabeledIntMap
LabeledIntMap.LabeledIntMapView
-
Field Summary
Modifier and TypeFieldDescription(package private) int
The number of elements in the map(package private) static final String
A labeled value as regular expression.(package private) static final Pattern
Matcher for a set of labeled values.(package private) boolean
Optimize In same applications it is important to maintain ¬C,0 and C,1.(package private) static final long
Serial number(package private) static final Pattern
Pattern for splitting a set of labeled values.(package private) static final Pattern
(package private) static final String
Admissible values as regular expression.(package private) static final Pattern
Pattern of valueREStringFields inherited from interface it.univr.di.labeledvalue.LabeledIntMap
entryComparator
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription(package private) static String
entryAsString
(it.unimi.dsi.fastutil.objects.Object2IntMap.Entry<Label> entry) static String
entryAsString
(Label label, int value) boolean
int
hashCode()
boolean
isEmpty()
static LabeledIntMap
static LabeledIntMap
parse
(String inputMap, Class<? extends LabeledIntMap> labeledIntMapClass) Parse a string representing a LabeledValueTreeMap and return an object containing the labeled values represented by the string.int
size()
toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface it.univr.di.labeledvalue.LabeledIntMap
alreadyRepresents, clear, entrySet, get, getMaxValue, getMaxValueSubsumedBy, getMinLabeledValue, getMinValue, getMinValueAmongLabelsWOUnknown, getMinValueConsistentWith, getMinValueSubsumedBy, keySet, newInstance, newInstance, newInstance, newInstance, put, putAll, putForcibly, remove, unmodifiable, values
-
Field Details
-
valueRE
Admissible values as regular expression. For now, only integer!- See Also:
-
valueREPattern
Pattern of valueREString -
labeledValueRE
A labeled value as regular expression. -
labeledValueSetREPattern
Matcher for a set of labeled values. WARNING: After some test, I verified that this pattern cannot be used because it is too much time-consuming.
I maintain it as a check in some tests. -
serialVersionUID
static final long serialVersionUIDSerial number- See Also:
-
splitterEntryPattern
Pattern for splitting a set of labeled values. -
splitterPair
-
count
int countThe number of elements in the map -
optimize
boolean optimizeOptimize In same applications it is important to maintain ¬C,0 and C,1. The optimization would reduce them to ⊡,0 and C,1. So, set false optimized to maintain ¬C,0 and C,1. Default is true.
-
-
Constructor Details
-
AbstractLabeledIntMap
public AbstractLabeledIntMap()
-
-
Method Details
-
entryAsString
-
entryAsString
-
parse
- Parameters:
inputMap
- the string representing a set of labeled values- Returns:
- a new labeled int map object
- See Also:
-
parse
@Nullable public static LabeledIntMap parse(String inputMap, Class<? extends LabeledIntMap> labeledIntMapClass) Parse a string representing a LabeledValueTreeMap and return an object containing the labeled values represented by the string.
The format of the string is given by the methodtoString()
: {\[(<value>, <key>) \]*}.
This method is also capable to parse the old format: {\[(<key>, <value>) \]*}- Parameters:
inputMap
- aString
object.labeledIntMapClass
- the class to manage the labeled values- Returns:
- a LabeledValueTreeMap object if
inputMap
represents a valid map, null otherwise.
-
equals
-
hashCode
-
isEmpty
public boolean isEmpty()- Specified by:
isEmpty
in interfaceLabeledIntMap
- Returns:
- true if the map has no elements.
-
size
public int size()- Specified by:
size
in interfaceLabeledIntMap
- Returns:
- the number of labeled value (value with empty label included).
- See Also:
-
toString
-