Package org.apache.uima.cas.impl

Examples of org.apache.uima.cas.impl.CASImpl


      Object[] initargs = new Object[2];
      JCasImpl jcasView = null;
      // this funny logic is because although the annotationView should always be set if
      // a type is a subtype of annotation, it isn't always set if an application uses low-level
      // api's. Rather than blow up, we limp along.
      CASImpl maybeAnnotationView = null;
      if (isSubtypeOfAnnotationBase) {
        final int sofaNbr = getSofaNbr(addr, casView);
        if (sofaNbr > 0) {
          maybeAnnotationView = (CASImpl) casView.getView(sofaNbr);
        }
      }
      final CASImpl view = (null != maybeAnnotationView) ? maybeAnnotationView : casView;

      try {
        jcasView = (JCasImpl) view.getJCas();
      } catch (CASException e1) {
        logAndThrow(e1, jcasView);
      }

      // Return eq fs instance if already created
View Full Code Here


   *                    If <code>srcOffset &lt; 0</code> or
   *                    <code>length &gt; size()</code> or
   *                    <code>destOffset + length &gt; destArray.length</code>.
   */
  public void copyToArray(int srcOffset, String[] dest, int destOffset, int length) {
    CASImpl ll = jcasType.casImpl;
    ll.checkArrayBounds(addr, srcOffset, length);
    for (int i = 0; i < length; i++) {
      dest[i + destOffset] = ll.ll_getFSForRef(ll.ll_getRefArrayValue(this.addr, i + srcOffset)).toString();
    }
  }
View Full Code Here

   * @see org.apache.uima.cas.text.AnnotationFS#getCoveredText()
   * @param inst low level reference to a Feature Structure
   * @return null or the covered text
   */
  public String getCoveredText(int inst) {
    final CASImpl casView = ll_cas.ll_getSofaCasView(inst);
    final String text = casView.getDocumentText();
    if (text == null) {
      return null;
    }
    return text.substring(getBegin(inst), getEnd(inst));
  }
View Full Code Here

   */
  @Deprecated
  public Sofa(JCas jcas, SofaID ID, String mimeType) {
    super(jcas);
    final CASImpl casImpl = jcasType.casImpl;
    casImpl.addSofa(casImpl.createFS(this.addr), ID.getSofaID(), mimeType);
    casImpl.getView(this); // needed to make reset work
  }
View Full Code Here

   * Create a new CASMgr object.
   *
   * @return A new CASMgr object.
   */
  public static CASMgr createCAS() {
    return new CASImpl();
  }
View Full Code Here

  public static CASMgr createCAS(int initialHeapSize) {
    return createCAS(initialHeapSize, USE_JCAS_CACHE_DEFAULT);
  }
 
  public static CASMgr createCAS(int initialHeapSize, boolean useJcasCache) {
    return new CASImpl(initialHeapSize, useJcasCache);
  }
View Full Code Here

 
  public static CASMgr createCAS(int initialHeapSize, TypeSystem ts, boolean useJcasCache) {
    if (ts == null) {
      throw new NullPointerException("TypeSystem");
    }
    return new CASImpl((TypeSystemImpl) ts, initialHeapSize, useJcasCache);
  }
View Full Code Here

 
  public static CASMgr createCAS(TypeSystem ts, boolean useJcasCache) {
    if (ts == null) {
      throw new NullPointerException("TypeSystem");
    }
    return new CASImpl((TypeSystemImpl) ts, CASImpl.DEFAULT_INITIAL_HEAP_SIZE, useJcasCache);
  }
View Full Code Here

   *             also create the Sofa for that view.
   */
  @Deprecated
  public Sofa(JCas jcas, SofaID ID, String mimeType) {
    super(jcas);
    final CASImpl casImpl = jcasType.casImpl;
    casImpl.addSofa(casImpl.createFS(this.addr), ID.getSofaID(), mimeType);
    casImpl.getView(this); // needed to make reset work
  }
View Full Code Here

  /**
   * @see org.apache.uima.cas.text.AnnotationFS#getCoveredText()
   */
  public String getCoveredText(int inst) {
    final CASImpl casView = ll_cas.ll_getSofaCasView(inst);
    final String text = casView.getDocumentText();
    if (text == null) {
      return null;
    }
    return text.substring(getBegin(inst), getEnd(inst));
  }
View Full Code Here

TOP

Related Classes of org.apache.uima.cas.impl.CASImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.