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

  • Home
  • SEARCH
  • 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 7850357
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T18:49:17+00:00 2026-06-02T18:49:17+00:00

In my current project, I need following type of data structure Map<String, Map<String,Set<String>>, Set<subscriber>>

  • 0

In my current project, I need following type of data structure

Map<String, Map<String,Set<String>>, Set<subscriber>> 

As per my knowledge, Java does not support this kind of data structure (Kindly correct me if I am wrong). Or (you can suggest me “how can I achieve this data type of data structure in Java).

Is there any third party library, which supports above mentioned data structure and operations on it?

  • 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-02T18:49:18+00:00Added an answer on June 2, 2026 at 6:49 pm

    If you really want maps to act as keys in your data structure, then I think this is what you want:

    static Map<String,Set<String>> makeUnmodifiable(Map<String,Set<String>> m) {
      Map<String,Set<String>> map = new HashMap<String,Set<String>>();
      for (Map.Entry<String,Set<String>> entry : m.entrySet()) {
        map.add(entry.getKey(), Collections.unmodifiableSet(entry.getValue()));
      }
      return Collections.unmodifiableMap(map);
    }
    
    static class Pair {
      final String first;
      final Map<String,Set<String>> second;
      Pair(String first, Map<String,Set<String>> second) {
        this.first = first;
        this.second = second != null ? makeUnmodifiable(second) : null;
      }
      public void equals(Object o) {
        ...
      }
      public int hashCode() {
        ...
      }
    }
    
    Map<Pair,Set<Subscriber>> myMap;
    

    Note that you MUST override equals and hashCode in the custom Pair class in order for this to work properly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In a current project i need to display PDFs in a webpage. Right now
Successfully used jquery-infinite-carousel in the past but for my current project I need it
I need to implement for current project some secure login in php. I wrote
In my current project (presentation, slide software) I need to be able to make
For our current J2EE project based on JBoss, we need to interface with a
In my current project I'm using classes which implement the following ITransaction interface shown
I've just begun a small project in CUDA. I need to know the following:
In our current project, we need some high level DBI for different databases. It
I run into following code in my project: html: <input type=button id=addmore value=Add more
For a current project I am working I need to return an aggregate report

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.