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

55
LINES

< > BotCompany Repo | #1002348 // nempty - not empty

JavaX fragment (include) [tags: use-pretranspiled]

Transpiled version (4522L) is out of date.

1  
static boolean nempty(Collection c) {
2  
  ret !empty(c);
3  
}
4  
5  
static boolean nempty(CharSequence s) {
6  
  ret !empty(s);
7  
}
8  
9  
static boolean nempty(O[] o) { ret !empty(o); }
10  
static boolean nempty(byte[] o) { ret !empty(o); }
11  
static boolean nempty(int[] o) { ret !empty(o); }
12  
13  
sbool nempty(BitSet bs) { ret !empty(bs); }
14  
15  
static boolean nempty(Map m) {
16  
  ret !empty(m);
17  
}
18  
19  
static boolean nempty(Iterator i) {
20  
  ret i != null && i.hasNext();
21  
}
22  
23  
ifclass IMultiMap
24  
sbool nempty(IMultiMap mm) { ret mm != null && mm.size() != 0; }
25  
endif
26  
27  
ifndef empty_noGeneric
28  
sbool nempty(O o) { ret !empty(o); }
29  
endifndef
30  
31  
ifclass IntRange
32  
sbool nempty(IntRange r) { ret !empty(r); }
33  
endif
34  
35  
ifclass IntBuffer
36  
sbool nempty(IntBuffer b) { ret b != null && !b.isEmpty(); }
37  
endif
38  
39  
ifclass LongBuffer
40  
sbool nempty(LongBuffer b) { ret b != null && !b.isEmpty(); }
41  
endif
42  
43  
ifclass Rect
44  
sbool nempty(Rect r) { ret r != null && r.w != 0 && r.h != 0; }
45  
endif
46  
47  
ifclass CloseablesHolder
48  
sbool nempty(CloseablesHolder ch) { ret ch != null && !empty(ch.closeables); }
49  
endif
50  
51  
ifclass MultiSet
52  
sbool nempty(MultiSet ms) { ret ms != null && !ms.isEmpty(); }
53  
endif
54  
55  
sbool nempty(IntSize l) { ret l != null && l.size() != 0; }

Author comment

Began life as a copy of #1002108

download  show line numbers  debug dex  old transpilations   

Travelled to 18 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt, whxojlpjdney, xrpafgyirdlv

No comments. add comment

Snippet ID: #1002348
Snippet name: nempty - not empty
Eternal ID of this version: #1002348/16
Text MD5: e6204f6592449fece06511a10a8a0ddd
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2023-01-17 22:21:23
Source code size: 1233 bytes / 55 lines
Pitched / IR pitched: No / No
Views / Downloads: 939 / 5187
Version history: 15 change(s)
Referenced in: [show references]