Package ghidra.app.decompiler.component
Class TokenHighlights
- java.lang.Object
-
- ghidra.app.decompiler.component.TokenHighlights
-
- All Implemented Interfaces:
java.lang.Iterable<HighlightToken>
public class TokenHighlights extends java.lang.Object implements java.lang.Iterable<HighlightToken>
A simple class to manageHighlightToken
s used to create highlights in the Decompiler. This class allows clients to access highlights either by aClangToken
or aHighlightToken
.
-
-
Constructor Summary
Constructors Constructor Description TokenHighlights()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(HighlightToken t)
Adds the given highlight to this containervoid
clear()
Removes all highlights from this containerboolean
contains(ClangToken t)
Returns true if this class has a highlight for the given tokenjava.util.Map<java.lang.String,java.awt.Color>
copyHighlightsByName()
HighlightToken
get(ClangToken t)
Gets the current highlight for the given tokenjava.util.Set<HighlightToken>
getHighlightsByFunction(Function f)
Returns all highlights for the given functionboolean
isEmpty()
Returns true if there are not highlightsjava.util.Iterator<HighlightToken>
iterator()
void
remove(ClangToken t)
Removes the highlight for the given tokenjava.util.Set<HighlightToken>
removeHighlightsByFunction(Function function)
Removes all highlights associated with the given functionint
size()
Returns the number of highlightsjava.lang.String
toString()
-
-
-
Method Detail
-
copyHighlightsByName
public java.util.Map<java.lang.String,java.awt.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
-
getHighlightsByFunction
public java.util.Set<HighlightToken> getHighlightsByFunction(Function f)
Returns all highlights for the given function- Parameters:
f
- the function- Returns:
- the highlights
-
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
-
removeHighlightsByFunction
public java.util.Set<HighlightToken> removeHighlightsByFunction(Function function)
Removes all highlights associated with the given function- Parameters:
function
- the function- Returns:
- the removed highlights; empty if no highlights existed
-
iterator
public java.util.Iterator<HighlightToken> iterator()
- Specified by:
iterator
in interfacejava.lang.Iterable<HighlightToken>
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-