edu.stanford.nlp.sequences
Class Clique

java.lang.Object
  extended by edu.stanford.nlp.sequences.Clique
All Implemented Interfaces:
Serializable

public class Clique
extends Object
implements Serializable

This class is meant to represent a clique in a (directed or undirected) linear-chain graphical model. It encodes the relative indices that are included in a clique with respect to the current index (0). For instance if you have a clique that is current label and two-ago label, then the relative indices clique would look like [-2, 0]. The relativeIndices[] array should be sorted. Cliques are immutable. Also, for two cliques, c1 and c2, (c1 == c2) iff c1.equals(c2).

Author:
Jenny Finkel
See Also:
Serialized Form

Field Summary
protected static Map<edu.stanford.nlp.sequences.Clique.CliqueEqualityWrapper,Clique> interner
           
protected static long serialVersionUID
           
 
Method Summary
 int hashCode()
           
 int indexOfRelativeIndex(int relativeIndex)
          For a particular relative index, returns which element in the Clique it is.
 Clique leftMessage()
           
 int maxLeft()
          Convenience method for finding the most far left relative index.
 int maxRight()
          Convenience method for finding the most far right relative index.
 Object readResolve()
           
 int relativeIndex(int i)
           
 Clique rightMessage()
           
 Clique shift(int shiftAmount)
           
 int size()
          The number of nodes in the clique.
 String toString()
           
static Clique valueOf(Clique c, int offset)
           
static Clique valueOf(int[] relativeIndices)
          relativeIndices should be sorted.
static Clique valueOf(int maxLeft, int maxRight)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

protected static final long serialVersionUID
See Also:
Constant Field Values

interner

protected static Map<edu.stanford.nlp.sequences.Clique.CliqueEqualityWrapper,Clique> interner
Method Detail

valueOf

public static Clique valueOf(int maxLeft,
                             int maxRight)

valueOf

public static Clique valueOf(int[] relativeIndices)
relativeIndices should be sorted.


valueOf

public static Clique valueOf(Clique c,
                             int offset)

maxLeft

public int maxLeft()
Convenience method for finding the most far left relative index.


maxRight

public int maxRight()
Convenience method for finding the most far right relative index.


size

public int size()
The number of nodes in the clique.


relativeIndex

public int relativeIndex(int i)
Returns:
the ith relativeIndex

indexOfRelativeIndex

public int indexOfRelativeIndex(int relativeIndex)
For a particular relative index, returns which element in the Clique it is. For instance, if you created a Clique c with relativeIndices [-2, -1, 0], then c.indexOfRelativeIndex(-1) will return 1. If the relative index is not present, it will return -1.


toString

public String toString()
Overrides:
toString in class Object

leftMessage

public Clique leftMessage()

rightMessage

public Clique rightMessage()

shift

public Clique shift(int shiftAmount)

hashCode

public int hashCode()
Overrides:
hashCode in class Object

readResolve

public Object readResolve()


Stanford NLP Group