public class DeviceConfiguration extends java.lang.Object implements java.io.Serializable, java.lang.Comparable<DeviceConfiguration>
Modifier and Type | Class and Description |
---|---|
static class |
DeviceConfiguration.I2cChannel
A separate class to allow the compiler to help us find all the place this should be used
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DISABLED_DEVICE_NAME |
protected java.lang.String |
name |
static java.lang.String |
TAG |
static java.lang.String |
XMLATTR_NAME |
static java.lang.String |
XMLATTR_PORT |
Constructor and Description |
---|
DeviceConfiguration() |
DeviceConfiguration(ConfigurationType type) |
DeviceConfiguration(int port) |
DeviceConfiguration(int port,
ConfigurationType type) |
DeviceConfiguration(int port,
ConfigurationType type,
java.lang.String name,
boolean enabled) |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(DeviceConfiguration another) |
void |
deserialize(XmlPullParser parser,
ReadXMLFileHandler xmlReader)
Initialize this DeviceConfiguration from XML
|
protected void |
deserializeAttributes(XmlPullParser parser)
This gets called while the parser is pointed at the open tag for this device configuration.
|
protected void |
deserializeChildElement(ConfigurationType configurationType,
XmlPullParser parser,
ReadXMLFileHandler xmlReader)
This gets called while the parser is pointed at the open tag for a child device configuration.
|
ConfigurationType |
getConfigurationType() |
DeviceConfiguration.I2cChannel |
getI2cChannel()
This device is an I2c device.
|
java.lang.String |
getName() |
int |
getPort() |
ConfigurationType |
getSpinnerChoiceType() |
boolean |
isEnabled() |
protected void |
onDeserializationComplete(ReadXMLFileHandler xmlReader)
This gets called when the serialization process has been completed.
|
void |
serializeXmlAttributes(XmlSerializer serializer) |
void |
setConfigurationType(ConfigurationType type) |
void |
setEnabled(boolean enabled) |
void |
setName(java.lang.String newName) |
void |
setPort(int port) |
static void |
sortByName(java.util.List<? extends DeviceConfiguration> configurations) |
public static final java.lang.String TAG
public static final java.lang.String XMLATTR_NAME
public static final java.lang.String XMLATTR_PORT
public static final java.lang.String DISABLED_DEVICE_NAME
protected java.lang.String name
public DeviceConfiguration(int port, ConfigurationType type, java.lang.String name, boolean enabled)
public DeviceConfiguration()
public DeviceConfiguration(int port)
public DeviceConfiguration(ConfigurationType type)
public DeviceConfiguration(int port, ConfigurationType type)
public boolean isEnabled()
public void setEnabled(boolean enabled)
public java.lang.String getName()
public void setName(java.lang.String newName)
public void setConfigurationType(ConfigurationType type)
public static void sortByName(java.util.List<? extends DeviceConfiguration> configurations)
public ConfigurationType getConfigurationType()
public ConfigurationType getSpinnerChoiceType()
public int getPort()
public void setPort(int port)
public DeviceConfiguration.I2cChannel getI2cChannel()
public int compareTo(DeviceConfiguration another)
compareTo
in interface java.lang.Comparable<DeviceConfiguration>
public void serializeXmlAttributes(XmlSerializer serializer)
public final void deserialize(XmlPullParser parser, ReadXMLFileHandler xmlReader) throws java.io.IOException, XmlPullParserException, RobotCoreException
parser
- An XmlPullParser pointed at the corresponding open tagxmlReader
- A ReadXMLFileHandler instance to call onDeviceParsed onjava.io.IOException
XmlPullParserException
RobotCoreException
protected void deserializeAttributes(XmlPullParser parser)
protected void deserializeChildElement(ConfigurationType configurationType, XmlPullParser parser, ReadXMLFileHandler xmlReader) throws java.io.IOException, XmlPullParserException, RobotCoreException
java.io.IOException
XmlPullParserException
RobotCoreException
protected void onDeserializationComplete(ReadXMLFileHandler xmlReader)