CollectionCycles.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.Tests;
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.Collections.*;
import Hoot.Collections.String;
import static Hoot.Magnitudes.SmallInteger.*;
import Hoot.Magnitudes.Integer;
public class CollectionCycles extends TestableClosure
{
protected OrderedCollection sample = OrderedCollection.type().$new(SmallInteger.from(20));
/**
* @return
*/
public CollectionCycles refillSample()
{
java.lang.String exitID = "CollectionCycles>>refillSample";
Frame f0 = new Frame(exitID);
{
OrderedCollection prime = (OrderedCollection)sample.removeAll();
prime.add(Zero);
prime.add(Zero);
prime.add(Zero);
prime.add(Zero);
prime.add(Zero);
prime.add(Zero);
prime.add(Zero);
prime.add(Zero);
prime.add(Zero);
prime.add(Zero);
};
return (CollectionCycles)this;
}
/**
* @return
*/
@Override public String description()
{
java.lang.String exitID = "CollectionCycles>>description";
Frame f0 = new Frame(exitID);
return (String)String.from("Collection cycles");
}
/**
* @return
*/
@Override public void prepare()
{
java.lang.String exitID = "CollectionCycles>>prepare";
Frame f0 = new Frame(exitID);
this.refillSample();
}
/**
* @return
*/
@Override public void runTest()
{
java.lang.String exitID = "CollectionCycles>>runTest";
Frame f0 = new Frame(exitID);
sample.$do(Closure.with(f2 -> {
Hoot.Behaviors.Object element = f2.getValue(0).value();
}, "element"));
}
}