Package de.monticore.values
Class MCValueInt
java.lang.Object
de.monticore.values.MCValueInt
- All Implemented Interfaces:
MCValue
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyteasByte()charasChar()doubleasDouble()floatasFloat()intasInt()longasLong()Used to pass the value to native Java classes and similar, e.g., collections.shortasShort()asString()booleancheckEqualityOperator(MCValue other) basically implements==booleanisInt()booleanPrint the type of the MIValue in human-readable formPrint the value in human-readable form
-
Field Details
-
value
protected int value
-
-
Constructor Details
-
MCValueInt
public MCValueInt(int value)
-
-
Method Details
-
isPrimitive
public boolean isPrimitive()- Specified by:
isPrimitivein interfaceMCValue
-
isInt
public boolean isInt() -
asByte
public byte asByte() -
asShort
public short asShort() -
asChar
public char asChar() -
asInt
public int asInt() -
asLong
public long asLong() -
asFloat
public float asFloat() -
asDouble
public double asDouble() -
asNativeObject
Description copied from interface:MCValueUsed to pass the value to native Java classes and similar, e.g., collections.Note: not all values can have a native representation, as such, their native version is the MIValue itself.
- Specified by:
asNativeObjectin interfaceMCValue- Returns:
- The value as a Java native Object.
-
asString
-
checkEqualityOperator
Description copied from interface:MCValuebasically implements==- Specified by:
checkEqualityOperatorin interfaceMCValue- Parameters:
other- the value to check against this- Returns:
- whether they are considered equal
-
printType
Description copied from interface:MCValuePrint the type of the MIValue in human-readable form -
printValue
Description copied from interface:MCValuePrint the value in human-readable form- Specified by:
printValuein interfaceMCValue
-