Package de.javagl.ply

Class ObjectPlySource

  • All Implemented Interfaces:
    PlySource

    public final class ObjectPlySource
    extends Object
    implements PlySource
    Implementation of a PlySource that can be backed by list of objects
    • Constructor Detail

      • ObjectPlySource

        public ObjectPlySource​(Descriptor descriptor)
        Creates a new instance with the given Descriptor
        Parameters:
        descriptor - The Descriptor
    • Method Detail

      • register

        public <T> ObjectPlySource.Handle<T> register​(String elementName,
                                                      List<T> objects)
        Register a new element type to be provided by this instance. This will return a ObjectPlySource.Handle that allows further configuration about how to provide the specific element type. The handle offers methods to configure how each property is supposed to be provided, using the handle.with... functions.
        Type Parameters:
        T - The element type
        Parameters:
        elementName - The element name
        objects - The objects
        Returns:
        The ObjectPlySource.Handle
      • getElementList

        public List<Element> getElementList​(String elementName)
        Description copied from interface: PlySource
        Returns an unmodifiable list of Element objects for the elements with the given name, or null if there are no elements with the given name.
        Specified by:
        getElementList in interface PlySource
        Parameters:
        elementName - The element name
        Returns:
        The Element list
      • getElementList

        public List<Element> getElementList​(int elementTypeIndex)
        Description copied from interface: PlySource
        Returns an unmodifiable list of Element objects for the specified element type index
        Specified by:
        getElementList in interface PlySource
        Parameters:
        elementTypeIndex - The element type index
        Returns:
        The Element list