/* * Copyright Dr. Marek A. Suchenek 2012 * Students currently enrolled in CSC 401 or CSC 501 class at CSUDH * can download and execute this program for their presonal educational use * provided they include this entire comment in their all copies. * All other use requires permission of the copyright holder. */ package binarysearch; /** * * @author Dr. Marek A. Suchenek */ public class Bcnt { // private static int n = 0; private static int max = 0; public static Boolean incr() { n++; if (n > max) max = n; return true; } public static Boolean incr(int increment) { n += increment; if (n > max) max = n; return true; } public static Boolean decr() { n--; return true; } public static Boolean decr(int decrement) { n -= decrement; return true; } public static Boolean clr() { n=0; return true; } public static Boolean clrAll() { n=0; max = 0; return true; } public static int get() { return n; } public static int getMax() { return max; } public static void out() { System.out.print(n); } public static void out(String pref) { System.out.print(pref + n); } public static void out(String pref, String suf) { System.out.print(pref + n + suf); } public static void outln() { System.out.println(n); } public static void outln(String pref) { System.out.println(pref + n); } public static void outln(String pref, String suf) { System.out.println(pref + n + suf); } }