org.jdom
Class Comment

java.lang.Object
  |
  +--org.jdom.Comment

public class Comment
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable

Comment defines behavior for an XML comment, modeled in Java. Methods allow the user to obtain the text of the comment.

Version:
1.0
Author:
Brett McLaughlin, Jason Hunter
See Also:
Serialized Form

Field Summary
protected  java.lang.String text
          Text of the Comment
 
Constructor Summary
protected Comment()
           Default, no-args constructor for implementations to use if needed.
  Comment(java.lang.String text)
           This creates the comment with the supplied text.
 
Method Summary
 java.lang.Object clone()
           This will return a clone of this Comment.
 boolean equals(java.lang.Object ob)
           This tests for equality of this Comment to the supplied Object.
 java.lang.String getSerializedForm()
           This will return the Comment in XML format, usable in an XML document.
 java.lang.String getText()
           This returns the textual data within the Comment.
 int hashCode()
           This returns the hash code for this Comment.
 Comment setText(java.lang.String text)
           This will set the value of the Comment.
 java.lang.String toString()
           This returns a String representation of the Comment, suitable for debugging.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

text

protected java.lang.String text
Text of the Comment
Constructor Detail

Comment

protected Comment()

Default, no-args constructor for implementations to use if needed.


Comment

public Comment(java.lang.String text)

This creates the comment with the supplied text.

Parameters:
text - String content of comment.
Method Detail

getText

public java.lang.String getText()

This returns the textual data within the Comment.

Returns:
String - text of comment.

setText

public Comment setText(java.lang.String text)

This will set the value of the Comment.

Parameters:
text - String text for comment.
Returns:
Comment - this Comment modified.

toString

public final java.lang.String toString()

This returns a String representation of the Comment, suitable for debugging. If the XML representation of the Comment is desired, getSerializedForm() should be used.

Returns:
String - information about the Attribute
Overrides:
toString in class java.lang.Object

getSerializedForm

public final java.lang.String getSerializedForm()

This will return the Comment in XML format, usable in an XML document.

Returns:
String - the serialized form of the Comment.

equals

public final boolean equals(java.lang.Object ob)

This tests for equality of this Comment to the supplied Object.

Parameters:
ob - Object to compare to.
Returns:
boolean - whether the Comment is equal to the supplied Object.
Overrides:
equals in class java.lang.Object

hashCode

public final int hashCode()

This returns the hash code for this Comment.

Returns:
int - hash code.
Overrides:
hashCode in class java.lang.Object

clone

public final java.lang.Object clone()

This will return a clone of this Comment.

Returns:
Object - clone of this Comment.
Overrides:
clone in class java.lang.Object


Copyright © 2000 Brett McLaughlin, Jason Hunter. All Rights Reserved.