code
stringlengths
10
174k
nl
stringlengths
3
129k
public PunctuationTrie<T> lookup(CharSequence s){ PunctuationTrie<T> t=this; for (int i=0, n=s.length(); i < n; ++i) { t=t.lookup(s.charAt(i)); if (null == t) { break; } } return t; }
The descendant of this trie corresponding to the string for this trie appended with s.
public void endConfigure(){ int newInterval=((Integer)intervalSpinner.getValue()).intValue(); myOp.setInterval(newInterval); int newMaxTries=((Integer)maxTriesSpinner.getValue()).intValue(); myOp.setMaxTries(newMaxTries); }
called when OK button pressed in config panel, to retrieve and set new values
public boolean isClosed(){ return journalWriter == null; }
Returns true if this cache has been closed.
public boolean isAvailableScope(@NotNull State scope){ return scopes.contains(scope); }
Validates an ability to show current tab for a given scope.
public static DuplicateEventException convertToApi(org.oscm.internal.types.exception.DuplicateEventException oldEx){ return convertExceptionToApi(oldEx,DuplicateEventException.class); }
Convert source version Exception to target version Exception
public boolean isAllowDecimals(){ return this.allowDecimals; }
Return whether decimals are allowed in the number.
public JSONException syntaxError(String message){ return new JSONException(message + toString()); }
Make a JSONException to signal a syntax error.
public void initializePackageContents(){ if (isInitialized) return; isInitialized=true; setName(eNAME); setNsPrefix(eNS_PREFIX); setNsURI(eNS_URI); standaloneBlockEClass.getESuperTypes().add(this.getEntry()); stringEvaluatorEClass.getESuperTypes().add(this.getEntry()); modelEClass.getESuperTypes().add(this.getEntry()); modelEClass.getESuperTypes().add(this.getVarDefinition()); importEClass.getESuperTypes().add(this.getVarDefinition()); s_GlobalEClass.getESuperTypes().add(this.getStatement()); s_SpeciesEClass.getESuperTypes().add(this.getStatement()); s_SpeciesEClass.getESuperTypes().add(this.getS_Declaration()); s_SpeciesEClass.getESuperTypes().add(this.getTypeDefinition()); s_ExperimentEClass.getESuperTypes().add(this.getStatement()); s_ExperimentEClass.getESuperTypes().add(this.getVarDefinition()); s_DoEClass.getESuperTypes().add(this.getStatement()); s_LoopEClass.getESuperTypes().add(this.getS_Declaration()); s_IfEClass.getESuperTypes().add(this.getStatement()); s_OtherEClass.getESuperTypes().add(this.getStatement()); s_ReturnEClass.getESuperTypes().add(this.getStatement()); s_DeclarationEClass.getESuperTypes().add(this.getStatement()); s_DeclarationEClass.getESuperTypes().add(this.getVarDefinition()); s_ReflexEClass.getESuperTypes().add(this.getS_Declaration()); s_DefinitionEClass.getESuperTypes().add(this.getS_Declaration()); s_DefinitionEClass.getESuperTypes().add(this.getActionDefinition()); s_AssignmentEClass.getESuperTypes().add(this.getStatement()); s_DirectAssignmentEClass.getESuperTypes().add(this.getS_Assignment()); s_SetEClass.getESuperTypes().add(this.getS_Assignment()); s_EquationsEClass.getESuperTypes().add(this.getStatement()); s_EquationsEClass.getESuperTypes().add(this.getEquationDefinition()); s_SolveEClass.getESuperTypes().add(this.getStatement()); s_DisplayEClass.getESuperTypes().add(this.getStatement()); speciesOrGridDisplayStatementEClass.getESuperTypes().add(this.getStatement()); parametersEClass.getESuperTypes().add(this.getExpression()); argumentDefinitionEClass.getESuperTypes().add(this.getVarDefinition()); facetEClass.getESuperTypes().add(this.getVarDefinition()); argumentPairEClass.getESuperTypes().add(this.getExpression()); functionEClass.getESuperTypes().add(this.getExpression()); expressionListEClass.getESuperTypes().add(this.getExpression()); variableRefEClass.getESuperTypes().add(this.getExpression()); equationDefinitionEClass.getESuperTypes().add(this.getGamlDefinition()); typeDefinitionEClass.getESuperTypes().add(this.getGamlDefinition()); typeDefinitionEClass.getESuperTypes().add(this.getActionDefinition()); varDefinitionEClass.getESuperTypes().add(this.getGamlDefinition()); actionDefinitionEClass.getESuperTypes().add(this.getGamlDefinition()); unitFakeDefinitionEClass.getESuperTypes().add(this.getGamlDefinition()); typeFakeDefinitionEClass.getESuperTypes().add(this.getTypeDefinition()); actionFakeDefinitionEClass.getESuperTypes().add(this.getActionDefinition()); skillFakeDefinitionEClass.getESuperTypes().add(this.getGamlDefinition()); varFakeDefinitionEClass.getESuperTypes().add(this.getVarDefinition()); equationFakeDefinitionEClass.getESuperTypes().add(this.getEquationDefinition()); terminalExpressionEClass.getESuperTypes().add(this.getExpression()); s_ActionEClass.getESuperTypes().add(this.getS_Definition()); s_VarEClass.getESuperTypes().add(this.getS_Definition()); pairEClass.getESuperTypes().add(this.getExpression()); ifEClass.getESuperTypes().add(this.getExpression()); castEClass.getESuperTypes().add(this.getExpression()); binaryEClass.getESuperTypes().add(this.getExpression()); unitEClass.getESuperTypes().add(this.getExpression()); unaryEClass.getESuperTypes().add(this.getExpression()); accessEClass.getESuperTypes().add(this.getExpression()); arrayEClass.getESuperTypes().add(this.getExpression()); pointEClass.getESuperTypes().add(this.getExpression()); parameterEClass.getESuperTypes().add(this.getExpression()); unitNameEClass.getESuperTypes().add(this.getExpression()); typeRefEClass.getESuperTypes().add(this.getExpression()); skillRefEClass.getESuperTypes().add(this.getExpression()); actionRefEClass.getESuperTypes().add(this.getExpression()); equationRefEClass.getESuperTypes().add(this.getExpression()); intLiteralEClass.getESuperTypes().add(this.getTerminalExpression()); doubleLiteralEClass.getESuperTypes().add(this.getTerminalExpression()); colorLiteralEClass.getESuperTypes().add(this.getTerminalExpression()); stringLiteralEClass.getESuperTypes().add(this.getTerminalExpression()); booleanLiteralEClass.getESuperTypes().add(this.getTerminalExpression()); reservedLiteralEClass.getESuperTypes().add(this.getTerminalExpression()); initEClass(entryEClass,Entry.class,"Entry",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEClass(standaloneBlockEClass,StandaloneBlock.class,"StandaloneBlock",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEReference(getStandaloneBlock_Block(),this.getBlock(),null,"block",null,0,1,StandaloneBlock.class,!IS_TRANSIENT,!IS_VOLATILE,IS_CHANGEABLE,IS_COMPOSITE,!IS_RESOLVE_PROXIES,!IS_UNSETTABLE,IS_UNIQUE,!IS_DERIVED,IS_ORDERED); initEClass(stringEvaluatorEClass,StringEvaluator.class,"StringEvaluator",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEAttribute(getStringEvaluator_Toto(),ecorePackage.getEString(),"toto",null,0,1,StringEvaluator.class,!IS_TRANSIENT,!IS_VOLATILE,IS_CHANGEABLE,!IS_UNSETTABLE,!IS_ID,IS_UNIQUE,!IS_DERIVED,IS_ORDERED); initEReference(getStringEvaluator_Expr(),this.getExpression(),null,"expr",null,0,1,StringEvaluator.class,!IS_TRANSIENT,!IS_VOLATILE,IS_CHANGEABLE,IS_COMPOSITE,!IS_RESOLVE_PROXIES,!IS_UNSETTABLE,IS_UNIQUE,!IS_DERIVED,IS_ORDERED); initEClass(modelEClass,Model.class,"Model",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEReference(getModel_Pragmas(),this.getPragma(),null,"pragmas",null,0,-1,Model.class,!IS_TRANSIENT,!IS_VOLATILE,IS_CHANGEABLE,IS_COMPOSITE,!IS_RESOLVE_PROXIES,!IS_UNSETTABLE,IS_UNIQUE,!IS_DERIVED,IS_ORDERED); initEReference(getModel_Imports(),this.getImport(),null,"imports",null,0,-1,Model.class,!IS_TRANSIENT,!IS_VOLATILE,IS_CHANGEABLE,IS_COMPOSITE,!IS_RESOLVE_PROXIES,!IS_UNSETTABLE,IS_UNIQUE,!IS_DERIVED,IS_ORDERED); initEReference(getModel_Block(),this.getBlock(),null,"block",null,0,1,Model.class,!IS_TRANSIENT,!IS_VOLATILE,IS_CHANGEABLE,IS_COMPOSITE,!IS_RESOLVE_PROXIES,!IS_UNSETTABLE,IS_UNIQUE,!IS_DERIVED,IS_ORDERED); initEClass(blockEClass,Block.class,"Block",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEReference(getBlock_Statements(),this.getStatement(),null,"statements",null,0,-1,Block.class,!IS_TRANSIENT,!IS_VOLATILE,IS_CHANGEABLE,IS_COMPOSITE,!IS_RESOLVE_PROXIES,!IS_UNSETTABLE,IS_UNIQUE,!IS_DERIVED,IS_ORDERED); initEReference(getBlock_Function(),this.getExpression(),null,"function",null,0,1,Block.class,!IS_TRANSIENT,!IS_VOLATILE,IS_CHANGEABLE,IS_COMPOSITE,!IS_RESOLVE_PROXIES,!IS_UNSETTABLE,IS_UNIQUE,!IS_DERIVED,IS_ORDERED); initEClass(importEClass,Import.class,"Import",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEAttribute(getImport_ImportURI(),ecorePackage.getEString(),"importURI",null,0,1,Import.class,!IS_TRANSIENT,!IS_VOLATILE,IS_CHANGEABLE,!IS_UNSETTABLE,!IS_ID,IS_UNIQUE,!IS_DERIVED,IS_ORDERED); initEClass(pragmaEClass,Pragma.class,"Pragma",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEAttribute(getPragma_Name(),ecorePackage.getEString(),"name",null,0,1,Pragma.class,!IS_TRANSIENT,!IS_VOLATILE,IS_CHANGEABLE,!IS_UNSETTABLE,!IS_ID,IS_UNIQUE,!IS_DERIVED,IS_ORDERED); initEClass(statementEClass,Statement.class,"Statement",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEAttribute(getStatement_Key(),ecorePackage.getEString(),"key",null,0,1,Statement.class,!IS_TRANSIENT,!IS_VOLATILE,IS_CHANGEABLE,!IS_UNSETTABLE,!IS_ID,IS_UNIQUE,!IS_DERIVED,IS_ORDERED); initEAttribute(getStatement_FirstFacet(),ecorePackage.getEString(),"firstFacet",null,0,1,Statement.class,!IS_TRANSIENT,!IS_VOLATILE,IS_CHANGEABLE,!IS_UNSETTABLE,!IS_ID,IS_UNIQUE,!IS_DERIVED,IS_ORDERED); initEReference(getStatement_Expr(),this.getExpression(),null,"expr",null,0,1,Statement.class,!IS_TRANSIENT,!IS_VOLATILE,IS_CHANGEABLE,IS_COMPOSITE,!IS_RESOLVE_PROXIES,!IS_UNSETTABLE,IS_UNIQUE,!IS_DERIVED,IS_ORDERED); initEReference(getStatement_Facets(),this.getFacet(),null,"facets",null,0,-1,Statement.class,!IS_TRANSIENT,!IS_VOLATILE,IS_CHANGEABLE,IS_COMPOSITE,!IS_RESOLVE_PROXIES,!IS_UNSETTABLE,IS_UNIQUE,!IS_DERIVED,IS_ORDERED); initEReference(getStatement_Block(),this.getBlock(),null,"block",null,0,1,Statement.class,!IS_TRANSIENT,!IS_VOLATILE,IS_CHANGEABLE,IS_COMPOSITE,!IS_RESOLVE_PROXIES,!IS_UNSETTABLE,IS_UNIQUE,!IS_DERIVED,IS_ORDERED); initEClass(s_GlobalEClass,S_Global.class,"S_Global",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEClass(s_SpeciesEClass,S_Species.class,"S_Species",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEClass(s_ExperimentEClass,S_Experiment.class,"S_Experiment",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEClass(s_DoEClass,S_Do.class,"S_Do",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEClass(s_LoopEClass,S_Loop.class,"S_Loop",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEClass(s_IfEClass,S_If.class,"S_If",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEReference(getS_If_Else(),ecorePackage.getEObject(),null,"else",null,0,1,S_If.class,!IS_TRANSIENT,!IS_VOLATILE,IS_CHANGEABLE,IS_COMPOSITE,!IS_RESOLVE_PROXIES,!IS_UNSETTABLE,IS_UNIQUE,!IS_DERIVED,IS_ORDERED); initEClass(s_OtherEClass,S_Other.class,"S_Other",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEClass(s_ReturnEClass,S_Return.class,"S_Return",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEClass(s_DeclarationEClass,S_Declaration.class,"S_Declaration",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEClass(s_ReflexEClass,S_Reflex.class,"S_Reflex",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEClass(s_DefinitionEClass,S_Definition.class,"S_Definition",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEReference(getS_Definition_Tkey(),this.getExpression(),null,"tkey",null,0,1,S_Definition.class,!IS_TRANSIENT,!IS_VOLATILE,IS_CHANGEABLE,IS_COMPOSITE,!IS_RESOLVE_PROXIES,!IS_UNSETTABLE,IS_UNIQUE,!IS_DERIVED,IS_ORDERED); initEReference(getS_Definition_Args(),this.getActionArguments(),null,"args",null,0,1,S_Definition.class,!IS_TRANSIENT,!IS_VOLATILE,IS_CHANGEABLE,IS_COMPOSITE,!IS_RESOLVE_PROXIES,!IS_UNSETTABLE,IS_UNIQUE,!IS_DERIVED,IS_ORDERED); initEClass(s_AssignmentEClass,S_Assignment.class,"S_Assignment",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEReference(getS_Assignment_Value(),this.getExpression(),null,"value",null,0,1,S_Assignment.class,!IS_TRANSIENT,!IS_VOLATILE,IS_CHANGEABLE,IS_COMPOSITE,!IS_RESOLVE_PROXIES,!IS_UNSETTABLE,IS_UNIQUE,!IS_DERIVED,IS_ORDERED); initEClass(s_DirectAssignmentEClass,S_DirectAssignment.class,"S_DirectAssignment",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEClass(s_SetEClass,S_Set.class,"S_Set",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEClass(s_EquationsEClass,S_Equations.class,"S_Equations",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEReference(getS_Equations_Equations(),this.getS_Assignment(),null,"equations",null,0,-1,S_Equations.class,!IS_TRANSIENT,!IS_VOLATILE,IS_CHANGEABLE,IS_COMPOSITE,!IS_RESOLVE_PROXIES,!IS_UNSETTABLE,IS_UNIQUE,!IS_DERIVED,IS_ORDERED); initEClass(s_SolveEClass,S_Solve.class,"S_Solve",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEClass(s_DisplayEClass,S_Display.class,"S_Display",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEAttribute(getS_Display_Name(),ecorePackage.getEString(),"name",null,0,1,S_Display.class,!IS_TRANSIENT,!IS_VOLATILE,IS_CHANGEABLE,!IS_UNSETTABLE,!IS_ID,IS_UNIQUE,!IS_DERIVED,IS_ORDERED); initEClass(speciesOrGridDisplayStatementEClass,speciesOrGridDisplayStatement.class,"speciesOrGridDisplayStatement",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEClass(parametersEClass,Parameters.class,"Parameters",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEReference(getParameters_Params(),this.getExpressionList(),null,"params",null,0,1,Parameters.class,!IS_TRANSIENT,!IS_VOLATILE,IS_CHANGEABLE,IS_COMPOSITE,!IS_RESOLVE_PROXIES,!IS_UNSETTABLE,IS_UNIQUE,!IS_DERIVED,IS_ORDERED); initEClass(actionArgumentsEClass,ActionArguments.class,"ActionArguments",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEReference(getActionArguments_Args(),this.getArgumentDefinition(),null,"args",null,0,-1,ActionArguments.class,!IS_TRANSIENT,!IS_VOLATILE,IS_CHANGEABLE,IS_COMPOSITE,!IS_RESOLVE_PROXIES,!IS_UNSETTABLE,IS_UNIQUE,!IS_DERIVED,IS_ORDERED); initEClass(argumentDefinitionEClass,ArgumentDefinition.class,"ArgumentDefinition",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEReference(getArgumentDefinition_Type(),this.getExpression(),null,"type",null,0,1,ArgumentDefinition.class,!IS_TRANSIENT,!IS_VOLATILE,IS_CHANGEABLE,IS_COMPOSITE,!IS_RESOLVE_PROXIES,!IS_UNSETTABLE,IS_UNIQUE,!IS_DERIVED,IS_ORDERED); initEReference(getArgumentDefinition_Default(),this.getExpression(),null,"default",null,0,1,ArgumentDefinition.class,!IS_TRANSIENT,!IS_VOLATILE,IS_CHANGEABLE,IS_COMPOSITE,!IS_RESOLVE_PROXIES,!IS_UNSETTABLE,IS_UNIQUE,!IS_DERIVED,IS_ORDERED); initEClass(facetEClass,Facet.class,"Facet",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEAttribute(getFacet_Key(),ecorePackage.getEString(),"key",null,0,1,Facet.class,!IS_TRANSIENT,!IS_VOLATILE,IS_CHANGEABLE,!IS_UNSETTABLE,!IS_ID,IS_UNIQUE,!IS_DERIVED,IS_ORDERED); initEReference(getFacet_Expr(),this.getExpression(),null,"expr",null,0,1,Facet.class,!IS_TRANSIENT,!IS_VOLATILE,IS_CHANGEABLE,IS_COMPOSITE,!IS_RESOLVE_PROXIES,!IS_UNSETTABLE,IS_UNIQUE,!IS_DERIVED,IS_ORDERED); initEReference(getFacet_Block(),this.getBlock(),null,"block",null,0,1,Facet.class,!IS_TRANSIENT,!IS_VOLATILE,IS_CHANGEABLE,IS_COMPOSITE,!IS_RESOLVE_PROXIES,!IS_UNSETTABLE,IS_UNIQUE,!IS_DERIVED,IS_ORDERED); initEClass(expressionEClass,Expression.class,"Expression",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEReference(getExpression_Left(),this.getExpression(),null,"left",null,0,1,Expression.class,!IS_TRANSIENT,!IS_VOLATILE,IS_CHANGEABLE,IS_COMPOSITE,!IS_RESOLVE_PROXIES,!IS_UNSETTABLE,IS_UNIQUE,!IS_DERIVED,IS_ORDERED); initEAttribute(getExpression_Op(),ecorePackage.getEString(),"op",null,0,1,Expression.class,!IS_TRANSIENT,!IS_VOLATILE,IS_CHANGEABLE,!IS_UNSETTABLE,!IS_ID,IS_UNIQUE,!IS_DERIVED,IS_ORDERED); initEReference(getExpression_Right(),this.getExpression(),null,"right",null,0,1,Expression.class,!IS_TRANSIENT,!IS_VOLATILE,IS_CHANGEABLE,IS_COMPOSITE,!IS_RESOLVE_PROXIES,!IS_UNSETTABLE,IS_UNIQUE,!IS_DERIVED,IS_ORDERED); initEClass(argumentPairEClass,ArgumentPair.class,"ArgumentPair",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEClass(functionEClass,Function.class,"Function",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEReference(getFunction_Action(),this.getExpression(),null,"action",null,0,1,Function.class,!IS_TRANSIENT,!IS_VOLATILE,IS_CHANGEABLE,IS_COMPOSITE,!IS_RESOLVE_PROXIES,!IS_UNSETTABLE,IS_UNIQUE,!IS_DERIVED,IS_ORDERED); initEReference(getFunction_Parameters(),this.getParameters(),null,"parameters",null,0,1,Function.class,!IS_TRANSIENT,!IS_VOLATILE,IS_CHANGEABLE,IS_COMPOSITE,!IS_RESOLVE_PROXIES,!IS_UNSETTABLE,IS_UNIQUE,!IS_DERIVED,IS_ORDERED); initEReference(getFunction_Args(),this.getExpressionList(),null,"args",null,0,1,Function.class,!IS_TRANSIENT,!IS_VOLATILE,IS_CHANGEABLE,IS_COMPOSITE,!IS_RESOLVE_PROXIES,!IS_UNSETTABLE,IS_UNIQUE,!IS_DERIVED,IS_ORDERED); initEReference(getFunction_Type(),this.getTypeInfo(),null,"type",null,0,1,Function.class,!IS_TRANSIENT,!IS_VOLATILE,IS_CHANGEABLE,IS_COMPOSITE,!IS_RESOLVE_PROXIES,!IS_UNSETTABLE,IS_UNIQUE,!IS_DERIVED,IS_ORDERED); initEClass(expressionListEClass,ExpressionList.class,"ExpressionList",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEReference(getExpressionList_Exprs(),this.getExpression(),null,"exprs",null,0,-1,ExpressionList.class,!IS_TRANSIENT,!IS_VOLATILE,IS_CHANGEABLE,IS_COMPOSITE,!IS_RESOLVE_PROXIES,!IS_UNSETTABLE,IS_UNIQUE,!IS_DERIVED,IS_ORDERED); initEClass(variableRefEClass,VariableRef.class,"VariableRef",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEReference(getVariableRef_Ref(),this.getVarDefinition(),null,"ref",null,0,1,VariableRef.class,!IS_TRANSIENT,!IS_VOLATILE,IS_CHANGEABLE,!IS_COMPOSITE,IS_RESOLVE_PROXIES,!IS_UNSETTABLE,IS_UNIQUE,!IS_DERIVED,IS_ORDERED); initEClass(typeInfoEClass,TypeInfo.class,"TypeInfo",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEReference(getTypeInfo_First(),this.getExpression(),null,"first",null,0,1,TypeInfo.class,!IS_TRANSIENT,!IS_VOLATILE,IS_CHANGEABLE,IS_COMPOSITE,!IS_RESOLVE_PROXIES,!IS_UNSETTABLE,IS_UNIQUE,!IS_DERIVED,IS_ORDERED); initEReference(getTypeInfo_Second(),this.getExpression(),null,"second",null,0,1,TypeInfo.class,!IS_TRANSIENT,!IS_VOLATILE,IS_CHANGEABLE,IS_COMPOSITE,!IS_RESOLVE_PROXIES,!IS_UNSETTABLE,IS_UNIQUE,!IS_DERIVED,IS_ORDERED); initEClass(gamlDefinitionEClass,GamlDefinition.class,"GamlDefinition",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEAttribute(getGamlDefinition_Name(),ecorePackage.getEString(),"name",null,0,1,GamlDefinition.class,!IS_TRANSIENT,!IS_VOLATILE,IS_CHANGEABLE,!IS_UNSETTABLE,!IS_ID,IS_UNIQUE,!IS_DERIVED,IS_ORDERED); initEClass(equationDefinitionEClass,EquationDefinition.class,"EquationDefinition",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEClass(typeDefinitionEClass,TypeDefinition.class,"TypeDefinition",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEClass(varDefinitionEClass,VarDefinition.class,"VarDefinition",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEClass(actionDefinitionEClass,ActionDefinition.class,"ActionDefinition",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEClass(unitFakeDefinitionEClass,UnitFakeDefinition.class,"UnitFakeDefinition",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEClass(typeFakeDefinitionEClass,TypeFakeDefinition.class,"TypeFakeDefinition",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEClass(actionFakeDefinitionEClass,ActionFakeDefinition.class,"ActionFakeDefinition",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEClass(skillFakeDefinitionEClass,SkillFakeDefinition.class,"SkillFakeDefinition",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEClass(varFakeDefinitionEClass,VarFakeDefinition.class,"VarFakeDefinition",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEClass(equationFakeDefinitionEClass,EquationFakeDefinition.class,"EquationFakeDefinition",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEClass(terminalExpressionEClass,TerminalExpression.class,"TerminalExpression",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEClass(s_ActionEClass,S_Action.class,"S_Action",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEClass(s_VarEClass,S_Var.class,"S_Var",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEClass(pairEClass,Pair.class,"Pair",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEClass(ifEClass,If.class,"If",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEReference(getIf_IfFalse(),this.getExpression(),null,"ifFalse",null,0,1,If.class,!IS_TRANSIENT,!IS_VOLATILE,IS_CHANGEABLE,IS_COMPOSITE,!IS_RESOLVE_PROXIES,!IS_UNSETTABLE,IS_UNIQUE,!IS_DERIVED,IS_ORDERED); initEClass(castEClass,Cast.class,"Cast",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEClass(binaryEClass,Binary.class,"Binary",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEClass(unitEClass,Unit.class,"Unit",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEClass(unaryEClass,Unary.class,"Unary",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEClass(accessEClass,Access.class,"Access",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEReference(getAccess_Args(),this.getExpressionList(),null,"args",null,0,1,Access.class,!IS_TRANSIENT,!IS_VOLATILE,IS_CHANGEABLE,IS_COMPOSITE,!IS_RESOLVE_PROXIES,!IS_UNSETTABLE,IS_UNIQUE,!IS_DERIVED,IS_ORDERED); initEAttribute(getAccess_Named_exp(),ecorePackage.getEString(),"named_exp",null,0,1,Access.class,!IS_TRANSIENT,!IS_VOLATILE,IS_CHANGEABLE,!IS_UNSETTABLE,!IS_ID,IS_UNIQUE,!IS_DERIVED,IS_ORDERED); initEClass(arrayEClass,Array.class,"Array",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEReference(getArray_Exprs(),this.getExpressionList(),null,"exprs",null,0,1,Array.class,!IS_TRANSIENT,!IS_VOLATILE,IS_CHANGEABLE,IS_COMPOSITE,!IS_RESOLVE_PROXIES,!IS_UNSETTABLE,IS_UNIQUE,!IS_DERIVED,IS_ORDERED); initEClass(pointEClass,Point.class,"Point",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEReference(getPoint_Z(),this.getExpression(),null,"z",null,0,1,Point.class,!IS_TRANSIENT,!IS_VOLATILE,IS_CHANGEABLE,IS_COMPOSITE,!IS_RESOLVE_PROXIES,!IS_UNSETTABLE,IS_UNIQUE,!IS_DERIVED,IS_ORDERED); initEClass(parameterEClass,Parameter.class,"Parameter",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEAttribute(getParameter_BuiltInFacetKey(),ecorePackage.getEString(),"builtInFacetKey",null,0,1,Parameter.class,!IS_TRANSIENT,!IS_VOLATILE,IS_CHANGEABLE,!IS_UNSETTABLE,!IS_ID,IS_UNIQUE,!IS_DERIVED,IS_ORDERED); initEClass(unitNameEClass,UnitName.class,"UnitName",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEReference(getUnitName_Ref(),this.getUnitFakeDefinition(),null,"ref",null,0,1,UnitName.class,!IS_TRANSIENT,!IS_VOLATILE,IS_CHANGEABLE,!IS_COMPOSITE,IS_RESOLVE_PROXIES,!IS_UNSETTABLE,IS_UNIQUE,!IS_DERIVED,IS_ORDERED); initEClass(typeRefEClass,TypeRef.class,"TypeRef",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEReference(getTypeRef_Ref(),this.getTypeDefinition(),null,"ref",null,0,1,TypeRef.class,!IS_TRANSIENT,!IS_VOLATILE,IS_CHANGEABLE,!IS_COMPOSITE,IS_RESOLVE_PROXIES,!IS_UNSETTABLE,IS_UNIQUE,!IS_DERIVED,IS_ORDERED); initEReference(getTypeRef_Parameter(),this.getTypeInfo(),null,"parameter",null,0,1,TypeRef.class,!IS_TRANSIENT,!IS_VOLATILE,IS_CHANGEABLE,IS_COMPOSITE,!IS_RESOLVE_PROXIES,!IS_UNSETTABLE,IS_UNIQUE,!IS_DERIVED,IS_ORDERED); initEClass(skillRefEClass,SkillRef.class,"SkillRef",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEReference(getSkillRef_Ref(),this.getSkillFakeDefinition(),null,"ref",null,0,1,SkillRef.class,!IS_TRANSIENT,!IS_VOLATILE,IS_CHANGEABLE,!IS_COMPOSITE,IS_RESOLVE_PROXIES,!IS_UNSETTABLE,IS_UNIQUE,!IS_DERIVED,IS_ORDERED); initEClass(actionRefEClass,ActionRef.class,"ActionRef",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEReference(getActionRef_Ref(),this.getActionDefinition(),null,"ref",null,0,1,ActionRef.class,!IS_TRANSIENT,!IS_VOLATILE,IS_CHANGEABLE,!IS_COMPOSITE,IS_RESOLVE_PROXIES,!IS_UNSETTABLE,IS_UNIQUE,!IS_DERIVED,IS_ORDERED); initEClass(equationRefEClass,EquationRef.class,"EquationRef",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEReference(getEquationRef_Ref(),this.getEquationDefinition(),null,"ref",null,0,1,EquationRef.class,!IS_TRANSIENT,!IS_VOLATILE,IS_CHANGEABLE,!IS_COMPOSITE,IS_RESOLVE_PROXIES,!IS_UNSETTABLE,IS_UNIQUE,!IS_DERIVED,IS_ORDERED); initEClass(intLiteralEClass,IntLiteral.class,"IntLiteral",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEClass(doubleLiteralEClass,DoubleLiteral.class,"DoubleLiteral",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEClass(colorLiteralEClass,ColorLiteral.class,"ColorLiteral",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEClass(stringLiteralEClass,StringLiteral.class,"StringLiteral",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEClass(booleanLiteralEClass,BooleanLiteral.class,"BooleanLiteral",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEClass(reservedLiteralEClass,ReservedLiteral.class,"ReservedLiteral",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); createResource(eNS_URI); }
Complete the initialization of the package and its meta-model. This method is guarded to have no affect on any invocation but its first. <!-- begin-user-doc --> <!-- end-user-doc -->
@Override public void skippedEntity(String str) throws SAXException { }
This method does nothing.
@LargeTest public void testThumbnailForH264QCIF() throws Exception { final String videoItemFilename=INPUT_FILE_PATH + "H264_BP_176x144_15fps_144kbps_AMRNB_8kHz_12.2kbps_m_1_17.3gp"; final int atTime=0; final int renderingMode=MediaItem.RENDERING_MODE_BLACK_BORDER; final MediaVideoItem mediaVideoItem=mVideoEditorHelper.createMediaItem(mVideoEditor,"m1",videoItemFilename,renderingMode); final int outWidth=mediaVideoItem.getWidth() * 2; final int outHeight=mediaVideoItem.getHeight() * 2; final Bitmap thumbNailBmp=mediaVideoItem.getThumbnail(outWidth,outHeight,atTime); validateThumbnail(thumbNailBmp,outWidth,outHeight); }
To test thumbnail / frame extraction on H264 QCIF.
public void initialize(Supplier<DataSource<CloseableReference<CloseableImage>>> dataSourceSupplier,String id,CacheKey cacheKey,Object callerContext){ super.initialize(id,callerContext); init(dataSourceSupplier); mCacheKey=cacheKey; }
Initializes this controller with the new data source supplier, id and caller context. This allows for reusing of the existing controller instead of instantiating a new one. This method should be called when the controller is in detached state.
private void checkCompletion(){ for (Iterator<ComputeTaskFuture<Integer>> iter=futures.iterator(); iter.hasNext(); ) { ComputeTaskFuture<Integer> fut=iter.next(); if (fut.isDone()) { try { Integer res=fut.get(); assert res == params.getJobsCount() : "Task returned wrong result [taskIs=" + fut.getTaskSession().getId() + ", result="+ res+ "]"; ignite.log().info(">>> Task completed successfully. Task id: " + fut.getTaskSession().getId()); } catch ( IgniteFutureCancelledException ignored) { ignite.log().info(">>> Task cancelled: " + fut.getTaskSession().getId()); } catch ( IgniteException e) { ignite.log().warning(">>> Get operation for completed task failed: " + fut.getTaskSession().getId(),e); } finally { iter.remove(); } } } }
Finds completed tasks in the queue and removes them.
@Override public Xid[] recover(int flag) throws XAException { debugCodeCall("recover",quoteFlags(flag)); checkOpen(); try (Statement stat=physicalConn.createStatement()){ ResultSet rs=stat.executeQuery("SELECT * FROM " + "INFORMATION_SCHEMA.IN_DOUBT ORDER BY TRANSACTION"); ArrayList<Xid> list=New.arrayList(); while (rs.next()) { String tid=rs.getString("TRANSACTION"); int id=getNextId(XID); Xid xid=new JdbcXid(factory,id,tid); list.add(xid); } rs.close(); Xid[] result=new Xid[list.size()]; list.toArray(result); if (list.size() > 0) { prepared=true; } return result; } catch ( SQLException e) { XAException xa=new XAException(XAException.XAER_RMERR); xa.initCause(e); throw xa; } }
Get the list of prepared transaction branches. This method is called by the transaction manager during recovery.
public void writeBitsLossless(int id,int format,int width,int height,Color[] colors,byte[] imageData,boolean hasAlpha) throws IOException { startTag(hasAlpha ? TAG_DEFINEBITSLOSSLESS2 : TAG_DEFINEBITSLOSSLESS,id,true); out.writeUI8(format); out.writeUI16(width); out.writeUI16(height); switch (format) { case BITMAP_FORMAT_8_BIT: out.writeUI8(colors.length - 1); break; case BITMAP_FORMAT_16_BIT: out.writeUI16(colors.length - 1); break; case BITMAP_FORMAT_32_BIT: break; default : throw new IOException("unknown bitmap format: " + format); } DeflaterOutputStream deflater=new DeflaterOutputStream(bytes); OutStream zipOut=new OutStream(deflater); if (format == BITMAP_FORMAT_8_BIT || format == BITMAP_FORMAT_16_BIT) { for (int i=0; i < colors.length; i++) { if (hasAlpha) { colors[i].writeWithAlpha(zipOut); } else { colors[i].writeRGB(zipOut); } } } zipOut.write(imageData); zipOut.flush(); deflater.finish(); completeTag(); }
Description of the Method
public CharArrayList(final Iterator<? extends Character> i){ this(); while (i.hasNext()) this.add(i.next()); }
Creates a new array list and fills it with the elements returned by an iterator..
public boolean hasValue(){ return getValue() != null; }
Returns whether it has the value.
public static double bitand(double left,double right){ return (int)left & (int)right; }
bitand operation
public static boolean isUnixSocketUri(@NotNull URI uri){ Objects.requireNonNull(uri,"Required non-null uri"); return UNIX_SOCKET_SCHEME.equals(uri.getScheme()); }
Tests URI to check if it is URI of UNIX socket
public Projectron(KernelTrick k){ this(k,0.1); }
Creates a new Projectron++ learner
public static void doOperations(){ try { region.create(CREATE_KEY,CREATE_VALUE); region.put(UPDATE_KEY,UPDATE_VALUE2); region.invalidate(INVALIDATE_KEY); region.destroy(DESTROY_KEY); Map map=new HashMap(); map.put(PUTALL_KEY,PUTALL_VALUE); map.put(PUTALL_KEY2,PUTALL_VALUE2); region.putAll(map); } catch ( Exception e) { Assert.fail(" Test failed due to " + e,e); } }
do the operations which you want to propagate
private void updateImage(ArtworkEntry artworkEntry){ if (artworkEntry.getArtworkLocation().equals(mArtworkEntry.getArtworkLocation())) { return; } if (mIsLoading) { mNewArtworkEntry=artworkEntry; } else { mArtworkEntry=artworkEntry; loadImage(); } }
Loads a new artwork
private void addJsonForEntryInfos(StringBuilder result,ArrayList<EntryInfo> entryInfoList,String paneId){ result.append("{\n"); boolean addedOneAlready=false; for ( final EntryInfo entryInfo : entryInfoList) { if (addedOneAlready) { result.append(",\n"); } addedOneAlready=true; result.append(JsonBuilder.quote((paneId != null ? paneId + ":" : "") + entryInfo.id)); result.append(":"); result.append("[" + JsonBuilder.quote(entryInfo.note) + ", "+ JsonBuilder.quote(entryInfo.quotation)+ ", "+ entryInfo.isPublic+ ", "+ entryInfo.hasChildren+ ", \""+ entryInfo.type+ "\", "+ entryInfo.hasParent+ "]"); } result.append("\n}"); }
Adds the JSON for note and quotation text.
public void saveAsCsv(String filename){ CsvWriter csvWriter=null; try { int n=pointSet.getNumberOfChildren(); String[] column={"Index","Name","X","Y","Z","Annotation"}; csvWriter=new CsvWriter(filename,column); csvWriter.open(); String[] value=new String[column.length]; Landscape landscape=Landscape.getInstance(); Vector3 coord=new Vector3(); for (int i=0; i < n; ++i) { Waypoint wp=(Waypoint)pointSet.getChild(i); coord.set(wp.getTranslation()); double elev=landscape.getElevationAtHighestLevel(coord.getX(),coord.getY()); landscape.localToWorldCoordinate(coord); coord.setZ(elev); value[0]=Integer.toString(i); value[1]=wp.getName(); value[2]=Double.toString(coord.getX()); value[3]=Double.toString(coord.getY()); value[4]=Double.toString(coord.getZ()); value[5]=wp.getState().getAnnotation(); csvWriter.writeLine(value); } csvWriter.close(); Console.getInstance().println(n + " records saved to " + filename); } catch ( Exception e) { e.printStackTrace(); if (csvWriter != null) { try { csvWriter.close(); } catch ( Exception e2) { e.printStackTrace(); } } } }
Write this path's way points to a file in comma separated value format.
public float weight(int contentLength,int totalTermFreq){ float numDocs=1 + contentLength / pivot; return (k1 + 1) * (float)Math.log(1 + (numDocs + 0.5D) / (totalTermFreq + 0.5D)); }
Computes term importance, given its in-document statistics.
public static final LocoNetMessage createIplUt4QueryPacket(){ return createIplSpecificHostQueryPacket(LnConstants.RE_IPL_MFR_DIGITRAX,LnConstants.RE_IPL_DIGITRAX_HOST_UT4); }
Creates a LocoNet packet which queries (some) UT4 throttles for IPL identification information. The invoking method is responsible for sending the message to LocoNet. <p> Note that UT4 and UT4R devices may not respond to this query. UT4D devices may respond to this query. <p>
public boolean isAuthenticated(HttpMessage msg){ return getContext().getAuthenticationMethod().isAuthenticated(msg); }
Checks if the response received by the Http Message corresponds to this user.
public boolean isSet(_Fields field){ if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SESSION_IDS: return isSetSessionIDs(); case PACKET: return isSetPacket(); } throw new IllegalStateException(); }
Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise
public MessageStore(Context context,int encryptionMode) throws IllegalArgumentException { store=new StorageBase(context,encryptionMode); mContext=context; }
Creates a Rangzen message store, with a consistent application of encryption of that stored data, as specified. All messages are associated with a priority value that can be modified.
public static Object readDeclaredField(final Object target,final String fieldName) throws IllegalAccessException { return FieldUtils.readDeclaredField(target,fieldName,false); }
Read the named public field. Only the class of the specified object will be considered.
public int firstByte(){ return firstByte; }
Returns the first byte in the array list
void verifyExceptionCaptured(Class<? extends Throwable> expectedExceptionClass){ assertTrue("Excpected exception not thrown",exceptionEventCapture.hasCaptured()); Throwable caughtEx=exceptionEventCapture.getValue(); assertEquals(expectedExceptionClass,caughtEx.getClass()); exceptionEventCapture.reset(); }
Verify that the given exception event capture (as returned by getAndInitExceptionCapture) has thrown an exception of the given expectedExceptionClass. Resets the capture
public static double digamma(double x){ if (x > 0 && x <= S_LIMIT) { return -GAMMA - 1 / x; } if (x >= C_LIMIT) { double inv=1 / (x * x); return FastMath.log(x) - 0.5 / x - inv * ((1.0 / 12) + inv * (1.0 / 120 - inv / 252)); } return digamma(x + 1) - 1 / x; }
<p>Computes the digamma function of x.</p> <p>This is an independently written implementation of the algorithm described in Jose Bernardo, Algorithm AS 103: Psi (Digamma) Function, Applied Statistics, 1976.</p> <p>Some of the constants have been changed to increase accuracy at the moderate expense of run-time. The result should be accurate to within 10^-8 absolute tolerance for x >= 10^-5 and within 10^-8 relative tolerance for x > 0.</p> <p>Performance for large negative values of x will be quite expensive (proportional to |x|). Accuracy for negative values of x should be about 10^-8 absolute for results less than 10^5 and 10^-8 relative for results larger than that.</p>
public static void logAllocation(RVMType type,int size){ if (demographics) { DemographicInformation info=demographicData.get(type); if (info != null) { info.count++; info.size+=size; } else { info=new DemographicInformation(); info.count++; info.size+=size; demographicData.put(type,info); } } }
Log an allocation in the boot image
protected Link createLink(final String relation,final URI href,final HttpMethod method){ return new Link(relation,href,method); }
Creates a Link with the specified relation and URI of the remote resource along with the method of the operation.
public synchronized ZooKeeperClientBuilder zkAclId(String zkAclId){ this.zkAclIdSet=true; this.zkAclId=zkAclId; return this; }
* Build zookeeper client with given zk acl digest id <i>zkAclId</i>.
private void convertEdges(final Collection<INaviEdge> edges,final Graph2D graph2D,final Map<INaviViewNode,Node> rawNodeToNodeMap,final boolean adjustColors){ for ( final INaviEdge edge : edges) { final NaviNode sourceNode=m_ynodeToNodeMap.get(rawNodeToNodeMap.get(edge.getSource())); final NaviNode targetNode=m_ynodeToNodeMap.get(rawNodeToNodeMap.get(edge.getTarget())); final Pair<Edge,NaviEdge> result=ZyEdgeBuilder.convertEdge(edge,sourceNode,targetNode,graph2D,adjustColors); m_yedgeToEdgeMap.put(result.first(),result.second()); } }
Converts the edges of a view into Graph2D edges.
private static void markForRemove(MethodNode mth,BlockNode block){ for ( BlockNode p : block.getPredecessors()) { p.getSuccessors().remove(block); p.updateCleanSuccessors(); } for ( BlockNode s : block.getSuccessors()) { s.getPredecessors().remove(block); } block.getPredecessors().clear(); block.getSuccessors().clear(); block.add(AFlag.REMOVE); block.remove(AFlag.SKIP); CatchAttr catchAttr=block.get(AType.CATCH_BLOCK); if (catchAttr != null) { catchAttr.getTryBlock().removeBlock(mth,block); for ( BlockNode skipBlock : mth.getBasicBlocks()) { if (skipBlock.contains(AFlag.SKIP)) { markForRemove(mth,skipBlock); } } } }
Unbind block for removing.
public static void dropAllTables(SQLiteDatabase db,boolean ifExists){ JokeCacheDao.dropTable(db,ifExists); FreshNewsCacheDao.dropTable(db,ifExists); PictureCacheDao.dropTable(db,ifExists); SisterCacheDao.dropTable(db,ifExists); VideoCacheDao.dropTable(db,ifExists); }
Drops underlying database table using DAOs.
public void deleteResourceConfig(String clusterName,ResourceType resourceType,String dsName) throws ConfigurationException { if (getClusterHome() == null) { throw new ConfigurationException("No home directory found from which to configure resources."); } File resources=getDir(getResourceConfigDirName(getClusterHome(),clusterName,resourceType)); String delFileName=resources.getAbsolutePath() + File.separator + dsName+ ".properties"; delFile(delFileName); }
Delete a specific resource configuration.
public void testPosZero(){ byte aBytes[]={-2,-3,-4,-4,5,14,23,39,48,57,66,5,14,23}; byte bBytes[]={0}; int aSign=1; int bSign=0; byte rBytes[]={0,-2,-3,-4,-4,5,14,23,39,48,57,66,5,14,23}; BigInteger aNumber=new BigInteger(aSign,aBytes); BigInteger bNumber=new BigInteger(bSign,bBytes); BigInteger result=aNumber.or(bNumber); byte resBytes[]=new byte[rBytes.length]; resBytes=result.toByteArray(); for (int i=0; i < resBytes.length; i++) { assertTrue(resBytes[i] == rBytes[i]); } assertEquals("incorrect sign",1,result.signum()); }
Or for a positive number and zero
public static ParsedBooleanQuery parseBooleanQuery(QueryLanguage ql,String query,String baseURI) throws MalformedQueryException, UnsupportedQueryLanguageException { ParsedOperation q=parseQuery(ql,query,baseURI); if (q instanceof ParsedBooleanQuery) { return (ParsedBooleanQuery)q; } throw new IllegalArgumentException("query is not a boolean query: " + query); }
Parses the supplied query into a query model.
void register(Object listener){ Multimap<Class<?>,Subscriber> listenerMethods=findAllSubscribers(listener); for ( Map.Entry<Class<?>,Collection<Subscriber>> entry : listenerMethods.asMap().entrySet()) { Class<?> eventType=entry.getKey(); Collection<Subscriber> eventMethodsInListener=entry.getValue(); CopyOnWriteArraySet<Subscriber> eventSubscribers=subscribers.get(eventType); if (eventSubscribers == null) { CopyOnWriteArraySet<Subscriber> newSet=new CopyOnWriteArraySet<Subscriber>(); eventSubscribers=MoreObjects.firstNonNull(subscribers.putIfAbsent(eventType,newSet),newSet); } eventSubscribers.addAll(eventMethodsInListener); } }
Registers all subscriber methods on the given listener object.
public void runTest(){ Vector v=new Vector(); v.addElement(new String("vector hello 1")); v.addElement(new String("vector hello 2")); v.addElement(new String("vector hello 3")); String strArray[]=new String[3]; strArray[0]="array hello 1"; strArray[1]="array hello 2"; strArray[2]="array hello 3"; VelocityContext context=new VelocityContext(); try { assureResultsDirectoryExists(RESULT_DIR); Template template=RuntimeSingleton.getTemplate(getFileName(null,"context_safety",TMPL_FILE_EXT)); FileOutputStream fos1=new FileOutputStream(getFileName(RESULT_DIR,"context_safety1",RESULT_FILE_EXT)); FileOutputStream fos2=new FileOutputStream(getFileName(RESULT_DIR,"context_safety2",RESULT_FILE_EXT)); Writer writer1=new BufferedWriter(new OutputStreamWriter(fos1)); Writer writer2=new BufferedWriter(new OutputStreamWriter(fos2)); context.put("vector",v); template.merge(context,writer1); writer1.flush(); writer1.close(); context.put("vector",strArray); template.merge(context,writer2); writer2.flush(); writer2.close(); if (!isMatch(RESULT_DIR,COMPARE_DIR,"context_safety1",RESULT_FILE_EXT,CMP_FILE_EXT) || !isMatch(RESULT_DIR,COMPARE_DIR,"context_safety2",RESULT_FILE_EXT,CMP_FILE_EXT)) { fail("Output incorrect."); } } catch ( Exception e) { fail(e.getMessage()); } }
Runs the test.
public static Insets of(int left,int top,int right,int bottom){ if (left == 0 && top == 0 && right == 0 && bottom == 0) { return NONE; } return new Insets(left,top,right,bottom); }
Return an Insets instance with the appropriate values.
public VisorThreadInfo(String name,Long id,Thread.State state,VisorThreadLockInfo lock,String lockName,Long lockOwnerId,String lockOwnerName,Boolean inNative,Boolean suspended,Long waitedCnt,Long waitedTime,Long blockedCnt,Long blockedTime,StackTraceElement[] stackTrace,VisorThreadLockInfo[] locks,VisorThreadMonitorInfo[] lockedMonitors){ this.name=name; this.id=id; this.state=state; this.lock=lock; this.lockName=lockName; this.lockOwnerId=lockOwnerId; this.lockOwnerName=lockOwnerName; this.inNative=inNative; this.suspended=suspended; this.waitedCnt=waitedCnt; this.waitedTime=waitedTime; this.blockedCnt=blockedCnt; this.blockedTime=blockedTime; this.stackTrace=stackTrace; this.locks=locks; this.lockedMonitors=lockedMonitors; }
Create thread info with given parameters.
public void access(){ lastAccessedTime=System.currentTimeMillis(); }
Updates this session, marking it as accessed.
public VNXeCommandJob modifyFileSystemAsync(ModifyFileSystemParam param,String resourceId) throws VNXeException { StringBuilder urlBld=new StringBuilder(URL_RESOURCE); urlBld.append(resourceId); urlBld.append(MODIFY); _url=urlBld.toString(); return postRequestAsync(param); }
modify file system, export/unexport, etc
public boolean timestampResolved(){ return timestampResolved; }
Has timestamp been resolved during the parsing phase.
public boolean canReach(Environment env,MemberDefinition f){ return field.canReach(env,f); }
Check if a field can reach another field (only considers forward references, not the access modifiers).
public boolean updatesAreDetected(int type) throws SQLException { return false; }
Indicates whether or not a visible row update can be detected by calling the method <code>ResultSet.rowUpdated</code>.
public static MenuItem createNavigationMenuItem(){ MenuItem item=new MenuItem(); item.setStyle("padding: 0;"); item.setUpdate(":tableForm,:navForm"); item.addActionListener(actionListener); return item; }
Creates a new item for the breadcrumb menu
public static void removeProxy(){ System.clearProperty("http.proxyHost"); }
Clear Proxy host settings in System property.
public static NSObject parse(final byte[] bytes) throws ParserConfigurationException, ParseException, SAXException, PropertyListFormatException, IOException { return parse(new ByteArrayInputStream(bytes)); }
Parses a XML property list from a byte array.
private void returnData(Object ret){ if (myHost != null) { myHost.returnData(ret); } }
Used to communicate a return object from a plugin tool to the main Whitebox user-interface.
public static void addParameter(MethodDeclaration method,Parameter parameter){ List<Parameter> parameters=method.getParameters(); if (parameters == null) { parameters=new ArrayList<Parameter>(); method.setParameters(parameters); } parameters.add(parameter); }
Adds the given parameter to the method. The list of parameters will be initialized if it is <code>null</code>.
@Override public boolean handleMessage(Message msg){ if (msg.what == 1) { RefundOrdersAdapter adapter=new RefundOrdersAdapter(RefundOrdersActivity.this,refundOrders); listViewRefundOrder.setAdapter(adapter); } return true; }
Callback interface you can use when instantiating a Handler to avoid having to implement your own subclass of Handler. handleMessage() defines the operations to perform when the Handler receives a new Message to process.
public GDSHelper(FbDatabase database){ this.registerResultSets=!database.getConnectionProperties().getExtraDatabaseParameters().hasArgument(DatabaseParameterBufferExtension.NO_RESULT_SET_TRACKING); this.database=database; syncObject=database.getSynchronizationObject(); }
Create instance of this class.
private void onPermissionsNotGranted(){ Toast.makeText(this,R.string.toast_permissions_not_granted,Toast.LENGTH_SHORT).show(); finish(); }
Permissions not granted. Quit.
public void sendToServer(AbstractPacket message){ this.channels.get(Side.CLIENT).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.TOSERVER); this.channels.get(Side.CLIENT).writeAndFlush(message); }
Send this message to the server. Adapted from CPW's code in cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper
public FeatureVector classify(Object example){ return new FeatureVector(featureValue(example)); }
This function makes one or more decisions about a single object, returning those decisions as <code>Feature</code>s in a vector.
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2014-03-25 14:24:54.453 -0400",hash_original_method="E01A9375EF3E05D6840F4E3FB44E9B7F",hash_generated_method="1610E441C16EF19AF21A1F0C5706B95F") public static boolean stopFilteringMulticastV6Packets(){ double taintDouble=0; return ((taintDouble) == 1); }
Stop filtering out Multicast V6 packets.
public void resetTo(int begin,int end){ this.diet=false; this.initialPosition=this.startPosition=this.currentPosition=begin; if (this.source != null && this.source.length < end) { this.eofPosition=this.source.length; } else { this.eofPosition=end < Integer.MAX_VALUE ? end + 1 : end; } this.commentPtr=-1; this.foundTaskCount=0; }
Reposition the scanner on some portion of the original source. The given endPosition is the last valid position. Beyond this position, the scanner will answer EOF tokens (<code>ITerminalSymbols.TokenNameEOF</code>).
public List<Completion> _queryUser_Completions(long userId){ synchronized (this) { if (user_CompletionsQuery == null) { QueryBuilder<Completion> queryBuilder=queryBuilder(); queryBuilder.where(Properties.UserId.eq(null)); user_CompletionsQuery=queryBuilder.build(); } } Query<Completion> query=user_CompletionsQuery.forCurrentThread(); query.setParameter(0,userId); return query.list(); }
Internal query to resolve the "completions" to-many relationship of User.
public static void main(String[] args){ System.out.println("Available Fonts:"); String[] family=GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames(); for (int i=0; i < family.length; i++) System.out.println(" - " + family[i]); org.compiere.Adempiere.startup(true); MPrintFont pf=new MPrintFont(Env.getCtx(),100,null); dump(pf.getFont()); String[] systemLocical=new String[]{"Dialog","DialogInput","Monospaced","Serif","SansSerif"}; for (int i=0; i < systemLocical.length; i++) { } int[] IDs=PO.getAllIDs("AD_PrintFont",null,null); for (int i=0; i < IDs.length; i++) { pf=new MPrintFont(Env.getCtx(),IDs[i],null); System.out.println(IDs[i] + " = " + pf.getFont()); } }
Seed Fonts
public static String obtenerURLPagoTasas() throws ConsultaExcepcion { try { return Configuracion.getURLPago(); } catch ( Exception e) { logger.error("Error al obtener URL de pago de tasas [obtenerURLPagoTasas][Excepcion]",e.fillInStackTrace()); throw new ConsultaExcepcion(ConsultaCodigosError.EC_OBTENER_URL_PAGO,e.getCause()); } }
Metodo de tipo get que devuelve la URL para el pago de tasas y que es configurable desde el fichero de properties ieci.tecdoc.sgm.ct.resources.application.
public PDFXref(byte[] line){ if (line == null) { id=-1; generation=-1; } else { id=Integer.parseInt(new String(line,0,10)); generation=Integer.parseInt(new String(line,11,5)); } compressed=false; }
create a new PDFXref, given a sequence of bytes representing the fixed-width cross reference table line
public static GLFont fromBuffer(String name,BufferedImage image,int width,int height,GLFontMetrics metric){ if (name == null) throw new IllegalArgumentException("name may not be null"); if (image == null) throw new IllegalArgumentException("image may not be null"); if (metric == null) throw new IllegalArgumentException("metric may not be null"); ColorModel glAlphaColorModel=new ComponentColorModel(ColorSpace.getInstance(ColorSpace.CS_sRGB),new int[]{8,8,8,8},true,false,Transparency.TRANSLUCENT,DataBuffer.TYPE_BYTE); WritableRaster raster=Raster.createInterleavedRaster(DataBuffer.TYPE_BYTE,width,height,4,null); BufferedImage texImage=new BufferedImage(glAlphaColorModel,raster,true,new Hashtable<Object,Object>()); Graphics g=texImage.getGraphics(); g.setColor(new Color(0f,0f,0f,0f)); g.fillRect(0,0,width,height); g.drawImage(image,0,0,null); byte[] data=((DataBufferByte)texImage.getRaster().getDataBuffer()).getData(); ByteBuffer buffer=ByteBuffer.allocateDirect(data.length); buffer.order(ByteOrder.nativeOrder()); buffer.put(data,0,data.length); buffer.flip(); IntBuffer tmp=BufferUtils.createIntBuffer(1); GL11.glGenTextures(tmp); tmp.rewind(); GL11.glBindTexture(GL11.GL_TEXTURE_2D,tmp.get(0)); GL11.glTexParameteri(GL11.GL_TEXTURE_2D,GL11.GL_TEXTURE_MIN_FILTER,GL11.GL_LINEAR); GL11.glTexParameteri(GL11.GL_TEXTURE_2D,GL11.GL_TEXTURE_MAG_FILTER,GL11.GL_LINEAR); GL11.glTexImage2D(GL11.GL_TEXTURE_2D,0,GL11.GL_RGBA,width,height,0,GL11.GL_RGBA,GL11.GL_UNSIGNED_BYTE,buffer); tmp.rewind(); int texIdx=tmp.get(0); GLFont font=new GLFont(name,texIdx,0.44f,metric); return font; }
Create a GLFont from an image buffer of a specified size with a specified metric map.
@Nonnull public BugInstance addOptionalField(@CheckForNull XField xfield){ if (xfield == null) { return this; } return addField(xfield.getClassName(),xfield.getName(),xfield.getSignature(),xfield.isStatic()); }
Add a field annotation for an XField.
public JSONObject(JSONObject jo,String[] sa) throws JSONException { this(); for (int i=0; i < sa.length; i+=1) { putOpt(sa[i],jo.opt(sa[i])); } }
Construct a JSONObject from a subset of another JSONObject. An array of strings is used to identify the keys that should be copied. Missing keys are ignored.
public static boolean isSelectingMetaTracker(CharSequence text,Object what){ return what == SELECTING; }
Returns true if this object is one that this class would use to keep track of the selecting meta state in the specified text.
public PLHTTPFileDownloader(){ super(); }
init methods
public static CtClass toCtClass(String desc,ClassPool cp) throws NotFoundException { CtClass[] clazz=new CtClass[1]; int res=toCtClass(cp,desc,0,clazz,0); if (res >= 0) return clazz[0]; else { return cp.get(desc.replace('/','.')); } }
Returns a <code>CtClass</code> object representing the type specified by the given descriptor. <p>This method works even if the package-class separator is not <code>/</code> but <code>.</code> (period). For example, it accepts <code>Ljava.lang.Object;</code> as well as <code>Ljava/lang/Object;</code>.
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:35:44.080 -0500",hash_original_method="23FE2246FE60A7859CD93D836CF467DE",hash_generated_method="0EF3D39AA54E6C404C253299675A50A8") public void runOnMainSync(Runnable runner){ validateNotAppThread(); SyncRunnable sr=new SyncRunnable(runner); mThread.getHandler().post(sr); sr.waitForComplete(); }
Execute a call on the application's main thread, blocking until it is complete. Useful for doing things that are not thread-safe, such as looking at or modifying the view hierarchy.
protected boolean isRecipientNotFound(){ return fieldRecipientNotFound; }
Returns the recipientNotFound.
public XBeeMessage(String m,int l){ super(m,l); }
This ctor interprets the String as the exact sequence to send, byte-for-byte.
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:28:44.167 -0500",hash_original_method="870E9211222A33CDF50FFEE42B5AEA84",hash_generated_method="2295C47135890B172FCC5171045CB48E") public String buildUnionQuery(String[] subQueries,String sortOrder,String limit){ StringBuilder query=new StringBuilder(128); int subQueryCount=subQueries.length; String unionOperator=mDistinct ? " UNION " : " UNION ALL "; for (int i=0; i < subQueryCount; i++) { if (i > 0) { query.append(unionOperator); } query.append(subQueries[i]); } appendClause(query," ORDER BY ",sortOrder); appendClause(query," LIMIT ",limit); return query.toString(); }
Given a set of subqueries, all of which are SELECT statements, construct a query that returns the union of what those subqueries return.
public IMouseState createNodeClickedLeftState(final Node n,final MouseEvent event){ final CNodeClickedLeftState<NodeType,EdgeType> state=new CNodeClickedLeftState<NodeType,EdgeType>(this,m_graph,n); m_factory.createNodeClickedLeftAction().execute(state,event); return state; }
Creates a new state object when a node is clicked with the left mouse button.
private void initMetrics(ServletContext servletContext,EnumSet<DispatcherType> disps){ log.debug("Initializing Metrics registries"); servletContext.setAttribute(InstrumentedFilter.REGISTRY_ATTRIBUTE,metricRegistry); servletContext.setAttribute(MetricsServlet.METRICS_REGISTRY,metricRegistry); log.debug("Registering Metrics Filter"); FilterRegistration.Dynamic metricsFilter=servletContext.addFilter("webappMetricsFilter",new InstrumentedFilter()); metricsFilter.addMappingForUrlPatterns(disps,true,"/*"); metricsFilter.setAsyncSupported(true); log.debug("Registering Metrics Servlet"); ServletRegistration.Dynamic metricsAdminServlet=servletContext.addServlet("metricsServlet",new MetricsServlet()); metricsAdminServlet.addMapping("/metrics/metrics/*"); metricsAdminServlet.setAsyncSupported(true); metricsAdminServlet.setLoadOnStartup(2); }
Initializes Metrics.
@Override public void transform(SolrDocument doc,int docid,float score) throws IOException { str.setLength(0); for ( String s : extra) { String v=getAsString(s,doc); str.append(v).append('#'); } System.out.println("HELLO: " + str); doc.setField(name,str.toString()); }
This transformer simply concatenates the values of multiple fields
public double calculateLogLikelihood(){ if (getBooleanState()) { return Double.NEGATIVE_INFINITY; } else { return 0.0; } }
Calculate the log likelihood of the current state. If all the statistics are true then it returns 0.0 otherwise -INF.
private synchronized void invalidate(){ ses=null; }
Invalidates session.
public static Object invoke(Object obj,String methodName,String stringParameter) throws NoSuchMethodException { try { Method method=obj.getClass().getMethod(methodName,new Class[]{String.class}); Object result=method.invoke(obj,new Object[]{stringParameter}); return result; } catch ( IllegalAccessException e) { throw new NoSuchMethodException(methodName + " is not accessible"); } catch ( InvocationTargetException e) { throw new InternalError(e.getMessage()); } }
Invokes the specified accessible method with a string parameter if it exists.
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:28:03.283 -0500",hash_original_method="6AE5D8E6865DDCD084B3272F01FD2E51",hash_generated_method="D761FF91EB130E4DE335DFAAA06834FB") public void insertAt(int row,int[] values){ if ((row < 0) || (row > size())) { throw new IndexOutOfBoundsException("row " + row); } if ((values != null) && (values.length < width())) { throw new IndexOutOfBoundsException("value count " + values.length); } moveRowGapTo(row); if (mRowGapLength == 0) { growBuffer(); } mRowGapStart++; mRowGapLength--; if (values == null) { for (int i=mColumns - 1; i >= 0; i--) { setValueInternal(row,i,0); } } else { for (int i=mColumns - 1; i >= 0; i--) { setValueInternal(row,i,values[i]); } } }
Inserts a new row of values at the specified row offset.
public static Assignment createDefault(Collection<String> variables){ Assignment a=new Assignment(); variables.stream().forEach(null); return a; }
Creates an assignment with only none values for the variable labels given as argument.
public void refresh(GridTab gridTab){ if (this.gridTab != gridTab || !isInit()) { init=false; init(gridTab); } else { listbox.setModel(listModel); updateListIndex(); } }
refresh after switching from form view
public boolean isSafeClass(SootClass clz){ return safeClasses.contains(clz.getName()); }
Are all the methods of this class safe?
public void stop(){ mRunning=false; mStop=true; }
Stops the animation in place. It does not snap the image to its final translation.
public boolean isSetPort(){ return EncodingUtils.testBit(__isset_bitfield,__PORT_ISSET_ID); }
Returns true if field port is set (has been assigned a value) and false otherwise
private void returnData(Object ret){ if (myHost != null) { myHost.returnData(ret); } }
Used to communicate a return object from a plugin tool to the main Whitebox user-interface.
public CaseSwitchExpression(){ }
Ctor - for use to create an expression tree, without inner expression
@Override public String auth(final String password){ checkIsInMultiOrPipeline(); client.auth(password); return client.getStatusCodeReply(); }
Request for authentication in a password protected Redis server. A Redis server can be instructed to require a password before to allow clients to issue commands. This is done using the requirepass directive in the Redis configuration file. If the password given by the client is correct the server replies with an OK status code reply and starts accepting commands from the client. Otherwise an error is returned and the clients needs to try a new password. Note that for the high performance nature of Redis it is possible to try a lot of passwords in parallel in very short time, so make sure to generate a strong and very long password so that this attack is infeasible.
public boolean pingMyServer(){ return pingMyServer(SmackConfiguration.getPacketReplyTimeout()); }
Pings the user's server with the PacketReplyTimeout as defined in SmackConfiguration.
public static long toLong(byte[] bytes){ return toLong(bytes,0); }
Convert byte[] to long
public double mean(){ throw new RuntimeException("Not yet implemented"); }
mean of the distribution
public void testSort(){ performTest(getFilter(true,"")); }
tests the sorting alone
protected Object convertArray(Object value){ return value; }
Returns the value unchanged.
public void removePropertyChangeListener(PropertyChangeListener l){ AccessibleContext ac=getCurrentAccessibleContext(); if (ac != null) { ac.removePropertyChangeListener(l); } else { super.removePropertyChangeListener(l); } }
Remove a PropertyChangeListener from the listener list. This removes a PropertyChangeListener that was registered for all properties.
public void assertNotEqual(byte expected,byte actual,String errorMessage){ TestUtils.assertNotEqual(expected,actual,errorMessage); }
This method just invokes the test utils method, it is here for convenience
public static void registerMetadata(MetadataRegistry registry){ if (registry.isRegistered(KEY)) { return; } ElementCreator builder=registry.build(KEY); builder.addAttribute(REL); builder.addAttribute(HREF); builder.addAttribute(READ_ONLY); builder.addAttribute(COUNT_HINT); builder.addElement(Feed.KEY); }
Registers the metadata for this element.
public void testUnisolatedAllocationContextRecycling(){ final Journal store=(Journal)getStore(0); try { final RWStrategy bufferStrategy=(RWStrategy)store.getBufferStrategy(); final RWStore rw=bufferStrategy.getStore(); final IAllocationContext cntxt=rw.newAllocationContext(false); final int allocs=1000; final PseudoRandom ran=new PseudoRandom(20000); final ArrayList<Integer> addrs=new ArrayList<Integer>(); final ArrayList<Integer> sizes=new ArrayList<Integer>(); for (int a=0; a < allocs; a++) { final int sze=32 + ran.nextInt(1200); addrs.add(rw.alloc(sze,cntxt)); sizes.add(sze); } store.commit(); IAllocationContext iso_cntxt=rw.newAllocationContext(true); for (int a=0; a < 3; a++) { rw.alloc(32 + ran.nextInt(1200),iso_cntxt); } if (log.isInfoEnabled()) { final StringBuilder str=new StringBuilder(); rw.showAllocators(str); log.info(str); } for (int a=0; a < 36; a++) { rw.free(addrs.get(a),sizes.get(a),cntxt); } store.abort(); for (int a=0; a < 36; a++) { final int rwaddr=addrs.get(a); if (log.isInfoEnabled()) log.info("Address: " + rw.physicalAddress(rwaddr) + ", Committed: "+ rw.isCommitted(rwaddr)); } log.info("INTERMEDIATE COMMIT"); for (int a=0; a < 36; a++) { final int rwaddr=addrs.get(a); if (log.isInfoEnabled()) log.info("Address: " + rw.physicalAddress(rwaddr) + ", Committed: "+ rw.isCommitted(rwaddr)+ ", Index: "+ getIndex(rwaddr)); } log.info("DETACH CONTEXT"); rw.detachContext(iso_cntxt); for (int a=0; a < 36; a++) { final int rwaddr=addrs.get(a); if (log.isInfoEnabled()) log.info("Address: " + rw.physicalAddress(rwaddr) + ", Committed: "+ rw.isCommitted(rwaddr)+ ", Index: "+ getIndex(rwaddr)); } store.commit(); log.info("COMMIT"); for (int a=0; a < 36; a++) { final int rwaddr=addrs.get(a); if (log.isInfoEnabled()) log.info("Address: " + rw.physicalAddress(rwaddr) + ", Committed: "+ rw.isCommitted(rwaddr)+ ", Index: "+ getIndex(rwaddr)); } store.commit(); log.info("SECONDARY"); for (int a=0; a < 36; a++) { final int rwaddr=addrs.get(a); if (log.isInfoEnabled()) log.info("Address: " + rw.physicalAddress(rwaddr) + ", Committed: "+ rw.isCommitted(rwaddr)+ ", Index: "+ getIndex(rwaddr)); } } finally { store.destroy(); } }
Need to test the handling of aborted Unisolated connections and specifically the logic behind freed addresses. <p> The process is to: Allocate a range of data (to establish a number of Allocators) Create an Isolated context and allocate a handful more Create an Unisolated context Free some committed addreses Abort the Unisolated context - calling abort on the Journal Commit the Isolated context Observe if any of the previously committed data is freed!