Boolean.java
/**
* Copyright 2010,2021 Nikolas S Boyd.
Permission is granted to copy this work provided this copyright statement is retained in all copies.
*/
package Hoot.Behaviors;
import Hoot.Runtime.Functions.*;
import Hoot.Runtime.Faces.*;
import Hoot.Runtime.Values.*;
import Hoot.Runtime.Blocks.*;
import Smalltalk.Core.*;
import Smalltalk.Blocks.*;
import Smalltalk.Magnitudes.*;
import Hoot.Magnitudes.*;
import Hoot.Magnitudes.Integer;
import Hoot.Magnitudes.Character;
import Hoot.Magnitudes.Float;
import Hoot.Magnitudes.Double;
import Hoot.Collections.*;
import Hoot.Collections.String;
public abstract class Boolean extends Object implements Posit
{
/**
* @return
*/
public static Boolean from(final Posit aBoolean)
{
java.lang.String exitID = "Boolean>>$from";
Frame f0 = new Frame(exitID);
return (Boolean)aBoolean;
}
/**
* @return
*/
public static Boolean from(final boolean aBoolean)
{
java.lang.String exitID = "Boolean>>$from";
Frame f0 = new Frame(exitID);
return (Boolean)(Boolean.primitiveValue(aBoolean) ? True.literal() : False.literal());
}
/**
* @return
*/
public static boolean primitiveValue(final Posit aBoolean)
{
java.lang.String exitID = "Boolean>>$primitiveValue";
Frame f0 = new Frame(exitID);
return (boolean)Boolean.from(aBoolean).primitiveBoolean();
}
/**
* @return
*/
public static boolean primitiveValue(final boolean aBoolean)
{
java.lang.String exitID = "Boolean>>$primitiveValue";
Frame f0 = new Frame(exitID);
return (boolean)aBoolean;
}
/**
* @return
*/
public abstract boolean primitiveBoolean();
/**
* @return
*/
public boolean asPrimitive()
{
java.lang.String exitID = "Boolean>>asPrimitive";
Frame f0 = new Frame(exitID);
return (boolean)this.primitiveBoolean();
}
/**
* @return
*/
public static Boolean trueValue()
{
java.lang.String exitID = "Boolean>>$trueValue";
Frame f0 = new Frame(exitID);
return (Boolean)True.literal();
}
/**
* @return
*/
public static Boolean falseValue()
{
java.lang.String exitID = "Boolean>>$falseValue";
Frame f0 = new Frame(exitID);
return (Boolean)False.literal();
}
/**
* @return
*/
public abstract Boolean not();
/**
* @return
*/
public Boolean and(final Posit aPosit)
{
java.lang.String exitID = "Boolean>>and";
Frame f0 = new Frame(exitID);
return (Boolean)Boolean.from((this.primitiveBoolean() & aPosit.primitiveBoolean()));
}
/**
* @return
*/
public Boolean or(final Posit aPosit)
{
java.lang.String exitID = "Boolean>>or";
Frame f0 = new Frame(exitID);
return (Boolean)Boolean.from((this.primitiveBoolean() | aPosit.primitiveBoolean()));
}
/**
* @return
*/
public Boolean and(final NiladicPredicate aBlock)
{
java.lang.String exitID = "Boolean>>and";
Frame f0 = new Frame(exitID);
return (Boolean)(this.and(aBlock.value()));
}
/**
* @return
*/
public Boolean or(final NiladicPredicate aBlock)
{
java.lang.String exitID = "Boolean>>or";
Frame f0 = new Frame(exitID);
return (Boolean)(this.or(aBlock.value()));
}
/**
* @return
*/
public Boolean xor(final NiladicPredicate aBlock)
{
java.lang.String exitID = "Boolean>>xor";
Frame f0 = new Frame(exitID);
return (Boolean)((Boolean)this.eqv(aBlock.value()).not());
}
/**
* @return
*/
public Boolean eqv(final Posit aPosit)
{
java.lang.String exitID = "Boolean>>eqv";
Frame f0 = new Frame(exitID);
return (Boolean)(this.isSame(aPosit));
}
/**
* @return
*/
@Override public Boolean isBoolean()
{
java.lang.String exitID = "Boolean>>isBoolean";
Frame f0 = new Frame(exitID);
return (Boolean)True.literal();
}
}