00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef COH_NULL_IMPLEMENTATION_HPP
00017 #define COH_NULL_IMPLEMENTATION_HPP
00018
00019 #include "coherence/lang.ns"
00020
00021 #include "coherence/io/pof/PofReader.hpp"
00022 #include "coherence/io/pof/PofWriter.hpp"
00023 #include "coherence/io/pof/PortableObject.hpp"
00024 #include "coherence/util/AbstractSet.hpp"
00025 #include "coherence/util/Filter.hpp"
00026 #include "coherence/util/MapListener.hpp"
00027 #include "coherence/util/ObservableMap.hpp"
00028 #include "coherence/util/ValueExtractor.hpp"
00029
00030 COH_OPEN_NAMESPACE2(coherence,util)
00031
00032 using coherence::io::pof::PofReader;
00033 using coherence::io::pof::PofWriter;
00034 using coherence::io::pof::PortableObject;
00035 using coherence::util::AbstractSet;
00036 using coherence::util::MapListener;
00037 using coherence::util::ObservableMap;
00038 using coherence::util::ValueExtractor;
00039
00040
00041
00042
00043
00044
00045
00046
00047 class COH_EXPORT NullImplementation
00048 {
00049
00050
00051 public:
00052
00053
00054
00055 static ObjectArray::Handle getArray();
00056
00057
00058
00059
00060 static Iterator::Handle getIterator();
00061
00062
00063
00064
00065 static Muterator::Handle getMuterator();
00066
00067
00068
00069
00070 static Set::Handle getSet();
00071
00072
00073
00074
00075 static Collection::Handle getCollection();
00076
00077
00078
00079
00080 static Map::Handle getMap();
00081
00082
00083
00084
00085 static ObservableMap::Handle getObservableMap();
00086
00087
00088
00089
00090 static ValueExtractor::Handle getValueExtractor();
00091
00092
00093
00094 public:
00095 class COH_EXPORT NullMuterator
00096 : public class_spec<NullMuterator,
00097 extends<Object>,
00098 implements<Muterator> >
00099 {
00100 friend class factory<NullImplementation::NullMuterator>;
00101
00102
00103
00104 protected:
00105
00106
00107
00108 NullMuterator();
00109
00110
00111
00112
00113 public:
00114
00115
00116
00117 virtual bool hasNext() const;
00118
00119
00120
00121
00122 virtual Object::Holder next();
00123
00124
00125
00126
00127 virtual void remove();
00128
00129 public:
00130 static Handle getInstance();
00131 };
00132
00133
00134
00135 public:
00136 class COH_EXPORT NullSet
00137 : public cloneable_spec<NullSet,
00138 extends<AbstractSet>,
00139 implements<PortableObject> >
00140 {
00141 friend class factory<NullImplementation::NullSet>;
00142
00143
00144
00145 protected:
00146
00147
00148
00149 NullSet();
00150
00151
00152
00153
00154 NullSet(const NullSet& that);
00155
00156
00157
00158
00159 public:
00160
00161
00162
00163
00164 virtual bool contains(Object::View v) const;
00165
00166
00167
00168
00169 virtual Iterator::Handle iterator() const;
00170
00171
00172
00173
00174 virtual Muterator::Handle iterator();
00175
00176
00177
00178
00179 virtual ObjectArray::Handle toArray(
00180 ObjectArray::Handle hao = NULL) const;
00181
00182
00183
00184
00185 virtual bool add(Object::Holder oh);
00186
00187
00188
00189
00190 virtual bool remove(Object::View v);
00191
00192
00193
00194
00195 virtual bool containsAll(Collection::View vc) const;
00196
00197
00198
00199
00200 virtual bool addAll(Collection::View vc);
00201
00202
00203
00204
00205 virtual bool removeAll(Collection::View vc);
00206
00207
00208
00209
00210 virtual bool retainAll(Collection::View vc);
00211
00212
00213
00214
00215 virtual size32_t size() const;
00216
00217
00218
00219
00220 virtual bool isEmpty() const;
00221
00222
00223
00224
00225 virtual void clear();
00226
00227
00228
00229
00230 public:
00231
00232
00233
00234 virtual void readExternal(PofReader::Handle hIn);
00235
00236
00237
00238
00239 virtual void writeExternal(PofWriter::Handle hOut) const;
00240
00241
00242
00243
00244 public:
00245
00246
00247
00248 virtual bool equals(Object::View v) const;
00249
00250 public:
00251 static Handle getInstance();
00252 };
00253
00254
00255 public:
00256 class COH_EXPORT NullCollection
00257 : public cloneable_spec<NullCollection,
00258 extends<Object>,
00259 implements<Collection, PortableObject> >
00260 {
00261 friend class factory<NullImplementation::NullCollection>;
00262
00263
00264
00265 protected:
00266
00267
00268
00269 NullCollection();
00270
00271
00272
00273
00274 NullCollection(const NullCollection& that);
00275
00276
00277
00278
00279 public:
00280
00281
00282
00283 virtual bool contains(Object::View v) const;
00284
00285
00286
00287
00288 virtual Iterator::Handle iterator() const;
00289
00290
00291
00292
00293 virtual Muterator::Handle iterator();
00294
00295
00296
00297
00298 virtual ObjectArray::Handle toArray(
00299 ObjectArray::Handle hoa = NULL) const;
00300
00301
00302
00303
00304 virtual bool add(Object::Holder oh);
00305
00306
00307
00308
00309 virtual bool remove(Object::View v);
00310
00311
00312
00313
00314 virtual bool containsAll(Collection::View vc) const;
00315
00316
00317
00318
00319 virtual bool addAll(Collection::View vc);
00320
00321
00322
00323
00324 virtual bool removeAll(Collection::View vc);
00325
00326
00327
00328
00329 virtual bool retainAll(Collection::View vc);
00330
00331
00332
00333
00334 virtual size32_t size() const;
00335
00336
00337
00338
00339 virtual bool isEmpty() const;
00340
00341
00342
00343
00344 virtual void clear();
00345
00346
00347
00348
00349 public:
00350
00351
00352
00353 virtual void readExternal(PofReader::Handle hIn);
00354
00355
00356
00357
00358 virtual void writeExternal(PofWriter::Handle hOut) const;
00359
00360
00361
00362
00363 public:
00364
00365
00366
00367 virtual bool equals(Object::View v) const;
00368
00369 public:
00370 static Handle getInstance();
00371 };
00372
00373
00374
00375 public:
00376 class COH_EXPORT NullMap
00377 : public cloneable_spec<NullMap,
00378 extends<Object>,
00379 implements<Map, PortableObject> >
00380 {
00381 friend class factory<NullImplementation::NullMap>;
00382
00383
00384
00385 protected:
00386
00387
00388
00389 NullMap();
00390
00391
00392
00393
00394 NullMap(const NullMap& that);
00395
00396
00397
00398
00399 public:
00400
00401
00402
00403 virtual size32_t size() const;
00404
00405
00406
00407
00408 virtual bool isEmpty() const;
00409
00410
00411
00412
00413 virtual void clear();
00414
00415
00416
00417
00418 virtual bool containsKey(Object::View vKey) const;
00419
00420
00421
00422
00423 virtual bool containsValue(Object::View vValue) const;
00424
00425
00426
00427
00428 virtual Object::Holder get(Object::View vKey) const;
00429
00430
00431
00432
00433 virtual Object::Holder get(Object::View vKey);
00434
00435
00436
00437
00438 virtual Object::Holder put(Object::View vKey,
00439 Object::Holder ohValue);
00440
00441
00442
00443
00444 virtual Object::Holder remove(Object::View vKey);
00445
00446
00447
00448
00449 virtual void putAll(Map::View vMap);
00450
00451
00452
00453
00454 virtual Set::View keySet() const;
00455
00456
00457
00458
00459 virtual Set::Handle keySet();
00460
00461
00462
00463
00464 virtual Collection::View values() const;
00465
00466
00467
00468
00469 virtual Collection::Handle values();
00470
00471
00472
00473
00474 virtual Set::View entrySet() const;
00475
00476
00477
00478
00479 virtual Set::Handle entrySet();
00480
00481
00482
00483
00484 public:
00485
00486
00487
00488 virtual void readExternal(PofReader::Handle hIn);
00489
00490
00491
00492
00493 virtual void writeExternal(PofWriter::Handle hOut) const;
00494
00495
00496
00497
00498 public:
00499
00500
00501
00502 virtual bool equals(Object::View v) const;
00503
00504 public:
00505 static Handle getInstance();
00506 };
00507
00508
00509
00510
00511 public:
00512 class COH_EXPORT NullObservableMap
00513 : public cloneable_spec<NullObservableMap,
00514 extends<NullMap>,
00515 implements<ObservableMap> >
00516 {
00517 friend class factory<NullImplementation::NullObservableMap>;
00518
00519
00520
00521 protected:
00522
00523
00524
00525 NullObservableMap();
00526
00527
00528
00529
00530 NullObservableMap(const NullObservableMap& that);
00531
00532
00533
00534
00535 public:
00536
00537
00538
00539 virtual void addKeyListener(MapListener::Handle hListener,
00540 Object::View vKey, bool fLite);
00541
00542
00543
00544
00545 virtual void removeKeyListener(MapListener::Handle hListener,
00546 Object::View vKey);
00547
00548
00549
00550
00551 virtual void addFilterListener(MapListener::Handle hListener,
00552 Filter::View vFilter, bool fLite);
00553
00554
00555
00556
00557 virtual void removeFilterListener(MapListener::Handle hListener,
00558 Filter::View vFilter);
00559
00560 public:
00561 static Handle getInstance();
00562 };
00563
00564
00565
00566
00567 public:
00568 class COH_EXPORT NullValueExtractor
00569 : public class_spec<NullValueExtractor,
00570 extends<Object>,
00571 implements<ValueExtractor> >
00572 {
00573 friend class factory<NullImplementation::NullValueExtractor>;
00574
00575
00576
00577 protected:
00578
00579
00580
00581 NullValueExtractor();
00582
00583
00584
00585
00586 public:
00587
00588
00589
00590 virtual Object::Holder extract(Object::Holder ohTarget) const;
00591
00592
00593
00594
00595 public:
00596
00597
00598
00599 virtual bool equals(Object::View v) const;
00600
00601
00602
00603
00604 virtual size32_t hashCode() const;
00605
00606
00607
00608
00609 public:
00610
00611
00612
00613 virtual void readExternal(PofReader::Handle hIn);
00614
00615
00616
00617
00618 virtual void writeExternal(PofWriter::Handle hOut) const;
00619
00620 public:
00621 static Handle getInstance();
00622 };
00623 };
00624
00625 COH_CLOSE_NAMESPACE2
00626
00627 #endif