Package ghidra.program.model.lang.protorules

# Class MetaTypeFilter

java.lang.Object
ghidra.program.model.lang.protorules.SizeRestrictedFilter
ghidra.program.model.lang.protorules.MetaTypeFilter

All Implemented Interfaces:
  `DatatypeFilter`

public class MetaTypeFilter extends SizeRestrictedFilter
Filter on a single meta data-type. Filters on TYPE_STRUCT or TYPE_FLOAT etc. Additional filtering on size of the data-type can be configured.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected int`
  `metaType`

  ### Fields inherited from class ghidra.program.model.lang.protorules.SizeRestrictedFilter

  `maxSize, minSize, NAME`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `MetaTypeFilter(int meta)`
  Constructor for use with decode().
  `MetaTypeFilter(int meta, int min, int max)`
  Constructor

- ## Method Summary

  Modifier and Type
  Method
  Description
  `DatatypeFilter`
  `clone()`
  Make a copy of this filter
  `void`
  `encode(Encoder encoder)`
  Encode this filter and its configuration to a stream
  `boolean`
  `filter(DataType dt)`
  Test whether the given data-type belongs to this filter's data-type class
  `boolean`
  `isEquivalent(DatatypeFilter op)`
  Test if the given filter is configured and performs identically to this
  `void`
  `restoreXml(XmlPullParser parser)`
  Configure details of the data-type class being filtered from the given stream

  ### Methods inherited from class ghidra.program.model.lang.protorules.SizeRestrictedFilter

  `encodeAttributes, filterOnSize, restoreAttributesXml`

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

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

- ## Field Details

  - ### metaType

    protected int metaType

- ## Constructor Details

  - ### MetaTypeFilter

    public MetaTypeFilter(int meta)
    Constructor for use with decode().
    Parameters:
      `meta` - is the data-type metatype to filter on

  - ### MetaTypeFilter

    public MetaTypeFilter(int meta, int min, int max)
    Constructor
    Parameters:
      `meta` - is the data-type metatype to filter on
      `min` - is the minimum size in bytes
      `max` - is the maximum size in bytes

- ## Method Details

  - ### isEquivalent

    public boolean isEquivalent(DatatypeFilter op)
    Description copied from interface: `DatatypeFilter`
    Test if the given filter is configured and performs identically to this
    Specified by:
      `isEquivalent` in interface `DatatypeFilter`
    Overrides:
      `isEquivalent` in class `SizeRestrictedFilter`
    Parameters:
      `op` - is the given filter
    Returns:
      true if the two filters are equivalent

  - ### clone

    public DatatypeFilter clone()
    Description copied from interface: `DatatypeFilter`
    Make a copy of this filter
    Specified by:
      `clone` in interface `DatatypeFilter`
    Overrides:
      `clone` in class `SizeRestrictedFilter`
    Returns:
      the new copy

  - ### filter

    public boolean filter(DataType dt)
    Description copied from interface: `DatatypeFilter`
    Test whether the given data-type belongs to this filter's data-type class
    Specified by:
      `filter` in interface `DatatypeFilter`
    Overrides:
      `filter` in class `SizeRestrictedFilter`
    Parameters:
      `dt` - is the given data-type to test
    Returns:
      true if the data-type is in the class, false otherwise

  - ### encode

    public void encode(Encoder encoder) throws IOException
    Description copied from interface: `DatatypeFilter`
    Encode this filter and its configuration to a stream
    Specified by:
      `encode` in interface `DatatypeFilter`
    Overrides:
      `encode` in class `SizeRestrictedFilter`
    Parameters:
      `encoder` - is the stream encoder
    Throws:
      `IOException` - for problems writing to the stream

  - ### restoreXml

    public void restoreXml(XmlPullParser parser) throws XmlParseException
    Description copied from interface: `DatatypeFilter`
    Configure details of the data-type class being filtered from the given stream
    Specified by:
      `restoreXml` in interface `DatatypeFilter`
    Overrides:
      `restoreXml` in class `SizeRestrictedFilter`
    Parameters:
      `parser` - is the given stream decoder
    Throws:
      `XmlParseException` - if there are problems with the stream