proper.xml
Class Comment

java.lang.Object
  extended by proper.xml.Node
      extended by proper.xml.Comment
All Implemented Interfaces:
javax.swing.tree.MutableTreeNode, javax.swing.tree.TreeNode

public class Comment
extends Node

This class represents an XML comment.

Version:
$Revision: 1.2 $
Author:
FracPete

Constructor Summary
Comment()
          initializes an empty comment with no parent
Comment(Node parent)
          initializes an empty comment with the given parent
Comment(Node parent, java.lang.String content)
          initializes an comment
Comment(java.lang.String content)
          initializes an comment with no parent and this content
 
Method Summary
 java.util.Enumeration children()
          Returns the children of the receiver as an Enumeration.
 boolean getAllowsChildren()
          Returns true if the receiver allows children.
 javax.swing.tree.TreeNode getChildAt(int childIndex)
          Returns the child TreeNode at index childIndex.
 int getChildCount()
          Returns the number of children TreeNodes the receiver contains.
 java.lang.String getContent()
          returns the content of the comment
 int getIndex(javax.swing.tree.TreeNode node)
          Returns the index of node in the receivers children.
 void insert(javax.swing.tree.MutableTreeNode child, int index)
          Adds child to the receiver at index.
 boolean isLeaf()
          Returns true if the receiver is a leaf.
 void remove(int index)
          Removes the child at index from the receiver.
 void remove(javax.swing.tree.MutableTreeNode node)
          Removes node from the receiver.
 void setContent(java.lang.String content)
          sets the content of the comment
 java.lang.String toString()
          the comment as XML string
 
Methods inherited from class proper.xml.Node
getDepth, getIndention, getParent, getRoot, isContainer, removeFromParent, setIndention, setIsContainer, setParent, setUserObject
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Comment

public Comment()
initializes an empty comment with no parent


Comment

public Comment(Node parent)
initializes an empty comment with the given parent


Comment

public Comment(java.lang.String content)
initializes an comment with no parent and this content


Comment

public Comment(Node parent,
               java.lang.String content)
initializes an comment

Method Detail

setContent

public void setContent(java.lang.String content)
sets the content of the comment


getContent

public java.lang.String getContent()
returns the content of the comment


children

public java.util.Enumeration children()
Returns the children of the receiver as an Enumeration. (= NULL!)

Specified by:
children in interface javax.swing.tree.TreeNode
Specified by:
children in class Node

getAllowsChildren

public boolean getAllowsChildren()
Returns true if the receiver allows children. (= false)

Specified by:
getAllowsChildren in interface javax.swing.tree.TreeNode
Specified by:
getAllowsChildren in class Node

getChildAt

public javax.swing.tree.TreeNode getChildAt(int childIndex)
Returns the child TreeNode at index childIndex. (= NULL!)

Specified by:
getChildAt in interface javax.swing.tree.TreeNode
Specified by:
getChildAt in class Node

getChildCount

public int getChildCount()
Returns the number of children TreeNodes the receiver contains. (= 0)

Specified by:
getChildCount in interface javax.swing.tree.TreeNode
Specified by:
getChildCount in class Node

getIndex

public int getIndex(javax.swing.tree.TreeNode node)
Returns the index of node in the receivers children. (= -1)

Specified by:
getIndex in interface javax.swing.tree.TreeNode
Specified by:
getIndex in class Node

isLeaf

public boolean isLeaf()
Returns true if the receiver is a leaf. (= true)

Specified by:
isLeaf in interface javax.swing.tree.TreeNode
Specified by:
isLeaf in class Node

insert

public void insert(javax.swing.tree.MutableTreeNode child,
                   int index)
Adds child to the receiver at index. (ignored!)

Specified by:
insert in interface javax.swing.tree.MutableTreeNode
Specified by:
insert in class Node

remove

public void remove(int index)
Removes the child at index from the receiver. (ignored!)

Specified by:
remove in interface javax.swing.tree.MutableTreeNode
Specified by:
remove in class Node

remove

public void remove(javax.swing.tree.MutableTreeNode node)
Removes node from the receiver. (ignored!)

Specified by:
remove in interface javax.swing.tree.MutableTreeNode
Specified by:
remove in class Node

toString

public java.lang.String toString()
the comment as XML string

Overrides:
toString in class java.lang.Object