aspose file tools*
The moose likes Beginning Java and the fly likes Inverse Boolean Value Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Inverse Boolean Value" Watch "Inverse Boolean Value" New topic

Inverse Boolean Value

Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1391
How do I re-write this to not equals?

Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24166

Putting aside the question of whether or not this is good code, you can just add a "!" (not):

new Boolean(!($F{day6r}.toString()+"/"+$F{day6o}.toString()).equals("0.0/0.0"))

[Jess in Action][AskingGoodQuestions]
Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1391
This works great. This is valid code for JasperReports PrintWhen expression.
fred rosenberger
lowercase baba

Joined: Oct 02, 2003
Posts: 10918

there is a difference between "good" code and "valid" code.

There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
I agree. Here's the link:
subject: Inverse Boolean Value
Similar Threads
Math.min and Math. max
compare variables of an object
Question about equals! help
wrapper class
iterate through float values