Class LinearTransformBuilder.Ungridded
java.lang.Object
org.apache.sis.internal.util.AbstractMap<org.opengis.geometry.DirectPosition,org.opengis.geometry.DirectPosition>
org.apache.sis.referencing.operation.builder.LinearTransformBuilder.ControlPoints
org.apache.sis.referencing.operation.builder.LinearTransformBuilder.Ungridded
- All Implemented Interfaces:
Map<org.opengis.geometry.DirectPosition,
org.opengis.geometry.DirectPosition>
- Enclosing class:
- LinearTransformBuilder
Implementation of the map returned by
LinearTransformBuilder.getControlPoints()
when no grid is used.
This implementation is simpler than the gridded case, but less efficient as some methods
require a linear scan.-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.sis.internal.util.AbstractMap
AbstractMap.EntryIterator<K,
V>, AbstractMap.IteratorAdapter<K, V>, AbstractMap.KeyIterator -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) int
domain()
Returns the number of points to consider when searching inLinearTransformBuilder.sources
orLinearTransformBuilder.targets
arrays.protected AbstractMap.EntryIterator<org.opengis.geometry.DirectPosition,
org.opengis.geometry.DirectPosition> Returns an iterator over the entries.(package private) int
flatIndex
(org.opengis.geometry.DirectPosition source) Returns the index where to fetch a target position for the given source position in the flattened array.boolean
isEmpty()
Overrides default method with more efficient implementation.int
size()
Returns the number of key-value mappings in this map.Methods inherited from class org.apache.sis.referencing.operation.builder.LinearTransformBuilder.ControlPoints
containsKey, containsValue, get, position, search
Methods inherited from class org.apache.sis.internal.util.AbstractMap
addKey, addValue, clear, entrySet, equals, getOrDefault, hashCode, keySet, put, putAll, remove, toString, values
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Constructor Details
-
Ungridded
private Ungridded()
-
-
Method Details
-
isEmpty
public boolean isEmpty()Overrides default method with more efficient implementation.- Specified by:
isEmpty
in interfaceMap<org.opengis.geometry.DirectPosition,
org.opengis.geometry.DirectPosition> - Overrides:
isEmpty
in classAbstractMap<org.opengis.geometry.DirectPosition,
org.opengis.geometry.DirectPosition> - Returns:
true
if this map contains no element.
-
size
public int size()Description copied from class:AbstractMap
Returns the number of key-value mappings in this map. The default implementation count the number of values returned byAbstractMap.entryIterator()
. Subclasses should implement a more efficient method.- Specified by:
size
in interfaceMap<org.opengis.geometry.DirectPosition,
org.opengis.geometry.DirectPosition> - Overrides:
size
in classAbstractMap<org.opengis.geometry.DirectPosition,
org.opengis.geometry.DirectPosition>
-
domain
int domain()Description copied from class:LinearTransformBuilder.ControlPoints
Returns the number of points to consider when searching inLinearTransformBuilder.sources
orLinearTransformBuilder.targets
arrays. For gridded data we cannot rely onLinearTransformBuilder.numPoints
because the coordinate values may be at any index, not necessarily at consecutive indices.- Overrides:
domain
in classLinearTransformBuilder.ControlPoints
-
flatIndex
int flatIndex(org.opengis.geometry.DirectPosition source) Returns the index where to fetch a target position for the given source position in the flattened array. In non-gridded case, this operation requires linear scan.- Overrides:
flatIndex
in classLinearTransformBuilder.ControlPoints
- See Also:
-
entryIterator
protected AbstractMap.EntryIterator<org.opengis.geometry.DirectPosition,org.opengis.geometry.DirectPosition> entryIterator()Returns an iterator over the entries.DirectPosition
instances are created on-the-fly during the iteration.- Overrides:
entryIterator
in classLinearTransformBuilder.ControlPoints
- Returns:
- an iterator over the entries in this map, or
null
.
-