Package net.sf.rej.java.constantpool

Examples of net.sf.rej.java.constantpool.DoubleInfo


  }
 
    private void drawConstant(JavaBytecodeSyntaxDrawer sd, ConstantPoolInfo constant) {
      switch (constant.getType()) {
      case ConstantPoolInfo.DOUBLE:
        DoubleInfo di = (DoubleInfo) constant;
        sd.drawDefault("(");
        sd.drawKeyword("double");
        sd.drawDefault(") " + di.getDoubleValue());
        break;
      case ConstantPoolInfo.FLOAT:
        FloatInfo fi = (FloatInfo) constant;
        sd.drawDefault("(");
        sd.drawKeyword("float");
View Full Code Here


    switch (cpi.getType()) {
    case ConstantPoolInfo.UTF8:
      bie.invoke("Edit UTF-8 Info", cpi.getValue());
      break;
    case ConstantPoolInfo.DOUBLE:
      DoubleInfo di = (DoubleInfo) cpi;
      bie.invoke("Edit Double Info", String.valueOf(di.getDoubleValue()));
      break;
    case ConstantPoolInfo.FLOAT:
      FloatInfo fi = (FloatInfo) cpi;
      bie.invoke("Edit Float Info", String.valueOf(fi.getFloatValue()));
      break;
View Full Code Here

  }
 
  void validateAndInsertDoubleInfo(String str) throws BasicInfoEditor.ValidationException {
    try {
      double d = Double.parseDouble(str);
      EditorFacade.getInstance().addConstantPoolInfo(this.cf.getPool(), new DoubleInfo(d, this.cf.getPool()));
    } catch (Exception e) {
      throw new BasicInfoEditor.ValidationException(e.getMessage());
    }
  }
View Full Code Here

      UTF8Info info = (UTF8Info) cpi;
      EditorFacade.getInstance().modifyUTF8Info(info, newValue);
      break;
    }
    case ConstantPoolInfo.DOUBLE: {
      DoubleInfo info = (DoubleInfo) cpi;
      double d = 0;
      try {
        d = Double.parseDouble(newValue);
      } catch (NumberFormatException nfe) {
        throw new BasicInfoEditor.ValidationException(
            "Not a valid double. (" + nfe.getMessage() + ")");
      }
      EditorFacade.getInstance().modifyDoubleInfo(info, d);
      break;
    }
    case ConstantPoolInfo.FLOAT: {
      FloatInfo info = (FloatInfo) cpi;
      float f = 0;
      try {
        f = Float.parseFloat(newValue);
      } catch (NumberFormatException nfe) {
        throw new BasicInfoEditor.ValidationException(
            "Not a valid float. (" + nfe.getMessage() + ")");
      }
      EditorFacade.getInstance().modifyFloatInfo(info, f);
      break;
    }
    case ConstantPoolInfo.INTEGER: {
      IntegerInfo info = (IntegerInfo) cpi;
      int i = 0;
      try {
        i = Integer.parseInt(newValue);
      } catch (NumberFormatException nfe) {
        throw new BasicInfoEditor.ValidationException(
            "Not a valid integer. (" + nfe.getMessage() + ")");
      }
      EditorFacade.getInstance().modifyIntegerInfo(info, i);
      break;
    }
    case ConstantPoolInfo.LONG: {
      LongInfo info = (LongInfo) cpi;
      long l = 0;
      try {
        l = Long.parseLong(newValue);
      } catch (NumberFormatException nfe) {
        throw new BasicInfoEditor.ValidationException(
            "Not a valid long. (" + nfe.getMessage() + ")");
      }
      EditorFacade.getInstance().modifyLongInfo(info, l);
      break;
    }
    case ConstantPoolInfo.STRING: {
      StringInfo info = (StringInfo) cpi;
      int answer = JOptionPane.showOptionDialog(this,
          "Modify underlying UTF-8 info or create a new one.",
          "Modify String Info item",
          JOptionPane.YES_NO_CANCEL_OPTION,
          JOptionPane.QUESTION_MESSAGE, null, new String[] {
              "Modify", "Create new", "Cancel" }, "Modify");
      if (answer == JOptionPane.YES_OPTION) {
        // Modify UTF-8 Info
        UTF8Info ui = info.getUTF8Info();
        EditorFacade.getInstance().modifyUTF8Info(ui, newValue);
        break;

      } else if (answer == JOptionPane.NO_OPTION) {
        // Create a new UTF-8 Info
View Full Code Here

            }
            case TYPE_CONSTANT_POOL_CONSTANT: {
              ConstantPoolInfo cpi = sourcePool.get(params.getInt(i));
              switch (cpi.getType()) {
              case ConstantPoolInfo.DOUBLE: {
                DoubleInfo di = (DoubleInfo)cpi;
                DoubleInfo diCopy = new DoubleInfo(di.getHighBytes(), di.getLowBytes(), destinationPool);
                int index = destinationPool.optionalAdd(diCopy);
                copyParams.addValue(index);
                break;
              }
              case ConstantPoolInfo.FLOAT: {
View Full Code Here

TOP

Related Classes of net.sf.rej.java.constantpool.DoubleInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.