@Override public boolean contains(Object element) { element = convert(element); return super.contains(element); } }
/** * Appends the specified element to the end of this list. * <p/> * This method performs any necessary type conversion. * * @param element element to be appended to this list. * @return <tt>true</tt> (as per the general contract of Collection.add). */ @Override public boolean add(Object element) { element = convert(element); return super.add(element); }
/** * Replaces the element at the specified position in this list with the specified element. * <p/> * This method is guaranteed to work since it will create empty beans to fill the gap between * the current list size and the requested index to enable the element to be set. This method * also performs any necessary type conversion. * * @param index index of element to replace. * @param element element to be stored at the specified position. * @return the element previously at the specified position. */ @Override public Object set(int index, Object element) { if (index >= this.size()) { get(index); } element = convert(element); return super.set(index, element); }
/** * Inserts the specified element at the specified position in this list. Shifts the element * currently at that position (if any) and any subsequent elements to the right (adds one to * their indices). * <p/> * This method is guaranteed to work since it will create empty beans to fill the gap between * the current list size and the requested index to enable the element to be set. This method * also performs any necessary type conversion. * * @param index index at which the specified element is to be inserted. * @param element element to be inserted. */ @Override public void add(int index, Object element) { if (index >= this.size()) { get(index); } element = convert(element); super.add(index, element); }