Fredrik Komstadius

Greenhorn
+ Follow
since Mar 29, 2002
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Fredrik Komstadius

Tree is declared Entry[]Tree.
And yea, starting to see that I'm assigning invalid types to an int. Thanx for the help!
21 years ago
I have this weird problem that I can not figure out what do to with. I want to do the following thing with the help of my entry class:


The thing is that I get the following error:

incompatible types
found : BinSearchTreeArray.Entry
required: int
tree[temp].left = new Entry (o, temp);



I realise this might be a bit much for you guys to take a look at but any help would be greatly appreciated!
[ October 15, 2002: Message edited by: Fredrik Komstadius ]
[ October 15, 2002: Message edited by: Fredrik Komstadius ]
21 years ago
Thanx man! Worked like a charm!
21 years ago
Ok, I get this weird error when compiling the code. I'm really stuck here, any help would be greatly appreciated!

Incompatible type for return. Explicit cast needed to convert BinSearchTree.TreeIterator to java.util.Iterator.
return new TreeIterator();




21 years ago
Feel kind of stupid but I just wonder what do to inside the fieldEqual() ?
I.E: I can't write: MyObject.fieldEqual(NUMBER) {prinln ("test"))....
I get this error:
method fieldEquals() not found in class java.lang.Object
[ May 19, 2002: Message edited by: Fredrik Komstadius ]
21 years ago
Well, now I have tested that code you suggested and it seems to work fine, but I don't understant what you mean with:
/* use and/or return the index or object */ ?
What does this mean, I want to search each part of my vector for number and then if they are found contine..
21 years ago
Wow, thanx guys! You really helped me out here! Very much Appreciated, thanx
21 years ago
They are wrapped in an object.... So the question might be how I should search the object for the numbers
[ May 18, 2002: Message edited by: Fredrik Komstadius ]
21 years ago
Just one small question. I can't figure out how to search a vector element for one or more numbers (that the user inputs). Can't be that hard I recon, just can't figure out how. Anyone ?
I tried using: if (v.contains(1)) but that gives me an Incompatible type for method error ..
Well, gotta sleep soon Too much Java left though
21 years ago
Yes! We are talking the same now! Thank you soooo much!!! It now works!!! Wohoo
[ May 18, 2002: Message edited by: Fredrik Komstadius ]
21 years ago
Thanx for all the help! But I still can't get it to work. This is the code that creates the binary file I am reading from, it seems to work but I can't access the different elements. Though when I print an object I get this: utin@e64edf5a (element right?)
So is there anything wrong with my vector creating code or am I just not understanding correctly ? Btw: Thanx again for the help!
[ May 18, 2002: Message edited by: Fredrik Komstadius ]
[ May 18, 2002: Message edited by: Fredrik Komstadius ]
21 years ago
Well, I guess that answers it. But I don't really understand. I have used this:
Objectnamne = v.elementAt(1);
That should make Objectname the object at element 1 right? Now what how do I access the parts in the object. I have a part in the object that has the name: address but I can't seem to get to it... adress.Objectname (or Objectname.adress) doesn't work... .. any Ideas ?
[ May 18, 2002: Message edited by: Fredrik Komstadius ]
21 years ago
Ok, here's my problem... I have a vector that contains objects. Ho exactly shall I do to get to read from the elements in the objects... elementAt() just gives me the objects name I want to see the content in the objects...
Help would be very appreciated!
Here's my code so far:

[ May 18, 2002: Message edited by: Fredrik Komstadius ]
[ May 18, 2002: Message edited by: Dirk Schreckmann ]
21 years ago
I'm trying to search a Vector for some numbers. My program compiles all ok but when running it gives me a ClassCastException... How can I fix this? Would really really appreciate some help

(edited by Cindy to fix formatting)
[ April 14, 2002: Message edited by: Cindy Glass ]
21 years ago
Thanx for the info! I really needed that!
21 years ago