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 Radix
The field for theradix
record component.private final char
The field for thesign
record component.private final @NotNull NumberType
The field for thetype
record component.private final @NotNull String
The field for thevalue
record component. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
ParsedNumber
(char sign, @NotNull String value, @NotNull NumberType type, @NotNull Radix radix) Constructs a new parsed number. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.@NotNull String
Returns the signed value of the number.
The value is prefixed with the sign.final int
hashCode()
Returns a hash code value for this object.@NotNull Radix
radix()
Returns the value of theradix
record component.char
sign()
Returns the value of thesign
record component.@NotNull String
toString()
Returns a string representation of this record class.@NotNull NumberType
type()
Returns the value of thetype
record component.@NotNull String
value()
Returns the value of thevalue
record 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 thesign
record component.- Returns:
- the value of the
sign
record component
-
value
Returns the value of thevalue
record component.- Returns:
- the value of the
value
record component
-
type
Returns the value of thetype
record component.- Returns:
- the value of the
type
record component
-
radix
Returns the value of theradix
record component.- Returns:
- the value of the
radix
record component
-