/** * @see java.lang.Comparable#compareTo(java.lang.Object) */ public int compareTo(CmsSite that) { if (that == this) { return 0; } float thatPos = that.getPosition(); // please note: can't just subtract and cast to int here because of float precision loss if (m_position == thatPos) { if (m_position == Float.MAX_VALUE) { // if they both do not have any position, sort by title return m_title.compareTo((that).getTitle()); } return 0; } return (m_position < thatPos) ? -1 : 1; }
/** * @see java.lang.Comparable#compareTo(java.lang.Object) */ public int compareTo(Object that) { if (that == this) { return 0; } if (that instanceof CmsSite) { float thatPos = ((CmsSite)that).getPosition(); // please note: can't just subtract and cast to int here because of float precision loss if (m_position == thatPos) { if (m_position == Float.MAX_VALUE) { // if they both do not have any position, sort by title return m_title.compareTo(((CmsSite)that).getTitle()); } return 0; } return (m_position < thatPos) ? -1 : 1; } return 0; }
/** * Returns a clone of this Objects instance.<p> * * @return a clone of this instance */ @Override public Object clone() { return new CmsSite( getSiteRoot(), (CmsUUID)getSiteRootUUID().clone(), getTitle(), (CmsSiteMatcher)getSiteMatcher().clone(), String.valueOf(getPosition())); }
if ((configuredSite != null) && (configuredSite.getPosition() != Float.MAX_VALUE)) { position = Float.toString(configuredSite.getPosition());
site.getSiteRoot(), site.getTitle(), Float.toString(site.getPosition()), site.getErrorPage(), Boolean.toString(site.isWebserver()),
/** * Returns a clone of this Objects instance.<p> * * @return a clone of this instance */ @Override public Object clone() { return new CmsSite( getSiteRoot(), (CmsUUID)getSiteRootUUID().clone(), getTitle(), (CmsSiteMatcher)getSiteMatcher().clone(), String.valueOf(getPosition()), getErrorPage(), getSecureServer(), isExclusiveUrl(), isExclusiveError(), isWebserver(), getAliases()); }
siteElement.addAttribute(A_URI, site.getSiteRoot().concat("/")); siteElement.addAttribute(A_TITLE, site.getTitle()); siteElement.addAttribute(A_POSITION, Float.toString(site.getPosition())); siteElement.addAttribute(A_ERROR_PAGE, site.getErrorPage()); siteElement.addAttribute(A_WEBSERVER, String.valueOf(site.isWebserver()));