fcmodeler.mapping
Class CompositeSentence

java.lang.Object
  |
  +--fcmodeler.mapping.CompositeSentence
All Implemented Interfaces:
Sentence

public final class CompositeSentence
extends java.lang.Object
implements Sentence

A composite sentence in first-order logic. This sentence is of the form

Sentence Connective Sentence

This sentence can be used to build up complex sentences using other sentences and connectives.

Since:
JDK1.3
Version:
$Revision: 1.1 $
Author:
Julie Dickerson , Zach Cox

Constructor Summary
CompositeSentence(Sentence first, Connective connective, Sentence second)
          Creates a new CompositeSentence that uses the specified Sentences and Connective.
 
Method Summary
 boolean evaluate(diva.util.PropertyContainer container)
          Evaluates this sentence using the specified PropertyContainer.
 Connective getConnective()
          Returns the connective used in this composite sentence.
 Sentence getFirstSentence()
          Returns the first sentence used in this composite sentence.
 Sentence getSecondSentence()
          Returns the second sentence used in this composite sentence.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CompositeSentence

public CompositeSentence(Sentence first,
                         Connective connective,
                         Sentence second)
Creates a new CompositeSentence that uses the specified Sentences and Connective.
Parameters:
first - the first sentence of this composite sentence.
connective - the connective used to join the first and second sentences.
second - the second sentence of this composite sentence.
Method Detail

evaluate

public boolean evaluate(diva.util.PropertyContainer container)
Evaluates this sentence using the specified PropertyContainer. This class just sends the request to its two Sentence objects, then returns the result of the Connective.evaluate method.
Specified by:
evaluate in interface Sentence
Parameters:
container - the PropertyContainer used to evaluate this sentence.
Returns:
true if this sentence evaluates to true using the specified PropertyContainer; false otherwise.

getConnective

public Connective getConnective()
Returns the connective used in this composite sentence.
Returns:
the connective used in this sentence.

getFirstSentence

public Sentence getFirstSentence()
Returns the first sentence used in this composite sentence.
Returns:
the first sentence used in this composite sentence.

getSecondSentence

public Sentence getSecondSentence()
Returns the second sentence used in this composite sentence.
Returns:
the second sentence used in this composite sentence.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object