Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.base.stats.element
Class StringElement

java.lang.Object
  extended by com.jivesoftware.base.stats.Element
      extended by com.jivesoftware.base.stats.element.StringElement
All Implemented Interfaces:
java.lang.Comparable

public class StringElement
extends Element

An Element that wraps a String.


Constructor Summary
StringElement(java.lang.String str)
          Create a new StringElement
 
Method Summary
 int compareTo(java.lang.Object obj)
          Compare this StringElement to another object
 boolean equals(java.lang.Object obj)
          Compare this StringElement to another object
 Element getInstance(long n)
          Generates a new instance of InfiniteElement.
 java.lang.Object getValue()
          Returns the object this element wraps.
 int hashCode()
          Generate a hashCode for the StringElement so we can use them with hash tables.
 java.lang.Long toLong()
          Convert the embedded String to a Long.
 java.lang.String toString()
          Convert StringElement to a String
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StringElement

public StringElement(java.lang.String str)
Create a new StringElement

Parameters:
str - String to embed
Method Detail

getValue

public java.lang.Object getValue()
Returns the object this element wraps.

Specified by:
getValue in class Element
Returns:
the object this element wraps.

toLong

public java.lang.Long toLong()
Convert the embedded String to a Long. Always returns null.

Overrides:
toLong in class Element
Returns:
null because we converting the Strings to Longs is not allowed in this class.

toString

public java.lang.String toString()
Convert StringElement to a String

Overrides:
toString in class Element
Returns:
a String representation of this element's value.

getInstance

public Element getInstance(long n)
Generates a new instance of InfiniteElement. This is disallowed, so return null.

Specified by:
getInstance in class Element
Parameters:
n - a long this element should wrap.
Returns:
null since creating a new instance for this element is disallowed.

compareTo

public int compareTo(java.lang.Object obj)
Compare this StringElement to another object


equals

public boolean equals(java.lang.Object obj)
Compare this StringElement to another object

Overrides:
equals in class java.lang.Object
Returns:
true if the String wrapped in the other element equals the string in this class.

hashCode

public int hashCode()
Generate a hashCode for the StringElement so we can use them with hash tables.

Overrides:
hashCode in class java.lang.Object
Returns:
an int representing the hash value of this object.

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.