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


Java ScalarIterator类代码示例

本文整理汇总了Java中org.vast.data.ScalarIterator的典型用法代码示例。如果您正苦于以下问题:Java ScalarIterator类的具体用法?Java ScalarIterator怎么用?Java ScalarIterator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ScalarIterator类属于org.vast.data包,在下文中一共展示了ScalarIterator类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getObservablePropertiesFromSensor

import org.vast.data.ScalarIterator; //导入依赖的package包/类
protected List<String> getObservablePropertiesFromSensor() throws SensorException
{
    List<String> observableUris = new ArrayList<String>();
    
    // process outputs descriptions
    for (Entry<String, ? extends ISensorDataInterface> entry: sensor.getAllOutputs().entrySet())
    {
        // iterate through all SWE components and add all definition URIs as observables
        // this way only composites with URI will get added
        ISensorDataInterface output = entry.getValue();
        ScalarIterator it = new ScalarIterator(output.getRecordDescription());
        while (it.hasNext())
        {
            String defUri = (String)it.next().getDefinition();
            if (defUri != null && !defUri.equals(SWEConstants.DEF_SAMPLING_TIME))
                observableUris.add(defUri);
        }
    }
    
    return observableUris;
}
 
开发者ID:sensiasoft,项目名称:sensorhub,代码行数:22,代码来源:DirectSensorConnector.java

示例2: setupUnitConverters

import org.vast.data.ScalarIterator; //导入依赖的package包/类
protected void setupUnitConverters() throws SMLException
{
    if (sourceComponent == null || destinationComponent == null)
        return;
    
    componentConverters.clear();
    ScalarIterator itSrc = new ScalarIterator(sourceComponent);
    ScalarIterator itDest = new ScalarIterator(destinationComponent);
    
    while (itSrc.hasNext())
    {
        DataComponent src = itSrc.next();
        DataComponent dest = itDest.next();
        UnitConverter conv = getUnitConverter(src, dest);
        
        if (conv != null)
        {
            componentConverters.add(new ComponentConverter(src, dest, conv));
            LOGGER.finer("Unit conversion setup from " + src.getName() + " to " + dest.getName());
        }
    }
}
 
开发者ID:sensiasoft,项目名称:lib-sensorml,代码行数:23,代码来源:DataConnection.java

示例3: getDefaultBinaryEncoding

import org.vast.data.ScalarIterator; //导入依赖的package包/类
/**
 * Get default binary encoding for the given component tree.<br/>
 * Data types used will be ones specified in each scalar component.
 * @param dataComponents component whose children will be mapped to encoding options
 * @return binary encoding instance pre-configured for the component
 */
public static BinaryEncoding getDefaultBinaryEncoding(DataComponent dataComponents)
{
    BinaryEncodingImpl encoding = new BinaryEncodingImpl();
    encoding.setByteEncoding(ByteEncoding.RAW);
    encoding.setByteOrder(ByteOrder.BIG_ENDIAN);
    
    // use default encoding info for each data value
    ScalarIterator it = new ScalarIterator(dataComponents);
    while (it.hasNext())
    {
        DataComponent[] nextPath = it.nextPath();
        DataValue nextScalar = (DataValue)nextPath[nextPath.length-1];
        
        // build path (just use / for root)
        StringBuilder pathString = new StringBuilder();
        pathString.append(PATH_SEPARATOR);
        for (int i = 0; i < nextPath.length; i++)
        {
            pathString.append(nextPath[i].getName());
            pathString.append(PATH_SEPARATOR);
        }
        
        BinaryComponentImpl binaryOpts = new BinaryComponentImpl();
        binaryOpts.setCdmDataType(nextScalar.getDataType());
        binaryOpts.setRef(pathString.substring(0, pathString.length()-1));
        
        encoding.addMemberAsComponent(binaryOpts);
        nextScalar.setEncodingInfo(binaryOpts);
    }
    
    return encoding;
}
 
开发者ID:sensiasoft,项目名称:lib-swe-common,代码行数:39,代码来源:SWEHelper.java


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