Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ final class TraversalCallreprBase[NodeType <: nodes.CallReprBase](val traversal:
def order(value: Int): Iterator[NodeType] =
traversal.filter { _.order == value }

/** Traverse to nodes where the order equals the given `value`, or no results if `value` is None
*/
def order(value: Option[Int]): Iterator[NodeType] =
value match { case Some(_val) => order(_val); case None => Iterator.empty }

/** Traverse to nodes where the order equals at least one of the given `values`
*/
def order(values: Int*): Iterator[NodeType] = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ final class TraversalPropertyOrder[NodeType <: nodes.StoredNode & nodes.StaticTy
def order(value: Int): Iterator[NodeType] =
traversal.filter { _.order == value }

/** Traverse to nodes where the order equals the given `value`, or no results if `value` is None
*/
def order(value: Option[Int]): Iterator[NodeType] =
value match { case Some(_val) => order(_val); case None => Iterator.empty }

/** Traverse to nodes where the order equals at least one of the given `values`
*/
def order(values: Int*): Iterator[NodeType] = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ final class TraversalNodeaBase[NodeType <: nodes.NodeABase](val traversal: Itera
def intMandatory(value: Int): Iterator[NodeType] =
traversal.filter { _.intMandatory == value }

/** Traverse to nodes where the intMandatory equals the given `value`, or no results if `value` is None
*/
def intMandatory(value: Option[Int]): Iterator[NodeType] =
value match { case Some(_val) => intMandatory(_val); case None => Iterator.empty }

/** Traverse to nodes where the intMandatory equals at least one of the given `values`
*/
def intMandatory(values: Int*): Iterator[NodeType] = {
Expand Down Expand Up @@ -68,6 +73,17 @@ final class TraversalNodeaBase[NodeType <: nodes.NodeABase](val traversal: Itera
val tmp = node.intOptional; tmp.isDefined && tmp.get == value
}

/** Traverse to nodes where the intOptional equals the given `value`. If `value` is None, only nodes where intOptional is not set are
* included.
*/
def intOptional(value: Option[Int]): Iterator[NodeType] =
value match { case Some(_val) => intOptional(_val); case None => traversal.filter { node => node.intOptional.isEmpty } }

/** Traverse to nodes where the intOptional equals the given `value`, or no results if `value` is None.
*/
def intOptionalIfPresent(value: Option[Int]): Iterator[NodeType] =
value match { case Some(_val) => intOptional(_val); case None => Iterator.empty }

/** Traverse to nodes where the intOptional equals at least one of the given `values`
*/
def intOptional(values: Int*): Iterator[NodeType] = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ final class TraversalPropertyIntMandatory[NodeType <: nodes.StoredNode & nodes.S
def intMandatory(value: Int): Iterator[NodeType] =
traversal.filter { _.intMandatory == value }

/** Traverse to nodes where the intMandatory equals the given `value`, or no results if `value` is None
*/
def intMandatory(value: Option[Int]): Iterator[NodeType] =
value match { case Some(_val) => intMandatory(_val); case None => Iterator.empty }

/** Traverse to nodes where the intMandatory equals at least one of the given `values`
*/
def intMandatory(values: Int*): Iterator[NodeType] = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,17 @@ final class TraversalPropertyIntOptional[NodeType <: nodes.StoredNode & nodes.St
val tmp = node.intOptional; tmp.isDefined && tmp.get == value
}

/** Traverse to nodes where the intOptional equals the given `value`. If `value` is None, only nodes where intOptional is not set are
* included.
*/
def intOptional(value: Option[Int]): Iterator[NodeType] =
value match { case Some(_val) => intOptional(_val); case None => traversal.filter { node => node.intOptional.isEmpty } }

/** Traverse to nodes where the intOptional equals the given `value`, or no results if `value` is None.
*/
def intOptionalIfPresent(value: Option[Int]): Iterator[NodeType] =
value match { case Some(_val) => intOptional(_val); case None => Iterator.empty }

/** Traverse to nodes where the intOptional equals at least one of the given `values`
*/
def intOptional(values: Int*): Iterator[NodeType] = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,17 @@ final class TraversalPropertyPerformances[NodeType <: nodes.StoredNode & nodes.S
val tmp = node.performances; tmp.isDefined && tmp.get == value
}

/** Traverse to nodes where the performances equals the given `value`. If `value` is None, only nodes where performances is not set are
* included.
*/
def performances(value: Option[Int]): Iterator[NodeType] =
value match { case Some(_val) => performances(_val); case None => traversal.filter { node => node.performances.isEmpty } }

/** Traverse to nodes where the performances equals the given `value`, or no results if `value` is None.
*/
def performancesIfPresent(value: Option[Int]): Iterator[NodeType] =
value match { case Some(_val) => performances(_val); case None => Iterator.empty }

/** Traverse to nodes where the performances equals at least one of the given `values`
*/
def performances(values: Int*): Iterator[NodeType] = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,17 @@ final class TraversalSongBase[NodeType <: nodes.SongBase](val traversal: Iterato
val tmp = node.performances; tmp.isDefined && tmp.get == value
}

/** Traverse to nodes where the performances equals the given `value`. If `value` is None, only nodes where performances is not set are
* included.
*/
def performances(value: Option[Int]): Iterator[NodeType] =
value match { case Some(_val) => performances(_val); case None => traversal.filter { node => node.performances.isEmpty } }

/** Traverse to nodes where the performances equals the given `value`, or no results if `value` is None.
*/
def performancesIfPresent(value: Option[Int]): Iterator[NodeType] =
value match { case Some(_val) => performances(_val); case None => Iterator.empty }

/** Traverse to nodes where the performances equals at least one of the given `values`
*/
def performances(values: Int*): Iterator[NodeType] = {
Expand Down
Loading