Java Reference
In-Depth Information
L ISTING 12.5
Continued
}
}
/**
* Implements the superclass method
*/
public boolean match(Versionable v) {
return false;
}
/**
* Adds a new Versionable (but not a VersionString itself!) to the
* Version string.
*/
public boolean addVersionable(Versionable v){
if (v instanceof VersionString)
return false;//it is not possible to have versionStrings
containing other VersionStrings!
return versionables.add(v);
}
/**
* Returns a human-readable representation of the versionString
*/
public String toString() {
StringBuffer stringbuffer = new StringBuffer();
for(int i= 0; i< versionables.size(); i++) {
stringbuffer.append(versionables.get(i).toString());
stringbuffer.append(' ');
}
return stringbuffer.toString();
}
/**
* return true if the given VersionId is contained
*/
public boolean contains(VersionId vid) {
Iterator iter = versionables.iterator();
while (iter.hasNext()) {
Versionable item = (Versionable)iter.next();
if (vid.match(item))
return true;
}
Search WWH ::




Custom Search