Class NumberMatch
java.lang.Object
com.northconcepts.datapipeline.foundations.core.Bean
com.northconcepts.datapipeline.foundations.number.NumberMatch
- All Implemented Interfaces:
DataExceptionContributor,JsonSerializable,RecordSerializable,XmlSerializable,Serializable
The result of
NumberDetector.match(String): the matched text split into whole and fraction parts, plus a
NumberDescriptor for it.- See Also:
-
Field Summary
Fields inherited from interface com.northconcepts.datapipeline.core.RecordSerializable
SERIALIZED_CLASS_NAME, TYPEFields inherited from interface com.northconcepts.datapipeline.core.XmlSerializable
XML_SERIALIZED_CLASS_NAME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the digits after the decimal point: empty if there is no point and"0"if nothing follows it.Parses the source text with the descriptor's field type and caches the result; returns null if there is no descriptor.Returns the digits before the decimal point, without the minus sign; empty if there are none.booleanReturnstruewhen this match is a non-negative whole number whose digits start with'0'and span more than one digit (e.g.setFractionPart(String fractionPart) Sets the digits after the decimal point.setNumberDescriptor(NumberDescriptor numberDescriptor) setWholePart(String wholePart) Sets the digits before the decimal point, without the minus sign.toString()Returns a basic JSON representation of this instance.Methods inherited from class com.northconcepts.datapipeline.foundations.core.Bean
addExceptionProperties, fromRecord, toRecordMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.northconcepts.datapipeline.core.DataExceptionContributor
addExceptionProperties, exception, exception, exceptionMethods inherited from interface com.northconcepts.datapipeline.core.RecordSerializable
fromJson, fromJson, toJson, toJson, toJsonMethods inherited from interface com.northconcepts.datapipeline.core.XmlSerializable
fromXml, fromXml, fromXmlElement, toXml, toXml, toXml, toXml, toXml, toXmlElement
-
Constructor Details
-
NumberMatch
public NumberMatch()
-
-
Method Details
-
getNumberDescriptor
-
setNumberDescriptor
-
getSource
-
setSource
-
getWholePart
Returns the digits before the decimal point, without the minus sign; empty if there are none. -
setWholePart
Sets the digits before the decimal point, without the minus sign. -
getFractionPart
Returns the digits after the decimal point: empty if there is no point and"0"if nothing follows it. -
setFractionPart
Sets the digits after the decimal point. -
isLeadingZeroWholeNumber
public boolean isLeadingZeroWholeNumber()Returnstruewhen this match is a non-negative whole number whose digits start with'0'and span more than one digit (e.g."00","007","00123").A single
"0", any negative value (e.g."-007"), and any value with a fraction (e.g."0.5") returnfalse. Such leading-zero whole numbers are typically codes/identifiers and are inferred as String. -
getNumber
Parses the source text with the descriptor's field type and caches the result; returns null if there is no descriptor. -
toString
Description copied from class:BeanReturns a basic JSON representation of this instance.
-