Class DATACasUtils


  • public class DATACasUtils
    extends java.lang.Object
    The Class DATACasUtils.
    • Constructor Summary

      Constructors 
      Constructor Description
      DATACasUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void addFeature​(CasData dataCas, java.lang.String featureType, java.lang.String featureName, java.lang.String featureValue)
      Adds the feature.
      static void addFeatureStructure​(CasData dataCas, java.lang.String featureType, java.lang.String featureName, java.lang.String featureValue)
      Adds the feature structure.
      static boolean dropIt​(java.lang.String aKey, java.lang.String[] dropKeyList)
      Drop it.
      static void dumpFeatures​(CasData aCAS)
      Dump features.
      static long getByteCount​(CasData aDataCas)
      Gets the byte count.
      static NameValuePair[] getCasDataFeatures​(CasData aCasData, java.lang.String aFeatureStructureName)
      Gets the cas data features.
      static java.lang.String[] getFeatureStructureValues​(CasData aCAS, java.lang.String featureStructureName, java.lang.String featureName)
      Gets the feature structure values.
      static java.lang.String getFeatureValueByType​(CasData aCAS, java.lang.String featureName)
      Gets the feature value by type.
      static java.lang.String getFeatureValueByType​(CasData aCAS, java.lang.String aFeatureStructure, java.lang.String featureName)
      Gets the feature value by type.
      static java.lang.String getXCASasString​(CasData aCasData, java.lang.String[] keysToFilter)
      Gets the XCA sas string.
      static boolean hasFeature​(CasData aCAS, java.lang.String featureName)
      Checks for feature.
      static boolean hasFeatureStructure​(CasData aCAS, java.lang.String aName)
      Checks for feature structure.
      static boolean isCasEmpty​(CasData aDataCas)
      Checks if is cas empty.
      static boolean isValidType​(java.lang.String aKey, java.lang.String[] typeList)
      Checks if is valid type.
      static void remapFeatureTypes​(CasData aDataCas, FeatureMap aFeatureMap)
      Remap feature types.
      static boolean shouldAnalyzeCAS​(CasData aCAS, java.util.LinkedList aFilterList)
      Should analyze CAS.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DATACasUtils

        public DATACasUtils()
    • Method Detail

      • getXCASasString

        public static java.lang.String getXCASasString​(CasData aCasData,
                                                       java.lang.String[] keysToFilter)
                                                throws java.lang.Exception
        Gets the XCA sas string.
        Parameters:
        aCasData - the a cas data
        keysToFilter - the keys to filter
        Returns:
        the XCA sas string
        Throws:
        java.lang.Exception - the exception
      • addFeatureStructure

        public static void addFeatureStructure​(CasData dataCas,
                                               java.lang.String featureType,
                                               java.lang.String featureName,
                                               java.lang.String featureValue)
        Adds the feature structure.
        Parameters:
        dataCas - the data cas
        featureType - the feature type
        featureName - the feature name
        featureValue - the feature value
      • isCasEmpty

        public static boolean isCasEmpty​(CasData aDataCas)
        Checks if is cas empty.
        Parameters:
        aDataCas - the a data cas
        Returns:
        true if the data cas is empty
      • addFeature

        public static void addFeature​(CasData dataCas,
                                      java.lang.String featureType,
                                      java.lang.String featureName,
                                      java.lang.String featureValue)
        Adds the feature.
        Parameters:
        dataCas - the data cas
        featureType - the feature type
        featureName - the feature name
        featureValue - the feature value
      • getByteCount

        public static long getByteCount​(CasData aDataCas)
                                 throws java.lang.Exception
        Gets the byte count.
        Parameters:
        aDataCas - the a data cas
        Returns:
        the byte count
        Throws:
        java.lang.Exception - -
      • shouldAnalyzeCAS

        public static boolean shouldAnalyzeCAS​(CasData aCAS,
                                               java.util.LinkedList aFilterList)
        Should analyze CAS.
        Parameters:
        aCAS - the a CAS
        aFilterList - the a filter list
        Returns:
        true if this cas should be analyzed
      • dropIt

        public static boolean dropIt​(java.lang.String aKey,
                                     java.lang.String[] dropKeyList)
        Drop it.
        Parameters:
        aKey - the a key
        dropKeyList - the drop key list
        Returns:
        true if this key is in the dropKeyList
      • isValidType

        public static boolean isValidType​(java.lang.String aKey,
                                          java.lang.String[] typeList)
        Checks if is valid type.
        Parameters:
        aKey - the a key
        typeList - the type list
        Returns:
        true if tbd
      • hasFeature

        public static boolean hasFeature​(CasData aCAS,
                                         java.lang.String featureName)
        Checks for feature.
        Parameters:
        aCAS - the a CAS
        featureName - the feature name
        Returns:
        true if
      • hasFeatureStructure

        public static boolean hasFeatureStructure​(CasData aCAS,
                                                  java.lang.String aName)
        Checks for feature structure.
        Parameters:
        aCAS - the a CAS
        aName - the a name
        Returns:
        true if tbd
      • dumpFeatures

        public static void dumpFeatures​(CasData aCAS)
        Dump features.
        Parameters:
        aCAS - the a CAS
      • getFeatureValueByType

        public static java.lang.String getFeatureValueByType​(CasData aCAS,
                                                             java.lang.String featureName)
        Gets the feature value by type.
        Parameters:
        aCAS - the a CAS
        featureName - the feature name
        Returns:
        true if tbd
      • getFeatureStructureValues

        public static java.lang.String[] getFeatureStructureValues​(CasData aCAS,
                                                                   java.lang.String featureStructureName,
                                                                   java.lang.String featureName)
        Gets the feature structure values.
        Parameters:
        aCAS - the a CAS
        featureStructureName - the feature structure name
        featureName - the feature name
        Returns:
        tbd
      • getFeatureValueByType

        public static java.lang.String getFeatureValueByType​(CasData aCAS,
                                                             java.lang.String aFeatureStructure,
                                                             java.lang.String featureName)
        Gets the feature value by type.
        Parameters:
        aCAS - the a CAS
        aFeatureStructure - the a feature structure
        featureName - the feature name
        Returns:
        tbd
      • remapFeatureTypes

        public static void remapFeatureTypes​(CasData aDataCas,
                                             FeatureMap aFeatureMap)
        Remap feature types.
        Parameters:
        aDataCas - the a data cas
        aFeatureMap - the a feature map
      • getCasDataFeatures

        public static NameValuePair[] getCasDataFeatures​(CasData aCasData,
                                                         java.lang.String aFeatureStructureName)
        Gets the cas data features.
        Parameters:
        aCasData - the a cas data
        aFeatureStructureName - the a feature structure name
        Returns:
        tbd