package au.id.mcmaster.libs.miij;
import java.util.Iterator;
import java.util.TimerTask;
import au.id.mcmaster.libs.miij.aa.PrintReverseWithDelayFactory;
import au.id.mcmaster.libs.miij.rom.ListPart;
import au.id.mcmaster.libs.miij.rom.ListPart.RemainOrderedMap;
import au.id.mcmaster.libs.miij.ttq.TimerPart;
public class TestHack
{
public static void main(String[] args)
{
test4();
}
public static void test1()
{
ListPart.MapPart.RemainOrderedMap remainOrderedMap = ListPart.create();
remainOrderedMap.hello();
remainOrderedMap.areYouFull();
System.out.println("Populate list.");
for (int i=0; i<250; i+=29)
{
System.out.println("i = " + i);
remainOrderedMap.index("" + i, "Value: " + i);
}
}
public static void test2()
{
ListPart.MapPart.RemainOrderedMap remainOrderedMap = ListPart.create();
remainOrderedMap.hello();
remainOrderedMap.areYouFull();
System.out.println("Populate list.");
for (int i=0; i<250; i+=29)
{
System.out.println("i = " + i);
remainOrderedMap.index("" + i, "Value: " + i);
}
System.out.println("Print list.");
Iterator<String> keys = remainOrderedMap.keyIterator();
while(keys.hasNext())
{
String key = keys.next();
String value = remainOrderedMap.getValue(key);
System.out.println(key + " : " + value);
}
TimerPart.QueuePart.ThrottledTaskQueue taskQueue = TimerPart.create();
for(int i = 1; i <= 5; i++)
{
final int number = i;
taskQueue.register(new TimerTask()
{
@Override public void run()
{
System.out.println("Task : " + number);
}
});
}
taskQueue.start();
}
public static void test3()
{
PrintReverseWithDelayFactory.BB.CC.DD.EE.FF.PrintReverseWithDelay printWithDelay = PrintReverseWithDelayFactory.createPrintReverseWithDelay();
System.out.println("Print with delay.");
for (int i=0; i<250; i+=29)
{
System.out.println("i = " + i);
printWithDelay.index("" + i, "Value: " + i);
}
printWithDelay.print();
}
@SuppressWarnings("unused")
public static void test4()
{
RemainOrderedMap remainOrderedMap = new ListPart().new RemainOrderedMap();
//RemainOrderedMap remainOrderedMap = new ListPart().newInstance();
}
}