Package java.math

Examples of java.math.BigDecimal.longValue()


                        }

                        if (num.scale() > 0) {
                            return new Double(num.doubleValue());
                        } else {
                            return new Long(num.longValue());
                        }

                    case Types.VARBINARY:
                    case Types.BINARY:
                        return resultSet.getString(index);
View Full Code Here


                        break;
                    }
                    if (num.scale() > 0) {
                        newprop.setFloatValue(num.doubleValue());
                    } else {
                        newprop.setIntegerValue(num.longValue());
                    }

                    break;

                case Types.VARBINARY:
View Full Code Here

        long n = nanos;
        BigDecimal bd = BigDecimal.valueOf(n);
        bd = bd.movePointLeft(9);
        bd = MathUtils.setScale(bd, targetScale);
        bd = bd.movePointRight(9);
        long n2 = bd.longValue();
        if (n2 == n) {
            return this;
        }
        return fromDateValueAndNanos(dateValue, n2);
    }
View Full Code Here

                break;
            case DECIMAL_DECIMAL:
            case DECIMAL_INT:
            case INT_DECIMAL:
                BigDecimal bd2 = DivDecimal.compute(it1, it2, dynEnv);
                long ll2 = bd2.longValue();
                result = new XInteger(ll2);
                break;
            case FLOAT_INT:
            case FLOAT_FLOAT:
            case FLOAT_DECIMAL:
View Full Code Here

         return new ClientProperty(name, null, null, ts.toString());
      }
      if (val instanceof BigDecimal) {
         BigDecimal dec = (BigDecimal)val;
         try {
            return new ClientProperty(name, null, null, "" + dec.longValue());
         }
         catch (Exception ex) {
            return new ClientProperty(name, null, null, "" + dec.doubleValue());
         }
      }
View Full Code Here

            return new ClientProperty(name, null, null, "" + dec.doubleValue());
         }
      }
      if (val instanceof BigInteger) {
         BigInteger dec = (BigInteger)val;
         return new ClientProperty(name, null, null, "" + dec.longValue());
      }
      if (val instanceof Date) {
         // Date date = (Date)val;
         Timestamp ts = rs.getTimestamp(pos);
         // DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
View Full Code Here

          BigDecimal oPartOffset = oRSet.getBigDecimal(6);
          if (oRSet.wasNull()) throw new SQLException ("nu_offset column may not be null for parts with pointer disposition", "22002", 22002);
          if (DebugFile.trace) DebugFile.writeln("new File(" + sTmpFilePath + ")");
          File oFile = new File (sTmpFilePath);
          MboxFile oMbox = new MboxFile(oFile, MboxFile.READ_ONLY);
          oRetVal = oMbox.getPartAsStream(oMsgPos.longValue(), oPartOffset.longValue(), Integer.parseInt(oPartLen.toString()));
          oMimeBody = new MimeBodyPart(oRetVal);
          oRetVal.close();
        }
        else if ((oFldr.getType()&DBFolder.MODE_BLOB)!=0) {
          if (DebugFile.trace) DebugFile.writeln("new MimeBodyPart(ResultSet.getBinaryStream(...))");
View Full Code Here

    String sNewGuid = null;
    try {
      if ((oSrcFldr.mode&MODE_MBOX)!=0) {
        if (DebugFile.trace) DebugFile.writeln("new MboxFile(" + oSrcFldr.getFile() + ", MboxFile.READ_ONLY)");
        oMboxSrc = new MboxFile(oSrcFldr.getFile(), MboxFile.READ_ONLY);
        InputStream oInStrm = oMboxSrc.getMessageAsStream(oPos.longValue(), iLen);
        oMimeSrc = new MimeMessage(Session.getDefaultInstance(new Properties()), oInStrm);
        oInStrm.close();
        oMboxSrc.close();
        oMboxSrc=null;
View Full Code Here

        oMboxThis = new MboxFile(getFile(), MboxFile.READ_WRITE);

        if (DebugFile.trace) DebugFile.writeln("MboxFile.appendMessage([MboxFile], "+oPos.toString()+","+String.valueOf(iLen)+")");

        oMboxThis.appendMessage(oMboxSrc, oPos.longValue(), iLen);

        oMboxThis.close();
        oMboxThis=null;

        oMboxSrc.purge (new int[]{oPg.intValue()});
View Full Code Here

      }

      File oFile = oDBF.getFile();
      MboxFile oMBox = new MboxFile(oFile, MboxFile.READ_ONLY);

      InputStream oInStrm = oMBox.getMessageAsStream(oPos.longValue(), iLen);
      StreamPipe oPipe = new StreamPipe();
      oPipe.between(oInStrm, oOutStrm);
      oInStrm.close();
      oMBox.close();
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.