コード例 #1
0
ファイル: BitSet.java プロジェクト: dperelman/WALA
 /** Does this set contain a certain object? */
 public boolean contains(T o) {
   int n = map.getMappedIndex(o);
   if (n == -1) {
     return false;
   }
   return vector.get(n);
 }
コード例 #2
0
ファイル: BitSet.java プロジェクト: dperelman/WALA
 /**
  * Remove an object from this bit set.
  *
  * @param o the object to remove
  */
 public void clear(T o) {
   int n = map.getMappedIndex(o);
   if (n == -1) {
     return;
   }
   vector.clear(n);
 }
コード例 #3
0
ファイル: BitSet.java プロジェクト: dperelman/WALA
 /**
  * Constructor: create an empty set corresponding to a given mapping
  *
  * @throws IllegalArgumentException if map is null
  */
 public BitSet(OrdinalSetMapping<T> map) {
   if (map == null) {
     throw new IllegalArgumentException("map is null");
   }
   int length = map.getMaximumIndex();
   vector = new BitVector(length);
   this.map = map;
 }
コード例 #4
0
 public Iterator<T> iterator() {
   return delegate.iterator();
 }
コード例 #5
0
 public boolean hasMappedIndex(T o) {
   return delegate.hasMappedIndex(o);
 }
コード例 #6
0
 public T getMappedObject(int n) throws NoSuchElementException {
   return delegate.getMappedObject(n - offset);
 }
コード例 #7
0
 public int getMappedIndex(T o) {
   if (delegate.getMappedIndex(o) == -1) {
     return -1;
   }
   return offset + delegate.getMappedIndex(o);
 }
コード例 #8
0
 public int add(T o) {
   return offset + delegate.add(o);
 }
コード例 #9
0
 public int getSize() {
   return delegate.getSize();
 }
コード例 #10
0
 public int getMaximumIndex() {
   return offset + delegate.getMaximumIndex();
 }
コード例 #11
0
ファイル: BitSet.java プロジェクト: dperelman/WALA
 /** Add an object to this bit set. */
 public void add(T o) {
   int n = map.getMappedIndex(o);
   vector.set(n);
 }