octavyn

Greenhorn
+ Follow
since Jun 22, 2000
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 octavyn

From your discussion, I assume you know about Maps. There is a technique for handling multi-maps in Java, described at the bottom of the page in the following link:
http://www.java.sun.com/docs/books/tutorial/collections/interfaces/map.html
I used this technique a bit and it is actually pretty quick. The author in the tutorial describes his performance as actually quite good for a list of 80,000 dictionary entries and an alphabetizing method utilizing the multimap. It sounds like it could work for your problem quite well, given that I doubt your lists will be very big judging from your example.
The tree could be useful if you needed things sorted in particular orders, but it doesn't sound like that is an issue for you.
Maybe this will help :-)
Octavyn
23 years ago
I am not real solid on this, but with the Collections interface can't you implement a hashmap, for example, and then use an ObjectOutputStream linked to a FileOutputStream to write the hashmap to a file and then reverse it with an ObjectInputStream linked to a FileInputStream to re-instantiate that data at a later time? Here is a snippet of code I found in the Collections tutorial at Javasoft regarding this:

import java.io.*;
import java.util.*;
public class serial1 {
public static void main(String args[]) {
Map hm = new HashMap();
hm.put("Mary", "123-4567");
hm.put("Larry", "234-5678");
hm.put("Mary", "456-7890");
hm.put("Felicia", "345-6789");
try { FileOutputStream fos = new FileOutputStream("test.ser"); ObjectOutputStream oos = new ObjectOutputStream(fos); oos.writeObject(hm);
oos.close();
}
catch (Throwable e) {
System.err.println(e);
}
}
}

import java.io.*;
import java.util.*;
public class serial2 {
public static void main(String args[]) {
Map hm = null;
try { FileInputStream fis = new FileInputStream("test.ser"); ObjectInputStream ois = new ObjectInputStream(fis);
hm = (Map)ois.readObject();
ois.close();
}
catch (Throwable e) {
System.err.println(e);
}
if (hm != null) {
Iterator iter = hm.entrySet().iterator();
while (iter.hasNext()) {
Map.Entry e = (Map.Entry)iter.next();
System.out.println(e.getKey() + " " + e.getValue());
}
}
}
}

--Octavyn
23 years ago
Roseanne,
I looked for your pic proving you weren't a guy, but alas no lass to see! ;-) I guess we'll have to trust you on this one. Thanks for the link, I hadn't seen the contacts page before and this is after 6 months of JavaRanch readership!
Octavyn
23 years ago
Didnt really like the Wrox book...although it attempts to cover a lot, it masquerades its true identity... a book trying to be a comprehensive guide to cutting edge technology, but really only providing lists of proposed standard XML terminology, which, while interesting and insightful, was written too early. In other words, it was written early in '98 before a lot of standards it talks about have been codified. It meanders pleasantly enough through topics, but fails to unify and simplify what is really going on.
In general I like Wrox publications, but this one seemed to jump the gun and maybe there were too many authors?
8-o
Thanks to all for their useful info in this forum and particularly this question strain.
Regarding the prescrawled paper, you are allowed a blank piece of paper when you sit down at the terminal to take the exam. As I sat down, I took a few minutes to write down some things I did not want to forget. I diagrammed the Layouts to cover any width changing but height not changing questions; I wrote two or three ways to process events (adapter, separate listener class, anon listener class, same listener class); I noted those key things to watch out for that I constantly overlooked on mock exams ( my own pitfall were static methods calling instance variables/methods and the
int i; while (int) {} trap ). I also wrote down the number I needed to get right just to keep focussed!!
Regarding the usefulness of prep techniques, I will post another posting to cover that topic as I want to keep the subject headings of the postings clear.
My sympathies Sankar!! I actually had only 2 minutes to spare after reviewing my answers but I could have easily been in your shoes. Congrats on passing!!
Octavyn
This site helped me up to 20%. Primarily in motivation and also it made me realize the obfuscated questions the SCJP test may ask about details in Java I wouldn't necessarily know as a Java programmer but would need to memorize for the test.
I was a bit lax prior to coming to this site. . .
(Great job all!)
Octavyn
Passed the test yesterday and am much obliged to all you helpful posters out there at the Ranch. This site motivated me to get in gear and go for it.
With that said, I wanted to vent about something I was not expecting during the exam . . . Sun solicitations! I had my one piece of paper nice and pre-scrawled in preparation, I had opened up my candy bar (er, power bar), had psyched myself appropriately to endure the grueling 2 hours ahead and clicked the 'start' button. . . and there, much to my surprise as the clock started ticking, was the first question (which I won't print here), basically asking me through a lot of legalize if I enabled the testing center and SUN and perhaps trusted partners to communicate about this and that about my test blah, blah, blah. After getting over the shock of having this occur *during* the timed test, I said 'ok' because the only other option was to contact SUN directly -- fat chance.
So I said to myself, "That stunk . . . but oh well. . ." on to the rest of the test, when # 2 (of 61) was another question asking whether I wanted to have material sent to me by SUN's partners and some other marketing madness.
char [h][m][m] I thought, already out of my groove as you can well imagine.
Anyone else think that stinks? (I wouldn't mind it if it wasn't during the *timed* session of test taking -- although admittedly I had time to spare)
Glad it's over :cool,
Octavyn