de.dante.extex.scanner.type.token
Class CrToken

java.lang.Object
  extended byde.dante.extex.scanner.type.token.AbstractToken
      extended byde.dante.extex.scanner.type.token.CrToken
All Implemented Interfaces:
java.io.Serializable, Token

public class CrToken
extends AbstractToken
implements Token

This class represents a cr token.

This class has a protected constructor only. Use the factory TokenFactory to get an instance of this class.

Version:
$Revision: 1.6 $
Author:
Gerd Neugebauer
See Also:
Serialized Form

Field Summary
protected static long serialVersionUID
          The constant serialVersionUID contains the id for serialization.
 
Constructor Summary
protected CrToken(UnicodeChar value)
          Creates a new object.
 
Method Summary
 boolean equals(Catcode cc, char c)
          Compare the current token with a pair of catcode and character value.
 boolean equals(Catcode cc, java.lang.String s)
          Compare the current token with a pair of catcode and String value.
 boolean equals(char c)
          Compare the current token with a character value.
 Catcode getCatcode()
          Getter for the catcode.
 java.lang.String toString()
          Get the string representation of this object for debugging purposes.
 void toString(java.lang.StringBuffer sb)
          Print the token into a StringBuffer.
 java.lang.String toText()
          This method returns the textual representation for the Token.
 java.lang.Object visit(TokenVisitor visitor, java.lang.Object arg1)
          Invoke the appropriate visit method for the current class.
 
Methods inherited from class de.dante.extex.scanner.type.token.AbstractToken
equals, getChar, getLocalizer, hashCode, isa, toText
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface de.dante.extex.scanner.type.token.Token
equals, getChar, isa, toText
 

Field Detail

serialVersionUID

protected static final long serialVersionUID
The constant serialVersionUID contains the id for serialization.

See Also:
Constant Field Values
Constructor Detail

CrToken

protected CrToken(UnicodeChar value)
Creates a new object.

Parameters:
value - the string value
Method Detail

equals

public boolean equals(Catcode cc,
                      char c)
Description copied from interface: Token
Compare the current token with a pair of catcode and character value. This pair constitutes a virtual token. They are the same if the catcode and the value are the same.

Specified by:
equals in interface Token
Overrides:
equals in class AbstractToken
See Also:
AbstractToken.equals(de.dante.extex.scanner.type.Catcode, char)

equals

public boolean equals(Catcode cc,
                      java.lang.String s)
Description copied from interface: Token
Compare the current token with a pair of catcode and String value. This pair constitutes a virtual token. They are the same if the catcode and the value are the same.

Specified by:
equals in interface Token
Overrides:
equals in class AbstractToken
See Also:
AbstractToken.equals(de.dante.extex.scanner.type.Catcode, java.lang.String)

equals

public boolean equals(char c)
Description copied from interface: Token
Compare the current token with a character value. They are the same if the values are the same.

Specified by:
equals in interface Token
Overrides:
equals in class AbstractToken
See Also:
AbstractToken.equals(char)

getCatcode

public Catcode getCatcode()
Description copied from interface: Token
Getter for the catcode.

Specified by:
getCatcode in interface Token
Specified by:
getCatcode in class AbstractToken
See Also:
Token.getCatcode()

toString

public java.lang.String toString()
Get the string representation of this object for debugging purposes.

Overrides:
toString in class AbstractToken
Returns:
the string representation
See Also:
"TeX – The Program [298]"

toString

public void toString(java.lang.StringBuffer sb)
Print the token into a StringBuffer.

Specified by:
toString in interface Token
Parameters:
sb - the target string buffer
See Also:
Token.toString(java.lang.StringBuffer)

toText

public java.lang.String toText()
Description copied from interface: Token
This method returns the textual representation for the Token. This textual representation might not contain the full information but can be used as an abbreviated form to be shown to the end user. A representation with more complete information can be received with the method toString().

Specified by:
toText in interface Token
Overrides:
toText in class AbstractToken
Returns:
the text representation
See Also:
Token.toText()

visit

public java.lang.Object visit(TokenVisitor visitor,
                              java.lang.Object arg1)
                       throws java.lang.Exception
Description copied from interface: Token
Invoke the appropriate visit method for the current class.

Specified by:
visit in interface Token
Parameters:
visitor - the calling visitor
arg1 - the first argument to pass
Returns:
the result object
Throws:
java.lang.Exception - in case of an error
See Also:
Token.visit( de.dante.extex.scanner.type.token.TokenVisitor, java.lang.Object)