Java Reference
In-Depth Information
*/
private boolean advance(ParseHTML parse, String tag, int count)
throws IOException
{
int ch;
while ((ch = parse.read()) != -1)
{
if (ch == 0)
{
if (parse.getTag().getName().equalsIgnoreCase(tag))
{
count--;
if (count <= 0)
return true;
}
}
}
return false;
}
/**
* Use the cookie to search for the specified state
* or capital. The search method can be called multiple
* times per login.
* @param search The search string to use.
* @param type What to search for(s=state,c=capital).
* @return A list of states or capitals.
* @throws IOException Thrown if a communication failure occurs
*/
public List<String> search(String search, String type)
throws IOException
{
String listType = "ul";
String listTypeEnd = "/ul";
StringBuilder buffer = new StringBuilder();
boolean capture = false;
List<String> result = new ArrayList<String>();
// build the URL
ByteArrayOutputStream bos = new ByteArrayOutputStream();
FormUtility form = new FormUtility(bos, null);
form.add("search", search);
form.add("type", type);
form.add("action", "Search");
form.complete();
Search WWH ::




Custom Search