se.chalmers.cs.gf.parse.chart
Class Chart

java.lang.Object
  extended by se.chalmers.cs.gf.parse.chart.Chart

public class Chart
extends java.lang.Object

A parse chart.


Constructor Summary
Chart(int n)
           
 
Method Summary
 boolean add(Edge e, int i, int j)
           
 boolean addPassiveEdges(java.util.Collection<? extends Edge> es, int i, int j)
           
 int countActiveEdges()
          Counts the number of active edges in the chart.
 int countPassiveEdges()
          Counts the number of passive edges in the chart.
 java.util.Set<Edge> getActive(int i, int j)
          Get all the active edges in the (i,j) set.
 java.util.Set<Edge> getPassive(int i, int j)
          Get all the passive edges in the (i,j) set.
 int getSize()
          Get the input length that this chart is for.
 void purgeActive()
          Remove all active edges.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Chart

public Chart(int n)
Method Detail

add

public boolean add(Edge e,
                   int i,
                   int j)
Returns:
true if the edge was not already in the set, i.e. if it was added.

addPassiveEdges

public boolean addPassiveEdges(java.util.Collection<? extends Edge> es,
                               int i,
                               int j)

getActive

public java.util.Set<Edge> getActive(int i,
                                     int j)
Get all the active edges in the (i,j) set. Modifying th returned set modifies the chart.


getPassive

public java.util.Set<Edge> getPassive(int i,
                                      int j)
Get all the passive edges in the (i,j) set. Modifying th returned set modifies the chart.


getSize

public int getSize()
Get the input length that this chart is for.


purgeActive

public void purgeActive()
Remove all active edges.


countPassiveEdges

public int countPassiveEdges()
Counts the number of passive edges in the chart.


countActiveEdges

public int countActiveEdges()
Counts the number of active edges in the chart.


toString

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