-
Notifications
You must be signed in to change notification settings - Fork 0
/
DataRecords.java
86 lines (86 loc) · 1.67 KB
/
DataRecords.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
/**
*@file DataRecords.java
*This file provides DataRecords
*@author Abhinav Khattar 2015120
*@author Tushar Arora 2015107
*/
import java.util.*;
import java.io.*;
/**DataRecords store all info related to a Publication*/
public class DataRecords implements Comparable<DataRecords>{
private String author;
private String title;
private String pages;
private int year;
private String volume;
private String journal;
private String booktitle;
private String url;
private int stringMatch;
public DataRecords(String _author, String _title, String _pages, String _volume, String _year, String _journal, String _booktitle, String _url){
author = _author;
title = _title;
pages = _pages;
volume = _volume;
try{
year = Integer.parseInt(_year);
}
catch (Exception e){
year = 0;
}
journal = _journal;
booktitle = _booktitle;
url = _url;
stringMatch=0;
}
public int compareTo(DataRecords d2){
if (d2.getYear() > year){
return 1;
}
else if (d2.getYear() == year){
return 0;
}
return -1;
}
public boolean equals(DataRecords d2){
return d2.getYear() == year;
}
public String getAuthor(){
return author;
}
public String getTitle(){
return title;
}
public String getPages(){
return pages;
}
public String getVolume(){
return volume;
}
public int getYear(){
return year;
}
public String getJournal(){
return journal;
}
public String getBookTitle(){
return booktitle;
}
public String getJournalTitle(){
if (journal == null){
return booktitle;
}
return journal;
}
public String getURL(){
return url;
}
public int getStringMatch()
{
return stringMatch;
}
public void setStringMatch(int m)
{
stringMatch=m;
}
}