Package java.text

Examples of java.text.DateFormat.clone()


         *    should have occured, with respect to default dateformat
         *    and timezone configuration. But we still better clone
         *    an instance as formatters may be stateful.
         */
        DateFormat df = _config.getDateFormat();
        _dateFormat = df = (DateFormat) df.clone();
        return df;
    }
}
View Full Code Here


        if ( df == null ) {
            df = this.map.get( identifier );
            if ( df == null ) {
                throw new RuntimeException( "Unable to find DateFormat for id '" + identifier + "'" );
            }
            this.localMap.get().put( identifier, ( DateFormat ) df.clone() );
        }
       
        try {
            return df.parse( date );
        } catch ( ParseException e ) {
View Full Code Here

/*     */
/*     */   public String format(Date date, String pattern) {
/* 191 */     DateFormat formatter = null;
/* 192 */     formatter = getDateFormatInstance();
/* 193 */     if ((formatter instanceof SimpleDateFormat)) {
/* 194 */       formatter = (SimpleDateFormat)formatter.clone();
/* 195 */       ((SimpleDateFormat)formatter).applyPattern(pattern);
/*     */     }
/* 197 */     return formatter.format(date);
/*     */   }
/*     */
View Full Code Here

/*     */     throws ParseException
/*     */   {
/* 211 */     DateFormat formatter = null;
/* 212 */     formatter = getDateFormatInstance();
/* 213 */     if ((formatter instanceof SimpleDateFormat)) {
/* 214 */       formatter = (SimpleDateFormat)formatter.clone();
/* 215 */       ((SimpleDateFormat)formatter).applyPattern(pattern);
/*     */     }
/* 217 */     return formatter.parse(date);
/*     */   }
/*     */
View Full Code Here

                localizedDateFormats.put(fk, format);
            }
        }

        // Clone it and store the clone in the local cache
        format = (DateFormat) format.clone();
        typedDateFormat.put(pattern, format);
        return format;
    }

    int parseDateStyleToken(String token) {
View Full Code Here

        if ( df == null ) {
            df = this.map.get( identifier );
            if ( df == null ) {
                throw new RuntimeException( "Unable to find DateFormat for id '" + identifier + "'" );
            }
            this.localMap.get().put( identifier, ( DateFormat ) df.clone() );
        }
       
        try {
            return df.parse( date );
        } catch ( ParseException e ) {
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.