1------------------------------------------------------------------------------
2--                                                                          --
3--                            Matreshka Project                             --
4--                                                                          --
5--                          Ada Modeling Framework                          --
6--                                                                          --
7--                        Runtime Library Component                         --
8--                                                                          --
9------------------------------------------------------------------------------
10--                                                                          --
11-- Copyright © 2011, Vadim Godunko <vgodunko@gmail.com>                     --
12-- All rights reserved.                                                     --
13--                                                                          --
14-- Redistribution and use in source and binary forms, with or without       --
15-- modification, are permitted provided that the following conditions       --
16-- are met:                                                                 --
17--                                                                          --
18--  * Redistributions of source code must retain the above copyright        --
19--    notice, this list of conditions and the following disclaimer.         --
20--                                                                          --
21--  * Redistributions in binary form must reproduce the above copyright     --
22--    notice, this list of conditions and the following disclaimer in the   --
23--    documentation and/or other materials provided with the distribution.  --
24--                                                                          --
25--  * Neither the name of the Vadim Godunko, IE nor the names of its        --
26--    contributors may be used to endorse or promote products derived from  --
27--    this software without specific prior written permission.              --
28--                                                                          --
29-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS      --
30-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT        --
31-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR    --
32-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT     --
33-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,   --
34-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
35-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR   --
36-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF   --
37-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING     --
38-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS       --
39-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.             --
40--                                                                          --
41------------------------------------------------------------------------------
42--  $Revision: 2325 $ $Date: 2011-12-03 13:34:51 +0400 (Sat, 03 Dec 2011) $
43------------------------------------------------------------------------------
44
45package body AMF.Internals.UML_Value_Specifications is
46
47   -------------------
48   -- Boolean_Value --
49   -------------------
50
51   overriding function Boolean_Value
52    (Self : not null access constant UML_Value_Specification_Proxy)
53       return AMF.Optional_Boolean
54   is
55      --  7.3.55 ValueSpecification (from Kernel)
56      --
57      --  [4] The query booleanValue() gives a single Boolean value when one
58      --  can be computed.
59      --
60      --  ValueSpecification::booleanValue() : [Boolean];
61      --  booleanValue = Set{}
62
63   begin
64      return (Is_Empty => True);
65   end Boolean_Value;
66
67   -------------------
68   -- Integer_Value --
69   -------------------
70
71   overriding function Integer_Value
72    (Self : not null access constant UML_Value_Specification_Proxy)
73       return AMF.Optional_Integer
74   is
75      --  7.3.55 ValueSpecification (from Kernel)
76      --
77      --  [2] The query integerValue() gives a single Integer value when one
78      --  can be computed.
79      --
80      --  ValueSpecification::integerValue() : [Integer];
81      --  integerValue = Set{}
82
83   begin
84      return (Is_Empty => True);
85   end Integer_Value;
86
87   -------------------
88   -- Is_Computable --
89   -------------------
90
91   overriding function Is_Computable
92    (Self : not null access constant UML_Value_Specification_Proxy)
93       return Boolean
94   is
95      --  7.3.55 ValueSpecification (from Kernel)
96      --
97      --  [1] The query isComputable() determines whether a value specification
98      --  can be computed in a model. This operation cannot be fully defined in
99      --  OCL. A conforming implementation is expected to deliver true for this
100      --  operation for all value specifications that it can compute, and to
101      --  compute all of those for which the operation is true. A conforming
102      --  implementation is expected to be able to compute the value of all
103      --  literals.
104      --
105      --  ValueSpecification::isComputable(): Boolean;
106      --  isComputable = false
107      --
108
109   begin
110      return False;
111   end Is_Computable;
112
113   -------------
114   -- Is_Null --
115   -------------
116
117   overriding function Is_Null
118    (Self : not null access constant UML_Value_Specification_Proxy)
119       return Boolean
120   is
121      --  7.3.55 ValueSpecification (from Kernel)
122      --
123      --  [7] The query isNull() returns true when it can be computed that the
124      --  value is null.
125      --
126      --  ValueSpecification::isNull() : Boolean;
127      --  isNull = false
128
129   begin
130      return False;
131   end Is_Null;
132
133   ----------------
134   -- Real_Value --
135   ----------------
136
137   overriding function Real_Value
138    (Self : not null access constant UML_Value_Specification_Proxy)
139       return AMF.Optional_Real
140   is
141      --  7.3.55 ValueSpecification (from Kernel)
142      --
143      --  [3] The query realValue() gives a single Real value when one can be
144      --  computed.
145      --
146      --  ValueSpecification::realValue() : [Real];
147      --  realValue = Set{}
148
149   begin
150      return (Is_Empty => True);
151   end Real_Value;
152
153   ------------------
154   -- String_Value --
155   ------------------
156
157   overriding function String_Value
158    (Self : not null access constant UML_Value_Specification_Proxy)
159       return AMF.Optional_String
160   is
161      --  7.3.55 ValueSpecification (from Kernel)
162      --
163      --  [5] The query stringValue() gives a single String value when one can
164      --  be computed.
165      --
166      --  ValueSpecification::stringValue() : [String];
167      --  stringValue = Set{}
168
169   begin
170      return (Is_Empty => True);
171   end String_Value;
172
173   ---------------------
174   -- Unlimited_Value --
175   ---------------------
176
177   overriding function Unlimited_Value
178    (Self : not null access constant UML_Value_Specification_Proxy)
179       return AMF.Optional_Unlimited_Natural
180   is
181      --  7.3.55 ValueSpecification (from Kernel)
182      --
183      --  [6] The query unlimitedValue() gives a single UnlimitedNatural value
184      --  when one can be computed.
185      --
186      --  ValueSpecification::unlimitedValue() : [UnlimitedNatural];
187      --  unlimitedValue = Set{}
188
189   begin
190      return (Is_Empty => True);
191   end Unlimited_Value;
192
193end AMF.Internals.UML_Value_Specifications;
194