xmltool.gui
Class Node

java.lang.Object
  |
  +--xmltool.gui.Node

public class Node
extends java.lang.Object

The Node class allows nodes to be created. It is a data structure for query elements.


Field Summary
 java.lang.String alpha
          Scale parameter (e.g., mean)
 java.lang.String beta
          Shape parameter (e.g., variance)
 java.awt.Color color
          Color of node
 java.lang.String fileName
          Name of file of node
 QCurve[] inEdge
          Number of incoming edges
 java.awt.Point location
          Position of node (coordinates of top left)
static int MAX_LEVEL
           
static int N_QUERY
           
 java.lang.String nodeName
          Name of node
 int nodeType
          Type of node (QUERY ..
 int numInEdges
          Number of incoming edges
 int numOutEdges
          Number of outgoing edges
 java.lang.String numTokens
          Initial number of tokens (service units)
static int OUT_DIAMETER
           
 QCurve[] outEdge
          Array of outgoing edges
 java.lang.String[] outProb
          Probability of taking each outgoing edge
 ParsedData parsedData
           
 java.awt.Polygon polyg
          Complete coordinates of node
static java.awt.Point T_QUERY
           
static int TOK_DIAMETER
           
static int TOK_RADIUS
           
static int[] X_QUERY
           
static int[] Y_QUERY
           
 
Constructor Summary
Node()
          Construct an empty node.
Node(int nodeType, java.awt.Point location)
          Construct and initialize a node.
 
Method Summary
 int getDialogsCount()
          Get dialog count
static int getQueryCount()
          Get methods for the counters (e.g., getQueryCount for queries).
 java.lang.String getRoot()
          Return the name of the root of the DTD.
 void incrementDialogsCount()
          Increment dialog count, i.e.
 ParsedData isParsed(java.lang.String string)
          Returns the reference of the ParsedData if it occurs more than once in the DTD, so that we dont have infinite looping.
 void loadNode(java.io.ObjectInputStream in)
          Load this node's state.
 void loadNodeParsedData(java.io.ObjectInputStream in, ParsedData pd)
          Load this node's Parsed Data state.
 void makeLinks(ParsedData pd)
          Method to make links for parent element to know its sub elements, if this element has already been parsed before and if it has subelements
 ParsedData recursiveIsParsed(ParsedData pd, java.lang.String string)
          This is doing the recursive job of traversing through the data structures and returns the answer needed by isParsed
static void reset()
          Reset the counters.
 void saveNode(java.io.ObjectOutputStream out)
          Save this node's state.
 void saveNodeParsedData(java.io.ObjectOutputStream out, ParsedData pd)
          Save this node's Parsed Data state.
 void setDialogsCount(int c)
          Set dialog count
static void setQueryCount(int c)
          Set methods for the counters (e.g., setQueryCount for queries).
 void unpack()
          Unpack the node: polyg and color are derivable from nodeType and location.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TOK_RADIUS

public static final int TOK_RADIUS

TOK_DIAMETER

public static final int TOK_DIAMETER

OUT_DIAMETER

public static final int OUT_DIAMETER

X_QUERY

public static final int[] X_QUERY

Y_QUERY

public static final int[] Y_QUERY

N_QUERY

public static final int N_QUERY

T_QUERY

public static final java.awt.Point T_QUERY

nodeType

public int nodeType
Type of node (QUERY .. UPDATE)

location

public java.awt.Point location
Position of node (coordinates of top left)

MAX_LEVEL

public static int MAX_LEVEL

color

public java.awt.Color color
Color of node

fileName

public java.lang.String fileName
Name of file of node

nodeName

public java.lang.String nodeName
Name of node

parsedData

public ParsedData parsedData

numTokens

public java.lang.String numTokens
Initial number of tokens (service units)

alpha

public java.lang.String alpha
Scale parameter (e.g., mean)

beta

public java.lang.String beta
Shape parameter (e.g., variance)

numOutEdges

public int numOutEdges
Number of outgoing edges

outEdge

public QCurve[] outEdge
Array of outgoing edges

outProb

public java.lang.String[] outProb
Probability of taking each outgoing edge

numInEdges

public int numInEdges
Number of incoming edges

inEdge

public QCurve[] inEdge
Number of incoming edges

polyg

public java.awt.Polygon polyg
Complete coordinates of node
Constructor Detail

Node

public Node()
Construct an empty node.

Node

public Node(int nodeType,
            java.awt.Point location)
Construct and initialize a node.
Parameters:
nodeType - type of node
location - location (top left) of node
Method Detail

reset

public static void reset()
Reset the counters.

getRoot

public java.lang.String getRoot()
Return the name of the root of the DTD.

setQueryCount

public static void setQueryCount(int c)
Set methods for the counters (e.g., setQueryCount for queries).

getQueryCount

public static int getQueryCount()
Get methods for the counters (e.g., getQueryCount for queries).

unpack

public void unpack()
Unpack the node: polyg and color are derivable from nodeType and location.

saveNode

public void saveNode(java.io.ObjectOutputStream out)
              throws java.io.IOException
Save this node's state.
Parameters:
out - output stream
Throws:
java.io.IOException - can't write output

saveNodeParsedData

public void saveNodeParsedData(java.io.ObjectOutputStream out,
                               ParsedData pd)
                        throws java.io.IOException
Save this node's Parsed Data state.
Parameters:
out - output stream
Throws:
java.io.IOException - can't write output

incrementDialogsCount

public void incrementDialogsCount()
Increment dialog count, i.e. number of windows popped up for this node

getDialogsCount

public int getDialogsCount()
Get dialog count

setDialogsCount

public void setDialogsCount(int c)
Set dialog count

loadNode

public void loadNode(java.io.ObjectInputStream in)
              throws java.io.IOException,
                     java.lang.ClassNotFoundException
Load this node's state.
Parameters:
in - input stream
Throws:
java.io.IOException - can't read input
java.lang.ClassNotFoundException - can't find class

loadNodeParsedData

public void loadNodeParsedData(java.io.ObjectInputStream in,
                               ParsedData pd)
                        throws java.io.IOException,
                               java.lang.ClassNotFoundException
Load this node's Parsed Data state.
Parameters:
in - input stream
Throws:
java.io.IOException - can't read input
java.io.IOException - can't find class

makeLinks

public void makeLinks(ParsedData pd)
Method to make links for parent element to know its sub elements, if this element has already been parsed before and if it has subelements
Parameters:
pd - ParsedData under consideration

isParsed

public ParsedData isParsed(java.lang.String string)
Returns the reference of the ParsedData if it occurs more than once in the DTD, so that we dont have infinite looping. This reference is then cloned and used as needed at runtime
Parameters:
string - name of element as in the DTD
Returns:
ParsedData The ParsedData reference which is the child of the element string, if there is one, else null

recursiveIsParsed

public ParsedData recursiveIsParsed(ParsedData pd,
                                    java.lang.String string)
This is doing the recursive job of traversing through the data structures and returns the answer needed by isParsed
Parameters:
pd - ParsedData for whom links are to be made as in isParsed
string - element name
Returns:
ParsedData The ParsedData reference which is the child of the element string, if there is one, else null