Java slf4j Logger rosettaShell(ArrayList a)

Here you can find the source of rosettaShell(ArrayList a)

Description

rosetta Shell

License

Apache License

Declaration

public static void rosettaShell(ArrayList<Character> a) 

Method Source Code


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

import java.util.ArrayList;

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

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

    public static void rosettaShell(ArrayList<Character> a) {
        int increment = a.size() / 2;

        int estimatedBytesI = 0;

        //while (increment > 0) {
        for (int p = 0; p < 5; p++) {
            logger.info("increment is: " + increment);
            int count = 0;

            for (int i = increment; i < a.size(); i++) {

                count++;/*w w w . ja  va2s.c o m*/

                int j = i;
                char temp = a.get(i);
                while (j >= increment && a.get(j - increment) > temp) {
                    a.set(j, a.get(j - increment));
                    j = j - increment;
                }
                a.set(j, temp);
            }
            if (increment == 2) {
                increment = 1;
            } else {
                increment *= (5.0 / 11);
            }

            logger.info(count + "");
            logger.info("estimated bytes is: " + (count / 8));
            estimatedBytesI += (count / 8);

        }

        logger.info("estimated bytes of meta data is: " + estimatedBytesI + "\n");
    }
}

Related

  1. printStackTrace(Logger logger, Throwable e)
  2. profilerTrigger2(Logger log, String msg)
  3. putMDCs(String clientId, String subjectId)
  4. request(String infoMessage)
  5. restoreContext(Map mdcContextMap)
  6. set(String key, String value)
  7. setbizSeq(String bizSeq)
  8. setClusterShard(String cluster, String shard)
  9. setContext(String value)