/** Abstracts directional comparisons based on scan direction. */ private enum Order { ASC { @Override public boolean lt(int lhs, int rhs) { return lhs < rhs; } @Override public boolean gt(int lhs, int rhs) { return lhs > rhs; } @Override public byte inc(byte val) { // TODO: what about over/underflow? return (byte) (val + 1); } @Override public boolean isMax(byte val) { return val == (byte) 0xff; } @Override public byte min() { return 0; } }, DESC {
/** Abstracts directional comparisons based on scan direction. */ private enum Order { ASC { @Override public boolean lt(int lhs, int rhs) { return lhs < rhs; } @Override public boolean gt(int lhs, int rhs) { return lhs > rhs; } @Override public byte inc(byte val) { // TODO: what about over/underflow? return (byte) (val + 1); } @Override public boolean isMax(byte val) { return val == (byte) 0xff; } @Override public byte min() { return 0; } }, DESC {
/** Abstracts directional comparisons based on scan direction. */ private enum Order { ASC { public boolean lt(int lhs, int rhs) { return lhs < rhs; } public boolean gt(int lhs, int rhs) { return lhs > rhs; } public byte inc(byte val) { // TODO: what about over/underflow? return (byte) (val + 1); } public boolean isMax(byte val) { return val == (byte) 0xff; } public byte min() { return 0; } }, DESC { public boolean lt(int lhs, int rhs) { return lhs > rhs; } public boolean gt(int lhs, int rhs) {
/** Abstracts directional comparisons based on scan direction. */ private enum Order { ASC { @Override public boolean lt(int lhs, int rhs) { return lhs < rhs; } @Override public boolean gt(int lhs, int rhs) { return lhs > rhs; } @Override public byte inc(byte val) { // TODO: what about over/underflow? return (byte) (val + 1); } @Override public boolean isMax(byte val) { return val == (byte) 0xff; } @Override public byte min() { return 0; } }, DESC {