public final class BitSetList extends AbstractList<Integer> implements Cloneable
0 and 1
stored as bits in a BitSet.
Implementational note: E extends Integer
which in turn is final.
This means E is nothing but Integer.
Created: Mon May 29 19:37:38 2006
| Modifier and Type | Field and Description |
|---|---|
private int |
size |
private BitSet |
wrapped |
modCount| Constructor and Description |
|---|
BitSetList()
Creates a new
BitSetList instance. |
BitSetList(Collection<? extends Integer> coll)
Creates a new
BitSetList instance. |
BitSetList(int initialCapacity) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(int index,
Integer integer)
Describe
add method here. |
private static Integer |
bool2int(boolean bool)
Returns the C-representation
of the given
boolean as an int. |
int |
cardinality() |
void |
clear()
Describe
clear method here. |
BitSetList |
clone() |
boolean |
contains(Object object)
Describe
contains method here. |
boolean |
equals(Object other) |
Integer |
get(int index)
Describe
get method here. |
int |
hashCode()
Returns the hash code value for this cyclic list.
|
private static boolean |
int2bool(int num)
Converts the given C-style-representation of a
boolean. |
int |
length1()
Returns the "logical size" of this List:
The index of the highest digit
1 in the List plus one. |
Integer |
remove(int index)
Describe
remove method here. |
boolean |
remove(Object object)
Describe
remove method here. |
Integer |
set(int index,
Integer integer)
Describe
set method here. |
void |
setW(int index) |
int |
size()
Describe
size method here. |
int |
sizeInternally() |
add, addAll, indexOf, iterator, lastIndexOf, listIterator, listIterator, removeRange, subListaddAll, containsAll, isEmpty, removeAll, retainAll, toArray, toArray, toStringfinalize, getClass, notify, notifyAll, wait, wait, waitaddAll, containsAll, isEmpty, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArrayparallelStream, removeIf, streamprivate BitSet wrapped
private int size
public BitSetList()
BitSetList instance.public BitSetList(Collection<? extends Integer> coll)
BitSetList instance.coll - a collection which may not contain null pointers.NullPointerException - if coll contains a null pointer.IllegalArgumentException - if coll contains an Integer object
other than 0 or 1.public BitSetList(int initialCapacity)
private static Integer bool2int(boolean bool)
boolean as an int.bool - a boolean value.int representation of bool:
1 if bool == true .
0 if bool == false.
int2bool(int)private static boolean int2bool(int num)
boolean.bool representation of num:
true if num == 1.
false if num == 0.
IllegalArgumentException - if num is neither 0 nor 1.bool2int(boolean)public int cardinality()
public int sizeInternally()
public int length1()
1 in the List plus one.
Returns zero if the List contains 0's only.public void setW(int index)
public int hashCode()
hashCode = 1;
Iterator i = list.iterator();
while (i.hasNext()) {
Object obj = i.next();
hashCode = 31*hashCode + (obj==null ? 0 : obj.hashCode());
}
This ensures that list1.equals(list2) implies that
list1.hashCode()==list2.hashCode() for any two lists,
list1 and list2,
as required by the general contract of Object.hashCode.
Note that this list does not allow null-elements and the hash code of an element is its value.
hashCode in interface Collection<Integer>hashCode in interface List<Integer>hashCode in class AbstractList<Integer>List.hashCode(),
Object.equals(Object),
equals(Object)public boolean equals(Object other)
equals in interface Collection<Integer>equals in interface List<Integer>equals in class AbstractList<Integer>public void add(int index,
Integer integer)
add method here.public void clear()
clear method here.clear in interface Collection<Integer>clear in interface List<Integer>clear in class AbstractList<Integer>public boolean contains(Object object)
contains method here.contains in interface Collection<Integer>contains in interface List<Integer>contains in class AbstractCollection<Integer>object - an Object valueboolean valuepublic Integer get(int index)
get method here.public int size()
size method here.size in interface Collection<Integer>size in interface List<Integer>size in class AbstractCollection<Integer>int valuepublic boolean remove(Object object)
remove method here.remove in interface Collection<Integer>remove in interface List<Integer>remove in class AbstractCollection<Integer>object - the Object to be removed, if present.boolean value true
if this list contained the specified element.public Integer remove(int index)
remove method here.public BitSetList clone() throws CloneNotSupportedException
clone in class ObjectCloneNotSupportedExceptionCopyright © 2012–2018 Simuline Organization (l2r). All rights reserved.