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

53
LINES

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

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

Transpiled version (4522L) is out of date.

static boolean nempty(Collection c) {
  ret !empty(c);
}

static boolean nempty(CharSequence s) {
  ret !empty(s);
}

static boolean nempty(O[] o) { ret !empty(o); }
static boolean nempty(byte[] o) { ret !empty(o); }
static boolean nempty(int[] o) { ret !empty(o); }

sbool nempty(BitSet bs) { ret !empty(bs); }

static boolean nempty(Map m) {
  ret !empty(m);
}

static boolean nempty(Iterator i) {
  ret i != null && i.hasNext();
}

ifclass IMultiMap
sbool nempty(IMultiMap mm) { ret mm != null && mm.size() != 0; }
endif

ifndef empty_noGeneric
sbool nempty(O o) { ret !empty(o); }
endifndef

ifclass IntRange
sbool nempty(IntRange r) { ret !empty(r); }
endif

ifclass IntBuffer
sbool nempty(IntBuffer b) { ret b != null && !b.isEmpty(); }
endif

ifclass LongBuffer
sbool nempty(LongBuffer b) { ret b != null && !b.isEmpty(); }
endif

ifclass Rect
sbool nempty(Rect r) { ret r != null && r.w != 0 && r.h != 0; }
endif

ifclass CloseablesHolder
sbool nempty(CloseablesHolder ch) { ret ch != null && !empty(ch.closeables); }
endif

ifclass MultiSet
sbool nempty(MultiSet ms) { ret ms != null && !ms.isEmpty(); }
endif

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/15
Text MD5: 1b130268306b52a80aee1dd5c23829d8
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-03-11 06:32:48
Source code size: 1170 bytes / 53 lines
Pitched / IR pitched: No / No
Views / Downloads: 799 / 4999
Version history: 14 change(s)
Referenced in: [show references]