| 1 | unit UObjectByte;
|
|---|
| 2 |
|
|---|
| 3 | interface
|
|---|
| 4 |
|
|---|
| 5 | uses
|
|---|
| 6 | Classes, SysUtils, UObjectTypeBase, UObjectBoolean;
|
|---|
| 7 |
|
|---|
| 8 | type
|
|---|
| 9 | TByte = class(TInterfacedObject, IAssignable, IOrderable, IComparable)
|
|---|
| 10 | public
|
|---|
| 11 | Value: Byte;
|
|---|
| 12 | procedure Assign(Source: TInterfacedObject);
|
|---|
| 13 | function HigherThen(Operand: IOrderable): TBoolean;
|
|---|
| 14 | function LowerThan(Operand: IOrderable): TBoolean;
|
|---|
| 15 | function Max(Operand1, Operand2: IOrderable): IOrderable;
|
|---|
| 16 | function Min(Operand1, Operand2: IOrderable): IOrderable;
|
|---|
| 17 | function EqualTo(Operand: IComparable): TBoolean;
|
|---|
| 18 | function Predecessor: IOrderable;
|
|---|
| 19 | function Successor: IOrderable;
|
|---|
| 20 | function Low: IOrderable;
|
|---|
| 21 | function High: IOrderable;
|
|---|
| 22 | end;
|
|---|
| 23 |
|
|---|
| 24 | implementation
|
|---|
| 25 |
|
|---|
| 26 | { TByte }
|
|---|
| 27 |
|
|---|
| 28 | procedure TByte.Assign(Source: TInterfacedObject);
|
|---|
| 29 | begin
|
|---|
| 30 | if Source is TByte then Value := (Source as TByte).Value
|
|---|
| 31 | else raise EConvertError.Create('');
|
|---|
| 32 | end;
|
|---|
| 33 |
|
|---|
| 34 | function TByte.EqualTo(Operand: IComparable): TBoolean;
|
|---|
| 35 | begin
|
|---|
| 36 |
|
|---|
| 37 | end;
|
|---|
| 38 |
|
|---|
| 39 | function TByte.High: IOrderable;
|
|---|
| 40 | begin
|
|---|
| 41 |
|
|---|
| 42 | end;
|
|---|
| 43 |
|
|---|
| 44 | function TByte.HigherThen(Operand: IOrderable): TBoolean;
|
|---|
| 45 | begin
|
|---|
| 46 |
|
|---|
| 47 | end;
|
|---|
| 48 |
|
|---|
| 49 | function TByte.Low: IOrderable;
|
|---|
| 50 | begin
|
|---|
| 51 |
|
|---|
| 52 | end;
|
|---|
| 53 |
|
|---|
| 54 | function TByte.LowerThan(Operand: IOrderable): TBoolean;
|
|---|
| 55 | begin
|
|---|
| 56 |
|
|---|
| 57 | end;
|
|---|
| 58 |
|
|---|
| 59 | function TByte.Max(Operand1, Operand2: IOrderable): IOrderable;
|
|---|
| 60 | begin
|
|---|
| 61 |
|
|---|
| 62 | end;
|
|---|
| 63 |
|
|---|
| 64 | function TByte.Min(Operand1, Operand2: IOrderable): IOrderable;
|
|---|
| 65 | begin
|
|---|
| 66 |
|
|---|
| 67 | end;
|
|---|
| 68 |
|
|---|
| 69 | function TByte.Predecessor: IOrderable;
|
|---|
| 70 | begin
|
|---|
| 71 |
|
|---|
| 72 | end;
|
|---|
| 73 |
|
|---|
| 74 | function TByte.Successor: IOrderable;
|
|---|
| 75 | begin
|
|---|
| 76 |
|
|---|
| 77 | end;
|
|---|
| 78 |
|
|---|
| 79 | end.
|
|---|