Package ghidra.app.decompiler.component

# Class TokenHighlights

java.lang.Object
ghidra.app.decompiler.component.TokenHighlights

All Implemented Interfaces:
  `Iterable<HighlightToken>`

public class TokenHighlights extends Object implements Iterable<HighlightToken>
A simple class to manage `HighlightToken`s used to create highlights in the Decompiler. This class allows clients to access highlights either by a `ClangToken` or a `HighlightToken`.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `TokenHighlights()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `add(HighlightToken t)`
  Adds the given highlight to this container
  `void`
  `clear()`
  Removes all highlights from this container
  `boolean`
  `contains(ClangToken t)`
  Returns true if this class has a highlight for the given token
  `Map<String,Color>`
  `copyHighlightsByName()`
  `HighlightToken`
  `get(ClangToken t)`
  Gets the current highlight for the given token
  `boolean`
  `isEmpty()`
  Returns true if there are not highlights
  `Iterator<HighlightToken>`
  `iterator()`
  `void`
  `remove(ClangToken t)`
  Removes the highlight for the given token
  `int`
  `size()`
  Returns the number of highlights
  `String`
  `toString()`

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

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

  ### Methods inherited from interface java.lang.Iterable

  `forEach, spliterator`

- ## Constructor Details

  - ### TokenHighlights

    public TokenHighlights()

- ## Method Details

  - ### copyHighlightsByName

    public Map<String,Color> copyHighlightsByName()

  - ### isEmpty

    public boolean isEmpty()
    Returns true if there are not highlights
    Returns:
      true if there are not highlights

  - ### size

    public int size()
    Returns the number of highlights
    Returns:
      the number of highlights

  - ### add

    public void add(HighlightToken t)
    Adds the given highlight to this container
    Parameters:
      `t` - the highlight

  - ### get

    public HighlightToken get(ClangToken t)
    Gets the current highlight for the given token
    Parameters:
      `t` - the token
    Returns:
      the highlight

  - ### contains

    public boolean contains(ClangToken t)
    Returns true if this class has a highlight for the given token
    Parameters:
      `t` - the token
    Returns:
      true if this class has a highlight for the given token

  - ### clear

    public void clear()
    Removes all highlights from this container

  - ### remove

    public void remove(ClangToken t)
    Removes the highlight for the given token
    Parameters:
      `t` - the token

  - ### iterator

    public Iterator<HighlightToken> iterator()
    Specified by:
      `iterator` in interface `Iterable<HighlightToken>`

  - ### toString

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