Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8540717
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T11:39:56+00:00 2026-06-11T11:39:56+00:00

I have POJOs parsed from JSON. Account [] accounts; class Account { Integer number;

  • 0

I have POJOs parsed from JSON.

Account [] accounts; 

class Account {
  Integer number;
  String name;
  String location;
  Date started;
}

I get list of accounts from JSON API call. Jackson mapper maps the resulting JSON to above POJOs.
I will need to do searching and other operations on these objects.

I am not sure how to store these to do the searching and to display them (in Android).

ArrayList
Map
HashTable
...

etc. Searching should be fast. I get about 500 accounts on an average. Mapping is done and I have the objects in an array now. But not sure how to go from here.

More over, I am fairly new to Java Collections and Generics. So any code example with direction would help.

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T11:39:58+00:00Added an answer on June 11, 2026 at 11:39 am

    If you’re searching, and you can identify a single key on which to search, I’d recommend the HashMap, because it’s O(1) for access if you have a key.

    HashTable is JDK 1.0 vintage; don’t choose that.

    Here’s an example, assuming that the number is unique and represents a good search choice:

    Account a = new Account(123456);
    Map<Integer, Account> accounts = new HashMap<Integer, Account>();
    accounts.put(a.getNumber(), a);
    

    To access, you use the number:

    Account b = accounts.get(123456);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following POJO: public class SampleBean1 { @Id @GeneratedValue(generator = system-uuid) @GenericGenerator(name
some methods in our model pojos have been annotated like this: @Column(name=cli_clipping_id, updatable=false, columnDefinition
i have a list of simples pojos (a User class) with about 15 simple
Suppose that I have the following HBM mapping: <class name=Student table=student> <set name=classes table=student_classes
I have the following POJO class for a JSON object: public class JSONChangeSet {
Consider a simple POJO Java Object: class MyObj { String a, b; Integer c;
I have the following pojo: public class Foo { @Size(min=0,max=10) private String bar =
A CXF JAX-RS application I have uses jackson to marshal POJOs to JSON. This
Is there a way to have all the POJOs autogenerated that are needed when
In Java I use getters/setters when I have simple models/pojos. I find that the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.