本文整理汇总了Java中java.io.ObjectInputStream.readDouble方法的典型用法代码示例。如果您正苦于以下问题:Java ObjectInputStream.readDouble方法的具体用法?Java ObjectInputStream.readDouble怎么用?Java ObjectInputStream.readDouble使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.io.ObjectInputStream
的用法示例。
在下文中一共展示了ObjectInputStream.readDouble方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: readObject
import java.io.ObjectInputStream; //导入方法依赖的package包/类
void readObject(ObjectInputStream in) throws IOException {
nTotalInstrMethods = in.readInt();
nClassLoads = in.readInt();
nFirstMethodInvocations = in.readInt();
nNonEmptyInstrMethodGroupResponses = in.readInt();
nEmptyInstrMethodGroupResponses = in.readInt();
nSingleMethodInstrMethodGroupResponses = in.readInt();
clientInstrTime = in.readDouble();
clientDataProcTime = in.readDouble();
totalHotswappingTime = in.readDouble();
averageHotswappingTime = in.readDouble();
minHotswappingTime = in.readDouble();
maxHotswappingTime = in.readDouble();
methodEntryExitCallTime0 = in.readDouble();
methodEntryExitCallTime1 = in.readDouble();
methodEntryExitCallTime2 = in.readDouble();
}
示例2: readObject
import java.io.ObjectInputStream; //导入方法依赖的package包/类
void readObject(ObjectInputStream in) throws IOException {
int len = in.readInt();
methodEntryExitCallTime = new double[len];
methodEntryExitInnerTime = new double[len];
methodEntryExitOuterTime = new double[len];
for (int i = 0; i < len; i++) {
methodEntryExitCallTime[i] = in.readDouble();
}
for (int i = 0; i < len; i++) {
methodEntryExitInnerTime[i] = in.readDouble();
}
for (int i = 0; i < len; i++) {
methodEntryExitOuterTime[i] = in.readDouble();
}
timerCountsInSecond = new long[2];
timerCountsInSecond[0] = in.readLong();
timerCountsInSecond[1] = in.readLong();
}
示例3: SVMExamples
import java.io.ObjectInputStream; //导入方法依赖的package包/类
/** Reads an example set from the given input stream. */
public SVMExamples(ObjectInputStream in) throws IOException {
this(in.readInt(), in.readDouble());
this.dim = in.readInt();
String scaleString = in.readUTF();
if (scaleString.equals("scale")) {
int numberOfAttributes = in.readInt();
this.meanVarianceMap = new HashMap<Integer, MeanVariance>();
for (int i = 0; i < numberOfAttributes; i++) {
int index = in.readInt();
double mean = in.readDouble();
double variance = in.readDouble();
meanVarianceMap.put(Integer.valueOf(index), new MeanVariance(mean, variance));
}
}
for (int e = 0; e < this.train_size; e++) {
index[e] = new int[in.readInt()];
atts[e] = new double[index[e].length];
for (int a = 0; a < index[e].length; a++) {
index[e][a] = in.readInt();
atts[e][a] = in.readDouble();
}
alphas[e] = in.readDouble();
ys[e] = in.readDouble();
}
}
示例4: readNode
import java.io.ObjectInputStream; //导入方法依赖的package包/类
protected IBspNode<ArrayList<Triangle>, AxisAlignedPlane3D> readNode( ObjectInputStream in ) throws IOException {
boolean isInternal = in.readBoolean();
if ( isInternal ) {
BspInternalNode<ArrayList<Triangle>, AxisAlignedPlane3D> internalNode = bspTree.makeInternalNode();
Axis3D axis = Axis3D.values()[in.readInt()];
double origin = in.readDouble();
internalNode.setBoundary( new AxisAlignedPlane3D( axis, origin) );
internalNode.setNegativeChild( readNode(in) );
internalNode.setPositiveChild( readNode(in) );
return internalNode;
} else {
BspLeafNode<ArrayList<Triangle>, AxisAlignedPlane3D> leafNode = bspTree.makeLeafNode();
int triangleCount = in.readInt();
ArrayList<Triangle> data = Lists.newArrayList();
while ( data.size() < triangleCount ) {
data.add( triangles.get( in.readInt() ) );
}
leafNode.setData( data );
return leafNode;
}
}
示例5: doReps
import java.io.ObjectInputStream; //导入方法依赖的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();
}
}
}
示例6: readObject
import java.io.ObjectInputStream; //导入方法依赖的package包/类
private void readObject(ObjectInputStream in)
throws IOException, ClassNotFoundException
{
z = in.readBoolean();
b = in.readByte();
c = in.readChar();
s = in.readShort();
i = in.readInt();
f = in.readFloat();
j = in.readLong();
d = in.readDouble();
str = (String) in.readObject();
parent = in.readObject();
left = in.readObject();
right = in.readObject();
}
示例7: readObject
import java.io.ObjectInputStream; //导入方法依赖的package包/类
protected void readObject(ObjectInputStream in) throws IOException {
loaded = in.readBoolean();
ArrayList<Point3D> allVertices = Lists.newArrayList();
int vertexCount = in.readInt();
while ( allVertices.size() < vertexCount ) {
double x = in.readDouble();
double y = in.readDouble();
double z = in.readDouble();
allVertices.add( new Point3D( x, y, z ) );
}
triangles = Lists.newArrayList();
int triangleCount = in.readInt();
while ( triangles.size() < triangleCount ) {
Point3D triangleVertices[] = new Point3D[3];
for ( int i=0; i<3; ++i ) {
triangleVertices[i] = allVertices.get( in.readInt() );
}
triangles.add( new Triangle( triangleVertices[0], triangleVertices[1], triangleVertices[2] ) );
}
bspTree = BspTree.make( new RayCastBspStrategy( this, new Random(250760834l) ) );
rayCaster = new RayCaster( bspTree );
bspTree.setRoot( readNode( in ) );
}
示例8: loadStats
import java.io.ObjectInputStream; //导入方法依赖的package包/类
/**
* Loads the statistics from a file
*/
protected static void loadStats(){
JFileChooser chooser = new JFileChooser();
chooser.setFileFilter(new FileNameExtensionFilter("Keys per second statistics file", "kpsstats"));
chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
if(chooser.showOpenDialog(null) != JFileChooser.APPROVE_OPTION){
return;
}
try{
ObjectInputStream in = new ObjectInputStream(new FileInputStream(chooser.getSelectedFile()));
TotPanel.hits = in.readInt();
avg = in.readDouble();
max = in.readInt();
n = in.readLong();
prev = in.readInt();
tmp.set(in.readInt());
while(in.available() > 0){
Key key = keys.get(in.readInt());
Key obj = ((Key)in.readObject());
if(key != null){
key.count = obj.count;
}
}
in.close();
frame.repaint();
graphFrame.repaint();
JOptionPane.showMessageDialog(null, "Statistics succesfully loaded", "Keys per second", JOptionPane.INFORMATION_MESSAGE);
}catch(IOException | ClassNotFoundException e){
JOptionPane.showMessageDialog(null, "Failed to load the statistics!", "Keys per second", JOptionPane.ERROR_MESSAGE);
}
}
示例9: read
import java.io.ObjectInputStream; //导入方法依赖的package包/类
@Override
public final void read(ObjectInputStream is, int count) throws IOException {
for (int i=0; i<count; ++i) {
final double value = is.readDouble();
this.setDouble(i, value);
}
}
示例10: readObject
import java.io.ObjectInputStream; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
/** Custom serialization */
private void readObject(ObjectInputStream is) throws IOException, ClassNotFoundException {
this.file = MappedArrayConstructor.randomFile(true);
this.length = is.readInt();
this.defaultValue = is.readDouble();
this.channel = new RandomAccessFile(file, "rw").getChannel();
this.buffer = channel.map(FileChannel.MapMode.READ_WRITE, 0, BYTE_COUNT * length).asDoubleBuffer();
for (int i=0; i<length; ++i) {
final double value = is.readDouble();
this.setDouble(i, value);
}
}
示例11: readObject
import java.io.ObjectInputStream; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
/** Custom serialization */
private void readObject(ObjectInputStream is) throws IOException, ClassNotFoundException {
final int length = is.readInt();
this.values = new double[length];
for (int i=0; i<length; ++i) {
values[i] = is.readDouble();
}
}
示例12: readParameters
import java.io.ObjectInputStream; //导入方法依赖的package包/类
void readParameters(ObjectInputStream in) throws IOException {
this.a = in.readDouble();
this.b = in.readDouble();
}
示例13: loadLegacyFormat
import java.io.ObjectInputStream; //导入方法依赖的package包/类
/**
* Loads a legacy configuration file
* @param saveloc The save location
* @return Whether or not the config was loaded successfully
*/
@SuppressWarnings("unchecked")
private final boolean loadLegacyFormat(File saveloc){
try {
ObjectInputStream objin = new ObjectInputStream(new FileInputStream(saveloc));
keyinfo = (List<KeyInformation>) objin.readObject();
showMax = objin.readBoolean();
showCur = objin.readBoolean();
showAvg = objin.readBoolean();
showGraph = objin.readBoolean();
graphAvg = objin.readBoolean();
backlog = objin.readInt();
updateRate = objin.readInt();
double version = 3.0D;
if(objin.available() > 0){
customColors = objin.readBoolean();
background = (Color)objin.readObject();
foreground = (Color)objin.readObject();
if(objin.available() > 0){
trackAll = objin.readBoolean();
showKeys = objin.readBoolean();
if(objin.available() > 0){
version = objin.readDouble();
}
}
}
if(version >= 3.9){
precision = objin.readInt();
}
if(version >= 3.10){
opacitybg = objin.readFloat();
opacityfg = objin.readFloat();
}
if(version >= 4.0D){
size = objin.readDouble();
}
if(version >= 4.2D){
overlay = objin.readBoolean();
}
objin.close();
for(KeyInformation info : keyinfo){
if(version < 3.7D){
info.visible = true;
}
if(info.index > KeyInformation.autoIndex){
KeyInformation.autoIndex = info.index + 1;
}
}
return true;
} catch (Exception e1) {
e1.printStackTrace();
return false;
}
}
示例14: read
import java.io.ObjectInputStream; //导入方法依赖的package包/类
@Override
public final void read(ObjectInputStream is, int count) throws IOException {
for (int i=0; i<count; ++i) {
this.values[i] = is.readDouble();
}
}