FastInteger.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 Smalltalk.Magnitudes.Ordinal;
public final class FastInteger extends SmallInteger
{
public static Metaclass type() { return (Metaclass)Metaclass.$class; }
@Override public Metaclass $class() { return (Metaclass)Metaclass.$class; }
public static class Metaclass extends SmallInteger.Metaclass
{
static final FastInteger.Metaclass $class = new FastInteger.Metaclass();
public Metaclass() {
this(FastInteger.Metaclass.class);
}
public Metaclass(java.lang.Class aClass) {
super(aClass);
}
@Override public java.lang.Class outerClass() { return FastInteger.class; }
}
/**
*
*/
protected FastInteger(final Integer anInteger)
{
super(anInteger.primitiveInteger());
java.lang.String exitID = "FastInteger>>FastInteger";
Frame f0 = new Frame(exitID);
}
/**
* @return
*/
public static FastInteger fromInteger(final Integer anInteger)
{
java.lang.String exitID = "FastInteger>>$fromInteger";
Frame f0 = new Frame(exitID);
return (FastInteger)new FastInteger(anInteger);
}
/**
* @return
*/
public FastInteger value(final Integer value)
{
java.lang.String exitID = "FastInteger>>value";
Frame f0 = new Frame(exitID);
cachedValue = value.intValue();
return (FastInteger)this;
}
/**
* @return
*/
public FastInteger value(final IntegerValue.Source source)
{
java.lang.String exitID = "FastInteger>>value";
Frame f0 = new Frame(exitID);
cachedValue = source.intValue();
return (FastInteger)this;
}
/**
* @return
*/
@Override public SmallInteger value()
{
java.lang.String exitID = "FastInteger>>value";
Frame f0 = new Frame(exitID);
return (SmallInteger)SmallInteger.from(cachedValue);
}
/**
* @return
*/
public FastInteger increment()
{
java.lang.String exitID = "FastInteger>>increment";
Frame f0 = new Frame(exitID);
this.add(Unity);
return (FastInteger)this;
}
/**
* @return
*/
public FastInteger decrement()
{
java.lang.String exitID = "FastInteger>>decrement";
Frame f0 = new Frame(exitID);
this.subtract(Unity);
return (FastInteger)this;
}
/**
* @return
*/
public final FastInteger add(final int aNumber)
{
java.lang.String exitID = "FastInteger>>add";
Frame f0 = new Frame(exitID);
cachedValue += aNumber;
return (FastInteger)this;
}
/**
* @return
*/
public final FastInteger add(final Ordinal aNumber)
{
java.lang.String exitID = "FastInteger>>add";
Frame f0 = new Frame(exitID);
cachedValue += aNumber.intValue();
return (FastInteger)this;
}
/**
* @return
*/
public final FastInteger add(final SmallInteger aNumber)
{
java.lang.String exitID = "FastInteger>>add";
Frame f0 = new Frame(exitID);
cachedValue += aNumber.primitiveInteger();
return (FastInteger)this;
}
/**
* @return
*/
public final FastInteger subtract(final SmallInteger aNumber)
{
java.lang.String exitID = "FastInteger>>subtract";
Frame f0 = new Frame(exitID);
cachedValue -= aNumber.primitiveInteger();
return (FastInteger)this;
}
/**
* @return
*/
public final FastInteger multiplyBy(final SmallInteger aNumber)
{
java.lang.String exitID = "FastInteger>>multiplyBy";
Frame f0 = new Frame(exitID);
cachedValue *= aNumber.primitiveInteger();
return (FastInteger)this;
}
/**
* @return
*/
public final FastInteger divideBy(final SmallInteger aNumber)
{
java.lang.String exitID = "FastInteger>>divideBy";
Frame f0 = new Frame(exitID);
cachedValue /= aNumber.primitiveInteger();
return (FastInteger)this;
}
/**
* @return
*/
public final FastInteger bitXorWith(final SmallInteger aNumber)
{
java.lang.String exitID = "FastInteger>>bitXorWith";
Frame f0 = new Frame(exitID);
cachedValue ^= aNumber.primitiveInteger();
return (FastInteger)this;
}
/**
* @return
*/
public final FastInteger bitShiftWith(final SmallInteger aNumber)
{
java.lang.String exitID = "FastInteger>>bitShiftWith";
Frame f0 = new Frame(exitID);
cachedValue <<= aNumber.primitiveInteger();
return (FastInteger)this;
}
}