com.ohrasys.cad.bnf
Class BNFRequiredTest

java.lang.Object
  extended by com.ohrasys.cad.bnf.BNFAbstractTest
      extended by com.ohrasys.cad.bnf.BNFRequiredTest
All Implemented Interfaces:
BNFTestImplementor
Direct Known Subclasses:
AssignmentValidator, BracedTermValidator, BracketedTermValidator, FactorsValidator, IdentifierValidator, OrFactorValidator, QuotedValidator, RuleValidator, UnderscoreValidator

public class BNFRequiredTest
extends BNFAbstractTest

A test in which all sub-tests must complete once


Field Summary
 
Fields inherited from class com.ohrasys.cad.bnf.BNFAbstractTest
collectedData, collecting, committed, formatting, i18n, nextTest, playable, result, tests
 
Constructor Summary
BNFRequiredTest(BNFTestImplementor[] tests)
          Creates a new BNFRequiredTest object.
 
Method Summary
 BNFTestResult test(BNFTestableObject obj)
          A method to evaluate this test using the supplied testable object
 java.lang.String toString()
          Returns a text representation of the test
 
Methods inherited from class com.ohrasys.cad.bnf.BNFAbstractTest
checkTests, collect, isFirstTest, isLastTest, isNotLastTest, reset, setCollecting, setFormatting
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BNFRequiredTest

public BNFRequiredTest(BNFTestImplementor[] tests)
                throws BNFTestException
Creates a new BNFRequiredTest object.

Parameters:
tests - The list of sub-tests that comprise this test
Throws:
BNFTestException - If the sub-test list is null, zero-length or one of the sub-tests is null
Method Detail

test

public BNFTestResult test(BNFTestableObject obj)
A method to evaluate this test using the supplied testable object

Specified by:
test in interface BNFTestImplementor
Specified by:
test in class BNFAbstractTest
Parameters:
obj - The BNFTestableObject from which to extract the token used to evaluate this test
Returns:
A BNFTestResult object representing the result of this test. If more tokens are required to resolve the test, then UNFINISHED is returned and the results committable tokens list and replayable tokens list are empty. If the test completed successfully then FINISHED is returned and the committable tokens list contains a list of all tokens successfully processed by this test and the replayable tokens list contains a list of tokens required to be replayed. Otherwise FAILED is returned and all tokens processed by this test are returned in the replayable list.

toString

public java.lang.String toString()
Returns a text representation of the test

Overrides:
toString in class BNFAbstractTest
Returns:
A text representation of the test