public enum NativeSeedType extends java.lang.Enum<NativeSeedType>
Valid native seed types are:
Integer
Long
int[]
long[]
Valid types for seed conversion are:
Integer
(or int
)Long
(or long
)int[]
long[]
byte[]
Enum Constant | Description |
---|---|
INT |
The seed type is
Integer . |
INT_ARRAY |
The seed type is
int[] . |
LONG |
The seed type is
Long . |
LONG_ARRAY |
The seed type is
long[] . |
Modifier and Type | Method | Description |
---|---|---|
protected abstract java.lang.Object |
convert(byte[] seed,
int size) |
Convert the input
byte[] seed to the native seed type. |
protected abstract java.lang.Object |
convert(int[] seed,
int size) |
Convert the input
int[] seed to the native seed type. |
protected abstract java.lang.Object |
convert(long[] seed,
int size) |
Convert the input
long[] seed to the native seed type. |
protected abstract java.lang.Object |
convert(java.lang.Integer seed,
int size) |
Convert the input
Integer seed to the native seed type. |
protected abstract java.lang.Object |
convert(java.lang.Long seed,
int size) |
Convert the input
Long seed to the native seed type. |
java.lang.Object |
convertSeed(java.lang.Object seed,
int size) |
Converts the input seed from any of the supported seed types to the native seed type.
|
static byte[] |
convertSeedToBytes(java.lang.Object seed) |
Converts the input seed from any of the supported seed types to bytes.
|
abstract java.lang.Object |
createSeed(int size) |
Creates the seed.
|
int |
getBytes() |
Gets the number of bytes required to represent the native seed type.
|
java.lang.Class<?> |
getType() |
Gets the class type of the native seed.
|
static NativeSeedType |
valueOf(java.lang.String name) |
Returns the enum constant of this type with the specified name.
|
static NativeSeedType[] |
values() |
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final NativeSeedType INT
Integer
.public static final NativeSeedType LONG
Long
.public static final NativeSeedType INT_ARRAY
int[]
.public static final NativeSeedType LONG_ARRAY
long[]
.public static NativeSeedType[] values()
for (NativeSeedType c : NativeSeedType.values()) System.out.println(c);
public static NativeSeedType valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic java.lang.Class<?> getType()
public int getBytes()
public abstract java.lang.Object createSeed(int size)
size
- The size of the seed (array types only).public java.lang.Object convertSeed(java.lang.Object seed, int size)
seed
- Input seed.size
- The size of the output seed (array types only).java.lang.UnsupportedOperationException
- if the seed
type is invalid.protected abstract java.lang.Object convert(java.lang.Integer seed, int size)
Integer
seed to the native seed type.seed
- Input seed.size
- The size of the output seed (array types only).protected abstract java.lang.Object convert(java.lang.Long seed, int size)
Long
seed to the native seed type.seed
- Input seed.size
- The size of the output seed (array types only).protected abstract java.lang.Object convert(int[] seed, int size)
int[]
seed to the native seed type.seed
- Input seed.size
- The size of the output seed (array types only).protected abstract java.lang.Object convert(long[] seed, int size)
long[]
seed to the native seed type.seed
- Input seed.size
- The size of the output seed (array types only).protected abstract java.lang.Object convert(byte[] seed, int size)
byte[]
seed to the native seed type.seed
- Input seed.size
- The size of the output seed (array types only).public static byte[] convertSeedToBytes(java.lang.Object seed)
seed
- Input seed.java.lang.UnsupportedOperationException
- if the seed
type is invalid.Copyright © 2016–2019 The Apache Software Foundation. All rights reserved.