Class ComparisonMatching
java.lang.Object
net.covers1624.coffeegrinder.bytecode.matching.ComparisonMatching
Created by covers1624 on 22/11/21.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable ComparisonmatchComparison(@Nullable Instruction insn) Matches the given Instruction to aComparisoninstruction.static @Nullable ComparisonmatchComparison(@Nullable Instruction insn, Comparison.ComparisonKind kind) Match the given Instruction to aComparisonof the given kind.static @Nullable ComparisonmatchComparison(@Nullable Instruction insn, Comparison.ComparisonKind kind, LocalVariable left, LocalVariable right) Match the given Instruction to aComparisonof the given kind which loads the given left and right variables.static @Nullable ComparisonmatchEqualNull(@Nullable Instruction insn, LocalVariable variable) Matches aComparisonwhich checks if the given variable equalsLdcNull.static @Nullable ComparisonmatchNotEqualNull(@Nullable Instruction insn, LocalVariable variable) Matches aComparisonwhich checks if the given variable does not equalLdcNull.
-
Constructor Details
-
ComparisonMatching
public ComparisonMatching()
-
-
Method Details
-
matchComparison
Matches the given Instruction to aComparisoninstruction.- Parameters:
insn- The Instruction to match.- Returns:
- The
Comparisonornull.
-
matchComparison
@Nullable public static @Nullable Comparison matchComparison(@Nullable @Nullable Instruction insn, Comparison.ComparisonKind kind) Match the given Instruction to aComparisonof the given kind.- Parameters:
insn- The Instruction to match.kind- The Kind of comparison.- Returns:
- The
Comparisonornull.
-
matchComparison
@Nullable public static @Nullable Comparison matchComparison(@Nullable @Nullable Instruction insn, Comparison.ComparisonKind kind, LocalVariable left, LocalVariable right) Match the given Instruction to aComparisonof the given kind which loads the given left and right variables.- Parameters:
insn- The Instruction to match.kind- The Kind of comparison.left- The LeftLocalVariable.right- The rightLocalVariable.- Returns:
- The
Comparisonornull.
-
matchNotEqualNull
@Nullable public static @Nullable Comparison matchNotEqualNull(@Nullable @Nullable Instruction insn, LocalVariable variable) Matches aComparisonwhich checks if the given variable does not equalLdcNull.- Parameters:
insn- The Instruction to match.variable- The variable.- Returns:
- The
Comparisonornull
-
matchEqualNull
@Nullable public static @Nullable Comparison matchEqualNull(@Nullable @Nullable Instruction insn, LocalVariable variable) Matches aComparisonwhich checks if the given variable equalsLdcNull.- Parameters:
insn- The Instruction to match.variable- The variable.- Returns:
- The
Comparisonornull
-