/** * Adds the fs index key description. * * @param fsid the fsid * @param key the key */ public void addFsIndexKeyDescription(FsIndexDescription fsid, FsIndexKeyDescription key) { FsIndexKeyDescription[] prevKeys = fsid.getKeys(); FsIndexKeyDescription[] newKeys = new FsIndexKeyDescription[prevKeys == null ? 1 : prevKeys.length + 1]; if (null != prevKeys) System.arraycopy(prevKeys, 0, newKeys, 0, prevKeys.length); newKeys[newKeys.length - 1] = key; fsid.setKeys(newKeys); }
/** * Removes the fs index key description. * * @param fsid the fsid * @param key the key */ public void removeFsIndexKeyDescription(FsIndexDescription fsid, FsIndexKeyDescription key) { fsid.setKeys((FsIndexKeyDescription[]) Utility.removeElementFromArray(fsid.getKeys(), key, FsIndexKeyDescription.class)); }
/** * 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; }
if (newFsKeys != indexes[i].getKeys()) { somethingChanged = true; indexes[i].setKeys(newFsKeys);
id.setKeys(dialog.keys); id.setKind(dialog.indexKind); fsid.setLabel(setValueChanged(dialog.indexName, fsid.getLabel())); fsid.setTypeName(setValueChanged(dialog.indexType, fsid.getTypeName())); fsid.setKeys(setValueChangedKeys(dialog.keys, fsid.getKeys())); fsid.setKind(setValueChanged(dialog.indexKind, handleDefaultIndexKind(fsid.getKind())));