Class CASFactory


  • public abstract class CASFactory
    extends java.lang.Object
    Factory class to create CASMgr objects. This is the only class in this package. Once you have created a CAS object, you can use the methods there to create and access objects implementing the other interfaces. For the OO API, no direct access to any of the implementations is provided. Should you want to provide an alternative implementation of the CAS interfaces in this package, the only thing you have to change is the implementation of the createCAS() method here.

    All methods in this class are static. CASFactory objects can not be created.

    • Field Detail

      • USE_JCAS_CACHE_DEFAULT

        public static final boolean USE_JCAS_CACHE_DEFAULT
        See Also:
        Constant Field Values
    • Constructor Detail

      • CASFactory

        public CASFactory()
    • Method Detail

      • createCAS

        public static CASMgr createCAS()
        Create a new CASMgr object.
        Returns:
        A new CASMgr object.
      • createCAS

        public static CASMgr createCAS​(int initialHeapSize)
        Create a new CASMgr object.
        Parameters:
        initialHeapSize - The initial size of the internal CAS heap. If you choose this number too small, it can have a major performance impact. As a very rough guideline, this number should not be smaller than the number of characters in documents you are processing.
        Returns:
        A new CASMgr object.
      • createCAS

        @Deprecated
        public static CASMgr createCAS​(int initialHeapSize,
                                       boolean useJcasCache)
        Deprecated.
        use createCas(int initialHeapSize)
        Parameters:
        initialHeapSize - The initial size of the internal CAS heap. If you choose this number too small, it can have a major performance impact. As a very rough guideline, this number should not be smaller than the number of characters in documents you are processing.
        useJcasCache - - ignored in v3
        Returns:
        A new CASMgr object.
      • createCAS

        public static CASMgr createCAS​(int initialHeapSize,
                                       TypeSystem ts)
        Create a new CASMgr object from a give type system.
        Parameters:
        initialHeapSize - The initial size of the internal CAS heap. If you choose this number too small, it can have a major performance impact. As a very rough guideline, this number should not be smaller than the number of characters in documents you are processing.
        ts - An existing type system (must not be null).
        Returns:
        A new CASMgr object.
      • createCAS

        public static CASMgr createCAS​(int initialHeapSize,
                                       TypeSystem ts,
                                       boolean useJcasCache)
      • createCAS

        public static CASMgr createCAS​(TypeSystem ts)
        Create a new CASMgr object from a give type system.
        Parameters:
        ts - An existing type system (must not be null).
        Returns:
        A new CASMgr object.
      • createCAS

        public static CASMgr createCAS​(TypeSystem ts,
                                       boolean useJcasCache)
      • createTypeSystem

        public static TypeSystemMgr createTypeSystem()
        Create a new type system that is populated with the built-in CAS types.
        Returns:
        A type system manager object that can be used to add more types.