@Test(expected = IllegalArgumentException.class) public void testInsertNullEntryException() { mWaypointList.insertEntry(0, null); }
public void insertEntry(final int index, final WaypointEntry entry) { if (index < 0 || index > mWaypointEntries.size()) { throw new IllegalArgumentException( getContext().getString(R.string.msdkui_exception_out_of_index_range, 0, mWaypointEntries.size())); } if (entry == null) { throw new IllegalArgumentException( getContext().getString(R.string.msdkui_exception_waypoint_entry_null)); } if (mWaypointEntries.size() == mMaxWaypointCount) { throw new IllegalArgumentException( getContext().getString(R.string.msdkui_exception_waypoint_exceed_max)); } mWaypointEntries.add(index, entry); mAdapter.notifyEntryAdded(index, entry); }
WaypointList extends RecyclerView { public void insertEntry(final int index, final WaypointEntry entry) { if (index < 0 || index > mWaypointEntries.size()) { throw new IllegalArgumentException( getContext().getString(R.string.msdkui_exception_out_of_index_range, 0, mWaypointEntries.size())); } if (entry == null) { throw new IllegalArgumentException( getContext().getString(R.string.msdkui_exception_waypoint_entry_null)); } if (mWaypointEntries.size() == mMaxWaypointCount) { throw new IllegalArgumentException( getContext().getString(R.string.msdkui_exception_waypoint_exceed_max)); } mWaypointEntries.add(index, entry); mAdapter.notifyEntryAdded(index, entry); } }
WaypointList extends RecyclerView { public void insertEntry(final int index, final WaypointEntry entry) { if (index < 0 || index > mWaypointEntries.size()) { throw new IllegalArgumentException( getContext().getString(R.string.msdkui_exception_out_of_index_range, 0, mWaypointEntries.size())); } if (entry == null) { throw new IllegalArgumentException( getContext().getString(R.string.msdkui_exception_waypoint_entry_null)); } if (mWaypointEntries.size() == mMaxWaypointCount) { throw new IllegalArgumentException( getContext().getString(R.string.msdkui_exception_waypoint_exceed_max)); } mWaypointEntries.add(index, entry); mAdapter.notifyEntryAdded(index, entry); } WaypointList(final Context context);  WaypointList(final Context context, final AttributeSet attrs);  WaypointList(final Context context, final AttributeSet attrs, final int defStyleAttr); }
WaypointList extends RecyclerView { public void insertEntry(final int index, final WaypointEntry entry) { if (index < 0 || index > mWaypointEntries.size()) { throw new IllegalArgumentException( getContext().getString(R.string.msdkui_exception_out_of_index_range, 0, mWaypointEntries.size())); } if (entry == null) { throw new IllegalArgumentException( getContext().getString(R.string.msdkui_exception_waypoint_entry_null)); } if (mWaypointEntries.size() == mMaxWaypointCount) { throw new IllegalArgumentException( getContext().getString(R.string.msdkui_exception_waypoint_exceed_max)); } mWaypointEntries.add(index, entry); mAdapter.notifyEntryAdded(index, entry); } WaypointList(final Context context);  WaypointList(final Context context, final AttributeSet attrs);  WaypointList(final Context context, final AttributeSet attrs, final int defStyleAttr); final WaypointEntry addEmptyEntry(); final WaypointEntry insertEmptyEntry(final int index); final boolean addEntry(final WaypointEntry entry); void insertEntry(final int index, final WaypointEntry entry); void updateEntry(final int index, final WaypointEntry entry); WaypointEntry removeEntry(final int index); int getMinWaypointItems(); void setMinWaypointItems(final int count); void setMaxWaypointItems(final int count); int getMaxWaypointItems(); void setVisibleNumberOfWaypointItems(final int count); int getVisibleWaypointItems(); void reset(); void reverse(); List<WaypointEntry> getEntries(); void setEntries(final List<WaypointEntry> entries); List<RouteWaypoint> getRouteWaypoints(); int getEntriesCount(); void setListener(final WaypointList.Listener listener); }
WaypointList extends RecyclerView { public void insertEntry(final int index, final WaypointEntry entry) { if (index < 0 || index > mWaypointEntries.size()) { throw new IllegalArgumentException( getContext().getString(R.string.msdkui_exception_out_of_index_range, 0, mWaypointEntries.size())); } if (entry == null) { throw new IllegalArgumentException( getContext().getString(R.string.msdkui_exception_waypoint_entry_null)); } if (mWaypointEntries.size() == mMaxWaypointCount) { throw new IllegalArgumentException( getContext().getString(R.string.msdkui_exception_waypoint_exceed_max)); } mWaypointEntries.add(index, entry); mAdapter.notifyEntryAdded(index, entry); } WaypointList(final Context context);  WaypointList(final Context context, final AttributeSet attrs);  WaypointList(final Context context, final AttributeSet attrs, final int defStyleAttr); final WaypointEntry addEmptyEntry(); final WaypointEntry insertEmptyEntry(final int index); final boolean addEntry(final WaypointEntry entry); void insertEntry(final int index, final WaypointEntry entry); void updateEntry(final int index, final WaypointEntry entry); WaypointEntry removeEntry(final int index); int getMinWaypointItems(); void setMinWaypointItems(final int count); void setMaxWaypointItems(final int count); int getMaxWaypointItems(); void setVisibleNumberOfWaypointItems(final int count); int getVisibleWaypointItems(); void reset(); void reverse(); List<WaypointEntry> getEntries(); void setEntries(final List<WaypointEntry> entries); List<RouteWaypoint> getRouteWaypoints(); int getEntriesCount(); void setListener(final WaypointList.Listener listener);  }