Advertisement
Guest User

Untitled

a guest
Jan 18th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.22 KB | None | 0 0
  1. package pl.edu.uwm.wmii.dorozkogrzegorz.Kolokwium;
  2. import java.time.LocalDate;
  3. public class PlikVideo extends Plik implements Cloneable
  4. {
  5.     private String rozszerzenie;
  6.     private LocalDate dataUtworzenia;
  7.     public PlikVideo(String nazwa, Integer rozmiar, boolean czyDoZapisu, String rozszerzenie)
  8.     {
  9.         super(nazwa,rozmiar,czyDoZapisu);
  10.         this.dataUtworzenia=LocalDate.now();
  11.         setRozszerzenie(rozszerzenie);
  12.     }
  13.     public void setRozszerzenie(String rozszerzenie)
  14.     {
  15.         this.rozszerzenie = rozszerzenie;
  16.     }
  17.     public void setDataUtworzenia(int rok, int miesiac, int dzien)
  18.     {
  19.         this.dataUtworzenia=LocalDate.now();
  20.     }
  21.     public LocalDate getDataUtworzenia()
  22.     {
  23.         return dataUtworzenia;
  24.     }
  25.     public String getRozszerzenie()
  26.     {
  27.         return rozszerzenie;
  28.     }
  29.     public String toString()
  30.     {
  31.         return super.toString()+", data utworzenia: "+this.getDataUtworzenia()+", rozszerzenie: "+this.getRozszerzenie();
  32.     }
  33.     protected Object clone() throws CloneNotSupportedException
  34.     {
  35.         PlikVideo temp = new PlikVideo(this.getNazwa(), this.getRozmiar(), this.getczyDoZapisu(), this.getRozszerzenie());
  36.         return temp;
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement