org.simantics.databoard.util
Class DataValueUtil
java.lang.Object
org.simantics.databoard.util.DataValueUtil
public class DataValueUtil
- extends java.lang.Object
DataValue handling utilities
- Author:
- Toni Kalajainen
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DataValueUtil
public DataValueUtil()
compare
public static int compare(Binding b1,
java.lang.Object o1,
Binding b2,
java.lang.Object o2)
throws BindingException
- Compares its two data values for order. Returns a negative integer,
zero, or a positive integer as the first argument is less than, equal
to, or greater than the second.
The implementor must also ensure that the relation is transitive:
((compare(x, y)>0) && (compare(y, z)>0))
implies
compare(x, z)>0
.
Finally, the implementor must ensure that compare(x, y)==0
implies that sgn(compare(x, z))==sgn(compare(y, z))
for all
z
.
DataTypes of b1 and b2 are not equal then data types are compared.
The comparison function is defined at
https://www.simantics.org/wiki/index.php/Org.simantics.datatype_Manual#CompareTo_and_Equals
- Parameters:
b1
- Binding of o1o1
- the first object to be compared.b2
- Binding of o2o2
- the second object to be compared.
- Returns:
- a negative integer, zero, or a positive integer as the
first argument is less than, equal to, or greater than the
second.
- Throws:
BindingException
- if object cannot be handled by a binding
equals
public static boolean equals(Binding b1,
java.lang.Object o1,
Binding b2,
java.lang.Object o2)
throws BindingException
- Throws:
BindingException
createComparator
public static java.util.Comparator<java.lang.Object> createComparator(Binding b1,
Binding b2)