public abstract class SequenceDomain<T> extends AbstractValueDomain<T>
Modifier | Constructor and Description |
---|---|
protected |
SequenceDomain(int maxLength)
Creates a new SequenceDomain instance.
|
Modifier and Type | Method and Description |
---|---|
protected abstract Stream<T> |
candidates(ResolverContext context)
Returns a random sequence of possible members of this domain.
|
boolean |
contains(T value)
Returns true if the given value belongs to this domain.
|
Set<T> |
getExcluded()
Returns the values excluded from this domain.
|
protected abstract int |
getLength(T value)
Returns the length of the given value.
|
protected LengthDomain |
getLengthRange()
Returns the length range for values in this domain.
|
int |
getMaxLength()
Returns the maximum value for unbounded length ranges.
|
DataValue.Type[] |
getTypes()
Return the type(s) of values that belong to this domain.
|
protected void |
initLengthRange()
Defines the initial length range for values in this domain.
|
protected boolean |
isNotExcluded(T value,
Set<T> excluded)
Returns true if
value is not equal to of any of the excluded values. |
void |
setExcluded(Set<T> excluded)
Changes the values excluded from this domain.
|
abstract void |
setExcludedStrings(Set<String> excluded)
Changes the values excluded from this domain.
|
void |
setLengthRange(Integer length)
Defines a constant length range for values in this domain.
|
void |
setLengthRange(Integer min,
Integer max)
Defines the length range for values in this domain.
|
protected void |
setLengthRange(LengthDomain domain)
Changes the length range for values in this domain.
|
void |
setLengthRange(NumberDomain.Range range)
Defines the length range for values in this domain.
|
String |
toString() |
Stream<DataValue<T>> |
values(ResolverContext context)
Returns a random sequence of values from this domain.
|
protected boolean |
valuesEqual(T value1,
T value2)
Returns true if the given values are equal.
|
dataValueOf, getFormat, setFormat, withFormat
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
arrayOf, arrayOf, arrayOf, contains, containsObject, getType, select, selectValue
protected SequenceDomain(int maxLength)
public int getMaxLength()
public void setLengthRange(Integer length)
public void setLengthRange(Integer min, Integer max)
public void setLengthRange(NumberDomain.Range range)
protected void initLengthRange()
protected void setLengthRange(LengthDomain domain)
protected LengthDomain getLengthRange()
public abstract void setExcludedStrings(Set<String> excluded)
protected abstract int getLength(T value)
public DataValue.Type[] getTypes()
public Stream<DataValue<T>> values(ResolverContext context)
protected abstract Stream<T> candidates(ResolverContext context)
public boolean contains(T value)
protected boolean isNotExcluded(T value, Set<T> excluded)
value
is not equal to of any of the excluded
values.protected boolean valuesEqual(T value1, T value2)
Copyright © 2024 The Cornutum Project. All rights reserved.