Package java.util

Examples of java.util.Comparator


         * @return true if this attribute name is equal to the
         *         specified attribute object
   */
  public boolean equals(Object o) {
      if (o instanceof Name) {
    Comparator c = ASCIICaseInsensitiveComparator.CASE_INSENSITIVE_ORDER;
    return c.compare(name, ((Name)o).name) == 0;
      } else {
    return false;
      }
  }
View Full Code Here


   public IntegerIndexedColumn(List<Object[]> rows, int colIx, ColumnDisplayDefinition colDef)
   {
      super(rows, colIx, colDef);

      Comparator comparator = new Comparator<Object>()
      {
         @Override
         public int compare(Object ix1, Object ix2)
         {
            if( ix1 instanceof NoIx && ix2 instanceof NoIx)
View Full Code Here

   public StringIndexedColumn(List<Object[]> rows, int colIx, ColumnDisplayDefinition colDef)
   {
      super(rows, colIx, colDef);

      Comparator comparator = new Comparator<Object>()
      {
         @Override
         public int compare(Object ix1, Object ix2)
         {
            if( ix1 instanceof NoIx && ix2 instanceof NoIx)
View Full Code Here

   public BooleanIndexedColumn(List<Object[]> rows, int colIx, ColumnDisplayDefinition colDef)
   {
      super(rows, colIx, colDef);

      Comparator comparator = new Comparator<Object>()
      {
         @Override
         public int compare(Object ix1, Object ix2)
         {
            if( ix1 instanceof NoIx && ix2 instanceof NoIx)
View Full Code Here

   public TimestampIndexedColumn(List<Object[]> rows, int colIx, ColumnDisplayDefinition colDef)
   {
      super(rows, colIx, colDef);

      Comparator comparator = new Comparator<Object>()
      {
         @Override
         public int compare(Object ix1, Object ix2)
         {
            if( ix1 instanceof NoIx && ix2 instanceof NoIx)
View Full Code Here

   public DoubleIndexedColumn(List<Object[]> rows, int colIx, ColumnDisplayDefinition colDef)
   {
      super(rows, colIx, colDef);

      Comparator comparator = new Comparator<Object>()
      {
         @Override
         public int compare(Object ix1, Object ix2)
         {
            if( ix1 instanceof NoIx && ix2 instanceof NoIx)
View Full Code Here

      Field[] fields = cl.getDeclaredFields();
      MemberSignature[] fieldSigs = new MemberSignature[fields.length];
      for (int i = 0; i < fields.length; i++) {
    fieldSigs[i] = new MemberSignature(fields[i]);
      }
      Arrays.sort(fieldSigs, new Comparator() {
    public int compare(Object o1, Object o2) {
        String name1 = ((MemberSignature) o1).name;
        String name2 = ((MemberSignature) o2).name;
        return name1.compareTo(name2);
    }
      });
      for (int i = 0; i < fieldSigs.length; i++) {
    MemberSignature sig = fieldSigs[i];
    int mods = sig.member.getModifiers() &
        (Modifier.PUBLIC | Modifier.PRIVATE | Modifier.PROTECTED |
         Modifier.STATIC | Modifier.FINAL | Modifier.VOLATILE |
         Modifier.TRANSIENT);
    if (((mods & Modifier.PRIVATE) == 0) ||
        ((mods & (Modifier.STATIC | Modifier.TRANSIENT)) == 0))
    {
      if (TRACE_UID) System.out.println(sig.name + " " + sig.signature + " " + mods);
        dout.writeUTF(sig.name);
        dout.writeInt(mods);
        dout.writeUTF(sig.signature);
    }
      }
     
      if (hasStaticInitializer(cl)) {
        if (TRACE_UID) System.out.println("STATICINIT");
    dout.writeUTF("<clinit>");
    dout.writeInt(Modifier.STATIC);
    dout.writeUTF("()V");
      }

      Constructor[] cons = cl.getDeclaredConstructors();
      MemberSignature[] consSigs = new MemberSignature[cons.length];
      for (int i = 0; i < cons.length; i++) {
    consSigs[i] = new MemberSignature(cons[i]);
      }
      Arrays.sort(consSigs, new Comparator() {
    public int compare(Object o1, Object o2) {
        String sig1 = ((MemberSignature) o1).signature;
        String sig2 = ((MemberSignature) o2).signature;
        return sig1.compareTo(sig2);
    }
      });
      for (int i = 0; i < consSigs.length; i++) {
    MemberSignature sig = consSigs[i];
    int mods = sig.member.getModifiers() &
        (Modifier.PUBLIC | Modifier.PRIVATE | Modifier.PROTECTED |
         Modifier.STATIC | Modifier.FINAL |
         Modifier.SYNCHRONIZED | Modifier.NATIVE |
         Modifier.ABSTRACT | Modifier.STRICT);
    if ((mods & Modifier.PRIVATE) == 0) {
      if (TRACE_UID) System.out.println("<init>" + sig.signature + " " + mods);
      dout.writeUTF("<init>");
        dout.writeInt(mods);
        dout.writeUTF(sig.signature.replace('/', '.'));
    }
      }
     
      MemberSignature[] methSigs = new MemberSignature[methods.length];
      for (int i = 0; i < methods.length; i++) {
    methSigs[i] = new MemberSignature(methods[i]);
      }
      Arrays.sort(methSigs, new Comparator() {
    public int compare(Object o1, Object o2) {
        MemberSignature ms1 = (MemberSignature) o1;
        MemberSignature ms2 = (MemberSignature) o2;
        int comp = ms1.name.compareTo(ms2.name);
        if (comp == 0) {
View Full Code Here

      {
         list.add(new Integer(unsorted[i]));
      }

      Collections.sort(list,
            new Comparator()
            {
             public boolean equals(Object obj)
             {
                return false;
             }
View Full Code Here

  }

 
  private void sortSystemParamsFirst()
  {
    Collections.sort(parametersList, new Comparator()
        {
          public int compare(Object o1, Object o2)
          {
            JRParameter p1 = (JRParameter) o1;
            JRParameter p2 = (JRParameter) o2;
View Full Code Here

    for (int i = 0; i < cols.length; i++) {
      final int col = i;
      Listheader listheader = new Listheader(cols[col]);
      listheader.setHflex("" + model.getProportions()[col]);
      if (model.isSortable()) {
        listheader.setSortAscending(new Comparator() {
          public int compare(Object o1, Object o2) {
            return compareValues(model.getCheckedValue(o1, col),
                model.getCheckedValue(o2, col));
          }
        });
        listheader.setSortDescending(new Comparator() {
          public int compare(Object o1, Object o2) {
            return -compareValues(model.getCheckedValue(o1, col),
                model.getCheckedValue(o2, col));
          }
        });
View Full Code Here

TOP

Related Classes of java.util.Comparator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.