public class Link extends Object implements Comparable<Link>, Storable
| Modifier and Type | Class and Description |
|---|---|
static class |
Link.Field
This is set of fields for input/output to XML and JSON format
|
| Modifier | Constructor and Description |
|---|---|
protected |
Link(Node fromNode,
Node toNode)
Deprecated.
For internal use only. Use createLink() instead
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(Link o)
Compares this Link object to another based on its underlying logic network and node IDs.
|
protected static Link |
createLink(Node fromNode,
Node toNode)
Creates a Link object without manipulating the nodes themselves.
|
protected void |
createLogicLink()
This will create a link in the underlying logic.
|
protected void |
destroyLogicLink()
Destroys the underlying logic link
Has no effect if the underlying logical network does not contain either of the nodes. |
boolean |
equals(Object obj)
Checks equality of a given object to this Link.
|
Node |
getFromNode()
Returns the source Link Node.
|
Node |
getToNode()
Returns the target Link Node.
|
int |
hashCode()
Returns a hash code value for this object.
|
protected void |
setGraphics(org.json.JSONObject graphics)
Stores Link's graphics.
|
org.json.JSONObject |
toJson()
Creates a JSON representing this Link, ready for file storage.
|
String |
toString()
Returns toStringExtra().
|
String |
toStringExtra()
Returns the string representation of the Link as: `Net1`.`Node1` → `Net2`.`Node2`.
|
@Deprecated protected Link(Node fromNode, Node toNode)
fromNode - source Node of the LinktoNode - target Node of the Linkprotected static Link createLink(Node fromNode, Node toNode) throws LinkException
fromNode - source Node of the LinktoNode - target Node of the LinkLinkException - if Nodes are in different Network (in that case CrossNetworkLink should haves been used)protected void createLogicLink()
throws LinkException
LinkException - if logical link was not createdprotected void destroyLogicLink()
public Node getFromNode()
public Node getToNode()
public String toString()
public String toStringExtra()
public int compareTo(Link o)
compareTo in interface Comparable<Link>o - another Link objectpublic boolean equals(Object obj)
public int hashCode()
protected void setGraphics(org.json.JSONObject graphics)
graphics - the graphics json to storeCopyright © 2021. All rights reserved.