Package com.nr.ran

Examples of com.nr.ran.Hashfn2


      chart[i].atomicmass=atmass[i];
      chart[i].name=atname[i];
    }

    Hashtable<atom> hash = new Hashtable<atom>(N,2*N){
      Hashfn2 hashfn2 = new Hashfn2();
      public long fn(atom k) {
       
        return hashfn2.fn(k.toByte());
      }
    };
   
    // Test simple iset(), iget()
    i=hash.iset(chart[5]);
View Full Code Here


    // Test Mhash
    System.out.println("Testing Mhash");

    //Mhash<int,string,Hashfn2> person(100,100);
    Mhash<Integer,String> person = new Mhash<Integer,String>(100,100){
      Hashfn2 hashfn2 = new Hashfn2();
      public long fn(Integer k){
        int kk = k;
        byte[] b = new byte[4];
        b[0] = (byte)(kk >>>24);
        b[1] = (byte)(kk >>>16);
        b[2] = (byte)(kk >>>8);
        b[3] = (byte)kk;
       
        return hashfn2.fn(b);
      }
    };

    for (i=0;i<N;i++) person.store(dates[i],names[i]);
View Full Code Here

    // Test Hash
    System.out.println("Testing Hash");

    Hash<String,Integer> year = new Hash<String,Integer>(100,100){
      Hashfn2 hashfn2 = new Hashfn2();
      public long fn(String k){
        return hashfn2.fn(k.getBytes());
      }
    };

    // Test operator[]
    for (i=0;i<N;i++)
View Full Code Here

TOP

Related Classes of com.nr.ran.Hashfn2

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.