當前位置: 首頁>>代碼示例>>Java>>正文


Java DataInput.readDouble方法代碼示例

本文整理匯總了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);
    }
}
 
開發者ID:aika-algorithm,項目名稱:aika,代碼行數:19,代碼來源:Synapse.java

示例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);
}
 
開發者ID:quqiangsheng,項目名稱:abhot,代碼行數:9,代碼來源:ComplexDataPointFactory.java

示例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;
}
 
開發者ID:ampool,項目名稱:monarch,代碼行數:17,代碼來源:DataSerializer.java

示例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();
}
 
開發者ID:huyang1,項目名稱:LDA,代碼行數:8,代碼來源:twoDimensionIndexWritable.java

示例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);
	}
}
 
開發者ID:transwarpio,項目名稱:rapidminer,代碼行數:47,代碼來源:ExampleSetToStream.java

示例6: read

import java.io.DataInput; //導入方法依賴的package包/類
@Override
public void read(DataInput stream) throws Exception{
    this.data = stream.readDouble();
}
 
開發者ID:RockBottomGame,項目名稱:API,代碼行數:5,代碼來源:PartDouble.java

示例7: read

import java.io.DataInput; //導入方法依賴的package包/類
void read(DataInput input, int depth, NBTSizeTracker sizeTracker) throws IOException
{
    sizeTracker.read(128L);
    this.data = input.readDouble();
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:6,代碼來源:NBTTagDouble.java

示例8: readFields

import java.io.DataInput; //導入方法依賴的package包/類
@Override
public void readFields(DataInput in) throws IOException {
  value = in.readDouble();
}
 
開發者ID:naver,項目名稱:hadoop,代碼行數:5,代碼來源:DoubleWritable.java

示例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(); 
}
 
開發者ID:nucypher,項目名稱:hadoop-oss,代碼行數:6,代碼來源:ArrayPrimitiveWritable.java

示例10: readStream

import java.io.DataInput; //導入方法依賴的package包/類
@Override
public Double readStream(final DataInput data)
        throws IOException
{
    return data.readDouble();
}
 
開發者ID:Leviathan-Studio,項目名稱:MineIDE,代碼行數:7,代碼來源:DataTypeList.java

示例11: read

import java.io.DataInput; //導入方法依賴的package包/類
@Override
public void read(DataInput input) throws IOException {
    super.value = input.readDouble();
}
 
開發者ID:McMoonLakeDev,項目名稱:MoonLakeNBT,代碼行數:5,代碼來源:NBTTagDouble.java

示例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);
        }
    }
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:71,代碼來源:ModuleInfo.java

示例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();
}
 
開發者ID:naver,項目名稱:hadoop,代碼行數:7,代碼來源:Key.java

示例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());
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:10,代碼來源:ConstantDouble.java

示例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();
}
 
開發者ID:sunmingshuai,項目名稱:apache-tomcat-7.0.73-with-comment,代碼行數:11,代碼來源:ConstantDouble.java


注:本文中的java.io.DataInput.readDouble方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。