- All Implemented Interfaces:
Iterable<ParameterValue>,Collection<ParameterValue>,List<ParameterValue>
Stores a collection of ParameterValue indexed on Parameter
it works like a LinkedHashMap<Parameter, LinkedList<ParameterValue>>
it also works like a LinkedList<ParameterValue;>
Not thread safe
-
Field Summary
FieldsFields inherited from class java.util.AbstractList
modCount -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanadd(ParameterValue pv) booleanaddAll(Collection<? extends ParameterValue> c) Adds all element to this collectionstatic ParameterValueListasList(ParameterValue... pvs) voidclear()Throws UnsupportedOperationExceptionbooleanReturn true if the list contains the exact same ParameterValue.booleancontainsAll(Collection<?> c) Throws UnsupportedOperationExceptionintcount(org.yamcs.xtce.Parameter p) Return the number of values for pvoidforEach(org.yamcs.xtce.Parameter p, Consumer<ParameterValue> action) Performs the given action for each value of the parameter p The values are considered in insertion order - oldest is first to be processedget(org.yamcs.xtce.Parameter p, int n) Returns the n'th instance of the parameter or null if it does not existgetFirst()getFirstInserted(org.yamcs.xtce.Parameter p) Returns first inserted parameter value for the given parameter or null if there is nonegetFromEnd(org.yamcs.xtce.Parameter p, int n) Returns the n'th instance of the parameter from the end or null if it does not existgetLast()getLastInserted(org.yamcs.xtce.Parameter p) Returns the last inserted value for Parameter p or null if there is no valueintgetSize()booleanisEmpty()iterator()listIterator(int index) booleanThrows UnsupportedOperationExceptionbooleanremoveAll(Collection<?> c) Throws UnsupportedOperationExceptionremoveFirst(org.yamcs.xtce.Parameter p) Remove the first inserted value for Parameter premoveLast(org.yamcs.xtce.Parameter p) Remove the last inserted value for Parameter pbooleanretainAll(Collection<?> c) Throws UnsupportedOperationExceptionintsize()Creates an iterator which is positioned on the end of the list but returns all the elements added after the iterator has been created.Object[]toArray()Returns a copy of the list as array<T> T[]toArray(T[] a) Throws UnsupportedOperationExceptiontoString()Methods inherited from class java.util.AbstractList
equals, hashCode, indexOf, lastIndexOf, listIterator, removeRange, subListMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.List
replaceAll, sort, spliterator
-
Field Details
-
EMPTY
-
-
Constructor Details
-
ParameterValueList
public ParameterValueList() -
ParameterValueList
- Parameters:
pvs-
-
-
Method Details
-
add
- Specified by:
addin interfaceCollection<ParameterValue>- Specified by:
addin interfaceList<ParameterValue>- Overrides:
addin classAbstractList<ParameterValue>
-
count
public int count(org.yamcs.xtce.Parameter p) Return the number of values for p- Parameters:
p-- Returns:
-
getFirst
-
getLast
-
getSize
public int getSize() -
getLastInserted
Returns the last inserted value for Parameter p or null if there is no value- Parameters:
p-- Returns:
-
getFirstInserted
Returns first inserted parameter value for the given parameter or null if there is none- Parameters:
p-- Returns:
-
get
Returns the n'th instance of the parameter or null if it does not existIf n = 0 it is equivalent with
getFirstInserted(Parameter) -
getFromEnd
Returns the n'th instance of the parameter from the end or null if it does not existIf n = 0 it is equivalent with
getLastInserted(Parameter) -
forEach
Performs the given action for each value of the parameter p The values are considered in insertion order - oldest is first to be processed- Parameters:
p-action-
-
removeLast
Remove the last inserted value for Parameter p- Parameters:
p-- Returns:
- the value removed or null if there was no value for p
-
removeFirst
Remove the first inserted value for Parameter p- Parameters:
p-- Returns:
- the value removed or null if there was no value for p
-
tailIterator
Creates an iterator which is positioned on the end of the list but returns all the elements added after the iterator has been created.Removing elements will invalidate the iterator.
- Returns:
-
iterator
- Specified by:
iteratorin interfaceCollection<ParameterValue>- Specified by:
iteratorin interfaceIterable<ParameterValue>- Specified by:
iteratorin interfaceList<ParameterValue>- Overrides:
iteratorin classAbstractSequentialList<ParameterValue>
-
addAll
Adds all element to this collection- Specified by:
addAllin interfaceCollection<ParameterValue>- Specified by:
addAllin interfaceList<ParameterValue>- Overrides:
addAllin classAbstractCollection<ParameterValue>- Parameters:
c-- Returns:
-
clear
public void clear()Throws UnsupportedOperationException- Specified by:
clearin interfaceCollection<ParameterValue>- Specified by:
clearin interfaceList<ParameterValue>- Overrides:
clearin classAbstractList<ParameterValue>
-
contains
Return true if the list contains the exact same ParameterValue. That means exactly the same object.- Specified by:
containsin interfaceCollection<ParameterValue>- Specified by:
containsin interfaceList<ParameterValue>- Overrides:
containsin classAbstractCollection<ParameterValue>- Parameters:
o-- Returns:
-
containsAll
Throws UnsupportedOperationException- Specified by:
containsAllin interfaceCollection<ParameterValue>- Specified by:
containsAllin interfaceList<ParameterValue>- Overrides:
containsAllin classAbstractCollection<ParameterValue>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceCollection<ParameterValue>- Specified by:
isEmptyin interfaceList<ParameterValue>- Overrides:
isEmptyin classAbstractCollection<ParameterValue>
-
remove
Throws UnsupportedOperationException- Specified by:
removein interfaceCollection<ParameterValue>- Specified by:
removein interfaceList<ParameterValue>- Overrides:
removein classAbstractCollection<ParameterValue>
-
removeAll
Throws UnsupportedOperationException- Specified by:
removeAllin interfaceCollection<ParameterValue>- Specified by:
removeAllin interfaceList<ParameterValue>- Overrides:
removeAllin classAbstractCollection<ParameterValue>
-
retainAll
Throws UnsupportedOperationException- Specified by:
retainAllin interfaceCollection<ParameterValue>- Specified by:
retainAllin interfaceList<ParameterValue>- Overrides:
retainAllin classAbstractCollection<ParameterValue>
-
size
public int size()- Specified by:
sizein interfaceCollection<ParameterValue>- Specified by:
sizein interfaceList<ParameterValue>- Specified by:
sizein classAbstractCollection<ParameterValue>
-
toArray
Returns a copy of the list as array- Specified by:
toArrayin interfaceCollection<ParameterValue>- Specified by:
toArrayin interfaceList<ParameterValue>- Overrides:
toArrayin classAbstractCollection<ParameterValue>
-
toArray
public <T> T[] toArray(T[] a) Throws UnsupportedOperationException- Specified by:
toArrayin interfaceCollection<ParameterValue>- Specified by:
toArrayin interfaceList<ParameterValue>- Overrides:
toArrayin classAbstractCollection<ParameterValue>
-
toString
- Overrides:
toStringin classAbstractCollection<ParameterValue>
-
listIterator
- Specified by:
listIteratorin interfaceList<ParameterValue>- Specified by:
listIteratorin classAbstractSequentialList<ParameterValue>
-
asList
-