/**
* The meta data associated to a {@link Story} object.
+ * <p>
+ * Note that some earlier version of the program did not save the resume as an
+ * external file; for those stories, the resume is not fetched until the story
+ * is.
+ * <p>
+ * The cover is never fetched until the story is.
*
* @author niki
*/
private String creationDate;
private boolean fakeCover;
+ /**
+ * Create an empty {@link MetaData}.
+ */
+ public MetaData() {
+ }
+
/**
* The title of the story.
*
* The story resume (a.k.a. description).
* <p>
* This can be NULL if we don't have a resume for this {@link Story}.
+ * <p>
+ * Note that some earlier version of the program did not save the resume as
+ * an external file; for those stories, the resume is not fetched until the
+ * story is.
*
* @return the resume
*/
/**
* The story resume (a.k.a. description).
+ * <p>
+ * Note that some earlier version of the program did not save the resume as
+ * an external file; for those stories, the resume is not fetched until the
+ * story is.
*
* @param resume
* the resume to set
/**
* The cover image of the story if any (can be NULL).
+ * <p>
+ * The cover is not fetched until the story is.
*
* @return the cover
*/
/**
* The cover image of the story if any (can be NULL).
+ * <p>
+ * The cover is not fetched until the story is.
*
* @param cover
* the cover to set
return 1;
}
- String id = (getUuid() == null ? "" : getUuid())
+ String id = (getTitle() == null ? "" : getTitle())
+ + (getUuid() == null ? "" : getUuid())
+ (getLuid() == null ? "" : getLuid());
- String oId = (getUuid() == null ? "" : o.getUuid())
+ String oId = (getTitle() == null ? "" : o.getTitle())
+ + (getUuid() == null ? "" : o.getUuid())
+ (o.getLuid() == null ? "" : o.getLuid());
- return id.compareTo(oId);
+ return id.compareToIgnoreCase(oId);
}
@Override
}
return String.format(
- "Meta %s:\n\tTitle: [%s]\n\tAuthor: [%s]\n\tDate: [%s]\n\tTags: [%s]"
- + "\n\tResume: [%s]\n\tCover: [%s]", luid, title,
- getAuthor(), getDate(), tags.toString(), resume, cover);
+ "Meta %s:\n\tTitle: [%s]\n\tAuthor: [%s]\n\tDate: [%s]\n\tTags: [%s]\n\tWord count: [%s]"
+ + "\n\tResume: [%s]\n\tCover: [%s]",
+ luid, title, getAuthor(), getDate(), tags.toString(),
+ "" + words, resume, cover);
}
}