org.crsh.util
Class Utils

java.lang.Object
  extended by org.crsh.util.Utils

public class Utils
extends Object


Field Summary
private static Iterator EMPTY_ITERATOR
          .
private static Pattern FOO
           
 
Constructor Summary
Utils()
           
 
Method Summary
static String globexToRegex(String globex)
          Create a pattern that transforms a glob expression into a regular expression, the following task are supported * : Match any number of unknown characters ? : Match one unknown character [characters] : Match a character as part of a group of characters \ : Escape character
static int indexOf(CharSequence s, int off, char c)
           
static
<E> Iterator<E>
iterator()
           
static
<E> Iterator<E>
iterator(E element)
           
static
<E> List<E>
list(E... elements)
           
static
<E> List<E>
list(Iterable<E> iterable)
           
static
<E> List<E>
list(Iterator<E> iterator)
           
static
<K,V> HashMap<K,V>
map(K key, V value)
           
static
<K,V,M extends Map<K,V>>
M
map(M map, K key, V value)
           
static
<E> ArrayList<E>
newArrayList()
           
static
<K,V> HashMap<K,V>
newHashMap()
           
static
<E> HashSet<E>
newHashSet()
           
static
<E> LinkedList<E>
newLinkedList()
           
static
<E> E
notNull(E e1, E e2)
           
static String trimLeft(String s)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY_ITERATOR

private static final Iterator EMPTY_ITERATOR
.


FOO

private static final Pattern FOO
Constructor Detail

Utils

public Utils()
Method Detail

iterator

public static <E> Iterator<E> iterator()

iterator

public static <E> Iterator<E> iterator(E element)

newArrayList

public static <E> ArrayList<E> newArrayList()

newLinkedList

public static <E> LinkedList<E> newLinkedList()

newHashSet

public static <E> HashSet<E> newHashSet()

newHashMap

public static <K,V> HashMap<K,V> newHashMap()

map

public static <K,V,M extends Map<K,V>> M map(M map,
                                             K key,
                                             V value)

map

public static <K,V> HashMap<K,V> map(K key,
                                     V value)

list

public static <E> List<E> list(E... elements)

list

public static <E> List<E> list(Iterable<E> iterable)

list

public static <E> List<E> list(Iterator<E> iterator)

indexOf

public static int indexOf(CharSequence s,
                          int off,
                          char c)

trimLeft

public static String trimLeft(String s)

notNull

public static <E> E notNull(E e1,
                            E e2)

globexToRegex

public static String globexToRegex(String globex)
                            throws NullPointerException
Create a pattern that transforms a glob expression into a regular expression, the following task are supported

Parameters:
globex - the glob expression
Returns:
the regular expression
Throws:
NullPointerException - when the globex argument is null


Copyright © 2013 eXo Platform SAS. All Rights Reserved.