Merge "Added new method to the NotificationManager Interface" into tizen_2.2
[platform/framework/native/appfw.git] / inc / FBaseColArrayList.h
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
3 //
4 // Licensed under the Apache License, Version 2.0 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16
17 /**
18  * @file                FBaseColArrayList.h
19  * @brief               This is the header file for the %ArrayList class.
20  *
21  * This header file contains the declarations of the %ArrayList class.
22  */
23 #ifndef _FBASE_COL_ARRAY_LIST_H_
24 #define _FBASE_COL_ARRAY_LIST_H_
25
26 #include <FBaseObject.h>
27 #include <FBaseColIComparer.h>
28 #include <FBaseColIList.h>
29
30
31 namespace Tizen { namespace Base { namespace Collection
32 {
33
34 /**
35  * @class ArrayList
36  * @brief This class represents a collection of objects that can be individually accessed by an index.
37  *
38  * @since 2.0
39  *
40  *
41  * The %ArrayList class represents a collection of objects that can be individually accessed by an index.
42  *
43  * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/base/arraylist_linkedlist.htm">ArrayList and LinkedList</a>.
44  *
45  * The following example demonstrates how to use the %ArrayList class.
46  *
47  * @code
48  *
49  *      #include <FBase.h>
50  *
51  *      using namespace Tizen::Base;
52  *      using namespace Tizen::Base::Collection;
53  *
54  *
55  *      void
56  *      MyClass::ArrayListSample(void)
57  *      {
58  *              ArrayList       list(SingleObjectDeleter);
59  *
60  *              list.Construct();
61  *
62  *              list.Add(new Integer(1));       // 1
63  *              list.Add(new Integer(2));       // 1,2
64  *              list.Add(new Integer(3));       // 1,2,3
65  *
66  *              Integer*        pInt = static_cast< Integer* > (list.GetAt(0));
67  *
68  *              if (pInt->Equals(Integer(1)))
69  *              {
70  *                      // Must be here
71  *              }
72  *
73  *              list.InsertAt(new Integer(4), 1);       // 1,4,2,3
74  *
75  *              list.Remove(Integer(3));                // 1,4,2
76  *
77  *              list.RemoveAt(0);                               // 4,2
78  *
79  *              list.Sort(IntegerComparer());   // 2,4
80  *
81  *              // Uses an enumerator to access elements in the list
82  *              IEnumerator*    pEnum = list.GetEnumeratorN();
83  *              Object*         pObj = null;
84  *              while (pEnum->MoveNext() == E_SUCCESS)
85  *              {
86  *                      pObj = pEnum->GetCurrent();
87  *              }
88  *
89  *              delete pEnum;
90  *
91  *
92  *              // Deallocates all objects
93  *              // Because the destructor calls RemoveAll() internally, you do not need to call RemoveAll() to destroy all elements at the end.
94  *              // list.RemoveAll();
95  *      }
96  * @endcode
97  */
98 class _OSP_EXPORT_ ArrayList
99         : public IList
100         , public Object
101 {
102 public:
103         using IList::Add;
104         using IList::InsertAt;
105         using IList::Remove;
106         using IList::RemoveAt;
107         using IList::RemoveItems;
108         using IList::RemoveAll;
109         using IList::SetAt;
110         using IList::ContainsAll;
111         /**
112          * This is the default constructor for this class.
113          *
114          * @since 2.0
115          *
116          * @param[in]   deleter         A function pointer to the type of the element deleter
117          * @remarks             
118          *                              - To create an owning collection, set the element deleter value as @c SingleObjectDeleter. @n
119          *                              This gives the collection the ownership of the elements and the collection will destroy the elements. @n
120          *                              On the other hand, to create a non-owning collection, you do not need to set the element deleter value, 
121          *                              as @c NoOpDeleter is the default element deleter. @n
122          *                              It means that you do not transfer the ownership of the elements to the collection.
123          *                              - After creating an instance of the %ArrayList class, one of the Construct() methods must be called explicitly to initialize this instance.
124          * @see                 NoOpDeleter()
125          * @see                 SingleObjectDeleter()
126          * @see                 ArrayDeleter()
127          */
128         explicit ArrayList(DeleterFunctionType deleter = NoOpDeleter);
129
130         /**
131          * This destructor overrides Tizen::Base::Object::~Object().
132          *
133          * @since 2.0
134          */
135         virtual ~ArrayList(void);
136
137         /**
138          * Initializes this instance of %ArrayList with the specified parameter and sets its initial capacity to the
139          * indicated value.
140          *
141          * @since 2.0
142          *
143          * @return              An error code
144          * @param[in]   capacity                  The number of elements @n
145          *                                                                The default capacity is @c 10.
146          * @exception   E_SUCCESS                 The method is successful.
147          * @exception   E_INVALID_ARG     Either of the following conditions has occurred:
148          *                                                                - A specified input parameter is invalid.
149          *                                                                - The specified @c capacity is negative.
150          * @remarks     If the number of elements added to the list reaches the current capacity,
151          *                              the capacity is automatically increased by memory reallocation. @n
152          *                              Therefore, if the size of the list can be estimated,
153          *                              specifying the initial capacity eliminates the need to perform a number of
154          *                              resizing operations while adding elements to the list.
155          * @see                 ArrayList()
156          */
157         result Construct(int capacity = DEFAULT_CAPACITY);
158
159
160         /**
161          * Initializes this instance of %ArrayList by copying the elements of the specified
162          * @c collection. @n
163          * The capacity of the list is the same as the number of elements copied.
164          *
165          * @since 2.0
166          *
167          * @return              An error code
168          * @param[in]   collection                      The collection to add
169          * @exception   E_SUCCESS                       The method is successful.
170          * @exception   E_INVALID_OPERATION     Either of the following conditions has occurred:
171          *                                                                      - The current state of the instance prohibits the execution of the specified operation.
172          *                                                                      - The specified @c collection is modified during the operation of this method.
173          * @remarks     This method performs a shallow copy. It copies just the pointer and not the element itself.
174          * @see                 ArrayList()
175          */
176         result Construct(const ICollection& collection);
177
178         /**
179          * Adds the specified object to the end of this list.
180          *
181          * @since 2.0
182          *
183          * @return              An error code
184          * @param[in]   pObj                    A pointer to the object to add
185          * @exception   E_SUCCESS               The method is successful.
186          * @exception   E_INVALID_ARG   The specified input parameter is invalid.
187          * @remarks     This method performs a shallow copy. It copies just the pointer and not the element itself.
188          * @see                 Remove()
189          */
190         virtual result Add(Object* pObj);
191
192
193         /**
194          * Adds the elements of the specified @c collection to the end of this list.
195          *
196          * @since 2.0
197          *
198          * @return              An error code
199          * @param[in]   collection                      The collection to add
200          * @exception   E_SUCCESS                       The method is successful.
201          * @exception   E_INVALID_OPERATION     Either of the following conditions has occurred:
202          *                                                                      - The current state of the instance prohibits the execution of the specified operation.
203          *                                                                      - The specified @c collection is modified during the operation of this method.
204          * @remarks     This method performs a shallow copy. It copies just the pointer and not the element itself.
205          * @see                 RemoveItems()
206          */
207         virtual result AddItems(const ICollection& collection);
208
209
210         /**
211          * Gets the enumerator (an instance of the IEnumerator derived class) of this list.
212          *
213          * @since 2.0
214          *
215          * @return              An instance of the IEnumerator derived class, @n
216          *                              else @c null if an exception occurs
217          * @remarks             The specific error code can be accessed using the GetLastResult() method.
218          */
219         virtual IEnumerator* GetEnumeratorN(void) const;
220
221         /**
222          * Gets the bidirectional enumerator (an instance of the IBidirectionalEnumerator derived class) of this list.
223          *
224          * @since 2.0
225          *
226          * @return                      An instance of the IBidirectionalEnumerator derived class, @n
227          *                                      else @c null if an exception occurs
228          * @remarks                     
229          *                                      - Use this method to obtain a bidirectional enumerator (an instance of the IBidirectionalEnumerator derived class)
230          *                                      to iterate over a collection (an instance of the IList derived class).
231          *                                      - The specific error code can be accessed using GetLastResult() method.
232          */
233         virtual IBidirectionalEnumerator* GetBidirectionalEnumeratorN(void) const;
234
235         /**
236          * Gets the object at the specified @c index of this list.
237          *
238          * @since 2.0
239          *
240          * @return              The object at the specified @c index of this list, @n
241          *                              else @c null if the @c index is not valid
242          * @param[in]   index                                   The index of the object to read in the calling list
243          * @exception   E_SUCCESS                               The method is successful.
244          * @exception   E_OUT_OF_RANGE                  Either of the following conditions has occurred:
245          *                                                                              - The specified @c index is outside the bounds of the data structure.
246          *                                                                              - The specified @c index is either equal to or greater than the number of elements.
247          *                                                                              - The specified @c index is less than @c 0.
248          * @remarks             The specific error code can be accessed using the GetLastResult() method.
249          * @see                 SetAt()
250          */
251         virtual const Object* GetAt(int index) const;
252
253
254         /**
255          * Gets the object at the specified @c index of this list.
256          *
257          * @since 2.0
258          *
259          * @return              The object at the specified @c index of this list, @n
260          *                              else @c null if the @c index is not valid
261          * @param[in]   index                                   The index of the object to read
262          * @exception   E_SUCCESS                               The method is successful.
263          * @exception   E_OUT_OF_RANGE                  Either of the following conditions has occurred:
264          *                                                                              - The specified @c index is outside the bounds of the data structure.
265          *                                                                              - The specified @c index is either equal to or greater than the number of elements.
266          *                                                                              - The specified @c index is less than @c 0.
267          * @remarks             The specific error code can be accessed using the GetLastResult() method.
268          * @see                 SetAt()
269          */
270         virtual Object* GetAt(int index);
271
272         /**
273          * Gets an IList instance within the specified range of this list.
274          *
275          * @since 2.0
276          *
277          * @return              A pointer to IList, @n
278          *                              else @c null if an exception occurs
279          * @param[in]   startIndex                              The starting index of the range
280          * @param[in]   count                                   The number of elements to read
281          * @exception   E_SUCCESS                               The method is successful.
282          * @exception   E_OUT_OF_RANGE                  Either of the following conditions has occurred:
283          *                                                                              - The specified index is outside the bounds of the data structure.
284          *                                                                              - The specified @c startIndex is either equal to or greater than the number of elements.
285          *                                                                              - The specified @c startIndex is less than @c 0.
286          *                                                                              - The specified @c count is greater than the number of elements starting from @c startIndex.
287          *                                                                              - The specified @c count is less than @c 0.
288          * @remarks             
289          *                              - The IList stores only the pointers to the elements in the list, not the elements themselves.
290          *                              - The specific error code can be accessed using the GetLastResult() method.
291          */
292         virtual IList* GetItemsN(int startIndex, int count) const;
293
294         /**
295          * Searches for an object in this list. @n
296          * Gets the @c index of the object if found.
297          *
298          * @since 2.0
299          *
300          * @return              An error code
301          * @param[in]   obj             The object to locate
302          * @param[out]  index                   The index of the object
303          * @exception   E_SUCCESS               The method is successful.
304          * @exception   E_OBJ_NOT_FOUND The specified @c obj has not been found.
305          * @see                 LastIndexOf()
306          */
307         virtual result IndexOf(const Object& obj, int& index) const;
308
309         /**
310          * Searches for an object starting from the specified @c startIndex. @n
311          * Gets the @c index of the object if found.
312          *
313          * @since 2.0
314          *
315          * @return              An error code
316          * @param[in]   obj                             The object to locate
317          * @param[in]   startIndex                              The starting index for the search @n
318          *                                                                              It must be less than the number of elements.
319          * @param[out]  index                                   The index of the object
320          * @exception   E_SUCCESS                               The method is successful.
321          * @exception   E_OUT_OF_RANGE                  Either of the following conditions has occurred:
322          *                                                                              - The specified @c index is outside the bounds of the data structure.
323          *                                                                              - The specified @c startIndex is either equal to or greater than the number of elements.
324          *                                                                              - The specified @c startIndex is less than @c 0.
325          * @exception   E_OBJ_NOT_FOUND                 The specified @c obj has not been found.
326          * @see                 LastIndexOf()
327          */
328         virtual result IndexOf(const Object& obj, int startIndex, int& index) const;
329
330         /**
331          * Searches for an object within the specified range. @n
332          * Gets the @c index of the object if found.
333          *
334          * @since 2.0
335          *
336          * @return              An error code
337          * @param[in]   obj                             The object to locate
338          * @param[in]   startIndex                              The starting index of the range
339          * @param[in]   count                                   The number of elements to read
340          * @param[out]  index                                   The index of the object
341          * @exception   E_SUCCESS                               The method is successful.
342          * @exception   E_OUT_OF_RANGE                  Either of the following conditions has occurred:
343          *                                                                              - The specified @c index is outside the bounds of the data structure.
344          *                                                                              - The specified @c startIndex is either equal to or greater than the number of elements.
345          *                                                                              - The specified @c startIndex is less than @c 0.
346          *                                                                              - The specified @c count is greater than the number of elements starting from @c startIndex.
347          *                                                                              - The specified @c count is less than @c 0.
348          * @exception   E_OBJ_NOT_FOUND                 The specified @c obj has not been found.
349          * @see                 LastIndexOf()
350          */
351         virtual result IndexOf(const Object& obj, int startIndex, int count, int& index) const;
352
353         /**
354          * Searches for the last occurrence of an object in this list. @n
355          * Gets the @c index of the object if found.
356          *
357          * @since 2.0
358          *
359          * @return              An error code
360          * @param[in]   obj                     The object to locate
361          * @param[out]  index                           The index of the last occurrence of the specified object
362          * @exception   E_SUCCESS                       The method is successful.
363          * @exception   E_OBJ_NOT_FOUND         The specified @c obj has not been found.
364          * @see                 IndexOf()
365          */
366         virtual result LastIndexOf(const Object& obj, int& index) const;
367
368         /**
369          * Inserts the object at the specified location.
370          *
371          * @since 2.0
372          *
373          * @return              An error code
374          * @param[in]   pObj                                    A pointer to the object to insert
375          * @param[in]   index                                   The index at which the object is inserted
376          * @exception   E_SUCCESS                               The method is successful.
377          * @exception   E_INVALID_ARG                   The specified input parameter is invalid.
378          * @exception   E_OUT_OF_RANGE                  Either of the following conditions has occurred:
379          *                                                                              - The specified @c index is outside the bounds of the data structure.
380          *                                                                              - The specified @c index is greater than the number of elements.
381          *                                                                              - The specified @c index is less than @c 0.
382          * @remarks             
383          *                              - The elements that follow the insertion point move down to accommodate the new element.
384          *                              - If the @c index is equal to the number of elements, then the new element
385          *                              is added at the end of this list.
386          *                              - This method performs a shallow copy. It inserts just the pointer and not the element itself.
387          * @see                 Add()
388          * @see                 RemoveAt()
389          */
390         virtual result InsertAt(Object* pObj, int index);
391
392         /**
393          * Inserts the elements of the collection at the specified location.
394          *
395          * @since 2.0
396          *
397          * @return              An error code
398          * @param[in]   collection                              The collection to insert
399          * @param[in]   startIndex                              The starting index at which the collection is inserted
400          * @exception   E_SUCCESS                               The method is successful.
401          * @exception   E_OUT_OF_RANGE                  Either of the following conditions has occurred:
402          *                                                                              - The specified index is outside the bounds of the data structure.
403          *                                                                              - The specified @c startIndex is greater than the number of elements.
404          *                                                                              - The specified @c startIndex is less than @c 0.
405          * @exception   E_INVALID_OPERATION             Either of the following conditions has occurred:
406          *                                                                              - The current state of the instance prohibits the execution of the specified operation.
407          *                                                                              - The specified @c collection is modified during the operation of this method.
408          * @remarks
409          *                              - The elements that follow the insertion point move down to accommodate the new element.
410          *                              - If the @c startIndex is equal to the number of elements then the new elements
411          *                              are added at the end of this list.
412          *                              - This method performs a shallow copy. It inserts just the pointer and not the element itself.
413          * @see                 RemoveItems()
414          * @see                 AddItems()
415          */
416         virtual result InsertItemsFrom(const ICollection& collection, int startIndex);
417
418         /**
419          * Removes the first occurrence of the specified object.
420          *
421          * @since 2.0
422          *
423          * @return              An error code
424          * @param[in]   obj                             The object to remove
425          * @exception   E_SUCCESS               The method is successful.
426          * @exception   E_OBJ_NOT_FOUND The specified @c obj has not been found.
427          * @see                 Add()
428          * @see                 RemoveAt()
429          * @see                 RemoveAll()
430          */
431         virtual result Remove(const Object& obj);
432
433         /**
434          * Removes the object at the specified location.
435          *
436          * @since 2.0
437          *
438          * @return              An error code
439          * @param[in]   index                                   The index at which the object is removed
440          * @exception   E_SUCCESS                               The method is successful.
441          * @exception   E_OUT_OF_RANGE                  Either of the following conditions has occurred:
442          *                                                                              - The specified @c index is outside the bounds of the data structure.
443          *                                                                              - The specified @c index is either equal to or greater than the number of elements.
444          *                                                                              - The specified @c index is less than @c 0.
445          * @remarks             The elements that follow the deletion point move up to occupy the vacated spot.
446          * @see                 InsertAt()
447          * @see                 Remove()
448          */
449         virtual result RemoveAt(int index);
450
451         /**
452          * Removes all the elements within the specified range.
453          *
454          * @since 2.0
455          *
456          * @return              An error code
457          * @param[in]   startIndex                              The starting index of the range
458          * @param[in]   count                                   The number of elements to read
459          * @exception   E_SUCCESS                               The method is successful.
460          * @exception   E_OUT_OF_RANGE                  Either of the following conditions has occurred:
461          *                                                                              - The specified index is outside the bounds of the data structure.
462          *                                                                              - The specified @c startIndex is either equal to or greater than the number of elements.
463          *                                                                              - The specified @c startIndex is less than @c 0.
464          *                                                                              - The specified @c count is greater than the number of elements starting from @c startIndex.
465          *                                                                              - The specified @c count is less than @c 0.
466          * @remarks             The elements that follow the deletion point move up to occupy the vacated spot.
467          * @see                 AddItems()
468          */
469         virtual result RemoveItems(int startIndex, int count);
470
471         /**
472          * Removes all of the elements that are in the intersection of the specified @c collection
473          * and this list.
474          *
475          * @since 2.0
476          *
477          * @return              An error code
478          * @param[in]   collection                      The collection to remove from this list
479          * @exception   E_SUCCESS                       The method is successful.
480          * @exception   E_INVALID_OPERATION     Either of the following conditions has occurred:
481          *                                                                      - The current state of the instance prohibits the execution of the specified operation.
482          *                                                                      - The specified @c collection is modified during the operation of this method.
483          * @see                 Remove()
484          * @see                 RemoveAt()
485          */
486         virtual result RemoveItems(const ICollection& collection);
487
488         /**
489          * Removes all the object pointers in the collection and also removes all the objects depending on the specified element deleter.
490          * The %RemoveAll() can be called before the collection is deleted.
491          *
492          * @since 2.0
493          */
494         virtual void RemoveAll(void);
495
496         /**
497          * Replaces the object at the specified @c index with the specified object.
498          *
499          * @since 2.0
500          *
501          * @return              An error code
502          * @param[in]   pObj                                    A pointer to the object to set
503          * @param[in]   index                                   The index at which the object is set
504          * @exception   E_SUCCESS                               The method is successful.
505          * @exception   E_INVALID_ARG                   A specified input parameter is invalid.
506          * @exception   E_OUT_OF_RANGE                  Either of the following conditions has occurred:
507          *                                                                              - The specified @c index is outside the bounds of the data structure.
508          *                                                                              - The specified @c index is either equal to or greater than the number of elements.
509          *                                                                              - The specified @c index is less than @c 0.
510          * @see                 GetAt()
511          */
512         virtual result SetAt(Object* pObj, int index);
513
514         /**
515          * Sets the capacity of this list at the specified value.
516          *
517          * @since 2.0
518          *
519          * @return              An error code
520          * @param[in]   newCapacity             The new capacity of this list
521          * @exception   E_SUCCESS               The method is successful.
522          * @exception   E_INVALID_ARG   Either of the following conditions has occurred:
523          *                                                              - The specified input parameter is invalid.
524          *                                                              - The specified @c newCapacity is negative.
525          * @remarks             When the new capacity is less than the current capacity, the elements
526          *                              within the truncated memory are not destroyed.
527          * @see                 Construct()
528          * @see                 Trim()
529          * @see                 GetCapacity()
530          */
531         virtual result SetCapacity(int newCapacity);
532
533         /**
534          * Sorts the elements of this list using the @c comparer provided.
535          *
536          * @since 2.0
537          *
538          * @return              An error code
539          * @param[in]   comparer                The IComparer implementation to use when comparing elements
540          * @exception   E_SUCCESS               The method is successful.
541          * @exception   E_INVALID_ARG   The specified input parameter is invalid.
542          */
543         virtual result Sort(const IComparer& comparer);
544
545         /**
546          * Sets the capacity to the actual number of elements in this list.
547          *
548          * @since 2.0
549          */
550         virtual void Trim(void);
551
552         /**
553          * Gets the current capacity of this list.
554          *
555          * @since 2.0
556          *
557          * @return      The current capacity of this list
558          * @see                 SetCapacity()
559          */
560         virtual int GetCapacity(void) const;
561
562         /**
563          * Gets the number of objects currently stored in this list.
564          *
565          * @since 2.0
566          *
567          * @return              The number of objects currently stored in this list
568          */
569         virtual int GetCount(void) const;
570
571         /**
572          * Checks whether the list contains the specified object.
573          *
574          * @since 2.0
575          *
576          * @return              @c true if the object is present in the list, @n
577          *                              else @c false
578          * @param[in]   obj     The object to locate
579          * @see                 ContainsAll()
580          */
581         virtual bool Contains(const Object& obj) const;
582
583         /**
584          * Checks whether the list contains all the elements of the specified @c collection.
585          *
586          * @since 2.0
587          *
588          * @return              @c true if the list contains all the elements of the specified @c collection, @n
589          *                              else @c false
590          * @param[in]   collection                      The collection to check for in the list
591          * @exception   E_SUCCESS                       The method is successful.
592          * @exception   E_INVALID_OPERATION     Either of the following conditions has occurred:
593          *                                                                      - The current state of the instance prohibits the execution of the specified operation.
594          *                                                                      - The specified @c collection is modified during the operation of this method.
595          * @remarks
596          *                              - The specific error code can be accessed using the GetLastResult() method.
597          *                              - If the given @c collection is empty, this method will return @c true.
598          * @see                 Contains()
599          */
600         virtual bool ContainsAll(const ICollection& collection) const;
601
602         /**
603          * Compares the specified Tizen::Base::Object instance with the calling %ArrayList instance.
604          *
605          * @since 2.0
606          *
607          * @return              @c true if the given Tizen::Base::Object matches the calling list, @n
608          *                              else @c false
609          * @param[in]   obj The object to compare with the calling list
610          * @remarks     This method returns @c true only if the specified @c obj is also an instance of %ArrayList,
611          *                              both lists have the same size, and all the corresponding pairs of the elements in the two lists are equal. @n
612          *                              In other words, the two lists are equal if they contain the same elements in the same order.
613          */
614         virtual bool Equals(const Object& obj) const;
615
616         /**
617          * Gets the hash value of the current instance.
618          *
619          * @since 2.0
620          *
621          * @return      The hash value of the current instance
622          * @remarks     The two Tizen::Base::Object::Equals() instances must return the same hash value. @n
623          *                              For better performance, the used hash function must generate a random distribution for all the inputs.
624          */
625         virtual int GetHashCode(void) const;
626
627         /**
628          * Checks whether the instance is an %ArrayList or a LinkedList.
629          *
630          * @since 2.0
631          * @return      @c true if it is an %ArrayList, @n
632          *                      else @c false if it is a LinkedList
633          */
634         virtual bool IsRandomAccessible(void) const
635         {
636                 return true;
637         }
638
639         /**
640          * Gets the element deleter of the collection.
641          *
642          * @since 2.0
643          *
644          * @return      A function pointer to the existing element deleter
645          */
646         virtual DeleterFunctionType GetDeleter(void) const;
647
648 private:
649         /**
650          * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
651          *
652          * @param[in]   list    The instance of the %ArrayList class to copy from
653          */
654         ArrayList(const ArrayList& list);
655
656         /**
657          * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
658          *
659          * @param[in]   list    An instance of %ArrayList
660          */
661         ArrayList& operator =(const ArrayList& list);
662
663         /**
664          * Sorts the specified sub-list.
665          *
666          * @return              An error code
667          * @param[in]   startIndex              The starting point of the sub-list to sort
668          * @param[in]   endIndex                The end point of the sub-list to sort
669          * @exception   E_SUCCESS               The method is successful.
670          * @exception   E_INVALID_ARG   A specified input parameter is invalid, or
671          *                                                              the comparer has failed to compare the elements.
672          */
673         result QuickSort(int startIndex, int endIndex);
674
675         /**
676          * Sets the element deleter of the collection.
677          *
678          * @since 2.0
679          *
680          * @param[in]   deleter A function pointer to the element deleter to set
681          */
682         virtual void SetDeleter(DeleterFunctionType deleter);
683
684         int __capacity;
685         int __count;
686         Object** __pObjArray;
687         int __modCount;
688         IComparer* __pComparer;
689         static const int DEFAULT_CAPACITY = 10;
690         DeleterFunctionType __deleter;
691
692         friend class _ArrayListEnumerator;
693         friend class _ArrayListImpl;
694         class _ArrayListImpl* __pArrayListImpl;
695
696 }; // ArrayList
697
698 }}} // Tizen::Base::Collection
699
700 #endif // _FBASE_COL_ARRAY_LIST_H_