esoe
2 years ago
15 changed files with 148 additions and 60 deletions
@ -0,0 +1,10 @@
@@ -0,0 +1,10 @@
|
||||
package ru.molokoin; |
||||
|
||||
public class Audio extends File{ |
||||
|
||||
public Audio(String name, byte size, Extension extension) { |
||||
super(name, size, extension); |
||||
//TODO Auto-generated constructor stub
|
||||
} |
||||
|
||||
} |
@ -0,0 +1,60 @@
@@ -0,0 +1,60 @@
|
||||
package ru.molokoin; |
||||
|
||||
public class Document extends File{ |
||||
private String format; |
||||
private int lists; |
||||
|
||||
/** |
||||
* Базовый конструктор класса File |
||||
* @param name |
||||
* @param size |
||||
* @param extension |
||||
*/ |
||||
public Document(String name, byte size, Extension extension) { |
||||
super(name, size, extension); |
||||
//TODO Auto-generated constructor stub
|
||||
} |
||||
|
||||
/** |
||||
* Основной конструктор документа |
||||
* @param name |
||||
* @param size |
||||
* @param extension |
||||
* @param format |
||||
* @param lists |
||||
*/ |
||||
public Document(String name, byte size, Extension extension,String format, int lists) { |
||||
super(name, size, extension); |
||||
init(format, lists); |
||||
} |
||||
|
||||
/** |
||||
* Инициируем атрибуты документа: |
||||
* формат и количество страниц. |
||||
* @param format |
||||
* @param lists |
||||
*/ |
||||
public void init(String format, int lists){ |
||||
setFormat(format); |
||||
setLists(lists); |
||||
} |
||||
public void print(){ |
||||
super.print(); |
||||
System.out.println("format: " + getFormat()); |
||||
System.out.println("lists: " + getLists()); |
||||
System.out.println("--------------------------------------------"); |
||||
|
||||
} |
||||
public void setFormat(String format) { |
||||
this.format = format; |
||||
} |
||||
public String getFormat() { |
||||
return format; |
||||
} |
||||
public void setLists(int lists) { |
||||
this.lists = lists; |
||||
} |
||||
public int getLists() { |
||||
return lists; |
||||
} |
||||
} |
@ -1,57 +1,9 @@
@@ -1,57 +1,9 @@
|
||||
package ru.molokoin; |
||||
|
||||
import java.sql.Time; |
||||
|
||||
public enum Extension{ |
||||
DOCUMENT, |
||||
IMAGE, |
||||
AUDIO, |
||||
VIDEO, |
||||
OTHER; |
||||
|
||||
private String format; |
||||
private int lists; |
||||
private Dimensions dimensions; |
||||
private String content; |
||||
private Time lenght; |
||||
|
||||
protected void initDocument(String format, int lists){ |
||||
setFormat(format); |
||||
setLists(lists); |
||||
} |
||||
protected void printDocument(){ |
||||
System.out.println("format: " + getFormat()); |
||||
System.out.println("lists: " + getLists()); |
||||
} |
||||
|
||||
protected void setFormat(String format) { |
||||
this.format = format; |
||||
} |
||||
protected void setLists(int lists) { |
||||
this.lists = lists; |
||||
} |
||||
protected void setDimensions(Dimensions dimensions) { |
||||
this.dimensions = dimensions; |
||||
} |
||||
protected void setContent(String content) { |
||||
this.content = content; |
||||
} |
||||
protected void setLenght(Time lenght) { |
||||
this.lenght = lenght; |
||||
} |
||||
protected String getFormat() { |
||||
return format; |
||||
} |
||||
protected int getLists() { |
||||
return lists; |
||||
} |
||||
protected Dimensions getDimensions() { |
||||
return dimensions; |
||||
} |
||||
protected String getContent() { |
||||
return content; |
||||
} |
||||
protected Time getLenght() { |
||||
return lenght; |
||||
} |
||||
} |
||||
|
@ -0,0 +1,35 @@
@@ -0,0 +1,35 @@
|
||||
package ru.molokoin; |
||||
|
||||
public class Image extends File{ |
||||
private String format; |
||||
private Dimensions dimensions; |
||||
|
||||
public Image(String name, byte size, Extension extension, String format, Dimensions dimensions) { |
||||
super(name, size, extension); |
||||
init(format, dimensions); |
||||
} |
||||
public void print(){ |
||||
super.print(); |
||||
System.out.println("format: " + getFormat()); |
||||
System.out.println("Dimensions: " + getDimensions().getHeight() + " x " + getDimensions().getWidth()); |
||||
System.out.println("--------------------------------------------"); |
||||
|
||||
} |
||||
public void init(String format, Dimensions dimensions){ |
||||
setFormat(format); |
||||
setDimensions(dimensions); |
||||
} |
||||
public void setFormat(String format) { |
||||
this.format = format; |
||||
} |
||||
public void setDimensions(Dimensions dimensions) { |
||||
this.dimensions = dimensions; |
||||
} |
||||
public String getFormat() { |
||||
return format; |
||||
} |
||||
public Dimensions getDimensions() { |
||||
return dimensions; |
||||
} |
||||
|
||||
} |
@ -0,0 +1,10 @@
@@ -0,0 +1,10 @@
|
||||
package ru.molokoin; |
||||
|
||||
public class Video extends File{ |
||||
|
||||
public Video(String name, byte size, Extension extension) { |
||||
super(name, size, extension); |
||||
//TODO Auto-generated constructor stub
|
||||
} |
||||
|
||||
} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in new issue