gdl.base
Class ContentParser

java.lang.Object
  extended by gdl.base.ContentParser

public class ContentParser
extends java.lang.Object

A simple XML parser to transform XML input into da 2D adjacence matrix and prepare a list of nodes and node ids Furthermode, a tree model for the content JTree is initialised based upon the source.

Author:
Martin Suntinger

Constructor Summary
ContentParser(ParsingManager pm, java.lang.Object sizeConfigSet, ConnectionTypeSet connectionSet, java.lang.String connectionTypeAttribute)
           
 
Method Summary
 int[][] getAdMatrix()
          This function can be called to obtain the adjacence matrix of the current graph
 java.util.LinkedList getAllNodeIDs()
          returns a list of all nodes IDs that could be parsed.
 java.util.LinkedList getAllNodes()
          returns a list of all nodes that could be parsed.
 void parse()
          invokes the parsing process: the matrix is stored in member variables, the list of all Nodes is initialised and prepared
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContentParser

public ContentParser(ParsingManager pm,
                     java.lang.Object sizeConfigSet,
                     ConnectionTypeSet connectionSet,
                     java.lang.String connectionTypeAttribute)
Parameters:
pm - the parsing manager that hold several parsing and wizard input information
sizeConfigSet - the size config set to use initially when initializing ContentNode objects
connectionSet - the currently active connection configuration
connectionTypeAttribute - the xml attrbiute that should be interpreted as the type of connection
Method Detail

parse

public void parse()
invokes the parsing process: the matrix is stored in member variables, the list of all Nodes is initialised and prepared


getAllNodes

public java.util.LinkedList getAllNodes()
returns a list of all nodes that could be parsed. This list contains ContentNode objects

Returns:
all content nodes as a java.util.LinkedList

getAdMatrix

public int[][] getAdMatrix()
This function can be called to obtain the adjacence matrix of the current graph

Returns:
the adjacence matrix of the graph

getAllNodeIDs

public java.util.LinkedList getAllNodeIDs()
returns a list of all nodes IDs that could be parsed.

Returns:
all content nodes IDs as String Objects in a java.util.LinkedList