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

10
LINES

< > TinyBrain | #1001162 - getClassDeclarationName (also works with interfaces and enums)

JavaX fragment (include)

please include function allClasses.

static S getClassDeclarationName(L<S> tok) {
  if (tok != null)
    for (int i = 1; i+2 < tok.size(); i += 2)
      if (allClasses_keywords.contains(tok.get(i)) && isIdentifier(tok.get(i+2)))
        ret tok.get(i+2);
  null;
}

download  show line numbers  debug dex   

Travelled to 11 computer(s): aoiabmzegqzx, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, tslmcundralx, tvejysmllsmz

No comments. add comment

Snippet ID: #1001162
Snippet name: getClassDeclarationName (also works with interfaces and enums)
Eternal ID of this version: #1001162/5
Text MD5: fea928a6f1e406b6e984078569ab389c
Author: stefan
Category:
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-10-02 00:39:15
Source code size: 274 bytes / 10 lines
Pitched / IR pitched: No / No
Views / Downloads: 315 / 1736
Version history: 4 change(s)
Referenced in: [show]