Class LogicalTypeFiniteSimple

    • Field Detail

      • qualifier

        protected String qualifier
      • regExp

        protected String regExp
      • backout

        protected String backout
      • reader

        protected java.io.Reader reader
    • Constructor Detail

      • LogicalTypeFiniteSimple

        public LogicalTypeFiniteSimple​(PluginDefinition plugin,
                                       String backout,
                                       int threshold)
    • Method Detail

      • setContent

        public void setContent​(String contentType,
                               String content)
      • isMember

        public boolean isMember​(String input)
      • nextRandom

        public 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.
      • initialize

        public boolean initialize​(Locale locale)
                           throws FTAPluginException
        Description copied from class: LogicalType
        Called to perform any initialization.
        Overrides:
        initialize in class LogicalTypeFinite
        Parameters:
        locale - The locale used for this analysis
        Returns:
        True if initialization was successful.
        Throws:
        FTAPluginException - Thrown when the plugin is incorrectly configured.
      • getQualifier

        public String getQualifier()
        Description copied from class: LogicalType
        The user-friendly name of the Qualifier. For example, EMAIL for an email address
        Specified by:
        getQualifier in class LogicalType
        Returns:
        The user-friendly name of the type-qualifier.
      • getRegExp

        public String getRegExp()
        Description copied from class: LogicalType
        The Regular Expression that most closely matches (See LogicalType.isRegExpComplete()) this Logical Type. Note: All valid matches will match this RE, but the inverse is not necessarily true.
        Specified by:
        getRegExp in class LogicalType
        Returns:
        The Java Regular Expression that most closely matches this Logical Type.
      • analyzeSet

        public PluginAnalysis analyzeSet​(AnalyzerContext context,
                                         long matchCount,
                                         long realSamples,
                                         String currentRegExp,
                                         Facts facts,
                                         Map<String,​Long> cardinality,
                                         Map<String,​Long> outliers,
                                         TokenStreams tokenStreams,
                                         AnalysisConfig analysisConfig)
        Description copied from class: LogicalType
        Given the data to date as embodied by the arguments return an analysis. If we think this is an instance of this logical type then valid will be true , if invalid then valid will be false and a new Pattern will be returned.
        Specified by:
        analyzeSet in class LogicalType
        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 against
        facts - Facts (min, max, sum) for the analysis to date (optional - i.e. maybe null)
        cardinality - Cardinality set, up to the maximum maintained
        outliers - Outlier set, up to the maximum maintained
        tokenStreams - Shapes observed
        analysisConfig - The Configuration of the current analysis
        Returns:
        Null if we think this is an instance of this logical type (backout pattern otherwise)