• Post Reply Bookmark Topic Watch Topic
  • New Topic

"is" method  RSS feed

 
Joseph Sweet
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there in one of the specifications any reference to methods that start with "is", while the suffix of the method's name is a property's name (similar to getter/setter methods)?

I was trying to find out an explanation about it but search engines omit the word "is".

Thanks!
 
Paul Clapham
Sheriff
Posts: 22819
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, there is. It's the JavaBeans Specification and you'll find it here. At least not quite there, but if you accept the licence agreement on that page you can download the spec. The part about "public boolean isProperty()" is section 8.3.2.
 
Campbell Ritchie
Marshal
Posts: 56522
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you look in the API index under "I", you will find lots of methods beginning "is". The equivalent of "get" when you want to return a boolean is "is" (or "has"). So you will find methods like "isEnabled" "isLetter" or "hasNext".
 
Joseph Sweet
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you guys!
 
Campbell Ritchie
Marshal
Posts: 56522
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're welcome
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!