本文整理汇总了Java中java.io.DataInput.readDouble方法的典型用法代码示例。如果您正苦于以下问题:Java DataInput.readDouble方法的具体用法?Java DataInput.readDouble怎么用?Java DataInput.readDouble使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.io.DataInput
的用法示例。
在下文中一共展示了DataInput.readDouble方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: readFields
import java.io.DataInput; //导入方法依赖的package包/类
@Override
public void readFields(DataInput in, Model m) throws IOException {
input = m.lookupNeuron(in.readInt());
output = m.lookupNeuron(in.readInt());
inputNode = m.lookupNodeProvider(in.readInt());
key = lookupKey(Key.read(in, m));
weight = in.readDouble();
bias = in.readDouble();
isConjunction = in.readBoolean();
if(in.readBoolean()) {
meta = new MetaSynapse();
meta.readFields(in, m);
}
}
示例2: getDataPoint
import java.io.DataInput; //导入方法依赖的package包/类
@Override
public DataPoint getDataPoint(long timestamp, DataInput buffer) throws IOException
{
double real = buffer.readDouble();
double imaginary = buffer.readDouble();
return new ComplexDataPoint(timestamp, real, imaginary);
}
示例3: readPrimitiveDouble
import java.io.DataInput; //导入方法依赖的package包/类
/**
* Reads a primitive <code>double</code> from a <code>DataInput</code>.
*
* @throws IOException A problem occurs while reading from <code>in</code>
* @see DataInput#readDouble
* @since GemFire 5.1
*/
public static double readPrimitiveDouble(DataInput in) throws IOException {
InternalDataSerializer.checkIn(in);
double value = in.readDouble();
if (logger.isTraceEnabled(LogMarker.SERIALIZER)) {
logger.trace(LogMarker.SERIALIZER, "Read Double {}", value);
}
return value;
}
示例4: readFields
import java.io.DataInput; //导入方法依赖的package包/类
public void readFields(DataInput dataInput) throws IOException {
this.m = dataInput.readInt();
this.n = dataInput.readInt();
this.topic = dataInput.readInt();
this.probability = dataInput.readDouble();
this.matrixKind = dataInput.readUTF();
}
示例5: readDatum
import java.io.DataInput; //导入方法依赖的package包/类
/**
* Reads a single datum in non-sparse representation of the given type and returns it as a
* double.
*/
private final double readDatum(final DataInput in, final ColumnType columnType) throws IOException {
switch (columnType) {
case DOUBLE:
return in.readDouble();
case INTEGER:
int iValue = in.readInt();
if (iValue == Integer.MIN_VALUE + 1) {
boolean isMissing = in.readBoolean();
if (isMissing) {
return Double.NaN;
} else {
return iValue;
}
} else {
return iValue;
}
case NOMINAL_BYTE:
byte bValue = in.readByte();
if (bValue == -1) {
return Double.NaN;
} else {
return bValue;
}
case NOMINAL_INTEGER:
iValue = in.readInt();
if (iValue == -1) {
return Double.NaN;
} else {
return iValue;
}
case NOMINAL_SHORT:
short sValue = in.readShort();
if (sValue == -1) {
return Double.NaN;
} else {
return sValue;
}
default:
// cannot happen
throw new RuntimeException("Illegal type: " + columnType);
}
}
示例6: read
import java.io.DataInput; //导入方法依赖的package包/类
@Override
public void read(DataInput stream) throws Exception{
this.data = stream.readDouble();
}
示例7: read
import java.io.DataInput; //导入方法依赖的package包/类
void read(DataInput input, int depth, NBTSizeTracker sizeTracker) throws IOException
{
sizeTracker.read(128L);
this.data = input.readDouble();
}
示例8: readFields
import java.io.DataInput; //导入方法依赖的package包/类
@Override
public void readFields(DataInput in) throws IOException {
value = in.readDouble();
}
示例9: readDoubleArray
import java.io.DataInput; //导入方法依赖的package包/类
private void readDoubleArray(DataInput in) throws IOException {
double[] v = (double[]) value;
for (int i = 0; i < length; i++)
v[i] = in.readDouble();
}
示例10: readStream
import java.io.DataInput; //导入方法依赖的package包/类
@Override
public Double readStream(final DataInput data)
throws IOException
{
return data.readDouble();
}
示例11: read
import java.io.DataInput; //导入方法依赖的package包/类
@Override
public void read(DataInput input) throws IOException {
super.value = input.readDouble();
}
示例12: ConstantPool
import java.io.DataInput; //导入方法依赖的package包/类
ConstantPool(DataInput in) throws IOException {
int count = in.readUnsignedShort();
pool = new Entry[count];
for (int i = 1; i < count; i++) {
int tag = in.readUnsignedByte();
switch (tag) {
case CONSTANT_Utf8:
String svalue = in.readUTF();
pool[i] = new ValueEntry(tag, svalue);
break;
case CONSTANT_Class:
case CONSTANT_Package:
case CONSTANT_Module:
case CONSTANT_String:
int index = in.readUnsignedShort();
pool[i] = new IndexEntry(tag, index);
break;
case CONSTANT_Double:
double dvalue = in.readDouble();
pool[i] = new ValueEntry(tag, dvalue);
i++;
break;
case CONSTANT_Fieldref:
case CONSTANT_InterfaceMethodref:
case CONSTANT_Methodref:
case CONSTANT_InvokeDynamic:
case CONSTANT_NameAndType:
int index1 = in.readUnsignedShort();
int index2 = in.readUnsignedShort();
pool[i] = new Index2Entry(tag, index1, index2);
break;
case CONSTANT_MethodHandle:
int refKind = in.readUnsignedByte();
index = in.readUnsignedShort();
pool[i] = new Index2Entry(tag, refKind, index);
break;
case CONSTANT_MethodType:
index = in.readUnsignedShort();
pool[i] = new IndexEntry(tag, index);
break;
case CONSTANT_Float:
float fvalue = in.readFloat();
pool[i] = new ValueEntry(tag, fvalue);
break;
case CONSTANT_Integer:
int ivalue = in.readInt();
pool[i] = new ValueEntry(tag, ivalue);
break;
case CONSTANT_Long:
long lvalue = in.readLong();
pool[i] = new ValueEntry(tag, lvalue);
i++;
break;
default:
throw invalidModuleDescriptor("Bad constant pool entry: "
+ i);
}
}
}
示例13: readFields
import java.io.DataInput; //导入方法依赖的package包/类
@Override
public void readFields(DataInput in) throws IOException {
this.bytes = new byte[in.readInt()];
in.readFully(this.bytes);
weight = in.readDouble();
}
示例14: ConstantDouble
import java.io.DataInput; //导入方法依赖的package包/类
/**
* Initialize instance from file data.
*
* @param file Input stream
* @throws IOException
*/
ConstantDouble(final DataInput file) throws IOException {
this(file.readDouble());
}
示例15: ConstantDouble
import java.io.DataInput; //导入方法依赖的package包/类
/**
* Initialize instance from file data.
*
* @param file Input stream
* @throws IOException
*/
ConstantDouble(final DataInput file) throws IOException {
super(Const.CONSTANT_Double);
this.bytes = file.readDouble();
}