Package org.xbill.DNS

Class LOCRecord

java.lang.Object
org.xbill.DNS.Record
org.xbill.DNS.LOCRecord
All Implemented Interfaces:
Serializable, Cloneable, Comparable<Record>

public class LOCRecord extends Record
Location - describes the physical location of hosts, networks, subnets.
See Also:
  • Field Details

    • w2

      private static final NumberFormat w2
    • w3

      private static final NumberFormat w3
    • size

      private long size
    • hPrecision

      private long hPrecision
    • vPrecision

      private long vPrecision
    • latitude

      private long latitude
    • longitude

      private long longitude
    • altitude

      private long altitude
  • Constructor Details

    • LOCRecord

      LOCRecord()
    • LOCRecord

      public LOCRecord(Name name, int dclass, long ttl, double latitude, double longitude, double altitude, double size, double hPrecision, double vPrecision)
      Creates an LOC Record from the given data
      Parameters:
      latitude - The latitude of the center of the sphere
      longitude - The longitude of the center of the sphere
      altitude - The altitude of the center of the sphere, in m
      size - The diameter of a sphere enclosing the described entity, in m.
      hPrecision - The horizontal precision of the data, in m.
      vPrecision - The vertical precision of the data, in m.
  • Method Details

    • rrFromWire

      protected void rrFromWire(DNSInput in) throws IOException
      Description copied from class: Record
      Converts the type-specific RR to wire format - must be overridden
      Specified by:
      rrFromWire in class Record
      Throws:
      IOException
    • parseFixedPoint

      private double parseFixedPoint(String s)
    • parsePosition

      private long parsePosition(Tokenizer st, String type) throws IOException
      Throws:
      IOException
    • parseDouble

      private long parseDouble(Tokenizer st, String type, boolean required, long min, long max, long defaultValue) throws IOException
      Throws:
      IOException
    • rdataFromString

      protected void rdataFromString(Tokenizer st, Name origin) throws IOException
      Description copied from class: Record
      Converts the text format of an RR to the internal format - must be overriden
      Specified by:
      rdataFromString in class Record
      Throws:
      IOException
    • renderFixedPoint

      private void renderFixedPoint(StringBuilder sb, NumberFormat formatter, long value, long divisor)
    • positionToString

      private String positionToString(long value, char pos, char neg)
    • rrToString

      protected String rrToString()
      Convert to a String
      Specified by:
      rrToString in class Record
    • getLatitude

      public double getLatitude()
      Returns the latitude
    • getLongitude

      public double getLongitude()
      Returns the longitude
    • getAltitude

      public double getAltitude()
      Returns the altitude
    • getSize

      public double getSize()
      Returns the diameter of the enclosing sphere
    • getHPrecision

      public double getHPrecision()
      Returns the horizontal precision
    • getVPrecision

      public double getVPrecision()
      Returns the horizontal precision
    • rrToWire

      protected void rrToWire(DNSOutput out, Compression c, boolean canonical)
      Description copied from class: Record
      Converts the type-specific RR to wire format - must be overridden.
      Specified by:
      rrToWire in class Record
    • parseLOCformat

      private static long parseLOCformat(int b) throws WireParseException
      Throws:
      WireParseException
    • toLOCformat

      private int toLOCformat(long l)