- Add the Codota plugin to your IDE and get smart completions
private void myMethod () {Connection c =
DataSource dataSource;dataSource.getConnection()
String url;DriverManager.getConnection(url)
IdentityDatabaseUtil.getDBConnection()
- Smart code suggestions by Codota
}
/** * Create querygoal processing rule. */ protected static Rule createQuerygoalProcessingRule() { Variable rgoal = new Variable("?rgoal", OAVBDIRuntimeModel.goal_type); ObjectCondition goalcon = new ObjectCondition(OAVBDIRuntimeModel.goal_type); goalcon.addConstraint(new BoundConstraint(null, rgoal)); goalcon.addConstraint(new LiteralConstraint(OAVBDIRuntimeModel.goal_has_lifecyclestate, OAVBDIRuntimeModel.GOALLIFECYCLESTATE_ACTIVE)); goalcon.addConstraint(new LiteralConstraint(OAVBDIRuntimeModel.goal_has_processingstate, OAVBDIRuntimeModel.GOALPROCESSINGSTATE_IDLE)); goalcon.addConstraint(new LiteralConstraint(OAVBDIRuntimeModel.element_has_model, OAVBDIMetaModel.querygoal_type, IOperator.INSTANCEOF)); ObjectCondition capcon = new ObjectCondition(OAVBDIRuntimeModel.capability_type); capcon.addConstraint(new BoundConstraint(OAVBDIRuntimeModel.capability_has_goals, rgoal, IOperator.CONTAINS)); Rule querygoal_processing = new Rule("querygoal_processing", new AndCondition(new ICondition[]{goalcon, capcon}), GOAL_PROCESSING); return querygoal_processing; }
/** * Evaluate two objects with respect to the * operator semantics. * @param state The state. * @param val1 The first object. * @param val2 The second object. * @return True, if objects fit wrt. the operator semantics. */ public boolean evaluate(IOAVState state, Object val1, Object val2) { val1 = val1 instanceof ILazyValue? ((ILazyValue)val1).getValue(): val1; val2 = val2 instanceof ILazyValue? ((ILazyValue)val2).getValue(): val2; return val1!=null && val2!=null && compare(val1, val2)<=0; }
/** * Test if a variable is contained in the expression. * @param var The variable. * @return True, when the variable is contained. */ public boolean containsVariable(Variable var) { return var.equals(variable); }
/** * Evaluate two objects with respect to the * operator semantics. * @param state The state. * @param val1 The first object. * @param val2 The second object. * @return True, if objects fit wrt. the operator semantics. */ public boolean evaluate(IOAVState state, Object val1, Object val2) { val1 = val1 instanceof ILazyValue? ((ILazyValue)val1).getValue(): val1; val2 = val2 instanceof ILazyValue? ((ILazyValue)val2).getValue(): val2; return !contains(val1, val2); }
/** * Get the string representation. * @return The string representation. */ public String toString() { return "("+getValueSource()+getOperator()+value+")"; } }
/** * Get the variables. * @return The declared variables. */ public List getVariables() { return funcall.getVariables(); }
/** * Get the string representation. * @return The string representation. */ public String toString() { //return "Variable(name="+name+")";//, type="+type+")"; //return (!isMulti()? "Variable(": "Multivariable(")+name+")"; // return (!isMulti()? "Variable(": "Multivariable(")+name+": "+type!=null? type.getName(): "null"+")"; return (!isMulti()? "Variable(": "Multivariable(")+name+")"; } }
/** * Create a new object condition. */ public CollectCondition(ObjectCondition ocon, List constraints) { this(createList(ocon), constraints); }
/** * Get the variables. * @return The declared variables. */ public List getVariables() { return constraint.getVariables(); }
/** * Create achievegoal processing rule. */ protected static Rule createAchievegoalProcessingRule() { Variable rgoal = new Variable("?rgoal", OAVBDIRuntimeModel.goal_type); ObjectCondition goalcon = new ObjectCondition(OAVBDIRuntimeModel.goal_type); goalcon.addConstraint(new BoundConstraint(null, rgoal)); goalcon.addConstraint(new LiteralConstraint(OAVBDIRuntimeModel.goal_has_lifecyclestate, OAVBDIRuntimeModel.GOALLIFECYCLESTATE_ACTIVE)); goalcon.addConstraint(new LiteralConstraint(OAVBDIRuntimeModel.goal_has_processingstate, OAVBDIRuntimeModel.GOALPROCESSINGSTATE_IDLE)); goalcon.addConstraint(new LiteralConstraint(OAVBDIRuntimeModel.element_has_model, OAVBDIMetaModel.achievegoal_type, IOperator.INSTANCEOF)); ObjectCondition capcon = new ObjectCondition(OAVBDIRuntimeModel.capability_type); capcon.addConstraint(new BoundConstraint(OAVBDIRuntimeModel.capability_has_goals, rgoal, IOperator.CONTAINS)); Rule achievegoal_processing = new Rule("achievegoal_processing", new AndCondition(new ICondition[]{goalcon, capcon}), GOAL_PROCESSING); return achievegoal_processing; }
/** * Evaluate two objects with respect to the * operator semantics. * @param state The state. * @param val1 The first object. * @param val2 The second object. * @return True, if objects fit wrt. the operator semantics. */ public boolean evaluate(IOAVState state, Object val1, Object val2) { val1 = val1 instanceof ILazyValue? ((ILazyValue)val1).getValue(): val1; val2 = val2 instanceof ILazyValue? ((ILazyValue)val2).getValue(): val2; return val1!=null && val2!=null && compare(val1, val2)>0; }
/** * Evaluate two objects with respect to the * operator semantics. * @param state The state. * @param val1 The first object. * @param val2 The second object. * @return True, if objects fit wrt. the operator semantics. */ public boolean evaluate(IOAVState state, Object val1, Object val2) { val1 = val1 instanceof ILazyValue? ((ILazyValue)val1).getValue(): val1; val2 = val2 instanceof ILazyValue? ((ILazyValue)val2).getValue(): val2; return contains(val1, val2); }
/** * Test if a variable is contained in the expression. * @param var The variable. * @return True, when the variable is contained. */ public boolean containsVariable(Variable var) { return var.equals(variable); }
/** * Get the variables. * @return The declared variables. */ public List getVariables() { return funcall.getVariables(); }
/** * Create the goal failed rule (when no plans available). * (state = nocandidates, recur = false) */ protected static Rule createGoalFailedRule() { Variable rgoal = new Variable("?rgoal", OAVBDIRuntimeModel.goal_type); ObjectCondition goalcon = new ObjectCondition(OAVBDIRuntimeModel.goal_type); goalcon.addConstraint(new BoundConstraint(null, rgoal)); goalcon.addConstraint(new LiteralConstraint(OAVBDIRuntimeModel.processableelement_has_state, OAVBDIRuntimeModel.PROCESSABLEELEMENT_NOCANDIDATES)); goalcon.addConstraint(new LiteralConstraint(new OAVAttributeType[]{OAVBDIRuntimeModel.element_has_model, OAVBDIMetaModel.goal_has_recur}, Boolean.FALSE)); Rule goal_failed = new Rule("goal_failed", goalcon, GOAL_FAILED); return goal_failed; }
/** * Evaluate two objects with respect to the * operator semantics. * @param state The state. * @param val1 The first object. * @param val2 The second object. * @return True, if objects fit wrt. the operator semantics. */ public boolean evaluate(IOAVState state, Object val1, Object val2) { val1 = val1 instanceof ILazyValue? ((ILazyValue)val1).getValue(): val1; val2 = val2 instanceof ILazyValue? ((ILazyValue)val2).getValue(): val2; return val1!=null && val2!=null && compare(val1, val2)>=0; }
/** * Evaluate two objects with respect to the * operator semantics. * @param state The state. * @param val1 The first object. * @param val2 The second object. * @return True, if objects fit wrt. the operator semantics. */ public boolean evaluate(IOAVState state, Object val1, Object val2) { val1 = val1 instanceof ILazyValue? ((ILazyValue)val1).getValue(): val1; val2 = val2 instanceof ILazyValue? ((ILazyValue)val2).getValue(): val2; return !contains(val1, val2); }
/** * Create performgoal processing rule. */ protected static Rule createPerformgoalProcessingRule() { Variable rgoal = new Variable("?rgoal", OAVBDIRuntimeModel.goal_type); ObjectCondition goalcon = new ObjectCondition(OAVBDIRuntimeModel.goal_type); goalcon.addConstraint(new BoundConstraint(null, rgoal)); goalcon.addConstraint(new LiteralConstraint(OAVBDIRuntimeModel.goal_has_lifecyclestate, OAVBDIRuntimeModel.GOALLIFECYCLESTATE_ACTIVE)); goalcon.addConstraint(new LiteralConstraint(OAVBDIRuntimeModel.goal_has_processingstate, OAVBDIRuntimeModel.GOALPROCESSINGSTATE_IDLE)); goalcon.addConstraint(new LiteralConstraint(OAVBDIRuntimeModel.element_has_model, OAVBDIMetaModel.performgoal_type, IOperator.INSTANCEOF)); ObjectCondition capacon = new ObjectCondition(OAVBDIRuntimeModel.capability_type); capacon.addConstraint(new BoundConstraint(OAVBDIRuntimeModel.capability_has_goals, rgoal, IOperator.CONTAINS)); Rule performgoal_processing = new Rule("performgoal_processing", new AndCondition(new ICondition[]{goalcon, capacon}), GOAL_PROCESSING); return performgoal_processing; }
/** * Evaluate two objects with respect to the * operator semantics. * @param state The state. * @param val1 The first object. * @param val2 The second object. * @return True, if objects fit wrt. the operator semantics. */ public boolean evaluate(IOAVState state, Object val1, Object val2) { val1 = val1 instanceof ILazyValue? ((ILazyValue)val1).getValue(): val1; val2 = val2 instanceof ILazyValue? ((ILazyValue)val2).getValue(): val2; return val1!=null && val2!=null && compare(val1, val2)<=0; }
/** * Evaluate two objects with respect to the * operator semantics. * @param state The state. * @param val1 The first object. * @param val2 The second object. * @return True, if objects fit wrt. the operator semantics. */ public boolean evaluate(IOAVState state, Object val1, Object val2) { val1 = val1 instanceof ILazyValue? ((ILazyValue)val1).getValue(): val1; val2 = val2 instanceof ILazyValue? ((ILazyValue)val2).getValue(): val2; return val1!=null && val2!=null && compare(val1, val2)>=0; }