diva.sketch.parser2d
Interface Constituent
- All Known Implementing Classes:
- CompositeConstituent, TerminalConstituent
- public abstract interface Constituent
Constituent is a term borrowed from linguistics that refers to a
natural grouping of language elements. So in other words, a
constituent is either a terminal or non-terminal entity in the
grammar. A default non-terminal implementation is given by the
CompositeConstituent class; TerminalConstituent provides a simple
class for terminals, though users of this package will probably
implement the terminal constituents themselves for space/time
efficiency.
Note: implementors should override the "hashCode" and
"equals" methods so that memoization works in the parser.
- Version:
- $Revision: 1.1 $
- See Also:
CompositeConstituent
,
TerminalConstituent
Method Summary |
java.awt.geom.Rectangle2D |
getBounds()
Return the 2D bounding box of the constituent. |
java.lang.String |
getType()
Return the type of the constituent (its LHS) |
getType
public java.lang.String getType()
- Return the type of the constituent (its LHS)
getBounds
public java.awt.geom.Rectangle2D getBounds()
- Return the 2D bounding box of the constituent.