當前位置: 首頁>>代碼示例>>Java>>正文


Java Input.readDouble方法代碼示例

本文整理匯總了Java中com.esotericsoftware.kryo.io.Input.readDouble方法的典型用法代碼示例。如果您正苦於以下問題:Java Input.readDouble方法的具體用法?Java Input.readDouble怎麽用?Java Input.readDouble使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.esotericsoftware.kryo.io.Input的用法示例。


在下文中一共展示了Input.readDouble方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: read

import com.esotericsoftware.kryo.io.Input; //導入方法依賴的package包/類
@Override
public SensorMeasurement read(Kryo kryo, Input input, Class<SensorMeasurement> clazz) {
	int magicNumber = input.readInt();
	assert (magicNumber == MAGIC_NUMBER);

	boolean is2D = (input.readByte() == 0x01) ? true : false;
	int coilId = input.readInt();
	double x = input.readDouble();
	double y = (is2D) ? input.readDouble() : 0;
	int varId = input.readInt();
	double value = input.readDouble();

	if (is2D) {
		return new SensorMeasurement2D(coilId, x, y, varId, value);
	} else {
		return new SensorMeasurement1D(coilId, x, varId, value);
	}

}
 
開發者ID:proteus-h2020,項目名稱:proteus-consumer-couchbase,代碼行數:20,代碼來源:ProteusSerializer.java

示例2: read

import com.esotericsoftware.kryo.io.Input; //導入方法依賴的package包/類
public ArrayMetaData<double[]> read(Kryo kryo, Input input, Class<ArrayMetaData<double[]>> type) {
    try {
        double[] arrData = arrayMetaData.getArrData();
        thatArrMetaData = arrayMetaData.recv(input);
        int arrSegNum = thatArrMetaData.getSegNum();
        for (int i = 0; i < arrSegNum; i++) {
            int from = thatArrMetaData.getFrom(i);
            int to = thatArrMetaData.getTo(i);
            for (int j = from; j < to; j++) {
                arrData[j] = input.readDouble();
            }
        }
        thatArrMetaData.setArrData(arrData);
    } catch (IOException e) {
        LOG.error("double array read exception", e);
        System.exit(1);
    }
    return thatArrMetaData;

}
 
開發者ID:yuantiku,項目名稱:ytk-mp4j,代碼行數:21,代碼來源:DoubleOperand.java

示例3: read

import com.esotericsoftware.kryo.io.Input; //導入方法依賴的package包/類
@Override
public Summary read(Kryo kryo, Input input, Class<Summary> type) {
    Summary summary = new Summary();
    int len = input.readInt();
    summary.value = new float[len];
    for (int i = 0; i < len; i++) {
        summary.value[i] = input.readFloat();
    }

    len = input.readInt();
    summary.rmin = new double[len];
    for (int i = 0; i < len; i++) {
        summary.rmin[i] = input.readDouble();
    }

    len = input.readInt();
    summary.rmax = new double[len];
    for (int i = 0; i < len; i++) {
        summary.rmax[i] = input.readDouble();
    }

    len = input.readInt();
    summary.w = new float[len];
    for (int i = 0; i < len; i++) {
        summary.w[i] = input.readFloat();
    }

    summary.capacity = input.readInt();
    summary.cursor = input.readInt();
    summary.B = input.readDouble();
    summary.exact = input.readBoolean();
    summary.eps = input.readDouble();

    summary.poolMap = new TreeMap<>();
    PoolNode poolNode = summary.getPoolNode(summary.capacity);

    return summary;
}
 
開發者ID:yuantiku,項目名稱:ytk-learn,代碼行數:39,代碼來源:WeightApproximateQuantile.java


注:本文中的com.esotericsoftware.kryo.io.Input.readDouble方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。