Method ADT.CircularList()->replace_back()


Method replace_back

ValueType|zero replace_back(ValueType value)

Description

Replace a value to the back of the list.

Parameter value

The value to add.

Returns

Returns the element that was at the front of the list if it was full, and UNDEFINED otherwise.

This operation is similar to:

mixed replace_back(mixed value)
    {
      mixed ret = UNDEFINED;
      if (sizeof(this) == max_size()) {
        ret = pop_front();
      }
      push_back(value);
      return ret;
    }
Note

Presence of this function is indicated by __HAVE_CIRCULAR_LIST_REPLACE_BACK__.

See also

add(), pop_back(), push_front(), replace_front()