@Override public boolean hasNext() { synchronized (ColtIntegerHashSet.this) { return index < mapKeyList.size(); } }
@Override public boolean hasNext() { synchronized (ColtHashSet.this) { return index < mapKeyList.size(); } }
@Override public Long next() { synchronized (ColtIntegerHashSet.this) { if (versionSnapshot != version) { throw new ConcurrentModificationException(); } if (index >= mapKeyList.size()) { throw new NoSuchElementException(); } long value = mapKeyList.getQuick(index); index++; canRemove = true; return value; } }
/** * Returns a list which is a concatenation of <code>times</code> times the receiver. * @param times the number of times the receiver shall be copied. */ public AbstractDoubleList times(int times) { AbstractDoubleList newList = new DoubleArrayList(times*size()); for (int i=times; --i >= 0; ) { newList.addAllOfFromTo(this,0,size()-1); } return newList; } /**
/** * Appends all elements of the specified list to the receiver. * @param list the list of which all elements shall be appended. */ public void addAllOf(IntArrayList other) { addAllOfFromTo(other,0,other.size()-1); } /**
/** * Returns a list which is a concatenation of <code>times</code> times the receiver. * @param times the number of times the receiver shall be copied. */ public AbstractIntList times(int times) { AbstractIntList newList = new IntArrayList(times*size()); for (int i=times; --i >= 0; ) { newList.addAllOfFromTo(this,0,size()-1); } return newList; } /**
@Override public Long next() { synchronized (ColtLongHashSet.this) { if (versionSnapshot != version) { throw new ConcurrentModificationException(); } if (index >= mapKeyList.size()) { throw new NoSuchElementException(); } long value = mapKeyList.getQuick(index); index++; canRemove = true; return value; } }
@Override public void remove() { synchronized (ColtIntegerHashSet.this) { if (!canRemove) { throw new IllegalStateException( "repeated remove() calls or next() not called" ); } map.removeKey(mapKeyList.get(index - 1)); canRemove = false; version++; versionSnapshot = version; } } }
/** * Returns a list which is a concatenation of <code>times</code> times the receiver. * @param times the number of times the receiver shall be copied. */ public AbstractByteList times(int times) { AbstractByteList newList = new ByteArrayList(times*size()); for (int i=times; --i >= 0; ) { newList.addAllOfFromTo(this,0,size()-1); } return newList; } /**
/** * Returns a list which is a concatenation of <code>times</code> times the receiver. * @param times the number of times the receiver shall be copied. */ public AbstractFloatList times(int times) { AbstractFloatList newList = new FloatArrayList(times*size()); for (int i=times; --i >= 0; ) { newList.addAllOfFromTo(this,0,size()-1); } return newList; } /**
@Override public void remove() { synchronized (ColtLongHashSet.this) { if (!canRemove) { throw new IllegalStateException( "repeated remove() calls or next() not called" ); } map.removeKey(mapKeyList.get(index - 1)); canRemove = false; version++; versionSnapshot = version; } } }
/** * Sets the size of the receiver without modifying it otherwise. * This method should not release or allocate new memory but simply set some instance variable like <tt>size</tt>. */ protected void setSizeRaw(int newSize) { super.setSizeRaw(newSize); elements.setSizeRaw(newSize); } /**
/** * Returns a list which is a concatenation of <code>times</code> times the receiver. * @param times the number of times the receiver shall be copied. */ public AbstractShortList times(int times) { AbstractShortList newList = new ShortArrayList(times*size()); for (int i=times; --i >= 0; ) { newList.addAllOfFromTo(this,0,size()-1); } return newList; } /**
/** * Returns a list which is a concatenation of <code>times</code> times the receiver. * @param times the number of times the receiver shall be copied. */ public AbstractCharList times(int times) { AbstractCharList newList = new CharArrayList(times*size()); for (int i=times; --i >= 0; ) { newList.addAllOfFromTo(this,0,size()-1); } return newList; } /**
/** * Returns a list which is a concatenation of <code>times</code> times the receiver. * @param times the number of times the receiver shall be copied. */ public AbstractBooleanList times(int times) { AbstractBooleanList newList = new BooleanArrayList(times*size()); for (int i=times; --i >= 0; ) { newList.addAllOfFromTo(this,0,size()-1); } return newList; } /**
/** * Appends all elements of the specified list to the receiver. * @param list the list of which all elements shall be appended. */ public void addAllOf(IntArrayList other) { addAllOfFromTo(other,0,other.size()-1); } /**
@Override public Long next() { synchronized (ColtHashSet.this) { if (versionSnapshot != version) { throw new ConcurrentModificationException(); } if (index >= mapKeyList.size()) { throw new NoSuchElementException(); } long value = mapKeyList.getQuick(index); index++; canRemove = true; return value; } }
@Override public boolean hasNext() { synchronized (ColtLongHashSet.this) { return index < mapKeyList.size(); } }
@Override public void remove() { synchronized (ColtHashSet.this) { if (!canRemove) { throw new IllegalStateException( "repeated remove() calls or next() not called" ); } map.removeKey(mapKeyList.get(index-1)); canRemove = false; version++; versionSnapshot = version; } } }