1 16 package org.apache.cocoon.components.serializers.encoding; 17 18 24 public abstract class AbstractCharset implements Charset { 25 26 27 private String name; 28 29 private String aliases[]; 30 31 38 public AbstractCharset(String name, String aliases[]) { 39 super(); 40 if (name == null) throw new NullPointerException ("Invalid name"); 41 if (aliases == null) throw new NullPointerException ("Invalid aliases"); 42 this.name = name; 43 this.aliases = aliases; 44 } 45 46 49 public String getName() { 50 return(this.name); 51 } 52 53 56 public String [] getAliases() { 57 String array[] = new String [this.aliases.length]; 58 System.arraycopy(this.aliases, 0, array, 0, array.length); 59 return(array); 60 } 61 62 65 public boolean equals(Object object) { 66 if (object instanceof Charset) return(equals((Charset)object)); 67 return(false); 68 } 69 70 73 public boolean equals(Charset charset) { 74 if (charset == null) return(false); 75 if ((charset.getClass().getName().equals(this.getClass().getName())) 76 && (charset.getName().equals(this.getName()))) return(true); 77 return(false); 78 } 79 80 84 public String toString() { 85 return(super.toString() + "[" + this.getName() + "]"); 86 } 87 } 88 | Popular Tags |