File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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: 1562
How do I re-write this to not equals?

Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24199

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: 1562
This works great. This is valid code for JasperReports PrintWhen expression.
fred rosenberger
lowercase baba

Joined: Oct 02, 2003
Posts: 11955

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
It's not a secret anymore!