// The contents of this file are subject to the Mozilla Public License // Version 1.1 (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License // at http://www.mozilla.org/MPL/ // // Software distributed under the License is distributed on an "AS IS" // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See // the License for the specific language governing rights and // limitations under the License. // // The Initial Developer of the Original Code is James L. Nance. #include "intcnt.h" IntCount::IntCount() : numInts(0), iPair(0) { } IntCount::~IntCount() { delete [] iPair;} int IntCount::getSize() {return numInts;} int IntCount::getCount(int pos) {return iPair[pos].cnt;} int IntCount::getIndex(int pos) {return iPair[pos].idx;} int IntCount::countAdd(int index, int increment) { if(numInts) { // Do a binary search to find the element int divPoint = 0; if(index>iPair[numInts-1].idx) { divPoint = numInts; } else if(indexiPair[mid].idx) { if(mid