diff --git a/AlexeySinyuk/src/Blog/MainClass.java b/AlexeySinyuk/src/Blog/MainClass.java new file mode 100644 index 0000000..26c9c14 --- /dev/null +++ b/AlexeySinyuk/src/Blog/MainClass.java @@ -0,0 +1,10 @@ +package Blog; + + +public abstract class MainClass { + + public static void main(String[] args) { + + } + +} diff --git a/AlexeySinyuk/src/Blog/Post.java b/AlexeySinyuk/src/Blog/Post.java new file mode 100644 index 0000000..f359a3a --- /dev/null +++ b/AlexeySinyuk/src/Blog/Post.java @@ -0,0 +1,68 @@ +package Blog; + + +public class Post { + + private String title; + protected User poster; + protected String text; + protected String imgurl; + + private Post prevComment; + private Post nextComment; + + public Post (String title, User poster, String text){ + this.title = title; + this.poster = poster; + this.text = text; + + Poster.incPosts(); + } + + public Post (String title, User poster, String text, String imgurl){ + this(title, poster, text); + this.imgurl = imgurl; + + Poster.incPosts(); + } + + public String getTitle (){ + return title; + } + + public User getPoster (){ + return poster; + } + + public String getText (){ + return text; + } + + public String getImgurl () { + return imgurl; + } + + public void setText (String text){ + this.text = text; + } + + public void setImgurl (String imgurl) { + this.imgurl = imgurl; + } + + public void addComment (User poster, String text){ + + } + + public void addComment (User poster, String text, String imgurl){ + + } + + public void Delete (){ + + } + + public void Print (){ + + } +} diff --git a/AlexeySinyuk/src/Blog/User.java b/AlexeySinyuk/src/Blog/User.java new file mode 100644 index 0000000..a25e151 --- /dev/null +++ b/AlexeySinyuk/src/Blog/User.java @@ -0,0 +1,43 @@ +package Blog; + +import javafx.geometry.Pos; + + +public class User { + + private String name; + private String surname; + private int posts = 0; + private int comments = 0; + + public User (String name, String surname){ + this.name = name; + this.surname = surname; + } + + public String getName(){ + return name; + } + + public String getSurname(){ + return surname; + } + + public int getPosts (){ + return posts; + } + + int incPosts (){ + posts++; + return posts; + } + + int decPosts (){ + posts--; + return posts; + } + + public int getCommentsNum() { + return comments; + } +}