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