Updated ThemeItem documentation.
Fixed the outdated instantiation example and clarified newInstance's
behaviour.
diff --git a/src/com/tmobile/themes/provider/AbstractDAOItem.java b/src/com/tmobile/themes/provider/AbstractDAOItem.java
index 6cfe8fd..de3ba56 100644
--- a/src/com/tmobile/themes/provider/AbstractDAOItem.java
+++ b/src/com/tmobile/themes/provider/AbstractDAOItem.java
@@ -92,10 +92,14 @@
protected abstract static class Creator<T extends AbstractDAOItem> {
/**
- * Creates an {@link AbstractDAOItem} for the specified {@link Uri} with the {@link Cursor} positioned to the first entry.
+ * Creates an {@link AbstractDAOItem} for the specified {@link Uri} with
+ * the {@link Cursor} positioned to the first entry.
+ *
* @param context the {@link Context} of the caller.
* @param uri the {@link Uri} of the item(s).
- * @return an {@link AbstractDAOItem} positioned to the first entry in the {@link Cursor}.
+ * @return an {@link AbstractDAOItem} positioned to the first entry in
+ * the {@link Cursor}. If there are no entries, null is
+ * returned.
*/
public T newInstance(Context context, Uri uri) {
if (uri != null) {
@@ -106,9 +110,13 @@
}
/**
- * Creates an {@link AbstractDAOItem} for the specified {@link Cursor} positioned to the first entry.
+ * Creates an {@link AbstractDAOItem} for the specified {@link Cursor}
+ * positioned to the first entry.
+ *
* @param c a valid {@link Cursor} for the {@link AbstractDAOItem} type.
- * @return an {@link AbstractDAOItem} positioned to the first entry in the {@link Cursor}.
+ * @return an {@link AbstractDAOItem} positioned to the first entry in
+ * the {@link Cursor}. If there are no entries, null is
+ * returned.
*/
public T newInstance(Cursor c) {
if (c != null) {
diff --git a/src/com/tmobile/themes/provider/ThemeItem.java b/src/com/tmobile/themes/provider/ThemeItem.java
index a3156e2..3348967 100644
--- a/src/com/tmobile/themes/provider/ThemeItem.java
+++ b/src/com/tmobile/themes/provider/ThemeItem.java
@@ -30,16 +30,13 @@
* <h2>Usage</h2>
* <p>Here is an example of looping through a Cursor with ThemeItem:</p>
* <pre class="prettyprint">
- * Cursor c = Themes.listThemes(myContext);
- * ThemeItem item = ThemeItem(c);
- * if (item != null) {
- * try {
- * do {
- * //Do something with the item
- * } while (c.moveToNext());
- * } finally {
- * item.close();
+ * ThemeItem item = new ThemeItem(Themes.listThemes(myContext));
+ * try {
+ * while (c.moveToNext()) {
+ * //Do something with the item
* }
+ * } finally {
+ * item.close();
* }
* </pre>
*/
@@ -74,14 +71,14 @@
};
/**
- * {@inheritDoc}
+ * @see AbstractDAOItem.Creator#newInstance(Context, Uri)
*/
public static ThemeItem getInstance(Context context, Uri uri) {
return CREATOR.newInstance(context, uri);
}
/**
- * {@inheritDoc}
+ * @see AbstractDAOItem.Creator#newInstance(Cursor)
*/
public static ThemeItem getInstance(Cursor c) {
return CREATOR.newInstance(c);