static void readSlotWithFields(
     short fieldsKey[], ClassMetaDataSlot slot, ObjectInput input, Object obj)
     throws IOException, ClassNotFoundException {
   short numberOfFields = (short) fieldsKey.length;
   for (short i = 0; i < numberOfFields; i++) {
     ClassMetadataField field = slot.getFields()[fieldsKey[i]];
     if (field.getField().getType() == Integer.TYPE) {
       FieldsManager.getFieldsManager().setInt(obj, field, input.readInt());
     } else if (field.getField().getType() == Byte.TYPE) {
       FieldsManager.getFieldsManager().setByte(obj, field, input.readByte());
     } else if (field.getField().getType() == Long.TYPE) {
       FieldsManager.getFieldsManager().setLong(obj, field, input.readLong());
     } else if (field.getField().getType() == Float.TYPE) {
       FieldsManager.getFieldsManager().setFloat(obj, field, input.readFloat());
     } else if (field.getField().getType() == Double.TYPE) {
       FieldsManager.getFieldsManager().setDouble(obj, field, input.readDouble());
     } else if (field.getField().getType() == Short.TYPE) {
       FieldsManager.getFieldsManager().setShort(obj, field, input.readShort());
     } else if (field.getField().getType() == Character.TYPE) {
       FieldsManager.getFieldsManager().setCharacter(obj, field, input.readChar());
     } else if (field.getField().getType() == Boolean.TYPE) {
       FieldsManager.getFieldsManager().setBoolean(obj, field, input.readBoolean());
     } else {
       Object objTmp = input.readObject();
       FieldsManager.getFieldsManager().setObject(obj, field, objTmp);
     }
   }
 }
  /** {@inheritDoc} */
  public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
    // VERSION
    in.readByte();

    // SUPER
    super.readExternal(in);

    // NUMBER OF ENTRIES
    int size = in.readInt();
    setUp(size);

    // ENTRIES
    while (size-- > 0) {
      long key = in.readLong();
      float val = in.readFloat();
      put(key, val);
    }
  }
Exemplo n.º 3
0
  private static void readFrom(ObjectInput o, ViewComponentInfo v)
      throws IOException, ClassNotFoundException {
    v.x = o.readInt();
    v.y = o.readInt();
    v.width = o.readInt();
    v.height = o.readInt();
    v.measuredWidth = o.readInt();
    v.measuredHeight = o.readInt();
    v.scrollX = o.readInt();
    v.scrollY = o.readInt();
    v.absoluteX = o.readInt();
    v.absoluteY = o.readInt();
    v.cameraDistance = o.readFloat();
    v.visible = o.readBoolean();
    v.drawingTime = o.readLong();
    v.isShown = o.readBoolean();
    v.hasFocus = o.readBoolean();
    v.focusable = o.readBoolean();
    v.hasOnClickListener = o.readBoolean();
    v.viewType = (String) o.readObject();
    v.textContent = (String) o.readObject();
    v.isEditText = o.readBoolean();
    v.isInputMethodTarget = o.readBoolean();
    v.isContainer = o.readBoolean();
    v.inputMethod = o.readInt();
    v.id = o.readInt();

    int size = o.readInt();
    if (size != 0) {
      v.children = new LinkedList<ViewComponentInfo>();
      for (int i = 0; i < size; i++) {
        ViewComponentInfo c = new ViewComponentInfo();
        readFrom(o, c);
        v.children.add(c);
      }
    }
  }