|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.rubato.logeo.Lists
public final class Lists
This class implements various operations on denotators of type list. Arguments to these methods must not be null.
Method Summary | |
---|---|
static ListDenotator |
appendElement(ListDenotator d,
Denotator element)
Appends an element denotator to a list denotator. |
static void |
appendElementTo(ListDenotator d,
Denotator element)
Appends a denotator to a list denotator. |
static void |
appendTo(ListDenotator d1,
ListDenotator d2)
Appends the elements of d2 to d1 . |
static void |
apply(Function f,
ListDenotator d)
Applies the function f to every factor of the argument denotator. |
static ListDenotator |
concat(ListDenotator... denoList)
Returns a list denotator that is the concatenation of the argument list denotators. |
static ListDenotator |
concat(ListDenotator d1,
ListDenotator d2)
Returns a list denotator that is the concatenation of d1 and d2 . |
static Denotator |
map(Function f,
ListDenotator d)
Returns a denotator, with f applied to the elements of d . |
static ListDenotator |
prependElement(ListDenotator d,
Denotator element)
Prepends a denotator to a list denotator. |
static void |
prependElementTo(ListDenotator d,
Denotator element)
Prepends a denotator to a list denotator. |
static void |
prependTo(ListDenotator d1,
ListDenotator d2)
Prepend the elements of d2 to d1. |
static Denotator |
reduce(Function f,
ListDenotator d)
Reduces the argument list denotator using the function f. |
static ListDenotator |
removeDuplicates(ListDenotator d)
Removes duplicates from the list denotator. |
static ListDenotator |
select(Predicate p,
ListDenotator d)
Returns a denotator, where only the elements from the argument denotator are contained that satisfy predicate p. |
static ListDenotator |
sort(ListDenotator d)
Sorts the list denotator according to canonical order. |
static ListDenotator |
sort(ListDenotator d,
java.util.Comparator<Denotator> c)
Sorts the list denotator according to order induced by the comparator c , which can also be a Predicate. |
static ListDenotator |
zip(Function f,
ListDenotator d1,
ListDenotator d2)
Zips the function on the two argument lists. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static ListDenotator concat(ListDenotator d1, ListDenotator d2) throws RubatoException
d1
and d2
.
RubatoException
- if d1
or d2
is not of the required formpublic static ListDenotator concat(ListDenotator... denoList) throws RubatoException
RubatoException
- if the denotators do not have the required formpublic static void appendTo(ListDenotator d1, ListDenotator d2) throws RubatoException
d2
to d1
.
This operation is destructive on the first argument.
RubatoException
- if d1
or d2
is not of the required form, or if they
do not have the same addresspublic static ListDenotator appendElement(ListDenotator d, Denotator element) throws RubatoException
RubatoException
public static void appendElementTo(ListDenotator d, Denotator element) throws RubatoException
RubatoException
public static void prependTo(ListDenotator d1, ListDenotator d2) throws RubatoException
RubatoException
- if d1 or d2 is not of the required formpublic static ListDenotator prependElement(ListDenotator d, Denotator element) throws RubatoException
RubatoException
public static void prependElementTo(ListDenotator d, Denotator element) throws RubatoException
RubatoException
public static Denotator map(Function f, ListDenotator d) throws RubatoException
f
applied to the elements of d
.
f
- the function to apply to the arguments, must have arity == 1
RubatoException
- if d
is not of the required form or
f
has arity != 1public static void apply(Function f, ListDenotator d) throws RubatoException
f
to every factor of the argument denotator.
f
- the function to apply to the argument factors, must have arity 1
RubatoException
- if f
has arity != 1public static ListDenotator select(Predicate p, ListDenotator d) throws RubatoException
p
- the predicate that the elements must satisfy, must have arity 1
RubatoException
- if d
has not the required form or
p
has arity != 1public static ListDenotator zip(Function f, ListDenotator d1, ListDenotator d2) throws RubatoException
f
- a function of arity 2, must have a first argument of the same
form as a list element of d1 and a second argument of the same form as a
list element of d2
RubatoException
- if d1 or d2 is not of the required form
or f has not the required typepublic static Denotator reduce(Function f, ListDenotator d) throws RubatoException
f
- a function of arity 2, must have both arguments of the
same form as the element form of the list denotator.
RubatoException
- if d is not of the required form
or f has arity != 2public static ListDenotator sort(ListDenotator d)
public static ListDenotator sort(ListDenotator d, java.util.Comparator<Denotator> c)
c
, which can also be a Predicate.
public static ListDenotator removeDuplicates(ListDenotator d)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |