csheets.ext.assertion
Class USAssertion

java.lang.Object
  extended by csheets.ext.assertion.Assertion
      extended by csheets.ext.assertion.USAssertion
All Implemented Interfaces:
Serializable

public class USAssertion
extends Assertion

This class represents an Assertion.

Author:
Fredrik Johansson, Peter Palotas
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class csheets.ext.assertion.Assertion
Assertion.ComparisonResult, Assertion.Result
 
Field Summary
protected  String assertion
          The original assertion string as entered by the user.
 
Fields inherited from class csheets.ext.assertion.Assertion
intervals, isInteger
 
Constructor Summary
USAssertion(String assertion)
          Constructs an Assertion object
 
Method Summary
 List<AssertionWarning> getWarnings()
          Retrieves the warnings associated with this assertion describing possible inconsitencies in the assertion.
 boolean isConsistent()
          Indicates wether the assertion is consistent or wether it may contain some inconsistencies.
 String prettyString()
          Used for "pretty printing" an assertion.
 void printWarnings()
          Deprecated. printWarnings
 String toString()
           
 
Methods inherited from class csheets.ext.assertion.Assertion
allowsIntegersOnly, equals, getIntervalIterator, getMultiInterval, validate, validate
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

assertion

protected String assertion
The original assertion string as entered by the user.

Constructor Detail

USAssertion

public USAssertion(String assertion)
            throws AssertionException
Constructs an Assertion object

Parameters:
assertion - is a string representation of an assertion
Throws:
AssertionException - is thrown if a syntactic or semantic error occurs
Method Detail

isConsistent

public boolean isConsistent()
Indicates wether the assertion is consistent or wether it may contain some inconsistencies. If there are inconsistecies the details can be retrieved by calling getWarnings().

Returns:
true if there are no inconsitencies, false otherwise.

getWarnings

public List<AssertionWarning> getWarnings()
Retrieves the warnings associated with this assertion describing possible inconsitencies in the assertion.

Returns:
a List of AssertionWarning objects describing any warnings/inconsistencies in the assertion represented by this object. This List will be non-empty if isConsistent() returns false, and empty otherwise.

toString

public String toString()
Overrides:
toString in class Assertion
Returns:
the String representation of the assertion as specified in the constructor.

prettyString

public String prettyString()
Used for "pretty printing" an assertion. The assertion string is re-constructed from the parsed data.

Returns:
a pretty printed version of the assertion.

printWarnings

public void printWarnings()
Deprecated. printWarnings

Used to print all warnings that were generated while parsing the assertion. Used only for debugging purposes.