/** * Sets the node id and prefix from a ResourceId object. * * @param id The resourceId to set. */ public void setResourceId(ResourceId id) { if (id != null) { this.nodeId = id.getId(); this.prefix = id.getPath(); } else { this.nodeId = null; this.prefix = ""; } }
/** * @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; }
/** * Sets the node id and prefix from a ResourceId object. * * @param id The resourceId to set. */ public void setResourceId(ResourceId id) { if (id != null) { this.nodeId = id.getId(); this.prefix = id.getPath(); } else { this.nodeId = null; this.prefix = ""; } }
/** * Sets the parent id and prefix from a ResourceId object. * * @param id The resourceId to set. */ public void setParentResourceId(ResourceId id) { if (id != null) { this.parentId = id.getId(); this.parentPrefix = id.getPath(); } else { this.parentId = null; this.parentPrefix = ""; } }
/** * @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; }
/** * Sets the parent id and prefix from a ResourceId object. * * @param id The resourceId to set. */ public void setParentResourceId(ResourceId id) { if (id != null) { this.parentId = id.getId(); this.parentPrefix = id.getPath(); } else { this.parentId = null; this.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 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()); }