storage.advancedStorage
Class AdvancedStorageManager.Segment

java.lang.Object
  extended bystorage.advancedStorage.AdvancedStorageManager.Segment
Enclosing class:
AdvancedStorageManager

public final class AdvancedStorageManager.Segment
extends java.lang.Object

This class represents a segment, a segmen is a set of spaces, each space inside a segment is identified by a number.


Nested Class Summary
 class AdvancedStorageManager.Segment.Space
          This class represents a space, a space is a set of units, each unit inside a space is identified by a unique number.
 class AdvancedStorageManager.Segment.SpaceNumberIterator
          This class is used to retrieve the used space numbers inside the segment.
 
Method Summary
 AdvancedStorageManager.Segment.Space getSpace(int spaceNumber)
          Returns the space with the specified number.
 AdvancedStorageManager.Segment.SpaceNumberIterator getSpaceNumbers()
          Returns the sequence of used space numbers by the segment.
 int getUnitSize()
          Returns the size of the units in the segmet.
 void loadSpace(int spaceNumber, int chunkNumber, boolean overwrite)
          Load a space with a specified space number.
 void removeSpace(int spaceNumber)
          Removes the space with the specified number inside the segment.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

loadSpace

public void loadSpace(int spaceNumber,
                      int chunkNumber,
                      boolean overwrite)
               throws InvalidSpaceNumberException,
                      AlreadyExistingSpaceNumberException,
                      PrimitiveStorageException,
                      IntermediateStorageException,
                      java.io.IOException
Load a space with a specified space number.

Parameters:
spaceNumber - The number which the space will be identified inside the segment.
chunkNumber - The number of the chunk to be used for mounting the space.
overwrite - If it is false the previous chunk's content will not be changed, if it is true the space will be formated.
Throws:
InvalidSpaceNumberException
AlreadyExistingSpaceNumberException
PrimitiveStorageException
IntermediateStorageException
java.io.IOException

removeSpace

public void removeSpace(int spaceNumber)
                 throws NotExistingSpaceNumberException
Removes the space with the specified number inside the segment.

Parameters:
spaceNumber - The number of the space to be removed.
Throws:
NotExistingSpaceNumberException

getSpace

public AdvancedStorageManager.Segment.Space getSpace(int spaceNumber)
Returns the space with the specified number.

Parameters:
spaceNumber - The number of the space to be retrieved.
Returns:
The Space object requested.

getSpaceNumbers

public AdvancedStorageManager.Segment.SpaceNumberIterator getSpaceNumbers()
Returns the sequence of used space numbers by the segment.


getUnitSize

public int getUnitSize()
Returns the size of the units in the segmet.