public class

IntGauge

extends Object
java.lang.Object
   ↳ com.pnfsoftware.jeb.util.collect.IntGauge

Class Overview

An integer gauge is used to define an integer range to be filled. The range must be reasonably small (for larger ranges (million+), a custom implementation relying ISegmentMap may be better suited in terms of memory usage).

Example:
- a range [20, 100] is specified
- calls to record may be used to record partial filling of the gauge:
record(10, 30), record(56, 60), record(0, 10)
- the order of the fillings does not matter; however, overlaps are not allowed:
e.g. if the sub-range [10,30[ was recorded and is present, adding a range [25,40[ would be rejected (record() would return false)
- when the gauge is complete, isComplete() returns true

Summary

Public Constructors
IntGauge(int size)
Create a gauge whose range goes from 0 to size.
IntGauge(int begin, int end)
Create a gauge whose range goes from begin to end (exclusive).
Public Methods
void clear()
boolean equals(Object obj)
int getBegin()
int getEnd()
int getRemaining()
int hashCode()
boolean isComplete()
boolean record(int begin, int end)
String toString()
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public IntGauge (int size)

Create a gauge whose range goes from 0 to size. The range must be reasonably small (recommendation: less than 1M).

public IntGauge (int begin, int end)

Create a gauge whose range goes from begin to end (exclusive). The range must be reasonably small (recommendation: less than 1M).

Public Methods

public void clear ()

public boolean equals (Object obj)

public int getBegin ()

public int getEnd ()

public int getRemaining ()

public int hashCode ()

public boolean isComplete ()

public boolean record (int begin, int end)

public String toString ()