-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
binary reverse OO with <operator>Rev method. for javac8 plugin
- Loading branch information
Showing
4 changed files
with
47 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import java.math.BigInteger; | ||
|
||
public class BinaryRev { | ||
static class MyInt { | ||
public int v; | ||
public MyInt(int v) { this.v = v; } | ||
public MyInt multiply(int a) { return new MyInt(v*a); } | ||
public MyInt multiplyRev(int a) { return multiply(a); } | ||
public boolean equals(Object o) { | ||
return (o instanceof MyInt) && ((MyInt)o).v == v; | ||
} | ||
} | ||
|
||
public static boolean test() { | ||
MyInt a = new MyInt(1); | ||
return (a*2).equals(2*a); | ||
} | ||
} |