Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Re: Java compatibility issues (WAS: MF having issues?)
Oliver Wong wrote:

Hey I have looked at rudimentaries - I knew Map = Dictionary :-)

Now I understand your 'Pairs' concept, your examples of 'doubles',
'triples' etc., that would work in the M/F dictionary class; and the J4
proposed KeyedCollection.

Mind you - if you think about it, the most logical thing is to have
names/descriptors as Dictionary Keys. I can't see you get much mileage
asking a dictionary "Do you have an element with a Key '12345' ?
There are several methods which pick up on the data, but I have never
used them.

One possibility -  use a callback/iterator against the whole collection
automatically checking each element. Then terminate with
'quitIteration', when you have found what you want.

My prime interest was converting data files written in RM/COBOL to
either M/F Files or SQL Tables. As part of 'normalization' I wanted to
get rid of duplicate descriptors stored in 700 data sets, (very small
volumes each, 20 - 30 entries). Example :

Gas Plant A - System 123 - Gas Scrubber
Gas Plant B - System 456 - Gas Scrubber

Using mnemonic codes in the DB Table, GS = Gas Scrubber - build
Dictionary from existing codes in the DB Table and as I read in each RM
entry do a look-up : (1) If found use new "GS" code, or (2) add a new
code to the Dictionary and write it to the DB Table - the M/F
files/Tables written for Plants A and B above contain the new mnemonics.

TOP POST - no more

Jimmy
>
> "James J. Gavan" <jgavandeletethis@shaw.ca> wrote in message
> news:uJNPf.128728$B94.114109@pd7tw3no...
> 
>
>
>    Yes, I meant something different.
>
>    In Java as well, you can't have a dictionary (though it's called a
> "Map" in Java) where two objects have the same key. I was saying you
> could "fake" it by having a "Pair" object whose sole purpose is to
> contain references to the two objects you *do* want to store.
>
> Key --> Data
> 123    (Hot, Cold)
> 124    (push, pull)
> 125    (stop, go)
> etc.
>
> The idea is that only one object, the "pair" object, is associate with a
> given key. But the pair object is like a collection whose size is
> guaranteed to always be 2. Obviously, you can extend this idea if you
> wanted to simulate 3 objects per key:
>
> Key --> Data
> 123   (Hot, Warm, Cold)
> 124   (push, rest, pull)
> 125   (red, green, blue)
> etc.
>
>    - Oliver

Report this thread to moderator Post Follow-up to this message
Old Post
James J. Gavan
03-09-06 11:55 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Cobol archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 05:23 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.