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 8492335
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T22:41:20+00:00 2026-06-10T22:41:20+00:00

I have a TreeMap map = new TreeMap(); to store values from documents in

  • 0

I have a

TreeMap map = new TreeMap();

to store values from documents in a view based on a selection criteria. map stores the creation date as the key and the document values as an object.

Within the object, I have a “form” field. documents can have different forms ( memo, notice, fax etc )

I have a method to return allEntries. That is ok and works as expected.

I now want to make a selection on the form field to return only a subset of the documents in the map.

Can someone point me into the right direction how to do this ?

  • 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-10T22:41:21+00:00Added an answer on June 10, 2026 at 10:41 pm

    Since the you want to select on something which is not the key of the map, you have to iterate over all the items.

    If you can use external libraries, you could use Collections2.filter() from google’s guava libraries. I.E.

    TreeMap<Date, Document> map = ...;
    final String formValue = "notice";
    Collection<Document> result = Collections2.filter(map.values(), new Predicate<Document>() {
        public boolean apply(Document input) {
            return formValue .equals(input.getForm());
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a map declared as follows - Map<Date, Long[]> myMap = new TreeMap<Date,
I have a TreeMap resMap new TreeMap<String, Map<String, String>>(); I would like to filter
If I have following map: NavigableMap<Integer,String> nmap = new TreeMap<Integer,String>(); nmap.put(3, Three); nmap.put(1, One);
I have a TreeMap that holds the following keys/values: private ArrayList<TreeMap<String,String>> mList = new
I have the following Map: Map<String, List<String>> map = new HashMap<String, List<String>>(); which is
I have the following TreeMap: TreeMap<String, Integer> distances = new TreeMap<String, Integer>(); and it
Ok I have this code: TreeMap<DateTime, Integer> tree2 = getDatesTreeMap(); DateTime startx = new
I have a Date/String TreeMap and I want to loop through the N last
I have created a Map as follows: private Map<String, List<Client>> clientCatalogue; this.clientCatalogue = new
I just have a map implementation below to sort the values in descending order

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.