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

16
LINES

< > BotCompany Repo | #1019478 // l_opt - length if possible

JavaX fragment (include)

1  
static int l_opt(O o) {
2  
  ret o == null ? 0
3  
    : o instanceof S ? l((S) o)
4  
    : o instanceof Map ? l((Map) o)
5  
    : o instanceof Collection ? l((Collection) o)
6  
    : o instanceof O[] ? l((O[]) o)
7  
    : o instanceof bool[] ? l((bool[]) o)
8  
    : o instanceof byte[] ? l((byte[]) o)
9  
    : o instanceof char[] ? l((char[]) o)
10  
    : o instanceof short[] ? l((short[]) o)
11  
    : o instanceof int[] ? l((int[]) o)
12  
    : o instanceof float[] ? l((float[]) o)
13  
    : o instanceof double[] ? l((double[]) o)
14  
    : o instanceof long[] ? l((long[]) o)
15  
    : toIntOpt(callOpt(o, 'size));
16  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 12 computer(s): bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1019478
Snippet name: l_opt - length if possible
Eternal ID of this version: #1019478/1
Text MD5: 760166c241dd4e7851c3e188e1176386
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-11-09 15:51:46
Source code size: 591 bytes / 16 lines
Pitched / IR pitched: No / No
Views / Downloads: 171 / 220
Referenced in: [show references]