public final class TableIterator extends Object
Table
, using a preferred variable ordering, as opposed to the default sorted order specified in Table.getSortedVariables()
.TableAccessor
,
Table
Constructor and Description |
---|
TableIterator(Table table,
List<Variable> order,
List<Integer> times)
Initializes a new instance of the
TableIterator class, allowing sequential access to [table] with a specified [order] for the variables at specified times. |
TableIterator(Table table,
List<VariableContext> order)
Initializes a new instance of the
TableIterator class, allowing sequential access to [table] with a specified [order] for the node variables. |
TableIterator(Table table,
Node[] order)
Initializes a new instance of the
TableIterator class, allowing sequential access to [table] with a specified [order] for the node variables. |
TableIterator(Table table,
Node[] order,
Integer[] times)
Initializes a new instance of the
TableIterator class, allowing sequential access to [table] with a specified [order] for the node variables. |
TableIterator(Table table,
Variable[] order)
Initializes a new instance of the
TableIterator class, allowing sequential access to [table] with a specified [order] for the variables. |
TableIterator(Table table,
Variable[] order,
Integer[] times)
Initializes a new instance of the
TableIterator class, allowing sequential access to [table] with a specified [order] for the variables at specified times. |
TableIterator(Table table,
VariableContextCollection order)
Initializes a new instance of the
TableIterator class, allowing sequential access to [table] with a specified [order] for the variables. |
Modifier and Type | Method and Description |
---|---|
void |
copyFrom(double[] values)
Resets the iterator and then copies values from an array into the underlying
Table using the variable ordering of the TableIterator , not the Table.getSortedVariables() . |
int |
getRow()
Gets the current position of the iterator.
|
int |
getState(int i)
Gets the state for an individual node indexed by the order of nodes in the
TableIterator . |
void |
getStates(int[] states)
Gets the states of all nodes, based on the order of nodes in the
TableIterator not the underlying Table . |
Table |
getTable()
Gets the underlying
Table . |
int |
getTableRow()
Gets the position of the iterator in the underlying
Table . |
double |
getValue()
Gets the underlying
Table value at the current position of the iterator. |
void |
increment()
Moves the iterator to the next value, with respect to the
TableIterator node order. |
void |
reset()
Resets the iterator to the start.
|
void |
setValue(double value)
Sets the underlying
Table value at the current position of the iterator. |
int |
size()
Gets the count of values in the underlying
Table . |
public TableIterator(Table table, Variable[] order)
TableIterator
class, allowing sequential access to [table] with a specified [order] for the variables.table
- The table whose values are to be accessed.order
- The order in which the variables should be accessed. The last variable's states toggle fastest.NullPointerException
- Raised if either [table] or [order] is null.IllegalArgumentException
- Raised if order does not contain the same variables as [table].public TableIterator(Table table, Variable[] order, Integer[] times)
TableIterator
class, allowing sequential access to [table] with a specified [order] for the variables at specified times.table
- The table whose values are to be accessed.order
- The order in which the variables should be accessed. The last variable's states toggle fastest.times
- The times for the variables.NullPointerException
- Raised if either [table] or [order] is null.IllegalArgumentException
- Raised if order does not contain the same variables as [table].public TableIterator(Table table, List<Variable> order, List<Integer> times)
TableIterator
class, allowing sequential access to [table] with a specified [order] for the variables at specified times.table
- The table whose values are to be accessed.order
- The order in which the variables should be accessed. The last variable's states toggle fastest.times
- The times for the variables.NullPointerException
- Raised if either [table] or [order] is null.IllegalArgumentException
- Raised if order does not contain the same variables as [table].public TableIterator(Table table, Node[] order, Integer[] times)
TableIterator
class, allowing sequential access to [table] with a specified [order] for the node variables.table
- The table whose values are to be accessed.order
- The order in which the node variables should be accessed. The last variable's states toggle fastest.times
- The times for the variables.NullPointerException
- Raised if either [table] or [order] is null.IllegalArgumentException
- Raised if the nodes in order do not contain the same variables as [table].public TableIterator(Table table, VariableContextCollection order)
TableIterator
class, allowing sequential access to [table] with a specified [order] for the variables. Any times that are contained within the VariableContextCollection
will be used.table
- The table whose values are to be accessed.order
- The order in which the variables should be accessed, including any timing information contained in the VariableContextCollection
. The last variable's states toggle fastest.NullPointerException
- Raised if either [table] or [order] is null.IllegalArgumentException
- Raised if order does not contain the same variables as [table].public TableIterator(Table table, Node[] order)
TableIterator
class, allowing sequential access to [table] with a specified [order] for the node variables.table
- The table whose values are to be accessed.order
- The order in which the node variables should be accessed. The last variable's states toggle fastest.NullPointerException
- Raised if either [table] or [order] is null.IllegalArgumentException
- Raised if the nodes in order do not contain the same variables as [table].public TableIterator(Table table, List<VariableContext> order)
TableIterator
class, allowing sequential access to [table] with a specified [order] for the node variables.table
- The table whose values are to be accessed.order
- The order in which the node variables should be accessed. The last variable's states toggle fastest.NullPointerException
- Raised if either [table] or [order] is null.IllegalArgumentException
- Raised if the variable-time combinations in order do not match those found in [table].public int size()
Table
.public double getValue()
Table
value at the current position of the iterator.Table
value.public void setValue(double value)
Table
value at the current position of the iterator.value
- The underlying Table
value.public void increment()
TableIterator
node order.public int getRow()
Table
see getTableRow()
.public int getTableRow()
Table
. For the position of the iterator see getRow()
.public void copyFrom(double[] values)
Table
using the variable ordering of the TableIterator
, not the Table.getSortedVariables()
.
At the end of the operation the iterator will be reset to the start.values
- An array of values to copy.NullPointerException
- Raised if [values] is null.IllegalArgumentException
- Raised if [values] is too short.public void reset()
public void getStates(int[] states)
TableIterator
not the underlying Table
.states
- A array, whose values will be replaced. The [states] array must have length equal to or greater than the node count in the underlying Table
.NullPointerException
- Raised if [states] is null.IllegalArgumentException
- Raised if [states] is too short.public int getState(int i)
TableIterator
.i
- The node position, based on the order of nodes in the TableIterator
.Copyright © 2023. All rights reserved.