java.lang.Object
java.lang.Record
net.luis.utils.io.reader.StringReader.ParsedNumber
- Record Components:
sign- The sign of the numbervalue- The value of the numbertype- The type of the numberradix- The radix of the number
- Enclosing class:
StringReader
private static record StringReader.ParsedNumber(char sign, @NotNull String value, @NotNull NumberType type, @NotNull Radix radix)
extends Record
Internal to represent a parsed number.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final @NotNull RadixThe field for theradixrecord component.private final charThe field for thesignrecord component.private final @NotNull NumberTypeThe field for thetyperecord component.private final @NotNull StringThe field for thevaluerecord component. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateParsedNumber(char sign, @NotNull String value, @NotNull NumberType type, @NotNull Radix radix) Constructs a new parsed number. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.@NotNull StringReturns the signed value of the number.
The value is prefixed with the sign.final inthashCode()Returns a hash code value for this object.@NotNull Radixradix()Returns the value of theradixrecord component.charsign()Returns the value of thesignrecord component.@NotNull StringtoString()Returns a string representation of this record class.@NotNull NumberTypetype()Returns the value of thetyperecord component.@NotNull Stringvalue()Returns the value of thevaluerecord component.
-
Field Details
-
Constructor Details
-
ParsedNumber
private ParsedNumber(char sign, @NotNull @NotNull String value, @NotNull @NotNull NumberType type, @NotNull @NotNull Radix radix) Constructs a new parsed number.- Parameters:
sign- The sign of the numbervalue- The value of the numbertype- The type of the numberradix- The radix of the number- Throws:
NullPointerException- If the value, type or radix is null
-
-
Method Details
-
getSignedValue
Returns the signed value of the number.
The value is prefixed with the sign.- Returns:
- The signed value
-
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 '=='. -
sign
public char sign()Returns the value of thesignrecord component.- Returns:
- the value of the
signrecord component
-
value
Returns the value of thevaluerecord component.- Returns:
- the value of the
valuerecord component
-
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
radix
Returns the value of theradixrecord component.- Returns:
- the value of the
radixrecord component
-