]> gitweb.fperrin.net Git - Dictionary.git/blob - jars/gss-lib-2.2/src/com/pras/table/Record.java
Added gss-lib-2.2.
[Dictionary.git] / jars / gss-lib-2.2 / src / com / pras / table / Record.java
1 /*\r
2  * Copyright (C) 2010 Prasanta Paul, http://prasanta-paul.blogspot.com\r
3  *\r
4  * Licensed under the Apache License, Version 2.0 (the "License");\r
5  * you may not use this file except in compliance with the License.\r
6  * You may obtain a copy of the License at\r
7  *\r
8  *      http://www.apache.org/licenses/LICENSE-2.0\r
9  *\r
10  * Unless required by applicable law or agreed to in writing, software\r
11  * distributed under the License is distributed on an "AS IS" BASIS,\r
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
13  * See the License for the specific language governing permissions and\r
14  * limitations under the License.\r
15  */\r
16 \r
17 package com.pras.table;\r
18 \r
19 import java.util.HashMap;\r
20 \r
21 /**\r
22  * This class represents individual records of the Table (associated with an WorkSheet)\r
23  * \r
24  * @author Prasanta Paul\r
25  */\r
26 public class Record {\r
27         /**\r
28          * <link rel='edit' href="">\r
29          */\r
30         String editURL;\r
31         /**\r
32          * <id> node of an entry\r
33          */\r
34         String id;\r
35 \r
36         /**\r
37          * It will store data of a single row\r
38          * <Col_Name> <Value>\r
39          */\r
40         HashMap<String, String> data = new HashMap<String, String>();\r
41 \r
42         /**\r
43          * Get Record Edit URL\r
44          * @return\r
45          */\r
46         public String getEditURL() {\r
47                 return editURL;\r
48         }\r
49 \r
50         /**\r
51          * Set Record Edit URL\r
52          * @param editURL\r
53          */\r
54         public void setEditURL(String editURL) {\r
55                 this.editURL = editURL;\r
56         }\r
57 \r
58         /**\r
59          * Get data of this Record\r
60          * @return\r
61          */\r
62         public HashMap<String, String> getData() {\r
63                 return data;\r
64         }\r
65         \r
66         /**\r
67          * Remove all stored data from this Record\r
68          */\r
69         public void clearData(){\r
70                 data.clear();\r
71         }\r
72         \r
73         /**\r
74          * Add data into this Record\r
75          * \r
76          * @param colName\r
77          * @param value\r
78          */\r
79         public void addData(String colName, String value){\r
80                 data.put(colName, value);\r
81         }\r
82         \r
83         /**\r
84          * Set Data into this Record\r
85          * @param data\r
86          */\r
87         public void setData(HashMap<String, String> data) {\r
88                 this.data = data;\r
89         }\r
90         /**\r
91          * Get ID URL of this Record\r
92          * @return\r
93          */\r
94         public String getId() {\r
95                 return id;\r
96         }\r
97 \r
98         /**\r
99          * Set ID URL of this Record\r
100          * @param id\r
101          */\r
102         public void setId(String id) {\r
103                 this.id = id;\r
104         }\r
105 }\r