18 #ifndef _DECAF_UTIL_ABSTRACTCOLLECTION_H_
19 #define _DECAF_UTIL_ABSTRACTCOLLECTION_H_
57 template<
typename E >
79 std::auto_ptr< Iterator<E> > iter( collection.
iterator() );
80 while( iter->hasNext() ) {
81 this->
add( iter->next() );
104 std::auto_ptr< Iterator<E> > iter( this->
iterator() );
105 while( iter->hasNext() ) {
120 std::auto_ptr< Iterator<E> > iter( this->
iterator() );
121 while( iter->hasNext() ) {
122 if( iter->next() == value ) {
139 std::auto_ptr< Iterator<E> > iter( collection.
iterator() );
140 while( iter->hasNext() ) {
141 if( !this->
contains( iter->next() ) ) {
160 if(
this == &collection ) {
187 std::auto_ptr< Iterator<E> > iter( collection.
iterator() );
188 while( iter->hasNext() ) {
189 this->
add( iter->next() );
201 return this->
size() == 0;
211 __FILE__, __LINE__,
"AbstractCollection add is not implemented.");
226 std::auto_ptr< Iterator<E> > iter( collection.
iterator() );
227 while( iter->hasNext() ) {
228 result = this->
add( iter->next() ) || result;
245 virtual bool remove(
const E& value ) {
247 std::auto_ptr< Iterator<E> > iter( this->
iterator() );
248 while( iter->hasNext() ) {
249 if( value == iter->next() ) {
272 std::auto_ptr< Iterator<E> > iter( this->
iterator() );
273 while( iter->hasNext() ) {
274 if( collection.
contains( iter->next() ) ) {
297 std::auto_ptr< Iterator<E> > iter( this->
iterator() );
298 while( iter->hasNext() ) {
299 if( !collection.
contains( iter->next() ) ) {
317 std::vector<E> valueArray;
318 valueArray.reserve( this->
size() );
320 std::auto_ptr< Iterator<E> > iter( this->
iterator() );
321 while( iter->hasNext() ) {
322 valueArray.push_back( iter->next() );
346 virtual void wait(
long long millisecs ) {
350 virtual void wait(
long long millisecs,
int nanos ) {