Package geomss.geom
Class PointComponent
- java.lang.Object
-
- geomss.geom.AbstractGeomElement<T>
-
- geomss.geom.AbstractGeomList<T,E>
-
- geomss.geom.AbstractPointGeomList<PointComponent,PointArray>
-
- geomss.geom.PointComponent
-
- All Implemented Interfaces:
GeomElement<PointComponent>,GeometryList<PointComponent,PointArray>,PointGeometry<PointComponent>,Transformable<PointComponent>,java.io.Serializable,java.lang.Cloneable,java.lang.Comparable,java.lang.Iterable<PointArray>,java.util.Collection<PointArray>,java.util.List<PointArray>,javolution.lang.Reusable,javolution.xml.XMLSerializable
public final class PointComponent extends AbstractPointGeomList<PointComponent,PointArray>
A list that holds onlyPointArrayobjects.WARNING: This list allows geometry to be stored in different units. If consistent units are required, then the user must specifically convert the list items.
Modified by: Joseph A. Huwaldt
- Version:
- February 17, 2025
- Author:
- Joseph A. Huwaldt, Date: May 1, 2009
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class geomss.geom.AbstractGeomElement
RESOURCES
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(int index, PointArray value)Inserts the specifiedPointArrayat the specified position in this list.booleanaddAll(int index, java.util.Collection<? extends PointArray> c)Inserts all of thePointArrayobjects in the specified collection into this list at the specified position.PointComponentcopy()Returns a copy of thisPointComponentinstanceallocatedby the calling thread (possibly on the stack).PointComponentcopyToReal()Return a copy of this object with any transformations or subranges removed (applied).intgetNumberOfPanels()Return the total number of quadrilateral panels in this component.PointComponentgetRange(int first, int last)Returns the range of elements in this list from the specified start and ending indexes.PointComponentgetTransformed(GTransform transform)Returns transformed version of this element.static PointComponentnewInstance()Returns a new, empty, preallocated or recycledPointComponentinstance (on the stack when executing in aStackContext), that can store a list ofPointArrayobjects.static PointComponentnewInstance(java.lang.String name)Returns a new, empty, preallocated or recycledPointComponentinstance (on the stack when executing in aStackContext) with the specified name, that can store a list ofPointArrayobjects.static voidrecycle(PointComponent instance)Recycles a case instance immediately (on the stack when executing in a StackContext).PointComponentreverse()Returns an newPointStringwith the elements in this list in reverse order.PointArrayset(int index, PointArray element)Replaces thePointArrayat the specified position in this list with the specified element.PointComponentto(javax.measure.unit.Unit<javax.measure.quantity.Length> unit)Returns the equivalent to this list but with all the elements stated in the specified unit.PointComponenttoDimension(int newDim)Return the equivalent of this list converted to the specified number of physical dimensions.static PointComponentvalueOf(PointArray... elements)Return a PointComponent made up of thePointArrayobjects in the specified array.static PointComponentvalueOf(java.lang.String name, PointArray... elements)Return a PointComponent made up of thePointArrayobjects in the specified array.static PointComponentvalueOf(java.lang.String name, java.util.Collection<? extends PointArray> elements)Return a PointComponent made up of thePointArrayobjects in the specified collection.-
Methods inherited from class geomss.geom.AbstractPointGeomList
getNumberOfPoints, getPhyDimension
-
Methods inherited from class geomss.geom.AbstractGeomList
add, add, add, addAll, addAll, addAll, clear, contains, containsAll, containsGeometry, equals, get, get, getAll, getBoundsMax, getBoundsMin, getFirst, getIndexFromName, getLast, getLimitPoint, getParDimension, getUnit, hashCode, indexOf, isEmpty, isValid, iterator, lastIndexOf, listIterator, listIterator, remove, remove, remove, removeAll, reset, retainAll, size, subList, toArray, toArray, toText, unmodifiableList
-
Methods inherited from class geomss.geom.AbstractGeomElement
addChangeListener, clone, compareTo, getAllUserData, getID, getName, getUserData, putAllUserData, putUserData, removeChangeListener, removeUserData, setName, toString
-
Methods inherited from interface geomss.geom.GeomElement
addChangeListener, getAllUserData, getBoundsMax, getBoundsMin, getID, getLimitPoint, getName, getParDimension, getUnit, getUserData, isValid, putAllUserData, putUserData, removeChangeListener, removeUserData, setName, size, toText
-
-
-
-
Method Detail
-
newInstance
public static PointComponent newInstance()
Returns a new, empty, preallocated or recycledPointComponentinstance (on the stack when executing in aStackContext), that can store a list ofPointArrayobjects.- Returns:
- A new, empty PointComponent.
-
newInstance
public static PointComponent newInstance(java.lang.String name)
Returns a new, empty, preallocated or recycledPointComponentinstance (on the stack when executing in aStackContext) with the specified name, that can store a list ofPointArrayobjects.- Parameters:
name- The name to be assigned to this list (may benull).- Returns:
- A new, empty PointComponent.
-
valueOf
public static PointComponent valueOf(java.lang.String name, java.util.Collection<? extends PointArray> elements)
Return a PointComponent made up of thePointArrayobjects in the specified collection.- Parameters:
name- The name to be assigned to this list (may benull).elements- A collection of PointArray elements. May not be null.- Returns:
- A new PointComponent containing the elements in the specified collection.
-
valueOf
public static PointComponent valueOf(java.lang.String name, PointArray... elements)
Return a PointComponent made up of thePointArrayobjects in the specified array.- Parameters:
name- The name to be assigned to this list (may benull).elements- A list of PointArray elements. May not be null.- Returns:
- A new PointComponent containing the elements in the specified array.
-
valueOf
public static PointComponent valueOf(PointArray... elements)
Return a PointComponent made up of thePointArrayobjects in the specified array.- Parameters:
elements- A list of PointArray elements. May not be null.- Returns:
- A new PointComponent containing the elements in the specified array.
-
getRange
public PointComponent getRange(int first, int last)
Returns the range of elements in this list from the specified start and ending indexes.- Specified by:
getRangein interfaceGeometryList<PointComponent,PointArray>- Specified by:
getRangein classAbstractGeomList<PointComponent,PointArray>- Parameters:
first- index of the first element to return.last- index of the last element to return.- Returns:
- the list of elements in the given range from this list.
- Throws:
java.lang.IndexOutOfBoundsException- if the given index is out of range (index < 0 || index ≥ size())
-
reverse
public PointComponent reverse()
Returns an newPointStringwith the elements in this list in reverse order.- Specified by:
reversein interfaceGeometryList<PointComponent,PointArray>- Specified by:
reversein classAbstractGeomList<PointComponent,PointArray>- Returns:
- A new PointComponent with the elements in this list in reverse order.
-
toDimension
public PointComponent toDimension(int newDim)
Return the equivalent of this list converted to the specified number of physical dimensions. If the number of dimensions is greater than this element, then zeros are added to the additional dimensions. If the number of dimensions is less than this element, then the extra dimensions are simply dropped (truncated). If the new dimensions are the same as the dimension of this element, then this list is simply returned.- Parameters:
newDim- The dimension of the element to return.- Returns:
- The equivalent of this list converted to the new dimensions.
-
to
public PointComponent to(javax.measure.unit.Unit<javax.measure.quantity.Length> unit)
Returns the equivalent to this list but with all the elements stated in the specified unit.- Parameters:
unit- the length unit of the list to be returned. May not be null.- Returns:
- an equivalent to this list but stated in the specified unit.
- Throws:
javax.measure.converter.ConversionException- if the the input unit is not a length unit.
-
copy
public PointComponent copy()
Returns a copy of thisPointComponentinstanceallocatedby the calling thread (possibly on the stack).- Returns:
- an identical and independent copy of this object.
-
copyToReal
public PointComponent copyToReal()
Return a copy of this object with any transformations or subranges removed (applied).- Returns:
- A copy of this list with any sub-element transformations or subranges removed.
-
getNumberOfPanels
public int getNumberOfPanels() throws java.lang.IndexOutOfBoundsException
Return the total number of quadrilateral panels in this component.- Returns:
- the total number of panels in this component.
- Throws:
java.lang.IndexOutOfBoundsException- if the strings in any array in this component have different lengths.
-
getTransformed
public PointComponent getTransformed(GTransform transform)
Returns transformed version of this element. The returned object implementsGeomTransformand contains transformed versions of the contents of this list as children.- Parameters:
transform- The transform to apply to this geometry element. May not be null.- Returns:
- A transformed version of this geometry element.
- Throws:
DimensionException- if this element is not 3D.
-
set
public PointArray set(int index, PointArray element)
Replaces thePointArrayat the specified position in this list with the specified element. Null elements are ignored. The input element must have the same physical dimensions as the other items in this list, or an exception is thrown.- Specified by:
setin interfacejava.util.List<PointArray>- Overrides:
setin classAbstractPointGeomList<PointComponent,PointArray>- Parameters:
index- The index of the element to replace (0 returns the 1st element, -1 returns the last, -2 returns the 2nd from last, etc).element- The element to be stored at the specified position. May not be null.- Returns:
- The element previously at the specified position in this list.
- Throws:
java.lang.IndexOutOfBoundsException- - ifindex > size()DimensionException- if the input element's dimensions are different from this list's dimensions.
-
add
public void add(int index, PointArray value)
Inserts the specifiedPointArrayat the specified position in this list. Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices). Null values are ignored. The input value must have the same physical dimensions as the other items in this list, or an exception is thrown.Note: If this method is used concurrent access must be synchronized (the list is not thread-safe).
- Specified by:
addin interfacejava.util.List<PointArray>- Overrides:
addin classAbstractPointGeomList<PointComponent,PointArray>- Parameters:
index- the index at which the specified element is to be inserted. (0 returns the 1st element, -1 returns the last, -2 returns the 2nd from last, etc).value- the element to be inserted. May not be null.- Throws:
java.lang.IndexOutOfBoundsException- ifindex > size()DimensionException- if the input value dimensions are different from this list's dimensions.
-
addAll
public boolean addAll(int index, java.util.Collection<? extends PointArray> c)
Inserts all of thePointArrayobjects in the specified collection into this list at the specified position. Shifts the element currently at that position (if any) and any subsequent elements to the right (increases their indices). The new elements will appear in this list in the order that they are returned by the specified collection's iterator. The behavior of this operation is unspecified if the specified collection is modified while the operation is in progress. Note that this will occur if the specified collection is this list, and it's nonempty. The input elements must have the same physical dimensions as the other items in this list, or an exception is thrown.- Specified by:
addAllin interfacejava.util.List<PointArray>- Overrides:
addAllin classAbstractGeomList<PointComponent,PointArray>- Parameters:
index- index at which to insert first element from the specified collection.c- Elements to be inserted into this collection. May not be null.- Returns:
trueif this collection changed as a result of the call.- Throws:
DimensionException- if the input element's dimensions are different from this list's dimensions.
-
recycle
public static void recycle(PointComponent instance)
Recycles a case instance immediately (on the stack when executing in a StackContext).- Parameters:
instance- The instance to be recycled.
-
-