001 package lrs.visitor; 002 import lrs.*; 003 import logic.*; 004 005 // This class is so the empty node can produce a valid return object that 006 // will always fail a compare or equals operation. Note that the return data 007 // compares the local data in the GetMin algorithm. The other order would have 008 // worked however, assuming that Integer.MAX_VALUE is not a valid data value. 009 public class CompareFalse extends CompareObject 010 { 011 012 private static final IBoolean falseBoolean = BooleanFactory.Singleton.makeBoolean(false); 013 // Instantiate itself with the maximum possible integer value 014 public CompareFalse() { 015 super(Integer.MAX_VALUE); 016 } 017 018 public IBoolean compare(IComparable x) { 019 return falseBoolean; 020 } 021 022 public IBoolean equals(IComparable x) { 023 return falseBoolean; 024 } 025 }