# Class: com.pnfsoftware.jeb.util.collect.IntGauge

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](ISegmentMap) may be better suited in terms of memory usage\). 

 Example:
 \- a range \[20, 100\] is specified
 \- calls to [record](#record(int, int)) 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()](#isComplete()) returns true

## Constructor: IntGauge
- parameter: `size`, type: `int`

Description: Create a gauge whose range goes from 0 to `size`. The range must be reasonably small \(recommendation: less than 1M\).
parameter: size: range end, exclusive

## Constructor: IntGauge
- parameter: `begin`, type: `int`
- parameter: `end`, type: `int`

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

## Method: clear

Description: Clear all recorded sub\-ranges.

## Method: equals
- parameter: `obj`, type: `java.lang.Object`
- return type: `boolean`


## Method: getBegin
- return type: `int`

Description: 
return: range begin, inclusive

## Method: getEnd
- return type: `int`

Description: 
return: range end, exclusive

## Method: getRemaining
- return type: `int`

Description: 
return: number of positions not yet recorded

## Method: hashCode
- return type: `int`


## Method: isComplete
- return type: `boolean`

Description: 
return: true if the whole range has been recorded

## Method: record
- parameter: `begin`, type: `int`
- parameter: `end`, type: `int`
- return type: `boolean`

Description: Record a filled sub\-range.
parameter: begin: sub\-range begin, inclusive
parameter: end: sub\-range end, exclusive
return: true if the sub\-range was recorded; false if it was invalid or overlapped existing         records

## Method: toString
- return type: `java.lang.String`


