Keeping TreeSet order up to date

As the properties change in the object kept in the TreeSet, the order becomes incorrect (order is set by custom Comparator). I was just wondering what the most efficient way to keep the TreeSet in order. The only way i have come up with is remove and add the objects as their properties change. Please let me know if there is a better way of doing this as my way is a bit tedious. Thank you in advance.

As the properties change in the object kept in the
TreeSet, the order becomes incorrect (order is set by
custom Comparator). I was just wondering what the
most efficient way to keep the TreeSet in order. The
only way i have come up with is remove and add the
objects as their properties change. Please let me
know if there is a better way of doing this as my way
is a bit tedious. Thank you in advance.As said above you must remove and re-add. However, if you want to handle this problem in an OO way, you can make the Objects in the map accept listeners (see the Observable pattern in GoF but don't use Observable class as it should be declared as an interface.) Then make a Map class that wraps other Maps (this makes it more reusable than extending TreeMap) and have your wrapper remove and readd on when it sees that an item has changed. This will make the solution invisible to classes using the Map. Be sure to address synchronization carefully if it is needed.

Similar Messages

  • I have Photoshop Elements 7.0 and when I go to sort the photos in order (from oldest date) I keep getting the message "Photoshop Elements 7.0 has stopped working" and then the program closes.  Sometimes, eventually it has sorted as I request but today thi

    I have Photoshop Elements 7.0 and when I go to sort the photos in order (from oldest date) I keep getting the message "Photoshop Elements 7.0 has stopped working" and then the program closes.  Sometimes, eventually it has sorted as I request but today this has been rejected over 15 times.  What is wrong?

    Try the licensing service update:
    http://helpx.adobe.com/creative-suite/kb/error-licensing-stopped-windows.html
    EDIT I see that maybe you did (is that the patch you mean? ); if so, try the other suggestions there.

  • Process Order Basic Finish Date and Scheduled Finish Date

    Folks,
    I have a requirement from the business to be able to update the Process Order Basic Finish Date and Scheduled Finish Date independently from each other.
    In other words, update the Basic Finish Date and the Scheduled Finish Date cannot change or update the Scheduled Finish Date and the Basic Finish Date cannot change.
    I believe the reason for this is to be able to use the Basic Date to maintain the ATP accurately and keep the Scheduled Date to mark when the order was originally due from the shop floor to be able to measure if orders are being completed on time or late.
    I have worked in tnx OPUZ and had some success with other issues with these dates but I can't seem to make them work independently from each other.
    Or does anyone have any ideas how to measure proces order performance to the production schedule?
    Thank you for your help,
    Greg

    Rajesha, thank you for your reply but it doesn't solve my problem.
    Let me restate my scenario:
    I start a process order and both the basic and scheduled finish dates are the same, June 1.
    At some point, shop floor tells me they will be late and cannot deliver until June 15.
    I need to update a date in the system so the ATP and the MRP planning runs have correct information for promising customers, I will update the Basic Finish date with June 15.
    I also need to keep the original June 1 date in order to measure the shop floor performance to the production schedule to measure how early or late the  order was delivered. How can I keep the original finish date or how can I measure if a process order is early or late??
    Thank you for your help,
    Greg

  • Process Order Schedule Finish date before Schedule Start date

    On rare occasions, the process order Schedule Finish date is before the Schedule Start date.  This causes an error on the APO system when the process order is CIF to APO.  Does anyone have any ideas how this occur?
    Thanks.
    Best regards,
    Sandy

    Rajesha, thank you for your reply but it doesn't solve my problem.
    Let me restate my scenario:
    I start a process order and both the basic and scheduled finish dates are the same, June 1.
    At some point, shop floor tells me they will be late and cannot deliver until June 15.
    I need to update a date in the system so the ATP and the MRP planning runs have correct information for promising customers, I will update the Basic Finish date with June 15.
    I also need to keep the original June 1 date in order to measure the shop floor performance to the production schedule to measure how early or late the  order was delivered. How can I keep the original finish date or how can I measure if a process order is early or late??
    Thank you for your help,
    Greg

  • How keep original order of photos in iPhoto album when transferring to Photo Stream?

    I want my carefully organized photos in a iPhoto Album to remain in SAME order when sending the album to my iPad from my MacBook Pro via Photo Stream. How can I do this?   Also, does anyone know how to keep the captions below photos when using Photo Stream?

    I want my carefully organized photos in a iPhoto Album to remain in SAME order when sending the album to my iPad from my MacBook Pro via Photo Stream. How can I do this? 
    Are you asking about "My Photo Stream" or a "Shared Photo Stream"?
    "My Photo Stream" is only a temporary buffer, not meant for long term storage. You have no control over the order of the photos in the stream. Mostly they will be ordered by the date.
    "Shared Photo Streams" will be ordered in the same order as add the photos. SO you can control the sequence by adding the photos one by one.
    The captions will not be transferred, only the file names.
    Regards
    Léonie

  • How do you keep the order using SELECT WHERE IN()?

    Hi,
    Is there a way to keep the order when using SELECT WHERE IN()? For example, using the following query:
    SELECT id FROM data_table WHERE id IN('56','55','54','1','7');
    The results will come back using the default order by id. 1,7,54,55,56
    When I want to keep the order used in the IN: 56,55,54,1,7
    Is there a quick way to do this in mySQL or will I be forced to order it after in code.
    Thanks

    797836 wrote:
    Hi,
    Is there a way to keep the order when using SELECT WHERE IN()? For example, using the following query:
    SELECT id FROM data_table WHERE id IN('56','55','54','1','7');
    The results will come back using the default order by id. 1,7,54,55,56In case the order by docs and comments weren't clear on this point, there is no default order and they may come back in a different order. Usually after you've tested it to exhaustion to prove otherwise, then put it in production.
    >
    When I want to keep the order used in the IN: 56,55,54,1,7
    Is there a quick way to do this in mySQL or will I be forced to order it after in code.
    ThanksUsing the in list allows oracle to have other possible data access paths than simply running the query 5 times. If for whatever reason you don't want to order the results after they come back, it may be worth your while to just run the five queries serially in the order you want, using bind variables and so having identical queries. That may seem silly on its face, but then again, we don't know the real requirements, what else is going on, if this is simplified from the real code or whether there will always be 5.

  • How to keep photo order when opening default photo app?

    First it concerns the default photo App: I have created an Album based on recent photos imported from the cloud, there are 125 photos in them, for some reason they are in the wrong order, i.e. by date. I know how to rearrange one photo at a time, but it's painfully slow to go through all 100s of them.
    Second, there is the iPhoto App: I downloaded iPhoto app from the iWork suite, that came free for me, it gave me an option to sort photos by date, hooray!
    BUT!! when I close iPhoto and reopen the default photo app, the photos were no longer sorted, it was the same order before the sort!
    My question is, how on earth do I sort an album in iPhoto and to keep that order when I open the album through the default photo app or indeed any other app that uses the iOS albums such as facebook etc?

    As far as i know, you can't, when using iphoto, the sort is only for iphoto, apps on ios do not have access to one anothers data, ever, you can transfer a file from one app to another app that supports the file format but then you have two independent copies of that file.

  • What is the process to upgrade at full retail, switch SIM cards, and keep old plan with unlimited data feature

    I'm on a really old plan...America's Choice Family Share 500, Free N&W, with 2 lines, and each line has the unlimited data feature on the line.
    Neither line has a texting package.
    I currently have a Droid Bionic (large SIM card) & want to get a Droid Turbo (small SIM card).  It is literally cheaper for me to pay full retail for a phone (actually 2 phones) than switch to a "More Everything" plan because my plan is so old.  Across the two lines, we probably only use 3-5 GB/mo, so we aren't 'heavy' data users, but we aren't using 1-2GB/mo either.
    I went into a VZW Corporate store, and they said I should be able to keep my plan with unlimited data if I pay full retail, but the sales person said their system has been knocking off unlimited data for other customers, even for something as small as a SIM card change.
    I tried upgrading on verizonwireless.com, and the system tried to kick me out of my America's Choice Family Share 500 plan.
    What is the process to get a new phone, pay ~$600 for it, get the new SIM card assigned to the account, and keep my calling plan with unlimited data?
    (I also have the option to turn on & off Mobile Hot-Spot for $30/mo at will...but probably only have it active for 1 week a year, if that)
    Thanks!

    Just log into your my verizon and order a phone at the full retail price. When you add the phone to the cart you choose 2 yr price, edge or full and then hit add. You will have to choose a plan but that plan does not go into effect since you are buying a phone out of contract, it is just part of the process. You then will not lose the data

  • What do I have to modify on below query to keep same order?

    here is my original post
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/1edac5ae-8c61-4dcf-9a15-b01df5cad617/how-to-remove-next-and-previous-record-if-amount-0?forum=transactsql#982b368a-bc6a-461a-9be2-37b3a7331dd8
    if I add an ID column to assign row order, what do I need to modify in the below query to keep that order
    CREATE TABLE #Temp(
    [id] [int] identity(1,1),
    [SHCOMP] [char](2) NOT NULL,
    [SHCRTD] [numeric](8, 0) NOT NULL,
    [SHCUST] [numeric](7, 0) NOT NULL,
    [SHDESC] [char](35) NOT NULL,
    [SHTYPE] [char](1) NOT NULL,
    [SHAMT] [numeric](9, 2) NOT NULL,
    [SHCRTT] [numeric](6, 0) NOT NULL,
    [CBLNAM] [char](30) NOT NULL,
    Query
    ; With cte As
    (Select *, 
         Row_Number() Over(Partition By SHCOMP, CBLNAM, SHDESC, SHAMT Order By ID) As rn, Abs(SHAMT) As AbsAmt
    From #Temp) 
    Select c1.* into #t1
    From cte c1
    Left Join cte c2 On c1.SHCOMP= c2.SHCOMP
      And c1.CBLNAM = c2.CBLNAM 
      And c1.SHDESC = c2.SHDESC
      And c1.SHAMT = -1 * c2.SHAMT
      And c1.rn = c2.rn
    Where c2.SHCOMP Is Null
    order by ID
    Original data
    SHCOMP     CBLNAM       SHDESC    SHAMT     SHTYPE    ID
    123         cust1       desc1      45          F       1
    123         cust1       desc1     -45          T       2
    123         cust1       desc1      45         F        3
    123         cust1       desc1     -45        T         4
    123         cust1       desc1      45         F        5
    123         cust1       desc1      -35         T       6
    234         cust3       desc2     -60          F       7
    234         cust3       desc2      60          T       8
    234         cust3       desc2      30          F       9
    234         cust3       desc2     -30         T        10
    234         cust3       desc2      30         F        11
    Results I want
    SHCOMP      CBLNAM      SHDESC    SHAMT      SHTYPE     ID
    123         cust1       desc1      45         F         5   
    123         cust1       desc1      -35         T        6
    234         cust3       desc2      30         F         11
    That query is changing my ID, instead of keep 5,6,11 it is assigning other numbers. For example
    SHCOMP      CBLNAM      SHDESC    SHAMT      SHTYPE     ID
    123         cust1       desc1      -35         T        4
    123         cust1       desc1      45         F         7 
    234         cust3       desc2      30         F         9

    Declare @Sample Table(ID int identity, SHCOMP int, CBLNAM varchar(30), SHDESC varchar(10), SHAMT int, SHTYPE char(1));
    Insert @Sample(SHCOMP, CBLNAM, SHDESC, SHAMT, SHTYPE) Values
    (123 ,'cust1', 'desc1', 45, 'F'),
    (123 ,'cust1', 'desc1', -45, 'T'),
    (123 ,'cust1', 'desc1', 45, 'F'),
    (123 ,'cust1', 'desc1', -45, 'T'),
    (123 ,'cust1', 'desc1', 45, 'F'),
    (123 ,'cust1', 'desc1', -35, 'T'),
    (234 ,'cust3', 'desc2', -60, 'F'),
    (234 ,'cust3', 'desc2', 60, 'T'),
    (234 ,'cust3', 'desc2', 30, 'F'),
    (234 ,'cust3', 'desc2', -30, 'T'),
    (234 ,'cust3', 'desc2', -30, 'F');
    ; With cte As
    (Select SHCOMP, CBLNAM, SHDESC, SHAMT, SHTYPE, ID,
    Row_Number() Over(Partition By SHCOMP, CBLNAM, SHDESC, SHAMT Order By SHAMT, ID) As rn
    From @Sample)
    Select c1.SHCOMP, c1.CBLNAM, c1.SHDESC, c1.SHAMT, c1.SHTYPE, c1.ID
    From cte c1
    Left Join cte c2 On c1.SHCOMP = c2.SHCOMP
    And c1.CBLNAM = c2.CBLNAM
    And c1.SHDESC = c2.SHDESC
    And c1.SHAMT = -1 * c2.SHAMT
    And c1.rn = c2.rn
    Where c2.SHCOMP Is Null
    Order By c1.ID;
    Tom

  • Find Sales Order Item Basic Data by Elements query fails

    I am trying to consume Find Sales Order Item Basic Data by Elements in .NET 3.0.
    Every thing appears to be working fine -- I could query by PO number, Creation time, SalesOrganisationID etc.
    However, the most basic query is mysteriously failing. I just want to query by Sales order number, and have given a valid sales order number 6718 that exists in SAP.
    It fails giving the following errors:
    (in Log.LogItem.Note variable):
    <b>"Conversion failed: Invalid input format"</b>
    (in Log.LogItem.TypeID variable):
    <b>"701(SFB)"</b>
    Code is pretty simple, and I am just trying to query Saler Order number 6718. Of course there is nothing wrong with its format.
    From the ESOA site, all I could get was:
    <i>----
    QUOTE -
    The following values are optional selection criteria for restricting the search result:
    SelectionByID – Document number range
    INCLUSION_EXCLUSION_CODE
    INTERVAL_BOUNDARY_TYPE_CODE
    LOWER_BOUNDARY_ID
    Value
    UPPER_BOUNDARY_ID Value
    Value
    UNQUOTE -
    </i>
    I could not even have any  documentation on what to put in InclusionExclusionCode, and IntervalBoundaryTypeCode. They apper to be some Global Data Types for which I couldn't find any documentation. By sifting through Wiki, I just guessed a couple of values praying that it may work. I am a bit new to ESOA, but have expertise in .NET 3.0. Would someone guide me where to find the documentation for that, where are the error codes listed, so that I make the queries with little better preparation.
                querydata.SelectionByID = new SalesOrderERPItemBasicDataByElementsQueryMessage_syncSalesOrderERPItemBasicDataSelectionByElementsSelectionByID[1];//Single element array is good enough
                querydata.SelectionByID[0] = new SalesOrderERPItemBasicDataByElementsQueryMessage_syncSalesOrderERPItemBasicDataSelectionByElementsSelectionByID();
                querydata.SelectionByID[0].InclusionExclusionCode = "E";
                querydata.SelectionByID[0].IntervalBoundaryTypeCode = "6";
                querydata.SelectionByID[0].LowerBoundaryID = new SalesOrderID();
                querydata.SelectionByID[0].LowerBoundaryID.Value = "6718";
                querydata.SelectionByID[0].UpperBoundaryID = new SalesOrderID();
                querydata.SelectionByID[0].UpperBoundaryID.Value = "6718";

    How do you test with a SOAP Client  - I am trying to use same dataset as provided?
    I did with WSDL Test - SAP, SOAP Client and got the following error:
    <soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
       <soap-env:Body>
          <nr1:SalesOrderERPBasicDataByElementsResponse_sync xmlns:nr1="http://sap.com/xi/APPL/Global2">
             <Log>
                <MaximumLogItemSeverityCode>1</MaximumLogItemSeverityCode>
                <Item>
                   <TypeID>701(SFB)</TypeID>
                   <SeverityCode>1</SeverityCode>
                   <Note>Conversion failed: Invalid input format</Note>
                </Item>
                <Item>
                   <TypeID>701(SFB)</TypeID>
                   <SeverityCode>1</SeverityCode>
                   <Note>Conversion failed: Invalid input format</Note>
                </Item>
                <Item>
                   <TypeID>701(SFB)</TypeID>
                   <SeverityCode>1</SeverityCode>
                   <Note>Conversion failed: Invalid input format</Note>
                </Item>
                <Item>
                   <TypeID>701(SFB)</TypeID>
                   <SeverityCode>1</SeverityCode>
                   <Note>Conversion failed: Invalid input format</Note>
                </Item>
                <Item>
                   <TypeID>701(SFB)</TypeID>
                   <SeverityCode>1</SeverityCode>
                   <Note>Conversion failed: Invalid input format</Note>
                </Item>
             </Log>
          </nr1:SalesOrderERPBasicDataByElementsResponse_sync>
       </soap-env:Body>
    </soap-env:Envelope>
    Thanks..
    Vikas

  • Load a sales order with delivery date in the past

    Hi,
    We want to load in the system a sales order with delivery date in the past, and maintain the schedule delivery date in the past. To do that, in the customizing Sales And Distribution / Basic Functions / Delivery Scheduling and Transportation Scheduling / Define Scheduling By Sales Document Type, I selected the flag Blackwards. But the problem is that the rest of the dates in the scredule line: goods issue date, loading date, material avail.date and transportation Plan Date, are in blank and you cannot enter any data because the system deletes it.
    How can I have these dates informed with dates in the past?
    Thanks in advance,

    You can control this using the "Message Control" in the SAP IMG.
    Supplier Relationship Management>SRM Server>Cross-Application Basic Settings>Message Control>Influence Message Control
    Using this you convert Error to Warning or even swith off this message.
    Please refer this thread for complete steps:
    Re: How to change an error message to a warning message in SRM
    Note: you need to suppress the messages relevant to your case here.
    Regards
    Kathirvel

  • Sales order schedule confirmed date will consider Production capacity load

    As we know about schedule confirm delivery dates of sales order will consider based on material master lead time ,shiping point etc
    How to consider production capacity plan on sales order's delivery date.
    Say for example :
    Production workcenter capacity to produce the XYZ material 10qty in a Day.
    today i have created the sales order XYZ materail qty of 100. lead days has give based of MMR 21 days 17-07-2010( 3 sundays)
    and in same day i have created other sales order XYZ material qty 5000 ,the lead days again it will came 17-07-2010.
    Now my client requiremnt is when the schedule days is confirming in the sale order it sholud also consider the production capacity planning also(CR01,CR02)
    Even though my work centers are overloaded it is confirming the sales order on 17-07-2010 (based on leads days in MMR)
    Need your Inputs on issue

    Hi,
    This is a complex issue; best solution is by using APO/GATP.
    If not, then in ERP only, the second best is:
    1) Work with assembly processing in SO, meaning that a production/planned order is automatically created in the customer order during order creation.
    2) Then, after the order is created it is scheduled, and the delivery date proposal is based on that.
    3) Now you can check in the order that there are no capacity overloads, and all capacity required to produce on the proposed date is available. If yes, you're done. If not, it gets a bit complex, since you actualy need to switch to capacity planning, do capacity leveling and dispatch (PP), and the you get a new feasible schedule proposal based on that.
    APO/GATP could do all that automatically!
    Regards,
    Mario

  • Complete MRP status according to Sales order schedule line data

    Dear All,
    Please help me to get technical configuration releted to
    "complete MRP status according to Sales order schedule line data"
    or MRP w.r.t. Schedule line
    Please send fields and table and logic specification .
    Thanks & Regards,
    Ashish Gautam

    You can use following Fm for change sales order
    CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
      EXPORTING
        salesdocument     = p_vbeln
        order_header_in   = s_order_header_in
        order_header_inx  = s_order_header_inx
        behave_when_error = 'P'
      TABLES
        return            = it_return
        order_item_in     = i_order_item_in
        order_item_inx    = i_order_item_inx
        schedule_lines    = i_sched
        schedule_linesx   = i_schedx.

  • I have multiple devices backed up to the same computer each with different data. how do i keep them from syncing all data when i back up or transfer stuff from the computer to a device?

    i have multiple devices backed up to the same computer each with different data. how do i keep them from syncing all data when i back up or transfer stuff from the computer to a device? one is an iphone 6 and the others are ipad mini first gens, each ipad has 64gb and the iphone has 128, need to keep the data seperate as they are not all mine

    Itunes content and pics are NOT part of the backup that itunes performs.
    Backing up, updating, and restoring iPad, iPod touch, and iPhone software
    You should transfer any purchases from iphone regularly:  File>Transfer Purchases  , if they fail to be transferred when you sync.
    You buy one and only one download.  It is your responsibility to move/copy/backup your purchases.
    You can try contacting itunes support and asking for an exception, but they are under no obligation to allow.
    http://www.apple.com/support/itunes

  • How can I find out the date of a movie I am trying to pre-order if the date is not available/showing in the "manage pre-order" section?

    How can I find out the date of a movie I am trying to pre-order if the date is not available/showing in the "manage pre-order" section?

    Thanks so much for your reply King_Penguin. No, sadly there is not indication of the expected release date on the film, it's no where to be found. I have also tried to look in other places online, but no luck. I guess your latter statement jives more with my situation, that  being the studio/rights-holder hasn't feel inclined to provide the date.

Maybe you are looking for