public class Structure
extends java.lang.Object
implements java.lang.Cloneable
| Constructor and Description |
|---|
Structure(BlenderInputStream inputStream,
java.lang.String[] names,
java.lang.String[] types,
BlenderContext blenderContext)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
clone() |
java.util.List<Structure> |
evaluateListBase()
This method should be used on structures that are of a 'ListBase' type.
|
void |
fill(BlenderInputStream inputStream)
This method fills the structure with data.
|
java.lang.String |
getFieldFullName(int fieldIndex)
This method returns the full field name of the given index.
|
int |
getFieldsAmount()
This method returns the amount of fields for the current structure.
|
java.lang.String |
getFieldType(int fieldIndex)
This method returns the field type of the given index.
|
java.lang.Object |
getFieldValue(java.lang.String fieldName)
This method returns the value of the filed with a given name.
|
java.lang.Object |
getFieldValue(java.lang.String fieldName,
java.lang.Object defaultValue)
This method returns the value of the filed with a given name.
|
java.lang.Object |
getFlatFieldValue(java.lang.String fieldName)
This method returns the value of the filed with a given name.
|
java.lang.String |
getName()
This method returns the name of the structure.
|
java.lang.Long |
getOldMemoryAddress()
This method returns the address of the structure.
|
java.lang.String |
getType()
This method returns the type of the structure.
|
java.lang.String |
toString() |
public Structure(BlenderInputStream inputStream, java.lang.String[] names, java.lang.String[] types, BlenderContext blenderContext) throws BlenderFileException
inputStream - the stream we read the structure fromnames - the names from which the name of structure and its fields will be takentypes - the names of types for the structureblenderContext - the blender contextBlenderFileException - this exception occurs if the amount of fields, defined in the file, is negativepublic void fill(BlenderInputStream inputStream) throws BlenderFileException
inputStream - the stream we read data from, its read cursor should be placed at the start position of the data for the
structureBlenderFileException - an exception is thrown when the blend file is somehow invalid or corruptedpublic java.lang.Object getFieldValue(java.lang.String fieldName)
fieldName - the name of the fieldpublic java.lang.Object getFieldValue(java.lang.String fieldName,
java.lang.Object defaultValue)
fieldName - the name of the fielddefaultValue - the value that is being returned when no field of a given name is foundpublic java.lang.Object getFlatFieldValue(java.lang.String fieldName)
fieldName - the name of the fieldpublic java.util.List<Structure> evaluateListBase() throws BlenderFileException
BlenderFileException - this exception is thrown when the blend file structure is somehow invalid or corruptedjava.lang.IllegalArgumentException - this exception is thrown if the type of the structure is not 'ListBase'public java.lang.String getType()
public int getFieldsAmount()
public java.lang.String getFieldFullName(int fieldIndex)
fieldIndex - the index of the fieldpublic java.lang.String getFieldType(int fieldIndex)
fieldIndex - the index of the fieldpublic java.lang.Long getOldMemoryAddress()
public java.lang.String getName()
public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.Object clone()
throws java.lang.CloneNotSupportedException
clone in class java.lang.Objectjava.lang.CloneNotSupportedException