# Package org.apache.uima.cas

package org.apache.uima.cas

Common Analysis System(CAS) Interfaces

## Common Analysis System (CAS) Interfaces

The CAS provides

- a set of methods for creating Feature Structures and setting / getting their Feature values, based on parameters referencing Types and Features.
- a link to the type system being used
- a container for the set of one or more "Views" - each view corresponding to a separate set of indexes, contained in a index repository. These indexes can be used to retrieve the Feature Structures that have already been created.
  - For each view:
    - a link to the indexes used to index Feature Structures
    - information about that view's (optional) Subject of Analysis (SofA).
    - convenience methods for adding Feature Structures to the view's indexes

### Type System

The Type System is a collection of types and features of each type, where the types are in a single type hierarchy. The type/feature information is collected from possibly multiple annotators that make up a UIMA pipeline, and the definitions are merged.

## Index Repository

Indexes provide a way to access those Feature Structures which have been indexed (added to the index, and not subsequently removed). Each CAS view has a separate set of indexes.

- FSIndexRepository - UIMA pipelines specify a set of index definitions to be used; these definitions are used for all views. In addition to user-specified indexes, there are two built-in indexes: the Annotation Index, and a default "bag" index that is used whenever no other index is defined, to enable retrieval of all indexed Feature Structures. When users add instances to the indexes, they do so for the indexes in just one view. Users may choose to index the same Feature Structure in multiple views, with one restriction: Feature Structures which are subtypes of AnnotationBase may only be added to the view where the Feature Structure was created. The FSIndexRepository instance per view allows access to the Feature Structures indexed in that view.
- FSIndex - represents a particular index over a type and its subtypes. There are three underlying kinds of indexes: Bag, Set, and Sorted. The Set and Sorted include a "comparator" which defines a compare order which is also used as the definition of "equal" for Sets.

### Built-in Feature Structure classes

This package holds the definition for many of the built-in Feature Structures.

The following classes are alternate interfaces for built-in Feature Structures; they remain for backwards compatibility.org.apache.uima.cas

alternate interfaces
UIMA v2 name org.apache.uima.cas | preferred org.apache.uima.jcas.cas
BooleanArrayFS | BooleanArray
ByteArrayFS | ByteArray
ShortArrayFS | ShortArray
IntegerArrayFS | IntegerArray
FloatArrayFS | FloatArray
LongArrayFS | LongArray
DoubleArrayFS | DoubleArray
SofaFS | Sofa
AnnotationBaseFS | AnnotationBase

### Constraints - used by filtered iterators

Iterators may be filtered, using constraints, specified using these interfaces.

- ConstraintFactor
- FeaturePath
- FeatureValuePath
- FSBooleanConstraint
- FSConstraint
- FSFloatConstraint
- FSIntConstraint
- FSMatchConstraint
- FSStringConstraint
- FSTypeConstraint

### Exception collections

Many of the exceptions that UIMA may throw are collected into groups here. These classes provide one level of indirection that permit IDE environments to conveniently locate and work with these.

exceptions
| Extends
CASException | UIMAException (checked)
CASRuntimeException | UIMARuntimeException

- Related Packages
  Package
  Description
  org.apache.uima
  Apache UIMA
  org.apache.uima.cas.admin
  org.apache.uima.cas.impl
  Implementation and Low-Level API for the CAS Interfaces.
  org.apache.uima.cas.text
  Text Common Annotation System (TCAS) Interfaces.
- Class
  Description
  AbstractCas
  The base interface extended by all CAS (Common Analysis System) interfaces in the UIMA SDK.
  AbstractCas_ImplBase
  Base class from which CAS implementations should extend.
  AnnotationBaseFS
  Annotation Base API.
  ArrayFS<E extends FeatureStructure>
  Feature structure array interface.
  BooleanArrayFS
  Boolean array interface.
  ByteArrayFS
  Byte array interface.
  CAS
  Object-oriented CAS (Common Analysis System) API.
  CASException
  Exception class for package org.apache.uima.cas.
  CasOwner
  Represents the "owner" of a CAS.
  CASRuntimeException
  Runtime exception class for package org.apache.uima.cas.
  CommonArrayFS<E>
  Common parts of the Array interfaces.
  ComponentInfo
  Information that a CAS needs to know about the component that's currently operating on it.
  ConstraintFactory
  Methods to create `FSMatchConstraint`s for filtered iterators or other use.
  DoubleArrayFS
  Double array interface.
  Feature
  The interface that describes features in the type system.
  FeaturePath
  Interface for a feature path.
  FeatureStructure
  Interface for feature structures.
  FeatureValuePath
  Deprecated.
  use `FeaturePath`
  FloatArrayFS
  Interface for CAS float arrays.
  FSBooleanConstraint
  Interface for a boolean constraint.
  FSComparators
  There are 4 kinds of comparators for the combinations of comparing - with or without the "id" - with or without type order (with only includes typeOrder if there is such a key included)
  FSConstraint
  Interface for feature structure constraints.
  FSFloatConstraint
  Interface for a float constraint.
  FSIndex<T extends FeatureStructure>
  Feature structure index access interface.
  FSIndexRepository
  Repository of indexes over feature structures.
  FSIntConstraint
  Interface for an integer constraint.
  FSIterator<T extends FeatureStructure>
  Iterator over feature structures.
  FSMatchConstraint
  Interface for feature structure matching constraints.
  FSStringConstraint
  Interface for a String constraint.
  FSTypeConstraint
  Interface for type constraint.
  IntArrayFS
  Interface for CAS int arrays.
  LongArrayFS
  Long array interface.
  Marker
  An object obtained from the `CAS` that is used to query when FSs were created or modified with respect to the marker.
  ParsingException
  Deprecated.
  The Constraint Parser is not supported in externally released versions of UIMA
  SelectFSs<T extends FeatureStructure>
  Collection of builder style methods to specify selection of FSs from indexes Documentation is in a chapter in the UIMA Version 3 User's Guide.
  SerialFormat
  The various forms of serialization (typically of the CAS)
  ShortArrayFS
  Short array interface.
  SofaFS
  Interface for "Subject of Analysis" (Sofa) feature structures.
  SofaID
  Deprecated.
  As of v2.0, this is no longer needed.
  StringArrayFS
  String array interface.
  Type
  The interface describing types in the type system.
  TypeClass
  This class may not be used.
  TypeNameSpace
  An object holding the namespace string for a type.
  TypeSystem
  The interface to the type system.