Package org.flag4j.complex_numbers
Class CNumberToken
java.lang.Object
org.flag4j.complex_numbers.CNumberToken
A CNumberToken is the smallest unit of a string which is being parsed to a complex number.
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
CNumberToken
(String k, String d) Creates a token of the specified kind and with the specified details. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
errorCheck
(String k) If a given token does not match the provided kind then the program will halt.protected void
errorCheck
(String k, String d) If a given tokens kind and details match k and d respectively then the program will halt.protected String
Gets the details of this token.protected String
getKind()
Gets the kind of this token.protected boolean
Checks if token is of kind s.protected boolean
Checks if given tokens kind and details match k and d respectively.toString()
Constructs a string representation of a token.
-
Field Details
-
kind
The kind of this token. -
details
The details of this token.
-
-
Constructor Details
-
CNumberToken
-
-
Method Details
-
isKind
Checks if token is of kind s.- Parameters:
s
- token of interest.- Returns:
- true if token kind equalTo s.
-
getKind
-
getDetails
-
matches
-
errorCheck
-
errorCheck
If a given token does not match the provided kind then the program will halt.- Parameters:
k
- token kind.
-
toString
-