|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.norther.tammi.acorn.util.Collections
public abstract class Collections
Collection utilities.
| Field Summary | |
|---|---|
static Comparator |
ALPHA_NUMERIC_COMPARATOR
An alpha-numeric comparator. |
static Comparator |
DEFAULT_COMPARATOR
A default comparator. |
static Enumeration |
EMPTY_ENUMERATION
An empty unmodifiable enumeration. |
static Iterator |
EMPTY_ITERATOR
An empty unmodifiable iterator. |
static List |
EMPTY_LIST
An empty unmodifiable list. |
static ListIterator |
EMPTY_LIST_ITERATOR
An empty unmodifiable list iterator. |
static OrderedMap |
EMPTY_MAP
An empty unmodifiable map. |
static OrderedSet |
EMPTY_SET
An empty unmodifiable set. |
static Comparator |
REVERSE_COMPARATOR
A reverse comparator. |
| Constructor Summary | |
|---|---|
Collections()
|
|
| Method Summary | |
|---|---|
static void |
append(Map source,
Map target,
boolean noDuplicates)
Appends a map to another one. |
static int |
indexOf(Object source,
Object object)
Gets the index of the specified object in the source. |
static int |
indexOf(Object source,
Object object,
int fromIndex,
int toIndex)
Gets the index of the specified object within the specified range of the source. |
static void |
insert(Map source,
int index,
Map target,
boolean noDuplicates)
Inserts a map into another one. |
static int[] |
order(Object source)
Orders the specified source into ascending order and returns the new order as an array of indeces. |
static int[] |
order(Object source,
boolean reverse)
Orders the specified source into ascending or descending order and returns the new order as an array of indeces. |
static int[] |
order(Object source,
Comparator comp)
Orders the specified source to the order induced by the specified comparator and returns the new order as an array of indeces. |
static Object |
sort(Object source)
Sorts the specified source into ascending order. |
static Object |
sort(Object source,
Comparator comp)
Sorts the specified source to the order induced by the specified comparator. |
static Object |
sort(Object source,
int[] order)
Sorts the specified source into the specified order. |
static Object |
sort(Object array,
int fromIndex,
int toIndex)
Sorts the specified range of the specified array into ascending order. |
static boolean |
subset(String prefix,
String delims,
boolean plainKeysOnly,
boolean absentKeysOnly,
Map source,
ConcurrentMap subset)
Collects a subset of the given map from key-value pairs having the specified prefix and optionally absent in the subset. |
static boolean |
subset(String prefix,
String delims,
boolean plainKeysOnly,
Map source,
Map subset)
Collects a subset of the given map from key-value pairs having the specified prefix. |
static boolean |
subset(String prefix,
String delims,
Map source)
Collects a subset of the given map by removing key-value pairs having the specified prefix. |
static boolean |
subset(String prefix,
String delims,
Map source,
Map subset)
Collects a subset of the given map from key-value pairs having the specified prefix. |
static boolean |
subset(String prefix,
String suffix,
String delims,
boolean plainKeysOnly,
boolean absentKeysOnly,
Map source,
ConcurrentMap subset)
Collects a subset of the given map from key-value pairs having the specified prefix and/or suffix and optionally absent in the subset. |
static boolean |
subset(String prefix,
String suffix,
String delims,
boolean plainKeysOnly,
Map source,
Map subset)
Collects a subset of the given map from key-value pairs having the specified prefix and/or suffix. |
static boolean |
subset(String prefix,
String suffix,
String delims,
Map source)
Collects a subset of the given map by removing key-value pairs having the specified prefix and/or suffix. |
static boolean |
subset(String prefix,
String suffix,
String delims,
Map source,
Map subset)
Collects a subset of the given map from key-value pairs having the specified prefix and/or suffix. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final List EMPTY_LIST
public static final OrderedSet EMPTY_SET
public static final OrderedMap EMPTY_MAP
public static final Iterator EMPTY_ITERATOR
public static final ListIterator EMPTY_LIST_ITERATOR
public static final Enumeration EMPTY_ENUMERATION
public static final Comparator DEFAULT_COMPARATOR
public static final Comparator REVERSE_COMPARATOR
public static final Comparator ALPHA_NUMERIC_COMPARATOR
| Constructor Detail |
|---|
public Collections()
| Method Detail |
|---|
public static int indexOf(Object source,
Object object)
source - the source.object - the object.
public static int indexOf(Object source,
Object object,
int fromIndex,
int toIndex)
source - the source.object - the object.fromIndex - the index to start from, inclusive.toIndex - the index to end to, exclusive.
public static Object sort(Object source)
source - the source to sort.
public static Object sort(Object source,
Comparator comp)
Note that primitive arrays are converted to the corresponding object arrays.
source - the source to sort.comp - the comparator.
public static Object sort(Object array,
int fromIndex,
int toIndex)
array - the array to sort.fromIndex - the index to start from, inclusive.toIndex - the index to end to, exclusive.
public static Object sort(Object source,
int[] order)
source - the source to sort.order - an array of ordered indeces.
public static int[] order(Object source)
source - the source to order.
public static int[] order(Object source,
boolean reverse)
source - the source to order.reverse - true for reversed order.
public static int[] order(Object source,
Comparator comp)
source - the source to order.comp - the comparator.
public static void append(Map source,
Map target,
boolean noDuplicates)
source - the source map.target - the destination map.noDuplicates - true to remove duplicates, false otherwise.
public static void insert(Map source,
int index,
Map target,
boolean noDuplicates)
source - the source map.index - the index.target - the target map.noDuplicates - true to remove duplicates, false otherwise.
public static boolean subset(String prefix,
String delims,
Map source)
prefix - a key prefix (may be null).delims - key delimiters (may be null).source - the source map.
public static boolean subset(String prefix,
String suffix,
String delims,
Map source)
prefix - a key prefix (may be null).suffix - a key suffix (may be null).delims - key delimiters (may be null).source - the source map.
public static boolean subset(String prefix,
String delims,
Map source,
Map subset)
prefix - a key prefix (may be null).delims - key delimiters (may be null).source - the source map.subset - the target map.
public static boolean subset(String prefix,
String suffix,
String delims,
Map source,
Map subset)
prefix - a key prefix (may be null).suffix - a key suffix (may be null).delims - key delimiters (may be null).source - the source map.subset - the target map.
public static boolean subset(String prefix,
String delims,
boolean plainKeysOnly,
Map source,
Map subset)
prefix - a key prefix (may be null).delims - key delimiters(may be null).plainKeysOnly - true to accept keys without delimiters only.source - the source map.subset - the target map.
public static boolean subset(String prefix,
String suffix,
String delims,
boolean plainKeysOnly,
Map source,
Map subset)
prefix - a key prefix (may be null).suffix - a key suffix (may be null).delims - key delimiters (may be null).plainKeysOnly - true to accept keys without delimiters only.source - the source map.subset - the target map.
public static boolean subset(String prefix,
String delims,
boolean plainKeysOnly,
boolean absentKeysOnly,
Map source,
ConcurrentMap subset)
prefix - a key prefix (may be null).delims - key delimiters (may be null).plainKeysOnly - true to accept keys without delimiters only.absentKeysOnly - true to accept keys absent in the subset only.source - the source map.subset - the target map.
public static boolean subset(String prefix,
String suffix,
String delims,
boolean plainKeysOnly,
boolean absentKeysOnly,
Map source,
ConcurrentMap subset)
prefix - a key prefix (may be null).suffix - a key suffix (may be null).delims - key delimiters (may be null).plainKeysOnly - true to accept keys without delimiters only.absentKeysOnly - true to accept keys absent in the subset only.source - the source map.subset - the target map.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||