Parsing Engine

danbikel.parser
Class Transition

java.lang.Object
  extended by danbikel.parser.Transition
All Implemented Interfaces:
Serializable

public class Transition
extends Object
implements Serializable

Represents the transition from a particular history to a particular future, to be used when computing the conditional probability of seeing a particular future in the context of a particular history.

See Also:
Serialized Form

Constructor Summary
Transition(Event future, Event history)
          Constructs this transition with the specified future and history events.
 
Method Summary
 Transition copy()
          Returns a deep copy of this Transition object.
 Transition copyCanonical(Map canonicalFutures, Map canonicalHistories)
          Returns a copy of this object with canonical versions of the history and future events.
 boolean equals(Object obj)
          Returns true if obj is an instance of Transition and has future and history components that are respectively equal to this object's future and history components.
 Event future()
          Gets the future event of this transition object.
 int hashCode()
          Returns the hash code of this transition object, based on the hash codes of its component history and future events.
 int hashCode(int historyHashCode)
          Returns the hash code for this object using the specified hash code for the history event.
 Event history()
          Gets the history event of this transition object.
 void setFuture(Event future)
          Sets the future event of this transition.
 void setHistory(Event history)
          Sets the history event of this transition.
 String toString()
          Returns a human-readable string representation of this transition.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Transition

public Transition(Event future,
                  Event history)
Constructs this transition with the specified future and history events.

Parameters:
future - the future event
history - the history event
Method Detail

future

public Event future()
Gets the future event of this transition object.


history

public Event history()
Gets the history event of this transition object.


setFuture

public void setFuture(Event future)
Sets the future event of this transition.


setHistory

public void setHistory(Event history)
Sets the history event of this transition.


hashCode

public int hashCode()
Returns the hash code of this transition object, based on the hash codes of its component history and future events.

Overrides:
hashCode in class Object

hashCode

public int hashCode(int historyHashCode)
Returns the hash code for this object using the specified hash code for the history event. If this method is called with an argument different from history().hashCode(), its behavior is undefined.

Parameters:
historyHashCode - the value of history().hashCode()
Returns:
the hash code for this object

equals

public boolean equals(Object obj)
Returns true if obj is an instance of Transition and has future and history components that are respectively equal to this object's future and history components.

Overrides:
equals in class Object

toString

public String toString()
Returns a human-readable string representation of this transition.

Overrides:
toString in class Object

copy

public Transition copy()
Returns a deep copy of this Transition object.


copyCanonical

public Transition copyCanonical(Map canonicalFutures,
                                Map canonicalHistories)
Returns a copy of this object with canonical versions of the history and future events.

Parameters:
canonicalFutures - a reflexive map by which to find a canonical version of the future in this Transition; if one is not found, then this object's future is added to the map
canonicalHistories - a reflexivve map by which to find a canonical version of the history in this Transition; if one is not found, then this object's history is added to the map
Returns:
a copy of this object with canonical versions of the history and future events.

Parsing Engine

Author: Dan Bikel.