ArrayedCollection.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.Collections;
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.Magnitudes.*;
import Hoot.Magnitudes.Integer;
import Hoot.Magnitudes.Character;
import Hoot.Magnitudes.Float;
import Hoot.Magnitudes.Double;
import Hoot.Magnitudes.Integer;
import Hoot.Magnitudes.Number;
import static Hoot.Magnitudes.SmallInteger.*;
import Smalltalk.Collections.*;
import Smalltalk.Magnitudes.Ordinal;
import Smalltalk.Core.Subject;
public abstract class ArrayedCollection<ElementType extends Object> extends SequencedCollection<ElementType> implements CollectedArray<ElementType>
{
public static Metaclass type() { return (Metaclass)Metaclass.$class; }
@Override public Metaclass $class() { return (Metaclass)Metaclass.$class; }
public static class Metaclass extends SequencedCollection.Metaclass implements CollectedArray.Metatype
{
static final ArrayedCollection.Metaclass $class = new ArrayedCollection.Metaclass();
public Metaclass() {
this(ArrayedCollection.Metaclass.class);
}
public Metaclass(java.lang.Class aClass) {
super(aClass);
}
@Override public java.lang.Class outerClass() { return ArrayedCollection.class; }
}
/**
* @return
*/
@Override public ElementType at_put(final Ordinal index, final ElementType element)
{
java.lang.String exitID = "ArrayedCollection>>at_put";
Frame f0 = new Frame(exitID);
return (ElementType)element;
}
/**
* @return
*/
@Override public ElementType atAll_put(final CollectedReadably<Ordinal> indices, final ElementType element)
{
java.lang.String exitID = "ArrayedCollection>>atAll_put";
Frame f0 = new Frame(exitID);
indices.$do(Closure.with(f2 -> {
Integer index = f2.getValue(0).value();
this.at_put(index, element);
}, "index"));
return (ElementType)element;
}
/**
* @return
*/
@Override public ElementType atAllPut(final ElementType element)
{
java.lang.String exitID = "ArrayedCollection>>atAllPut";
Frame f0 = new Frame(exitID);
SmallInteger.from(1).to_do(this.size(), Closure.with(f2 -> {
Integer index = f2.getValue(0).value();
this.at_put(index, element);
}, "index"));
return (ElementType)element;
}
}