JBoss port of sunxacml 2.0.8.Final-redhat-1

org.jboss.security.xacml.sunxacml.attr
Class DoubleAttribute

java.lang.Object
  extended by org.jboss.security.xacml.sunxacml.attr.AttributeValue
      extended by org.jboss.security.xacml.sunxacml.attr.DoubleAttribute
All Implemented Interfaces:
Evaluatable, Expression

public class DoubleAttribute
extends AttributeValue

Representation of an xsi:double value. This class supports parsing xsi:double values. All objects of this class are immutable and all methods of the class are thread-safe.

Since:
1.0
Author:
Marco Barreno, Seth Proctor, Steve Hanna

Field Summary
static String identifier
          Official name of this type
 
Constructor Summary
DoubleAttribute(double value)
          Creates a new DoubleAttribute that represents the double value supplied.
 
Method Summary
 String encode()
          Encodes the value in a form suitable for including in XML data like a request or an obligation.
 boolean equals(Object o)
          Returns true if the input is an instance of this class and if its value equals the value contained in this class.
static DoubleAttribute getInstance(Node root)
          Returns a new DoubleAttribute that represents the xsi:double at a particular DOM node.
static DoubleAttribute getInstance(String value)
          Returns a new DoubleAttribute that represents the xsi:double value indicated by the string provided.
 Double getValue()
          Returns the double value represented by this object.
 int hashCode()
          Returns the hashcode value used to index and compare this object with others of the same type.
 
Methods inherited from class org.jboss.security.xacml.sunxacml.attr.AttributeValue
encode, encode, encodeWithTags, evaluate, evaluatesToBag, getChildren, getType, isBag, returnsBag
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

identifier

public static final String identifier
Official name of this type

See Also:
Constant Field Values
Constructor Detail

DoubleAttribute

public DoubleAttribute(double value)
Creates a new DoubleAttribute that represents the double value supplied.

Parameters:
value - the double value to be represented
Method Detail

getInstance

public static DoubleAttribute getInstance(Node root)
                                   throws NumberFormatException
Returns a new DoubleAttribute that represents the xsi:double at a particular DOM node.

Parameters:
root - the Node that contains the desired value
Returns:
a new DoubleAttribute representing the appropriate value (null if there is a parsing error)
Throws:
NumberFormatException - if the string form is not a double

getInstance

public static DoubleAttribute getInstance(String value)
Returns a new DoubleAttribute that represents the xsi:double value indicated by the string provided.

Parameters:
value - a string representing the desired value
Returns:
a new DoubleAttribute representing the desired value (null if there is a parsing error)
Throws:
NumberFormatException - if the value is not a double

getValue

public Double getValue()
Returns the double value represented by this object.

Specified by:
getValue in class AttributeValue
Returns:
the double value

equals

public boolean equals(Object o)
Returns true if the input is an instance of this class and if its value equals the value contained in this class.

Overrides:
equals in class Object
Parameters:
o - the object to compare
Returns:
true if this object and the input represent the same value

hashCode

public int hashCode()
Returns the hashcode value used to index and compare this object with others of the same type. Typically this is the hashcode of the backing data object.

Overrides:
hashCode in class Object
Returns:
the object's hashcode value

encode

public String encode()
Description copied from class: AttributeValue
Encodes the value in a form suitable for including in XML data like a request or an obligation. This must return a value that could in turn be used by the factory to create a new instance with the same value.

Specified by:
encode in class AttributeValue
Returns:
a String form of the value

JBoss port of sunxacml 2.0.8.Final-redhat-1

Copyright © 2012 JBoss by Red Hat. All Rights Reserved.