Public Member Functions | |
Exclude (ArrayList< Element > values) | |
Exclude (byte omissions[][]) | |
Create an Exclude filter that excludes exactly the listed name components. | |
boolean | match (byte[] component) |
void | add (byte omissions[][]) |
Return a new Exclude filter that is a copy of this one with the supplied omissions added. | |
void | excludeUpto (byte[] component) |
Take an existing Exclude filter and additionally exclude all components up to and including the component passed in. | |
boolean | empty () |
Check for exclude with no elements. | |
void | decode (XMLDecoder decoder) throws ContentDecodingException |
Decode this object as the top-level item in a new XML document, reading it from a network buffer. | |
void | encode (XMLEncoder encoder) throws ContentEncodingException |
Encode this object during an ongoing encoding pass; this is what subclasses generally need to know how to implement. | |
long | getElementLabel () |
Allow the encoder/decoder to retrieve the top-level element name programmatically. | |
boolean | validate () |
Make sure all of the necessary fields are filled in prior to attempting to encode. | |
int | compareTo (Exclude o) |
boolean | equals (Object obj) |
int | size () |
Gets the number of elements in the Exclude filter. | |
Element | value (int i) |
DEBUGGING ONLY -- may need to be removed. | |
String | toString () |
Default toString() implementation simply prints the text encoding of the object. | |
Static Public Member Functions | |
static Exclude | uptoFactory (byte[] component) |
Create an Exclude filter that excludes all components up to and including the one given, but none after. | |
static Exclude | factory (byte omissions[][]) |
Static Public Attributes | |
static int | OPTIMUM_FILTER_SIZE = 100 |
Protected Attributes | |
ArrayList< Element > | _values = new ArrayList<Element>() |
Classes | |
class | Element |
Object to contain elements used in an exclude filter. More... | |
class | Filler |
A filler element occurs in a Exclude filter between 2 name components which may be an implied name component if the filler element is the first or last element in the Exclude filter. More... |
The filter works on the name component after the last one specified in the Interest.
Exclude filters contain at least one element. The elements are either a name component, a bloom filter or the 'any' element. This allows the specification of individual component values to be excluded, as well as arbitrary ranges of component values and a compact form for long lists of component values (bloom filters).
The order of elements within an exclude filter must follow 2 rules: 1. Within an exclude filter all name component elements must be in ascending order wherever they occur and there should be no duplicates. 2. An any element or a bloom filter element must not be followed by an any element or bloom filter.
org.ccnx.ccn.protocol.Exclude.Exclude | ( | ArrayList< Element > | values | ) |
values | Must be a list of ExcludeElements - Components must be in increasing order and there must not be more than one BloomFilter in a row. |
IllegalArgumentException |
org.ccnx.ccn.protocol.Exclude.Exclude | ( | byte | omissions[][] | ) |
Create an Exclude filter that excludes exactly the listed name components.
omissions | The name components to be excluded. Passing in null or a zero length array here will result in an IllegalArgumentException exception |
IllegalArgumentException |
static Exclude org.ccnx.ccn.protocol.Exclude.uptoFactory | ( | byte[] | component | ) | [static] |
Create an Exclude filter that excludes all components up to and including the one given, but none after.
component | if a null component is passed in then null is returned. |
static Exclude org.ccnx.ccn.protocol.Exclude.factory | ( | byte | omissions[][] | ) | [static] |
boolean org.ccnx.ccn.protocol.Exclude.match | ( | byte[] | component | ) |
component | - A name component |
void org.ccnx.ccn.protocol.Exclude.add | ( | byte | omissions[][] | ) |
void org.ccnx.ccn.protocol.Exclude.excludeUpto | ( | byte[] | component | ) |
boolean org.ccnx.ccn.protocol.Exclude.empty | ( | ) |
Check for exclude with no elements.
void org.ccnx.ccn.protocol.Exclude.decode | ( | XMLDecoder | decoder | ) | throws ContentDecodingException [virtual] |
Decode this object as the top-level item in a new XML document, reading it from a network buffer.
Reads document start and end. Assumes default encoding.
buf | input stream to read from |
ContentDecodingException | if there is an error decoding the content Decode this object as the top-level item in a new XML document, reading it from a network buffer. Reads document start and end. |
buf | input stream to read from | |
codec | the codec to use; must be recognized by XMLCodecFactory |
ContentDecodingException | if there is an error decoding the content |
decoder | the decoder being used; encapsulates state including the codec being used as well as the input source and current offset |
Implements org.ccnx.ccn.impl.encoding.GenericXMLEncodable.
void org.ccnx.ccn.protocol.Exclude.encode | ( | XMLEncoder | encoder | ) | throws ContentEncodingException [virtual] |
Encode this object during an ongoing encoding pass; this is what subclasses generally need to know how to implement.
Writes just the object itself, higher-level processes have handled start and end document if need be. Allows object to be written using the same code whether it is a top-level element written alone, or nested inside another element.
encoder | the encoder being used; encapsulates state including the codec being used as well as the output destination and current offset |
Implements org.ccnx.ccn.impl.encoding.GenericXMLEncodable.
long org.ccnx.ccn.protocol.Exclude.getElementLabel | ( | ) | [virtual] |
Allow the encoder/decoder to retrieve the top-level element name programmatically.
This allows subclasses to rename elements without changing their encoder/decoders.
Implements org.ccnx.ccn.impl.encoding.GenericXMLEncodable.
boolean org.ccnx.ccn.protocol.Exclude.validate | ( | ) | [virtual] |
Make sure all of the necessary fields are filled in prior to attempting to encode.
All implementations of encode(XMLEncoder) should call this for their classes prior to encoding.
Implements org.ccnx.ccn.impl.encoding.GenericXMLEncodable.
int org.ccnx.ccn.protocol.Exclude.size | ( | ) |
String org.ccnx.ccn.protocol.Exclude.toString | ( | ) |
Default toString() implementation simply prints the text encoding of the object.
This demonstrates how to force use of the text encoding.
Reimplemented from org.ccnx.ccn.impl.encoding.GenericXMLEncodable.