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


Java StreamOutput.writeDouble方法代码示例

本文整理汇总了Java中org.elasticsearch.common.io.stream.StreamOutput.writeDouble方法的典型用法代码示例。如果您正苦于以下问题:Java StreamOutput.writeDouble方法的具体用法?Java StreamOutput.writeDouble怎么用?Java StreamOutput.writeDouble使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.elasticsearch.common.io.stream.StreamOutput的用法示例。


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

示例1: writeSortValue

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
private static void writeSortValue(StreamOutput out, Object field) throws IOException {
    if (field == null) {
        out.writeByte((byte) 0);
    } else {
        Class type = field.getClass();
        if (type == String.class) {
            out.writeByte((byte) 1);
            out.writeString((String) field);
        } else if (type == Integer.class) {
            out.writeByte((byte) 2);
            out.writeInt((Integer) field);
        } else if (type == Long.class) {
            out.writeByte((byte) 3);
            out.writeLong((Long) field);
        } else if (type == Float.class) {
            out.writeByte((byte) 4);
            out.writeFloat((Float) field);
        } else if (type == Double.class) {
            out.writeByte((byte) 5);
            out.writeDouble((Double) field);
        } else if (type == Byte.class) {
            out.writeByte((byte) 6);
            out.writeByte((Byte) field);
        } else if (type == Short.class) {
            out.writeByte((byte) 7);
            out.writeShort((Short) field);
        } else if (type == Boolean.class) {
            out.writeByte((byte) 8);
            out.writeBoolean((Boolean) field);
        } else if (type == BytesRef.class) {
            out.writeByte((byte) 9);
            out.writeBytesRef((BytesRef) field);
        } else {
            throw new IOException("Can't handle sort field value of type [" + type + "]");
        }
    }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:38,代码来源:Lucene.java

示例2: writeValueTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
public void writeValueTo(StreamOutput out, Object v) throws IOException {
    out.writeBoolean(v == null);
    if (v != null) {
        out.writeDouble(((Number) v).doubleValue());
    }
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:8,代码来源:DoubleType.java

示例3: doWriteTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
protected void doWriteTo(StreamOutput out) throws IOException {
    out.writeNamedWriteable(format);
    out.writeBoolean(keyed);
    out.writeVInt(ranges.size());
    for (B bucket : ranges) {
        out.writeOptionalString(((Bucket) bucket).key);
        out.writeDouble(((Bucket) bucket).from);
        out.writeDouble(((Bucket) bucket).to);
        out.writeVLong(((Bucket) bucket).docCount);
        bucket.aggregations.writeTo(out);
    }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:14,代码来源:InternalRange.java

示例4: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeString(STREAM.getName());
    out.writeDouble(alpha);
    out.writeDouble(beta);
    out.writeDouble(gamma);
    out.writeVInt(period);
    seasonalityType.writeTo(out);
    out.writeBoolean(pad);
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:11,代码来源:HoltWintersModel.java

示例5: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
public void writeTo(StreamOutput out) throws IOException {
    super.writeTo(out);
    out.writeString(geoTree);
    out.writeOptionalString(precision);
    out.writeBoolean(treeLevels == null);
    if (treeLevels != null) {
        out.writeVInt(treeLevels);
    }
    out.writeBoolean(distanceErrorPct == null);
    if (distanceErrorPct != null) {
        out.writeDouble(distanceErrorPct);
    }
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:15,代码来源:GeoReferenceInfo.java

示例6: doWriteTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
protected void doWriteTo(StreamOutput out) throws IOException {
    out.writeDouble(top);
    out.writeDouble(bottom);
    out.writeDouble(posLeft);
    out.writeDouble(posRight);
    out.writeDouble(negLeft);
    out.writeDouble(negRight);
    out.writeBoolean(wrapLongitude);
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:11,代码来源:InternalGeoBounds.java

示例7: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
public void writeTo(StreamOutput out) throws IOException {
    super.writeTo(out);
    out.writeString(clusterName);
    out.writeVInt(clusterStateHealth.getActivePrimaryShards());
    out.writeVInt(clusterStateHealth.getActiveShards());
    out.writeVInt(clusterStateHealth.getRelocatingShards());
    out.writeVInt(clusterStateHealth.getInitializingShards());
    out.writeVInt(clusterStateHealth.getUnassignedShards());
    out.writeVInt(clusterStateHealth.getNumberOfNodes());
    out.writeVInt(clusterStateHealth.getNumberOfDataNodes());
    out.writeInt(numberOfPendingTasks);
    out.writeByte(clusterStateHealth.getStatus().value());
    out.writeVInt(clusterStateHealth.getIndices().size());
    for (ClusterIndexHealth indexHealth : clusterStateHealth) {
        indexHealth.writeTo(out);
    }
    out.writeBoolean(timedOut);

    out.writeVInt(clusterStateHealth.getValidationFailures().size());
    for (String failure : clusterStateHealth.getValidationFailures()) {
        out.writeString(failure);
    }

    out.writeInt(numberOfInFlightFetch);
    if (out.getVersion().onOrAfter(Version.V_1_7_0)) {
        out.writeInt(delayedUnassignedShards);
    }
    out.writeDouble(clusterStateHealth.getActiveShardsPercent());
    taskMaxWaitingTime.writeTo(out);
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:32,代码来源:ClusterHealthResponse.java

示例8: write

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
public static void write(TDigestState state, StreamOutput out) throws IOException {
    out.writeDouble(state.compression);
    out.writeVInt(state.centroidCount());
    for (Centroid centroid : state.centroids()) {
        out.writeDouble(centroid.mean());
        out.writeVLong(centroid.count());
    }
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:9,代码来源:TDigestState.java

示例9: writeValueTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
public void writeValueTo(StreamOutput out, Object v) throws IOException {
    if (v == null) {
        out.writeBoolean(false);
    } else {
        out.writeBoolean(true);
        Double[] point = (Double[]) v;
        out.writeDouble(point[0]);
        out.writeDouble(point[1]);
    }
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:12,代码来源:GeoPointType.java

示例10: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeVLong(subsetDf);
    out.writeVLong(supersetDf);
    out.writeLong(term);
    out.writeDouble(getSignificanceScore());
    aggregations.writeTo(out);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:9,代码来源:SignificantLongTerms.java

示例11: doWriteTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
protected void doWriteTo(StreamOutput out) throws IOException {
    ValueFormatterStreams.writeOptional(valueFormatter, out);
    out.writeVLong(count);
    out.writeDouble(min);
    out.writeDouble(max);
    out.writeDouble(sum);
    writeOtherStatsTo(out);
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:10,代码来源:InternalStats.java

示例12: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
public void writeTo(StreamOutput out) throws IOException {
    super.writeTo(out);
    out.writeDouble(minValue);
    out.writeDouble(maxValue);
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:7,代码来源:FieldStats.java

示例13: doWriteTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
protected void doWriteTo(StreamOutput out) throws IOException {
    ValueFormatterStreams.writeOptional(valueFormatter, out);
    out.writeDouble(value);
    out.writeStringArray(keys);
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:7,代码来源:InternalBucketMetricValue.java

示例14: doWriteTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
protected void doWriteTo(StreamOutput out) throws IOException {
    ValueFormatterStreams.writeOptional(valueFormatter, out);
    out.writeDouble(sum);
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:6,代码来源:InternalSum.java

示例15: doWriteTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
protected void doWriteTo(StreamOutput out) throws IOException {
    out.writeNamedWriteable(format);
    out.writeDouble(sum);
    out.writeVLong(count);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:7,代码来源:InternalAvg.java


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