Class semper.transfer.Node
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class semper.transfer.Node

java.lang.Object
   |
   +----semper.transfer.Node

public class Node
extends Object
implements Streamable
This class is the basic datatype building a container. It has two types of data: the one used for building the container structure and the one for storing information.

The main storing element is a TransferData object called node content. Also there is the node type which categorizes the node. It could be 'internal' 'payment' or 'statement'. Next There's the content description.

Another important data are the security attributes. There are two of them, one for the node itself (the NodeAttributes) and the other for the subcontainer (or subtree) called subConAttributes. The security attributes are objects of the Security class.


Variable Index

 o __nodeCount
Class variable to provide a unique identification of the node.

Constructor Index

 o Node()
Simple default Constructor without arguments.
 o Node(String)
Constructor with nodeType.

Method Index

 o delContentDescr()
Deletes the Content Description of the node.
 o delNodeAttributes(int[])
Deletes the node security attributes (all attributes are reset).
 o delNodeCont()
Deletes the Content of the node.
 o delNodeType()
Deletes the node type.
 o delSubConAttributes(int[])
Deletes the subcontainer security attributes.
 o existChild()
Tests if the children vector is empty.
 o getChildren()
Retrieves the vector that contains the reeferences to the children of the node.
 o getContainerID()
Extracts the ContainerID.
 o getContentDescr()
Extracts the Content Description of the given node.
 o getFather()
Retrieves a reference to the father node.
 o getFatherID()
Gets the father's NodeID.
 o getNodeAttributes()
Gets the node security attributes.
 o getNodeContent()
Gets the node content.
 o getNodeID()
Gets the NodeID.
 o getNodeType()
Extracts the node type.
 o getSubConAttributes()
Gets the subcontainer security attributes.
 o getTransferContent()
Getting the transfer content of the node content directly.
 o insertChild(Node)
Appends the reference to a node at the children vector.
 o makeToNode(String)
Reconverts a String to a Node
 o makeToString()
Writes the node data into a string.
 o myStreamSize()
The size of a stream made from this object is computed.
 o print()
Prints information of the Node (on STDOUT)
 o readObject(StreamInputInterface)
Reads a node from a stream.
 o setContainerID(String)
Sets the container ID of a node.
 o setContentDescr(String)
Inserts the content description into the node.
 o setFather(Node)
Sets a reference to the father in the container tree structure.
 o setFatherID(String)
The method sets the father ID of the node.
 o setNodeAttributes(int[])
Sets the node security attributes.
 o setNodeAttributes(Security)
Sets the node security attributes.
 o setNodeContent(TransferData)
Inserts the content into the node.
 o setNodeType(String)
Inserts the node type.
 o setSubConAttributes(int[])
Sets the subcontainer security attributes.
 o setSubConAttributes(Security)
Sets the subcontainer security attributes.
 o setTransferContent(String)
Sets the transfer content of the node content.
 o writeObject(StreamOutputInterface)
Writes the container into a stream.

Variables

 o __nodeCount
  public static int __nodeCount
Class variable to provide a unique identification of the node. This index is used with the prefix 'N' to build the NodeID.

Constructors

 o Node
  public Node()
Simple default Constructor without arguments. This constructor builds only a new NodeId. The other elements contain no data. The Security objects use the default constructor, so all the attributes are not set.
 o Node
  public Node(String NodeType)
Constructor with nodeType. The same constructor as above, only the nodeType is set to the parameter string. There is no check of the validity of this string. All security attributes are false.
Parameters:
NodeType - specifies the node type (i.e statement)

Methods

 o getNodeID
  public String getNodeID()
Gets the NodeID.
Returns:
the node ID
 o getFatherID
  public String getFatherID()
Gets the father's NodeID.
Returns:
a unique name of the node's father
 o setFatherID
  protected void setFatherID(String father_ID)
The method sets the father ID of the node. This ID is important for the building of containers.
Parameters:
father_ID - a unique name of the node's father
See Also:
Container
 o setContainerID
  public void setContainerID(String ContainerID)
Sets the container ID of a node.
 o getContainerID
  public String getContainerID()
Extracts the ContainerID.
Returns:
the container ID
 o setNodeType
  public void setNodeType(String NodeType)
Inserts the node type.
Parameters:
NodeType - specifies the node type (i.e statement)
 o getNodeType
  public String getNodeType()
Extracts the node type.
Returns:
the node type (i.e statement)
 o delNodeType
  public void delNodeType()
Deletes the node type.
 o setNodeContent
  public void setNodeContent(TransferData NodeContent)
Inserts the content into the node. The nodeType is a TransferData object which is quiet the same as a CLContentData object, only it extends the Streamable class.
Parameters:
NodeContent - the data wich is transfered by this node
 o setTransferContent
  public void setTransferContent(String transfer_content)
Sets the transfer content of the node content. This is a shortway setting the transfer content. It is not necessary to get first the node content and then set the transfer content and then write it back.
Parameters:
transfer_content - the contend of the node
See Also:
TransferData
 o getTransferContent
  public String getTransferContent()
Getting the transfer content of the node content directly.
Returns:
the data which is transfered by this Node
See Also:
TransferData
 o getNodeContent
  public TransferData getNodeContent()
Gets the node content. The node content is a TransferData Object.
Returns:
the data which is transfered by this Node
See Also:
TransferData, getTransferContent
 o delNodeCont
  public void delNodeCont()
Deletes the Content of the node.
 o setContentDescr
  public void setContentDescr(String ContentDescr)
Inserts the content description into the node.
Parameters:
ContentDescr - a description about the data which is transfered by this Node
 o getContentDescr
  public String getContentDescr()
Extracts the Content Description of the given node.
Returns:
a description about the data which is transfered by this Node
 o delContentDescr
  public void delContentDescr()
Deletes the Content Description of the node.
 o setNodeAttributes
  public void setNodeAttributes(int Attribute_list[])
Sets the node security attributes. You can give a list of attributes you want to be set. For example you want MESSAGE_CONFIDENTIALITY and ANONIMITY_BY_ALIAS you have to give an integer array [0, 3] as parameter. Of course the array should not be larger than SEC_ATTR_MAX.
Parameters:
Attribute_list - an array which holds the security attributes
See Also:
Security
 o setNodeAttributes
  public void setNodeAttributes(Security SecAttr)
Sets the node security attributes.
Parameters:
SecAttr - describes the security features to be used at the transaction
See Also:
Security
 o getNodeAttributes
  public Security getNodeAttributes()
Gets the node security attributes. The returned value is a copy of the attributes not a reference!
Returns:
an object of the class Security that describes the security features to be used at the transaction
See Also:
Security
 o delNodeAttributes
  public void delNodeAttributes(int Attribute_list[])
Deletes the node security attributes (all attributes are reset).
Parameters:
Attribute_list - an array of that describes the security features to be used at the transaction
See Also:
Security
 o setSubConAttributes
  public void setSubConAttributes(int Attribute_list[])
Sets the subcontainer security attributes. For detailed explanation see setNodeAttributes(int[] Attribute_list).
Parameters:
Attribute_list - an array of that describes the security features to be used at the transaction
See Also:
Security
 o setSubConAttributes
  public void setSubConAttributes(Security SecAttr)
Sets the subcontainer security attributes.
Parameters:
SecAttr - describes the security features to be used at the transaction
See Also:
Security
 o getSubConAttributes
  public Security getSubConAttributes()
Gets the subcontainer security attributes. The returned value is a copy of the attributes not a reference!
Returns:
an object of the class Security that describes the security features to be used at the transaction
See Also:
Security
 o delSubConAttributes
  public void delSubConAttributes(int Attribute_list[])
Deletes the subcontainer security attributes.
Parameters:
Attribute_list - an array of that describes the security features to be used at the transaction
 o insertChild
  public void insertChild(Node Child)
Appends the reference to a node at the children vector.
Parameters:
Child - the child to be inserted
 o getChildren
  public Vector getChildren()
Retrieves the vector that contains the reeferences to the children of the node.
Returns:
a vector which holds the children of this node
 o existChild
  public boolean existChild()
Tests if the children vector is empty.
Returns:
true if the node has any child
 o setFather
  public void setFather(Node Father)
Sets a reference to the father in the container tree structure. If the param node is null, this node has no father (for example the root of a container or a single node) and the father ID is set to the node's ID. Else the father ID of the node is set to node ID of the param node.
Parameters:
Father - the node that is set as this node's father
 o getFather
  public Node getFather()
Retrieves a reference to the father node.
Returns:
the node that is set as this node's father
 o writeObject
  public void writeObject(StreamOutputInterface s) throws StreamIOException
Writes the container into a stream. All the data of a node is written into a stream which can then be wrote into a file, socket or string.
Parameters:
stream - the stream of data the object state is recorded in
Throws: StreamIOException
If a subobject does not implement the Streamable interface.
 o readObject
  public void readObject(StreamInputInterface s) throws StreamIOException
Reads a node from a stream. This method can read a node out of a file, socket or string.
Parameters:
stream - the stream of data the object state is retrieved from
Throws: StreamIOException
If a class is not present or the input data is corrupt
 o myStreamSize
  public int myStreamSize() throws StreamIOException
The size of a stream made from this object is computed. There is one byte added for version number of the communication block.
Returns:
the size of the stream
Throws: StreamIOException
if the size of a Node could not be got
 o makeToString
  public String makeToString() throws StreamIOException
Writes the node data into a string.
Returns:
the String made of this node
Throws: StreamIOException
is thrown if an error occurse during creating or accessing the Stream classes
 o makeToNode
  public void makeToNode(String string) throws StreamIOException
Reconverts a String to a Node
Parameters:
string - the String to be converted
Throws: StreamIOException
is thrown if an error occurse during creating or accessing the Stream classes
 o print
  public void print()
Prints information of the Node (on STDOUT)

All Packages  Class Hierarchy  This Package  Previous  Next  Index