Advertisement
Guest User

Untitled

a guest
Sep 17th, 2019
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.05 KB | None | 0 0
  1. class KontenerImplExt : Kontener
  2.     {
  3.         int Odczyty[];
  4.         int Zapisy[];
  5.         KontenerImpl KONTENER;
  6.         public KontenerImplExt(int rozmiar) throws BladPamieci
  7.         {
  8.             KONTENER=new KontenerImpl(rozmiar);
  9.             Odczyty=new int[rozmiar];
  10.             Zapisy=new int[rozmiar];
  11.         }
  12.     void zwolnij() throws BladPamieci;
  13.     {
  14.         KONTENER.zwolnij();
  15.     }
  16.    
  17.     void zapisz(int i,int ind) throws BladZapisu
  18.     {
  19.         Zapisy[ind] = Zapisy[ind]+1
  20.         KONTENER.zapisz(i,ind);
  21.     }
  22.  
  23.     public int ile_odczytow(int ind) throws BladOdczytu;
  24.     {
  25.         return Odczyty[ind];
  26.     }
  27.     public int ile_zapisow(int ind) throws BladOdczytu;
  28.     {
  29.         return Zapisy[ind];
  30.     }
  31.  
  32.     int odczytaj(int ind) throws BladOdczytu
  33.     {
  34.         try{
  35.         KONTENER.odczytaj(ind);
  36.             }
  37.         catch(TymczasowyBladOdczytu)
  38.             {
  39.                 odczytaj(ind);
  40.             }
  41.         catch(PermamentnyBladOdczytu ex)
  42.             {
  43.             throw new ex;
  44.             }
  45.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement