org.vizzini.ui.ai.logic
Class AbstractSentenceWrapper

java.lang.Object
  extended by org.vizzini.ui.ai.logic.AbstractSentenceWrapper
All Implemented Interfaces:
ISentenceWrapper
Direct Known Subclasses:
AtomicSentenceWrapper, BinaryAtomicSentenceWrapper, ComplexSentenceWrapper

public abstract class AbstractSentenceWrapper
extends Object
implements ISentenceWrapper

Provides base functionality for sentence wrappers in the logic system. Wrappers are used to provide a proper display string to the user interface.

Since:
v0.2
Version:
v0.2
Author:
Jeffrey M. Thompson

Constructor Summary
protected AbstractSentenceWrapper(ISentence sentence)
          Construct this object with the given parameter.
 
Method Summary
 boolean equals(Object object)
          Return true if this equals the given object.
static int getMaxLength()
           
 ISentence getSentence()
          Return the sentence wrapped by this object.
static void setMaxLength(int maxLength)
           
protected  void setSentence(ISentence sentence)
           
 String toString()
          Return a string representation of this object.
protected  String truncate(String string)
          Limit the given string to the maximum string length.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractSentenceWrapper

protected AbstractSentenceWrapper(ISentence sentence)
Construct this object with the given parameter.

Parameters:
sentence - Sentence.
Since:
v0.2
Method Detail

getMaxLength

public static int getMaxLength()
Returns:
Return maxLength.
Since:
v0.2

setMaxLength

public static void setMaxLength(int maxLength)
Parameters:
maxLength - The maxLength to set.
Since:
v0.2

equals

public boolean equals(Object object)
Return true if this equals the given object.

Specified by:
equals in interface ISentenceWrapper
Overrides:
equals in class Object
Parameters:
object - Object to compare.
Since:
v0.2

getSentence

public ISentence getSentence()
Description copied from interface: ISentenceWrapper
Return the sentence wrapped by this object.

Specified by:
getSentence in interface ISentenceWrapper
Returns:
Return sentence.
Since:
v0.2

toString

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

Specified by:
toString in interface ISentenceWrapper
Overrides:
toString in class Object
Since:
v0.2

setSentence

protected void setSentence(ISentence sentence)
Parameters:
sentence - The sentence to set.
Since:
v0.2

truncate

protected String truncate(String string)
Limit the given string to the maximum string length.

Since:
v0.2


Copyright 2007 Vizzini.org. All Rights Reserved. 2007.12.25.03.00.02