@Override public boolean addAll(Collection<? extends T> ts) { boolean changed = false; for (T t : ts) { changed |= add(t); } return changed; }
public T peekNext() { if (value == null) { internalNext(); } return value; }
@Override public boolean removeAll(Collection<?> c) { boolean changed = false; for (Object o : c) { changed |= remove(o); } return changed; }
@Test(groups = "fast") public void testSuperType() throws Exception { Key<String, Object> objectKey = Key.get("x", Object.class); Key<String, Number> numberKey = Key.get("x", Number.class); Key<String, Float> floatKey = Key.get("x", Float.class); asssertSuperTestResults(objectKey, numberKey, floatKey); }
public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof ByteArray)) { return false; } final ByteArray that = (ByteArray) o; return ByteArray.equals(this, that); }
@Override public synchronized Long remove(int i) throws ArrayIndexOutOfBoundsException { if (isEmpty(i)) { return null; } else { Long previousValue = data[i]; data[i] = EMPTY; size--; return convertValue(previousValue); } }
public static byte[] packComparable(List<byte[]> arrays) { return packComparable( arrays, DEFAULT_DELIMITER, DEFAULT_TERMINAL_DELIMITER ); }
public static <T1 extends Comparable<? super T1>, T2 extends Comparable<? super T2>> Pair<T1, T2> of(T1 first, T2 second) { return new ComparablePair<>(first, second); }
@Override public int compareTo(ByteArray o) { return BYTE_ARRAY_COMPARATOR.compare(this, o); }
@Override public Iterator<Map.Entry<K, S>> iterator() { return new WrappedIterator<Map.Entry<K, S>>(delegate.iterator()) { @Override public void remove() { super.remove(); dirty.set(true); } }; } }
/** * @return */ @Override public Iterator<Long> iterator() { return new Iter(); }
public SampledSetImpl( int maxSetSize, DigestFunction<T> digestFunction, SetFactory<T, SnapshotableSet<T>> setFactory ) { this(maxSetSize, digestFunction, setFactory.create(), setFactory, 1); }
@Override public void clear() { delegate.clear(); }
@Override public S get(K key) { return delegate.get(key); }
public ConcurrentSetMap() { super(new ConcurrentSetFactory<V>()); } }
@Override public int resize(int sizeHint) { return internalResize(sizeHint); }
public static <K, V> Key<K, V> get(K id, TypeToken<V> clazz) { return new Key<>(id, clazz); }
public static ByteArray wrap(byte[] array, int offset) { return new ByteArrayView(array, offset); }
public Void call() throws InterruptedException { for (final int value : values) { iterator.add(value); } return null; } };
@Override public int compareTo(ByteArray o) { return BYTE_ARRAY_COMPARATOR.compare(this, o); }