Class Attributes
java.lang.Object
org.gwtopenmaps.openlayers.client.util.JSObjectWrapper
org.gwtopenmaps.openlayers.client.util.Attributes
public class Attributes extends JSObjectWrapper
Class to hold arbitrary attributes. More constrained than JSObject.
- Author:
- Rafael Ceravolo - LOGANN
-
Constructor Summary
Constructors Modifier Constructor Description Attributes()
protected
Attributes(JSObject jsObject)
-
Method Summary
Modifier and Type Method Description boolean
getAttributeAsBoolean(java.lang.String name)
Get the value of an attribute as a boolean.double
getAttributeAsDouble(java.lang.String name)
Get the value of an attribute as a double.float
getAttributeAsFloat(java.lang.String name)
Get the value of an attribute as a float.int
getAttributeAsInt(java.lang.String name)
Get the value of an attribute as an integer.java.lang.String
getAttributeAsString(java.lang.String name)
Get the value of an attribute as a Stringjava.util.List<java.lang.String>
getAttributeNames()
Gets all the names of the attributes.Attributes
getAttributes(java.lang.String name)
Get a nested attribute object.java.util.List<java.lang.String>
getAttributeValues()
Gets all the values of the attributes.static Attributes
narrowToAttributes(JSObject attributes)
void
setAttribute(java.lang.String name, boolean value)
Sets a boolean value to the arbitrary attribute.void
setAttribute(java.lang.String name, double value)
Sets a double value to the arbitrary attribute.void
setAttribute(java.lang.String name, float value)
Sets a float value to the arbitrary attribute.void
setAttribute(java.lang.String name, int value)
Sets an integer value to the arbitrary attribute.void
setAttribute(java.lang.String name, long value)
Sets a long value to the arbitrary attribute.void
setAttribute(java.lang.String name, java.lang.String value)
Sets a String value to the arbitrary attribute.void
setAttribute(java.lang.String name, Attributes attributes)
Allows nesting attribute objects.void
unsetAttribute(java.lang.String name)
Unset/Clear the property with the given name.Methods inherited from class org.gwtopenmaps.openlayers.client.util.JSObjectWrapper
getJSObject, setJSObject
-
Constructor Details
-
Attributes
public Attributes() -
Attributes
-
-
Method Details
-
narrowToAttributes
-
unsetAttribute
public void unsetAttribute(java.lang.String name)Unset/Clear the property with the given name. Uses the javascript operator delete- Parameters:
name
- - Name of the attribute
-
setAttribute
public void setAttribute(java.lang.String name, java.lang.String value)Sets a String value to the arbitrary attribute.- Parameters:
name
- - Name of the attributevalue
- - String value of the attribute
-
setAttribute
public void setAttribute(java.lang.String name, int value)Sets an integer value to the arbitrary attribute.- Parameters:
name
- - Name of the attributevalue
- - Integer value of the attribute
-
setAttribute
public void setAttribute(java.lang.String name, long value)Sets a long value to the arbitrary attribute.- Parameters:
name
- - Name of the attributevalue
- - Long value of the attribute
-
setAttribute
public void setAttribute(java.lang.String name, boolean value)Sets a boolean value to the arbitrary attribute.- Parameters:
name
- Name of the attributevalue
- Value of the attribute
-
setAttribute
public void setAttribute(java.lang.String name, float value)Sets a float value to the arbitrary attribute.- Parameters:
name
- - Name of the attributevalue
- - Value of the attribute
-
setAttribute
public void setAttribute(java.lang.String name, double value)Sets a double value to the arbitrary attribute.- Parameters:
name
- - Name of the attributevalue
- - Value of the attribute
-
setAttribute
Allows nesting attribute objects. -
getAttributeAsString
public java.lang.String getAttributeAsString(java.lang.String name)Get the value of an attribute as a String- Parameters:
name
- - name of the attribute- Returns:
- the attribute as String
-
getAttributeAsInt
public int getAttributeAsInt(java.lang.String name)Get the value of an attribute as an integer.- Parameters:
name
- - name of the attribute- Returns:
- the attribute as integer
-
getAttributeAsBoolean
public boolean getAttributeAsBoolean(java.lang.String name)Get the value of an attribute as a boolean.- Parameters:
name
- - name of the attribute- Returns:
- the attribute as boolean
-
getAttributeAsFloat
public float getAttributeAsFloat(java.lang.String name)Get the value of an attribute as a float.- Parameters:
name
- - name of the attribute- Returns:
- the attribute as float
-
getAttributeAsDouble
public double getAttributeAsDouble(java.lang.String name)Get the value of an attribute as a double.- Parameters:
name
- - name of the attribute- Returns:
- the attribute as double
-
getAttributes
Get a nested attribute object.- Parameters:
name
- - name of the attribute holding the attributes object- Returns:
- nested attributes object
-
getAttributeNames
public java.util.List<java.lang.String> getAttributeNames()Gets all the names of the attributes.- Returns:
- The names of all attributes.
-
getAttributeValues
public java.util.List<java.lang.String> getAttributeValues()Gets all the values of the attributes.- Returns:
- The names of all attributes.
-