From ef8f7a96a6ddcc8ef3641ce830dac350f5816316 Mon Sep 17 00:00:00 2001 From: Victor Date: Tue, 26 Nov 2013 00:02:40 +0200 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=20=D0=BA=D0=BB=D0=B0=D1=81=D1=81=20=D1=85=D1=80=D0=B0?= =?UTF-8?q?=D0=BD=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=B4=D0=B0=D0=BD=D0=BD=D1=8B?= =?UTF-8?q?=D1=85=20=D0=B7=D0=B0=D0=BF=D0=B8=D1=81=D0=B8=20=D0=B5=D0=B6?= =?UTF-8?q?=D0=B5=D0=B4=D0=BD=D0=B5=D0=B2=D0=BD=D0=B8=D0=BA=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/tse/lr4/NotePad.java | 65 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 src/tse/lr4/NotePad.java diff --git a/src/tse/lr4/NotePad.java b/src/tse/lr4/NotePad.java new file mode 100644 index 0000000..fecf119 --- /dev/null +++ b/src/tse/lr4/NotePad.java @@ -0,0 +1,65 @@ +package tse.lr4; + +import java.text.SimpleDateFormat; +import java.util.Date; + +/** + * Класс представления данных записи ежедневника. + * @author aNNiMON + */ +public class NotePad { + + private static final String DATE_PATTERN = "yyyy.MM.dd HH:mm:ss"; + + private String name, description; + private Date date; + private boolean important; + + public NotePad(String name, String description, Date date, boolean important) { + this.name = name; + this.description = description; + this.date = date; + this.important = important; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Date getDate() { + return date; + } + + public void setDate(Date date) { + this.date = date; + } + + public boolean isImportant() { + return important; + } + + public void setImportant(boolean important) { + this.important = important; + } + + + public String storeToCsvLine() { + final char SEPARATOR = ','; + return name + SEPARATOR + + description + SEPARATOR + + new SimpleDateFormat(DATE_PATTERN).format(date) + SEPARATOR + + important; + } +}