final F gotit = filter.filter(elementData[bpi]); if (gotit != null) { backingpos[backingsize] = bpi;
/** * */ @Override public T evaluateFirst(Object context) { Object raw = evaluateRawFirst(context); if (raw == null) { return null; } return xfilter.filter(raw); }
@Override public List<T> evaluate(Object context) { return xfilter.filter(evaluateRawAll(context)); }
T t = filter.filter(o); if (t == null) { filtered.add(o);
@Override public boolean hasNext() { canremove = false; if (nextObject != null) { return true; } while (iterator.hasNext()) { final Object obj = iterator.next(); final T f = filter.filter(obj); if (f != null) { nextObject = f; return true; } } return false; }
/** * Set the object at the specified location to the supplied object. * * @param index * The location to set the value to. * @param obj * The location to set the value to. * @return The object which was replaced. throws * IndexOutOfBoundsException if index < 0 || index >= size() */ @Override public F set(final int index, final F obj) { if (index < 0) { throw new IndexOutOfBoundsException("Index: " + index + " Size: " + size()); } final int adj = resync(index); if (adj == size) { throw new IndexOutOfBoundsException("Index: " + index + " Size: " + size()); } final F ins = filter.filter(obj); if (ins != null) { final F oldc = filter.filter(ContentList.this.set(adj, ins)); // optimize the backing.... xdata = getDataModCount(); return oldc; } throw new IllegalAddException("Filter won't allow index " + index + " to be set to " + (obj.getClass()).getName()); }
/** * Return the object at the specified offset. * * @param index * The offset of the object. * @return The Object which was returned. */ @Override public F get(final int index) { if (index < 0) { throw new IndexOutOfBoundsException("Index: " + index + " Size: " + size()); } final int adj = resync(index); if (adj == size) { throw new IndexOutOfBoundsException("Index: " + index + " Size: " + size()); } return filter.filter(ContentList.this.get(adj)); }
/** * Remove the object at the specified offset. * * @param index * The offset of the object. * @return The Object which was removed. */ @Override public F remove(final int index) { if (index < 0) { throw new IndexOutOfBoundsException("Index: " + index + " Size: " + size()); } final int adj = resync(index); if (adj == size) { throw new IndexOutOfBoundsException("Index: " + index + " Size: " + size()); } final Content oldc = ContentList.this.remove(adj); // optimise the backing cache. backingsize = index; xdata = getDataModCount(); // use Filter to ensure the cast is right. return filter.filter(oldc); }