Lines Matching refs:elements
15 * Returns elements of the collection. Keeps returning the last element forever.
16 * Might be useful on occasion when you have a collection of elements to return.
35 private final LinkedList<Object> elements;
37 public ReturnsElementsOf(Collection<?> elements) {
38 if (elements == null) {
42 this.elements = new LinkedList<Object>(elements);
46 if (elements.size() == 1)
47 return elements.get(0);
49 return elements.poll();