diff options
Diffstat (limited to 'libjava/classpath/gnu/java/security/prng/BasePRNG.java')
-rw-r--r-- | libjava/classpath/gnu/java/security/prng/BasePRNG.java | 39 |
1 files changed, 9 insertions, 30 deletions
diff --git a/libjava/classpath/gnu/java/security/prng/BasePRNG.java b/libjava/classpath/gnu/java/security/prng/BasePRNG.java index fe815d7004e..3b7c8cf071f 100644 --- a/libjava/classpath/gnu/java/security/prng/BasePRNG.java +++ b/libjava/classpath/gnu/java/security/prng/BasePRNG.java @@ -41,14 +41,11 @@ package gnu.java.security.prng; import java.util.Map; /** - * <p>An abstract class to facilitate implementing PRNG algorithms.</p> + * An abstract class to facilitate implementing PRNG algorithms. */ -public abstract class BasePRNG implements IRandom +public abstract class BasePRNG + implements IRandom { - - // Constants and variables - // ------------------------------------------------------------------------- - /** The canonical name prefix of the PRNG algorithm. */ protected String name; @@ -61,12 +58,9 @@ public abstract class BasePRNG implements IRandom /** The index into buffer of where the next byte will come from. */ protected int ndx; - // Constructor(s) - // ------------------------------------------------------------------------- - /** - * <p>Trivial constructor for use by concrete subclasses.</p> - * + * Trivial constructor for use by concrete subclasses. + * * @param name the canonical name of this instance. */ protected BasePRNG(String name) @@ -78,14 +72,6 @@ public abstract class BasePRNG implements IRandom buffer = new byte[0]; } - // Class methods - // ------------------------------------------------------------------------- - - // Instance methods - // ------------------------------------------------------------------------- - - // IRandom interface implementation ---------------------------------------- - public String name() { return name; @@ -101,10 +87,9 @@ public abstract class BasePRNG implements IRandom public byte nextByte() throws IllegalStateException, LimitReachedException { - if (!initialised) - { - throw new IllegalStateException(); - } + if (! initialised) + throw new IllegalStateException(); + return nextByteInternal(); } @@ -117,7 +102,7 @@ public abstract class BasePRNG implements IRandom public void nextBytes(byte[] out, int offset, int length) throws IllegalStateException, LimitReachedException { - if (!initialised) + if (! initialised) throw new IllegalStateException("not initialized"); if (length == 0) @@ -127,7 +112,6 @@ public abstract class BasePRNG implements IRandom throw new ArrayIndexOutOfBoundsException("offset=" + offset + " length=" + length + " limit=" + out.length); - if (ndx >= buffer.length) { fillBlock(); @@ -163,9 +147,6 @@ public abstract class BasePRNG implements IRandom throw new UnsupportedOperationException("random state is non-modifiable"); } - // Instance methods - // ------------------------------------------------------------------------- - public boolean isInitialised() { return initialised; @@ -182,8 +163,6 @@ public abstract class BasePRNG implements IRandom return buffer[ndx++]; } - // abstract methods to implement by subclasses ----------------------------- - public Object clone() throws CloneNotSupportedException { BasePRNG result = (BasePRNG) super.clone(); |