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

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

public class ActiveCharacterToken
extends AbstractToken
implements CodeToken

This class represents an active character token. The active character token is characterized by its name. This name is a single letter string.

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 ActiveCharacterToken(UnicodeChar uc, java.lang.String theNamespace)
          Creates a new object.
 
Method Summary
 CodeToken cloneInDefaultNamespace()
          Create a new instance of the token where the namespace is the default namespace and the other attributes are the same as for the current token.
 CodeToken cloneInNamespace(java.lang.String theNamespace)
          Create a new instance of the token where the namespace is the given one.
 boolean equals(java.lang.Object other)
          Compare the current token to another token.
 Catcode getCatcode()
          Getter for the catcode.
 java.lang.String getName()
          Getter for the name.
 java.lang.String getNamespace()
          Getter for the namespace.
 int hashCode()
           
 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.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, equals, equals, getChar, getLocalizer, isa, toText, 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, equals, equals, getChar, isa, toText, toText
 

Field Detail

serialVersionUID

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

See Also:
Constant Field Values
Constructor Detail

ActiveCharacterToken

protected ActiveCharacterToken(UnicodeChar uc,
                               java.lang.String theNamespace)
Creates a new object.

Parameters:
uc - the string value
theNamespace - the namespace
Method Detail

cloneInDefaultNamespace

public CodeToken cloneInDefaultNamespace()
Description copied from interface: CodeToken
Create a new instance of the token where the namespace is the default namespace and the other attributes are the same as for the current token.

Specified by:
cloneInDefaultNamespace in interface CodeToken
Returns:
the new token
See Also:
CodeToken.cloneInDefaultNamespace()

cloneInNamespace

public CodeToken cloneInNamespace(java.lang.String theNamespace)
Create a new instance of the token where the namespace is the given one.

Specified by:
cloneInNamespace in interface CodeToken
Parameters:
theNamespace - the namespace to use
Returns:
the new token
See Also:
CodeToken.cloneInNamespace( java.lang.String)

equals

public boolean equals(java.lang.Object other)
Description copied from interface: Token
Compare the current token to another 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:
Object.equals(java.lang.Object)

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()

getName

public java.lang.String getName()
Description copied from interface: CodeToken
Getter for the name. The name is the string representation without the escape character in front.

Specified by:
getName in interface CodeToken
Returns:
the name of the token
See Also:
CodeToken.getName()

getNamespace

public java.lang.String getNamespace()
Description copied from interface: CodeToken
Getter for the namespace.

Specified by:
getNamespace in interface CodeToken
Returns:
the namespace
See Also:
CodeToken.getNamespace()

hashCode

public int hashCode()
Overrides:
hashCode in class AbstractToken
See Also:
Object.hashCode()

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

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)

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)