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


Java ObjectOutputStream.writeDouble方法代码示例

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


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

示例1: writeObject

import java.io.ObjectOutputStream; //导入方法依赖的package包/类
void writeObject(ObjectOutputStream out) throws IOException {
    out.writeInt(nTotalInstrMethods);
    out.writeInt(nClassLoads);
    out.writeInt(nFirstMethodInvocations);
    out.writeInt(nNonEmptyInstrMethodGroupResponses);
    out.writeInt(nEmptyInstrMethodGroupResponses);
    out.writeInt(nSingleMethodInstrMethodGroupResponses);
    out.writeDouble(clientInstrTime);
    out.writeDouble(clientDataProcTime);
    out.writeDouble(totalHotswappingTime);
    out.writeDouble(averageHotswappingTime);
    out.writeDouble(minHotswappingTime);
    out.writeDouble(maxHotswappingTime);
    out.writeDouble(methodEntryExitCallTime0);
    out.writeDouble(methodEntryExitCallTime1);
    out.writeDouble(methodEntryExitCallTime2);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:18,代码来源:InternalStatsResponse.java

示例2: writeObject

import java.io.ObjectOutputStream; //导入方法依赖的package包/类
void writeObject(ObjectOutputStream out) throws IOException {
    int len = methodEntryExitCallTime.length;
    out.writeInt(len);

    for (int i = 0; i < len; i++) {
        out.writeDouble(methodEntryExitCallTime[i]);
    }

    for (int i = 0; i < len; i++) {
        out.writeDouble(methodEntryExitInnerTime[i]);
    }

    for (int i = 0; i < len; i++) {
        out.writeDouble(methodEntryExitOuterTime[i]);
    }

    out.writeLong(timerCountsInSecond[0]);
    out.writeLong(timerCountsInSecond[1]);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:20,代码来源:CalibrationDataResponse.java

示例3: writeNode

import java.io.ObjectOutputStream; //导入方法依赖的package包/类
protected void writeNode(ObjectOutputStream out, IConstBspNode<ArrayList<Triangle>, AxisAlignedPlane3D> node, HashMap<Triangle, Integer> triangleToIndexMap ) throws IOException {
   	out.writeBoolean( node.isInternal() );
	if ( node.isInternal() ) {
		IConstBspInternalNode<ArrayList<Triangle>, AxisAlignedPlane3D> internalNode = node.asInternal();
		out.writeInt( internalNode.getBoundary().axis.ordinal() );
		out.writeDouble( internalNode.getBoundary().origin );
		writeNode( out, internalNode.getNegativeChild(), triangleToIndexMap );
		writeNode( out, internalNode.getPositiveChild(), triangleToIndexMap );
	} else {
		ArrayList<Triangle> triangles = node.asLeaf().getData();
		out.writeInt( triangles.size() );
		for ( Triangle triangle : triangles ) {
			out.writeInt( triangleToIndexMap.get(triangle) );
		}
	}
}
 
开发者ID:kefik,项目名称:Pogamut3,代码行数:17,代码来源:LevelGeometry.java

示例4: doReps

import java.io.ObjectOutputStream; //导入方法依赖的package包/类
/**
 * Run benchmark for given number of batches, with given number of cycles
 * for each batch.
 */
void doReps(ObjectOutputStream oout, ObjectInputStream oin,
            StreamBuffer sbuf, int nbatches, int ncycles)
    throws Exception
{
    for (int i = 0; i < nbatches; i++) {
        sbuf.reset();
        for (int j = 0; j < ncycles; j++) {
            oout.writeDouble(0.0);
        }
        oout.flush();
        for (int j = 0; j < ncycles; j++) {
            oin.readDouble();
        }
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:20,代码来源:Doubles.java

示例5: writeSupportVectors

import java.io.ObjectOutputStream; //导入方法依赖的package包/类
/** Writes the example set into the given output stream. */
public void writeSupportVectors(ObjectOutputStream out) throws IOException {
	out.writeInt(getNumberOfSupportVectors());
	out.writeDouble(b);
	out.writeInt(dim);
	if ((meanVarianceMap == null) || (meanVarianceMap.size() == 0)) {
		out.writeUTF("noscale");
	} else {
		out.writeUTF("scale");
		out.writeInt(meanVarianceMap.size());
		Iterator i = meanVarianceMap.keySet().iterator();
		while (i.hasNext()) {
			Integer index = (Integer) i.next();
			MeanVariance meanVariance = meanVarianceMap.get(index);
			out.writeInt(index.intValue());
			out.writeDouble(meanVariance.getMean());
			out.writeDouble(meanVariance.getVariance());
		}
	}
	for (int e = 0; e < train_size; e++) {
		if (alphas[e] != 0.0d) {
			out.writeInt(atts[e].length);
			for (int a = 0; a < atts[e].length; a++) {
				out.writeInt(index[e][a]);
				out.writeDouble(atts[e][a]);
			}
			out.writeDouble(alphas[e]);
			out.writeDouble(ys[e]);
		}
	}
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:32,代码来源:SVMExamples.java

示例6: save

import java.io.ObjectOutputStream; //导入方法依赖的package包/类
static void save( List<PrecomputedRaycastResult> data, String fileName ) {
	try {
		ObjectOutputStream raycastDataFile = new ObjectOutputStream( new FileOutputStream("DM-Flux2_raycastDump.bin") );
		
		for (PrecomputedRaycastResult result : data ) {
			raycastDataFile.writeObject(result.request.from);
			raycastDataFile.writeObject(result.request.to);
			raycastDataFile.writeDouble(result.hitDistance);
		}
		
		raycastDataFile.close();
	} catch (IOException e) {
		fail("Failed to save data.");
	}
}
 
开发者ID:kefik,项目名称:Pogamut3,代码行数:16,代码来源:RaycastDataFileTools.java

示例7: saveStats

import java.io.ObjectOutputStream; //导入方法依赖的package包/类
/**
 * Saves the statistics logged so far
 */
protected static void saveStats(){
	JFileChooser chooser = new JFileChooser();
	chooser.setFileFilter(new FileNameExtensionFilter("Keys per second statistics file", "kpsstats"));
	chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
	if(chooser.showSaveDialog(null) != JFileChooser.APPROVE_OPTION){
		return;
	}
	File file = new File(chooser.getSelectedFile().getAbsolutePath().endsWith(".kpsstats") ? chooser.getSelectedFile().getAbsolutePath() : (chooser.getSelectedFile().getAbsolutePath() + ".kpsstats"));
	if(!file.exists() || (file.exists() && JOptionPane.showConfirmDialog(null, "File already exists, overwrite?", "Keys per second", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION)){
		try {
			file.createNewFile();
			ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream(file));
			out.writeInt(TotPanel.hits);
			out.writeDouble(avg);
			out.writeInt(max);
			out.writeLong(n);
			out.writeInt(prev);
			out.writeInt(tmp.get());
			for(Entry<Integer, Key> key : keys.entrySet()){
				out.writeInt(key.getKey());
				out.writeObject(key.getValue());
			}
			out.flush();
			out.close();
			JOptionPane.showMessageDialog(null, "Statistics succesfully saved", "Keys per second", JOptionPane.INFORMATION_MESSAGE);
		} catch (IOException e) {e.printStackTrace();
		JOptionPane.showMessageDialog(null, "Failed to save the statistics!", "Keys per second", JOptionPane.ERROR_MESSAGE);
		}
	}
}
 
开发者ID:RoanH,项目名称:KeysPerSecond,代码行数:34,代码来源:Main.java

示例8: writeObject

import java.io.ObjectOutputStream; //导入方法依赖的package包/类
private void writeObject(ObjectOutputStream out) throws IOException {
    out.defaultWriteObject();

    out.writeLong(mCoordinates != null ? mCoordinates.first : -1);
    out.writeLong(mCoordinates != null ? mCoordinates.second : -1);

    out.writeUTF(mLocation != null ? mLocation.getProvider() : null);
    out.writeDouble(mLocation != null ? mLocation.getLatitude() : -1);
    out.writeDouble(mLocation != null ? mLocation.getLongitude() : -1);
    out.writeFloat(mLocation != null ? mLocation.getAccuracy() : -1);
    out.writeDouble(mLocation != null ? mLocation.getAltitude() : -1);
}
 
开发者ID:suomenriistakeskus,项目名称:oma-riista-android,代码行数:13,代码来源:GameHarvest.java

示例9: writeObject

import java.io.ObjectOutputStream; //导入方法依赖的package包/类
private void writeObject(ObjectOutputStream out) throws IOException {
    out.writeBoolean(z);
    out.writeByte(b);
    out.writeChar(c);
    out.writeShort(s);
    out.writeInt(i);
    out.writeFloat(f);
    out.writeLong(j);
    out.writeDouble(d);
    out.writeObject(str);
    out.writeObject(parent);
    out.writeObject(left);
    out.writeObject(right);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:15,代码来源:CustomObjTrees.java

示例10: write

import java.io.ObjectOutputStream; //导入方法依赖的package包/类
@Override
public final void write(ObjectOutputStream os, int[] indexes) throws IOException {
    for (int index : indexes) {
        final double value = getDouble(index);
        os.writeDouble(value);
    }
}
 
开发者ID:zavtech,项目名称:morpheus-core,代码行数:8,代码来源:SparseArrayOfDoubles.java

示例11: writeObject

import java.io.ObjectOutputStream; //导入方法依赖的package包/类
/** Custom serialization */
private void writeObject(ObjectOutputStream os) throws IOException {
    os.writeInt(length);
    os.writeDouble(defaultValue);
    for (int i=0; i<length; ++i) {
        final double value = getDouble(i);
        os.writeDouble(value);
    }
}
 
开发者ID:zavtech,项目名称:morpheus-core,代码行数:10,代码来源:MappedArrayOfDoubles.java

示例12: writeObject

import java.io.ObjectOutputStream; //导入方法依赖的package包/类
/** Custom serialization */
private void writeObject(ObjectOutputStream os) throws IOException {
    os.writeInt(values.length);
    for (double value : values) {
        os.writeDouble(value);
    }
}
 
开发者ID:zavtech,项目名称:morpheus-core,代码行数:8,代码来源:DenseArrayOfDoubles.java

示例13: writeParameters

import java.io.ObjectOutputStream; //导入方法依赖的package包/类
void writeParameters(ObjectOutputStream out) throws IOException {
	out.writeDouble(this.a);
	out.writeDouble(this.b);
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:5,代码来源:PlattParameters.java

示例14: write

import java.io.ObjectOutputStream; //导入方法依赖的package包/类
@Override
public final void write(ObjectOutputStream os, int[] indexes) throws IOException {
    for (int index : indexes) {
        os.writeDouble(values[index]);
    }
}
 
开发者ID:zavtech,项目名称:morpheus-core,代码行数:7,代码来源:DenseArrayOfDoubles.java


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