HashMap type object that allows multiple duplicate keys

Hello all,
I need an object that will allow me to have a key/value similar to a HashMap except that it will allow me to have duplicate keys.
ie....
//set(Key,Value)
set("Apple","red")
set("Apple","green")
set("Apple","brown")Any Ideas?
TIA!

Nevermind,
I figured it out.
            if(!map.containsKey(key))
              ArrayList arraylist = new ArrayList();
              arraylist.add(value);
              map.put(key,arraylist);
            else
                ArrayList arraylist = (ArrayList) map.get(key);
                arraylist.add(value);
            }Thanks.

Similar Messages

  • Authorization Objects that allowed/disallowed FI Postings

    Hi All,
    May I know what are the Authorization Objects that allowed/disallowed FI Postings?
    Thanks,
    Teo

    Dear:
                    Here is the list of FI objects i have maintained to allow or disallow the transactions into Customer, Vendor, Co code, GLs e..t.c Hope it will be helpful for your.
    F_AVIK_BUK     FI        Payment Advice: Authorization for Company Codes            
    F_BKPF_BED     FI        Accounting Document: Account Authorization for Customers   
    F_BKPF_BEK     FI        Accounting Document: Account Authorization for Vendors     
    F_BKPF_BES     FI        Accounting Document: Account Authorization for G/L Accounts
    F_BKPF_BLA     FI        Accounting Document: Authorization for Document Types      
    F_BKPF_BUK     FI        Accounting Document: Authorization for Company Codes       
    F_BKPF_BUP     FI        Accounting Document: Authorization for Posting Periods     
    F_BKPF_GSB     FI        Accounting Document: Authorization for Business Areas      
    F_BKPF_KOA     FI        Accounting Document: Authorization for Account Types       
    F_BKPF_VW      FI        Acc. Document: Change/Display Default Vals for Doc.Type/PKey
    F_BL_BANK      FI        Authorization for House Banks and Payment Methods          
    F_BNKA_BUK     FI        Banks: Authorization for Company Codes         
    Regards

  • Creating a form that allows multiple Digital Signatures

    I am trying to make a PDF form that allows multiple users to sign different portions of a single form. I have created the form and inserted the Digital signature fields. Which if I use my Acrobat 8 Professional to open I am able to sign each different signature field independantly, but if the form is opened in just Reader 8 it will not allow singing of any digital signature field at all. Seems the security settings revert to a default of not allowing the form to be signed. Anyone able to help, if I have not provided enough information please let me know as I am pretty new to LiveCycle.

    The previous post is correct.  Reader will not allow you to sigh an form unless it has been reader extended to enable the signing functionality.  Acrobat pro or LiveCycle Reader Extensions can be used for this.
    Regards
    Steve

  • SSIS - "Violation of PRIMARY KEY constraint. Cannot insert duplicate key in object ' tablename '. The duplicate key value is 1234 . Though there are no duplicate records.

    Hi,
    I am providing support to one of our clients, where we have jobs scheduled to load the data from the tables in the source database to the destination database via SSIS packages. The first time load is a full load where we truncate all the tables in the destination
    and load them from the source tables. But from the next day, we perform the incremental load from source to destination, i.e., only modified records fetched using changed tracking concept will be loaded to the destination. After full load, if we run the incremental
    load, the job is failing with the error on one of the packages "Violation of PRIMARY KEY constraint. Cannot insert duplicate key in object '<tablename>'. The duplicate key value is <1234>, even though there are no duplicate records. When we
    try debugging and running the failing package, it runs successfully. We are not able to figure out why the package fails and when we run the next day it runs successfully. Request you to help me in this regard.
    Thank you,
    Bala Murali Krishna Medipally.

    Hi,
    I am providing support to one of our clients, where we have jobs scheduled to load the data from the tables in the source database to the destination database via SSIS packages. The first time load is a full load where we truncate all the tables in the destination
    and load them from the source tables. But from the next day, we perform the incremental load from source to destination, i.e., only modified records fetched using changed tracking concept will be loaded to the destination. After full load, if we run the incremental
    load, the job is failing with the error on one of the packages "Violation of PRIMARY KEY constraint. Cannot insert duplicate key in object '<tablename>'. The duplicate key value is <1234>, even though there are no duplicate records. When we
    try debugging and running the failing package, it runs successfully. We are not able to figure out why the package fails and when we run the next day it runs successfully. Request you to help me in this regard.
    Thank you,
    Bala Murali Krishna Medipally.
    I suspect you are trying to insert modified records instead of updating.

  • A PKGBUILD that allows multiple installed kernels

    Hi All,
    I've had so many people help me with so many things here at Arch, hopefully this will be useful to someone.
    What is it:
    I've got a kernel PKGBUILD file that allows me to build and install as many different kernels as desired, as long as each one has a unique $pkgver-$pkgrel setting.
    /var/abs/local/kernel-custom1/PKGBUILD:
    # $Id: PKGBUILD,v 1.17 2004/05/11 23:25:20 judd Exp $
    # Maintainer: judd <[email protected]>
    # 2004/06/30: Modified to support multiple loaded kernels -jea
    # Any kernel with a unique $pkgver-$pkgrel will not conflict with others.
    pkgver=2.6.6
    pkgrel=custom1
    # name mangling is necessary so pacman will load multiple packages
    pkgname=kernel$pkgver$pkgrel
    pkgdesc="Linux Kernel ver: $pkgver, build: $pkgrel"
    url="http://www.kernel.org"
    depends=('module-init-tools')
    # Is this file were patches to grub/menu.lst should occur? -jea
    install=kernel26.install
    source=(ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-$pkgver.tar.bz2
    config)
    # patch makepkg to use as many sums as listed, in order? -jea
    md5sums=('5218790bc3db41e77a7422969639a9ad' 'fd32e9f43e9b6060e01f71d666372518')
    build() {
    cd $startdir/src/linux-$pkgver
    # get rid of the 'i' in i686
    carch=`echo $CARCH | sed 's|i||'`
    cat ../config | sed "s|#CARCH#|$carch|g" >./.config
    yes "" | make config
    # set EXTRAVERSION to create unique /lib/modules/ subdirectories
    cat Makefile | sed "s|EXTRAVERSION =|EXTRAVERSION = -$pkgrel|" > tmpMake
    mv tmpMake Makefile
    make clean bzImage modules || return 1
    mkdir -p $startdir/pkg/{lib/modules,boot}
    make INSTALL_MOD_PATH=$startdir/pkg modules_install || return 1
    # create unique names in /boot/
    cp System.map $startdir/pkg/boot/System.map-$pkgver-$pkgrel
    cp arch/i386/boot/bzImage $startdir/pkg/boot/vmlinuz-$pkgver-$pkgrel
    install -D -m644 Makefile $startdir/pkg/usr/src/linux-$pkgver/Makefile
    install -D -m644 .config $startdir/pkg/usr/src/linux-$pkgver/.config
    install -D -m644 .config $startdir/pkg/boot/kconfig-$pkgver-$pkgrel
    mkdir -p $startdir/pkg/usr/src/linux-$pkgver/include
    mkdir -p $startdir/pkg/usr/src/linux-$pkgver/arch/i386/kernel
    for i in acpi asm-generic asm-i386 config linux math-emu net pcmcia scsi video; do
    cp -a include/$i $startdir/pkg/usr/src/linux-$pkgver/include/
    done
    # copy files necessary for later builds, like nvidia and vmware
    # does this "$pkgver-$pkgrel" multi-kernel strategy screw these up? -jea
    cp -a scripts $startdir/pkg/usr/src/linux-$pkgver/
    cp arch/i386/Makefile $startdir/pkg/usr/src/linux-$pkgver/arch/i386/
    cp arch/i386/kernel/asm-offsets.s $startdir/pkg/usr/src/linux-$pkgver/arch/i386/kernel/
    # copy in Kconfig files
    for i in `find . -name "Kconfig*"`; do
    mkdir -p $startdir/pkg/usr/src/linux-$pkgver/`echo $i | sed 's|/Kconfig.*||'`
    cp $i $startdir/pkg/usr/src/linux-$pkgver/$i
    done
    cd $startdir/pkg/usr/src/linux-$pkgver/include && ln -s asm-i386 asm
    cd $startdir/pkg/usr/src
    # create a unique subdirectory under /usr/src/
    mv linux-$pkgver linux-$pkgver-$pkgrel
    chown -R root.root $startdir/pkg/usr/src/linux-$pkgver-$pkgrel
    cd $startdir/pkg/lib/modules/$pkgver-$pkgrel &&
    (rm -f build; ln -sf /usr/src/linux-$pkgver-$pkgrel build)
    How it works:
    The primary thing I've usually done is wipe out my custom kernel by inadvertantly overwriting the loadable modules in the /lib/modules/$pkgver directory with a pacman -Su.
    The reason for this is that the current arch kernel build does not set the EXTRAVERSION variable in the kernel top level makefile. Therefore all kernels of the same $pkgver use the same /lib/modules/$pkgver/ subdirectory.
    The above PKGBUILD sets EXTRAVERSION to the $pkgrel variable.
    This causes the loadable module tree to be in a /lib/modules/$pkgver-$pkgrel/ directory.
    There are two other places where kernels experience file conflicts:
    /boot/
    /usr/src/
    The /boot/ files: vmlinuz, System.map and kconfig are given unique names by appending the $pkgver-$pkgrel string.
    The /usr/src/linux-$pkgver/ directory is moved to /usr/src/linux-$pkgver-$pkgrel/.
    This allows the loadable kernel, the loadable modules and the stripped source headers to be in a unique place for each different kernel. Therefore multiple kernels can be loaded concurrently and the desired one may be chosen at boot time by grub.
    The only thing a little weird about this, is the $pkgname variable. pacman will only load one version of each $pkgname, so for multiple kernels to be loaded, they each have to have a unique $pkgname. This is accomplished by appending the $pkgver and $pkgrel to the $pkgname. This is fine, except it gives a slightly weird name for the resulting kernel package file. It has the format:
    kernel$pkgver$pkgrel-$pkgver-$pkgrel.pkg.tar.gz
    That is, the $pkgver and $pkgrel appear in the package file name twice. This also shows if one issues:
    pacman -Q | grep kernel -
    Which yields for me:
    kernel2.6.6custom1 2.6.6-custom1
    kernel2.6.61 2.6.6-1
    kernel26 2.6.7-1
    This command could only have shown one package before, now it shows that I currently have installed: a custom 2.6.6 kernel, the stock arch 2.6.6 kernel built with the above PKGBUILD and the current arch kernel26 package.
    I may choose between any of these at boot time with grub. And as an added bonus, the next time I pacman -Su I won't wipe out my custom /lib/modules subdirectory 8-)
    All of this assumes the supply of your own custom config file as in the arch wiki Building the Kernel in ABS instructions.
    Idle thoughts:
    It would sure be nice if something like this could be adopted for the stock arch kernels. Unlike most other packages it is often desirable to have multiple versions of the kernel package installed at once.
    I wonder if it is practical for pacman to allow multiple versions of the same $pkgname to be installed concurrently if the $pkgname-$pkgver-$pkgrel string is unique and the different versions do not have file conflicts?
    The other major package I could see this being applied to is gcc. It would be really cool to load different cross and other configurations of gcc concurently.
    I find one of the most diifficult things needed to get a workstation running is getting all of the correct kernel modules built in. It seems that most PCs today have all the major features built in to the motherboard chipset: graphics controller, sound, usb, ethernet, etc. If it was possible to build a database of custom kernels, one for each major chipset, then one could be chosen by hardware detection at install time. This would provide the benefits of a custom kernel in an autoload fashion.
    Just dreaming...
    Conclusion:
    I'm not sure how this strategy fits in with the bigger pictiure of running pkg repositories, building dependent packages, who knows what else.
    The thing I hope to add next is automatically adding and removing entries into: /boot/grub/menu.lst when the kernel package is installed and removed. The $pkgdesc string is perfect for serving as the title line.
    Hopefully this can be useful to others, it has helped me clean up my multi-kernel mess here.
    Thanks Again for such an awesome distro...
    John E. A.
    p.s Arch Rulz!

    Thank you, I tried to set something up like this in the wiki, but never tested it and it didn't work for some users. You've tested it well?
    If so, you can copy it over to the wiki (edit or overwrite the Kernel compile with ABS wiki entry), or I can.
    Thanks again, its much appreciated.
    Dusty

  • Derived Column : for Lookup type column with 'Allow Multiple Selection' : True in sharepoint list

    Hello,
    I have one column where field type is Lookup but 'Allow Multiple Selection' is true in SharePoint List.
    So, in this scenario data from the SharePoint list is being exported as below.
    1;#Red;#3;#Blue;#4;#Black;#5;#Green
    Now resultant text exported to SQL Table should be :
    1,3,4,5
    OR
    Red,Blue,Black,Green
    Either way it is fine. How can we get this using Derived Column and Data Conversion?
    I am able to do this for single occurrence using below expression.
    (DT_STR,100,1252)(SUBSTRING([BusinessUnit],FINDSTRING([BusinessUnit],"#",1)+1,LEN([BusinessUnit])-FINDSTRING([BusinessUnit],"#",1)))
    Please suggest.
    Thank you,
    Mittal.

    Your best bet would be to do this in sql using a string parsing udf as below
    http://visakhm.blogspot.com/2010/02/parsing-delimited-string.html
    You can make it into procedure and call it from oledb command task.
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Is there an enterprise version of Adobe Forms Central subscription that allows multiple users?

    I have found many online form tools. Adobe is reputable so I am inclined to use it, however I can find little information. I need a forms system that stores results in the cloud for export. It must store more than 10,000 responses (how many does the most advanced version of FormsCentral allow you to store)? Also must be able to create unlimited forms.
    Thank you - Blake

    It allows unlimited forms, but the limit on the number of responses at one time is 5000, with a buffer that stores an additional 2500. You can always download the responses before you reach the limit though. For more info, see: http://forums.adobe.com/docs/DOC-1382

  • Free alternatives to JTable that allow multiple rows in the header?

    My goal is to make a table with two or more rows in the column header. For instance, imagine I want to have the numbers of the days in the calendar as columns, then I want to have a row over them with the months, spanning over multiple days, then I want to have a row over that with the year, spanning over multiple months. I want these rows to be in the column header so they're always visible as you scroll down.
    Right now, I'm doing this with the first rows of the grid, out of the header, so they get out of view when the user scrolls down. Also, by being in the actual grid, they screw up sorting of the table.
    So I need 2 features. Multiple rows in the column header and the ability to merge multiple cells in the header.
    I've see some code to do this but it seemed too complicated so I want to see if I can find a component that does this out of the box first. I've seen 2 3rd party JTable-based components that do this but they're paid products and paying the full price of a component bundle for these features isn't a very attractive idea.
    So, does anyone know of a good table component that does this?

    Have a look at JXTable from the SwingX project. You should be able to find it via Google.

  • Is there a widget that allows multiple panels to be open at once

    Thanks, Deb

    Hi Deb,
    You can probably place multiple accordion panels inside a content field of an accordian panel which will all be open by default, however the parent (containing accordion) panel will be closed by default.
    You will be able to view content of all the child accordion panels when you open the parent one. However they will keep their state in case you close one or more of them.
    Try it out if that helps your setup.
    Cheers,
    Vikas

  • Someone told me about an ipad MMORPG type game that allowed you to invite other players to your home/world for a feast, and do activities like that.. Does anyone know what it is?

    Refer to title

    Have latest version of iTunes installed and running. Also make sure you have internet access working and can access Apple websites. Also, make sure you don't have any entries in your hosts file referring to gs.apple.com....If your not sure about how to do that, go ahead and do the rest first. You can come back to that later.....Plug in phone. Put phone in DFU mode.(google put iphone in DFU mode for instructions) Then restore the phone in iTunes by highliting your device in the left column and click on the Restore button. The latest iOS version is 4.3.3. That's what iTunes will restore it to. When it's done restoring, iTunes will ask if you want to restore from a backup or setup as a new phone. I would use the Setup as a New Phone option. Once it's done, you should have a clean install of the iOS and an operating phone, as long as there are no hardware issues with it.

  • How to create a DAD that allows multiple connection to database

    many users can access through the same dad

    In OAS4.0.8, open the Database Access Descriptor Form, and uncheck the option, "Store database username and password in the DAD".
    This prompts the user to enter a username and pwd when accessing the database. Even if you specify one set of values while creating the DAD, you can specify any other valid username and password from the browser.
    However, it would be interesting to figure how to do the same thing in versions > 4 where do not have an OAS manager interface.
    If you figure how to set it in the conf files, fdo let me know as well.
    Viji

  • Violation of PRIMARY KEY constraint . Cannot insert duplicate key in object

    hi i am using SQL Server, when i try to insert data from my jsp page it is inserting the data double time and when i try to submit for second time it is showing the following error.
    Violation of PRIMARY KEY constraint 'PK_EMPLOYEE'. Cannot insert duplicate key in object 'EMPLOYEE'.
    I didnt set identity for primary key. If i try to set identity to true then it is allowing data to submit only if i uncheck my primary key column in cached row set. And if i uncheck that primary key element then i can not retrieve the data by edit button. So how to solve this problem.
    Please any help would be appreciated.
    Thank You in Advance.

    Hi,
    I am providing support to one of our clients, where we have jobs scheduled to load the data from the tables in the source database to the destination database via SSIS packages. The first time load is a full load where we truncate all the tables in the destination
    and load them from the source tables. But from the next day, we perform the incremental load from source to destination, i.e., only modified records fetched using changed tracking concept will be loaded to the destination. After full load, if we run the incremental
    load, the job is failing with the error on one of the packages "Violation of PRIMARY KEY constraint. Cannot insert duplicate key in object '<tablename>'. The duplicate key value is <1234>, even though there are no duplicate records. When we
    try debugging and running the failing package, it runs successfully. We are not able to figure out why the package fails and when we run the next day it runs successfully. Request you to help me in this regard.
    Thank you,
    Bala Murali Krishna Medipally.
    I suspect you are trying to insert modified records instead of updating.

  • Looking up values from Map/HashMap  when Objects are used as keys

    I'm trying to understand why Map/HashMap don't test for equals() when looking up a key ( which is an Object that overrides equals() and hashCode()) in the Map.
    I've written this code, based on some code from the SCJP book, but it is not exactly the same, this code talks about a different issue not addressed in the book.
    I've added my questions inside the comments below, I think that is the best way I can ask it.
    import java.util.*;
    class Bird{
         public String name;
         public Bird(String name){
              this.name = name;
         //Override equals()
         public boolean equals(Object o){
              if(((Bird)o).name.equals(this.name)){
                   return true;
              }else{
                   return false;
            //Override hashCode
         public int hashCode(){
              return name.length();
    class TestMapLookup{
         static public void main(String[] args){
              Map<Object, Object> hashMap = new HashMap<Object, Object>();
              Bird b = new Bird("crow");
              hashMap.put(b, "somevalue");
              //according to the book, the map object calls the key's (Bird object's)
              //hashCode() first and then equals()
              //to find this key in the map
              System.out.println(hashMap.get(b));
              //Using the b reference to lookup value
              //ouputs - somevalue
              System.out.println(hashMap.get(new Bird("crow")));
              //Using a new Bird object to lookup value
              //outputs - somevalue
              //because Bird overrides equals and hashCode
              //otherwise we'd get null
              //Now change the name of the bird in the b reference
              b.name = "sparrow";
              //Notice that the crow's hashCode is 4
              //sparrow's hashCode is 7 , in the above implementation of hashCode
              System.out.println(hashMap.get(b));
              //Again using b reference to lookup value
              //ouputs - null
              //because the hashCode of b.name does not match
              //the hashCode of any of the keys stored in the map
              System.out.println(hashMap.get(new Bird("crow")));
              //This also outputs null
              //for the same reason that there's no key in the map
              //with a hashcode of 7
              //This is where it becomes strange......................
              //Change the name of the bird in the b reference
              //so that the new name has the same hashCode, as the key in the map
              b.name = "dove";
              System.out.println(hashMap.get(b));
              //In the above - the hashCode matches
              //but equals() fails
              //even though equals() fails, the key is still located and the value is output
              //output is "somevalue"
              //same here:
              b.name = "1234";
              System.out.println(hashMap.get(b));
              //output is "somevalue" instead of null
              b.name = "abcd";
              System.out.println(hashMap.get(b));
              //output is "somevalue" instead of null
              //why does it output "somevalue" instead of null , even though when the map
              //looks up the key , equals() returns false?     
              System.out.println(hashMap.get(new Bird("crow")));
              //In this case ( new Bird reference ) it prints null
    }I'm aware of best practices in coding and coding conventions but haven't used them here, because this is in preparation for SCJP - which tests on a lot of different things.
    I appreciate any info.

    It is correct that b is referring to the same object that the map's key is pointing to, but why does the following
    print null , instead of "somevalue"?
    at these lines in the code above.
    b.name = "sparrow";
    System.out.println(hashMap.get(b));Because the hashCode used when you stored b was 4, and now it's 7. You should read the Wikipedia article on Hashtable, but a simplistic explanation is that a HashMap has a bunch of "buckets," say 10, each indexed with a number 0-9. To decide which bucket to put a new key-value pair in, you take the hashcode (say 2112) and take the remainder of hashcode/number of buckets (in this case, 2112%10=2). So when you store the key-value, it gets "put" in this bucket.
    When you change the hashcode of b by changing its name attribute, it doesn't change the fact that the pair is in that bucket. But, it now looks in the wrong bucket and so can't find the pair.
    A hashtable gets its good efficiency by not having to look through all values to find the pair. It can jump directly to the correct bucket, which takes constant time instead of being dependent on the number of items in the collection.
    endasil wrote:
    You should never, ever change an object being used as a key in a map.I guess this is a best practice, I just wanted to try changing the key object to test a few things for SCJP, which does not test on coding best practices but tests on how the code behaves.Yep, and what you should take away is that this is WHY it's bad to change the key :).

  • Allow multiple records from this table to be displayed in the form is greyed out.

    I'm trying to add a second table to my main data source in an InfoPath 2010 form (database template), but the option to allow multiple records from this table to be displayed in the form is greyed out and I can't select it.
    Can someone please tell me how to correct this? I'm guessing that there might have to be something change in MS SQL because on other occasions I've have not encountered this problem when adding a second table.
    Any help would be greatly appreciated.
    Thanks.

    So I've found a work around, but I still don't know why I'm having the problem in the first place.
    I've been trying to relate the two tables by using the primary key in the parent table to a view of the child table that also includes primary key in the parent, e.g. the ORDER ID in the order table relating to the ORDER ID in the view of the order detail
    table. For whatever reason whenever I did that InfoPath prohibited the data source from returning multiple order details.
    My work around is to use views of both the order table and order details table that include the customer ID and to relate the two table in InfoPath using the customer ID. Now I get a data source that allows multiple order detail records. In order to get
    just the order details that I want that relate to a particular order, I use a rule that sets the order id in both the order and order details query data sets before executing the query (as opposed to just the order data set).
    Hope that's a clear explanation.

  • Need help Sorting an Arraylist of type Object by Name

    Hey guys this is my first time posting on this forum so hopefully i do it the right way. My problem is that i am having difficulties sorting an Array list of my type object that i created. My class has fields for Name, ID, Hrs and Hrs worked. I need to sort this Array list in descending order according to name. Name is the last name only. I have used a bubble sort like this:
    public static void BubbleSort(TStudent[] x){
    TStudent temp = new TStudent();
            boolean doMore = true;
            while (doMore) {
                doMore = false;
                for (int i=0; i < x.length-1; i++) {
                   if (x.stuGetGPA() < x[i+1].stuGetGPA()) {
    // exchange elements
    temp = x[i]; x[i] = x[i+1];
    x[i+1] = temp;
    doMore = true;
    before many time to sort an array of my class TStudent according to GPA.  This time though i tried using an Array list instead of just a simple array and i can't figure out how i would modify that to perform the same task.  Then i googled it and read about the Collections.sort function.  The only problem there is that i know i have to make my own comparator but i can't figure out how to do that either.  All of the examples of writing a comparator i could find were just using either String's or just simple Arrays of strings.  I couldn't find a good example of using an Array list of an Object.
    Anyways sorry for the long explanation and any help anyone could give me would be greatly appreciated.  Thanks guys
    Edited by: Brian13 on Oct 19, 2007 10:38 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    ok still having problems I have this line of code to try and all Arrays.sort
    Arrays.sort(Employee, TEmployee.FirstNameComparator);Then in my class TEmployee i have
    public static Comparator FirstNameComparator = new Comparator() {
        public int compare(Object employee, Object anotherEmployee) {
          String lastName1 = ((TEmployee) employee).getEmpName().toUpperCase();
          String lastName2 = ((TEmployee) anotherEmployee).getEmpName().toUpperCase();     
           return lastName1.compareTo(lastName2);
      };Here is the rundown of what i have for this. I have 2 classes. One is called TEmployee and that class holds fields for Name, ID, Hrs Worked, Hourly Rate. Then i have another class called myCompany that holds an ArrayList of type TEmployee. Then i have my main program in a Jframe.
    So maybe i am putting them in the wrong spots. The code in TEmployee thats make the comparator is fine. However when i try to call Arrays.sort from class myCompany i get this
    cannot find symbol
    symbol: method sort (java.util.Array list<TEmployee>.java.util.Comparator
    location: class java.util.Arrays
    I have to put the comparator in TEmployee right because thats where my fields for Name are? Do i call the arrays.sort from my main program or do i call that from the class myCompany where my ArrayList of TEmployees are stored?
    Again guys thanks for any help you could give me and if you need any code to see what else is going on just let me know.

Maybe you are looking for