java.lang.Object
org.yamcs.parameter.ParameterValueList
- All Implemented Interfaces:
Iterable<ParameterValue>,Collection<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
Fields -
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()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.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
equals, hashCode, parallelStream, removeIf, spliterator, stream, toArray
-
Field Details
-
EMPTY
-
-
Constructor Details
-
ParameterValueList
public ParameterValueList() -
ParameterValueList
- Parameters:
pvs-
-
-
Method Details
-
add
- Specified by:
addin interfaceCollection<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>
-
addAll
Adds all element to this collection- Specified by:
addAllin interfaceCollection<ParameterValue>- Parameters:
c-- Returns:
-
clear
public void clear()Throws UnsupportedOperationException- Specified by:
clearin interfaceCollection<ParameterValue>
-
contains
Return true if the list contains the exact same ParameterValue. That means exactly the same object.- Specified by:
containsin interfaceCollection<ParameterValue>- Parameters:
o-- Returns:
-
containsAll
Throws UnsupportedOperationException- Specified by:
containsAllin interfaceCollection<ParameterValue>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceCollection<ParameterValue>
-
remove
Throws UnsupportedOperationException- Specified by:
removein interfaceCollection<ParameterValue>
-
removeAll
Throws UnsupportedOperationException- Specified by:
removeAllin interfaceCollection<ParameterValue>
-
retainAll
Throws UnsupportedOperationException- Specified by:
retainAllin interfaceCollection<ParameterValue>
-
size
public int size()- Specified by:
sizein interfaceCollection<ParameterValue>
-
toArray
Returns a copy of the list as array- Specified by:
toArrayin interfaceCollection<ParameterValue>
-
toArray
public <T> T[] toArray(T[] a) Throws UnsupportedOperationException- Specified by:
toArrayin interfaceCollection<ParameterValue>
-
toString
-
asList
-