agentland.device
Interface Device

All Superinterfaces:
Agent, Good, Managed, Remote, Spy
All Known Subinterfaces:
AbstractDeviceManager, AnotherDummyDevice, AudioMux, AutoPatchVideoMux, BaseAmplifier, BaseMux, CrossPointMux, DeviceManager, DimmableLight, DisplayDevice, Drapes, DrapesManager, DummyDevice, HKAVR7000Amplifier, IR, Light, LightManager, LynX10, ManualProjectionScreen, ManualProjector, MultiDevice, Mux, NamedMux, ProjectionScreen, Projector, ProjectorManager, TwoWayX10, UniversalDevice, X10, X10DimmableLight, X10Drapes, X10Light, X10ProjectionScreen
All Known Implementing Classes:
DeviceAgent

public interface Device
extends Managed


Fields inherited from interface metaglue.Agent
ALIVE, DIED, NO_METAGLUE, NOT_RUNNING, STARTING
 
Method Summary
 void addName(String newName)
          Allows you to add a new name by which this device can be known (or referred to)
 String getName()
          Returns THE name for the device, i.e.
 Vector getNames()
          Returns all names for this device; if there are no names, you get back an empty vector.
 DeviceState getState()
           
 DeviceState getState(String name)
           
 Vector getStateNames()
           
 boolean hasName(String name)
          returns true if this device can be called by the name passed as a parameter (matching is done in case-insensitive way)
 void resetAllStates()
           
 String resetName(String newName)
          Cleares all names for this device and sets newName as the only name for it.
 void resetState()
           
 void resetState(String name)
           
 String setName(int i, String newName)
          Allows you to change the name on the list; starting index is 0;
 void setState(DeviceState state)
           
 
Methods inherited from interface agentland.resource.Managed
getNeed, replace, replace, resources, yank, yank
 
Methods inherited from interface agentland.util.Good
getHistory, getHistoryElement, resetHistory
 
Methods inherited from interface metaglue.Agent
addMonitor, alive, getAgentID, getMetaglueAgentID, shutdown, startup, whereAreYou
 
Methods inherited from interface agentland.util.Spy
tell
 

Method Detail

setState

public void setState(DeviceState state)
              throws RemoteException

resetAllStates

public void resetAllStates()
                    throws RemoteException

resetState

public void resetState()
                throws RemoteException

resetState

public void resetState(String name)
                throws RemoteException

getState

public DeviceState getState()
                     throws RemoteException

getState

public DeviceState getState(String name)
                     throws RemoteException

getStateNames

public Vector getStateNames()
                     throws RemoteException

resetName

public String resetName(String newName)
                 throws RemoteException
Cleares all names for this device and sets newName as the only name for it.
Returns:
the old main name

addName

public void addName(String newName)
             throws RemoteException
Allows you to add a new name by which this device can be known (or referred to)

getName

public String getName()
               throws RemoteException
Returns THE name for the device, i.e. the first name on the list of names for this device

getNames

public Vector getNames()
                throws RemoteException
Returns all names for this device; if there are no names, you get back an empty vector.

setName

public String setName(int i,
                      String newName)
               throws RemoteException
Allows you to change the name on the list; starting index is 0;
Parameters:
i - index of the name to change (corresponding to what you see when you do getNames()
newName - new name
Returns:
the old name or null if index was out of bounds

hasName

public boolean hasName(String name)
                throws RemoteException
returns true if this device can be called by the name passed as a parameter (matching is done in case-insensitive way)