|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectgalois.objects.Mappables
public class Mappables
Several helper methods to bridge common Java classes into Mappable
framework.
| Constructor Summary | |
|---|---|
Mappables()
|
|
| Method Summary | ||
|---|---|---|
static
|
fromList(List<T> list)
Creates a mappable view from a list. |
|
static Mappable<String> |
fromReader(BufferedReader reader)
Creates a mappable over lines of a stream. |
|
static
|
product(Mappable<A> rows,
Lambda<A,Mappable<B>> cols)
Forms the product space between two Mappables. |
|
static Mappable<Integer> |
range(int start,
int end)
Creates a mappable over integers in a range. |
|
static Mappable<Integer> |
range(int start,
int end,
int chunkSize)
Creates a mappable over integers in a range. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Mappables()
| Method Detail |
|---|
public static <A,B> Mappable<Pair<A,B>> product(Mappable<A> rows,
Lambda<A,Mappable<B>> cols)
Mappables. This is useful for
flattening nested iterators into a single iterator. Product iteration
proceeds by row, completing an entire row before moving on to the next
row. During concurrent execution, entire rows are processed concurrently.
The pair objects produced by this mappable are reused between iterations.
Therefore, it is an error to store references to the argument pairs;
make a copy instead.
A - type of first component of the product spaceB - type of second component of the product spacerows - mappable that iterates over first component of the product spacecols - function that generates a mappable over the second component of the product
space from an element of the first component
public static Mappable<String> fromReader(BufferedReader reader)
reader - reader of stream
public static Mappable<Integer> range(int start,
int end)
start - starting integerend - ending integer (exclusive)
public static Mappable<Integer> range(int start,
int end,
int chunkSize)
chunkSize size blocks.
start - starting integerend - ending integer (exclusive)chunkSize - the chunk size
public static <T> Mappable<T> fromList(List<T> list)
T - type of elements of the listlist - list that this mappable is a view of
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||