1182 GENERICITY VERSUS INHERITANCE SB.4 feature--Access capacity,first,next,count:INTEGER item:like item anchor is --Oldest element in queue require not empty do Result implementation.item (first) end feature--Status report empty:BOOLEAN is --Is queue empty? do Result :=(count=0)end full:BOOLEAN is --Is representation full? do Result :=(count capacity)end feature--Element change put (x:like item anchor)is -Add x at end of queue require not full do implementation.put (x,next),count :count I;next:=successor (next) end remove is 一 Remove oldest element require not empty do first:=successor (first);count count-I end1182 GENERICITY VERSUS INHERITANCE §B.4 feature -- Access capacity, first, next, count: INTEGER item: like item_anchor is -- Oldest element in queue require not empty do Result := implementation ● item (first) end feature -- Status report empty: BOOLEAN is -- Is queue empty? do Result := (count = 0) end full: BOOLEAN is -- Is representation full? do Result := (count = capacity) end feature -- Element change put (x: like item_anchor) is -- Add x at end of queue require not full do implementation ●put (x, next); count := count + 1; next := successor (next) end remove is -- Remove oldest element require not empty do first := successor (first); count := count – 1 end