From aa6f48f447881313cacf02a5d75c86abf6c11097 Mon Sep 17 00:00:00 2001 From: Victor Date: Tue, 26 Nov 2013 10:01:41 +0200 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=B5=D1=80=D0=B5=D0=BE=D0=BF=D1=80?= =?UTF-8?q?=D0=B5=D0=B4=D0=B5=D0=BB=D1=91=D0=BD=20=D0=BC=D0=B5=D1=82=D0=BE?= =?UTF-8?q?=D0=B4=20toString()?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/tse/lr4/NotePad.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/tse/lr4/NotePad.java b/src/tse/lr4/NotePad.java index 346e8aa..9034194 100644 --- a/src/tse/lr4/NotePad.java +++ b/src/tse/lr4/NotePad.java @@ -55,9 +55,14 @@ public class NotePad { this.important = important; } + @Override + public String toString() { + return getName() + ". " + getDescription(); + } + public static NotePad readFromCsvLine(String line) throws ParseException { if (line.isEmpty()) throw new RuntimeException("Пустая строка"); - String[] params = line.split(","); + String[] params = line.split("\t"); if (params.length != 4) throw new RuntimeException("Неверное количество параметров"); String name = params[0]; @@ -69,7 +74,7 @@ public class NotePad { } public String storeToCsvLine() { - final char SEPARATOR = ','; + final char SEPARATOR = '\t'; return name + SEPARATOR + description + SEPARATOR + new SimpleDateFormat(DATE_PATTERN).format(date) + SEPARATOR +