Record Class ShapefileGeometryReader.ShapeRecord

java.lang.Object
java.lang.Record
edu.cnu.mdi.mapping.shapefile.ShapefileGeometryReader.ShapeRecord
Record Components:
recordNumber - one-based record number as stored in the file
shapeType - shape type for this record; one of the TYPE_* constants
points - flat list of points; non-empty for ShapefileGeometryReader.TYPE_POINT and ShapefileGeometryReader.TYPE_MULTIPOINT; empty for ring-based types
rings - list of ring/part coordinate lists; non-empty for ShapefileGeometryReader.TYPE_POLYGON and ShapefileGeometryReader.TYPE_POLYLINE; empty for point types
Enclosing class:
ShapefileGeometryReader

public static record ShapefileGeometryReader.ShapeRecord(int recordNumber, int shapeType, List<Point2D.Double> points, List<List<Point2D.Double>> rings) extends Record
Immutable container for the geometry data of a single shapefile record.
  • Constructor Details

    • ShapeRecord

      public ShapeRecord(int recordNumber, int shapeType, List<Point2D.Double> points, List<List<Point2D.Double>> rings)
      Creates an instance of a ShapeRecord record class.
      Parameters:
      recordNumber - the value for the recordNumber record component
      shapeType - the value for the shapeType record component
      points - the value for the points record component
      rings - the value for the rings record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • recordNumber

      public int recordNumber()
      Returns the value of the recordNumber record component.
      Returns:
      the value of the recordNumber record component
    • shapeType

      public int shapeType()
      Returns the value of the shapeType record component.
      Returns:
      the value of the shapeType record component
    • points

      public List<Point2D.Double> points()
      Returns the value of the points record component.
      Returns:
      the value of the points record component
    • rings

      public List<List<Point2D.Double>> rings()
      Returns the value of the rings record component.
      Returns:
      the value of the rings record component