• 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 ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Tim Cooke
  • Junilu Lacar
  • Paul Clapham
  • Devaka Cooray
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Frits Walraven
  • Carey Brown
  • salvin francis
  • Claude Moore

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

Posts: 22
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
Posts: 1170
Firefox Browser 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

And when my army is complete, I will rule the world! But, for now, I'm going to be happy with this tiny ad:
Create Edit Print & Convert PDF Using Free API with Java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!