Package de.javagl.ply
Class ObjectPlySource
- java.lang.Object
-
- de.javagl.ply.ObjectPlySource
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classObjectPlySource.Handle<T>The handle that is returned fromregister(String, List)and that allows configuring how the objects are converted into elements.
-
Constructor Summary
Constructors Constructor Description ObjectPlySource(Descriptor descriptor)Creates a new instance with the givenDescriptor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DescriptorgetDescriptor()Returns theDescriptorthat describes the structure of the data.List<Element>getElementList(int elementTypeIndex)Returns an unmodifiable list ofElementobjects for the specified element type indexList<Element>getElementList(String elementName)Returns an unmodifiable list ofElementobjects for the elements with the given name, ornullif there are no elements with the given name.<T> ObjectPlySource.Handle<T>register(String elementName, List<T> objects)Register a new element type to be provided by this instance.
-
-
-
Constructor Detail
-
ObjectPlySource
public ObjectPlySource(Descriptor descriptor)
Creates a new instance with the givenDescriptor- Parameters:
descriptor- TheDescriptor
-
-
Method Detail
-
getDescriptor
public Descriptor getDescriptor()
Description copied from interface:PlySourceReturns theDescriptorthat describes the structure of the data.- Specified by:
getDescriptorin interfacePlySource- Returns:
- The
Descriptor
-
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 aObjectPlySource.Handlethat 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 thehandle.with...functions.- Type Parameters:
T- The element type- Parameters:
elementName- The element nameobjects- The objects- Returns:
- The
ObjectPlySource.Handle
-
getElementList
public List<Element> getElementList(String elementName)
Description copied from interface:PlySourceReturns an unmodifiable list ofElementobjects for the elements with the given name, ornullif there are no elements with the given name.- Specified by:
getElementListin interfacePlySource- Parameters:
elementName- The element name- Returns:
- The
Elementlist
-
getElementList
public List<Element> getElementList(int elementTypeIndex)
Description copied from interface:PlySourceReturns an unmodifiable list ofElementobjects for the specified element type index- Specified by:
getElementListin interfacePlySource- Parameters:
elementTypeIndex- The element type index- Returns:
- The
Elementlist
-
-