Package org.geotools.data.shapefile.shp
Enum Class ShapeType
- All Implemented Interfaces:
Serializable
,Comparable<ShapeType>
,Constable
Not much but a type safe enumeration of file types as ints and names. The descriptions can easily be tied to a
ResourceBundle if someone wants to do that.
- Author:
- Ian Schneider
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionRepresents an Arc shape (id = 3).Represents an ArcM shape (id = 23).Represents an ArcZ shape (id = 13).Represents a MultiPoint shape (id = 8).Represents a MultiPointM shape (id = 28).Represents a MultiPointZ shape (id = 18).Represents a Null shape (id = 0).Represents a Point shape (id = 1).Represents a PointM shape (id = 21).Represents a PointZ shape (id = 11).Represents a Polygon shape (id = 5).Represents a PolygonM shape (id = 25).Represents a PolygonZ shape (id = 15).Represents an Undefined shape (id = -1). -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic ShapeType
forID
(int id) Determine the ShapeType for the id.Each ShapeType corresponds to a handler.boolean
boolean
Is this a multipoint shape?boolean
boolean
boolean
toString()
Get the name of this ShapeType.static ShapeType
Returns the enum constant of this class with the specified name.static ShapeType[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NULL
Represents a Null shape (id = 0). -
POINT
Represents a Point shape (id = 1). -
POINTZ
Represents a PointZ shape (id = 11). -
POINTM
Represents a PointM shape (id = 21). -
ARC
Represents an Arc shape (id = 3). -
ARCZ
Represents an ArcZ shape (id = 13). -
ARCM
Represents an ArcM shape (id = 23). -
POLYGON
Represents a Polygon shape (id = 5). -
POLYGONZ
Represents a PolygonZ shape (id = 15). -
POLYGONM
Represents a PolygonM shape (id = 25). -
MULTIPOINT
Represents a MultiPoint shape (id = 8). -
MULTIPOINTZ
Represents a MultiPointZ shape (id = 18). -
MULTIPOINTM
Represents a MultiPointM shape (id = 28). -
UNDEFINED
Represents an Undefined shape (id = -1).
-
-
Field Details
-
id
public final int idThe integer id of this ShapeType. -
name
The human-readable name for this ShapeType.
Could easily use ResourceBundle for internationialization.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
toString
Get the name of this ShapeType. -
isMultiPoint
public boolean isMultiPoint()Is this a multipoint shape? Hint- all shapes are multipoint except NULL, UNDEFINED, and the POINTs.- Returns:
- true if multipoint, false otherwise.
-
isPointType
public boolean isPointType() -
isLineType
public boolean isLineType() -
isPolygonType
public boolean isPolygonType() -
isMultiPointType
public boolean isMultiPointType() -
forID
Determine the ShapeType for the id.- Parameters:
id
- The id to search for.- Returns:
- The ShapeType for the id.
-
getShapeHandler
Each ShapeType corresponds to a handler. In the future this should probably go else where to allow different handlers, or something...- Returns:
- The correct handler for this ShapeType. Returns a new one.
- Throws:
ShapefileException
- If the ShapeType is bogus.
-