From 866c6355fb092b2ecce0273868f96d69bce93851 Mon Sep 17 00:00:00 2001 From: esoe Date: Sun, 23 Oct 2022 20:10:34 +0300 Subject: [PATCH] qq --- files/src/main/docs/diagrams/src/Files.puml | 30 +++++++++-- .../src/main/java/ru/molokoin/Dimensions.java | 22 ++++++++ .../main/java/ru/molokoin/DocumentFile.java | 3 -- .../src/main/java/ru/molokoin/Extension.java | 51 +++++++++++++++++- files/src/main/java/ru/molokoin/File.java | 42 +++++++++++---- files/src/main/java/ru/molokoin/Storage.java | 26 ++++++++- .../ru/molokoin/AnnotationReseacher.class | Bin 1363 -> 0 bytes .../classes/ru/molokoin/Dimensions.class | Bin 0 -> 739 bytes .../classes/ru/molokoin/Extension.class | Bin 1130 -> 2873 bytes files/target/classes/ru/molokoin/File.class | Bin 614 -> 1675 bytes .../target/classes/ru/molokoin/Storage.class | Bin 1567 -> 1014 bytes 11 files changed, 156 insertions(+), 18 deletions(-) create mode 100644 files/src/main/java/ru/molokoin/Dimensions.java delete mode 100644 files/src/main/java/ru/molokoin/DocumentFile.java delete mode 100644 files/target/classes/ru/molokoin/AnnotationReseacher.class create mode 100644 files/target/classes/ru/molokoin/Dimensions.class diff --git a/files/src/main/docs/diagrams/src/Files.puml b/files/src/main/docs/diagrams/src/Files.puml index ed7201a..8212d61 100644 --- a/files/src/main/docs/diagrams/src/Files.puml +++ b/files/src/main/docs/diagrams/src/Files.puml @@ -1,9 +1,6 @@ @startuml Files - title Files class diagram -class Storage { - File[] files -} + enum Extension{ DOCUMENT IMAGE @@ -16,5 +13,30 @@ class File { byte size 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 \ No newline at end of file diff --git a/files/src/main/java/ru/molokoin/Dimensions.java b/files/src/main/java/ru/molokoin/Dimensions.java new file mode 100644 index 0000000..0028f12 --- /dev/null +++ b/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; + } +} diff --git a/files/src/main/java/ru/molokoin/DocumentFile.java b/files/src/main/java/ru/molokoin/DocumentFile.java deleted file mode 100644 index 851314a..0000000 --- a/files/src/main/java/ru/molokoin/DocumentFile.java +++ /dev/null @@ -1,3 +0,0 @@ -public class DocumentFile extends File{ - -} diff --git a/files/src/main/java/ru/molokoin/Extension.java b/files/src/main/java/ru/molokoin/Extension.java index 01ecbe6..bf645d4 100644 --- a/files/src/main/java/ru/molokoin/Extension.java +++ b/files/src/main/java/ru/molokoin/Extension.java @@ -1,8 +1,57 @@ -public enum Extension { +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; + } } diff --git a/files/src/main/java/ru/molokoin/File.java b/files/src/main/java/ru/molokoin/File.java index 7b4dd58..9ab3547 100644 --- a/files/src/main/java/ru/molokoin/File.java +++ b/files/src/main/java/ru/molokoin/File.java @@ -1,16 +1,40 @@ package ru.molokoin; +/** + * Класс - обертка + * предоставляет инструментарий обращения с отдельным файлом + */ public class File { - String name; - Byte size; - Extension extension; - - public File (String name, Byte size, Extension extension){ - + private String name; + private byte size; + private Extension extension; + public File(String name, byte size, Extension extension){ + setName(name); + setSize(size); + setExtension(extension); } - - public static void main(String[] args) { - // + public void print(){ + 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; + } } diff --git a/files/src/main/java/ru/molokoin/Storage.java b/files/src/main/java/ru/molokoin/Storage.java index 11c218f..a5cbc95 100644 --- a/files/src/main/java/ru/molokoin/Storage.java +++ b/files/src/main/java/ru/molokoin/Storage.java @@ -1,3 +1,27 @@ +package ru.molokoin; +/** + * Класс - хранилище + * предоставляет инструментарий обращения с массивом файлов + */ 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(); + + } + } diff --git a/files/target/classes/ru/molokoin/AnnotationReseacher.class b/files/target/classes/ru/molokoin/AnnotationReseacher.class deleted file mode 100644 index 8b464570fb9e4b775b384d4b0fb32d72732467c3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1363 zcmah|TTc@~7(G)8OUrUAEpkx-6=(}ml`3lS0u|JxUSdsOd>ZOl7TaC3-5T|0_)FA> z8htQ6`=g9!x~1J#iP>a!=9}+3=X{s>_51q|09$xqASAHhHZnD*>b!O=JF{ckjwe0K zv7f2BlI26?8VCza9LcvbQZOgX2+X4g0R7oJ5cV4O}1`shZh#`UT zf@Q16joN{7pUZ=)5{MO?vaFV*Yw2^_81@dWy1-K5KQeLxMn!r1mPSe?d)$kjHG5{<=`9Fvf0U* z6RKH?U>U0hR(kqhd|&re%|sF@_TFg_AmIzKoXk^=SoB;aYq=4`v1Vc&7daiatWie1 zr|k5z>TvlU>cewj0v8`$UMnY4D*=6DyLx+iGaRrM_;<5Z@Hsy7x}inHR9^R Xi7uI6$=N_91@2+5<+#r^g!_L0xHc_> diff --git a/files/target/classes/ru/molokoin/Dimensions.class b/files/target/classes/ru/molokoin/Dimensions.class new file mode 100644 index 0000000000000000000000000000000000000000..df12d4b6fcaf19127f3cd8d411effe04909fef23 GIT binary patch literal 739 zcmZ`%%TB^T6g>l_K&?~}@qzCZc43z;G;TCT5~2$Y#$~|?3__bg(Vuc-qL{ew1NY1K7t-7Ab-9VC40~UU(O(z&lZW84Ohz46`r<=DPm9@Adqk z?OimxvK0wr9@K5r5fC*2vm;fz!=ibp0u>#xTdmc08v@30cq=WWVcW=IRv=y7ZCDU+ zY|LR^AUBlJ^@Pc&5~6zxHcGmeXYVXwcIqmS=c9g84zB!WPYM+4Vax9|{DIPWQZ%BD z8VW4er!RAmC;h683{3r6vyp{K6YU=p^v8wrEPN|lm*Hs8lBY_GI=_e6(>K93Y0|u6 ziXT}Sp*iCWTv^Ll%x*ZL=N$JHGj3&!g1a_G@rk7r78#2$7){13K{*r{%dBioU|7O3 zGZMryB7SM16a{$6MCOROwqm-K7p(lUTXA)USUYAdPo{oY&4g9x%TME~{N*YT;rzp; weeuu0IyMq6FV1-)_ZcgXG&osWkAZ@EQ9FKT5=#P`Q^A$L;L=p^RxGjo1qlve6#xJL literal 0 HcmV?d00001 diff --git a/files/target/classes/ru/molokoin/Extension.class b/files/target/classes/ru/molokoin/Extension.class index 0c76b87677aaff3c1472aa2f9d8346e45cc69ce9..19073a86b417a0e36365fa7a087d31e2893729c4 100644 GIT binary patch literal 2873 zcmZ`)Xh?>fx2GXW>8^Ra|lNronrTg|T`WO14 z#TtF;Q=fkBkLuHN-x-n+k}vblo%h~z?>%>!fB*aI4S=ioMMsy0!BRC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