Touble with HashSet

Hi,
I've been using java for a while now. I have developed a small framework for my PhD research project.
I wrote a Sphere class to hold position and radius for a given sphere and I used a HashSet to hold a bunch of spheres. Since I don't make copies of the spheres, I didn't override the hashCode and equals methods.
Now, I have a class which basically holds three HashSets of spheres, I'll call the A, B and C here. I call a method of the class which puts a bunch of spheres from A in B, then modifies all the spheres in B and finally moves the spheres from B to C (removing them from C). After that my method goes through all the spheres in C and merges some of them together. I do that by using the toArray method for the HashSet C and going through the array. I never remove spheres from A and I never create new instances. The problem now is, if i check A.containsAll(B) before I start running through the array, I get true, but if I do that right after I start the for cycle to go through the spheres in the array I get false. Also, only some of the spheres in C are not also in A.
I've been trying to figure this out for the last 2 days and I still can't. All the spheres in C should always be in A too and I don't understand what's going on. I tried to replicate my issue in a small test code but it doesn't happen there. I'm not posting any code because my framework is quite big, I'm just brainstorming now, but if anyone is interested I can post some code.
Any help would be appreciated.
Thanks

GioDude wrote:
Hi,
I've been using java for a while now. I have developed a small framework for my PhD research project.
I wrote a Sphere class to hold position and radius for a given sphere and I used a HashSet to hold a bunch of spheres. Since I don't make copies of the spheres, I didn't override the hashCode and equals methods.Then you can't put them into a HashSet. Or, at least, you are saying that no two Sphere instances are ever considered equal, even if they have the same position and radius.
If you're still stuck, provide an SSCCE.

Similar Messages

  • I'm having touble with Icloud

    Hi,
    I just got a new iphone for my birthday and I went to transfer my purchases from my ipod to my iphone. then it requested a password so I tried all the passwords I knew. I was wondering how can you find the icloud password that i set up and change it, and I tried looking at all the help with the icloud but it didn't help at all.

    that doesnt make anysense, its either you or you dont.
    lllaassThis solved my question    Re: I'm having touble with Icloud
    Mar 24, 2012 4:56 PM (in response to scooberang2)
    Do you have more than one Apple ID?
    scooberang2
    Re: I'm having touble with Iclou
    Mar 24, 2012 4:58 PM (in response to lllaass)
    no its the same id
    not rly an answer now is it

  • Touble with Internet Sharing since latest Aiport Update

    Up to yesterday I was able to share seamlessly my internet connection on my iMac using built in airport as a router. Since the last update, every time I open internet sharing is running on my iMac while connected to the internet, sharing my connection from ethernet using Airport within 30 second of my iPod been connected to my Wireless signal my internet connection die, and can no longer access the internet with my iMac or iPod. The only way to get back my internet connection is to disable internet sharing in system preference.
    AirPort Card Information:
    Wireless Card Type: AirPort Extreme (0x14E4, 0x87)
    Wireless Card Locale: Worldwide
    Wireless Card Firmware Version: Broadcom BCM43xx 1.0 (5.10.38.27)
    Current Wireless Network: Airport
    Wireless Channel: 11
    Help

    Just to be clear,
    1. You are connecting fine on your iPhone (meaning that you have the 3 bars next to your Carrier in the top left of the screen)
    2. you can't access the internet on you iPhone
    Correct?

  • Touble with TV out from my Ipod Touch

    Here's the deal. I am out of the states for a while, and I only get three english channels. So I bought some shows on itunes and I bought the A/V cable so i can watch them on my tv in my apartment. The only problem is, they start playing and about 30sec to a minute in, the show stops and the ipod touch goes back to the main video page. I tried about 3 or four different shows. I tried changing from NTSC to PAL and that doesnt do it either. It only works if I connect the iPod then turn it off and back on again. Then, like I said, it only works for 30sec to a minute or so. Anyone have any words of wisdom? I think I might return the cable today and try the cable with the usb on it as well since my tv has a usb in on it. Do I have a setting wrong, or should the iPod just recognize when its connected and start playing?

    I believe it's a firmware problem. I'm using a 3rd party TV out cable with the Apple chip. On my 32GB Touch with 2.0, video will play for 1 minute and then stop. I need to disconnect the cable and put the Touch into standby a few times before TV out will work again but then stop after 1 minute. The cable works fine on a 160GB Classic and 3rd gen 8GB Nano. I also tried it on a 8GB Touch out of the box with 1.4, the TV out cable works great. Unit wasn't mine, so can't upgrade the firmware to see if the problem occurs with 2.0.2.

  • 890fx board having touble with ethernet connection

    i own an 890 fx mother board and i am having trouble connecting to the internet through my ethernet cable. i have checked the cables to make sure they work and i have checked both of my ethernet ports neither of them work. the internet through the ports was working perfect a day ago but seems to have stopped working any thoughts guys i really dont want to rma it

    when i plug in the cable i get lights that show that it is plugged in. the devices manager shows the ethernet and they register. in my network connections it shows connection to internet however i can not connect to anything.

  • Toubles with Application 's folder

    when I install some new programs i find in Machintosh HD a new Application Folder.
    so I have 2 application Folders and I'm constrict to copy the new into the old.
    sometimes I have renamed Application Folder and I have substituted its Icon... it's possible that this trouble is due to this?

    Yes. Renaming the Applications folder will cause OS X to not have a default place to put new applications and it will re-create it, as you have discovered. My advice? Don't do this anymore. If you want to have your own folder to contain applications, just create it and put your programs in there. Just leave the Applications folder alone.
    HTH,
    ~FifthWheel

  • Plug ins are up to date but still having touble with not responding & freezing

    my plug ins are up to date. why am i still getting a mozilla not responding message and computer freezing?'''bold text'''

    I have had this problem for a few days, no sound in Firefox, but IE and WMP (offline) have sound, this is a Firefox ONLY problem, so the volumes are all set correctly and the drivers and needed files are there, I've tried every fix that people have suggested on Google like checking the flash player settings, creating the "missing.reg" registry file and importing it, etc...
    nothing works, I may just have to switch to Safari or Chrome, I watch a lot of video online (Youtube, ESPN3, NFL.com, etc.) so this is a huge problem...

  • Unable set session attribute with certain types.

    Hello I was surprise that when I execute HttpSession.setAttribute("somekey", new HashMap()), "somekey" will not be stored in the Session. I can replace HashMap with HashSet and it's okay.
              Out of curiosity, I create a Java class like below :
              public class abc implements Serializable {
              public String def = "def";
              And I have the same issue with HashMap and it will not get stored in the Session attribute. Does anyone know what kind of valid object and what makes the object storable into the Session's attribute? Any inputs are appreciated. Thanks.
              yien

    Actually never mind. It have something to do with BEA's Portal Ad services. I will post this into the appropriate forum.

  • N96 sync with PC Outlook Calendar

    I have an unlocked, unbranded N96 which has developed a problem when attempting to sync with Outlook Calendar.  I have prevously managed to get it to work using Ovi (at Home) to sync the entries in my calendar, however I also used PC Suite (at Work) to do the same thing on another PC, which worked fine.
    The problem started when I attempted to re-sync my calendar entries at home again, I installed PC Suite as it seemed easier to use.  Now many of my entries are duplicated and some have dissappeared..
    ...Basically Help!  Anyone who has had touble with this, or anyone who can suggest what action to take would be greatly appreciated.

    Hi I'd like to join in this discussion please - strangely it sounds exactly like what's happening to me at the moment
    I did make a backup the other day luckily, on my work PC (assuming I can find where I saved it of course ), but a) I'd forgotten about it, duh b) I'd still like to know what's gone wrong...
    I started off with Ovi on a laptop (out of date info) at home - sync worked fine.  Then used PC suite at work - again, worked fine and phone had all up to date info on it.  Then I installed PC suite at home so they both matched - fine, except when I sync'd I forgot to give the phone data priority so I ended up with old info again.  Silly me.  Back to work and told the PC to update the phone with calendar entries again (phew, nearly there I thought).  But it wouldn't.  It recognises the phone but doesn't update the entries.  Getting warnings - one was about loss of profile, but said you could only restore these on Communicators and one other - not mine anyway.  Latest one just says 'Microsoft Outlook'.  Very helpful eh?  So I reinstalled PC suite and switched my phone off and on again (technical approach you know, usually works if you include the odd swear word).  But it's still not updating the calendar entries. I think I've killed it

  • I cannot send texts with lion

    Since I downloaded Lion I have touble with text messages:  1.  I often can't move from the submect line to the text line. It never allows me to send. It is like it is frozen. Rebooting does not resolve it. 

    MOE33 wrote:
    I've been having the same problem as the original poster.  I updated to the new OS a few weeks ago, and the last couple of days I've been unable to text, off and on, because I can't move from the contact to the text box and the keyboard isn't appearing. 
    If this is an iPhone post in the iPhone forum, if an iPad post in the iPad forum, this forum is for OSX Lion, which runs on a Mac computer, not an iAnything.

  • IPad won't update apps after upgrading to ios8 ?

    Hello,
    I have been having touble with my apps getting updated.  This seemed to have started after I downloaded the ios 8 on my iPad.  I didn't have the problem before. I had 15 updates its now down to 8 but I have been waiting for the past 4 days for it to complete.  It keep stalling/pausing and I have to restart it.  I have tried to turn the iPad off and on.  I don't want to have to uninstall the apps and redo all of them.  Is there something wrong with my it because of the iOS 8 update?  Is there a recommendation or a resolution to solve the issue.  Thank you

    Hello ukgals,
    Thank you for Apple Support Communities.
    If you are running into issues upgrading when updating over-the-air, this article can help you resolve it. 
    Resolve issues with an over-the-air iOS update - Apple Support
    Regards,
    Jeff D. 

  • QaaWS-swf in InfoView: unstable connection

    Hallo,
    we designed a dashboard using QaaWS to connect to live data. On a local machine, the Xcelsius-swf works fine. Once I publish it to InfoView and open it online, the connection seems to be "unstable"? After several minutes (2 to 3) when I navigate the dashboard so the QaaWS has to refresh the data, I get the following error message for each QaaWS:
    soapenv:Server.generalException: Unable to reconnect to the CMS. The session has been logged off or has expired. (FWM 01002)
    After closing the dashboard, InfoView also shows an error message:
    An error has occurred: Unable to reconnect to the CMS. The session has been logged off or has expired. (FWM 01002)
    The timeout is set to 20 minutes, so this should not be the problem. Also, when I navigate through WebI, the InfoView connection stays stable. The problem seems to occur only when swfs, using QaaWS are opened.
    Any suggestions what to do to keep the connection alive would be highly appreciated.
    Thanks in advance!

    Hi Kevin,
    I have been having touble with Xcelsius and had seen a similar error to this. I was accessing through BI Widgets and the application was shutting down. I was also getting the same error, but had assumed the problem was with my server.
    We reinstalled and created a new BOE environment and created a simple qaaws application. This ran fine updating 12 times a minute. At this point I closed the issue I had raised with the SAP/BO, concentrating on the other issues.
    However, after I recreated my original dashboard, I found the problem reoccurred. The default session timeout was 1 minute. What I found was that I could get around the problem by refreshing the qaaws query more frequently than that. As my data was only really updating every 15 minutes this resulted in a lot of unncessary queries to the database but at least the user was not seeing the error
    I then looked at creating the query through live office, as I noticed the a second dashobard I had created with Live Office did not seem to be suffering the same problem. I was able to get this working without the session time out and the high number of database queries.
    I realise these are more workarounds the fixes but I hope it helps
    Regards
    Alan

  • Oracle 8i on linux 6.2

    I'm trying to install Oracle 8.1.5 on Red Hat Linux 6.2
    After installing and config JRE with symbolic Link when i try to run ./runInstaller
    I get foll. error
    Initializing JVM from /usr/local/jre/bin/jre Please wait....
    Error in CreateOUTProcess():-1
    :Permission denied
    Can anyone throw some light
    Cheers !!!
    Nitin

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by e9601497 ([email protected]):
    8i seems to be very buggy on Linux. I had several toubles with RedHat and 8i.
    I'm using 8i R2 now and most of my problems seem to be fixed.
    To get rid of your problem try the following: Change to directory ......./install/linux (or something like that) and run ./runIns.sh (./runinstaller is in the same dir). This should work.
    Hans<HR></BLOCKQUOTE>
    Thanks for imm reply
    But i've tried running ......./install/linux
    ./runIns.h aswell but it doesn't shows any products in the OUI and rather shows Deinstall Products on the button below.
    what could be the reason
    Cheers !!!
    Nitin
    null

  • All of a Sudden Getting Jagged Images in InDesign 5.5

    Hello,
    Saw an earlier thread with someone having touble with placed images that were jagged, but that thread didn't help.
    I'm using InDesign 5.5. Just completed an ePub project with a placed .jpg from Photoshop and had no problems at all. Went to repeat the process with a second ePub project and suddenly I'm getting placed images that are jagged. The fonts especially look horrible. I haven't done anything different that I'm aware of with the second file. Same relative file size. I flatten the image in Photoshop and then save it as a .jpg. It looks perfect in Photoshop. No jaggies. Then place in InDesign and yuck. I have the display performance settings on High. Thinking it might just be a display problem, I export to ePub. Jaggies still there. Even tried with a TIFF. No difference. Just in case the one InDesign file had become corrupt, I opened a new file, layed it out and placed again, and it didn't help. Image still jagged.
    What gives? Why would one file place perfectly and the other poorly?

    GoldCountry86 wrote:
    When you say place at 100% how you mean? I didn't think it mattered since it was going to ePub anyway. I used Cmd + D, click on the page in ID, the image loads. I only resize it on the page  for my own benefit in layout.
    I mean you don't want to scale the image in ID. The pixel dimensions of the saved image should be the same as the number of pixles required to place the image at the intended size and resolution. When you scale, you are either throwing away pixels or make up new ones by interpolation. Your epub is basically just a web page, and it doesn't care about the resolution of your image, just how many pixels are in it. Any non-vertical or non-horizontal line must be made by stair-stepping around pixel edges -- you can't use half a pixel -- and the more pixels you have available for that stair, the less jagged the appearance will be on screen.

  • Miracast on Q10

    Hi all,
    I have a problem to connect to an Netgear PTV3000 by Miracast. After the installation and updating (the adapter) I can't see the adapter in the miracast-menu of the Q10.
    The menu on the TV-screen ist ok, the devices are in same network...
    Does anyone have suggestions or notes?
    Need some help... ;-(
    Thanks!

    Hello, 
    I use the PTV3000 too and updated it today with 2.4.26.  I rebooted my Z30 and then I saw the PTV3000. My other problem is that I can not use the PTV3000 within my 5 Ghz wifi because I read the Netgear or BlackBerry had some touble with miracast and channels above 40 in this bandwith. Can someone here confirm that. Does a fix come with the next 10.2 update?

Maybe you are looking for