Package org.eclipse.net4j.util.security

# Class Randomizer

java.lang.Object
org.eclipse.net4j.util.event.Notifier
org.eclipse.net4j.util.lifecycle.Lifecycle
org.eclipse.net4j.util.security.Randomizer

All Implemented Interfaces:
  `INotifier`, `INotifier.INotifier2`, `IDeactivateable`, `ILifecycle`, `ILifecycle.DeferrableActivation`, `IRandomizer`

public class Randomizer extends Lifecycle implements IRandomizer

Author:
  Eike Stepper

## Nested Class Summary

## Nested classes/interfaces inherited from class org.eclipse.net4j.util.event.Notifier

`Notifier.Cancelation`

## Nested classes/interfaces inherited from interface org.eclipse.net4j.util.lifecycle.ILifecycle

`ILifecycle.DeferrableActivation`

## Nested classes/interfaces inherited from interface org.eclipse.net4j.util.event.INotifier

`INotifier.INotifier2`

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`ALGORITHM_SHA1PRNG`
`static final String`
`DEFAULT_ALGORITHM_NAME`

### Fields inherited from class org.eclipse.net4j.util.lifecycle.Lifecycle

`USE_LABEL`

## Constructor Summary

Constructors
Constructor
Description
`Randomizer()`

## Method Summary

Modifier and Type
Method
Description
`protected void`
`doActivate()`
`protected void`
`doBeforeActivate()`
`protected void`
`doDeactivate()`
`byte[]`
`generateSeed(int numBytes)`
`String`
`getAlgorithm()`
`String`
`getAlgorithmName()`
`String`
`getProviderName()`
`boolean`
`nextBoolean()`
`void`
`nextBytes(byte[] bytes)`
`double`
`nextDouble()`
`float`
`nextFloat()`
`double`
`nextGaussian()`
`int`
`nextInt()`
`int`
`nextInt(int n)`
`long`
`nextLong()`
`String`
`nextString(int length, String alphabet)`
`void`
`setAlgorithmName(String algorithmName)`
`void`
`setProviderName(String providerName)`
`void`
`setSeed(byte[] seed)`
`void`
`setSeed(long seed)`

### Methods inherited from class org.eclipse.net4j.util.lifecycle.Lifecycle

`activate, checkActive, checkArg, checkArg, checkInactive, checkNull, checkState, checkState, deactivate, deferredActivate, doAfterActivate, doBeforeDeactivate, dump, getLifecycleState, isActive, isDeferredActivation, toString`

### Methods inherited from class org.eclipse.net4j.util.event.Notifier

`addListener, addUniqueListener, fireEvent, fireEvent, fireEvent, fireThrowable, firstListenerAdded, getListeners, getNotificationService, hasListener, hasListeners, lastListenerRemoved, listenerAdded, listenerRemoved, removeListener`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface org.eclipse.net4j.util.event.INotifier

`addListener, getListeners, hasListeners, removeListener`

## Field Details

### ALGORITHM_SHA1PRNG

public static final String ALGORITHM_SHA1PRNG

See Also:
  - Constant Field Values

### DEFAULT_ALGORITHM_NAME

public static final String DEFAULT_ALGORITHM_NAME

See Also:
  - Constant Field Values

## Constructor Details

### Randomizer

public Randomizer()

## Method Details

### getAlgorithmName

public String getAlgorithmName()

### setAlgorithmName

public void setAlgorithmName(String algorithmName)

### getProviderName

public String getProviderName()

### setProviderName

public void setProviderName(String providerName)

### setSeed

public void setSeed(byte[] seed)

### setSeed

public void setSeed(long seed)

### nextBoolean

public boolean nextBoolean()

Specified by:
  `nextBoolean` in interface `IRandomizer`

### nextDouble

public double nextDouble()

Specified by:
  `nextDouble` in interface `IRandomizer`

### nextFloat

public float nextFloat()

Specified by:
  `nextFloat` in interface `IRandomizer`

### nextGaussian

public double nextGaussian()

Specified by:
  `nextGaussian` in interface `IRandomizer`

### nextInt

public int nextInt()

Specified by:
  `nextInt` in interface `IRandomizer`

### nextInt

public int nextInt(int n)

Specified by:
  `nextInt` in interface `IRandomizer`

### nextLong

public long nextLong()

Specified by:
  `nextLong` in interface `IRandomizer`

### generateSeed

public byte[] generateSeed(int numBytes)

Specified by:
  `generateSeed` in interface `IRandomizer`

### getAlgorithm

public String getAlgorithm()

### nextBytes

public void nextBytes(byte[] bytes)

Specified by:
  `nextBytes` in interface `IRandomizer`

### nextString

public String nextString(int length, String alphabet)

Specified by:
  `nextString` in interface `IRandomizer`

### doBeforeActivate

protected void doBeforeActivate() throws Exception

Overrides:
  `doBeforeActivate` in class `Lifecycle`
Throws:
  `Exception`

### doActivate

protected void doActivate() throws Exception

Overrides:
  `doActivate` in class `Lifecycle`
Throws:
  `Exception`

### doDeactivate

protected void doDeactivate() throws Exception

Overrides:
  `doDeactivate` in class `Lifecycle`
Throws:
  `Exception`