Package org.eclipse.mat.parser.index

## Class IndexWriter.IntArray1NWriter

- java.lang.Object
- - org.eclipse.mat.parser.index.IndexWriter.IntArray1NWriter

Direct Known Subclasses:
  `IndexWriter.IntArray1NSortedWriter`

Enclosing class:
  IndexWriter

    public static class IndexWriter.IntArray1NWriter
    extends java.lang.Object

Write out a mapping of ints to int arrays.

### Constructor Summary

Constructors
`IntArray1NWriter​(int size, java.io.File indexFile)` Construct a writer of the required size.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `cancel()` Terminate the IntArray1NWriter and delete any file which has been written so far.
`IIndexReader.IOne2ManyIndex` `flush()` Finishes writing out everything
`java.io.File` `getIndexFile()` Get the index file.
`void` `log​(int index, int[] values)` must not contain duplicates!
`void` `log​(int index, ArrayInt references)` must not contain duplicates!
`void` `log​(IIndexReader.IOne2LongIndex identifier, int index, ArrayLong references)` Used to record the addresses as IDs.
`void` `log​(IndexWriter.Identifier identifier, int index, ArrayLong references)` Used to record the addresses as IDs.

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

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

### Constructor Detail

#### IntArray1NWriter

    public IntArray1NWriter​(int size,
                            java.io.File indexFile)
                     throws java.io.IOException

Construct a writer of the required size.

Parameters:
  `size` - the number of entries
  `indexFile` - the file to be written to
Throws:
  `java.io.IOException` - if there is a problem writing the file

### Method Detail

#### log

    public void log​(IndexWriter.Identifier identifier,
                    int index,
                    ArrayLong references)
             throws java.io.IOException

Used to record the addresses as IDs.

Parameters:
  `identifier` - used to map references to IDs
  `index` - the index associated with these references
  `references` - the references (should be in identifier otherwise ignored)
Throws:
  `java.io.IOException` - if there is a problem writing the data

#### log

    public void log​(IIndexReader.IOne2LongIndex identifier,
                    int index,
                    ArrayLong references)
             throws java.io.IOException

Used to record the addresses as IDs. Sorts the references in order (except the first) and removes duplicates.

Parameters:
  `identifier` - used to map references to IDs
  `index` - the index associated with these references
  `references` - the references (should be in identifier otherwise ignored)
Throws:
  `java.io.IOException` - if there is a problem writing the data
Since:
  1.2

#### log

    public void log​(int index,
                    ArrayInt references)
             throws java.io.IOException

must not contain duplicates!

Throws:
  `java.io.IOException`

#### log

    public void log​(int index,
                    int[] values)
             throws java.io.IOException

must not contain duplicates!

Throws:
  `java.io.IOException`

#### flush

    public IIndexReader.IOne2ManyIndex flush()
                                      throws java.io.IOException

Finishes writing out everything

Returns:
  a reader for the data
Throws:
  `java.io.IOException` - if there is a problem writing the data

#### cancel

    public void cancel()

Terminate the IntArray1NWriter and delete any file which has been written so far. Use to cancel part way through.

#### getIndexFile

    public java.io.File getIndexFile()

Get the index file.

Returns:
  the file