/** * True if this version is the first copy in a version tree * i.e. versionTreeId is 1. */ public boolean isFirst() { return trunkVersion.equals("1") && !isBranch(); }
/** * True if this version is the first copy in a version tree * i.e. versionTreeId is 1. */ public boolean isFirst() { return trunkVersion.equals("1") && !isBranch(); }
/** * True if this Version represents a branch */ public boolean isBranch() { return uid.versionTreeID().isBranch(); }
/** * True if this Version represents a branch */ public boolean isBranch() { return uid.versionTreeID().isBranch(); }
/** * Return the next logical versionTreeId * i.e. next logical versionTreeId for 1.2.1 is 1.2.2 */ public VersionTreeID next() { if (isBranch()) { String newBranchVersion = Integer.toString(Integer.valueOf(branchVersion) + 1); return new VersionTreeID(trunkVersion + "." + branchNumber + "." + newBranchVersion); } else { return new VersionTreeID(Integer.toString(Integer.valueOf(trunkVersion) + 1)); } }
/** * Return the next logical versionTreeId * i.e. next logical versionTreeId for 1.2.1 is 1.2.2 */ public VersionTreeID next() { if (isBranch()) { String newBranchVersion = Integer.toString(Integer.valueOf(branchVersion) + 1); return new VersionTreeID(trunkVersion + "." + branchNumber + "." + newBranchVersion); } else { return new VersionTreeID(Integer.toString(Integer.valueOf(trunkVersion) + 1)); } }
private void addVersion(Version<T> version) { if (!version.getUid().versionTreeID().isBranch()) { int trunkNo = Integer.parseInt(version.getUid().versionTreeID().trunkVersion()); if (trunkNo != trunkCounter + 1) { throw new IllegalArgumentException("invlalid trunk no in uid"); } else { trunkCounter++; latestTrunkUid = version.getUid(); } } timeVersionMap.put(version.getCommitAudit().getTimeCommitted(), version); idVersionMap.put(version.getUid(), version); }
private void addVersion(Version<T> version) { if (!version.getUid().versionTreeID().isBranch()) { int trunkNo = Integer.parseInt(version.getUid().versionTreeID().trunkVersion()); if (trunkNo != trunkCounter + 1) { throw new IllegalArgumentException("invlalid trunk no in uid"); } else { trunkCounter++; latestTrunkUid = version.getUid(); } } timeVersionMap.put(version.getCommitAudit().getTimeCommitted(), version); idVersionMap.put(version.getUid(), version); }