public int compare(Object o1, Object o2) { // if the same object if (o1 == o2) return 0; // assume they are Resource Entity r1 = (Entity) o1; Entity r2 = (Entity) o2; // get each one's date Time t1 = m_user.getDate(r1); Time t2 = m_user.getDate(r2); // compare based on date int compare = t2.compareTo(t1); return compare; } });
public int compare(Object o1, Object o2) { // if the same object if (o1 == o2) return 0; // assume they are Resource Entity r1 = (Entity) o1; Entity r2 = (Entity) o2; // get each one's date Time t1 = m_user.getDate(r1); Time t2 = m_user.getDate(r2); // compare based on date int compare = t2.compareTo(t1); return compare; } });
public void setRetractDate(Time time) { if(time == null) { if(m_retractDate != null) { this.m_visibilityUpdated = true; } m_retractDate = null; } else { if(m_retractDate == null || m_retractDate.compareTo(time) != 0) { this.m_visibilityUpdated = true; } m_retractDate = timeService.newTime(time.getTime()); } m_hidden = false; }
public void setReleaseDate(Time time) { if(time == null) { if(m_releaseDate != null) { this.m_visibilityUpdated = true; } m_releaseDate = null; } else { if(m_releaseDate == null || m_releaseDate.compareTo(time) != 0) { this.m_visibilityUpdated = true; } m_releaseDate = timeService.newTime(time.getTime()); } m_hidden = false; }
public int compare(Alias o1, Alias o2) { // Sort by date, then by ID to assure consistent order. return o1.getCreatedTime().compareTo(o2.getCreatedTime()) * 10 + o1.getId().compareTo(o2.getId()); }
public int compare(Alias o1, Alias o2) { // Sort by date, then by ID to assure consistent order. return o1.getCreatedTime().compareTo(o2.getCreatedTime()) * 10 + o1.getId().compareTo(o2.getId()); }
/** * Compare this object with the specified object for order. * * @return A negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object. */ public int compareTo(Object obj) { if (!(obj instanceof Message)) throw new ClassCastException(); // if the object are the same, say so if (obj == this) return 0; // compare the header's date int compare = getHeader().getDate().compareTo(((Message) obj).getHeader().getDate()); return compare; } // compareTo
/** * Compare this object with the specified object for order. * * @return A negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object. */ public int compareTo(Object obj) { if (!(obj instanceof Message)) throw new ClassCastException(); // if the object are the same, say so if (obj == this) return 0; // compare the header's date int compare = getHeader().getDate().compareTo(((Message) obj).getHeader().getDate()); return compare; } // compareTo
/** * Compare this object with the specified object for order. * * @return A negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object. */ public int compareTo(Object obj) { if (!(obj instanceof Message)) throw new ClassCastException(); // if the object are the same, say so if (obj == this) return 0; // compare the header's date int compare = getHeader().getDate().compareTo(((Message) obj).getHeader().getDate()); return compare; } // compareTo
} else if(releaseDate != null && m_releaseDate == null) { this.m_visibilityUpdated = true; } else if(m_releaseDate != null && releaseDate != null && m_releaseDate.compareTo(releaseDate) != 0) { this.m_visibilityUpdated = true; } else if(retractDate == null && m_retractDate != null) { } else if(retractDate != null && m_retractDate == null) { this.m_visibilityUpdated = true; } else if(m_retractDate != null && retractDate != null && m_retractDate.compareTo(retractDate) != 0) { this.m_visibilityUpdated = true;
if (t2 == null) t2 = ((ContentResource) o2).getProperties().getTimeProperty(m_property); rv = t1.compareTo(t2);
int rv = t1.compareTo(t2); if (!m_ascending) rv = -rv; return rv;