Update Rule.java

Created the flip method.