Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.base.stats.bin
Class SingleElementBin

java.lang.Object
  extended by com.jivesoftware.base.stats.Bin
      extended by com.jivesoftware.base.stats.bin.SingleElementBin
All Implemented Interfaces:
java.lang.Comparable

public class SingleElementBin
extends Bin

SingleElementBin is a Bin that contains a single element. Most of the Bin functions are passed through to the element.


Constructor Summary
SingleElementBin(Element element)
          Creates new SingleElementBin that wraps the given element
 
Method Summary
 int compareTo(java.lang.Object o)
          Compare this bin to the given object (assumed to be another bin).
 boolean contains(Bin b)
          See if this bin contains the given bin.
 boolean contains(Element e)
          See if this bin contains the given element.
 boolean containsBegin()
          A SingleElementBin behaves like a ClosedInterval with begin = end.
 boolean containsEnd()
          A SingleElementBin behaves like a ClosedInterval with begin = end.
 boolean equals(java.lang.Object o)
          Test whether this bin equals the given object
 Element getBegin()
          Get the first element in this bin (the embedded element)
 Element getEnd()
          Get the last element in this bin (the embedded element)
 int hashCode()
          Return a suitable hashcode so that this bin can be used in a HashMap
 java.lang.String toString()
          Convert the Bin to a string using the element's toString() method.
 
Methods inherited from class com.jivesoftware.base.stats.Bin
getProperty, setProperty
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SingleElementBin

public SingleElementBin(Element element)
Creates new SingleElementBin that wraps the given element

Method Detail

toString

public java.lang.String toString()
Convert the Bin to a string using the element's toString() method.

Specified by:
toString in class Bin
See Also:
Object.toString()

contains

public boolean contains(Bin b)
See if this bin contains the given bin.

Specified by:
contains in class Bin
Parameters:
b - the Bin to compare this object with.
Returns:
true if this Bin contains the given Bin, false otherwise.

contains

public boolean contains(Element e)
See if this bin contains the given element.

Specified by:
contains in class Bin

compareTo

public int compareTo(java.lang.Object o)
Compare this bin to the given object (assumed to be another bin).

Specified by:
compareTo in interface java.lang.Comparable
Specified by:
compareTo in class Bin
Returns:
-1 if this < o, 0 if this.equals(o), 1 if this > o
See Also:
Comparable.compareTo(java.lang.Object)

getBegin

public Element getBegin()
Get the first element in this bin (the embedded element)

Specified by:
getBegin in class Bin

containsBegin

public boolean containsBegin()
A SingleElementBin behaves like a ClosedInterval with begin = end. Hence containsBegin() always returns true

Specified by:
containsBegin in class Bin

getEnd

public Element getEnd()
Get the last element in this bin (the embedded element)

Specified by:
getEnd in class Bin

containsEnd

public boolean containsEnd()
A SingleElementBin behaves like a ClosedInterval with begin = end. Hence containsEnd() always returns true

Specified by:
containsEnd in class Bin

hashCode

public int hashCode()
Return a suitable hashcode so that this bin can be used in a HashMap

Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Test whether this bin equals the given object

Overrides:
equals in class java.lang.Object

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.