Package org.gtugs.domain

Examples of org.gtugs.domain.Country


  public boolean supports(Class c) {
    return Country.class.equals(c);
  }

  public void validate(Object obj, Errors errors) {
    Country country = (Country) obj;

    if (country == null) {
      errors.rejectValue("name", null, null, "Name required");
    }
    else {
      if (country.getName() == null || country.getName().equals("")) {
        errors.rejectValue("name", null, null, "Name required");
      }
    }
  }
View Full Code Here


        }
      }

      List<Country> countries = new ArrayList<Country>();
      for (Map.Entry<String, Long> countryEntry : countryCounts.entrySet()) {
        Country country = new Country();
        country.setName(countryEntry.getKey());
        country.setNumEvents(countryEntry.getValue().intValue());
        countries.add(country);
      }

      // Sort the array on numEvents
      for (int i = 1; i < countries.size(); i++) {
        int numEvents = countries.get(i).getNumEvents();
        int j = i - 1;
        boolean done = false;
        do {
          if (countries.get(j).getNumEvents() < numEvents) {
            Country swapped = countries.remove(j + 1);
            countries.add(j, swapped);
            j--;
            if (j < 0) {
              done = true;
            }
View Full Code Here

TOP

Related Classes of org.gtugs.domain.Country

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.