better measurement

This commit is contained in:
bancika
2011-01-10 19:37:13 +00:00
parent 3fd425f2cd
commit ee01f390da
12 changed files with 92 additions and 43 deletions
@@ -32,4 +32,15 @@ public abstract class AbstractComponent<T> implements IDIYComponent<T> {
public String toString() {
return name;
}
/**
* Returns the closest odd number, i.e. x when x is odd, or x + 1 when x is
* even.
*
* @param x
* @return
*/
protected int getClosestOdd(int x) {
return (x / 2) * 2 + 1;
}
}