Data Request Broker
2-3-release

fr.gael.drb.query
Class TokenElement

java.lang.Object
  extended by fr.gael.drb.query.TokenElement
All Implemented Interfaces:
Serializable

public class TokenElement
extends Object
implements Serializable

Simple class to represent a lexical token. This wraps the QueryParserConstants used by the scanner to provide a convenient class that can be stored as a attribute value.

See Also:
Serialized Form

Field Summary
static Object TOKEN_ATTRIBUTE
          Key to be used in AttributeSet's holding a value of TokenElement.
 
Method Summary
 boolean equals(Object obj)
          Compares this object to the specifed object.
 String getCategory()
          Specifies the category of the token as a string that can be used as a label.
 Color getColor()
          TokenElement color accessor.
 Font getFont()
          TokenElement font accessor.
 int getScanValue()
          Numeric value of this token.
 Style getStyle()
          TokenElement style accessor.
 int hashCode()
          Returns a hashcode for this set of attributes.
 void setFont(Font new_font)
          Sets the new font of this token.
 void setStyle(Style style)
          Sets this token style.
 String toString()
          A human presentable form of the token, useful for things like lists, debugging, etc.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

TOKEN_ATTRIBUTE

public static final Object TOKEN_ATTRIBUTE
Key to be used in AttributeSet's holding a value of TokenElement.

Method Detail

toString

public String toString()
A human presentable form of the token, useful for things like lists, debugging, etc.

Overrides:
toString in class Object
Returns:
the representation.

getScanValue

public int getScanValue()
Numeric value of this token. This is the value returned by the scanner and is the tie between the lexical scanner and the tokens.

Returns:
the scan value.

getColor

public Color getColor()
TokenElement color accessor.

Returns:
the color.

getFont

public Font getFont()
TokenElement font accessor.

Returns:
the font.

setFont

public void setFont(Font new_font)
Sets the new font of this token.

Parameters:
new_font - the font to be set.

setStyle

public void setStyle(Style style)
Sets this token style.

Parameters:
style - the style to be associated with this token.

getStyle

public Style getStyle()
TokenElement style accessor.

Returns:
the style associated with this token.

getCategory

public String getCategory()
Specifies the category of the token as a string that can be used as a label.

Returns:
the string name of the category.

hashCode

public final int hashCode()
Returns a hashcode for this set of attributes.

Overrides:
hashCode in class Object
Returns:
a hashcode value for this set of attributes.

equals

public final boolean equals(Object obj)
Compares this object to the specifed object. The result is true if and only if the argument is not null and is a Font object with the same name, style, and point size as this font.

Overrides:
equals in class Object
Parameters:
obj - the object to compare this font with.
Returns:
true if the objects are equal; false otherwise.

Data Request Broker - DRB API®
2-3-release

Copyright© 2001-2009 GAEL Consultant. All rights reserved. Use is subject to license terms .