Package net.emustudio.edigen.nodes
Class Pattern
- java.lang.Object
-
- net.emustudio.edigen.nodes.TreeNode
-
- net.emustudio.edigen.nodes.Pattern
-
public class Pattern extends TreeNode
Pattern node - a sequence of bits used during instruction decoding.
-
-
Constructor Summary
Constructors Constructor Description Pattern(BitSequence bits)Constructs a pattern.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(Visitor visitor)Accepts the visitor.Patternand(Mask mask)Returns a pattern ANDed with the specified mask.booleanequals(java.lang.Object o)BitSequencegetBits()Returns the bit sequence.inthashCode()TreeNodeshallowCopy()java.lang.StringtoString()Returns the pattern as a string in binary notation.-
Methods inherited from class net.emustudio.edigen.nodes.TreeNode
acceptChildren, addChild, addChildren, addChildren, childCount, copy, dump, getChild, getChildren, getLine, getParent, remove, setLine
-
-
-
-
Constructor Detail
-
Pattern
public Pattern(BitSequence bits)
Constructs a pattern.- Parameters:
bits- the bit sequence
-
-
Method Detail
-
getBits
public BitSequence getBits()
Returns the bit sequence.- Returns:
- the bit sequence
-
and
public Pattern and(Mask mask)
Returns a pattern ANDed with the specified mask.- Parameters:
mask- the mask- Returns:
- the resulting pattern
-
accept
public void accept(Visitor visitor) throws SemanticException
Accepts the visitor.- Overrides:
acceptin classTreeNode- Parameters:
visitor- the visitor object- Throws:
SemanticException- depends on the specific visitor
-
toString
public java.lang.String toString()
Returns the pattern as a string in binary notation.- Overrides:
toStringin classjava.lang.Object- Returns:
- the string
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
shallowCopy
public TreeNode shallowCopy()
- Specified by:
shallowCopyin classTreeNode
-
-