01: // kelondroObjectsMapEntry.java
02: // ----------------------------
03: // (C) 29.01.2007 by Michael Peter Christen; mc@anomic.de, Frankfurt a. M., Germany
04: // first published 2004 as part of kelondroMap on http://www.anomic.de
05: //
06: // This is a part of YaCy, a peer-to-peer based web search engine
07: //
08: // $LastChangedDate: 2006-04-02 22:40:07 +0200 (So, 02 Apr 2006) $
09: // $LastChangedRevision: 1986 $
10: // $LastChangedBy: orbiter $
11: //
12: // LICENSE
13: //
14: // This program is free software; you can redistribute it and/or modify
15: // it under the terms of the GNU General Public License as published by
16: // the Free Software Foundation; either version 2 of the License, or
17: // (at your option) any later version.
18: //
19: // This program is distributed in the hope that it will be useful,
20: // but WITHOUT ANY WARRANTY; without even the implied warranty of
21: // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22: // GNU General Public License for more details.
23: //
24: // You should have received a copy of the GNU General Public License
25: // along with this program; if not, write to the Free Software
26: // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27:
28: package de.anomic.kelondro;
29:
30: import java.io.IOException;
31: import java.util.HashMap;
32:
33: public class kelondroObjectsMapEntry implements kelondroObjectsEntry {
34:
35: protected HashMap<String, String> entry;
36:
37: public kelondroObjectsMapEntry() {
38: this .entry = new HashMap<String, String>();
39: }
40:
41: public kelondroObjectsMapEntry(HashMap<String, String> map) {
42: this .entry = map;
43: }
44:
45: public kelondroObjectsMapEntry(kelondroRA ra) {
46: this .read(ra);
47: }
48:
49: public void read(kelondroRA ra) {
50: try {
51: this .entry = ra.readMap();
52: } catch (IOException e) {
53: e.printStackTrace();
54: }
55: }
56:
57: public void write(kelondroRA ra) {
58: try {
59: ra.writeMap(this .entry, "");
60: } catch (IOException e) {
61: e.printStackTrace();
62: }
63: }
64:
65: public HashMap<String, String> map() {
66: return this.entry;
67: }
68:
69: }
|