# Class: com.pnfsoftware.jeb.util.encoding.jflex.Token

A Token in a Document. Tokens do NOT store a reference to the underlying SyntaxDocument, and must generally be obtained from the SyntaxDocument methods. The reason for not storing the SyntaxDocument is simply for memory, as the number of Tokens per document can be large, you may end up with twice the memory in a SyntaxDocument with Tokens than a simple PlainDocument.

## Constructor: Token
- parameter: `type`, type: `com.pnfsoftware.jeb.util.encoding.jflex.TokenType`
- parameter: `start`, type: `long`
- parameter: `length`, type: `int`

Description: Constructs a new token

## Constructor: Token
- parameter: `type`, type: `com.pnfsoftware.jeb.util.encoding.jflex.TokenType`
- parameter: `start`, type: `long`
- parameter: `length`, type: `int`
- parameter: `pairValue`, type: `byte`

Description: Construct a new part of pair token

## Field: kind
Type: `short`

Constant value: `0`
Description: The kind of the Document. This is only needed if proper Parsing of a document is needed and it makes certain operations faster. You can use any of the supplied Generic Values, or create your language specific uses by using USER\_FIRST \+ x;

## Field: length
Type: `int`

## Field: pairValue
Type: `byte`
Description: the pair value to use if this token is one of a pair: This is how it is used: The opening part will have a positive number X The closing part will have a negative number X X should be unique for a pair: e.g. for \[ pairValue = \+1 for \] pairValue = \-1

## Field: start
Type: `long`

## Field: type
Type: `com.pnfsoftware.jeb.util.encoding.jflex.TokenType`

## Method: compareTo
- parameter: `t`, type: `com.pnfsoftware.jeb.util.encoding.jflex.Token`
- return type: `int`


## Method: end
- return type: `long`

Description: return the end position of the token.
return: start \+ length

## Method: equals
- parameter: `obj`, type: `java.lang.Object`
- return type: `boolean`


## Method: hashCode
- return type: `int`


## Method: toString
- return type: `java.lang.String`


