|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcs1705.weblog.LogScanner
public class LogScanner
A class to scan information from a web server access log. It currently supports log files from the Virginia Tech CS department's server proxy, which are in Apache's log format.
LogReader class)| Constructor Summary | |
|---|---|
LogScanner(File file)
Create a LogScanner that reads access log data from the given file. |
|
LogScanner(Scanner inStream)
Create a LogScanner that reads access log data from the given stream. |
|
LogScanner(String file)
Create a LogScanner that reads access log data from the given file. |
|
| Method Summary | |
|---|---|
boolean |
hasMoreEntries()
A synonym for hasNext() provided for backward
compatibility with the older Java 1.4-style LogReader
class. |
boolean |
hasNext()
Does the scanner have more data to supply? |
Iterator<LogEntry> |
iterator()
Return this object, unchanged, to provide support for foreach-style loops. |
LogEntry |
next()
Analyze the next line from the log file and make it available via a LogEntry object. |
LogEntry |
nextEntry()
A synonym for hasNext() provided for backward
compatibility with the older Java 1.4-style LogReader
class. |
void |
remove()
Provided for compliance with the Iterator interface,
but this method is not supported. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public LogScanner(File file)
public LogScanner(Scanner inStream)
public LogScanner(String file)
| Method Detail |
|---|
public boolean hasMoreEntries()
hasNext() provided for backward
compatibility with the older Java 1.4-style LogReader
class.
public boolean hasNext()
hasNext in interface Iterator<LogEntry>public Iterator<LogEntry> iterator()
Scanner (possibly attached to a file) that
was used to create this LogScanner.
iterator in interface Iterable<LogEntry>public LogEntry next()
next in interface Iterator<LogEntry>NoSuchElementException - if there are no more log entries
(call hasNext() first if you want to avoid the exception)public LogEntry nextEntry()
hasNext() provided for backward
compatibility with the older Java 1.4-style LogReader
class. This one silently converts NoSuchElementExceptions
into null return values for backward compatibility.
public void remove()
Iterator interface,
but this method is not supported.
remove in interface Iterator<LogEntry>UnsupportedOperationException - if you call it, since
this operation is not supported on LogScanners
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||