KSquare Utilities
KKMLL::SizeDistribution::ClassTotals Class Reference

Public Types

typedef ClassTotalsClassTotalsPtr
 

Public Member Functions

 ClassTotals (KKStr _name, kkint32 _bucketCount, kkint32 _bucketSize)
 
 ~ClassTotals ()
 
void AddIn (ClassTotalsPtr classTotals)
 
kkint32 BucketCount (kkint32 idx)
 
void Increment (kkint32 size)
 
void PrintCSVLine (ostream &_outFile)
 
void PrintFormatedLine (ostream &_outFile)
 
void PrintTabDelLine (ostream &_outFile)
 

Public Attributes

kkint32 bucketCount
 
kkint32 bucketSize
 
kkint32 count
 
KKStr name
 
KKStr nameUpper
 
kkint32sizeBuckets
 

Detailed Description

Definition at line 33 of file SizeDistribution.cpp.

Member Typedef Documentation

Constructor & Destructor Documentation

KKMLL::SizeDistribution::ClassTotals::ClassTotals ( KKStr  _name,
kkint32  _bucketCount,
kkint32  _bucketSize 
)
inline

Definition at line 38 of file SizeDistribution.cpp.

References KKMLL::SizeDistribution::ClassTotals::bucketCount, KKMLL::SizeDistribution::ClassTotals::bucketSize, KKMLL::SizeDistribution::ClassTotals::count, KKB::KKStr::KKStr(), KKMLL::SizeDistribution::ClassTotals::name, KKMLL::SizeDistribution::ClassTotals::nameUpper, KKMLL::SizeDistribution::ClassTotals::sizeBuckets, and KKB::KKStr::Upper().

Referenced by KKMLL::SizeDistribution::Increment(), KKMLL::SizeDistribution::PrintCSVDistributionMatrix(), KKMLL::SizeDistribution::PrintFormatedDistributionMatrix(), and KKMLL::SizeDistribution::PrintTabDelDistributionMatrix().

41  :
42  bucketCount (_bucketCount),
43  bucketSize (_bucketSize),
44  count (0),
45  name (_name),
46  nameUpper (_name),
47  sizeBuckets (NULL)
48 
49  {
50  nameUpper.Upper ();
51 
53  for (kkint32 x = 0; x < bucketCount; x++)
54  sizeBuckets[x] = 0;
55 
56  count = 0;
57  }
__int32 kkint32
Definition: KKBaseTypes.h:88
void Upper()
Converts all characters in string to their Upper case equivalents via &#39;toupper&#39;.
Definition: KKStr.cpp:2461
KKMLL::SizeDistribution::ClassTotals::~ClassTotals ( )
inline

Definition at line 60 of file SizeDistribution.cpp.

References KKMLL::SizeDistribution::ClassTotals::sizeBuckets.

61  {
62  delete[] sizeBuckets;
63  }

Member Function Documentation

void KKMLL::SizeDistribution::ClassTotals::AddIn ( ClassTotalsPtr  classTotals)
kkint32 KKMLL::SizeDistribution::ClassTotals::BucketCount ( kkint32  idx)
inline
void KKMLL::SizeDistribution::ClassTotals::PrintCSVLine ( ostream &  _outFile)

Definition at line 169 of file SizeDistribution.cpp.

References KKMLL::SizeDistribution::ClassTotals::bucketCount.

Referenced by KKMLL::SizeDistribution::PrintCSVDistributionMatrix().

170 {
171  o << "\"" << name << "\"," << count;
172 
173  kkint32 bucket;
174 
175  for (bucket = 0; bucket < bucketCount; bucket++)
176  {
177  o << "," << sizeBuckets[bucket];
178  }
179  o << endl;
180 }
HTMLReport &__cdecl endl(HTMLReport &htmlReport)
Definition: HTMLReport.cpp:240
__int32 kkint32
Definition: KKBaseTypes.h:88
void KKMLL::SizeDistribution::ClassTotals::PrintFormatedLine ( ostream &  _outFile)

Definition at line 142 of file SizeDistribution.cpp.

References KKMLL::SizeDistribution::ClassTotals::bucketCount, KKB::KKStr::Concat(), KKMLL::SizeDistribution::ClassTotals::count, KKB::KKStr::KKStr(), KKB::KKStr::LeftPad(), KKMLL::SizeDistribution::ClassTotals::name, KKB::operator<<(), KKB::KKStr::operator=(), KKB::KKStr::RightPad(), and KKMLL::SizeDistribution::ClassTotals::sizeBuckets.

Referenced by KKMLL::SizeDistribution::PrintFormatedDistributionMatrix().

143 {
144  KKStr s (name);
145  s.RightPad (20);
146  o << s;
147 
148  s = count;
149  s.LeftPad (9);
150  o << s;
151 
152  kkint32 bucket;
153 
154  for (bucket = 0; bucket < bucketCount; bucket++)
155  {
156  s = sizeBuckets [bucket];
157  s.LeftPad (8);
158  o << s;
159  }
160  o << endl;
161 } /* PrintFormatedLine */
HTMLReport &__cdecl endl(HTMLReport &htmlReport)
Definition: HTMLReport.cpp:240
__int32 kkint32
Definition: KKBaseTypes.h:88
void KKMLL::SizeDistribution::ClassTotals::PrintTabDelLine ( ostream &  _outFile)

Definition at line 185 of file SizeDistribution.cpp.

References KKMLL::SizeDistribution::ClassTotals::bucketCount.

Referenced by KKMLL::SizeDistribution::PrintTabDelDistributionMatrix().

186 {
187  o << "\"" << name << "\"" << "\t" << count;
188 
189  kkint32 bucket;
190 
191  for (bucket = 0; bucket < bucketCount; bucket++)
192  {
193  o << "\t" << sizeBuckets[bucket];
194  }
195  o << endl;
196 }
HTMLReport &__cdecl endl(HTMLReport &htmlReport)
Definition: HTMLReport.cpp:240
__int32 kkint32
Definition: KKBaseTypes.h:88

Member Data Documentation

kkint32 KKMLL::SizeDistribution::ClassTotals::bucketSize
KKStr KKMLL::SizeDistribution::ClassTotals::name
KKStr KKMLL::SizeDistribution::ClassTotals::nameUpper

The documentation for this class was generated from the following file: