org.objectledge.parameters
Interface Parameters

All Known Implementing Classes:
CompoundParameters, DBParameters, DefaultParameters, DirectoryParameters, ScopedParameters, SortedParameters

public interface Parameters

A container of parameters.

Version:
$Id: Parameters.java,v 1.14 2005/12/20 09:09:32 pablo Exp $
Author:
Pawel Potempski

Method Summary
 void add(Parameters parameters, boolean overwrite)
          Adds all parameters from another container to this container.
 void add(String name, boolean value)
          Add the parameter.
 void add(String name, boolean[] values)
          Add the parameter.
 void add(String name, Date value)
          Add the parameter.
 void add(String name, Date[] values)
          Add the parameter.
 void add(String name, float value)
          Add the parameter.
 void add(String name, float[] values)
          Add the parameter.
 void add(String name, int value)
          Add the parameter.
 void add(String name, int[] values)
          Add the parameter.
 void add(String name, long value)
          Add the parameter.
 void add(String name, long[] values)
          Add the parameter.
 void add(String name, String value)
          Add the parameter.
 void add(String name, String[] values)
          Add the parameter.
 String get(String name)
          Return the parameter with specified name.
 String get(String name, String defaultValue)
          Return the parameter with specified name.
 boolean getBoolean(String name)
          Return the parameter with specified name.
 boolean getBoolean(String name, boolean defaultValue)
          Return the parameter with specified name.
 boolean[] getBooleans(String name)
          Return all values of the parameter with specified name as an array.
 Parameters getChild(String prefix)
          Return a parameters object that represents a subset of parameters with specified prefix.
 Date getDate(String name)
          Return the parameter with specified name.
 Date getDate(String name, Date defaultValue)
          Return the parameter with specified name.
 Date[] getDates(String name)
          Return all values of the parameter with specified name as an array.
 float getFloat(String name)
          Return the parameter with specified name.
 float getFloat(String name, float defaultValue)
          Return the parameter with specified name.
 float[] getFloats(String name)
          Return all values of the parameter with specified name as an array.
 int getInt(String name)
          Return the parameter with specified name.
 int getInt(String name, int defaultValue)
          Return the parameter with specified name.
 int[] getInts(String name)
          Return all values of the parameter with specified name as an array.
 long getLong(String name)
          Return the parameter with specified name.
 long getLong(String name, long defaultValue)
          Return the parameter with specified name.
 long[] getLongs(String name)
          Return the parameter as array of long values.
 String[] getParameterNames()
          Return the names of all parameters.
 String[] getStrings(String name)
          Return all values of the parameter with specified name as an array.
 boolean isDefined(String name)
          Checks whether parameter is defined.
 void remove()
          Remove all parameters.
 void remove(Set<String> keys)
          Remove all parameters with a name contained in given set.
 void remove(String name)
          Remove all parameters with a specified name.
 void remove(String name, Date value)
          Remove all parameters with a specified name and value.
 void remove(String name, float value)
          Remove all parameters with a specified name and value.
 void remove(String name, int value)
          Remove all parameters with a specified name and value.
 void remove(String name, long value)
          Remove all parameters with a specified name and value.
 void remove(String name, String value)
          Remove all parameters with a specified name and string value.
 void removeExcept(Set<String> keys)
          Remove all except those with a keys specified in the set.
 void set(Parameters parameters)
          Reset state to equal with given parameters.
 void set(String name, boolean value)
          Set the parameter.
 void set(String name, boolean[] values)
          Set the parameter.
 void set(String name, Date value)
          Set the parameter.
 void set(String name, Date[] values)
          Set the parameter.
 void set(String name, float value)
          Set the parameter.
 void set(String name, float[] values)
          Set the parameter.
 void set(String name, int value)
          Set the parameter.
 void set(String name, int[] values)
          Set the parameter.
 void set(String name, long value)
          Set the parameter.
 void set(String name, long[] values)
          Set the parameter.
 void set(String name, String value)
          Set the parameter.
 void set(String name, String[] values)
          Set the parameter.
 String toString()
          Returns the contained properties as a parsable String.
 

Method Detail

get

String get(String name)
Return the parameter with specified name.

Parameters:
name - the name of the parameter.
Returns:
the string value of the parameter.

get

String get(String name,
           String defaultValue)
Return the parameter with specified name.

Parameters:
name - the name of the parameter.
defaultValue - the default value of the parameter.
Returns:
the string value of the parameter.

getStrings

String[] getStrings(String name)
Return all values of the parameter with specified name as an array.

Parameters:
name - the name of the parameters.
Returns:
the array of the string values of the parameter.

getBoolean

boolean getBoolean(String name)
Return the parameter with specified name.

Parameters:
name - the name of the parameter.
Returns:
the boolean value of the parameter.

getBoolean

boolean getBoolean(String name,
                   boolean defaultValue)
Return the parameter with specified name.

Parameters:
name - the name of the parameter.
defaultValue - the default value of the parameter.
Returns:
the boolean value of the parameter.

getBooleans

boolean[] getBooleans(String name)
Return all values of the parameter with specified name as an array.

Parameters:
name - the name of the parameters.
Returns:
the array of the boolean values of the parameter.

getDate

Date getDate(String name)
Return the parameter with specified name. The assumed String value of this parameter is a decimal representation of a Unix time-stamp.

Parameters:
name - the name of the parameter.
Returns:
the date value of the parameter.

getDate

Date getDate(String name,
             Date defaultValue)
Return the parameter with specified name. The assumed String value of this parameter is a decimal representation of a Unix time-stamp.

Parameters:
name - the name of the parameter.
defaultValue - the default value of the parameter.
Returns:
the date value of the parameter.

getDates

Date[] getDates(String name)
Return all values of the parameter with specified name as an array. The assumed String values of this parameter is are decimal representations of Unix time-stamps.

Parameters:
name - the name of the parameters.
Returns:
the array of the date values of the parameter.

getFloat

float getFloat(String name)
               throws NumberFormatException
Return the parameter with specified name.

Parameters:
name - the name of the parameter.
Returns:
the float value of the parameter.
Throws:
NumberFormatException - if parameter is not a number.

getFloat

float getFloat(String name,
               float defaultValue)
Return the parameter with specified name.

Parameters:
name - the name of the parameter.
defaultValue - the default value of the parameter.
Returns:
the float value of the parameter.

getFloats

float[] getFloats(String name)
                  throws NumberFormatException
Return all values of the parameter with specified name as an array.

Parameters:
name - the name of the parameters.
Returns:
the array of the float values of the parameter.
Throws:
NumberFormatException - if anyone of the values is not a number.

getInt

int getInt(String name)
           throws NumberFormatException
Return the parameter with specified name.

Parameters:
name - the name of the parameter.
Returns:
the integer value of the parameter.
Throws:
NumberFormatException - if parameter is not a number.

getInt

int getInt(String name,
           int defaultValue)
Return the parameter with specified name.

Parameters:
name - the name of the parameter.
defaultValue - the default value of the parameter.
Returns:
the integer value of the parameter.

getInts

int[] getInts(String name)
              throws NumberFormatException
Return all values of the parameter with specified name as an array.

Parameters:
name - the name of the parameters.
Returns:
the array of the integer values of the parameter.
Throws:
NumberFormatException - if anyone of the values is not a number.

getLong

long getLong(String name)
             throws NumberFormatException
Return the parameter with specified name.

Parameters:
name - the name of the parameter.
Returns:
the integer value of the parameter.
Throws:
NumberFormatException - if parameter is not a number.

getLongs

long[] getLongs(String name)
                throws NumberFormatException
Return the parameter as array of long values.

Parameters:
name - the name of the parameter.
Returns:
the array of parameter values.
Throws:
NumberFormatException - if parameter is not a number.

getLong

long getLong(String name,
             long defaultValue)
Return the parameter with specified name.

Parameters:
name - the name of the parameter.
defaultValue - the default value of the parameter.
Returns:
the integer value of the parameter.

getParameterNames

String[] getParameterNames()
Return the names of all parameters.

Returns:
the parameter names.

isDefined

boolean isDefined(String name)
Checks whether parameter is defined.

Parameters:
name - the name of the parameter.
Returns:
true if parameter is defined.

remove

void remove()
Remove all parameters.


remove

void remove(String name)
Remove all parameters with a specified name.

Parameters:
name - the parameter name.

remove

void remove(String name,
            String value)
Remove all parameters with a specified name and string value.

Parameters:
name - the parameter name.
value - the parameter value.

remove

void remove(String name,
            Date value)
Remove all parameters with a specified name and value.

Parameters:
name - the parameter name.
value - the parameter value.

remove

void remove(String name,
            float value)
Remove all parameters with a specified name and value.

Parameters:
name - the parameter name.
value - the parameter value.

remove

void remove(String name,
            int value)
Remove all parameters with a specified name and value.

Parameters:
name - the parameter name.
value - the parameter value.

remove

void remove(String name,
            long value)
Remove all parameters with a specified name and value.

Parameters:
name - the parameter name.
value - the parameter value.

remove

void remove(Set<String> keys)
Remove all parameters with a name contained in given set.

Parameters:
keys - the set of keys.

removeExcept

void removeExcept(Set<String> keys)
Remove all except those with a keys specified in the set.

Parameters:
keys - the set of names.

set

void set(String name,
         String value)
Set the parameter.

Parameters:
name - the parameter name.
value - the parameter value.

set

void set(String name,
         String[] values)
Set the parameter.

Parameters:
name - the parameter name.
values - the parameter values.

set

void set(Parameters parameters)
Reset state to equal with given parameters.

Parameters:
parameters - the source parameters.

set

void set(String name,
         boolean value)
Set the parameter.

Parameters:
name - the parameter name.
value - the parameter value.

set

void set(String name,
         boolean[] values)
Set the parameter.

Parameters:
name - the parameter name.
values - the parameter values.

set

void set(String name,
         Date value)
Set the parameter.

Parameters:
name - the parameter name.
value - the parameter value.

set

void set(String name,
         Date[] values)
Set the parameter.

Parameters:
name - the parameter name.
values - the parameter values.

set

void set(String name,
         float value)
Set the parameter.

Parameters:
name - the parameter name.
value - the parameter value.

set

void set(String name,
         float[] values)
Set the parameter.

Parameters:
name - the parameter name.
values - the parameter values.

set

void set(String name,
         int value)
Set the parameter.

Parameters:
name - the parameter name.
value - the parameter value.

set

void set(String name,
         int[] values)
Set the parameter.

Parameters:
name - the parameter name.
values - the parameter values.

set

void set(String name,
         long value)
Set the parameter.

Parameters:
name - the parameter name.
value - the parameter value.

set

void set(String name,
         long[] values)
Set the parameter.

Parameters:
name - the parameter name.
values - the parameter values.

add

void add(String name,
         String value)
Add the parameter.

Parameters:
name - the parameter name.
value - the parameter value.

add

void add(String name,
         String[] values)
Add the parameter.

Parameters:
name - the parameter name.
values - the parameter values.

add

void add(String name,
         boolean value)
Add the parameter.

Parameters:
name - the parameter name.
value - the parameter value.

add

void add(String name,
         boolean[] values)
Add the parameter.

Parameters:
name - the parameter name.
values - the parameter values.

add

void add(String name,
         Date value)
Add the parameter.

Parameters:
name - the parameter name.
value - the parameter value.

add

void add(String name,
         Date[] values)
Add the parameter.

Parameters:
name - the parameter name.
values - the parameter values.

add

void add(String name,
         float value)
Add the parameter.

Parameters:
name - the parameter name.
value - the parameter value.

add

void add(String name,
         float[] values)
Add the parameter.

Parameters:
name - the parameter name.
values - the parameter values.

add

void add(String name,
         int value)
Add the parameter.

Parameters:
name - the parameter name.
value - the parameter value.

add

void add(String name,
         int[] values)
Add the parameter.

Parameters:
name - the parameter name.
values - the parameter values.

add

void add(String name,
         long value)
Add the parameter.

Parameters:
name - the parameter name.
value - the parameter value.

add

void add(String name,
         long[] values)
Add the parameter.

Parameters:
name - the parameter name.
values - the parameter values.

add

void add(Parameters parameters,
         boolean overwrite)
Adds all parameters from another container to this container. If overwrite is set to true all conflicting parameters from this container will be replaced, otherwise all parameters from another container will be added.

Parameters:
parameters - the parameters object.
overwrite - the overwrite switch.

toString

String toString()
Returns the contained properties as a parsable String.

Overrides:
toString in class Object
Returns:
parsable String representation of the contained properties.

getChild

Parameters getChild(String prefix)
Return a parameters object that represents a subset of parameters with specified prefix.

Parameters:
prefix - the prefix.
Returns:
the nested parameters object.


Copyright © 2003-2006 objectledge.org. All Rights Reserved.