public class LogicalNetNodeImpl extends java.lang.Object implements LogicalNetNode
Constructor and Description |
---|
LogicalNetNodeImpl(long id, int partitionId, int linkLevel, double cost, boolean isActive, int maxLinkLevel, int numInLinks, int numOutLinks, CategorizedUserData userData)
Constructs a LogicalNetNode object.
|
Modifier and Type | Method and Description |
---|---|
void |
addInLink(LogicalNetLink link)
Adds an incoming link to this node.
|
void |
addOutLink(LogicalNetLink link)
Adds an outgoing link to this node.
|
java.lang.Object |
clone()
Support cloneable
|
long[] |
getAdjacentNodeIds(boolean activeOnly)
Returns the IDs of all the nodes with a direct link to or from this node.
|
CategorizedUserData |
getCategorizedUserData()
Returns categorized user data.
|
CategorizedUserData |
getCategorizedUserData()
Returns categorized user data.
|
double |
getCost()
Returns the cost of this node.
|
long |
getId()
Returns the node ID
|
LogicalNetLink[] |
getIncidentLinks(boolean activeOnly)
Returns the IDs of all the links incident to this node.
|
LogicalNetLink[] |
getInLinks(boolean activeOnly)
Returns the array of incoming links to this node.
|
int |
getLinkLevel()
Returns the link level of the containing partition.
|
int |
getMaxLinkLevel()
Returns the maximum link level of the links incident to this node.
|
long[] |
getNextNodeIds(boolean activeOnly)
Returns the IDs of all the nodes with a direct link from this node.
|
int |
getNumberOfInLinks()
Returns the number of incoming links.
|
int |
getNumberOfOutLinks()
Returns the number of outgoing links.
|
LogicalNetLink[] |
getOutLinks(boolean activeOnly)
Returns the array of outgoing links from this node.
|
int |
getPartitionId()
Returns the partition ID.
|
long[] |
getPreviousNodeIds(boolean activeOnly)
Returns the IDs of all the nodes with a direct link to this node.
|
UserData |
getUserData(int category)
Returns user data for the specified category.
|
UserData |
getUserData(int category)
Returns user data for the specified category.
|
boolean |
isActive()
Checks whether the node is active.
|
boolean |
isDummyExternalNode()
Returns true if the net node object is an external node and
|
boolean |
isPartiallyLoaded()
Use max link level as an indicator for whether a node is external.
|
void |
removeInLink(long linkId)
Removes the incoming link with the specified link ID.
|
void |
removeOutLink(long linkId)
Removes the outgoing link with the specified link ID.
|
void |
setCategorizedUserData(CategorizedUserData userData)
Sets categorized user data.
|
void |
setCategorizedUserData(CategorizedUserData cud)
Sets categorized user data.
|
void |
setCost(double cost)
Sets the cost of this node.
|
void |
setIsActive(boolean isActive)
Sets whether this node is active.
|
void |
setMaxLinkLevel(int maxLinkLevel)
Sets the maximum link level of the links incident to this node.
|
void |
setPartitionId(int partitionId)
Sets the partition ID.
|
void |
setUserData(int category, UserData userData)
Sets user data for the specified category.
|
void |
setUserData(int category, UserData userData)
Sets user data for the specified category.
|
LogicalNode |
toStandAloneNode()
Returns a new instance of a standalone node, which has the same properties as this node.
|
void |
update(LogicalNode node)
Copies the attributes of the input node to this node.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getCost, getId, getMaxLinkLevel, isActive, setCost, setIsActive, setMaxLinkLevel, update
public LogicalNetNodeImpl(long id, int partitionId, int linkLevel, double cost, boolean isActive, int maxLinkLevel, int numInLinks, int numOutLinks, CategorizedUserData userData)
id
- ID of the nodepartitionId
- the partition which the node belongs tolinkLevel
- link level of the partitioncost
- cost of the nodeisActive
- whether the node is activemaxLinkLevel
- maximum link levelnumInLinks
-numOutLinks
-userData
-public int getLinkLevel()
LogicalNetNode
getLinkLevel
in interface LogicalNetNode
public int getPartitionId()
LogicalNetNode
getPartitionId
in interface LogicalNetNode
public void setPartitionId(int partitionId)
LogicalNetNode
setPartitionId
in interface LogicalNetNode
public LogicalNetLink[] getInLinks(boolean activeOnly)
LogicalNetNode
getInLinks
in interface LogicalNetNode
public LogicalNetLink[] getOutLinks(boolean activeOnly)
LogicalNetNode
getOutLinks
in interface LogicalNetNode
public LogicalNetLink[] getIncidentLinks(boolean activeOnly)
LogicalNetNode
getIncidentLinks
in interface LogicalNetNode
public int getNumberOfInLinks()
LogicalNetNode
getNumberOfInLinks
in interface LogicalNetNode
public int getNumberOfOutLinks()
LogicalNetNode
getNumberOfOutLinks
in interface LogicalNetNode
public void addInLink(LogicalNetLink link)
LogicalNetNode
addInLink
in interface LogicalNetNode
link
- incoming linkpublic void addOutLink(LogicalNetLink link)
LogicalNetNode
addOutLink
in interface LogicalNetNode
link
- outgoing linkpublic long[] getPreviousNodeIds(boolean activeOnly)
LogicalNetNode
getPreviousNodeIds
in interface LogicalNetNode
public long[] getNextNodeIds(boolean activeOnly)
LogicalNetNode
getNextNodeIds
in interface LogicalNetNode
public long[] getAdjacentNodeIds(boolean activeOnly)
LogicalNetNode
getAdjacentNodeIds
in interface LogicalNetNode
public void removeInLink(long linkId)
LogicalNetNode
removeInLink
in interface LogicalNetNode
linkId
- link IDpublic void removeOutLink(long linkId)
LogicalNetNode
removeOutLink
in interface LogicalNetNode
linkId
- link IDpublic boolean isPartiallyLoaded()
isPartiallyLoaded
in interface LogicalNetNode
public LogicalNode toStandAloneNode()
LogicalNetNode
toStandAloneNode
in interface LogicalNetNode
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in interface LogicalNetNode
java.lang.CloneNotSupportedException
public boolean isDummyExternalNode()
LogicalNetNode
isDummyExternalNode
in interface LogicalNetNode
public CategorizedUserData getCategorizedUserData()
public void setCategorizedUserData(CategorizedUserData userData)
userData
-public UserData getUserData(int category)
public void setUserData(int category, UserData userData)
userData
-public long getId()
LogicalNode
getId
in interface LogicalNode
public double getCost()
LogicalNode
getCost
in interface LogicalNode
public void setCost(double cost)
LogicalNode
setCost
in interface LogicalNode
cost
- node costpublic int getMaxLinkLevel()
LogicalNode
getMaxLinkLevel
in interface LogicalNode
public void setMaxLinkLevel(int maxLinkLevel)
LogicalNode
setMaxLinkLevel
in interface LogicalNode
maxLinkLevel
- maximum link level of the links incident to this nodepublic boolean isActive()
LogicalNode
isActive
in interface LogicalNode
public void setIsActive(boolean isActive)
LogicalNode
setIsActive
in interface LogicalNode
isActive
- true if the node is active; false otherwise.public void update(LogicalNode node)
LogicalNode
update
in interface LogicalNode
node
- node containing the attributes to copy frompublic CategorizedUserData getCategorizedUserData()
public void setCategorizedUserData(CategorizedUserData cud)
public UserData getUserData(int category)
public void setUserData(int category, UserData userData)