Record Class NonEmptyCardinalityInterval
java.lang.Object
java.lang.Record
tools.refinery.logic.term.cardinalityinterval.NonEmptyCardinalityInterval
- All Implemented Interfaces:
AbstractValue<CardinalityInterval,
,Integer> CardinalityInterval
public record NonEmptyCardinalityInterval(int lowerBound, UpperCardinality upperBound)
extends Record
implements CardinalityInterval
-
Constructor Summary
ConstructorDescriptionNonEmptyCardinalityInterval
(int lowerBound, UpperCardinality upperBound) Creates an instance of aNonEmptyCardinalityInterval
record class. -
Method Summary
Modifier and TypeMethodDescriptionadd
(CardinalityInterval other) boolean
Indicates whether some other object is "equal to" this one.@NotNull Integer
@Nullable Integer
int
hashCode()
Returns a hash code value for this object.boolean
boolean
isError()
boolean
join
(CardinalityInterval other) int
Returns the value of thelowerBound
record component.max
(CardinalityInterval other) meet
(CardinalityInterval other) min
(CardinalityInterval other) multiply
(CardinalityInterval other) take
(int count) toString()
Returns a string representation of this record class.Returns the value of theupperBound
record component.
-
Constructor Details
-
NonEmptyCardinalityInterval
Creates an instance of aNonEmptyCardinalityInterval
record class.- Parameters:
lowerBound
- the value for thelowerBound
record componentupperBound
- the value for theupperBound
record component
-
-
Method Details
-
getConcrete
- Specified by:
getConcrete
in interfaceAbstractValue<CardinalityInterval,
Integer>
-
isConcrete
public boolean isConcrete()- Specified by:
isConcrete
in interfaceAbstractValue<CardinalityInterval,
Integer>
-
getArbitrary
- Specified by:
getArbitrary
in interfaceAbstractValue<CardinalityInterval,
Integer>
-
isError
public boolean isError()- Specified by:
isError
in interfaceAbstractValue<CardinalityInterval,
Integer>
-
isRefinementOf
- Specified by:
isRefinementOf
in interfaceAbstractValue<CardinalityInterval,
Integer>
-
min
- Specified by:
min
in interfaceCardinalityInterval
-
max
- Specified by:
max
in interfaceCardinalityInterval
-
add
- Specified by:
add
in interfaceCardinalityInterval
-
multiply
- Specified by:
multiply
in interfaceCardinalityInterval
-
meet
- Specified by:
meet
in interfaceAbstractValue<CardinalityInterval,
Integer>
-
join
- Specified by:
join
in interfaceAbstractValue<CardinalityInterval,
Integer>
-
take
- Specified by:
take
in interfaceCardinalityInterval
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object)
; primitive components are compared with '=='. -
hashCode
public int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
lowerBound
public int lowerBound()Returns the value of thelowerBound
record component.- Specified by:
lowerBound
in interfaceCardinalityInterval
- Returns:
- the value of the
lowerBound
record component
-
upperBound
Returns the value of theupperBound
record component.- Specified by:
upperBound
in interfaceCardinalityInterval
- Returns:
- the value of the
upperBound
record component
-