Class LabeledIntSimpleMap
java.lang.Object
it.univr.di.labeledvalue.AbstractLabeledIntMap
it.univr.di.labeledvalue.LabeledIntSimpleMap
- All Implemented Interfaces:
LabeledIntMap, Serializable
- Direct Known Subclasses:
LabeledIntSimpleMap.LabeledIntNotMinMapView
Deprecated.
Simple implementation of
LabeledIntMap interface without minimization.
This class is provided only to give evidence that, without minimizing the labeled value sets, any CSTN algorithm can be very slow.- Version:
- $Rev: 993 $
- Author:
- Roberto Posenato
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classDeprecated.Nested classes/interfaces inherited from interface LabeledIntMap
LabeledIntMap.LabeledIntMapViewModifier and TypeInterfaceDescriptionstatic interfaceA read-only view of an object -
Field Summary
FieldsModifier and TypeFieldDescription(package private) it.unimi.dsi.fastutil.objects.Object2IntMap<Label> Deprecated.Map of label(package private) final it.unimi.dsi.fastutil.objects.Object2IntMap<Label> Deprecated.Counter of labeled value updates.Fields inherited from class AbstractLabeledIntMap
count, labeledValueRE, labeledValueSetREPattern, optimize, splitterEntryPattern, splitterPair, valueRE, valueREPatternModifier 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 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 LabeledIntMap
entryComparatorModifier and TypeFieldDescriptionstatic final Comparator<it.unimi.dsi.fastutil.objects.Object2IntMap.Entry<Label>> A natural comparator for Entry<Label>. -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.Necessary constructor for the factory.LabeledIntSimpleMap(boolean optimize) Deprecated.Necessary constructor for the factory.Deprecated.Constructor to clone the structure.LabeledIntSimpleMap(LabeledIntMap lvm, boolean optimize) Deprecated.Constructor to clone the structure. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanalreadyRepresents(Label newLabel, int newValue) Deprecated.voidclear()Deprecated.Remove all entries from the map.it.unimi.dsi.fastutil.objects.ObjectSet<it.unimi.dsi.fastutil.objects.Object2IntMap.Entry<Label>> entrySet()Deprecated.The set of all map entries.intDeprecated.it.unimi.dsi.fastutil.objects.ObjectSet<Label> keySet()Deprecated.A copy of all labels in the map.final LabeledIntSimpleMapDeprecated.FactorynewInstance(boolean optimize) Deprecated.Factoryfinal LabeledIntSimpleMapnewInstance(LabeledIntMap lim) Deprecated.FactorynewInstance(LabeledIntMap lim, boolean optimize) Deprecated.Factoryfinal booleanDeprecated.Put a label with valueiif labellis not null and there is no labeled value in the set with labell, or it is present but with a value higher thanl.voidputForcibly(Label l, int i) Deprecated.Put the labeled value without any control.intDeprecated.Remove the labellfrom the map.intsize()Deprecated.Deprecated.it.unimi.dsi.fastutil.ints.IntSetvalues()Deprecated.Methods inherited from class AbstractLabeledIntMap
entryAsString, entryAsString, equals, hashCode, isEmpty, parse, parse, toStringModifier and TypeMethodDescription(package private) static StringentryAsString(it.unimi.dsi.fastutil.objects.Object2IntMap.Entry<Label> entry) static StringentryAsString(Label label, int value) final booleanfinal inthashCode()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.final StringtoString()Methods inherited from interface LabeledIntMap
getMaxValue, getMaxValueSubsumedBy, getMinLabeledValue, getMinValue, getMinValueAmongLabelsWOUnknown, getMinValueConsistentWith, getMinValueSubsumedBy, putAllModifier and TypeMethodDescriptiondefault intdefault intReturns the value associated with thelif it exists, otherwise the maximal value among all labels consistent withl.default it.unimi.dsi.fastutil.objects.Object2IntMap.Entry<Label> default intdefault intdefault intReturns the value associated with thelif it exists, otherwise the minimal value among all labels consistent withl.default intReturns the minimal value among those associated with labels subsumed bylif it exists,Constants.INT_NULLotherwise.default voidputAll(LabeledIntMap inputMap) Put all elements of `inputMap` into the current one without making a defensive copy.
-
Field Details
-
mainMap
-
updateCount
Deprecated.Counter of labeled value updates.
-
-
Constructor Details
-
LabeledIntSimpleMap
Deprecated.Constructor to clone the structure. For optimization issues, this method clones only the LabeledIntTreeMap object.- Parameters:
lvm- the LabeledValueTreeMap to clone. If LVM is null, this will be an empty map.
-
LabeledIntSimpleMap
Deprecated.Constructor to clone the structure. For optimization issues, this method clones only the LabeledIntTreeMap object.- Parameters:
lvm- the LabeledValueTreeMap to clone. If LVM is null, this will be an empty map.optimize- true for having the label as short as possible, false otherwise. For example, the set {(0, ¬C), (1, C)} is represented as {(0, ⊡), (1, C)} if this parameter is true.
-
LabeledIntSimpleMap
public LabeledIntSimpleMap()Deprecated.Necessary constructor for the factory. The internal structure is built and empty. -
LabeledIntSimpleMap
public LabeledIntSimpleMap(boolean optimize) Deprecated.Necessary constructor for the factory. The internal structure is built and empty.- Parameters:
optimize- true for having the label as short as possible, false otherwise. For example, the set {(0, ¬C), (1, C)} is represented as {(0, ⊡), (1, C)} if this parameter is true.
-
-
Method Details
-
alreadyRepresents
-
clear
public void clear()Deprecated.Description copied from interface:LabeledIntMapRemove all entries from the map.- See Also:
-
entrySet
public it.unimi.dsi.fastutil.objects.ObjectSet<it.unimi.dsi.fastutil.objects.Object2IntMap.Entry<Label>> entrySet()Deprecated.Description copied from interface:LabeledIntMapThe set of all map entries. The set is a view of the map. A modification of the map is reflected in the entries of the returned set.
If it is necessary to scan all the entries to modify the map, the only right way is to consider the keys returned byLabeledIntMap.keySet()and use methods likeLabeledIntMap.remove(Label)and/orLabeledIntMap.put(Label, int).- Returns:
- The set of all map entries.
- See Also:
-
get
Deprecated.- Parameters:
l- anLabelobject.- Returns:
- the value associated to
lif it exists,Constants.INT_NULLotherwise.
-
keySet
Deprecated.Description copied from interface:LabeledIntMapA copy of all labels in the map.The returned set must not be connected to the map.
The semantics of this method is different from the
Map.keySet()!It can cost time and memory because it duplicates all the keys of the map.
This method allows one to scan all the keys of the map, even if during the scan, some key of the map is removed.
It is important to modify this map using only the method
LabeledIntMap.remove(Label).Method
LabeledIntMap.entrySet()returns a view of the entries of the map. Therefore, it cannot be used to scan or modify the map.- Returns:
- a copy of all labels in the map.
-
newInstance
Deprecated.Description copied from interface:LabeledIntMapFactory- Returns:
- an object of type LabeledIntMap.
-
newInstance
Deprecated.Factory- Parameters:
optimize- true for having the label as short as possible, false otherwise. For example, the set {(0, ¬C), (1, C)} is represented as {(0, ⊡), (1, C)} if this parameter is true.- Returns:
- an object of type LabeledIntMap.
-
newInstance
Deprecated.Description copied from interface:LabeledIntMapFactory- Parameters:
lim- a map to clone.- Returns:
- an object of type LabeledIntMap.
-
newInstance
Deprecated.Factory- Parameters:
lim- an object to clone.optimize- true for having the label as short as possible, false otherwise. For example, the set {(0, ¬C), (1, C)} is represented as {(0, ⊡), (1, C)} if this parameter is true.- Returns:
- an object of type LabeledIntMap.
-
put
Deprecated.Description copied from interface:LabeledIntMapPut a label with valueiif labellis not null and there is no labeled value in the set with labell, or it is present but with a value higher thanl.Not mandatory: the method can remove or modify other labeled values of the set to minimize the labeled values present, guaranteeing that no info is lost.
- Parameters:
newLabel- a non-null label.newValue- a notConstants.INT_NULLvalue.- Returns:
- true if
(l,i)has been inserted. Since an insertion can remove more than one redundant labeled value, it is nonsensical to return "the old value" as expected from a classical put method.
-
putForcibly
-
remove
Deprecated.Description copied from interface:LabeledIntMapRemove the labellfrom the map. If thelis not present, it does nothing.- Parameters:
l- a non-null label.- Returns:
- the previous value associated with
l, orConstants.INT_NULLif there was no mapping forl.
-
size
public int size()Deprecated.- Specified by:
sizein interfaceLabeledIntMap- Overrides:
sizein classAbstractLabeledIntMap- Returns:
- the number of labeled values (value with empty label included).
- See Also:
-
unmodifiable
Deprecated.- Returns:
- a read-only view of this.
-
values
public it.unimi.dsi.fastutil.ints.IntSet values()Deprecated.- Returns:
- the set of all integer values present in the map as an ordered list.
-