com.esri.adf.web.data.geometry
Class WebSpatialReference

java.lang.Object
  extended by com.esri.adf.web.data.geometry.WebSpatialReference
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable

public final class WebSpatialReference
extends java.lang.Object
implements java.io.Externalizable

WebSpatialReference is a class representing a spatial reference.

See Also:
Serialized Form

Field Summary
protected  java.lang.String definitionString
           
protected static java.util.Map<java.lang.String,WebSpatialReference> defSRs
           
static int GEOG_CS
           
protected  int id
           
protected static java.util.Map<java.lang.Integer,WebSpatialReference> idSRs
           
static int PROJ_CS
           
protected  int type
           
 
Constructor Summary
  WebSpatialReference()
          Constructs an empty instance of WebSpatialReference.
protected WebSpatialReference(int id, java.lang.String definitionString, int type)
           
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.lang.String getDefinitionString()
          Returns spatial reference definition string.
 WebPolygon getHorizon(boolean inGCS)
          Returns the horizon of this spatial reference.
 int getId()
          Return spatial reference ID.
 int getType()
          Returns spatial reference type.
static WebSpatialReference getWebSpatialReference(int id)
          Returns an instance of WebSpatialReference corresponding to its ID.
static WebSpatialReference getWebSpatialReference(java.lang.String definitionString)
          Returns an instance of WebSpatialReference corresponding to a given definition string.
static int getWebSpatialReferenceId(java.lang.String definitionString)
          Returns the spatial reference id based on the specified definition string.
 int hashCode()
           
 void readExternal(java.io.ObjectInput in)
           
 java.lang.String toString()
           
 void writeExternal(java.io.ObjectOutput out)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

GEOG_CS

public static final int GEOG_CS
See Also:
Constant Field Values

PROJ_CS

public static final int PROJ_CS
See Also:
Constant Field Values

id

protected int id

definitionString

protected java.lang.String definitionString

type

protected int type

idSRs

protected static java.util.Map<java.lang.Integer,WebSpatialReference> idSRs

defSRs

protected static java.util.Map<java.lang.String,WebSpatialReference> defSRs
Constructor Detail

WebSpatialReference

public WebSpatialReference()
Constructs an empty instance of WebSpatialReference.


WebSpatialReference

protected WebSpatialReference(int id,
                              java.lang.String definitionString,
                              int type)
Method Detail

getId

public int getId()
Return spatial reference ID.

Returns:
spatial reference ID

getDefinitionString

public java.lang.String getDefinitionString()
Returns spatial reference definition string.

Returns:
spatial reference definition string

getType

public int getType()
Returns spatial reference type.

Returns:
spatial reference type

getWebSpatialReference

public static WebSpatialReference getWebSpatialReference(int id)
Returns an instance of WebSpatialReference corresponding to its ID.

Parameters:
id - id of the spatial reference
Returns:
an instance of WebSpatialReference

getWebSpatialReference

public static WebSpatialReference getWebSpatialReference(java.lang.String definitionString)
Returns an instance of WebSpatialReference corresponding to a given definition string.

Parameters:
definitionString - spatial reference's definition string
Returns:
an instance of WebSpatialReference

getWebSpatialReferenceId

public static int getWebSpatialReferenceId(java.lang.String definitionString)
Returns the spatial reference id based on the specified definition string.

Parameters:
definitionString - the spatial reference definition string
Returns:
the spatial reference id, -1 if there is no id available for the specified definition string

getHorizon

public WebPolygon getHorizon(boolean inGCS)
Returns the horizon of this spatial reference.

Parameters:
inGCS - . This parameter has an affect only if the current spatial reference is in Projected Coordinate System. When true, the horizon will be returned in the Geographic Coordinate System that this spatial reference is based on.
Returns:
a horizon of WebPolygon object

toString

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

hashCode

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

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException
Specified by:
readExternal in interface java.io.Externalizable
Throws:
java.io.IOException

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Specified by:
writeExternal in interface java.io.Externalizable
Throws:
java.io.IOException