|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.blogspot.applications4android.comicreader.core.Strip
public final class Strip
Data-structure for holding info on a comic-strip
Field Summary | |
---|---|
static int |
BITMAP_MEM_LIMIT
Limit to the amount of memory to be used by the bitmap (in B) |
Constructor Summary | |
---|---|
Strip(java.lang.String html,
java.lang.String imgR)
Default constructor |
|
Strip(java.lang.String html,
java.lang.String imgR,
boolean read,
boolean fav,
java.lang.String prev,
java.lang.String next,
java.lang.String title,
java.lang.String text)
Constructor with initialization |
Method Summary | |
---|---|
java.lang.String |
currentTitleAsValidFilename()
Creates a valid file name out of the strip's title |
boolean |
downloadImage(ComicParser p)
Downloads the image of the strip if it doesn't exist already |
Bitmap |
getBitmapFromFile()
This gets the bitmap from the file (to be used only for comics which can have large strips) You should have called 'getImage' before calling this function! |
java.lang.String |
getImage(ComicParser p)
Fetches the image of the strip |
java.lang.String |
getImagePath()
Returns the path to the stored image file |
java.lang.String |
getNext()
Get the next comic strip |
java.lang.String |
getPrevious()
Get the previous comic strip |
java.lang.String |
getStripUrl()
Returns the strip url |
java.lang.String |
getText()
Get the strip text |
java.lang.String |
getTitle()
Get the strip title |
boolean |
hasNext()
Is there a next strip for this strip |
boolean |
hasPrevious()
Is there a previous strip for this strip |
boolean |
hasText()
Checks whether the strip has hover-text or not |
boolean |
isFavorite()
Whether this strip is favorite |
boolean |
isRead()
Whether this strip has been read |
static Strip |
readFromJsonObject(JSONObject obj)
Helper function to initialize the contents of the strip |
void |
setAsFavorite(boolean fav)
Set this comic as favorite |
void |
setAsRead(boolean read)
Mark this strip as read/un-read |
void |
setNext(java.lang.String uid)
Set the next comic strip |
void |
setPrevious(java.lang.String uid)
Set the previous comic strip |
void |
setText(java.lang.String txt)
Set the strip text |
void |
setTitle(java.lang.String title)
Set the strip title |
void |
toJsonString(java.lang.StringBuilder sb)
Convert the contents of this strip into json string |
java.lang.String |
uid()
Returns the UID for this strip (nothing but the html-url) |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int BITMAP_MEM_LIMIT
Constructor Detail |
---|
public Strip(java.lang.String html, java.lang.String imgR)
html
- html urlimgR
- image file rootpublic Strip(java.lang.String html, java.lang.String imgR, boolean read, boolean fav, java.lang.String prev, java.lang.String next, java.lang.String title, java.lang.String text)
html
- html urlimgR
- image file rootread
- strip read before?fav
- favorite strip?prev
- previous comic stripnext
- next comic striptitle
- strip titletext
- strip textMethod Detail |
---|
public static Strip readFromJsonObject(JSONObject obj) throws JSONException
obj
- json object
JSONException
public void toJsonString(java.lang.StringBuilder sb)
sb
- string-builder where to append the contentspublic Bitmap getBitmapFromFile() throws java.io.FileNotFoundException, BitMapException
java.io.FileNotFoundException
BitMapException
public java.lang.String getImage(ComicParser p) throws ClientProtocolException, java.net.URISyntaxException, java.io.IOException, ComicSDCardFull
p
- parser which generates strip info
java.io.IOException
java.net.URISyntaxException
ClientProtocolException
ComicSDCardFull
public boolean downloadImage(ComicParser p) throws ClientProtocolException, java.net.URISyntaxException, java.io.IOException, ComicSDCardFull
p
- parser which generates strip info
java.io.IOException
java.net.URISyntaxException
ClientProtocolException
ComicSDCardFull
public java.lang.String currentTitleAsValidFilename()
public void setAsRead(boolean read)
read
- read/un-readpublic void setAsFavorite(boolean fav)
fav
- favorite or notpublic void setPrevious(java.lang.String uid)
uid
- previous strippublic void setNext(java.lang.String uid)
uid
- next strippublic void setText(java.lang.String txt)
txt
- textpublic void setTitle(java.lang.String title)
title
- titlepublic java.lang.String uid()
public java.lang.String getStripUrl()
public java.lang.String getImagePath()
public boolean isRead()
public boolean isFavorite()
public java.lang.String getPrevious()
public boolean hasPrevious()
public java.lang.String getNext()
public boolean hasNext()
public java.lang.String getTitle()
public java.lang.String getText()
public boolean hasText()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |