Class ElementWithCardinality

    • Constructor Detail

      • ElementWithCardinality

        public ElementWithCardinality​(GrammarItem content)
    • Method Detail

      • getChildren

        public List<GrammarItem> getChildren()
        Description copied from interface: GrammarItem
        get the child items as a list. Terminals will return an empty list, non-lists will return a list of one.
        Specified by:
        getChildren in interface GrammarItem
        Returns:
      • getMin

        public abstract int getMin()
      • isUnbounded

        public abstract boolean isUnbounded()
      • isPlural

        public boolean isPlural()
        Description copied from interface: GrammarItem
        are there more than one of these items. Some serialisations will require brackets of some kind if there are
        Specified by:
        isPlural in interface GrammarItem
        Returns:
        true if there are multiple of these items.
      • isKeywordPart

        public boolean isKeywordPart()
        Description copied from interface: GrammarItem
        Could this be part or all of a keyword ? Is either a letter or all of its parts are letters
        Specified by:
        isKeywordPart in interface GrammarItem
        Returns:
        true iff this could be part of a keyword
      • getContentStructure

        protected String getContentStructure​(String indent)
      • reachThrough

        public GrammarItem reachThrough()
        Description copied from interface: GrammarItem
        if this item is a wrapper round a single item, get that one. A wrapper may affect cardinality, optionality etc.
        Specified by:
        reachThrough in interface GrammarItem
        Returns:
        the wrapped item, or this item itself it if isn't wrapper.