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
Write out a mapping of ints to int arrays.
-
Constructor Summary
ConstructorDescriptionIntArray1NWriter
(int size, File indexFile) Construct a writer of the required size. -
Method Summary
Modifier and TypeMethodDescriptionvoid
cancel()
Terminate the IntArray1NWriter and delete any file which has been written so far.flush()
Finishes writing out everythingGet the index file.void
log
(int index, int[] values) must not contain duplicates!void
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.
-
Constructor Details
-
IntArray1NWriter
Construct a writer of the required size.- Parameters:
size
- the number of entriesindexFile
- the file to be written to- Throws:
IOException
- if there is a problem writing the file
-
-
Method Details
-
log
public void log(IndexWriter.Identifier identifier, int index, ArrayLong references) throws IOException Used to record the addresses as IDs.- Parameters:
identifier
- used to map references to IDsindex
- the index associated with these referencesreferences
- the references (should be in identifier otherwise ignored)- Throws:
IOException
- if there is a problem writing the data
-
log
public void log(IIndexReader.IOne2LongIndex identifier, int index, ArrayLong references) throws 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 IDsindex
- the index associated with these referencesreferences
- the references (should be in identifier otherwise ignored)- Throws:
IOException
- if there is a problem writing the data- Since:
- 1.2
-
log
must not contain duplicates!- Throws:
IOException
-
log
must not contain duplicates!- Throws:
IOException
-
flush
Finishes writing out everything- Returns:
- a reader for the data
- Throws:
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
Get the index file.- Returns:
- the file
-