Class ListAccessor<P>

java.lang.Object
org.ddogleg.clustering.misc.ListAccessor<P>
All Implemented Interfaces:
LArrayAccessor<P>

public class ListAccessor<P>
extends Object
implements LArrayAccessor<P>
Wrapper around List for LArrayAccessor.
  • Constructor Details

  • Method Details

    • getTemp

      public P getTemp​(int index)
      Description copied from interface: LArrayAccessor
      Returns an instance of P which has the value of the element at 'index'. Note that the accessor will own the data type which is returned and can modify it on the next call.

      This design is intended to be efficient when a massive array that's compressed and a very small array which is not compressed is used.

      Specified by:
      getTemp in interface LArrayAccessor<P>
    • getCopy

      public void getCopy​(int index, P dst)
      Description copied from interface: LArrayAccessor
      Copies the element at 'index' into 'dst'. Only use if a copy is required.
      Specified by:
      getCopy in interface LArrayAccessor<P>
    • copy

      public void copy​(P src, P dst)
      Description copied from interface: LArrayAccessor
      Copies src into dst
      Specified by:
      copy in interface LArrayAccessor<P>
    • size

      public int size()
      Description copied from interface: LArrayAccessor
      Number of elements in the set
      Specified by:
      size in interface LArrayAccessor<P>
    • getElementType

      public Class<P> getElementType()
      Description copied from interface: LArrayAccessor
      Data type of element
      Specified by:
      getElementType in interface LArrayAccessor<P>