|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.millscript.millscript.datatypes.ListAwareTools
public final class ListAwareTools
This utility class implements list aware tools for MillScript. List aware means that these methods unify different datatypes in a list-like way. e.g. getting a specified item in a list.
These static methods provide a location to optimize List-like operations for
particular classes. Each one provides a general fallback defined in terms
of ListFactory.make.
| Method Summary | |
|---|---|
static void |
addLast(java.lang.Object obj,
java.lang.Object val)
Performs an add-last operation, adding the specified value to the given list. |
static java.lang.Object |
append(java.lang.Object x,
java.lang.Object y)
Returns a new object that is the result of appending the two specified objects together. |
static void |
explode(java.lang.Object obj,
Machine mc)
This method explodes the specified object into the specified machine. |
static java.lang.Object |
get(java.lang.Object obj,
int i)
Returns the item at the specified position, from the specified object. |
static org.millscript.commons.util.MapIterator |
mapIterator(java.lang.Object obj)
Returns a map iterator to iterate over all the entries in the specified list like object. |
static void |
removeLast(java.lang.Object obj)
Performs a remove-last operation, removing the last value from the given list. |
static java.lang.Object |
reverse(java.lang.Object obj)
Returns an object containing the elements from the specified object, in reverse order. |
static java.lang.Object |
subrange(java.lang.Object obj,
int lo,
int hi)
Returns an object representing the specified subrange of items from the specified object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static void addLast(java.lang.Object obj,
java.lang.Object val)
obj - the object to be resolved as a listval - the value to add to the end of the list
public static java.lang.Object append(java.lang.Object x,
java.lang.Object y)
x - the first objecty - the second object, to append to the first
public static void explode(java.lang.Object obj,
Machine mc)
obj - the object to explodemc - the machine to put the pieces of the explosion into
public static java.lang.Object get(java.lang.Object obj,
int i)
obj - the object to index as a listi - the index
public static org.millscript.commons.util.MapIterator mapIterator(java.lang.Object obj)
obj - the list like object to get a map interator for
ListFactorypublic static void removeLast(java.lang.Object obj)
obj - the object to be resolved as a listpublic static java.lang.Object reverse(java.lang.Object obj)
obj - the object to reverse
public static java.lang.Object subrange(java.lang.Object obj,
int lo,
int hi)
obj - the target object to subrangelo - the low end of the range(one based, inclusive)hi - the high end of the range(one based, inclusive)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||