/** * Test if two objects are equal. */ public boolean equals(Object obj) { if(this == obj) return true; boolean ret = false; if(obj instanceof OAVObjectUsage) { final OAVObjectUsage other = (OAVObjectUsage)obj; ret = object.equals(other.getObject()) && attr.equals(other.getAttribute()); } return ret; }
/** * Test if two objects are equal. */ public boolean equals(Object obj) { if(this == obj) return true; boolean ret = false; if(obj instanceof OAVObjectUsage) { final OAVObjectUsage other = (OAVObjectUsage)obj; ret = object.equals(other.getObject()) && attr.equals(other.getAttribute()); } return ret; }
/** * Ensure that a type has an attribute. * @param object The object. * @param attribute The attribute. * @throws RuntimeException if value is not allowed. */ protected boolean checkTypeHasAttribute(Object object, OAVAttributeType attribute) { if(attribute==null) throw new IllegalArgumentException("Attribute must not null."); OAVObjectType type = attribute.getObjectType() instanceof OAVJavaType ? tmodel.getJavaType(object.getClass()) : (OAVObjectType)types.get(object); if(type==null) throw new RuntimeException("Unknown object type of: "+object); OAVAttributeType attr = type.getAttributeType(attribute.getName()); if(!attribute.equals(attr)) throw new RuntimeException("Attribute must belong to object type: "+attribute+", "+type); return true; }
/** * Ensure that a type has an attribute. * @param object The object. * @param attribute The attribute. * @throws RuntimeException if value is not allowed. */ protected boolean checkTypeHasAttribute(Object object, OAVAttributeType attribute) { if(attribute==null) throw new IllegalArgumentException("Attribute must not null."); OAVObjectType type = attribute.getObjectType() instanceof OAVJavaType ? tmodel.getJavaType(object.getClass()) : (OAVObjectType)types.get(object); if(type==null) throw new RuntimeException("Unknown object type of: "+object); OAVAttributeType attr = type.getAttributeType(attribute.getName()); if(!attribute.equals(attr)) throw new RuntimeException("Attribute must belong to object type: "+attribute+", "+type); return true; }
/** * Get the value or values of a sub attribute. * The subindex specifies the variable which should be accessed. * Each virtual fact has bindings for every subvariable, i.e. * the values contain for each variable its current values. * @param attr The attribute. * @param subindex The subindex. */ public Object getSubAttributeValue(OAVAttributeType attr, int subindex) { assert attr!=null; Object ret; if(attr.equals(getAttribute())) { ret = values.get(subindex); } else { ret = getSuperFact().getSubAttributeValue(attr, subindex); } return ret; }
/** * Get the value or values of a sub attribute. * The subindex specifies the variable which should be accessed. * Each virtual fact has bindings for every subvariable, i.e. * the values contain for each variable its current values. * @param attr The attribute. * @param subindex The subindex. */ public Object getSubAttributeValue(OAVAttributeType attr, int subindex) { assert attr!=null; Object ret; if(attr.equals(getAttribute())) { ret = values.get(subindex); } else { ret = getSuperFact().getSubAttributeValue(attr, subindex); } return ret; }
/** * Ensure that a type has an attribute. * @param id The object (oid). * @param attribute The attribute. * @throws RuntimeException if value is not allowed. */ protected boolean checkTypeHasAttribute(Object id, OAVAttributeType attribute) { // #ifndef MIDP assert nocheck || generator.isId(id); // #endif if(attribute==null) throw new IllegalArgumentException("Attribute must not null."); OAVObjectType type = attribute.getObjectType() instanceof OAVJavaType ? tmodel.getJavaType(id.getClass()) : getType(id); OAVAttributeType attr = type.getAttributeType(attribute.getName()); if(!attribute.equals(attr)) throw new RuntimeException("Attribute must belong to object type: "+attribute+", "+type); return true; }
/** * Ensure that a type has an attribute. * @param id The object (oid). * @param attribute The attribute. * @throws RuntimeException if value is not allowed. */ protected boolean checkTypeHasAttribute(Object id, OAVAttributeType attribute) { // #ifndef MIDP assert nocheck || generator.isId(id); // #endif if(attribute==null) throw new IllegalArgumentException("Attribute must not null."); OAVObjectType type = attribute.getObjectType() instanceof OAVJavaType ? tmodel.getJavaType(id.getClass()) : getType(id); OAVAttributeType attr = type.getAttributeType(attribute.getName()); if(!attribute.equals(attr)) throw new RuntimeException("Attribute must belong to object type: "+attribute+", "+type); return true; }
if(attr.equals(OAVBDIRuntimeModel.agent_has_state)) else if(OAVBDIRuntimeModel.belief_has_fact.equals(attr)) else if(OAVBDIRuntimeModel.beliefset_has_facts.equals(attr)) else if(OAVBDIRuntimeModel.capability_has_internalevents.equals(attr) && newvalue!=null) else if(OAVBDIRuntimeModel.capability_has_messageevents.equals(attr) && newvalue!=null) else if(OAVBDIRuntimeModel.capability_has_outbox.equals(attr) && newvalue!=null) else if(OAVBDIRuntimeModel.capability_has_goals.equals(attr)) else if(OAVBDIRuntimeModel.capability_has_plans.equals(attr)) else if(OAVBDIRuntimeModel.goal_has_lifecyclestate.equals(attr) || OAVBDIRuntimeModel.goal_has_processingstate.equals(attr)) else if(OAVBDIRuntimeModel.plan_has_lifecyclestate.equals(attr))
if(attr.equals(snode.getAttribute()) && Arrays.equals(binds, snode.getSplitPattern()))
if(attr.equals(snode.getAttribute()) && Arrays.equals(binds, snode.getSplitPattern()))