Code example for ArrayList

Methods: addcontains

0
	public boolean registerListener(SensorEventListener listener, Sensor sensor, int rate) {
		 
		if(forceListenersToFail)
			return false; 
		 
		if(!listeners.contains(listener))
			listeners.add(listener);
		 
		return true; 
	} 
	 
	@Implementation 
	public void unregisterListener(SensorEventListener listener, Sensor sensor) {
		listeners.remove(listener);
	} 
	 
	public boolean hasListener(SensorEventListener listener) {
		return listeners.contains(listener);
	} 
 
Stop searching for code, let great code find you!  Add Codota to your java IDE