public class DuoNodes
extends java.lang.Object
Class DuoNodes
stores ordered node trios and associated values.
Instances of class DuoNodes
are not thread safe.
Constructor and Description |
---|
DuoNodes()
Creates a new instance of
DuoNodes that has an
initial value of 0 for each ordered node trio. |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Sets the value of each node trio to 0.
|
int |
enumNodeA2(int index)
Returns the second node of the specified node trio in a list of
node trios with non-zero value.
|
int |
enumNodeAB1(int index)
Returns the first node of the specified node trio in a list of
node trios with non-zero value.
|
int |
enumNodeB2(int index)
Returns the third node of the specified node trio in a list of
node trios with non-zero value.
|
float |
enumValue(int index)
Returns the value of the specified ordered node trio in a list of
node trios with non-zero value.
|
int |
size()
Returns the number of node trios with non-zero value.
|
void |
sumUpdate(int nodeAB1,
int nodeA2,
int nodeB2,
float value)
Adds the specified value to the stored value of the specified
node trio.
|
java.lang.String |
toString()
Returns a string representation of
this . |
float |
value(int nodeAB1,
int nodeA2,
int nodeB2)
Returns the specified node trio value.
|
public DuoNodes()
DuoNodes
that has an
initial value of 0 for each ordered node trio.public void sumUpdate(int nodeAB1, int nodeA2, int nodeB2, float value)
nodeAB1
- the first nodenodeA2
- the second nodenodeB2
- the third nodevalue
- the valuejava.lang.IllegalArgumentException
- if
(nodeAB1 < 0 || nodeA2 < 0 || nodeB2 < 0)
java.lang.IllegalArgumentException
- if
value <= 0 || (Double.isFinite(value) == false)
public int size()
public int enumNodeAB1(int index)
(index >= 0 && index < this.size())
, then the following
expression will always evaluate to true
:(this.value(this.enumNodeAB1(index), this.enumNodeA2(index),
this.enumNodeB2(index)) == this.enumValue(index))
.index
- an index in a list of node trios with non-zero value.java.lang.IndexOutOfBoundsException
- if
index < 0 || index >= this.size()
public int enumNodeA2(int index)
(index >= 0 && index < this.size())
, then the following
expression will always evaluate to true
:(this.value(this.enumNodeAB1(index), this.enumNodeA2(index),
this.enumNodeB2(index)) == this.enumValue(index))
.index
- an index in a list of node trios with non-zero valuejava.lang.IndexOutOfBoundsException
- if
index < 0 || index >= this.size()
public int enumNodeB2(int index)
(index >= 0 && index < this.size())
, then the following
expression will always evaluate to true
:(this.value(this.enumNodeAB1(index), this.enumNodeA2(index),
this.enumNodeB2(index)) == this.enumValue(index))
.index
- an index in a list of node trios with non-zero valuejava.lang.IndexOutOfBoundsException
- if
index < 0 || index >= this.size()
public float enumValue(int index)
(index >= 0 && index < this.size())
, then the following
expression will always evaluate to true
:(this.value(this.enumNodeAB1(index), this.enumNodeA2(index),
this.enumNodeB2(index)) == this.enumValue(index))
.index
- an index in a list of node trios with non-zero valuejava.lang.IndexOutOfBoundsException
- if
index < 0 || index >= this.size()
public float value(int nodeAB1, int nodeA2, int nodeB2)
nodeAB1
- the first nodenodeA2
- the second nodenodeB2
- the third nodejava.lang.IllegalArgumentException
- if
(nodeAB1 < 0 || nodeA2 < 0 || nodeB2 < 0)
public void clear()
public java.lang.String toString()
this
. The exact
details of the representation are unspecified and subject to change.toString
in class java.lang.Object
this
.