|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectstorage.UnitsStorageManager
This class provides methods for using units. That methods are shortcuts of the underlying methods in the advanced storage component.
Constructor Summary | |
UnitsStorageManager(AdvancedStorageManager asm)
Constructs a units storage manager from an advanced storage manager. |
Method Summary | |
void |
addUnit(int segmentNumber,
int spaceNumber,
long unitNumber)
Adds a unit with specifified segment, space and unit numbers, i.e. occups that unit. |
void |
addUnit(int segmentNumber,
UnitAddress unitAddress)
Adds a unit with specifified segment and unit address, i.e. occups that unit. |
void |
dropUnit(int segmentNumber,
int spaceNumber,
long unitNumber)
Drops a specific unit, i.e. frees the specified unit. |
void |
dropUnit(int segmentNumber,
UnitAddress unitAddress)
Drops a specific unit, i.e. frees the specified unit. |
UnitAddress |
findFreeUnit(int segmentNumber)
Finds the first free unit in the segment. |
boolean |
findFreeUnit(int segmentNumber,
UnitAddress freeUnit)
Finds the first free unit in the segment. |
UnitAddress |
findFreeUnitAsCloserAsPosibleOf(int segmentNumber,
int spaceNumber,
long unitNumber)
Tries to find a free unit, first in the same page, second in the same space and finally in the same segment of a specified unit. |
boolean |
findFreeUnitAsCloserAsPosibleOf(int segmentNumber,
int spaceNumber,
long unitNumber,
UnitAddress freeUnit)
Tries to find a free unit, first in the same page, second in the same space and finally in the same segment of a specified unit. |
UnitAddress |
findFreeUnitAsCloserAsPosibleOf(int segmentNumber,
UnitAddress unitAddress)
Tries to find a free unit, first in the same page, second in the same space and finally in the same segment of a specified unit. |
boolean |
findFreeUnitAsCloserAsPosibleOf(int segmentNumber,
UnitAddress unitAddress,
UnitAddress freeUnit)
Tries to find a free unit, first in the same page, second in the same space and finally in the same segment of a specified unit. |
AdvancedStorageManager |
getAdvancedStorageManager()
Returns the underlying advanced storage manager. |
IntermediateStorageManager |
getIntermediateStorageManager()
Returns the underlying intermediate storage manager. |
PrimitiveStorageManager |
getPrimitiveStorageManager()
Returns the underlying primitive storage manager. |
boolean |
isFreeUnit(int segmentNumber,
int spaceNumber,
long unitNumber)
Checks if a unit is free. |
boolean |
isFreeUnit(int segmentNumber,
UnitAddress unitAddress)
Checks if a unit is free. |
boolean |
isOccupiedUnit(int segmentNumber,
int spaceNumber,
long unitNumber)
Checks if a unit is occupied. |
boolean |
isOccupiedUnit(int segmentNumber,
UnitAddress unitAddress)
Checks if a unit is occupied. |
void |
readUnit(int segmentNumber,
int spaceNumber,
long unitNumber,
byte[] b,
int off)
Reads fully a unit. |
void |
readUnit(int segmentNumber,
int spaceNumber,
long unitNumber,
int unitOffset,
int length,
byte[] b,
int off)
Reads partially a unit starting from an offset and reading a specific length. |
void |
readUnit(int segmentNumber,
UnitAddress unitAddress,
byte[] b,
int off)
Reads fully a unit. |
void |
readUnit(int segmentNumber,
UnitAddress unitAddress,
int unitOffset,
int length,
byte[] b,
int off)
Reads partially a unit starting from an offset and reading a specific length. |
void |
writeUnit(int segmentNumber,
int spaceNumber,
long unitNumber,
byte[] b,
int off)
Writes fully a unit. |
void |
writeUnit(int segmentNumber,
int spaceNumber,
long unitNumber,
int unitOffset,
int length,
byte[] b,
int off)
Writes partially a unit starting from an offset and writing a specific length of bytes. |
void |
writeUnit(int segmentNumber,
UnitAddress unitAddress,
byte[] b,
int off)
Writes fully a unit. |
void |
writeUnit(int segmentNumber,
UnitAddress unitAddress,
int unitOffset,
int length,
byte[] b,
int off)
Writes partially a unit starting from an offset and writing a specific length of bytes. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public UnitsStorageManager(AdvancedStorageManager asm)
Method Detail |
public UnitAddress findFreeUnit(int segmentNumber) throws StorageException, java.io.IOException
segmentNumber
- The number of the segment.
UnitAddress
objec represents the unit found,
null
if a free unit is not found.
StorageException
java.io.IOException
public boolean findFreeUnit(int segmentNumber, UnitAddress freeUnit) throws StorageException, java.io.IOException
segmentNumber
- The number of the segment.freeUnit
- Where the address of the free unit will be stored.
true
if the free unit is found, false
otherwise.
StorageException
java.io.IOException
public UnitAddress findFreeUnitAsCloserAsPosibleOf(int segmentNumber, int spaceNumber, long unitNumber) throws StorageException, java.io.IOException
segmentNumber
- The number of the segment of the close unit.spaceNumber
- The number of the space of the close unit.unitNumber
- The unit number of the close unit.
UnitAddress
objec represents the unit found,
null
if a free unit is not found.
StorageException
java.io.IOException
public UnitAddress findFreeUnitAsCloserAsPosibleOf(int segmentNumber, UnitAddress unitAddress) throws StorageException, java.io.IOException
segmentNumber
- The number of the segment of the close unit.unitAddress
- unit address of the close unit.
UnitAddress
objec represents the unit found,
null
if a free unit is not found.
StorageException
java.io.IOException
public boolean findFreeUnitAsCloserAsPosibleOf(int segmentNumber, int spaceNumber, long unitNumber, UnitAddress freeUnit) throws StorageException, java.io.IOException
segmentNumber
- The number of the segment of the close unit.spaceNumber
- The number of the space of the close unit.unitNumber
- The unit number of the close unit.freeUnit
- Where the address of the new unit will be stored.
true
if the unit is found,
false
otherwise.
StorageException
java.io.IOException
public boolean findFreeUnitAsCloserAsPosibleOf(int segmentNumber, UnitAddress unitAddress, UnitAddress freeUnit) throws StorageException, java.io.IOException
segmentNumber
- The number of the segment of the close unit.unitAddress
- unit address of the close unit.freeUnit
- Where the address of the new unit will be stored.
true
if the unit is found,
false
otherwise.
StorageException
java.io.IOException
public void addUnit(int segmentNumber, int spaceNumber, long unitNumber) throws StorageException, java.io.IOException
segmentNumber
- The number of the segment of the specified unit.spaceNumber
- The number of the space of the specified unit.unitNumber
- The unit number of the specified unit.
StorageException
java.io.IOException
public void addUnit(int segmentNumber, UnitAddress unitAddress) throws StorageException, java.io.IOException
segmentNumber
- The number of the segment of the specified unit.unitAddress
- unit address of the specified unit.
StorageException
java.io.IOException
public void dropUnit(int segmentNumber, int spaceNumber, long unitNumber) throws StorageException, java.io.IOException
segmentNumber
- The number of the segment.spaceNumber
- The number of the space.unitNumber
- The number of the unit. .
StorageException
java.io.IOException
public void dropUnit(int segmentNumber, UnitAddress unitAddress) throws StorageException, java.io.IOException
segmentNumber
- The number of the segment.unitAddress
- unit address of the specified unit.
StorageException
java.io.IOException
public void readUnit(int segmentNumber, int spaceNumber, long unitNumber, byte[] b, int off) throws StorageException, java.io.IOException
segmentNumber
- The number of the segment.spaceNumber
- The number of the space.unitNumber
- The number of the unit. .b
- The byte array which the content of the readed unit will be stored.off
- The offset of b
from which the readed content will be stored.
StorageException
java.io.IOException
public void readUnit(int segmentNumber, UnitAddress unitAddress, byte[] b, int off) throws StorageException, java.io.IOException
segmentNumber
- The number of the segment.unitAddress
- The address of the unit. .b
- The byte array which the content of the readed unit will be stored.off
- The offset of b
from which the readed content will be stored.
StorageException
java.io.IOException
public void readUnit(int segmentNumber, int spaceNumber, long unitNumber, int unitOffset, int length, byte[] b, int off) throws StorageException, java.io.IOException
segmentNumber
- The number of the segment.spaceNumber
- The number of the space.unitNumber
- The number of the unit. .unitOffset
- The position of the unit from which the reading starts.length
- The number of bytes to be readed.b
- The byte array which the content of the readed unit will be stored.off
- The offset of b
from which the readed content will be stored.
StorageException
java.io.IOException
public void readUnit(int segmentNumber, UnitAddress unitAddress, int unitOffset, int length, byte[] b, int off) throws StorageException, java.io.IOException
segmentNumber
- The number of the segment.unitAddress
- The address of the unit. .unitOffset
- The position of the unit from which the reading starts.length
- The number of bytes to be readed.b
- The byte array which the content of the readed unit will be stored.off
- The offset of b
from which the readed content will be stored.
StorageException
java.io.IOException
public void writeUnit(int segmentNumber, int spaceNumber, long unitNumber, byte[] b, int off) throws StorageException, java.io.IOException
segmentNumber
- The number of the segment.spaceNumber
- The number of the space.unitNumber
- The number of the unit.b
- The byte array from which the units's content will be get.off
- The offset of b
from which the unit's content will be get.
StorageException
java.io.IOException
public void writeUnit(int segmentNumber, UnitAddress unitAddress, byte[] b, int off) throws StorageException, java.io.IOException
segmentNumber
- The number of the segment.unitAddress
- The address of the unit.b
- The byte array from which the units's content will be get.off
- The offset of b
from which the unit's content will be get.
StorageException
java.io.IOException
public void writeUnit(int segmentNumber, int spaceNumber, long unitNumber, int unitOffset, int length, byte[] b, int off) throws StorageException, java.io.IOException
segmentNumber
- The number of the segment.spaceNumber
- The number of the space.unitNumber
- The number of the unit.unitOffset
- The position of the unit from which the writing starts.length
- The number of bytes to be wrote.b
- The byte array from which the units's content will be get.off
- The offset of b
from which the unit's content will be get.
StorageException
java.io.IOException
public void writeUnit(int segmentNumber, UnitAddress unitAddress, int unitOffset, int length, byte[] b, int off) throws StorageException, java.io.IOException
segmentNumber
- The number of the segment.unitAddress
- The address of the unit.unitOffset
- The position of the unit from which the writing starts.length
- The number of bytes to be wrote.b
- The byte array from which the units's content will be get.off
- The offset of b
from which the unit's content will be get.
StorageException
java.io.IOException
public boolean isFreeUnit(int segmentNumber, int spaceNumber, long unitNumber) throws StorageException, java.io.IOException
segmentNumber
- The number of the segment.spaceNumber
- The number of the space.unitNumber
- The number of the unit.
true
if the specified unit is free, false
otherwise.
StorageException
java.io.IOException
public boolean isFreeUnit(int segmentNumber, UnitAddress unitAddress) throws StorageException, java.io.IOException
segmentNumber
- The number of the segment.unitAddress
- The address of the unit.
true
if the specified unit is free, false
otherwise.
StorageException
java.io.IOException
public boolean isOccupiedUnit(int segmentNumber, int spaceNumber, long unitNumber) throws StorageException, java.io.IOException
segmentNumber
- The number of the segment.spaceNumber
- The number of the space.unitNumber
- The number of the unit.
true
if the specified unit is occupied, false
otherwise.
StorageException
java.io.IOException
public boolean isOccupiedUnit(int segmentNumber, UnitAddress unitAddress) throws StorageException, java.io.IOException
segmentNumber
- The number of the segment.unitAddress
- The address of the unit.
true
if the specified unit is occupied, false
otherwise.
StorageException
java.io.IOException
public PrimitiveStorageManager getPrimitiveStorageManager()
public IntermediateStorageManager getIntermediateStorageManager()
public AdvancedStorageManager getAdvancedStorageManager()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |