/** * Deserialize a type system and index repository definition and use to initialize * a new instance of a CAS. * @param ser the CAS to receive the type system * @return the initialized CAS loaded with the deserialized info about the CAS Type systen and Index repositories */ public static CASMgr createCASMgr(CASMgrSerializer ser) { return new CASImpl(ser); }
/** * Create a new CASMgr object. * * @return A new CASMgr object. */ public static CASMgr createCAS() { return new CASImpl(); }
public static CASMgr createCAS(int initialHeapSize, boolean useJcasCache) { return new CASImpl(initialHeapSize, useJcasCache); }
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); }
public static CASMgr createCAS(int initialHeapSize, TypeSystem ts, boolean useJcasCache) { if (ts == null) { throw new NullPointerException("TypeSystem"); } return new CASImpl((TypeSystemImpl) ts, initialHeapSize, useJcasCache); }
CAS getInitialView() { CAS couldBeThis = getViewFromSofaNbr(1); if (couldBeThis != null) { return couldBeThis; } // create the initial view, without a Sofa CAS aView = new CASImpl(this.svd.baseCAS, null, this.isUsedJcasCache); setViewForSofaNbr(1, aView); assert (this.svd.viewCount <= 1); this.svd.viewCount = 1; return aView; }
@Override public CAS getView(SofaFS aSofa) { final int sofaNbr = aSofa.getSofaRef(); // final Integer sofaNbrInteger = Integer.valueOf(sofaNbr); CASImpl aView = (CASImpl) getViewFromSofaNbr(sofaNbr); if (null == aView) { // This is the deserializer case, or the case where an older API created a // sofa, // which is now creating the associated view // create a new CAS view aView = new CASImpl(this.svd.baseCAS, aSofa, this.isUsedJcasCache); setViewForSofaNbr(sofaNbr, aView); verifySofaNameUniqueIfDeserializedViewAdded(sofaNbr, aSofa); return aView; } // for deserialization - might be reusing a view, and need to tie new Sofa // to old View if (0 == aView.mySofaRef) { aView.mySofaRef = ((FeatureStructureImpl) aSofa).getAddress(); } verifySofaNameUniqueIfDeserializedViewAdded(sofaNbr, aSofa); return aView; }