fiftyone.device.example.batch
Class UaProcessor.Base

java.lang.Object
  extended by fiftyone.device.example.batch.UaProcessor.Base
All Implemented Interfaces:
UaProcessor
Direct Known Subclasses:
FutureUaProcessor
Enclosing interface:
UaProcessor

public abstract static class UaProcessor.Base
extends Object
implements UaProcessor

Base implementation of UaProcessor accepting a BufferedReader from which UA Strings can be read and a Provider to use to do detections


Nested Class Summary
 
Nested classes/interfaces inherited from interface fiftyone.device.example.batch.UaProcessor
UaProcessor.Base
 
Field Summary
protected  int count
           
protected  int limit
           
protected  int numberOfThreads
           
protected  Provider provider
           
protected  long start
           
protected  long stop
           
protected  BufferedReader useragents
           
 
Constructor Summary
UaProcessor.Base(BufferedReader useragents, Provider provider, int numberOfThreads, int limit)
           
 
Method Summary
 void printStats(PrintWriter output)
          Writes timings (overall) of of a detection test
protected static void writeHeaders(BufferedWriter writer)
          Utility for descendants to write a set of headers relating to a match
protected static void writeMatch(BufferedWriter writer, String s, long time, Match match)
          Utility for descendants to write details relating to a match
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface fiftyone.device.example.batch.UaProcessor
process, writeResults
 

Field Detail

limit

protected final int limit

numberOfThreads

protected final int numberOfThreads

useragents

protected final BufferedReader useragents

provider

protected final Provider provider

count

protected int count

start

protected long start

stop

protected long stop
Constructor Detail

UaProcessor.Base

public UaProcessor.Base(BufferedReader useragents,
                        Provider provider,
                        int numberOfThreads,
                        int limit)
                 throws IOException
Throws:
IOException
Method Detail

printStats

public void printStats(PrintWriter output)
Description copied from interface: UaProcessor
Writes timings (overall) of of a detection test

Specified by:
printStats in interface UaProcessor
Parameters:
output - a PrintWriter to report the timings on

writeHeaders

protected static void writeHeaders(BufferedWriter writer)
                            throws IOException
Utility for descendants to write a set of headers relating to a match

Parameters:
writer - a writer to write to
Throws:
IOException - if there was a problem accessing data file.

writeMatch

protected static void writeMatch(BufferedWriter writer,
                                 String s,
                                 long time,
                                 Match match)
                          throws IOException
Utility for descendants to write details relating to a match

Parameters:
writer - a writer to write to
s - string to write.
time - timestamp.
match - Match object with results.
Throws:
IOException - if there was a problem accessing data file.


Copyright © 2017 51Degrees. All rights reserved.