|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.microcrowd.loader.java3d.max3ds.chunks.Chunk
public class Chunk
The base class for all chunks. Chunks are flyweights and should be managed
by ChunkChopper Every chunk should know how many bytes of data(or
be able figure out) to read before its subchunks are found. Chunks that only have
subchunks need not overrided loadData.
Chunks may store data for later use in loadData with pushData
If a chunk needs to initialize components with from subchunks, that data
can be retrieved with ChunkChopper.popData(java.lang.Object) inside the initialize(com.microcrowd.loader.java3d.max3ds.ChunkChopper) method. loadData(com.microcrowd.loader.java3d.max3ds.ChunkChopper) is called at the beginning of the
loading process, before any data or subchunks have been loaded(the chunk
itself must load its data).
During loadData, if the length of data before subchunks is unknown,
ChunkChopper.getChunkBytes() may be called and all the data
for the chunk(including subchunks) will be read and returned.
| Constructor Summary | |
|---|---|
Chunk()
default no-arg constructror. |
|
Chunk(java.lang.String chunkName)
default no-arg constructror. |
|
| Method Summary | |
|---|---|
void |
addSubChunk(java.lang.Integer id,
Chunk subChunk)
|
java.lang.String |
getDescription()
|
java.lang.String |
getName()
Gets a human readable name for the chunk. |
Chunk |
getSubChunk(java.lang.Integer id)
|
void |
initialize(ChunkChopper chopper)
This method is called after all the current chunks subchunks are loaded. |
void |
loadData(ChunkChopper chopper)
This is called by the chunk chopper before any of the chunk's subchunks are loaded. |
void |
setDescription(java.lang.String desc)
|
void |
setName(java.lang.String name)
Sets nice human readable name for the chunk. |
java.lang.String |
toString()
Returns the name of this chunk. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Chunk(java.lang.String chunkName)
public Chunk()
| Method Detail |
|---|
public void addSubChunk(java.lang.Integer id,
Chunk subChunk)
public Chunk getSubChunk(java.lang.Integer id)
public void initialize(ChunkChopper chopper)
ChunkChopper.popData(java.lang.Object)
The default implementation does nothing.
chopper - may contain data loaded by subchunks.public void loadData(ChunkChopper chopper)
ChunkChopper.popData(java.lang.Object)
The default implementation does nothing.
chopper - may contain data loaded by subchunks.public final void setName(java.lang.String name)
name - to use for display of this chunk.public final java.lang.String getName()
public final java.lang.String getDescription()
public final void setDescription(java.lang.String desc)
public java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||