source: other-projects/the-macronizer/trunk/src/java/util/MacroniserLogFileData.java@ 32745

Last change on this file since 32745 was 32745, checked in by ak19, 5 years ago

More Western Wilson stuff. 1. Major changes to fix handling of utf8 stuff in db so uniqueness actually works: so finding (selecting) exact matches works and insert unique violations don't happen from code. Inserting is now made lowercase since only macrons matter and case doesn't. 2. The SQL db's MarkedWords table needs to specify the uniqueness of its utf8 marked_word column differently for the utf8-ness to work.

File size: 2.6 KB
Line 
1package util;
2
3import java.time.LocalDate;
4import java.time.LocalTime;
5import java.time.format.DateTimeFormatter;
6
7public class MacroniserLogFileData {
8
9 //object variables
10 private LocalDate date;
11 private LocalTime time;
12 private String inputText;
13 private String outputText;
14
15 /**
16 * Constructor to set up object with stored values without the
17 * @param date - The date the log file was used
18 * @param inputText - The input text of the log file
19 * @param outputText - the fixed text of the log file with '<mark>' tags
20 */
21 public MacroniserLogFileData (LocalDate date, LocalTime time, String inputText, String outputText){
22 this.date = date;
23 this.time = time;
24 this.inputText = inputText;
25 this.outputText = outputText;
26 }
27
28 @Override
29 public String toString() {
30 //Set up the string builder containing all fields
31 StringBuilder sb = new StringBuilder();
32 sb.append("INFO : [");
33 sb.append(date.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
34 sb.append(" ");
35 sb.append(time.format(DateTimeFormatter.ofPattern("HH:mm:ss")));
36 sb.append("] DirectInput.doPost() \n Input:");
37 if(inputText != null) sb.append(inputText);
38 sb.append("Output:");
39 if(outputText != null) sb.append(outputText);
40
41 return sb.toString();
42 }
43
44 /*Getters and Setters for the appropriate variables*/
45
46 /**
47 * Gets the date
48 * @return the date of this instance
49 */
50 public LocalDate getDate() { return date; }
51
52 /**
53 * Sets the date
54 * @param date - the date that we are setting for this instance
55 */
56 public void setDate(LocalDate date) { this.date = date; }
57
58 /**
59 * Gets the time stored in this instance
60 * @return returns the time as LocalTime
61 */
62 public LocalTime getTime() { return time; }
63
64 /**
65 * Method to be called if the user wants to set the time
66 * @param time
67 */
68 public void setTime(LocalTime time) { this.time = time; }
69
70 /**
71 * Returns the input text
72 * @return - the input text of this instance
73 */
74 public String getInputText() { return inputText; }
75
76 /**
77 * Sets the input text
78 * @param inputText - the input text
79 */
80 public void setInputText(String inputText) { this.inputText = inputText; }
81
82 /**
83 * Returns the fixed text
84 * @return - the fixed text of this instance
85 */
86 public String getOutputText() { return outputText; }
87
88 /**
89 * Sets the fixed text to the given string
90 * @param outputText
91 */
92 public void setOutputText(String outputText) { this.outputText = outputText; }
93}
Note: See TracBrowser for help on using the repository browser.