com.blogspot.applications4android.comicreader.comictypes
Class RandomIndexedComic

java.lang.Object
  extended by com.blogspot.applications4android.comicreader.core.ComicParser
      extended by com.blogspot.applications4android.comicreader.core.Comic
          extended by com.blogspot.applications4android.comicreader.comictypes.IndexedComic
              extended by com.blogspot.applications4android.comicreader.comictypes.RandomIndexedComic
Direct Known Subclasses:
Cyanide, TheDevilsPanties

public abstract class RandomIndexedComic
extends IndexedComic

Base class for all those comics which are indexed, but not in order


Field Summary
protected  int mNextId
          next strip's id
protected  int mPrevId
          previous strip's id
 
Fields inherited from class com.blogspot.applications4android.comicreader.comictypes.IndexedComic
mBound, mLatestId
 
Fields inherited from class com.blogspot.applications4android.comicreader.core.Comic
DIALOG_DATE, DIALOG_NUMBER, mFirstUid, mLatestUid, mPrevSessionUid, NAV_CURRENT, NAV_FIRST, NAV_LATEST, NAV_LATEST_FORCE, NAV_NEXT, NAV_PREV_SESSION, NAV_PREVIOUS, NAV_RANDOM, PROPS, TYPE_CACHING, TYPE_FAVORITE, TYPE_LATEST, TYPE_PREV_SESSION, TYPE_PREVIEW
 
Constructor Summary
RandomIndexedComic()
           
 
Method Summary
protected abstract  int getNextStripId(java.io.BufferedReader br, java.lang.String url)
          Evaluate the next strip's index from the current strip's url
protected  java.lang.String getNextStripUrl()
          Gets the url for the next strip
protected abstract  int getPreviousStripId(java.io.BufferedReader br, java.lang.String url)
          Evaluate the previous strip's index from the current strip's url
protected  java.lang.String getPreviousStripUrl()
          Gets the url for the previous strip
protected  java.lang.String getRandomStripUrl()
          Gets the url for the previous strip
protected abstract  java.lang.String getRandUrl()
          Function to return the random url
protected abstract  int parseForNextId(java.lang.String line, int def)
          Given a line containing the next strip's url, return the id
protected abstract  int parseForPrevId(java.lang.String line, int def)
          Given a line containing the previous strip's url, return the id
protected  void setNextId(int id)
          Helper function to set the next id
protected  void setPreviousId(int id)
          Helper function to set the previous id
protected  java.lang.String[] urlsNotForCaching()
          Gives out the list of urls (can be regexes) which are not supposed to be cached using 'mStrips'
 
Methods inherited from class com.blogspot.applications4android.comicreader.comictypes.IndexedComic
addException, dialogType, getBound, getCurrentId, getFirstId, getFirstStripUrl, getFrontPageUrl, getIdFromStripUrl, getLatestId, getLatestStripUrl, getStripUrlFromId, parseForLatestId
 
Methods inherited from class com.blogspot.applications4android.comicreader.core.Comic
clearCache, clearHistory, currentHasImageText, currentTitleAsValidFilename, downloadCurrentStrip, getComicName, getComicWebPageUrl, getCurrentStrip, getDefaultZoom, getFirstStrip, getLatestStrip, getLatestStripForcefully, getLaunchType, getName, getNextStrip, getPreviousSessionStrip, getPreviousStrip, getRandomStrip, getStripFromUrl, hasPreviousSession, hasUid, isCurrentFavorite, isCurrentFirstStrip, isCurrentLatestStrip, navigateStrip, queryUid, readOnlyUnread, readProperties, setCacheEnabled, setComicName, setCurrentAsFavorite, setDefaultZoom, setLaunchType, writeProperties
 
Methods inherited from class com.blogspot.applications4android.comicreader.core.ComicParser
htmlNeeded, parse, parse
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mNextId

protected int mNextId
next strip's id


mPrevId

protected int mPrevId
previous strip's id

Constructor Detail

RandomIndexedComic

public RandomIndexedComic()
Method Detail

getRandUrl

protected abstract java.lang.String getRandUrl()
Function to return the random url

Returns:
random url

getNextStripId

protected abstract int getNextStripId(java.io.BufferedReader br,
                                      java.lang.String url)
Evaluate the next strip's index from the current strip's url

Parameters:
br - reader for the current strip's url connection
url - current strip's url
Returns:
next strip's index

getPreviousStripId

protected abstract int getPreviousStripId(java.io.BufferedReader br,
                                          java.lang.String url)
Evaluate the previous strip's index from the current strip's url

Parameters:
br - reader for the current strip's url connection
url - current strip's url
Returns:
previous strip's index

parseForPrevId

protected abstract int parseForPrevId(java.lang.String line,
                                      int def)
Given a line containing the previous strip's url, return the id

Parameters:
line - line of interest
def - default value to be returned
Returns:
prev Id

parseForNextId

protected abstract int parseForNextId(java.lang.String line,
                                      int def)
Given a line containing the next strip's url, return the id

Parameters:
line - line of interest
def - default value to be returned
Returns:
next Id

setNextId

protected void setNextId(int id)
Helper function to set the next id

Parameters:
id - next id

setPreviousId

protected void setPreviousId(int id)
Helper function to set the previous id

Parameters:
id - prev id

getNextStripUrl

protected java.lang.String getNextStripUrl()
Description copied from class: Comic
Gets the url for the next strip

Overrides:
getNextStripUrl in class IndexedComic
Returns:
url

getPreviousStripUrl

protected java.lang.String getPreviousStripUrl()
Description copied from class: Comic
Gets the url for the previous strip

Overrides:
getPreviousStripUrl in class IndexedComic
Returns:
url

urlsNotForCaching

protected java.lang.String[] urlsNotForCaching()
Description copied from class: Comic
Gives out the list of urls (can be regexes) which are not supposed to be cached using 'mStrips'

Overrides:
urlsNotForCaching in class IndexedComic
Returns:
list

getRandomStripUrl

protected java.lang.String getRandomStripUrl()
Description copied from class: Comic
Gets the url for the previous strip

Overrides:
getRandomStripUrl in class IndexedComic
Returns:
url