org.deegree.commons.tom.ows
Class StringOrRef
java.lang.Object
org.deegree.commons.tom.ows.StringOrRef
- All Implemented Interfaces:
- TypedObjectNode
public class StringOrRef
- extends java.lang.Object
- implements TypedObjectNode
A simple text description or a reference to an external description.
- Version:
- $Revision: 25171 $, $Date: 2010-07-05 16:21:54 +0200 (Mo, 05. Jul 2010) $
- Author:
- Markus Schneider, last edited by: $Author: aschmitz $
Constructor Summary |
StringOrRef(java.lang.String s,
java.lang.String ref)
|
Method Summary |
boolean |
equals(java.lang.Object o)
|
java.lang.String |
getRef()
|
java.lang.String |
getString()
|
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 |
StringOrRef
public StringOrRef(java.lang.String s,
java.lang.String ref)
- Parameters:
s
- ref
-
getString
public java.lang.String getString()
- Returns:
- the string
getRef
public java.lang.String getRef()
- Returns:
- the ref
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in class java.lang.Object
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:
- boolean -- code = (f ? 0 : 1)
- byte, char, short, int -- code = (int)f
- long -- code = (int)(f ^ (f >>>32))
- float -- code = Float.floatToIntBits(f);
- double -- long l = Double.doubleToLongBits(f); code = (int)(l ^ (l >>> 32))
- all Objects, (where equals( ) calls equals( ) for this field) -- code = f.hashCode( )
- Array -- Apply above rules to each element
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()
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
Copyright © 2011. All Rights Reserved.