Package org.opencypher.tools.g4tree
Class ElementWithCardinality
- java.lang.Object
-
- org.opencypher.tools.g4tree.ElementWithCardinality
-
- All Implemented Interfaces:
Element,GrammarItem
- Direct Known Subclasses:
Group,InOptional,OneOrMore,ZeroOrMore
public abstract class ElementWithCardinality extends Object implements Element
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.opencypher.tools.g4tree.GrammarItem
GrammarItem.ItemType
-
-
Field Summary
-
Fields inherited from interface org.opencypher.tools.g4tree.GrammarItem
INDENT
-
-
Constructor Summary
Constructors Constructor Description ElementWithCardinality(GrammarItem content)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description GrammarItemextractContent()List<GrammarItem>getChildren()get the child items as a list.protected StringgetContentStructure(String indent)abstract intgetMin()GrammarItem.ItemTypegetType()what type, in terms of how to process its conversion to main grammarbooleanisKeywordPart()Could this be part or all of a keyword ? Is either a letter or all of its parts are lettersbooleanisPlural()are there more than one of these items.abstract booleanisUnbounded()GrammarItemreachThrough()if this item is a wrapper round a single item, get that one.StringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.opencypher.tools.g4tree.GrammarItem
getStructure
-
-
-
-
Constructor Detail
-
ElementWithCardinality
public ElementWithCardinality(GrammarItem content)
-
-
Method Detail
-
getType
public GrammarItem.ItemType getType()
Description copied from interface:GrammarItemwhat type, in terms of how to process its conversion to main grammar- Specified by:
getTypein interfaceGrammarItem- Returns:
-
getChildren
public List<GrammarItem> getChildren()
Description copied from interface:GrammarItemget the child items as a list. Terminals will return an empty list, non-lists will return a list of one.- Specified by:
getChildrenin interfaceGrammarItem- Returns:
-
getMin
public abstract int getMin()
-
isUnbounded
public abstract boolean isUnbounded()
-
isPlural
public boolean isPlural()
Description copied from interface:GrammarItemare there more than one of these items. Some serialisations will require brackets of some kind if there are- Specified by:
isPluralin interfaceGrammarItem- Returns:
- true if there are multiple of these items.
-
isKeywordPart
public boolean isKeywordPart()
Description copied from interface:GrammarItemCould this be part or all of a keyword ? Is either a letter or all of its parts are letters- Specified by:
isKeywordPartin interfaceGrammarItem- Returns:
- true iff this could be part of a keyword
-
extractContent
public GrammarItem extractContent()
-
reachThrough
public GrammarItem reachThrough()
Description copied from interface:GrammarItemif this item is a wrapper round a single item, get that one. A wrapper may affect cardinality, optionality etc.- Specified by:
reachThroughin interfaceGrammarItem- Returns:
- the wrapped item, or this item itself it if isn't wrapper.
-
-