comparator

    0热度

    2回答

    这是我的主要结构: 一些接口方法在类A中实现,其余的都在子类中实现。 public interface I { // some methods // } public abstract class A implements I { // some variables and methods // } public class B extends A { // some

    1热度

    2回答

    我有一个列表 List<String> names = new ArrayList<String>(); names.add("One"); names.add("Two"); names.add("Three"); names.add("Six"); names.add("Four"); names.add("Five"); 我想这个列表进行排序,使得六是第一位的,然后应该是按字

    1热度

    4回答

    我有在里面,并在其内容的其他对象的内容列表中的对象而不列表类似下面 List<LoginInformation> allUsersLoginInfo LoginInformation loginInformation 现在我想要的代码比较这两个,看看loginInformation的元素是否存在于allUsersLoginInfo LoginInformation是一个模型类。 它有名字和R

    0热度

    1回答

    我使用Apache Commons IO比较和排序File[]类型的数组。 import org.apache.commons.io.comparator.*; public abstract class Order { static final String ABS = "abs", TYPE = "type", SIZE = "size"; public static vo

    0热度

    2回答

    我使用下面的方法调用来返回对象列表。 final List<LinkModelSpi> documentLinks = this.documentLinksModelSpi.getDocumentLinks(); 接下来我使用了Comparator对这个列表进行排序。但List包含两种类型的对象。有些功能的工作原理是返回DocumentLinkModelImpl和一些功能操作它返回LinkMo

    -1热度

    2回答

    我使用Comparator接口,使用下面的代码片段按升序排序对象: final List<LinkModelSpi> documentLinks = this.documentLinksModelSpi.getDocumentLinks(); //Add This method for Sorting Document Link View Same Order. Now The applica

    -4热度

    2回答

    我已经创建了下列比较测试图的所有元素: struct comparator{ bool operatior() (int a,int b){ return 1; } } 则以下algorthim: int main(){ // imports string to currentString ... std::map<int,ch

    1热度

    3回答

    我的类实现了Comparator<ClassName>。 我的要求是在叫rNumber双类型字段的降序排序ArrayList<Hw4b> myList;。我调用Collections.sort(myList,this); 我总是 异常在线程“主” java.lang.IllegalArgumentException异常: 比较法违反其总承包!在 java.util.TimSort.mergeHi(

    0热度

    1回答

    我有优先级队列和我的比较器泛型类型的问题,因为我不知道如何重新键入。 当我调用比较(IRecord t,IRecord t1)方法时,它需要IRecord对象,但我需要比较泛型类型。 Class AbstrPriorQueue必须是泛型。 有与对象IRecord工作的比较: public class MyComparator implements Comparator<IZaznam> { @

    1热度

    1回答

    我是Java的新手,我尝试使用Lambda表达式和比较器进行练习。 我有这个公共类的人与其他getter和toString方法: public class Person { private String name; private int age; private int computers; private double salary; public