|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractList<List<T>>
org.expasy.jpl.commons.collection.PartitionList<T>
T - the list element object.public final class PartitionList<T>
This object is a partition of a List that proposes a view of smaller
split Lists.
http://www.vogella.de/articles/JavaAlgorithmsPartitionCollection/article.html
| Nested Class Summary | |
|---|---|
static interface |
PartitionList.IndexingAlgo<T>
|
static interface |
PartitionList.LastIndexingAlgo<T>
|
| Field Summary |
|---|
| Fields inherited from class java.util.AbstractList |
|---|
modCount |
| Method Summary | ||
|---|---|---|
void |
checkBounds(int i)
Get the indices of T-objects int the ith partition. |
|
List<T> |
get(int i)
|
|
IntegerSequence |
getIndices(int i)
Get the indices of T-objects of partition i. |
|
int[] |
getInterval(int i)
Get the indices of T-objects of partition i. |
|
List<T> |
getList()
|
|
int |
getMaxBucketCapacity()
|
|
int |
indexOf(Object value)
|
|
int |
indexOf(Object value,
PartitionList.IndexingAlgo<T> algo)
|
|
boolean |
isEmpty()
|
|
int |
lastIndexOf(Object value)
|
|
int |
lastIndexOf(Object value,
PartitionList.LastIndexingAlgo<T> algo)
|
|
int |
size()
|
|
static
|
withBucketCapacity(List<T> list,
int maxBucketCapacity)
Make a partition from a given list and a partition capacity. |
|
static
|
withBucketNumber(List<T> list,
int bucketNumber)
Make a partition from a given list and a bucket number. |
|
| Methods inherited from class java.util.AbstractList |
|---|
add, add, addAll, clear, equals, hashCode, iterator, listIterator, listIterator, remove, removeRange, set, subList |
| Methods inherited from class java.util.AbstractCollection |
|---|
addAll, contains, containsAll, remove, removeAll, retainAll, toArray, toArray, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.List |
|---|
addAll, contains, containsAll, remove, removeAll, retainAll, toArray, toArray |
| Method Detail |
|---|
public static <T> PartitionList<T> withBucketCapacity(List<T> list,
int maxBucketCapacity)
list - the list to partition.maxBucketCapacity - the max partition capacity.
public static <T> PartitionList<T> withBucketNumber(List<T> list,
int bucketNumber)
list - the list to divide.bucketNumber - the number of partitions.
public final List<T> get(int i)
get in interface List<List<T>>get in class AbstractList<List<T>>public final List<T> getList()
public int[] getInterval(int i)
T-objects of partition i.
i - the partition index.
public IntegerSequence getIndices(int i)
T-objects of partition i.
i - the partition index.
public void checkBounds(int i)
T-objects int the ith partition.
i - the partition index.public int size()
size in interface Collection<List<T>>size in interface List<List<T>>size in class AbstractCollection<List<T>>public int getMaxBucketCapacity()
public int indexOf(Object value)
indexOf in interface List<List<T>>indexOf in class AbstractList<List<T>>
public int indexOf(Object value,
PartitionList.IndexingAlgo<T> algo)
public int lastIndexOf(Object value)
lastIndexOf in interface List<List<T>>lastIndexOf in class AbstractList<List<T>>
public int lastIndexOf(Object value,
PartitionList.LastIndexingAlgo<T> algo)
public boolean isEmpty()
isEmpty in interface Collection<List<T>>isEmpty in interface List<List<T>>isEmpty in class AbstractCollection<List<T>>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||