org.caida.otter
Class GraphNode

java.lang.Object
  |
  +--org.caida.otter.GraphNode

public class GraphNode
extends java.lang.Object

A node in a directed graph.


Constructor Summary
GraphNode(java.lang.String name)
          Make a new node w/ no children
GraphNode(java.lang.String name, float latitude, float longitude)
          Make a new node w/ no children, w/ Lat Long
GraphNode(java.lang.String source, java.lang.String name, float weight)
          Make a new node w/ one child and weight
GraphNode(java.lang.String source, java.lang.String name, GraphNode new_child)
          Make a new node w/ one child
GraphNode(java.lang.String source, java.lang.String name, GraphNode[] new_childList)
          Make a new node w/ several children
GraphNode(java.lang.String source, java.lang.String name, GraphNode[] new_childList, float weight)
          Make a new node w/ several children and weight
GraphNode(java.lang.String source, java.lang.String name, GraphNode[] new_childList, float latitude, float longitude)
          Make a new node w/ several children, w/ Lat Long
GraphNode(java.lang.String source, java.lang.String name, GraphNode[] new_childList, float latitude, float longitude, float weight)
          Make a new node w/ several children, w/ Lat Long and weight
GraphNode(java.lang.String source, java.lang.String name, GraphNode new_child, float weight)
          Make a new node w/ one child and weight
GraphNode(java.lang.String source, java.lang.String name, GraphNode new_child, float latitude, float longitude)
          Make a new node w/ one child, w/ Lat Long
GraphNode(java.lang.String source, java.lang.String name, GraphNode new_child, float latitude, float longitude, float weight)
          Make a new node w/ one child, w/ Lat Long and weight
GraphNode(java.lang.String source, java.lang.String name, java.util.Vector new_childList)
          Make a new node w/ several children
GraphNode(java.lang.String source, java.lang.String name, java.util.Vector new_childList, float weight)
          Make a new node w/ several children and weight
GraphNode(java.lang.String source, java.lang.String name, java.util.Vector new_childList, float latitude, float longitude)
          Make a new node w/ several children, w/ Lat Long
GraphNode(java.lang.String source, java.lang.String name, java.util.Vector new_childList, float latitude, float longitude, float weight)
          Make a new node w/ several children, w/ Lat Long and weight
 
Method Summary
 void addChild(java.lang.String source, GraphNode new_child)
          Add one child to a node
 void addChild(java.lang.String source, GraphNode[] new_children)
          Add several children to a node
 void addChild(java.lang.String source, java.util.Vector new_children)
          Add several children to a node
 int calcMaxDepth()
          Calculate depth in graph for each node using the current node as the only source.
 int calcMaxDepth(java.util.Vector sourceList, java.lang.String sourceName)
          CalcMaxDepth of the graph from multiple nodes under a single source category.
 void decrementWeight(java.lang.String source, float num)
          Decrement a node's weight for a given source
 boolean equals(java.lang.Object node)
          Override equals to test name equivalence
 java.lang.String[] getAllSources()
          Get all sources that this node is used in
 int getASNumber()
          Get a node's AS Number
 java.util.Vector getChildren(java.lang.String source)
          Get a node's children for a given source if they exist
 java.lang.String getCity()
          Get a node's city
 int getDepth(java.lang.String source)
          Get a node's depth in the graph
 float getLat()
          Get a node's latitude
 float getLong()
          Get a node's longitude
 java.lang.String getName()
          Get a node's name
 GraphNode getParent(java.lang.String source)
          Get a node parent for a given source if one exists
 float getWeight(java.lang.String source)
          Get a node's weight given a source
 void incrementWeight(java.lang.String source, float num)
          Add to a node's weight for a given source
 boolean isChildOf(java.lang.String source, GraphNode node)
          Recursively check the parents to see if any of them correspond to the node given
 void mergeChildren(java.lang.String source, GraphNode ref_node)
          Merge the children for a given source.
 void setASNumber(int as_num)
          Set a node's AS number
 void setCity(java.lang.String city)
          Set a node's city
 void setDepth(java.lang.String source, int depth)
          Set a node's depth in the graph
 void setLat(float lat)
          Set a node's latitude
 void setLong(float lon)
          Set a nodes longitude
 void setParent(java.lang.String source, GraphNode parent)
          Add one parent to a node
 void validateChildren(java.lang.String source, DirectedGraph graph)
          Make sure all the children are valid children for the graph meaning that the children are contained in the graph.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GraphNode

public GraphNode(java.lang.String name)
Make a new node w/ no children

GraphNode

public GraphNode(java.lang.String source,
                 java.lang.String name,
                 GraphNode new_child)
Make a new node w/ one child

GraphNode

public GraphNode(java.lang.String source,
                 java.lang.String name,
                 GraphNode new_child,
                 float weight)
Make a new node w/ one child and weight

GraphNode

public GraphNode(java.lang.String source,
                 java.lang.String name,
                 float weight)
Make a new node w/ one child and weight

GraphNode

public GraphNode(java.lang.String source,
                 java.lang.String name,
                 GraphNode[] new_childList)
Make a new node w/ several children

GraphNode

public GraphNode(java.lang.String source,
                 java.lang.String name,
                 GraphNode[] new_childList,
                 float weight)
Make a new node w/ several children and weight

GraphNode

public GraphNode(java.lang.String source,
                 java.lang.String name,
                 java.util.Vector new_childList)
Make a new node w/ several children

GraphNode

public GraphNode(java.lang.String source,
                 java.lang.String name,
                 java.util.Vector new_childList,
                 float weight)
Make a new node w/ several children and weight

GraphNode

public GraphNode(java.lang.String name,
                 float latitude,
                 float longitude)
Make a new node w/ no children, w/ Lat Long

GraphNode

public GraphNode(java.lang.String source,
                 java.lang.String name,
                 GraphNode new_child,
                 float latitude,
                 float longitude)
Make a new node w/ one child, w/ Lat Long

GraphNode

public GraphNode(java.lang.String source,
                 java.lang.String name,
                 GraphNode new_child,
                 float latitude,
                 float longitude,
                 float weight)
Make a new node w/ one child, w/ Lat Long and weight

GraphNode

public GraphNode(java.lang.String source,
                 java.lang.String name,
                 java.util.Vector new_childList,
                 float latitude,
                 float longitude)
Make a new node w/ several children, w/ Lat Long

GraphNode

public GraphNode(java.lang.String source,
                 java.lang.String name,
                 java.util.Vector new_childList,
                 float latitude,
                 float longitude,
                 float weight)
Make a new node w/ several children, w/ Lat Long and weight

GraphNode

public GraphNode(java.lang.String source,
                 java.lang.String name,
                 GraphNode[] new_childList,
                 float latitude,
                 float longitude)
Make a new node w/ several children, w/ Lat Long

GraphNode

public GraphNode(java.lang.String source,
                 java.lang.String name,
                 GraphNode[] new_childList,
                 float latitude,
                 float longitude,
                 float weight)
Make a new node w/ several children, w/ Lat Long and weight
Method Detail

setParent

public void setParent(java.lang.String source,
                      GraphNode parent)
Add one parent to a node

addChild

public void addChild(java.lang.String source,
                     GraphNode new_child)
Add one child to a node

addChild

public void addChild(java.lang.String source,
                     java.util.Vector new_children)
Add several children to a node

addChild

public void addChild(java.lang.String source,
                     GraphNode[] new_children)
Add several children to a node

equals

public boolean equals(java.lang.Object node)
Override equals to test name equivalence
Overrides:
equals in class java.lang.Object

getParent

public GraphNode getParent(java.lang.String source)
Get a node parent for a given source if one exists

getChildren

public java.util.Vector getChildren(java.lang.String source)
Get a node's children for a given source if they exist

getName

public java.lang.String getName()
Get a node's name

setDepth

public void setDepth(java.lang.String source,
                     int depth)
Set a node's depth in the graph

getDepth

public int getDepth(java.lang.String source)
Get a node's depth in the graph

getAllSources

public java.lang.String[] getAllSources()
Get all sources that this node is used in

isChildOf

public boolean isChildOf(java.lang.String source,
                         GraphNode node)
Recursively check the parents to see if any of them correspond to the node given

calcMaxDepth

public int calcMaxDepth()
Calculate depth in graph for each node using the current node as the only source.

calcMaxDepth

public int calcMaxDepth(java.util.Vector sourceList,
                        java.lang.String sourceName)
CalcMaxDepth of the graph from multiple nodes under a single source category.

mergeChildren

public void mergeChildren(java.lang.String source,
                          GraphNode ref_node)
Merge the children for a given source.

validateChildren

public void validateChildren(java.lang.String source,
                             DirectedGraph graph)
Make sure all the children are valid children for the graph meaning that the children are contained in the graph.

getLat

public float getLat()
Get a node's latitude

setLat

public void setLat(float lat)
Set a node's latitude

setASNumber

public void setASNumber(int as_num)
Set a node's AS number

getASNumber

public int getASNumber()
Get a node's AS Number

setCity

public void setCity(java.lang.String city)
Set a node's city

getCity

public java.lang.String getCity()
Get a node's city

getLong

public float getLong()
Get a node's longitude

setLong

public void setLong(float lon)
Set a nodes longitude

incrementWeight

public void incrementWeight(java.lang.String source,
                            float num)
Add to a node's weight for a given source

decrementWeight

public void decrementWeight(java.lang.String source,
                            float num)
Decrement a node's weight for a given source

getWeight

public float getWeight(java.lang.String source)
Get a node's weight given a source