Package com.cobber.fta.plugins
Class LogicalTypeCoordinateDMS
- java.lang.Object
-
- com.cobber.fta.LogicalType
-
- com.cobber.fta.LogicalTypeCode
-
- com.cobber.fta.LogicalTypeInfinite
-
- com.cobber.fta.plugins.LogicalTypeCoordinateDMS
-
- All Implemented Interfaces:
LTRandom
,java.lang.Comparable<LogicalType>
- Direct Known Subclasses:
LogicalTypeLatitudeDMS
,LogicalTypeLongitudeDMS
public abstract class LogicalTypeCoordinateDMS extends LogicalTypeInfinite
-
-
Field Summary
-
Fields inherited from class com.cobber.fta.LogicalTypeCode
random
-
Fields inherited from class com.cobber.fta.LogicalType
defn, headerPatterns, locale, priority, threshold
-
-
Constructor Summary
Constructors Constructor Description LogicalTypeCoordinateDMS(PluginDefinition plugin)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FTAType
getBaseType()
The underlying type we are qualifying.boolean
initialize(java.util.Locale locale)
Called to perform any initialization.boolean
isCandidate(java.lang.String trimmed, java.lang.StringBuilder compressed, int[] charCounts, int[] lastIndex)
A fast check to see if the supplied String might be an instance of this logical type?boolean
isRegExpComplete()
Is the returned Regular Expression a true representation of the Logical Type.boolean
isValid(java.lang.String input)
Is the supplied String an instance of this logical type?java.lang.String
isValidSet(AnalyzerContext context, long matchCount, long realSamples, java.lang.String currentRegExp, FactsTypeBased facts, java.util.Map<java.lang.String,java.lang.Long> cardinality, java.util.Map<java.lang.String,java.lang.Long> outliers, Shapes shapes, AnalysisConfig analysisConfig)
Given the data to date as embodied by the arguments return null if we think this is an instance of this logical type, if not return a new suitable pattern.java.lang.String
nextRandom()
nextRandom will generate a random (secure) valid example of this Semantic Type.-
Methods inherited from class com.cobber.fta.LogicalTypeInfinite
isClosed
-
Methods inherited from class com.cobber.fta.LogicalTypeCode
seed
-
Methods inherited from class com.cobber.fta.LogicalType
acceptsBaseType, compareTo, getConfidence, getDescription, getHeaderConfidence, getPriority, getQualifier, getRegExp, getSignature, getThreshold, isLocaleSensitive, setThreshold
-
-
-
-
Constructor Detail
-
LogicalTypeCoordinateDMS
public LogicalTypeCoordinateDMS(PluginDefinition plugin)
-
-
Method Detail
-
initialize
public boolean initialize(java.util.Locale locale) throws FTAPluginException
Description copied from class:LogicalType
Called to perform any initialization.- Overrides:
initialize
in classLogicalTypeCode
- Parameters:
locale
- The locale used for this analysis- Returns:
- True if initialization was successful.
- Throws:
FTAPluginException
- Thrown when the plugin is incorrectly configured.
-
nextRandom
public java.lang.String nextRandom()
Description copied from interface:LTRandom
nextRandom will generate a random (secure) valid example of this Semantic Type.- Returns:
- a new valid example of the Semantic Type.
-
getBaseType
public FTAType getBaseType()
Description copied from class:LogicalType
The underlying type we are qualifying.- Specified by:
getBaseType
in classLogicalType
- Returns:
- The underlying type - e.g. STRING, LONG, etc.
-
isRegExpComplete
public boolean isRegExpComplete()
Description copied from class:LogicalType
Is the returned Regular Expression a true representation of the Logical Type. For example, \\d{5} is not for US ZIP codes, whereas (?i)(male|female) could be valid for a Gender.- Overrides:
isRegExpComplete
in classLogicalTypeInfinite
- Returns:
- The Java Regular Expression that most closely matches this Logical Type.
-
isValid
public boolean isValid(java.lang.String input)
Description copied from class:LogicalType
Is the supplied String an instance of this logical type?- Specified by:
isValid
in classLogicalType
- Parameters:
input
- String to check (trimmed for Numeric base Types, un-trimmed for String base Type)- Returns:
- true iff the supplied String is an instance of this Logical type.
-
isCandidate
public boolean isCandidate(java.lang.String trimmed, java.lang.StringBuilder compressed, int[] charCounts, int[] lastIndex)
Description copied from class:LogicalTypeInfinite
A fast check to see if the supplied String might be an instance of this logical type?- Specified by:
isCandidate
in classLogicalTypeInfinite
- Parameters:
trimmed
- String to checkcompressed
- A compressed representation of the input string (e.g. \d{5} for 20351).charCounts
- An array of occurrence counts for characters in the input (ASCII-only).lastIndex
- An array of the last index where character is located (ASCII-only).- Returns:
- true iff the supplied String is a possible instance of this Logical type.
-
isValidSet
public java.lang.String isValidSet(AnalyzerContext context, long matchCount, long realSamples, java.lang.String currentRegExp, FactsTypeBased facts, java.util.Map<java.lang.String,java.lang.Long> cardinality, java.util.Map<java.lang.String,java.lang.Long> outliers, Shapes shapes, AnalysisConfig analysisConfig)
Description copied from class:LogicalType
Given the data to date as embodied by the arguments return null if we think this is an instance of this logical type, if not return a new suitable pattern.- Specified by:
isValidSet
in classLogicalType
- Parameters:
context
- The context used to interpret the Data Stream (for example, stream name, date resolution mode, etc)matchCount
- Number of samples that match so far (as determined by isValid()realSamples
- Number of real (i.e. non-blank and non-null) samples that we have processed so far.currentRegExp
- The current Regular Expression that we matched againstfacts
- Facts (min, max, sum) for the analysis to date (optional - i.e. maybe null)cardinality
- Cardinality set, up to the maximum maintainedoutliers
- Outlier set, up to the maximum maintainedshapes
- Shapes observedanalysisConfig
- The Configuration of the current analysis- Returns:
- Null if we think this is an instance of this logical type (backout pattern otherwise)
-
-