@Override public void finished() { checkState(sizeT1 == data.values().stream().filter(node -> node.type == QueueType.T1).count()); checkState(sizeT2 == data.values().stream().filter(node -> node.type == QueueType.T2).count()); checkState(sizeB1 == data.values().stream().filter(node -> node.type == QueueType.B1).count()); checkState(sizeB2 == data.values().stream().filter(node -> node.type == QueueType.B2).count()); checkState((sizeT1 + sizeT2) <= maximumSize); checkState((sizeB1 + sizeB2) <= maximumSize); }
@Override public Iterator<Result> iterator() { return delegate.values().iterator(); }
@Override public int size() { return collection.size(); } @Override
@Override public Object[] toArray() { synchronized (sync) { return collection.toArray(); } } @Override
@Override public ObjectIterator<K> iterator() { return collection.iterator(); } @Override
@Override public int size() { synchronized (sync) { return collection.size(); } } @Override
@Override public <T> T[] toArray(final T[] a) { synchronized (sync) { return collection.toArray(a); } } @Override
@Override public void finished() { for (int i = 0; i < levels; i++) { int level = i; long count = data.values().stream().filter(node -> node.level == level).count(); checkState(count == sizeQ[i]); } }
/** * Creates a new array list and fills it with a given type-specific collection. * * @param c * a type-specific collection that will be used to fill the array * list. */ public ObjectArrayList(final ObjectCollection<? extends K> c) { this(c.size()); size = ObjectIterators.unwrap(c.iterator(), a); } /**
@Override public ObjectIterator<K> iterator() { return ObjectIterators.unmodifiable(collection.iterator()); } @Override
/** * Creates a new array set copying the contents of a given collection. * * @param c * a collection. */ public ObjectArraySet(ObjectCollection<K> c) { this(c.size()); addAll(c); } /**
@Override public Object[] toArray() { return collection.toArray(); } @Override
@Override public void finished() { long filterSize = data.values().stream().filter(node -> node.status == Status.FILTER).count(); long mainSize = data.values().stream().filter(node -> node.status == Status.MAIN).count(); checkState((filterSize + mainSize) <= maximumSize); checkState(residentFilter == filterSize); checkState(residentMain == mainSize); }
/** Creates a new array list and fills it with a given type-specific collection. * * @param c a type-specific collection that will be used to fill the array list. */ public IdentityArrayList ( final ObjectCollection <? extends K> c ) { this( c.size() ); size = ObjectIterators.unwrap( c.iterator(), a ); } /** Creates a new array list and fills it with a given type-specific list.
@Override public Iterator<Result> iterator() { return delegate.values().iterator(); }
/** * Creates a new hash set copying a given type-specific collection. * * @param c * a type-specific collection to be copied into the new hash set. * @param f * the load factor. */ public ObjectOpenHashSet(final ObjectCollection<? extends K> c, final float f) { this(c.size(), f); addAll(c); } /**
@Override public <T> T[] toArray(final T[] a) { return collection.toArray(a); } @Override
@Override public void finished() { long filterSize = data.values().stream() .filter(node -> node.status == Status.FILTER) .count(); long mainSize = data.values().stream() .filter(node -> node.status == Status.MAIN) .count(); checkState(filterSize <= maximumFilterSize); checkState(mainSize <= maximumMainResidentSize); checkState((filterSize + mainSize) <= maximumSize); checkState((filterSize + mainSize) == residentSize); }
/** * Creates a new big-array big list and fills it with a given type-specific * collection. * * @param c * a type-specific collection that will be used to fill the array * list. */ public ObjectBigArrayBigList(final ObjectCollection<? extends K> c) { this(c.size()); for (ObjectIterator<? extends K> i = c.iterator(); i.hasNext();) add(i.next()); } /**