AbstractMap.h

Go to the documentation of this file.
00001 #ifndef JAVA_UTIL_ABSTRACTMAP_H
00002 #define JAVA_UTIL_ABSTRACTMAP_H 1
00003 
00004 #ifndef JAVA_UTIL_MAP_H
00005 #include <java_util/Map.h>
00006 #endif /* JAVA_UTIL_MAP_H */
00007 #ifndef JAVA_UTIL_SET_H
00008 #include <java_util/Set.h>
00009 #endif /* JAVA_UTIL_SET_H */
00010 #ifndef JAVA_UTIL_IMMUTABLE_H
00011 #include <java_util/Immutable.h>
00012 #endif /* JAVA_UTIL_IMMUTABLE_H */
00013 
00014 namespace java {
00015   namespace util {
00016 
00048     class JAVA_UTIL_SPEC AbstractMap : virtual public Map {
00049 
00050     public:
00051 
00059       virtual jint size() const;
00060 
00068       virtual jboolean isEmpty() const;
00069 
00086       virtual jboolean containsKey(const ObjectRef& key) const;
00087 
00104       virtual jboolean containsValue(const ObjectRef& value) const;
00105 
00130       virtual ObjectRef get(const ObjectRef& key) const;
00131 
00158       virtual ObjectRef put(const ObjectRef& key, const ObjectRef& value);
00159 
00185       virtual ObjectRef remove(const ObjectRef& key);
00186 
00209       virtual void putAll(const Map& t);
00210 
00217       virtual void clear();
00218 
00231       virtual Ref<Set> keySet() const;
00232 
00246       virtual Ref<Collection> values() const;
00247 
00260       virtual jboolean equals(const Object& o) const;
00261 
00272       virtual jint hashCode() const;
00273 
00274       virtual String toString() const;
00275 
00276       class JAVA_UTIL_SPEC SimpleEntry : public Map::Entry {
00277 
00278       public:
00279 
00280         SimpleEntry() {}
00281         SimpleEntry(const Entry& e) : key(e.getKey()), value(e.getValue()) {}
00282         SimpleEntry(const ObjectRef& _k, const ObjectRef& _v) : key(_k), value(_v) {}
00283 
00289         inline virtual ObjectRef getKey() const { return key;}
00290 
00298         inline virtual ObjectRef getValue() const { return value;}
00299 
00319         virtual ObjectRef setValue(const ObjectRef& _v) { return value.set(_v);}
00320 
00339         virtual jboolean equals(const Object& o) const;
00340         virtual jboolean equals(const Entry& e) const;
00341 
00358         virtual jint hashCode() const;
00359 
00360         virtual String toString() const;
00361 
00362       protected:
00363         
00364         ObjectRef key, value;
00365 
00366       private:
00367       
00368         REGISTER_MEMBERS;
00369 
00370       };
00371 
00372       class JAVA_UTIL_SPEC ImmutableEntry : public SimpleEntry, virtual public Immutable {
00373 
00374       public:
00375         
00376         ImmutableEntry();
00377 
00378         ImmutableEntry(const ObjectRef& key, const ObjectRef& value);
00379 
00399         virtual ObjectRef setValue(const ObjectRef& value);
00400 
00419         virtual jboolean equals(const Object& o) const;
00420 
00437         virtual jint hashCode() const;
00438 
00439         virtual String toString() const;
00440 
00441       private:
00442       
00443         REGISTER_MEMBERS;
00444 
00445       };
00446 
00447     protected:
00448     
00453       AbstractMap();
00454 
00455     private:
00456 
00457       REGISTER_MEMBERS;
00458 
00459     };
00460 
00461   } // namespace util
00462 } // namespace java
00463 
00464 #endif /* JAVA_UTIL_ABSTRACTMAP_H */

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