org.codehaus.jparsec.functors
Class Maps

java.lang.Object
  extended by org.codehaus.jparsec.functors.Maps

public final class Maps
extends Object

Provides common implementations of Map interface and the variants.

Author:
Ben Yu

Field Summary
static Map<String,Integer> TO_INTEGER
          The Map that maps a String to Integer by calling Integer.valueOf(String).
static Unary<String> TO_LOWER_CASE
          The Unary that maps a String to lower case using Locale.US.
static Unary<String> TO_UPPER_CASE
          The Unary that maps a String to upper case using Locale.US.
 
Method Summary
static
<F,T> Map<F,T>
constant(T v)
          Returns a Map that always maps any object to v.
static
<T> Unary<T>
identity()
          Returns an identity map that maps parameter to itself.
static
<K,V> Map<K,V>
map(Map<K,V> m)
          Adapts a Map to Map.
static
<T> Map<T,String>
mapToString()
          A Map instance that maps its parameter to a String by calling Object.toString() against it.
static
<E extends Enum<E>>
Map<String,E>
toEnum(Class<E> enumType)
          Returns a Map that maps the string representation of an enum to the corresponding enum value by calling Enum.valueOf(Class, String).
static Unary<String> toLowerCase(Locale locale)
          Returns a Unary that maps a String to lower case using locale.
static
<A,B> Map2<A,B,Pair<A,B>>
toPair()
          A Map2 object that maps 2 values into a Pair object.
static
<A,B,C> Map3<A,B,C,Tuple3<A,B,C>>
toTuple3()
          A Map3 object that maps 3 values to a Tuple3 object.
static
<A,B,C,D> Map4<A,B,C,D,Tuple4<A,B,C,D>>
toTuple4()
          A Map4 object that maps 4 values to a Tuple4 object.
static
<A,B,C,D,E>
Map5<A,B,C,D,E,Tuple5<A,B,C,D,E>>
toTuple5()
          A Map5 object that maps 5 values to a Tuple5 object.
static Unary<String> toUpperCase(Locale locale)
          Returns a Unary that maps a String to upper case using locale.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TO_INTEGER

public static final Map<String,Integer> TO_INTEGER
The Map that maps a String to Integer by calling Integer.valueOf(String).


TO_LOWER_CASE

public static Unary<String> TO_LOWER_CASE
The Unary that maps a String to lower case using Locale.US.


TO_UPPER_CASE

public static Unary<String> TO_UPPER_CASE
The Unary that maps a String to upper case using Locale.US.

Method Detail

toLowerCase

public static Unary<String> toLowerCase(Locale locale)
Returns a Unary that maps a String to lower case using locale.


toUpperCase

public static Unary<String> toUpperCase(Locale locale)
Returns a Unary that maps a String to upper case using locale.


mapToString

public static <T> Map<T,String> mapToString()
A Map instance that maps its parameter to a String by calling Object.toString() against it.


toEnum

public static <E extends Enum<E>> Map<String,E> toEnum(Class<E> enumType)
Returns a Map that maps the string representation of an enum to the corresponding enum value by calling Enum.valueOf(Class, String).


identity

public static <T> Unary<T> identity()
Returns an identity map that maps parameter to itself.


constant

public static <F,T> Map<F,T> constant(T v)
Returns a Map that always maps any object to v.


map

public static <K,V> Map<K,V> map(Map<K,V> m)
Adapts a Map to Map.


toPair

public static <A,B> Map2<A,B,Pair<A,B>> toPair()
A Map2 object that maps 2 values into a Pair object.


toTuple3

public static <A,B,C> Map3<A,B,C,Tuple3<A,B,C>> toTuple3()
A Map3 object that maps 3 values to a Tuple3 object.


toTuple4

public static <A,B,C,D> Map4<A,B,C,D,Tuple4<A,B,C,D>> toTuple4()
A Map4 object that maps 4 values to a Tuple4 object.


toTuple5

public static <A,B,C,D,E> Map5<A,B,C,D,E,Tuple5<A,B,C,D,E>> toTuple5()
A Map5 object that maps 5 values to a Tuple5 object.



Copyright © 2014. All rights reserved.