Package ffx.utilities

Class FFXContext

java.lang.Object
org.apache.commons.configuration2.event.BaseEventSource
org.apache.commons.configuration2.AbstractConfiguration
org.apache.commons.configuration2.CompositeConfiguration
ffx.utilities.FFXContext
All Implemented Interfaces:
Cloneable, org.apache.commons.configuration2.Configuration, org.apache.commons.configuration2.event.EventSource, org.apache.commons.configuration2.ImmutableConfiguration, org.apache.commons.configuration2.sync.SynchronizerSupport

public class FFXContext extends org.apache.commons.configuration2.CompositeConfiguration
This represents the context of an FFX MolecularAssembly.

CompositeConfiguration is extended by adding the API used by the Groovy Binding class.

The Binding API represents the variable bindings of a script which can be altered from outside the script object or created and passed into it.

The Binding API is not supposed to be used in a multithreaded context.

Author:
Michael J. Schnieders
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor for FFXContext.
    A helper constructor used in main(String[]) method calls
    Constructor for FFXContext.
  • Method Summary

    Modifier and Type
    Method
    Description
    getVariable.
    Get the Map of all variables.
    boolean
    Simple check for whether the context contains a particular variable or not.
    void
    Remove the variable with the specified name.
    void
    setVariable(String name, Object value)
    Sets the value of the given variable
    void
    Set the Map of all variables.

    Methods inherited from class org.apache.commons.configuration2.CompositeConfiguration

    addConfiguration, addConfiguration, addConfigurationFirst, addConfigurationFirst, addPropertyDirect, clearInternal, clearPropertyDirect, clone, containsKeyInternal, getConfiguration, getInMemoryConfiguration, getKeysInternal, getKeysInternal, getList, getNumberOfConfigurations, getPropertyInternal, getSource, getStringArray, isEmptyInternal, removeConfiguration, setListDelimiterHandler

    Methods inherited from class org.apache.commons.configuration2.AbstractConfiguration

    addErrorLogListener, addProperty, addPropertyInternal, append, beginRead, beginWrite, clear, clearProperty, cloneInterpolator, containsKey, copy, endRead, endWrite, get, get, getArray, getArray, getBigDecimal, getBigDecimal, getBigInteger, getBigInteger, getBoolean, getBoolean, getBoolean, getByte, getByte, getByte, getCollection, getCollection, getConfigurationDecoder, getConversionHandler, getDouble, getDouble, getDouble, getDuration, getDuration, getEncodedString, getEncodedString, getFloat, getFloat, getFloat, getInt, getInt, getInteger, getInterpolator, getKeys, getKeys, getKeys, getKeysInternal, getList, getList, getList, getListDelimiterHandler, getLogger, getLong, getLong, getLong, getProperties, getProperties, getProperty, getShort, getShort, getShort, getString, getString, getSynchronizer, immutableSubset, initLogger, installInterpolator, interpolate, interpolate, interpolatedConfiguration, isEmpty, isScalarValue, isThrowExceptionOnMissing, lock, setConfigurationDecoder, setConversionHandler, setDefaultLookups, setInterpolator, setLogger, setParentInterpolator, setPrefixLookups, setProperty, setPropertyInternal, setSynchronizer, setThrowExceptionOnMissing, size, sizeInternal, subset, unlock

    Methods inherited from class org.apache.commons.configuration2.event.BaseEventSource

    addEventListener, clearErrorListeners, clearEventListeners, copyEventListeners, createErrorEvent, createEvent, fireError, fireEvent, getEventListenerRegistrations, getEventListeners, isDetailEvents, removeEventListener, setDetailEvents

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.apache.commons.configuration2.ImmutableConfiguration

    getEnum, getEnum
  • Constructor Details

    • FFXContext

      public FFXContext()

      Constructor for FFXContext.

    • FFXContext

      public FFXContext(Map<String,Object> variables)

      Constructor for FFXContext.

      Parameters:
      variables - a Map object
    • FFXContext

      public FFXContext(String[] args)
      A helper constructor used in main(String[]) method calls
      Parameters:
      args - are the command line arguments from a main()
  • Method Details

    • getVariable

      public Object getVariable(String name) throws Exception

      getVariable.

      Parameters:
      name - the name of the variable to lookup
      Returns:
      the variable value
      Throws:
      Exception - if any.
    • setVariable

      public void setVariable(String name, Object value)
      Sets the value of the given variable
      Parameters:
      name - the name of the variable to set
      value - the new value for the given variable
    • removeVariable

      public void removeVariable(String name)
      Remove the variable with the specified name.
      Parameters:
      name - the name of the variable to remove
    • hasVariable

      public boolean hasVariable(String name)
      Simple check for whether the context contains a particular variable or not.
      Parameters:
      name - the name of the variable to check for
      Returns:
      a boolean
    • getVariables

      public Map<String,Object> getVariables()
      Get the Map of all variables. This returns a reference and not a copy.
      Returns:
      a Map of the variables.
    • setVariables

      public void setVariables(Map<String,Object> variables)
      Set the Map of all variables. The reference is kept without making a copy.
      Parameters:
      variables - a Map of the variables.