Package ghidra.app.plugin.processors.sleigh.pattern

# Class PatternBlock

java.lang.Object
ghidra.app.plugin.processors.sleigh.pattern.PatternBlock

public class PatternBlock extends Object
A mask/value pair viewed as two bitstreams

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected static final int`
  `LEFT_BYTE`
  `protected static final int`
  `SHAMT`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `PatternBlock(boolean tf)`
  `PatternBlock(int off, int msk, int val)`
  `PatternBlock(PatternBlock a, PatternBlock b)`
  `PatternBlock(ArrayList<?> list)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `alwaysFalse()`
  `boolean`
  `alwaysTrue()`
  `PatternBlock`
  `andBlock(PatternBlock b)`
  `Object`
  `clone()`
  `int`
  `getLength()`
  `int`
  `getMask(int startbit, int size)`
  `int[]`
  `getMaskVector()`
  `int`
  `getNonZeroLength()`
  `int`
  `getOffset()`
  `int`
  `getValue(int startbit, int size)`
  `int[]`
  `getValueVector()`
  `byte[]`
  `getWholeBytes()`
  Extract those portions of the pattern which constitute fully-specified bytes
  `boolean`
  `identical(PatternBlock op2)`
  `boolean`
  `isContextMatch(ParserWalker walker)`
  `boolean`
  `isInstructionMatch(ParserWalker walker)`
  `void`
  `restoreXml(XmlPullParser parser)`
  `void`
  `shift(int sa)`
  `boolean`
  `specializes(PatternBlock op2)`
  `String`
  `toString()`

  ### Methods inherited from class java.lang.Object

  `equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Field Details

  - ### SHAMT

    protected static final int SHAMT
    See Also:
      - Constant Field Values

  - ### LEFT_BYTE

    protected static final int LEFT_BYTE
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### PatternBlock

    public PatternBlock(int off, int msk, int val)

  - ### PatternBlock

    public PatternBlock(boolean tf)

  - ### PatternBlock

    public PatternBlock(PatternBlock a, PatternBlock b)

  - ### PatternBlock

    public PatternBlock(ArrayList<?> list)

- ## Method Details

  - ### getMaskVector

    public int[] getMaskVector()

  - ### getValueVector

    public int[] getValueVector()

  - ### clone

    public Object clone()
    Overrides:
      `clone` in class `Object`

  - ### andBlock

    public PatternBlock andBlock(PatternBlock b)

  - ### specializes

    public boolean specializes(PatternBlock op2)

  - ### identical

    public boolean identical(PatternBlock op2)

  - ### shift

    public void shift(int sa)

  - ### getLength

    public int getLength()

  - ### getMask

    public int getMask(int startbit, int size)

  - ### getValue

    public int getValue(int startbit, int size)

  - ### alwaysTrue

    public boolean alwaysTrue()

  - ### alwaysFalse

    public boolean alwaysFalse()

  - ### isInstructionMatch

    public boolean isInstructionMatch(ParserWalker walker)

  - ### isContextMatch

    public boolean isContextMatch(ParserWalker walker)

  - ### restoreXml

    public void restoreXml(XmlPullParser parser)

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`

  - ### getOffset

    public int getOffset()

  - ### getNonZeroLength

    public int getNonZeroLength()

  - ### getWholeBytes

    public byte[] getWholeBytes()
    Extract those portions of the pattern which constitute fully-specified bytes
    Returns:
      an array of bytes