當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。