#ifndef __X10_UTIL_ABSTRACTCOLLECTION_H
#define __X10_UTIL_ABSTRACTCOLLECTION_H

#include <x10rt.h>


#define X10_UTIL_ABSTRACTCONTAINER_H_NODEPS
#include <x10/util/AbstractContainer.h>
#undef X10_UTIL_ABSTRACTCONTAINER_H_NODEPS
#define X10_UTIL_COLLECTION_H_NODEPS
#include <x10/util/Collection.h>
#undef X10_UTIL_COLLECTION_H_NODEPS
namespace x10 { namespace lang { 
class Boolean;
} } 
namespace x10 { namespace util { 
template<class TPMGL(T)> class Container;
} } 
namespace x10 { namespace lang { 
template<class TPMGL(Z1), class TPMGL(U)> class Fun_0_1;
} } 
namespace x10 { namespace lang { 
template<class TPMGL(T)> class Iterator;
} } 
namespace x10 { namespace lang { 
template<class TPMGL(T)> class Iterable;
} } 
namespace x10 { namespace util { 

template<class TPMGL(T)> class AbstractCollection;
template <> class AbstractCollection<void>;
template<class TPMGL(T)> class AbstractCollection : public x10::util::AbstractContainer<TPMGL(T)>
  {
    public:
    RTT_H_DECLS_CLASS
    
    virtual x10_boolean add(TPMGL(T) id__125) = 0;
    virtual x10_boolean remove(TPMGL(T) id__126) = 0;
    virtual x10_boolean addAll(x10aux::ref<x10::util::Container<TPMGL(T)> > c);
    virtual x10_boolean retainAll(x10aux::ref<x10::util::Container<TPMGL(T)> > c);
    virtual x10_boolean removeAll(x10aux::ref<x10::util::Container<TPMGL(T)> > c);
    virtual x10_boolean addAllWhere(x10aux::ref<x10::util::Container<TPMGL(T)> > c,
                                    x10aux::ref<x10::lang::Fun_0_1<TPMGL(T), x10_boolean> > p);
    virtual x10_boolean removeAllWhere(x10aux::ref<x10::lang::Fun_0_1<TPMGL(T), x10_boolean> > p);
    virtual void clear();
    virtual x10aux::ref<x10::util::Container<TPMGL(T)> > clone(
      ) = 0;
    virtual x10aux::ref<x10::util::AbstractCollection<TPMGL(T)> >
      x10__util__AbstractCollection____x10__util__AbstractCollection__this(
      );
    void _constructor();
    
    
    // Serialization
    public: virtual void _serialize_body(x10aux::serialization_buffer& buf);
    
    public: void _deserialize_body(x10aux::deserialization_buffer& buf);
    
};
template <> class AbstractCollection<void> : public x10::util::AbstractContainer<void>
{
    public:
    static x10aux::RuntimeType rtt;
    static const x10aux::RuntimeType* getRTT() { return & rtt; }
    
};

} } 
#endif // X10_UTIL_ABSTRACTCOLLECTION_H

namespace x10 { namespace util { 
template<class TPMGL(T)> class AbstractCollection;
} } 

#ifndef X10_UTIL_ABSTRACTCOLLECTION_H_NODEPS
#define X10_UTIL_ABSTRACTCOLLECTION_H_NODEPS
#include <x10/util/AbstractContainer.h>
#include <x10/util/Collection.h>
#include <x10/lang/Boolean.h>
#include <x10/util/Container.h>
#include <x10/lang/Fun_0_1.h>
#include <x10/lang/Iterator.h>
#include <x10/lang/Iterable.h>
#ifndef X10_UTIL_ABSTRACTCOLLECTION_H_GENERICS
#define X10_UTIL_ABSTRACTCOLLECTION_H_GENERICS
#endif // X10_UTIL_ABSTRACTCOLLECTION_H_GENERICS
#ifndef X10_UTIL_ABSTRACTCOLLECTION_H_IMPLEMENTATION
#define X10_UTIL_ABSTRACTCOLLECTION_H_IMPLEMENTATION
#include <x10/util/AbstractCollection.h>

#ifndef X10_UTIL_ABSTRACTCOLLECTION__CLOSURE__1_CLOSURE
#define X10_UTIL_ABSTRACTCOLLECTION__CLOSURE__1_CLOSURE
#include <x10/lang/Closure.h>
#include <x10/lang/Fun_0_1.h>
template<class TPMGL(T)> class x10_util_AbstractCollection__closure__1 : public x10::lang::Closure {
    public:
    
    static typename x10::lang::Fun_0_1<TPMGL(T), x10_boolean>::template itable <x10_util_AbstractCollection__closure__1<TPMGL(T) > > _itable;
    static x10aux::itable_entry _itables[2];
    
    virtual x10aux::itable_entry* _getITables() { return _itables; }
    
    // closure body
    x10_boolean __apply(TPMGL(T) id__127) {
        
        //#line 19 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/AbstractCollection.x10": x10.ast.X10Return_c
        return true;
        
    }
    
    // captured environment
    
    x10aux::serialization_id_t _get_serialization_id() {
        return _serialization_id;
    }
    
    void _serialize_body(x10aux::serialization_buffer &buf) {
        
    }
    
    template<class __T> static x10aux::ref<__T> _deserialize(x10aux::deserialization_buffer &buf) {
        x10_util_AbstractCollection__closure__1<TPMGL(T) >* storage = x10aux::alloc<x10_util_AbstractCollection__closure__1<TPMGL(T) > >();
        buf.record_reference(x10aux::ref<x10_util_AbstractCollection__closure__1<TPMGL(T) > >(storage));
        x10aux::ref<x10_util_AbstractCollection__closure__1<TPMGL(T) > > this_ = new (storage) x10_util_AbstractCollection__closure__1<TPMGL(T) >();
        return this_;
    }
    
    x10_util_AbstractCollection__closure__1() { }
    
    static const x10aux::serialization_id_t _serialization_id;
    
    static const x10aux::RuntimeType* getRTT() { return x10aux::getRTT<x10::lang::Fun_0_1<TPMGL(T), x10_boolean> >(); }
    virtual const x10aux::RuntimeType *_type() const { return x10aux::getRTT<x10::lang::Fun_0_1<TPMGL(T), x10_boolean> >(); }
    
    x10aux::ref<x10::lang::String> toString() {
        return x10aux::string_utils::lit(this->toNativeString());
    }
    
    const char* toNativeString() {
        return "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/AbstractCollection.x10:19";
    }

};

template<class TPMGL(T)> typename x10::lang::Fun_0_1<TPMGL(T), x10_boolean>::template itable <x10_util_AbstractCollection__closure__1<TPMGL(T) > >x10_util_AbstractCollection__closure__1<TPMGL(T) >::_itable(&x10::lang::Reference::equals, &x10::lang::Closure::hashCode, &x10_util_AbstractCollection__closure__1<TPMGL(T) >::__apply, &x10_util_AbstractCollection__closure__1<TPMGL(T) >::toString, &x10::lang::Closure::typeName);
template<class TPMGL(T)> x10aux::itable_entry x10_util_AbstractCollection__closure__1<TPMGL(T) >::_itables[2] = {x10aux::itable_entry(&x10aux::getRTT<x10::lang::Fun_0_1<TPMGL(T), x10_boolean> >, &x10_util_AbstractCollection__closure__1<TPMGL(T) >::_itable),x10aux::itable_entry(NULL, NULL)};

template<class TPMGL(T)> const x10aux::serialization_id_t x10_util_AbstractCollection__closure__1<TPMGL(T) >::_serialization_id = 
    x10aux::DeserializationDispatcher::addDeserializer(x10_util_AbstractCollection__closure__1<TPMGL(T) >::template _deserialize<x10::lang::Reference>,x10aux::CLOSURE_KIND_NOT_ASYNC);

#endif // X10_UTIL_ABSTRACTCOLLECTION__CLOSURE__1_CLOSURE
#ifndef X10_UTIL_ABSTRACTCOLLECTION__CLOSURE__2_CLOSURE
#define X10_UTIL_ABSTRACTCOLLECTION__CLOSURE__2_CLOSURE
#include <x10/lang/Closure.h>
#include <x10/lang/Fun_0_1.h>
template<class TPMGL(T)> class x10_util_AbstractCollection__closure__2 : public x10::lang::Closure {
    public:
    
    static typename x10::lang::Fun_0_1<TPMGL(T), x10_boolean>::template itable <x10_util_AbstractCollection__closure__2<TPMGL(T) > > _itable;
    static x10aux::itable_entry _itables[2];
    
    virtual x10aux::itable_entry* _getITables() { return _itables; }
    
    // closure body
    x10_boolean __apply(TPMGL(T) x) {
        
        //#line 20 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/AbstractCollection.x10": x10.ast.X10Return_c
        return !(x10::util::Container<TPMGL(T)>::contains(x10aux::nullCheck(c), 
                   x));
        
    }
    
    // captured environment
    x10aux::ref<x10::util::Container<TPMGL(T)> > c;
    
    x10aux::serialization_id_t _get_serialization_id() {
        return _serialization_id;
    }
    
    void _serialize_body(x10aux::serialization_buffer &buf) {
        buf.write(this->c);
    }
    
    template<class __T> static x10aux::ref<__T> _deserialize(x10aux::deserialization_buffer &buf) {
        x10_util_AbstractCollection__closure__2<TPMGL(T) >* storage = x10aux::alloc<x10_util_AbstractCollection__closure__2<TPMGL(T) > >();
        buf.record_reference(x10aux::ref<x10_util_AbstractCollection__closure__2<TPMGL(T) > >(storage));
        x10aux::ref<x10::util::Container<TPMGL(T)> > that_c = buf.read<x10aux::ref<x10::util::Container<TPMGL(T)> > >();
        x10aux::ref<x10_util_AbstractCollection__closure__2<TPMGL(T) > > this_ = new (storage) x10_util_AbstractCollection__closure__2<TPMGL(T) >(that_c);
        return this_;
    }
    
    x10_util_AbstractCollection__closure__2(x10aux::ref<x10::util::Container<TPMGL(T)> > c) : c(c) { }
    
    static const x10aux::serialization_id_t _serialization_id;
    
    static const x10aux::RuntimeType* getRTT() { return x10aux::getRTT<x10::lang::Fun_0_1<TPMGL(T), x10_boolean> >(); }
    virtual const x10aux::RuntimeType *_type() const { return x10aux::getRTT<x10::lang::Fun_0_1<TPMGL(T), x10_boolean> >(); }
    
    x10aux::ref<x10::lang::String> toString() {
        return x10aux::string_utils::lit(this->toNativeString());
    }
    
    const char* toNativeString() {
        return "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/AbstractCollection.x10:20";
    }

};

template<class TPMGL(T)> typename x10::lang::Fun_0_1<TPMGL(T), x10_boolean>::template itable <x10_util_AbstractCollection__closure__2<TPMGL(T) > >x10_util_AbstractCollection__closure__2<TPMGL(T) >::_itable(&x10::lang::Reference::equals, &x10::lang::Closure::hashCode, &x10_util_AbstractCollection__closure__2<TPMGL(T) >::__apply, &x10_util_AbstractCollection__closure__2<TPMGL(T) >::toString, &x10::lang::Closure::typeName);
template<class TPMGL(T)> x10aux::itable_entry x10_util_AbstractCollection__closure__2<TPMGL(T) >::_itables[2] = {x10aux::itable_entry(&x10aux::getRTT<x10::lang::Fun_0_1<TPMGL(T), x10_boolean> >, &x10_util_AbstractCollection__closure__2<TPMGL(T) >::_itable),x10aux::itable_entry(NULL, NULL)};

template<class TPMGL(T)> const x10aux::serialization_id_t x10_util_AbstractCollection__closure__2<TPMGL(T) >::_serialization_id = 
    x10aux::DeserializationDispatcher::addDeserializer(x10_util_AbstractCollection__closure__2<TPMGL(T) >::template _deserialize<x10::lang::Reference>,x10aux::CLOSURE_KIND_NOT_ASYNC);

#endif // X10_UTIL_ABSTRACTCOLLECTION__CLOSURE__2_CLOSURE
#ifndef X10_UTIL_ABSTRACTCOLLECTION__CLOSURE__3_CLOSURE
#define X10_UTIL_ABSTRACTCOLLECTION__CLOSURE__3_CLOSURE
#include <x10/lang/Closure.h>
#include <x10/lang/Fun_0_1.h>
template<class TPMGL(T)> class x10_util_AbstractCollection__closure__3 : public x10::lang::Closure {
    public:
    
    static typename x10::lang::Fun_0_1<TPMGL(T), x10_boolean>::template itable <x10_util_AbstractCollection__closure__3<TPMGL(T) > > _itable;
    static x10aux::itable_entry _itables[2];
    
    virtual x10aux::itable_entry* _getITables() { return _itables; }
    
    // closure body
    x10_boolean __apply(TPMGL(T) x) {
        
        //#line 21 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/AbstractCollection.x10": x10.ast.X10Return_c
        return x10::util::Container<TPMGL(T)>::contains(x10aux::nullCheck(c), 
                 x);
        
    }
    
    // captured environment
    x10aux::ref<x10::util::Container<TPMGL(T)> > c;
    
    x10aux::serialization_id_t _get_serialization_id() {
        return _serialization_id;
    }
    
    void _serialize_body(x10aux::serialization_buffer &buf) {
        buf.write(this->c);
    }
    
    template<class __T> static x10aux::ref<__T> _deserialize(x10aux::deserialization_buffer &buf) {
        x10_util_AbstractCollection__closure__3<TPMGL(T) >* storage = x10aux::alloc<x10_util_AbstractCollection__closure__3<TPMGL(T) > >();
        buf.record_reference(x10aux::ref<x10_util_AbstractCollection__closure__3<TPMGL(T) > >(storage));
        x10aux::ref<x10::util::Container<TPMGL(T)> > that_c = buf.read<x10aux::ref<x10::util::Container<TPMGL(T)> > >();
        x10aux::ref<x10_util_AbstractCollection__closure__3<TPMGL(T) > > this_ = new (storage) x10_util_AbstractCollection__closure__3<TPMGL(T) >(that_c);
        return this_;
    }
    
    x10_util_AbstractCollection__closure__3(x10aux::ref<x10::util::Container<TPMGL(T)> > c) : c(c) { }
    
    static const x10aux::serialization_id_t _serialization_id;
    
    static const x10aux::RuntimeType* getRTT() { return x10aux::getRTT<x10::lang::Fun_0_1<TPMGL(T), x10_boolean> >(); }
    virtual const x10aux::RuntimeType *_type() const { return x10aux::getRTT<x10::lang::Fun_0_1<TPMGL(T), x10_boolean> >(); }
    
    x10aux::ref<x10::lang::String> toString() {
        return x10aux::string_utils::lit(this->toNativeString());
    }
    
    const char* toNativeString() {
        return "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/AbstractCollection.x10:21";
    }

};

template<class TPMGL(T)> typename x10::lang::Fun_0_1<TPMGL(T), x10_boolean>::template itable <x10_util_AbstractCollection__closure__3<TPMGL(T) > >x10_util_AbstractCollection__closure__3<TPMGL(T) >::_itable(&x10::lang::Reference::equals, &x10::lang::Closure::hashCode, &x10_util_AbstractCollection__closure__3<TPMGL(T) >::__apply, &x10_util_AbstractCollection__closure__3<TPMGL(T) >::toString, &x10::lang::Closure::typeName);
template<class TPMGL(T)> x10aux::itable_entry x10_util_AbstractCollection__closure__3<TPMGL(T) >::_itables[2] = {x10aux::itable_entry(&x10aux::getRTT<x10::lang::Fun_0_1<TPMGL(T), x10_boolean> >, &x10_util_AbstractCollection__closure__3<TPMGL(T) >::_itable),x10aux::itable_entry(NULL, NULL)};

template<class TPMGL(T)> const x10aux::serialization_id_t x10_util_AbstractCollection__closure__3<TPMGL(T) >::_serialization_id = 
    x10aux::DeserializationDispatcher::addDeserializer(x10_util_AbstractCollection__closure__3<TPMGL(T) >::template _deserialize<x10::lang::Reference>,x10aux::CLOSURE_KIND_NOT_ASYNC);

#endif // X10_UTIL_ABSTRACTCOLLECTION__CLOSURE__3_CLOSURE
#ifndef X10_UTIL_ABSTRACTCOLLECTION__CLOSURE__4_CLOSURE
#define X10_UTIL_ABSTRACTCOLLECTION__CLOSURE__4_CLOSURE
#include <x10/lang/Closure.h>
#include <x10/lang/Fun_0_1.h>
template<class TPMGL(T)> class x10_util_AbstractCollection__closure__4 : public x10::lang::Closure {
    public:
    
    static typename x10::lang::Fun_0_1<TPMGL(T), x10_boolean>::template itable <x10_util_AbstractCollection__closure__4<TPMGL(T) > > _itable;
    static x10aux::itable_entry _itables[2];
    
    virtual x10aux::itable_entry* _getITables() { return _itables; }
    
    // closure body
    x10_boolean __apply(TPMGL(T) id__130) {
        
        //#line 41 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/AbstractCollection.x10": x10.ast.X10Return_c
        return true;
        
    }
    
    // captured environment
    
    x10aux::serialization_id_t _get_serialization_id() {
        return _serialization_id;
    }
    
    void _serialize_body(x10aux::serialization_buffer &buf) {
        
    }
    
    template<class __T> static x10aux::ref<__T> _deserialize(x10aux::deserialization_buffer &buf) {
        x10_util_AbstractCollection__closure__4<TPMGL(T) >* storage = x10aux::alloc<x10_util_AbstractCollection__closure__4<TPMGL(T) > >();
        buf.record_reference(x10aux::ref<x10_util_AbstractCollection__closure__4<TPMGL(T) > >(storage));
        x10aux::ref<x10_util_AbstractCollection__closure__4<TPMGL(T) > > this_ = new (storage) x10_util_AbstractCollection__closure__4<TPMGL(T) >();
        return this_;
    }
    
    x10_util_AbstractCollection__closure__4() { }
    
    static const x10aux::serialization_id_t _serialization_id;
    
    static const x10aux::RuntimeType* getRTT() { return x10aux::getRTT<x10::lang::Fun_0_1<TPMGL(T), x10_boolean> >(); }
    virtual const x10aux::RuntimeType *_type() const { return x10aux::getRTT<x10::lang::Fun_0_1<TPMGL(T), x10_boolean> >(); }
    
    x10aux::ref<x10::lang::String> toString() {
        return x10aux::string_utils::lit(this->toNativeString());
    }
    
    const char* toNativeString() {
        return "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/AbstractCollection.x10:41";
    }

};

template<class TPMGL(T)> typename x10::lang::Fun_0_1<TPMGL(T), x10_boolean>::template itable <x10_util_AbstractCollection__closure__4<TPMGL(T) > >x10_util_AbstractCollection__closure__4<TPMGL(T) >::_itable(&x10::lang::Reference::equals, &x10::lang::Closure::hashCode, &x10_util_AbstractCollection__closure__4<TPMGL(T) >::__apply, &x10_util_AbstractCollection__closure__4<TPMGL(T) >::toString, &x10::lang::Closure::typeName);
template<class TPMGL(T)> x10aux::itable_entry x10_util_AbstractCollection__closure__4<TPMGL(T) >::_itables[2] = {x10aux::itable_entry(&x10aux::getRTT<x10::lang::Fun_0_1<TPMGL(T), x10_boolean> >, &x10_util_AbstractCollection__closure__4<TPMGL(T) >::_itable),x10aux::itable_entry(NULL, NULL)};

template<class TPMGL(T)> const x10aux::serialization_id_t x10_util_AbstractCollection__closure__4<TPMGL(T) >::_serialization_id = 
    x10aux::DeserializationDispatcher::addDeserializer(x10_util_AbstractCollection__closure__4<TPMGL(T) >::template _deserialize<x10::lang::Reference>,x10aux::CLOSURE_KIND_NOT_ASYNC);

#endif // X10_UTIL_ABSTRACTCOLLECTION__CLOSURE__4_CLOSURE

//#line 16 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/AbstractCollection.x10": x10.ast.X10MethodDecl_c

//#line 17 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/AbstractCollection.x10": x10.ast.X10MethodDecl_c

//#line 19 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/AbstractCollection.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(T)> x10_boolean x10::util::AbstractCollection<TPMGL(T)>::addAll(
  x10aux::ref<x10::util::Container<TPMGL(T)> > c) {
    
    //#line 19 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/AbstractCollection.x10": x10.ast.X10Return_c
    return ((x10aux::ref<x10::util::AbstractCollection<TPMGL(T)> >)this)->addAllWhere(
             c, x10aux::ref<x10::lang::Fun_0_1<TPMGL(T), x10_boolean> >(x10aux::ref<x10_util_AbstractCollection__closure__1<TPMGL(T) > >(new (x10aux::alloc<x10::lang::Fun_0_1<TPMGL(T), x10_boolean> >(sizeof(x10_util_AbstractCollection__closure__1<TPMGL(T)>)))x10_util_AbstractCollection__closure__1<TPMGL(T)>())));
    
}

//#line 20 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/AbstractCollection.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(T)> x10_boolean x10::util::AbstractCollection<TPMGL(T)>::retainAll(
  x10aux::ref<x10::util::Container<TPMGL(T)> > c) {
    
    //#line 20 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/AbstractCollection.x10": x10.ast.X10Return_c
    return ((x10aux::ref<x10::util::AbstractCollection<TPMGL(T)> >)this)->removeAllWhere(
             x10aux::ref<x10::lang::Fun_0_1<TPMGL(T), x10_boolean> >(x10aux::ref<x10_util_AbstractCollection__closure__2<TPMGL(T) > >(new (x10aux::alloc<x10::lang::Fun_0_1<TPMGL(T), x10_boolean> >(sizeof(x10_util_AbstractCollection__closure__2<TPMGL(T)>)))x10_util_AbstractCollection__closure__2<TPMGL(T)>(c))));
    
}

//#line 21 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/AbstractCollection.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(T)> x10_boolean x10::util::AbstractCollection<TPMGL(T)>::removeAll(
  x10aux::ref<x10::util::Container<TPMGL(T)> > c) {
    
    //#line 21 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/AbstractCollection.x10": x10.ast.X10Return_c
    return ((x10aux::ref<x10::util::AbstractCollection<TPMGL(T)> >)this)->removeAllWhere(
             x10aux::ref<x10::lang::Fun_0_1<TPMGL(T), x10_boolean> >(x10aux::ref<x10_util_AbstractCollection__closure__3<TPMGL(T) > >(new (x10aux::alloc<x10::lang::Fun_0_1<TPMGL(T), x10_boolean> >(sizeof(x10_util_AbstractCollection__closure__3<TPMGL(T)>)))x10_util_AbstractCollection__closure__3<TPMGL(T)>(c))));
    
}

//#line 23 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/AbstractCollection.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(T)> x10_boolean x10::util::AbstractCollection<TPMGL(T)>::addAllWhere(
  x10aux::ref<x10::util::Container<TPMGL(T)> > c, x10aux::ref<x10::lang::Fun_0_1<TPMGL(T), x10_boolean> > p) {
    
    //#line 24 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/AbstractCollection.x10": x10.ast.X10LocalDecl_c
    x10_boolean result = false;
    
    //#line 25 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/AbstractCollection.x10": polyglot.ast.For_c
    {
        x10aux::ref<x10::lang::Iterator<TPMGL(T)> > x46183;
        for (
             //#line 25 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/AbstractCollection.x10": x10.ast.X10LocalDecl_c
             x46183 = x10::util::Container<TPMGL(T)>::iterator(x10aux::nullCheck(c));
             x10::lang::Iterator<TPMGL(T)>::hasNext(x10aux::nullCheck(x46183));
             ) {
            
            //#line 25 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/AbstractCollection.x10": x10.ast.X10LocalDecl_c
            TPMGL(T) x = x10::lang::Iterator<TPMGL(T)>::next(x10aux::nullCheck(x46183));
            
            //#line 26 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/AbstractCollection.x10": x10.ast.X10If_c
            if (x10::lang::Fun_0_1<TPMGL(T), x10_boolean>::__apply(x10aux::nullCheck(p), 
                  x)) {
                
                //#line 27 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/AbstractCollection.x10": Eval of x10.ast.X10LocalAssign_c
                result = ((x10_boolean) (((result) ? 1 : 0) | ((((x10aux::ref<x10::util::AbstractCollection<TPMGL(T)> >)this)->add(
                                                                  x)) ? 1 : 0)));
            }
            
        }
    }
    
    //#line 29 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/AbstractCollection.x10": x10.ast.X10Return_c
    return result;
    
}

//#line 32 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/AbstractCollection.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(T)> x10_boolean x10::util::AbstractCollection<TPMGL(T)>::removeAllWhere(
  x10aux::ref<x10::lang::Fun_0_1<TPMGL(T), x10_boolean> > p) {
    
    //#line 33 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/AbstractCollection.x10": x10.ast.X10LocalDecl_c
    x10_boolean result = false;
    
    //#line 34 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/AbstractCollection.x10": polyglot.ast.For_c
    {
        x10aux::ref<x10::lang::Iterator<TPMGL(T)> > x46185;
        for (
             //#line 34 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/AbstractCollection.x10": x10.ast.X10LocalDecl_c
             x46185 = x10::util::Collection<TPMGL(T)>::iterator(x10aux::nullCheck(x10aux::class_cast_unchecked<x10aux::ref<x10::util::Collection<TPMGL(T)> > >(((x10aux::ref<x10::util::AbstractCollection<TPMGL(T)> >)this)->clone())));
             x10::lang::Iterator<TPMGL(T)>::hasNext(x10aux::nullCheck(x46185));
             ) {
            
            //#line 34 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/AbstractCollection.x10": x10.ast.X10LocalDecl_c
            TPMGL(T) x = x10::lang::Iterator<TPMGL(T)>::next(x10aux::nullCheck(x46185));
            
            //#line 35 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/AbstractCollection.x10": x10.ast.X10If_c
            if (x10::lang::Fun_0_1<TPMGL(T), x10_boolean>::__apply(x10aux::nullCheck(p), 
                  x)) {
                
                //#line 36 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/AbstractCollection.x10": Eval of x10.ast.X10LocalAssign_c
                result = ((x10_boolean) (((result) ? 1 : 0) | ((((x10aux::ref<x10::util::AbstractCollection<TPMGL(T)> >)this)->remove(
                                                                  x)) ? 1 : 0)));
            }
            
        }
    }
    
    //#line 38 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/AbstractCollection.x10": x10.ast.X10Return_c
    return result;
    
}

//#line 41 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/AbstractCollection.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(T)> void x10::util::AbstractCollection<TPMGL(T)>::clear(
  ) {
    
    //#line 41 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/AbstractCollection.x10": Eval of x10.ast.X10Call_c
    ((x10aux::ref<x10::util::AbstractCollection<TPMGL(T)> >)this)->removeAllWhere(
      x10aux::ref<x10::lang::Fun_0_1<TPMGL(T), x10_boolean> >(x10aux::ref<x10_util_AbstractCollection__closure__4<TPMGL(T) > >(new (x10aux::alloc<x10::lang::Fun_0_1<TPMGL(T), x10_boolean> >(sizeof(x10_util_AbstractCollection__closure__4<TPMGL(T)>)))x10_util_AbstractCollection__closure__4<TPMGL(T)>())));
}

//#line 43 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/AbstractCollection.x10": x10.ast.X10MethodDecl_c

//#line 15 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/AbstractCollection.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(T)> x10aux::ref<x10::util::AbstractCollection<TPMGL(T)> >
  x10::util::AbstractCollection<TPMGL(T)>::x10__util__AbstractCollection____x10__util__AbstractCollection__this(
  ) {
    
    //#line 15 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/AbstractCollection.x10": x10.ast.X10Return_c
    return ((x10aux::ref<x10::util::AbstractCollection<TPMGL(T)> >)this);
    
}

//#line 15 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/AbstractCollection.x10": x10.ast.X10ConstructorDecl_c
template<class TPMGL(T)> void x10::util::AbstractCollection<TPMGL(T)>::_constructor(
                           ) {
    
    //#line 15 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/AbstractCollection.x10": x10.ast.X10ConstructorCall_c
    (this)->::x10::util::AbstractContainer<TPMGL(T)>::_constructor();
    
    //#line 15 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/AbstractCollection.x10": x10.ast.AssignPropertyCall_c
    
}

template<class TPMGL(T)> void x10::util::AbstractCollection<TPMGL(T)>::_serialize_body(x10aux::serialization_buffer& buf) {
    x10::util::AbstractContainer<TPMGL(T)>::_serialize_body(buf);
    
}

template<class TPMGL(T)> void x10::util::AbstractCollection<TPMGL(T)>::_deserialize_body(x10aux::deserialization_buffer& buf) {
    x10::util::AbstractContainer<TPMGL(T)>::_deserialize_body(buf);
    
}

template<class TPMGL(T)> x10aux::RuntimeType x10::util::AbstractCollection<TPMGL(T)>::rtt;
template<class TPMGL(T)> void x10::util::AbstractCollection<TPMGL(T)>::_initRTT() {
    const x10aux::RuntimeType *canonical = x10aux::getRTT<x10::util::AbstractCollection<void> >();
    if (rtt.initStageOne(canonical)) return;
    const x10aux::RuntimeType* parents[2] = { x10aux::getRTT<x10::util::AbstractContainer<TPMGL(T)> >(), x10aux::getRTT<x10::util::Collection<TPMGL(T)> >()};
    const x10aux::RuntimeType* params[1] = { x10aux::getRTT<TPMGL(T)>()};
    x10aux::RuntimeType::Variance variances[1] = { x10aux::RuntimeType::invariant};
    const char *baseName = "x10.util.AbstractCollection";
    rtt.initStageTwo(baseName, x10aux::RuntimeType::class_kind, 2, parents, 1, params, variances);
}
#endif // X10_UTIL_ABSTRACTCOLLECTION_H_IMPLEMENTATION
#endif // __X10_UTIL_ABSTRACTCOLLECTION_H_NODEPS
