1 /* Copyright (C) 1998, 1999 Cygnus Solutions
3 This file is part of libgcj.
5 This software is copyrighted work licensed under the terms of the
6 Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
12 * @author Per Bothner <bothner@cygnus.com>
13 * @date October 25, 1998.
15 /* Written using "Java Class Libraries", 2nd edition, plus online
16 * API docs for JDK 1.2 beta from http://www.javasoft.com.
17 * Status: Believed complete and correct.
20 public abstract class Format implements java.io.Serializable, Cloneable
26 public abstract StringBuffer format (Object obj,
27 StringBuffer sbuf, FieldPosition pos);
29 public final String format (Object obj)
31 StringBuffer sbuf = new StringBuffer();
32 format(obj, sbuf, new FieldPosition(0));
33 return sbuf.toString();
36 public abstract Object parseObject (String source, ParsePosition pos);
38 public Object parseObject (String source) throws ParseException
40 ParsePosition pos = new ParsePosition(0);
41 Object result = parseObject (source, pos);
44 int index = pos.getErrorIndex();
46 index = pos.getIndex();
47 throw new ParseException("parseObject failed", index);