00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00026 
00027 #if !defined(_SORTEDCOLLECTIONS_H_)
00028 #define _SORTEDCOLLECTIONS_H_
00029 
00030 #if _MSC_VER > 1000
00031 #pragma once
00032 #endif // _MSC_VER > 1000
00033 
00034 #include "Collections.h"
00035 
00036 namespace cmlabs {
00037 
00038 class SortedCollection;
00039 class SortedCollection : public Collection
00040 {
00041 public:
00042         SortedCollection();
00043         SortedCollection(const JString& xml);
00044         SortedCollection(XMLNode *node);
00045         virtual ~SortedCollection();
00046 
00047         bool unitTest();
00048 
00049         int addAndReturnPosition(const JString& value);
00050         int removeAllBetween(const JString& str1, const JString& str2);
00051 
00052         SortedCollection getAllBetween(const JString& str1, const JString& str2);
00053         JString getFirstAfter(const JString& str);
00054         JString getLastBefore(const JString& str);
00055 
00056         bool replace(int pos, const JString& value) { return false; }
00057         bool addFirst(const JString& value) { return false; }
00058         bool addLast(const JString& value) { return false; }
00059         bool addAfter(int pos, const JString& value) { return false; }
00060         bool addBefore(int pos, const JString& value) { return false; }
00061 };
00062 
00063 
00064 class SortedObjectCollection;
00065 class SortedObjectCollection : public ObjectCollection
00066 {
00067 public:
00068         SortedObjectCollection();
00069         SortedObjectCollection(const JString& xml);
00070         SortedObjectCollection(XMLNode *node);
00071         virtual ~SortedObjectCollection();
00072 
00073         bool unitTest();
00074 
00075         int addAndReturnPosition(Object* value);
00076         int removeAllBetween(const Object* obj1, const Object* obj2);
00077 
00078         SortedObjectCollection getAllBetween(const Object* obj1, const Object* obj2);
00079         JString getFirstAfter(const Object* obj);
00080         JString getLastBefore(const Object* obj);
00081 
00082         bool replace(int pos, const Object* value) { return false; }
00083         bool addFirst(const Object* value) { return false; }
00084         bool addLast(const Object* value) { return false; }
00085         bool addAfter(int pos, const Object* value) { return false; }
00086         bool addBefore(int pos, const Object* value) { return false; }
00087 };
00088 
00089 class SortedDictionary : public Dictionary
00090 {
00091 public:
00092         SortedDictionary();
00093         SortedDictionary(const JString& xml);
00094         SortedDictionary(XMLNode *node);
00095         virtual ~SortedDictionary();
00096 
00097         bool unitTest();
00098 
00099         int putAndReturnPosition(const JString& key, const JString& value);
00100         int removeAllBetween(const JString& key1, const JString& key2);
00101 
00102         Dictionary getAllBetween(const JString& key1, const JString& key2);
00103         JString getFirstAfter(const JString& key);
00104         JString getLastBefore(const JString& key);
00105 
00106         bool replace(int pos, const JString& key, const JString& value) { return false; }
00107         bool putFirst(const JString& key, const JString& value) { return false; }
00108         bool putLast(const JString& key, const JString& value) { return false; }
00109         bool putAfter(int pos, const JString& key, const JString& value) { return false; }
00110         bool putBefore(int pos, const JString& key, const JString& value) { return false; }
00111 };
00112 
00113 class SortedObjectDictionary : public ObjectDictionary
00114 {
00115 public:
00116         SortedObjectDictionary();
00117         SortedObjectDictionary(const JString& xml);
00118         SortedObjectDictionary(XMLNode *node);
00119         virtual ~SortedObjectDictionary();
00120 
00121         bool unitTest();
00122 
00123         int putAndReturnPosition(const JString& key, Object* value);
00124         int removeAllBetween(const JString& key1, const JString& key2);
00125 
00126         ObjectDictionary getAllBetween(const JString& key1, const JString& key2);
00127         JString getFirstAfter(const JString& key);
00128         JString getLastBefore(const JString& key);
00129 
00130         bool replace(int pos, const JString& key, const Object* value) { return false; }
00131         bool putFirst(const JString& key, const Object* value) { return false; }
00132         bool putLast(const JString& key, const Object* value) { return false; }
00133         bool putAfter(int pos, const JString& key, const Object* value) { return false; }
00134         bool putBefore(int pos, const JString& key, const Object* value) { return false; }
00135 };
00136 
00137 } 
00138 
00139 #endif // !defined(_SORTEDCOLLECTIONS_H_)