org.gwtopenmaps.openlayers.client.util
Class Attributes

java.lang.Object
  extended by org.gwtopenmaps.openlayers.client.util.JSObjectWrapper
      extended by 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
  Attributes()
           
protected Attributes(JSObject jsObject)
           
 
Method Summary
 boolean getAttributeAsBoolean(String name)
          Get the value of an attribute as a boolean.
 double getAttributeAsDouble(String name)
          Get the value of an attribute as a double.
 float getAttributeAsFloat(String name)
          Get the value of an attribute as a float.
 int getAttributeAsInt(String name)
          Get the value of an attribute as an integer.
 String getAttributeAsString(String name)
          Get the value of an attribute as a String
 Attributes getAttributes(String name)
          Get a nested attribute object.
static Attributes narrowToAttributes(JSObject attributes)
           
 void setAttribute(String name, Attributes attributes)
          Allows nesting attribute objects.
 void setAttribute(String name, boolean value)
          Sets a boolean value to the arbitrary attribute.
 void setAttribute(String name, double value)
          Sets a double value to the arbitrary attribute.
 void setAttribute(String name, float value)
          Sets a float value to the arbitrary attribute.
 void setAttribute(String name, int value)
          Sets an integer value to the arbitrary attribute.
 void setAttribute(String name, long value)
          Sets a long value to the arbitrary attribute.
 void setAttribute(String name, String value)
          Sets a String value to the arbitrary attribute.
 
Methods inherited from class org.gwtopenmaps.openlayers.client.util.JSObjectWrapper
getJSObject, setJSObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Attributes

public Attributes()

Attributes

protected Attributes(JSObject jsObject)
Method Detail

narrowToAttributes

public static Attributes narrowToAttributes(JSObject attributes)

setAttribute

public void setAttribute(String name,
                         String value)
Sets a String value to the arbitrary attribute.

Parameters:
name - - Name of the attribute
value - - String value of the attribute

setAttribute

public void setAttribute(String name,
                         int value)
Sets an integer value to the arbitrary attribute.

Parameters:
name - - Name of the attribute
value - - Integer value of the attribute

setAttribute

public void setAttribute(String name,
                         long value)
Sets a long value to the arbitrary attribute.

Parameters:
name - - Name of the attribute
value - - Long value of the attribute

setAttribute

public void setAttribute(String name,
                         boolean value)
Sets a boolean value to the arbitrary attribute.

Parameters:
name - Name of the attribute
value - Value of the attribute

setAttribute

public void setAttribute(String name,
                         float value)
Sets a float value to the arbitrary attribute.

Parameters:
name - - Name of the attribute
value - - Value of the attribute

setAttribute

public void setAttribute(String name,
                         double value)
Sets a double value to the arbitrary attribute.

Parameters:
name - - Name of the attribute
value - - Value of the attribute

setAttribute

public void setAttribute(String name,
                         Attributes attributes)
Allows nesting attribute objects.


getAttributeAsString

public String getAttributeAsString(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(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(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(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(String name)
Get the value of an attribute as a double.

Parameters:
name - - name of the attribute
Returns:
the attribute as double

getAttributes

public Attributes getAttributes(String name)
Get a nested attribute object.

Parameters:
name - - name of the attribute holding the attributes object
Returns:
nested attributes object


Copyright © 2011 sourceforge. All Rights Reserved.