public Object clone () { return new IntegerAttribute(intValue()); }
public Object encode (final Attribute a, final java.util.Map args) throws CodingException { final org.jdom.Element elt = newElement(); elt.addContent(((IntegerAttribute)a).getValue().toString()); return elt; }
public Attribute decode (final Object o, final java.util.Map args) throws CodingException { final org.jdom.Element elt = enforceElement(o); final String text = XmlUtils.fetchTextContent(elt); try { return new IntegerAttribute(Integer.parseInt(text)); } catch (NumberFormatException nfe) { throw new CodingException ("Cannot build an integer from '"+text+"'", nfe); } }
/** * Attempts to turn an attribute into an integer. */ public static int toInt (final ApplicationContext context, Attribute a) { if (a == null) { throw new IllegalArgumentException ("cannot turn a null attribute into an int"); } if (log.isDebugEnabled()) log.debug("toInt() a.class is "+a.getClass().getName()); if (a instanceof XmlAttribute) { final Attribute a2 = ((XmlAttribute)a).getAttributeContent(context); if (a2 != null) a = a2; } if (a instanceof IntegerAttribute) return ((IntegerAttribute)a).intValue(); return Integer.parseInt(a.toString()); }
public void apply (final InFlowWorkItem wi) throws ApplyException { //log.debug("apply()"); if (this.getChildren().size() < 1) { ValueUtils.setResult(wi, new IntegerAttribute(0)); applyToParent(wi); return; } final FlowExpressionId fei = (FlowExpressionId)getChildren().get(0); getExpressionPool().apply(fei, wi); }
public void reply (final InFlowWorkItem wi) throws ReplyException { final org.jdom.Content c = XemeUtils.fetchWorkitemResult(this, wi); ValueUtils.setResult(wi, new IntegerAttribute(XemeUtils.size(c))); replyToParent(wi); }
attr = new IntegerAttribute(Integer.parseInt(fieldValue));
return map2owfe((java.util.Map)o); if (o instanceof Integer) return new IntegerAttribute((Integer)o); if (o instanceof Long) return new LongAttribute((Long)o);
new IntegerAttribute(this.iterationPosition));
variableValue = new BooleanAttribute(value); else if (type.equals(T_INTEGER)) variableValue = new IntegerAttribute(value); else if (type.equals(T_LONG)) variableValue = new LongAttribute(value);