当前位置: 首页>>代码示例>>Java>>正文


Java AllowedTokens.addValue方法代码示例

本文整理汇总了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;
}
 
开发者ID:sensiasoft,项目名称:sensorhub,代码行数:23,代码来源:FakeSensorControl1.java

示例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;
}
 
开发者ID:sensiasoft,项目名称:sensorhub,代码行数:14,代码来源:FakeSensorControl2.java

示例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();
    }
}
 
开发者ID:sensiasoft,项目名称:lib-swe-common,代码行数:35,代码来源:XMLStreamBindings.java

示例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");
}
 
开发者ID:sensiasoft,项目名称:sensorhub,代码行数:43,代码来源:AVLOutput.java


注:本文中的net.opengis.swe.v20.AllowedTokens.addValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。