public static class TypeChunk.Entry extends java.lang.Object implements SerializableResource
| Modifier and Type | Field and Description |
|---|---|
static int |
NO_ENTRY
An entry offset that indicates that a given resource is not present.
|
| Modifier and Type | Method and Description |
|---|---|
static TypeChunk.Entry |
create(java.nio.ByteBuffer buffer,
int baseOffset,
TypeChunk parent)
Creates a new
TypeChunk.Entry whose contents start at the 0-based position in
buffer given by a 4-byte value read from buffer and then added to
baseOffset. |
boolean |
equals(java.lang.Object o) |
int |
flags()
Resource entry flags.
|
int |
hashCode() |
int |
headerSize()
Number of bytes in the header of the
TypeChunk.Entry. |
boolean |
isComplex()
Returns true if this is a complex resource.
|
java.lang.String |
key()
Returns the key name identifying this resource entry.
|
int |
keyIndex()
Index into
PackageChunk.getKeyStringPool() identifying this entry. |
TypeChunk |
parent()
The
TypeChunk that this resource entry belongs to. |
int |
parentEntry()
Entry into
PackageChunk that is the parent TypeChunk.Entry to this entry. |
int |
size()
The total number of bytes that this
TypeChunk.Entry takes up. |
byte[] |
toByteArray()
Converts this resource into an array of bytes representation.
|
byte[] |
toByteArray(boolean shrink)
Converts this resource into an array of bytes representation.
|
java.lang.String |
toString() |
java.lang.String |
typeName()
Returns the name of the type this chunk represents (e.g.
|
BinaryResourceValue |
value()
The value of this resource entry, if this is not a complex entry.
|
java.util.Map<java.lang.Integer,BinaryResourceValue> |
values()
The extra values in this resource entry if this
isComplex(). |
public static final int NO_ENTRY
public int headerSize()
TypeChunk.Entry.public int flags()
public int keyIndex()
PackageChunk.getKeyStringPool() identifying this entry.@Nullable public BinaryResourceValue value()
public java.util.Map<java.lang.Integer,BinaryResourceValue> values()
isComplex().public int parentEntry()
PackageChunk that is the parent TypeChunk.Entry to this entry.
This value only makes sense when this is complex (isComplex() returns true).public final java.lang.String typeName()
public final int size()
TypeChunk.Entry takes up.public final java.lang.String key()
public final boolean isComplex()
@Nullable public static TypeChunk.Entry create(java.nio.ByteBuffer buffer, int baseOffset, TypeChunk parent)
TypeChunk.Entry whose contents start at the 0-based position in
buffer given by a 4-byte value read from buffer and then added to
baseOffset. If the value read from buffer is equal to NO_ENTRY, then
null is returned as there is no resource at that position.
Otherwise, this position is parsed and returned as an TypeChunk.Entry.
buffer - A buffer positioned at an offset to an TypeChunk.Entry.baseOffset - Offset that must be added to the value at buffer's position.parent - The TypeChunk that this resource entry belongs to.TypeChunk.Entry or null if there is no resource at this location.public final byte[] toByteArray()
SerializableResourcetoByteArray in interface SerializableResourcepublic final byte[] toByteArray(boolean shrink)
SerializableResourcetoByteArray in interface SerializableResourceshrink - True if, when converting to a byte array, this resource can modify the returned
bytes in an effort to reduce the size.public final java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object