public class NodeData<N extends NodeLocation & Locatable<? super N>> extends Object
Constructor and Description |
---|
NodeData(Value nodeIn,
List<Value> valueIn,
List<String> textIn,
List<Boolean> isNullIn,
List<Boolean> nullLinkIn,
N locationIn)
Creates a new NodeData.
|
Modifier and Type | Method and Description |
---|---|
boolean |
getChangedValue(int v) |
ChangeType |
getChangeType()
Gets the change type.
|
N |
getLocation()
Gets the node location.
|
Value |
getNode()
Gets the node value.
|
int |
getNumLinks()
Gets the number of links in the node.
|
N |
getPreviousLocation()
Gets the location at the previous update.
|
String |
getText(int v)
Gets the text at a specified index.
|
Value |
getValue(int v)
Gets the value at a specified index.
|
boolean |
isNull(int v)
Determines if a specified value is null.
|
boolean |
linkIsNull(int index)
Determines if a link is null.
|
void |
setNullLink(int index,
boolean nul)
Sets the null state for a link.
|
boolean |
setPrevious(NodeData<N> previous)
Updates the node based on its previous data.
|
public NodeData(Value nodeIn, List<Value> valueIn, List<String> textIn, List<Boolean> isNullIn, List<Boolean> nullLinkIn, N locationIn)
nodeIn
- the node itself.valueIn
- the node values.textIn
- the display text for each value.isNullIn
- for each value, true if that value is null, false
otherwise.nullLinkIn
- for each link, true if that link is null, false
otherwise. The length of this array must be equal to the number of links
in the node. This may be null if there are no links.locationIn
- the node location.public boolean getChangedValue(int v)
public ChangeType getChangeType()
public N getLocation()
public Value getNode()
public int getNumLinks()
public N getPreviousLocation()
public String getText(int v)
v
- index of the value of interest.v
.public Value getValue(int v)
v
- index of the value of interest.v
.public boolean isNull(int v)
v
- index of the value of interest.v
is null, false otherwise.public boolean linkIsNull(int index)
index
- index of the link of interest.public void setNullLink(int index, boolean nul)
index
- index of the null link to be set.nul
- true if the link is null, false otherwise.public boolean setPrevious(NodeData<N> previous)
previous
- the previous data for the same node that this NodeData
holds.