Meki Cherkaoui | 97e7a59 | 2012-04-14 02:50:06 -0700 | [diff] [blame^] | 1 | |
| 2 | var Exclude = function Exclude(_Values){ |
| 3 | |
| 4 | this.OPTIMUM_FILTER_SIZE = 100; |
| 5 | |
| 6 | |
| 7 | this.Values = _Values; //array of elements |
| 8 | |
| 9 | } |
| 10 | |
| 11 | Exclude.prototype.decode = function(/*XMLDecoder*/ decoder) { |
| 12 | |
| 13 | |
| 14 | |
| 15 | decoder.readStartElement(this.getElementLabel()); |
| 16 | |
| 17 | //TODO |
| 18 | /*var component; |
| 19 | var any = false; |
| 20 | while ((component = decoder.peekStartElement(CCNProtocolDTags.Component)) || |
| 21 | (any = decoder.peekStartElement(CCNProtocolDTags.Any)) || |
| 22 | decoder.peekStartElement(CCNProtocolDTags.Bloom)) { |
| 23 | var ee = component?new ExcludeComponent(): any ? new ExcludeAny() : new BloomFilter(); |
| 24 | ee.decode(decoder); |
| 25 | _values.add(ee); |
| 26 | }*/ |
| 27 | |
| 28 | decoder.readEndElement(); |
| 29 | |
| 30 | }; |
| 31 | |
| 32 | Exclude.prototype.encode=function(/*XMLEncoder*/ encoder) { |
| 33 | if (!validate()) { |
| 34 | throw new ContentEncodingException("Cannot encode " + this.getClass().getName() + ": field values missing."); |
| 35 | } |
| 36 | // if everything is null, output nothing |
| 37 | if (empty()) |
| 38 | return; |
| 39 | |
| 40 | encoder.writeStartElement(getElementLabel()); |
| 41 | |
| 42 | encoder.writeEndElement(); |
| 43 | |
| 44 | }; |
| 45 | |
| 46 | Exclude.prototype.getElementLabel = function() { return CCNProtocolDTags.Exclude; }; |
| 47 | |