public abstract class NumberDomain<T extends Number & Comparable<T>> extends AbstractValueDomain<T>
Modifier and Type | Class and Description |
---|---|
static class |
NumberDomain.Range
Represents a range of numeric values.
|
Modifier | Constructor and Description |
---|---|
protected |
NumberDomain(DataValue.Type type,
long maxRange)
Creates a new NumberDomain instance.
|
Modifier and Type | Method and Description |
---|---|
boolean |
contains(T value)
Returns true if the given value belongs to this domain.
|
Set<T> |
getExcluded()
Returns the values excluded from this domain.
|
T |
getMax()
Returns the (inclusive) maximum for this domain.
|
long |
getMaxRange()
Returns the maximum magnitude for unbounded value ranges.
|
T |
getMin()
Returns the (inclusive) minimum for this domain.
|
T |
getMultipleOf()
Returns the factor required for all values in this domain.
|
Set<T> |
getNotMultipleOfs()
Returns the factors not allowed for any values in this domain.
|
DataValue.Type[] |
getTypes()
Return the type(s) of values that belong to this domain.
|
protected abstract boolean |
isMultipleOf(T value,
T multiple)
Returns true if
value is a multiple of multiple . |
protected boolean |
isNotExcluded(T value,
Set<T> excluded)
Returns true if
value is not equal to of any of the excluded values. |
protected boolean |
isNotMultipleOf(T value,
Set<T> multiples)
Returns true if
value is a not a multiple of any of the multiples . |
void |
setExcluded(Set<T> excluded)
Changes the values excluded from this domain.
|
abstract void |
setMultipleOf(String multipleOf)
If non-null, all values in this domain are a multiple of the given value.
|
void |
setMultipleOf(T multipleOf)
Changes the factor required for all values in this domain.
|
void |
setNotMultipleOfs(Set<T> notMultipleOfs)
Changes the factors not allowed for any values in this domain.
|
abstract void |
setNotMultipleOfs(String[] notMultipleOfs)
Changes the factors not allowed for any values in this domain.
|
abstract void |
setRange(NumberDomain.Range range)
Defines the value range for this domain.
|
void |
setRange(T min,
T max)
Changes the (inclusive) minimum and the (inclusive) maximum for this domain.
|
String |
toString() |
dataValueOf, getFormat, setFormat, withFormat
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
arrayOf, arrayOf, arrayOf, contains, containsObject, getType, select, selectValue, values
protected NumberDomain(DataValue.Type type, long maxRange)
public long getMaxRange()
public abstract void setRange(NumberDomain.Range range)
public abstract void setMultipleOf(String multipleOf)
public abstract void setNotMultipleOfs(String[] notMultipleOfs)
protected abstract boolean isMultipleOf(T value, T multiple)
value
is a multiple of multiple
.public void setRange(T min, T max)
public T getMin()
public T getMax()
public void setMultipleOf(T multipleOf)
public T getMultipleOf()
public void setNotMultipleOfs(Set<T> notMultipleOfs)
public Set<T> getNotMultipleOfs()
public boolean contains(T value)
public DataValue.Type[] getTypes()
protected boolean isNotMultipleOf(T value, Set<T> multiples)
value
is a not a multiple of any of the multiples
.Copyright © 2024 The Cornutum Project. All rights reserved.