[rules-users] Less than "<" greater than ">" operator
Bruno Freudensprung
bruno.freudensprung at temis.com
Mon Oct 25 09:39:03 EDT 2010
Hi,
From what I see in the code
("org.drools.base.evaluators.ComparableEvaluatorsDefinition" class),
comparison operators have different implementations depending on the
type of the arguments. For Integer, it uses the intValue() and the <
operator. There a many pre-defined type but, in the end, the Object type
seems to be implemented by casting arguments to "Comparable" then using
the compareTo() method.
Bruno.
Ji Oh Yoo a écrit :
> Hi,
>
> In drools rules, we can use "<" or ">" (also "<=" and ">") to write
> conditions
> with numbers and strings.
> But how does it work?
> My question is, does it call the compareTo() method?
> If it does, will those operators work with any objects inherited from
> Comparable<T>?
>
>
> Thanks.
>
More information about the rules-users
mailing list