/** * Test if two object are equal. * @param object The object to compare to. */ public boolean equals(Object object) { return object instanceof OAVInternalObjectId && this.id==((OAVInternalObjectId)object).id && this.type.equals(((OAVInternalObjectId)object).type); }
/** * Test if two object are equal. * @param object The object to compare to. */ public boolean equals(Object object) { return object instanceof OAVInternalObjectId && this.id==((OAVInternalObjectId)object).id && this.type.equals(((OAVInternalObjectId)object).type); }
/** * Test if this type is same type or subtype of another type. * @param type The type to test. * @return True, if this object is same type or subtype. */ public boolean isSubtype(OAVObjectType type) { boolean ret = false; OAVObjectType tmp = this; while(tmp!=null && !ret) { if(type.equals(tmp)) ret = true; else tmp = tmp.getSupertype(); } return ret; }
/** * Test if this type is same type or subtype of another type. * @param type The type to test. * @return True, if this object is same type or subtype. */ public boolean isSubtype(OAVObjectType type) { boolean ret = false; OAVObjectType tmp = this; while(tmp!=null && !ret) { if(type.equals(tmp)) ret = true; else tmp = tmp.getSupertype(); } return ret; }
/** * Get the rank of a candidate. * The order is as follows: * running plan (0) -> waitqueue (1) -> plan instance (2). * @return The rank of a candidate. */ protected static int getRank(IOAVState state, Object cand, Object apl) { int rank; if(state.getType(cand).equals(OAVBDIRuntimeModel.waitqueuecandidate_type)) { rank = 1; // waitqueue } else if(state.getType(cand).equals(OAVBDIRuntimeModel.mplancandidate_type)) { rank = 0; // mplan } else //if(state.getType(cand).equals(OAVBDIRuntimeModel.plancandidate_type)) { rank = 2; // running plan } return rank; }
/** * Create a new fetcher. */ public OAVBDIFetcher(IOAVState state, Object rcapa, Object relem) { this(state, rcapa); if(state.getType(relem).equals(OAVBDIRuntimeModel.goal_type)) setRGoal(relem); else if(state.getType(relem).equals(OAVBDIRuntimeModel.plan_type)) setRPlan(relem); else if(state.getType(relem).equals(OAVBDIRuntimeModel.messageevent_type)) setRMessageEvent(relem); else if(state.getType(relem).equals(OAVBDIRuntimeModel.internalevent_type)) setRInternalEvent(relem); else throw new IllegalArgumentException("Unsoppurted object: "+relem); }
/** * Test if this expression is equal to some object. */ public boolean equals(Object o) { return o instanceof CastExpression && ((CastExpression)o).getType().equals(getType()) && ((CastExpression)o).getValue().equals(getValue()); }
/** * Test if this expression is equal to some object. */ public boolean equals(Object o) { return o instanceof CastExpression && ((CastExpression)o).getType().equals(getType()) && ((CastExpression)o).getValue().equals(getValue()); }
if(OAVBDIMetaModel.metagoal_type.equals(state.getType(handle))) else if(OAVBDIMetaModel.performgoal_type.equals(state.getType(handle))) else if(OAVBDIMetaModel.achievegoal_type.equals(state.getType(handle))) else if(OAVBDIMetaModel.querygoal_type.equals(state.getType(handle))) else if(OAVBDIMetaModel.maintaingoal_type.equals(state.getType(handle)))
String kind = state.getType(belief).equals(OAVBDIRuntimeModel.belief_type) ? "belief" : "beliefset"; String type = (String)state.getAttributeValue(mbelief, OAVBDIMetaModel.modelelement_has_name); String valuetype = SReflect.getInnerClassName((Class)state.getAttributeValue(mbelief, OAVBDIMetaModel.typedelement_has_class)); Object value; if(state.getType(belief).equals(OAVBDIRuntimeModel.belief_type))
/** * Get the priority of a candidate. * @return The priority of a candidate. */ protected static int getPriority(IOAVState state, Object cand) { Object mplan; if(state.getType(cand).equals(OAVBDIRuntimeModel.waitqueuecandidate_type)) { Object rplan = state.getAttributeValue(cand, OAVBDIRuntimeModel.waitqueuecandidate_has_plan); mplan = state.getAttributeValue(rplan, OAVBDIRuntimeModel.element_has_model); } else if(state.getType(cand).equals(OAVBDIRuntimeModel.plancandidate_type)) { Object rplan = state.getAttributeValue(cand, OAVBDIRuntimeModel.plancandidate_has_plan); mplan = state.getAttributeValue(rplan, OAVBDIRuntimeModel.element_has_model); } else // if(state.getType(cand).equals(OAVBDIRuntimeModel.mplancandidate_type)) { mplan = state.getAttributeValue(cand, OAVBDIRuntimeModel.mplancandidate_has_mplan); } Integer prio = (Integer)state.getAttributeValue(mplan, OAVBDIMetaModel.plan_has_priority); return prio==null? 0: prio.intValue(); }
/** * Test if this object is equal to some object. */ public boolean equals(Object o) { return o instanceof ExistentialDeclaration && ((ExistentialDeclaration)o).getType().equals(getType()) && ((ExistentialDeclaration)o).getVariable().equals(getVariable()); }
/** * Test if this object is equal to some object. */ public boolean equals(Object o) { return o instanceof ExistentialDeclaration && ((ExistentialDeclaration)o).getType().equals(getType()) && ((ExistentialDeclaration)o).getVariable().equals(getVariable()); }
else if(!otype.equals(type))
else if(!otype.equals(type))
if(OAVBDIMetaModel.beliefset_type.equals(state.getType(handle)))
if(OAVBDIMetaModel.belief_type.equals(state.getType(handle)))