Gridarta Editor
Public Member Functions | Private Attributes | Static Private Attributes | List of all members
net.sf.gridarta.textedit.textarea.tokenmarker.Node Class Reference
Collaboration diagram for net.sf.gridarta.textedit.textarea.tokenmarker.Node:
Collaboration graph

Public Member Functions

Node define (final char ch)
 
byte getId ()
 
Node lookup (final char ch)
 
void setId (final byte id)
 

Private Attributes

byte id = Token.NULL
 
final Node[] nodes = new Node[MAX - MIN + 1]
 

Static Private Attributes

static final char MAX = 'z'
 
static final char MIN = 'A'
 

Detailed Description

A node in the tree that is used to store all key-value pairs.

Author
Andreas Kirschbaum

Definition at line 30 of file Node.java.

Member Function Documentation

◆ define()

Node net.sf.gridarta.textedit.textarea.tokenmarker.Node.define ( final char  ch)

Looks up or defines the next node for a given character.

Parameters
chthe character
Returns
the next node
Exceptions
IndexOutOfBoundsExceptionif the character is not withing ..

Definition at line 63 of file Node.java.

References net.sf.gridarta.textedit.textarea.tokenmarker.Node.MIN, and net.sf.gridarta.textedit.textarea.tokenmarker.Node.nodes.

Referenced by net.sf.gridarta.textedit.textarea.tokenmarker.KeywordMap.add().

Here is the caller graph for this function:

◆ getId()

byte net.sf.gridarta.textedit.textarea.tokenmarker.Node.getId ( )

Returns the id for this node.

Returns
this id, or
token.NULL
if no key matches this node

Definition at line 93 of file Node.java.

References net.sf.gridarta.textedit.textarea.tokenmarker.Node.id.

Referenced by net.sf.gridarta.textedit.textarea.tokenmarker.KeywordMap.lookup().

Here is the caller graph for this function:

◆ lookup()

Node net.sf.gridarta.textedit.textarea.tokenmarker.Node.lookup ( final char  ch)

Looks up the next node for a given character.

Parameters
chthe character
Returns
the next node, or
null
if no key matching exists

Definition at line 77 of file Node.java.

References net.sf.gridarta.textedit.textarea.tokenmarker.Node.MAX, net.sf.gridarta.textedit.textarea.tokenmarker.Node.MIN, and net.sf.gridarta.textedit.textarea.tokenmarker.Node.nodes.

Referenced by net.sf.gridarta.textedit.textarea.tokenmarker.KeywordMap.lookup().

Here is the caller graph for this function:

◆ setId()

void net.sf.gridarta.textedit.textarea.tokenmarker.Node.setId ( final byte  id)

Sets the id to return for this node.

Parameters
idthe ide to set

Definition at line 85 of file Node.java.

References net.sf.gridarta.textedit.textarea.tokenmarker.Node.id.

Referenced by net.sf.gridarta.textedit.textarea.tokenmarker.KeywordMap.add().

Here is the caller graph for this function:

Member Data Documentation

◆ id

byte net.sf.gridarta.textedit.textarea.tokenmarker.Node.id = Token.NULL
private

The id for the key matching the path between the root node and this node.

Definition at line 46 of file Node.java.

Referenced by net.sf.gridarta.textedit.textarea.tokenmarker.Node.getId(), and net.sf.gridarta.textedit.textarea.tokenmarker.Node.setId().

◆ MAX

final char net.sf.gridarta.textedit.textarea.tokenmarker.Node.MAX = 'z'
staticprivate

The maximal character code usable in keys.

Definition at line 40 of file Node.java.

Referenced by net.sf.gridarta.textedit.textarea.tokenmarker.Node.lookup().

◆ MIN

final char net.sf.gridarta.textedit.textarea.tokenmarker.Node.MIN = 'A'
staticprivate

The minimal character code usable in keys.

Definition at line 35 of file Node.java.

Referenced by net.sf.gridarta.textedit.textarea.tokenmarker.Node.define(), and net.sf.gridarta.textedit.textarea.tokenmarker.Node.lookup().

◆ nodes

final Node [] net.sf.gridarta.textedit.textarea.tokenmarker.Node.nodes = new Node[MAX - MIN + 1]
private

The next nodes, or

null

if no next node exists. The index is

0

for MIN.

Definition at line 53 of file Node.java.

Referenced by net.sf.gridarta.textedit.textarea.tokenmarker.Node.define(), and net.sf.gridarta.textedit.textarea.tokenmarker.Node.lookup().


The documentation for this class was generated from the following file:
net.sf.gridarta.textedit.textarea.tokenmarker.Node.MAX
static final char MAX
Definition: Node.java:40
net.sf.gridarta.textedit.textarea.tokenmarker.Node.MIN
static final char MIN
Definition: Node.java:35