You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by al...@apache.org on 2006/11/28 23:20:55 UTC
svn commit: r480240 [2/3] - in
/incubator/uima/uimaj/trunk/uimaj-examples/src/main/java: example/
org/apache/uima/examples/ org/apache/uima/examples/cas/
org/apache/uima/examples/casMultiplier/ org/apache/uima/examples/cpe/
org/apache/uima/examples/tok...
Modified: incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/cas/RegExAnnotator.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/cas/RegExAnnotator.java?view=diff&rev=480240&r1=480239&r2=480240
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/cas/RegExAnnotator.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/cas/RegExAnnotator.java Tue Nov 28 14:20:52 2006
@@ -107,10 +107,10 @@
String[] patternStrings = (String[]) getContext().getConfigParameterValue("Patterns");
String[] typeNames = (String[]) getContext().getConfigParameterValue("TypeNames");
mContainingAnnotationTypeNames = (String[]) getContext().getConfigParameterValue(
- "ContainingAnnotationTypes");
+ "ContainingAnnotationTypes");
if (mContainingAnnotationTypeNames != null && mContainingAnnotationTypeNames.length > 0) {
mAnnotateEntireContainingAnnotation = (Boolean) getContext().getConfigParameterValue(
- "AnnotateEntireContainingAnnotation");
+ "AnnotateEntireContainingAnnotation");
} else {
mAnnotateEntireContainingAnnotation = Boolean.FALSE;
}
@@ -125,7 +125,7 @@
if (typeNames == null || typeNames.length != patternStrings.length) {
// throw exception - error message in external message digest
throw new ResourceInitializationException(MESSAGE_DIGEST,
- "type_pattern_array_length_mismatch", new Object[0]);
+ "type_pattern_array_length_mismatch", new Object[0]);
}
mTypeNames.addAll(Arrays.asList(typeNames));
@@ -147,7 +147,7 @@
String line = reader.readLine();
while (line != null) {
if (!line.startsWith("#") && line.length() > 0
- && !Character.isWhitespace(line.charAt(0))) {
+ && !Character.isWhitespace(line.charAt(0))) {
// line is not a comment
if (line.startsWith("%")) // annotation type name
{
@@ -182,8 +182,8 @@
// make sure there is at least one pattern
if (patternArray.isEmpty()) {
throw new ResourceInitializationException(
- AnnotatorConfigurationException.ONE_PARAM_REQUIRED,
- new Object[] { "Patterns, Pattern File" });
+ AnnotatorConfigurationException.ONE_PARAM_REQUIRED,
+ new Object[] { "Patterns, Pattern File" });
}
// compile regular expression patterns
@@ -198,11 +198,11 @@
// would lead to infinite loops during processing
if (mPatterns[i][j].matcher("").matches()) {
throw new ResourceInitializationException(MESSAGE_DIGEST,
- "regex_matches_empty_string", new Object[] { pats[j] });
+ "regex_matches_empty_string", new Object[] { pats[j] });
}
} catch (PatternSyntaxException e) {
throw new ResourceInitializationException(MESSAGE_DIGEST, "regex_syntax_error",
- new Object[] { pats[j] }, e);
+ new Object[] { pats[j] }, e);
}
}
}
@@ -227,7 +227,7 @@
mCASTypes[i] = aTypeSystem.getType(curTypeName);
if (mCASTypes[i] == null) {
throw new AnalysisEngineProcessException(AnnotatorInitializationException.TYPE_NOT_FOUND,
- new Object[] { this.getClass().getName(), curTypeName });
+ new Object[] { this.getClass().getName(), curTypeName });
}
}
@@ -240,7 +240,7 @@
mContainingAnnotationTypes[i] = aTypeSystem.getType(mContainingAnnotationTypeNames[i]);
if (mContainingAnnotationTypes[i] == null) {
throw new AnalysisEngineProcessException(AnnotatorInitializationException.TYPE_NOT_FOUND,
- new Object[] { getClass().getName(), mContainingAnnotationTypeNames[i] });
+ new Object[] { getClass().getName(), mContainingAnnotationTypeNames[i] });
}
}
}
@@ -285,7 +285,7 @@
Matcher matcher = mPatterns[j][k].matcher(subText);
while (pos < subText.length() && matcher.find(pos)) {
getContext().getLogger().log(Level.FINER,
- "RegEx match found: [" + matcher.group() + "]");
+ "RegEx match found: [" + matcher.group() + "]");
// match found; extract locations of start and end of match
// (or of entire containing annotation, if that option is on)
int annotStart, annotEnd;
Modified: incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/casMultiplier/SimpleTextMerger.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/casMultiplier/SimpleTextMerger.java?view=diff&rev=480240&r1=480239&r2=480240
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/casMultiplier/SimpleTextMerger.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/casMultiplier/SimpleTextMerger.java Tue Nov 28 14:20:52 2006
@@ -37,18 +37,16 @@
import org.apache.uima.util.CasCopier;
/**
- * An example CasMultiplier, which merges text documents into larger ones.
- * It attempts to merge all of the segments that came from one original artifact.
- * This is done by checking the "lastSegment" feature of the SourceDocumentInformation
- * FeatureStructure, which is expected to be populated by the CollectionReader
- * or CasMultiplier that produced the input CASes.
+ * An example CasMultiplier, which merges text documents into larger ones. It attempts to merge all
+ * of the segments that came from one original artifact. This is done by checking the "lastSegment"
+ * feature of the SourceDocumentInformation FeatureStructure, which is expected to be populated by
+ * the CollectionReader or CasMultiplier that produced the input CASes.
* <p>
- * Limitations: if the lastSegment feature is never set to true by the component producing
- * the input CASes, the merger will never produce any output. Also, this implementation
- * relies on the CASes arriving in order, which could be a problem in a
- * mulithreaded framework implementation. The order requirement could be relieved by recording
- * a segment number in the SourceDocumentInformation, but that would also make this example
- * more complicated.
+ * Limitations: if the lastSegment feature is never set to true by the component producing the input
+ * CASes, the merger will never produce any output. Also, this implementation relies on the CASes
+ * arriving in order, which could be a problem in a mulithreaded framework implementation. The order
+ * requirement could be relieved by recording a segment number in the SourceDocumentInformation, but
+ * that would also make this example more complicated.
*/
public class SimpleTextMerger extends JCasMultiplier_ImplBase {
private StringBuffer mDocBuf = new StringBuffer();
@@ -88,7 +86,7 @@
// copy specified annotation types
CasCopier copier = new CasCopier(mMergedCas.getCas());
Set copiedIndexedFs = new HashSet(); // needed in case one annotation is in two indexes (could
- // happen if specified annotation types overlap)
+ // happen if specified annotation types overlap)
for (int i = 0; i < mAnnotationTypesToCopy.length; i++) {
Type type = mMergedCas.getTypeSystem().getType(mAnnotationTypesToCopy[i]);
FSIndex index = aJCas.getCas().getAnnotationIndex(type);
@@ -109,9 +107,9 @@
// get the SourceDocumentInformation FS, which indicates the sourceURI of the document
// and whether the incoming CAS is the last segment
FSIterator it = aJCas.getJFSIndexRepository()
- .getAnnotationIndex(SourceDocumentInformation.type).iterator();
+ .getAnnotationIndex(SourceDocumentInformation.type).iterator();
if (!it.hasNext()) {
- throw new RuntimeException("Missing SourceDocumentInformation");
+ throw new RuntimeException("Missing SourceDocumentInformation");
}
SourceDocumentInformation sourceDocInfo = (SourceDocumentInformation) it.next();
if (sourceDocInfo.getLastSegment()) {
@@ -147,7 +145,7 @@
*/
public AbstractCas next() throws AnalysisEngineProcessException {
if (!mReadyToOutput) {
- throw new RuntimeException("No next CAS");
+ throw new RuntimeException("No next CAS");
}
JCas casToReturn = mMergedCas;
mMergedCas = null;
Modified: incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/casMultiplier/SimpleTextSegmenter.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/casMultiplier/SimpleTextSegmenter.java?view=diff&rev=480240&r1=480239&r2=480240
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/casMultiplier/SimpleTextSegmenter.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/casMultiplier/SimpleTextSegmenter.java Tue Nov 28 14:20:52 2006
@@ -64,7 +64,7 @@
// retreive the filename of the input file from the CAS so that it can be added
// to each segment
FSIterator it = aJCas.getJFSIndexRepository()
- .getAnnotationIndex(SourceDocumentInformation.type).iterator();
+ .getAnnotationIndex(SourceDocumentInformation.type).iterator();
if (it.hasNext()) {
SourceDocumentInformation fileLoc = (SourceDocumentInformation) it.next();
mDocUri = fileLoc.getUri();
Modified: incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/cpe/AnnotationPrinter.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/cpe/AnnotationPrinter.java?view=diff&rev=480240&r1=480239&r2=480240
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/cpe/AnnotationPrinter.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/cpe/AnnotationPrinter.java Tue Nov 28 14:20:52 2006
@@ -73,16 +73,15 @@
// Output file should be specified in the descriptor
if (oPath == null) {
throw new ResourceInitializationException(
- ResourceInitializationException.CONFIG_SETTING_ABSENT,
- new Object[] { "outputFile" });
+ ResourceInitializationException.CONFIG_SETTING_ABSENT, new Object[] { "outputFile" });
}
// If specified output directory does not exist, try to create it
outFile = new File(oPath.trim());
if (outFile.getParentFile() != null && !outFile.getParentFile().exists()) {
if (!outFile.getParentFile().mkdirs())
throw new ResourceInitializationException(
- ResourceInitializationException.RESOURCE_DATA_NOT_VALID, new Object[] {
- oPath, "outputFile" });
+ ResourceInitializationException.RESOURCE_DATA_NOT_VALID, new Object[] { oPath,
+ "outputFile" });
}
try {
fileWriter = new FileWriter(outFile);
@@ -115,7 +114,7 @@
boolean titleP = false;
String docUri = null;
Iterator it = jcas.getJFSIndexRepository().getAnnotationIndex(SourceDocumentInformation.type)
- .iterator();
+ .iterator();
if (it.hasNext()) {
SourceDocumentInformation srcDocInfo = (SourceDocumentInformation) it.next();
docUri = srcDocInfo.getUri();
@@ -163,7 +162,7 @@
* @see org.apache.uima.collection.CasConsumer#batchProcessComplete(ProcessTrace)
*/
public void batchProcessComplete(ProcessTrace aTrace) throws ResourceProcessException,
- IOException {
+ IOException {
// nothing to do in this case as AnnotationPrinter doesnot do
// anything cumulatively
}
@@ -180,7 +179,7 @@
* @see org.apache.uima.collection.CasConsumer#collectionProcessComplete(ProcessTrace)
*/
public void collectionProcessComplete(ProcessTrace aTrace) throws ResourceProcessException,
- IOException {
+ IOException {
if (fileWriter != null) {
fileWriter.close();
}
@@ -211,8 +210,8 @@
if (oFile.getParentFile() != null && !oFile.getParentFile().exists()) {
if (!oFile.getParentFile().mkdirs())
throw new ResourceConfigurationException(
- ResourceInitializationException.RESOURCE_DATA_NOT_VALID, new Object[] {
- oPath, "outputFile" });
+ ResourceInitializationException.RESOURCE_DATA_NOT_VALID, new Object[] { oPath,
+ "outputFile" });
}
fileWriter = new FileWriter(oFile);
} catch (IOException e) {
Modified: incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/cpe/FileSystemCollectionReader.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/cpe/FileSystemCollectionReader.java?view=diff&rev=480240&r1=480239&r2=480240
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/cpe/FileSystemCollectionReader.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/cpe/FileSystemCollectionReader.java Tue Nov 28 14:20:52 2006
@@ -86,8 +86,7 @@
// if input directory does not exist or is not a directory, throw exception
if (!directory.exists() || !directory.isDirectory()) {
throw new ResourceInitializationException(ResourceConfigurationException.DIRECTORY_NOT_FOUND,
- new Object[] { PARAM_INPUTDIR, this.getMetaData().getName(),
- directory.getPath() });
+ new Object[] { PARAM_INPUTDIR, this.getMetaData().getName(), directory.getPath() });
}
// get list of files (not subdirectories) in the specified directory
Modified: incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/cpe/InlineXmlCasConsumer.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/cpe/InlineXmlCasConsumer.java?view=diff&rev=480240&r1=480239&r2=480240
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/cpe/InlineXmlCasConsumer.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/cpe/InlineXmlCasConsumer.java Tue Nov 28 14:20:52 2006
@@ -89,7 +89,7 @@
// retreive the filename of the input file from the CAS
FSIterator it = jcas.getJFSIndexRepository().getAnnotationIndex(SourceDocumentInformation.type)
- .iterator();
+ .iterator();
File outFile = null;
if (it.hasNext()) {
SourceDocumentInformation fileLoc = (SourceDocumentInformation) it.next();
Modified: incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/cpe/PersonTitleDBWriterCasConsumer.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/cpe/PersonTitleDBWriterCasConsumer.java?view=diff&rev=480240&r1=480239&r2=480240
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/cpe/PersonTitleDBWriterCasConsumer.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/cpe/PersonTitleDBWriterCasConsumer.java Tue Nov 28 14:20:52 2006
@@ -98,8 +98,7 @@
public void initialize() throws ResourceInitializationException {
startTime = System.currentTimeMillis();
System.out
- .println("Time: " + (System.currentTimeMillis() - startTime)
- + " initialize() called");
+ .println("Time: " + (System.currentTimeMillis() - startTime) + " initialize() called");
mOutputDir = new File((String) getConfigParameterValue(PARAM_OUTPUTDIR));
if (!mOutputDir.exists()) {
mOutputDir.mkdirs();
@@ -108,7 +107,7 @@
// make this the derby home by setting system property
System.setProperty("derby.system.home", mOutputDir.toString());
System.out.println("Time: " + (System.currentTimeMillis() - startTime)
- + " DB Writer: Set derby system home to: '" + mOutputDir.toString() + "'");
+ + " DB Writer: Set derby system home to: '" + mOutputDir.toString() + "'");
}
/**
@@ -126,7 +125,7 @@
*/
public void processCas(CAS aCAS) throws ResourceProcessException {
System.out.println("Time: " + (System.currentTimeMillis() - startTime)
- + " DB Writer: ProcessCas called");
+ + " DB Writer: ProcessCas called");
JCas jcas;
try {
jcas = aCAS.getJCas();
@@ -138,7 +137,7 @@
if (firstCall) {
firstCall = false;
System.out.println("Time: " + (System.currentTimeMillis() - startTime)
- + " DB Writer: First Time Initiailization: ");
+ + " DB Writer: First Time Initiailization: ");
// NOTE TO USERS: a better design will be to do the loading of the
// driver in the initialize() method, where it can
// throw a ResourceInitialization Exception if it can't
@@ -152,15 +151,15 @@
if (firstEverCall) {
firstEverCall = false;
System.out
- .println("Time: "
- + (System.currentTimeMillis() - startTime)
- + " DB Writer: Doing first process call ever (even during re-runs) initialization");
+ .println("Time: "
+ + (System.currentTimeMillis() - startTime)
+ + " DB Writer: Doing first process call ever (even during re-runs) initialization");
try {
// note: newInstance() call is needed to reinitialize properly after
// derby has been shutdown
Class.forName("org.apache.derby.jdbc.EmbeddedDriver").newInstance();
System.out.println("Time: " + (System.currentTimeMillis() - startTime)
- + " DB Writer: Loaded derby DB driver OK");
+ + " DB Writer: Loaded derby DB driver OK");
} catch (ClassNotFoundException e) {
System.err.println("No driver found for derby - check class path.");
} catch (InstantiationException e) {
@@ -189,18 +188,18 @@
File db = new File(mOutputDir.toString() + "/ExamplePersonTitleDB");
if (db.exists()) {
System.out.println("Time: " + (System.currentTimeMillis() - startTime)
- + " DB Writer: First Time Initiailization: Deleting Database");
+ + " DB Writer: First Time Initiailization: Deleting Database");
deleteDir(db);
System.out.println("Time: " + (System.currentTimeMillis() - startTime)
- + " DB Writer: First Time Initiailization: Database deleted");
+ + " DB Writer: First Time Initiailization: Database deleted");
}
con = DriverManager.getConnection("jdbc:derby:ExamplePersonTitleDB;create=true");
System.out
- .println("Time: "
- + (System.currentTimeMillis() - startTime)
- + " DB Writer: First Time Initiailization: Created the ExamplePersonTitleDB and connected to it.");
+ .println("Time: "
+ + (System.currentTimeMillis() - startTime)
+ + " DB Writer: First Time Initiailization: Created the ExamplePersonTitleDB and connected to it.");
// Databases typically use user-names and passwords; these can
// be passed as //properties to the getConnection method.
@@ -214,10 +213,10 @@
} catch (SQLException e) {
}
sqlStmt.execute("create table PersonTitle(" + "uri varchar(" + MAX_URI_LENGTH
- + "), spannedText varchar(" + MAX_TITLE_LENGTH
- + "), beginOffset int, endOffset int)");
+ + "), spannedText varchar(" + MAX_TITLE_LENGTH
+ + "), beginOffset int, endOffset int)");
System.out.println("Time: " + (System.currentTimeMillis() - startTime)
- + " DB Writer: First Time Initiailization: Created the PersonTitle table.");
+ + " DB Writer: First Time Initiailization: Created the PersonTitle table.");
sqlStmt.close(); // free resources associated with this
// statement
@@ -231,14 +230,14 @@
// get the singleton instance of the SourceDocumentInformation
SourceDocumentInformation sdi = (SourceDocumentInformation) jcas.getJFSIndexRepository()
- .getAnnotationIndex(SourceDocumentInformation.type).iterator().next();
+ .getAnnotationIndex(SourceDocumentInformation.type).iterator().next();
System.out.println("Time: " + (System.currentTimeMillis() - startTime)
- + " DB Writer: Processing doc: '" + sdi.getUri() + "'");
+ + " DB Writer: Processing doc: '" + sdi.getUri() + "'");
stmt.setString(1, truncate(sdi.getUri(), MAX_URI_LENGTH));
for (FSIterator iter = jcas.getJFSIndexRepository().getAnnotationIndex(PersonTitle.type)
- .iterator(); iter.hasNext();) {
+ .iterator(); iter.hasNext();) {
PersonTitle pt = (PersonTitle) iter.next();
stmt.setString(2, truncate(pt.getCoveredText(), MAX_TITLE_LENGTH));
stmt.setInt(3, pt.getBegin());
@@ -247,7 +246,7 @@
batchCounter--;
if (batchCounter <= 0) {
System.out.println("Time: " + (System.currentTimeMillis() - startTime)
- + " DB Writer: Batch writing updates - process call");
+ + " DB Writer: Batch writing updates - process call");
stmt.executeBatch();
// NOTE TO USERS: Although we "commit" here, you may want
// to delay committing until batchProcessComplete - or some
@@ -279,13 +278,13 @@
}
public void collectionProcessComplete(ProcessTrace arg0) throws ResourceProcessException,
- IOException {
+ IOException {
firstCall = true;
try {
if (batchCounter < DB_LOAD_BATCH_SIZE) {
System.out.println("Time: " + (System.currentTimeMillis() - startTime)
- + " DB Writer: Batch writing updates - processComplete call");
+ + " DB Writer: Batch writing updates - processComplete call");
stmt.executeBatch();
con.commit();
batchCounter = DB_LOAD_BATCH_SIZE;
@@ -294,7 +293,7 @@
stmt.close();
con.close();
System.out.println("Time: " + (System.currentTimeMillis() - startTime)
- + " DB Writer: Sucessfully closed the connection - done.");
+ + " DB Writer: Sucessfully closed the connection - done.");
} catch (SQLException e) {
System.err.println("Unexpected SQL exception");
Modified: incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/cpe/SimpleRunCPE.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/cpe/SimpleRunCPE.java?view=diff&rev=480240&r1=480239&r2=480240
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/cpe/SimpleRunCPE.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/cpe/SimpleRunCPE.java Tue Nov 28 14:20:52 2006
@@ -67,7 +67,7 @@
// parse CPE descriptor
System.out.println("Parsing CPE Descriptor");
CpeDescription cpeDesc = UIMAFramework.getXMLParser().parseCpeDescription(
- new XMLInputSource(args[0]));
+ new XMLInputSource(args[0]));
// instantiate CPE
System.out.println("Instantiating CPE");
mCPE = UIMAFramework.produceCollectionProcessingEngine(cpeDesc);
@@ -96,7 +96,7 @@
*/
private static void printUsageMessage() {
System.out.println(" Arguments to the program are as follows : \n"
- + "args[0] : path to CPE descriptor file");
+ + "args[0] : path to CPE descriptor file");
}
/**
Modified: incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/cpe/SimpleRunCPM.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/cpe/SimpleRunCPM.java?view=diff&rev=480240&r1=480239&r2=480240
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/cpe/SimpleRunCPM.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/cpe/SimpleRunCPM.java Tue Nov 28 14:20:52 2006
@@ -94,13 +94,13 @@
// Collection Reader
System.out.println("Initializing Collection Reader");
ResourceSpecifier colReaderSpecifier = UIMAFramework.getXMLParser()
- .parseCollectionReaderDescription(new XMLInputSource(args[0]));
+ .parseCollectionReaderDescription(new XMLInputSource(args[0]));
CollectionReader collectionReader = UIMAFramework.produceCollectionReader(colReaderSpecifier);
// CAS Initializer
System.out.println("Initializing CAS Initializer");
ResourceSpecifier casIniSpecifier = UIMAFramework.getXMLParser()
- .parseCasInitializerDescription(new XMLInputSource(args[1]));
+ .parseCasInitializerDescription(new XMLInputSource(args[1]));
CasInitializer casIni = UIMAFramework.produceCasInitializer(casIniSpecifier);
// plug CAS Initializer into Collection Reader
collectionReader.setCasInitializer(casIni);
@@ -108,13 +108,13 @@
// TAE
System.out.println("Initializing AnalysisEngine");
ResourceSpecifier aeSpecifier = UIMAFramework.getXMLParser().parseResourceSpecifier(
- new XMLInputSource(args[2]));
+ new XMLInputSource(args[2]));
AnalysisEngine ae = UIMAFramework.produceAnalysisEngine(aeSpecifier);
// CAS Consumer
System.out.println("Initializing CAS Consumer");
ResourceSpecifier consumerSpecifier = UIMAFramework.getXMLParser().parseCasConsumerDescription(
- new XMLInputSource(args[3]));
+ new XMLInputSource(args[3]));
CasConsumer casConsumer = UIMAFramework.produceCasConsumer(consumerSpecifier);
// create a new Collection Processing Manager
@@ -139,10 +139,9 @@
*/
private static void printUsageMessage() {
System.out.println(" Arguments to the program are as follows : \n"
- + "args[0] : CollectionReader descriptor file \n "
- + "args[1] : CAS Initializer descriptor file \n "
- + "args[2] : TAE descriptor file. \n"
- + "args[3] : CAS Consumer descriptor file");
+ + "args[0] : CollectionReader descriptor file \n "
+ + "args[1] : CAS Initializer descriptor file \n " + "args[2] : TAE descriptor file. \n"
+ + "args[3] : CAS Consumer descriptor file");
}
/**
Modified: incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/cpe/SimpleXmlCasInitializer.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/cpe/SimpleXmlCasInitializer.java?view=diff&rev=480240&r1=480239&r2=480240
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/cpe/SimpleXmlCasInitializer.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/cpe/SimpleXmlCasInitializer.java Tue Nov 28 14:20:52 2006
@@ -86,7 +86,7 @@
inputSource = new InputSource((InputStream) aObj);
} else {
throw new CollectionException(CollectionException.INCORRECT_INPUT_TO_CAS_INITIALIZER,
- new Object[] { InputStream.class.getName(), aObj.getClass().getName() });
+ new Object[] { InputStream.class.getName(), aObj.getClass().getName() });
}
// create SAX ContentHandler that populates CAS
SaxHandler handler = new SaxHandler(aCAS);
@@ -126,7 +126,7 @@
* java.lang.String, org.xml.sax.Attributes)
*/
public void startElement(String uri, String localName, String qName, Attributes attributes)
- throws SAXException {
+ throws SAXException {
if (mInsideTextTag) {
mBuf.append('<').append(qName).append('>');
} else if (qName.equalsIgnoreCase(mXmlTagContainingText)) {
Modified: incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/cpe/XCasWriterCasConsumer.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/cpe/XCasWriterCasConsumer.java?view=diff&rev=480240&r1=480239&r2=480240
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/cpe/XCasWriterCasConsumer.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/cpe/XCasWriterCasConsumer.java Tue Nov 28 14:20:52 2006
@@ -90,7 +90,7 @@
// retreive the filename of the input file from the CAS
FSIterator it = jcas.getJFSIndexRepository().getAnnotationIndex(SourceDocumentInformation.type)
- .iterator();
+ .iterator();
File outFile = null;
if (it.hasNext()) {
SourceDocumentInformation fileLoc = (SourceDocumentInformation) it.next();
Modified: incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/tokenizer/Sentence.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/tokenizer/Sentence.java?view=diff&rev=480240&r1=480239&r2=480240
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/tokenizer/Sentence.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/tokenizer/Sentence.java Tue Nov 28 14:20:52 2006
@@ -26,11 +26,16 @@
public class Sentence extends Annotation {
public final static int typeIndexID = JCas.getNextIndex();
+
public final static int type = typeIndexID;
- public int getTypeIndexID() {return typeIndexID;}
- // Never called. Disable default constructor
- protected Sentence() {}
+ public int getTypeIndexID() {
+ return typeIndexID;
+ }
+
+ // Never called. Disable default constructor
+ protected Sentence() {
+ }
/** Internal - Constructor used by generator */
public Sentence(int addr, TOP_Type type) {
@@ -41,6 +46,7 @@
super(jcas);
}
-
- public Sentence(JCas jcas, int start, int end) { super(jcas, start, end);}
+ public Sentence(JCas jcas, int start, int end) {
+ super(jcas, start, end);
+ }
}
Modified: incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/tokenizer/Sentence_Type.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/tokenizer/Sentence_Type.java?view=diff&rev=480240&r1=480239&r2=480240
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/tokenizer/Sentence_Type.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/tokenizer/Sentence_Type.java Tue Nov 28 14:20:52 2006
@@ -28,35 +28,40 @@
import org.apache.uima.jcas.tcas.Annotation_Type;
public class Sentence_Type extends Annotation_Type {
- protected FSGenerator getFSGenerator() {return fsGenerator;}
- private final FSGenerator fsGenerator =
- new FSGenerator() {
- public FeatureStructure createFS(int addr, CASImpl cas) {
- if (instanceOf_Type.useExistingInstance) {
- // Return eq fs instance if already created
- FeatureStructure fs = instanceOf_Type.jcas.getJfsFromCaddr(addr);
- if (null == fs) {
- fs = new Sentence(addr, instanceOf_Type);
- instanceOf_Type.jcas.putJfsFromCaddr(addr, fs);
- return fs;
- }
- return fs;
- } else return new Sentence(addr, instanceOf_Type);
- }
- };
+ protected FSGenerator getFSGenerator() {
+ return fsGenerator;
+ }
+
+ private final FSGenerator fsGenerator = new FSGenerator() {
+ public FeatureStructure createFS(int addr, CASImpl cas) {
+ if (instanceOf_Type.useExistingInstance) {
+ // Return eq fs instance if already created
+ FeatureStructure fs = instanceOf_Type.jcas.getJfsFromCaddr(addr);
+ if (null == fs) {
+ fs = new Sentence(addr, instanceOf_Type);
+ instanceOf_Type.jcas.putJfsFromCaddr(addr, fs);
+ return fs;
+ }
+ return fs;
+ } else
+ return new Sentence(addr, instanceOf_Type);
+ }
+ };
public final static int typeIndexID = Sentence.typeIndexID;
- public final static boolean featOkTst = JCas.getFeatOkTst("org.apache.uima_examples.tokenizer.Sentence");
+ public final static boolean featOkTst = JCas
+ .getFeatOkTst("org.apache.uima_examples.tokenizer.Sentence");
- //* initialize variables to correspond with Cas Type and Features
+ // * initialize variables to correspond with Cas Type and Features
public Sentence_Type(JCas jcas, Type casType) {
super(jcas, casType);
- casImpl.getFSClassRegistry().addGeneratorForType((TypeImpl)this.casType, getFSGenerator());
+ casImpl.getFSClassRegistry().addGeneratorForType((TypeImpl) this.casType, getFSGenerator());
}
- protected Sentence_Type() { //block default new operator
- throw new RuntimeException("Internal Error-this constructor should never be called."); }
+ protected Sentence_Type() { // block default new operator
+ throw new RuntimeException("Internal Error-this constructor should never be called.");
+ }
}
Modified: incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/tokenizer/SimpleTokenAndSentenceAnnotator.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/tokenizer/SimpleTokenAndSentenceAnnotator.java?view=diff&rev=480240&r1=480239&r2=480240
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/tokenizer/SimpleTokenAndSentenceAnnotator.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/tokenizer/SimpleTokenAndSentenceAnnotator.java Tue Nov 28 14:20:52 2006
@@ -83,7 +83,7 @@
void makeAnnotations(Maker m, BreakIterator b) {
b.setText(input);
for (int end = b.next(), start = b.first(); end != BreakIterator.DONE; start = end, end = b
- .next()) {
+ .next()) {
// eliminate all-whitespace tokens
boolean isWhitespace = true;
for (int i = start; i < end; i++) {
Modified: incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/tokenizer/Token.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/tokenizer/Token.java?view=diff&rev=480240&r1=480239&r2=480240
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/tokenizer/Token.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/tokenizer/Token.java Tue Nov 28 14:20:52 2006
@@ -26,11 +26,16 @@
public class Token extends Annotation {
public final static int typeIndexID = JCas.getNextIndex();
+
public final static int type = typeIndexID;
- public int getTypeIndexID() {return typeIndexID;}
- // Never called. Disable default constructor
- protected Token() {}
+ public int getTypeIndexID() {
+ return typeIndexID;
+ }
+
+ // Never called. Disable default constructor
+ protected Token() {
+ }
/** Internal - Constructor used by generator */
public Token(int addr, TOP_Type type) {
@@ -41,6 +46,7 @@
super(jcas);
}
-
- public Token(JCas jcas, int start, int end) { super(jcas, start, end);}
+ public Token(JCas jcas, int start, int end) {
+ super(jcas, start, end);
+ }
}
Modified: incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/tokenizer/Token_Type.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/tokenizer/Token_Type.java?view=diff&rev=480240&r1=480239&r2=480240
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/tokenizer/Token_Type.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/tokenizer/Token_Type.java Tue Nov 28 14:20:52 2006
@@ -28,35 +28,40 @@
import org.apache.uima.jcas.tcas.Annotation_Type;
public class Token_Type extends Annotation_Type {
- protected FSGenerator getFSGenerator() {return fsGenerator;}
- private final FSGenerator fsGenerator =
- new FSGenerator() {
- public FeatureStructure createFS(int addr, CASImpl cas) {
- if (instanceOf_Type.useExistingInstance) {
- // Return eq fs instance if already created
- FeatureStructure fs = instanceOf_Type.jcas.getJfsFromCaddr(addr);
- if (null == fs) {
- fs = new Token(addr, instanceOf_Type);
- instanceOf_Type.jcas.putJfsFromCaddr(addr, fs);
- return fs;
- }
- return fs;
- } else return new Token(addr, instanceOf_Type);
- }
- };
+ protected FSGenerator getFSGenerator() {
+ return fsGenerator;
+ }
+
+ private final FSGenerator fsGenerator = new FSGenerator() {
+ public FeatureStructure createFS(int addr, CASImpl cas) {
+ if (instanceOf_Type.useExistingInstance) {
+ // Return eq fs instance if already created
+ FeatureStructure fs = instanceOf_Type.jcas.getJfsFromCaddr(addr);
+ if (null == fs) {
+ fs = new Token(addr, instanceOf_Type);
+ instanceOf_Type.jcas.putJfsFromCaddr(addr, fs);
+ return fs;
+ }
+ return fs;
+ } else
+ return new Token(addr, instanceOf_Type);
+ }
+ };
public final static int typeIndexID = Token.typeIndexID;
- public final static boolean featOkTst = JCas.getFeatOkTst("org.apache.uima_examples.tokenizer.Token");
+ public final static boolean featOkTst = JCas
+ .getFeatOkTst("org.apache.uima_examples.tokenizer.Token");
- //* initialize variables to correspond with Cas Type and Features
+ // * initialize variables to correspond with Cas Type and Features
public Token_Type(JCas jcas, Type casType) {
super(jcas, casType);
- casImpl.getFSClassRegistry().addGeneratorForType((TypeImpl)this.casType, getFSGenerator());
+ casImpl.getFSClassRegistry().addGeneratorForType((TypeImpl) this.casType, getFSGenerator());
}
- protected Token_Type() { //block default new operator
- throw new RuntimeException("Internal Error-this constructor should never be called."); }
+ protected Token_Type() { // block default new operator
+ throw new RuntimeException("Internal Error-this constructor should never be called.");
+ }
}
Modified: incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/xmi/XmiCollectionReader.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/xmi/XmiCollectionReader.java?view=diff&rev=480240&r1=480239&r2=480240
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/xmi/XmiCollectionReader.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/xmi/XmiCollectionReader.java Tue Nov 28 14:20:52 2006
@@ -59,8 +59,7 @@
// if input directory does not exist or is not a directory, throw exception
if (!directory.exists() || !directory.isDirectory()) {
throw new ResourceInitializationException(ResourceConfigurationException.DIRECTORY_NOT_FOUND,
- new Object[] { PARAM_INPUTDIR, this.getMetaData().getName(),
- directory.getPath() });
+ new Object[] { PARAM_INPUTDIR, this.getMetaData().getName(), directory.getPath() });
}
// get list of .xmi files in the specified directory
Modified: incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/xmi/XmiEcoreCasConsumer.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/xmi/XmiEcoreCasConsumer.java?view=diff&rev=480240&r1=480239&r2=480240
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/xmi/XmiEcoreCasConsumer.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/xmi/XmiEcoreCasConsumer.java Tue Nov 28 14:20:52 2006
@@ -90,7 +90,7 @@
mOutputDir.mkdirs();
}
writeEcoreTypeSystem = Boolean.TRUE.equals(getUimaContext().getConfigParameterValue(
- PARAM_WRITE_ECORE_TYPESYSTEM));
+ PARAM_WRITE_ECORE_TYPESYSTEM));
}
/**
@@ -116,7 +116,7 @@
// retreive the filename of the input file from the CAS
FSIterator it = jcas.getJFSIndexRepository().getAnnotationIndex(SourceDocumentInformation.type)
- .iterator();
+ .iterator();
File outFile = null;
if (it.hasNext()) {
SourceDocumentInformation fileLoc = (SourceDocumentInformation) it.next();
@@ -166,18 +166,18 @@
// Generate E-core for type system, but only once
if (writeEcoreTypeSystem && !isModelGenerated) {
TypeSystemDescription tsDesc = TypeSystemUtil.typeSystem2TypeSystemDescription(aCas
- .getTypeSystem());
+ .getTypeSystem());
// register default resource factory
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("*",
- new XMIResourceFactoryImpl());
+ new XMIResourceFactoryImpl());
ResourceSet resourceSet = new ResourceSetImpl();
URI outputURI = URI.createFileURI(new File(mOutputDir, "typesystem.ecore")
- .getAbsolutePath());
+ .getAbsolutePath());
Resource outputResource = resourceSet.createResource(outputURI);
schemaLocationMap = new HashMap();
try {
UimaTypeSystem2Ecore
- .uimaTypeSystem2Ecore(tsDesc, outputResource, null, schemaLocationMap);
+ .uimaTypeSystem2Ecore(tsDesc, outputResource, null, schemaLocationMap);
} catch (InvalidXMLException e) {
// this should not happen. TypeSystemUtil.typeSystem2TypeSystemDescription
// should never produce an invalid TypeSystemDescription!
Modified: incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/xmi/XmiWriterCasConsumer.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/xmi/XmiWriterCasConsumer.java?view=diff&rev=480240&r1=480239&r2=480240
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/xmi/XmiWriterCasConsumer.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/xmi/XmiWriterCasConsumer.java Tue Nov 28 14:20:52 2006
@@ -89,7 +89,7 @@
// retreive the filename of the input file from the CAS
FSIterator it = jcas.getJFSIndexRepository().getAnnotationIndex(SourceDocumentInformation.type)
- .iterator();
+ .iterator();
File outFile = null;
if (it.hasNext()) {
SourceDocumentInformation fileLoc = (SourceDocumentInformation) it.next();
Modified: incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/tutorial/DateAnnot.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/tutorial/DateAnnot.java?view=diff&rev=480240&r1=480239&r2=480240
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/tutorial/DateAnnot.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/tutorial/DateAnnot.java Tue Nov 28 14:20:52 2006
@@ -19,57 +19,70 @@
package org.apache.uima.tutorial;
-import org.apache.uima.jcas.impl.JCas;
+import org.apache.uima.jcas.impl.JCas;
import org.apache.uima.jcas.cas.TOP_Type;
-
-
-/**
- * Updated by JCasGen Mon Nov 29 15:02:38 EST 2004
- * XML source: C:/Program Files/apache/uima/examples/descriptors/tutorial/ex6/TutorialTypeSystem.xml
- * @generated */
+/**
+ * Updated by JCasGen Mon Nov 29 15:02:38 EST 2004 XML source: C:/Program
+ * Files/apache/uima/examples/descriptors/tutorial/ex6/TutorialTypeSystem.xml
+ *
+ * @generated
+ */
public class DateAnnot extends DateTimeAnnot {
- /** @generated
- * @ordered
+ /**
+ * @generated
+ * @ordered
*/
public final static int typeIndexID = JCas.getNextIndex();
- /** @generated
- * @ordered
+
+ /**
+ * @generated
+ * @ordered
*/
public final static int type = typeIndexID;
- /** @generated */
- public int getTypeIndexID() {return typeIndexID;}
-
- /** Never called. Disable default constructor
- * @generated */
- protected DateAnnot() {}
-
- /** Internal - constructor used by generator
- * @generated */
+
+ /** @generated */
+ public int getTypeIndexID() {
+ return typeIndexID;
+ }
+
+ /**
+ * Never called. Disable default constructor
+ *
+ * @generated
+ */
+ protected DateAnnot() {
+ }
+
+ /**
+ * Internal - constructor used by generator
+ *
+ * @generated
+ */
public DateAnnot(int addr, TOP_Type type) {
super(addr, type);
readObject();
}
-
+
/** @generated */
public DateAnnot(JCas jcas) {
super(jcas);
- readObject();
- }
-
+ readObject();
+ }
+
public DateAnnot(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() {}
-
-}
+ /**
+ * <!-- begin-user-doc --> Write your own initialization here <!-- end-user-doc -->
+ *
+ * @generated modifiable
+ */
+ private void readObject() {
+ }
-
+}
Modified: incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/tutorial/DateAnnot_Type.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/tutorial/DateAnnot_Type.java?view=diff&rev=480240&r1=480239&r2=480240
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/tutorial/DateAnnot_Type.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/tutorial/DateAnnot_Type.java Tue Nov 28 14:20:52 2006
@@ -26,44 +26,51 @@
import org.apache.uima.cas.impl.TypeImpl;
import org.apache.uima.cas.Type;
-/**
+/**
* Updated by JCasGen Mon Nov 29 15:02:38 EST 2004
- * @generated */
+ *
+ * @generated
+ */
public class DateAnnot_Type extends DateTimeAnnot_Type {
/** @generated */
- protected FSGenerator getFSGenerator() {return fsGenerator;}
+ protected FSGenerator getFSGenerator() {
+ return fsGenerator;
+ }
+
/** @generated */
- private final FSGenerator fsGenerator =
- new FSGenerator() {
- public FeatureStructure createFS(int addr, CASImpl cas) {
- if (instanceOf_Type.useExistingInstance) {
- // Return eq fs instance if already created
- FeatureStructure fs = instanceOf_Type.jcas.getJfsFromCaddr(addr);
- if (null == fs) {
- fs = new DateAnnot(addr, instanceOf_Type);
- instanceOf_Type.jcas.putJfsFromCaddr(addr, fs);
- return fs;
- }
- return fs;
- } else return new DateAnnot(addr, instanceOf_Type);
- }
- };
+ private final FSGenerator fsGenerator = new FSGenerator() {
+ public FeatureStructure createFS(int addr, CASImpl cas) {
+ if (instanceOf_Type.useExistingInstance) {
+ // Return eq fs instance if already created
+ FeatureStructure fs = instanceOf_Type.jcas.getJfsFromCaddr(addr);
+ if (null == fs) {
+ fs = new DateAnnot(addr, instanceOf_Type);
+ instanceOf_Type.jcas.putJfsFromCaddr(addr, fs);
+ return fs;
+ }
+ return fs;
+ } else
+ return new DateAnnot(addr, instanceOf_Type);
+ }
+ };
+
/** @generated */
public final static int typeIndexID = DateAnnot.typeIndexID;
- /** @generated
- @modifiable */
- public final static boolean featOkTst = JCas.getFeatOkTst("org.apache.uima.tutorial.DateAnnot");
+ /**
+ * @generated
+ * @modifiable
+ */
+ public final static boolean featOkTst = JCas.getFeatOkTst("org.apache.uima.tutorial.DateAnnot");
- /** initialize variables to correspond with Cas Type and Features
- * @generated */
+ /**
+ * initialize variables to correspond with Cas Type and Features
+ *
+ * @generated
+ */
public DateAnnot_Type(JCas jcas, Type casType) {
super(jcas, casType);
- casImpl.getFSClassRegistry().addGeneratorForType((TypeImpl)this.casType, getFSGenerator());
+ casImpl.getFSClassRegistry().addGeneratorForType((TypeImpl) this.casType, getFSGenerator());
}
}
-
-
-
-
Modified: incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/tutorial/DateTimeAnnot.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/tutorial/DateTimeAnnot.java?view=diff&rev=480240&r1=480239&r2=480240
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/tutorial/DateTimeAnnot.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/tutorial/DateTimeAnnot.java Tue Nov 28 14:20:52 2006
@@ -19,76 +19,100 @@
package org.apache.uima.tutorial;
-import org.apache.uima.jcas.impl.JCas;
+import org.apache.uima.jcas.impl.JCas;
import org.apache.uima.jcas.cas.TOP_Type;
import org.apache.uima.jcas.tcas.Annotation;
-
-/**
- * Updated by JCasGen Mon Nov 29 15:02:38 EST 2004
- * XML source: C:/Program Files/apache/uima/examples/descriptors/tutorial/ex6/TutorialTypeSystem.xml
- * @generated */
+/**
+ * Updated by JCasGen Mon Nov 29 15:02:38 EST 2004 XML source: C:/Program
+ * Files/apache/uima/examples/descriptors/tutorial/ex6/TutorialTypeSystem.xml
+ *
+ * @generated
+ */
public class DateTimeAnnot extends Annotation {
- /** @generated
- * @ordered
+ /**
+ * @generated
+ * @ordered
*/
public final static int typeIndexID = JCas.getNextIndex();
- /** @generated
- * @ordered
+
+ /**
+ * @generated
+ * @ordered
*/
public final static int type = typeIndexID;
- /** @generated */
- public int getTypeIndexID() {return typeIndexID;}
-
- /** Never called. Disable default constructor
- * @generated */
- protected DateTimeAnnot() {}
-
- /** Internal - constructor used by generator
- * @generated */
+
+ /** @generated */
+ public int getTypeIndexID() {
+ return typeIndexID;
+ }
+
+ /**
+ * Never called. Disable default constructor
+ *
+ * @generated
+ */
+ protected DateTimeAnnot() {
+ }
+
+ /**
+ * Internal - constructor used by generator
+ *
+ * @generated
+ */
public DateTimeAnnot(int addr, TOP_Type type) {
super(addr, type);
readObject();
}
-
+
/** @generated */
public DateTimeAnnot(JCas jcas) {
super(jcas);
- readObject();
- }
-
+ readObject();
+ }
+
public DateTimeAnnot(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() {
+ }
- /** <!-- begin-user-doc -->
- * Write your own initialization here
- * <!-- end-user-doc -->
- @generated modifiable */
- private void readObject() {}
-
-
-
- //*--------------*
- //* Feature: shortDateString
+ // *--------------*
+ // * Feature: shortDateString
- /** getter for shortDateString - gets
- * @generated */
+ /**
+ * getter for shortDateString - gets
+ *
+ * @generated
+ */
public String getShortDateString() {
- if (DateTimeAnnot_Type.featOkTst && ((DateTimeAnnot_Type)jcasType).casFeat_shortDateString == null)
+ if (DateTimeAnnot_Type.featOkTst
+ && ((DateTimeAnnot_Type) jcasType).casFeat_shortDateString == null)
JCas.throwFeatMissing("shortDateString", "org.apache.uima.tutorial.DateTimeAnnot");
- return jcasType.ll_cas.ll_getStringValue(addr, ((DateTimeAnnot_Type)jcasType).casFeatCode_shortDateString);}
-
- /** setter for shortDateString - sets
- * @generated */
+ return jcasType.ll_cas.ll_getStringValue(addr,
+ ((DateTimeAnnot_Type) jcasType).casFeatCode_shortDateString);
+ }
+
+ /**
+ * setter for shortDateString - sets
+ *
+ * @generated
+ */
public void setShortDateString(String v) {
- if (DateTimeAnnot_Type.featOkTst && ((DateTimeAnnot_Type)jcasType).casFeat_shortDateString == null)
+ if (DateTimeAnnot_Type.featOkTst
+ && ((DateTimeAnnot_Type) jcasType).casFeat_shortDateString == null)
JCas.throwFeatMissing("shortDateString", "org.apache.uima.tutorial.DateTimeAnnot");
- jcasType.ll_cas.ll_setStringValue(addr, ((DateTimeAnnot_Type)jcasType).casFeatCode_shortDateString, v);}
+ jcasType.ll_cas.ll_setStringValue(addr,
+ ((DateTimeAnnot_Type) jcasType).casFeatCode_shortDateString, v);
}
-
-
+}
Modified: incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/tutorial/DateTimeAnnot_Type.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/tutorial/DateTimeAnnot_Type.java?view=diff&rev=480240&r1=480239&r2=480240
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/tutorial/DateTimeAnnot_Type.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/tutorial/DateTimeAnnot_Type.java Tue Nov 28 14:20:52 2006
@@ -29,66 +29,77 @@
import org.apache.uima.cas.Feature;
import org.apache.uima.jcas.tcas.Annotation_Type;
-/**
+/**
* Updated by JCasGen Mon Nov 29 15:02:38 EST 2004
- * @generated */
+ *
+ * @generated
+ */
public class DateTimeAnnot_Type extends Annotation_Type {
/** @generated */
- protected FSGenerator getFSGenerator() {return fsGenerator;}
+ protected FSGenerator getFSGenerator() {
+ return fsGenerator;
+ }
+
/** @generated */
- private final FSGenerator fsGenerator =
- new FSGenerator() {
- public FeatureStructure createFS(int addr, CASImpl cas) {
- if (instanceOf_Type.useExistingInstance) {
- // Return eq fs instance if already created
- FeatureStructure fs = instanceOf_Type.jcas.getJfsFromCaddr(addr);
- if (null == fs) {
- fs = new DateTimeAnnot(addr, instanceOf_Type);
- instanceOf_Type.jcas.putJfsFromCaddr(addr, fs);
- return fs;
- }
- return fs;
- } else return new DateTimeAnnot(addr, instanceOf_Type);
- }
- };
+ private final FSGenerator fsGenerator = new FSGenerator() {
+ public FeatureStructure createFS(int addr, CASImpl cas) {
+ if (instanceOf_Type.useExistingInstance) {
+ // Return eq fs instance if already created
+ FeatureStructure fs = instanceOf_Type.jcas.getJfsFromCaddr(addr);
+ if (null == fs) {
+ fs = new DateTimeAnnot(addr, instanceOf_Type);
+ instanceOf_Type.jcas.putJfsFromCaddr(addr, fs);
+ return fs;
+ }
+ return fs;
+ } else
+ return new DateTimeAnnot(addr, instanceOf_Type);
+ }
+ };
+
/** @generated */
public final static int typeIndexID = DateTimeAnnot.typeIndexID;
- /** @generated
- @modifiable */
- public final static boolean featOkTst = JCas.getFeatOkTst("org.apache.uima.tutorial.DateTimeAnnot");
-
+
+ /**
+ * @generated
+ * @modifiable
+ */
+ public final static boolean featOkTst = JCas
+ .getFeatOkTst("org.apache.uima.tutorial.DateTimeAnnot");
+
/** @generated */
final Feature casFeat_shortDateString;
+
+ /** @generated */
+ final int casFeatCode_shortDateString;
+
/** @generated */
- final int casFeatCode_shortDateString;
- /** @generated */
public String getShortDateString(int addr) {
- if (featOkTst && casFeat_shortDateString == null)
+ if (featOkTst && casFeat_shortDateString == null)
JCas.throwFeatMissing("shortDateString", "org.apache.uima.tutorial.DateTimeAnnot");
return ll_cas.ll_getStringValue(addr, casFeatCode_shortDateString);
}
- /** @generated */
+
+ /** @generated */
public void setShortDateString(int addr, String v) {
- if (featOkTst && casFeat_shortDateString == null)
+ if (featOkTst && casFeat_shortDateString == null)
JCas.throwFeatMissing("shortDateString", "org.apache.uima.tutorial.DateTimeAnnot");
- ll_cas.ll_setStringValue(addr, casFeatCode_shortDateString, v);}
-
-
-
+ ll_cas.ll_setStringValue(addr, casFeatCode_shortDateString, v);
+ }
- /** initialize variables to correspond with Cas Type and Features
- * @generated */
+ /**
+ * initialize variables to correspond with Cas Type and Features
+ *
+ * @generated
+ */
public DateTimeAnnot_Type(JCas jcas, Type casType) {
super(jcas, casType);
- casImpl.getFSClassRegistry().addGeneratorForType((TypeImpl)this.casType, getFSGenerator());
+ casImpl.getFSClassRegistry().addGeneratorForType((TypeImpl) this.casType, getFSGenerator());
-
- casFeat_shortDateString = jcas.getRequiredFeatureDE(casType, "shortDateString", "uima.cas.String", featOkTst);
- casFeatCode_shortDateString = (null == casFeat_shortDateString) ? JCas.INVALID_FEATURE_CODE : ((FeatureImpl)casFeat_shortDateString).getCode();
+ casFeat_shortDateString = jcas.getRequiredFeatureDE(casType, "shortDateString",
+ "uima.cas.String", featOkTst);
+ casFeatCode_shortDateString = (null == casFeat_shortDateString) ? JCas.INVALID_FEATURE_CODE
+ : ((FeatureImpl) casFeat_shortDateString).getCode();
}
}
-
-
-
-
Modified: incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/tutorial/Meeting.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/tutorial/Meeting.java?view=diff&rev=480240&r1=480239&r2=480240
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/tutorial/Meeting.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/tutorial/Meeting.java Tue Nov 28 14:20:52 2006
@@ -19,147 +19,195 @@
package org.apache.uima.tutorial;
-import org.apache.uima.jcas.impl.JCas;
+import org.apache.uima.jcas.impl.JCas;
import org.apache.uima.jcas.cas.TOP_Type;
import org.apache.uima.jcas.tcas.Annotation;
-
-/**
- * Updated by JCasGen Mon Nov 29 15:02:38 EST 2004
- * XML source: C:/Program Files/apache/uima/examples/descriptors/tutorial/ex6/TutorialTypeSystem.xml
- * @generated */
+/**
+ * Updated by JCasGen Mon Nov 29 15:02:38 EST 2004 XML source: C:/Program
+ * Files/apache/uima/examples/descriptors/tutorial/ex6/TutorialTypeSystem.xml
+ *
+ * @generated
+ */
public class Meeting extends Annotation {
- /** @generated
- * @ordered
+ /**
+ * @generated
+ * @ordered
*/
public final static int typeIndexID = JCas.getNextIndex();
- /** @generated
- * @ordered
+
+ /**
+ * @generated
+ * @ordered
*/
public final static int type = typeIndexID;
- /** @generated */
- public int getTypeIndexID() {return typeIndexID;}
-
- /** Never called. Disable default constructor
- * @generated */
- protected Meeting() {}
-
- /** Internal - constructor used by generator
- * @generated */
+
+ /** @generated */
+ public int getTypeIndexID() {
+ return typeIndexID;
+ }
+
+ /**
+ * Never called. Disable default constructor
+ *
+ * @generated
+ */
+ protected Meeting() {
+ }
+
+ /**
+ * Internal - constructor used by generator
+ *
+ * @generated
+ */
public Meeting(int addr, TOP_Type type) {
super(addr, type);
readObject();
}
-
+
/** @generated */
public Meeting(JCas jcas) {
super(jcas);
- readObject();
- }
-
+ readObject();
+ }
+
public Meeting(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() {
+ }
- /** <!-- begin-user-doc -->
- * Write your own initialization here
- * <!-- end-user-doc -->
- @generated modifiable */
- private void readObject() {}
-
-
-
- //*--------------*
- //* Feature: room
+ // *--------------*
+ // * Feature: room
- /** getter for room - gets
- * @generated */
+ /**
+ * getter for room - gets
+ *
+ * @generated
+ */
public RoomNumber getRoom() {
- if (Meeting_Type.featOkTst && ((Meeting_Type)jcasType).casFeat_room == null)
+ if (Meeting_Type.featOkTst && ((Meeting_Type) jcasType).casFeat_room == null)
JCas.throwFeatMissing("room", "org.apache.uima.tutorial.Meeting");
- return (RoomNumber)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr, ((Meeting_Type)jcasType).casFeatCode_room)));}
-
- /** setter for room - sets
- * @generated */
+ return (RoomNumber) (jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr,
+ ((Meeting_Type) jcasType).casFeatCode_room)));
+ }
+
+ /**
+ * setter for room - sets
+ *
+ * @generated
+ */
public void setRoom(RoomNumber v) {
- if (Meeting_Type.featOkTst && ((Meeting_Type)jcasType).casFeat_room == null)
+ if (Meeting_Type.featOkTst && ((Meeting_Type) jcasType).casFeat_room == null)
JCas.throwFeatMissing("room", "org.apache.uima.tutorial.Meeting");
- jcasType.ll_cas.ll_setRefValue(addr, ((Meeting_Type)jcasType).casFeatCode_room, jcasType.ll_cas.ll_getFSRef(v));}
-
-
- //*--------------*
- //* Feature: date
+ jcasType.ll_cas.ll_setRefValue(addr, ((Meeting_Type) jcasType).casFeatCode_room,
+ jcasType.ll_cas.ll_getFSRef(v));
+ }
- /** getter for date - gets
- * @generated */
+ // *--------------*
+ // * Feature: date
+
+ /**
+ * getter for date - gets
+ *
+ * @generated
+ */
public DateAnnot getDate() {
- if (Meeting_Type.featOkTst && ((Meeting_Type)jcasType).casFeat_date == null)
+ if (Meeting_Type.featOkTst && ((Meeting_Type) jcasType).casFeat_date == null)
JCas.throwFeatMissing("date", "org.apache.uima.tutorial.Meeting");
- return (DateAnnot)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr, ((Meeting_Type)jcasType).casFeatCode_date)));}
-
- /** setter for date - sets
- * @generated */
+ return (DateAnnot) (jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr,
+ ((Meeting_Type) jcasType).casFeatCode_date)));
+ }
+
+ /**
+ * setter for date - sets
+ *
+ * @generated
+ */
public void setDate(DateAnnot v) {
- if (Meeting_Type.featOkTst && ((Meeting_Type)jcasType).casFeat_date == null)
+ if (Meeting_Type.featOkTst && ((Meeting_Type) jcasType).casFeat_date == null)
JCas.throwFeatMissing("date", "org.apache.uima.tutorial.Meeting");
- jcasType.ll_cas.ll_setRefValue(addr, ((Meeting_Type)jcasType).casFeatCode_date, jcasType.ll_cas.ll_getFSRef(v));}
-
-
- //*--------------*
- //* Feature: startTime
+ jcasType.ll_cas.ll_setRefValue(addr, ((Meeting_Type) jcasType).casFeatCode_date,
+ jcasType.ll_cas.ll_getFSRef(v));
+ }
- /** getter for startTime - gets
- * @generated */
+ // *--------------*
+ // * Feature: startTime
+
+ /**
+ * getter for startTime - gets
+ *
+ * @generated
+ */
public TimeAnnot getStartTime() {
- if (Meeting_Type.featOkTst && ((Meeting_Type)jcasType).casFeat_startTime == null)
+ if (Meeting_Type.featOkTst && ((Meeting_Type) jcasType).casFeat_startTime == null)
JCas.throwFeatMissing("startTime", "org.apache.uima.tutorial.Meeting");
- return (TimeAnnot)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr, ((Meeting_Type)jcasType).casFeatCode_startTime)));}
-
- /** setter for startTime - sets
- * @generated */
+ return (TimeAnnot) (jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr,
+ ((Meeting_Type) jcasType).casFeatCode_startTime)));
+ }
+
+ /**
+ * setter for startTime - sets
+ *
+ * @generated
+ */
public void setStartTime(TimeAnnot v) {
- if (Meeting_Type.featOkTst && ((Meeting_Type)jcasType).casFeat_startTime == null)
+ if (Meeting_Type.featOkTst && ((Meeting_Type) jcasType).casFeat_startTime == null)
JCas.throwFeatMissing("startTime", "org.apache.uima.tutorial.Meeting");
- jcasType.ll_cas.ll_setRefValue(addr, ((Meeting_Type)jcasType).casFeatCode_startTime, jcasType.ll_cas.ll_getFSRef(v));}
-
-
- //*--------------*
- //* Feature: endTime
+ jcasType.ll_cas.ll_setRefValue(addr, ((Meeting_Type) jcasType).casFeatCode_startTime,
+ jcasType.ll_cas.ll_getFSRef(v));
+ }
+
+ // *--------------*
+ // * Feature: endTime
- /** getter for endTime - gets
- * @generated */
+ /**
+ * getter for endTime - gets
+ *
+ * @generated
+ */
public TimeAnnot getEndTime() {
- if (Meeting_Type.featOkTst && ((Meeting_Type)jcasType).casFeat_endTime == null)
+ if (Meeting_Type.featOkTst && ((Meeting_Type) jcasType).casFeat_endTime == null)
JCas.throwFeatMissing("endTime", "org.apache.uima.tutorial.Meeting");
- return (TimeAnnot)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr, ((Meeting_Type)jcasType).casFeatCode_endTime)));}
-
- /** setter for endTime - sets
- * @generated */
+ return (TimeAnnot) (jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr,
+ ((Meeting_Type) jcasType).casFeatCode_endTime)));
+ }
+
+ /**
+ * setter for endTime - sets
+ *
+ * @generated
+ */
public void setEndTime(TimeAnnot v) {
- if (Meeting_Type.featOkTst && ((Meeting_Type)jcasType).casFeat_endTime == null)
+ if (Meeting_Type.featOkTst && ((Meeting_Type) jcasType).casFeat_endTime == null)
JCas.throwFeatMissing("endTime", "org.apache.uima.tutorial.Meeting");
- jcasType.ll_cas.ll_setRefValue(addr, ((Meeting_Type)jcasType).casFeatCode_endTime, jcasType.ll_cas.ll_getFSRef(v));}
+ jcasType.ll_cas.ll_setRefValue(addr, ((Meeting_Type) jcasType).casFeatCode_endTime,
+ jcasType.ll_cas.ll_getFSRef(v));
+ }
+ /** Custom constructor taking all parameters */
+ public Meeting(JCas jcas, int start, int end, RoomNumber room, DateAnnot date,
+ TimeAnnot startTime, TimeAnnot endTime) {
+ super(jcas, start, end);
+ setRoom(room);
+ setDate(date);
+ setStartTime(startTime);
+ setEndTime(endTime);
+ }
- /** Custom constructor taking all parameters */
- public Meeting(JCas jcas, int start, int end, RoomNumber room,
- DateAnnot date, TimeAnnot startTime, TimeAnnot endTime)
- { super(jcas, start, end);
- setRoom(room);
- setDate(date);
- setStartTime(startTime);
- setEndTime(endTime);
- }
- public String toString()
- { return "Meeting in " + getRoom().getCoveredText() +
- " on " + getDate().getCoveredText() + ", " + getStartTime().getCoveredText() + " - " +
- getEndTime().getCoveredText();
- }
-
-}
+ public String toString() {
+ return "Meeting in " + getRoom().getCoveredText() + " on " + getDate().getCoveredText() + ", "
+ + getStartTime().getCoveredText() + " - " + getEndTime().getCoveredText();
+ }
-
+}
Modified: incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/tutorial/Meeting_Type.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/tutorial/Meeting_Type.java?view=diff&rev=480240&r1=480239&r2=480240
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/tutorial/Meeting_Type.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/tutorial/Meeting_Type.java Tue Nov 28 14:20:52 2006
@@ -29,132 +29,151 @@
import org.apache.uima.cas.Feature;
import org.apache.uima.jcas.tcas.Annotation_Type;
-/**
+/**
* Updated by JCasGen Mon Nov 29 15:02:38 EST 2004
- * @generated */
+ *
+ * @generated
+ */
public class Meeting_Type extends Annotation_Type {
/** @generated */
- protected FSGenerator getFSGenerator() {return fsGenerator;}
+ protected FSGenerator getFSGenerator() {
+ return fsGenerator;
+ }
+
/** @generated */
- private final FSGenerator fsGenerator =
- new FSGenerator() {
- public FeatureStructure createFS(int addr, CASImpl cas) {
- if (instanceOf_Type.useExistingInstance) {
- // Return eq fs instance if already created
- FeatureStructure fs = instanceOf_Type.jcas.getJfsFromCaddr(addr);
- if (null == fs) {
- fs = new Meeting(addr, instanceOf_Type);
- instanceOf_Type.jcas.putJfsFromCaddr(addr, fs);
- return fs;
- }
- return fs;
- } else return new Meeting(addr, instanceOf_Type);
- }
- };
+ private final FSGenerator fsGenerator = new FSGenerator() {
+ public FeatureStructure createFS(int addr, CASImpl cas) {
+ if (instanceOf_Type.useExistingInstance) {
+ // Return eq fs instance if already created
+ FeatureStructure fs = instanceOf_Type.jcas.getJfsFromCaddr(addr);
+ if (null == fs) {
+ fs = new Meeting(addr, instanceOf_Type);
+ instanceOf_Type.jcas.putJfsFromCaddr(addr, fs);
+ return fs;
+ }
+ return fs;
+ } else
+ return new Meeting(addr, instanceOf_Type);
+ }
+ };
+
/** @generated */
public final static int typeIndexID = Meeting.typeIndexID;
- /** @generated
- @modifiable */
+
+ /**
+ * @generated
+ * @modifiable
+ */
public final static boolean featOkTst = JCas.getFeatOkTst("org.apache.uima.tutorial.Meeting");
-
+
/** @generated */
final Feature casFeat_room;
+
+ /** @generated */
+ final int casFeatCode_room;
+
/** @generated */
- final int casFeatCode_room;
- /** @generated */
public int getRoom(int addr) {
- if (featOkTst && casFeat_room == null)
+ if (featOkTst && casFeat_room == null)
JCas.throwFeatMissing("room", "org.apache.uima.tutorial.Meeting");
return ll_cas.ll_getRefValue(addr, casFeatCode_room);
}
- /** @generated */
+
+ /** @generated */
public void setRoom(int addr, int v) {
- if (featOkTst && casFeat_room == null)
+ if (featOkTst && casFeat_room == null)
JCas.throwFeatMissing("room", "org.apache.uima.tutorial.Meeting");
- ll_cas.ll_setRefValue(addr, casFeatCode_room, v);}
-
-
-
+ ll_cas.ll_setRefValue(addr, casFeatCode_room, v);
+ }
+
/** @generated */
final Feature casFeat_date;
+
+ /** @generated */
+ final int casFeatCode_date;
+
/** @generated */
- final int casFeatCode_date;
- /** @generated */
public int getDate(int addr) {
- if (featOkTst && casFeat_date == null)
+ if (featOkTst && casFeat_date == null)
JCas.throwFeatMissing("date", "org.apache.uima.tutorial.Meeting");
return ll_cas.ll_getRefValue(addr, casFeatCode_date);
}
- /** @generated */
+
+ /** @generated */
public void setDate(int addr, int v) {
- if (featOkTst && casFeat_date == null)
+ if (featOkTst && casFeat_date == null)
JCas.throwFeatMissing("date", "org.apache.uima.tutorial.Meeting");
- ll_cas.ll_setRefValue(addr, casFeatCode_date, v);}
-
-
-
+ ll_cas.ll_setRefValue(addr, casFeatCode_date, v);
+ }
+
/** @generated */
final Feature casFeat_startTime;
+
+ /** @generated */
+ final int casFeatCode_startTime;
+
/** @generated */
- final int casFeatCode_startTime;
- /** @generated */
public int getStartTime(int addr) {
- if (featOkTst && casFeat_startTime == null)
+ if (featOkTst && casFeat_startTime == null)
JCas.throwFeatMissing("startTime", "org.apache.uima.tutorial.Meeting");
return ll_cas.ll_getRefValue(addr, casFeatCode_startTime);
}
- /** @generated */
+
+ /** @generated */
public void setStartTime(int addr, int v) {
- if (featOkTst && casFeat_startTime == null)
+ if (featOkTst && casFeat_startTime == null)
JCas.throwFeatMissing("startTime", "org.apache.uima.tutorial.Meeting");
- ll_cas.ll_setRefValue(addr, casFeatCode_startTime, v);}
-
-
-
+ ll_cas.ll_setRefValue(addr, casFeatCode_startTime, v);
+ }
+
/** @generated */
final Feature casFeat_endTime;
+
+ /** @generated */
+ final int casFeatCode_endTime;
+
/** @generated */
- final int casFeatCode_endTime;
- /** @generated */
public int getEndTime(int addr) {
- if (featOkTst && casFeat_endTime == null)
+ if (featOkTst && casFeat_endTime == null)
JCas.throwFeatMissing("endTime", "org.apache.uima.tutorial.Meeting");
return ll_cas.ll_getRefValue(addr, casFeatCode_endTime);
}
- /** @generated */
+
+ /** @generated */
public void setEndTime(int addr, int v) {
- if (featOkTst && casFeat_endTime == null)
+ if (featOkTst && casFeat_endTime == null)
JCas.throwFeatMissing("endTime", "org.apache.uima.tutorial.Meeting");
- ll_cas.ll_setRefValue(addr, casFeatCode_endTime, v);}
-
-
-
+ ll_cas.ll_setRefValue(addr, casFeatCode_endTime, v);
+ }
- /** initialize variables to correspond with Cas Type and Features
- * @generated */
+ /**
+ * initialize variables to correspond with Cas Type and Features
+ *
+ * @generated
+ */
public Meeting_Type(JCas jcas, Type casType) {
super(jcas, casType);
- casImpl.getFSClassRegistry().addGeneratorForType((TypeImpl)this.casType, getFSGenerator());
+ casImpl.getFSClassRegistry().addGeneratorForType((TypeImpl) this.casType, getFSGenerator());
-
- casFeat_room = jcas.getRequiredFeatureDE(casType, "room", "org.apache.uima.tutorial.RoomNumber", featOkTst);
- casFeatCode_room = (null == casFeat_room) ? JCas.INVALID_FEATURE_CODE : ((FeatureImpl)casFeat_room).getCode();
-
-
- casFeat_date = jcas.getRequiredFeatureDE(casType, "date", "org.apache.uima.tutorial.DateAnnot", featOkTst);
- casFeatCode_date = (null == casFeat_date) ? JCas.INVALID_FEATURE_CODE : ((FeatureImpl)casFeat_date).getCode();
-
-
- casFeat_startTime = jcas.getRequiredFeatureDE(casType, "startTime", "org.apache.uima.tutorial.TimeAnnot", featOkTst);
- casFeatCode_startTime = (null == casFeat_startTime) ? JCas.INVALID_FEATURE_CODE : ((FeatureImpl)casFeat_startTime).getCode();
-
-
- casFeat_endTime = jcas.getRequiredFeatureDE(casType, "endTime", "org.apache.uima.tutorial.TimeAnnot", featOkTst);
- casFeatCode_endTime = (null == casFeat_endTime) ? JCas.INVALID_FEATURE_CODE : ((FeatureImpl)casFeat_endTime).getCode();
+ casFeat_room = jcas.getRequiredFeatureDE(casType, "room",
+ "org.apache.uima.tutorial.RoomNumber", featOkTst);
+ casFeatCode_room = (null == casFeat_room) ? JCas.INVALID_FEATURE_CODE
+ : ((FeatureImpl) casFeat_room).getCode();
+
+ casFeat_date = jcas.getRequiredFeatureDE(casType, "date", "org.apache.uima.tutorial.DateAnnot",
+ featOkTst);
+ casFeatCode_date = (null == casFeat_date) ? JCas.INVALID_FEATURE_CODE
+ : ((FeatureImpl) casFeat_date).getCode();
+
+ casFeat_startTime = jcas.getRequiredFeatureDE(casType, "startTime",
+ "org.apache.uima.tutorial.TimeAnnot", featOkTst);
+ casFeatCode_startTime = (null == casFeat_startTime) ? JCas.INVALID_FEATURE_CODE
+ : ((FeatureImpl) casFeat_startTime).getCode();
+
+ casFeat_endTime = jcas.getRequiredFeatureDE(casType, "endTime",
+ "org.apache.uima.tutorial.TimeAnnot", featOkTst);
+ casFeatCode_endTime = (null == casFeat_endTime) ? JCas.INVALID_FEATURE_CODE
+ : ((FeatureImpl) casFeat_endTime).getCode();
}
}
-
-
-
-
Modified: incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/tutorial/RoomNumber.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/tutorial/RoomNumber.java?view=diff&rev=480240&r1=480239&r2=480240
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/tutorial/RoomNumber.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/tutorial/RoomNumber.java Tue Nov 28 14:20:52 2006
@@ -19,76 +19,97 @@
package org.apache.uima.tutorial;
-import org.apache.uima.jcas.impl.JCas;
+import org.apache.uima.jcas.impl.JCas;
import org.apache.uima.jcas.cas.TOP_Type;
import org.apache.uima.jcas.tcas.Annotation;
-
-/**
- * Updated by JCasGen Mon Nov 29 15:02:37 EST 2004
- * XML source: C:/Program Files/apache/uima/examples/descriptors/tutorial/ex6/TutorialTypeSystem.xml
- * @generated */
+/**
+ * Updated by JCasGen Mon Nov 29 15:02:37 EST 2004 XML source: C:/Program
+ * Files/apache/uima/examples/descriptors/tutorial/ex6/TutorialTypeSystem.xml
+ *
+ * @generated
+ */
public class RoomNumber extends Annotation {
- /** @generated
- * @ordered
+ /**
+ * @generated
+ * @ordered
*/
public final static int typeIndexID = JCas.getNextIndex();
- /** @generated
- * @ordered
+
+ /**
+ * @generated
+ * @ordered
*/
public final static int type = typeIndexID;
- /** @generated */
- public int getTypeIndexID() {return typeIndexID;}
-
- /** Never called. Disable default constructor
- * @generated */
- protected RoomNumber() {}
-
- /** Internal - constructor used by generator
- * @generated */
+
+ /** @generated */
+ public int getTypeIndexID() {
+ return typeIndexID;
+ }
+
+ /**
+ * Never called. Disable default constructor
+ *
+ * @generated
+ */
+ protected RoomNumber() {
+ }
+
+ /**
+ * Internal - constructor used by generator
+ *
+ * @generated
+ */
public RoomNumber(int addr, TOP_Type type) {
super(addr, type);
readObject();
}
-
+
/** @generated */
public RoomNumber(JCas jcas) {
super(jcas);
- readObject();
- }
-
+ readObject();
+ }
+
public RoomNumber(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() {
+ }
- /** <!-- begin-user-doc -->
- * Write your own initialization here
- * <!-- end-user-doc -->
- @generated modifiable */
- private void readObject() {}
-
-
-
- //*--------------*
- //* Feature: building
+ // *--------------*
+ // * Feature: building
- /** getter for building - gets Building containing this room
- * @generated */
+ /**
+ * getter for building - gets Building containing this room
+ *
+ * @generated
+ */
public String getBuilding() {
- if (RoomNumber_Type.featOkTst && ((RoomNumber_Type)jcasType).casFeat_building == null)
+ if (RoomNumber_Type.featOkTst && ((RoomNumber_Type) jcasType).casFeat_building == null)
JCas.throwFeatMissing("building", "org.apache.uima.tutorial.RoomNumber");
- return jcasType.ll_cas.ll_getStringValue(addr, ((RoomNumber_Type)jcasType).casFeatCode_building);}
-
- /** setter for building - sets Building containing this room
- * @generated */
+ return jcasType.ll_cas.ll_getStringValue(addr,
+ ((RoomNumber_Type) jcasType).casFeatCode_building);
+ }
+
+ /**
+ * setter for building - sets Building containing this room
+ *
+ * @generated
+ */
public void setBuilding(String v) {
- if (RoomNumber_Type.featOkTst && ((RoomNumber_Type)jcasType).casFeat_building == null)
+ if (RoomNumber_Type.featOkTst && ((RoomNumber_Type) jcasType).casFeat_building == null)
JCas.throwFeatMissing("building", "org.apache.uima.tutorial.RoomNumber");
- jcasType.ll_cas.ll_setStringValue(addr, ((RoomNumber_Type)jcasType).casFeatCode_building, v);}
+ jcasType.ll_cas.ll_setStringValue(addr, ((RoomNumber_Type) jcasType).casFeatCode_building, v);
}
-
-
+}
Modified: incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/tutorial/RoomNumber_Type.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/tutorial/RoomNumber_Type.java?view=diff&rev=480240&r1=480239&r2=480240
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/tutorial/RoomNumber_Type.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/tutorial/RoomNumber_Type.java Tue Nov 28 14:20:52 2006
@@ -29,66 +29,75 @@
import org.apache.uima.cas.Feature;
import org.apache.uima.jcas.tcas.Annotation_Type;
-/**
+/**
* Updated by JCasGen Mon Nov 29 15:02:37 EST 2004
- * @generated */
+ *
+ * @generated
+ */
public class RoomNumber_Type extends Annotation_Type {
/** @generated */
- protected FSGenerator getFSGenerator() {return fsGenerator;}
+ protected FSGenerator getFSGenerator() {
+ return fsGenerator;
+ }
+
/** @generated */
- private final FSGenerator fsGenerator =
- new FSGenerator() {
- public FeatureStructure createFS(int addr, CASImpl cas) {
- if (instanceOf_Type.useExistingInstance) {
- // Return eq fs instance if already created
- FeatureStructure fs = instanceOf_Type.jcas.getJfsFromCaddr(addr);
- if (null == fs) {
- fs = new RoomNumber(addr, instanceOf_Type);
- instanceOf_Type.jcas.putJfsFromCaddr(addr, fs);
- return fs;
- }
- return fs;
- } else return new RoomNumber(addr, instanceOf_Type);
- }
- };
+ private final FSGenerator fsGenerator = new FSGenerator() {
+ public FeatureStructure createFS(int addr, CASImpl cas) {
+ if (instanceOf_Type.useExistingInstance) {
+ // Return eq fs instance if already created
+ FeatureStructure fs = instanceOf_Type.jcas.getJfsFromCaddr(addr);
+ if (null == fs) {
+ fs = new RoomNumber(addr, instanceOf_Type);
+ instanceOf_Type.jcas.putJfsFromCaddr(addr, fs);
+ return fs;
+ }
+ return fs;
+ } else
+ return new RoomNumber(addr, instanceOf_Type);
+ }
+ };
+
/** @generated */
public final static int typeIndexID = RoomNumber.typeIndexID;
- /** @generated
- @modifiable */
+
+ /**
+ * @generated
+ * @modifiable
+ */
public final static boolean featOkTst = JCas.getFeatOkTst("org.apache.uima.tutorial.RoomNumber");
-
+
/** @generated */
final Feature casFeat_building;
+
+ /** @generated */
+ final int casFeatCode_building;
+
/** @generated */
- final int casFeatCode_building;
- /** @generated */
public String getBuilding(int addr) {
- if (featOkTst && casFeat_building == null)
+ if (featOkTst && casFeat_building == null)
JCas.throwFeatMissing("building", "org.apache.uima.tutorial.RoomNumber");
return ll_cas.ll_getStringValue(addr, casFeatCode_building);
}
- /** @generated */
+
+ /** @generated */
public void setBuilding(int addr, String v) {
- if (featOkTst && casFeat_building == null)
+ if (featOkTst && casFeat_building == null)
JCas.throwFeatMissing("building", "org.apache.uima.tutorial.RoomNumber");
- ll_cas.ll_setStringValue(addr, casFeatCode_building, v);}
-
-
-
+ ll_cas.ll_setStringValue(addr, casFeatCode_building, v);
+ }
- /** initialize variables to correspond with Cas Type and Features
- * @generated */
+ /**
+ * initialize variables to correspond with Cas Type and Features
+ *
+ * @generated
+ */
public RoomNumber_Type(JCas jcas, Type casType) {
super(jcas, casType);
- casImpl.getFSClassRegistry().addGeneratorForType((TypeImpl)this.casType, getFSGenerator());
+ casImpl.getFSClassRegistry().addGeneratorForType((TypeImpl) this.casType, getFSGenerator());
-
casFeat_building = jcas.getRequiredFeatureDE(casType, "building", "uima.cas.String", featOkTst);
- casFeatCode_building = (null == casFeat_building) ? JCas.INVALID_FEATURE_CODE : ((FeatureImpl)casFeat_building).getCode();
+ casFeatCode_building = (null == casFeat_building) ? JCas.INVALID_FEATURE_CODE
+ : ((FeatureImpl) casFeat_building).getCode();
}
}
-
-
-
-