fiftyone.mobile.detection
Class ClosestScore

java.lang.Object
  extended by fiftyone.mobile.detection.BaseScore
      extended by fiftyone.mobile.detection.ClosestScore

 class ClosestScore
extends BaseScore


Constructor Summary
ClosestScore()
           
 
Method Summary
protected  int getInitialScore(Match match, Signature signature, int lastNodeCharacter)
          Calculate the initial score based on the difference in length of the right most node and the target user agent.
private static boolean getIsNumeric(byte value)
           
private static int getNumber(byte[] array, int start, int length)
          Returns an integer representation of the characters between start and end.
protected  int getScore(Match match, Node node)
          Returns the difference score between the node and the target user agent working from right to left.
 
Methods inherited from class fiftyone.mobile.detection.BaseScore
evaluateSignatures
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClosestScore

ClosestScore()
Method Detail

getInitialScore

protected int getInitialScore(Match match,
                              Signature signature,
                              int lastNodeCharacter)
                       throws IOException
Calculate the initial score based on the difference in length of the right most node and the target user agent.

Specified by:
getInitialScore in class BaseScore
Returns:
Throws:
IOException

getScore

protected int getScore(Match match,
                       Node node)
                throws IOException
Returns the difference score between the node and the target user agent working from right to left.

Specified by:
getScore in class BaseScore
Parameters:
match -
node -
Returns:
Throws:
IOException

getIsNumeric

private static boolean getIsNumeric(byte value)

getNumber

private static int getNumber(byte[] array,
                             int start,
                             int length)
Returns an integer representation of the characters between start and end. Assumes that all the characters are numeric characters.

Parameters:
array - Array of characters with numeric characters present between start and end
start - The first character to use to convert to a number
end - The last character to use to convert to a number
Returns: