public static CAS createEmptyCAS(TypeSystemDescription typeSystem) { ResourceSpecifierFactory resourceSpecifierFactory = UIMAFramework .getResourceSpecifierFactory(); TypePriorities typePriorities = resourceSpecifierFactory .createTypePriorities(); FsIndexDescription indexDesciptor = new FsIndexDescription_impl(); indexDesciptor.setLabel("TOPIndex"); indexDesciptor.setTypeName("uima.cas.TOP"); indexDesciptor.setKind(FsIndexDescription.KIND_SORTED); CAS cas; try { cas = CasCreationUtils.createCas(typeSystem, typePriorities, new FsIndexDescription[] { indexDesciptor }); } catch (ResourceInitializationException e) { e.printStackTrace(); cas = null; } return cas; }
indexDesciptor.setLabel("TOPIndex"); indexDesciptor.setTypeName("uima.cas.TOP"); indexDesciptor.setKind(FsIndexDescription.KIND_SORTED);
/** * Gets the built in index description. * * @return the built in index description */ public FsIndexDescription getBuiltInIndexDescription() { if (m_builtInIndexDescription == null) { m_builtInIndexDescription = UIMAFramework.getResourceSpecifierFactory() .createFsIndexDescription(); m_builtInIndexDescription.setLabel(ANNOTATION_INDEX_BUILT_IN); m_builtInIndexDescription.setTypeName(CAS.TYPE_NAME_ANNOTATION); m_builtInIndexDescription.setKind("sorted"); FsIndexKeyDescription[] keys = new FsIndexKeyDescription[] { createFsIndexKeyDescription(), createFsIndexKeyDescription(), createFsIndexKeyDescription() }; keys[0].setFeatureName("begin"); keys[0].setComparator(FSIndexComparator.STANDARD_COMPARE); keys[1].setFeatureName("end"); keys[1].setComparator(FSIndexComparator.REVERSE_STANDARD_COMPARE); keys[2].setTypePriority(true); m_builtInIndexDescription.setKeys(keys); } return m_builtInIndexDescription; }
.createFsIndexDescription(); id.setLabel(dialog.indexName); id.setTypeName(dialog.indexType); id.setKeys(dialog.keys); fsid.setLabel(setValueChanged(dialog.indexName, fsid.getLabel())); fsid.setTypeName(setValueChanged(dialog.indexType, fsid.getTypeName())); fsid.setKeys(setValueChangedKeys(dialog.keys, fsid.getKeys()));