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

14
LINES

< > BotCompany Repo | #1007140 // getFloat - getOpt with cast to Float

JavaX fragment (include)

static Float getFloat(Map map, O key) {
  ret map == null ? null : (Float) map.get(key);
}

static Float getFloat(L l, int idx) {
  ret (Float) get(l, idx);
}

static Float getFloat(O o, O key) {
  if (o instanceof Map) ret getFloat((Map) o, key);
  if (key instanceof S)
    ret (Float) getOpt(o, (S) key);
  throw fail("Not a string key: " + getClassName(key));
}

Author comment

Began life as a copy of #1001954

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1007140
Snippet name: getFloat - getOpt with cast to Float
Eternal ID of this version: #1007140/1
Text MD5: 40bfaf1e0d61a20b0bbedb88e8a1ea88
Author: stefan
Category:
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-03-06 14:46:12
Source code size: 378 bytes / 14 lines
Pitched / IR pitched: No / No
Views / Downloads: 478 / 525
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)