ArrayList.h

Go to the documentation of this file.
00001 #ifndef JAVA_UTIL_ARRAYLIST_H
00002 #define JAVA_UTIL_ARRAYLIST_H 1
00003 
00004 #ifndef JAVA_UTIL_ABSTRACTLIST_H
00005 #include <java_util/AbstractList.h>
00006 #endif /* JAVA_UTIL_ABSTRACTLIST_H */
00007 #ifndef JAVA_UTIL_RANDOMACCESS_H
00008 #include <java_util/RandomAccess.h>
00009 #endif /* JAVA_UTIL_RANDOMACCESS_H */
00010 
00011 namespace java {
00012   namespace util {
00013 
00081     class JAVA_UTIL_SPEC ArrayList : public AbstractList, virtual public RandomAccess {
00082 
00083     public:
00084 
00092       ArrayList(jint initialCapacity = 10);
00093 
00103       ArrayList(const Collection& c);
00104 
00111       ArrayList(const Array<ObjectRef>& c);
00112       ArrayList(const ArrayList& src);
00113       virtual ~ArrayList();
00114 
00120       virtual void trimToSize();
00121 
00129       virtual void ensureCapacity(jint minCapacity);
00130 
00136       virtual jint size() const;
00137 
00144       virtual jboolean isEmpty() const;
00145 
00153       virtual jboolean contains(const ObjectRef& o) const;
00154 
00164       virtual jint indexOf(const ObjectRef& o) const;
00165     
00174       virtual jint lastIndexOf(const ObjectRef& o) const;
00175 
00183       virtual Array<ObjectRef> toArray() const;
00184 
00193       virtual ObjectRef get(jint index) const;
00194 
00205       virtual ObjectRef set(jint index, const ObjectRef& element);
00206 
00213       virtual jboolean add(const ObjectRef& o);
00214 
00225       virtual void add(jint index, const ObjectRef& element);
00226 
00243       virtual jboolean remove(const ObjectRef& o);
00244 
00255       virtual ObjectRef remove(jint index);
00256 
00265       virtual void swap(jint index1, jint index2);
00266 
00271       virtual void clear();
00272 
00288       virtual jboolean addAll(const Collection& c);
00289     
00320       virtual jboolean addAll(jint index, const Collection& c);
00321 
00339       virtual jboolean equals(const Object& o) const;
00340 
00355       virtual jint hashCode() const;
00356 
00374       virtual String toString() const;
00375 
00376     protected:
00377 
00401       virtual void removeRange(jint fromIndex, jint toIndex);
00402 
00403     private:
00404 
00405       ObjectRef impl;
00406       REGISTER_MEMBERS;
00407 
00408     };
00409 
00410   } // namespace util
00411 } // namespace java
00412 
00413 #endif /* JAVA_UTIL_ARRAYLIST_H */

Generated on Fri May 16 11:54:42 2008 for CrossPlatformJavaLikeC++API by  doxygen 1.5.3