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 an evidence that without minimization of labeled value sets,
any CSTN algorithm can be very slowly.- Version:
- $Rev: 877 $
- Author:
- Roberto Posenato
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Deprecated.Nested classes/interfaces inherited from interface it.univr.di.labeledvalue.LabeledIntMap
LabeledIntMap.LabeledIntMapView
-
Field Summary
Modifier 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 it.univr.di.labeledvalue.AbstractLabeledIntMap
count, labeledValueRE, labeledValueSetREPattern, optimize, splitterEntryPattern, splitterPair, valueRE, valueREPattern
Fields inherited from interface it.univr.di.labeledvalue.LabeledIntMap
entryComparator
-
Constructor Summary
ConstructorDescriptionDeprecated.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 boolean
alreadyRepresents
(Label newLabel, int newValue) Deprecated.void
clear()
Deprecated.Remove all entries of the map.it.unimi.dsi.fastutil.objects.ObjectSet
<it.unimi.dsi.fastutil.objects.Object2IntMap.Entry<Label>> entrySet()
Deprecated.The set of all entries of the map.int
Deprecated.it.unimi.dsi.fastutil.objects.ObjectSet
<Label> keySet()
Deprecated.A copy of all labels in the map.final LabeledIntSimpleMap
Deprecated.FactorynewInstance
(boolean optimize) Deprecated.Factoryfinal LabeledIntSimpleMap
newInstance
(LabeledIntMap lim) Deprecated.FactorynewInstance
(LabeledIntMap lim, boolean optimize) Deprecated.Factoryfinal boolean
Deprecated.Put a label with valuei
if labell
is not null and there is not a labeled value in the set with labell
or it is present but with a value higher thanl
.void
putForcibly
(Label l, int i) Deprecated.Put the labeled value without any control.int
Deprecated.Remove the labell
from the map.int
size()
Deprecated.Deprecated.it.unimi.dsi.fastutil.ints.IntSet
values()
Deprecated.Methods inherited from class it.univr.di.labeledvalue.AbstractLabeledIntMap
entryAsString, entryAsString, equals, hashCode, isEmpty, parse, parse, 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
getMaxValue, getMaxValueSubsumedBy, getMinLabeledValue, getMinValue, getMinValueAmongLabelsWOUnknown, getMinValueConsistentWith, getMinValueSubsumedBy, putAll
-
Field Details
-
mainMap
-
updateCount
Deprecated.Counter of labeled value updates.
-
-
Constructor Details
-
LabeledIntSimpleMap
Deprecated.Constructor to clone the structure. For optimization issue, this method clone only 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 issue, this method clone only LabeledIntTreeMap object.- Parameters:
lvm
- the LabeledValueTreeMap to clone. If lvm is null, this will be an empty map.optimize
- true for having the label shortest 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 shortest 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:LabeledIntMap
Remove all entries of 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:LabeledIntMap
The set of all entries of the map. The set is a view of the map. A modification of the map is reflected on 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 entries of the map.
- See Also:
-
get
Deprecated.- Parameters:
l
- anLabel
object.- Returns:
- the value associated to
l
if it exists,Constants.INT_NULL
otherwise.
-
keySet
Deprecated.Description copied from interface:LabeledIntMap
A copy of all labels in the map.
The returned set must not be connected with the map.
The semantics of this method is different from theMap.keySet()
!
It can costs time and memory because it should duplicate 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 are removed.
It is important to modify this map using only methodLabeledIntMap.remove(Label)
.
MethodLabeledIntMap.entrySet()
returns a view of the entries of the map. Therefore, it cannot use to scan the map to modify it.- Returns:
- a copy of all labels in the map.
-
newInstance
Deprecated.Description copied from interface:LabeledIntMap
Factory- Returns:
- an object of type LabeledIntMap.
-
newInstance
Deprecated.Factory- Parameters:
optimize
- true for having the label shortest 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:LabeledIntMap
Factory- 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 shortest 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:LabeledIntMap
Put a label with valuei
if labell
is not null and there is not a 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 in order to minimize the labeled values present guaranteeing that no info is lost.
- Parameters:
newLabel
- a not null label.newValue
- a notConstants.INT_NULL
value.- Returns:
- true if
(l,i)
has been inserted. Since an insertion can remove more than one redundant labeled values, it is nonsensical to return "the old value" as expected from a classical put method.
-
putForcibly
-
remove
Deprecated.Description copied from interface:LabeledIntMap
Remove the labell
from the map. If thel
is not present, it does nothing.- Parameters:
l
- a not null label.- Returns:
- the previous value associated with
l
, orConstants.INT_NULL
if there was no mapping forl
.
-
size
public int size()Deprecated.- Specified by:
size
in interfaceLabeledIntMap
- Overrides:
size
in classAbstractLabeledIntMap
- Returns:
- the number of labeled value (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.
-