Package org.eclipse.mat.parser.index

# Class IndexWriter.IntIndexCollector

java.lang.Object
org.eclipse.mat.parser.index.IndexWriter.IntIndexCollector

All Implemented Interfaces:
  `IIndexReader`, `IIndexReader.IOne2OneIndex`

Enclosing class:
  IndexWriter

public static class IndexWriter.IntIndexCollector extends Object implements IIndexReader.IOne2OneIndex
A collector of ArrayIntCompressed.

## Nested Class Summary

## Nested classes/interfaces inherited from interface org.eclipse.mat.parser.index.IIndexReader

`IIndexReader.IOne2LongIndex, IIndexReader.IOne2ManyIndex, IIndexReader.IOne2ManyObjectsIndex, IIndexReader.IOne2OneIndex, IIndexReader.IOne2SizeIndex`

## Constructor Summary

Constructors
Constructor
Description
`IntIndexCollector(int size, int mostSignificantBit)`
Construct a collector of the required size, holding int values up to the specified size.

## Method Summary

Modifier and Type
Method
Description
`void`
`close()`
Close the backing file.
`void`
`delete()`
Delete the backing file.
`int`
`get(int index)`
Look up an int in the underlying index
`int[]`
`getAll(int[] index)`
Look up all the items from the index array and return the version in the index
`int[]`
`getNext(int index, int length)`
Look up all the items from the index from index to index + length - 1 and return the result in the index for each on
`IteratorInt`
`iterator()`
`void`
`set(int index, int value)`
`int`
`size()`
Size of the index
`void`
`unload()`
Clear the caches.
`IIndexReader.IOne2OneIndex`
`writeTo(DataOutputStream out, long position)`
`IIndexReader.IOne2OneIndex`
`writeTo(File indexFile)`
Write the collector to a file.

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### IntIndexCollector

public IntIndexCollector(int size, int mostSignificantBit)
Construct a collector of the required size, holding int values up to the specified size.

Parameters:
  `size` - the number of entries
  `mostSignificantBit` - the most significant bit set of any entry

## Method Details

### writeTo

public IIndexReader.IOne2OneIndex writeTo(File indexFile) throws IOException
Write the collector to a file.

Parameters:
  `indexFile` - the file
Returns:
  an index which holds the same values as the collector
Throws:
  `IOException` - if a problem occurred with the write

### writeTo

public IIndexReader.IOne2OneIndex writeTo(DataOutputStream out, long position) throws IOException

Throws:
  `IOException`

### set

public void set(int index, int value)

### get

public int get(int index)
Description copied from interface: `IIndexReader.IOne2OneIndex`
Look up an int in the underlying index

Specified by:
  `get` in interface `IIndexReader.IOne2OneIndex`
Parameters:
  `index` - the int key
Returns:
  the int value

### close

public void close() throws IOException
Description copied from interface: `IIndexReader`
Close the backing file.

Specified by:
  `close` in interface `IIndexReader`
Throws:
  `IOException`

### delete

public void delete()
Description copied from interface: `IIndexReader`
Delete the backing file.

Specified by:
  `delete` in interface `IIndexReader`

### size

public int size()
Description copied from interface: `IIndexReader`
Size of the index

Specified by:
  `size` in interface `IIndexReader`
Returns:
  number of entries

### unload

public void unload()
Description copied from interface: `IIndexReader`
Clear the caches. Used when the indexes are not current in use and the memory needs to be reclaimed such as when building the dominator tree.

Specified by:
  `unload` in interface `IIndexReader`

### getAll

public int[] getAll(int[] index)
Description copied from interface: `IIndexReader.IOne2OneIndex`
Look up all the items from the index array and return the version in the index

Specified by:
  `getAll` in interface `IIndexReader.IOne2OneIndex`
Parameters:
  `index` - an array of items to look up
Returns:
  an array of the result items

### getNext

public int[] getNext(int index, int length)
Description copied from interface: `IIndexReader.IOne2OneIndex`
Look up all the items from the index from index to index + length - 1 and return the result in the index for each on

Specified by:
  `getNext` in interface `IIndexReader.IOne2OneIndex`
Parameters:
  `index` - the start index
  `length` - the number of consecutive items to look up
Returns:
  an array of the result items

### iterator

public IteratorInt iterator()