/** * Constructor used to make a comparator which will compare Locators * using the context provided. This implementation doesn't use the * context yet. */ public LocatorComparator(Collection<TopicIF> context) { this.scopes = context; tc = new StringifierComparator<String>(); }
/** * Empty constructor, used on application startup to initialise a * "fast" comparator which will compare Locators using no context. */ public LocatorComparator() { tc = new StringifierComparator<String>(); }
public static Comparator<TopicIF> getTopicNameComparator(Collection<TopicIF> scope) { return new StringifierComparator<TopicIF>(TopicStringifiers.getTopicNameStringifier(scope)); }
public static Comparator<TypedIF> getTypedIFComparator(Collection<TopicIF> scope) { return new TypedIFComparator(new StringifierComparator<TopicIF>(TopicStringifiers.getTopicNameStringifier(scope))); }
new StringifierComparator<LocatorIF>(new LocatorStringifier())); while (it.hasNext()) writeResourceRef(it.next(), dh); new StringifierComparator<LocatorIF>(new LocatorStringifier())); while (it.hasNext()) { LocatorIF loc = it.next(); new StringifierComparator<OccurrenceIF>(new OccurrenceStringifier())); while (it.hasNext()) { OccurrenceIF occ = it.next();
public ContextHolder(Map<TopicIF, String> topicIds) { this.topicIds = topicIds; topicRefComparator = new StringifierComparator<TopicIF>(new TopicRefStringifier(topicIds)); topicComparator = TopicComparator.getInstance(); baseNameComparator = TopicNameComparator.getInstance(); variantNameComparator = VariantNameComparator.getInstance(); assocComparator = AssociationComparator.getInstance(); roleComparator = AssociationRoleComparator.getInstance(); }
public void testStringifierComparator() { UpperCaseGrabber upg = new UpperCaseGrabber(); GrabberStringifier grb = new GrabberStringifier(upg); testComparator(new StringifierComparator(grb).compare(upg.grab("foobar"), "FOOBAR"), 0, 1); }
/** * 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()))); }