Update Direction.java

Added support for random generation and integer conversion