/** * getMaxOccur method * @return int * * If -1, it's UNBOUNDED. */ public int getMaxOccur() { return fCMContent.getMaxOccur(); }
if (content.getMaxOccur() > 1) if (itemCount.count + 1 >= content.getMaxOccur())
public void addOccurenceSymbol(CMContent content) { int min = content.getMinOccur(); int max = content.getMaxOccur(); if (min == 0) { if (max > 1 || max == -1) { sb.append("*"); //$NON-NLS-1$ } else { sb.append("?"); //$NON-NLS-1$ } } else if (max > 1 || max == -1) { sb.append("+"); //$NON-NLS-1$ } } }
protected void createArcs(GraphNode in, GraphNode out, CMContent cmContent, boolean isAllGroup) { //println("+createArcs() " + ed.getDescription() + " " + ed.getMinOccur()); GraphNode prev = context.from; GraphNode next = new GraphNode(getGraphNodeName()); prev.addArc(new Arc(Arc.PREV_IN, in, cmContent)); out.addArc(new Arc(Arc.OUT_NEXT, next, cmContent)); if (context.to != null) { next.addArc(new Arc(Arc.LINK, context.to, cmContent)); } else { context.from = next; } if (cmContent.getMinOccur() == 0) { // todo... should we see if an optional arc has already been added? prev.addArc(new Arc(Arc.OPTIONAL, next, cmContent)); } if (cmContent.getMaxOccur() == -1 || cmContent.getMaxOccur() > 1 || isAllGroup) { out.addArc(new Arc(Arc.REPEAT, in, cmContent)); } }