Record Class CheckOperatorData
java.lang.Object
java.lang.Record
org.ek9lang.compiler.phase3.CheckOperatorData
record CheckOperatorData(ISymbol symbol, IToken operatorUseToken, MethodSymbolSearch search, boolean onType)
extends Record
What an operator check needs: the operand, where the operator is used, and the operator search.
The operand is normally a VALUE. A caller that only knows a TYPE - a stream stage checking the element type has
<=> or #? - says so with forType(ISymbol, IToken, MethodSymbolSearch): the operand is then the type itself, and the check that stops an
enumeration TYPE being used as a value does not apply (it rejected cat Hue | sort, front-end rationalisation F02).
-
Constructor Summary
ConstructorsConstructorDescriptionCheckOperatorData(ISymbol symbol, IToken operatorUseToken, MethodSymbolSearch search) An operator used on a VALUE (the usual case).CheckOperatorData(ISymbol symbol, IToken operatorUseToken, MethodSymbolSearch search, boolean onType) Creates an instance of aCheckOperatorDatarecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.(package private) static CheckOperatorDataforType(ISymbol type, IToken operatorUseToken, MethodSymbolSearch search) An operator required of a TYPE, by a caller that has no value of it.final inthashCode()Returns a hash code value for this object.booleanonType()Returns the value of theonTyperecord component.Returns the value of theoperatorUseTokenrecord component.search()Returns the value of thesearchrecord component.symbol()Returns the value of thesymbolrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
CheckOperatorData
CheckOperatorData(ISymbol symbol, IToken operatorUseToken, MethodSymbolSearch search) An operator used on a VALUE (the usual case). -
CheckOperatorData
CheckOperatorData(ISymbol symbol, IToken operatorUseToken, MethodSymbolSearch search, boolean onType) Creates an instance of aCheckOperatorDatarecord class.- Parameters:
symbol- the value for thesymbolrecord componentoperatorUseToken- the value for theoperatorUseTokenrecord componentsearch- the value for thesearchrecord componentonType- the value for theonTyperecord component
-
-
Method Details
-
forType
An operator required of a TYPE, by a caller that has no value of it. -
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
symbol
Returns the value of thesymbolrecord component.- Returns:
- the value of the
symbolrecord component
-
operatorUseToken
Returns the value of theoperatorUseTokenrecord component.- Returns:
- the value of the
operatorUseTokenrecord component
-
search
Returns the value of thesearchrecord component.- Returns:
- the value of the
searchrecord component
-
onType
public boolean onType()Returns the value of theonTyperecord component.- Returns:
- the value of the
onTyperecord component
-