|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectchord.util.SetUtils
public class SetUtils
Set related utilities.
| Field Summary | |
|---|---|
static int |
DEFAULT_ESTIMATED_SIZE
Default estimated size of a set. |
static int |
THRESHOLD
Threshold that, given the estimated size of a set to be created, is used to decide whether to use a lightweight (e.g. |
| Constructor Summary | |
|---|---|
SetUtils()
|
|
| Method Summary | ||
|---|---|---|
static
|
iterableToSet(java.lang.Iterable<T> c,
int size)
Create a set from the given iterable of the given estimated size. |
|
static
|
newSet()
Create a new set of the default estimated size. |
|
static
|
newSet(int size)
Create a new set of the given estimated size. |
|
static
|
newSet(java.util.Set<T> c)
Create a copy of the given set. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int DEFAULT_ESTIMATED_SIZE
public static final int THRESHOLD
| Constructor Detail |
|---|
public SetUtils()
| Method Detail |
|---|
public static <T> java.util.Set<T> newSet()
THRESHOLD is used to choose the implementation of
the created set based on the default estimated size.
T - The type of elements in the set.
public static <T> java.util.Set<T> newSet(int size)
THRESHOLD is used to choose the implementation of
the create set based on the given estimated size.
T - The type of elements in the set.size - The estimated size of the set.
public static <T> java.util.Set<T> newSet(java.util.Set<T> c)
THRESHOLD is used to choose the implementation of
the created set based on the size of the given set.
T - The type of elements in the given set.c - The given set to be copied.
public static <T> java.util.Set<T> iterableToSet(java.lang.Iterable<T> c,
int size)
THRESHOLD is used to choose the implementation of the
created set based on the given estimated size.
T - The type of elements in the iterable.c - The iterable.size - The estimated size of the iterable.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||