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
Author

Inverse Boolean Value

Steve Dyke
Ranch Hand

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

Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

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

Joined: Oct 02, 2003
Posts: 11479
    
  16

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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Inverse Boolean Value