Package jsl.modeling.elements.spatial
Class Euclidean2DPlane
- java.lang.Object
-
- jsl.modeling.elements.spatial.SpatialModel
-
- jsl.modeling.elements.spatial.Euclidean2DPlane
-
- All Implemented Interfaces:
ObservableIfc,GetNameIfc,IdentityIfc
public class Euclidean2DPlane extends SpatialModel
-
-
Field Summary
-
Fields inherited from class jsl.modeling.elements.spatial.SpatialModel
ADDED_ELEMENT, myDefaultPositionPrecision, myElements, REMOVED_ELEMENT, UPDATED_POSITION
-
-
Constructor Summary
Constructors Constructor Description Euclidean2DPlane()Euclidean2DPlane(java.lang.String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancomparePositions(CoordinateIfc coordinate1, CoordinateIfc coordinate2)Returns true if the first coordinate is the same as second coordinate within the underlying spatial model.doubledistance(CoordinateIfc fromCoordinate, CoordinateIfc toCoordinate)Computes the distance between the two supplied coordinatesCoordinateIfcgetCoordinate(double x1, double x2, double x3)Creates a valid coordinate for this spatial model This method should check whether the coordinate can be represented spatially within this spatial model.CoordinateIfcgetDefaultCoordinate()Returns a default set of coordinates to be used to initialize the location of spatial elements if necessary.booleanisValid(CoordinateIfc coordinate)Checks to see if the supplied coordinate is physically valid within the spatial model.-
Methods inherited from class jsl.modeling.elements.spatial.SpatialModel
addObserver, addSpatialElement, checkForSpatialElementRemoved, checkSpatialElementAdded, checkSpatialElementPositionChanged, comparePositions, contains, contains, countObservers, deleteObserver, deleteObservers, distance, getCoordinate, getDefaultPositionPrecision, getId, getModel, getName, getObserverState, getUpdatingSpatialElement, isValid, notifyObservers, removeSpatialElement, setDefaultPositionPrecision, setModel, setName, setObserverState, setUpdatingElement, updatePosition, updatePosition_
-
-
-
-
Method Detail
-
getDefaultCoordinate
public CoordinateIfc getDefaultCoordinate()
Description copied from class:SpatialModelReturns a default set of coordinates to be used to initialize the location of spatial elements if necessary.- Specified by:
getDefaultCoordinatein classSpatialModel- Returns:
-
getCoordinate
public CoordinateIfc getCoordinate(double x1, double x2, double x3)
Description copied from class:SpatialModelCreates a valid coordinate for this spatial model This method should check whether the coordinate can be represented spatially within this spatial model. If not, an IllegalArgumentException should be thrown- Specified by:
getCoordinatein classSpatialModel- Returns:
-
isValid
public boolean isValid(CoordinateIfc coordinate)
Description copied from class:SpatialModelChecks to see if the supplied coordinate is physically valid within the spatial model. This depends on the underlying spatial representation. This method should check whether the coordinate can be represented spatially within this spatial model. If so, this method should return true.- Specified by:
isValidin classSpatialModel- Returns:
-
distance
public double distance(CoordinateIfc fromCoordinate, CoordinateIfc toCoordinate)
Description copied from class:SpatialModelComputes the distance between the two supplied coordinates- Specified by:
distancein classSpatialModel- Returns:
-
comparePositions
public boolean comparePositions(CoordinateIfc coordinate1, CoordinateIfc coordinate2)
Description copied from class:SpatialModelReturns true if the first coordinate is the same as second coordinate within the underlying spatial model. This is not object reference equality, but rather whether or not the positions within the underlying spatial model can be considered spatially (equivalent). Requirement: The coordinates must be valid within the spatial model. If they are not valid within same spatial model, then this method should return false.- Specified by:
comparePositionsin classSpatialModel- Returns:
-
-