|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.zkoss.util.CollectionsX
public class CollectionsX
The collection related utilities.
Collections| Nested Class Summary | |
|---|---|
static class |
CollectionsX.ArrayCollection
An readonly collection on top of an array. |
static class |
CollectionsX.ArrayEnumeration
An enumeration on top of an array. |
static class |
CollectionsX.ArrayIterator
An iterator on top of an array. |
static class |
CollectionsX.ArrayList
An readonly list on top of an array. |
static class |
CollectionsX.ArrayListIterator
|
static class |
CollectionsX.CollectionEnumeration
An enumeration on top of a collection or iterator. |
static class |
CollectionsX.EnumerationIterator
An iterator that iterates thru an Enumeration. |
static class |
CollectionsX.OneCollection
A collection that contains only one element. |
static class |
CollectionsX.OneEnumeration
An enumeration that enumerates one element. |
static class |
CollectionsX.OneIterator
An iterator that iterates one element. |
| Field Summary | |
|---|---|
static java.util.Enumeration |
EMPTY_ENUMERATION
Empty enumeration. |
static java.util.Iterator |
EMPTY_ITERATOR
Empty iterator. |
| Constructor Summary | |
|---|---|
CollectionsX()
|
|
| Method Summary | |
|---|---|
static int |
addAll(java.util.Collection col,
java.util.Enumeration enm)
Adds all elements returned by the enumerator to a collection. |
static int |
addAll(java.util.Collection col,
java.util.Iterator iter)
Adds all elements returned by the iterator to a collection. |
static int |
addAll(java.util.Collection col,
java.lang.Object[] ary)
Adds all elements of an array to a collection. |
static boolean |
isIntersected(java.util.Set a,
java.util.Set b)
Tests whether two sets has any intersection. |
static java.util.Iterator |
iterator(java.lang.Object obj)
Based on the given collection type of Object, return an iterator. |
static java.util.Collection |
parse(java.util.Collection c,
java.lang.String src,
char separator)
Parses a string into a list. |
static java.util.Collection |
parse(java.util.Collection c,
java.lang.String src,
char separator,
boolean handleBackslash)
Parses a string into a list. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.util.Iterator EMPTY_ITERATOR
public static final java.util.Enumeration EMPTY_ENUMERATION
| Constructor Detail |
|---|
public CollectionsX()
| Method Detail |
|---|
public static final int addAll(java.util.Collection col,
java.util.Iterator iter)
iter - the iterator; null is OK
public static final int addAll(java.util.Collection col,
java.util.Enumeration enm)
enm - the enumeration; null is OK
public static final int addAll(java.util.Collection col,
java.lang.Object[] ary)
ary - the array; null is OK
public static final boolean isIntersected(java.util.Set a,
java.util.Set b)
public static final java.util.Collection parse(java.util.Collection c,
java.lang.String src,
char separator)
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".
c - the collection to hold the parsed results; a linked list
is created if c is null.src - the string to parseseparator - the separator, e.g., ',', '\n' or ' '.
Note: if separator is ' ', it denotes any white space.
c collection if not null; or a linked list
if c is null (so you can cast it to List)
IllegalSyntaxException - if syntax errorsMaps.parse(java.util.Map, java.lang.String, char, char)
public static final java.util.Collection parse(java.util.Collection c,
java.lang.String src,
char separator,
boolean handleBackslash)
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".
c - the collection to hold the parsed results; a linked list
is created if c is null.src - the string to parseseparator - the separator, e.g., ',', '\n' or ' '.
Note: if separator is ' ', it denotes any white space.handleBackslash - whether to treat '\\' specially (as escape char)
c collection if not null; or a linked list
if c is null (so you can cast it to List)
IllegalSyntaxException - if syntax errorsMaps.parse(java.util.Map, java.lang.String, char, char)public static final java.util.Iterator iterator(java.lang.Object obj)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||