Package PamController.positionreference
Class PositionReferenceFinder
java.lang.Object
PamController.positionreference.PositionReferenceFinder
Find a Position Reference, based on a preferred order.
Options to take anything available if nothing in list exists.
- Author:
- Doug
-
Constructor Summary
ConstructorDescriptionPositionReferenceFinder
(Class[] preferredList, boolean acceptAnything) Construct a class to find and managed PositionReference PreferencesPositionReferenceFinder
(List<Class> preferredList, boolean acceptAnything) Construct a class to find and managed PositionReference Preferences -
Method Summary
Modifier and TypeMethodDescriptiondistanceToAirgun
(LatLong latLong, long timeMillis) Get the distance to the nearest Airgun array from the given position.distanceToNearest
(LatLong latLong, Class<?> referenceType, long timeMillis) Find the 2D distance to the nearest reference position of a given type.Get a list of all available position referencesFind any available PositionReferencefindNearest
(LatLong latLong, Class<?> referenceType, long timeMillis) Find the nearest reference position of a given type.Find the preferred position referenceTry to find a reference position based on the set rules.findReference
(Class referenceClass) Find the first available reference for a given class typeboolean
void
setAcceptAnything
(boolean acceptAnything) void
setPreferredList
(List<Class> preferredList)
-
Constructor Details
-
PositionReferenceFinder
Construct a class to find and managed PositionReference Preferences- Parameters:
preferredList
- list or preferred reference types in preferred orderacceptAnything
- accept anything if nothing in the preferred list exists.
-
PositionReferenceFinder
Construct a class to find and managed PositionReference Preferences- Parameters:
preferredList
- list or preferred reference types in preferred orderacceptAnything
- accept anything if nothing in the preferred list exists.
-
-
Method Details
-
findReference
Try to find a reference position based on the set rules.- Returns:
-
findAnyReference
Find any available PositionReference- Returns:
- first available position reference
-
findPreferredReference
Find the preferred position reference- Returns:
- the first available position reference in the preferred list.
-
findAllReferences
Get a list of all available position references- Returns:
- list of available position references
-
findReference
Find the first available reference for a given class type- Parameters:
referenceClass
- class of PositionReference- Returns:
- position reference
-
getPreferredList
- Returns:
- the preferredList
-
setPreferredList
- Parameters:
preferredList
- the preferredList to set
-
isAcceptAnything
public boolean isAcceptAnything()- Returns:
- the acceptAnything
-
setAcceptAnything
public void setAcceptAnything(boolean acceptAnything) - Parameters:
acceptAnything
- the acceptAnything to set
-
distanceToAirgun
Get the distance to the nearest Airgun array from the given position. 2D distance only !- Parameters:
timeMillis
- Current time in milliseconds.sequencePos
- Position of generated sequence- Returns:
- smallest distance or null.
-
distanceToNearest
Find the 2D distance to the nearest reference position of a given type.- Parameters:
latLong
- location of start pointreferenceType
- Type of position referencetimeMillis
- Millisecond time- Returns:
- distance in metres, or null if no reference found.
-
findNearest
Find the nearest reference position of a given type.- Parameters:
latLong
- location of start pointreferenceType
- Type of position referencetimeMillis
- Millisecond time- Returns:
- distance in metres, or null if no reference found.
-