Elexis API documentation
Version 2.1.6 as of December 11 2011

ch.marlovits.addressSearch.directories
Class PhoneBookContentParser_de

java.lang.Object
  extended by ch.marlovits.addressSearch.directories.HtmlParser
      extended by ch.marlovits.addressSearch.directories.PhoneBookContentParser
          extended by ch.marlovits.addressSearch.directories.PhoneBookContentParser_de

public class PhoneBookContentParser_de
extends PhoneBookContentParser


Constructor Summary
PhoneBookContentParser_de(java.lang.String name, java.lang.String geo, int pageNum)
           
 
Method Summary
 java.util.List<java.util.HashMap<java.lang.String,java.lang.String>> extractKontakte()
          extracts Kontakte from HTML
extract [entriesPerPage] number of entries
Abstract function, must override
 java.util.HashMap<java.lang.String,java.lang.String> extractKontaktFromDetail()
          extracts a Kontakt from a DetailEntry (single result displayed on a page)
this just extracts the parts needed for the display in the results list
if the actual detail info is needed, then the vCards are extracted
this procedure can be the same as extracting from a list
- for ch this is different from extractListKontakt
- for de this is the same as extractListKontakt
- for at this is the same as extractListKontakt Abstract function, must override
 java.util.HashMap<java.lang.String,java.lang.String> extractKontaktFromList()
          extracts a Kontakt from a listEntry (multiple results displayed on a page)
this just extracts the parts needed for the display in the results list
if the actual detail info is needed, then the vCards are extracted
Abstract function, must override
 java.util.HashMap<java.lang.String,java.lang.String> extractMaxInfo(java.util.HashMap<java.lang.String,java.lang.String> kontaktHashMap)
          extracts a Kontakt with ALL available info from a vCard and /or html combined
usually if there is a vCard then it is better to use this to get the data
 java.lang.String[][] getCitiesList()
          returns a list of possible city names if the entered city could not be found or matched exactly
 java.lang.String getCitiesListMessage()
          if there is more than one city to select from then this procedure extracts the error message to show to the user for explaining
 java.lang.String[][] getCitySuggestions(java.lang.String part)
           
 int getNumOfEntries()
          extracts the total number of found entries
Abstract function, must override
 java.lang.String getSearchInfo()
          extract infos for the current search from HTML-source
- für die Suche in ch - tel.search.ch zBsp "Treffer 1 - 10 von 11"
- für die Suche in de - telefonbuch.de zBsp "Seite 1 (von 6)"
- für die Suche in at - herold.at/telefonbuch zBsp "Treffer 1-15 von 61"
Abstract function, must override
 java.net.URL getURL(java.lang.String name, java.lang.String geo, int pageNum)
          creates and returns a URL for reading data from an online-address-query page
Abstract function, must override
 boolean hasCitiesList()
          test if the query returned saying that there is more than one city to select from
 boolean noCityFound()
          test if the there entered city has been found or not
 
Methods inherited from class ch.marlovits.addressSearch.directories.PhoneBookContentParser
extractFirstnames, formatPhoneNumber, formatPhoneNumber, formatString, initHashMap, readContent, readContent
 
Methods inherited from class ch.marlovits.addressSearch.directories.HtmlParser
extract, extractTo, getNextPos, getNextPos, getTail, moveTo, reset, setHtmlText, startsWith
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PhoneBookContentParser_de

public PhoneBookContentParser_de(java.lang.String name,
                                 java.lang.String geo,
                                 int pageNum)
Method Detail

extractKontaktFromDetail

public java.util.HashMap<java.lang.String,java.lang.String> extractKontaktFromDetail()
Description copied from class: PhoneBookContentParser
extracts a Kontakt from a DetailEntry (single result displayed on a page)
this just extracts the parts needed for the display in the results list
if the actual detail info is needed, then the vCards are extracted
this procedure can be the same as extracting from a list
- for ch this is different from extractListKontakt
- for de this is the same as extractListKontakt
- for at this is the same as extractListKontakt Abstract function, must override

Specified by:
extractKontaktFromDetail in class PhoneBookContentParser
Returns:
the Kontakt in a HashMap, the possible keys of the HashMap are described above

extractKontaktFromList

public java.util.HashMap<java.lang.String,java.lang.String> extractKontaktFromList()
Description copied from class: PhoneBookContentParser
extracts a Kontakt from a listEntry (multiple results displayed on a page)
this just extracts the parts needed for the display in the results list
if the actual detail info is needed, then the vCards are extracted
Abstract function, must override

Specified by:
extractKontaktFromList in class PhoneBookContentParser
Returns:
the Kontakt in a HashMap, the possible keys of the HashMap are described above

extractKontakte

public java.util.List<java.util.HashMap<java.lang.String,java.lang.String>> extractKontakte()
Description copied from class: PhoneBookContentParser
extracts Kontakte from HTML
extract [entriesPerPage] number of entries
Abstract function, must override

Specified by:
extractKontakte in class PhoneBookContentParser
Returns:
the List of KontaktEntry's

extractMaxInfo

public java.util.HashMap<java.lang.String,java.lang.String> extractMaxInfo(java.util.HashMap<java.lang.String,java.lang.String> kontaktHashMap)
Description copied from class: PhoneBookContentParser
extracts a Kontakt with ALL available info from a vCard and /or html combined
usually if there is a vCard then it is better to use this to get the data

Specified by:
extractMaxInfo in class PhoneBookContentParser
Parameters:
kontaktHashMap - Kontakt for which to extract the info
Returns:
the Kontakt in a HashMap, the possible keys of the HashMap are described above

getNumOfEntries

public int getNumOfEntries()
Description copied from class: PhoneBookContentParser
extracts the total number of found entries
Abstract function, must override

Specified by:
getNumOfEntries in class PhoneBookContentParser
Returns:
number of found entries

getSearchInfo

public java.lang.String getSearchInfo()
Description copied from class: PhoneBookContentParser
extract infos for the current search from HTML-source
- für die Suche in ch - tel.search.ch zBsp "Treffer 1 - 10 von 11"
- für die Suche in de - telefonbuch.de zBsp "Seite 1 (von 6)"
- für die Suche in at - herold.at/telefonbuch zBsp "Treffer 1-15 von 61"
Abstract function, must override

Specified by:
getSearchInfo in class PhoneBookContentParser
Returns:
the search string to be displayed as info

getURL

public java.net.URL getURL(java.lang.String name,
                           java.lang.String geo,
                           int pageNum)
Description copied from class: PhoneBookContentParser
creates and returns a URL for reading data from an online-address-query page
Abstract function, must override

Specified by:
getURL in class PhoneBookContentParser
Parameters:
name - search for this name
geo - search in this city/location
pageNum - which page to get
Returns:
the url which returns the results, null if any error occurs

getCitiesList

public java.lang.String[][] getCitiesList()
Description copied from class: PhoneBookContentParser
returns a list of possible city names if the entered city could not be found or matched exactly

Specified by:
getCitiesList in class PhoneBookContentParser
Returns:
String[] the list of city-pairs, null if none found. each entry consist of following parts: city - selectable. if the entry is not selectable, then it is just a category for the following entries

getCitiesListMessage

public java.lang.String getCitiesListMessage()
Description copied from class: PhoneBookContentParser
if there is more than one city to select from then this procedure extracts the error message to show to the user for explaining

Specified by:
getCitiesListMessage in class PhoneBookContentParser
Returns:
the error/explanation string

hasCitiesList

public boolean hasCitiesList()
Description copied from class: PhoneBookContentParser
test if the query returned saying that there is more than one city to select from

Specified by:
hasCitiesList in class PhoneBookContentParser
Returns:
boolean true if there is more than one city to select from

noCityFound

public boolean noCityFound()
Description copied from class: PhoneBookContentParser
test if the there entered city has been found or not

Specified by:
noCityFound in class PhoneBookContentParser
Returns:
false if no city found

getCitySuggestions

public java.lang.String[][] getCitySuggestions(java.lang.String part)
Specified by:
getCitySuggestions in class PhoneBookContentParser

Elexis API documentation
Version 2.1.6 as of December 11 2011

Copyright 2005-2011 by Gerry Weirich, Elexis