cc.redberry.core.indexgenerator
Class IndexGeneratorImpl
- java.lang.Object
-
- cc.redberry.core.indexgenerator.IndexGeneratorImpl
-
- All Implemented Interfaces:
- IndexGenerator
public final class IndexGeneratorImpl extends java.lang.Object implements IndexGenerator
Generates distinct indices of particular types, which does not contain in specified sets of indices (engaged data).- Since:
- 1.0
-
-
Constructor Summary
Constructors Constructor and Description IndexGeneratorImpl()Creates with generator without engaged data.IndexGeneratorImpl(Indices indices)Creates with generator with specified engaged data.IndexGeneratorImpl(int[] indices)Creates with generator with specified engaged data.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description IndexGeneratorImplclone()booleancontains(int index)Returns true if index contains in engaged data or already was generated.intgenerate(byte type)Generates new index of a particular type.intgenerate(IndexType type)Generates new index of a particular type.voidmergeFrom(IndexGeneratorImpl other)Merges from specified generator.
-
-
-
Constructor Detail
-
IndexGeneratorImpl
public IndexGeneratorImpl()
Creates with generator without engaged data.
-
IndexGeneratorImpl
public IndexGeneratorImpl(Indices indices)
Creates with generator with specified engaged data.- Parameters:
indices- forbidden indices
-
IndexGeneratorImpl
public IndexGeneratorImpl(int[] indices)
Creates with generator with specified engaged data.- Parameters:
indices- forbidden indices
-
-
Method Detail
-
contains
public boolean contains(int index)
Returns true if index contains in engaged data or already was generated.- Parameters:
index- index- Returns:
- true if index contains in engaged data or already was generated
-
mergeFrom
public void mergeFrom(IndexGeneratorImpl other)
Merges from specified generator.- Parameters:
other- index generator
-
generate
public int generate(IndexType type)
Generates new index of a particular type.- Parameters:
type- index type- Returns:
- new index of a particular type
-
generate
public int generate(byte type)
Generates new index of a particular type.- Specified by:
generatein interfaceIndexGenerator- Parameters:
type- index type- Returns:
- new index of a particular type
-
clone
public IndexGeneratorImpl clone()
- Overrides:
clonein classjava.lang.Object
-
-
DataMelt 3.0 © DataMelt by jWork.ORG