Class ColladaAccessor

  • All Implemented Interfaces:
    XMLEventParser

    public class ColladaAccessor
    extends ColladaAbstractObject
    Represents the COLLADA accessor element and provides access to its contents.
    • Field Detail

      • params

        protected java.util.List<ColladaParam> params
        Parameters used by this accessor.
    • Constructor Detail

      • ColladaAccessor

        public ColladaAccessor​(java.lang.String ns)
        Create a new accessor.
        Parameters:
        ns - Namespace.
    • 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.
      • 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 class AbstractXMLEventParser
        Throws:
        javax.xml.stream.XMLStreamException