Package java.text

Examples of java.text.FieldPosition$Delegate


        }
        //System.out.println("start = " + d);
        // set the unit
        sdf.applyPattern("yyyy-MM-dd HH:mm:ss Z");
        setUnit("hours since "
                + sdf.format(d, new StringBuffer(), new FieldPosition(0)));
        // parse the increment
        // vvkk where
        // vv     =       an integer number, 1 or 2 digits
        // kk     =       mn (minute)
        //                hr (hour)
View Full Code Here


  // ---------------------------------------------------------------------------

  public void setCurrencyFormat(String sFormat) throws NullPointerException {
    sCurrencyFormat = sFormat;
    oCurrencyFormat = new DecimalFormat(sFormat);
    oCurrencyFieldP = new FieldPosition(NumberFormat.FRACTION_FIELD);
    oCurrencyBuffer = new StringBuffer();
  }
View Full Code Here

  format.setLocale (locale);

  // return the formatted message
  StringBuffer  result = new StringBuffer ();

  result = format.format (parameters, result, new FieldPosition (0));
  return result.toString ();
    }
View Full Code Here

    public String getMonth(int m) {
        GregorianCalendar month = new GregorianCalendar(2000, m, 1);
        SimpleDateFormat dateFormat = new SimpleDateFormat("MMMM",
                this.currentLocale);
        StringBuffer result = new StringBuffer();
        result = dateFormat.format(month.getTime(), result, new FieldPosition(
                DateFormat.MONTH_FIELD));
        return result.toString();
    }
View Full Code Here

        day.add(Calendar.DATE, d);

        SimpleDateFormat dateFormat = new SimpleDateFormat("EEE",
                this.currentLocale);
        StringBuffer result = new StringBuffer();
        result = dateFormat.format(day.getTime(), result, new FieldPosition(
                DateFormat.DAY_OF_WEEK_FIELD));
        return result.toString();
    }
View Full Code Here

    if ( this.opened.getTime() != that.opened.getTime() )
      {
      mods = true;
      buf.append( prefix );
      buf.append( "Open date changed from '" );
      dFmt.format( that.opened, dBuf, new FieldPosition(0) );
      buf.append( dBuf );
      buf.append( "' to '" );
      dFmt.format( this.opened, dBuf, new FieldPosition(0) );
      buf.append( dBuf );
      buf.append( "'.\n" );
      }

    // CLOSE DATE
    if ( this.closed == null && that.closed == null )
      {
      // No mods
      }
    else if ( this.closed == null && that.closed != null )
      {
      mods = true;
      buf.append( prefix );
      buf.append( "Close date unset, previous value was '" );
      dFmt.format( that.closed, dBuf, new FieldPosition(0) );
      buf.append( dBuf );
      buf.append( "'.\n" );
      }
    else if ( this.closed != null && that.closed == null )
      {
      mods = true;
      buf.append( prefix );
      buf.append( "Close date set to '" );
      dFmt.format( this.closed, dBuf, new FieldPosition(0) );
      buf.append( dBuf );
      buf.append( "'.\n" );
      }
    else if ( this.closed.getTime() != that.closed.getTime() )
      {
      mods = true;
      buf.append( prefix );
      buf.append( "Close date changed from '" );
      dFmt.format( that.closed, dBuf, new FieldPosition(0) );
      buf.append( dBuf );
      buf.append( "' to '" );
      dFmt.format( this.closed, dBuf, new FieldPosition(0) );
      buf.append( dBuf );
      buf.append( "'.\n" );
      }

    if ( ! this.envdesc.equals( that.envdesc ) )
View Full Code Here

   * @param number Zahl
   * @return formatierte Darstellung der Zahl
   */
  private static String format(NumberFormat nf, Number number) {
    StringBuffer sb = new StringBuffer();
    sb = nf.format(number, sb, new FieldPosition(0));
    return sb.toString();
  }
View Full Code Here

    String queuePattern="yyyy-MM-dd.HHmmss.S";
    Date d = new Date();
      StringBuffer bb = new StringBuffer();
      SimpleDateFormat s =  new SimpleDateFormat(queuePattern);

      FieldPosition fp = new FieldPosition(0);
      StringBuffer b =  s.format(d,bb,fp);
     
      String dumpFileName = logDirectory  + "/" + "sos." + b + ".email";
      try{
        mail.dumpMessageToFile(dumpFileName,true);
View Full Code Here

//--------------------------------------------------------------------------------dumpMessageToFile
    private void dumpMessageToFile(boolean withAttachment) throws Exception{
    Date d = new Date();
    StringBuffer bb = new StringBuffer();
    SimpleDateFormat s =  new SimpleDateFormat(queuePattern);
    FieldPosition fp = new FieldPosition(0);
    StringBuffer b =  s.format(d,bb,fp);
    lastGeneratedFileName = queueDir  + "/" + queuePraefix + b + ".email";
    File f = new File(lastGeneratedFileName);
    while (f.exists()){
      b =  s.format(d,bb,fp);
View Full Code Here

       
      Date d = new Date();
      StringBuffer bb = new StringBuffer();
      SimpleDateFormat s =  new SimpleDateFormat(queuePattern);

    FieldPosition fp = new FieldPosition(0);
    StringBuffer b =  s.format(d,bb,fp);
   
   
    dumpedFileName = queueDir + queuePraefix + b + ".email";
View Full Code Here

TOP

Related Classes of java.text.FieldPosition$Delegate

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.