Libraryless. Click here for Pure Java version (39L/1K).
1 | static Set<Class> classSuperclassesAndInterfaces(Class c) { |
2 | if (c == null) null; |
3 | new HashSet<Class> set; |
4 | classSuperclassesAndInterfaces_find(c, set); |
5 | ret set; |
6 | } |
7 | |
8 | svoid classSuperclassesAndInterfaces_find(Class c, Set<Class> set) { |
9 | do { |
10 | if (!set.add(c)) ret; |
11 | for (Class intf : c.getInterfaces()) |
12 | classSuperclassesAndInterfaces_find(intf, set); |
13 | } while ((c = c.getSuperclass()) != null); |
14 | } |
Began life as a copy of #1022198
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
Snippet ID: | #1028477 |
Snippet name: | classSuperclassesAndInterfaces |
Eternal ID of this version: | #1028477/2 |
Text MD5: | 4ceb605d3623d10a596fae2194521cbe |
Transpilation MD5: | b4a0645ddf364d37306d056eb768aa9d |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2020-06-21 01:47:46 |
Source code size: | 426 bytes / 14 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 172 / 262 |
Version history: | 1 change(s) |
Referenced in: | [show references] |