| java.lang.Object org.zkoss.util.CollectionsX
Inner Class :final public static class CollectionEnumeration implements Enumeration | |
Inner Class :final public static class ArrayEnumeration implements Enumeration | |
Inner Class :final public static class OneEnumeration implements Enumeration | |
Inner Class :final public static class ArrayList extends AbstractList | |
Inner Class :public static class ArrayIterator implements Iterator | |
Inner Class :public static class ArrayListIterator extends ArrayIterator implements ListIterator | |
Inner Class :final public static class OneIterator implements Iterator | |
Inner Class :final public static class EnumerationIterator implements Iterator | |
Method Summary | |
final public static int | addAll(Collection col, Iterator iter) Adds all elements returned by the iterator to a collection. | final public static int | addAll(Collection col, Enumeration enm) Adds all elements returned by the enumerator to a collection. | final public static int | addAll(Collection col, Object[] ary) Adds all elements of an array to a collection. | final public static boolean | isIntersected(Set a, Set b) Tests whether two sets has any intersection. | final public static Iterator | iterator(Object obj) Based on the given collection type of Object, return an iterator. | final public static Collection | parse(Collection c, String src, char separator) Parses a string into a list.
To quote a string, both '\'' and '"' are OK.
Whitespaces are trimmed between quotation and separators.
Unlike Java, quotation could spread over multiple lines.
Example,
a b , ' c d',"'f'", '1' "2", 3
generate a list of "a b", "c d", "'f'", "1", "2" and "3".
Note: the separator between "1" and "2" is optional.
Note: Like Java, if the string is ending with a separator,
it will be ignored.
Example,
a, , b,
generate a list of "a", "", "b".
Parameters: c - the collection to hold the parsed results; a linked listis created if c is null. Parameters: src - the string to parse Parameters: separator - the separator, e.g., ',', '\n' or ' '.Note: if separator is ' ', it denotes any white space. | final public static Collection | parse(Collection c, String src, char separator, boolean handleBackslash) Parses a string into a list. |
EMPTY_ENUMERATION | final public static Enumeration EMPTY_ENUMERATION(Code) | | Empty enumeration.
|
EMPTY_ITERATOR | final public static Iterator EMPTY_ITERATOR(Code) | | Empty iterator.
|
addAll | final public static int addAll(Collection col, Iterator iter)(Code) | | Adds all elements returned by the iterator to a collection.
Parameters: iter - the iterator; null is OK the number element being added |
addAll | final public static int addAll(Collection col, Enumeration enm)(Code) | | Adds all elements returned by the enumerator to a collection.
Parameters: enm - the enumeration; null is OK the number element being added |
addAll | final public static int addAll(Collection col, Object[] ary)(Code) | | Adds all elements of an array to a collection.
Parameters: ary - the array; null is OK the number element being added |
isIntersected | final public static boolean isIntersected(Set a, Set b)(Code) | | Tests whether two sets has any intersection.
|
iterator | final public static Iterator iterator(Object obj)(Code) | | Based on the given collection type of Object, return an iterator. The
Collection type of object can be Collection, Map (return the entry), or
Array.
|
parse | final public static Collection parse(Collection c, String src, char separator)(Code) | | Parses a string into a list.
To quote a string, both '\'' and '"' are OK.
Whitespaces are trimmed between quotation and separators.
Unlike Java, quotation could spread over multiple lines.
Example,
a b , ' c d',"'f'", '1' "2", 3
generate a list of "a b", "c d", "'f'", "1", "2" and "3".
Note: the separator between "1" and "2" is optional.
Note: Like Java, if the string is ending with a separator,
it will be ignored.
Example,
a, , b,
generate a list of "a", "", "b".
Parameters: c - the collection to hold the parsed results; a linked listis created if c is null. Parameters: src - the string to parse Parameters: separator - the separator, e.g., ',', '\n' or ' '.Note: if separator is ' ', it denotes any white space. the c collection if not null; or a linked listif c is null (so you can cast it to List) exception: IllegalSyntaxException - if syntax errors See Also: Maps.parse |
parse | final public static Collection parse(Collection c, String src, char separator, boolean handleBackslash)(Code) | | Parses a string into a list.
To quote a string, both '\'' and '"' are OK.
Whitespaces are trimmed between quotation and separators.
Unlike Java, quotation could spread over multiple lines.
Example,
a b , ' c d',"'f'", '1' "2", 3
generate a list of "a b", "c d", "'f'", "1", "2" and "3".
Note: the separator between "1" and "2" is optional.
Note: Like Java, if the string is ending with a separator,
it will be ignored.
Example,
a, , b,
generate a list of "a", "", "b".
Parameters: c - the collection to hold the parsed results; a linked listis created if c is null. Parameters: src - the string to parse Parameters: separator - the separator, e.g., ',', '\n' or ' '.Note: if separator is ' ', it denotes any white space. Parameters: handleBackslash - whether to treat '\\' specially (as escape char) the c collection if not null; or a linked listif c is null (so you can cast it to List) exception: IllegalSyntaxException - if syntax errors See Also: Maps.parse |
|
|