Package java.util

Examples of java.util.Random.nextLong()


        } else {
          final int n2 = random.nextInt(3);
          if (n2 == 1) {
            random.nextInt();
          } else if (n2 == 2) {
            random.nextLong();
          }
          if (LuceneTestCase.VERBOSE) {
            System.out.println("MockRandomCodec: variable-gap terms index (divisor=" + state.termsIndexDivisor + ")");
          }
          indexReader = new VariableGapTermsIndexReader(state.directory,
View Full Code Here


            response.setStatus(HttpServletResponse.SC_OK);
        }
        else
        {
            Random rand = getRandom(session);
            id = String.valueOf(rand.nextLong());
            session.setAttribute(ATTR_ID, id);
            session.setAttribute(ATTR_SASL_SERVER, saslServer);
            session.setAttribute(ATTR_EXPIRY, System.currentTimeMillis() + SASL_EXCHANGE_EXPIRY);

            response.setStatus(HttpServletResponse.SC_OK);
View Full Code Here

         Random rnb = new Random(12345);

         int numGenerated = 1;
         while (numGenerated <= numRandom)
         {
            long ran = rnb.nextLong() & bitMask;
            if (assci)
            {
               // printable ASCII values fall [33-126] range (except whitespace).
               if ((numGenerated < 33) || (numGenerated > 126))
                  continue;
View Full Code Here

   @Test
   public void testDuplicateTaggedTasks()
   {
      Random rand = new Random();
      long tag = Math.abs(rand.nextLong());

      testDuplicateTasks(tag, tag, true);
   }

   @Test
View Full Code Here

   @Test
   public void testNonDuplicateTaggedTasks()
   {
      Random rand = new Random();
      long tag1 = Math.abs(rand.nextLong());
      long tag2 = Math.abs(rand.nextLong());

      testDuplicateTasks(tag1, tag2, false);
   }
View Full Code Here

   @Test
   public void testNonDuplicateTaggedTasks()
   {
      Random rand = new Random();
      long tag1 = Math.abs(rand.nextLong());
      long tag2 = Math.abs(rand.nextLong());

      testDuplicateTasks(tag1, tag2, false);
   }

   @Test
View Full Code Here

  {

    Checkpoint cp = new Checkpoint();
    cp.setConsumptionMode(DbusClientMode.ONLINE_CONSUMPTION);
    Random r = new Random(System.currentTimeMillis());
    long scn = r.nextLong();

    cp.setWindowScn(scn);
    cp.setWindowOffset(-1);
    try
    {
View Full Code Here

            }

            long millis = randomMillis(rnd);
            int value = rnd.nextInt(200) - 100;
            // millis2 is used for difference tests.
            long millis2 = millis + rnd.nextLong() % _1000_YEARS - _500_YEARS;

            try {
                testFields(millis, value, millis2);
            } catch (RuntimeException e) {
                System.out.println("Failure index: " + i);
View Full Code Here

   * @param probe    which probe
   * @return The hashes for the given probe
   */
  public long hashForProbe(int category, int probe) {
    Random hash = new Random(seed + category);
    long r = hash.nextLong();
    for (int i = 0; i < probe; i++) {
      r = hash.nextLong();
    }
    return r;
  }
View Full Code Here

   */
  public long hashForProbe(int category, int probe) {
    Random hash = new Random(seed + category);
    long r = hash.nextLong();
    for (int i = 0; i < probe; i++) {
      r = hash.nextLong();
    }
    return r;
  }

  public void addToVector(int category, Vector data) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.