Back to project page sloop.
The source code is released under:
NON-LICENSE The Sloop data-browser source code is hereby released into the Public Domain. The original author, David Megginson, Megginson Technologies Ltd., and Acclar Open Ltd. provide no warranty:...
If you think the Android project sloop listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.megginson.sloop.model; //from w w w.j a va2 s .co m /** * A saved reference to an external data set. * * @author David Megginson */ public class Bookmark { private String mTitle; private String mUrl; public Bookmark() { super(); } public Bookmark(String url) { this(url, null); } public Bookmark(String url, String title) { setUrl(url); setTitle(title); } public Bookmark(Bookmark bookmark) { setUrl(bookmark.getUrl()); setTitle(bookmark.getTitle()); } public String getTitle() { return mTitle; } public void setTitle(String title) { if (title == null) { mTitle = getUrl(); } else { mTitle = title; } } public String getUrl() { return mUrl; } public void setUrl(String url) { mUrl = url; } @Override protected Object clone() throws CloneNotSupportedException { return new Bookmark(this); } @Override public boolean equals(Object o) { if (o == this) { return true; } else if (o != null && o instanceof Bookmark) { Bookmark b = (Bookmark) o; return (Util.equals(getUrl(), b.getUrl()) && Util.equals( getTitle(), b.getTitle())); } else { return false; } } @Override public int hashCode() { return Util.hashCode(getUrl()) + Util.hashCode(getTitle()); } @Override public String toString() { return "{Bookmark|" + getUrl() + "|" + getTitle() + "}"; } }