Class marimba.util.Props
All Packages Class Hierarchy This Package Previous Next Index
Class marimba.util.Props
java.lang.Object
|
+----java.util.Dictionary
|
+----java.util.Hashtable
|
+----java.util.Properties
|
+----marimba.util.Props
- public class Props
- extends Properties
- implements Cloneable
A wrapper class for Properties. Add adds a header, file name,
is case insensitive, and keeps track of changes.
- Version:
- 1.39, 01/04/97
- Author:
- Arthur van Hoff
-
changed
-
-
Props(Properties, String, String)
- Construct from parent.
-
Props(String, File, boolean)
- Constructor.
-
Props(String, String)
- Constructor.
-
Props(String, String, boolean)
- Constructor.
-
addPropsFrom(Props)
-
-
clean()
-
-
clear()
-
-
clone()
-
-
get(Object)
- Get a property, ignore case.
-
getBoolean(String, boolean)
-
-
getFile()
-
-
getInteger(String, int)
-
-
getLong(String, long)
-
-
getProperty(String)
- Get a property, ignore case.
-
getProperty(String, String)
- Get a property, ignore case.
-
load()
- Load from the file.
-
put(Object, Object)
- Store a property.
-
remove(Object)
- Remove a key.
-
save()
- Save to the file.
-
save(FastOutputStream, String)
- Save properties to an OutputStream.
-
setProp(Object, Object)
- Store a property only if the value is not null or
an empty string.
-
setProperty(String, String)
- Set a property, ignore case.
-
toString()
- Debugging.
-
touch()
- Mark the properties as changed.
changed
public boolean changed
Props
public Props(String hdr,
String file)
- Constructor.
Props
public Props(String hdr,
File file,
boolean sensitive)
- Constructor.
Props
public Props(String hdr,
String file,
boolean sensitive)
- Constructor.
Props
public Props(Properties parent,
String hdr,
String file)
- Construct from parent.
clone
public Object clone()
- Overrides:
- clone in class Hashtable
save
public synchronized boolean save()
- Save to the file. Return false if the save fails for any reason.
save
public synchronized void save(FastOutputStream prnt,
String header)
- Save properties to an OutputStream. Use the header as
a comment at the top of the file. This now uses a FastOutputStream
so that it is more efficient and so that it saves it in the
appropriate format.
load
public synchronized boolean load()
- Load from the file. Returns whether the load succeeded.
touch
public synchronized void touch()
- Mark the properties as changed.
clear
public synchronized void clear()
- Overrides:
- clear in class Hashtable
clean
public synchronized void clean()
remove
public synchronized Object remove(Object key)
- Remove a key.
- Overrides:
- remove in class Hashtable
get
public Object get(Object key)
- Get a property, ignore case.
- Overrides:
- get in class Hashtable
getProperty
public String getProperty(String key)
- Get a property, ignore case.
- Overrides:
- getProperty in class Properties
getProperty
public String getProperty(String key,
String defaultValue)
- Get a property, ignore case.
- Overrides:
- getProperty in class Properties
put
public synchronized Object put(Object key,
Object val)
- Store a property. If the key is a string, then convert it
to lower case.
- Overrides:
- put in class Hashtable
addPropsFrom
public synchronized void addPropsFrom(Props src)
setProp
public synchronized Object setProp(Object key,
Object val)
- Store a property only if the value is not null or
an empty string.
setProperty
public synchronized void setProperty(String key,
String val)
- Set a property, ignore case.
getFile
public String getFile()
getLong
public long getLong(String name,
long def)
getInteger
public int getInteger(String name,
int def)
getBoolean
public boolean getBoolean(String name,
boolean def)
toString
public String toString()
- Debugging.
- Overrides:
- toString in class Hashtable
All Packages Class Hierarchy This Package Previous Next Index