public class

VectorElement

extends Object
java.lang.Object
   ↳ com.carto.vectorelements.VectorElement
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

A base class for all vector elements (points, lines, texts, models, etc).

Summary

Public Methods
boolean containsMetaDataKey(String key)
Returns true if the specified key exists in the vector element meta data map.
synchronized void delete()
boolean equals(Object obj)
Checks if this object is equal to the specified object.
MapBounds getBounds()
Returns the bounds of this vector element.
Geometry getGeometry()
Returns the geometry object that defines the location of this vector element.
long getId()
Returns the internal id of this vector element.
StringVariantMap getMetaData()
Returns a copy of the vector element meta data map.
Variant getMetaDataElement(String key)
Returns a meta data element corresponding to the key.
int hashCode()
Returns the hash value of this object.
boolean isVisible()
Returns the state of the visibility flag of this vector element.
void notifyElementChanged()
Notifies this vector element's datasource about the change in this element.
void setId(long id)
Sets the internal id for this vector element.
void setMetaData(StringVariantMap metaData)
Sets a new meta data map for the vector element.
void setMetaDataElement(String key, Variant element)
Adds a new key-value pair to the meta data map.
void setVisible(boolean visible)
Sets the state of the visibility flag for this vector element.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public boolean containsMetaDataKey (String key)

Returns true if the specified key exists in the vector element meta data map.

Parameters
key The key to check.
Returns
  • True if the vector element meta data element exists.

public synchronized void delete ()

public boolean equals (Object obj)

Checks if this object is equal to the specified object.

Parameters
obj The reference object.
Returns
  • True when objects are equal, false otherwise.

public MapBounds getBounds ()

Returns the bounds of this vector element.

Returns
  • The bounds of this vector element.

public Geometry getGeometry ()

Returns the geometry object that defines the location of this vector element.

Returns
  • The geometry object of this vector element.

public long getId ()

Returns the internal id of this vector element.

Returns
  • The internal id of this vector element.

public StringVariantMap getMetaData ()

Returns a copy of the vector element meta data map. The changes you make to this map are NOT reflected in the actual meta data of the element.

Returns
  • A copy of the vector element meta data map.

public Variant getMetaDataElement (String key)

Returns a meta data element corresponding to the key. If no value is found null variant is returned.

Parameters
key The key to use.
Returns
  • The value corresponding to the key from the meta data map. If the key does not exists, empty variant is returned.

public int hashCode ()

Returns the hash value of this object.

Returns
  • The hash value of this object.

public boolean isVisible ()

Returns the state of the visibility flag of this vector element.

Returns
  • True if this vector element is visible.

public void notifyElementChanged ()

Notifies this vector element's datasource about the change in this element.
The data source may then notify the layer to update the view.

public void setId (long id)

Sets the internal id for this vector element. The id is used for internal caching, and
should not be changed by the user. User id can added to meta data as a key-value pair.

Parameters
id The new internal id for this vector element.

public void setMetaData (StringVariantMap metaData)

Sets a new meta data map for the vector element. Old meta data values will be lost.

Parameters
metaData The new meta data map for this vector element.

public void setMetaDataElement (String key, Variant element)

Adds a new key-value pair to the meta data map. If the key already exists in the map,
it's value will be replaced by the new value.

Parameters
key The new key.
element The new value.

public void setVisible (boolean visible)

Sets the state of the visibility flag for this vector element. If set to false the element will not be
drawn.

Parameters
visible The new state of the visibility flag for the vector element.