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 #include "CollectionBase.h"
00026
00027 namespace cmlabs {
00028
00029
00030
00031
00032
00033 CollectionBase::CollectionBase()
00034 {
00035 }
00036
00037
00038
00039
00040
00041 CollectionBase::CollectionBase(const JString& xml) {
00042 objectTable.fromXML(xml);
00043 }
00044
00045 CollectionBase::CollectionBase(XMLNode* node) {
00046 objectTable.fromXML(node);
00047 }
00048
00049
00050 CollectionBase::~CollectionBase()
00051 {
00052 objectTable.removeAll();
00053 }
00054
00055 bool CollectionBase::isCollection() const {
00056 return true;
00057 }
00058
00059
00060 unsigned long CollectionBase::getPayloadSize() const {
00061 return objectTable.getPayloadSize();
00062 }
00063
00064
00065
00066
00067
00068
00069 bool CollectionBase::equals(const Object* o2) const {
00070 if (o2 == NULL) return false;
00071 if (!this->isSameClass(o2)) {
00072 return false;
00073 }
00074 return (objectTable.equals(&((CollectionBase*)o2)->objectTable));
00075 }
00076
00077 bool CollectionBase::operator ==(CollectionBase& c) {
00078 return (objectTable == c.objectTable);
00079 }
00080
00081 bool CollectionBase::operator !=(CollectionBase& c) {
00082 return (!(*this == c));
00083 }
00084
00085 Object* CollectionBase::clone() const {
00086 CollectionBase* coll = new CollectionBase();
00087 coll->objectTable.copyAll(objectTable);
00088 coll->objectTable.type = objectTable.type;
00089 coll->objectTable.sorting = objectTable.sorting;
00090 return coll;
00091 }
00092
00093 bool CollectionBase::removeAll() {
00094 return objectTable.removeAll();
00095 }
00096
00097
00098 int CollectionBase::getCount() const {
00099 return objectTable.count;
00100 }
00101
00102 int CollectionBase::length() const {
00103 return objectTable.count;
00104 }
00105
00106
00107
00108
00109
00110
00111
00112 bool CollectionBase::removeFirst() {
00113 return objectTable.removeFirst();
00114 }
00115
00116 bool CollectionBase::removeLast() {
00117 return objectTable.removeLast();
00118 }
00119
00120 bool CollectionBase::remove(int pos) {
00121 return objectTable.remove(pos);
00122 }
00123
00124
00125
00126
00127
00128
00129
00130 JString CollectionBase::toHTML() {
00131 return objectTable.toHTML();
00132 }
00133
00134
00135 JString CollectionBase::toXML() {
00136 return objectTable.toXML();
00137 }
00138
00139 bool CollectionBase::fromXML(const JString& xml) {
00140 return objectTable.fromXML(xml);
00141 }
00142
00143 bool CollectionBase::fromXML(XMLNode* node) {
00144 return objectTable.fromXML(node);
00145 }
00146
00147
00148
00149 JString CollectionBase::print() const {
00150 return objectTable.print();
00151 }
00152
00153 JString CollectionBase::printListLine(const JString& separator, const JString& equalsign, const JString& quotes) const {
00154 return objectTable.printListLine(separator, equalsign, quotes);
00155 }
00156
00157
00158
00159
00160
00161
00162
00163 bool CollectionBase::addAll(const CollectionBase* c)
00164 {
00165 if (c == NULL)
00166 return false;
00167 return objectTable.addAll(c->objectTable);
00168 }
00169
00170 bool CollectionBase::copyAll(const CollectionBase* c)
00171 {
00172 if (c == NULL)
00173 return false;
00174 return objectTable.copyAll(c->objectTable);
00175 }
00176
00177 bool CollectionBase::takeAll(CollectionBase* c)
00178 {
00179 if (c == NULL)
00180 return false;
00181 return objectTable.takeAll(c->objectTable);
00182 }
00183
00184 bool CollectionBase::addAll(const CollectionBase& c)
00185 {
00186 return objectTable.addAll(c.objectTable);
00187 }
00188
00189 bool CollectionBase::copyAll(const CollectionBase& c)
00190 {
00191 return objectTable.copyAll(c.objectTable);
00192 }
00193
00194 bool CollectionBase::takeAll(CollectionBase& c)
00195 {
00196 return objectTable.takeAll(c.objectTable);
00197 }
00198
00199
00200
00201
00202
00203
00204
00205
00206 long CollectionBase::getBinarySize(int chunk) {
00207 return objectTable.getBinarySize(chunk);
00208 }
00209
00210
00211 int CollectionBase::getBinaryChunkCount() {
00212 return objectTable.getBinaryChunkCount();
00213 }
00214
00215
00216 long CollectionBase::toBinaryBuffer(int chunk, char* buffer, int maxlen) {
00217 return objectTable.toBinaryBuffer(chunk, buffer, maxlen);
00218 }
00219
00220
00221 bool CollectionBase::fromBinaryBuffer(int chunk, char* buffer, long len) {
00222 return objectTable.fromBinaryBuffer(chunk, buffer, len);
00223 }
00224
00225
00226
00227
00228
00229
00230
00231
00232 bool CollectionBase::sortKeysReverse() {
00233 return objectTable.sortKeysReverse();
00234 }
00235
00236 bool CollectionBase::sortKeys() {
00237 return objectTable.sortKeys();
00238 }
00239
00240 bool CollectionBase::sortValues() {
00241 return objectTable.sortValues();
00242 }
00243
00244 bool CollectionBase::sortValuesReverse() {
00245 return objectTable.sortValuesReverse();
00246 }
00247
00248
00249 bool CollectionBase::sortRandomMix() {
00250 return objectTable.sortRandomMix();
00251 }
00252
00253
00254 bool CollectionBase::removeNoDelete(int pos) {
00255 return objectTable.removeNoDelete(pos);
00256 }
00257
00258 bool CollectionBase::removeAllNoDelete() {
00259 return objectTable.removeAllNoDelete();
00260 }
00261
00262 void CollectionBase::noDelete() {
00263 objectTable.noDelete();
00264 }
00265
00266 void CollectionBase::doDelete() {
00267 objectTable.doDelete();
00268 }
00269
00270
00271
00272
00273
00274
00275
00276
00277
00278
00279
00280 }