正在加载图片...
1166.2 EXTRACTS FROM THE BASE LIBRARY SA.I end; ensure lower minindex; upper maxindex end; make_from_array (a:ARRAY [G])is --Initialize from the items of'a'. -(Useful in proper descendants of class'ARRAY', -to initialize an array-like object from a manifest array.) require array_exists:a /Void do area :a.area; lower :a.lower; upper :a.upper end; setup (other:like Current)is --Perform actions on a freshly created object so that -the contents of'other'can be safely copied onto it. do make area (other.capacity) end; feature--Access frozen item,frozen infix"@",entry (i:INTEGER):G is --Entry at index'i',if in index interval do Result :area.item (i-lower); end;1166.2 EXTRACTS FROM THE BASE LIBRARY §A.1 end; ensure lower = minindex; upper = maxindex end; make_from_array (a: ARRAY [G]) is -- Initialize from the items of `a’. -- (Useful in proper descendants of class `ARRAY’, -- to initialize an array-like object from a manifest array.) require array_exists: a /= Void do area := a.area; lower := a.lower; upper := a.upper end; setup (other: like Current) is -- Perform actions on a freshly created object so that -- the contents of `other’ can be safely copied onto it. do make_area (other.capacity) end; feature -- Access frozen item, frozen infix “@”, entry (i: INTEGER): G is -- Entry at index `i’, if in index interval do Result := area.item (i - lower); end;
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有