SunSPOT API V6.0


com.sun.spot.resources
Class Resource

java.lang.Object
  extended by com.sun.spot.resources.Resource
All Implemented Interfaces:
IResource
Direct Known Subclasses:
AbstractAT91_PIO, Accelerometer3D, ADJDS311TriColorLightSensor, AnalogInput, AT91_I2C, AT91_Peripherals, ATmega_I2C, BasicService, BinaryScalar, CompositeResource, DMAMemoryManager, DriverRegistry, ExternalBoard, FiqInterruptDaemon, InfraRed, InputPin, InvertingInputPin, InvertingOutputPin, IOPin, LockingResource, NodeLifeAndLinkMonitor, OutputPin, PeripheralChipSelect, RadioPolicyManager, RadioProtocolManager, RemotePrintManager, RequestTable, RequestTable, ResourceRegistryChild, ResourceRegistryMaster, RoutingTable, RoutingTable, ScalarInput, Serial, SerialFlash, Servo, SimpleSPIControlledIOChip, Spot, Switch, TaskManager, ToneGenerator, TriColorLED

public class Resource
extends Object
implements IResource

Minimal implementation of the IResource interface.

Author:
Ron

Constructor Summary
Resource()
           
 
Method Summary
 void addTag(String tag)
          Add a new tag to describe this resource.
 String[] getTags()
          Get the array of tags associated with this resource.
 String getTagValue(String key)
          Treat each tag as being "key=value" and return the value of the first tag with the specified key.
 boolean hasTag(String tag)
          Check if the specified tag is associated with this resource.
 void removeTag(String tag)
          Remove an existing tag describing this resource.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Resource

public Resource()
Method Detail

getTags

public String[] getTags()
Get the array of tags associated with this resource.

Specified by:
getTags in interface IResource
Returns:
the array of tags associated with this resource.

addTag

public void addTag(String tag)
Add a new tag to describe this resource.

Specified by:
addTag in interface IResource
Parameters:
tag - the new tag to add

removeTag

public void removeTag(String tag)
Remove an existing tag describing this resource.

Specified by:
removeTag in interface IResource
Parameters:
tag - the tag to remove

hasTag

public boolean hasTag(String tag)
Check if the specified tag is associated with this resource.

Specified by:
hasTag in interface IResource
Parameters:
tag - the tag to check
Returns:
true if the tag is associated with this resource, false otherwise.

getTagValue

public String getTagValue(String key)
Treat each tag as being "key=value" and return the value of the first tag with the specified key. Return null if no tag has the specified key.

Specified by:
getTagValue in interface IResource
Parameters:
key - the string to match the key
Returns:
the tag value matching the specified key or null if none

SunSPOT API V6.0


Copyright © 2006-2010 Oracle. All Rights Reserved.