Win a copy of Spring in Action (5th edition) this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

how to set a intelvall on what to be loaded in a tableview of postal areas  RSS feed

 
Greenhorn
Posts: 13
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi, i have a list of objects that represent postal areas, the postal class have two String properies postalnumber and postalname. i'm making a feature to seach for s spesiffic postal area and you can seach on both name and number. my problem now is i'm trying to add a som more for the postal feature to can specify a intervall of postal numbers that vil be shown. for example: i want to see all postal numbers from postalnumber 1256 to postal number 3678. any idea of i can accomplished this task? have tried to stream the list and add a filter, my problem is that the postalnumber is a string
 
Rancher
Posts: 515
11
Hibernate IntelliJ IDE Java MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could loop your list of object with a for each.
in your loop check wit an if statement if the parsed to an integer value of your zipcode is between or equal to 1256 and 3678

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!