public void getMappedGroups(String group, ArrayList<String> result) { if (result == null) { throw new RuntimeException("result argument cannot be NULL"); } ArrayList<String> mappedGrps = groupMappingTable.get(group); if (mappedGrps == null || mappedGrps.isEmpty()) { return; } addUnique(result,mappedGrps); //look for transitive closure ArrayList<String> result1 = new ArrayList<String>(); for (String str : mappedGrps) { getMappedGroups(group, str,result1); } addUnique(result, result1); }
groupMapper = new GroupMapper(); groupMapper.parse(groupMapping);
protected ArrayList<String> getMappedGroupNames(String group) { if (groupMapper != null) { ArrayList<String> result = new ArrayList<String>(); groupMapper.getMappedGroups(group, result); return result; } return null; }
mappedGroup = tmpGroup.trim(); validate(mappedGroup, mappingGroups); for (String grp : mappingGroups) { int aIndex = grp.indexOf("->");
groupMapper = new GroupMapper(); groupMapper.parse(groupMapping);
protected ArrayList<String> getMappedGroupNames(String group) { if (groupMapper != null) { ArrayList<String> result = new ArrayList<String>(); groupMapper.getMappedGroups(group, result); return result; } return null; }
mappedGroup = tmpGroup.trim(); validate(mappedGroup, mappingGroups); for (String grp : mappingGroups) { int aIndex = grp.indexOf("->");
public void getMappedGroups(String group, ArrayList<String> result) { if (result == null) { throw new RuntimeException("result argument cannot be NULL"); } ArrayList<String> mappedGrps = groupMappingTable.get(group); if (mappedGrps == null || mappedGrps.isEmpty()) { return; } addUnique(result,mappedGrps); //look for transitive closure ArrayList<String> result1 = new ArrayList<String>(); for (String str : mappedGrps) { getMappedGroups(group, str,result1); } addUnique(result, result1); }
private String[] addMappedGroupNames(String[] grpList) { if (groupMapper == null) { return grpList; } ArrayList<String> finalresult = new ArrayList<String>(); for (String grp : grpList) { ArrayList<String> result = new ArrayList<String>(); groupMapper.getMappedGroups(grp, result); finalresult.add(grp); if (!result.isEmpty()) { finalresult.addAll(result); } } return finalresult.toArray(new String[finalresult.size()]); }
/** * @param args the command line arguments public static void main(String[] args) { // TODO code application logic here GroupMapper mapper = new GroupMapper(); mapper.parse(mappingStr); mapper.traverse(); }*/ private void getMappedGroups(String group, String str, ArrayList<String> result) { ArrayList<String> mappedGrps = groupMappingTable.get(str); if (mappedGrps == null || mappedGrps.isEmpty()) { return; } if (mappedGrps.contains(group)) { throw new RuntimeException("Illegal Mapping: cycle detected with group'" + group); } addUnique(result,mappedGrps); for (String str1 : mappedGrps) { getMappedGroups(group, str1,result); } }
private String[] addMappedGroupNames(String[] grpList) { if (groupMapper == null) { return grpList; } ArrayList<String> finalresult = new ArrayList<String>(); for (String grp : grpList) { ArrayList<String> result = new ArrayList<String>(); groupMapper.getMappedGroups(grp, result); finalresult.add(grp); if (!result.isEmpty()) { finalresult.addAll(result); } } return finalresult.toArray(new String[finalresult.size()]); }
/** * @param args the command line arguments public static void main(String[] args) { // TODO code application logic here GroupMapper mapper = new GroupMapper(); mapper.parse(mappingStr); mapper.traverse(); }*/ private void getMappedGroups(String group, String str, ArrayList<String> result) { ArrayList<String> mappedGrps = groupMappingTable.get(str); if (mappedGrps == null || mappedGrps.isEmpty()) { return; } if (mappedGrps.contains(group)) { throw new RuntimeException("Illegal Mapping: cycle detected with group'" + group); } addUnique(result,mappedGrps); for (String str1 : mappedGrps) { getMappedGroups(group, str1,result); } }