public StringifierGrabber(StringifierIF<T> stringifier) { setStringifier(stringifier); }
public void testStringifierGrabber() { testGrabber(new StringifierGrabber().grab(new Float(1234.56)), new Float(1234.56).toString(), new Float(1234).toString()); testGrabber(new StringifierGrabber().grab(new Double(4321.56)), new Double(4321.56).toString(), new Double(4321.57).toString()); testGrabber(new StringifierGrabber().grab(new Integer(2987)), new Integer(2987).toString(), new Integer(2986).toString()); testGrabber(new StringifierGrabber().grab(new Integer(2987)), new Integer(2987).toString(), new Float(2987).toString()); testGrabber(new StringifierGrabber().grab(Boolean.TRUE), Boolean.TRUE.toString(), Boolean.FALSE.toString()); }
/** * Constructor used to make a comparator which will compare * Associations using the context provided. */ public AssociationComparator(Collection<TopicIF> context) { this.scopes = context; if (scopes == null) scopes = Collections.emptyList(); StringifierIF<TopicIF> bts = new GrabberStringifier<TopicIF, TopicNameIF>(new TopicNameGrabber(scopes), new NameStringifier()); tc = new StringifierComparator<TopicIF>(new GrabberStringifier<TopicIF, String>(new GrabberGrabber<TopicIF, String>(new StringifierGrabber<TopicIF>(bts), new UpperCaseGrabber()))); }