我有一个对象具有与该对象关联的5种不同整数类型的对象。像这样:java arraylist在对象上包含类型
public class Edge implements Comparable {
int weight, tox, toy, fromx, fromy;
public Edge(int x1, int y1, int x2, int y2, int wei) {
tox = x1;
toy = y1;
fromx = x2;
fromy = y2;
weight = wei;
}
public int compareTo(Object obj) {
我要让这些OBJ文件的ArrayList,然后调用包含在名单上看到,如果任意整数处于或者列表中的任何一种数据类型,edge.tox edge.toy edge.fromx或edge.fromy ....有没有办法做到这一点?
感谢你在先进
等等,你想要一个'列表'或列表'? –
durron597
2013-04-24 21:16:24