tauZaman
v0.1

tauzaman.timestamp
Class ExtendedBoolean

java.lang.Object
  |
  +--tauzaman.timestamp.ExtendedBoolean
All Implemented Interfaces:
java.io.Serializable

public class ExtendedBoolean
extends java.lang.Object
implements java.io.Serializable

ExtendedBoolean class implements the boolean algebra for a Three-Valued Logic. For example:

    ExtendedBoolean trueValue = new ExtendedBoolean(true);
    ExtendedBoolean falseValue = new ExtendedBoolean(false);
    // Maybe values are currently unsupported, but eventually...
    ExtendedBoolean maybeValue = new ExtendedBoolean();
    if ((trueValue.or(falseValue)).satisfied()) {
       // works, should be satisfied
       }
    if (!maybeValue.satisfied()) {
       // works, maybe is not satisfied
       }
    if (maybeValue.unsatisfied()) {
       // works, maybe is not unsatisfied either!
       }
 

See Also:
Serialized Form

Field Summary
static ExtendedBoolean FalseEB
           
private static int MAYBE
           
static ExtendedBoolean MaybeEB
           
private static int SATISFIED
           
private  int status
           
static ExtendedBoolean TrueEB
           
private static int UNSATISFIED
           
 
Constructor Summary
ExtendedBoolean()
          Build a MAYBE value in the ExtendedBoolean logic.
ExtendedBoolean(boolean satisfied)
          Build a TRUE or FALSE value in the ExtendedBoolean logic.
 
Method Summary
 ExtendedBoolean and(ExtendedBoolean other)
          And this one with another.
 boolean maybe()
          Maybe?
 ExtendedBoolean not(ExtendedBoolean other)
          Not.
 ExtendedBoolean or(ExtendedBoolean other)
          Or this one with another.
 boolean satisfied()
          Satisfied?
 boolean unsatisfied()
          Unsatisfied?
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SATISFIED

private static final int SATISFIED
See Also:
Constant Field Values

UNSATISFIED

private static final int UNSATISFIED
See Also:
Constant Field Values

MAYBE

private static final int MAYBE
See Also:
Constant Field Values

status

private int status

TrueEB

public static ExtendedBoolean TrueEB

FalseEB

public static ExtendedBoolean FalseEB

MaybeEB

public static ExtendedBoolean MaybeEB
Constructor Detail

ExtendedBoolean

public ExtendedBoolean(boolean satisfied)
Build a TRUE or FALSE value in the ExtendedBoolean logic.

Parameters:
satisfied - - truth condition of the true part

ExtendedBoolean

public ExtendedBoolean()
Build a MAYBE value in the ExtendedBoolean logic.

Method Detail

and

public ExtendedBoolean and(ExtendedBoolean other)
And this one with another.

Parameters:
other - - the other one
Returns:
this && other

or

public ExtendedBoolean or(ExtendedBoolean other)
Or this one with another.

Parameters:
other - - the other one
Returns:
this || other

not

public ExtendedBoolean not(ExtendedBoolean other)
Not.

Returns:
!this

satisfied

public boolean satisfied()
Satisfied?

Returns:
true if truth condition is represented

unsatisfied

public boolean unsatisfied()
Unsatisfied?

Returns:
true if false condition is represented

maybe

public boolean maybe()
Maybe?

Returns:
true if this is a maybe value

tauZaman
v0.1

Submit a bug or feature

tauZaman is an open-source, publicly avaliable project