/** * Get the values of a parameterset. * @return The values. */ protected Object[] getValues(Class<?> type) { Object ret; List<Object> vals = internalGetValues(); int size = vals==null? 0: vals.size(); ret = type!=null? ret = Array.newInstance(SReflect.getWrappedType(type), size): new Object[size]; if(vals!=null) System.arraycopy(vals.toArray(new Object[vals.size()]), 0, ret, 0, vals.size()); return (Object[])ret; }
clazz1 = getWrappedType(clazz1); clazz2 = getWrappedType(clazz2);
/** * Test if a value is decodable to the same type. * Works for basic (final) types only and checks if the * two types are of same class. */ protected boolean isDecodableToSameType(Object property, Object value, IContext context) { boolean ret = true; if(value!=null) { ret = false; if(property instanceof BeanProperty) { BeanProperty prop = (BeanProperty)property; // Do not allow strings -> avoids strings being written as attributes by default. ret = !(value instanceof String) && value.getClass().equals(SReflect.getWrappedType(prop.getSetterType())); } else if(property instanceof Classname) { // Allow XML class name as attribute ret = true; } } return ret; }
/** * */ public static Object[] getFacts(IOAVState state, Object handle) { Object[] ret; Object mbelset = state.getAttributeValue(handle, OAVBDIRuntimeModel.element_has_model); Collection facts = state.getAttributeValues(handle, OAVBDIRuntimeModel.beliefset_has_facts); Class clazz = (Class)state.getAttributeValue(mbelset, OAVBDIMetaModel.typedelement_has_class); ret = (Object[])Array.newInstance(SReflect.getWrappedType(clazz), facts!=null ? facts.size() : 0); if(facts!=null) { ret = facts.toArray(ret); } return ret; }
clazz = getWrappedType(clazz); if(isSupertype(Number.class, clazz))
if(val!=null && ((exact && val.getClass().equals(SReflect.getWrappedType(type))) || (!exact && SReflect.isSupertype(type, val.getClass()))))
/** * Get the facts of a beliefset. * @return The facts. */ public Object[] getFacts() { Object ret; List<Object> facts = internalGetValues(); Class<?> type = ((MBelief)getModelElement()).getType(getAgent().getClassLoader()); int size = facts==null? 0: facts.size(); ret = type!=null? ret = Array.newInstance(SReflect.getWrappedType(type), size): new Object[size]; if(facts!=null) { System.arraycopy(facts.toArray(new Object[facts.size()]), 0, ret, 0, facts.size()); } return (Object[])ret; }
matches[i] += getWrappedType(paramtypes[i][j])==getWrappedType(argtypes[j]) ? 2 : 1; if(matches[i]>hq) hq = matches[i];
else if(SReflect.getWrappedType(type)!=type) // Number type
else if(SReflect.getWrappedType(type)!=type) // Number type
type = SReflect.getWrappedType(type); if(type==Float.class)
Object value = context.getParameterValue(param.getName()); JComponent comp; if(SReflect.getWrappedType(param.getClazz().getType(instance.getClassLoader(), instance.getModel().getAllImports())).equals(Boolean.class))
Object[] vals = (Object[])Array.newInstance(SReflect.getWrappedType(clazz), coll!=null ? coll.size() : 0); if(coll!=null) Object[] vals = (Object[])Array.newInstance(SReflect.getWrappedType(clazz), coll!=null ? coll.size() : 0); if(coll!=null)
if(SReflect.getWrappedType(ptypes[i]).isInstance(event.getValue()))
if(SReflect.getWrappedType(field.getType()).equals(Boolean.class))
if(SReflect.getWrappedType(ptypes[i]).isInstance(event.getValue())) set = true; else if(SReflect.getWrappedType(ptypes[i]).isInstance(ci.getValue()))
if(SReflect.getWrappedType(ptypes[i]).isInstance(event.getValue())) set = true; else if(SReflect.getWrappedType(ptypes[i]).isInstance(ci.getValue()))
setStaticType(SReflect.getWrappedType(retype)); this.setStaticType(SReflect.getWrappedType(field.getType()));
clazz = Array.newInstance(SReflect.getWrappedType(clazz), 0).getClass(); ret = new Variable(name, state.getTypeModel().getJavaType(clazz), false, true); Variable belvar = new Variable(name+"_bel", OAVBDIRuntimeModel.beliefset_type, false, true); clazz = Array.newInstance(SReflect.getWrappedType(clazz), 0).getClass(); ret = new Variable(name, state.getTypeModel().getJavaType(clazz), false, true); Variable belvar = new Variable(name+"_bel", OAVBDIRuntimeModel.beliefset_type, false, true); Class clazz = SReflect.getWrappedType((Class)state.getAttributeValue(mpar, OAVBDIMetaModel.typedelement_has_class)); ret = new Variable(name, state.getTypeModel().getJavaType(clazz), false, true); Variable parvar = new Variable(context.generateVariableName(), OAVBDIRuntimeModel.parameter_type, true, true); Class clazz = SReflect.getWrappedType((Class)state.getAttributeValue(mpar, OAVBDIMetaModel.typedelement_has_class)); clazz = Array.newInstance(SReflect.getWrappedType(clazz), 0).getClass(); ret = new Variable(name, state.getTypeModel().getJavaType(clazz), false, true); Variable parvar = new Variable(context.generateVariableName(), OAVBDIRuntimeModel.parameterset_type, true, true); Class clazz = SReflect.getWrappedType((Class)state.getAttributeValue(mpar, OAVBDIMetaModel.typedelement_has_class)); ret = new Variable(name, state.getTypeModel().getJavaType(clazz), false, true); Variable parvar = new Variable(context.generateVariableName(), OAVBDIRuntimeModel.parameter_type, true, true); Class clazz = SReflect.getWrappedType((Class)state.getAttributeValue(mpar, OAVBDIMetaModel.typedelement_has_class)); clazz = Array.newInstance(SReflect.getWrappedType(clazz), 0).getClass(); ret = new Variable(name, state.getTypeModel().getJavaType(clazz), false, true); Variable parvar = new Variable(context.generateVariableName(), OAVBDIRuntimeModel.parameterset_type, true, true);
ExpressionNode right = (ExpressionNode)jjtGetChild(1); Class cleft = left.getStaticType()!=null ? SReflect.getWrappedType(left.getStaticType()) : null; Class cright = right.getStaticType()!=null ? SReflect.getWrappedType(right.getStaticType()) : null; if(cleft==null && cright==null)