Package org.jfree.data.statistics
Class SimpleHistogramBin
java.lang.Object
org.jfree.data.statistics.SimpleHistogramBin
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparable
,PublicCloneable
public class SimpleHistogramBin
extends Object
implements Comparable, Cloneable, PublicCloneable, Serializable
A bin for the
SimpleHistogramDataset
.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
A flag that controls whether the lower bound is included in the bin range.private boolean
A flag that controls whether the upper bound is included in the bin range.private int
The item count.private double
The lower bound for the bin.private static final long
For serialization.private double
The upper bound for the bin. -
Constructor Summary
ConstructorsConstructorDescriptionSimpleHistogramBin
(double lowerBound, double upperBound) Creates a new bin.SimpleHistogramBin
(double lowerBound, double upperBound, boolean includeLowerBound, boolean includeUpperBound) Creates a new bin. -
Method Summary
Modifier and TypeMethodDescriptionboolean
accepts
(double value) Returnstrue
if the specified value belongs in the bin, andfalse
otherwise.clone()
Returns a clone of the bin.int
Compares the bin to an arbitrary object and returns the relative ordering.boolean
Tests this bin for equality with an arbitrary object.int
Returns the item count.double
Returns the lower bound.double
Return the upper bound.boolean
Returnstrue
if this bin overlaps with the specified bin, andfalse
otherwise.void
setItemCount
(int count) Sets the item count.
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDFor serialization.- See Also:
-
lowerBound
private double lowerBoundThe lower bound for the bin. -
upperBound
private double upperBoundThe upper bound for the bin. -
includeLowerBound
private boolean includeLowerBoundA flag that controls whether the lower bound is included in the bin range. -
includeUpperBound
private boolean includeUpperBoundA flag that controls whether the upper bound is included in the bin range. -
itemCount
private int itemCountThe item count.
-
-
Constructor Details
-
SimpleHistogramBin
public SimpleHistogramBin(double lowerBound, double upperBound) Creates a new bin.- Parameters:
lowerBound
- the lower bound (inclusive).upperBound
- the upper bound (inclusive);
-
SimpleHistogramBin
public SimpleHistogramBin(double lowerBound, double upperBound, boolean includeLowerBound, boolean includeUpperBound) Creates a new bin.- Parameters:
lowerBound
- the lower bound.upperBound
- the upper bound.includeLowerBound
- include the lower bound?includeUpperBound
- include the upper bound?
-
-
Method Details
-
getLowerBound
public double getLowerBound()Returns the lower bound.- Returns:
- The lower bound.
-
getUpperBound
public double getUpperBound()Return the upper bound.- Returns:
- The upper bound.
-
getItemCount
public int getItemCount()Returns the item count.- Returns:
- The item count.
-
setItemCount
public void setItemCount(int count) Sets the item count.- Parameters:
count
- the item count.
-
accepts
public boolean accepts(double value) Returnstrue
if the specified value belongs in the bin, andfalse
otherwise.- Parameters:
value
- the value.- Returns:
- A boolean.
-
overlapsWith
Returnstrue
if this bin overlaps with the specified bin, andfalse
otherwise.- Parameters:
bin
- the other bin (null
not permitted).- Returns:
- A boolean.
-
compareTo
Compares the bin to an arbitrary object and returns the relative ordering.- Specified by:
compareTo
in interfaceComparable
- Parameters:
obj
- the object.- Returns:
- An integer indicating the relative ordering of the this bin and the given object.
-
equals
Tests this bin for equality with an arbitrary object. -
clone
Returns a clone of the bin.- Specified by:
clone
in interfacePublicCloneable
- Overrides:
clone
in classObject
- Returns:
- A clone.
- Throws:
CloneNotSupportedException
- not thrown by this class.
-