True.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;
import Hoot.Runtime.Names.Primitive;
import Hoot.Runtime.Behaviors.HootRegistry;
import Smalltalk.Core.Posit;
public class True extends Boolean
{
protected static final True Literal = new True();
private final boolean value = true;
/**
* @return
*/
public static Boolean literal()
{
java.lang.String exitID = "True>>$literal";
Frame f0 = new Frame(exitID);
return (Boolean)Literal;
}
/**
*
*/
protected True()
{
java.lang.String exitID = "True>>True";
Frame f0 = new Frame(exitID);
HootRegistry.registerValue(this);
}
/**
* @return
*/
@Override public boolean primitiveBoolean()
{
java.lang.String exitID = "True>>primitiveBoolean";
Frame f0 = new Frame(exitID);
return (boolean)value;
}
/**
* @return
*/
@Override public int hashCode()
{
java.lang.String exitID = "True>>hashCode";
Frame f0 = new Frame(exitID);
return (int)Primitive.elementaryTrue().hashCode();
}
/**
* @return
*/
@Override public boolean equals(final java.lang.Object candidate)
{
java.lang.String exitID = "True>>equals";
Frame f0 = new Frame(exitID);
return (boolean)this.eqv(((Boolean)candidate)).primitiveBoolean();
}
/**
* @return
*/
@Override public Boolean eqv(final Posit operand)
{
java.lang.String exitID = "True>>eqv";
Frame f0 = new Frame(exitID);
return (Boolean)((Boolean)operand);
}
/**
* @return
*/
@Override public True copy()
{
java.lang.String exitID = "True>>copy";
Frame f0 = new Frame(exitID);
return (True)this;
}
/**
* @return
*/
@Override public True deepCopy()
{
java.lang.String exitID = "True>>deepCopy";
Frame f0 = new Frame(exitID);
return (True)this;
}
/**
* @return
*/
@Override public True shallowCopy()
{
java.lang.String exitID = "True>>shallowCopy";
Frame f0 = new Frame(exitID);
return (True)this;
}
/**
* @return
*/
public Object ifTrue(final NiladicValuable trueBlock)
{
java.lang.String exitID = "True>>ifTrue";
Frame f0 = new Frame(exitID);
return (Object)((Object)trueBlock.value());
}
/**
* @return
*/
public Object ifFalse(final NiladicValuable falseBlock)
{
java.lang.String exitID = "True>>ifFalse";
Frame f0 = new Frame(exitID);
return (Object)Nil.literal();
}
/**
* @return
*/
public Object ifTrue_ifFalse(final NiladicValuable trueBlock, final NiladicValuable falseBlock)
{
java.lang.String exitID = "True>>ifTrue_ifFalse";
Frame f0 = new Frame(exitID);
return (Object)((Object)trueBlock.value());
}
/**
* @return
*/
public Object ifFalse_ifTrue(final NiladicValuable falseBlock, final NiladicValuable trueBlock)
{
java.lang.String exitID = "True>>ifFalse_ifTrue";
Frame f0 = new Frame(exitID);
return (Object)((Object)trueBlock.value());
}
/**
* @return
*/
@Override public Boolean and(final Posit aPosit)
{
java.lang.String exitID = "True>>and";
Frame f0 = new Frame(exitID);
return (Boolean)((Boolean)aPosit);
}
/**
* @return
*/
@Override public Boolean or(final Posit aPosit)
{
java.lang.String exitID = "True>>or";
Frame f0 = new Frame(exitID);
return (Boolean)this;
}
/**
* @return
*/
@Override public Boolean not()
{
java.lang.String exitID = "True>>not";
Frame f0 = new Frame(exitID);
return (Boolean)False.literal();
}
/**
* @return
*/
@Override public Boolean and(final NiladicPredicate aBlock)
{
java.lang.String exitID = "True>>and";
Frame f0 = new Frame(exitID);
return (Boolean)((Boolean)aBlock.value());
}
/**
* @return
*/
@Override public Boolean or(final NiladicPredicate aBlock)
{
java.lang.String exitID = "True>>or";
Frame f0 = new Frame(exitID);
return (Boolean)this;
}
/**
* @return
*/
@Override public String printString()
{
java.lang.String exitID = "True>>printString";
Frame f0 = new Frame(exitID);
return (String)String.from("true");
}
/**
* @return
*/
@Override public java.lang.String toString()
{
java.lang.String exitID = "True>>toString";
Frame f0 = new Frame(exitID);
return (java.lang.String)this.printString().primitiveString();
}
/**
* @return
*/
@Override public Boolean isLiteral()
{
java.lang.String exitID = "True>>isLiteral";
Frame f0 = new Frame(exitID);
return (Boolean)True.literal();
}
}