|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jaudiotagger.audio.asf.data.Chunk org.jaudiotagger.audio.asf.data.ChunkContainer
public class ChunkContainer
Stores multiple ASF objects (chunks) in form of Chunk
objects, and is
itself an ASF object (chunk).
Because current implementation is solely used for ASF metadata, all chunks
(except for StreamChunk
) may only be inserted once.
Field Summary | |
---|---|
private java.util.Map<GUID,java.util.List<Chunk>> |
chunkTable
Stores the Chunk objects to their GUID . |
private static java.util.Set<GUID> |
MULTI_CHUNKS
Stores the GUID instances, which are allowed multiple times
within an ASF header. |
Fields inherited from class org.jaudiotagger.audio.asf.data.Chunk |
---|
chunkLength, guid, position |
Constructor Summary | |
---|---|
ChunkContainer(GUID chunkGUID,
long pos,
java.math.BigInteger length)
Creates an instance. |
Method Summary | |
---|---|
void |
addChunk(Chunk toAdd)
Adds a chunk to the container. |
protected java.util.List<Chunk> |
assertChunkList(GUID lookFor)
This method asserts that a List exists for the given GUID
, in chunkTable . |
protected static boolean |
chunkstartsUnique(ChunkContainer container)
Tests whether all stored chunks have a unique starting position among their brothers. |
java.util.Collection<Chunk> |
getChunks()
Returns a collection of all contained chunks. |
protected Chunk |
getFirst(GUID lookFor,
java.lang.Class<? extends Chunk> instanceOf)
Looks for the first stored chunk which has the given GUID. |
boolean |
hasChunkByGUID(GUID lookFor)
This method checks if a chunk has been added with specified GUID. |
java.lang.String |
prettyPrint(java.lang.String prefix)
This method creates a String containing useful information prepared to be printed on STD-OUT. |
java.lang.String |
prettyPrint(java.lang.String prefix,
java.lang.String containerInfo)
Nearly the same as prettyPrint(String) however, additional
information can be injected below the Chunk.prettyPrint(String)
output and the listing of the contained chunks. |
Methods inherited from class org.jaudiotagger.audio.asf.data.Chunk |
---|
getChunckEnd, getChunkEnd, getChunkLength, getGuid, getPosition, setPosition, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final java.util.Set<GUID> MULTI_CHUNKS
GUID
instances, which are allowed multiple times
within an ASF header.
private final java.util.Map<GUID,java.util.List<Chunk>> chunkTable
Chunk
objects to their GUID
.
Constructor Detail |
---|
public ChunkContainer(GUID chunkGUID, long pos, java.math.BigInteger length)
chunkGUID
- the GUID which identifies the chunk.pos
- the position of the chunk within the stream.length
- the length of the chunk.Method Detail |
---|
protected static boolean chunkstartsUnique(ChunkContainer container)
container
- the container to test.
true
if all chunks are located at an unique
position. However, no intersection is tested.public void addChunk(Chunk toAdd)
toAdd
- The chunk which is to be added.
java.lang.IllegalArgumentException
- If a chunk of same type is already added, except for
StreamChunk
.protected java.util.List<Chunk> assertChunkList(GUID lookFor)
List
exists for the given GUID
, in chunkTable
.
lookFor
- The GUID to get list for.
public java.util.Collection<Chunk> getChunks()
protected Chunk getFirst(GUID lookFor, java.lang.Class<? extends Chunk> instanceOf)
lookFor
- GUID to look up.instanceOf
- The class which must additionally be matched.
null
if no chunk was found, or the stored instance
doesn't match.public boolean hasChunkByGUID(GUID lookFor)
lookFor
- GUID to look up.
true
if chunk with specified GUID has been added.public java.lang.String prettyPrint(java.lang.String prefix)
prettyPrint
in class Chunk
prefix
- each line gets this string prepended.
public java.lang.String prettyPrint(java.lang.String prefix, java.lang.String containerInfo)
prettyPrint(String)
however, additional
information can be injected below the Chunk.prettyPrint(String)
output and the listing of the contained chunks.
prefix
- The prefix to prepend.containerInfo
- Information to inject.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |