de.fu_berlin.ties.combi
Class CombinationState

java.lang.Object
  extended by de.fu_berlin.ties.combi.CombinationState

public class CombinationState
extends Object

Immutable class contains state information used by combination strategies.

Version:
$Revision: 1.5 $, $Date: 2004/07/15 14:35:48 $, $Author: siefkes $
Author:
Christian Siefkes

Field Summary
static CombinationState OUTSIDE
          Combination state to be used for outside/other (type is set to null).
 
Constructor Summary
CombinationState(String myType, boolean myBegin, boolean myEnd)
          Creates a new instance, setting isDiscardPreceding() to false.
CombinationState(String myType, boolean myBegin, boolean myEnd, boolean discardPrevious)
          Creates a new instance.
 
Method Summary
 boolean equals(Object obj)
          Indicates whether some other object is "equal to" this one, fulfulling the Object.equals(java.lang.Object) contract.
 String getType()
          Returns the type (class) of the current instance; or null if we're outside of any instance (OUTSIDE).
 int hashCode()
          Returns a hash code value for this object, fulfulling the Object.hashCode() contract.
 boolean isBegin()
          Returns whether this is the begin of an instance.
 boolean isDiscardPreceding()
          Signals that the extraction in progress during the preceding combination state should be discarded.
 boolean isEnd()
          Returns whether this is the end of an instance.
 String toString()
          Returns a string representation of this object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

OUTSIDE

public static final CombinationState OUTSIDE
Combination state to be used for outside/other (type is set to null). Begin and end are always false.

Constructor Detail

CombinationState

public CombinationState(String myType,
                        boolean myBegin,
                        boolean myEnd)
Creates a new instance, setting isDiscardPreceding() to false.

Parameters:
myType - the type (class) of this instance; or null if we're outside of any instance
myBegin - whether this is the begin of an instance
myEnd - whether this is the end of an instance

CombinationState

public CombinationState(String myType,
                        boolean myBegin,
                        boolean myEnd,
                        boolean discardPrevious)
Creates a new instance.

Parameters:
myType - the type (class) of this instance; or null if we're outside of any instance
myBegin - whether this is the begin of an instance
myEnd - whether this is the end of an instance
discardPrevious - whether the extraction in progress during the preceding combination state should be discarded
Method Detail

equals

public boolean equals(Object obj)
Indicates whether some other object is "equal to" this one, fulfulling the Object.equals(java.lang.Object) contract.

Overrides:
equals in class Object
Parameters:
obj - the reference object with which to compare
Returns:
true iff the specified object is a CombinationState equal to this instance

getType

public String getType()
Returns the type (class) of the current instance; or null if we're outside of any instance (OUTSIDE).

Returns:
the value of the attribute

hashCode

public int hashCode()
Returns a hash code value for this object, fulfulling the Object.hashCode() contract.

Overrides:
hashCode in class Object
Returns:
a hash code value for this object

isBegin

public boolean isBegin()
Returns whether this is the begin of an instance.

Returns:
the value of the attribute

isDiscardPreceding

public boolean isDiscardPreceding()
Signals that the extraction in progress during the preceding combination state should be discarded. If this combination state starts a new extraction, the new extraction should not be discarded.

Returns:
the value of the attribute

isEnd

public boolean isEnd()
Returns whether this is the end of an instance.

Returns:
the value of the attribute

toString

public String toString()
Returns a string representation of this object.

Overrides:
toString in class Object
Returns:
a textual representation


Copyright © 2003-2004 Christian Siefkes. All Rights Reserved.