xtc.tree
Class Comment

java.lang.Object
  extended by xtc.tree.Node
      extended by xtc.tree.Annotation
          extended by xtc.tree.Comment
All Implemented Interfaces:
java.lang.Iterable<java.lang.Object>, Locatable

public class Comment
extends Annotation

A source code comment.

Version:
$Revision: 1.11 $
Author:
Robert Grimm

Nested Class Summary
static class Comment.Kind
          The kind of comment.
 
Field Summary
 Comment.Kind kind
          The kind.
 java.util.List<java.lang.String> text
          The actual text, one line per list entry.
 
Constructor Summary
Comment(Comment.Kind kind, java.util.List<java.lang.String> text)
          Create a new comment.
Comment(Comment.Kind kind, java.util.List<java.lang.String> text, Node node)
          Create a new comment.
 
Method Summary
static Comment documentation(java.lang.String s)
          Create a new code documentation comment.
 boolean equals(java.lang.Object o)
           
 int hashCode()
           
 
Methods inherited from class xtc.tree.Annotation
getNode, getTokenText, innerMost, isAnnotation, setNode, strip, toAnnotation
 
Methods inherited from class xtc.tree.Node
add, add, addAll, addAll, addAll, addAll, addAllTo, addNode, contains, get, getBoolean, getBooleanProperty, getGeneric, getList, getLocation, getName, getNode, getProperty, getString, getStringProperty, hasLocation, hasName, hasProperty, hasTraversal, hasVariable, indexOf, isEmpty, isGeneric, isList, isToken, iterator, lastIndexOf, properties, remove, removeProperty, set, setLocation, setLocation, setProperty, size, toList, toString, toToken, write
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

kind

public Comment.Kind kind
The kind.


text

public java.util.List<java.lang.String> text
The actual text, one line per list entry.

Constructor Detail

Comment

public Comment(Comment.Kind kind,
               java.util.List<java.lang.String> text)
Create a new comment.

Parameters:
kind - The kind.
text - The text.

Comment

public Comment(Comment.Kind kind,
               java.util.List<java.lang.String> text,
               Node node)
Create a new comment.

Parameters:
kind - The kind.
text - The text.
node - The node.
Method Detail

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

documentation

public static Comment documentation(java.lang.String s)
Create a new code documentation comment. If the specified text is null, it is passed through.

Parameters:
s - The text of the comment, including start and end markers.
Returns:
The comment.


Copyright © 2012. All Rights Reserved.