DEVICE_TYPE - public class HardwareMap.DeviceMapping<DEVICE_TYPE extends HardwareDevice>
extends java.lang.Object
implements java.lang.Iterable<DEVICE_TYPE>
HardwareMap
comprised of all the devices of a particular device typeget(String),
get(String)| Constructor and Description |
|---|
HardwareMap.DeviceMapping(java.lang.Class<DEVICE_TYPE> deviceTypeClass) |
| Modifier and Type | Method and Description |
|---|---|
java.util.Set<java.util.Map.Entry<java.lang.String,DEVICE_TYPE>> |
entrySet()
Returns a collection of all the (name, device) pairs in this DeviceMapping.
|
DEVICE_TYPE |
get(java.lang.String deviceName) |
java.lang.Class<DEVICE_TYPE> |
getDeviceTypeClass() |
java.util.Iterator<DEVICE_TYPE> |
iterator()
Returns an iterator over all the devices in this DeviceMapping.
|
void |
put(java.lang.String deviceName,
DEVICE_TYPE device)
Registers a new device in this DeviceMapping under the indicated name.
|
boolean |
remove(java.lang.String deviceName)
Removes the device with the indicated name (if any) from this DeviceMapping.
|
int |
size()
Returns the number of devices currently in this DeviceMapping
|
public HardwareMap.DeviceMapping(java.lang.Class<DEVICE_TYPE> deviceTypeClass)
public java.lang.Class<DEVICE_TYPE> getDeviceTypeClass()
public DEVICE_TYPE get(java.lang.String deviceName)
public void put(java.lang.String deviceName,
DEVICE_TYPE device)
deviceName - the name by which the new device is to be known (case sensitive)device - the new device to be namedHardwareMap.put(String, HardwareDevice)public boolean remove(java.lang.String deviceName)
deviceName - the name of the device to remove.HardwareMap.remove(String, HardwareDevice)public java.util.Iterator<DEVICE_TYPE> iterator()
iterator in interface java.lang.Iterable<DEVICE_TYPE extends HardwareDevice>public java.util.Set<java.util.Map.Entry<java.lang.String,DEVICE_TYPE>> entrySet()
public int size()