You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by jo...@apache.org on 2009/05/30 13:13:01 UTC
svn commit: r780236 [5/6] - in /incubator/uima/sandbox/trunk/Lucas: ./ src/
src/main/ src/main/java/ src/main/java/org/ src/main/java/org/apache/
src/main/java/org/apache/uima/ src/main/java/org/apache/uima/lucas/
src/main/java/org/apache/uima/lucas/co...
Added: incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/analysis/UniqueFilterTest.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/analysis/UniqueFilterTest.java?rev=780236&view=auto
==============================================================================
--- incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/analysis/UniqueFilterTest.java (added)
+++ incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/analysis/UniqueFilterTest.java Sat May 30 11:12:58 2009
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.uima.lucas.indexer.analysis;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import junit.framework.TestCase;
+
+import org.apache.lucene.analysis.Token;
+import org.apache.lucene.analysis.TokenFilter;
+import org.apache.lucene.analysis.TokenStream;
+import org.apache.uima.lucas.indexer.analysis.UniqueFilter;
+import org.apache.uima.lucas.indexer.test.util.CollectionTokenStream;
+
+public class UniqueFilterTest extends TestCase {
+
+ public void testUniqueFilter() throws Exception {
+ Collection<Token> tokens = new ArrayList<Token>();
+ tokens.add(new Token("token1", 0, 6));
+ tokens.add(new Token("token1", 7, 13));
+ tokens.add(new Token("token2", 14, 20));
+ tokens.add(new Token("token2", 21, 27));
+ tokens.add(new Token("token3", 28, 33));
+ tokens.add(new Token("token4", 34, 40));
+
+ TokenStream tokenStream = new CollectionTokenStream(tokens);
+ TokenFilter filter = new UniqueFilter(tokenStream);
+
+ Token nextToken = filter.next();
+ assertNotNull(nextToken);
+ assertEquals("token1", new String(nextToken.termBuffer(), 0, nextToken.termLength()));
+
+ nextToken = filter.next();
+ assertNotNull(nextToken);
+ assertEquals("token2", new String(nextToken.termBuffer(), 0, nextToken.termLength()));
+
+ nextToken = filter.next();
+ assertNotNull(nextToken);
+ assertEquals("token3", new String(nextToken.termBuffer(), 0, nextToken.termLength()));
+
+ nextToken = filter.next();
+ assertNotNull(nextToken);
+ assertEquals("token4", new String(nextToken.termBuffer(), 0, nextToken.termLength()));
+
+ assertNull(filter.next());
+ }
+}
Propchange: incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/analysis/UniqueFilterTest.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/analysis/UppercaseTokenFilterTest.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/analysis/UppercaseTokenFilterTest.java?rev=780236&view=auto
==============================================================================
--- incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/analysis/UppercaseTokenFilterTest.java (added)
+++ incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/analysis/UppercaseTokenFilterTest.java Sat May 30 11:12:58 2009
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.uima.lucas.indexer.analysis;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import junit.framework.TestCase;
+
+import org.apache.lucene.analysis.Token;
+import org.apache.lucene.analysis.TokenStream;
+import org.apache.uima.lucas.indexer.analysis.UpperCaseTokenFilter;
+import org.apache.uima.lucas.indexer.test.util.CollectionTokenStream;
+
+public class UppercaseTokenFilterTest extends TestCase {
+
+ public void testNext() throws Exception {
+ List<Token> tokens = new ArrayList<Token>();
+ tokens.add(new Token("token1", 0, 6));
+ tokens.add(new Token("token2", 7, 13));
+ tokens.add(new Token("token3", 14, 20));
+
+ TokenStream tokenStream = new CollectionTokenStream(tokens);
+
+ UpperCaseTokenFilter upperCaseTokenFilter = new UpperCaseTokenFilter(tokenStream);
+
+ Token next = upperCaseTokenFilter.next();
+
+ String nextString = new String(next.termBuffer(), 0, next.termLength());
+ assertEquals("TOKEN1", nextString);
+
+ next = upperCaseTokenFilter.next();
+ nextString = new String(next.termBuffer(), 0, next.termLength());
+ assertEquals("TOKEN2", nextString);
+
+ next = upperCaseTokenFilter.next();
+ nextString = new String(next.termBuffer(), 0, next.termLength());
+ assertEquals("TOKEN3", nextString);
+
+ }
+}
Propchange: incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/analysis/UppercaseTokenFilterTest.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/test/util/CollectionTokenStream.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/test/util/CollectionTokenStream.java?rev=780236&view=auto
==============================================================================
--- incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/test/util/CollectionTokenStream.java (added)
+++ incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/test/util/CollectionTokenStream.java Sat May 30 11:12:58 2009
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.uima.lucas.indexer.test.util;
+
+import java.io.IOException;
+import java.util.Collection;
+import java.util.Iterator;
+
+import org.apache.lucene.analysis.Token;
+import org.apache.lucene.analysis.TokenStream;
+
+public class CollectionTokenStream extends TokenStream {
+
+ private Iterator<Token> tokenIterator;
+
+ private Collection<Token> tokens;
+
+ public CollectionTokenStream(Collection<Token> tokens) {
+ super();
+ this.tokenIterator = tokens.iterator();
+ this.tokens = tokens;
+ }
+
+ @Override
+ public Token next() throws IOException {
+ if (tokenIterator.hasNext())
+ return tokenIterator.next();
+ else
+ return null;
+ }
+
+ @Override
+ public void reset() throws IOException {
+ super.reset();
+ this.tokenIterator = tokens.iterator();
+ }
+}
Propchange: incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/test/util/CollectionTokenStream.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/test/util/DummyTokenStream.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/test/util/DummyTokenStream.java?rev=780236&view=auto
==============================================================================
--- incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/test/util/DummyTokenStream.java (added)
+++ incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/test/util/DummyTokenStream.java Sat May 30 11:12:58 2009
@@ -0,0 +1,68 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.uima.lucas.indexer.test.util;
+
+import java.io.IOException;
+
+import org.apache.lucene.analysis.Token;
+import org.apache.lucene.analysis.TokenStream;
+
+public class DummyTokenStream extends TokenStream {
+ private int count = 0;
+
+ private String tokenValue;
+
+ private int distance;
+
+ private int number;
+
+ private int begin;
+
+ private int end;
+
+ public DummyTokenStream(String tokenValue, int distance, int number, int offset) {
+ this.tokenValue = tokenValue;
+ this.distance = distance;
+ this.number = number;
+
+ if (offset > 0) {
+ count = offset;
+ begin = count * (tokenValue.length() + 1);
+ end = count * (tokenValue.length() + 1) + tokenValue.length();
+ } else {
+ begin = 0;
+ end = tokenValue.length();
+ }
+ }
+
+ public Token next() throws IOException {
+ if (number <= count / distance)
+ return null;
+
+ Token token = new Token(tokenValue, begin, end);
+
+ count += distance;
+ begin += distance * (tokenValue.length() + 1);
+ end += distance * (tokenValue.length() + 1);
+
+ System.out.println(token);
+ return token;
+ }
+}
Propchange: incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/test/util/DummyTokenStream.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/test/util/MockCollectionReader.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/test/util/MockCollectionReader.java?rev=780236&view=auto
==============================================================================
--- incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/test/util/MockCollectionReader.java (added)
+++ incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/test/util/MockCollectionReader.java Sat May 30 11:12:58 2009
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.uima.lucas.indexer.test.util;
+
+import java.io.IOException;
+
+import org.apache.uima.cas.CAS;
+import org.apache.uima.collection.CollectionException;
+import org.apache.uima.collection.CollectionReader_ImplBase;
+import org.apache.uima.util.Progress;
+
+public class MockCollectionReader extends CollectionReader_ImplBase {
+
+ public void getNext(CAS cas) throws IOException, CollectionException {
+ }
+
+ public void close() throws IOException {
+ }
+
+ public Progress[] getProgress() {
+ return null;
+ }
+
+ public boolean hasNext() throws IOException, CollectionException {
+ return false;
+ }
+}
Propchange: incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/test/util/MockCollectionReader.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/types/test/Annotation1.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/types/test/Annotation1.java?rev=780236&view=auto
==============================================================================
--- incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/types/test/Annotation1.java (added)
+++ incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/types/test/Annotation1.java Sat May 30 11:12:58 2009
@@ -0,0 +1,337 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/* First created by JCasGen Fri Jan 16 11:22:31 CET 2009 */
+package org.apache.uima.lucas.indexer.types.test;
+
+import org.apache.uima.jcas.JCas;
+import org.apache.uima.jcas.JCasRegistry;
+import org.apache.uima.jcas.cas.FSArray;
+import org.apache.uima.jcas.cas.StringArray;
+import org.apache.uima.jcas.cas.TOP_Type;
+import org.apache.uima.jcas.tcas.Annotation;
+
+/**
+ * Updated by JCasGen Fri Jan 16 11:22:31 CET 2009 XML source:
+ * /home/landefeld/workspace/jules-lucene
+ * -indexer/src/test/resources/AnnotationTokenStreamTestTypeSystem.xml
+ *
+ * @generated
+ */
+public class Annotation1 extends Annotation {
+ /**
+ * @generated
+ * @ordered
+ */
+ public final static int typeIndexID = JCasRegistry.register(Annotation1.class);
+
+ /**
+ * @generated
+ * @ordered
+ */
+ public final static int type = typeIndexID;
+
+ /** @generated */
+ public int getTypeIndexID() {
+ return typeIndexID;
+ }
+
+ /**
+ * Never called. Disable default constructor
+ *
+ * @generated
+ */
+ protected Annotation1() {
+ }
+
+ /**
+ * Internal - constructor used by generator
+ *
+ * @generated
+ */
+ public Annotation1(int addr, TOP_Type type) {
+ super(addr, type);
+ readObject();
+ }
+
+ /** @generated */
+ public Annotation1(JCas jcas) {
+ super(jcas);
+ readObject();
+ }
+
+ /** @generated */
+ public Annotation1(JCas jcas, int begin, int end) {
+ super(jcas);
+ setBegin(begin);
+ setEnd(end);
+ readObject();
+ }
+
+ /**
+ * <!-- begin-user-doc --> Write your own initialization here <!-- end-user-doc -->
+ *
+ * @generated modifiable
+ */
+ private void readObject() {
+ }
+
+ // *--------------*
+ // * Feature: featureString
+
+ /**
+ * getter for featureString - gets
+ *
+ * @generated
+ */
+ public String getFeatureString() {
+ if (Annotation1_Type.featOkTst && ((Annotation1_Type) jcasType).casFeat_featureString == null)
+ jcasType.jcas.throwFeatMissing("featureString", "de.julielab.jules.types.test.Annotation1");
+ return jcasType.ll_cas.ll_getStringValue(addr,
+ ((Annotation1_Type) jcasType).casFeatCode_featureString);
+ }
+
+ /**
+ * setter for featureString - sets
+ *
+ * @generated
+ */
+ public void setFeatureString(String v) {
+ if (Annotation1_Type.featOkTst && ((Annotation1_Type) jcasType).casFeat_featureString == null)
+ jcasType.jcas.throwFeatMissing("featureString", "de.julielab.jules.types.test.Annotation1");
+ jcasType.ll_cas.ll_setStringValue(addr,
+ ((Annotation1_Type) jcasType).casFeatCode_featureString, v);
+ }
+
+ // *--------------*
+ // * Feature: featureStringArray
+
+ /**
+ * getter for featureStringArray - gets
+ *
+ * @generated
+ */
+ public StringArray getFeatureStringArray() {
+ if (Annotation1_Type.featOkTst
+ && ((Annotation1_Type) jcasType).casFeat_featureStringArray == null)
+ jcasType.jcas.throwFeatMissing("featureStringArray",
+ "de.julielab.jules.types.test.Annotation1");
+ return (StringArray) (jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr,
+ ((Annotation1_Type) jcasType).casFeatCode_featureStringArray)));
+ }
+
+ /**
+ * setter for featureStringArray - sets
+ *
+ * @generated
+ */
+ public void setFeatureStringArray(StringArray v) {
+ if (Annotation1_Type.featOkTst
+ && ((Annotation1_Type) jcasType).casFeat_featureStringArray == null)
+ jcasType.jcas.throwFeatMissing("featureStringArray",
+ "de.julielab.jules.types.test.Annotation1");
+ jcasType.ll_cas.ll_setRefValue(addr,
+ ((Annotation1_Type) jcasType).casFeatCode_featureStringArray, jcasType.ll_cas
+ .ll_getFSRef(v));
+ }
+
+ /**
+ * indexed getter for featureStringArray - gets an indexed value -
+ *
+ * @generated
+ */
+ public String getFeatureStringArray(int i) {
+ if (Annotation1_Type.featOkTst
+ && ((Annotation1_Type) jcasType).casFeat_featureStringArray == null)
+ jcasType.jcas.throwFeatMissing("featureStringArray",
+ "de.julielab.jules.types.test.Annotation1");
+ jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(addr,
+ ((Annotation1_Type) jcasType).casFeatCode_featureStringArray), i);
+ return jcasType.ll_cas.ll_getStringArrayValue(jcasType.ll_cas.ll_getRefValue(addr,
+ ((Annotation1_Type) jcasType).casFeatCode_featureStringArray), i);
+ }
+
+ /**
+ * indexed setter for featureStringArray - sets an indexed value -
+ *
+ * @generated
+ */
+ public void setFeatureStringArray(int i, String v) {
+ if (Annotation1_Type.featOkTst
+ && ((Annotation1_Type) jcasType).casFeat_featureStringArray == null)
+ jcasType.jcas.throwFeatMissing("featureStringArray",
+ "de.julielab.jules.types.test.Annotation1");
+ jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(addr,
+ ((Annotation1_Type) jcasType).casFeatCode_featureStringArray), i);
+ jcasType.ll_cas.ll_setStringArrayValue(jcasType.ll_cas.ll_getRefValue(addr,
+ ((Annotation1_Type) jcasType).casFeatCode_featureStringArray), i, v);
+ }
+
+ // *--------------*
+ // * Feature: featureInteger
+
+ /**
+ * getter for featureInteger - gets
+ *
+ * @generated
+ */
+ public int getFeatureInteger() {
+ if (Annotation1_Type.featOkTst && ((Annotation1_Type) jcasType).casFeat_featureInteger == null)
+ jcasType.jcas.throwFeatMissing("featureInteger", "de.julielab.jules.types.test.Annotation1");
+ return jcasType.ll_cas.ll_getIntValue(addr,
+ ((Annotation1_Type) jcasType).casFeatCode_featureInteger);
+ }
+
+ /**
+ * setter for featureInteger - sets
+ *
+ * @generated
+ */
+ public void setFeatureInteger(int v) {
+ if (Annotation1_Type.featOkTst && ((Annotation1_Type) jcasType).casFeat_featureInteger == null)
+ jcasType.jcas.throwFeatMissing("featureInteger", "de.julielab.jules.types.test.Annotation1");
+ jcasType.ll_cas.ll_setIntValue(addr, ((Annotation1_Type) jcasType).casFeatCode_featureInteger,
+ v);
+ }
+
+ // *--------------*
+ // * Feature: featureFloat
+
+ /**
+ * getter for featureFloat - gets
+ *
+ * @generated
+ */
+ public float getFeatureFloat() {
+ if (Annotation1_Type.featOkTst && ((Annotation1_Type) jcasType).casFeat_featureFloat == null)
+ jcasType.jcas.throwFeatMissing("featureFloat", "de.julielab.jules.types.test.Annotation1");
+ return jcasType.ll_cas.ll_getFloatValue(addr,
+ ((Annotation1_Type) jcasType).casFeatCode_featureFloat);
+ }
+
+ /**
+ * setter for featureFloat - sets
+ *
+ * @generated
+ */
+ public void setFeatureFloat(float v) {
+ if (Annotation1_Type.featOkTst && ((Annotation1_Type) jcasType).casFeat_featureFloat == null)
+ jcasType.jcas.throwFeatMissing("featureFloat", "de.julielab.jules.types.test.Annotation1");
+ jcasType.ll_cas.ll_setFloatValue(addr, ((Annotation1_Type) jcasType).casFeatCode_featureFloat,
+ v);
+ }
+
+ // *--------------*
+ // * Feature: featureStructure1
+
+ /**
+ * getter for featureStructure1 - gets
+ *
+ * @generated
+ */
+ public FeatureStructure1 getFeatureStructure1() {
+ if (Annotation1_Type.featOkTst
+ && ((Annotation1_Type) jcasType).casFeat_featureStructure1 == null)
+ jcasType.jcas.throwFeatMissing("featureStructure1",
+ "de.julielab.jules.types.test.Annotation1");
+ return (FeatureStructure1) (jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr,
+ ((Annotation1_Type) jcasType).casFeatCode_featureStructure1)));
+ }
+
+ /**
+ * setter for featureStructure1 - sets
+ *
+ * @generated
+ */
+ public void setFeatureStructure1(FeatureStructure1 v) {
+ if (Annotation1_Type.featOkTst
+ && ((Annotation1_Type) jcasType).casFeat_featureStructure1 == null)
+ jcasType.jcas.throwFeatMissing("featureStructure1",
+ "de.julielab.jules.types.test.Annotation1");
+ jcasType.ll_cas.ll_setRefValue(addr,
+ ((Annotation1_Type) jcasType).casFeatCode_featureStructure1, jcasType.ll_cas
+ .ll_getFSRef(v));
+ }
+
+ // *--------------*
+ // * Feature: featureStructures1
+
+ /**
+ * getter for featureStructures1 - gets
+ *
+ * @generated
+ */
+ public FSArray getFeatureStructures1() {
+ if (Annotation1_Type.featOkTst
+ && ((Annotation1_Type) jcasType).casFeat_featureStructures1 == null)
+ jcasType.jcas.throwFeatMissing("featureStructures1",
+ "de.julielab.jules.types.test.Annotation1");
+ return (FSArray) (jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr,
+ ((Annotation1_Type) jcasType).casFeatCode_featureStructures1)));
+ }
+
+ /**
+ * setter for featureStructures1 - sets
+ *
+ * @generated
+ */
+ public void setFeatureStructures1(FSArray v) {
+ if (Annotation1_Type.featOkTst
+ && ((Annotation1_Type) jcasType).casFeat_featureStructures1 == null)
+ jcasType.jcas.throwFeatMissing("featureStructures1",
+ "de.julielab.jules.types.test.Annotation1");
+ jcasType.ll_cas.ll_setRefValue(addr,
+ ((Annotation1_Type) jcasType).casFeatCode_featureStructures1, jcasType.ll_cas
+ .ll_getFSRef(v));
+ }
+
+ /**
+ * indexed getter for featureStructures1 - gets an indexed value -
+ *
+ * @generated
+ */
+ public FeatureStructure1 getFeatureStructures1(int i) {
+ if (Annotation1_Type.featOkTst
+ && ((Annotation1_Type) jcasType).casFeat_featureStructures1 == null)
+ jcasType.jcas.throwFeatMissing("featureStructures1",
+ "de.julielab.jules.types.test.Annotation1");
+ jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(addr,
+ ((Annotation1_Type) jcasType).casFeatCode_featureStructures1), i);
+ return (FeatureStructure1) (jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefArrayValue(
+ jcasType.ll_cas.ll_getRefValue(addr,
+ ((Annotation1_Type) jcasType).casFeatCode_featureStructures1), i)));
+ }
+
+ /**
+ * indexed setter for featureStructures1 - sets an indexed value -
+ *
+ * @generated
+ */
+ public void setFeatureStructures1(int i, FeatureStructure1 v) {
+ if (Annotation1_Type.featOkTst
+ && ((Annotation1_Type) jcasType).casFeat_featureStructures1 == null)
+ jcasType.jcas.throwFeatMissing("featureStructures1",
+ "de.julielab.jules.types.test.Annotation1");
+ jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(addr,
+ ((Annotation1_Type) jcasType).casFeatCode_featureStructures1), i);
+ jcasType.ll_cas.ll_setRefArrayValue(jcasType.ll_cas.ll_getRefValue(addr,
+ ((Annotation1_Type) jcasType).casFeatCode_featureStructures1), i, jcasType.ll_cas
+ .ll_getFSRef(v));
+ }
+}
Propchange: incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/types/test/Annotation1.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/types/test/Annotation1_Type.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/types/test/Annotation1_Type.java?rev=780236&view=auto
==============================================================================
--- incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/types/test/Annotation1_Type.java (added)
+++ incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/types/test/Annotation1_Type.java Sat May 30 11:12:58 2009
@@ -0,0 +1,288 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/* First created by JCasGen Fri Jan 16 11:22:34 CET 2009 */
+package org.apache.uima.lucas.indexer.types.test;
+
+import org.apache.uima.cas.Feature;
+import org.apache.uima.cas.FeatureStructure;
+import org.apache.uima.cas.Type;
+import org.apache.uima.cas.impl.CASImpl;
+import org.apache.uima.cas.impl.FSGenerator;
+import org.apache.uima.cas.impl.FeatureImpl;
+import org.apache.uima.cas.impl.TypeImpl;
+import org.apache.uima.jcas.JCas;
+import org.apache.uima.jcas.JCasRegistry;
+import org.apache.uima.jcas.tcas.Annotation_Type;
+
+/**
+ * Updated by JCasGen Fri Jan 16 11:22:34 CET 2009
+ *
+ * @generated
+ */
+public class Annotation1_Type extends Annotation_Type {
+ /** @generated */
+ protected FSGenerator getFSGenerator() {
+ return fsGenerator;
+ }
+
+ /** @generated */
+ private final FSGenerator fsGenerator = new FSGenerator() {
+ public FeatureStructure createFS(int addr, CASImpl cas) {
+ if (Annotation1_Type.this.useExistingInstance) {
+ // Return eq fs instance if already created
+ FeatureStructure fs = Annotation1_Type.this.jcas.getJfsFromCaddr(addr);
+ if (null == fs) {
+ fs = new Annotation1(addr, Annotation1_Type.this);
+ Annotation1_Type.this.jcas.putJfsFromCaddr(addr, fs);
+ return fs;
+ }
+ return fs;
+ } else
+ return new Annotation1(addr, Annotation1_Type.this);
+ }
+ };
+
+ /** @generated */
+ public final static int typeIndexID = Annotation1.typeIndexID;
+
+ /**
+ * @generated
+ * @modifiable
+ */
+ public final static boolean featOkTst =
+ JCasRegistry.getFeatOkTst("de.julielab.jules.types.test.Annotation1");
+
+ /** @generated */
+ final Feature casFeat_featureString;
+
+ /** @generated */
+ final int casFeatCode_featureString;
+
+ /** @generated */
+ public String getFeatureString(int addr) {
+ if (featOkTst && casFeat_featureString == null)
+ jcas.throwFeatMissing("featureString", "de.julielab.jules.types.test.Annotation1");
+ return ll_cas.ll_getStringValue(addr, casFeatCode_featureString);
+ }
+
+ /** @generated */
+ public void setFeatureString(int addr, String v) {
+ if (featOkTst && casFeat_featureString == null)
+ jcas.throwFeatMissing("featureString", "de.julielab.jules.types.test.Annotation1");
+ ll_cas.ll_setStringValue(addr, casFeatCode_featureString, v);
+ }
+
+ /** @generated */
+ final Feature casFeat_featureStringArray;
+
+ /** @generated */
+ final int casFeatCode_featureStringArray;
+
+ /** @generated */
+ public int getFeatureStringArray(int addr) {
+ if (featOkTst && casFeat_featureStringArray == null)
+ jcas.throwFeatMissing("featureStringArray", "de.julielab.jules.types.test.Annotation1");
+ return ll_cas.ll_getRefValue(addr, casFeatCode_featureStringArray);
+ }
+
+ /** @generated */
+ public void setFeatureStringArray(int addr, int v) {
+ if (featOkTst && casFeat_featureStringArray == null)
+ jcas.throwFeatMissing("featureStringArray", "de.julielab.jules.types.test.Annotation1");
+ ll_cas.ll_setRefValue(addr, casFeatCode_featureStringArray, v);
+ }
+
+ /** @generated */
+ public String getFeatureStringArray(int addr, int i) {
+ if (featOkTst && casFeat_featureStringArray == null)
+ jcas.throwFeatMissing("featureStringArray", "de.julielab.jules.types.test.Annotation1");
+ if (lowLevelTypeChecks)
+ return ll_cas.ll_getStringArrayValue(ll_cas.ll_getRefValue(addr,
+ casFeatCode_featureStringArray), i, true);
+ jcas.checkArrayBounds(ll_cas.ll_getRefValue(addr, casFeatCode_featureStringArray), i);
+ return ll_cas.ll_getStringArrayValue(ll_cas
+ .ll_getRefValue(addr, casFeatCode_featureStringArray), i);
+ }
+
+ /** @generated */
+ public void setFeatureStringArray(int addr, int i, String v) {
+ if (featOkTst && casFeat_featureStringArray == null)
+ jcas.throwFeatMissing("featureStringArray", "de.julielab.jules.types.test.Annotation1");
+ if (lowLevelTypeChecks)
+ ll_cas.ll_setStringArrayValue(ll_cas.ll_getRefValue(addr, casFeatCode_featureStringArray), i,
+ v, true);
+ jcas.checkArrayBounds(ll_cas.ll_getRefValue(addr, casFeatCode_featureStringArray), i);
+ ll_cas
+ .ll_setStringArrayValue(ll_cas.ll_getRefValue(addr, casFeatCode_featureStringArray), i,
+ v);
+ }
+
+ /** @generated */
+ final Feature casFeat_featureInteger;
+
+ /** @generated */
+ final int casFeatCode_featureInteger;
+
+ /** @generated */
+ public int getFeatureInteger(int addr) {
+ if (featOkTst && casFeat_featureInteger == null)
+ jcas.throwFeatMissing("featureInteger", "de.julielab.jules.types.test.Annotation1");
+ return ll_cas.ll_getIntValue(addr, casFeatCode_featureInteger);
+ }
+
+ /** @generated */
+ public void setFeatureInteger(int addr, int v) {
+ if (featOkTst && casFeat_featureInteger == null)
+ jcas.throwFeatMissing("featureInteger", "de.julielab.jules.types.test.Annotation1");
+ ll_cas.ll_setIntValue(addr, casFeatCode_featureInteger, v);
+ }
+
+ /** @generated */
+ final Feature casFeat_featureFloat;
+
+ /** @generated */
+ final int casFeatCode_featureFloat;
+
+ /** @generated */
+ public float getFeatureFloat(int addr) {
+ if (featOkTst && casFeat_featureFloat == null)
+ jcas.throwFeatMissing("featureFloat", "de.julielab.jules.types.test.Annotation1");
+ return ll_cas.ll_getFloatValue(addr, casFeatCode_featureFloat);
+ }
+
+ /** @generated */
+ public void setFeatureFloat(int addr, float v) {
+ if (featOkTst && casFeat_featureFloat == null)
+ jcas.throwFeatMissing("featureFloat", "de.julielab.jules.types.test.Annotation1");
+ ll_cas.ll_setFloatValue(addr, casFeatCode_featureFloat, v);
+ }
+
+ /** @generated */
+ final Feature casFeat_featureStructure1;
+
+ /** @generated */
+ final int casFeatCode_featureStructure1;
+
+ /** @generated */
+ public int getFeatureStructure1(int addr) {
+ if (featOkTst && casFeat_featureStructure1 == null)
+ jcas.throwFeatMissing("featureStructure1", "de.julielab.jules.types.test.Annotation1");
+ return ll_cas.ll_getRefValue(addr, casFeatCode_featureStructure1);
+ }
+
+ /** @generated */
+ public void setFeatureStructure1(int addr, int v) {
+ if (featOkTst && casFeat_featureStructure1 == null)
+ jcas.throwFeatMissing("featureStructure1", "de.julielab.jules.types.test.Annotation1");
+ ll_cas.ll_setRefValue(addr, casFeatCode_featureStructure1, v);
+ }
+
+ /** @generated */
+ final Feature casFeat_featureStructures1;
+
+ /** @generated */
+ final int casFeatCode_featureStructures1;
+
+ /** @generated */
+ public int getFeatureStructures1(int addr) {
+ if (featOkTst && casFeat_featureStructures1 == null)
+ jcas.throwFeatMissing("featureStructures1", "de.julielab.jules.types.test.Annotation1");
+ return ll_cas.ll_getRefValue(addr, casFeatCode_featureStructures1);
+ }
+
+ /** @generated */
+ public void setFeatureStructures1(int addr, int v) {
+ if (featOkTst && casFeat_featureStructures1 == null)
+ jcas.throwFeatMissing("featureStructures1", "de.julielab.jules.types.test.Annotation1");
+ ll_cas.ll_setRefValue(addr, casFeatCode_featureStructures1, v);
+ }
+
+ /** @generated */
+ public int getFeatureStructures1(int addr, int i) {
+ if (featOkTst && casFeat_featureStructures1 == null)
+ jcas.throwFeatMissing("featureStructures1", "de.julielab.jules.types.test.Annotation1");
+ if (lowLevelTypeChecks)
+ return ll_cas.ll_getRefArrayValue(
+ ll_cas.ll_getRefValue(addr, casFeatCode_featureStructures1), i, true);
+ jcas.checkArrayBounds(ll_cas.ll_getRefValue(addr, casFeatCode_featureStructures1), i);
+ return ll_cas.ll_getRefArrayValue(ll_cas.ll_getRefValue(addr, casFeatCode_featureStructures1),
+ i);
+ }
+
+ /** @generated */
+ public void setFeatureStructures1(int addr, int i, int v) {
+ if (featOkTst && casFeat_featureStructures1 == null)
+ jcas.throwFeatMissing("featureStructures1", "de.julielab.jules.types.test.Annotation1");
+ if (lowLevelTypeChecks)
+ ll_cas.ll_setRefArrayValue(ll_cas.ll_getRefValue(addr, casFeatCode_featureStructures1), i, v,
+ true);
+ jcas.checkArrayBounds(ll_cas.ll_getRefValue(addr, casFeatCode_featureStructures1), i);
+ ll_cas.ll_setRefArrayValue(ll_cas.ll_getRefValue(addr, casFeatCode_featureStructures1), i, v);
+ }
+
+ /**
+ * initialize variables to correspond with Cas Type and Features
+ *
+ * @generated
+ */
+ public Annotation1_Type(JCas jcas, Type casType) {
+ super(jcas, casType);
+ casImpl.getFSClassRegistry().addGeneratorForType((TypeImpl) this.casType, getFSGenerator());
+
+ casFeat_featureString =
+ jcas.getRequiredFeatureDE(casType, "featureString", "uima.cas.String", featOkTst);
+ casFeatCode_featureString =
+ (null == casFeat_featureString) ? JCas.INVALID_FEATURE_CODE
+ : ((FeatureImpl) casFeat_featureString).getCode();
+
+ casFeat_featureStringArray =
+ jcas.getRequiredFeatureDE(casType, "featureStringArray", "uima.cas.StringArray",
+ featOkTst);
+ casFeatCode_featureStringArray =
+ (null == casFeat_featureStringArray) ? JCas.INVALID_FEATURE_CODE
+ : ((FeatureImpl) casFeat_featureStringArray).getCode();
+
+ casFeat_featureInteger =
+ jcas.getRequiredFeatureDE(casType, "featureInteger", "uima.cas.Integer", featOkTst);
+ casFeatCode_featureInteger =
+ (null == casFeat_featureInteger) ? JCas.INVALID_FEATURE_CODE
+ : ((FeatureImpl) casFeat_featureInteger).getCode();
+
+ casFeat_featureFloat =
+ jcas.getRequiredFeatureDE(casType, "featureFloat", "uima.cas.Float", featOkTst);
+ casFeatCode_featureFloat =
+ (null == casFeat_featureFloat) ? JCas.INVALID_FEATURE_CODE
+ : ((FeatureImpl) casFeat_featureFloat).getCode();
+
+ casFeat_featureStructure1 =
+ jcas.getRequiredFeatureDE(casType, "featureStructure1",
+ "de.julielab.jules.types.test.FeatureStructure1", featOkTst);
+ casFeatCode_featureStructure1 =
+ (null == casFeat_featureStructure1) ? JCas.INVALID_FEATURE_CODE
+ : ((FeatureImpl) casFeat_featureStructure1).getCode();
+
+ casFeat_featureStructures1 =
+ jcas.getRequiredFeatureDE(casType, "featureStructures1", "uima.cas.FSArray", featOkTst);
+ casFeatCode_featureStructures1 =
+ (null == casFeat_featureStructures1) ? JCas.INVALID_FEATURE_CODE
+ : ((FeatureImpl) casFeat_featureStructures1).getCode();
+
+ }
+}
Propchange: incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/types/test/Annotation1_Type.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/types/test/FeatureStructure1.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/types/test/FeatureStructure1.java?rev=780236&view=auto
==============================================================================
--- incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/types/test/FeatureStructure1.java (added)
+++ incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/types/test/FeatureStructure1.java Sat May 30 11:12:58 2009
@@ -0,0 +1,238 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/* First created by JCasGen Fri Jan 16 11:22:35 CET 2009 */
+package org.apache.uima.lucas.indexer.types.test;
+
+import org.apache.uima.jcas.JCas;
+import org.apache.uima.jcas.JCasRegistry;
+import org.apache.uima.jcas.cas.FSArray;
+import org.apache.uima.jcas.cas.TOP;
+import org.apache.uima.jcas.cas.TOP_Type;
+
+/**
+ * Updated by JCasGen Fri Jan 16 11:22:35 CET 2009 XML source:
+ * /home/landefeld/workspace/jules-lucene
+ * -indexer/src/test/resources/AnnotationTokenStreamTestTypeSystem.xml
+ *
+ * @generated
+ */
+public class FeatureStructure1 extends TOP {
+ /**
+ * @generated
+ * @ordered
+ */
+ public final static int typeIndexID = JCasRegistry.register(FeatureStructure1.class);
+
+ /**
+ * @generated
+ * @ordered
+ */
+ public final static int type = typeIndexID;
+
+ /** @generated */
+ public int getTypeIndexID() {
+ return typeIndexID;
+ }
+
+ /**
+ * Never called. Disable default constructor
+ *
+ * @generated
+ */
+ protected FeatureStructure1() {
+ }
+
+ /**
+ * Internal - constructor used by generator
+ *
+ * @generated
+ */
+ public FeatureStructure1(int addr, TOP_Type type) {
+ super(addr, type);
+ readObject();
+ }
+
+ /** @generated */
+ public FeatureStructure1(JCas jcas) {
+ super(jcas);
+ readObject();
+ }
+
+ /**
+ * <!-- begin-user-doc --> Write your own initialization here <!-- end-user-doc -->
+ *
+ * @generated modifiable
+ */
+ private void readObject() {
+ }
+
+ // *--------------*
+ // * Feature: feature1
+
+ /**
+ * getter for feature1 - gets
+ *
+ * @generated
+ */
+ public String getFeature1() {
+ if (FeatureStructure1_Type.featOkTst
+ && ((FeatureStructure1_Type) jcasType).casFeat_feature1 == null)
+ jcasType.jcas.throwFeatMissing("feature1", "de.julielab.jules.types.test.FeatureStructure1");
+ return jcasType.ll_cas.ll_getStringValue(addr,
+ ((FeatureStructure1_Type) jcasType).casFeatCode_feature1);
+ }
+
+ /**
+ * setter for feature1 - sets
+ *
+ * @generated
+ */
+ public void setFeature1(String v) {
+ if (FeatureStructure1_Type.featOkTst
+ && ((FeatureStructure1_Type) jcasType).casFeat_feature1 == null)
+ jcasType.jcas.throwFeatMissing("feature1", "de.julielab.jules.types.test.FeatureStructure1");
+ jcasType.ll_cas.ll_setStringValue(addr,
+ ((FeatureStructure1_Type) jcasType).casFeatCode_feature1, v);
+ }
+
+ // *--------------*
+ // * Feature: feature2
+
+ /**
+ * getter for feature2 - gets
+ *
+ * @generated
+ */
+ public String getFeature2() {
+ if (FeatureStructure1_Type.featOkTst
+ && ((FeatureStructure1_Type) jcasType).casFeat_feature2 == null)
+ jcasType.jcas.throwFeatMissing("feature2", "de.julielab.jules.types.test.FeatureStructure1");
+ return jcasType.ll_cas.ll_getStringValue(addr,
+ ((FeatureStructure1_Type) jcasType).casFeatCode_feature2);
+ }
+
+ /**
+ * setter for feature2 - sets
+ *
+ * @generated
+ */
+ public void setFeature2(String v) {
+ if (FeatureStructure1_Type.featOkTst
+ && ((FeatureStructure1_Type) jcasType).casFeat_feature2 == null)
+ jcasType.jcas.throwFeatMissing("feature2", "de.julielab.jules.types.test.FeatureStructure1");
+ jcasType.ll_cas.ll_setStringValue(addr,
+ ((FeatureStructure1_Type) jcasType).casFeatCode_feature2, v);
+ }
+
+ // *--------------*
+ // * Feature: feature3
+
+ /**
+ * getter for feature3 - gets
+ *
+ * @generated
+ */
+ public FeatureStructure2 getFeature3() {
+ if (FeatureStructure1_Type.featOkTst
+ && ((FeatureStructure1_Type) jcasType).casFeat_feature3 == null)
+ jcasType.jcas.throwFeatMissing("feature3", "de.julielab.jules.types.test.FeatureStructure1");
+ return (FeatureStructure2) (jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr,
+ ((FeatureStructure1_Type) jcasType).casFeatCode_feature3)));
+ }
+
+ /**
+ * setter for feature3 - sets
+ *
+ * @generated
+ */
+ public void setFeature3(FeatureStructure2 v) {
+ if (FeatureStructure1_Type.featOkTst
+ && ((FeatureStructure1_Type) jcasType).casFeat_feature3 == null)
+ jcasType.jcas.throwFeatMissing("feature3", "de.julielab.jules.types.test.FeatureStructure1");
+ jcasType.ll_cas.ll_setRefValue(addr, ((FeatureStructure1_Type) jcasType).casFeatCode_feature3,
+ jcasType.ll_cas.ll_getFSRef(v));
+ }
+
+ // *--------------*
+ // * Feature: featureStructures2
+
+ /**
+ * getter for featureStructures2 - gets
+ *
+ * @generated
+ */
+ public FSArray getFeatureStructures2() {
+ if (FeatureStructure1_Type.featOkTst
+ && ((FeatureStructure1_Type) jcasType).casFeat_featureStructures2 == null)
+ jcasType.jcas.throwFeatMissing("featureStructures2",
+ "de.julielab.jules.types.test.FeatureStructure1");
+ return (FSArray) (jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr,
+ ((FeatureStructure1_Type) jcasType).casFeatCode_featureStructures2)));
+ }
+
+ /**
+ * setter for featureStructures2 - sets
+ *
+ * @generated
+ */
+ public void setFeatureStructures2(FSArray v) {
+ if (FeatureStructure1_Type.featOkTst
+ && ((FeatureStructure1_Type) jcasType).casFeat_featureStructures2 == null)
+ jcasType.jcas.throwFeatMissing("featureStructures2",
+ "de.julielab.jules.types.test.FeatureStructure1");
+ jcasType.ll_cas.ll_setRefValue(addr,
+ ((FeatureStructure1_Type) jcasType).casFeatCode_featureStructures2, jcasType.ll_cas
+ .ll_getFSRef(v));
+ }
+
+ /**
+ * indexed getter for featureStructures2 - gets an indexed value -
+ *
+ * @generated
+ */
+ public FeatureStructure2 getFeatureStructures2(int i) {
+ if (FeatureStructure1_Type.featOkTst
+ && ((FeatureStructure1_Type) jcasType).casFeat_featureStructures2 == null)
+ jcasType.jcas.throwFeatMissing("featureStructures2",
+ "de.julielab.jules.types.test.FeatureStructure1");
+ jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(addr,
+ ((FeatureStructure1_Type) jcasType).casFeatCode_featureStructures2), i);
+ return (FeatureStructure2) (jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefArrayValue(
+ jcasType.ll_cas.ll_getRefValue(addr,
+ ((FeatureStructure1_Type) jcasType).casFeatCode_featureStructures2), i)));
+ }
+
+ /**
+ * indexed setter for featureStructures2 - sets an indexed value -
+ *
+ * @generated
+ */
+ public void setFeatureStructures2(int i, FeatureStructure2 v) {
+ if (FeatureStructure1_Type.featOkTst
+ && ((FeatureStructure1_Type) jcasType).casFeat_featureStructures2 == null)
+ jcasType.jcas.throwFeatMissing("featureStructures2",
+ "de.julielab.jules.types.test.FeatureStructure1");
+ jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(addr,
+ ((FeatureStructure1_Type) jcasType).casFeatCode_featureStructures2), i);
+ jcasType.ll_cas.ll_setRefArrayValue(jcasType.ll_cas.ll_getRefValue(addr,
+ ((FeatureStructure1_Type) jcasType).casFeatCode_featureStructures2), i, jcasType.ll_cas
+ .ll_getFSRef(v));
+ }
+}
Propchange: incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/types/test/FeatureStructure1.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/types/test/FeatureStructure1_Type.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/types/test/FeatureStructure1_Type.java?rev=780236&view=auto
==============================================================================
--- incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/types/test/FeatureStructure1_Type.java (added)
+++ incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/types/test/FeatureStructure1_Type.java Sat May 30 11:12:58 2009
@@ -0,0 +1,208 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/* First created by JCasGen Fri Jan 16 11:22:36 CET 2009 */
+package org.apache.uima.lucas.indexer.types.test;
+
+import org.apache.uima.cas.Feature;
+import org.apache.uima.cas.FeatureStructure;
+import org.apache.uima.cas.Type;
+import org.apache.uima.cas.impl.CASImpl;
+import org.apache.uima.cas.impl.FSGenerator;
+import org.apache.uima.cas.impl.FeatureImpl;
+import org.apache.uima.cas.impl.TypeImpl;
+import org.apache.uima.jcas.JCas;
+import org.apache.uima.jcas.JCasRegistry;
+import org.apache.uima.jcas.cas.TOP_Type;
+
+/**
+ * Updated by JCasGen Fri Jan 16 11:22:36 CET 2009
+ *
+ * @generated
+ */
+public class FeatureStructure1_Type extends TOP_Type {
+ /** @generated */
+ protected FSGenerator getFSGenerator() {
+ return fsGenerator;
+ }
+
+ /** @generated */
+ private final FSGenerator fsGenerator = new FSGenerator() {
+ public FeatureStructure createFS(int addr, CASImpl cas) {
+ if (FeatureStructure1_Type.this.useExistingInstance) {
+ // Return eq fs instance if already created
+ FeatureStructure fs = FeatureStructure1_Type.this.jcas.getJfsFromCaddr(addr);
+ if (null == fs) {
+ fs = new FeatureStructure1(addr, FeatureStructure1_Type.this);
+ FeatureStructure1_Type.this.jcas.putJfsFromCaddr(addr, fs);
+ return fs;
+ }
+ return fs;
+ } else
+ return new FeatureStructure1(addr, FeatureStructure1_Type.this);
+ }
+ };
+
+ /** @generated */
+ public final static int typeIndexID = FeatureStructure1.typeIndexID;
+
+ /**
+ * @generated
+ * @modifiable
+ */
+ public final static boolean featOkTst =
+ JCasRegistry.getFeatOkTst("de.julielab.jules.types.test.FeatureStructure1");
+
+ /** @generated */
+ final Feature casFeat_feature1;
+
+ /** @generated */
+ final int casFeatCode_feature1;
+
+ /** @generated */
+ public String getFeature1(int addr) {
+ if (featOkTst && casFeat_feature1 == null)
+ jcas.throwFeatMissing("feature1", "de.julielab.jules.types.test.FeatureStructure1");
+ return ll_cas.ll_getStringValue(addr, casFeatCode_feature1);
+ }
+
+ /** @generated */
+ public void setFeature1(int addr, String v) {
+ if (featOkTst && casFeat_feature1 == null)
+ jcas.throwFeatMissing("feature1", "de.julielab.jules.types.test.FeatureStructure1");
+ ll_cas.ll_setStringValue(addr, casFeatCode_feature1, v);
+ }
+
+ /** @generated */
+ final Feature casFeat_feature2;
+
+ /** @generated */
+ final int casFeatCode_feature2;
+
+ /** @generated */
+ public String getFeature2(int addr) {
+ if (featOkTst && casFeat_feature2 == null)
+ jcas.throwFeatMissing("feature2", "de.julielab.jules.types.test.FeatureStructure1");
+ return ll_cas.ll_getStringValue(addr, casFeatCode_feature2);
+ }
+
+ /** @generated */
+ public void setFeature2(int addr, String v) {
+ if (featOkTst && casFeat_feature2 == null)
+ jcas.throwFeatMissing("feature2", "de.julielab.jules.types.test.FeatureStructure1");
+ ll_cas.ll_setStringValue(addr, casFeatCode_feature2, v);
+ }
+
+ /** @generated */
+ final Feature casFeat_feature3;
+
+ /** @generated */
+ final int casFeatCode_feature3;
+
+ /** @generated */
+ public int getFeature3(int addr) {
+ if (featOkTst && casFeat_feature3 == null)
+ jcas.throwFeatMissing("feature3", "de.julielab.jules.types.test.FeatureStructure1");
+ return ll_cas.ll_getRefValue(addr, casFeatCode_feature3);
+ }
+
+ /** @generated */
+ public void setFeature3(int addr, int v) {
+ if (featOkTst && casFeat_feature3 == null)
+ jcas.throwFeatMissing("feature3", "de.julielab.jules.types.test.FeatureStructure1");
+ ll_cas.ll_setRefValue(addr, casFeatCode_feature3, v);
+ }
+
+ /** @generated */
+ final Feature casFeat_featureStructures2;
+
+ /** @generated */
+ final int casFeatCode_featureStructures2;
+
+ /** @generated */
+ public int getFeatureStructures2(int addr) {
+ if (featOkTst && casFeat_featureStructures2 == null)
+ jcas.throwFeatMissing("featureStructures2", "de.julielab.jules.types.test.FeatureStructure1");
+ return ll_cas.ll_getRefValue(addr, casFeatCode_featureStructures2);
+ }
+
+ /** @generated */
+ public void setFeatureStructures2(int addr, int v) {
+ if (featOkTst && casFeat_featureStructures2 == null)
+ jcas.throwFeatMissing("featureStructures2", "de.julielab.jules.types.test.FeatureStructure1");
+ ll_cas.ll_setRefValue(addr, casFeatCode_featureStructures2, v);
+ }
+
+ /** @generated */
+ public int getFeatureStructures2(int addr, int i) {
+ if (featOkTst && casFeat_featureStructures2 == null)
+ jcas.throwFeatMissing("featureStructures2", "de.julielab.jules.types.test.FeatureStructure1");
+ if (lowLevelTypeChecks)
+ return ll_cas.ll_getRefArrayValue(
+ ll_cas.ll_getRefValue(addr, casFeatCode_featureStructures2), i, true);
+ jcas.checkArrayBounds(ll_cas.ll_getRefValue(addr, casFeatCode_featureStructures2), i);
+ return ll_cas.ll_getRefArrayValue(ll_cas.ll_getRefValue(addr, casFeatCode_featureStructures2),
+ i);
+ }
+
+ /** @generated */
+ public void setFeatureStructures2(int addr, int i, int v) {
+ if (featOkTst && casFeat_featureStructures2 == null)
+ jcas.throwFeatMissing("featureStructures2", "de.julielab.jules.types.test.FeatureStructure1");
+ if (lowLevelTypeChecks)
+ ll_cas.ll_setRefArrayValue(ll_cas.ll_getRefValue(addr, casFeatCode_featureStructures2), i, v,
+ true);
+ jcas.checkArrayBounds(ll_cas.ll_getRefValue(addr, casFeatCode_featureStructures2), i);
+ ll_cas.ll_setRefArrayValue(ll_cas.ll_getRefValue(addr, casFeatCode_featureStructures2), i, v);
+ }
+
+ /**
+ * initialize variables to correspond with Cas Type and Features
+ *
+ * @generated
+ */
+ public FeatureStructure1_Type(JCas jcas, Type casType) {
+ super(jcas, casType);
+ casImpl.getFSClassRegistry().addGeneratorForType((TypeImpl) this.casType, getFSGenerator());
+
+ casFeat_feature1 = jcas.getRequiredFeatureDE(casType, "feature1", "uima.cas.String", featOkTst);
+ casFeatCode_feature1 =
+ (null == casFeat_feature1) ? JCas.INVALID_FEATURE_CODE
+ : ((FeatureImpl) casFeat_feature1).getCode();
+
+ casFeat_feature2 = jcas.getRequiredFeatureDE(casType, "feature2", "uima.cas.String", featOkTst);
+ casFeatCode_feature2 =
+ (null == casFeat_feature2) ? JCas.INVALID_FEATURE_CODE
+ : ((FeatureImpl) casFeat_feature2).getCode();
+
+ casFeat_feature3 =
+ jcas.getRequiredFeatureDE(casType, "feature3",
+ "de.julielab.jules.types.test.FeatureStructure2", featOkTst);
+ casFeatCode_feature3 =
+ (null == casFeat_feature3) ? JCas.INVALID_FEATURE_CODE
+ : ((FeatureImpl) casFeat_feature3).getCode();
+
+ casFeat_featureStructures2 =
+ jcas.getRequiredFeatureDE(casType, "featureStructures2", "uima.cas.FSArray", featOkTst);
+ casFeatCode_featureStructures2 =
+ (null == casFeat_featureStructures2) ? JCas.INVALID_FEATURE_CODE
+ : ((FeatureImpl) casFeat_featureStructures2).getCode();
+
+ }
+}
Propchange: incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/types/test/FeatureStructure1_Type.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/types/test/FeatureStructure2.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/types/test/FeatureStructure2.java?rev=780236&view=auto
==============================================================================
--- incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/types/test/FeatureStructure2.java (added)
+++ incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/types/test/FeatureStructure2.java Sat May 30 11:12:58 2009
@@ -0,0 +1,202 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/* First created by JCasGen Fri Jan 16 11:22:37 CET 2009 */
+package org.apache.uima.lucas.indexer.types.test;
+
+import org.apache.uima.jcas.JCas;
+import org.apache.uima.jcas.JCasRegistry;
+import org.apache.uima.jcas.cas.StringArray;
+import org.apache.uima.jcas.cas.TOP;
+import org.apache.uima.jcas.cas.TOP_Type;
+
+/**
+ * Updated by JCasGen Fri Jan 16 11:22:37 CET 2009 XML source:
+ * /home/landefeld/workspace/jules-lucene
+ * -indexer/src/test/resources/AnnotationTokenStreamTestTypeSystem.xml
+ *
+ * @generated
+ */
+public class FeatureStructure2 extends TOP {
+ /**
+ * @generated
+ * @ordered
+ */
+ public final static int typeIndexID = JCasRegistry.register(FeatureStructure2.class);
+
+ /**
+ * @generated
+ * @ordered
+ */
+ public final static int type = typeIndexID;
+
+ /** @generated */
+ public int getTypeIndexID() {
+ return typeIndexID;
+ }
+
+ /**
+ * Never called. Disable default constructor
+ *
+ * @generated
+ */
+ protected FeatureStructure2() {
+ }
+
+ /**
+ * Internal - constructor used by generator
+ *
+ * @generated
+ */
+ public FeatureStructure2(int addr, TOP_Type type) {
+ super(addr, type);
+ readObject();
+ }
+
+ /** @generated */
+ public FeatureStructure2(JCas jcas) {
+ super(jcas);
+ readObject();
+ }
+
+ /**
+ * <!-- begin-user-doc --> Write your own initialization here <!-- end-user-doc -->
+ *
+ * @generated modifiable
+ */
+ private void readObject() {
+ }
+
+ // *--------------*
+ // * Feature: feature1
+
+ /**
+ * getter for feature1 - gets
+ *
+ * @generated
+ */
+ public String getFeature1() {
+ if (FeatureStructure2_Type.featOkTst
+ && ((FeatureStructure2_Type) jcasType).casFeat_feature1 == null)
+ jcasType.jcas.throwFeatMissing("feature1", "de.julielab.jules.types.test.FeatureStructure2");
+ return jcasType.ll_cas.ll_getStringValue(addr,
+ ((FeatureStructure2_Type) jcasType).casFeatCode_feature1);
+ }
+
+ /**
+ * setter for feature1 - sets
+ *
+ * @generated
+ */
+ public void setFeature1(String v) {
+ if (FeatureStructure2_Type.featOkTst
+ && ((FeatureStructure2_Type) jcasType).casFeat_feature1 == null)
+ jcasType.jcas.throwFeatMissing("feature1", "de.julielab.jules.types.test.FeatureStructure2");
+ jcasType.ll_cas.ll_setStringValue(addr,
+ ((FeatureStructure2_Type) jcasType).casFeatCode_feature1, v);
+ }
+
+ // *--------------*
+ // * Feature: feature2
+
+ /**
+ * getter for feature2 - gets
+ *
+ * @generated
+ */
+ public String getFeature2() {
+ if (FeatureStructure2_Type.featOkTst
+ && ((FeatureStructure2_Type) jcasType).casFeat_feature2 == null)
+ jcasType.jcas.throwFeatMissing("feature2", "de.julielab.jules.types.test.FeatureStructure2");
+ return jcasType.ll_cas.ll_getStringValue(addr,
+ ((FeatureStructure2_Type) jcasType).casFeatCode_feature2);
+ }
+
+ /**
+ * setter for feature2 - sets
+ *
+ * @generated
+ */
+ public void setFeature2(String v) {
+ if (FeatureStructure2_Type.featOkTst
+ && ((FeatureStructure2_Type) jcasType).casFeat_feature2 == null)
+ jcasType.jcas.throwFeatMissing("feature2", "de.julielab.jules.types.test.FeatureStructure2");
+ jcasType.ll_cas.ll_setStringValue(addr,
+ ((FeatureStructure2_Type) jcasType).casFeatCode_feature2, v);
+ }
+
+ // *--------------*
+ // * Feature: feature3
+
+ /**
+ * getter for feature3 - gets
+ *
+ * @generated
+ */
+ public StringArray getFeature3() {
+ if (FeatureStructure2_Type.featOkTst
+ && ((FeatureStructure2_Type) jcasType).casFeat_feature3 == null)
+ jcasType.jcas.throwFeatMissing("feature3", "de.julielab.jules.types.test.FeatureStructure2");
+ return (StringArray) (jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr,
+ ((FeatureStructure2_Type) jcasType).casFeatCode_feature3)));
+ }
+
+ /**
+ * setter for feature3 - sets
+ *
+ * @generated
+ */
+ public void setFeature3(StringArray v) {
+ if (FeatureStructure2_Type.featOkTst
+ && ((FeatureStructure2_Type) jcasType).casFeat_feature3 == null)
+ jcasType.jcas.throwFeatMissing("feature3", "de.julielab.jules.types.test.FeatureStructure2");
+ jcasType.ll_cas.ll_setRefValue(addr, ((FeatureStructure2_Type) jcasType).casFeatCode_feature3,
+ jcasType.ll_cas.ll_getFSRef(v));
+ }
+
+ /**
+ * indexed getter for feature3 - gets an indexed value -
+ *
+ * @generated
+ */
+ public String getFeature3(int i) {
+ if (FeatureStructure2_Type.featOkTst
+ && ((FeatureStructure2_Type) jcasType).casFeat_feature3 == null)
+ jcasType.jcas.throwFeatMissing("feature3", "de.julielab.jules.types.test.FeatureStructure2");
+ jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(addr,
+ ((FeatureStructure2_Type) jcasType).casFeatCode_feature3), i);
+ return jcasType.ll_cas.ll_getStringArrayValue(jcasType.ll_cas.ll_getRefValue(addr,
+ ((FeatureStructure2_Type) jcasType).casFeatCode_feature3), i);
+ }
+
+ /**
+ * indexed setter for feature3 - sets an indexed value -
+ *
+ * @generated
+ */
+ public void setFeature3(int i, String v) {
+ if (FeatureStructure2_Type.featOkTst
+ && ((FeatureStructure2_Type) jcasType).casFeat_feature3 == null)
+ jcasType.jcas.throwFeatMissing("feature3", "de.julielab.jules.types.test.FeatureStructure2");
+ jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(addr,
+ ((FeatureStructure2_Type) jcasType).casFeatCode_feature3), i);
+ jcasType.ll_cas.ll_setStringArrayValue(jcasType.ll_cas.ll_getRefValue(addr,
+ ((FeatureStructure2_Type) jcasType).casFeatCode_feature3), i, v);
+ }
+}
Propchange: incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/types/test/FeatureStructure2.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/types/test/FeatureStructure2_Type.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/types/test/FeatureStructure2_Type.java?rev=780236&view=auto
==============================================================================
--- incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/types/test/FeatureStructure2_Type.java (added)
+++ incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/types/test/FeatureStructure2_Type.java Sat May 30 11:12:58 2009
@@ -0,0 +1,179 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/* First created by JCasGen Fri Jan 16 11:22:38 CET 2009 */
+package org.apache.uima.lucas.indexer.types.test;
+
+import org.apache.uima.cas.Feature;
+import org.apache.uima.cas.FeatureStructure;
+import org.apache.uima.cas.Type;
+import org.apache.uima.cas.impl.CASImpl;
+import org.apache.uima.cas.impl.FSGenerator;
+import org.apache.uima.cas.impl.FeatureImpl;
+import org.apache.uima.cas.impl.TypeImpl;
+import org.apache.uima.jcas.JCas;
+import org.apache.uima.jcas.JCasRegistry;
+import org.apache.uima.jcas.cas.TOP_Type;
+
+/**
+ * Updated by JCasGen Fri Jan 16 11:22:38 CET 2009
+ *
+ * @generated
+ */
+public class FeatureStructure2_Type extends TOP_Type {
+ /** @generated */
+ protected FSGenerator getFSGenerator() {
+ return fsGenerator;
+ }
+
+ /** @generated */
+ private final FSGenerator fsGenerator = new FSGenerator() {
+ public FeatureStructure createFS(int addr, CASImpl cas) {
+ if (FeatureStructure2_Type.this.useExistingInstance) {
+ // Return eq fs instance if already created
+ FeatureStructure fs = FeatureStructure2_Type.this.jcas.getJfsFromCaddr(addr);
+ if (null == fs) {
+ fs = new FeatureStructure2(addr, FeatureStructure2_Type.this);
+ FeatureStructure2_Type.this.jcas.putJfsFromCaddr(addr, fs);
+ return fs;
+ }
+ return fs;
+ } else
+ return new FeatureStructure2(addr, FeatureStructure2_Type.this);
+ }
+ };
+
+ /** @generated */
+ public final static int typeIndexID = FeatureStructure2.typeIndexID;
+
+ /**
+ * @generated
+ * @modifiable
+ */
+ public final static boolean featOkTst =
+ JCasRegistry.getFeatOkTst("de.julielab.jules.types.test.FeatureStructure2");
+
+ /** @generated */
+ final Feature casFeat_feature1;
+
+ /** @generated */
+ final int casFeatCode_feature1;
+
+ /** @generated */
+ public String getFeature1(int addr) {
+ if (featOkTst && casFeat_feature1 == null)
+ jcas.throwFeatMissing("feature1", "de.julielab.jules.types.test.FeatureStructure2");
+ return ll_cas.ll_getStringValue(addr, casFeatCode_feature1);
+ }
+
+ /** @generated */
+ public void setFeature1(int addr, String v) {
+ if (featOkTst && casFeat_feature1 == null)
+ jcas.throwFeatMissing("feature1", "de.julielab.jules.types.test.FeatureStructure2");
+ ll_cas.ll_setStringValue(addr, casFeatCode_feature1, v);
+ }
+
+ /** @generated */
+ final Feature casFeat_feature2;
+
+ /** @generated */
+ final int casFeatCode_feature2;
+
+ /** @generated */
+ public String getFeature2(int addr) {
+ if (featOkTst && casFeat_feature2 == null)
+ jcas.throwFeatMissing("feature2", "de.julielab.jules.types.test.FeatureStructure2");
+ return ll_cas.ll_getStringValue(addr, casFeatCode_feature2);
+ }
+
+ /** @generated */
+ public void setFeature2(int addr, String v) {
+ if (featOkTst && casFeat_feature2 == null)
+ jcas.throwFeatMissing("feature2", "de.julielab.jules.types.test.FeatureStructure2");
+ ll_cas.ll_setStringValue(addr, casFeatCode_feature2, v);
+ }
+
+ /** @generated */
+ final Feature casFeat_feature3;
+
+ /** @generated */
+ final int casFeatCode_feature3;
+
+ /** @generated */
+ public int getFeature3(int addr) {
+ if (featOkTst && casFeat_feature3 == null)
+ jcas.throwFeatMissing("feature3", "de.julielab.jules.types.test.FeatureStructure2");
+ return ll_cas.ll_getRefValue(addr, casFeatCode_feature3);
+ }
+
+ /** @generated */
+ public void setFeature3(int addr, int v) {
+ if (featOkTst && casFeat_feature3 == null)
+ jcas.throwFeatMissing("feature3", "de.julielab.jules.types.test.FeatureStructure2");
+ ll_cas.ll_setRefValue(addr, casFeatCode_feature3, v);
+ }
+
+ /** @generated */
+ public String getFeature3(int addr, int i) {
+ if (featOkTst && casFeat_feature3 == null)
+ jcas.throwFeatMissing("feature3", "de.julielab.jules.types.test.FeatureStructure2");
+ if (lowLevelTypeChecks)
+ return ll_cas.ll_getStringArrayValue(ll_cas.ll_getRefValue(addr, casFeatCode_feature3), i,
+ true);
+ jcas.checkArrayBounds(ll_cas.ll_getRefValue(addr, casFeatCode_feature3), i);
+ return ll_cas.ll_getStringArrayValue(ll_cas.ll_getRefValue(addr, casFeatCode_feature3), i);
+ }
+
+ /** @generated */
+ public void setFeature3(int addr, int i, String v) {
+ if (featOkTst && casFeat_feature3 == null)
+ jcas.throwFeatMissing("feature3", "de.julielab.jules.types.test.FeatureStructure2");
+ if (lowLevelTypeChecks)
+ ll_cas.ll_setStringArrayValue(ll_cas.ll_getRefValue(addr, casFeatCode_feature3), i, v, true);
+ jcas.checkArrayBounds(ll_cas.ll_getRefValue(addr, casFeatCode_feature3), i);
+ ll_cas.ll_setStringArrayValue(ll_cas.ll_getRefValue(addr, casFeatCode_feature3), i, v);
+ }
+
+ /**
+ * initialize variables to correspond with Cas Type and Features
+ *
+ * @generated
+ */
+ public FeatureStructure2_Type(JCas jcas, Type casType) {
+ super(jcas, casType);
+ casImpl.getFSClassRegistry().addGeneratorForType((TypeImpl) this.casType, getFSGenerator());
+
+ casFeat_feature1 = jcas.getRequiredFeatureDE(casType, "feature1", "uima.cas.String", featOkTst);
+ casFeatCode_feature1 =
+ (null == casFeat_feature1) ? JCas.INVALID_FEATURE_CODE
+ : ((FeatureImpl) casFeat_feature1).getCode();
+
+ casFeat_feature2 = jcas.getRequiredFeatureDE(casType, "feature2", "uima.cas.String", featOkTst);
+ casFeatCode_feature2 =
+ (null == casFeat_feature2) ? JCas.INVALID_FEATURE_CODE
+ : ((FeatureImpl) casFeat_feature2).getCode();
+
+ casFeat_feature3 =
+ jcas.getRequiredFeatureDE(casType, "feature3", "uima.cas.StringArray", featOkTst);
+ casFeatCode_feature3 =
+ (null == casFeat_feature3) ? JCas.INVALID_FEATURE_CODE
+ : ((FeatureImpl) casFeat_feature3).getCode();
+
+ }
+}
Propchange: incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/types/test/FeatureStructure2_Type.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/util/MapFileReaderTest.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/util/MapFileReaderTest.java?rev=780236&view=auto
==============================================================================
--- incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/util/MapFileReaderTest.java (added)
+++ incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/util/MapFileReaderTest.java Sat May 30 11:12:58 2009
@@ -0,0 +1,78 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.uima.lucas.indexer.util;
+
+import static org.easymock.EasyMock.expect;
+import static org.easymock.classextension.EasyMock.createMock;
+import static org.easymock.classextension.EasyMock.replay;
+import static org.easymock.classextension.EasyMock.verify;
+import static org.junit.Assert.assertEquals;
+
+import java.io.BufferedReader;
+import java.util.Map;
+
+import org.apache.uima.lucas.indexer.util.MapFileReader;
+import org.junit.Before;
+import org.junit.Test;
+
+public class MapFileReaderTest {
+
+ private BufferedReader reader;
+
+ private MapFileReader mapFileReader;
+
+ private static final String LINE_1 = "term1=id1";
+
+ private static final String LINE_2 = "term2=id2";
+
+ private static final String LINE_3 = "term3=id3";
+
+ @Before
+ public void setUp() {
+ reader = createMock(BufferedReader.class);
+ mapFileReader = new MapFileReader(reader);
+ }
+
+ @Test
+ public void testReadMap() throws Exception {
+ expect(reader.readLine()).andReturn(LINE_1);
+ expect(reader.readLine()).andReturn(LINE_2);
+ expect(reader.readLine()).andReturn(LINE_3);
+ expect(reader.readLine()).andReturn(null);
+ replay(reader);
+
+ Map<String, String> map = mapFileReader.readMap();
+ verify(reader);
+
+ assertEquals("id1", map.get("term1"));
+ assertEquals("id2", map.get("term2"));
+ assertEquals("id3", map.get("term3"));
+ }
+
+ @Test
+ public void testClose() throws Exception {
+ reader.close();
+ replay(reader);
+
+ mapFileReader.close();
+ verify(reader);
+ }
+
+}
Propchange: incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/util/MapFileReaderTest.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/util/MultimapFileReaderTest.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/util/MultimapFileReaderTest.java?rev=780236&view=auto
==============================================================================
--- incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/util/MultimapFileReaderTest.java (added)
+++ incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/util/MultimapFileReaderTest.java Sat May 30 11:12:58 2009
@@ -0,0 +1,82 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.uima.lucas.indexer.util;
+
+import static org.easymock.EasyMock.expect;
+import static org.easymock.classextension.EasyMock.createMock;
+import static org.easymock.classextension.EasyMock.replay;
+import static org.easymock.classextension.EasyMock.verify;
+import static org.junit.Assert.assertEquals;
+
+import java.io.BufferedReader;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.uima.lucas.indexer.util.MultimapFileReader;
+import org.junit.Before;
+import org.junit.Test;
+
+public class MultimapFileReaderTest {
+
+ private BufferedReader reader;
+
+ private MultimapFileReader multimapFileReader;
+
+ private static final String LINE_1 = "term1=term111|term11|term1";
+
+ private static final String LINE_2 = "term2=term222|term22|term2";
+
+ @Before
+ public void setUp() {
+ reader = createMock(BufferedReader.class);
+ multimapFileReader = new MultimapFileReader(reader);
+ }
+
+ @Test
+ public void testReadMultimap() throws Exception {
+ expect(reader.readLine()).andReturn(LINE_1);
+ expect(reader.readLine()).andReturn(LINE_2);
+ expect(reader.readLine()).andReturn(null);
+ replay(reader);
+
+ Map<String, List<String>> multimap = multimapFileReader.readMultimap();
+ verify(reader);
+
+ assertEquals(2, multimap.size());
+ List<String> line1Values = multimap.get("term1");
+ assertEquals("term111", line1Values.get(0));
+ assertEquals("term11", line1Values.get(1));
+ assertEquals("term1", line1Values.get(2));
+
+ List<String> line2Values = multimap.get("term2");
+ assertEquals("term222", line2Values.get(0));
+ assertEquals("term22", line2Values.get(1));
+ assertEquals("term2", line2Values.get(2));
+ }
+
+ @Test
+ public void testClose() throws Exception {
+ reader.close();
+ replay(reader);
+
+ multimapFileReader.close();
+ verify(reader);
+ }
+}
Propchange: incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/util/MultimapFileReaderTest.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/util/PlainFileReaderTest.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/util/PlainFileReaderTest.java?rev=780236&view=auto
==============================================================================
--- incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/util/PlainFileReaderTest.java (added)
+++ incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/util/PlainFileReaderTest.java Sat May 30 11:12:58 2009
@@ -0,0 +1,74 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.uima.lucas.indexer.util;
+
+import static org.easymock.EasyMock.expect;
+import static org.easymock.classextension.EasyMock.createMock;
+import static org.easymock.classextension.EasyMock.replay;
+import static org.easymock.classextension.EasyMock.verify;
+import static org.junit.Assert.assertEquals;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+
+import org.apache.uima.lucas.indexer.util.PlainFileReader;
+import org.junit.Before;
+import org.junit.Test;
+
+public class PlainFileReaderTest {
+
+ private BufferedReader reader;
+
+ @Before
+ public void setUp() {
+ reader = createMock(BufferedReader.class);
+ }
+
+ @Test
+ public void testReadFile() throws Exception {
+ PlainFileReader plainFileReader = new PlainFileReader(reader);
+ expect(reader.readLine()).andReturn("na");
+ expect(reader.readLine()).andReturn("und");
+ expect(reader.readLine()).andReturn("nu");
+ expect(reader.readLine()).andReturn(null);
+
+ replay(reader);
+
+ String[] lines = plainFileReader.readLines();
+ verify(reader);
+
+ assertEquals(3, lines.length);
+ assertEquals("na", lines[0]);
+ assertEquals("und", lines[1]);
+ assertEquals("nu", lines[2]);
+
+ }
+
+ @Test
+ public void testClose() throws IOException {
+ PlainFileReader plainFileReader = new PlainFileReader(reader);
+
+ reader.close();
+ replay(reader);
+ plainFileReader.close();
+ verify(reader);
+ }
+
+}
Propchange: incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/util/PlainFileReaderTest.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/util/TokenStreamStringConcatenatorTest.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/util/TokenStreamStringConcatenatorTest.java?rev=780236&view=auto
==============================================================================
--- incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/util/TokenStreamStringConcatenatorTest.java (added)
+++ incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/util/TokenStreamStringConcatenatorTest.java Sat May 30 11:12:58 2009
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.uima.lucas.indexer.util;
+
+import static org.junit.Assert.assertEquals;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.apache.lucene.analysis.Token;
+import org.apache.uima.lucas.indexer.test.util.CollectionTokenStream;
+import org.apache.uima.lucas.indexer.util.TokenStreamStringConcatenator;
+import org.junit.Test;
+
+public class TokenStreamStringConcatenatorTest {
+
+ @Test
+ public void testTokenStreamToStringWithDelimiter() throws Exception {
+ TokenStreamStringConcatenator tokenStreamStringConcatenator =
+ new TokenStreamStringConcatenator();
+ Collection<Token> tokens1 = new ArrayList<Token>();
+ tokens1.add(new Token("token1".toCharArray(), 0, 6, 0, 6));
+ tokens1.add(new Token("token2".toCharArray(), 0, 6, 7, 13));
+ tokens1.add(new Token("token3".toCharArray(), 0, 6, 14, 20));
+
+ CollectionTokenStream tokenStream1 = new CollectionTokenStream(tokens1);
+ String concatenatedString =
+ tokenStreamStringConcatenator.tokenStreamToStringWithDelimiter(tokenStream1, " ");
+ assertEquals("token1 token2 token3", concatenatedString);
+
+ }
+
+}
Propchange: incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/util/TokenStreamStringConcatenatorTest.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: incubator/uima/sandbox/trunk/Lucas/src/test/resources/AnnotationTokenStreamTestDummyCollectionReader.xml
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/Lucas/src/test/resources/AnnotationTokenStreamTestDummyCollectionReader.xml?rev=780236&view=auto
==============================================================================
--- incubator/uima/sandbox/trunk/Lucas/src/test/resources/AnnotationTokenStreamTestDummyCollectionReader.xml (added)
+++ incubator/uima/sandbox/trunk/Lucas/src/test/resources/AnnotationTokenStreamTestDummyCollectionReader.xml Sat May 30 11:12:58 2009
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+
+<collectionReaderDescription xmlns="http://uima.apache.org/resourceSpecifier">
+ <frameworkImplementation>org.apache.uima.java</frameworkImplementation>
+ <implementationName>de.julielab.jules.test.util.MockCollectionReader</implementationName>
+ <processingResourceMetaData>
+ <name>MockCollectionReader Descriptor</name>
+ <description>Mock collection reader. Does nothing</description>
+ <version>1.0</version>
+ <vendor>The Apache Software Foundation</vendor>
+ <configurationParameters>
+ <configurationParameter>
+ <name>InputDirectory</name>
+ <description>Directory containing input files</description>
+ <type>String</type>
+ <multiValued>false</multiValued>
+ <mandatory>true</mandatory>
+ </configurationParameter>
+ </configurationParameters>
+ <configurationParameterSettings>
+ <nameValuePair>
+ <name>InputDirectory</name>
+ <value>
+ <string>C:/Program Files/apache-uima/examples/data</string>
+ </value>
+ </nameValuePair>
+ </configurationParameterSettings>
+ <typeSystemDescription>
+ <imports>
+ <import location="AnnotationTokenStreamTestTypeSystem.xml"/>
+ </imports>
+ </typeSystemDescription>
+ <capabilities/>
+ <operationalProperties>
+ <modifiesCas>true</modifiesCas>
+ <multipleDeploymentAllowed>false</multipleDeploymentAllowed>
+ <outputsNewCASes>true</outputsNewCASes>
+ </operationalProperties>
+ </processingResourceMetaData>
+</collectionReaderDescription>
Propchange: incubator/uima/sandbox/trunk/Lucas/src/test/resources/AnnotationTokenStreamTestDummyCollectionReader.xml
------------------------------------------------------------------------------
svn:mime-type = text/plain