Java slf4j Logger countMSCandidates(byte[] byteARR)

Here you can find the source of countMSCandidates(byte[] byteARR)

Description

count MS Candidates

License

Apache License

Declaration

public static void countMSCandidates(byte[] byteARR) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.util.ArrayList;
import java.util.Collections;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class Main {
    static Logger logger = LoggerFactory.getLogger("UTIL5");

    public static void countMSCandidates(byte[] byteARR) {

        int candidateCountI = 0;
        int noHitCountI = 0;
        int byteNumI = 3;
        int toI = byteARR.length - byteNumI;
        ArrayList<Integer> tempAL = new ArrayList<Integer>();

        for (int i = 0; i < toI; i += byteNumI) {

            for (int k = 0; k < 3; k++) {
                tempAL.add((int) byteARR[i + k] + 1);
            }/*from  w w w .  j  a  v  a2  s .c o  m*/

            Collections.sort(tempAL);

            if ((tempAL.get(0) < tempAL.get(1)) && (tempAL.get(1) < (tempAL.get(2) - tempAL.get(0)))) {

                candidateCountI++;
            } else {
                noHitCountI++;
            }

            tempAL.clear();

        }

        logger.info("candidate count is: " + candidateCountI + " / " + noHitCountI);

    }
}

Related

  1. clearRequestId()
  2. close(final AutoCloseable closeable, final Logger log)
  3. closeQuietly(AutoCloseable toClose, Logger log)
  4. configureXWikiLogs()
  5. configureXWikiLogs()
  6. countMSCandidates_m2(ArrayList asHexAL)
  7. d d(String fmt, Object... args)
  8. debug(Logger logger, Exception e)
  9. debug(Logger logger, String format, Object... arguments)