@Test public void testCompareTo() { PageletURI previous = new PageletURIImpl(uri, composer, position - 1); PageletURI next = new PageletURIImpl(uri, composer, position + 1); assertEquals(1, location.compareTo(previous)); assertEquals(0, location.compareTo(location)); assertEquals(-1, location.compareTo(next)); }
public int compareTo(PageletURI l) { if (pageURI != null) { if (pageURI.equals(l.getPageURI()) && composer == null && position < 0) return 0; } else if (composer != null) { if (composer.equals(l.getComposer()) && position < 0) return 0; } return Integer.valueOf(position).compareTo(Integer.valueOf(l.getPosition())); }
PageletURIImpl implements PageletURI { public int compareTo(PageletURI l) { if (pageURI != null) { if (pageURI.equals(l.getPageURI()) && composer == null && position < 0) return 0; } else if (composer != null) { if (composer.equals(l.getComposer()) && position < 0) return 0; } return Integer.valueOf(position).compareTo(Integer.valueOf(l.getPosition())); } }
PageletURIImpl implements PageletURI { public int compareTo(PageletURI l) { if (pageURI != null) { if (pageURI.equals(l.getPageURI()) && composer == null && position < 0) return 0; } else if (composer != null) { if (composer.equals(l.getComposer()) && position < 0) return 0; } return Integer.valueOf(position).compareTo(Integer.valueOf(l.getPosition())); } PageletURIImpl(ResourceURI pageURI, String composer, int position); }
PageletURIImpl implements PageletURI { public int compareTo(PageletURI l) { if (pageURI != null) { if (pageURI.equals(l.getPageURI()) && composer == null && position < 0) return 0; } else if (composer != null) { if (composer.equals(l.getComposer()) && position < 0) return 0; } return Integer.valueOf(position).compareTo(Integer.valueOf(l.getPosition())); } PageletURIImpl(ResourceURI pageURI, String composer, int position); Site getSite(); ResourceURI getPageURI(); String getComposer(); int getPosition(); void setURI(ResourceURI uri); void setComposer(String composer); void setPosition(int position); @Override int hashCode(); @Override boolean equals(Object o); int compareTo(PageletURI l); @Override String toString(); }
PageletURIImpl implements PageletURI { public int compareTo(PageletURI l) { if (pageURI != null) { if (pageURI.equals(l.getPageURI()) && composer == null && position < 0) return 0; } else if (composer != null) { if (composer.equals(l.getComposer()) && position < 0) return 0; } return Integer.valueOf(position).compareTo(Integer.valueOf(l.getPosition())); } PageletURIImpl(ResourceURI pageURI, String composer, int position); Site getSite(); ResourceURI getPageURI(); String getComposer(); int getPosition(); void setURI(ResourceURI uri); void setComposer(String composer); void setPosition(int position); @Override int hashCode(); @Override boolean equals(Object o); int compareTo(PageletURI l); @Override String toString();  }