18#ifndef _DECAF_UTIL_ABSTRACTSET_H_
19#define _DECAF_UTIL_ABSTRACTSET_H_
72 if (this->
size() <= collection.
size()) {
74 std::auto_ptr<Iterator<E> > iter(this->
iterator());
75 while (iter->hasNext()) {
76 if (collection.
contains(iter->next())) {
84 std::auto_ptr<Iterator<E> > iter(collection.
iterator());
85 while (iter->hasNext()) {
86 result = this->
remove(iter->next()) || result;
virtual decaf::util::Iterator< E > * iterator()=0
This class provides a skeletal implementation of the Collection interface, to minimize the effort req...
Definition AbstractCollection.h:58
AbstractCollection()
Definition AbstractCollection.h:65
virtual bool remove(const E &value)
Removes a single instance of the specified element from the collection.More formally,...
Definition AbstractCollection.h:259
AbstractSet()
Definition AbstractSet.h:50
virtual ~AbstractSet()
Definition AbstractSet.h:52
virtual bool removeAll(const Collection< E > &collection)
Removes all this collection's elements that are also contained in the specified collection (optional ...
Definition AbstractSet.h:69
The root interface in the collection hierarchy.
Definition Collection.h:69
virtual bool contains(const E &value) const =0
Returns true if this collection contains the specified element.
virtual int size() const =0
Returns the number of elements in this collection.
A collection that contains no duplicate elements.
Definition Set.h:45
Definition AbstractCollection.h:33
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
Definition AprPool.h:25