• 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
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Getting field name position form field info

 
Ranch Hand
Posts: 240
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there any easy way of getting the postion of a field from an array of FieldInfo[] just by the name without having to iterate over the entire array and check for the name? I dont want to create a new datastructure like a list if there is a way out?
 
Kalichar Rangantittu
Ranch Hand
Posts: 240
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What I mean to say, if I want to find the position of the Destination airport from the fieldInfo, how do I do it without iterating through?
 
Ranch Hand
Posts: 273
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello:
Is there any easy way of getting the postion of a field from an array of FieldInfo[] just by the name without having to iterate over the entire array and check for the name?
I am not sure how you do it? If you got ARRAY you got to walk through all the indexes to figure out where it is what you want. Oh yes! it is possible if you know the exact index what you are looking for like, FieldInfo[FieldInfo.length -1].
Hope it helps. -Bal
 
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's an idea I thought of right before i finished my project. I wrote a class that encapsulated a record.
It took a DataInfo object, and had get/set methods for all the fields along with a getNewRecord() method which returned an updated DataInfo object.
[ January 27, 2002: Message edited by: Andre Mermegas ]
 
Kalichar Rangantittu
Ranch Hand
Posts: 240
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Andre, that is the usual way to do, what you are suggesting is a flight buisness object. It the way I would go but I am not sure if the project really needs it. I was hoping that there is some way from the Collections frame work to search for a particular value nested within an array.
Thanks
 
Andre Tow
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh I see.
 
Do not meddle in the affairs of dragons - for you are crunchy and good with ketchup. Crunchy tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic