public class Node extends java.lang.Object implements Connectable, Duplicable
| Modifier and Type | Field and Description |
|---|---|
protected java.util.Map<java.lang.Integer,java.util.List<Pin<? extends Node>>> |
m_inputs
A map associating input pin indices with a list of output pins of other
nodes.
|
protected java.util.Map<java.lang.Integer,java.util.List<Pin<? extends Node>>> |
m_outputs
A map associating output pin indices with a list of input pins of other
nodes.
|
| Constructor and Description |
|---|
Node(int in_arity,
int out_arity)
Creates a new node.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addToInput(int index,
Pin<? extends Node> pin)
Adds a node's output pin to the set of connections of this node's
input pin.
|
void |
addToOutput(int index,
Pin<? extends Node> pin)
Adds a node's input pin to the set of connections of this node's
output pin.
|
protected void |
copyInto(Node n,
boolean with_state)
Copies the contents of the current node into another node instance.
|
Node |
duplicate()
Creates a copy of an object.
|
Node |
duplicate(boolean with_state)
Creates a possibly stateful copy of an object.
|
int |
getInputArity()
Gets the input arity of the node.
|
java.util.Collection<Pin<? extends Node>> |
getInputLinks(int index)
Gets the output pins of other nodes that are connected to a given
input pin of this node.
|
Pin<? extends Node> |
getInputPin(int index)
Gets the node's input pin for a given index.
|
int |
getOutputArity()
Gets the output arity of the node.
|
java.util.List<Pin<? extends Node>> |
getOutputLinks(int index)
Gets the input pins of other nodes that are connected to a given
output pin of this node.
|
Pin<? extends Node> |
getOutputPin(int index)
Gets the node's input pin for a given index.
|
void |
removeFromInput(int index,
Pin<? extends Node> pin)
Removes a node's output pin to the set of connections of this node's
input pin.
|
void |
removeFromOutput(int index,
Pin<? extends Node> pin)
Removes a node's input pin to the set of connections of this node's
output pin.
|
void |
setToInput(int index,
Pin<? extends Node> pin)
Sets a node's output pin as the connection of this node's input
pin.
|
void |
setToOutput(int index,
Pin<? extends Node> pin)
Sets a node's input pin as the connection of this node's output
pin.
|
protected java.util.Map<java.lang.Integer,java.util.List<Pin<? extends Node>>> m_inputs
public Node(int in_arity,
int out_arity)
in_arity - The number of input pins on this nodeout_arity - The number of output pins on this nodepublic int getInputArity()
ConnectablegetInputArity in interface Connectablepublic int getOutputArity()
ConnectablegetOutputArity in interface Connectablepublic java.util.Collection<Pin<? extends Node>> getInputLinks(int index)
ConnectablegetInputLinks in interface Connectableindex - The index of the current node's input pinpublic java.util.List<Pin<? extends Node>> getOutputLinks(int index)
ConnectablegetOutputLinks in interface Connectableindex - The index of the current node's output pinpublic void addToInput(int index,
Pin<? extends Node> pin)
ConnectableaddToInput in interface Connectableindex - The index of the current node's input pinpin - A node's output pin to add to the connectionspublic void setToInput(int index,
Pin<? extends Node> pin)
ConnectablesetToInput in interface Connectableindex - The index of the current node's input pinpin - A node's output pin to add to the connectionspublic void removeFromInput(int index,
Pin<? extends Node> pin)
ConnectableremoveFromInput in interface Connectableindex - The index of the current node's input pinpin - A node's output pin to remove from the connectionspublic void addToOutput(int index,
Pin<? extends Node> pin)
ConnectableaddToOutput in interface Connectableindex - The index of the current node's output pinpin - A node's input pin to add to the connectionspublic void setToOutput(int index,
Pin<? extends Node> pin)
ConnectablesetToOutput in interface Connectableindex - The index of the current node's output pinpin - A node's input pin to add to the connectionspublic void removeFromOutput(int index,
Pin<? extends Node> pin)
ConnectableremoveFromOutput in interface Connectableindex - The index of the current node's output pinpin - A node's input pin to remove from the connectionspublic Pin<? extends Node> getInputPin(int index) throws java.lang.IndexOutOfBoundsException
ConnectablegetInputPin in interface Connectableindex - The indexjava.lang.IndexOutOfBoundsException - If the index is incompatible with
the node's input aritypublic Pin<? extends Node> getOutputPin(int index) throws java.lang.IndexOutOfBoundsException
ConnectablegetOutputPin in interface Connectableindex - The indexjava.lang.IndexOutOfBoundsException - If the index is incompatible with
the node's output aritypublic Node duplicate()
Duplicableduplicate(false).duplicate in interface Duplicablepublic Node duplicate(boolean with_state)
Duplicableduplicate in interface Duplicablewith_state - Set to true for a stateful copy, false
otherwiseprotected void copyInto(Node n, boolean with_state)
n - The other nodewith_state - Set to true for a stateful copy, false
otherwiseCopyright © Sylvain HallĂ©. All Rights Reserved.