org.eclipse.mtl.parser.cst.utils
Class Region

java.lang.Object
  extended by org.eclipse.mtl.parser.cst.utils.Region

public class Region
extends java.lang.Object

A region with a beginning index and an ending index.


Field Summary
static Region NOT_FOUND
          To specify that the region doesn't exist.
 
Constructor Summary
Region(int b, int e, Sequence sequence)
          Constructor.
 
Method Summary
 int b()
          Gets the beginning index.
static Region[] createPositions(int length)
          Initializes a table of region.
 int e()
          Gets the ending index.
 boolean equals(java.lang.Object arg0)
          
 Sequence getSequence()
          Gets the sequence used to match the region.
 int hashCode()
          
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

NOT_FOUND

public static final Region NOT_FOUND
To specify that the region doesn't exist.

Constructor Detail

Region

public Region(int b,
              int e,
              Sequence sequence)
Constructor.

Parameters:
b - is the beginning index of a substring
e - is the ending index of a substring
sequence - is the sequence used to match the region
Method Detail

b

public int b()
Gets the beginning index.

Returns:
the beginning index.

e

public int e()
Gets the ending index.

Returns:
the ending index.

getSequence

public Sequence getSequence()
Gets the sequence used to match the region.

Returns:
the sequence used to match the region

equals

public boolean equals(java.lang.Object arg0)

Overrides:
equals in class java.lang.Object
See Also:
Object.equals(java.lang.Object)

hashCode

public int hashCode()

Overrides:
hashCode in class java.lang.Object
See Also:
Object.hashCode()

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object
See Also:
Object.toString()

createPositions

public static Region[] createPositions(int length)
Initializes a table of region.

Parameters:
length - is the length of the table to create
Returns:
the table, each element is a Region(-2, -2, null)

Copyright 2008 Obeo
All Rights Reserved.