比较两个对象并存储结果

时间:2020-01-30 16:45:55

标签: java vector nested comparison

我有两个对象,并使用算法比较它们的字符串。我需要存储结果,两个对象和最佳值。有什么建议吗?

void getDistances(Class m1, Class m2) {        

    Vector[] vector1 = new Vector[m1.getSize()]; // Object from my class
    Vector[] vector2 = new Vector[m2.getSize()]; // Object from my class

    for (int i = 0; i < vector1.length; i++) {
        Class current;
        Class next;

        current = m1.getInfo(i);

        for (int j = 0; j < vector2.length; j++) {
            prox = m2.getInfo(j);
            calcDist = lev.distance(current.getLabel(), next.getLabel());
            System.out.println(current + " <-> " + next + " = " + df.format(calcDist));

            if(something here){
                 // I think it's here the logic ...
            }
        }
    }
}

任何想法都会帮助我。谢谢。

0 个答案:

没有答案