public static ChameRIA createChameleon(String[] args) throws Exception {
        boolean debug = isDebugModeEnabled(args);
        String core = getCore(args);
        String app = getApp(args);
        String runtime = getRuntime(args);
        String fileinstall = getDeployDirectory(args);
        String config = getProps(args);
        if (config == null  || ! new File(config).exists()) {
            return new ChameRIA(core, debug, app, runtime, fileinstall, null);
        } else {
            return new ChameRIA(core, debug, app, runtime, fileinstall, config);
        }

    }

public static ChameRIA createChameleon ( String [ ] args ) throws Exception { boolean debug = isDebugModeEnabled ( args ) ; String core = getCore ( args ) ; String app = getApp ( args ) ; String runtime = getRuntime ( args ) ; String fileinstall = getDeployDirectory ( args ) ; String config = getProps ( args ) ; if ( config == null || ! new File ( config ) . exists ( ) ) { return new ChameRIA ( core , debug , app , runtime , fileinstall , null ) ; } else { return new ChameRIA ( core , debug , app , runtime , fileinstall , config ) ; } }

Creates the Chameleon instance.The instance is not started.
@param args the command line parameters.
@return the Chameleon instance
@throws Exception if the chameleon instance cannot be created correctly.

Creates the Chameleon instance . The instance is not started .


private static void registerShutdownHook(final ChameRIA chameleon) {
        Runtime runtime = Runtime.getRuntime();
        Runnable hook = new Runnable() {

            public void run() {
                try {
                    if (chameleon != null) {
                        chameleon.stop();
                        printStoppedBanner();
                    }
                } catch (BundleException e) {
                    System.err.println("Cannot stop Chameleon correctly : "
                            + e.getMessage());
                } catch (InterruptedException e) {
                    System.err.println("Unexpected Exception : "
                            + e.getMessage());
                    // nothing to do
                }
            }
        };
        runtime.addShutdownHook(new Thread(hook));

    }

private
static
void
registerShutdownHook
(
final
ChameRIA
chameleon
)
{
Runtime
runtime
=
Runtime
.
getRuntime
(
)
;
Runnable
hook
=
new
Runnable
(
)
{
public
void
run
(
)
{
try
{
if
(
chameleon
!=
)
{
chameleon
.
stop
(
)
;
printStoppedBanner
(
)
;
}
}
catch
(
BundleException
e
)
{
System
.
err
.
println
(
"Cannot stop Chameleon correctly : "
+
e
.
getMessage
(
)
)
;
}
catch
(
InterruptedException
e
)
{
System
.
err
.
println
(
"Unexpected Exception : "
+
e
.
getMessage
(
)
)
;
// nothing to do
}
}
}
;
runtime
.
addShutdownHook
(
new
Thread
(
hook
)
)
;
}

Registers a shutdown hook to stop nicely the embedded framework.
@param chameleon the stopped chameleon

Registers a shutdown hook to stop nicely the embedded framework .


public void trigger() {
        try {
            onTrigger();
            Notification.show(getCaption(), "Successful.", Notification.Type.TRAY_NOTIFICATION);
        } catch (IOException | IllegalArgumentException | IllegalAccessException | IllegalStateException ex) {
            onError(ex);
        }
    }

public void trigger ( ) { try { onTrigger ( ) ; Notification . show ( getCaption ( ) , "Successful." , Notification . Type . TRAY_NOTIFICATION ) ; } catch ( IOException | IllegalArgumentException | IllegalAccessException | IllegalStateException ex ) { onError ( ex ) ; } }


protected void onTrigger()
            throws IOException, IllegalArgumentException, IllegalAccessException, FileNotFoundException, IllegalStateException {
        endpoint.trigger();
        eventBus.post(new TriggerEvent(endpoint));
    }

protected void onTrigger ( ) throws IOException , IllegalArgumentException , IllegalAccessException , FileNotFoundException , IllegalStateException { endpoint . trigger ( ) ; eventBus . post ( new TriggerEvent ( endpoint ) ) ; }

Handler for triggering the action.

@throws IOException Network communication failed.
@throws IllegalArgumentException {@link HttpStatus#SC_BAD_REQUEST}
@throws IllegalAccessException {@link HttpStatus#SC_UNAUTHORIZED} or
{@link HttpStatus#SC_FORBIDDEN}
@throws FileNotFoundException {@link HttpStatus#SC_NOT_FOUND} or
{@link HttpStatus#SC_GONE}
@throws IllegalStateException {@link HttpStatus#SC_CONFLICT}
@throws RuntimeException Other non-success status code.


public void insertAndReplace(final FitRow row) {
        if (results.isEmpty()) {
            return;
        }

        int index = row.getIndex();
        FitTable table = row.getTable();
        table.remove(index);
        addRows(table, index);
	}

public void insertAndReplace ( final FitRow row ) { if ( results . isEmpty ( ) ) { return ; } int index = row . getIndex ( ) ; FitTable table = row . getTable ( ) ; table . remove ( index ) ; addRows ( table , index ) ; }

Replaces a row with one or more results.

@param row the row to replace

Replaces a row with one or more results .


public Counts getCounts() {
		Counts counts = new Counts();
		for (FileCount fileCount : results) {
			counts.tally(fileCount.getCounts());
		}
		return counts;
	}

public Counts getCounts ( ) { Counts counts = new Counts ( ) ; for ( FileCount fileCount : results ) { counts . tally ( fileCount . getCounts ( ) ) ; } return counts ; }

Gets the sum of all results.

@return sum of all saved results


public void setScore(double v) {
    if (Summary_Type.featOkTst && ((Summary_Type)jcasType).casFeat_score == null)
      jcasType.jcas.throwFeatMissing("score", "edu.cmu.lti.oaqa.type.answer.Summary");
    jcasType.ll_cas.ll_setDoubleValue(addr, ((Summary_Type)jcasType).casFeatCode_score, v);}

public void setScore ( double v ) { if ( Summary_Type . featOkTst && ( ( Summary_Type ) jcasType ) . casFeat_score == null ) jcasType . jcas . throwFeatMissing ( "score" , "edu.cmu.lti.oaqa.type.answer.Summary" ) ; jcasType . ll_cas . ll_setDoubleValue ( addr , ( ( Summary_Type ) jcasType ) . casFeatCode_score , v ) ; }

setter for score - sets The score associated with the answer.
@generated
@param v value to set into the feature

setter for score - sets The score associated with the answer .


public StringList getVariants() {
    if (Summary_Type.featOkTst && ((Summary_Type)jcasType).casFeat_variants == null)
      jcasType.jcas.throwFeatMissing("variants", "edu.cmu.lti.oaqa.type.answer.Summary");
    return (StringList)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr, ((Summary_Type)jcasType).casFeatCode_variants)));}

public StringList getVariants ( ) { if ( Summary_Type . featOkTst && ( ( Summary_Type ) jcasType ) . casFeat_variants == null ) jcasType . jcas . throwFeatMissing ( "variants" , "edu.cmu.lti.oaqa.type.answer.Summary" ) ; return ( StringList ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( Summary_Type ) jcasType ) . casFeatCode_variants ) ) ) ; }

getter for variants - gets List of alternative answer summaries.
@generated
@return value of the feature

getter for variants - gets List of alternative answer summaries .


public void setVariants(StringList v) {
    if (Summary_Type.featOkTst && ((Summary_Type)jcasType).casFeat_variants == null)
      jcasType.jcas.throwFeatMissing("variants", "edu.cmu.lti.oaqa.type.answer.Summary");
    jcasType.ll_cas.ll_setRefValue(addr, ((Summary_Type)jcasType).casFeatCode_variants, jcasType.ll_cas.ll_getFSRef(v));}

public void setVariants ( StringList v ) { if ( Summary_Type . featOkTst && ( ( Summary_Type ) jcasType ) . casFeat_variants == null ) jcasType . jcas . throwFeatMissing ( "variants" , "edu.cmu.lti.oaqa.type.answer.Summary" ) ; jcasType . ll_cas . ll_setRefValue ( addr , ( ( Summary_Type ) jcasType ) . casFeatCode_variants , jcasType . ll_cas . ll_getFSRef ( v ) ) ; }

setter for variants - sets List of alternative answer summaries.
@generated
@param v value to set into the feature

setter for variants - sets List of alternative answer summaries .


public String getQuestionType() {
    if (Question_Type.featOkTst && ((Question_Type)jcasType).casFeat_questionType == null)
      jcasType.jcas.throwFeatMissing("questionType", "edu.cmu.lti.oaqa.type.input.Question");
    return jcasType.ll_cas.ll_getStringValue(addr, ((Question_Type)jcasType).casFeatCode_questionType);}

public String getQuestionType ( ) { if ( Question_Type . featOkTst && ( ( Question_Type ) jcasType ) . casFeat_questionType == null ) jcasType . jcas . throwFeatMissing ( "questionType" , "edu.cmu.lti.oaqa.type.input.Question" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( Question_Type ) jcasType ) . casFeatCode_questionType ) ; }

getter for questionType - gets The class of the question, determined by either an automatic question classification process or human judgment.
@generated
@return value of the feature

getter for questionType - gets The class of the question determined by either an automatic question classification process or human judgment .


public void setQuestionType(String v) {
    if (Question_Type.featOkTst && ((Question_Type)jcasType).casFeat_questionType == null)
      jcasType.jcas.throwFeatMissing("questionType", "edu.cmu.lti.oaqa.type.input.Question");
    jcasType.ll_cas.ll_setStringValue(addr, ((Question_Type)jcasType).casFeatCode_questionType, v);}

public void setQuestionType ( String v ) { if ( Question_Type . featOkTst && ( ( Question_Type ) jcasType ) . casFeat_questionType == null ) jcasType . jcas . throwFeatMissing ( "questionType" , "edu.cmu.lti.oaqa.type.input.Question" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( Question_Type ) jcasType ) . casFeatCode_questionType , v ) ; }

setter for questionType - sets The class of the question, determined by either an automatic question classification process or human judgment.
@generated
@param v value to set into the feature

setter for questionType - sets The class of the question determined by either an automatic question classification process or human judgment .


public Token getToken() {
    if (Focus_Type.featOkTst && ((Focus_Type)jcasType).casFeat_token == null)
      jcasType.jcas.throwFeatMissing("token", "edu.cmu.lti.oaqa.type.nlp.Focus");
    return (Token)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr, ((Focus_Type)jcasType).casFeatCode_token)));}

public Token getToken ( ) { if ( Focus_Type . featOkTst && ( ( Focus_Type ) jcasType ) . casFeat_token == null ) jcasType . jcas . throwFeatMissing ( "token" , "edu.cmu.lti.oaqa.type.nlp.Focus" ) ; return ( Token ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( Focus_Type ) jcasType ) . casFeatCode_token ) ) ) ; }

getter for token - gets The corresponding token for the focus.
@generated
@return value of the feature

getter for token - gets The corresponding token for the focus .


public String getDepLabel() {
    if (Token_Type.featOkTst && ((Token_Type)jcasType).casFeat_depLabel == null)
      jcasType.jcas.throwFeatMissing("depLabel", "edu.cmu.lti.oaqa.type.nlp.Token");
    return jcasType.ll_cas.ll_getStringValue(addr, ((Token_Type)jcasType).casFeatCode_depLabel);}

public String getDepLabel ( ) { if ( Token_Type . featOkTst && ( ( Token_Type ) jcasType ) . casFeat_depLabel == null ) jcasType . jcas . throwFeatMissing ( "depLabel" , "edu.cmu.lti.oaqa.type.nlp.Token" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( Token_Type ) jcasType ) . casFeatCode_depLabel ) ; }

getter for depLabel - gets The dependency label of the token with respect to its head.
@generated
@return value of the feature

getter for depLabel - gets The dependency label of the token with respect to its head .


public void setDepLabel(String v) {
    if (Token_Type.featOkTst && ((Token_Type)jcasType).casFeat_depLabel == null)
      jcasType.jcas.throwFeatMissing("depLabel", "edu.cmu.lti.oaqa.type.nlp.Token");
    jcasType.ll_cas.ll_setStringValue(addr, ((Token_Type)jcasType).casFeatCode_depLabel, v);}

public void setDepLabel ( String v ) { if ( Token_Type . featOkTst && ( ( Token_Type ) jcasType ) . casFeat_depLabel == null ) jcasType . jcas . throwFeatMissing ( "depLabel" , "edu.cmu.lti.oaqa.type.nlp.Token" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( Token_Type ) jcasType ) . casFeatCode_depLabel , v ) ; }

setter for depLabel - sets The dependency label of the token with respect to its head.
@generated
@param v value to set into the feature

setter for depLabel - sets The dependency label of the token with respect to its head .


public String getSemanticType() {
    if (Token_Type.featOkTst && ((Token_Type)jcasType).casFeat_semanticType == null)
      jcasType.jcas.throwFeatMissing("semanticType", "edu.cmu.lti.oaqa.type.nlp.Token");
    return jcasType.ll_cas.ll_getStringValue(addr, ((Token_Type)jcasType).casFeatCode_semanticType);}

public String getSemanticType ( ) { if ( Token_Type . featOkTst && ( ( Token_Type ) jcasType ) . casFeat_semanticType == null ) jcasType . jcas . throwFeatMissing ( "semanticType" , "edu.cmu.lti.oaqa.type.nlp.Token" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( Token_Type ) jcasType ) . casFeatCode_semanticType ) ; }

getter for semanticType - gets A semantic type, typically the name of an Entity Annotation type.
@generated
@return value of the feature

getter for semanticType - gets A semantic type typically the name of an Entity Annotation type .


public void setSemanticType(String v) {
    if (Token_Type.featOkTst && ((Token_Type)jcasType).casFeat_semanticType == null)
      jcasType.jcas.throwFeatMissing("semanticType", "edu.cmu.lti.oaqa.type.nlp.Token");
    jcasType.ll_cas.ll_setStringValue(addr, ((Token_Type)jcasType).casFeatCode_semanticType, v);}

public void setSemanticType ( String v ) { if ( Token_Type . featOkTst && ( ( Token_Type ) jcasType ) . casFeat_semanticType == null ) jcasType . jcas . throwFeatMissing ( "semanticType" , "edu.cmu.lti.oaqa.type.nlp.Token" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( Token_Type ) jcasType ) . casFeatCode_semanticType , v ) ; }

setter for semanticType - sets A semantic type, typically the name of an Entity Annotation type.
@generated
@param v value to set into the feature

setter for semanticType - sets A semantic type typically the name of an Entity Annotation type .


public StringArray getSections() {
    if (Document_Type.featOkTst && ((Document_Type)jcasType).casFeat_sections == null)
      jcasType.jcas.throwFeatMissing("sections", "edu.cmu.lti.oaqa.type.retrieval.Document");
    return (StringArray)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr, ((Document_Type)jcasType).casFeatCode_sections)));}

getter for sections - gets Content of sections in the document.
@generated
@return value of the feature

getter for sections - gets Content of sections in the document .


public void setSections(StringArray v) {
    if (Document_Type.featOkTst && ((Document_Type)jcasType).casFeat_sections == null)
      jcasType.jcas.throwFeatMissing("sections", "edu.cmu.lti.oaqa.type.retrieval.Document");
    jcasType.ll_cas.ll_setRefValue(addr, ((Document_Type)jcasType).casFeatCode_sections, jcasType.ll_cas.ll_getFSRef(v));}

setter for sections - sets Content of sections in the document.
@generated
@param v value to set into the feature

setter for sections - sets Content of sections in the document .


public String getSections(int i) {
    if (Document_Type.featOkTst && ((Document_Type)jcasType).casFeat_sections == null)
      jcasType.jcas.throwFeatMissing("sections", "edu.cmu.lti.oaqa.type.retrieval.Document");
    jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(addr, ((Document_Type)jcasType).casFeatCode_sections), i);
    return jcasType.ll_cas.ll_getStringArrayValue(jcasType.ll_cas.ll_getRefValue(addr, ((Document_Type)jcasType).casFeatCode_sections), i);}

indexed getter for sections - gets an indexed value - Content of sections in the document.
@generated
@param i index in the array to get
@return value of the element at index i

indexed getter for sections - gets an indexed value - Content of sections in the document .


public void setSections(int i, String v) {
    if (Document_Type.featOkTst && ((Document_Type)jcasType).casFeat_sections == null)
      jcasType.jcas.throwFeatMissing("sections", "edu.cmu.lti.oaqa.type.retrieval.Document");
    jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(addr, ((Document_Type)jcasType).casFeatCode_sections), i);
    jcasType.ll_cas.ll_setStringArrayValue(jcasType.ll_cas.ll_getRefValue(addr, ((Document_Type)jcasType).casFeatCode_sections), i, v);}

indexed setter for sections - sets an indexed value - Content of sections in the document.
@generated
@param i index in the array to set
@param v value to set into the array

indexed setter for sections - sets an indexed value - Content of sections in the document .


public StringList getUris() {
    if (Concept_Type.featOkTst && ((Concept_Type)jcasType).casFeat_uris == null)
      jcasType.jcas.throwFeatMissing("uris", "edu.cmu.lti.oaqa.type.kb.Concept");
    return (StringList)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr, ((Concept_Type)jcasType).casFeatCode_uris)));}

public StringList getUris ( ) { if ( Concept_Type . featOkTst && ( ( Concept_Type ) jcasType ) . casFeat_uris == null ) jcasType . jcas . throwFeatMissing ( "uris" , "edu.cmu.lti.oaqa.type.kb.Concept" ) ; return ( StringList ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( Concept_Type ) jcasType ) . casFeatCode_uris ) ) ) ; }

getter for uris - gets Array of uris that identify this named entity. There may be more than one uri if this named entity is ambiguous.
@generated
@return value of the feature

getter for uris - gets Array of uris that identify this named entity . There may be more than one uri if this named entity is ambiguous .


public void setUris(StringList v) {
    if (Concept_Type.featOkTst && ((Concept_Type)jcasType).casFeat_uris == null)
      jcasType.jcas.throwFeatMissing("uris", "edu.cmu.lti.oaqa.type.kb.Concept");
    jcasType.ll_cas.ll_setRefValue(addr, ((Concept_Type)jcasType).casFeatCode_uris, jcasType.ll_cas.ll_getFSRef(v));}

public void setUris ( StringList v ) { if ( Concept_Type . featOkTst && ( ( Concept_Type ) jcasType ) . casFeat_uris == null ) jcasType . jcas . throwFeatMissing ( "uris" , "edu.cmu.lti.oaqa.type.kb.Concept" ) ; jcasType . ll_cas . ll_setRefValue ( addr , ( ( Concept_Type ) jcasType ) . casFeatCode_uris , jcasType . ll_cas . ll_getFSRef ( v ) ) ; }

setter for uris - sets Array of uris that identify this named entity. There may be more than one uri if this named entity is ambiguous.
@generated
@param v value to set into the feature

setter for uris - sets Array of uris that identify this named entity . There may be more than one uri if this named entity is ambiguous .


public FSList getTypes() {
    if (Concept_Type.featOkTst && ((Concept_Type)jcasType).casFeat_types == null)
      jcasType.jcas.throwFeatMissing("types", "edu.cmu.lti.oaqa.type.kb.Concept");
    return (FSList)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr, ((Concept_Type)jcasType).casFeatCode_types)));}

public FSList getTypes ( ) { if ( Concept_Type . featOkTst && ( ( Concept_Type ) jcasType ) . casFeat_types == null ) jcasType . jcas . throwFeatMissing ( "types" , "edu.cmu.lti.oaqa.type.kb.Concept" ) ; return ( FSList ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( Concept_Type ) jcasType ) . casFeatCode_types ) ) ) ; }

getter for types - gets A list of concept types that the concept belongs to.
@generated
@return value of the feature

getter for types - gets A list of concept types that the concept belongs to .


public void setTypes(FSList v) {
    if (Concept_Type.featOkTst && ((Concept_Type)jcasType).casFeat_types == null)
      jcasType.jcas.throwFeatMissing("types", "edu.cmu.lti.oaqa.type.kb.Concept");
    jcasType.ll_cas.ll_setRefValue(addr, ((Concept_Type)jcasType).casFeatCode_types, jcasType.ll_cas.ll_getFSRef(v));}

public void setTypes ( FSList v ) { if ( Concept_Type . featOkTst && ( ( Concept_Type ) jcasType ) . casFeat_types == null ) jcasType . jcas . throwFeatMissing ( "types" , "edu.cmu.lti.oaqa.type.kb.Concept" ) ; jcasType . ll_cas . ll_setRefValue ( addr , ( ( Concept_Type ) jcasType ) . casFeatCode_types , jcasType . ll_cas . ll_getFSRef ( v ) ) ; }

setter for types - sets A list of concept types that the concept belongs to.
@generated
@param v value to set into the feature

setter for types - sets A list of concept types that the concept belongs to .


public Annotation getTargetType() {
    if (AnswerType_Type.featOkTst && ((AnswerType_Type)jcasType).casFeat_targetType == null)
      jcasType.jcas.throwFeatMissing("targetType", "edu.cmu.lti.oaqa.type.answer.AnswerType");
    return (Annotation)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr, ((AnswerType_Type)jcasType).casFeatCode_targetType)));}

getter for targetType - gets The actual target type annotation.
@generated
@return value of the feature

getter for targetType - gets The actual target type annotation .


public void setTargetType(Annotation v) {
    if (AnswerType_Type.featOkTst && ((AnswerType_Type)jcasType).casFeat_targetType == null)
      jcasType.jcas.throwFeatMissing("targetType", "edu.cmu.lti.oaqa.type.answer.AnswerType");
    jcasType.ll_cas.ll_setRefValue(addr, ((AnswerType_Type)jcasType).casFeatCode_targetType, jcasType.ll_cas.ll_getFSRef(v));}

setter for targetType - sets The actual target type annotation.
@generated
@param v value to set into the feature

setter for targetType - sets The actual target type annotation .


public int getRank() {
    if (SearchResult_Type.featOkTst && ((SearchResult_Type)jcasType).casFeat_rank == null)
      jcasType.jcas.throwFeatMissing("rank", "edu.cmu.lti.oaqa.type.retrieval.SearchResult");
    return jcasType.ll_cas.ll_getIntValue(addr, ((SearchResult_Type)jcasType).casFeatCode_rank);}

getter for rank - gets Rank of this result in the original hit-list.
@generated
@return value of the feature

getter for rank - gets Rank of this result in the original hit - list .


public void setRank(int v) {
    if (SearchResult_Type.featOkTst && ((SearchResult_Type)jcasType).casFeat_rank == null)
      jcasType.jcas.throwFeatMissing("rank", "edu.cmu.lti.oaqa.type.retrieval.SearchResult");
    jcasType.ll_cas.ll_setIntValue(addr, ((SearchResult_Type)jcasType).casFeatCode_rank, v);}

setter for rank - sets Rank of this result in the original hit-list.
@generated
@param v value to set into the feature

setter for rank - sets Rank of this result in the original hit - list .


public String getQueryString() {
    if (SearchResult_Type.featOkTst && ((SearchResult_Type)jcasType).casFeat_queryString == null)
      jcasType.jcas.throwFeatMissing("queryString", "edu.cmu.lti.oaqa.type.retrieval.SearchResult");
    return jcasType.ll_cas.ll_getStringValue(addr, ((SearchResult_Type)jcasType).casFeatCode_queryString);}

getter for queryString - gets The query string associated with the hit.
@generated
@return value of the feature

getter for queryString - gets The query string associated with the hit .


public void setQueryString(String v) {
    if (SearchResult_Type.featOkTst && ((SearchResult_Type)jcasType).casFeat_queryString == null)
      jcasType.jcas.throwFeatMissing("queryString", "edu.cmu.lti.oaqa.type.retrieval.SearchResult");
    jcasType.ll_cas.ll_setStringValue(addr, ((SearchResult_Type)jcasType).casFeatCode_queryString, v);}

setter for queryString - sets The query string associated with the hit.
@generated
@param v value to set into the feature

setter for queryString - sets The query string associated with the hit .


public FSArray getCandidateAnswers() {
    if (SearchResult_Type.featOkTst && ((SearchResult_Type)jcasType).casFeat_candidateAnswers == null)
      jcasType.jcas.throwFeatMissing("candidateAnswers", "edu.cmu.lti.oaqa.type.retrieval.SearchResult");
    return (FSArray)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr, ((SearchResult_Type)jcasType).casFeatCode_candidateAnswers)));}

getter for candidateAnswers - gets CandidateAnswerVariants generated from this SearchResult.
@generated
@return value of the feature

getter for candidateAnswers - gets CandidateAnswerVariants generated from this SearchResult .


public void setCandidateAnswers(FSArray v) {
    if (SearchResult_Type.featOkTst && ((SearchResult_Type)jcasType).casFeat_candidateAnswers == null)
      jcasType.jcas.throwFeatMissing("candidateAnswers", "edu.cmu.lti.oaqa.type.retrieval.SearchResult");
    jcasType.ll_cas.ll_setRefValue(addr, ((SearchResult_Type)jcasType).casFeatCode_candidateAnswers, jcasType.ll_cas.ll_getFSRef(v));}

setter for candidateAnswers - sets CandidateAnswerVariants generated from this SearchResult.
@generated
@param v value to set into the feature

setter for candidateAnswers - sets CandidateAnswerVariants generated from this SearchResult .


public CandidateAnswerVariant getCandidateAnswers(int i) {
    if (SearchResult_Type.featOkTst && ((SearchResult_Type)jcasType).casFeat_candidateAnswers == null)
      jcasType.jcas.throwFeatMissing("candidateAnswers", "edu.cmu.lti.oaqa.type.retrieval.SearchResult");
    jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(addr, ((SearchResult_Type)jcasType).casFeatCode_candidateAnswers), i);
    return (CandidateAnswerVariant)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefArrayValue(jcasType.ll_cas.ll_getRefValue(addr, ((SearchResult_Type)jcasType).casFeatCode_candidateAnswers), i)));}

indexed getter for candidateAnswers - gets an indexed value - CandidateAnswerVariants generated from this SearchResult.
@generated
@param i index in the array to get
@return value of the element at index i

indexed getter for candidateAnswers - gets an indexed value - CandidateAnswerVariants generated from this SearchResult .


public void setCandidateAnswers(int i, CandidateAnswerVariant v) {
    if (SearchResult_Type.featOkTst && ((SearchResult_Type)jcasType).casFeat_candidateAnswers == null)
      jcasType.jcas.throwFeatMissing("candidateAnswers", "edu.cmu.lti.oaqa.type.retrieval.SearchResult");
    jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(addr, ((SearchResult_Type)jcasType).casFeatCode_candidateAnswers), i);
    jcasType.ll_cas.ll_setRefArrayValue(jcasType.ll_cas.ll_getRefValue(addr, ((SearchResult_Type)jcasType).casFeatCode_candidateAnswers), i, jcasType.ll_cas.ll_getFSRef(v));}

indexed setter for candidateAnswers - sets an indexed value - CandidateAnswerVariants generated from this SearchResult.
@generated
@param i index in the array to set
@param v value to set into the array

indexed setter for candidateAnswers - sets an indexed value - CandidateAnswerVariants generated from this SearchResult .


public String getQuery() {
    if (Search_Type.featOkTst && ((Search_Type)jcasType).casFeat_query == null)
      jcasType.jcas.throwFeatMissing("query", "edu.cmu.lti.oaqa.type.retrieval.Search");
    return jcasType.ll_cas.ll_getStringValue(addr, ((Search_Type)jcasType).casFeatCode_query);}

getter for query - gets The query in the native syntax of the corresponding search engine.
@generated
@return value of the feature

getter for query - gets The query in the native syntax of the corresponding search engine .


public void setQuery(String v) {
    if (Search_Type.featOkTst && ((Search_Type)jcasType).casFeat_query == null)
      jcasType.jcas.throwFeatMissing("query", "edu.cmu.lti.oaqa.type.retrieval.Search");
    jcasType.ll_cas.ll_setStringValue(addr, ((Search_Type)jcasType).casFeatCode_query, v);}

setter for query - sets The query in the native syntax of the corresponding search engine.
@generated
@param v value to set into the feature

setter for query - sets The query in the native syntax of the corresponding search engine .


public FSArray getHitList() {
    if (Search_Type.featOkTst && ((Search_Type)jcasType).casFeat_hitList == null)
      jcasType.jcas.throwFeatMissing("hitList", "edu.cmu.lti.oaqa.type.retrieval.Search");
    return (FSArray)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr, ((Search_Type)jcasType).casFeatCode_hitList)));}

getter for hitList - gets Hit list of search results, sorted in descreasing order of relevance score.
@generated
@return value of the feature

getter for hitList - gets Hit list of search results sorted in descreasing order of relevance score .


public void setHitList(FSArray v) {
    if (Search_Type.featOkTst && ((Search_Type)jcasType).casFeat_hitList == null)
      jcasType.jcas.throwFeatMissing("hitList", "edu.cmu.lti.oaqa.type.retrieval.Search");
    jcasType.ll_cas.ll_setRefValue(addr, ((Search_Type)jcasType).casFeatCode_hitList, jcasType.ll_cas.ll_getFSRef(v));}

setter for hitList - sets Hit list of search results, sorted in descreasing order of relevance score.
@generated
@param v value to set into the feature

setter for hitList - sets Hit list of search results sorted in descreasing order of relevance score .


public SearchResult getHitList(int i) {
    if (Search_Type.featOkTst && ((Search_Type)jcasType).casFeat_hitList == null)
      jcasType.jcas.throwFeatMissing("hitList", "edu.cmu.lti.oaqa.type.retrieval.Search");
    jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(addr, ((Search_Type)jcasType).casFeatCode_hitList), i);
    return (SearchResult)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefArrayValue(jcasType.ll_cas.ll_getRefValue(addr, ((Search_Type)jcasType).casFeatCode_hitList), i)));}

indexed getter for hitList - gets an indexed value - Hit list of search results, sorted in descreasing order of relevance score.
@generated
@param i index in the array to get
@return value of the element at index i

indexed getter for hitList - gets an indexed value - Hit list of search results sorted in descreasing order of relevance score .


public void setHitList(int i, SearchResult v) {
    if (Search_Type.featOkTst && ((Search_Type)jcasType).casFeat_hitList == null)
      jcasType.jcas.throwFeatMissing("hitList", "edu.cmu.lti.oaqa.type.retrieval.Search");
    jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(addr, ((Search_Type)jcasType).casFeatCode_hitList), i);
    jcasType.ll_cas.ll_setRefArrayValue(jcasType.ll_cas.ll_getRefValue(addr, ((Search_Type)jcasType).casFeatCode_hitList), i, jcasType.ll_cas.ll_getFSRef(v));}

indexed setter for hitList - sets an indexed value - Hit list of search results, sorted in descreasing order of relevance score.
@generated
@param i index in the array to set
@param v value to set into the array

indexed setter for hitList - sets an indexed value - Hit list of search results sorted in descreasing order of relevance score .


public AbstractQuery getAbstractQuery() {
    if (Search_Type.featOkTst && ((Search_Type)jcasType).casFeat_abstractQuery == null)
      jcasType.jcas.throwFeatMissing("abstractQuery", "edu.cmu.lti.oaqa.type.retrieval.Search");
    return (AbstractQuery)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr, ((Search_Type)jcasType).casFeatCode_abstractQuery)));}

getter for abstractQuery - gets The abstract query from which this actual query was generated.
@generated
@return value of the feature

getter for abstractQuery - gets The abstract query from which this actual query was generated .


public void setAbstractQuery(AbstractQuery v) {
    if (Search_Type.featOkTst && ((Search_Type)jcasType).casFeat_abstractQuery == null)
      jcasType.jcas.throwFeatMissing("abstractQuery", "edu.cmu.lti.oaqa.type.retrieval.Search");
    jcasType.ll_cas.ll_setRefValue(addr, ((Search_Type)jcasType).casFeatCode_abstractQuery, jcasType.ll_cas.ll_getFSRef(v));}

setter for abstractQuery - sets The abstract query from which this actual query was generated.
@generated
@param v value to set into the feature

setter for abstractQuery - sets The abstract query from which this actual query was generated .


public String getSearchId() {
    if (Search_Type.featOkTst && ((Search_Type)jcasType).casFeat_searchId == null)
      jcasType.jcas.throwFeatMissing("searchId", "edu.cmu.lti.oaqa.type.retrieval.Search");
    return jcasType.ll_cas.ll_getStringValue(addr, ((Search_Type)jcasType).casFeatCode_searchId);}

getter for searchId - gets An identifier for this search result. Used to collect hit-list objects that belong to this search result after they've been split out for parallel processing then gathered up again.
@generated
@return value of the feature

getter for searchId - gets An identifier for this search result . Used to collect hit - list objects that belong to this search result after they ve been split out for parallel processing then gathered up again .


public void setSearchId(String v) {
    if (Search_Type.featOkTst && ((Search_Type)jcasType).casFeat_searchId == null)
      jcasType.jcas.throwFeatMissing("searchId", "edu.cmu.lti.oaqa.type.retrieval.Search");
    jcasType.ll_cas.ll_setStringValue(addr, ((Search_Type)jcasType).casFeatCode_searchId, v);}

setter for searchId - sets An identifier for this search result. Used to collect hit-list objects that belong to this search result after they've been split out for parallel processing then gathered up again.
@generated
@param v value to set into the feature

setter for searchId - sets An identifier for this search result . Used to collect hit - list objects that belong to this search result after they ve been split out for parallel processing then gathered up again .


public void setDocId(String v) {
    if (Passage_Type.featOkTst && ((Passage_Type)jcasType).casFeat_docId == null)
      jcasType.jcas.throwFeatMissing("docId", "edu.cmu.lti.oaqa.type.retrieval.Passage");
    jcasType.ll_cas.ll_setStringValue(addr, ((Passage_Type)jcasType).casFeatCode_docId, v);}

setter for docId - sets A unique identifier for the document that conatins this passage.
@generated
@param v value to set into the feature

setter for docId - sets A unique identifier for the document that conatins this passage .


public int getOffsetInBeginSection() {
    if (Passage_Type.featOkTst && ((Passage_Type)jcasType).casFeat_offsetInBeginSection == null)
      jcasType.jcas.throwFeatMissing("offsetInBeginSection", "edu.cmu.lti.oaqa.type.retrieval.Passage");
    return jcasType.ll_cas.ll_getIntValue(addr, ((Passage_Type)jcasType).casFeatCode_offsetInBeginSection);}

getter for offsetInBeginSection - gets Character offset of the start of this passage within the section that contains this passage.
@generated
@return value of the feature

getter for offsetInBeginSection - gets Character offset of the start of this passage within the section that contains this passage .


public void setOffsetInBeginSection(int v) {
    if (Passage_Type.featOkTst && ((Passage_Type)jcasType).casFeat_offsetInBeginSection == null)
      jcasType.jcas.throwFeatMissing("offsetInBeginSection", "edu.cmu.lti.oaqa.type.retrieval.Passage");
    jcasType.ll_cas.ll_setIntValue(addr, ((Passage_Type)jcasType).casFeatCode_offsetInBeginSection, v);}

setter for offsetInBeginSection - sets Character offset of the start of this passage within the section that contains this passage.
@generated
@param v value to set into the feature

setter for offsetInBeginSection - sets Character offset of the start of this passage within the section that contains this passage .


public int getOffsetInEndSection() {
    if (Passage_Type.featOkTst && ((Passage_Type)jcasType).casFeat_offsetInEndSection == null)
      jcasType.jcas.throwFeatMissing("offsetInEndSection", "edu.cmu.lti.oaqa.type.retrieval.Passage");
    return jcasType.ll_cas.ll_getIntValue(addr, ((Passage_Type)jcasType).casFeatCode_offsetInEndSection);}

getter for offsetInEndSection - gets Character offset of the end of this passage within the section that contains this passage.
@generated
@return value of the feature

getter for offsetInEndSection - gets Character offset of the end of this passage within the section that contains this passage .


public void setOffsetInEndSection(int v) {
    if (Passage_Type.featOkTst && ((Passage_Type)jcasType).casFeat_offsetInEndSection == null)
      jcasType.jcas.throwFeatMissing("offsetInEndSection", "edu.cmu.lti.oaqa.type.retrieval.Passage");
    jcasType.ll_cas.ll_setIntValue(addr, ((Passage_Type)jcasType).casFeatCode_offsetInEndSection, v);}

setter for offsetInEndSection - sets Character offset of the end of this passage within the section that contains this passage.
@generated
@param v value to set into the feature

setter for offsetInEndSection - sets Character offset of the end of this passage within the section that contains this passage .


public String getBeginSection() {
    if (Passage_Type.featOkTst && ((Passage_Type)jcasType).casFeat_beginSection == null)
      jcasType.jcas.throwFeatMissing("beginSection", "edu.cmu.lti.oaqa.type.retrieval.Passage");
    return jcasType.ll_cas.ll_getStringValue(addr, ((Passage_Type)jcasType).casFeatCode_beginSection);}

getter for beginSection - gets The start section of this passage within the document that contains this passage.
@generated
@return value of the feature

getter for beginSection - gets The start section of this passage within the document that contains this passage .


public void setBeginSection(String v) {
    if (Passage_Type.featOkTst && ((Passage_Type)jcasType).casFeat_beginSection == null)
      jcasType.jcas.throwFeatMissing("beginSection", "edu.cmu.lti.oaqa.type.retrieval.Passage");
    jcasType.ll_cas.ll_setStringValue(addr, ((Passage_Type)jcasType).casFeatCode_beginSection, v);}

setter for beginSection - sets The start section of this passage within the document that contains this passage.
@generated
@param v value to set into the feature

setter for beginSection - sets The start section of this passage within the document that contains this passage .


public String getEndSection() {
    if (Passage_Type.featOkTst && ((Passage_Type)jcasType).casFeat_endSection == null)
      jcasType.jcas.throwFeatMissing("endSection", "edu.cmu.lti.oaqa.type.retrieval.Passage");
    return jcasType.ll_cas.ll_getStringValue(addr, ((Passage_Type)jcasType).casFeatCode_endSection);}

getter for endSection - gets The end section of this passage within the document that contains this passage.
@generated
@return value of the feature

getter for endSection - gets The end section of this passage within the document that contains this passage .


public void setEndSection(String v) {
    if (Passage_Type.featOkTst && ((Passage_Type)jcasType).casFeat_endSection == null)
      jcasType.jcas.throwFeatMissing("endSection", "edu.cmu.lti.oaqa.type.retrieval.Passage");
    jcasType.ll_cas.ll_setStringValue(addr, ((Passage_Type)jcasType).casFeatCode_endSection, v);}

setter for endSection - sets The end section of this passage within the document that contains this passage.
@generated
@param v value to set into the feature

setter for endSection - sets The end section of this passage within the document that contains this passage .


public String getAspects() {
    if (Passage_Type.featOkTst && ((Passage_Type)jcasType).casFeat_aspects == null)
      jcasType.jcas.throwFeatMissing("aspects", "edu.cmu.lti.oaqa.type.retrieval.Passage");
    return jcasType.ll_cas.ll_getStringValue(addr, ((Passage_Type)jcasType).casFeatCode_aspects);}

getter for aspects - gets Aspects of the gold standard passage.
@generated
@return value of the feature

getter for aspects - gets Aspects of the gold standard passage .


public void setAspects(String v) {
    if (Passage_Type.featOkTst && ((Passage_Type)jcasType).casFeat_aspects == null)
      jcasType.jcas.throwFeatMissing("aspects", "edu.cmu.lti.oaqa.type.retrieval.Passage");
    jcasType.ll_cas.ll_setStringValue(addr, ((Passage_Type)jcasType).casFeatCode_aspects, v);}

setter for aspects - sets Aspects of the gold standard passage.
@generated
@param v value to set into the feature

setter for aspects - sets Aspects of the gold standard passage .


public Triple getTriple() {
    if (TripleSearchResult_Type.featOkTst && ((TripleSearchResult_Type)jcasType).casFeat_triple == null)
      jcasType.jcas.throwFeatMissing("triple", "edu.cmu.lti.oaqa.type.retrieval.TripleSearchResult");
    return (Triple)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr, ((TripleSearchResult_Type)jcasType).casFeatCode_triple)));}

getter for triple - gets The relevant triple searched in the RDF store.
@generated
@return value of the feature

getter for triple - gets The relevant triple searched in the RDF store .


public void setTriple(Triple v) {
    if (TripleSearchResult_Type.featOkTst && ((TripleSearchResult_Type)jcasType).casFeat_triple == null)
      jcasType.jcas.throwFeatMissing("triple", "edu.cmu.lti.oaqa.type.retrieval.TripleSearchResult");
    jcasType.ll_cas.ll_setRefValue(addr, ((TripleSearchResult_Type)jcasType).casFeatCode_triple, jcasType.ll_cas.ll_getFSRef(v));}

setter for triple - sets The relevant triple searched in the RDF store.
@generated
@param v value to set into the feature

setter for triple - sets The relevant triple searched in the RDF store .


public Triple getSourceRelation() {
    if (PassageFromRelation_Type.featOkTst && ((PassageFromRelation_Type)jcasType).casFeat_sourceRelation == null)
      jcasType.jcas.throwFeatMissing("sourceRelation", "edu.cmu.lti.oaqa.type.retrieval.PassageFromRelation");
    return (Triple)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr, ((PassageFromRelation_Type)jcasType).casFeatCode_sourceRelation)));}

getter for sourceRelation - gets The triple from which the search result was generated
@generated
@return value of the feature


public void setSourceRelation(Triple v) {
    if (PassageFromRelation_Type.featOkTst && ((PassageFromRelation_Type)jcasType).casFeat_sourceRelation == null)
      jcasType.jcas.throwFeatMissing("sourceRelation", "edu.cmu.lti.oaqa.type.retrieval.PassageFromRelation");
    jcasType.ll_cas.ll_setRefValue(addr, ((PassageFromRelation_Type)jcasType).casFeatCode_sourceRelation, jcasType.ll_cas.ll_getFSRef(v));}

setter for sourceRelation - sets The triple from which the search result was generated
@generated
@param v value to set into the feature


public String getSubject() {
    if (Triple_Type.featOkTst && ((Triple_Type)jcasType).casFeat_subject == null)
      jcasType.jcas.throwFeatMissing("subject", "edu.cmu.lti.oaqa.type.kb.Triple");
    return jcasType.ll_cas.ll_getStringValue(addr, ((Triple_Type)jcasType).casFeatCode_subject);}

public String getSubject ( ) { if ( Triple_Type . featOkTst && ( ( Triple_Type ) jcasType ) . casFeat_subject == null ) jcasType . jcas . throwFeatMissing ( "subject" , "edu.cmu.lti.oaqa.type.kb.Triple" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( Triple_Type ) jcasType ) . casFeatCode_subject ) ; }

getter for subject - gets The subject of the triple - always a URI.
@generated
@return value of the feature

getter for subject - gets The subject of the triple - always a URI .


public void setSubject(String v) {
    if (Triple_Type.featOkTst && ((Triple_Type)jcasType).casFeat_subject == null)
      jcasType.jcas.throwFeatMissing("subject", "edu.cmu.lti.oaqa.type.kb.Triple");
    jcasType.ll_cas.ll_setStringValue(addr, ((Triple_Type)jcasType).casFeatCode_subject, v);}

public void setSubject ( String v ) { if ( Triple_Type . featOkTst && ( ( Triple_Type ) jcasType ) . casFeat_subject == null ) jcasType . jcas . throwFeatMissing ( "subject" , "edu.cmu.lti.oaqa.type.kb.Triple" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( Triple_Type ) jcasType ) . casFeatCode_subject , v ) ; }

setter for subject - sets The subject of the triple - always a URI.
@generated
@param v value to set into the feature

setter for subject - sets The subject of the triple - always a URI .


public String getPredicate() {
    if (Triple_Type.featOkTst && ((Triple_Type)jcasType).casFeat_predicate == null)
      jcasType.jcas.throwFeatMissing("predicate", "edu.cmu.lti.oaqa.type.kb.Triple");
    return jcasType.ll_cas.ll_getStringValue(addr, ((Triple_Type)jcasType).casFeatCode_predicate);}

public String getPredicate ( ) { if ( Triple_Type . featOkTst && ( ( Triple_Type ) jcasType ) . casFeat_predicate == null ) jcasType . jcas . throwFeatMissing ( "predicate" , "edu.cmu.lti.oaqa.type.kb.Triple" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( Triple_Type ) jcasType ) . casFeatCode_predicate ) ; }

getter for predicate - gets The predicate of the triple - always a URI.
@generated
@return value of the feature

getter for predicate - gets The predicate of the triple - always a URI .


public void setPredicate(String v) {
    if (Triple_Type.featOkTst && ((Triple_Type)jcasType).casFeat_predicate == null)
      jcasType.jcas.throwFeatMissing("predicate", "edu.cmu.lti.oaqa.type.kb.Triple");
    jcasType.ll_cas.ll_setStringValue(addr, ((Triple_Type)jcasType).casFeatCode_predicate, v);}

public void setPredicate ( String v ) { if ( Triple_Type . featOkTst && ( ( Triple_Type ) jcasType ) . casFeat_predicate == null ) jcasType . jcas . throwFeatMissing ( "predicate" , "edu.cmu.lti.oaqa.type.kb.Triple" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( Triple_Type ) jcasType ) . casFeatCode_predicate , v ) ; }

setter for predicate - sets The predicate of the triple - always a URI.
@generated
@param v value to set into the feature

setter for predicate - sets The predicate of the triple - always a URI .


public boolean getIsObjUri() {
    if (Triple_Type.featOkTst && ((Triple_Type)jcasType).casFeat_isObjUri == null)
      jcasType.jcas.throwFeatMissing("isObjUri", "edu.cmu.lti.oaqa.type.kb.Triple");
    return jcasType.ll_cas.ll_getBooleanValue(addr, ((Triple_Type)jcasType).casFeatCode_isObjUri);}

public boolean getIsObjUri ( ) { if ( Triple_Type . featOkTst && ( ( Triple_Type ) jcasType ) . casFeat_isObjUri == null ) jcasType . jcas . throwFeatMissing ( "isObjUri" , "edu.cmu.lti.oaqa.type.kb.Triple" ) ; return jcasType . ll_cas . ll_getBooleanValue ( addr , ( ( Triple_Type ) jcasType ) . casFeatCode_isObjUri ) ; }

getter for isObjUri - gets Boolean flag - true of object field is a URI, false otherwise.
@generated
@return value of the feature

getter for isObjUri - gets Boolean flag - true of object field is a URI false otherwise .


public void setIsObjUri(boolean v) {
    if (Triple_Type.featOkTst && ((Triple_Type)jcasType).casFeat_isObjUri == null)
      jcasType.jcas.throwFeatMissing("isObjUri", "edu.cmu.lti.oaqa.type.kb.Triple");
    jcasType.ll_cas.ll_setBooleanValue(addr, ((Triple_Type)jcasType).casFeatCode_isObjUri, v);}

public void setIsObjUri ( boolean v ) { if ( Triple_Type . featOkTst && ( ( Triple_Type ) jcasType ) . casFeat_isObjUri == null ) jcasType . jcas . throwFeatMissing ( "isObjUri" , "edu.cmu.lti.oaqa.type.kb.Triple" ) ; jcasType . ll_cas . ll_setBooleanValue ( addr , ( ( Triple_Type ) jcasType ) . casFeatCode_isObjUri , v ) ; }

setter for isObjUri - sets Boolean flag - true of object field is a URI, false otherwise.
@generated
@param v value to set into the feature

setter for isObjUri - sets Boolean flag - true of object field is a URI false otherwise .


public QueryOperator getOperator() {
    if (ComplexQueryConcept_Type.featOkTst && ((ComplexQueryConcept_Type)jcasType).casFeat_operator == null)
      jcasType.jcas.throwFeatMissing("operator", "edu.cmu.lti.oaqa.type.retrieval.ComplexQueryConcept");
    return (QueryOperator)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr, ((ComplexQueryConcept_Type)jcasType).casFeatCode_operator)));}

getter for operator - gets The operator associated with this concept.
@generated
@return value of the feature

getter for operator - gets The operator associated with this concept .


public void setOperator(QueryOperator v) {
    if (ComplexQueryConcept_Type.featOkTst && ((ComplexQueryConcept_Type)jcasType).casFeat_operator == null)
      jcasType.jcas.throwFeatMissing("operator", "edu.cmu.lti.oaqa.type.retrieval.ComplexQueryConcept");
    jcasType.ll_cas.ll_setRefValue(addr, ((ComplexQueryConcept_Type)jcasType).casFeatCode_operator, jcasType.ll_cas.ll_getFSRef(v));}

setter for operator - sets The operator associated with this concept.
@generated
@param v value to set into the feature

setter for operator - sets The operator associated with this concept .


public FSList getOperatorArgs() {
    if (ComplexQueryConcept_Type.featOkTst && ((ComplexQueryConcept_Type)jcasType).casFeat_operatorArgs == null)
      jcasType.jcas.throwFeatMissing("operatorArgs", "edu.cmu.lti.oaqa.type.retrieval.ComplexQueryConcept");
    return (FSList)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr, ((ComplexQueryConcept_Type)jcasType).casFeatCode_operatorArgs)));}

getter for operatorArgs - gets The operator arguments in a complex query concept.
@generated
@return value of the feature

getter for operatorArgs - gets The operator arguments in a complex query concept .


public void setOperatorArgs(FSList v) {
    if (ComplexQueryConcept_Type.featOkTst && ((ComplexQueryConcept_Type)jcasType).casFeat_operatorArgs == null)
      jcasType.jcas.throwFeatMissing("operatorArgs", "edu.cmu.lti.oaqa.type.retrieval.ComplexQueryConcept");
    jcasType.ll_cas.ll_setRefValue(addr, ((ComplexQueryConcept_Type)jcasType).casFeatCode_operatorArgs, jcasType.ll_cas.ll_getFSRef(v));}

setter for operatorArgs - sets The operator arguments in a complex query concept.
@generated
@param v value to set into the feature

setter for operatorArgs - sets The operator arguments in a complex query concept .


public Concept getConcept() {
    if (ConceptMention_Type.featOkTst && ((ConceptMention_Type)jcasType).casFeat_concept == null)
      jcasType.jcas.throwFeatMissing("concept", "edu.cmu.lti.oaqa.type.kb.ConceptMention");
    return (Concept)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr, ((ConceptMention_Type)jcasType).casFeatCode_concept)));}

getter for concept - gets The abstract concept that the text span conveys.
@generated
@return value of the feature

getter for concept - gets The abstract concept that the text span conveys .


public double getScore() {
    if (ConceptMention_Type.featOkTst && ((ConceptMention_Type)jcasType).casFeat_score == null)
      jcasType.jcas.throwFeatMissing("score", "edu.cmu.lti.oaqa.type.kb.ConceptMention");
    return jcasType.ll_cas.ll_getDoubleValue(addr, ((ConceptMention_Type)jcasType).casFeatCode_score);}

getter for score - gets The confidence score that the concept mention matches the concept.
@generated
@return value of the feature

getter for score - gets The confidence score that the concept mention matches the concept .


public String getText() {
    if (CandidateAnswerOccurrence_Type.featOkTst && ((CandidateAnswerOccurrence_Type)jcasType).casFeat_text == null)
      jcasType.jcas.throwFeatMissing("text", "edu.cmu.lti.oaqa.type.answer.CandidateAnswerOccurrence");
    return jcasType.ll_cas.ll_getStringValue(addr, ((CandidateAnswerOccurrence_Type)jcasType).casFeatCode_text);}

getter for text - gets The candidate answer string.
@generated
@return value of the feature

getter for text - gets The candidate answer string .


public void setText(String v) {
    if (CandidateAnswerOccurrence_Type.featOkTst && ((CandidateAnswerOccurrence_Type)jcasType).casFeat_text == null)
      jcasType.jcas.throwFeatMissing("text", "edu.cmu.lti.oaqa.type.answer.CandidateAnswerOccurrence");
    jcasType.ll_cas.ll_setStringValue(addr, ((CandidateAnswerOccurrence_Type)jcasType).casFeatCode_text, v);}

setter for text - sets The candidate answer string.
@generated
@param v value to set into the feature

setter for text - sets The candidate answer string .


public String getId() {
    if (ConceptType_Type.featOkTst && ((ConceptType_Type)jcasType).casFeat_id == null)
      jcasType.jcas.throwFeatMissing("id", "edu.cmu.lti.oaqa.type.kb.ConceptType");
    return jcasType.ll_cas.ll_getStringValue(addr, ((ConceptType_Type)jcasType).casFeatCode_id);}

public String getId ( ) { if ( ConceptType_Type . featOkTst && ( ( ConceptType_Type ) jcasType ) . casFeat_id == null ) jcasType . jcas . throwFeatMissing ( "id" , "edu.cmu.lti.oaqa.type.kb.ConceptType" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( ConceptType_Type ) jcasType ) . casFeatCode_id ) ; }

getter for id - gets The id of the concept type.
@generated
@return value of the feature

getter for id - gets The id of the concept type .


public void setId(String v) {
    if (ConceptType_Type.featOkTst && ((ConceptType_Type)jcasType).casFeat_id == null)
      jcasType.jcas.throwFeatMissing("id", "edu.cmu.lti.oaqa.type.kb.ConceptType");
    jcasType.ll_cas.ll_setStringValue(addr, ((ConceptType_Type)jcasType).casFeatCode_id, v);}

public void setId ( String v ) { if ( ConceptType_Type . featOkTst && ( ( ConceptType_Type ) jcasType ) . casFeat_id == null ) jcasType . jcas . throwFeatMissing ( "id" , "edu.cmu.lti.oaqa.type.kb.ConceptType" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( ConceptType_Type ) jcasType ) . casFeatCode_id , v ) ; }

setter for id - sets The id of the concept type.
@generated
@param v value to set into the feature

setter for id - sets The id of the concept type .


public String getName() {
    if (ConceptType_Type.featOkTst && ((ConceptType_Type)jcasType).casFeat_name == null)
      jcasType.jcas.throwFeatMissing("name", "edu.cmu.lti.oaqa.type.kb.ConceptType");
    return jcasType.ll_cas.ll_getStringValue(addr, ((ConceptType_Type)jcasType).casFeatCode_name);}

public String getName ( ) { if ( ConceptType_Type . featOkTst && ( ( ConceptType_Type ) jcasType ) . casFeat_name == null ) jcasType . jcas . throwFeatMissing ( "name" , "edu.cmu.lti.oaqa.type.kb.ConceptType" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( ConceptType_Type ) jcasType ) . casFeatCode_name ) ; }

getter for name - gets A human readable concept label.
@generated
@return value of the feature

getter for name - gets A human readable concept label .


public String getAbbreviation() {
    if (ConceptType_Type.featOkTst && ((ConceptType_Type)jcasType).casFeat_abbreviation == null)
      jcasType.jcas.throwFeatMissing("abbreviation", "edu.cmu.lti.oaqa.type.kb.ConceptType");
    return jcasType.ll_cas.ll_getStringValue(addr, ((ConceptType_Type)jcasType).casFeatCode_abbreviation);}

public String getAbbreviation ( ) { if ( ConceptType_Type . featOkTst && ( ( ConceptType_Type ) jcasType ) . casFeat_abbreviation == null ) jcasType . jcas . throwFeatMissing ( "abbreviation" , "edu.cmu.lti.oaqa.type.kb.ConceptType" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( ConceptType_Type ) jcasType ) . casFeatCode_abbreviation ) ; }

getter for abbreviation - gets The abbreviation of the name label.
@generated
@return value of the feature

getter for abbreviation - gets The abbreviation of the name label .


public void setAbbreviation(String v) {
    if (ConceptType_Type.featOkTst && ((ConceptType_Type)jcasType).casFeat_abbreviation == null)
      jcasType.jcas.throwFeatMissing("abbreviation", "edu.cmu.lti.oaqa.type.kb.ConceptType");
    jcasType.ll_cas.ll_setStringValue(addr, ((ConceptType_Type)jcasType).casFeatCode_abbreviation, v);}

public void setAbbreviation ( String v ) { if ( ConceptType_Type . featOkTst && ( ( ConceptType_Type ) jcasType ) . casFeat_abbreviation == null ) jcasType . jcas . throwFeatMissing ( "abbreviation" , "edu.cmu.lti.oaqa.type.kb.ConceptType" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( ConceptType_Type ) jcasType ) . casFeatCode_abbreviation , v ) ; }

setter for abbreviation - sets The abbreviation of the name label.
@generated
@param v value to set into the feature

setter for abbreviation - sets The abbreviation of the name label .


public void setConcept(Concept v) {
    if (ConceptSearchResult_Type.featOkTst && ((ConceptSearchResult_Type)jcasType).casFeat_concept == null)
      jcasType.jcas.throwFeatMissing("concept", "edu.cmu.lti.oaqa.type.retrieval.ConceptSearchResult");
    jcasType.ll_cas.ll_setRefValue(addr, ((ConceptSearchResult_Type)jcasType).casFeatCode_concept, jcasType.ll_cas.ll_getFSRef(v));}

setter for concept - sets The relevant concept searched in the ontology.
@generated
@param v value to set into the feature

setter for concept - sets The relevant concept searched in the ontology .


public FSList getVariants() {
    if (Answer_Type.featOkTst && ((Answer_Type)jcasType).casFeat_variants == null)
      jcasType.jcas.throwFeatMissing("variants", "edu.cmu.lti.oaqa.type.answer.Answer");
    return (FSList)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr, ((Answer_Type)jcasType).casFeatCode_variants)));}

public FSList getVariants ( ) { if ( Answer_Type . featOkTst && ( ( Answer_Type ) jcasType ) . casFeat_variants == null ) jcasType . jcas . throwFeatMissing ( "variants" , "edu.cmu.lti.oaqa.type.answer.Answer" ) ; return ( FSList ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( Answer_Type ) jcasType ) . casFeatCode_variants ) ) ) ; }

getter for variants - gets List of candidate answer variants that were merged into this final answer.
@generated
@return value of the feature

getter for variants - gets List of candidate answer variants that were merged into this final answer .


public void setVariants(FSList v) {
    if (Answer_Type.featOkTst && ((Answer_Type)jcasType).casFeat_variants == null)
      jcasType.jcas.throwFeatMissing("variants", "edu.cmu.lti.oaqa.type.answer.Answer");
    jcasType.ll_cas.ll_setRefValue(addr, ((Answer_Type)jcasType).casFeatCode_variants, jcasType.ll_cas.ll_getFSRef(v));}

public void setVariants ( FSList v ) { if ( Answer_Type . featOkTst && ( ( Answer_Type ) jcasType ) . casFeat_variants == null ) jcasType . jcas . throwFeatMissing ( "variants" , "edu.cmu.lti.oaqa.type.answer.Answer" ) ; jcasType . ll_cas . ll_setRefValue ( addr , ( ( Answer_Type ) jcasType ) . casFeatCode_variants , jcasType . ll_cas . ll_getFSRef ( v ) ) ; }

setter for variants - sets List of candidate answer variants that were merged into this final answer.
@generated
@param v value to set into the feature

setter for variants - sets List of candidate answer variants that were merged into this final answer .


public StringList getNamedEntityTypes() {
    if (QueryConcept_Type.featOkTst && ((QueryConcept_Type)jcasType).casFeat_namedEntityTypes == null)
      jcasType.jcas.throwFeatMissing("namedEntityTypes", "edu.cmu.lti.oaqa.type.retrieval.QueryConcept");
    return (StringList)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr, ((QueryConcept_Type)jcasType).casFeatCode_namedEntityTypes)));}

getter for namedEntityTypes - gets List of Named Entity types associated with this concept.
@generated
@return value of the feature

getter for namedEntityTypes - gets List of Named Entity types associated with this concept .


public void setNamedEntityTypes(StringList v) {
    if (QueryConcept_Type.featOkTst && ((QueryConcept_Type)jcasType).casFeat_namedEntityTypes == null)
      jcasType.jcas.throwFeatMissing("namedEntityTypes", "edu.cmu.lti.oaqa.type.retrieval.QueryConcept");
    jcasType.ll_cas.ll_setRefValue(addr, ((QueryConcept_Type)jcasType).casFeatCode_namedEntityTypes, jcasType.ll_cas.ll_getFSRef(v));}

setter for namedEntityTypes - sets List of Named Entity types associated with this concept.
@generated
@param v value to set into the feature

setter for namedEntityTypes - sets List of Named Entity types associated with this concept .


public String getConceptType() {
    if (QueryConcept_Type.featOkTst && ((QueryConcept_Type)jcasType).casFeat_conceptType == null)
      jcasType.jcas.throwFeatMissing("conceptType", "edu.cmu.lti.oaqa.type.retrieval.QueryConcept");
    return jcasType.ll_cas.ll_getStringValue(addr, ((QueryConcept_Type)jcasType).casFeatCode_conceptType);}

getter for conceptType - gets The type of this concept.
@generated
@return value of the feature

getter for conceptType - gets The type of this concept .


public void setConceptType(String v) {
    if (QueryConcept_Type.featOkTst && ((QueryConcept_Type)jcasType).casFeat_conceptType == null)
      jcasType.jcas.throwFeatMissing("conceptType", "edu.cmu.lti.oaqa.type.retrieval.QueryConcept");
    jcasType.ll_cas.ll_setStringValue(addr, ((QueryConcept_Type)jcasType).casFeatCode_conceptType, v);}

setter for conceptType - sets The type of this concept.
@generated
@param v value to set into the feature

setter for conceptType - sets The type of this concept .


public FSList getOccurrences() {
    if (CandidateAnswerVariant_Type.featOkTst && ((CandidateAnswerVariant_Type)jcasType).casFeat_occurrences == null)
      jcasType.jcas.throwFeatMissing("occurrences", "edu.cmu.lti.oaqa.type.answer.CandidateAnswerVariant");
    return (FSList)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr, ((CandidateAnswerVariant_Type)jcasType).casFeatCode_occurrences)));}

getter for occurrences - gets The occurrences of this variant.
@generated
@return value of the feature

getter for occurrences - gets The occurrences of this variant .


public void setOccurrences(FSList v) {
    if (CandidateAnswerVariant_Type.featOkTst && ((CandidateAnswerVariant_Type)jcasType).casFeat_occurrences == null)
      jcasType.jcas.throwFeatMissing("occurrences", "edu.cmu.lti.oaqa.type.answer.CandidateAnswerVariant");
    jcasType.ll_cas.ll_setRefValue(addr, ((CandidateAnswerVariant_Type)jcasType).casFeatCode_occurrences, jcasType.ll_cas.ll_getFSRef(v));}

setter for occurrences - sets The occurrences of this variant.
@generated
@param v value to set into the feature

setter for occurrences - sets The occurrences of this variant .


public FSList getConcepts() {
    if (AbstractQuery_Type.featOkTst && ((AbstractQuery_Type)jcasType).casFeat_concepts == null)
      jcasType.jcas.throwFeatMissing("concepts", "edu.cmu.lti.oaqa.type.retrieval.AbstractQuery");
    return (FSList)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr, ((AbstractQuery_Type)jcasType).casFeatCode_concepts)));}

getter for concepts - gets The list of query concepts that make up this abstract query. The list is ordered.
@generated
@return value of the feature

getter for concepts - gets The list of query concepts that make up this abstract query . The list is ordered .


public void setConcepts(FSList v) {
    if (AbstractQuery_Type.featOkTst && ((AbstractQuery_Type)jcasType).casFeat_concepts == null)
      jcasType.jcas.throwFeatMissing("concepts", "edu.cmu.lti.oaqa.type.retrieval.AbstractQuery");
    jcasType.ll_cas.ll_setRefValue(addr, ((AbstractQuery_Type)jcasType).casFeatCode_concepts, jcasType.ll_cas.ll_getFSRef(v));}

setter for concepts - sets The list of query concepts that make up this abstract query. The list is ordered.
@generated
@param v value to set into the feature

setter for concepts - sets The list of query concepts that make up this abstract query . The list is ordered .


public String getOriginalText() {
    if (AtomicQueryConcept_Type.featOkTst && ((AtomicQueryConcept_Type)jcasType).casFeat_originalText == null)
      jcasType.jcas.throwFeatMissing("originalText", "edu.cmu.lti.oaqa.type.retrieval.AtomicQueryConcept");
    return jcasType.ll_cas.ll_getStringValue(addr, ((AtomicQueryConcept_Type)jcasType).casFeatCode_originalText);}

getter for originalText - gets The lexical string in the question.
@generated
@return value of the feature

getter for originalText - gets The lexical string in the question .


public void setOriginalText(String v) {
    if (AtomicQueryConcept_Type.featOkTst && ((AtomicQueryConcept_Type)jcasType).casFeat_originalText == null)
      jcasType.jcas.throwFeatMissing("originalText", "edu.cmu.lti.oaqa.type.retrieval.AtomicQueryConcept");
    jcasType.ll_cas.ll_setStringValue(addr, ((AtomicQueryConcept_Type)jcasType).casFeatCode_originalText, v);}

setter for originalText - sets The lexical string in the question.
@generated
@param v value to set into the feature

setter for originalText - sets The lexical string in the question .


public StringList getArgs() {
    if (QueryOperator_Type.featOkTst && ((QueryOperator_Type)jcasType).casFeat_args == null)
      jcasType.jcas.throwFeatMissing("args", "edu.cmu.lti.oaqa.type.retrieval.QueryOperator");
    return (StringList)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr, ((QueryOperator_Type)jcasType).casFeatCode_args)));}

getter for args - gets The arguments for the operator.
@generated
@return value of the feature

getter for args - gets The arguments for the operator .


public void setArgs(StringList v) {
    if (QueryOperator_Type.featOkTst && ((QueryOperator_Type)jcasType).casFeat_args == null)
      jcasType.jcas.throwFeatMissing("args", "edu.cmu.lti.oaqa.type.retrieval.QueryOperator");
    jcasType.ll_cas.ll_setRefValue(addr, ((QueryOperator_Type)jcasType).casFeatCode_args, jcasType.ll_cas.ll_getFSRef(v));}

setter for args - sets The arguments for the operator.
@generated
@param v value to set into the feature

setter for args - sets The arguments for the operator .


public String getLabel() {
    if (SemanticRole_Type.featOkTst && ((SemanticRole_Type)jcasType).casFeat_label == null)
      jcasType.jcas.throwFeatMissing("label", "edu.cmu.lti.oaqa.type.nlp.SemanticRole");
    return jcasType.ll_cas.ll_getStringValue(addr, ((SemanticRole_Type)jcasType).casFeatCode_label);}

getter for label - gets The semantic role label.
@generated
@return value of the feature

getter for label - gets The semantic role label .


public void setLabel(String v) {
    if (SemanticRole_Type.featOkTst && ((SemanticRole_Type)jcasType).casFeat_label == null)
      jcasType.jcas.throwFeatMissing("label", "edu.cmu.lti.oaqa.type.nlp.SemanticRole");
    jcasType.ll_cas.ll_setStringValue(addr, ((SemanticRole_Type)jcasType).casFeatCode_label, v);}

setter for label - sets The semantic role label.
@generated
@param v value to set into the feature

setter for label - sets The semantic role label .


public int nextClearBit(int index) {
    int i = index >> 6;
    if (i >= wlen)
      return -1;
    int subIndex = index & 0x3f; // index within the word
    long word = ~bits.get(i) >> subIndex; // skip all the bits to the right of
                                          // index
    if (word != 0) {
      return (i << 6) + subIndex + Long.numberOfTrailingZeros(word);
    }
    while (++i < wlen) {
      word = ~bits.get(i);
      if (word != 0) {
        return (i << 6) + Long.numberOfTrailingZeros(word);
      }
    }
    return -1;
  }

public
int
nextClearBit
(
int
index
)
{
int
i
=
index
>>
6
;
if
(
i
>=
wlen
)
return
1
;
int
subIndex
=
index
&
0x3f
;
// index within the word
long
word
=
~
bits
.
get
(
i
)
>>
subIndex
;
// skip all the bits to the right of
// index
if
(
word
!=
0
)
{
return
(
i
<<
6
)
+
subIndex
+
Long
.
numberOfTrailingZeros
(
word
)
;
}
while
(
++
i
<
wlen
)
{
word
=
~
bits
.
get
(
i
)
;
if
(
word
!=
0
)
{
return
(
i
<<
6
)
+
Long
.
numberOfTrailingZeros
(
word
)
;
}
}
return
1
;
}

Find the next clear bit in the bit set.

@param index
@return

Find the next clear bit in the bit set .


public boolean set(int index) {
    int wordNum = index >> 6; // div 64
    int bit = index & 0x3f; // mod 64
    long bitmask = 1L << bit;
    long word, oword;
    do {
      word = bits.get(wordNum);
      // if set another thread stole the lock
      if ((word & bitmask) != 0) {
        return false;
      }
      oword = word;
      word |= bitmask;
    } while (!bits.compareAndSet(wordNum, oword, word));
    return true;
  }

public
boolean
set
(
int
index
)
{
int
wordNum
=
index
>>
6
;
// div 64
int
bit
=
index
&
0x3f
;
// mod 64
long
bitmask
=
1L
<<
bit
;
long
word
,
oword
;
do
{
word
=
bits
.
get
(
wordNum
)
;
// if set another thread stole the lock
if
(
(
word
&
bitmask
)
!=
0
)
{
return
false
;
}
oword
=
word
;
word
|=
bitmask
;
}
while
(
!
bits
.
compareAndSet
(
wordNum
,
oword
,
word
)
)
;
return
true
;
}

Thread safe set operation that will set the bit if and only if the bit was
not previously set.

@param index
the index position to set.
@return returns true if the bit was set and false if it was already set.

Thread safe set operation that will set the bit if and only if the bit was not previously set .


protected void freeBuffer(final ByteBuffer buffer) throws IOException {
    if (buffer == null) {
      return;
    }
    if (UNMAP_SUPPORTED) {
      try {
        AccessController.doPrivileged(new PrivilegedExceptionAction<Void>() {
          @Override
          public Void run() throws Exception {
            final Method getCleanerMethod = buffer.getClass().getMethod("cleaner");
            getCleanerMethod.setAccessible(true);
            final Object cleaner = getCleanerMethod.invoke(buffer);
            if (cleaner != null) {
              cleaner.getClass().getMethod("clean").invoke(cleaner);
            }
            return null;
          }
        });
      } catch (PrivilegedActionException e) {
        final IOException ioe = new IOException("unable to unmap the mapped buffer");
        ioe.initCause(e.getCause());
        throw ioe;
      }
    }
  }

protected
void
freeBuffer
(
final
ByteBuffer
buffer
)
throws
IOException
{
if
(
buffer
==
)
{
return
;
}
if
(
UNMAP_SUPPORTED
)
{
try
{
AccessController
.
doPrivileged
(
new
PrivilegedExceptionAction
<
Void
>
(
)
{
@
Override
public
Void
run
(
)
throws
Exception
{
final
Method
getCleanerMethod
=
buffer
.
getClass
(
)
.
getMethod
(
"cleaner"
)
;
getCleanerMethod
.
setAccessible
(
true
)
;
final
Object
cleaner
=
getCleanerMethod
.
invoke
(
buffer
)
;
if
(
cleaner
!=
)
{
cleaner
.
getClass
(
)
.
getMethod
(
"clean"
)
.
invoke
(
cleaner
)
;
}
return
;
}
}
)
;
}
catch
(
PrivilegedActionException
e
)
{
final
IOException
ioe
=
new
IOException
(
"unable to unmap the mapped buffer"
)
;
ioe
.
initCause
(
e
.
getCause
(
)
)
;
throw
ioe
;
}
}
}

This code was copied form MMAPDirectory in Lucene.

This code was copied form MMAPDirectory in Lucene .


public CacheValue newInstance(CacheDirectory directory, String fileName) {
    return newInstance(directory, fileName, getCacheBlockSize(directory, fileName));
  }

public CacheValue newInstance ( CacheDirectory directory , String fileName ) { return newInstance ( directory , fileName , getCacheBlockSize ( directory , fileName ) ) ; }

Creates a new instance of CacheValue, the cache capacity should be used for
the given file.

@param directory
the directory.
@param fileName
the file name.
@return the new CacheValue instance.

Creates a new instance of CacheValue the cache capacity should be used for the given file .


private static Object[] rehash(final Object[] values, final int newSize)
    {
        Object[] newArray = new Object[newSize];

        for (Object value : values)
        {
            if (value == null)
            {
                continue;
            }

            newArray[predictedPosition(newArray, value, value.hashCode())] = value;
        }

        return newArray;
    }

private static Object [ ] rehash ( final Object [ ] values , final int newSize ) { Object [ ] newArray = new Object [ newSize ] ; for ( Object value : values ) { if ( value == null ) { continue ; } newArray [ predictedPosition ( newArray , value , value . hashCode ( ) ) ] = value ; } return newArray ; }

Rebuild the backing array with a different size.

@param values
The values to put into the new array.
@param newSize
The size of the new array.

@return The new backing array.

Rebuild the backing array with a different size .


public String toHELM2() {
		StringBuilder notation = new StringBuilder();
		for (int i = 0; i < listMonomerNotations.size(); i++) {
			notation.append(listMonomerNotations.get(i).toHELM2() + ".");

		}

		notation.setLength(notation.length() - 1);
		return notation.toString();
	}

public String toHELM2 ( ) { StringBuilder notation = new StringBuilder ( ) ; for ( int i = 0 ; i < listMonomerNotations . size ( ) ; i ++ ) { notation . append ( listMonomerNotations . get ( i ) . toHELM2 ( ) + "." ) ; } notation . setLength ( notation . length ( ) - 1 ) ; return notation . toString ( ) ; }

method to generate a valid HELM2 of this object

@return valid HELM2


private boolean checkBracketsParenthesis() {
    LOG.debug("Check of brackets in the annotation section:");
    if (bracketCounterOpen == bracketCounterClose
        && parenthesisCounterOpen == parenthesisCounterClose
        && curlyBracketCounterOpen == curlyBracketCounterClose) {
      return true;

    }
    return false;
  }

method to check if all open brackets are closed

@return true if all open brackets are close, false otherwise


private void addDetails(String str) throws NotationException{
    String[] parts = str.split("-");

    /* MonomerUnit */
    sourceUnit = parts[0].split(":")[0].toUpperCase();
    targetUnit = parts[1].split(":")[0].toUpperCase();

    /* R-group */

    rGroupSource = parts[0].split(":")[1];
    rGroupTarget = parts[1].split(":")[1];

    Pattern r = Pattern.compile("R\\d", Pattern.CASE_INSENSITIVE);
    Pattern pair = Pattern.compile("pair", Pattern.CASE_INSENSITIVE);

    Matcher mR = r.matcher(rGroupSource);
    Matcher mPair = pair.matcher(rGroupTarget);
    if(mR.matches()){
    	rGroupSource = rGroupSource.toUpperCase();
    }else{
    	rGroupSource = rGroupSource.toLowerCase();
    }

    if(mPair.matches()){
    	rGroupTarget = rGroupTarget.toLowerCase();
    }else{
    	rGroupTarget = rGroupTarget.toUpperCase();
    }
  }

private
void
addDetails
(
String
str
)
throws
NotationException
{
String
[
]
parts
=
str
.
split
(
"-"
)
;
/* MonomerUnit */
sourceUnit
=
parts
[
0
]
.
split
(
":"
)
[
0
]
.
toUpperCase
(
)
;
targetUnit
=
parts
[
1
]
.
split
(
":"
)
[
0
]
.
toUpperCase
(
)
;
/* R-group */
rGroupSource
=
parts
[
0
]
.
split
(
":"
)
[
1
]
;
rGroupTarget
=
parts
[
1
]
.
split
(
":"
)
[
1
]
;
Pattern
r
=
Pattern
.
compile
(
"R\\d"
,
Pattern
.
CASE_INSENSITIVE
)
;
Pattern
pair
=
Pattern
.
compile
(
"pair"
,
Pattern
.
CASE_INSENSITIVE
)
;
Matcher
mR
=
r
.
matcher
(
rGroupSource
)
;
Matcher
mPair
=
pair
.
matcher
(
rGroupTarget
)
;
if
(
mR
.
matches
(
)
)
{
rGroupSource
=
rGroupSource
.
toUpperCase
(
)
;
}
else
{
rGroupSource
=
rGroupSource
.
toLowerCase
(
)
;
}
if
(
mPair
.
matches
(
)
)
{
rGroupTarget
=
rGroupTarget
.
toLowerCase
(
)
;
}
else
{
rGroupTarget
=
rGroupTarget
.
toUpperCase
(
)
;
}
}

method to set the details of the current connection

@param method to add connection detail
@throws NotationException


public String toHELM2() {
    if (isAnnotationTrue()) {
      return sourceId.getId() + "," + targetId.getId() + "," + sourceUnit + ":"
          + rGroupSource + "-" + targetUnit + ":" + rGroupTarget + "\"" + annotation + "\"";
    } else {
      return sourceId.getId() + "," + targetId.getId() + "," + sourceUnit + ":"
          + rGroupSource + "-" + targetUnit + ":" + rGroupTarget;
    }
  }

public String toHELM2 ( ) { if ( isAnnotationTrue ( ) ) { return sourceId . getId ( ) + "," + targetId . getId ( ) + "," + sourceUnit + ":" + rGroupSource + "-" + targetUnit + ":" + rGroupTarget + "\"" + annotation + "\"" ; } else { return sourceId . getId ( ) + "," + targetId . getId ( ) + "," + sourceUnit + ":" + rGroupSource + "-" + targetUnit + ":" + rGroupTarget ; } }

method to get a valid HELM2 of the connection notation

@return valid HELM2


public void addElement(String str, String type, double one, double two, boolean interval, boolean isDefault) throws NotationException{
    this.elements.add(ValidationMethod.decideWhichMonomerNotationInGroup(str, type, one, two, interval, isDefault));

  }

public void addElement ( String str , String type , double one , double two , boolean interval , boolean isDefault ) throws NotationException { this . elements . add ( ValidationMethod . decideWhichMonomerNotationInGroup ( str , type , one , two , interval , isDefault ) ) ; }

method to add a single element to the group

@param str Monomer
@param type type of current polymer
@param one value of the monomer
@param two value of the monomer
@param interval is the value on interval
@param isDefault if the value is the default one
@throws NotationException if notation is not valid


public static void main(String[] args) throws ParseException,
      ExceptionState, IOException {
    /* options for the program */
    Options options = new Options();
    /* add helm string */
    options.addOption("inputHELM", true, "HELM1 or HELM2 string in a file");

    /* add output option */
    options.addOption("output", true, "output can be in JSON- or HELM2-format");

    /* add translate option */
    options.addOption("translate", false, "translate HELM1 to HELM2");

    CommandLineParser parameter = new DefaultParser();
    try {

      CommandLine cmd = parameter.parse(options, args);

      String filename = cmd.getOptionValue("inputHELM");

      ParserHELM2 parser = new ParserHELM2();

      FileReader in = new FileReader(filename);

      BufferedReader br = new BufferedReader(in);

      String line;
      String helm;
      try {
        while ((line = br.readLine()) != null) {
          helm = line;
          /* HELM1 notation has to be translated into HELM2 */
          if (cmd.hasOption("translate")) {

            ConverterHELM1ToHELM2 converter = new ConverterHELM1ToHELM2();
            helm = converter.doConvert(helm);
            LOG.info("HELM1 is translated to HELM2");
          }

          parser.parse(helm);

          /* There are two different output options */
          String output = "";
          if (cmd.getOptionValue("output").equals("HELM2")) {
            output = parser.getHELM2Notation().toHELM2();
          } else if (cmd.getOptionValue("output").equals("JSON")) {

            output = parser.getJSON();
          }
          System.out.println(output);
        }
      } finally {
        br.close();
      }
    } catch (NullPointerException e) {
      System.out.println("Please call the program with the following arguments: "
          + "\n"
          + "-inputHELM  <"
          + options.getOption("inputHELM").getDescription()
          + ">\n"
          + "-output <"
          + options.getOption("output").getDescription()
          + ">\n-translate(optional) <"
          + options.getOption("translate").getDescription()
          + ">");
    } catch (ParseException exp) {
      System.out.println("Unexpected exception: " + exp.getMessage());
    }

  }

main method to run a single HELM2Parser from the command line

@param args console parameters
@throws ParseException if parsing the command lines produces an error
@throws ExceptionState an exception in a state during parsing occurs, helm notation is not valid
@throws IOException if file can not be read


public boolean checkPolymerId(String polymerId) {
    LOG.debug("Validation of polymerID: " + polymerId);
    String pattern = "PEPTIDE[1-9][0-9]*|RNA[1-9][0-9]*|CHEM[1-9][0-9]*|BLOB[1-9][0-9]*";

    Pattern p = Pattern.compile(pattern, Pattern.CASE_INSENSITIVE);
    Matcher m = p.matcher(polymerId);
    if (m.matches()) {
      LOG.debug("PolymerID is valid: " + polymerId);
      return true;
    }

    LOG.debug("PolymerID is not valid: " + polymerId);
    return false;
  }

method to validate the polymer id in the simple polymer section the id can
be peptide, rna, chem or blob

@param polymerId ID of a polymer
@return true if the ID is valid, false otherwise

method to validate the polymer id in the simple polymer section the id can be peptide rna chem or blob


public boolean checkPolymeridConnection(String polymerId) {
    LOG.debug("Validation of polymerID in the connection section:");
    String ratio = "(:[1-9][0-9]*(\\.[0-9]+)?)?";
    String id = "(PEPTIDE[1-9][0-9]*|RNA[1-9][0-9]*|CHEM[1-9][0-9]*|BLOB[1-9][0-9]*|G[1-9][0-9]*)";
    String pattern = "(\\(" + id + ratio + "(," + id + ratio + ")+\\)" + ratio + "|" + id + ratio + ")";
    Pattern p = Pattern.compile(pattern,Pattern.CASE_INSENSITIVE);
    Matcher m  = p.matcher(polymerId);
    if (m.matches()) {
      LOG.debug("PolymerID in the connection section is valid:");
      return true;
    }

    LOG.debug("PolymerID in the connection section is not valid: " + polymerId);
    return false;
  }

method to validate the polymer id in the connection section the id can be
peptide, rna, chem or blob the ratio + range was also included, the
ambiguity is also proven

@param polymerId ID of a polymer
@return true if the ID is valid, false otherwise

method to validate the polymer id in the connection section the id can be peptide rna chem or blob the ratio + range was also included the ambiguity is also proven


public boolean checkDetailsConnections(String d) {
    LOG.debug("Validation of connection's details:");
    String group = "\\((\\D|\\d)((,|\\+)(\\D|\\d))+\\)";
    String partOne = "([1-9][0-9]*|\\D|\\?|" + group + ")";
    String partTwo = "(R[1-9][0-9]*+|\\?)";
    String element = partOne + ":" + partTwo;
    String patternConnection = element + "-" + element;
    String hydrogenBondPartner = partOne + ":pair";
    String hydrogenBondPattern = hydrogenBondPartner + "-" + hydrogenBondPartner;
    Pattern pConnection = Pattern.compile(patternConnection , Pattern.CASE_INSENSITIVE);
    Matcher mConnection = pConnection.matcher(d);
    Pattern pHydrogen = Pattern.compile(hydrogenBondPattern, Pattern.CASE_INSENSITIVE);
    Matcher mHydrogen = pHydrogen.matcher(d);
    if (mConnection.matches() || mHydrogen.matches()) {
      LOG.debug("Connection's details are valid:");
      return true;
    }
    LOG.debug("Connection's details are not valid: " + d);
    return false;
  }

public
boolean
checkDetailsConnections
(
String
d
)
{
LOG
.
debug
(
"Validation of connection's details:"
)
;
String
group
=
"\\((\\D|\\d)((,|\\+)(\\D|\\d))+\\)"
;
String
partOne
=
"([1-9][0-9]*|\\D|\\?|"
+
group
+
")"
;
String
partTwo
=
"(R[1-9][0-9]*+|\\?)"
;
String
element
=
partOne
+
":"
+
partTwo
;
String
patternConnection
=
element
+
"-"
+
element
;
String
hydrogenBondPartner
=
partOne
+
":pair"
;
String
hydrogenBondPattern
=
hydrogenBondPartner
+
"-"
+
hydrogenBondPartner
;
Pattern
pConnection
=
Pattern
.
compile
(
patternConnection
,
Pattern
.
CASE_INSENSITIVE
)
;
Matcher
mConnection
=
pConnection
.
matcher
(
d
)
;
Pattern
pHydrogen
=
Pattern
.
compile
(
hydrogenBondPattern
,
Pattern
.
CASE_INSENSITIVE
)
;
Matcher
mHydrogen
=
pHydrogen
.
matcher
(
d
)
;
if
(
mConnection
.
matches
(
)
||
mHydrogen
.
matches
(
)
)
{
LOG
.
debug
(
"Connection's details are valid:"
)
;
return
true
;
}
LOG
.
debug
(
"Connection's details are not valid: "
+
d
)
;
return
false
;
}

method to validate the details about the connections; hydrogen bonds are
here included

@param d connection details
@return true if the connection details are valid, false otherwise

method to validate the details about the connections ; hydrogen bonds are here included


public boolean checkGroupId(String d) {
	  Pattern p = Pattern.compile("G[1-9][0-9]*", Pattern.CASE_INSENSITIVE);
	  Matcher m = p.matcher(d);
    LOG.debug("Validation of groupID:");
    if (m.matches()) {
      LOG.debug("GroupID is valid:");
      return true;
    }
    LOG.debug("GroupID is not valid:");
    return false;
  }

public
boolean
checkGroupId
(
String
d
)
{
Pattern
p
=
Pattern
.
compile
(
"G[1-9][0-9]*"
,
Pattern
.
CASE_INSENSITIVE
)
;
Matcher
m
=
p
.
matcher
(
d
)
;
LOG
.
debug
(
"Validation of groupID:"
)
;
if
(
m
.
matches
(
)
)
{
LOG
.
debug
(
"GroupID is valid:"
)
;
return
true
;
}
LOG
.
debug
(
"GroupID is not valid:"
)
;
return
false
;
}

method to validate the group id

@param d ID of a group
@return true if the connection details are valid, false otherwise


public boolean checkRepeating(String str) {
    String pattern = "\\d+|\\d+-\\d+";
    if (str.matches(pattern)) {
      return true;
    }
    return false;
  }

public boolean checkRepeating ( String str ) { String pattern = "\\d+|\\d+-\\d+" ; if ( str . matches ( pattern ) ) { return true ; } return false ; }

method to validate the repeating section it can be a single number or a
range

@param str repeating information
@return true if the information is valid, false otherwise


public boolean isPeptideOrRna() throws SimplePolymerSectionException {
    if (polymerElements.size() >= 1) {
      if (polymerElements.get(polymerElements.size() - 1).matches("(PEPTIDE[1-9][0-9]*+|RNA[1-9][0-9]*)")) {
        return true;
      }
      return false;
    } else {
      throw new SimplePolymerSectionException("No Polymer Id is found");
    }
  }

public
boolean
isPeptideOrRna
(
)
throws
SimplePolymerSectionException
{
if
(
polymerElements
.
size
(
)
>=
1
)
{
if
(
polymerElements
.
get
(
polymerElements
.
size
(
)
1
)
.
matches
(
"(PEPTIDE[1-9][0-9]*+|RNA[1-9][0-9]*)"
)
)
{
return
true
;
}
return
false
;
}
else
{
throw
new
SimplePolymerSectionException
(
"No Polymer Id is found"
)
;
}
}

method to check if the last added polymer element is a peptide or a rna

@return true, if the last added polymer is a peptide or a rna, false
otherwise
@throws SimplePolymerSectionException if list of polymers is null


protected String toJSON() {
    ObjectMapper mapper = new ObjectMapper();

    try {
      String jsonINString = mapper.writeValueAsString(notationContainer);
      jsonINString = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(notationContainer);

      return jsonINString;
    } catch (Exception e) {
      e.printStackTrace();
    }
    return null;
  }

protected String toJSON ( ) { ObjectMapper mapper = new ObjectMapper ( ) ; try { String jsonINString = mapper . writeValueAsString ( notationContainer ) ; jsonINString = mapper . writerWithDefaultPrettyPrinter ( ) . writeValueAsString ( notationContainer ) ; return jsonINString ; } catch ( Exception e ) { e . printStackTrace ( ) ; } return null ; }

method to generate a JSON-Object from the NotationContainer

@return NotationContainer in JSON-Format

method to generate a JSON - Object from the NotationContainer


public PolymerNotation getSimplePolymer(String string) {
    for (PolymerNotation polymer : listOfPolymers) {
      if (polymer.getPolymerID().getId().equals(string)) {
        return polymer;
      }
    }
    return null;
  }

public PolymerNotation getSimplePolymer ( String string ) { for ( PolymerNotation polymer : listOfPolymers ) { if ( polymer . getPolymerID ( ) . getId ( ) . equals ( string ) ) { return polymer ; } } return null ; }

method to get the simple polymer type
@param string id of polymer
@return PolymerNotation with the given id


@JsonIgnore
  public GroupingNotation getCurrentGroupingNotation() {
    if (listOfGroupings.size() == 0) {
      return null;
    }
    return listOfGroupings.get(listOfGroupings.size() - 1);
  }

@ JsonIgnore public GroupingNotation getCurrentGroupingNotation ( ) { if ( listOfGroupings . size ( ) == 0 ) { return null ; } return listOfGroupings . get ( listOfGroupings . size ( ) - 1 ) ; }

method to get the current grouping notation

@return GroupingNotation


public String toHELM2() {
    String output = "";
    /* first section: simple polymer section */
    output += polymerToHELM2() + "$";

    /* second section: connection section */
    output += connectionToHELM2() + "$";

    /* third section: grouping section */
    output += groupingToHELM2() + "$";

    /* fourth section: annotation section */
    output += annotationToHELM2() + "$";

    /* add version number */
    output += "V2.0";

    return output;
  }

method to generate for all sections a HELM2 string

@return HELM2


public String polymerToHELM2() {
    StringBuilder notation = new StringBuilder();
    for (int i = 0; i < listOfPolymers.size(); i++) {
      if (listOfPolymers.get(i).isAnnotationHere()) {
        notation.append(listOfPolymers.get(i).getPolymerID() + "{" + listOfPolymers.get(i).toHELM2() + "}\""
            + listOfPolymers.get(i).getAnnotation() + "\"|");
      } else {
        notation.append(listOfPolymers.get(i).getPolymerID() + "{" + listOfPolymers.get(i).toHELM2() + "}" + "|");
      }
    }

    notation.setLength(notation.length() - 1);
    return notation.toString();
  }

public String polymerToHELM2 ( ) { StringBuilder notation = new StringBuilder ( ) ; for ( int i = 0 ; i < listOfPolymers . size ( ) ; i ++ ) { if ( listOfPolymers . get ( i ) . isAnnotationHere ( ) ) { notation . append ( listOfPolymers . get ( i ) . getPolymerID ( ) + "{" + listOfPolymers . get ( i ) . toHELM2 ( ) + "}\"" + listOfPolymers . get ( i ) . getAnnotation ( ) + "\"|" ) ; } else { notation . append ( listOfPolymers . get ( i ) . getPolymerID ( ) + "{" + listOfPolymers . get ( i ) . toHELM2 ( ) + "}" + "|" ) ; } } notation . setLength ( notation . length ( ) - 1 ) ; return notation . toString ( ) ; }

method to generate a valid HELM2 string for the first section

@return valid HELM2 string


public String connectionToHELM2() {
    if (listOfConnections.size() == 0) {
      return "";
    }
    StringBuilder notation = new StringBuilder();
    for (int i = 0; i < listOfConnections.size(); i++) {
      notation.append(listOfConnections.get(i).toHELM2() + "|");
    }

    notation.setLength(notation.length() - 1);
    return notation.toString();
  }

public String connectionToHELM2 ( ) { if ( listOfConnections . size ( ) == 0 ) { return "" ; } StringBuilder notation = new StringBuilder ( ) ; for ( int i = 0 ; i < listOfConnections . size ( ) ; i ++ ) { notation . append ( listOfConnections . get ( i ) . toHELM2 ( ) + "|" ) ; } notation . setLength ( notation . length ( ) - 1 ) ; return notation . toString ( ) ; }

method to generate a valid HELM2 string for the second section

@return valid HELM2 String


public String groupingToHELM2() {
    if (listOfGroupings.size() == 0) {
      return "";
    }
    StringBuilder notation = new StringBuilder();
    for (int i = 0; i < listOfGroupings.size(); i++) {
      notation.append(listOfGroupings.get(i).toHELM2() + "|");
    }

    notation.setLength(notation.length() - 1);
    return notation.toString();
  }

public String groupingToHELM2 ( ) { if ( listOfGroupings . size ( ) == 0 ) { return "" ; } StringBuilder notation = new StringBuilder ( ) ; for ( int i = 0 ; i < listOfGroupings . size ( ) ; i ++ ) { notation . append ( listOfGroupings . get ( i ) . toHELM2 ( ) + "|" ) ; } notation . setLength ( notation . length ( ) - 1 ) ; return notation . toString ( ) ; }

method to generate a valid HELM2 string for the third section

@return valid HELM2 String


public String annotationToHELM2() {
    if (!(annotationSection.isEmpty())) {
      StringBuilder sb = new StringBuilder();
      for (int i = 0; i < annotationSection.size(); i++) {
        sb.append(annotationSection.get(i).toHELM2() + "|");
      }

      sb.setLength(sb.length() - 1);
      return sb.toString();
    }
    return "";
  }

public String annotationToHELM2 ( ) { if ( ! ( annotationSection . isEmpty ( ) ) ) { StringBuilder sb = new StringBuilder ( ) ; for ( int i = 0 ; i < annotationSection . size ( ) ; i ++ ) { sb . append ( annotationSection . get ( i ) . toHELM2 ( ) + "|" ) ; } sb . setLength ( sb . length ( ) - 1 ) ; return sb . toString ( ) ; } return "" ; }

method to generate a valid HELM2 string for the fourth section

@return valid HELM2 String


@JsonIgnore
  public List<String> getPolymerAndGroupingIDs() {
    List<String> listOfIDs = new ArrayList<String>();
    for (PolymerNotation polymer : listOfPolymers) {
      listOfIDs.add(polymer.getPolymerID().getId());
    }

    for (GroupingNotation grouping : listOfGroupings) {
      listOfIDs.add(grouping.getGroupID().getId());
    }
    return listOfIDs;
  }

@ JsonIgnore public List < String > getPolymerAndGroupingIDs ( ) { List < String > listOfIDs = new ArrayList < String > ( ) ; for ( PolymerNotation polymer : listOfPolymers ) { listOfIDs . add ( polymer . getPolymerID ( ) . getId ( ) ) ; } for ( GroupingNotation grouping : listOfGroupings ) { listOfIDs . add ( grouping . getGroupID ( ) . getId ( ) ) ; } return listOfIDs ; }

method to get the ID's from all polymers and groups

@return List of all ids from all polymers and groups

method to get the ID s from all polymers and groups


@JsonIgnore
  public PolymerNotation getPolymerNotation(String id) {
    for (PolymerNotation polymer : listOfPolymers) {
      if (polymer.getPolymerID().getId().equals(id)) {
        return polymer;
      }
    }

    return null;
  }

@ JsonIgnore public PolymerNotation getPolymerNotation ( String id ) { for ( PolymerNotation polymer : listOfPolymers ) { if ( polymer . getPolymerID ( ) . getId ( ) . equals ( id ) ) { return polymer ; } } return null ; }

method to get a specific polymer by its id

@param id polymer id
@return polymer


private void setPolymerElements() {
    if (polymerID instanceof RNAEntity || polymerID instanceof PeptideEntity) {
      this.polymerElements = new PolymerListElements(polymerID);
    } else {
      this.polymerElements = new PolymerSingleElements(polymerID);
    }

  }

private void setPolymerElements ( ) { if ( polymerID instanceof RNAEntity || polymerID instanceof PeptideEntity ) { this . polymerElements = new PolymerListElements ( polymerID ) ; } else { this . polymerElements = new PolymerSingleElements ( polymerID ) ; } }

method to generate the right PolymerElements, in the case of Chem and Blob
only one Monomer is allowed

method to generate the right PolymerElements in the case of Chem and Blob only one Monomer is allowed


public String doConvert(String str) {

	//check for just missing V2.0

	  ParserHELM2 parser = new ParserHELM2();
	  try{
	  parser.parse(str + "V2.0");
	  return str + "V2.0";
	  }
	  catch(Exception e){

    /* Use String Builder */
    /* simple add character -> split works then */
    String helm1 = str + "f";

    StringBuilder helm2 = new StringBuilder();
    String[] sections = helm1.split("}\\$");

    /* Section 1 is accepted in full, no changes necessary, Section 1 has to be there */
    helm2.append(sections[0] + "}$");

    StringBuilder sb = new StringBuilder();
    for (int i = 1; i < sections.length; i++) {
      sb.append(sections[i] + "}$");
    }

    helm1 = "$" + sb.toString();
    sections = helm1.split("\\$");

     /*
     * Section 2 connection section; section 3 is added to the second section,
     * Section 2 is not necessary, is this section really there
     */
     if (sections.length >= 2) {
       if (!(sections[1].isEmpty())) {
        helm2.append(sections[1]);
       }
     }

     /* Add hydrogen bonds to the connection section */
     if (sections.length >= 3) {
       if (!(sections[2].isEmpty())) {

         if (!(sections[1].isEmpty())) {
          helm2.append("|" + sections[2]);
         } else {
          helm2.append(sections[2]);
         }
       }

       /*Group section*/
      helm2.append("$");

      helm2.append("$");

       /*Add annotation to the annotation section*/
       if (sections.length >= 4) {
         if (!(sections[3].isEmpty())) {
          helm2.append(sections[3]);
         }
       }

     }

    /* Add version number to indicate HELM2 notation */
    helm2.append("$V2.0");
    return helm2.toString();
	  }

  }

method to convert the given string into the HELM2 format

@param str HELM1 Notation
@return HELM2 Notation


public void setAnnotation(String str) {
    if (str != null) {
      annotation = str;
      isAnnotationHere = true;
    } else {
      annotation = null;
      isAnnotationHere = false;
    }
  }

public void setAnnotation ( String str ) { if ( str != null ) { annotation = str ; isAnnotationHere = true ; } else { annotation = null ; isAnnotationHere = false ; } }

method to add annotation to this monomer

@param str annotation


public void setCount(String str) {
    isDefault = false;
    if (str.equals("1")) {
      isDefault = true;
    }

    count = str;
  }

public void setCount ( String str ) { isDefault = false ; if ( str . equals ( "1" ) ) { isDefault = true ; } count = str ; }

method to change the default count of one to the user-defined

@param str user-defined count

method to change the default count of one to the user - defined


public static MonomerNotation decideWhichMonomerNotation(String str, String type)
			throws NotationException {
		MonomerNotation mon;
		/* group ? */
		if (str.startsWith("(") && str.endsWith(")")) {
			String str2 = str.substring(1, str.length() - 1);

			Pattern patternAND = Pattern.compile("\\+");
			Pattern patternOR = Pattern.compile(",");
			/* Mixture of elements */
			if (patternAND.matcher(str).find()) {
				mon = new MonomerNotationGroupMixture(str2, type);
			} /* or - groups */ else if (patternOR.matcher(str).find()) {
				mon = new MonomerNotationGroupOr(str2, type);
			} else {
				if (str.contains(".")) {
					mon = new MonomerNotationList(str2, type);
				} else {
					/* monomer unit is just in brackets */
					if (type == "RNA") {
						mon = new MonomerNotationUnitRNA(str2, type);
					} else {
						if (str2.length() > 1) {
							if (!(str2.startsWith("[") && str2.endsWith("]"))) {
								throw new NotationException("Monomers have to be in brackets: " + str);
							}
						}
						mon = new MonomerNotationUnit(str2, type);
					}
				}

			}
		} else {
			if (type == "RNA") {
				// if (str.startsWith("[") && str.endsWith("]")) {
				// mon = new MonomerNotationUnitRNA(str, type);
				// }
				mon = new MonomerNotationUnitRNA(str, type);
			} else if (type != "BLOB") {
				if (str.length() > 1) {
					if (!(str.startsWith("[") && str.endsWith("]"))) {
						throw new NotationException("Monomers have to be in brackets: " + str);
					}
				}
				mon = new MonomerNotationUnit(str, type);
			}
			else{
				mon = new MonomerNotationUnit(str, type);
			}

		}
		return mon;
	}

method to decide which of the MonomerNotation classes should be
initialized

@param str notation
@param type polymer type
@return MonomerNotation if monomer is not valid
@throws NotationException if notation is not valid


public static MonomerNotationGroupElement decideWhichMonomerNotationInGroup(String str, String type, double one,
			double two, boolean interval, boolean isDefault) throws NotationException{
		MonomerNotation element;

		element = decideWhichMonomerNotation(str, type);

		if (interval) {
			return new MonomerNotationGroupElement(element, one, two);
		} else {
			return new MonomerNotationGroupElement(element, one, isDefault);
		}
	}

public static MonomerNotationGroupElement decideWhichMonomerNotationInGroup ( String str , String type , double one , double two , boolean interval , boolean isDefault ) throws NotationException { MonomerNotation element ; element = decideWhichMonomerNotation ( str , type ) ; if ( interval ) { return new MonomerNotationGroupElement ( element , one , two ) ; } else { return new MonomerNotationGroupElement ( element , one , isDefault ) ; } }

method to decide which of the two Constructors of
MonomerNotationGroupElement should be called

@param str
Monomer
@param type
polymer type of monomer
@param one
count of Monomer
@param two
count of Monomer
@param interval
Has the monomer instead of one count an interval
@param isDefault
Is the count of the monomer default = 1
@return MonomerNotationGroupElement
@throws NotationException if notation is not valid