org.eclipse.net4j.util.security
Class Randomizer

java.lang.Object
  extended by org.eclipse.net4j.util.event.Notifier
      extended by org.eclipse.net4j.util.lifecycle.Lifecycle
          extended by org.eclipse.net4j.util.security.Randomizer
All Implemented Interfaces:
INotifier, INotifier.Introspection, ILifecycle, ILifecycle.Introspection, IRandomizer

public class Randomizer
extends Lifecycle
implements IRandomizer


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.eclipse.net4j.util.lifecycle.ILifecycle
ILifecycle.Introspection
 
Nested classes/interfaces inherited from interface org.eclipse.net4j.util.event.INotifier
INotifier.Introspection
 
Field Summary
static java.lang.String ALGORITHM_SHA1PRNG
           
static java.lang.String DEFAULT_ALGORITHM_NAME
           
 
Fields inherited from class org.eclipse.net4j.util.lifecycle.Lifecycle
USE_LABEL
 
Constructor Summary
Randomizer()
           
 
Method Summary
protected  void doActivate()
           
protected  void doBeforeActivate()
           
protected  void doDeactivate()
           
 byte[] generateSeed(int numBytes)
           
 java.lang.String getAlgorithm()
           
 java.lang.String getAlgorithmName()
           
 java.lang.String getProviderName()
           
 boolean nextBoolean()
           
 void nextBytes(byte[] bytes)
           
 double nextDouble()
           
 float nextFloat()
           
 double nextGaussian()
           
 int nextInt()
           
 int nextInt(int n)
           
 long nextLong()
           
 java.lang.String nextString(int length, java.lang.String alphabet)
           
 void setAlgorithmName(java.lang.String algorithmName)
           
 void setProviderName(java.lang.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, deferredDeactivate, doBeforeDeactivate, dump, getLifecycleState, isActive, isDeferredActivation, isDeferredDeactivation, toString
 
Methods inherited from class org.eclipse.net4j.util.event.Notifier
addListener, fireEvent, getListeners, hasListeners, removeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ALGORITHM_SHA1PRNG

public static final java.lang.String ALGORITHM_SHA1PRNG
See Also:
Constant Field Values

DEFAULT_ALGORITHM_NAME

public static final java.lang.String DEFAULT_ALGORITHM_NAME
See Also:
Constant Field Values
Constructor Detail

Randomizer

public Randomizer()
Method Detail

getAlgorithmName

public java.lang.String getAlgorithmName()

setAlgorithmName

public void setAlgorithmName(java.lang.String algorithmName)

getProviderName

public java.lang.String getProviderName()

setProviderName

public void setProviderName(java.lang.String providerName)

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 java.lang.String getAlgorithm()

nextBytes

public void nextBytes(byte[] bytes)
Specified by:
nextBytes in interface IRandomizer

nextString

public java.lang.String nextString(int length,
                                   java.lang.String alphabet)
Specified by:
nextString in interface IRandomizer

setSeed

public void setSeed(byte[] seed)

setSeed

public void setSeed(long seed)

doBeforeActivate

protected void doBeforeActivate()
                         throws java.lang.Exception
Overrides:
doBeforeActivate in class Lifecycle
Throws:
java.lang.Exception

doActivate

protected void doActivate()
                   throws java.lang.Exception
Overrides:
doActivate in class Lifecycle
Throws:
java.lang.Exception

doDeactivate

protected void doDeactivate()
                     throws java.lang.Exception
Overrides:
doDeactivate in class Lifecycle
Throws:
java.lang.Exception

Copyright (c) 2004 - 2008 Eike Stepper, Germany.
All Rights Reserved.