Java HashMap

Has anyone ever created a ldif file through a HashMap algorithm? I have written the code to read in the text files for the rules and data. I am having trouble getting the hash to work, my code is based off of the examples from Sun. Any ideas would be greatly appreciated Thanks.

Comments


  • What code do you want ?
    bashiro

    : Has anyone ever created a ldif file through a HashMap algorithm? I have written the code to read in the text files for the rules and data. I am having trouble getting the hash to work, my code is based off of the examples from Sun. Any ideas would be greatly appreciated Thanks.
    :

  • Anything that shows using a HashMap to compare 2 files, unless there is some JAR or API for this.

    :
    : What code do you want ?
    : bashiro
    :
    : : Has anyone ever created a ldif file through a HashMap algorithm? I have written the code to read in the text files for the rules and data. I am having trouble getting the hash to work, my code is based off of the examples from Sun. Any ideas would be greatly appreciated Thanks.
    : :
    :
    :

  • I am not sure if I understand your expression correctly.
    But the java HashMap is located in the Java Utilily Package
    example:

    [code]
    import java.util.*

    // you create an instance
    HashMap somename = new HashMap

    //using chemicals as an example
    //[red]you use a key to store a variable and then use the key to get
    // it back. The key word to store is "put".So here if you use
    ca which is calcium as key and then Calcium as the rest of the body,

    you then ask the user to enter the key which is ca.
    You use the ca to "get" the rest.
    You use the key word "remove " to delete.

    [/red]
    public class Example
    {
    public static void main( String[] args )
    {
    HashMap chemicals = new HashMap();
    chemicals.put( "Ca", "Calcium" );
    chemicals.put( "Au", "Gold" );
    chemicals.put( "He", "Helium" );

    [blue]
    System.out.println( "Enter what you want to find:" );

    String s = keyboard.readin();
    // is the same as comparing
    if (Chemicals.Contains (s)){
    chemicals.get(s)
    }

    [/blue]
    System.out.println( "Au means " + chemicals.get( "Au" ) );
    }
    }


    [/code]
    NB:
    HashMap is VERY VERY EASY to use. In the beguining it will seem
    complex but if you take your time to understand, you will see it's easy.
    [red]
    I will suggest you download Brce Eckels free electronic book he has illustrated the use of HashMap.
    http://64.78.49.204/[/red]

    You can use HashMap to do a lot of things.
    Go here and see an example of a Dictionay or Translation and study the codes
    http://www.eli.sdsu.edu/courses/spring99/cs535/notes/translator/translator.html

    I have an example of Student register, Cd collections, etc. If you want I can send it to you to study.

    Hop this helps

    bashiro


    : Anything that shows using a HashMap to compare 2 files, unless there is some JAR or API for this.
    :
    : :
    : : What code do you want ?
    : : bashiro
    : :
    : : : Has anyone ever created a ldif file through a HashMap algorithm? I have written the code to read in the text files for the rules and data. I am having trouble getting the hash to work, my code is based off of the examples from Sun. Any ideas would be greatly appreciated Thanks.
    : : :
    : :
    : :
    :
    :

  • Thank you this helps tons, I know this is a newby question, I just never used a HashMap, I have always used an array. Thanks again.

    : I am not sure if I understand your expression correctly.
    : But the java HashMap is located in the Java Utilily Package
    : example:
    :
    : [code]
    : import java.util.*
    :
    : // you create an instance
    : HashMap somename = new HashMap
    :
    : //using chemicals as an example
    : //[red]you use a key to store a variable and then use the key to get
    : // it back. The key word to store is "put".So here if you use
    : ca which is calcium as key and then Calcium as the rest of the body,
    :
    : you then ask the user to enter the key which is ca.
    : You use the ca to "get" the rest.
    : You use the key word "remove " to delete.
    :
    : [/red]
    : public class Example
    : {
    : public static void main( String[] args )
    : {
    : HashMap chemicals = new HashMap();
    : chemicals.put( "Ca", "Calcium" );
    : chemicals.put( "Au", "Gold" );
    : chemicals.put( "He", "Helium" );
    :
    : [blue]
    : System.out.println( "Enter what you want to find:" );
    :
    : String s = keyboard.readin();
    : // is the same as comparing
    : if (Chemicals.Contains (s)){
    : chemicals.get(s)
    : }
    :
    : [/blue]
    : System.out.println( "Au means " + chemicals.get( "Au" ) );
    : }
    : }
    :
    :
    : [/code]
    : NB:
    : HashMap is VERY VERY EASY to use. In the beguining it will seem
    : complex but if you take your time to understand, you will see it's easy.
    : [red]
    : I will suggest you download Brce Eckels free electronic book he has illustrated the use of HashMap.
    : http://64.78.49.204/[/red]
    :
    : You can use HashMap to do a lot of things.
    : Go here and see an example of a Dictionay or Translation and study the codes
    : http://www.eli.sdsu.edu/courses/spring99/cs535/notes/translator/translator.html
    :
    : I have an example of Student register, Cd collections, etc. If you want I can send it to you to study.
    :
    : Hop this helps
    :
    : bashiro
    :
    :
    : : Anything that shows using a HashMap to compare 2 files, unless there is some JAR or API for this.
    : :
    : : :
    : : : What code do you want ?
    : : : bashiro
    : : :
    : : : : Has anyone ever created a ldif file through a HashMap algorithm? I have written the code to read in the text files for the rules and data. I am having trouble getting the hash to work, my code is based off of the examples from Sun. Any ideas would be greatly appreciated Thanks.
    : : : :
    : : :
    : : :
    : :
    : :
    :
    :

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories