English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
يوجد العديد من طرق ArrayList في Java، مما يسمح لنا باستخدام ArrayList. في هذه الصفحة المرجعية، يمكنك العثور على جميع طرق ArrayList المتاحة في Java، مثل أمثلة على استخدام طرق ArrayList. على سبيل المثال، إذا كنت بحاجة إلى إضافة عنصر إلى ArrayList، استخدم طريقة add().
الطريقة | وصف |
---|---|
add() | إدراج العنصر في ArrayList |
addAll() | إضافة جميع العناصر في المجموعة إلى ArrayList |
clear() | حذف جميع العناصر من ArrayList |
clone() | نسخ ArrayList |
contains() | تحقق من وجود العنصر في ArrayList |
get() | استرجاع العنصر الموجود في الموقع المحدد |
indexOf() | استرجاع موقع العنصر المحدد |
removeAll() | حذف عدة عناصر من ArrayList |
remove() | حذف عنصر واحد من ArrayList |
size() | استرجاع عدد العناصر في ArrayList |
isEmpty() | تحقق من أن ArrayList فارغ |
subList() | استرجاع جزء من ArrayList |
set() | Replace a single element in the ArrayList |
sort() | Sort the ArrayList according to the specified order |
toArray() | Convert the ArrayList to an array |
toString() | Convert the ArrayList to a String |
ensureCapacity() | Adjust the capacity size of the ArrayList |
lastIndexOf() | Return the last occurrence position of the element |
retainAll() | Return the retained common elements |
containsAll() | Check if the collection is a subset of the ArrayList |
trimToSize() | Modify the capacity of the ArrayList example to the current size of the list |
removeRange() | Delete a part of the ArrayList |
replaceAll() | Replace all elements in the ArrayList |
removeIf() | Delete elements that meet the conditions |
forEach() | Traverse all elements of the ArrayList |
iterator() | Return an iterator to traverse the ArrayList in a loop |