In Random Marker Schnittstellenbeschreibung steht geschrieben:Wann werden Algorithmen zum Manipulieren von Direktzugriffslisten angewendet?
* <p>The best algorithms for manipulating random access lists (such as
* <tt>ArrayList</tt>) can produce quadratic behavior when applied to
* sequential access lists (such as <tt>LinkedList</tt>). Generic list
* algorithms are encouraged to check whether the given list is an
* <tt>instanceof</tt> this interface before applying an algorithm that would
* provide poor performance if it were applied to a sequential access list,
* and to alter their behavior if necessary to guarantee acceptable
* performance.
In synchronisedList Methodensammlung Klasse gibt es einen Scheck für Random & wenn Erfolg hinsichtlich Algorithmus SynchronizedRandomAccessList Objekt, sondern sie auch keine Details erstellen.
public static <T> List<T> synchronizedList(List<T> list) {
return (list instanceof RandomAccess ?
new SynchronizedRandomAccessList<T>(list) :
new SynchronizedList<T>(list));
}
Wann gilt dieser Algorithmus und wo (ist es ein nativer Code)?
'synchronizedList' erzeugt eine Datenstruktur, es ist nicht wirklich ein Algorithmus ... –
@OliCharlesworth das ist richtig, aber die docs Kommentar sehen, die über Algorithmus sprechen ... im fragen, wann und wo der Algorithmus angewendet wird – Prateek
Was Algorithmus meinen Sie? –