Tabnine Logo
RandomUtil.randomInterval
Code IndexAdd Tabnine to your IDE (free)

How to use
randomInterval
method
in
org.apache.activemq.artemis.utils.RandomUtil

Best Java code snippets using org.apache.activemq.artemis.utils.RandomUtil.randomInterval (Showing top 20 results out of 315)

origin: wildfly/wildfly

  /**
  * Returns a pseudo random number between {@code 0} (inclusive) and {@code max} exclusive.
  *
  * @param max the upper limit of the random number selection
  * @see java.util.Random#nextInt(int)
  */
  @Override
  public int select(final int max) {
   return RandomUtil.randomInterval(0, max);
  }
}
origin: wildfly/wildfly

  /**
  * @see java.util.Random#nextInt(int)
  */
  @Override
  public int select(final int max) {
   if (pos == -1) {
     pos = RandomUtil.randomInterval(0, max);
   }

   return pos;
  }
}
origin: wildfly/wildfly

  @Override
  public int select(final int max) {
   if (first) {
     // We start on a random one
     pos = RandomUtil.randomInterval(0, max);

     first = false;
   } else {
     pos++;

     if (pos >= max) {
      pos = 0;
     }
   }

   return pos;
  }
}
origin: wildfly/wildfly

@Override
public void openBroadcaster() throws Exception {
  if (localBindPort != -1) {
   broadcastingSocket = new DatagramSocket(localBindPort, localAddress);
  } else {
   if (localAddress != null) {
     for (int i = 0; i < 100; i++) {
      int nextPort = RandomUtil.randomInterval(3000, 4000);
      try {
        broadcastingSocket = new DatagramSocket(nextPort, localAddress);
        ActiveMQClientLogger.LOGGER.broadcastGroupBindError(localAddress.toString() + ":" + nextPort);
        break;
      } catch (Exception e) {
        ActiveMQClientLogger.LOGGER.broadcastGroupBindErrorRetry(localAddress.toString() + ":" + nextPort, e);
      }
     }
   }
   if (broadcastingSocket == null) {
     broadcastingSocket = new DatagramSocket();
   }
  }
  open = true;
}
origin: apache/activemq-artemis

  /**
  * Returns a pseudo random number between {@code 0} (inclusive) and {@code max} exclusive.
  *
  * @param max the upper limit of the random number selection
  * @see java.util.Random#nextInt(int)
  */
  @Override
  public int select(final int max) {
   return RandomUtil.randomInterval(0, max);
  }
}
origin: apache/activemq-artemis

  /**
  * Returns a pseudo random number between {@code 0} (inclusive) and {@code max} exclusive.
  *
  * @param max the upper limit of the random number selection
  * @see java.util.Random#nextInt(int)
  */
  @Override
  public int select(final int max) {
   return RandomUtil.randomInterval(0, max);
  }
}
origin: apache/activemq-artemis

  /**
  * @see java.util.Random#nextInt(int)
  */
  @Override
  public int select(final int max) {
   if (pos == -1) {
     pos = RandomUtil.randomInterval(0, max);
   }

   return pos;
  }
}
origin: org.apache.activemq/artemis-jms-client-all

  /**
  * Returns a pseudo random number between {@code 0} (inclusive) and {@code max} exclusive.
  *
  * @param max the upper limit of the random number selection
  * @see java.util.Random#nextInt(int)
  */
  @Override
  public int select(final int max) {
   return RandomUtil.randomInterval(0, max);
  }
}
origin: apache/activemq-artemis

  /**
  * @see java.util.Random#nextInt(int)
  */
  @Override
  public int select(final int max) {
   if (pos == -1) {
     pos = RandomUtil.randomInterval(0, max);
   }

   return pos;
  }
}
origin: apache/activemq-artemis

  /**
  * Returns a pseudo random number between {@code 0} (inclusive) and {@code max} exclusive.
  *
  * @param max the upper limit of the random number selection
  * @see java.util.Random#nextInt(int)
  */
  @Override
  public int select(final int max) {
   return RandomUtil.randomInterval(0, max);
  }
}
origin: org.apache.activemq/artemis-core-client

  /**
  * @see java.util.Random#nextInt(int)
  */
  @Override
  public int select(final int max) {
   if (pos == -1) {
     pos = RandomUtil.randomInterval(0, max);
   }

   return pos;
  }
}
origin: org.apache.activemq/artemis-core-client

  /**
  * Returns a pseudo random number between {@code 0} (inclusive) and {@code max} exclusive.
  *
  * @param max the upper limit of the random number selection
  * @see java.util.Random#nextInt(int)
  */
  @Override
  public int select(final int max) {
   return RandomUtil.randomInterval(0, max);
  }
}
origin: apache/activemq-artemis

  /**
  * @see java.util.Random#nextInt(int)
  */
  @Override
  public int select(final int max) {
   if (pos == -1) {
     pos = RandomUtil.randomInterval(0, max);
   }

   return pos;
  }
}
origin: org.apache.activemq/artemis-jms-client-all

  /**
  * @see java.util.Random#nextInt(int)
  */
  @Override
  public int select(final int max) {
   if (pos == -1) {
     pos = RandomUtil.randomInterval(0, max);
   }

   return pos;
  }
}
origin: apache/activemq-artemis

  @Override
  public int select(final int max) {
   if (first) {
     // We start on a random one
     pos = RandomUtil.randomInterval(0, max);

     first = false;
   } else {
     pos++;

     if (pos >= max) {
      pos = 0;
     }
   }

   return pos;
  }
}
origin: org.jboss.eap/wildfly-client-all

  /**
  * Returns a pseudo random number between {@code 0} (inclusive) and {@code max} exclusive.
  *
  * @param max the upper limit of the random number selection
  * @see java.util.Random#nextInt(int)
  */
  @Override
  public int select(final int max) {
   return RandomUtil.randomInterval(0, max);
  }
}
origin: org.jboss.eap/wildfly-client-all

  /**
  * @see java.util.Random#nextInt(int)
  */
  @Override
  public int select(final int max) {
   if (pos == -1) {
     pos = RandomUtil.randomInterval(0, max);
   }

   return pos;
  }
}
origin: org.apache.activemq/artemis-core-client

  @Override
  public int select(final int max) {
   if (first) {
     // We start on a random one
     pos = RandomUtil.randomInterval(0, max);

     first = false;
   } else {
     pos++;

     if (pos >= max) {
      pos = 0;
     }
   }

   return pos;
  }
}
origin: org.apache.activemq/artemis-jms-client-all

  @Override
  public int select(final int max) {
   if (first) {
     // We start on a random one
     pos = RandomUtil.randomInterval(0, max);

     first = false;
   } else {
     pos++;

     if (pos >= max) {
      pos = 0;
     }
   }

   return pos;
  }
}
origin: apache/activemq-artemis

public static void main(String[] arg) {
 long start = Long.parseLong(arg[0]);
 try {
   Thread.sleep((start - System.currentTimeMillis()) / 2);
 } catch (Exception e) {
 }
 while (System.currentTimeMillis() < start) {
   Thread.yield();
 }
 int value;
 value = RandomUtil.randomInterval(0, 255);
 System.exit(value);
}
org.apache.activemq.artemis.utilsRandomUtilrandomInterval

Popular methods of RandomUtil

  • randomInt
  • randomLong
  • randomString
  • randomByte
  • randomBytes
  • randomPositiveInt
  • randomBoolean
  • randomDouble
  • randomSimpleString
  • randomChar
  • randomPositiveLong
  • randomFloat
  • randomPositiveLong,
  • randomFloat,
  • randomShort,
  • getRandom,
  • randomBuffer

Popular in Java

  • Making http post requests using okhttp
  • notifyDataSetChanged (ArrayAdapter)
  • getApplicationContext (Context)
  • getSharedPreferences (Context)
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now