Class:nsTDeque: Difference between revisions

no edit summary
No edit summary
 
No edit summary
Line 21: Line 21:
    
    
   /**
   /**
     * Returns the number of elements in the deque.
     * @returns
    *  The number of elements in the deque.
     */
     */
   PRUint32 Length();  // or Count() ?
   PRUint32 Length();  // or Count() ?
   
  /**
    * @returns
    *  PR_TRUE if the deque contains no elements and PR_FALSE otherwise.
    */
  PRBool IsEmpty();
    
    
   /**
   /**
     * Adds a new element to the front of the deque.
     * Adds a new element to the front of the deque.
     * @param obj
     * @param obj
     *   The object to be added.
     *   The object to be added.
     */
     */
   void PushFront(const T& obj);
   void PushFront(const T& obj);
    
    
   /**
   /**
     * Adds a new element to the front of the deque.
     * Adds a new element using T's default constructor to the front of the  
     * @returns the address of the newly added element.  
    * deque.
     * @returns
    *  The address of the newly added element or null if the object
    *  could not be allocated.  
     */
     */
   T* PushFront();
   T* PushFront();
    
    
  /**
    * Adds a new element to the back of the deque.
    * @param obj
    *  The object to be added.
    */
   void PushBack(const T& obj);
   void PushBack(const T& obj);
   
  /**
    * Adds a new element using T's default constructor to the back of the
    * deque.
    * @returns
    *  The address of the newly added element or null if the object
    *  could not be allocated.
    */
   T* PushBack();
   T* PushBack();
   
  /**
    * @returns
    *  A const reference to the element at the front of the deque.
    *  It is an error to call this method on an empty deque.
    */
   const T& Front() const;
   const T& Front() const;
   
  /**
    * @returns
    *  A reference to the element at the front of the deque.
    *  It is an error to call this method on an empty deque.
    */
   T& Front();
   T& Front();
   
  /**
    * @returns
    *  A const reference to the element at the back of the deque.
    *  It is an error to call this method on an empty deque.
    */
   const T& Back() const;
   const T& Back() const;
   
  /**
    * @returns
    *  A reference to the element at the back of the deque.
    *  It is an error to call this method on an empty deque.
    */
   T& Back();
   T& Back();
   
  /**
    * Removes the element at the front of the deque.  This method
    * has no effect if the deque is empty.
    */
   void PopFront();
   void PopFront();
   
  /**
    * Removes the element at the back of the deque.  This method
    * has no effect if the deque is empty.
    */
   void PopBack();
   void PopBack();
  };
  };
272

edits