add --shared
[pylucene.git] / lucene-java-3.4.0 / lucene / contrib / benchmark / src / java / org / apache / lucene / benchmark / byTask / feeds / DocData.java
1 package org.apache.lucene.benchmark.byTask.feeds;
2
3 /**
4  * Licensed to the Apache Software Foundation (ASF) under one or more
5  * contributor license agreements.  See the NOTICE file distributed with
6  * this work for additional information regarding copyright ownership.
7  * The ASF licenses this file to You under the Apache License, Version 2.0
8  * (the "License"); you may not use this file except in compliance with
9  * the License.  You may obtain a copy of the License at
10  *
11  *     http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19
20 import java.util.Date;
21 import java.util.Properties;
22
23 import org.apache.lucene.document.DateTools;
24
25 /** Output of parsing (e.g. HTML parsing) of an input document. */
26 public class DocData {
27   
28   private String name;
29   private String body;
30   private String title;
31   private String date;
32   private int id;
33   private Properties props;
34   
35   public void clear() {
36     name = null;
37     body = null;
38     title = null;
39     date = null;
40     props = null;
41     id = -1;
42   }
43   
44   public String getBody() {
45     return body;
46   }
47
48   /**
49    * @return the date. If the ctor with Date was called, then the String
50    *         returned is the output of
51    *         {@link DateTools#dateToString(Date, org.apache.lucene.document.DateTools.Resolution)}
52    *         . Otherwise it's the String passed to the other ctor.
53    */
54   public String getDate() {
55     return date;
56   }
57
58   public String getName() {
59     return name;
60   }
61
62   public int getID() {
63     return id;
64   }
65
66   public Properties getProps() {
67     return props;
68   }
69
70   public String getTitle() {
71     return title;
72   }
73
74   public void setBody(String body) {
75     this.body = body;
76   }
77
78   public void setDate(Date date) {
79     if (date != null) {
80       setDate(DateTools.dateToString(date, DateTools.Resolution.SECOND));
81     } else {
82       this.date = null;
83     }
84   }
85
86   public void setDate(String date) {
87     this.date = date;
88   }
89
90   public void setName(String name) {
91     this.name = name;
92   }
93
94   public void setID(int id) {
95     this.id = id;
96   }
97
98   public void setProps(Properties props) {
99     this.props = props;
100   }
101
102   public void setTitle(String title) {
103     this.title = title;
104   }
105
106 }