01 /*
02 * DocumentData.java
03 *
04 * Copyright (c) 1995-2010, The University of Sheffield. See the file
05 * COPYRIGHT.txt in the software or at http://gate.ac.uk/gate/COPYRIGHT.txt
06 *
07 * This file is part of GATE (see http://gate.ac.uk/), and is free
08 * software, licenced under the GNU Library General Public License,
09 * Version 2, June 1991 (in the distribution as file licence.html,
10 * and also available at http://gate.ac.uk/gate/licence.html).
11 *
12 * Marin Dimitrov, 05/Mar/2002
13 *
14 * $Id: DocumentData.java 12006 2009-12-01 17:24:28Z thomas_heitz $
15 */
16
17 package gate.corpora;
18
19 import java.io.Serializable;
20
21 public class DocumentData implements Serializable {
22
23 //fix the ID for serialisation
24 static final long serialVersionUID = 4192762901421847525L;
25
26 public DocumentData(String name, Object ID, String classType){
27 docName = name;
28 persistentID = ID;
29 this.classType = classType;
30 }
31
32 public DocumentData(String name, Object ID){
33 docName = name;
34 persistentID = ID;
35 this.classType = "gate.corpora.DocumentImpl";
36 }
37
38 public String getDocumentName() {
39 return docName;
40 }
41
42 public Object getPersistentID() {
43 return persistentID;
44 }
45
46 public void setPersistentID(Object newID) {
47 persistentID = newID;
48 }
49
50 public String toString() {
51 return new String("DocumentData: " + docName + ", " + persistentID + ", " + classType);
52 }
53
54 String docName;
55 Object persistentID;
56 String classType;
57
58 public String getClassType() {
59 if(classType == null) {
60 classType = DocumentImpl.class.getName();
61 }
62 return classType;
63 }
64
65 public void setClassType(String classType) {
66 this.classType = classType;
67
68 }
69 }
|