pl.edu.pjwstk.yaod.store.defaultstore.persistentstore
Class PersistentBlockID

java.lang.Object
  |
  +--pl.edu.pjwstk.yaod.store.AbstractBlockID
        |
        +--pl.edu.pjwstk.yaod.store.defaultstore.blocks.BlockID
              |
              +--pl.edu.pjwstk.yaod.store.defaultstore.persistentstore.PersistentBlockID
All Implemented Interfaces:
java.io.Serializable

public class PersistentBlockID
extends BlockID

Klasa reprezentuje identyfikator bloku. Dla skladu trwalych obiektow ma on postac .

Author:
M. Lentner, raist@ertel.com.pl
See Also:
Serialized Form

Constructor Summary
PersistentBlockID(short file, short block)
          Tworzy nowy identyfikator bloku.
PersistentBlockID(short store, short file, short block)
          Tworzy nowy identyfikator bloku.
 
Method Summary
 boolean equals(java.lang.Object par)
          Sprawdza czy dwa identyfikatory wskazuja na ten sam blok.
 short getBlockID()
          Zwraca numer bloku w pliku danych.
 short getFileID()
          Zwraca identyfikator pliku danych.
 int hashCode()
          Zwraca klucz haszowania, wykorzystywany w buforze blokow (jest obiektem Hashtable).
 void setBlockID(short block)
          Ustala numer bloku w pliku danych.
 void setFileID(short file)
          Ustala identyfikator pliku danych.
 short sizeOf()
          Zwraca dlugosc zserializowanego identyfikatora bloku.
 byte[] toByteArray()
          Serializuje identyfikator bloku.
 
Methods inherited from class pl.edu.pjwstk.yaod.store.AbstractBlockID
getStoreID, setStoreID
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PersistentBlockID

public PersistentBlockID(short file,
                         short block)
Tworzy nowy identyfikator bloku.
Parameters:
file - id pliku, w ktorym blok jest zapisany.
block - numer bloku od poczatku pliku (dokladny poczatek block * rozmiar bloku).

PersistentBlockID

public PersistentBlockID(short store,
                         short file,
                         short block)
Tworzy nowy identyfikator bloku.
Parameters:
store - identyfikator skladu do ktorego nalezy blok.
file - id pliku, w ktorym blok jest zapisany.
block - numer bloku od poczatku pliku (dokladny poczatek block * rozmiar bloku).
Method Detail

getFileID

public short getFileID()
Zwraca identyfikator pliku danych.
Returns:
identyfikator pliku.

setFileID

public void setFileID(short file)
Ustala identyfikator pliku danych.
Parameters:
identyfikator - pliku danych.

setBlockID

public void setBlockID(short block)
Ustala numer bloku w pliku danych.
Parameters:
block - identyfikator bloku.

getBlockID

public short getBlockID()
Zwraca numer bloku w pliku danych.
Returns:
numer bloku.

hashCode

public int hashCode()
Zwraca klucz haszowania, wykorzystywany w buforze blokow (jest obiektem Hashtable).
Overrides:
hashCode in class AbstractBlockID
Returns:
klucz haszowania.

equals

public boolean equals(java.lang.Object par)
Sprawdza czy dwa identyfikatory wskazuja na ten sam blok.
Overrides:
equals in class AbstractBlockID
Parameters:
par - porownywany identyfiaktor.
Returns:
oba identyfikatory wskazuja na ten sam blok (true) lub nie (false).

sizeOf

public short sizeOf()
Zwraca dlugosc zserializowanego identyfikatora bloku.
Overrides:
sizeOf in class BlockID
Returns:
dlugosc zserializowanego identyfikatora bloku.

toByteArray

public byte[] toByteArray()
Serializuje identyfikator bloku.
Overrides:
toByteArray in class BlockID
Returns:
zserializowany identfikator bloku.