Magnitude.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.Magnitudes;
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.Behaviors.*;
import Hoot.Behaviors.Nil;
import Hoot.Behaviors.Object;
import Hoot.Behaviors.True;
import Hoot.Behaviors.False;
import Hoot.Behaviors.Boolean;
import Hoot.Collections.*;
import Hoot.Collections.String;
import Hoot.Behaviors.Ordered;
import Hoot.Collections.Interval;
import Smalltalk.Core.Subject;
import Smalltalk.Magnitudes.Scalar;
import Smalltalk.Magnitudes.Numeric;
public abstract class Magnitude extends Object implements Ordered
{
public static Metaclass type() { return (Metaclass)Metaclass.$class; }
@Override public Metaclass $class() { return (Metaclass)Metaclass.$class; }
public static class Metaclass extends Object.Metaclass implements Ordered.Metatype
{
static final Magnitude.Metaclass $class = new Magnitude.Metaclass();
public Metaclass() {
this(Magnitude.Metaclass.class);
}
public Metaclass(java.lang.Class aClass) {
super(aClass);
}
@Override public java.lang.Class outerClass() { return Magnitude.class; }
}
/**
*
*/
protected Magnitude()
{
super();
java.lang.String exitID = "Magnitude>>Magnitude";
Frame f0 = new Frame(exitID);
}
/**
* @return
*/
public Boolean equals(final Magnitude value)
{
java.lang.String exitID = "Magnitude>>equals";
Frame f0 = new Frame(exitID);
return (Boolean)Magnitude.type().accepts(value).and(Predicate.with(f2 -> {
return (value.equals(this));
}, ""));
}
/**
* @return
*/
@Override public Boolean equals(final Subject value)
{
java.lang.String exitID = "Magnitude>>equals";
Frame f0 = new Frame(exitID);
return (Boolean)Magnitude.type().accepts(value).and(Predicate.with(f2 -> {
return (((Magnitude)value).equals(this));
}, ""));
}
/**
* @return
*/
public Boolean equals(final Numeric value)
{
java.lang.String exitID = "Magnitude>>equals";
Frame f0 = new Frame(exitID);
return (Boolean)Magnitude.type().accepts(value).and(Predicate.with(f2 -> {
return (((Number)value).equals(this));
}, ""));
}
/**
* @return
*/
@Override public Boolean lessThan(final Scalar upperBound)
{
java.lang.String exitID = "Magnitude>>lessThan";
Frame f0 = new Frame(exitID);
return (Boolean)((Boolean)(((Magnitude)upperBound).moreThan(this)));
}
/**
* @return
*/
@Override public Boolean moreThan(final Scalar lowerBound)
{
java.lang.String exitID = "Magnitude>>moreThan";
Frame f0 = new Frame(exitID);
return (Boolean)((Boolean)(((Magnitude)lowerBound).lessThan(this)));
}
/**
* @return
*/
@Override public java.lang.String toString()
{
java.lang.String exitID = "Magnitude>>toString";
Frame f0 = new Frame(exitID);
return (java.lang.String)this.printString().primitiveString();
}
}