Stores the set of dependency types for an edge in the dependency graph.
The APIs of this class are similar to that of EnumSet<DependencyType>
. Instead of using an EnumSet
, we use this smaller class which stores the dependencies as bitflags in a int
field.
This class was originally designed to handle the fact that we shouldn't need to keep track of each type of dependency on each edge: if an edge has a more important dependency type we should be able to ignore the fact that it also has a less important dependency type. The idea was that this would reduce the size of the SWC catalog.
The add()
was originally a bottleneck which added a dependency type to the set, and then cleaned up the set by removing lesser dependency types that are trumped by greater ones. (SIGNATURE
trumped EXPRESSION
; INHERITANCE
trumped all others.) But this meant that APIs like allOf()
didn't actually create a set that contained all the types, Although everything seemed to work, it seemed too dangerous given the way that sets are used for filtering of edges.
Therefore that "trumping" logic has moved to the SWC catalog writer and this class is merely a optimization.