-
Notifications
You must be signed in to change notification settings - Fork 0
/
TextInfo.java
70 lines (57 loc) · 1.27 KB
/
TextInfo.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
public class TextInfo
{
private String fileName;
private long charCount;
private long wordCount;
private long lineCount;
public TextInfo()
{
this(null, 0, 0, 0);
}
public TextInfo(String newFileName, long newCharCount,
long newWordCount, long newLineCount)
{
setFileName(newFileName);
setCharCount(newCharCount);
setWordCount(newWordCount);
setLineCount(newLineCount);
}
@Override
public String toString()
{
return String.format("%s:\t%d\t%d\t%d", getFileName(),
getCharCount(), getWordCount(), getLineCount());
}
public void setFileName(String newFileName)
{
fileName = newFileName;
}
public String getFileName()
{
return fileName;
}
public void setCharCount(long newCharCount)
{
charCount = newCharCount;
}
public long getCharCount()
{
return charCount;
}
public void setWordCount(long newWordCount)
{
wordCount = newWordCount;
}
public long getWordCount()
{
return wordCount;
}
public void setLineCount(long newLineCount)
{
lineCount = newLineCount;
}
public long getLineCount()
{
return lineCount;
}
}