|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Interface for determining a suitable storage type for data of some expected size. The factory method pattern is used for creating the data storages.
The storage type can be different based on the size of the data. For example, it may be beneficial to store small amounts of data always in memory, for small overhead in access times, and to store larger objects on disk files, to avoid running out of memory.
Further, an implementing class may provide data storage objects that store data in disk files, for Java client applications, or e.g. in a relational database, for an EJB server environment where files are not allowed to be used.
DataStorage
Method Summary | |
DataStorage |
createDataStorage(long size)
Get an appropriate type of data storage for the requested size of data. |
Method Detail |
public DataStorage createDataStorage(long size) throws ApfloatRuntimeException
Note that the returned data storage object is not set to have the
requested size, so the client should call the object's DataStorage.setSize(long)
method before storing data to it.
size
- The size of data to be stored in the storage, in bytes.
DataStorage
object of an appropriate type for storing size
bytes of data.
ApfloatRuntimeException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |