Package it.univr.di.labeledvalue
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: 993 $
- Author:
- Roberto Posenato
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface it.univr.di.labeledvalue.LabeledIntMap
LabeledIntMap.LabeledIntMapView -
Field Summary
FieldsModifier and TypeFieldDescription(package private) intThe number of elements in the map(package private) static final StringA labeled value as a regular expression.(package private) static final PatternMatcher for a set of labeled values.(package private) booleanOptimize.(package private) static final longSerial number(package private) static final PatternPattern for splitting a set of labeled values.(package private) static final Pattern(package private) static final StringAdmissible values as a regular expression.(package private) static final PatternPattern of valueREStringFields inherited from interface it.univr.di.labeledvalue.LabeledIntMap
entryComparator -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static StringentryAsString(it.unimi.dsi.fastutil.objects.Object2IntMap.Entry<Label> entry) static StringentryAsString(Label label, int value) booleaninthashCode()booleanisEmpty()static LabeledIntMapstatic LabeledIntMapparse(String inputMap, Class<? extends LabeledIntMap> labeledIntMapClass) Parse a string representing a LabeledValueTreeMap and return an object containing the labeled values represented by the string.intsize()toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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 a regular expression. For now, only integers!- See Also:
-
valueREPattern
Pattern of valueREString -
labeledValueRE
A labeled value as a regular expression. -
labeledValueSetREPattern
Matcher for a set of labeled values. WARNING: After some tests, I verified that this pattern cannot be used because it is too 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 some 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'. The default is true.
-
-
Constructor Details
-
AbstractLabeledIntMap
public AbstractLabeledIntMap()
-
-
Method Details
-
entryAsString
- Parameters:
entry- (label, value)- Returns:
- string representing the labeled value, i.e., "(value, label)"
-
entryAsString
- Parameters:
label- must not be null!value- the value to represent- Returns:
- string representing the labeled value, i.e., "(value, label)"
-
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 method
toString(): {\[(<value>, <key>) \]*}.This method is also capable of parsing the old format: {\[(<key>, <value>) \]*}
- Parameters:
inputMap- aStringobject.labeledIntMapClass- the class to manage the labeled values- Returns:
- a LabeledValueTreeMap object if
inputMaprepresents a valid map, null otherwise.
-
equals
-
hashCode
public int hashCode() -
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceLabeledIntMap- Returns:
- true if the map has no elements.
-
size
public int size()- Specified by:
sizein interfaceLabeledIntMap- Returns:
- the number of labeled values (value with empty label included).
- See Also:
-
toString
-