Class And

java.lang.Object
  |
  +--LogicTree
        |
        +--BinaryTree
              |
              +--And

class And
extends BinaryTree

a LogicTree tree with a "*" operator and two subtrees


Field Summary
(package private) static java.lang.String additionalIndentation
          additionalIndentation determines how much additional Indentation there is at each level of the tree when it is converted to a String.
(package private) static LogicTree C0
          C0 is a tree for the constant 0 (false).
(package private) static LogicTree C1
          C1 is a tree for the constant 1 (true).
(package private)  LogicTree leftSubtree
          the left subtree of this tree
(package private)  java.lang.String op
          the operator
(package private)  LogicTree rightSubtree
          the right subtree of this tree
 
Constructor Summary
(package private) And(LogicTree leftSubtree, LogicTree rightSubtree)
           
 
Method Summary
static LogicTree and(LogicTree leftSubtree, LogicTree rightSubtree)
          pseudo-constructor for an "and" tree
static LogicTree failure(java.lang.String cause)
          pseudo-constructor for a failure
static LogicTree iff(LogicTree leftSubtree, LogicTree rightSubtree)
          pseudo-constructor for an "iff" tree
static LogicTree implies(LogicTree leftSubtree, LogicTree rightSubtree)
          pseudo-constructor for an "implies" tree
 boolean isFailure()
          Tell whether this tree is a failure.
static void main(java.lang.String[] arg)
          test program that constructs several trees and displays them
static LogicTree not(LogicTree subtree)
          pseudo-constructor for a "not" tree
static LogicTree or(LogicTree leftSubtree, LogicTree rightSubtree)
          pseudo-constructor for an "or" tree
 java.lang.String toString()
          Convert the tree to a String representation.
 void toStringBuffer(java.lang.String indentation, java.lang.StringBuffer buffer)
          Put the tree's representation into a StringBuffer.
static LogicTree var(char name)
          pseudo-constructor for a logical variable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

op

java.lang.String op
the operator


leftSubtree

LogicTree leftSubtree
the left subtree of this tree


rightSubtree

LogicTree rightSubtree
the right subtree of this tree


C0

static LogicTree C0
C0 is a tree for the constant 0 (false).


C1

static LogicTree C1
C1 is a tree for the constant 1 (true).


additionalIndentation

static java.lang.String additionalIndentation
additionalIndentation determines how much additional Indentation there is at each level of the tree when it is converted to a String.

Constructor Detail

And

And(LogicTree leftSubtree,
    LogicTree rightSubtree)
Method Detail

toStringBuffer

public void toStringBuffer(java.lang.String indentation,
                           java.lang.StringBuffer buffer)
Description copied from class: LogicTree
Put the tree's representation into a StringBuffer.

Specified by:
toStringBuffer in class LogicTree

toString

public java.lang.String toString()
Convert the tree to a String representation.

Overrides:
toString in class java.lang.Object

isFailure

public boolean isFailure()
Tell whether this tree is a failure.


iff

public static LogicTree iff(LogicTree leftSubtree,
                            LogicTree rightSubtree)
pseudo-constructor for an "iff" tree


implies

public static LogicTree implies(LogicTree leftSubtree,
                                LogicTree rightSubtree)
pseudo-constructor for an "implies" tree


or

public static LogicTree or(LogicTree leftSubtree,
                           LogicTree rightSubtree)
pseudo-constructor for an "or" tree


and

public static LogicTree and(LogicTree leftSubtree,
                            LogicTree rightSubtree)
pseudo-constructor for an "and" tree


not

public static LogicTree not(LogicTree subtree)
pseudo-constructor for a "not" tree


var

public static LogicTree var(char name)
pseudo-constructor for a logical variable


failure

public static LogicTree failure(java.lang.String cause)
pseudo-constructor for a failure


main

public static void main(java.lang.String[] arg)
test program that constructs several trees and displays them