- Timestamp:
- 07/02/13 16:20:07 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
java/main/src/main/java/com/framsticks/params/FramsClass.java
r88 r90 4 4 import com.framsticks.params.annotations.ParamAnnotation; 5 5 import com.framsticks.util.FramsticksException; 6 import com.framsticks.util.lang.Containers; 6 7 // import com.framsticks.util.FramsticksException; 7 8 … … 51 52 // protected Map<String, Integer> paramIdMap = new HashMap<String, Integer>(); 52 53 53 public Collection<Param> getParamEntries() { 54 return paramList; 54 @ParamAnnotation(id = "props", name = "props") 55 public List<Param> getParamEntries() { 56 return Collections.unmodifiableList(paramList); 55 57 } 56 58 … … 60 62 this.name = builder.getName(); 61 63 this.description = builder.getDescription(); 62 this.groups = builder.groups;64 this.groups = Containers.build(builder.groupBuilders); 63 65 this.paramList = builder.params; 64 66 65 67 for (Param param : paramList) { 66 68 paramEntryMap.put(param.getId(), param); 67 try {68 Group group = groups.get(param.getGroup());69 if (group != null) {70 group.addProperty(param);71 }72 } catch (IndexOutOfBoundsException ignored) {73 74 }75 69 } 76 70 … … 88 82 } 89 83 90 /** 91 * Gets the group member. 92 * 93 * @param gi 94 * the offset of group 95 * @param pi 96 * the offset of member within a group 97 * @return the pi-th member of group gi 98 */ 99 public Param getGroupMember(int gi, int pi) { 100 if (gi < 0 || pi < 0 || gi >= groups.size()) { 101 return null; 102 } 103 Group group = groups.get(gi); 104 return (group != null ? group.getProperty(pi) : null); 84 public Group getGroup(int groupNumber) { 85 return Containers.getFromList(groups, groupNumber, "group", this); 105 86 } 106 87 107 /** 108 * Gets the group name. 109 * 110 * @param gi 111 * the offset of group 112 * @return the group name 113 */ 114 public String getGroupName(int gi) { 115 if (gi < 0 || gi >= groups.size()) 116 return null; 117 return groups.get(gi).name; 118 } 88 // /** 89 // * Gets the group member. 90 // * 91 // * @param gi 92 // * the offset of group 93 // * @param pi 94 // * the offset of member within a group 95 // * @return the pi-th member of group gi 96 // */ 97 // public Param getGroupMember(int gi, int pi) { 98 // if (gi < 0 || pi < 0 || gi >= groups.size()) { 99 // return null; 100 // } 101 // Group group = groups.get(gi); 102 // return (group != null ? group.getProperty(pi) : null); 103 // } 104 105 // /** 106 // * Gets the group name. 107 // * 108 // * @param gi 109 // * the offset of group 110 // * @return the group name 111 // */ 112 // public String getGroupName(int gi) { 113 // if (gi < 0 || gi >= groups.size()) 114 // return null; 115 // return groups.get(gi).name; 116 // } 119 117 120 118 @ParamAnnotation
Note: See TracChangeset
for help on using the changeset viewer.