analysis.parsing
Class Tuple

java.lang.Object
  extended by analysis.parsing.Tuple

public class Tuple
extends java.lang.Object

The tuple used in Earley's algorithm, consisting of a production index, a dot position at the production, a state, ahead strings and father tuples.

Author:
XZW

Field Summary
 int d
          Current position (dot)
 int p
          Index of production
 int s
          State
 
Constructor Summary
Tuple()
          Creates an instance of Tuple.
Tuple(int pv, int dv, int sv)
          Creates an instance of Tuple.
Tuple(int pv, int dv, int sv, Tuple father)
          Creates an instance of Tuple.
 
Method Summary
 void addFather(Tuple father)
          Adds a tuple to the father tuple list.
 boolean equals(java.lang.Object obj)
           
 Tuple[] getFathers()
          Returns the fathers
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

p

public int p
Index of production


d

public int d
Current position (dot)


s

public int s
State

Constructor Detail

Tuple

public Tuple()
Creates an instance of Tuple.


Tuple

public Tuple(int pv,
             int dv,
             int sv)
Creates an instance of Tuple.

Parameters:
pv - production index
dv - dot position
sv - state

Tuple

public Tuple(int pv,
             int dv,
             int sv,
             Tuple father)
Creates an instance of Tuple.

Parameters:
pv - production index
dv - dot position
sv - state
father - father tuple
Method Detail

addFather

public void addFather(Tuple father)
Adds a tuple to the father tuple list.

Parameters:
father - the tuple to add

getFathers

public Tuple[] getFathers()
Returns the fathers

Returns:
the fathers

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object