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

33
LINES

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

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

Libraryless. Click here for Pure Java version (2489L/16K).

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); }

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

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

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

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

Author comment

Began life as a copy of #1002108

download  show line numbers  debug dex   

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

No comments. add comment

Snippet ID: #1002348
Snippet name: nempty - not empty
Eternal ID of this version: #1002348/7
Text MD5: e15c21428c4c8d4f2fbd7e36d20de372
Transpilation MD5: 4f882fd7b539e6e43d94251efbe1cf2f
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-08-05 15:18:22
Source code size: 700 bytes / 33 lines
Pitched / IR pitched: No / No
Views / Downloads: 579 / 4631
Version history: 6 change(s)
Referenced in: [show references]

Formerly at http://tinybrain.de/1002348 & http://1002348.tinybrain.de