LIST - update Id numbers

Hi
I have List<group> with groupid. I want to update or sort id the group id
I have written this code., but not working can anyone explain tome
public void updateid()
          for(int i= 1 ;i < g_list.size();i++)
               g_list.get(i).setGroupId(new BigDecimal(i));
     }

Note that the list index starts at zero, not one!
It is also conventions that classes are capitalized (Group, not group).
You can sort using Collections.sort(), in your case you need a custom comparator:
Collections.sort(g_list, new Comparator<Group>() {
  public int compare(Group group1, Group group2) {
   if(group1 != null && group2 == null) {
    // group 1 is bigger
    return 1;
  else if(group1 == null && group2 != null) {
    // group1 is smaller
    return -1;
// needs extra null checks here if group id can be null
// if group id really are decimals and not just ints, need to do rounding here
   return group1.getGroupID().subtract(group2.getGroupID()).intValue();
});

Similar Messages

  • I just updated to Numbers 3.0.1. In the old version if I started to type a name that was already in the spreadsheet, it would automatically fill it in. That doesn't happen in the new version. What am I missing to get that to happen?

    I just updated to Numbers 3.0.1. In the old version if I started to type a name that was already in my spreadsheet (in another cell), it would automatically fill that name in. That is not happening in the new version. Am I missing something to get that to happen? Thanks

    If you frequently enter repeating values in a column and don't want to type the same text over and over again, instead of just waiting for Apple's updates why not try using an enhanced feature in Numbers 3 that in many (probably most) situations is even better than "auto-complete"?
    Numbers 3 has an enhanced Pop-Up Menu functionality that helps prevent typos or capitalization inconsistencies from creeping in and messing up your data. It is also much more efficient than auto-complete in Numbers for iOS, should you ever want to sync to an iPad or iPhone and do data entry there.
    Pop-Up Menu is much enhanced over what it was in Numbers 2.3, and is easy to set up:
    Select the whole column or range before formatting as Pop-Up Menu and your existing values in that column or range will pre-populate a menu automatically:
    Then you can remove the values you don't want in the list, such as the column header (and possibly some previous spelling errors too!):
    And after this easy one-time setup all you have to do thereafter is to choose from the pop-up list when you add rows:
    See this post for more details on how this handy feature has been enhanced in Numbers 3.0.
    Should you ever want to take your Numbers with you and do data entry on an iPad or iPhone, in a touch interface, pop-ups are much more efficient than typing the first few letters of items. You can scroll with ease through a list of dozens of items to make a pick. Anybody using Numbers cross-platform should favor Pop-Up so they can use their documents efficiently for data input on the go, which can be a productivity booster.
    See this thread for this and other workarounds for Numbers 3.0.
    SG

  • NSS Hard Drive Approved Vendor List Updated

    http://www.cisco.com/en/US/products/ps9957/prod_technical_reference_list.html
    The approved vendor list has been updated and posted to the above link.
    This updates adds the Western Digital RE3 1TB drive to the Recommended Drive list.
    Also Hitachi drives that were previously approved but were left off the previous AVL list by mistake have been added back.

    NSS Hard Drive Approved Vendor List updated.
    Now supports Seagate 1.5TB Drives bring the total storage capacity to 6TB for NSS3000, NSS4000, and NSS6000 models.  NSS2000 can now support 3TB using the new 1.5TB drives.
    Updated PDF documentation with the part numbers are available on cisco.com
    http://www.cisco.com/en/US/products/ps9957/prod_technical_reference_list.html

  • Automatically update a Numbers spreadsheet from other application/documents

    Hi,
    Before I start I am a relative novice in using Numbers, and if it applies in this instance, Applescript and Automator. I run a small local weekly free newspaper (created using InDesign if that is relevant) which is paid for by adverts; I want to create a spreadsheet to track my advertisers and the financials in every respect - renewals, sizes and duration of ads, amount paid and owing, and a whole load of other stuff which includes their contact details. Now I know that I can import the relevant info from Address Book as a snapshot at that moment, but what I want to know is whether it is possible to have the spreadsheet automatically update whenever I change a contact or add a new one to my Address Book? As far as I have been able to ascertain so far, it is not, so if that is the case, is there some sort of workaround, possibly using Automator and another app or even the web, where this can be done? Or is it possible the other way round, where I keep the contact details updated in Numbers and this gets transferred to Address Book? Or any other bright ideas? I don't really want to have to type the same information, or even copy/paste it for every new customer, as well as inputting it into my phone (which I don't think is able to sync with my Mac - it is a Samsung).
    Please keep any scripting/technical answers as simple as possible, as I don't have much experience with it. Thanks in anticipation...

    I have been doing a lot more reading on the forum and I now think there might be a partial solution to what I would like to do, possibly even a complete one, but I am not sure if what I have in mind is possible.
    Using Automator/Applescript, could it be done that on a weekly basis Address Book gets opened automatically, the relevant group of contacts (which is already set up) is selected and copied/exported, and then Numbers and the relevant sheet opened automatically and the updated contact list pasted/imported? In addition is it possible to set up a script that can check if a group in AB has been changed, and if it has for this to be the trigger for the earlier script/workflow I have described rather than a date (every week in this case)? Again this could work the other way around, with the Numbers sheet being the one changed by me, and then a script to update AB. Any help would be massively appreciated.
    I have now managed to set up iSync to work with my phone so that can be updated once AB has been, but I am still working on getting the information from the phone to AB to be correct for Numbers! This is because of how my phone contact details is stored which is different seemingly from AB and I am not sure if I can sort that out. There is a First Name and Last Name field but no Company name in my phone, and I need to have all of those for it to work.

  • When playing songs in iTunes playlist, How do you keep the next song from jumping to next song? I am working on song list updating other tracks info and then the next song starts and I lose my spot in song list?

    When playing songs in iTunes playlist, How do you keep the next song from jumping to next song? I am working on song list updating other tracks info and then the next song starts and I lose my spot in song list?

    Max OSX 10.6.8, iTunes 11.1
    I had a similar problem: I wanted to synch my playlist to my iphone. I like to have my playlist sorted by genre. But under each genre, albums are not sorted by the track numbers. This is a problem, especially when I am listening to club mixes when the DJ smoothly transitions from 1 track sequentially to the next one. Under the properties of each audio file, the Track Numbers and Disc Numbers are already there.
    My perfect solution was to turn On Sorting - Sort Album under View>Show View Options. Then, select all the songs in that album (Shift click, Cmd click, etc) , and Edit multiple item information (Cmd I). You will see Info-Video-Sorting-Options buttons. Click on Sorting. Then, under Sort Album, Enter the name of the album. Then OK.
    You should now have the playlist sorted by Genre, then each album individually sorted by track numbers. On your playlist you should see, if you scroll right, the column added called "Sort Album".
    Hope this helps.

  • Problem with updating serial numbers in sales order!

    Hi,
    I am trying to update serial numbers for a sales order in SAP. I tried using both SERNR_ADD_TO_AU and SERNR_ADD_TO_DOCUMENT. However, in both cases the FM returned the number of serial numbers created but these did not reflect in the sales order. The code for both is as below:
    WA_SERXX-SDAUFNR = '0000001733'.
    WA_SERXX-POSNR = '000010'.
    WA_SERXX-KUNDE = '0000009000'.
    WA_SERXX-VBTYP = 'C'.
    WA_SERXX-SD_AUART = 'OR'.
    WA_SERXX-SD_POSTYP = 'TAN'.
    WA_SERNR-SERNR = '000000001234ABCDAR'.
    APPEND WA_SERNR TO IT_SERNR.
    WA_SERNR-SERNR = '000000001234ABCDAQ'.
    APPEND WA_SERNR TO IT_SERNR.
    CALL FUNCTION 'SERNR_ADD_TO_DOCUMENT'
      EXPORTING
        operation                       = 'SDAU'
        objkopf                         = 'SER02'
        serxx                           = wa_serxx
        material                        = 'P1-TEST'
       PROFILE                         = 'Z001'
        quantity                        = '2'
      M_CHARGE                        =
       J_VORGANG                       = 'PMS2'
      KMATNR                          =
      CUOBJ                           =
      R_MATERIAL                      =
      BSTCH                           =
      BSTUP                           =
      SNBWG                           =
      EMATN                           =
      KDAUF                           =
      KDPOS                           =
      AUTOMATIC                       = ' '
      NO_ENQUEUE                      = ' '
      MORE_ALLOWED                    = ' '
      BUDAT                           =
    IMPORTING
       ANZSN                           = anzsn
       NEW_OBKNR                       = new_obknr
       SERIAL_COMMIT                   = serial_commit
       STATUS_NOT_ALLOWED              = status_not_allowed
      tables
        sernr                           = IT_SERNR
        r_sernr                         = it_ser1
      XVBPA                           =
    CHANGING
      T_SMESG                         =
    EXCEPTIONS
      KONFIGURATIONS_ERROR            = 1
      GENERAL_SERIAL_ERROR            = 2
      NO_PROFILE_OPERATION            = 3
      DIFFERENCE_IN_HEADER_DATA       = 4
      OTHERS                          = 5
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    commit work and wait.
    CALL FUNCTION 'SERNR_ADD_TO_AU'
      EXPORTING
        sernr                       = '000000001234ABCDAR'
        profile                     = 'Z001'
        material                    = 'P1-TEST'
      M_CHARGE                    =
        quantity                    = '1'
      J_VORGANG                   = 'PMS2'
      KMATNR                      =
      CUOBJ                       =
        document                    = '0000001733'
        item                        = '000010'
        debitor                     = '0000009000'
        vbtyp                       = 'C'
        sd_auart                    = 'OR'
        sd_postyp                   = 'TAN'
    IMPORTING
       ANZSN                       = ANZSN
      ZEILEN_ID                   =
       SERIAL_COMMIT               = SERIAL_COMMIT
    EXCEPTIONS
      KONFIGURATIONS_ERROR        = 1
      SERIALNUMBER_ERRORS         = 2
      SERIALNUMBER_WARNINGS       = 3
      NO_PROFILE_OPERATION        = 4
      OTHERS                      = 5
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    COMMIT WORK AND WAIT.

    hi,
    In order to maintain customer specific serial numbers you can do the following steps:
    1. Maintain the serial numbers provided by your client in tcode IQ01. this will create the customer serial numbers in the system.
    2. In the material master under Sales View maintain the serial number profile as 0002. this is sap standard.
    3. Once the above has been maintained you can assign serial numbers at the time of delivery and NOT in sales order.
    I hope this helps.
    Regards,
    Vishesh

  • Chinese Word list Update 1.5 not downloaded and installed automatically

    On my Macbook Pro with Retina display 15 inches running OSX 10.8.3, an update called "Chinese Word list Update 1.5" show up on Update available list in Appfresh application. But when I click on install, Mac APp Store open to search for that update, but it end up with "No update available"
    When I click Software Update from Apple menu, the same thing with No update available occurred.
    On my system information, I have Chinese Wrd list Update 1.0, 1.1, 1.2, 1.3, 1nd 1.4 installed. But I can't get this 1.5 Chinese Word list Update to automatically downloaded and installed as in the previous version
    Where can I download chinesewordlistupdate.pkg version 1.5 for manual installation? I cannot find it anywhere on APple support website
    This problem always occured when a new Chinese Word list Update is released. Why Apple won't make this update available for manual download or thru normal process of software update? Why Apple has to make this very suspicious update? I can't find answer anywhere on the Internet
    Can any expert here point me to download this chinesewordlistupdate.pkg version 1.5 so that I can manually install it please

    Purd wrote:
    Any advise
    Perhaps it would help if you would do a few things to make sure the Apple update system knows that your machine needs to do Chinese.  This includes a) check the boxes to activate the simplified and traditional input sources in system preferences/language & text/input sources, b) download the additional 10 chinese fonts which Apple provides only when you try to enable them in Fontbook, and c) download the additional chinese voices which Apple provides only when you check their boxes in system preferences/speech/system voice/customize.
    It might also help to temporarily switch the OS interface to Chinese and then check for software updates.

  • HT4623 My contacts are listed by telephone numbers instead of names in my messages since I upgraded to OS8? How can I change it to names?l,

    My contacts are listed by telephone numbers instead of names in my messages since I upgraded to OS8? How can I change it to names?l,

    Under Settings->Messages->Send & Receive
    1) is your Apple ID listed there?
    2)  Under "You can be reached..." is your phone number appearing at the top of the list and does it have a checkmark next to it?
    3) Under "Start New Conversation From" is the checkmark next to your phone number?

  • Since the last update my Numbers app in IOS, iPad3 and iphone5 will not open.  It works fine on my macbook pro.  It starts but before I can open a file it closes.

    Since the last update my Numbers app will not load in either my iPad3 or my iPhone5.  It works fine on my MacBook Pro.  The app starts but before I can open a file it closes.  Is this a common problem and do you know hwo to solve it?

    Hi Michael,
    If you've already restarted both your iOS devices after the update and Numbers for iOS still won't load, you might try clearing the documents temporarily out of iCloud, opening the apps, closing them, and then placing the documents back in iCloud.
    To do this, in Finder on your Mac, hold down the option key and then Go > Library > Mobile Documents > com~apple~Numbers.  Move the documents there out to the Desktop or other location of your choosing.  Then give iCloud time to sync.  Then try opening Numbers on iPad and on the iPhone.  If they open, then close them, and move the documents back into  Library > Mobile Documents > com~apple~Numbers and let iCloud sync again.
    That sometimes clears up the problem.
    SG

  • Report to Get the List of Personnel Numbers in COntrol Record

    Hi Folks,
    In Pao3-Control Record, we get the List of Personnel Numbers active for the current month in a Particular Payroll area, For one particular payroll area, we have around 1000 numbers , is there any standard report available to get the employee list along with personnel  numbers from the control record.
    Regards,
    Sekar.

    You can try using Flexible Employee Report.
    Choose Payroll Area as Input
    Choose Personnel Number and Employment status as Output.
    Try this.

  • Problems with new update of Numbers for Maverick

    When opening any of my documents creted on a alder version of Numbers, I lose the format that I had on the page. The table or spreadsheet stays intact, but no the document perse. Where is the "Show Print View" feature on the new update of Numbers. I am frustrated and disappointed with the new changes, since I had to recreate all the spreadsheets that I had for my personal use and work.

    Hi Sarafinna
    Welcome to http://supportforums.blackberry.com/
    Trying to restart the BlackBerry to see if it works and works well the OS on your BlackBerry.
    If evidences the persistence problem I recommend you do a hard reset
    By pressing the plus and minus volume along with the power button for about 30 seconds.
    BBM Channels  PIN: C0007093A
    Do not forget to give LIKE    Those people who help you and advise you about your doubts.  if the review has been SOLVED** # 4LL  #ÉliteRoad  Make a backup of your BlackBerry
    BlackBerry Protect and  BlackBerry Link constantly.  #ichooseBlackBerry10 Gutijose14 Forums Veteran I

  • Why do I have to update Keynote,Numbers,and Pages on a daily basis?

    For the past week I've had to update Keynote, Numbers, and Pages on a daily basis?If I update the apps today, tomorrow I will be asked to update them again.Something is wrong with picture.
    Is anyone else having this issue?

    Rebuild the Spotlight index. If you try to search now from the magnifying-glass icon in the top right corner of the display, there will be an indication that indexing is in progress.

  • Can I push and execute a list of phone numbers to an IP Phone?

    Hi,
    I want to build a .net application which will push a list of phone numbers to an IP phone and execute this list serially.
    That means that after the end of a call in the list the next call will be generated.
    Can this be done ?
    Thanks
    D.E.

    You mean you want an outbound dialler.. just like it's being used in a call center?
    That is most definitely a case for CTI.. you need to know when one call ends and when to make another one and the only way to do this (well, you could do phone polling, but that's nasty and unreliable) is CTI. And you also need to consider how cell centers work... agents need to be able to hit a pause button for their coffee / cigarette /bathroom breaks, they need wrapup time, etc.
    Or you could do predictive outbound dialling, where you use a bunch of CTI ports to make outgoing calls, then route them to an agent if a call is connected.. but considering the amount of time you're going to invest versus what's already on the market in terms of call center solutions, I'd only do it as an academic project or if none of the existing solutions really do what you need done (with predictive outbound dialling goes a metric to decide how much you overbook your agents (make more calls than you have agents since not every call will be answered), and a VAD (a connect doesn't mean there's a human being on the other end.. there could be a fax or modem and you don't want those calls connected to your agents).
    Or am I completely on the wrong track here with the whole Callcenter approach and you're looking for something else entirely?

  • Are there free updates for Numbers 09 v2.3?

    Hello,
    I am looking for a free software update for Numbers 09 v2.3.  All of a sudden I cannot open spreadsheets that I was working on last week!   The same happened with Pages and the I found the update and it's now opening all documents.  Any thoughts or do I need to buy the update for Numbers?
    I have a new Mac OSX v 10.9
    Thanks!

    Chryiis,
    If you updated to Mavericks and then performed all software updates it is likely you installed the latest version of the the iWorks applications.  There are now two versions on you computer.
    The lastest version (3.0) is located in the foldler: "/Applications"
    The previous version (2.3) is located in the folder "/Applications/iWork '09"

  • Wish List Updates for Snow Leopard

    If you support any of the following, please send them to Apple's suggestion box.
    I would like Apple to offer the following settings, preferably without third party fixes.  HOWEVER, feel free to respond with your favorite work-around solutions.  I need to learn Terminal!
    1. Safari - close download window upon completion
    2. Safari - remove ALL cookies and cached items when "resetting" same.  There are always a select few that have to be manually deleted
    3. Safari - have a built in video downloader/converter - Yes there are good third party solutions for this
    4. Safari - allow Private Viewing as a default option
    1.Pointer options - Create an option in preferences to enable the pointer to automatically go the default option selection (as is possible in that "other" operating system.  You know, the one that pirated the window concept)
    1. Apple mail - #1 request is identify a way to allow the numerous superior email clients interface as seamlessly with other native apps.
    2. Apple mail - short of that, create a setting to turn off or allow a time setting to override an email automatically being marked as read if it happens to be highlighted with you open the app, thereby appearing in the preview pane. Appearing in the preview pane does not mean I have read it.
    3. Apple mail - provide an option for creating return receipts requests
    4. Apple mail - What it that box that appears around blocks of text in received mail that makes editing more difficult than it should be
    5. Apple mail - Provide a tool to apply the formatting to other parts of the email (sort of like the paint brush tool in that OS with the "W" word)
    6. Apple mail - If I label a sender as "not-junk" do not put label mail from this sender as Junk.  I do not want all senders in my address book.
    7. Apple mail - If I label a sender as "JUNK" future mail from this sender should also be JUNK, no?
    8. Apple mail - Create a rule that allows "Bounce" as an option
    1. iPhoto - I know I must be missing something here, so please chime in -
    How or what can I do to save photos into iPhoto when I am not using iPhoto.  The most common annoyance for me is saving photos off email attachment or from the web.  There MUST be something I am doing wrong.  Where is the "Save to iPhoto Library" option?
    1. QuickTime - Please bring back QT Player 7!!!
    12. I know we mustn’t use "other" browsers, but in those rare events that it happens - how nice would it be to have a native bookmark sync option or common folder?
    13. Finder - allow more columns in the viewing options for Spotlight
    Please feel free to add to the list.

    kurt188
    Re: Wish List Updates for Snow Leopard 
    Feb 12, 2012 9:59 AM (in response to CAPTJON)
    So may words, so little help.  You do realize that they call this a Support Community, right?
    1. Safari - close download window upon completion
    Mine already does this, and I'm sure you can do it in Snow Leopard, too.
         When you refer to "mine," what OS are you referring to?  Are you willing to share your knowledge on where I might find this capability?
    3. Safari - have a built in video downloader/converter - Yes there are good third party solutions for this
    That's not the job of a browser, and it's not going to happen. Keep dreaming.
         Thanks again for the helpful advice. I am impressed with our willingness to help.
    4. Safari - allow Private Viewing as a default option
    You can turn it on yourself. There's also AppleScript, or assigning a keyboard shortcut.
         I am very aware of how to turn it on.  I would prefer to leave it on by default.  Care to share your AppleScript knowledge?
    Apple mail - provide an option for creating return receipts requests
    It's been there for years—where have you been?
         Thanks again for the poweruser tip, very helpful.
    1. Apple mail - #1 request is identify a way to allow the numerous superior email clients interface as seamlessly with other native apps.
    That's entirely your opinion, which isn't shared by the vast majority of Mac users.
         I am sorry I do not share you opinion, nor did I know you speak for the majority of Mac users.  Perhaps with your superior guidance I would become a power user too?
    Where is the "Save to iPhoto Library" option?
    Have you tried looking at the options given to you when you receive email with attachments? There's a Save button in the Header section that gives you the option to save the image to iPhoto.
         And how does this sugggestion help when downloading a photo from the web?
    Perhaps if you spent time getting to know your Mac and OS X, you'd find that there aren't nearly as many "issues" as you seem to imagine.
         Yes, and I perhaps if you would share a bit of your superior knowledge I would agree.  That was my hope in posting to a "support community."  You put a fair amount of effort into your criticism.  Just "imagnie..."
    Correct Answer 

Maybe you are looking for

  • Yoga 2 13 (Not Pro) Pre-Purchase Questions

    Yesterday I looked at the Yoga 2 13 Ultrabook (non-pro version), 4 GB RAM, I5 processor, 500 GB hard drive at a big box store. I am seriously considering this, but wonder about fan noise (under high load conditions) and any other possible issues that

  • The color on my iPhone went from positive to negative.....help

    The color on my iPhone changed from positive to negative.......help

  • Picture Gallery - Please help!!!!

    Hey everyone My images under my picture gallery are displayed (four images per row). How can I change it so there are three in a row.  My images are also bad quality when you view them as tiles.  All my friends etc pictures are very clear.  Your help

  • Changing Photo Size Dimensions

    Hi, I put a few photo's on CD and attempted to put a couple of photo's on the internet using a PC as I'm not currently online at home. The website I tried to post these on allows space for 2KB for each image, each image I used is less than this. Howe

  • Adding a period of silence between imported files

    I have imported a group of mp3 files as an album into my iTunes library. During playback, is there a way to insert a short period of silence (2-3 seconds) at the beginning or end of each file?