どちらも同じです。
DefaultListModel
Vector
ボンネットの下を使用します。
コレクション API に適合するように Vector が書き直されたときに、clear() メソッドが後で追加されました。
バージョン 1.3 ではCollections API
が登場したため、はインターフェイスVector
に適合するように書き直されました。List
下位互換性を保つために、利用可能で可能な場合は、呼び出しを古い既存のメソッドに転送するだけでした。
編集
Java ソースから:
/**
* Removes all components from this list and sets its size to zero.
* <blockquote>
* <b>Note:</b> Although this method is not deprecated, the preferred
* method to use is <code>clear</code>, which implements the
* <code>List</code> interface defined in the 1.2 Collections framework.
* </blockquote>
*
* @see #clear()
* @see Vector#removeAllElements()
*/
public void removeAllElements() {
int index1 = delegate.size()-1;
delegate.removeAllElements();
if (index1 >= 0) {
fireIntervalRemoved(this, 0, index1);
}
}