本文整理汇总了Java中net.opengis.swe.v20.AllowedTokens.addValue方法的典型用法代码示例。如果您正苦于以下问题:Java AllowedTokens.addValue方法的具体用法?Java AllowedTokens.addValue怎么用?Java AllowedTokens.addValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.opengis.swe.v20.AllowedTokens
的用法示例。
在下文中一共展示了AllowedTokens.addValue方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getCommandDescription
import net.opengis.swe.v20.AllowedTokens; //导入方法依赖的package包/类
@Override
public DataComponent getCommandDescription()
{
DataComponent record = new DataRecordImpl(3);
record.setName(this.name);
record.setDefinition("urn:blabla:command");
Quantity q = new QuantityImpl();
q.setDefinition("urn:blabla:samplingPeriod");
q.getUom().setCode("s");
record.addComponent("samplingPeriod", q);
Category c = new CategoryImpl();
c.setDefinition("urn:blabla:sensitivity");
AllowedTokens tokens = new AllowedTokensImpl();
tokens.addValue("HIGH");
tokens.addValue("LOW");
c.setConstraint(tokens);
record.addComponent("sens", c);
return record;
}
示例2: getCommandDescription
import net.opengis.swe.v20.AllowedTokens; //导入方法依赖的package包/类
@Override
public DataComponent getCommandDescription()
{
Category c = new CategoryImpl();
c.setName(name);
c.setDefinition("urn:blabla:trigger");
AllowedTokens tokens = new AllowedTokensImpl();
tokens.addValue("NOW");
tokens.addValue("REPEAT");
tokens.addValue("STOP");
c.setConstraint(tokens);
return c;
}
示例3: readAllowedTokensTypeElements
import net.opengis.swe.v20.AllowedTokens; //导入方法依赖的package包/类
/**
* Reads elements of AllowedTokensType complex type
*/
public void readAllowedTokensTypeElements(XMLStreamReader reader, AllowedTokens bean) throws XMLStreamException
{
this.readAbstractSWETypeElements(reader, bean);
boolean found;
String val;
// value
do
{
found = checkElementName(reader, "value");
if (found)
{
val = reader.getElementText();
if (val != null)
bean.addValue(trimStringValue(val));
reader.nextTag();
}
}
while (found);
// pattern
found = checkElementName(reader, "pattern");
if (found)
{
val = reader.getElementText();
if (val != null)
bean.setPattern(trimStringValue(val));
reader.nextTag();
}
}
示例4: init
import net.opengis.swe.v20.AllowedTokens; //导入方法依赖的package包/类
@Override
protected void init()
{
SWEHelper fac = new SWEHelper();
// SWE Common data structure
dataStruct = fac.newDataRecord(7);
dataStruct.setName(getName());
// time
dataStruct.addComponent("time", fac.newTimeStampIsoUTC());
// Mobile Data Terminal ID
dataStruct.addComponent("mdt-id", fac.newCategory(SWEHelper.getPropertyUri("MDT-ID"), "MDT-ID", "Mobile Data Terminal ID", null));
// Unit and Vehicle ID (often the same)
dataStruct.addComponent("unit-id", fac.newCategory(SWEHelper.getPropertyUri("Unit-ID"), "Unit ID", "Mobile Unit ID", null));
dataStruct.addComponent("veh-id", fac.newCategory(SWEHelper.getPropertyUri("vehicle-ID"), "Vehicle ID", "Mobile Vehicle Identification", null));
// location (latitude-longitude)
Vector locVector = fac.newLocationVectorLatLon(SWEConstants.DEF_SENSOR_LOC);
locVector.setLabel("Location");
locVector.setDescription("Latitude-Longitude location measured by GPS device");
dataStruct.addComponent("location", locVector);
// status constraints: (AQ - at-station; ER - enroute; AR - arrived?, OS - out-of-service, AK - completed-returning)
Category status = fac.newCategory(SWEHelper.getPropertyUri("VehicleStatus"), "Unit Status", "Unit-Vehicle Status (AQ, OS, AK, ER, AR)", null);
AllowedTokens constraints = fac.newAllowedTokens();
constraints.addValue("AQ");
constraints.addValue("ER");
constraints.addValue("AR");
constraints.addValue("OS");
constraints.addValue("AK");
status.setConstraint(constraints);
dataStruct.addComponent("status", status);
// event (empty if AQ, OS, or AK; event number if ER or AR)
dataStruct.addComponent("event-id", fac.newCategory(SWEHelper.getPropertyUri("Event-ID"), "Event ID", "Assigned ID to an emergency event", null));
// set encoding to CSV
dataEncoding = fac.newTextEncoding(",", "\n");
}