TreeSet contains and remove not working

I am using a TreeSet in a class that extends AbstractListModel. It seems that the TreeSet.remove() and TreeSet.contains() is not finding the object. If I run the code below, the element is not found (sometimes).
public boolean removeElement(VariableInfo element){
        boolean removed = model.remove(element);
        if(removed){
            fireContentsChanged(this, 0, getSize());
        return removed;
}If I run this code, however, the element is found. (The code below will fail if the uncommented line is used.) Any ideas why this is happening? I don't want to use the code below because it requires iterating over all the elements in the list.
public boolean removeElement(VariableInfo element){
        for(VariableInfo v : model){
            if(v.equals(element)){
                return model.remove(v);
                //return model.remove(element); //will also fail if using this line instead of previous one
        return false;
}

Sorry for the confusion. The compareTo method in VariableInfo simply calls the compareTo method in VariableName which is wrapped by the Variableinfo object. The two classes below should clarify what I mean. Should I not be calling the compareTo method on VariableName from the VariableInfo class?
public class VariableInfo implements Comparable<VariableInfo>{
     * Variable name
    private VariableName name = null;
  public VariableInfo(String name, String label, int type, int dataType, int positionInDb, String subscale){
        this.name = new VariableName(name.trim());
        this.label = new VariableLabel(label.trim());
        this.type = new VariableType(type, dataType);
        this.positionInDb = new Integer(positionInDb);
        this.subscale = subscale;
public int compareTo(VariableInfo o){
        System.out.println("VariableInfo compareTo");
          return this.name.compareTo(o.name);
@Override
public boolean equals(Object o){
        System.out.println("VariableInfo equals");
        return (o instanceof VariableInfo) && (this.compareTo((VariableInfo)o)==0);
public class VariableName implements Comparable<VariableName>{
   @Override
    public boolean equals(Object o){
        System.out.println("VariableName equals");
        return (o instanceof VariableName) && (this.compareTo((VariableName)o)==0);
    public int compareTo(VariableName o){
        System.out.println("VariableName compareTo");
        return this.toString().compareTo(o.toString());
}

Similar Messages

  • Hyperlink that contains backslash is not working in Acrobat Reader 8 and 9

    Hi,
    Does anyone know why a hyperlink that contains backslash is not working in Acrobat reader 8 and 9?
    I created a document in Indesign CS and it contains hyperlinks that open up files from network drive so they contain backslash (for example: c:\foder\forder\filename.jpg). All the hyperlinks work in Acrobat Reader 6 but not in Acrobat Reader 8 or 9.
    Anybody could share the solution would be very much appreciated. Thanks!

    Did you ever figure this out? I am also having problems with the "No Hand" javascript which turns off the (not very helpful) page-forward hand icon (a hand symbol with a down arrow) which confuses our users when in fullscreen mode. We create interactive PDFs and everything worked fine up to Acrobat X/Reader X. Now in XI it doesn't allow the internal link icon (pointing finger) nor weblink icon (pointing finger with W) to appear. It just remains a plain o’ hand icon no matter what you mouse over even though there are links present.

  • Usb composite device is an older usb device and might not work in USB 3

    I recently bought one Lenovo Yoga 2 11 laptop running Windows 8.1 (64 bit).
    When I try to connect my old Brother MFC-3240C printer using USB (2.0), it doesn’t work.
    Below are the steps performed:
    Connected the printer to USB 2.0 port on laptop (on the right side). Automatically installed the printer driver (no exclamation mark beside printer icon)
    When the printer didn’t print, I tried to use troubleshoot as below:
    Control Panel->Hardware and Sound->Devices and Printers->Right Click on Printer Icon->Troubleshoot.
    It came up with USB composite device is an older usb device and might not work in USB 3.0
    Removed the printer and re-installed the driver. It is all the same.
    Any help will be greatly appreciated.
    FYI – the same printer works fine with my older laptops running Windows 7.

    Already checked Brothers website for the printer drivre for Windows 8.1 (64 bit).
    It says ... The built-in driver is already included with Windows® Operating System or is available through Windows® update.
    So, installed the default driver for the printer that is available with Windows 8.1.
    Even connected the printer with USB 3.0 port on the laptop, but it is all the same.

  • Paid subscription, but all products still in trial mode and does not work!

    Hello!
    I paid subscription, but all products still in trial mode and does not work! In Adobe ID manage page i don't see my subscription Screenshot “Adobe ID”
    I received an email confirmation of my payment subscription. Order number 12984126025, my adobe id
    [personal information removed... Mod - https://forums.adobe.com/docs/DOC-3731]
    [This is an open forum, not Adobe support, please do not post personal information]
    Why so?! This is very important! My current project at risk, I can lose money

    Please try the below mentioned steps
    1) Sign out of the Creative Cloud app
    2) delete the opm.db file*
    3) update to the latest version of the Creative Cloud app.
    *On Windows 7, the opm.db file is located here:
    C:\Users\YourUserName\AppData\Local\Adobe\OOBE
    *On a Mac, go here:
    [Userdir]:Library:Application Support:Adobe
    ~Deepak

  • Drag and Drop not working since last software update

    Drag and Drop not working since last software update - this is occuring on Outlook for the mac and I just tried moving  an icon on the doc and the same thing occured.  YOu can drag but the items will not drop.

    Please read this whole message before doing anything.
    This procedure is a test, not a solution. Don’t be disappointed when you find that nothing has changed after you complete it.
    Step 1
    The purpose of this step is to determine whether the problem is localized to your user account.
    Enable guest logins and log in as Guest. For instructions, launch the System Preferences application, select Help from the menu bar, and enter “Set up a guest account” (without the quotes) in the search box.
    While logged in as Guest, you won’t have access to any of your personal files or settings. Applications will behave as if you were running them for the first time. Don’t be alarmed by this; it’s normal. If you need any passwords or other personal data in order to complete the test, memorize, print, or write them down before you begin.
    Test while logged in as Guest. Same problem(s)?
    After testing, log out of the guest account and, in your own account, disable it if you wish. Any files you created in the guest account will be deleted automatically when you log out of it.
    Note: If you’ve activated “Find My Mac” or FileVault in Mac OS X 10.7 or later, then you can’t enable the Guest account. Create a new account in which to test, and delete it, including its home folder, after testing.
    Step 2
    The purpose of this step is to determine whether the problem is caused by third-party system modifications that load automatically at startup or login.
    Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards. Boot in safe mode and log in to the account with the problem. The instructions provided by Apple are as follows:
    Be sure your Mac is shut down.
    Press the power button.
    Immediately after you hear the startup tone, hold the Shift key. The Shift key should be held as soon as possible after the startup tone, but not before the tone.
    Release the Shift key when you see the gray Apple icon and the progress indicator (looks like a spinning gear).
    Safe mode is much slower to boot and run than normal, and some things won’t work at all, including wireless networking on certain Macs.
    The login screen appears even if you usually log in automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin.
    Test while in safe mode. Same problem(s)?
    After testing, reboot as usual (i.e., not in safe mode) and verify that you still have the problem. Post the results of steps 1 and 2.

  • TS1541 I tried importing email addresses from gmail and now my address book is locked up and will not work. Help please.

    I tried importing email addresses from gmail and now my address book is locked up and will not work. Do I need to delete my address book software and reinstall? If so, what is the proper way to do this? New to Macbook software. I have tried several things and nothing has helped. I have backed up photos, movies, etc. My addresses are on my iphone so I can sync them later right if I loose my data?
    Thanks for your time and expertise,
    T.

    You can probably resolve this by removing some Address Book preference files rather than deleting your Address Book application.
    First turn off Synchronize in Address Book Preferences if you can.
    Next restart Address Book and try to export everything to your Desktop.
    I have had a play and found my Address Book preference files. In the following ~/Library is the Library within your Home folder. Any numerals may differ on your Mac. Quit Address Book before doing anything with these.
    1 - Display details and things set in Address Book Preferences
    ~/Library/Preferences/com.apple.AddressBook.plist
    2 - Has no data - not sure what this does
    ~/Library/Preferences/com.apple.AddressBook.abd.plist
    3 - Has last sync date - may have more if I used sync
    ~/Library/Preferences/ByHost/com.apple.AddressBook.sync.000393735c06.plist
    4 - My contact details
    /Library/Preferences/AddressBookMe.plist
    5 - Individual addresses and groups stored as separate files within:
    ~/Library/Application Support/AddressBook/Metadata
    6 - All of these addresses are are also in this single database:
    ~/Library/Application Support/AddressBook/AddressBook-v22.abcddb
    If you wish to remove all addresses drag both 5 & 6 to your Desktop.
    If you wish to reset preferences drag 1 your Desktop.
    Removing 3 may resolve sync issues but I am unable to test this.
    If you wish to reset everything drag all except 4 to your desktop.
    Apple has an interesting page at: http://support.apple.com/kb/TS2481
    I hope this helps.

  • I want to install my Photoshop Exange CC and does not work me.

    I want to install my Photoshop Exange CC and does not work me.

    <u>'''Step 1.'''</u> You can check if you have any of these from [http://www.google.com/search?q=%22Fun+Web+Products%22&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:es-ES:official&client=firefox-a "Fun Web Products"] installed:
    Control Panel > Add or Remove Programs: Ask.com Bar,My Search Bar,MyWay Speed Bar,My Web Search Bar,Fun Web Products Easy Installer
    See:
    http://www.safer-networking.com/removemywebsearch.php
    [http://www.pchell.com/support/mywebsearch.shtml PC Hell: My Web Search Removal Instructions]
    http://helpint.mywebsearch.com/intlinfo/help/toolhelp.jhtml#q3
    <u>'''Step 2.'''</u> You <u>'''may'''</u> need to change a preference to reset your default URL/location bar search provider:
    -Enter '''about:config''' in the address/URL bar and press the Enter key
    -If you see a warning, accept it (Promise that you will be careful)
    -Filter = keyword.url
    -Below the Filter, right-click on keyword.URL and choose "Reset"
    -Restart Firefox (File > Restart Firefox)
    See: http://kb.mozillazine.org/Keyword.url
    <u>'''Step 3.'''</u> You <u>'''may'''</u> need to reset your homepage. Firefox can open multiple home pages. Home pages are separated by the "|" symbol.
    See: http://support.mozilla.com/en-US/kb/How+to+set+the+home+page

  • Plzz i think i opened a hacked internet page and now notting works well autocad stopped working firefox as well and i donno wat to do

    plzz i think i opened a hacked internet page and now notting works well autocad stopped working and firefox as well ........could mac os be virused??

    There are no Mac viruses, only malware that requires your assistance to get installed.  For more on this, see:
    http://www.reedcorner.net/guides/macvirus
    As to your problem, we can't say what might have happened without more information.  Try restarting your computer, and if that doesn't help, we need to know what you saw and what's happening now in greater detail.
    (Note that my pages contain links to other pages that promote my services, and this should not be taken as an endorsement of my services by Apple.)

  • HT1476 This cable or accessory is not certified and may not work reliably with this iPhone

    This cable or accessory is not certified and may not work reliably with this iPhone

    This is an incredibly stupid move by Apple. Nobody could convince me that it's about security and safety...
    I bought two Lightning to 30-pin Adapters to use my two 4s chargers with my 5s iPhone.
    Price on Amazon - 3$:
    http://www.amazon.co.uk/gp/product/B00IA95L2A/ref=oh_details_o00_s00_i00?ie=UTF8 &psc=1
    Price on Apple for the same thing - 60$
    http://store.apple.com/us/product/MD823ZM/A/lightning-to-30-pin-adapter
    This is just a piece of metal and plastic. It's ridiculous.
    Apple, please remove this ridiculous software. I also have a car charger. Should I just throw them away because I paid a bunch of money for your new device? That's how you reward loyalty?!!

  • @REMOVE not working

    Hello,
    I want to load data into one Account in USD, rather than Local.
    To achieve that, I loaded data in USD currency and thought of changing the Currency Conversion script where I would exclude that one account from DATACOPY and then conversion part. I tried @REMOVE(@LEVMBRS("Account",0),"xxxxx"), @REMOVE(@RELATIVE("All Accounts",0),"xxxxx"), @REMOVE(@DECENDANTS("All Accounts"),"xxxxx"), but no matter what I tried it is still taking that one account into calculation. I even tried pulling that one member in @LIST function but still it did not work.
    Am I missing something? The funny part is, another @REMOVE is already being used in the script where rates are being copied.
    Can anyone please suggest any solutions? I have already got the script to working but really want to know why is @REMOVE not working.
    Thanks!

    but what if further changes come in outline where as in UDA script will be same just need to tag UDA to members^^^So you've got four choices:
    1) Change the members in code
    2) Update metadata aka UDAs in outline
    3) Create a shared member parent and go after the children/descendants. This is a metadata approach as well but from the hierarchy side.
    4) Update metadata but this time in the form of attributes instead of UDAs. I use this in Planning apps all the time as it gives me a way to filter on a form if I want to. Without Planning, I would go with UDAs as they seem to be lower impact.
    I personally would do it with UDAs but would keep in mind lots of UDAs = a pain to maintain.
    Regards,
    Cameron Lackpour
    P.S. I am patiently waiting for MMIC, GlennS, to give you a fifth, sixth, and seventh way of doing this. :)

  • Red Eye Removal not working properly

    I'm having a problem with the red eye tool. I've done a search of this problem which returned no results.
    I have three similar photographs, i.e, taken a few seconds a part at a wedding ceremony. I've corrected the red eye problem on the first file. However, the red eye "dots" REMAIN when I switch to the next files. If I select the red eye tool, I even get the location ovals overlaying the new picture.
    Bug?
    Eric

    > It only works on red eye, not bright eye, steel eye, green eye, or any other color.
    How about Evil Eye? 8-}
    Actually I've had the same problem with Red Eye Removal not working properly. Problem is intermittent and the eye was for sure red.

  • Red Eye Removal not working

    I am using 1.3.1 and started out using the original version of lightroom that was released. I have really enjoyed lightroom. However, the red eye removal tool which worked when I started using lightroom is no longer working. I am having to pull all red eye corrections into "Elements" and that is annoying. When I select the red eye tool and click on the red eye all I get is a beep. I have tried clicking and dragging to select the exact size and that does not work either, just a beep. Does anyone have an answer to my problem?

    > It only works on red eye, not bright eye, steel eye, green eye, or any other color.
    How about Evil Eye? 8-}
    Actually I've had the same problem with Red Eye Removal not working properly. Problem is intermittent and the eye was for sure red.

  • Wireless network and bluetooth not working on touchsmart 600

    This has not worked since day 1 and I have been using wired internet.
    I really need to setup a home network and need to use wireless.
    Research on the net has led me to belive I should have HP WIRELESS ASSISTANT on my machine... is that correct?
    Everytime I try to download it is seem to be for a notepad... mine is a touchsmart desktop...
    Please advise  

    Hi coffee12345,
    Welcome to the HP Forums!
    I have read your post on your wireless keyboard and mouse not working with your desktop, and I would be happy to help you! To begin, I need to ask you a few introductory questions:
    What is the Product and Model Number of your desktop?
    What version of Windows are you using?
    Is this a recent issue, or has it been like this since day one?
    Are you using a USB hub to connect your peripherals or is it directly plugged into the computer?
    Please re-post with the necessary information, and I look forward to your reply!
    Regards
    MechPilot
    I work on behalf of HP
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos, Thumbs Up" on the right to say “Thanks” for helping!

  • My Ipod touch 4th generation is not working, its frozen, ive tried everything and its not working, its just frozen on an app and i really really need HELP!!!

    My Ipod is frozen!!! Its a 4th generation and its frozen on an app, Ive tried everything like holding down the lock screen and stuff and its not showing the red thing to slid to shut it down....This is my only thing to use to contact my friends and its not working, i dont have a phone and i cant get one, so this is the onlything i have.....PLEASE HELP!!!

    Try:
    - iOS: Not responding or does not turn on
    - Also try DFU mode after try recovery mode
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings
    - If not successful and you can't fully turn the iOS device fully off, let the battery fully drain. After charging for an least an hour try the above again.
    - Try on another computer
    - If still not successful that usually indicates a hardware problem and an appointment at the Genius Bar of an Apple store is in order.
    Apple Retail Store - Genius Bar       

  • How can I get my itunes onto my new laptop? Do I need to download itunes again or can I just copy it? My ipod classic has since been soaked in water and does not work so I cannot copy from there. Can anyone help?

    How can I get my itunes onto my new laptop? Do I need to download itunes again or can I just copy it? My ipod classic has since been soaked in water and does not work so I cannot copy from there. Can anyone help?

    You should copy everything from your old comptuer to your new one.

Maybe you are looking for

  • Problem with tcode FMCACOV "No valid configuration found"

    Hi experts i'm trying to prove this transaction: Tcode FMCACOV (program FMCA_COV) "Business Partner Overview" the system spits out this message: "No valid configuration found" Message no. FMCA_COV004 can you help me? thanks!

  • Is there a way to change the ThreadPoolSize of Weblogic 6.1?

     

  • Installing CS6 upgrade on 2 computers....

    Hello I currently run CS5.5 Design Premium on my mac, which I am thinking of also installing on my macbook so I can work away from the desk (which i think I can do, looking at the end-user agreement??). I'm also thinking of upgrading to CS6 - as this

  • Define a single scope for two Custom Lists

    Hi, I have ran into a requirement where i have to create a single scope for two lists 'Employee' and 'Department' . I tried creating individual scopes and they came up in the scope drop down . For this i gave the scope rule as below : Both lists are

  • E71 modem issue

    Hi All, I am from Delhi and I am having connection of Airtel . Today i updated my PC Suite to version 7.1.30.9 . Now when I connect to Internet using USB modem it connects at a speed of 115 kbps max and say 'Nokia E71 USB Modem (OTA)' connected. Spee