Package it.unitn.disi.ds1.qtop
Class PairsHistory
java.lang.Object
java.util.AbstractCollection<ArrayList<akka.japi.Pair<Integer,Utils.Decision>>>
java.util.AbstractList<ArrayList<akka.japi.Pair<Integer,Utils.Decision>>>
java.util.ArrayList<ArrayList<akka.japi.Pair<Integer,Utils.Decision>>>
it.unitn.disi.ds1.qtop.PairsHistory
- All Implemented Interfaces:
Serializable
,Cloneable
,Iterable<ArrayList<akka.japi.Pair<Integer,
,Utils.Decision>>> Collection<ArrayList<akka.japi.Pair<Integer,
,Utils.Decision>>> List<ArrayList<akka.japi.Pair<Integer,
,Utils.Decision>>> RandomAccess
,SequencedCollection<ArrayList<akka.japi.Pair<Integer,
Utils.Decision>>>
PairsHistory class to store the history of the pairs and the final decision associated to it
- See Also:
-
Field Summary
Fields inherited from class java.util.AbstractList
modCount
-
Constructor Summary
ConstructorDescriptionDefault constructor.PairsHistory
(@NotNull PairsHistory sourceObject) Copy constructor. -
Method Summary
Modifier and TypeMethodDescriptionGet the latest epoch and iteration.Get the epoch and iteration of the last commited transaction, by commited transaction we consider a transaction that has non-pending state.void
insert
(int e, int i, int element) Insert a new element in the history.int
Read the last valid, i.e., committed, variable.void
setState
(int e, int i, Utils.Decision finalState) Get the state of the given epoch and iteration.toString()
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, addFirst, addLast, clear, clone, contains, ensureCapacity, equals, forEach, get, getFirst, getLast, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeFirst, removeIf, removeLast, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
Methods inherited from class java.util.AbstractCollection
containsAll
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, stream, toArray
Methods inherited from interface java.util.List
containsAll, reversed
-
Constructor Details
-
PairsHistory
public PairsHistory()Default constructor. -
PairsHistory
Copy constructor.- Parameters:
sourceObject
- source object to copy
-
-
Method Details
-
setState
Get the state of the given epoch and iteration.- Parameters:
e
- epochi
- iterationfinalState
- final state to set
-
readValidVariable
public int readValidVariable()Read the last valid, i.e., committed, variable.- Returns:
- the last valid variable, -1 in case none is set
-
insert
public void insert(int e, int i, int element) Insert a new element in the history.- Parameters:
e
- epochi
- iterationelement
- element to insert
-
getLatest
Get the latest epoch and iteration.- Returns:
- the latest epoch and iteration
-
getLatestCommitted
Get the epoch and iteration of the last commited transaction, by commited transaction we consider a transaction that has non-pending state.- Returns:
- the latest epoch and iteration committed
-
toString
- Overrides:
toString
in classAbstractCollection<ArrayList<akka.japi.Pair<Integer,
Utils.Decision>>>
-