@Test public void testOverlapsWidth() { SimpleHistogramBin b1 = new SimpleHistogramBin(1.0, 2.0); SimpleHistogramBin b2 = new SimpleHistogramBin(2.0, 3.0); SimpleHistogramBin b3 = new SimpleHistogramBin(3.0, 4.0); SimpleHistogramBin b4 = new SimpleHistogramBin(0.0, 5.0); SimpleHistogramBin b5 = new SimpleHistogramBin(2.0, 3.0, false, true); SimpleHistogramBin b6 = new SimpleHistogramBin(2.0, 3.0, true, false); assertTrue(b1.overlapsWith(b2)); assertTrue(b2.overlapsWith(b1)); assertFalse(b1.overlapsWith(b3)); assertFalse(b3.overlapsWith(b1)); assertTrue(b1.overlapsWith(b4)); assertTrue(b4.overlapsWith(b1)); assertFalse(b1.overlapsWith(b5)); assertFalse(b5.overlapsWith(b1)); assertTrue(b1.overlapsWith(b6)); assertTrue(b6.overlapsWith(b1)); }
public boolean overlapsWith(SimpleHistogramBin bin) { if (this.upperBound < bin.lowerBound) { return false; } if (this.lowerBound > bin.upperBound) { return false; } if (this.upperBound == bin.lowerBound) { return this.includeUpperBound && bin.includeLowerBound; } if (this.lowerBound == bin.upperBound) { return this.includeLowerBound && bin.includeUpperBound; } return true; }
SimpleHistogramBin implements Comparable,
        Cloneable, PublicCloneable, Serializable { public boolean overlapsWith(SimpleHistogramBin bin) { if (this.upperBound < bin.lowerBound) { return false; } if (this.lowerBound > bin.upperBound) { return false; } if (this.upperBound == bin.lowerBound) { return this.includeUpperBound && bin.includeLowerBound; } if (this.lowerBound == bin.upperBound) { return this.includeLowerBound && bin.includeUpperBound; } return true; } }
SimpleHistogramBin implements Comparable,
        Cloneable, PublicCloneable, Serializable { public boolean overlapsWith(SimpleHistogramBin bin) { if (this.upperBound < bin.lowerBound) { return false; } if (this.lowerBound > bin.upperBound) { return false; } if (this.upperBound == bin.lowerBound) { return this.includeUpperBound && bin.includeLowerBound; } if (this.lowerBound == bin.upperBound) { return this.includeLowerBound && bin.includeUpperBound; } return true; } SimpleHistogramBin(double lowerBound, double upperBound);  SimpleHistogramBin(double lowerBound, double upperBound,
                              boolean includeLowerBound,
                              boolean includeUpperBound); }
SimpleHistogramBin implements Comparable,
        Cloneable, PublicCloneable, Serializable { public boolean overlapsWith(SimpleHistogramBin bin) { if (this.upperBound < bin.lowerBound) { return false; } if (this.lowerBound > bin.upperBound) { return false; } if (this.upperBound == bin.lowerBound) { return this.includeUpperBound && bin.includeLowerBound; } if (this.lowerBound == bin.upperBound) { return this.includeLowerBound && bin.includeUpperBound; } return true; } SimpleHistogramBin(double lowerBound, double upperBound);  SimpleHistogramBin(double lowerBound, double upperBound,
                              boolean includeLowerBound,
                              boolean includeUpperBound); double getLowerBound(); double getUpperBound(); int getItemCount(); void setItemCount(int count); boolean accepts(double value); boolean overlapsWith(SimpleHistogramBin bin); @Override int compareTo(Object obj); @Override boolean equals(Object obj); @Override Object clone(); }
SimpleHistogramBin implements Comparable,
        Cloneable, PublicCloneable, Serializable { public boolean overlapsWith(SimpleHistogramBin bin) { if (this.upperBound < bin.lowerBound) { return false; } if (this.lowerBound > bin.upperBound) { return false; } if (this.upperBound == bin.lowerBound) { return this.includeUpperBound && bin.includeLowerBound; } if (this.lowerBound == bin.upperBound) { return this.includeLowerBound && bin.includeUpperBound; } return true; } SimpleHistogramBin(double lowerBound, double upperBound);  SimpleHistogramBin(double lowerBound, double upperBound,
                              boolean includeLowerBound,
                              boolean includeUpperBound); double getLowerBound(); double getUpperBound(); int getItemCount(); void setItemCount(int count); boolean accepts(double value); boolean overlapsWith(SimpleHistogramBin bin); @Override int compareTo(Object obj); @Override boolean equals(Object obj); @Override Object clone();  }