PageRenderTime 14ms CodeModel.GetById 7ms app.highlight 4ms RepoModel.GetById 0ms app.codeStats 0ms

/src/main/java/de/jbee/lang/Ord.java

http://github.com/jbee/jadamant
Java | 24 lines | 4 code | 2 blank | 18 comment | 0 complexity | 90470925da3458fa3ba17803f2c043fa MD5 | raw file
 1package de.jbee.lang;
 2
 3/**
 4 * <p>
 5 * {@link Ord} is not a property of the value instances being ordered itself since there is no
 6 * natural order. This is a common misunderstanding. {@link Order} does depend on the current role
 7 * of the sorted object. Therefore a order is something external that is applied to value objects.
 8 * It results in a {@link Ordering}.
 9 * </p>
10 * <p>
11 * If that seams to force you to violate encapsulation principle simply put the concerned
12 * {@linkplain Ord} implementation as a static inner class of your value object. That helps to hide
13 * its data and still allows to apply an specific order based on your entity's hidden field(s).
14 * </p>
15 * <p>
16 * There are a bunch of frequently used orderings available in the {@link Order} utility class.
17 * </p>
18 * 
19 * @author Jan Bernitt (jan.bernitt@gmx.de)
20 */
21public interface Ord<T> {
22
23	Ordering ord( T left, T right );
24}