org.deegree.coverage.rangeset
Class SingleValue<T extends java.lang.Comparable<T>>

java.lang.Object
  extended by org.deegree.coverage.rangeset.SingleValue<T>
Type Parameters:
T - type of the value

public class SingleValue<T extends java.lang.Comparable<T>>
extends java.lang.Object

The SingleValue denotes a single typed value in a range set.

Version:
$Revision: 19041 $, $Date: 2009-08-11 17:04:57 +0200 (Di, 11 Aug 2009) $
Author:
Rutger Bezema, last edited by: $Author: rbezema $

Field Summary
 ValueType type
          the type
 T value
          the value
 
Constructor Summary
SingleValue(ValueType type, T value)
           
 
Method Summary
static SingleValue<?> createFromString(java.lang.String type, java.lang.String value)
           
static SingleValue<?> createFromValue(java.lang.String type, java.lang.Number value)
           
 boolean equals(java.lang.Object other)
           
 int hashCode()
          Implementation as proposed by Joshua Block in Effective Java (Addison-Wesley 2001), which supplies an even distribution and is relatively fast.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

value

public final T extends java.lang.Comparable<T> value
the value


type

public final ValueType type
the type

Constructor Detail

SingleValue

public SingleValue(ValueType type,
                   T value)
Parameters:
type - describing the type of the value.
value - the actual value
Method Detail

equals

public boolean equals(java.lang.Object other)
Overrides:
equals in class java.lang.Object
Parameters:
other - to test against
Returns:
true if the given singlevalue matches this one, e.g. the value and types are equal.

hashCode

public int hashCode()
Implementation as proposed by Joshua Block in Effective Java (Addison-Wesley 2001), which supplies an even distribution and is relatively fast. It is created from field f as follows:

Combining the hash code(s) computed above: result = 37 * result + code;

Overrides:
hashCode in class java.lang.Object
Returns:
(int) ( result >>> 32 ) ^ (int) result;
See Also:
Object.hashCode()

createFromValue

public static SingleValue<?> createFromValue(java.lang.String type,
                                             java.lang.Number value)
                                      throws java.lang.NumberFormatException
Parameters:
type -
value -
Returns:
the typed SingleValue.
Throws:
java.lang.NumberFormatException

createFromString

public static SingleValue<?> createFromString(java.lang.String type,
                                              java.lang.String value)
                                       throws java.lang.NumberFormatException
Parameters:
type -
value -
Returns:
the typed SingleValue.
Throws:
java.lang.NumberFormatException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2011. All Rights Reserved.