esoe 2 years ago
parent
commit
866c6355fb
  1. 30
      files/src/main/docs/diagrams/src/Files.puml
  2. 22
      files/src/main/java/ru/molokoin/Dimensions.java
  3. 3
      files/src/main/java/ru/molokoin/DocumentFile.java
  4. 49
      files/src/main/java/ru/molokoin/Extension.java
  5. 42
      files/src/main/java/ru/molokoin/File.java
  6. 26
      files/src/main/java/ru/molokoin/Storage.java
  7. BIN
      files/target/classes/ru/molokoin/AnnotationReseacher.class
  8. BIN
      files/target/classes/ru/molokoin/Dimensions.class
  9. BIN
      files/target/classes/ru/molokoin/Extension.class
  10. BIN
      files/target/classes/ru/molokoin/File.class
  11. BIN
      files/target/classes/ru/molokoin/Storage.class

30
files/src/main/docs/diagrams/src/Files.puml

@ -1,9 +1,6 @@
@startuml Files @startuml Files
title Files class diagram title Files class diagram
class Storage {
File[] files
}
enum Extension{ enum Extension{
DOCUMENT DOCUMENT
IMAGE IMAGE
@ -16,5 +13,30 @@ class File {
byte size byte size
Extension extension Extension extension
} }
class Document{
String format
int lists
}
class Image{
}
class Audio{
}
class Video{
}
Extension -> File
File -> Document
File -> Image
File -> Audio
File -> Video
class Storage {
File[] files
File[] getDefaultList()
void print()
}
@enduml @enduml

22
files/src/main/java/ru/molokoin/Dimensions.java

@ -0,0 +1,22 @@
package ru.molokoin;
public class Dimensions {
int width;
int height;
Dimensions(int width, int height){
setWidth(width);
setHeight(height);
}
public void setWidth(int width) {
this.width = width;
}
public void setHeight(int height) {
this.height = height;
}
public int getWidth() {
return width;
}
public int getHeight() {
return height;
}
}

3
files/src/main/java/ru/molokoin/DocumentFile.java

@ -1,3 +0,0 @@
public class DocumentFile extends File{
}

49
files/src/main/java/ru/molokoin/Extension.java

@ -1,3 +1,7 @@
package ru.molokoin;
import java.sql.Time;
public enum Extension{ public enum Extension{
DOCUMENT, DOCUMENT,
IMAGE, IMAGE,
@ -5,4 +9,49 @@ public enum Extension {
VIDEO, VIDEO,
OTHER; 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;
}
} }

42
files/src/main/java/ru/molokoin/File.java

@ -1,16 +1,40 @@
package ru.molokoin; package ru.molokoin;
/**
* Класс - обертка
* предоставляет инструментарий обращения с отдельным файлом
*/
public class File { public class File {
String name; private String name;
Byte size; private byte size;
Extension extension; private Extension extension;
public File(String name, byte size, Extension extension){
public File (String name, Byte size, Extension extension){ setName(name);
setSize(size);
setExtension(extension);
} }
public void print(){
public static void main(String[] args) { System.out.println("name: " + getName());
// System.out.println("size: " + (byte) getSize());
System.out.println("extension: " + extension);
} }
public void setName(String name) {
this.name = name;
}
public void setSize(byte size) {
this.size = size;
}
public void setExtension(Extension extension) {
this.extension = extension;
}
public String getName() {
return name;
}
public byte getSize() {
return size;
}
public Extension getExtension() {
return extension;
}
} }

26
files/src/main/java/ru/molokoin/Storage.java

@ -1,3 +1,27 @@
package ru.molokoin;
/**
* Класс - хранилище
* предоставляет инструментарий обращения с массивом файлов
*/
public class Storage { public class Storage {
File[] files; private File[] files;
public void setFiles(File[] files) {
this.files = files;
}
public File[] getFiles() {
return files;
}
public static void main(String[] args) {
Storage storage = new Storage();
storage.setFiles(new File[1]);
Extension e = Extension.DOCUMENT;
e.initDocument("null", 0);
storage.files[0] = new File("noname", (byte)0, e);
storage.files[0].print();
}
} }

BIN
files/target/classes/ru/molokoin/AnnotationReseacher.class

Binary file not shown.

BIN
files/target/classes/ru/molokoin/Dimensions.class

Binary file not shown.

BIN
files/target/classes/ru/molokoin/Extension.class

Binary file not shown.

BIN
files/target/classes/ru/molokoin/File.class

Binary file not shown.

BIN
files/target/classes/ru/molokoin/Storage.class

Binary file not shown.
Loading…
Cancel
Save