/** * * @return A resource id for the progress entry. */ public ResourceId getResourceId() { return new ResourceId(id, prefix); }
/** * * @return A resourceId for the request, or null if there is a null nodeId. */ public ResourceId getResourceId() { return nodeId == null ? null : new ResourceId(nodeId, prefix); }
/** * * @return A resource id for the progress entry. */ public ResourceId getResourceId() { return new ResourceId(id, prefix); }
/** * * @return A resourceId for the parent, or null if there is a null parentId. */ public ResourceId getParentResourceId() { return parentId == null ? null : new ResourceId(parentId, parentPrefix); }
/** * @param directory the File of the directory * @param resourceId the ResourceId of the directory * @param children the directory's children */ ProgressEntry(final Path directory, final ResourceId resourceId, final Path[] children) { if (resourceId == null) { throw new IllegalArgumentException("Cannot construct a ProgressEntry with a null ResourceId"); } this.directory = directory; this.id = resourceId.getId(); this.prefix = resourceId.getPath(); this.children = children; }
/** * * @return A resourceId for the request, or null if there is a null nodeId. */ public ResourceId getResourceId() { return nodeId == null ? null : new ResourceId(nodeId, prefix); }
/** * @param directory the File of the directory * @param resourceId the ResourceId of the directory * @param children the directory's children */ ProgressEntry(File directory, ResourceId resourceId, File[] children) { if (resourceId == null) { throw new IllegalArgumentException("Cannot construct a ProgressEntry with a null ResourceId"); } this.directory = directory; this.id = resourceId.getId(); this.prefix = resourceId.getPath(); this.children = children; }
/** * * @return A resourceId for the parent, or null if there is a null parentId. */ public ResourceId getParentResourceId() { return parentId == null ? null : new ResourceId(parentId, parentPrefix); }
private void setNodeIds(ProfileResourceNode node, ResourceId parentId) { final Long nodeId = nodeIds.incrementAndGet(); node.setId(nodeId); String parentsPrefixString = ""; if (parentId != null) { parentsPrefixString = parentId.getPath(); node.setParentId(parentId.getId()); } int parentsPrefixStringLength = parentsPrefixString != null ? parentsPrefixString.length() : 0; final int buliderBaseSize = 5; final int nodeValueSize = 5; final StringBuilder builder = new StringBuilder(buliderBaseSize + parentsPrefixStringLength); builder.append(parentsPrefixString); final char[] nodeValue = new char[nodeValueSize]; ResourceUtils.getBase128IntegerCharArray(nodeId, nodeValue); builder.append(nodeValue); node.setPrefix(builder.toString()); //builder.setLength(parentsPrefixString.length()); builder.setLength(parentsPrefixStringLength); ResourceUtils.getBase128IntegerCharArray(nodeId + 1, nodeValue); builder.append(nodeValue); node.setPrefixPlusOne(builder.toString()); }
private ResourceId getParentResourceId(ProfileResourceNode node) { ResourceId id = null; Long parentId = node.getParentId(); if (parentId != null) { String parentPrefix = node.getPrefix(); if (parentPrefix.length() >= FIVE) { parentPrefix = parentPrefix.substring(0, parentPrefix.length() - FIVE); } else { parentPrefix = ""; } id = new ResourceId(parentId, parentPrefix); } return id; }
private void setNodeIds(ProfileResourceNode node, ResourceId parentId) { final Long nodeId = nodeIds.incrementAndGet(); node.setId(nodeId); String parentsPrefixString = ""; if (parentId != null) { parentsPrefixString = parentId.getPath(); node.setParentId(parentId.getId()); } int parentsPrefixStringLength = parentsPrefixString != null ? parentsPrefixString.length() : 0; final int buliderBaseSize = 5; final int nodeValueSize = 5; final StringBuilder builder = new StringBuilder(buliderBaseSize + parentsPrefixStringLength); builder.append(parentsPrefixString); final char[] nodeValue = new char[nodeValueSize]; ResourceUtils.getBase128IntegerCharArray(nodeId, nodeValue); builder.append(nodeValue); node.setPrefix(builder.toString()); //builder.setLength(parentsPrefixString.length()); builder.setLength(parentsPrefixStringLength); ResourceUtils.getBase128IntegerCharArray(nodeId + 1, nodeValue); builder.append(nodeValue); node.setPrefixPlusOne(builder.toString()); }
private ResourceId getParentResourceId(ProfileResourceNode node) { ResourceId id = null; Long parentId = node.getParentId(); if (parentId != null) { String parentPrefix = node.getPrefix(); if (parentPrefix.length() >= FIVE) { parentPrefix = parentPrefix.substring(0, parentPrefix.length() - FIVE); } else { parentPrefix = ""; } id = new ResourceId(parentId, parentPrefix); } return id; }
return new ResourceId(node.getId(), node.getPrefix());
return new ResourceId(node.getId(), node.getPrefix());