net.named_data.jndn
public class DelegationSet extends Object
Modifier and Type | Class and Description |
---|---|
static class |
DelegationSet.Delegation
A DelegationSet.Delegation holds a preference number and delegation name.
|
Constructor and Description |
---|
DelegationSet()
Create a DelegationSet with an empty list of delegations.
|
DelegationSet(DelegationSet delegationSet)
Create a DelegationSet, copying values from the other DelegationSet.
|
Modifier and Type | Method and Description |
---|---|
void |
add(int preference,
Name name)
Add a new DelegationSet.Delegation to the list of delegations, sorted by
preference number then by name.
|
void |
addUnsorted(int preference,
Name name)
Add a new DelegationSet.Delegation to the end of the list of delegations,
without sorting or updating any existing entries.
|
void |
clear()
Clear the list of delegations.
|
int |
find(Name name)
Find the first delegation with the given name and return its index.
|
DelegationSet.Delegation |
get(int i)
Get the delegation at the given index, according to the ordering described
in add().
|
boolean |
remove(Name name)
Remove every DelegationSet.Delegation with the given name.
|
int |
size()
Get the number of delegation entries.
|
void |
wireDecode(Blob input)
Decode the input using the default wire format
WireFormat.getDefaultWireFormat() and update this DelegationSet.
|
void |
wireDecode(Blob input,
WireFormat wireFormat)
Decode the input using a particular wire format and update this DelegationSet.
|
void |
wireDecode(ByteBuffer input)
Decode the input using the default wire format
WireFormat.getDefaultWireFormat() and update this DelegationSet, using
addUnsorted() to preserve the given order and possible duplicates.
|
void |
wireDecode(ByteBuffer input,
WireFormat wireFormat)
Decode the input using a particular wire format and update this
DelegationSet, using addUnsorted() to preserve the given order and
possible duplicates.
|
Blob |
wireEncode()
Encode this DelegationSet for the default wire format
WireFormat.getDefaultWireFormat().
|
Blob |
wireEncode(WireFormat wireFormat)
Encode this DelegationSet for a particular wire format.
|
public DelegationSet()
public DelegationSet(DelegationSet delegationSet)
delegationSet
- The DelegationSet to copy values from.public final void add(int preference, Name name)
preference
- The preference number.name
- The delegation name. This makes a copy of the name.public final void addUnsorted(int preference, Name name)
preference
- The preference number.name
- The delegation name. This makes a copy of the name.public final boolean remove(Name name)
name
- The name to match the name of the delegation(s) to be removed.public final void clear()
public final int size()
public final DelegationSet.Delegation get(int i)
i
- The index of the component, starting from 0.public final int find(Name name)
name
- Then name of the delegation to find.public final Blob wireEncode(WireFormat wireFormat)
wireFormat
- A WireFormat object used to encode this DelegationSet.public final Blob wireEncode()
public final void wireDecode(ByteBuffer input, WireFormat wireFormat) throws EncodingException
input
- The input buffer to decode. This reads from position() to
limit(), but does not change the position.wireFormat
- A WireFormat object used to decode the input.EncodingException
- For invalid encoding.public final void wireDecode(ByteBuffer input) throws EncodingException
input
- The input buffer to decode. This reads from position() to
limit(), but does not change the position.EncodingException
- For invalid encoding.public final void wireDecode(Blob input, WireFormat wireFormat) throws EncodingException
input
- The input blob to decode.wireFormat
- A WireFormat object used to decode the input.EncodingException
- For invalid encoding.public final void wireDecode(Blob input) throws EncodingException
input
- The input blob to decode.EncodingException
- For invalid encoding.Copyright © 2016. All rights reserved.