|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdeadbeef.Tools.Props
public class Props
Property class to ease use of ini files to save/load properties
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Constructor Summary | |
---|---|
Props()
Constructor |
Method Summary | |
---|---|
void |
clear()
Clear all properties |
boolean |
get(java.lang.String key,
boolean def)
Get boolean property |
double |
get(java.lang.String key,
double def)
Get double property |
int |
get(java.lang.String key,
int def)
Get integer property |
int[] |
get(java.lang.String key,
int[] def)
Get integer array property |
java.lang.String |
get(java.lang.String key,
java.lang.String def)
Get string property |
java.lang.String[] |
get(java.lang.String key,
java.lang.String[] def)
Get string array property |
boolean |
load(java.lang.String fname)
Load property file |
boolean |
load(java.net.URL file)
Load property file |
void |
remove(java.lang.String key)
Remove key |
boolean |
save(java.lang.String fname)
Save property file |
void |
set(java.lang.String key,
boolean value)
Set boolean property |
void |
set(java.lang.String key,
double value)
Set double property |
void |
set(java.lang.String key,
int value)
Set integer property |
void |
set(java.lang.String key,
java.lang.String value)
Set string property |
void |
setHeader(java.lang.String h)
Set the property file header |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Props()
Method Detail |
---|
public void setHeader(java.lang.String h)
h
- String containing Header informationpublic void clear()
public void remove(java.lang.String key)
key
- Name of keypublic void set(java.lang.String key, java.lang.String value)
key
- Name of the key to set value forvalue
- Value to setpublic void set(java.lang.String key, int value)
key
- Name of the key to set value forvalue
- Value to setpublic void set(java.lang.String key, boolean value)
key
- Name of the key to set value forvalue
- Value to setpublic void set(java.lang.String key, double value)
key
- Name of the key to set value forvalue
- Value to setpublic java.lang.String get(java.lang.String key, java.lang.String def)
key
- Name of the key to get value fordef
- Default value in case key is not found
public int get(java.lang.String key, int def)
key
- Name of the key to get value fordef
- Default value in case key is not found
public int[] get(java.lang.String key, int[] def)
key
- Name of the key to get value fordef
- Default value in case key is not found
public java.lang.String[] get(java.lang.String key, java.lang.String[] def)
key
- Name of the key to get value fordef
- Default value in case key is not found
public boolean get(java.lang.String key, boolean def)
key
- Name of the key to get value fordef
- Default value in case key is not found
public double get(java.lang.String key, double def)
key
- Name of the key to get value fordef
- default value in case key is not found
public boolean save(java.lang.String fname)
fname
- File name of property file
public boolean load(java.net.URL file)
file
- File handle of property file
public boolean load(java.lang.String fname)
fname
- File name of property file
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |