Package org.jfree.data.statistics
Class SimpleHistogramBin
- java.lang.Object
-
- org.jfree.data.statistics.SimpleHistogramBin
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,java.lang.Comparable,PublicCloneable
public class SimpleHistogramBin extends java.lang.Object implements java.lang.Comparable, java.lang.Cloneable, PublicCloneable, java.io.Serializable
A bin for theSimpleHistogramDataset.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private booleanincludeLowerBoundA flag that controls whether the lower bound is included in the bin range.private booleanincludeUpperBoundA flag that controls whether the upper bound is included in the bin range.private intitemCountThe item count.private doublelowerBoundThe lower bound for the bin.private static longserialVersionUIDFor serialization.private doubleupperBoundThe upper bound for the bin.
-
Constructor Summary
Constructors Constructor Description SimpleHistogramBin(double lowerBound, double upperBound)Creates a new bin.SimpleHistogramBin(double lowerBound, double upperBound, boolean includeLowerBound, boolean includeUpperBound)Creates a new bin.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaccepts(double value)Returnstrueif the specified value belongs in the bin, andfalseotherwise.java.lang.Objectclone()Returns a clone of the bin.intcompareTo(java.lang.Object obj)Compares the bin to an arbitrary object and returns the relative ordering.booleanequals(java.lang.Object obj)Tests this bin for equality with an arbitrary object.intgetItemCount()Returns the item count.doublegetLowerBound()Returns the lower bound.doublegetUpperBound()Return the upper bound.booleanoverlapsWith(SimpleHistogramBin bin)Returnstrueif this bin overlaps with the specified bin, andfalseotherwise.voidsetItemCount(int count)Sets the item count.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
For serialization.- See Also:
- Constant Field Values
-
lowerBound
private double lowerBound
The lower bound for the bin.
-
upperBound
private double upperBound
The upper bound for the bin.
-
includeLowerBound
private boolean includeLowerBound
A flag that controls whether the lower bound is included in the bin range.
-
includeUpperBound
private boolean includeUpperBound
A flag that controls whether the upper bound is included in the bin range.
-
itemCount
private int itemCount
The item count.
-
-
Constructor Detail
-
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 Detail
-
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)
Returnstrueif the specified value belongs in the bin, andfalseotherwise.- Parameters:
value- the value.- Returns:
- A boolean.
-
overlapsWith
public boolean overlapsWith(SimpleHistogramBin bin)
Returnstrueif this bin overlaps with the specified bin, andfalseotherwise.- Parameters:
bin- the other bin (nullnot permitted).- Returns:
- A boolean.
-
compareTo
public int compareTo(java.lang.Object obj)
Compares the bin to an arbitrary object and returns the relative ordering.- Specified by:
compareToin interfacejava.lang.Comparable- Parameters:
obj- the object.- Returns:
- An integer indicating the relative ordering of the this bin and the given object.
-
equals
public boolean equals(java.lang.Object obj)
Tests this bin for equality with an arbitrary object.- Overrides:
equalsin classjava.lang.Object- Parameters:
obj- the object (nullpermitted).- Returns:
- A boolean.
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedExceptionReturns a clone of the bin.- Specified by:
clonein interfacePublicCloneable- Overrides:
clonein classjava.lang.Object- Returns:
- A clone.
- Throws:
java.lang.CloneNotSupportedException- not thrown by this class.
-
-