Package com.bayesserver.inference
Class DefaultQueryDistributionCollection
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<QueryDistribution>
-
- com.bayesserver.inference.DefaultQueryDistributionCollection
-
- All Implemented Interfaces:
QueryDistributionCollection
,Iterable<QueryDistribution>
,Collection<QueryDistribution>
,List<QueryDistribution>
public final class DefaultQueryDistributionCollection extends AbstractList<QueryDistribution> implements QueryDistributionCollection
The collection of distributions to be calculated by aInference.query(com.bayesserver.inference.QueryOptions, com.bayesserver.inference.QueryOutput)
. SeeQueryDistributionCollection
.
-
-
Field Summary
-
Fields inherited from class java.util.AbstractList
modCount
-
-
Constructor Summary
Constructors Constructor Description DefaultQueryDistributionCollection(Network network)
Initializes a new instance of theDefaultQueryDistributionCollection
class, passing the target Bayesian network as a parameter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(int index, QueryDistribution item)
QueryDistribution
add(Distribution distribution)
Adds the specified distribution, automatically creating aQueryDistribution
instance.void
clear()
QueryDistribution
get(int index)
Network
getNetwork()
Gets theNetwork
that is the target for aInference.query(com.bayesserver.inference.QueryOptions, com.bayesserver.inference.QueryOutput)
.QueryDistribution
remove(int index)
QueryDistribution
set(int index, QueryDistribution item)
int
size()
-
Methods inherited from class java.util.AbstractList
add, addAll, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, removeRange, subList
-
Methods inherited from class java.util.AbstractCollection
addAll, contains, 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
add, addAll, addAll, contains, containsAll, equals, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, removeAll, replaceAll, retainAll, sort, spliterator, subList, toArray, toArray
-
-
-
-
Constructor Detail
-
DefaultQueryDistributionCollection
public DefaultQueryDistributionCollection(Network network)
Initializes a new instance of theDefaultQueryDistributionCollection
class, passing the target Bayesian network as a parameter.- Parameters:
network
- The network that will be the target of theInference.query(com.bayesserver.inference.QueryOptions, com.bayesserver.inference.QueryOutput)
.
-
-
Method Detail
-
size
public int size()
- Specified by:
size
in interfaceCollection<QueryDistribution>
- Specified by:
size
in interfaceList<QueryDistribution>
- Specified by:
size
in classAbstractCollection<QueryDistribution>
-
add
public void add(int index, QueryDistribution item)
- Specified by:
add
in interfaceList<QueryDistribution>
- Overrides:
add
in classAbstractList<QueryDistribution>
-
clear
public void clear()
- Specified by:
clear
in interfaceCollection<QueryDistribution>
- Specified by:
clear
in interfaceList<QueryDistribution>
- Overrides:
clear
in classAbstractList<QueryDistribution>
-
add
public QueryDistribution add(Distribution distribution)
Adds the specified distribution, automatically creating aQueryDistribution
instance.- Specified by:
add
in interfaceQueryDistributionCollection
- Parameters:
distribution
- The distribution to query.- Returns:
- The automatically created
QueryDistribution
instance.
-
remove
public QueryDistribution remove(int index)
- Specified by:
remove
in interfaceList<QueryDistribution>
- Overrides:
remove
in classAbstractList<QueryDistribution>
-
set
public QueryDistribution set(int index, QueryDistribution item)
- Specified by:
set
in interfaceList<QueryDistribution>
- Overrides:
set
in classAbstractList<QueryDistribution>
-
get
public QueryDistribution get(int index)
- Specified by:
get
in interfaceList<QueryDistribution>
- Specified by:
get
in classAbstractList<QueryDistribution>
-
getNetwork
public Network getNetwork()
Gets theNetwork
that is the target for aInference.query(com.bayesserver.inference.QueryOptions, com.bayesserver.inference.QueryOutput)
.
-
-