Record Class CardinalityInterval
java.lang.Object
java.lang.Record
tools.refinery.logic.term.cardinalityinterval.CardinalityInterval
- All Implemented Interfaces:
AbstractValue<CardinalityInterval,
Integer>
public record CardinalityInterval(int lowerBound, UpperCardinality upperBound)
extends Record
implements AbstractValue<CardinalityInterval,Integer>
-
Constructor Summary
ConstructorDescriptionCardinalityInterval
(int lowerBound, UpperCardinality upperBound) Creates an instance of aCardinalityInterval
record class. -
Method Summary
Modifier and TypeMethodDescriptionadd
(CardinalityInterval other) final boolean
Indicates whether some other object is "equal to" this one.@Nullable Integer
@Nullable Integer
final 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) @Nullable CardinalityInterval
take
(int count) toString()
Returns a string representation of this record class.Returns the value of theupperBound
record component.
-
Constructor Details
-
CardinalityInterval
Creates an instance of aCardinalityInterval
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
-
max
-
add
-
multiply
-
meet
- Specified by:
meet
in interfaceAbstractValue<CardinalityInterval,
Integer>
-
join
- Specified by:
join
in interfaceAbstractValue<CardinalityInterval,
Integer>
-
take
-
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. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code 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 '=='. -
lowerBound
public int lowerBound()Returns the value of thelowerBound
record component.- Returns:
- the value of the
lowerBound
record component
-
upperBound
Returns the value of theupperBound
record component.- Returns:
- the value of the
upperBound
record component
-