One object needs to map to several objects. Best collection implementation?

Hello,
What is the best kind of Collection to use for the following scenario?
I 2 folders (stored in a folders_collection) and 10 files (stored in a files_collection). I iterate through and access a folder in the folders_collection one at a time. I then inspect the files_collection for files that belong to that folder. After I have all of the files that belong to that folder, I then add the files to an internal folder_attribute_collection of the folder_object. WHAT IS THE BEST COLLECTION TO STORE MY �FILES� OBJECTS IN?
I was hoping to use an instance the MAP collection (Map files_collection = new TreeMap <�String_key�, file_object_value>();),�where the String key is the ID of the folder_object that the file belongs to. But maps don�t allow duplicate keys.
Thanks
RodneyM

lol...I'll try.
Objective:
- I have a folder that has a folder ID called javaFolder_ID.
- I have 5 files in a collection (javaFile_1,javaFile_2,javaFile_3,cobolFile1,cobolFile2).
- Only 3 of the 5 files in the collection go with the folder above. The other two go to another folder.
- I am currently: Looping through the files collection and inspect the ID of each file. If the file has the javaFolderID in it, then I add that file to the FILES collection attribute of the above folder.
Instead of looping through the files collection, it would be great to be able to say:
- for this folder ID: javaFolder_ID
- access the files collection and return ALL files that have the "key" javaFolder_ID.
- Now I have a collection of files that goes with the folder and I add them to the files collection attribute of the folder.
Ex: using a tree map you can access elements of the collection by calling its key value. The problem here is that a map collection can not hold duplicate keys. So I can not provide one folder ID to the map collection, and have it return ALL the elements in the map collection with that ID.
So I'm wondering if there is even a way to do something like this. If not I'll just resort to iterating through the collection. But when you have tons of objects it will take a bit longer.
Thanks for giving this a shot.

Similar Messages

  • Hi i need one object from goods receipt, and one from invoice

    hi gurus
    what are the tables and fields we have in goods receipt and invoice
    plz send one object on goods receipt
    and one object on invoice
    thank oyu
    regards
    kals.

    Check EKBE table.
    If BEWTP='E' means Goods Receipt and 'Q' means Invoice Receipt.
    DMBTR and WRBTR fields gives you the value of that item.
    ALso check this thread.
    Goods Receipt and Invoice Amount
    Check this thread for goods receipt notice sample program.
    grn report(goods receipt notice)

  • Selecting more than one object at a time

    Hi guys and girls
    I am trying to select more than one object on my artboard and Shift+clicking on the next one isn't working...
    I am creating an interactive form in Indesign and realised that I have everything on one layer... I have radio buttons for yes/no questions and I wanted to move them to a new layer for ease of selection and editing...
    I have tried selecting one and then Shift+Click on the next but it just moves which one is selected...?
    I even tried creating a new layer and dragging them up to the new layer...no Dice?
    Has anyone any ideas....Please!
    bookie56
    P.S. Just realised that the radio buttons are part of the text? Could this be the reason why I can't move them. Doesn't solve the question about selection though

    Hi AnshulJain19
    OK! sort of guessed that....thanks for coming by.
    I am still on this form and have created multiline text boxes for two of my text boxes.... have checked the positioning of the boxes - but when I write in the box in Adobe Acrobat the text is quite a long way above the line...this is only happening with the multiline boxes.
    Is there a way to export a font colour for the boxes or does this need to be done in Acrobat Reader...?
    I have a standard dark background for my page and that needs a White font...when I fill the form in it is black...
    bookie56

  • How to find multiple transport requests for one object

    Hi all,
    Is there any function module which will fetches multiple transport requests ( if created ) for one object.I tried almost all the function modules , but i didn't got the solution.
    I need to develop a report ,   which will takes a single Task number as input and gets the Request number from table E070.
    Based on that Request Number i will fetch remaining Task numbers under it.
    Then for all the Tasks Numbers, i am fetching their  objects by using table E071.
    I need to list out  whether any of these objects are in multiple Transport Requests. Once i got all the Transport Request numbers i need to release the Request based on their Transport Request sequence.
    I tried the following FM's , but not able to get the solution.
    SVRS_DISPLAY_VERSION_LIST
    SVRS_GET_VERSION_DIRECTORY_46
    SVRS_GATHER_REQUEST_FRAGS
    Thanks..

    Hello
    I have tried with below code
    DATA list_tab TYPE TABLE OF abaplist.
    SUBMIT RSWBO040 USING SELECTION-SET 'TEST'
                    EXPORTING LIST TO MEMORY
                   AND RETURN.
    CALL FUNCTION 'LIST_FROM_MEMORY'
       TABLES
         listobject = list_tab
       EXCEPTIONS
         not_found  = 1
         OTHERS           = 2.
    IF sy-subrc = 0.
       CALL FUNCTION 'WRITE_LIST'
         TABLES
           listobject = list_tab.
    ENDIF.
    break-point.
    Submitting the program(RSWBO040) of SE03 transaction a will result in 'CNTL_ERROR' dump.
    Please try some other options
    Thanks

  • Methods that return more than one object.

    Hello everyone,
    I don't know if this has ever been proposed or if there's an actual solution to this in any programming language. I just think it would be very interesting and would like to see it someday.
    This is the thing: why isn't it possible for a method to return more than one object. They can receive as many parameters as wanted (I don't know if there's a limit), but they can return only 1 object. So, if you need to return more than one, you have to use an auxiliary class...
    public class Person {
       private String name;
       private String lastName;
       public Person(String name, String lastName) {
          this.name = name;
          this.lastName= lastName;
       public String getName() {
           return name;
       public String getLastName() {
           return lastName;
    }So if you want to get the name of somebody you have to do this, assuming "person" is an instance of the object Person:
    String name = person.getName();And you need a whole new method (getLastName) for getting the person's last name:
    String lastName = person.getLastName();Anyway, what if we were able to have just one method that would return both. My idea is as follows:
    public class Person {
       private String name;
       private String lastName;
       public Person(String name, String lastName) {
          this.name = name;
          this.lastName= lastName;
       public String name, String lastName getName() {
           return this.name as name;
           return this.lastName as lastName;
    }And you would be able to do something like:
    String name = person.getName().name;and for the last name you would use the same method:
    String lastName = person.getName().lastName;It may not seem like a big deal in this example, but as things get more complicated simplicity becomes very useful.
    Imagine for example that you were trying to get information from a database with a very complex query. If you only need to return 1 column you have no problem, since your object can be an array of Strings (or whatever type is necessary). But if you need to retrieve all columns, you have three options:
    - Create 1 method per column --> Not so good idea since you're duplicating code (the query).
    - Create and auxiliary object to store the information --> Maybe you won't ever use that class again. So, too much code.
    - Concatenate the results and then parse them where you get them. --> Too much work.
    What do you think of my idea? Very simple, very straight-forward.
    I think it should be native to the language and Java seems like a great option to implement it in the future.
    Please leave your comments.
    Juan Carlos García Naranjo

    It's pretty simple. In OO, a method should do one thing. If that thing is to produce an object that contains multiple values as part of its state, and that object makes sense as an entity in its own right in the problem domain--as opposed to just being a way to wrap up multiple values that the programmer finds it convenient to return together--then great, define the class as such and return an instance. But if you're returning multiple values that have nothing to do with each other outside of the fact that it's convenient to return them together, then your method is probably doing too much and should be refactored.
    As for the "if it increases productivity, why not add it?" argument, there are lots of things that would "increase productivity" or have some benefit or other, but it's not worth having them in the language because the value they add is so small as to no be worth the increase in complexity, risk, etc. MI of implementation is one great example of something that a lot of people want because it's convenient, but that has real, valid utility only in very rare cases. This feature is another one--at least in the domain that Java is targetting, AFAICT.

  • How to  extracting data in all objects except one object?

    hi experts,
    when we are trying extracting(load) data, it should be updated in all objects except one object,what is the procedure, pl anybody can explain step by step procedure.
    thanks & regards
    vijay

    Hi vijay
    By object do you mean infoObject ?..if it is then you can set no update in update rule and do not map in transfer rule...
    Thanks
    Tripple k

  • How to hide one object within a group

    Is it possible to show/hide one object within group using the Timeline? I don't need to hide it in output, just need to show/hide it in the Timeline for convenience while working on a slide.

    It's funny that they will let you expand/collapse the group in the timeline window, but not edit visibility. At any rate, I suggest you enter a feature request and/or bug report here: http://www.adobe.com/go/wish
    The more people that bother them about it, the more likely they are to fix it.

  • How to recover a state of  one objects threads by other object

    hi everyone
    how to recover a state of one object's threads by other object..
    i am creating a object in that i have 10 thread..... i have started it then i have closed that object ...then i am creating a new object for the same class ...i need to stop those thread which i have started earlier

    saiyath_babuhussain wrote:
    hi everyone
    how to recover a state of one object's threads by other object..Objects don't own threads so that's hard to understand
    >
    i am creating a object in that i have 10 thread..... i have started it then i have closed that object ...then i am creating a new object for the same class ...i need to stop those thread which i have started earlierWe don't so much stop threads as inform them politely that their services are no longer required. When you have a long running thread it's almost always a loop, often with a wait or sleep which causes it to wait until it's activitty is needed.
    So if you want to be able to wind up a thread from another thread then you put a boolean flag in which can break the loop. The other thread then changes that flag and calls interupt() on the thread it's trying to stop. Interupt will kick the thread out of wait or sleep if that's where it is, causing an InterruptedException. On discovering that the flag indicates it should stop, or on catching an InterruptedException the thread should then clean up and finish.
    The master thread can call join on the thread it's stopping if it needs to wait for it to terminate.

  • Does any one implemented solution for httpservlet request/response object in IWSDLInterceptor implemented class?

    I am trying to handle Producer not available situation in which I am using Interceptor IWSDLInterceptor in WLP 10.3.4. I am able to retrieve exception using onWSDLException but from here if I have to forward my pageURL object I need httpservlet request and response. I tried my own filter class to have its own customize request and also tried it out all other Interceptor to see if any one can handle IOException. I did manage to throw my own Customize exception but  that also did not work out as Page does not have any backing file or any supportive Controller class.
    Does any one implemented solution for httpservlet request/response object in IWSDLInterceptor implemented class? or do we have any specific documentation in regards to this? As I am not able to find much martial on IWSDLInterceptor except Java API from Oracle and article defining Two way SSL handshake Producer.
    Any kind of help is appreciated.
    Thanks
    PT

    Thanks Emmanuel for your response but render behavior is not available for IWSDLRequestContext/IWDSLResponseContext object which IWSDLInterceptor uses for implementation.
    Let me put my question in little simpler manner. May be my approach to the problem is not proper.
    Problem : Handle Producer Not available (no application exists on server) on consumer side.
    So far tried approach : Producer is not running then I am able to handle that TransportException at IInitCookieInterceptor/IHandleEventInterceptor onFault behaviour but in the case of Producer not even exists Consumer try to get WSDL fetch operation and failed with FileNotFoundException.
    To handle this exception, I used IWSDLInterceptor which is available under IWSDLInterceptor.OnWSDLException (Oracle Fusion Middleware Java API for Oracle WebLogic Portal)
    I am able to catch the exception but problem arise when application needs to forward at specific page/render portlet for this situation. For that it required request/response object but IWSDLInterceptor does not give any kind of instances to redirect request as there is no direct access to HTTPServlet request/response object.
    I tried my custom request object to use there. I tried out custom filter object of IWSDLrequestContext. nothing works.
    One approach works is to put producer WSDL file at consumer level. But in that, you need to handle different producer files for different environment. Which I don't think its a good approach.
    eAny one Let me know if my approach to the problem/scenario is wrong. Or if I am missing out any other supporting interface which also required to handle this scenario. or I am using wrong interface for this scenario.
    Thanks for your help in advance.
    PT.

  • Re: How to create More two class with one object

    haii,
             i have small information How to create More two class with one object,
    bye
    bye
    babu

    Hello
    I assume you want to create multiple instance of your class.
    Assuming that you class is NOT a singleton then simply repeat the CREATE OBJECT statement as many times as you need.
    TYPES: begin of ty_s_class.
    TYPES: instance   TYPE REF TO zcl_myclass.
    TYPES: end of ty_s_class.
    DATA:
      lt_itab      TYPE STANDARD TABLE OF ty_s_class
                     WITH DEFAULT KEY,
      ls_record  TYPE ty_s_class.
      DO 10 TIMES.
        CLEAR: ls_record-instance.
        CREATE OBJECT ls_record-instance.
        APPEND ls_record TO lt_itab.
      ENDDO.
    Regards
      Uwe

  • If possible, one SoftReference refer to more than one object?

    Hello,
    I want design a cache to keep huge number objects.
    If create a new SoftReference intance for each object,
    will take a lot of space and time.
    So, one SoftReference refer to more than one object, if possible?

    or arrange your objects into buckets somehow and have
    soft references to the bucketsEn, It's a good idea. but I think it doesn't work.
    My problem is:
    There are many caches(cache1, cache2.......), they may cache a lot of same object instance.
    then, I want to keep a object pool, and try to get the equal object from pool before put a object into a cache, if there is an equal object, put the equal object into cache, if there is no equal object, put the target object into pool and cache. the object pool may very huge because there is lot of objects. So it's necessary to release the object in the pool if no cache referes to the object(the caches contain the object may removed). Then SoftReference come into my mind. I try to create a SoftReference for each object in the pool, but soonly, I find there are two problems:
    1, A lot SoftReference instances take much memory.
    2, Need some time to new and reclaim the SoftReference intances.
    I think SoftReference may work fine to cache the object frequently used,
    but the object number can't be too large.
    Now, I don't use object pool. replace starting a thread to scan those cache s and combine the same objects intervally. It can scan about 2000,000 objects one second in my pc. It's ok for my project. But I am looking for some better way still.

  • [Q] Can Vision track more than one object in a same area - objects that might cross?

    Hi,
    Sorry for that long title, but that's my question.
    Can Vision track more than one object in a same area - objects that might cross?
    Because I'm able to do it, extracting XY, but it looks like "IMAQ Count Objects" doesn't track object frame after but frame, but extract the XY coordinates always in the same way, like example starting from top and everytime he sees an object, he extracts the XY, but if the objects cross (then he will extract XY without caring which objects was the previous one but just based on "scan from top to bottom").
    This is why I opened this topic in the non Vision forum part : http://forums.ni.com/t5/LabVIEW/Sort-XY-by-closest/td-p/2440428
    Thank you,
    Sébastien
    Solved!
    Go to Solution.

    Hi,
    In fact, IMAQ count object order the object regarding their top most and left most pixel, but not regarding their gravity center point.
    Axis origin of an image is situated on the left top corner.
    You need to refer to other caracteristics such as shape or color to identify your objects.
    Regards

  • How do i join multiple paths to make one object.....

    .... so as to be able to apply a fill over the whole object?? 
    This might sound more obvious than it actually is in this case so i'll explain.  My partners artwork contains a lot of linework and unfortunately, i can't get the degree of accuracy i need with a continous path.  Therefore, the problem i have is joining lots of paths (some of which have endpoints joining midway through other paths) to make a single object with the strokes preserved, so i can apply a fill to the overall object or to individual sections. 
    I've tried unite, join and all the other commands that i'm aware of but all give undesired effects.  I've tried using a compund path but all that does is make them act as one but still doesn't do what i need with regards to filling the object.
    A simplified example of what i need to achieve is this...... create a square using 4 seperate paths and then a cross through the middle using more seperate paths to create a 4 box square.  I need to be able to make this one object so i can fill each individual square a different colour if need be?? 
    This is something i've found i will need to be able to do on a regular basis so any help is gratefully received
    Thanks for any help in advance

    Thank you friend, this is exactly what i'm after.  Something so simple that has escaped my knowledge up until now...... absolute lifesaver
    Thanks to both of you that answered

  • Retreiving more than one object from an object stream using serialization.

    I have written a number of object into a file using the object Output stream. Each object was added separately with a button event. Now when I retrieve it only one object is being displayed. the others are not displayed The code for retrieval and inserting is given below. Please do help me.
    code for inserting is as follows
    Vehicle veh1 and vehicle class implements serializable
    veh1.vehNum=tf1.getText();
              veh1.vehMake=tf2.getText();
              veh1.vehModel=tf3.getText();
              veh1.driveClass=tf4.getText();
              veh1.vehCapacity=tf5.getText();          
              FileOutputStream out = new FileOutputStream("vehicle.txt",true);
              ObjectOutputStream s = new ObjectOutputStream(out);
              s.writeObject(veh1);
    retrieval
    FileInputStream out = new FileInputStream("vehicle.txt");
              String str1,str2;
              str1=str2=" ";
              Vehicle veh=new Vehicle();
              ObjectInputStream s = new ObjectInputStream(out);
              try
              Vehicle veh1=(Vehicle)s.readObject();
              s.close();
              int i=0;
              str1=veh1.vehNum;
              str2+=str1+"\t";
              str1=veh1.vehMake;
              str2+=str1+"\t";
              str1=veh1.vehModel;
              str2+=str1+"\t";
              str1=veh1.driveClass;
              str2+=str1+"\t";
              str1=veh1.vehCapacity;
              str2+=str1+"\t\n";
              ta1.append(str2);
              catch(Exception e)
              e.printStackTrace();
    Pleas give me the code for moving through the object until it reaches the end of file

    You can read objects from the stream one by one. So, what you need is an endless loop like this:
    // Suppose you have an ObjectInputStream called objIn
    // So here is the loop which reads objects from the stream:
    Object inObj;
    while (1) {
        try {
            inObj=objIn.readObject();
            // Do something with the object we got
            parse_the_object(inObj);
        } catch (EOFException ex) {
            // The EOFException will be thrown when
            // we reached the end of the file, so here we break out
            // of our lovely infinite cycle
            break;
        } catch (Exception ex) {
            ex.printStackTrace();
            // Here you may decide what to do...
            // Probably the processing will end here, too. For now,
            // we moving on, hoping there is still something to read
    objIn.close();
    // ...

  • ATTACHING one object to another - best way?

    Whats the best way to ATTACH one object to another in my 3D composition?
    For example, I have a circular logo which I am spinning and moving in 3D space. I want to attach a lens flare graphic to it at it's right edge.
    I will then animate the brightness of this lens flare for a few seconds.
    How do I make sure BOTH of these graphics are spinning and moving married together x,y,z all the time?
    Thanks,,
    Message was edited by: Bansaw

    Howdy,
    As Certified said, grouping multiple elements and animating the group is ideal, but as you pointed out, you often animate one object and only later decide to include more elements in the animation.
    You can copy and paste the keyframes/behaviors or drag-and-drop the animated channels from one object to the next, but that means having to update a bunch of elements every time you want to make a change. The best solution: the Match Move behavior (sound of trumpets).
    In addition to pixel-based tracking, Match Move can tell one object to simply match the transforms of another. It has two modes: attach and mimic. Attach basically nails the match-moved object to its source. Mimic has the match-moved object perform the same animation as the source. A movie that better shows the distinction can be found here.
    This works for position, scale and rotation transforms. By default, Match Move will set the next object down in the Layers List to be the source. Just drag and drop a new source (if need be) and you're good to go. Keep in mind that the behavior is overriding the targeted transforms channels on the object, so any other animation on those channels will be ignored. This is why doing the group thing is the most flexible.

Maybe you are looking for

  • Not able to refresh data in Xcelsius from BPC

    Hi, I have created a simple xcelsius dashboard with refresh button and data grid. When I click reload in the preview mode am getting the log on screen where I am trying to connect to the address  http://servername in the EPM connection. But I am not

  • How do I move a file into a folder on my creative cloud site?

    While Im on my creative cloud site, trying to organize files... how can i simply move an old file/doc into a folder that I've already created?? Also, on creative cloud I want to view actual print size without downloading it somewhere... can I????

  • How can I make the text bigger in iCal?

    How can I make the text bigger in iCal?  I've looked at Preferences and View. 

  • Oracle 11g R2 how to take exp/imp

    hi.. i am using oracle11.2 version. i am try to take logical backup like "EXP" in linux environment but empty table missed out.. can u say how to take this backup with empty tables... Thanks in advance

  • InstanceManager problem

    Hi, i am trying to add subform using instanceManger.addInstance(true); on a button click event. But subform/instance is not getting added. I have created a POC sample and attaching an screenshot. Please let me knwo the issue why i am not able to add