Public Member Functions | |
Collection | clone () |
Collection (java.util.Collection< Link > contents) | |
Collection (Link[] contents) | |
Collection (ArrayList< ContentName > nameContents) | |
Make a Collection containing Links which only specify names. | |
Collection (String label, ArrayList< ContentName > nameContents) | |
Make a Collection containing Links which only specify names and a single label. | |
LinkedList< Link > | contents () |
Link | get (int i) |
Link | get (String label) |
Return the first Link with matching label, if any. | |
void | add (Link content) |
void | add (ArrayList< Link > contents) |
void | add (String label, ArrayList< ContentName > nameContents) |
void | add (String label, ContentName target) |
Link | remove (int i) |
boolean | remove (Link content) |
void | removeAll () |
int | size () |
ArrayList< Link > | find (Link target) |
Find all the elements in this Collection that match target on any of the parameters it has set, and return them. | |
ArrayList< Link > | find (ContentName targetName) |
ArrayList< Link > | find (String targetLabel) |
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. | |
boolean | validate () |
Make sure all of the necessary fields are filled in prior to attempting to encode. | |
long | getElementLabel () |
Allow the encoder/decoder to retrieve the top-level element name programmatically. | |
int | hashCode () |
boolean | equals (Object obj) |
String | toString () |
More concise toString. | |
Iterator< Link > | iterator () |
Protected Attributes | |
LinkedList< Link > | _contents = new LinkedList<Link>() |
Classes | |
class | CollectionObject |
A CCNNetworkObject wrapper around Collection, used for easily saving and retrieving versioned Collections to CCN. More... |
See Link for a discussion of what such links can refer to and their security. A Collection is the easiest way in CCN of representing extensional containment -- a fixed list of items that form a group, where it is possible to say that an item is either in or out of the group. Containment in CCN can also be represented intentionally -- by looking at the set of children a given name currently has. In that latter case, it is impossible to say in general whether something is not in the set, as there might exist a child with that name, but it is not accessible to your network at the moment.
By tailoring the meaning of and labels attached to the Links in a Collection, one can generate special-purpose Collection subclasses with particular semantics, useful in particular applications. See ACL and the Name Enumeration protocol for examples of this.
org.ccnx.ccn.io.content.Collection.Collection | ( | ArrayList< ContentName > | nameContents | ) |
Make a Collection containing Links which only specify names.
nameContents | The list of names to link to. |
org.ccnx.ccn.io.content.Collection.Collection | ( | String | label, | |
ArrayList< ContentName > | nameContents | |||
) |
Make a Collection containing Links which only specify names and a single label.
nameContents | The list of names to link to. |
Link org.ccnx.ccn.io.content.Collection.get | ( | String | label | ) |
void org.ccnx.ccn.io.content.Collection.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.io.content.Collection.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.
boolean org.ccnx.ccn.io.content.Collection.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.
Reimplemented in org.ccnx.ccn.profiles.security.access.group.ACL.
long org.ccnx.ccn.io.content.Collection.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.
Reimplemented in org.ccnx.ccn.profiles.security.access.group.ACL.