Record Class IRFieldMutation
java.lang.Object
java.lang.Record
io.github.protasm.jvmud.compiler.ir.IRFieldMutation
- All Implemented Interfaces:
IRExpression, IRNode
public record IRFieldMutation(int line, IRField field, int delta, boolean prefix)
extends Record
implements IRExpression
Numeric field increment/decrement expression with prefix or postfix result semantics.
-
Constructor Summary
ConstructorsConstructorDescriptionIRFieldMutation(int line, IRField field, int delta, boolean prefix) Creates an instance of aIRFieldMutationrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintdelta()Returns the value of thedeltarecord component.final booleanIndicates whether some other object is "equal to" this one.field()Returns the value of thefieldrecord component.final inthashCode()Returns a hash code value for this object.booleanisPrefix()Returns true when the expression should evaluate to the updated field value.intline()Returns the value of thelinerecord component.booleanprefix()Returns the value of theprefixrecord component.final StringtoString()Returns a string representation of this record class.type()
-
Constructor Details
-
IRFieldMutation
Creates an instance of aIRFieldMutationrecord class.- Parameters:
line- the value for thelinerecord componentfield- the value for thefieldrecord componentdelta- the value for thedeltarecord componentprefix- the value for theprefixrecord component
-
-
Method Details
-
isPrefix
public boolean isPrefix()Returns true when the expression should evaluate to the updated field value. -
type
- Specified by:
typein interfaceIRExpression
-
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. -
line
-
field
Returns the value of thefieldrecord component.- Returns:
- the value of the
fieldrecord component
-
delta
public int delta()Returns the value of thedeltarecord component.- Returns:
- the value of the
deltarecord component
-
prefix
public boolean prefix()Returns the value of theprefixrecord component.- Returns:
- the value of the
prefixrecord component
-