logo

class

sql::TypeGraph

sys::Obj
  sql::TypeGraph

TypeGraph is used to sort a set of types based on their dependencies on each other. A set of types cannot be sorted if the types have cyclic dependencies.

Slots

addDependency

Void addDependency(Type from, Type to)

Add a dependency from the from type to the to type.

addType

Void addType(Type t)

Add a type to the graph without specifying a dependency.

rsort

Type[] rsort()

Get the list of types in the graph sorted in reverse order.

sort

Type[] sort()

Get the list of types in the graph sorted by dependency. A type will always be later in the list than the types it depends on. That is, if type B depends on type A, the sorted result will be [A, B].