storage.primitiveStorage
Class PrimitiveStorageManager.ChunksTable

java.lang.Object
  extended bystorage.primitiveStorage.PrimitiveStorageManager.ChunksTable
Enclosing class:
PrimitiveStorageManager

public class PrimitiveStorageManager.ChunksTable
extends java.lang.Object

This class represents the chunk's table, i.e. a set of number-chunk pairs. This class uses a AA-Tree for implementing the table.


Nested Class Summary
 class PrimitiveStorageManager.ChunksTable.Entry
          Represents a number-chunk pair.
 
Constructor Summary
PrimitiveStorageManager.ChunksTable()
          Constructs an empty chunk's table.
 
Method Summary
 boolean containsChunkNumber(int chunkNumber)
          Checks if a chunk with a given number exists in the table.
 PrimitiveStorageManager.Chunk get(int chunkNumber)
          Returns the chunk with the specified number.
 PrimitiveStorageManager.ChunksTable.Entry getEntry(int chunkNumber)
          Returns the number-chunk pair with the specified number.
 PrimitiveStorageManager.ChunksTable.Entry getFirst()
          Returns the first inserted number-chunk pair.
 PrimitiveStorageManager.ChunksTable.Entry getLast()
          Returns the last inserted number-chunk pair.
 void put(int chunkNumber, PrimitiveStorageManager.Chunk chunk)
          Puts a chunk with a specified number in the table.
 void remove(int chunkNumber)
          Removes a chunk with a specified number from the table.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PrimitiveStorageManager.ChunksTable

public PrimitiveStorageManager.ChunksTable()
Constructs an empty chunk's table.

Method Detail

containsChunkNumber

public boolean containsChunkNumber(int chunkNumber)
Checks if a chunk with a given number exists in the table.

Parameters:
chunkNumber - The chunk number to find in the table.
Returns:
true if a chunk with the given number is in the table, false otherwise.

get

public PrimitiveStorageManager.Chunk get(int chunkNumber)
Returns the chunk with the specified number.

Parameters:
chunkNumber - The chunk number to find in the table.
Returns:
The chunk with the specified number, null if the number does not exist.

getEntry

public PrimitiveStorageManager.ChunksTable.Entry getEntry(int chunkNumber)
Returns the number-chunk pair with the specified number.

Parameters:
chunkNumber - The chunk number to find in the table.
Returns:
The number-chunk pair with the specified number, null if the number does not exist.

put

public void put(int chunkNumber,
                PrimitiveStorageManager.Chunk chunk)
Puts a chunk with a specified number in the table.

Parameters:
chunkNumber - The chunk number to put.
chunk - The chunk to put.

remove

public void remove(int chunkNumber)
Removes a chunk with a specified number from the table.

Parameters:
chunkNumber - The number of the chunk to remove.

getFirst

public PrimitiveStorageManager.ChunksTable.Entry getFirst()
Returns the first inserted number-chunk pair.

Returns:
The first inserted number-chunk pair, null if there are not inserted chunks.

getLast

public PrimitiveStorageManager.ChunksTable.Entry getLast()
Returns the last inserted number-chunk pair.

Returns:
The last inserted number-chunk pair, null if there are not inserted chunks.