public void removeListener(Class<? extends SequenceListener> listenerClass,
			int preOrPost) {
		List<SequenceListener> toRemove = null;
		SequenceGenerator gen = null;
		if (preOrPost == POST) {
			toRemove = postTrimListeners;
			gen = (TrimmingListener) getListener(TrimmingListener.class, PRE);
		}
		if (preOrPost == PRE) {
			toRemove = preTrimListeners;
			gen = mainReader;
		}
		if ((toRemove == null) || (gen == null))
			return;
		// Checking if this class has already a listener of the same type
		for (SequenceListener l : toRemove) {
			if (l.getClass().equals(listenerClass)) {
				toRemove.remove(l);
				gen.removeListener(l);
				return;
			}
		}
	}