NASA World Wind

gov.nasa.worldwind.ogc.collada
Class ColladaAccessor

java.lang.Object
  extended by gov.nasa.worldwind.util.xml.AbstractXMLEventParser
      extended by gov.nasa.worldwind.ogc.collada.ColladaAbstractObject
          extended by 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
protected  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
ColladaAccessor(String ns)
          Create a new accessor.
 
Method Summary
protected  void doAddEventAttribute(Attribute attr, XMLEventParserContext ctx, XMLEvent event, 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.
 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(String keyName, 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, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

params

protected List<ColladaParam> params
Parameters used by this accessor.

Constructor Detail

ColladaAccessor

public ColladaAccessor(String ns)
Create a new accessor.

Parameters:
ns - Namespace.
Method Detail

doAddEventAttribute

protected void doAddEventAttribute(Attribute attr,
                                   XMLEventParserContext ctx,
                                   XMLEvent event,
                                   Object... args)
                            throws XMLStreamException

Overrides:
doAddEventAttribute in class AbstractXMLEventParser
Throws:
XMLStreamException

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.

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.

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.

getSource

public String getSource()
Get the identifier of this accessor's source.

Returns:
Accessor source.

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.

setField

public void setField(String keyName,
                     Object value)

Overrides:
setField in class AbstractXMLEventParser

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.

NASA World Wind