Package ghidra.taint.model

# Class TaintSet

java.lang.Object
ghidra.taint.model.TaintSet

public class TaintSet extends Object
An immutable set of multiple taint marks

A variable in an emulator could be tainted by multiple marks, so we must use vectors of sets, not vectors of marks. Please see `TaintMark.equals(Object)` regarding the equality of tagged marks.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final TaintSet`
  `EMPTY`
  The empty set, the default for all state variables

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `equals(Object obj)`
  `Set<TaintMark>`
  `getMarks()`
  Get the marks in this set
  `int`
  `hashCode()`
  `boolean`
  `isEmpty()`
  Check if this set is empty
  `static TaintSet`
  `of(TaintMark... marks)`
  Create a taint set of the given marks
  `static TaintSet`
  `parse(String string)`
  Parse a set of taint marks
  `TaintSet`
  `tagged(String string)`
  Construct the taint set formed by tagging each mark in this set
  `String`
  `toString()`
  Convert the set to a string
  `TaintSet`
  `union(TaintSet that)`
  Construct the taint set from the union of marks of this and the given taint set

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

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## Field Details

  - ### EMPTY

    public static final TaintSet EMPTY
    The empty set, the default for all state variables

- ## Method Details

  - ### parse

    public static TaintSet parse(String string)
    Parse a set of taint marks

    The form is a semicolon-separated list of taint marks, e.g., "`myVar:tag1,tag2;anotherVar;yetAnother`".

    Parameters:
      `string` - the string to parse
    Returns:
      the resulting set

  - ### of

    public static TaintSet of(TaintMark... marks)
    Create a taint set of the given marks
    Parameters:
      `marks` - the marks
    Returns:
      the set

  - ### toString

    public String toString()
    Convert the set to a string
    Overrides:
      `toString` in class `Object`
    See Also:
      - `parse(String)`

  - ### equals

    public boolean equals(Object obj)
    Overrides:
      `equals` in class `Object`

  - ### hashCode

    public int hashCode()
    Overrides:
      `hashCode` in class `Object`

  - ### getMarks

    public Set<TaintMark> getMarks()
    Get the marks in this set
    Returns:
      the marks

  - ### isEmpty

    public boolean isEmpty()
    Check if this set is empty
    Returns:
      the marks

  - ### union

    public TaintSet union(TaintSet that)
    Construct the taint set from the union of marks of this and the given taint set
    Parameters:
      `that` - another taint set
    Returns:
      the union

  - ### tagged

    public TaintSet tagged(String string)
    Construct the taint set formed by tagging each mark in this set
    Parameters:
      `string` - the tag to add to each mark
    Returns:
      the new set