org.ckkloverdos.collection
Class L

java.lang.Object
  extended by org.ckkloverdos.collection.L
All Implemented Interfaces:
IL, IToStringAware

public class L
extends java.lang.Object
implements IL

Basic implementation of IL.

The list is a wrapper for the underlying backing store, which is either a Collection or an array of objects and treats theses two cases uniformly.

Arrays of primitive types are not supported, so this will throw an exception:

 L l = new L(new int[]{1, 2, 3});
 System.out.println(l);
 

Author:
Christos KK Loverdos

Field Summary
protected  java.lang.Object[] array
           
protected  java.util.Collection col
           
 
Constructor Summary
L()
          Constructs a new list.
L(java.util.Collection collection)
          Constructs a new list with the provided collection as the backing store.
L(java.util.Iterator iterator)
          Constructs a new list from the elements provided by the iterator.
L(java.lang.Object o)
          Constructs a new list.
L(java.lang.Object[] array)
          Constructs a new list with the provided array as the backing store.
L(java.lang.Object a, java.lang.Object b)
          Constructs a new list with an Object array containing the two objects as the backing store.
L(java.lang.Object a, java.lang.Object b, java.lang.Object c)
          Constructs a new list with an Object array containing the three objects as the backing store.
L(java.lang.Object a, java.lang.Object b, java.lang.Object c, java.lang.Object d)
          Constructs a new list with an Object array containing the four objects as the backing store.
L(java.lang.Object a, java.lang.Object b, java.lang.Object c, java.lang.Object d, java.lang.Object e)
          Constructs a new list with an Object array containing the five objects as the backing store.
L(java.util.Set set)
          Constructs a new list withe the provided set as the backing store.
 
Method Summary
 IL add(java.lang.Object o)
          Adds the element to the list.
 IL addAll(java.util.Collection c)
          Adds all the elements of the collection to this list.
 IL addAll(IL l)
          Adds all the elements of the given list to this one.
 IL addAll(java.lang.Object[] array)
          Adds all the elements of the array to this list.
 boolean all(IFilter filter)
          Returns true iff all the elements can be accepted by the filter.
 boolean all(IFilter filter, java.lang.Object hints)
          Returns true iff all the elements can be accepted by the filter.
 boolean any(IFilter filter)
          Returns true iff all the elements can be accepted by the filter.
 boolean any(IFilter filter, java.lang.Object hints)
          Returns true iff all the elements can be accepted by the filter.
 IL chopPrefix(java.lang.String prefix)
          Chops the prefix from all elements, which are assumed to be strings.
 IL chopPrefixRE(java.lang.String prefix)
          Chops the regular expression prefix from all elements, which are assumed to be strings.
 IL chopSuffix(java.lang.String suffix)
          Chops the suffix from all elements, which are assumed to be strings.
 IL chopSuffixRE(java.lang.String suffix)
          Chops the regula expression suffix from all elements, which are assumed to be strings.
 IL clear(java.lang.Object o)
          Completely removes the element from the list.
 boolean contains(java.lang.Object o)
          Returns true if this list contains the specified element.
 IL copy()
          Returns a copy of this list.
 IL filter(IFilter filter)
          Returns a new list with all the elements that are accepted by filter.
 IL filter(IFilter filter, java.lang.Object hints)
          Returns a new list with all the elements that are accepted by filter.
 IL filterEndsWith(java.lang.String s)
          Filters all elements that end with s, assuming that elements are strings.
 IL filterEndsWithRE(java.lang.String re)
           
 IL filterEndsWithRE(java.lang.String re, int modifiers)
           
 IL filterFindRE(java.lang.String re)
          Uses Matcher.find().
 IL filterFindRE(java.lang.String re, int modifiers)
          Uses Matcher.find().
 void filterForEach(IFilterProcedure function)
          Combines filtering and processing in one place.
 void filterForEach(IFilterProcedure function, java.lang.Object hints)
          Combines filtering and processing in one place.
 IL filterMap(IFilterFunction ff)
          Combines filtering and mapping in one place.
 IL filterMap(IFilterFunction ff, java.lang.Object hints)
          Combines filtering and mapping in one place.
 IL filterMatchesRE(java.lang.String re)
          Uses Matcher.matches().
 IL filterMatchesRE(java.lang.String re, int modifiers)
          Uses Matcher.matches().
 IL filterNotEndsWith(java.lang.String s)
          Filters all elements that end with s, assuming that elements are strings.
 IL filterNotEndsWithRE(java.lang.String re)
           
 IL filterNotEndsWithRE(java.lang.String re, int modifiers)
           
 IL filterNotFindRE(java.lang.String re)
          Uses Matcher.find().
 IL filterNotFindRE(java.lang.String re, int modifiers)
          Uses Matcher.find().
 IL filterNotMatchesRE(java.lang.String re)
          Uses Matcher.matches().
 IL filterNotMatchesRE(java.lang.String re, int modifiers)
          Uses Matcher.matches().
 IL filterNotStartsWith(java.lang.String s)
          Filters all elements that do not start with s, assuming that elements are strings.
 IL filterNotStartsWithRE(java.lang.String re)
           
 IL filterNotStartsWithRE(java.lang.String re, int modifiers)
           
 IL filterStartsWith(java.lang.String s)
          Filters all elements that start with s, assuming that elements are strings.
 IL filterStartsWithRE(java.lang.String re)
           
 IL filterStartsWithRE(java.lang.String re, int modifiers)
           
 void forEach(IProcedure function)
          Processes all alements with procedure.
 void forEach(IProcedure function, java.lang.Object hints)
          Processes all alements with procedure.
 java.lang.Object get(int i)
          Returns the i-th element of this list.
 java.lang.String getString(int i)
          Convenience method that returns the i-th string of this list, assuming that the list contains strings.
 int hashCode()
           
 java.lang.Object head()
          Returns the first element of this list, retrieved from the iterator.
 java.lang.Object head(IFilter filter)
          Returns the first element of this list that is accepted by filter.
 java.lang.Object head(IFilter filter, java.lang.Object hints)
          Returns the first element of this list that is accepted by filter.
 IL intersect(IL other)
          Returns a new list containg the elements of this list that also belong to the other list.
 boolean isArray()
          Returns true if this list wraps an Object array.
 boolean isCollection()
          Returns true if this list wraps a Collection.
 boolean isList()
          Returns true if this list wraps a Collection and more specifically a List.
 boolean isSet()
          Returns true if this list wraps a Collection and more specifically a Set.
 java.util.Iterator iterator()
          Returns an iterator over the elements in this list.
 java.util.Iterator iterator(IFilter filter)
          Returns an iterator over the elements in this list that are accepted by the given filter.
 java.util.Iterator iterator(IFilter filter, java.lang.Object hints)
          Returns an iterator over the elements in this list that are accepted by the given filter.
 IL map(IFunction function)
          Returns a new list containing all the elements of this list, mapped by function.
 IL map(IFunction function, java.lang.Object hints)
          Returns a new list containing all the elements of this list, mapped by function.
 IL minus(IL other)
          Returns a new list containg the elements of this list that do not belong to the other list.
protected  java.util.Collection newCollection()
           
protected  java.util.Collection newCollection(java.util.Collection withItems)
           
protected  java.util.Collection newCollection(java.util.Iterator withItems)
           
protected  java.util.Collection newCollection(java.lang.Object[] withItems)
           
protected  java.util.List newList()
           
protected  java.util.List newList(java.util.Collection withElements)
           
protected  java.util.List newList(java.util.Iterator withElements)
           
protected  java.util.List newList(java.lang.Object[] withElements)
           
protected  java.util.Set newSet()
           
protected  java.util.Set newSet(java.util.Collection withElements)
           
protected  java.util.Set newSet(java.util.Iterator withElements)
           
protected  java.util.Set newSet(java.lang.Object[] withElements)
           
protected  java.util.SortedSet newSortedSet()
           
protected  java.util.SortedSet newSortedSet(java.util.Collection withElements)
           
protected  java.util.SortedSet newSortedSet(java.util.Collection withElements, java.util.Comparator c)
           
protected  java.util.SortedSet newSortedSet(java.util.Comparator c)
           
protected  java.util.SortedSet newSortedSet(java.lang.Object[] withElements)
           
 void print()
          Prints the elements to standard output.
 void print(java.io.PrintStream ps)
          Prints the elements to the PrintStream.
 void print(java.io.PrintWriter pw)
          Prints the elements to the PrintWriter.
 IL remove(java.lang.Object o)
          Removes the element from the list (only once).
 IL selectProperty(java.lang.String propertyName)
          Returns a new list with the JavaBean properties of the given name for each element.
 IL setFrom(CollectionProxy proxy)
          Sets the elements of this list from those of the collection proxy.
 int size()
          Returns the number of elements in this list.
 IL sort()
          Sorts the elements of the list.
 IL sort(java.util.Comparator c)
          Sorts the elements of the list, using the given Comparator.
 IL tail()
          Returns the list constructed from this one if we remove the head().
 IL take(int n)
          Returns the first n elements of this list, n starting from one.
 java.lang.Object[] toArray()
          Returns an array containing all of the elements in this collection.
 java.lang.Object[] toArray(java.lang.Class arrayClass)
          Returns an array containing all of the elements in this collection; the runtime type of the returned array is that of the specified class.
 java.util.Collection toCollection()
          Returns a Collection containing the elements of this array.
 java.util.List toList()
          Returns a List containing the elements of this array.
 java.util.Set toSet()
          Returns a Set containing the unique elements of this array.
 java.util.SortedSet toSortedSet()
          Returns a SortedSet containing the unique elements of this array.
 java.lang.String toString()
           
 java.lang.String[] toStringArray()
          Convenience method that returns the strings of this list, assuming of course that this list contains strings.
 void toStringAware(ToString ts)
           
 IL union(IL other)
          Returns a new list containg the elements of this list along with the elements of other.
 IL unique()
          Returns a set containing the unique elements of this list.
 IL zip(IL other)
          Implements list zipping.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

col

protected java.util.Collection col

array

protected java.lang.Object[] array
Constructor Detail

L

public L()
Constructs a new list. The backing store is a List.


L

public L(java.lang.Object o)
Constructs a new list. The backing store used depends on the type of o. In particular:

Parameters:
o -

L

public L(java.lang.Object a,
         java.lang.Object b)
Constructs a new list with an Object array containing the two objects as the backing store.


L

public L(java.lang.Object a,
         java.lang.Object b,
         java.lang.Object c)
Constructs a new list with an Object array containing the three objects as the backing store.


L

public L(java.lang.Object a,
         java.lang.Object b,
         java.lang.Object c,
         java.lang.Object d)
Constructs a new list with an Object array containing the four objects as the backing store.


L

public L(java.lang.Object a,
         java.lang.Object b,
         java.lang.Object c,
         java.lang.Object d,
         java.lang.Object e)
Constructs a new list with an Object array containing the five objects as the backing store.


L

public L(java.util.Collection collection)
Constructs a new list with the provided collection as the backing store.


L

public L(java.util.Set set)
Constructs a new list withe the provided set as the backing store.

Parameters:
set -

L

public L(java.util.Iterator iterator)
Constructs a new list from the elements provided by the iterator.


L

public L(java.lang.Object[] array)
Constructs a new list with the provided array as the backing store.

Method Detail

newSortedSet

protected java.util.SortedSet newSortedSet()

newSortedSet

protected java.util.SortedSet newSortedSet(java.util.Comparator c)

newSet

protected java.util.Set newSet()

newSet

protected java.util.Set newSet(java.util.Collection withElements)

newSet

protected java.util.Set newSet(java.util.Iterator withElements)

newSortedSet

protected java.util.SortedSet newSortedSet(java.util.Collection withElements)

newSortedSet

protected java.util.SortedSet newSortedSet(java.util.Collection withElements,
                                           java.util.Comparator c)

newSet

protected java.util.Set newSet(java.lang.Object[] withElements)

newSortedSet

protected java.util.SortedSet newSortedSet(java.lang.Object[] withElements)

newCollection

protected java.util.Collection newCollection()

newCollection

protected java.util.Collection newCollection(java.util.Collection withItems)

newCollection

protected java.util.Collection newCollection(java.util.Iterator withItems)

newCollection

protected java.util.Collection newCollection(java.lang.Object[] withItems)

newList

protected java.util.List newList()

newList

protected java.util.List newList(java.util.Collection withElements)

newList

protected java.util.List newList(java.util.Iterator withElements)

newList

protected java.util.List newList(java.lang.Object[] withElements)

iterator

public java.util.Iterator iterator()
Returns an iterator over the elements in this list.

Specified by:
iterator in interface IL

iterator

public java.util.Iterator iterator(IFilter filter)
Returns an iterator over the elements in this list that are accepted by the given filter.

Specified by:
iterator in interface IL
Parameters:
filter -

iterator

public java.util.Iterator iterator(IFilter filter,
                                   java.lang.Object hints)
Returns an iterator over the elements in this list that are accepted by the given filter. The hints parameter is passed directly to the filter.

Specified by:
iterator in interface IL
Parameters:
filter -
hints -

size

public int size()
Returns the number of elements in this list.

Specified by:
size in interface IL

contains

public boolean contains(java.lang.Object o)
Returns true if this list contains the specified element.

Specified by:
contains in interface IL
Parameters:
o -

isArray

public boolean isArray()
Returns true if this list wraps an Object array.

Specified by:
isArray in interface IL

isCollection

public boolean isCollection()
Returns true if this list wraps a Collection.

Specified by:
isCollection in interface IL

isSet

public boolean isSet()
Returns true if this list wraps a Collection and more specifically a Set.

Specified by:
isSet in interface IL

isList

public boolean isList()
Returns true if this list wraps a Collection and more specifically a List.

Specified by:
isList in interface IL

toArray

public java.lang.Object[] toArray()
Returns an array containing all of the elements in this collection. If this list is already wrapping an Object array, this array is returned.

Specified by:
toArray in interface IL

toArray

public java.lang.Object[] toArray(java.lang.Class arrayClass)
Returns an array containing all of the elements in this collection; the runtime type of the returned array is that of the specified class. If this list is already wrapping an Object array, this array is returned and it MUST be of the given type.

Specified by:
toArray in interface IL

toStringArray

public java.lang.String[] toStringArray()
Convenience method that returns the strings of this list, assuming of course that this list contains strings.

Specified by:
toStringArray in interface IL

toList

public java.util.List toList()
Returns a List containing the elements of this array. If this list is already wrapping a List, then it is returned intact, otherwise a new one is created.

Specified by:
toList in interface IL

toSet

public java.util.Set toSet()
Returns a Set containing the unique elements of this array. If this list is already wrapping a Set, then it is returned intact, otherwise a new one is created.

Specified by:
toSet in interface IL

toSortedSet

public java.util.SortedSet toSortedSet()
Returns a SortedSet containing the unique elements of this array. If this list is already wrapping a SortedSet, then it is returned intact, otherwise a new one is created.

Specified by:
toSortedSet in interface IL

toCollection

public java.util.Collection toCollection()
Returns a Collection containing the elements of this array. If this list is already wrapping a Collection, then it is returned intact, otherwise a new one is created.

Specified by:
toCollection in interface IL

get

public java.lang.Object get(int i)
Returns the i-th element of this list. If the underlying backing store is a set, then the order is that of the set iterator.

Specified by:
get in interface IL
Parameters:
i -

getString

public java.lang.String getString(int i)
Convenience method that returns the i-th string of this list, assuming that the list contains strings.

Specified by:
getString in interface IL
Parameters:
i -

head

public java.lang.Object head()
Returns the first element of this list, retrieved from the iterator.

Specified by:
head in interface IL
Throws:
java.lang.IndexOutOfBoundsException - of the list has no elements.

tail

public IL tail()
Returns the list constructed from this one if we remove the head(). If this list has no elements, an empty one is returned.

Specified by:
tail in interface IL

take

public IL take(int n)
Returns the first n elements of this list, n starting from one. If the list contains less than n elements, all are returned. If n is less than one, an empty list is returned.

Example:

 IL il = new L("zero", "one", "two", "three", "four");
 StdLog.log("il = " + il.take(3));
 
prints:
 [0="zero", 1="one", 2="two"]
 

Specified by:
take in interface IL
Parameters:
n -

head

public java.lang.Object head(IFilter filter)
Returns the first element of this list that is accepted by filter. Elements are retrieved from the iterator.

Specified by:
head in interface IL
Throws:
java.lang.IndexOutOfBoundsException - of the list has no elements or no element is accepted by filter.

head

public java.lang.Object head(IFilter filter,
                             java.lang.Object hints)
Returns the first element of this list that is accepted by filter. Elements are retrieved from the iterator. The second parameter hints is directly passed to the filter.

Specified by:
head in interface IL
Throws:
java.lang.IndexOutOfBoundsException - of the list has no elements or no element is accepted by filter.

filter

public IL filter(IFilter filter)
Returns a new list with all the elements that are accepted by filter.

Specified by:
filter in interface IL
Parameters:
filter -

filter

public IL filter(IFilter filter,
                 java.lang.Object hints)
Returns a new list with all the elements that are accepted by filter. The second parameter hints is directly passed to the filter.

Specified by:
filter in interface IL

map

public IL map(IFunction function)
Returns a new list containing all the elements of this list, mapped by function.

Specified by:
map in interface IL
Parameters:
function -

map

public IL map(IFunction function,
              java.lang.Object hints)
Returns a new list containing all the elements of this list, mapped by function. The second parameter hints is directly passed to the function.

Specified by:
map in interface IL

filterMap

public IL filterMap(IFilterFunction ff)
Combines filtering and mapping in one place.

Specified by:
filterMap in interface IL
Parameters:
ff -

filterMap

public IL filterMap(IFilterFunction ff,
                    java.lang.Object hints)
Combines filtering and mapping in one place. The second parameter hints is directly passed to ff.

If hints is an implementation of BinaryHint, then BinaryHint.getHintA() is passed to IFilter.accept(Object,Object) and BinaryHint.getHintB() is passed to IFunction.evaluate(Object,Object).

Specified by:
filterMap in interface IL
Parameters:
ff -
See Also:
BinaryHint

selectProperty

public IL selectProperty(java.lang.String propertyName)
Returns a new list with the JavaBean properties of the given name for each element.

If name ends with (), then the name is treated as a method, which is used to give the new elements.

Example

The code:
 IL il = new L("zero", "one", "two", "three", "four");
 System.out.println(il.selectProperty("length()"));
 
prints:
 [0=4, 1=3, 2=3, 3=5, 4=4]
 

Specified by:
selectProperty in interface IL

forEach

public void forEach(IProcedure function)
Processes all alements with procedure.

Specified by:
forEach in interface IL

forEach

public void forEach(IProcedure function,
                    java.lang.Object hints)
Processes all alements with procedure. The second parameter hints is directly passed to procedure.

Specified by:
forEach in interface IL

filterForEach

public void filterForEach(IFilterProcedure function)
Combines filtering and processing in one place. The elements to be processed are those accepted by the filter.

Specified by:
filterForEach in interface IL

filterForEach

public void filterForEach(IFilterProcedure function,
                          java.lang.Object hints)
Combines filtering and processing in one place. The elements to be processed are those accepted by the filter. The second parameter hints is directly passed to procedure.

If hints is an implementation of BinaryHint, then BinaryHint.getHintA() is passed to IFilter.accept(Object,Object) and BinaryHint.getHintB() is passed to IProcedure.process(Object,Object).

Specified by:
filterForEach in interface IL
See Also:
BinaryHint

copy

public IL copy()
Returns a copy of this list. The underlying backing store (collection or array) is preserved in the new list.

Specified by:
copy in interface IL

add

public IL add(java.lang.Object o)
Adds the element to the list. The addition is made directly at the backing store and no new list is created.

If the backing store is an array, then the component type of the array must be assignable from the class of the new element, unless the new element is null.

Example 1

The code:
 IL l = new L("zero", "one", "two", "three", "four");
 System.out.println(l.add(new Integer(1000)));
 
will print:
 [0="zero", 1="one", 2="two", 3="three", 4="four", 5=1000]
 

Example 2

The code:
 IL l = new L(new String[]{"zero", "one", "two", "three", "four"});
 System.out.println(l.add(new Integer(1000)));
 
will throw an exception: java.lang.IllegalArgumentException: array element type mismatch.

Example 3

The code:
 IL l = new L(new Number[] {new Long(1), new Float(2.2)});
 System.out.println(l.add(new Integer(1000)));
 
will print:
 [0=1, 1=2.2, 2=1000]
 

Specified by:
add in interface IL
Parameters:
o -
Returns:
this list with the new element added.

addAll

public IL addAll(java.util.Collection c)
Adds all the elements of the collection to this list. The comments of add(Object) apply here as well.

Specified by:
addAll in interface IL
Parameters:
c -

addAll

public IL addAll(java.lang.Object[] array)
Adds all the elements of the array to this list. The comments of add(Object) apply here as well.

Specified by:
addAll in interface IL
Parameters:
array -

addAll

public IL addAll(IL l)
Adds all the elements of the given list to this one. The comments of add(Object) apply here as well.

Specified by:
addAll in interface IL
Parameters:
l -

remove

public IL remove(java.lang.Object o)
Removes the element from the list (only once). The deletion is made directly at the backing store and no new list is created.

Specified by:
remove in interface IL
Parameters:
o -

clear

public IL clear(java.lang.Object o)
Completely removes the element from the list. The deletion is made directly at the backing store and no new list is created.

Specified by:
clear in interface IL
Parameters:
o -

setFrom

public IL setFrom(CollectionProxy proxy)
Sets the elements of this list from those of the collection proxy. This is lightweight and just updates the underlying backing store reference with that of the proxy.

Specified by:
setFrom in interface IL
Parameters:
proxy -

toStringAware

public void toStringAware(ToString ts)
Specified by:
toStringAware in interface IToStringAware

all

public boolean all(IFilter filter)
Returns true iff all the elements can be accepted by the filter. In case the list is empty, false is returned.

Specified by:
all in interface IL
Parameters:
filter -

all

public boolean all(IFilter filter,
                   java.lang.Object hints)
Returns true iff all the elements can be accepted by the filter. In case the list is empty, false is returned. The second parameter hints is directly passed to filter.

Specified by:
all in interface IL
Parameters:
filter -
hints -

any

public boolean any(IFilter filter)
Returns true iff all the elements can be accepted by the filter. In case the list is empty, true is returned.

Specified by:
any in interface IL
Parameters:
filter -

any

public boolean any(IFilter filter,
                   java.lang.Object hints)
Returns true iff all the elements can be accepted by the filter. In case the list is empty, true is returned. The second parameter hints is directly passed to filter.

Specified by:
any in interface IL
Parameters:
filter -
hints -

unique

public IL unique()
Returns a set containing the unique elements of this list. If the underlying backing store is already a set, then it is returned as is.

Specified by:
unique in interface IL

zip

public IL zip(IL other)
Implements list zipping. The elements of the new list are instances of Pair. The backing store of the returned list is a List.

Specified by:
zip in interface IL
Parameters:
other -

sort

public IL sort()
Sorts the elements of the list.

Specified by:
sort in interface IL

sort

public IL sort(java.util.Comparator c)
Sorts the elements of the list, using the given Comparator.

Specified by:
sort in interface IL

union

public IL union(IL other)
Returns a new list containg the elements of this list along with the elements of other.

If the underlying backing store is a set for both lists, then the method implements the set-theoretic union operation.

Specified by:
union in interface IL
Parameters:
other -

intersect

public IL intersect(IL other)
Returns a new list containg the elements of this list that also belong to the other list.

If the underlying backing store is a set for both lists, then the method implements the set-theoretic intersection operation.

Specified by:
intersect in interface IL
Parameters:
other -

minus

public IL minus(IL other)
Returns a new list containg the elements of this list that do not belong to the other list.

If the underlying backing store is a set for both lists, then the method implements the set-theoretic difference operation.

Specified by:
minus in interface IL
Parameters:
other -

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

chopPrefix

public IL chopPrefix(java.lang.String prefix)
Chops the prefix from all elements, which are assumed to be strings. nulls pass through.

Specified by:
chopPrefix in interface IL
Parameters:
prefix -

chopPrefixRE

public IL chopPrefixRE(java.lang.String prefix)
Chops the regular expression prefix from all elements, which are assumed to be strings. nulls pass through.

Specified by:
chopPrefixRE in interface IL
Parameters:
prefix -

chopSuffix

public IL chopSuffix(java.lang.String suffix)
Chops the suffix from all elements, which are assumed to be strings. nulls pass through.

Specified by:
chopSuffix in interface IL

chopSuffixRE

public IL chopSuffixRE(java.lang.String suffix)
Chops the regula expression suffix from all elements, which are assumed to be strings. nulls pass through.

Specified by:
chopSuffixRE in interface IL

filterStartsWith

public IL filterStartsWith(java.lang.String s)
Filters all elements that start with s, assuming that elements are strings. nulls do not pass through.

Specified by:
filterStartsWith in interface IL
Parameters:
s -

filterNotStartsWith

public IL filterNotStartsWith(java.lang.String s)
Filters all elements that do not start with s, assuming that elements are strings. nulls pass through.

Specified by:
filterNotStartsWith in interface IL
Parameters:
s -

filterEndsWith

public IL filterEndsWith(java.lang.String s)
Filters all elements that end with s, assuming that elements are strings. nulls do not pass through.

Specified by:
filterEndsWith in interface IL
Parameters:
s -

filterNotEndsWith

public IL filterNotEndsWith(java.lang.String s)
Filters all elements that end with s, assuming that elements are strings. nulls pass through.

Specified by:
filterNotEndsWith in interface IL
Parameters:
s -

filterFindRE

public IL filterFindRE(java.lang.String re)
Uses Matcher.find(). nulls do not pass through.

Specified by:
filterFindRE in interface IL
Parameters:
re -

filterNotFindRE

public IL filterNotFindRE(java.lang.String re)
Uses Matcher.find(). nulls pass through.

Specified by:
filterNotFindRE in interface IL
Parameters:
re -

filterFindRE

public IL filterFindRE(java.lang.String re,
                       int modifiers)
Uses Matcher.find(). nulls do not pass through.

Specified by:
filterFindRE in interface IL
Parameters:
re -

filterNotFindRE

public IL filterNotFindRE(java.lang.String re,
                          int modifiers)
Uses Matcher.find(). nulls pass through.

Specified by:
filterNotFindRE in interface IL
Parameters:
re -

filterMatchesRE

public IL filterMatchesRE(java.lang.String re)
Uses Matcher.matches(). nulls do not pass through.

Specified by:
filterMatchesRE in interface IL
Parameters:
re -

filterNotMatchesRE

public IL filterNotMatchesRE(java.lang.String re)
Uses Matcher.matches(). nulls pass through.

Specified by:
filterNotMatchesRE in interface IL
Parameters:
re -

filterMatchesRE

public IL filterMatchesRE(java.lang.String re,
                          int modifiers)
Uses Matcher.matches(). nulls do not pass through.

Specified by:
filterMatchesRE in interface IL
Parameters:
re -

filterNotMatchesRE

public IL filterNotMatchesRE(java.lang.String re,
                             int modifiers)
Uses Matcher.matches(). nulls pass through.

Specified by:
filterNotMatchesRE in interface IL
Parameters:
re -

filterStartsWithRE

public IL filterStartsWithRE(java.lang.String re)
Specified by:
filterStartsWithRE in interface IL

filterNotStartsWithRE

public IL filterNotStartsWithRE(java.lang.String re)
Specified by:
filterNotStartsWithRE in interface IL

filterStartsWithRE

public IL filterStartsWithRE(java.lang.String re,
                             int modifiers)
Specified by:
filterStartsWithRE in interface IL

filterNotStartsWithRE

public IL filterNotStartsWithRE(java.lang.String re,
                                int modifiers)
Specified by:
filterNotStartsWithRE in interface IL

filterEndsWithRE

public IL filterEndsWithRE(java.lang.String re)
Specified by:
filterEndsWithRE in interface IL

filterNotEndsWithRE

public IL filterNotEndsWithRE(java.lang.String re)
Specified by:
filterNotEndsWithRE in interface IL

filterEndsWithRE

public IL filterEndsWithRE(java.lang.String re,
                           int modifiers)
Specified by:
filterEndsWithRE in interface IL

filterNotEndsWithRE

public IL filterNotEndsWithRE(java.lang.String re,
                              int modifiers)
Specified by:
filterNotEndsWithRE in interface IL

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

print

public void print()
Description copied from interface: IL
Prints the elements to standard output.

Specified by:
print in interface IL

print

public void print(java.io.PrintStream ps)
Description copied from interface: IL
Prints the elements to the PrintStream.

Specified by:
print in interface IL

print

public void print(java.io.PrintWriter pw)
Description copied from interface: IL
Prints the elements to the PrintWriter.

Specified by:
print in interface IL


Copyright © 1999-2007 Christos KK Loverdos. All Rights Reserved.