Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (101)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (309)
Collections:
Other Resources:
commons-lang-2.6.jar - Apache Commons Lang
commons-lang-2.6.jar is the JAR file for Apache Commons Lang 2.6, which provides a host of helper utilities for the java.lang API.
JAR File Size and Download Location:
File name: commons-lang-2.6.jar File size: 284220 bytes Date modified: 01/13/2011 Download: Apache Commons Lang Website
✍: FYIcenter
⏎ org/apache/commons/lang/math/RandomUtils.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.commons.lang.math; import java.util.Random; /** * <p><code>RandomUtils</code> is a wrapper that supports all possible * {@link java.util.Random} methods via the {@link java.lang.Math#random()} * method and its system-wide <code>Random</code> object. * * @author Gary D. Gregory * @since 2.0 * @version $Id: RandomUtils.java 906320 2010-02-04 01:41:10Z sebb $ */ public class RandomUtils { /** * An instance of {@link JVMRandom}. */ public static final Random JVM_RANDOM = new JVMRandom(); // should be possible for JVM_RANDOM? // public static void nextBytes(byte[]) { // public synchronized double nextGaussian(); // } /** * <p>Returns the next pseudorandom, uniformly distributed int value * from the Math.random() sequence.</p> * <b>N.B. All values are >= 0.<b> * @return the random int */ public static int nextInt() { return nextInt(JVM_RANDOM); } /** * <p>Returns the next pseudorandom, uniformly distributed int value * from the given <code>random</code> sequence.</p> * * @param random the Random sequence generator. * @return the random int */ public static int nextInt(Random random) { return random.nextInt(); } /** * <p>Returns a pseudorandom, uniformly distributed int value * between <code>0</code> (inclusive) and the specified value * (exclusive), from the Math.random() sequence.</p> * * @param n the specified exclusive max-value * @return the random int */ public static int nextInt(int n) { return nextInt(JVM_RANDOM, n); } /** * <p>Returns a pseudorandom, uniformly distributed int value * between <code>0</code> (inclusive) and the specified value * (exclusive), from the given Random sequence.</p> * * @param random the Random sequence generator. * @param n the specified exclusive max-value * @return the random int */ public static int nextInt(Random random, int n) { // check this cannot return 'n' return random.nextInt(n); } /** * <p>Returns the next pseudorandom, uniformly distributed long value * from the Math.random() sequence.</p> * <b>N.B. All values are >= 0.<b> * @return the random long */ public static long nextLong() { return nextLong(JVM_RANDOM); } /** * <p>Returns the next pseudorandom, uniformly distributed long value * from the given Random sequence.</p> * * @param random the Random sequence generator. * @return the random long */ public static long nextLong(Random random) { return random.nextLong(); } /** * <p>Returns the next pseudorandom, uniformly distributed boolean value * from the Math.random() sequence.</p> * * @return the random boolean */ public static boolean nextBoolean() { return nextBoolean(JVM_RANDOM); } /** * <p>Returns the next pseudorandom, uniformly distributed boolean value * from the given random sequence.</p> * * @param random the Random sequence generator. * @return the random boolean */ public static boolean nextBoolean(Random random) { return random.nextBoolean(); } /** * <p>Returns the next pseudorandom, uniformly distributed float value * between <code>0.0</code> and <code>1.0</code> from the Math.random() * sequence.</p> * * @return the random float */ public static float nextFloat() { return nextFloat(JVM_RANDOM); } /** * <p>Returns the next pseudorandom, uniformly distributed float value * between <code>0.0</code> and <code>1.0</code> from the given Random * sequence.</p> * * @param random the Random sequence generator. * @return the random float */ public static float nextFloat(Random random) { return random.nextFloat(); } /** * <p>Returns the next pseudorandom, uniformly distributed float value * between <code>0.0</code> and <code>1.0</code> from the Math.random() * sequence.</p> * * @return the random double */ public static double nextDouble() { return nextDouble(JVM_RANDOM); } /** * <p>Returns the next pseudorandom, uniformly distributed float value * between <code>0.0</code> and <code>1.0</code> from the given Random * sequence.</p> * * @param random the Random sequence generator. * @return the random double */ public static double nextDouble(Random random) { return random.nextDouble(); } }
⏎ org/apache/commons/lang/math/RandomUtils.java
⇒ commons-lang-1.0.1.jar - Apache Commons Lang
⇐ What Is commons-lang3-3.1.jar
2009-12-24, 80017👍, 0💬
Popular Posts:
What Is log4j-1.2.13.jar? I got the JAR file from logging-log4j-1.2.13.zip .log4j-1.2.13.jar is the ...
Jettison is a collection of Java APIs (like STaX and DOM) which read and write JSON. This allows nea...
JasperReports, the world's most popular open source business intelligence and reporting engine and J...
What Is ojdbc8.jar for Oracle 12c R2? ojdbc8.jar for Oracle 12c R2 is the JAR files of ojdbc.jar, JD...
What Is jms.jar? I heard it's related to JMS (Java Message Service) 1.1? The if you have an jms.jar ...