Package com.bayesserver
Class NetworkVariableCollection
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<Variable>
-
- com.bayesserver.NetworkVariableCollection
-
public final class NetworkVariableCollection extends AbstractList<Variable>
Represents a read-only collection of variables that belong to a network. When a variable is added to aNodeit is automatically inserted into this collection.
-
-
Field Summary
-
Fields inherited from class java.util.AbstractList
modCount
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontains(Object o)Determines whether aVariableis in the collection.Variableget(int index)Gets theVariableobject at the specified index.Variableget(String name)Performs a case sensitive lookup.Variableget(String name, boolean throwIfNotFound)Performs a case sensitive lookup.NetworkgetNetwork()TheNetworkthe collection belongs to.intindexOf(Object o)Determines the index of a specificVariablein the collection.Variableset(int index, Variable value)Gets theVariableobject at the specified index.intsize()Gets the number of elements contained in theNetworkVariableCollectioninstance.-
Methods inherited from class java.util.AbstractList
add, add, addAll, clear, equals, hashCode, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, subList
-
Methods inherited from class java.util.AbstractCollection
addAll, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface java.util.List
addAll, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
-
-
-
-
Method Detail
-
size
public int size()
Gets the number of elements contained in theNetworkVariableCollectioninstance.- Specified by:
sizein interfaceCollection<Variable>- Specified by:
sizein interfaceList<Variable>- Specified by:
sizein classAbstractCollection<Variable>
-
contains
public boolean contains(Object o)
Determines whether aVariableis in the collection. The operation is O(1).- Specified by:
containsin interfaceCollection<Variable>- Specified by:
containsin interfaceList<Variable>- Overrides:
containsin classAbstractCollection<Variable>- Parameters:
o- TheVariableto locate in the collection. The value can be null.- Returns:
- true if [o] is found in the collection; otherwise, false.
-
indexOf
public int indexOf(Object o)
Determines the index of a specificVariablein the collection. This operation is O(1).
-
-