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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:27:43+00:00 2026-05-25T12:27:43+00:00

Hi I think this is very simple problem but I am not able to

  • 0

Hi I think this is very simple problem but I am not able to get through it right now;
There are two kinds of Objects-RuleObject,TaskObject
Following are definitions of RuleObject,TaskObject

RuleObject
  ruleID,RulePatternType,RulePrint

TaskObject
  taskID,taskName,Org,ruleID

ruleArrayList is all objects of RuleObjects

taskArrayList is all objects of TaskObjects

The final formation will be to fetch all RuleObjects used by TaskObjects and arrange by RuleObjects
like example shown below:


RuleObject.RulePatternType1

 TaskName1  TaskOrg1    RUleObject.rulePrint1
 TaskName2  TaskOrg2    RuleObject.rulePrint1

RuleObject.RulePatternType2

 TaskName3  TaskOrg1    RUleObject.rulePrint2
 TaskName4  TaskOrg2    RuleObject.rulePrint2
 TaskName5  TaskOrg3    RUleObject.rulePrint2
 TaskName6  TaskOrg4    RuleObject.rulePrint2

Code snippet:

List<TaskObject> taskArrayList = compModIF.getRecurringTasksForOrgsAndEffDate(allOrgIds, effDate);        
        List<RuleObject> ruleArrayList = compModIF.getComplianceTaskRecurrenceRules();
        Map ruleTypes = new HashMap();
        Map groupTaskTypes = new HashMap();
        Map groupRecurRulesNames = new HashMap();
        Map masterMapOfallMaps = new HashMap();
        Map recurPrintMap = new HashMap();
        Map recurPatternTypeMap = new HashMap();
        List groupRecuringTaskTypesList = null;
        Map filterRules = new HashMap();
        List completedList = new ArrayList();
        for(Iterator iter = ruleArrayList .iterator(); iter.hasNext();)
        {
            RuleObject ruleBase = (RuleObject)iter.next();              
            ruleTypes.put(ruleBase.getRecurRuleID(),ruleBase);

        }

        if (recurringTaskList != null)
        {
            for (Iterator it = taskArrayList .iterator(); it.hasNext();)
            {               
                TaskObject aTaskDef = (TaskObject)it.next();
                groupRecuringTaskTypesList = new ArrayList();
                if(ruleTypes.containsKey(aTaskDef.getTaskRecurRuleIDAsLong()))
                {
                    RuleObject ruleBase = (RuleObject)ruleTypes.get(aTaskDef.getTaskRecurRuleIDAsLong());                   
                    groupRecuringTaskTypesList.add(aTaskDef);                   
                    groupTaskTypes.put(ruleBase.getRecurRuleID(),groupRecuringTaskTypesList);
                    groupRecurRulesNames.put(ruleBase.getRecurRuleID(), ruleBase.getRecurRuleName());
                    if(ruleBase.getRecurPatternType()==ComplianceCodes.TASK_RECUR_PATTERN_TYPE_DAILY)
                    {
                        completedList= getDailyRecursCommentsAsCompleted(ruleBase.printRule());
                        recurPrintMap.put(ruleBase.getRecurRuleID(), completedList);
                    }
                    //groupRecuringTaskTypes = new ArrayList();
                    recurPatternTypeMap.put(ruleBase.getRecurRuleID(), ruleBase.getRecurPatternType());

                }
            }
       }

The problem here is for 1 ruleID there are multiple arraylists because of which I am able to get the last added list.
Can any one suggest better alternative for 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-05-25T12:27:43+00:00Added an answer on May 25, 2026 at 12:27 pm

    I didn’t really follow your example too closely, but it sounds like what you need is a multimap – a mapping from a single key to multiple values.

    Guava provides an interface for this and various implementations, usually accessed via Multimaps.

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

Sidebar

Related Questions

I think this must be simple but I can't get it right... I have
I'm hoping this question has a very simple answer. I can think of ways
This is something that I think would be very useful. Basically, I'd like there
This might be a very simple thing. Check out the normal sql query below
All the ways I can think to do this seem very hackish. What is
This might be something very straight forward and I really think it should work
This SQL statement example is very close to what I think I need... update
Today I got this question for which I think I answered very bad. I
I think this is specific to IE 6.0 but... In JavaScript I add a
This question goes beoynd just programming, but I'd like to get some input on

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.