Class Location


  • public class Location
    extends java.lang.Object
    Location data for a geographical query.
    Author:
    Steinar Knutsen, arnej27959
    • Constructor Summary

      Constructors 
      Constructor Description
      Location()  
      Location​(java.lang.String rawLocation)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      double degEW()
      Obtain degrees longitude (East-West direction); negative numbers are degrees West.
      double degNS()
      Obtain degrees latitude (North-South direction); negative numbers are degrees South.
      double degRadius()
      Obtain circle radius (in degrees).
      int encode​(java.nio.ByteBuffer buffer)
      Encodes the location to the given buffer and returns the length.
      boolean equals​(java.lang.Object other)  
      java.lang.String getAttribute()  
      int getBoundingHeight()
      Returns height of bounding box (actual height if rectangle, bounding square if circle)
      int getBoundingWidth()
      Returns width of bounding box (actual width if rectangle, bounding square if circle)
      int getDimensions()  
      boolean hasAttribute()  
      boolean hasBoundingBox()  
      boolean hasDimensions()  
      int hashCode()  
      boolean isGeoCircle()
      check whether this Location contains a 2D circle
      void setAttribute​(java.lang.String attributeName)  
      void setBoundingBox​(double n, double s, double e, double w)  
      void setDimensions​(int d)  
      void setGeoCircle​(double ns, double ew, double radius_in_degrees)  
      void setXyCircle​(int px, int py, int radius_in_units)  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • Location

        public Location()
      • Location

        public Location​(java.lang.String rawLocation)
    • Method Detail

      • equals

        public boolean equals​(java.lang.Object other)
        Overrides:
        equals in class java.lang.Object
      • hasDimensions

        public boolean hasDimensions()
      • setDimensions

        public void setDimensions​(int d)
      • getDimensions

        public int getDimensions()
      • setBoundingBox

        public void setBoundingBox​(double n,
                                   double s,
                                   double e,
                                   double w)
      • setGeoCircle

        public void setGeoCircle​(double ns,
                                 double ew,
                                 double radius_in_degrees)
      • setXyCircle

        public void setXyCircle​(int px,
                                int py,
                                int radius_in_units)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getBoundingWidth

        public int getBoundingWidth()
        Returns width of bounding box (actual width if rectangle, bounding square if circle)
        Returns:
        width of bounding box
      • getBoundingHeight

        public int getBoundingHeight()
        Returns height of bounding box (actual height if rectangle, bounding square if circle)
        Returns:
        height of bounding box
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • hasAttribute

        public boolean hasAttribute()
      • getAttribute

        public java.lang.String getAttribute()
      • setAttribute

        public void setAttribute​(java.lang.String attributeName)
      • isGeoCircle

        public boolean isGeoCircle()
        check whether this Location contains a 2D circle
      • hasBoundingBox

        public boolean hasBoundingBox()
      • degNS

        public double degNS()
        Obtain degrees latitude (North-South direction); negative numbers are degrees South. Expected range is [-90.0,+90.0] only. May only be called when isGeoCircle() returns true.
      • degEW

        public double degEW()
        Obtain degrees longitude (East-West direction); negative numbers are degrees West. Expected range is [-180.0,+180.0] only. May only be called when isGeoCircle() returns true.
      • degRadius

        public double degRadius()
        Obtain circle radius (in degrees). May only be called when isGeoCircle() returns true.
      • encode

        public int encode​(java.nio.ByteBuffer buffer)
        Encodes the location to the given buffer and returns the length. For internal use.