import java.time.LocalDate;
public class PlikVideo extends Plik{
public PlikVideo(String nazwa , int rozmiar, boolean czyDoZapisu, String rozszerzenie){
super(nazwa, rozmiar, czyDoZapisu);
this.rozszerzenie = rozszerzenie;
this.dataUtworzenia = LocalDate.now();
}
public boolean equals(Object obj) {
if(super.equals(obj) == true){
PlikVideo other = (PlikVideo) obj;
if (rozszerzenie == null) if (other.rozszerzenie != null) return false;
else if (!rozszerzenie.equals(other.rozszerzenie)) return false;
if(!this.dataUtworzenia.equals(other.dataUtworzenia)) return false;
} else return false;
return true;
}
public int compareTo(Plik other)
{
PlikVideo otherP = (PlikVideo) other;
if(super.compareTo(otherP) == 0){
if((this.dataUtworzenia.compareTo(otherP.dataUtworzenia)) == 0){
return 0;
} else return this.dataUtworzenia.compareTo(otherP.dataUtworzenia);
} else return super.compareTo(otherP);
}
public Object clone() throws CloneNotSupportedException {
return super.clone();
}
public String toString(){
return super.toString() + " , " + "[" + this.dataUtworzenia + "]" + " , Dzień tygodnia w którym został wyprodukowany: " +
"[" + this.dataUtworzenia.getDayOfWeek().name() + "]" + " , Dzień roku w krórym został wyprodukowany: " + this.dataUtworzenia.getDayOfYear();
}
public void setDataUtworzenia(int rok, int miesiac, int dzien){
this.dataUtworzenia = LocalDate.of(rok,miesiac,dzien);
}
public LocalDate getDataUtworzenia(){
return this.dataUtworzenia;
}
private String rozszerzenie;
private LocalDate dataUtworzenia;
}
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}