Package gov.nasa.worldwind.ogc.collada
Class ColladaAccessor
- java.lang.Object
-
- gov.nasa.worldwind.util.xml.AbstractXMLEventParser
-
- gov.nasa.worldwind.ogc.collada.ColladaAbstractObject
-
- gov.nasa.worldwind.ogc.collada.ColladaAccessor
-
- All Implemented Interfaces:
XMLEventParser
public class ColladaAccessor extends ColladaAbstractObject
Represents the COLLADA accessor element and provides access to its contents.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List<ColladaParam>
params
Parameters used by this accessor.-
Fields inherited from class gov.nasa.worldwind.util.xml.AbstractXMLEventParser
CHARACTERS_CONTENT, fields, namespaceURI, parent
-
-
Constructor Summary
Constructors Constructor Description ColladaAccessor(java.lang.String ns)
Create a new accessor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
doAddEventAttribute(javax.xml.stream.events.Attribute attr, XMLEventParserContext ctx, javax.xml.stream.events.XMLEvent event, java.lang.Object... args)
int
getCount()
Indicates the number of elements that this accessor can read.float[]
getFloats()
Copies this accessor's content to a buffer.int
getOffset()
Indicates the offset into the source data at which the accessor starts reading.java.lang.String
getSource()
Get the identifier of this accessor's source.int
getStride()
Indicates the number of tokens in the source data to advance between elements.void
setField(java.lang.String keyName, java.lang.Object value)
int
size()
Indicates the number of tokens that the accessor can read.-
Methods inherited from class gov.nasa.worldwind.ogc.collada.ColladaAbstractObject
getLocalExtent, getRoot
-
Methods inherited from class gov.nasa.worldwind.util.xml.AbstractXMLEventParser
allocate, doAddCharacters, doAddEventContent, doParseEventAttributes, doParseEventContent, freeResources, getAConstructor, getCharacters, getField, getField, getFields, getNamespaceURI, getParent, hasField, hasField, hasFields, mergeFields, newInstance, overrideFields, parse, parseCharacterContent, removeField, setField, setFields, setNamespaceURI, setParent
-
-
-
-
Field Detail
-
params
protected java.util.List<ColladaParam> params
Parameters used by this accessor.
-
-
Method Detail
-
getSource
public java.lang.String getSource()
Get the identifier of this accessor's source.- Returns:
- Accessor source.
-
getCount
public int getCount()
Indicates the number of elements that this accessor can read. An element is a tuple whose length depends on the number of accessor parameters. For example, if the accessor has three float parameters, than an element is three floats, and this method returns the number of float triplets.- Returns:
- Number of elements that the accessor can read.
-
getOffset
public int getOffset()
Indicates the offset into the source data at which the accessor starts reading. Returns zero if this attribute has not been set.- Returns:
- Offset at which the accessor starts reading.
-
getStride
public int getStride()
Indicates the number of tokens in the source data to advance between elements.- Returns:
- Offset at which the accessor starts reading.
-
size
public int size()
Indicates the number of tokens that the accessor can read. For example, if the accessor reads floats, then this method returns the number of floats that the accessor can read.- Returns:
- Number of tokens that the accessor can read.
-
getFloats
public float[] getFloats()
Copies this accessor's content to a buffer. This method begins writing data at the buffer's current position, and continues until the accessor is out of data.- Returns:
- Array of floats. May return null if the data source is not available.
-
setField
public void setField(java.lang.String keyName, java.lang.Object value)
- Overrides:
setField
in classAbstractXMLEventParser
-
doAddEventAttribute
protected void doAddEventAttribute(javax.xml.stream.events.Attribute attr, XMLEventParserContext ctx, javax.xml.stream.events.XMLEvent event, java.lang.Object... args) throws javax.xml.stream.XMLStreamException
- Overrides:
doAddEventAttribute
in classAbstractXMLEventParser
- Throws:
javax.xml.stream.XMLStreamException
-
-