SubjectTree

public indirect enum SubjectTree : Hashable

Recursive tree structure used for grouping arXiv subjects.

Use for making arbitrary groups of arXiv subjects. For example, arXiv.org organises multiple subjects under umbrella term Physics. To represent such groups together with regular subjects, this library uses SubjectTree. SubjectTree.allSubjects returns a SubjectTree that can be used to recursively enumerate all available subjects and their groupings as organised on arXiv.org.

Other arbitrary groupings can be constructed, depending on particular needs.

  • Leaf node, a single arXive suject.

    Declaration

    Swift

    case subject(ArxivSubject)
  • Arbitrary grouping of arXive subjects.

    Declaration

    Swift

    case grouping(name: String, children: [SubjectTree])
  • Returns group name. If the node is single subject, group name is the subject’s name.

    Declaration

    Swift

    var name: String { get }
  • Retunrs child nodes of the given node.

    Declaration

    Swift

    var children: [SubjectTree] { get }
  • Returns node’s subject if the node is .subject(_) or nil otherwise.

    Declaration

    Swift

    var subject: ArxivSubject? { get }
  • Returns a tree that can be used to recursively enumerate all available subjects and their groupings as organised on arXiv.org.

    Declaration

    Swift

    static var allSubjects: SubjectTree