/** * getMinOccur method * @return int * * If 0, it's OPTIONAL. * If 1, it's REQUIRED. */ public int getMinOccur() { return fCMContent.getMinOccur(); }
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$ } } }
if (cmNode.getMinOccur() == 0)
ItemCount itemCount = (ItemCount)map.get(node); if (itemCount.count < content.getMinOccur())
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)); } }