Package org.eclipse.mat.parser.index
Class IndexReader.SizeIndexReader
- java.lang.Object
-
- org.eclipse.mat.parser.index.IndexReader.SizeIndexReader
-
- All Implemented Interfaces:
IIndexReader,IIndexReader.IOne2OneIndex,IIndexReader.IOne2SizeIndex
- Enclosing class:
- IndexReader
public static class IndexReader.SizeIndexReader extends java.lang.Object implements IIndexReader.IOne2SizeIndex
Creates a index reader for array sizes, presuming the sizes are stored as ints and get expanded in the reverse of the compression.- Since:
- 1.0
-
-
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 SizeIndexReader(java.io.File indexFile)Constructor used when reopening a dumpSizeIndexReader(IIndexReader.IOne2OneIndex idx)Construct a size index reader based on a int index holding the compressed data
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Delegate to the int index.voiddelete()Delegate to the int index.intget(int index)Get the (compressed) size.int[]getAll(int[] index)Delegate to the int index.int[]getNext(int index, int length)Delegate to the int index.longgetSize(int index)Expand the compressed size.intsize()Delegate to the int index.voidunload()Delegate to the int index.
-
-
-
Constructor Detail
-
SizeIndexReader
public SizeIndexReader(java.io.File indexFile) throws java.io.IOExceptionConstructor used when reopening a dump- Parameters:
indexFile- the file holding the index- Throws:
java.io.IOException- if there was a problem reading the file
-
SizeIndexReader
public SizeIndexReader(IIndexReader.IOne2OneIndex idx)
Construct a size index reader based on a int index holding the compressed data- Parameters:
idx- the source index
-
-
Method Detail
-
getSize
public long getSize(int index)
Expand the compressed size.- Specified by:
getSizein interfaceIIndexReader.IOne2SizeIndex- Parameters:
index- the encoded compressed size- Returns:
- the actual size in bytes
-
get
public int get(int index)
Get the (compressed) size. Delegate to the int index.- Specified by:
getin interfaceIIndexReader.IOne2OneIndex- Parameters:
index- the index of the object- Returns:
- the encoded compressed size
-
getAll
public int[] getAll(int[] index)
Delegate to the int index. Gets the encoded sizes for a list of object IDs- Specified by:
getAllin interfaceIIndexReader.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)Delegate to the int index. Gets the encoded sizes for a consecutive list of object IDs- Specified by:
getNextin interfaceIIndexReader.IOne2OneIndex- Parameters:
index- the starting indexlength- the number to read- Returns:
- an array of compressed sizes
-
close
public void close() throws java.io.IOExceptionDelegate to the int index.- Specified by:
closein interfaceIIndexReader- Throws:
java.io.IOException
-
delete
public void delete()
Delegate to the int index.- Specified by:
deletein interfaceIIndexReader
-
size
public int size()
Delegate to the int index.- Specified by:
sizein interfaceIIndexReader- Returns:
- the number of entries
-
unload
public void unload() throws java.io.IOExceptionDelegate to the int index.- Specified by:
unloadin interfaceIIndexReader- Throws:
java.io.IOException
-
-