public final class Maps
extends java.lang.Object
Constructor and Description |
---|
Maps() |
Modifier and Type | Method and Description |
---|---|
static <x,V> Map<x,V> |
cnst(V v)
Creates a map that maps any object to the same object.
|
static <x> Unary<x> |
id()
Returns an identity map.
|
static <R> Unary<R> |
id(java.lang.Class<R> type)
Returns an identity map.
|
static <A,B> Map2<A,B,Pair<A,B>> |
id2()
Create a Map2 object that stores the two objects into a Pair object.
|
static <A,B,C> Map3<A,B,C,Tuple3<A,B,C>> |
id3()
Create a Map3 object that stores the 3 objects into a Tuple3 object.
|
static <A,B,C,D> Map4<A,B,C,D,Tuple4<A,B,C,D>> |
id4()
Create a Map4 object that stores the 4 objects into a Tuple4 object.
|
static <A,B,C,D,E> |
id5()
Create a Map5 object that stores the 5 objects into a Tuple5 object.
|
static Mapn<java.lang.Object[]> |
idn()
Returns an identity map.
|
static <From,To> Map<From,To> |
jmap(java.util.Map<From,To> m)
Adapts a java.util.Map to jfun.util.Map.
|
static <T> Map<Tok,T> |
toToken()
Transform a Tok object to the wrapped token object.
|
public static <x> Unary<x> id()
public static <R> Unary<R> id(java.lang.Class<R> type)
type
- the class literal for the type parameter.public static Mapn<java.lang.Object[]> idn()
public static <x,V> Map<x,V> cnst(V v)
v
- the object that is gonna be returned from the Map.public static <From,To> Map<From,To> jmap(java.util.Map<From,To> m)
m
- the java.util.Map object.public static <T> Map<Tok,T> toToken()
public static <A,B> Map2<A,B,Pair<A,B>> id2()
public static <A,B,C> Map3<A,B,C,Tuple3<A,B,C>> id3()
public static <A,B,C,D> Map4<A,B,C,D,Tuple4<A,B,C,D>> id4()