Code example for LinkedHashSet

Methods: addAll

0
 
	private static final int MAX_ITEMS_TO_MEASURE = 100;
	protected static final int UPDATE_INTERVAL = 2000;
	protected final List<? extends Object> items;
	protected List<? extends Object> fitems;
	protected LinkedHashSet<Object> result = new LinkedHashSet<Object>();
	protected ArrayAdapter<Object> adapter;
	protected String filterString = "";
	protected ListView listView;
	protected ViewGroup toolbarView;
	// protected ImageButton disableFilter; 
	protected EditText editText;
 
	protected long startTime = 0L;
	protected Handler editHandler = new Handler();
	protected Runnable filterUpdateCallbak = new Runnable() {
 
		@Override 
		public void run() { 
			ObjectSelectDialog.this 
					.setFilterString(ObjectSelectDialog.this.editText.getText() 
							.toString()); 
			ObjectSelectDialog.this.startTime = 0L; 
		} 
	}; 
 
	@SuppressWarnings("unchecked") 
	public ObjectSelectDialog(Context context, int theme,
			List<? extends Object> items,
			Collection<? extends Object> initiallySelected, ITheme dialogTheme) {
		super(context, theme, dialogTheme);
		Collections.sort(items, new Comparator<Object>() {
 
			@Override 
			public int compare(Object object1, Object object2) {
				if ((object1 == null) && (object2 == null)) {
					return 0; 
				} 
				if (object2 == null) {
					return 1; 
				} 
				if (object1 == null) {
					return -1; 
				} 
				try { 
					if (object1 instanceof Comparable) {
						return ((Comparable<Object>) object1)
								.compareTo(object2);
					} 
				} catch (Exception e) {
					// ignore 
				} 
				return object1.toString().compareTo(object2.toString());
			} 
		}); 
		this.items = items;
		this.result.addAll(initiallySelected);
		this.setTitle(this.getInitialTitle());
	} 
 
	public ObjectSelectDialog(Context context, List<? extends Object> items,
			Collection<? extends Object> initial, ITheme dialogTheme) {