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 aNode
it 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 boolean
contains(Object o)
Determines whether aVariable
is in the collection.Variable
get(int index)
Gets theVariable
object at the specified index.Variable
get(String name)
Performs a case sensitive lookup.Variable
get(String name, boolean throwIfNotFound)
Performs a case sensitive lookup.Network
getNetwork()
TheNetwork
the collection belongs to.int
indexOf(Object o)
Determines the index of a specificVariable
in the collection.Variable
set(int index, Variable value)
Gets theVariable
object at the specified index.int
size()
Gets the number of elements contained in theNetworkVariableCollection
instance.-
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 theNetworkVariableCollection
instance.- Specified by:
size
in interfaceCollection<Variable>
- Specified by:
size
in interfaceList<Variable>
- Specified by:
size
in classAbstractCollection<Variable>
-
contains
public boolean contains(Object o)
Determines whether aVariable
is in the collection. The operation is O(1).- Specified by:
contains
in interfaceCollection<Variable>
- Specified by:
contains
in interfaceList<Variable>
- Overrides:
contains
in classAbstractCollection<Variable>
- Parameters:
o
- TheVariable
to 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 specificVariable
in the collection. This operation is O(1).
-
-