本文整理匯總了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();
}