org.eclipse.ocl.options
Class BasicOption<T>

java.lang.Object
  extended by org.eclipse.ocl.options.BasicOption<T>
All Implemented Interfaces:
Option<T>

public class BasicOption<T>
extends java.lang.Object
implements Option<T>

Useful implementation of the Option interface for OCL parsing options.


Constructor Summary
BasicOption(java.lang.String key, T defaultValue)
          Initializes me with my key and default value.
 
Method Summary
 T getDefaultValue()
          Obtains the option's default value.
 java.lang.String getKey()
          Obtains my string key, which may be used for persistence in a preference store.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicOption

public BasicOption(java.lang.String key,
                   T defaultValue)
Initializes me with my key and default value.

Parameters:
key - identifies me
defaultValue - my default value
Method Detail

getKey

public final java.lang.String getKey()
Description copied from interface: Option
Obtains my string key, which may be used for persistence in a preference store.

Specified by:
getKey in interface Option<T>
Returns:
my key. Is never null

getDefaultValue

public final T getDefaultValue()
Description copied from interface: Option
Obtains the option's default value.

Specified by:
getDefaultValue in interface Option<T>
Returns:
my default value, which default-default is null

Copyright 2002, 2007 IBM Corporation and others.
All Rights Reserved.