@Test public void testProcessing() { Name<?>[] names= { NamingScheme.getDefault().name("http: NamingScheme.getDefault().name(URI.create("http: NamingScheme.getDefault().name(new QName("http: NamingScheme.getDefault().name(Byte.MAX_VALUE), NamingScheme.getDefault().name(Short.MAX_VALUE), NamingScheme.getDefault().name(Integer.MAX_VALUE), NamingScheme.getDefault().name(Long.MAX_VALUE), NamingScheme.getDefault().name(Double.MAX_VALUE), NamingScheme.getDefault().name(Float.MAX_VALUE), }; Encoder nameEncoder=new NameEncoder(); Encoder valueEncoder=new ValueEncoder(); Stat stat=new Stat(); for(Name<?> name:names) { System.out.printf("Name [%s]: %s%n",name.id().getClass().getName(),name); String nameEncoding = nameEncoder.encode(name); String valueEncoding = valueEncoder.encode(name); stat.add(nameEncoding.length(),valueEncoding.length()); show("Name encoding",nameEncoding); show("Value encoding",valueEncoding); } System.out.println(stat); }
public abstract String encode(Name<?> name);
Encoder { public abstract String encode(Name<?> name); }
Encoder { public abstract String encode(Name<?> name);  }
Encoder { public abstract String encode(Name<?> name);  abstract String encode(Name<?> name); abstract Name<T> decode(String data); static Encoder nameEncoder(); static Encoder valueEncoder(); }
Encoder { public abstract String encode(Name<?> name);  abstract String encode(Name<?> name); abstract Name<T> decode(String data); static Encoder nameEncoder(); static Encoder valueEncoder();  }