net.named_data.jndn
public static class Name.Component extends Object implements Comparable
| Constructor and Description |
|---|
Name.Component()
Create a new Name.Component with a zero-length value.
|
Name.Component(Blob value)
Create a new Name.Component, using the existing the Blob value.
|
Name.Component(byte[] value)
Create a new Name.Component, copying the given value.
|
Name.Component(Name.Component component)
Create a new Name.Component, taking another pointer to the component's
read-only value.
|
Name.Component(String value)
Create a new Name.Component, converting the value to UTF8 bytes.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compare(Name.Component other)
Compare this to the other Component using NDN canonical ordering.
|
int |
compareTo(Object o) |
boolean |
equals(Name.Component other)
Check if this is the same component as other.
|
boolean |
equals(Object other) |
static Name.Component |
fromNumber(long number)
Create a component whose value is the nonNegativeInteger encoding of the
number.
|
static Name.Component |
fromNumberWithMarker(long number,
int marker)
Create a component whose value is the marker appended with the
nonNegativeInteger encoding of the number.
|
Blob |
getValue()
Get the component value.
|
int |
hashCode() |
String |
toEscapedString()
Convert this component value by escaping characters according to the
NDN URI Scheme.
|
void |
toEscapedString(StringBuffer result)
Write this component value to result, escaping characters according to
the NDN URI Scheme.
|
long |
toNumber()
Interpret this name component as a network-ordered number and return an
integer.
|
long |
toNumberWithMarker(int marker)
Interpret this name component as a network-ordered number with a marker
and return an integer.
|
long |
toSegment()
Interpret this name component as a segment number according to NDN naming
conventions for "Segment number" (marker 0x00).
|
long |
toSegmentOffset()
Interpret this name component as a segment byte offset according to NDN
naming conventions for segment "Byte offset" (marker 0xFB).
|
long |
toSequenceNumber()
Interpret this name component as a sequence number according to NDN naming
conventions for "Sequencing" (marker 0xFE).
|
long |
toTimestamp()
Interpret this name component as a timestamp according to NDN naming
conventions for "Timestamp" (marker 0xFC).
|
long |
toVersion()
Interpret this name component as a version number according to NDN naming
conventions for "Versioning" (marker 0xFD).
|
public Name.Component()
public Name.Component(Blob value)
value - The component value. value may not be null, but
value.buf() may be null.public Name.Component(Name.Component component)
component - The component to copy.public Name.Component(byte[] value)
value - The value byte array.public Name.Component(String value)
value - The string to convert to UTF8.public final Blob getValue()
public final void toEscapedString(StringBuffer result)
result - The StringBuffer to write to.public final String toEscapedString()
public final long toNumber()
public final long toNumberWithMarker(int marker)
throws EncodingException
marker - The required first byte of the component.EncodingException - If the first byte of the component does not
equal the marker.public final long toSegment()
throws EncodingException
EncodingException - If the first byte of the component is not the
expected marker.public final long toSegmentOffset()
throws EncodingException
EncodingException - If the first byte of the component is not the
expected marker.public final long toVersion()
throws EncodingException
EncodingException - If the first byte of the component is not the
expected marker.public final long toTimestamp()
throws EncodingException
EncodingException - If the first byte of the component is not the
expected marker.public final long toSequenceNumber()
throws EncodingException
EncodingException - If the first byte of the component is not the
expected marker.public static Name.Component fromNumber(long number)
number - The number to be encoded.public static Name.Component fromNumberWithMarker(long number, int marker)
number - The number to be encoded.marker - The marker to use as the first byte of the component.public final boolean equals(Name.Component other)
other - The other Component to compare with.public final int compare(Name.Component other)
other - The other Component to compare with.public final int compareTo(Object o)
compareTo in interface ComparableCopyright © 2015. All rights reserved.