/[classpath]/classpath/java/nio/charset/Charset.java
ViewVC logotype

Diff of /classpath/java/nio/charset/Charset.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.11.2.10 by gnu_andrew, Tue Sep 20 18:46:29 2005 UTC revision 1.11.2.11 by tromey, Tue Sep 27 16:56:22 2005 UTC
# Line 217  public abstract class Charset implements Line 217  public abstract class Charset implements
217      return cs;      return cs;
218    }    }
219    
220    public static SortedMap availableCharsets()    public static SortedMap<String, Charset> availableCharsets()
221    {    {
222      TreeMap charsets = new TreeMap(String.CASE_INSENSITIVE_ORDER);      TreeMap<String, Charset> charsets
223      for (Iterator i = provider().charsets(); i.hasNext(); )        = new TreeMap(String.CASE_INSENSITIVE_ORDER);
224        for (Iterator<Charset> i = provider().charsets(); i.hasNext(); )
225        {        {
226          Charset cs = (Charset) i.next();          Charset cs = i.next();
227          charsets.put(cs.name(), cs);          charsets.put(cs.name(), cs);
228        }        }
229    
230      CharsetProvider[] providers = providers2();      CharsetProvider[] providers = providers2();
231      for (int j = 0; j < providers.length; j++)      for (int j = 0; j < providers.length; j++)
232        {        {
233          for (Iterator i = providers[j].charsets(); i.hasNext(); )          for (Iterator<Charset> i = providers[j].charsets(); i.hasNext(); )
234            {            {
235              Charset cs = (Charset) i.next();              Charset cs = (Charset) i.next();
236              charsets.put(cs.name(), cs);              charsets.put(cs.name(), cs);
# Line 282  public abstract class Charset implements Line 283  public abstract class Charset implements
283      return canonicalName;      return canonicalName;
284    }    }
285    
286    public final Set aliases ()    public final Set<String> aliases ()
287    {    {
288      if (aliases == null)      if (aliases == null)
289        return Collections.EMPTY_SET;        return Collections.<String>emptySet();
290    
291      // should we cache the aliasSet instead?      // should we cache the aliasSet instead?
292      int n = aliases.length;      int n = aliases.length;
293      HashSet aliasSet = new HashSet (n);      HashSet<String> aliasSet = new HashSet<String> (n);
294      for (int i = 0; i < n; ++i)      for (int i = 0; i < n; ++i)
295          aliasSet.add (aliases[i]);          aliasSet.add (aliases[i]);
296      return Collections.unmodifiableSet (aliasSet);      return Collections.unmodifiableSet (aliasSet);

Legend:
Removed from v.1.11.2.10  
changed lines
  Added in v.1.11.2.11

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26