stella.roof
Class ShelterTrigger

java.lang.Object
  extended by util.PropertyContainer
      extended by util.PropertyResources
          extended by util.PropertyBundles
              extended by stella.parameter.AbstractParameter
                  extended by stella.parameter.AbstractRemoteParameter
                      extended by stella.parameter.AbstractRemoteTrigger
                          extended by stella.roof.ShelterTrigger
All Implemented Interfaces:
Cloneable, Remote, Parameter, RemoteParameter, RemoteTrigger, Trigger, ExitCleaning, Initializable, LocalizedSupplying, PropertySupplying, ResourceSupplying, RmiCaster

public class ShelterTrigger
extends AbstractRemoteTrigger

A trigger that directly connects to a Sheltering instance. It comes in two flavors, KEY_FLAVOR, operating either on Sheltering.isOpen() or Sheltering.isClosed(). This trigger is read-only. Its toggle-time is undefined.


Nested Class Summary
 
Nested classes/interfaces inherited from class util.PropertyResources
PropertyResources.URLResource
 
Field Summary
static String CLOSE
          The close flavor.
private static String DEFFLAVOR
          The default flavor.
static String KEY_FLAVOR
          The key to the flavor of the trigger.
static String OPEN
          The open flavor.
private  Sheltering roof
          The roof operating instance for this trigger.
 
Fields inherited from class stella.parameter.AbstractRemoteParameter
DEFBIND, KEY_BIND
 
Fields inherited from class stella.parameter.AbstractParameter
KEY_FORMAT, KEY_NAME, KEY_PRESERVE, UNKNOWN
 
Fields inherited from class util.PropertyBundles
KEY_LOCALECOUNTRY, KEY_LOCALELANGUAGE, KEY_RESOURCEBUNDLES
 
Fields inherited from class util.PropertyResources
KEY_NOINITONCREATE, localurl, locate, POSTFIX_DIR, POSTFIX_EXT, POSTFIX_FILE, POSTFIX_LIST, POSTFIX_URL, urlset
 
Fields inherited from class util.PropertyContainer
KEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATOR
 
Fields inherited from interface stella.rmi.RemoteTrigger
NAMING_EXTENSION
 
Fields inherited from interface util.PropertySupplying
CONFIG, KEY_CLASS
 
Fields inherited from interface util.ResourceSupplying
KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME
 
Constructor Summary
ShelterTrigger(Map<String,String> prop)
          Constructs a new roof trigger.
 
Method Summary
 Object get()
          Diverts to getTrigger().
 long getElapsedToggleTime()
          Returns the time elapsed since the last toggle event.
 String getFlavor()
          Returns the flavor of this roof trigger.
 Date getLastToggleTime()
          Returns the last toggle time of the trigger in the appropriate falvour.
 Boolean getTrigger()
          Gets the value of this parameter.
 boolean isTrue()
          Shortcut to getTrigger().
 void registerShelter(Sheltering operator)
          Sets the roof operator where queries are diverted to.
 Object set(Object newval)
          Not allowed.
 Boolean setTrigger(Boolean newval)
          Not allowed.
 Boolean toggleTrigger()
          Not allowed.
 
Methods inherited from class stella.parameter.AbstractRemoteTrigger
remoteGetTrigger, remoteIsTrue, remoteToggleTime
 
Methods inherited from class stella.parameter.AbstractRemoteParameter
addRmiListener, bindToRegistry, exit, init, isValid, remoteGet, removeRmiListener, rescanned, unbindFromRegistry
 
Methods inherited from class stella.parameter.AbstractParameter
createParameter, delivers, getFormatted, getFormatted, getName, getPreserveFile, getString, getString, register, setName, toString
 
Methods inherited from class util.PropertyBundles
clone, getLocalized, getLocalized, getLocalizedString, getLocalizedString, loadResource
 
Methods inherited from class util.PropertyResources
createFrom, createFrom, createFrom, getApplet, getAsResources, getLocalClassLoader, getPropertiesToKey, getPropertiesToKey, getResource, getResourceAsStream, getResourceFromKey, getResources, keyCreate, keyCreate, reload, setApplet
 
Methods inherited from class util.PropertyContainer
augment, augment, augment, defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsEnums, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, isNew, parseObject, reload, removeProperty, setObject, setProperties, setProperty, stringProperties
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface stella.rmi.RemoteParameter
addRmiListener, remoteGet, removeRmiListener
 
Methods inherited from interface util.rmi.RmiCaster
bindToRegistry, isValid, unbindFromRegistry
 
Methods inherited from interface stella.Parameter
getFormatted, getName, getString
 
Methods inherited from interface util.PropertySupplying
defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, parseObject, removeProperty, setObject, setProperty, stringProperties
 
Methods inherited from interface util.Initializable
init
 
Methods inherited from interface util.ResourceSupplying
getResource, getResourceAsStream, getResources
 

Field Detail

KEY_FLAVOR

public static final String KEY_FLAVOR
The key to the flavor of the trigger.

See Also:
Constant Field Values

OPEN

public static final String OPEN
The open flavor.

See Also:
Constant Field Values

CLOSE

public static final String CLOSE
The close flavor.

See Also:
Constant Field Values

DEFFLAVOR

private static final String DEFFLAVOR
The default flavor.

See Also:
Constant Field Values

roof

private Sheltering roof
The roof operating instance for this trigger.

Constructor Detail

ShelterTrigger

public ShelterTrigger(Map<String,String> prop)
               throws RemoteException
Constructs a new roof trigger. The RoofOperating instance must be registered to it prior to querying.

Throws:
RemoteException
Method Detail

registerShelter

public void registerShelter(Sheltering operator)
Sets the roof operator where queries are diverted to.


getFlavor

public String getFlavor()
Returns the flavor of this roof trigger. Either open or close.


getTrigger

public Boolean getTrigger()
Gets the value of this parameter. Depending on the KEY_FLAVOR of the trigger, either the operators is open or is closed method is queried.


isTrue

public boolean isTrue()
Shortcut to getTrigger().


get

public Object get()
Diverts to getTrigger().


set

public Object set(Object newval)
Not allowed.

Returns:
The previous value of this parameter.

setTrigger

public Boolean setTrigger(Boolean newval)
Not allowed.


toggleTrigger

public Boolean toggleTrigger()
Not allowed.


getLastToggleTime

public Date getLastToggleTime()
Returns the last toggle time of the trigger in the appropriate falvour. May return null, if querying for the wrong state.


getElapsedToggleTime

public long getElapsedToggleTime()
Returns the time elapsed since the last toggle event. If the method getLastToggleTime() returns null, -1 is returned.