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


Java Output.writeFloat方法代碼示例

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


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

示例1: write

import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
public void write (Kryo kryo, Output output, ObjectFloatMap map) {
    int length = map.size;
    output.writeVarInt(length, true);
    output.writeBoolean(false); // whether type is written (in case future version of ObjectFloatMap supports type awareness)

    Serializer keySerializer = null;
    if (keyGenericType != null) {
        if (keySerializer == null) keySerializer = kryo.getSerializer(keyGenericType);
        keyGenericType = null;
    }

    for (Iterator iter = map.iterator(); iter.hasNext();) {
        ObjectFloatMap.Entry entry = (ObjectFloatMap.Entry)iter.next();
        if (keySerializer != null) {
            kryo.writeObject(output, entry.key, keySerializer);
        } else
            kryo.writeClassAndObject(output, entry.key);
        output.writeFloat(entry.value);
    }
}
 
開發者ID:CypherCove,項目名稱:gdx-cclibs,代碼行數:21,代碼來源:ObjectFloatMapSerializer.java

示例2: write

import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
public void write(Kryo kryo, Output output, MapMetaData<Float> object) {
    try {
        List<Map<String, Float>> mapDataList = mapMetaData.getMapDataList();
        mapMetaData.send(output);
        int mapSegNum = mapMetaData.getSegNum();
        for (int i = 0; i < mapSegNum; i++) {
            Map<String, Float> mapData = mapDataList.get(i);
            for (Map.Entry<String, Float> entry : mapData.entrySet()) {
                output.writeString(entry.getKey());
                output.writeFloat(entry.getValue());
            }
            if (mapMetaData.getCollective() == Collective.GATHER ||
                    mapMetaData.getCollective() == Collective.SCATTER ||
                    mapMetaData.getCollective() == Collective.REDUCE_SCATTER) {
                mapData.clear();
            }
        }

    } catch (IOException e) {
        LOG.error("double array write exception", e);
        System.exit(1);
    }
}
 
開發者ID:yuantiku,項目名稱:ytk-mp4j,代碼行數:24,代碼來源:FloatOperand.java

示例3: write

import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
@Override
public void write(Kryo kryo, Output output, BoundingBox boundingBox) {
    Vector3 min = boundingBox.min;
    output.writeFloat(min.x);
    output.writeFloat(min.y);
    output.writeFloat(min.z);
    Vector3 max = boundingBox.max;
    output.writeFloat(max.x);
    output.writeFloat(max.y);
    output.writeFloat(max.z);
}
 
開發者ID:CypherCove,項目名稱:gdx-cclibs,代碼行數:12,代碼來源:BoundingBoxSerializer.java

示例4: write

import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
@Override
public void write(Kryo kryo, Output output, Ray ray) {
    Vector3 origin = ray.origin;
    output.writeFloat(origin.x);
    output.writeFloat(origin.y);
    output.writeFloat(origin.z);
    Vector3 direction = ray.direction;
    output.writeFloat(direction.x);
    output.writeFloat(direction.y);
    output.writeFloat(direction.z);
}
 
開發者ID:CypherCove,項目名稱:gdx-cclibs,代碼行數:12,代碼來源:RaySerializer.java

示例5: write

import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
@Override
public void write(Kryo kryo, Output output, Segment segment) {
    Vector3 a = segment.a;
    output.writeFloat(a.x);
    output.writeFloat(a.y);
    output.writeFloat(a.z);
    Vector3 b = segment.b;
    output.writeFloat(b.x);
    output.writeFloat(b.y);
    output.writeFloat(b.z);
}
 
開發者ID:CypherCove,項目名稱:gdx-cclibs,代碼行數:12,代碼來源:SegmentSerializer.java

示例6: write

import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
@Override
public void write (Kryo kryo, Output output, Polyline polyline) {
    output.writeInt(polyline.getVertices().length);
    output.writeFloats(polyline.getVertices());
    output.writeFloat(polyline.getX());
    output.writeFloat(polyline.getY());
    output.writeFloat(polyline.getOriginX());
    output.writeFloat(polyline.getOriginY());
    output.writeFloat(polyline.getRotation());
    output.writeFloat(polyline.getScaleX());
    output.writeFloat(polyline.getScaleY());
}
 
開發者ID:CypherCove,項目名稱:gdx-cclibs,代碼行數:13,代碼來源:PolylineSerializer.java

示例7: write

import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
@Override
public void write(Kryo kryo, Output output, SplitInfo object) {
    output.writeFloat(object.lossChg);
    output.writeInt(object.splitIndex);
    output.writeFloat(object.splitValue);
    output.writeInt(object.splitSlotInterval.length);
    for (int i = 0; i < object.splitSlotInterval.length; i++) {
        output.writeInt(object.splitSlotInterval[i]);
    }
}
 
開發者ID:yuantiku,項目名稱:ytk-learn,代碼行數:11,代碼來源:SplitInfo.java

示例8: write

import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
@Override
public void write(Kryo kryo, Output output, Quaternion quaternion) {
    output.writeFloat(quaternion.x);
    output.writeFloat(quaternion.y);
    output.writeFloat(quaternion.z);
    output.writeFloat(quaternion.w);
}
 
開發者ID:CypherCove,項目名稱:gdx-cclibs,代碼行數:8,代碼來源:QuaternionSerializer.java

示例9: write

import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
@Override
public void write(Kryo kryo, Output output, FloatCounter floatCounter) {
    kryo.writeObjectOrNull(output, floatCounter.mean, WindowedMean.class);
    output.writeInt(floatCounter.count);
    output.writeFloat(floatCounter.total);
    output.writeFloat(floatCounter.min);
    output.writeFloat(floatCounter.max);
    output.writeFloat(floatCounter.average);
    output.writeFloat(floatCounter.latest);
    output.writeFloat(floatCounter.value);
}
 
開發者ID:CypherCove,項目名稱:gdx-cclibs,代碼行數:12,代碼來源:FloatCounterSerializer.java

示例10: write

import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
@Override
public void write(Kryo kryo, Output output, Ellipse ellipse) {
    output.writeFloat(ellipse.x);
    output.writeFloat(ellipse.y);
    output.writeFloat(ellipse.width);
    output.writeFloat(ellipse.height);
}
 
開發者ID:CypherCove,項目名稱:gdx-cclibs,代碼行數:8,代碼來源:EllipseSerializer.java

示例11: write

import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
@Override
public void write(Kryo kryo, Output output, Plane plane) {
    Vector3 normal = plane.normal;
    output.writeFloat(normal.x);
    output.writeFloat(normal.y);
    output.writeFloat(normal.z);
    output.writeFloat(plane.d);
}
 
開發者ID:CypherCove,項目名稱:gdx-cclibs,代碼行數:9,代碼來源:PlaneSerializer.java

示例12: write

import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
@Override
public void write(Kryo kryo, Output output, Affine2 affine2) {
    output.writeFloat(affine2.m00);
    output.writeFloat(affine2.m01);
    output.writeFloat(affine2.m02);
    output.writeFloat(affine2.m10);
    output.writeFloat(affine2.m11);
    output.writeFloat(affine2.m12);
}
 
開發者ID:CypherCove,項目名稱:gdx-cclibs,代碼行數:10,代碼來源:Affine2Serializer.java

示例13: write

import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
@Override
public void write (Kryo kryo, Output output, PerspectiveCamera camera) {
    kryo.writeObject(output, camera.position);
    kryo.writeObject(output, camera.direction);
    kryo.writeObject(output, camera.up);
    output.writeFloat(camera.near);
    output.writeFloat(camera.far);
    output.writeFloat(camera.viewportWidth);
    output.writeFloat(camera.viewportHeight);
    output.writeFloat(camera.fieldOfView);
}
 
開發者ID:CypherCove,項目名稱:gdx-cclibs,代碼行數:12,代碼來源:PerspectiveCameraSerializer.java

示例14: write

import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
@Override
public void write(Kryo kryo, Output output, Summary object) {
    output.writeInt(object.value.length);
    for (int i = 0; i < object.value.length; i++) {
        output.writeFloat(object.value[i]);
    }

    output.writeInt(object.rmin.length);
    for (int i = 0; i < object.rmin.length; i++) {
        output.writeDouble(object.rmin[i]);
    }

    output.writeInt(object.rmax.length);
    for (int i = 0; i < object.rmax.length; i++) {
        output.writeDouble(object.rmax[i]);
    }

    output.writeInt(object.w.length);
    for (int i = 0; i < object.w.length; i++) {
        output.writeFloat(object.w[i]);
    }

    output.writeInt(object.capacity);
    output.writeInt(object.cursor);
    output.writeDouble(object.B);
    output.writeBoolean(object.exact);
    output.writeDouble(object.eps);
}
 
開發者ID:yuantiku,項目名稱:ytk-learn,代碼行數:29,代碼來源:WeightApproximateQuantile.java

示例15: write

import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
@Override
public void write(Kryo kryo, Output output, Color color) {
    Boolean compact = GraphHeader.isUseCompactColor(kryo);
    if (compact == null) compact = isCompactDefault;
    if (compact){
        output.writeInt(Color.rgba8888(color));
    } else {
        output.writeFloat(color.r);
        output.writeFloat(color.g);
        output.writeFloat(color.b);
        output.writeFloat(color.a);
    }
}
 
開發者ID:CypherCove,項目名稱:gdx-cclibs,代碼行數:14,代碼來源:ColorSerializer.java


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