<commit_before>// This is part of the Mommon Library
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
//
// This software is distributed without any warranty.
//
// @author <NAME> (<EMAIL> - www.mammola.net)

unit mBooleanDataProvider;

{$IFDEF FPC}
  {$MODE DELPHI}
 {$ENDIF}
 
interface

uses
  {$IFNDEF FPC}mInterfaces,{$ENDIF}
  mVirtualFieldDefs, mVirtualDataSetInterfaces, mVirtualDatasetDataProvider;

type

  { TBooleanDatumKey }

  TBooleanDatumKey = class(IVDDatumKey)
  strict private
    FValue : boolean;
  public
    constructor Create (aValue : boolean);

    procedure Assign(aSource : TObject);
    function AsString : string;

    property Value : boolean read FValue write FValue;
  end;

  { TBooleanDatum }

  TBooleanDatum = class ({$IFNDEF FPC}TJavaInterfacedObject, {$ENDIF}IVDDatum)
  strict private
    const FLD_VALUE = 'VALUE';
  strict private
    FKey : TBooleanDatumKey;
  public
    constructor Create(aValue : boolean);
    destructor Destroy; override;

    function GetDatumKey : IVDDatumKey;
    function AsObject: TObject;

    class procedure FillVirtualFieldDefs (aFieldDefs : TmVirtualFieldDefs; const aPrefix : String);
    class function GetKeyField : String;
    function GetPropertyByFieldName(const aFieldName : String) : Variant;
    procedure SetPropertyByFieldName(const aFieldName: String; const aValue : Variant);

    property Key : TBooleanDatumKey read FKey;
  end;

  TBooleanDataProvider = class (TmDatasetDataProvider)
  strict private
    FTrueValue : TBooleanDatum;
    FFalseValue : TBooleanDatum;
  public
    constructor Create;<commit_msg>* const set as public<commit_after>// This is part of the Mommon Library
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
//
// This software is distributed without any warranty.
//
// @author <NAME> (<EMAIL> - www.mammola.net)

unit mBooleanDataProvider;

{$IFDEF FPC}
  {$MODE DELPHI}
 {$ENDIF}
 
interface

uses
  {$IFNDEF FPC}mInterfaces,{$ENDIF}
  mVirtualFieldDefs, mVirtualDataSetInterfaces, mVirtualDatasetDataProvider;

type

  { TBooleanDatumKey }

  TBooleanDatumKey = class(IVDDatumKey)
  strict private
    FValue : boolean;
  public
    constructor Create (aValue : boolean);

    procedure Assign(aSource : TObject);
    function AsString : string;

    property Value : boolean read FValue write FValue;
  end;

  { TBooleanDatum }

  TBooleanDatum = class ({$IFNDEF FPC}TJavaInterfacedObject, {$ENDIF}IVDDatum)
  strict private
    FKey : TBooleanDatumKey;
  public
    const FLD_VALUE = 'VALUE';
  public
    constructor Create(aValue : boolean);
    destructor Destroy; override;

    function GetDatumKey : IVDDatumKey;
    function AsObject: TObject;

    class procedure FillVirtualFieldDefs (aFieldDefs : TmVirtualFieldDefs; const aPrefix : String);
    class function GetKeyField : String;
    function GetPropertyByFieldName(const aFieldName : String) : Variant;
    procedure SetPropertyByFieldName(const aFieldName: String; const aValue : Variant);

    property Key : TBooleanDatumKey read FKey;
  end;

  TBooleanDataProvider = class (TmDatasetDataProvider)
  strict private
    FTrueValue : TBooleanDatum;
    FFalseValue : TBooleanDatum;
  public
    constructor Create;
{'fraction_non_alphanumeric': 0.08224245873648264, 'fraction_numerical': 0.0022766078542970974, 'mean_word_length': 3.895543175487465, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '913764', 'n_tokens_mistral': 1112, 'n_tokens_neox': 1066, 'n_words': 330}