com.sun.jimi.core.options
Class FormatOption

java.lang.Object
  |
  +--com.sun.jimi.core.options.FormatOption
Direct Known Subclasses:
BooleanOption, IntOption

public class FormatOption
extends java.lang.Object
implements java.lang.Cloneable

Class representing an option for a format. Options include such things as compression scheme, use of interlacing, or any other parameter that a file format makes use of.


Field Summary
protected  java.lang.Object defaultValue
           
protected  java.lang.String description
           
protected  java.lang.String name
           
protected  java.lang.Object possibleValues
           
protected  java.lang.Object value
           
 
Constructor Summary
FormatOption(java.lang.String name, java.lang.String description, java.lang.Object possibleValues, java.lang.Object defaultValue)
          Create a FormatOption object.
 
Method Summary
 java.lang.Object clone()
          Shallow-copy clone from java.lang.Object.
 java.lang.Object getDefaultValue()
          Get the default value of the option
 java.lang.String getDescription()
          Get a string describing the option.
 java.lang.String getName()
          Get the name of the option.
 java.lang.Object getPossibleValues()
          Get a set of objects describing the legal values of the option.
 java.lang.Object getValue()
          Get the current value of the option.
 void parseValue(java.lang.String value)
          Interpret the value of the option from a String.
 void setValue(java.lang.Object value)
          Set the value of the option.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

protected java.lang.String name

description

protected java.lang.String description

value

protected java.lang.Object value

possibleValues

protected java.lang.Object possibleValues

defaultValue

protected java.lang.Object defaultValue
Constructor Detail

FormatOption

public FormatOption(java.lang.String name,
                    java.lang.String description,
                    java.lang.Object possibleValues,
                    java.lang.Object defaultValue)
Create a FormatOption object.
Parameters:
name - the name of the option
description - a description of the item
possibleValues - an array of possible values for the option
defaultValue - the default value of the option
Method Detail

getName

public java.lang.String getName()
Get the name of the option.
Returns:
the name

getDescription

public java.lang.String getDescription()
Get a string describing the option.
Returns:
the description

getPossibleValues

public java.lang.Object getPossibleValues()
Get a set of objects describing the legal values of the option.
Returns:
the possible values

getValue

public java.lang.Object getValue()
Get the current value of the option.
Returns:
the value

setValue

public void setValue(java.lang.Object value)
              throws OptionException
Set the value of the option.

parseValue

public void parseValue(java.lang.String value)
                throws OptionException
Interpret the value of the option from a String. By default, this method passes the String to setValue().

getDefaultValue

public java.lang.Object getDefaultValue()
Get the default value of the option

clone

public java.lang.Object clone()
Shallow-copy clone from java.lang.Object.
Overrides:
clone in class java.lang.Object