org.basex.core
Class AProp

java.lang.Object
  extended by org.basex.core.AProp
Direct Known Subclasses:
GUIProp, Prop

public abstract class AProp
extends Object

This class assembles properties which are used all around the project. They are initially read from and finally written to disk.

Author:
Workgroup DBIS, University of Konstanz 2005-10, ISC License, Christian Gruen

Constructor Summary
AProp(String prop)
          Constructor.
 
Method Summary
 String get(Object[] key)
          Returns the requested string.
 boolean invert(Object[] key)
          Inverts a boolean property.
 boolean is(Object[] key)
          Returns the requested boolean.
 int num(Object[] key)
          Returns the requested integer.
 int[] nums(Object[] key)
          Returns the requested integer array.
 Object object(String key)
          Returns the requested object.
 void set(Object[] key, boolean val)
          Sets the specified boolean for the specified key.
 void set(Object[] key, int val)
          Sets the specified integer for the specified key.
 void set(Object[] key, int[] val)
          Sets the specified integer array for the specified key.
 void set(Object[] key, String val)
          Sets the specified value for the specified key.
 void set(Object[] key, String[] val)
          Sets the specified string array for the specified key.
 void set(String key, Object val)
          Sets the specified value for the specified key.
 String[] strings(Object[] key)
          Returns the requested string array.
 void write()
          Writes the properties to disk.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AProp

public AProp(String prop)
Constructor. Reads the configuration file and initializes the project properties. The file is located in the user's home directory. If the prop argument is set to null, reading is omitted.

Parameters:
prop - property file extension
Method Detail

write

public final void write()
Writes the properties to disk.


object

public final Object object(String key)
Returns the requested object.

Parameters:
key - key to be found
Returns:
value

get

public final String get(Object[] key)
Returns the requested string.

Parameters:
key - key to be found
Returns:
value

num

public final int num(Object[] key)
Returns the requested integer.

Parameters:
key - key to be found
Returns:
value

is

public final boolean is(Object[] key)
Returns the requested boolean.

Parameters:
key - key to be found
Returns:
value

strings

public final String[] strings(Object[] key)
Returns the requested string array.

Parameters:
key - key to be found
Returns:
value

nums

public final int[] nums(Object[] key)
Returns the requested integer array.

Parameters:
key - key to be found
Returns:
value

set

public final void set(Object[] key,
                      String val)
Sets the specified value for the specified key.

Parameters:
key - key to be found
val - value to be written

set

public final void set(Object[] key,
                      int val)
Sets the specified integer for the specified key.

Parameters:
key - key to be found
val - value to be written

set

public final void set(Object[] key,
                      boolean val)
Sets the specified boolean for the specified key.

Parameters:
key - key to be found
val - value to be written

set

public final void set(Object[] key,
                      String[] val)
Sets the specified string array for the specified key.

Parameters:
key - key to be found
val - value to be written

set

public final void set(Object[] key,
                      int[] val)
Sets the specified integer array for the specified key.

Parameters:
key - key to be found
val - value to be written

set

public final void set(String key,
                      Object val)
Sets the specified value for the specified key.

Parameters:
key - key to be found
val - value to be written

invert

public final boolean invert(Object[] key)
Inverts a boolean property.

Parameters:
key - key
Returns:
new value