ch.aplu.nxt.platform
Class NxtProperties

java.lang.Object
  extended by ch.aplu.nxt.platform.NxtProperties

public class NxtProperties
extends java.lang.Object

Class to read properties from the NxtJLib property file. Many library options are defined in a property file 'nxtjlib.properties' that may be modified as needed.

Consult the distributed file for more information.


Constructor Summary
NxtProperties()
          Searches the property file 'nxtjlib.properties' in subdirectory 'res' and, if not found, in subdirectory 'ch/aplu/nxt/properties' of the jar file.
 
Method Summary
 double getDoubleValue(java.lang.String key)
          Gets the property value with the given key as double.
 int getIntValue(java.lang.String key)
          Gets the property value with the given key as int.
 java.lang.String getResourceInfo()
          Returns empty string.
 java.lang.String getStringValue(java.lang.String key)
          Gets the property value with the given key as string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NxtProperties

public NxtProperties()
Searches the property file 'nxtjlib.properties' in subdirectory 'res' and, if not found, in subdirectory 'ch/aplu/nxt/properties' of the jar file. Be careful to keep the original formatting.

Method Detail

getResourceInfo

public java.lang.String getResourceInfo()
Returns empty string. Declared for compatibility with J2SE.


getStringValue

public java.lang.String getStringValue(java.lang.String key)
Gets the property value with the given key as string. An error form is shown, if the property does not exist.

Parameters:
key - the key of the property
Returns:
the value of the property or empty string, if the property is not found

getIntValue

public int getIntValue(java.lang.String key)
Gets the property value with the given key as int. An error form is shown, if the property does not exist or has bad format.

Parameters:
key - the key of the property
Returns:
the value of the property or 0, if the property is not found or does not have integer format

getDoubleValue

public double getDoubleValue(java.lang.String key)
Gets the property value with the given key as double. An error form is shown, if the property does not exist or has bad format.

Parameters:
key - the key of the property
Returns:
the value of the property or 0, if the property is not found or does not have double format