Package wt.associativity
Class WTAssociativityHelper
java.lang.Object
wt.associativity.WTAssociativityHelper
This is a helper class having helper methods for dealing with elements of bom like UsesOccurrence, PathOccurrence and some related to
Equivalence Link.
Supported API: true
Extendable: false
Supported API: true
Extendable: false
-
Method Summary
Modifier and TypeMethodDescriptionstatic intdeleteEquivalenceLink(Iterated iterated) This method will delete the equivalence links that reference the given itetared object.getOccurrencableLinkFromPersistable(Persistable persistable) This method will get the map of UsesOccurrence id and its corresponding UsesOccurrence objects for all occurrenceable links (i.e.static booleanisContained2(PathOccurrence path1, PathOccurrence path2) This method will is done for indicators.static booleanisEquivalent(PathOccurrence path1, PathOccurrence path2) This method will verify if path1 is equivalent to path2.
-
Method Details
-
isEquivalent
This method will verify if path1 is equivalent to path2. It checks if path1 has same structure and same context as that of path2.
Supported API: true- Parameters:
path1- PathOccurrence to be comparedpath2- PathOccurrence to be compared- Returns:
- boolean Flag stating if the given paths are equivalent
-
isContained2
This method will is done for indicators. The other one seems to not work correctly. This method checks if the first path contains the second path The logic assumes below things.
1. Both path should have same uses occurrence reference at each level starting form tail.
2. It does not check if the path2 is contained somewhere in between path1. It only check that path2 is a part of path1 starting from tail to somewhere till root. E.g If we have path1 A -> B -> C -> D, and path2 B -> C, then this method will return false. This method will return true only if path2 is either D, C -> D or B -> C -> D
Supported API: true- Parameters:
path1- Super pathpath2- subset path- Returns:
- boolean Flag stating if first path contains second path
-
deleteEquivalenceLink
This method will delete the equivalence links that reference the given itetared object.
Supported API: true- Parameters:
iterated- An Iterated object for which the equivalence links have to be deleted- Returns:
- int returns the number of equivalence links deleted
- Throws:
WTException
-
getOccurrencableLinkFromPersistable
public static HashMap<Long,Object[]> getOccurrencableLinkFromPersistable(Persistable persistable) throws WTException This method will get the map of UsesOccurrence id and its corresponding UsesOccurrence objects for all occurrenceable links (i.e. usage links) of the given persistable object.
Supported API: true- Parameters:
persistable- A Persistable object for which occurrenceable links need to be fetched- Returns:
- Map of UsesOccurrence id and array containing its corresponding UsesOccurrence objects
- Throws:
WTException
-