All Packages Class Hierarchy This Package Previous Next Index
Class oplan.util.Seq
java.lang.Object
|
+----oplan.util.Seq
- public abstract class Seq
- extends Object
Seq defines some convenient methods for use with sequences,
where a sequence is an Object[], a Vector, a List, or an
Enumeration. Enumerations are used as a common intermediate
form for conversions and are also given some operations of
their own.
A Collector can be used as the source of an Enumeration.
This gives us a very simple, but still open-ended, ability
to handle new types.
- See Also:
- Collector
-
Seq()
-
-
addEnumeration(Collector, Enumeration)
-
-
elementAdder(Collector)
-
-
elements(Collector)
-
-
elements(List)
-
-
elements(Object[])
-
-
elements(Vector)
-
-
fillVector(Vector, Enumeration)
-
-
filter(Enumeration, Predicate1)
- Takes an Enumeration e and a Predicate1 p and returns a "wrapper"
Enumeration w such that the elements of w are the corresponding
elements of e, omitting the elements of e for which p.trueOf
returns false.
-
forEach(Enumeration, Function1)
- Applies a Function1 to each element of an Enumeration
and discards the results.
-
map(Enumeration, Function1)
- Takes an Enumeration e and a Function1 f and returns a "wrapper"
Enumeration w such that each element of w is the result of calling
f on the corresponding element of e.
-
toArray(Enumeration)
-
-
toList(Enumeration)
-
-
toVector(Enumeration)
-
Seq
public Seq()
toVector
public static Vector toVector(Enumeration e)
fillVector
public static Vector fillVector(Vector v,
Enumeration e)
toArray
public static Object[] toArray(Enumeration e)
toList
public static List toList(Enumeration e)
elements
public static Enumeration elements(Vector v)
elements
public static Enumeration elements(List l)
elements
public static Enumeration elements(Object a[])
elements
public static Enumeration elements(Collector c)
forEach
public static void forEach(Enumeration e,
Function1 f)
- Applies a Function1 to each element of an Enumeration
and discards the results.
map
public static Enumeration map(Enumeration e,
Function1 f)
- Takes an Enumeration e and a Function1 f and returns a "wrapper"
Enumeration w such that each element of w is the result of calling
f on the corresponding element of e.
filter
public static Enumeration filter(Enumeration e,
Predicate1 p)
- Takes an Enumeration e and a Predicate1 p and returns a "wrapper"
Enumeration w such that the elements of w are the corresponding
elements of e, omitting the elements of e for which p.trueOf
returns false.
addEnumeration
public static void addEnumeration(Collector c,
Enumeration e)
elementAdder
public static Function1 elementAdder(Collector c)
All Packages Class Hierarchy This Package Previous Next Index