列挙型:
public enum ComponentType {
INSTRUCTION, ACTION, SERVICE, DOMAIN, INTEGRATION, OTHER, CONTEXT;
}
クラスA:
public class A
{
String name;
ComponentType c;
public A(String name, ComponentType c)
{
this.name = name;
this.c = c;
}
}
コード:
List<A> l = new ArrayList<A>();
l.add(new A("ZY", ACTION));
l.add(new A("ZY0", INSTRUCTION));
l.add(new A("ZY1", DOMAIN));
l.add(new A("ZY2", SERVICE));
l.add(new A("ZY3", INSTRUCTION));
l.add(new A("ZY4", ACTION));
列挙型の順序に従ってリストを並べ替える方法は?