Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

8
LINES

< > BotCompany Repo | #1020918 // toIntOrMinus1

JavaX fragment (include)

1  
static int toIntOrMinus1(O o) {
2  
  if (o == null) ret -1;
3  
  if (o instanceof Number)
4  
    ret ((Number) o).intValue();
5  
  if (o cast S)
6  
    ret isInteger(o) ? parseInt(o) : -1;
7  
  ret -1;
8  
}

Author comment

Began life as a copy of #1019477

download  show line numbers  debug dex  old transpilations   

Travelled to 8 computer(s): bhatertpkbcr, cfunsshuasjs, gwrvuhgaqvyk, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1020918
Snippet name: toIntOrMinus1
Eternal ID of this version: #1020918/1
Text MD5: ba440398bd9ca8715ac90d88ee9c7776
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-01-10 16:09:10
Source code size: 192 bytes / 8 lines
Pitched / IR pitched: No / No
Views / Downloads: 291 / 326
Referenced in: [show references]