de.lmu.ifi.dbs.elki.utilities
Class Util.MaskedArrayList<T>
java.lang.Object
java.util.AbstractCollection<T>
de.lmu.ifi.dbs.elki.utilities.Util.MaskedArrayList<T>
- Type Parameters:
T
- Object type
- All Implemented Interfaces:
- Iterable<T>, Collection<T>
- Enclosing class:
- Util
public static class Util.MaskedArrayList<T>
- extends AbstractCollection<T>
- implements Collection<T>
This class is a virtual collection based on masking an array list using a
bit mask.
Field Summary |
protected BitSet |
bits
The bitmask used for masking |
protected ArrayList<T> |
data
Data storage |
protected boolean |
inverse
Flag whether to iterator over set or unset values. |
Methods inherited from class java.util.AbstractCollection |
addAll, clear, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString |
Methods inherited from interface java.util.Collection |
addAll, clear, contains, containsAll, equals, hashCode, isEmpty, remove, removeAll, retainAll, toArray, toArray |
data
protected ArrayList<T> data
- Data storage
bits
protected BitSet bits
- The bitmask used for masking
inverse
protected boolean inverse
- Flag whether to iterator over set or unset values.
Util.MaskedArrayList
public Util.MaskedArrayList(ArrayList<T> data,
BitSet bits,
boolean inverse)
- Constructor.
- Parameters:
data
- Databits
- Bitset to use as maskinverse
- Flag to inverse the masking rule
add
public boolean add(T e)
- Specified by:
add
in interface Collection<T>
- Overrides:
add
in class AbstractCollection<T>
iterator
public Iterator<T> iterator()
- Specified by:
iterator
in interface Iterable<T>
- Specified by:
iterator
in interface Collection<T>
- Specified by:
iterator
in class AbstractCollection<T>
size
public int size()
- Specified by:
size
in interface Collection<T>
- Specified by:
size
in class AbstractCollection<T>