All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.sourceforge.plantuml.bpm.Navigators Maven / Gradle / Ivy

There is a newer version: 1.2024.8
Show newest version
// THIS FILE HAS BEEN GENERATED BY A PREPROCESSOR.
package net.sourceforge.plantuml.bpm;

public final class Navigators {

	private Navigators() {

	}

	public static  Navigator iterate(final Chain orig, final O from, final O to) {
		if (orig.compare(from, to) <= 0) {
			return orig.navigator(from);
		}
		return reverse(orig.navigator(from));
	}

	public static  Navigator reverse(final Navigator orig) {
		return new Navigator() {

			public O next() {
				return orig.previous();
			}

			public O previous() {
				return orig.next();
			}

			public O get() {
				return orig.get();
			}

			public void set(O data) {
				orig.set(data);
			}

			public void insertBefore(O data) {
				throw new UnsupportedOperationException();
			}

			public void insertAfter(O data) {
				throw new UnsupportedOperationException();
			}
		};
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy