com.mapquest
Class LinePrimitive

java.lang.Object
  extended bycom.mapquest.MQObject
      extended bycom.mapquest.Primitive
          extended bycom.mapquest.LinePrimitive
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
PolygonPrimitive

public class LinePrimitive
extends Primitive

Describes linear annotations to be placed on the map. The line is converted into latitude/longitude points so it can be placed in the same geographical location after the map is manipulated.

See Also:
ColorStyle, Primitive, PenStyle, PointCollection, LatLngCollection

Field Summary
static int CLASS_ID
           
static java.lang.String CLASS_NAME
           
 
Fields inherited from class com.mapquest.MQObject
DEFAULT_ID, DEFAULT_NAME, DEFAULT_VERSION, FORMAT_NUMERIC_ID, FORMAT_TEXT_NAME, INVALID_ID, INVALID_NAME, INVALID_VERSION
 
Constructor Summary
LinePrimitive()
          Default constructor.
 
Method Summary
 boolean equals(java.lang.Object otherObject)
          Compares this object to the specified object.
 int getClassId()
          Returns the numeric id of this class.
 java.lang.String getClassName()
          Returns the text name of this class.
 ColorStyle getColor()
          Returns the value of m_color.
 LatLngCollection getLatLngs()
          Returns the LatLngCollection of coordinates of the Line.
 PointCollection getPoints()
          Returns the PointCollection of coordinates of the Line.
 PenStyle getStyle()
          Returns the value currently assigned to member data representing the style of this object.
 int getWidth()
          Returns the value currently assigned to member data representing the width of this object.
 int hashCode()
          Returns a hash code for this LinePrimitive.
 void init()
          Initializes object.
 void setColor(ColorStyle lColor)
          Sets the color.
 void setLatLngs(LatLngCollection ll)
          Sets the value of m_LLArray to the specified LatLng collection of coordinates of the Line.
 void setStyle(PenStyle nStyle)
          Sets the value of m_nStyle, which specifies the style of this object.
 void setWidth(int nWidth)
          Sets the value of m_nWidth, which specifies the width of this object.
 
Methods inherited from class com.mapquest.Primitive
getCoordinateType, getDrawTrigger, getKey, getOpacity, getTriggerDT, setCoordinateType, setDrawTrigger, setKey, setOpacity, setTriggerDT
 
Methods inherited from class com.mapquest.MQObject
clone, getFormat, getIdWithVersion, getNameWithVersion, getObjectVersion, getTypeId, getTypeName, getVerboseConsoleOutput, setFormat, setObjectVersion, setVerboseConsoleOutput, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

CLASS_ID

public static final int CLASS_ID
See Also:
Constant Field Values

CLASS_NAME

public static final java.lang.String CLASS_NAME
See Also:
Constant Field Values
Constructor Detail

LinePrimitive

public LinePrimitive()
Default constructor.

Method Detail

init

public void init()
Initializes object.

Overrides:
init in class Primitive

getClassId

public int getClassId()
Returns the numeric id of this class.

Overrides:
getClassId in class MQObject
Returns:
the numeric id of this class.

getClassName

public java.lang.String getClassName()
Returns the text name of this class.

Overrides:
getClassName in class MQObject
Returns:
the text name of this class.

setColor

public void setColor(ColorStyle lColor)
Sets the color.

Parameters:
lColor - The new color to be assigned to m_color

getColor

public ColorStyle getColor()
Returns the value of m_color.

Returns:
The current value for the color of this object

setStyle

public void setStyle(PenStyle nStyle)
Sets the value of m_nStyle, which specifies the style of this object.

Parameters:
nStyle - The new style value.

getStyle

public PenStyle getStyle()
Returns the value currently assigned to member data representing the style of this object.

Returns:
The value currently assigned to the member data representing the style of this object.

setWidth

public void setWidth(int nWidth)
Sets the value of m_nWidth, which specifies the width of this object.

Parameters:
nWidth - The new width value.

getWidth

public int getWidth()
Returns the value currently assigned to member data representing the width of this object.

Returns:
m_nWidth The value currently assigned to the member data representing the width of this object.

getPoints

public PointCollection getPoints()
Returns the PointCollection of coordinates of the Line.


getLatLngs

public LatLngCollection getLatLngs()
Returns the LatLngCollection of coordinates of the Line.


setLatLngs

public void setLatLngs(LatLngCollection ll)
Sets the value of m_LLArray to the specified LatLng collection of coordinates of the Line. Calls LatLngCollection.removeAll(). Calls LatLngCollection.append(MQObjectCollection).

Parameters:
ll - specified LatLng collection.
See Also:
MQObjectCollection.removeAll(), MQObjectCollection.append(MQObjectCollection)

equals

public boolean equals(java.lang.Object otherObject)
Compares this object to the specified object. The result is true if and only if the argument is not null and is a LinePrimitive object that has same attributes as this object.

Overrides:
equals in class Primitive
Parameters:
otherObject - the object to compare this LinePrimitive against.
Returns:
true if the LinePrimitive objects are equal; false otherwise.

hashCode

public int hashCode()
Returns a hash code for this LinePrimitive.

Overrides:
hashCode in class Primitive
Returns:
a hash code value for this LinePrimitive.