Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions AlexeySinyuk/src/Blog/MainClass.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package Blog;


public abstract class MainClass {

public static void main(String[] args) {

}

}
68 changes: 68 additions & 0 deletions AlexeySinyuk/src/Blog/Post.java
Original file line number Diff line number Diff line change
@@ -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 (){

}
}
43 changes: 43 additions & 0 deletions AlexeySinyuk/src/Blog/User.java
Original file line number Diff line number Diff line change
@@ -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;
}
}