mwalk Platform 0.3.0

mwalk.core
Class TreeNode

java.lang.Object
  |
  +--mwalk.core.TreeNode
Direct Known Subclasses:
Receiver, Router, Source

public abstract class TreeNode
extends java.lang.Object
implements java.io.Serializable

An abstract class representing a node in the tree.

Version:
1.0
Author:
Robert Chalmers
See Also:
Serialized Form

Field Summary
 boolean active
          Flag indicating randomly chosen activity
protected  java.util.Hashtable children
          List of child nodes hashed by IP
 java.util.Hashtable data
          Storage available to visitors to store partial results
protected  java.lang.String ip
          IP address of node
protected  java.util.Hashtable parents
          List of parent nodes hashed by IP
(package private) static long serialVersionUID
          Serialized version ID
 
Constructor Summary
TreeNode(java.lang.String ip)
          Constructor.
 
Method Summary
 void activateLink(TreeNode child, long time, long next)
           
 TreeNode addChild(TreeNode child)
           
protected  Link addChildLink(TreeNode child)
           
 TreeNode addParent(TreeNode parent)
           
 int children()
          Return the numbmer of children.
 void clearData()
           
 long deactivateLink(TreeNode child, long time)
           
 void delChild(TreeNode child)
           
 void delParent(TreeNode parent)
           
 boolean equals(java.lang.String check)
           
 boolean equals(TreeNode node)
           
 TreeNode[] getActiveChildren(ActivityEvaluator eval)
           
 TreeNode[] getActiveChildren(ActivityEvaluator eval, long time)
           
 Link[] getActiveLinks(ActivityEvaluator eval)
           
 Link[] getActiveLinks(ActivityEvaluator eval, long time)
           
protected  java.util.Vector getActiveList(ActivityEvaluator eval, long time)
           
 Link getChildLink(TreeNode child)
           
 Link[] getChildLinks()
           
 TreeNode[] getChildren()
          Return a list of this node's children.
 java.lang.String getIP()
          Return the node's IP address.
 TreeNode[] getParents()
          Return a list of this node's parents.
 boolean hasChild(java.lang.String ip)
          Check whether this node has a particular child.
 boolean hasParent(java.lang.String ip)
          Check whether this node has a particular parent.
 int parents()
          Return the numbmer of parents.
private  void readObject(java.io.ObjectInputStream in)
          Initialize transient variables after reading the object in.
static Link[] toLinkArray(java.util.Enumeration list, int size)
           
static TreeNode[] toNodeArray(java.util.Enumeration list, int size)
           
static java.util.Vector toNodeVector(java.util.Enumeration list, int size)
           
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

serialVersionUID

static final long serialVersionUID
Serialized version ID

ip

protected java.lang.String ip
IP address of node

parents

protected java.util.Hashtable parents
List of parent nodes hashed by IP

children

protected java.util.Hashtable children
List of child nodes hashed by IP

active

public transient boolean active
Flag indicating randomly chosen activity

data

public transient java.util.Hashtable data
Storage available to visitors to store partial results
Constructor Detail

TreeNode

public TreeNode(java.lang.String ip)
Constructor.
Parameters:
String - node's IP address
Method Detail

getIP

public java.lang.String getIP()
Return the node's IP address.
Returns:
String node's IP address

hasParent

public boolean hasParent(java.lang.String ip)
Check whether this node has a particular parent.
Parameters:
String - address of parent
Returns:
boolean whether node has this parent

parents

public int parents()
Return the numbmer of parents.
Returns:
int number of parents

getParents

public TreeNode[] getParents()
Return a list of this node's parents.
Returns:
TreeNode[] list of parents

hasChild

public boolean hasChild(java.lang.String ip)
Check whether this node has a particular child.
Parameters:
String - address of child
Returns:
boolean whether node has this child

children

public int children()
Return the numbmer of children.
Returns:
int number of children

getChildren

public TreeNode[] getChildren()
Return a list of this node's children.
Returns:
TreeNode[] list of children

getChildLink

public Link getChildLink(TreeNode child)

getChildLinks

public Link[] getChildLinks()

addParent

public TreeNode addParent(TreeNode parent)

addChild

public TreeNode addChild(TreeNode child)

addChildLink

protected Link addChildLink(TreeNode child)

delParent

public void delParent(TreeNode parent)

delChild

public void delChild(TreeNode child)

activateLink

public void activateLink(TreeNode child,
                         long time,
                         long next)
                  throws BuildException

deactivateLink

public long deactivateLink(TreeNode child,
                           long time)
                    throws BuildException

getActiveChildren

public TreeNode[] getActiveChildren(ActivityEvaluator eval)

getActiveChildren

public TreeNode[] getActiveChildren(ActivityEvaluator eval,
                                    long time)

getActiveLinks

public Link[] getActiveLinks(ActivityEvaluator eval)

getActiveLinks

public Link[] getActiveLinks(ActivityEvaluator eval,
                             long time)

getActiveList

protected java.util.Vector getActiveList(ActivityEvaluator eval,
                                         long time)

clearData

public void clearData()

equals

public boolean equals(TreeNode node)

equals

public boolean equals(java.lang.String check)

toNodeVector

public static java.util.Vector toNodeVector(java.util.Enumeration list,
                                            int size)

toNodeArray

public static TreeNode[] toNodeArray(java.util.Enumeration list,
                                     int size)

toLinkArray

public static Link[] toLinkArray(java.util.Enumeration list,
                                 int size)

readObject

private void readObject(java.io.ObjectInputStream in)
                 throws java.io.IOException,
                        java.lang.ClassNotFoundException
Initialize transient variables after reading the object in.
Parameters:
ObjectInputStream - input stream
Throws:
IOException - if object not read correctly

mwalk Platform 0.3.0

Submit a bug or feature mwalk Platform API Specification 0.3.0
Sensitivity: {Public:Research}
Copyright(c) 2000, Robert Chalmers