@Override public IGroup getGroup(String shortName) { List<IGroup> list = getGroupList(); IGroup result = null; NexusNode nodeName = PathNexus.splitStringToNode(shortName)[0]; NexusNode groupName; NexusNode[] nodes; for (IGroup group : list) { nodes = PathNexus.splitStringToNode(group.getName()); groupName = nodes[nodes.length - 1]; if (groupName.matchesNode(nodeName)) { result = group; break; } } return result; }
@Override public IDataItem getDataItem(String shortName) { List<IDataItem> list = getDataItemList(); IDataItem result = null; NexusNode nodeName = PathNexus.splitStringToNode(shortName)[0]; NexusNode groupName; NexusNode[] nodes; for (IDataItem item : list) { nodes = PathNexus.splitStringToNode(item.getName()); groupName = nodes[nodes.length - 1]; if (groupName.matchesNode(nodeName)) { result = item; break; } } return result; }
public NxsGroup(IGroup parent, PathNexus path, NxsDataset dataset) { try { List<IContainer> list = dataset.getRootGroup().findAllContainerByPath(path.getValue()); List<IGroup> groups = new ArrayList<IGroup>(); for (IContainer container : list) { if (container.getModelType() == ModelType.Group) { groups.add((IGroup) container); } } IGroup[] array = new IGroup[groups.size()]; mGroups = groups.toArray(array); } catch (NoResultException e) { } mParent = parent; mDataset = dataset; mChildren = null; mIsChildUpdate = false; }