public final class SpecRelations
extends java.lang.Object
SpecRelation objects that also contains lookups for quick access of relations
keyed by either the source or target identifiers.| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(SpecRelation specRelation)
Checks whether the specified
SpecRelation exists in this collection. |
boolean |
containsIdentifiableWithLongName(java.lang.String longName)
Checks for existence of an
Identifiable in this collection with the specified longName. |
boolean |
containsKey(java.lang.String identifier)
Checks whether this collection contains the
Identifiable whose identfier matches that specified in the argument |
SpecRelation |
createSpecRelation(SpecRelationType specRelationType,
SpecObject sourceSpecObject,
SpecObject targetSpecObject,
java.lang.String desc,
java.util.Date lastChange,
java.lang.String longName,
java.lang.String identifier,
java.lang.String alternativeId)
Creates a
SpecRelation object by specifying the source and target SpecObject objects |
SpecRelation |
createSpecRelation(SpecRelationType specRelationType,
java.lang.String sourceSpecObjectIdentifier,
java.lang.String targetSpecObjectIdentifier,
java.lang.String desc,
java.util.Date lastChange,
java.lang.String longName,
java.lang.String identifier,
java.lang.String alternativeId)
Creates a
SpecRelation object by specifying the source and target SpecObject identifiers |
SpecRelation |
find(java.lang.String longName)
Returns the first occurrence of a
SpecRelation object with the specified longName that is contained in this collection. |
SpecRelation |
get(int index)
Returns the
SpecRelation object at the specified index that is contained in this collection. |
SpecRelation |
get(java.lang.String identifier)
Returns the
SpecRelation object with the specified identifier that is contained in this collection. |
int |
getCount()
Returns the count of items in this collection.
|
java.util.Iterator<SpecRelation> |
iterator() |
void |
remove(SpecRelation specRelation)
Removes a
SpecRelation object from this collection. |
void |
removeAll()
Removes all (@code SpecRelation} objects from this collection.
|
java.util.stream.Stream<SpecRelation> |
stream() |
java.lang.String |
toString() |
public SpecRelation createSpecRelation(SpecRelationType specRelationType, SpecObject sourceSpecObject, SpecObject targetSpecObject, java.lang.String desc, java.util.Date lastChange, java.lang.String longName, java.lang.String identifier, java.lang.String alternativeId) throws DuplicateIdentifierException, InvalidIdentifierException
SpecRelation object by specifying the source and target SpecObject objectsspecRelationType - the SpecRelationType of the SpecRelation to create, not nullsourceSpecObject - the SpecObject corresponding to the source, not nulltargetSpecObject - the SpecObject corresponding to the target, not nulldesc - the String value to sert for the description property, can be nulllastChange - the Date value to set for the lastChange property, set to null for 'now'longName - the String value to set for the longName property, can be nullidentifier - the String value to set for the identifier property (must confirm to xsd:ID),
set to null to autogeneratealternativeId - the String value to set for the alternativeId property, can be nullSpecRelation, not nullDuplicateIdentifierException - if the specified identifier is already used in this ReqIF fileInvalidIdentifierException - if the specified identifier does not confrom to xsd:ID formatpublic SpecRelation createSpecRelation(SpecRelationType specRelationType, java.lang.String sourceSpecObjectIdentifier, java.lang.String targetSpecObjectIdentifier, java.lang.String desc, java.util.Date lastChange, java.lang.String longName, java.lang.String identifier, java.lang.String alternativeId) throws DuplicateIdentifierException, InvalidIdentifierException
SpecRelation object by specifying the source and target SpecObject identifiersspecRelationType - the SpecRelationType of the SpecRelation to create, not nullsourceSpecObjectIdentifier - the identifier of the SpecObject corresponding to the source, not nulltargetSpecObjectIdentifier - the identifier of the SpecObject corresponding to the target, not nulldesc - the String value to sert for the description property, can be nulllastChange - the Date value to set for the lastChange property, set to null for 'now'longName - the String value to set for the longName property, can be nullidentifier - the String value to set for the identifier property (must confirm to xsd:ID),
set to null to autogeneratealternativeId - the String value to set for the alternativeId property, can be nullSpecRelation, not nullDuplicateIdentifierException - if the specified identifier is already used in this ReqIF fileInvalidIdentifierException - if the specified identifier does not conform to xsd:ID formatpublic java.util.stream.Stream<SpecRelation> stream()
public java.util.Iterator<SpecRelation> iterator()
iterator in interface java.lang.Iterable<SpecRelation>public SpecRelation get(int index) throws java.lang.IndexOutOfBoundsException
SpecRelation object at the specified index that is contained in this collection.index - the index of the SpecRelation to return from the collection, >= 0 and < collection sizeSpecRelation object at the specified indexjava.lang.IndexOutOfBoundsException - if the index is < 0 or >= countpublic SpecRelation get(java.lang.String identifier) throws UnknownIdentifierException
SpecRelation object with the specified identifier that is contained in this collection.identifier - the identifier of the collection member to return, not nullSpecRelation subclass with the specified identifierUnknownIdentifierException - if the object identified by the Identifier parameter can't be foundpublic SpecRelation find(java.lang.String longName)
SpecRelation object with the specified longName that is contained in this collection.longName - the longName of the SpecRelation to return, not nullSpecRelation subclass with the specified longName, can be nullpublic boolean contains(SpecRelation specRelation)
SpecRelation exists in this collection.specRelation - the SpecRelation to check, not nulltrue if the specified specRelation exists, false otherwisepublic void remove(SpecRelation specRelation) throws NotFoundException, ReferencedException
SpecRelation object from this collection.specRelation - the SpecRelation object to remove, not nullNotFoundException - if the specified SpecRelation object is not in the collectionReferencedException - if the specified SpecRelation object is referenced in other RelationGroup objectspublic void removeAll()
throws ReferencedException
ReferencedException - if at least one SpecRelation object is referenced in other RelationGroup objectspublic boolean containsKey(java.lang.String identifier)
Identifiable whose identfier matches that specified in the argumentidentifier - the identifier of the member to check for occurrence in the collection, not nullpublic boolean containsIdentifiableWithLongName(java.lang.String longName)
Identifiable in this collection with the specified longName.longName - the value of longName to check, nullable since longName can be nullIdentifiable with the specified longName exists in this collection, otherwise falsepublic java.lang.String toString()
toString in class java.lang.Objectpublic int getCount()