org.apache.sshd.common.random
Class SingletonRandomFactory
java.lang.Object
org.apache.sshd.common.random.SingletonRandomFactory
- All Implemented Interfaces:
- Factory<Random>, NamedFactory<Random>, Random
public class SingletonRandomFactory
- extends Object
- implements Random, NamedFactory<Random>
A random factory wrapper that uses a single random instance.
The underlying random instance has to be thread safe.
- Author:
- Apache MINA SSHD Project
Method Summary |
Random |
create()
Create a new instance |
void |
fill(byte[] bytes,
int start,
int len)
Fill part of bytes with random values. |
String |
getName()
Name of this factory |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SingletonRandomFactory
public SingletonRandomFactory(NamedFactory<Random> factory)
fill
public void fill(byte[] bytes,
int start,
int len)
- Description copied from interface:
Random
- Fill part of bytes with random values.
- Specified by:
fill
in interface Random
- Parameters:
bytes
- byte array to be filled.start
- index to start filling at.len
- length of segment to fill.
getName
public String getName()
- Description copied from interface:
NamedFactory
- Name of this factory
- Specified by:
getName
in interface NamedFactory<Random>
- Returns:
create
public Random create()
- Description copied from interface:
Factory
- Create a new instance
- Specified by:
create
in interface Factory<Random>
- Returns:
Copyright © 2008-2012 Apache Software Foundation. All Rights Reserved.