Examples of PropertyComparator


Examples of org.springframework.beans.support.PropertyComparator

        selectableItems = Arrays.asList(new Object[] {new Item("A"), new Item("B"), new Item("C"), new Item("D"),
                new Item("E")});

        context.put(ListBinder.SELECTABLE_ITEMS_KEY, selectableItems);
        context.put(ListBinder.RENDERER_KEY, new BeanPropertyValueListRenderer("name"));
        context.put(ListBinder.COMPARATOR_KEY, new PropertyComparator("name", true, false));

        return "listProperty";
    }
View Full Code Here

Examples of org.springframework.beans.support.PropertyComparator

    dog.setNickName("mace");

    Dog dog2 = new Dog();
    dog2.setNickName("biscy");

    PropertyComparator c = new PropertyComparator("nickName", false, true);
    assertTrue(c.compare(dog, dog2) > 0);
    assertTrue(c.compare(dog, dog) == 0);
    assertTrue(c.compare(dog2, dog) < 0);
  }
View Full Code Here

Examples of org.springframework.beans.support.PropertyComparator

  }

  public void testPropertyComparatorNulls() {
    Dog dog = new Dog();
    Dog dog2 = new Dog();
    PropertyComparator c = new PropertyComparator("nickName", false, true);
    assertTrue(c.compare(dog, dog2) == 0);
  }
View Full Code Here

Examples of org.springframework.beans.support.PropertyComparator

    fail("illegal state should've been thrown on empty list");
  }

  public void testCompoundComparator() {
    CompoundComparator c = new CompoundComparator();
    c.addComparator(new PropertyComparator("lastName", false, true));

    Dog dog1 = new Dog();
    dog1.setFirstName("macy");
    dog1.setLastName("grayspots");

    Dog dog2 = new Dog();
    dog2.setFirstName("biscuit");
    dog2.setLastName("grayspots");

    assertTrue(c.compare(dog1, dog2) == 0);

    c.addComparator(new PropertyComparator("firstName", false, true));
    assertTrue(c.compare(dog1, dog2) > 0);

    dog2.setLastName("konikk dog");
    assertTrue(c.compare(dog2, dog1) > 0);
  }
View Full Code Here

Examples of org.springframework.beans.support.PropertyComparator

    assertTrue(c.compare(dog2, dog1) > 0);
  }

  public void testCompoundComparatorInvert() {
    CompoundComparator c = new CompoundComparator();
    c.addComparator(new PropertyComparator("lastName", false, true));
    c.addComparator(new PropertyComparator("firstName", false, true));
    Dog dog1 = new Dog();
    dog1.setFirstName("macy");
    dog1.setLastName("grayspots");

    Dog dog2 = new Dog();
View Full Code Here

Examples of org.springframework.beans.support.PropertyComparator

      EventList<T> rawList = GlazedLists.eventList( data );
      int initialSortColumn = getInitialSortColumn();
      if ( initialSortColumn >= 0 ) {
        PropertyPath sortProperty = getColumnDefinition( initialSortColumn ).getPropertyPath();
        //noinspection unchecked
        baseEventList = new SortedList<T>( rawList, new PropertyComparator( sortProperty.getProperty(), false, true ) );
      } else {
        baseEventList = new SortedList<T>( rawList );
      }
    }
    //noinspection ReturnOfCollectionOrArrayField
View Full Code Here

Examples of org.springframework.beans.support.PropertyComparator

    }

    public static void sort(List list, String field, Boolean desc) {
        if (list != null && field != null) {
            boolean asc = (desc == null || !desc);
            Collections.sort(list, new PropertyComparator(field, true, asc));
        }
    }
View Full Code Here

Examples of ru.spbu.math.ontologycomparison.zhukova.logic.similarity.comparators.impl.PropertyComparator

            IOntologyProperty first = firstGraph.getUriToProperty().get(uri);
            IOntologyProperty second = secondGraph.getUriToProperty().get(uri);
            bind(first, second, SAME_URI);
        }

        PropertyComparator propertyComparator = new PropertyComparator(mappedConcepts);
        Set<String> commonLabelSet = SetHelper.INSTANCE.setIntersection(firstGraph.getPropertyLabels(),
                secondGraph.getPropertyLabels());
        for (String label : commonLabelSet) {
            for (IOntologyProperty first : firstGraph.getLabelToProperty().get(label)) {
                for (IOntologyProperty second : secondGraph.getLabelToProperty().get(label)) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.