Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

No Format
for ( Object o : cs.keySet() )
{
    System.out.println(o.toString() + "=" + cs.getString(o.toString()) );
}

Most likely, the typed values from the ConditionsSet need to be retrieved in order to do anything useful.

Here is an example showing how to convert conditions in a ConditionSet to their typed values, one-by-one.

No Format

for ( Object o : cs.keySet() )
{
    String k = (String) o;

    Class typ = cs.getType(k);
 
    if ( typ.toString().equals("double"))
    {
        double dblVal = cs.getDouble(k);                        
    }
    else if ( typ.toString().equals("integer"))
    {
        int intVal = cs.getInteger(k);
    }
    else if ( typ.toString().equals("java.lang.String"))
    {
        String strVal = cs.getString(k);
    }
}

Presumably, an algorithm will do something with the value once it is retrieved.