01: /*
02: * DataProperties.java
03: *
04: * Created on June 3, 2002, 1:23 PM
05: */
06: /*
07: * The Unified Mapping Platform (JUMP) is an extensible, interactive GUI
08: * for visualizing and manipulating spatial features with geometry and attributes.
09: *
10: * Copyright (C) 2003 Vivid Solutions
11: *
12: * This program is free software; you can redistribute it and/or
13: * modify it under the terms of the GNU General Public License
14: * as published by the Free Software Foundation; either version 2
15: * of the License, or (at your option) any later version.
16: *
17: * This program is distributed in the hope that it will be useful,
18: * but WITHOUT ANY WARRANTY; without even the implied warranty of
19: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20: * GNU General Public License for more details.
21: *
22: * You should have received a copy of the GNU General Public License
23: * along with this program; if not, write to the Free Software
24: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25: *
26: * For more information, contact:
27: *
28: * Vivid Solutions
29: * Suite #1A
30: * 2328 Government Street
31: * Victoria BC V8T 5G5
32: * Canada
33: *
34: * (250)385-6040
35: * www.vividsolutions.com
36: */
37:
38: package com.vividsolutions.jump.io;
39:
40: import java.util.Properties;
41:
42: /**
43: * Object to store a bunch of key/value pairs used by the input/output drivers/classes. <br>
44: *
45: * dp = new DriverProperties() <br>
46: * dp.set('DefaultValue','c:\me.shp') <br>
47: * <br>
48: * is the same as:<br>
49: * <br>
50: * dp = new DriverProperties('c:\me.shp')<br>
51: *<br>
52: * NOTE: dp.get('DefaultValue') is available via the parent class <br>
53: * Typically one uses 'DefaultValue' or 'InputFile' or 'OutputFile'
54: */
55: public class DriverProperties extends Properties {
56: /** Creates new DataProperties */
57: public DriverProperties() {
58: }
59:
60: /**
61: *constructor that will autoset the key 'DefaultValue'
62: *
63: *@param defaultValue value portion for the the key 'DefaultValue'
64: **/
65: public DriverProperties(String defaultValue) {
66: this .set("DefaultValue", defaultValue);
67: }
68:
69: /**
70: * Sets a key/value pair in the object. <br>
71: * It returns the object so you can cascade sets: <br>
72: * dp.set ('a','value1') <br>
73: * .set('b','value2') <br>
74: * ...
75: *@param key key name
76: *@param value key's value
77: */
78: public DriverProperties set(String key, String value) {
79: setProperty(key, value);
80:
81: return this;
82: }
83: }
|