#ifndef __X10_UTIL_ABSTRACTCONTAINER_H
#define __X10_UTIL_ABSTRACTCONTAINER_H

#include <x10rt.h>


#define X10_LANG_OBJECT_H_NODEPS
#include <x10/lang/Object.h>
#undef X10_LANG_OBJECT_H_NODEPS
#define X10_UTIL_CONTAINER_H_NODEPS
#include <x10/util/Container.h>
#undef X10_UTIL_CONTAINER_H_NODEPS
namespace x10 { namespace lang { 
class Int;
} } 
namespace x10 { namespace lang { 
class Boolean;
} } 
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 AbstractContainer;
template <> class AbstractContainer<void>;
template<class TPMGL(T)> class AbstractContainer : public x10::lang::Object
  {
    public:
    RTT_H_DECLS_CLASS
    
    virtual x10_int size() = 0;
    virtual x10_boolean isEmpty();
    virtual x10_boolean contains(TPMGL(T) y) = 0;
    virtual x10aux::ref<x10::util::Container<TPMGL(T)> > clone() = 0;
    virtual x10aux::ref<x10::lang::Iterator<TPMGL(T)> > iterator() = 0;
    virtual x10_boolean containsAll(x10aux::ref<x10::util::Container<TPMGL(T)> > c);
    virtual x10aux::ref<x10::util::AbstractContainer<TPMGL(T)> > x10__util__AbstractContainer____x10__util__AbstractContainer__this(
      );
    void _constructor();
    
    
    // Serialization
    public: virtual void _serialize_body(x10aux::serialization_buffer& buf);
    
    public: void _deserialize_body(x10aux::deserialization_buffer& buf);
    
};
template <> class AbstractContainer<void> : public x10::lang::Object
{
    public:
    static x10aux::RuntimeType rtt;
    static const x10aux::RuntimeType* getRTT() { return & rtt; }
    
};

} } 
#endif // X10_UTIL_ABSTRACTCONTAINER_H

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

#ifndef X10_UTIL_ABSTRACTCONTAINER_H_NODEPS
#define X10_UTIL_ABSTRACTCONTAINER_H_NODEPS
#include <x10/lang/Object.h>
#include <x10/util/Container.h>
#include <x10/lang/Int.h>
#include <x10/lang/Boolean.h>
#include <x10/lang/Iterator.h>
#include <x10/lang/Iterable.h>
#ifndef X10_UTIL_ABSTRACTCONTAINER_H_GENERICS
#define X10_UTIL_ABSTRACTCONTAINER_H_GENERICS
#endif // X10_UTIL_ABSTRACTCONTAINER_H_GENERICS
#ifndef X10_UTIL_ABSTRACTCONTAINER_H_IMPLEMENTATION
#define X10_UTIL_ABSTRACTCONTAINER_H_IMPLEMENTATION
#include <x10/util/AbstractContainer.h>


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

//#line 18 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/AbstractContainer.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(T)> x10_boolean x10::util::AbstractContainer<TPMGL(T)>::isEmpty(
  ) {
    
    //#line 18 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/AbstractContainer.x10": x10.ast.X10Return_c
    return (x10aux::struct_equals(((x10aux::ref<x10::util::AbstractContainer<TPMGL(T)> >)this)->size(),
                                  ((x10_int)0)));
    
}

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

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

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

//#line 24 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/AbstractContainer.x10": x10.ast.X10MethodDecl_c
template<class TPMGL(T)> x10_boolean x10::util::AbstractContainer<TPMGL(T)>::containsAll(
  x10aux::ref<x10::util::Container<TPMGL(T)> > c) {
    
    //#line 25 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/AbstractContainer.x10": polyglot.ast.For_c
    {
        x10aux::ref<x10::lang::Iterator<TPMGL(T)> > x46187;
        for (
             //#line 25 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/AbstractContainer.x10": x10.ast.X10LocalDecl_c
             x46187 = x10::util::Container<TPMGL(T)>::iterator(x10aux::nullCheck(c));
             x10::lang::Iterator<TPMGL(T)>::hasNext(x10aux::nullCheck(x46187));
             ) {
            
            //#line 25 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/AbstractContainer.x10": x10.ast.X10LocalDecl_c
            TPMGL(T) x = x10::lang::Iterator<TPMGL(T)>::next(x10aux::nullCheck(x46187));
            
            //#line 26 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/AbstractContainer.x10": x10.ast.X10If_c
            if (!(((x10aux::ref<x10::util::AbstractContainer<TPMGL(T)> >)this)->contains(
                    x))) {
                
                //#line 27 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/AbstractContainer.x10": x10.ast.X10Return_c
                return false;
                
            }
            
        }
    }
    
    //#line 29 "/wrkdirs/usr/ports/lang/x10/work/x10.runtime/src-x10/x10/util/AbstractContainer.x10": x10.ast.X10Return_c
    return true;
    
}

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

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

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

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

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