Добавил:
Studfiles2
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз:
Предмет:
Файл:Курсовой проект групп 3341 и 3382 / DMCore / AttributeStats
.pas unit AttributeStats;
interface
uses
Classes,
DmmTypes,
SerializableObject;
type
{}
TDMAttributeStats = class( TDMSerializableObject )
public
intCount : Integer;
realCount : Integer;
missingCount : Integer;
distinctCount : Integer;
uniqueCount : Integer;
totalCount : Integer;
nominalCounts : IArray;
procedure addDistinct( const value : Double; const count : Integer );
procedure serializeObject( ostream : TStream ); override;
procedure deserializeObject( istream : TStream ); override;
end;
implementation
procedure TDMAttributeStats.addDistinct( const value : Double; const count : Integer );
var
tdval : Double;
tival : Integer;
begin
if ( count > 0 ) then
begin
if ( count = 1 ) then uniqueCount := uniqueCount + 1;
tival := Trunc( value );
tdval := tival;
if ( tdval = value ) then intCount := intCount + 1
else realCount := realCount + 1;
if ( Length( nominalCounts ) > 0 ) then nominalCounts[ tival ] := count;
end;
distinctCount := distinctCount + 1;
end;
procedure TDMAttributeStats.serializeObject( ostream : TStream );
begin
end;
procedure TDMAttributeStats.deserializeObject( istream : TStream );
begin
end;
end.
interface
uses
Classes,
DmmTypes,
SerializableObject;
type
{}
TDMAttributeStats = class( TDMSerializableObject )
public
intCount : Integer;
realCount : Integer;
missingCount : Integer;
distinctCount : Integer;
uniqueCount : Integer;
totalCount : Integer;
nominalCounts : IArray;
procedure addDistinct( const value : Double; const count : Integer );
procedure serializeObject( ostream : TStream ); override;
procedure deserializeObject( istream : TStream ); override;
end;
implementation
procedure TDMAttributeStats.addDistinct( const value : Double; const count : Integer );
var
tdval : Double;
tival : Integer;
begin
if ( count > 0 ) then
begin
if ( count = 1 ) then uniqueCount := uniqueCount + 1;
tival := Trunc( value );
tdval := tival;
if ( tdval = value ) then intCount := intCount + 1
else realCount := realCount + 1;
if ( Length( nominalCounts ) > 0 ) then nominalCounts[ tival ] := count;
end;
distinctCount := distinctCount + 1;
end;
procedure TDMAttributeStats.serializeObject( ostream : TStream );
begin
end;
procedure TDMAttributeStats.deserializeObject( istream : TStream );
begin
end;
end.
Соседние файлы в папке DMCore