com.monad.homerun.action
Class Binding

java.lang.Object
  extended by com.monad.homerun.action.Binding
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
DateBinding, EventBinding, ReflexBinding, TimeBinding

public class Binding
extends java.lang.Object
implements java.io.Serializable

Binding is a base class representing an action rule bound to a context of execution. Subclasses include TimeBinding (an action bound to a specific recurring time in a schedule), EventBinding (an action bound to the occurance of an event in an event plan), and DateBinding (an action bound to a date in a Calendar),

See Also:
Serialized Form

Field Summary
static int RUN_MODE
          Run (execute) the action rule immediately
static java.lang.String RUN_MODE_STR
           
static int START_MODE
          Start (schedule for execution when conditions met) the action rule
static java.lang.String START_MODE_STR
           
static int STOP_MODE
          Stop (de-schedule for execution) the action rule
static java.lang.String STOP_MODE_STR
           
 
Constructor Summary
Binding()
          Creates a binding with no attributes.
Binding(Binding b)
          Creates a binding cloned from passed binding.
Binding(int mode, java.lang.String actionName, java.lang.String category)
          Creates a binding with specified mode, name and category.
 
Method Summary
 java.lang.String getActionCategory()
          Returns the category of the bound action
static java.lang.String getActionMode(int mode)
          Returns a readable string for the mode
 java.lang.String getActionName()
          Returns the name of the bound action rule
 int getMode()
          Returns the binding mode
static java.lang.String getModeIconName(int mode)
          Returns the name of the icon for the binding mode
static java.lang.String[] getModes()
          Returns all modes as readable strings
 java.lang.String getNote()
          Returns an optional note
 java.util.Map<java.lang.String,java.lang.String> getProperties()
           
 java.lang.String getProperty(java.lang.String name)
          Returns the value of the named property
static int modeFor(java.lang.String mode)
          Returns a mode for a readable string
 void setNote(java.lang.String note)
          Sets the value of the optional note
 void setProperties(java.util.Map<java.lang.String,java.lang.String> props)
           
 void setProperty(java.lang.String name, java.lang.String value)
          Assigns a value to a property
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RUN_MODE

public static final int RUN_MODE
Run (execute) the action rule immediately

See Also:
Constant Field Values

START_MODE

public static final int START_MODE
Start (schedule for execution when conditions met) the action rule

See Also:
Constant Field Values

STOP_MODE

public static final int STOP_MODE
Stop (de-schedule for execution) the action rule

See Also:
Constant Field Values

RUN_MODE_STR

public static final java.lang.String RUN_MODE_STR
See Also:
Constant Field Values

START_MODE_STR

public static final java.lang.String START_MODE_STR
See Also:
Constant Field Values

STOP_MODE_STR

public static final java.lang.String STOP_MODE_STR
See Also:
Constant Field Values
Constructor Detail

Binding

public Binding()
Creates a binding with no attributes.


Binding

public Binding(int mode,
               java.lang.String actionName,
               java.lang.String category)
Creates a binding with specified mode, name and category.

Parameters:
mode - the action mode (run, start, or stop)
actionName - the name of the bond action
category - the category of the action (which is its namespace)

Binding

public Binding(Binding b)
Creates a binding cloned from passed binding.

Parameters:
b - the binding to clone
Method Detail

getMode

public int getMode()
Returns the binding mode

Returns:
mode - the binding mode (run, start or stop)

getActionMode

public static java.lang.String getActionMode(int mode)
Returns a readable string for the mode

Parameters:
mode - the mode
Returns:
mode String - a readable String

modeFor

public static int modeFor(java.lang.String mode)
Returns a mode for a readable string

Parameters:
mode - the readable string
Returns:
mode the mode

getModes

public static java.lang.String[] getModes()
Returns all modes as readable strings

Returns:
an array of readable mode names

getActionName

public java.lang.String getActionName()
Returns the name of the bound action rule

Returns:
action name

getActionCategory

public java.lang.String getActionCategory()
Returns the category of the bound action

Returns:
action category

getModeIconName

public static java.lang.String getModeIconName(int mode)
Returns the name of the icon for the binding mode

Parameters:
mode - the binding mode
Returns:
the icon name

getNote

public java.lang.String getNote()
Returns an optional note

Returns:
an optional binding note

setNote

public void setNote(java.lang.String note)
Sets the value of the optional note

Parameters:
note - the note string value

getProperty

public java.lang.String getProperty(java.lang.String name)
Returns the value of the named property

Parameters:
name - the name of the property

setProperty

public void setProperty(java.lang.String name,
                        java.lang.String value)
Assigns a value to a property


getProperties

public java.util.Map<java.lang.String,java.lang.String> getProperties()

setProperties

public void setProperties(java.util.Map<java.lang.String,java.lang.String> props)


Copyright © 2006-2009 Richard Rodgers. All Rights Reserved.