Provides the conversion type class AsBoolean, and simple matchers (extractor builders) to use them.
Provides the conversion type class AsBoolean, and simple matchers (extractor builders) to use them. Used by the xpath boolean function and xmltree matching
Either is great, perfect for what is needed, except for the indirection and the added memory and cpu costs thereof.
Either is great, perfect for what is needed, except for the indirection and the added memory and cpu costs thereof. If ScalesXml is meant to be used in the placesthat JAXP and friends would live it should perform the best it can.
That means reducing allocations wherever possible and optimising up to the point of model damage. I think this unfortunately crosses that line but meets the aim.
Provides evidence that two instances of two disctinct types are equivalent after a conversion.
Provides evidence that two instances of two disctinct types are equivalent after a conversion. Requires an instance of Equal for the common convertable type.
badly named the boolean should indicate if it has any children
badly named the boolean should indicate if it has any children
Allows importing all scales.utils implicits directly
Calls eval to return a T t'.
Calls eval to return a T t'. This T is then evaluated with the AsBoolean type class.
When evaluated to true (t',x) is returned. val Matcher = booleanMatcher( (x) => T ); val Matcher(t,x) = x
Calls eval to return a T t'.
Calls eval to return a T t'. This T is then evaluated with the AsBoolean type class.
When evaluated to true t' is returned. val Matcher = booleanMatcher( (x) => T ); val Matcher(t) = x
Calculates the value once and only once (using a lazy val), returning the result, use this approach for expensive calculations.
Calculates the value once and only once (using a lazy val), returning the result, use this approach for expensive calculations.
Collects the first Some
Collects the first Some
The collection pacakge provides the scales.utils.collection.Tree
When paths are not in the same root, they are compared based on the identity hash of the given roots.
When paths are not in the same root, they are compared based on the identity hash of the given roots. Of course this relies on that function having a decent vm implementation.
1 if path1 is before path2, -1 if path2 is before path1, 0 if they are the same and NotSameRoot+-1 if they are not in the same root
When paths are not in the same root, they are compared based on the identity hash of the given roots.
When paths are not in the same root, they are compared based on the identity hash of the given roots. Of course this relies on that function having a decent vm implementation. See http://www.w3.org/TR/2007/REC-xpath20-20070123/#dt-document-order, tree order must remain constant. Its also a pretty sensible approach for non xml trees.
1 if path1 is before path2, -1 if path2 is before path1, 0 if they are the same and NotSameRoot+-1 if they are not in the same root
Helper for comparePaths, will not evaluate position if the paths are equal
Helper for comparePaths, will not evaluate position if the paths are equal
Deepest last child
Deepest last child
A usable default of UTF8 NOT the vm's Charset.defaultCharset based on its locale, use vmDefaultCharset for that
Are these two parameters (convertable to a C) equal for a given Equiv[C] instance
Are these two parameters (convertable to a C) equal for a given Equiv[C] instance
Folds over positions within a single path, for example all given children.
Folds over positions within a single path, for example all given children. As such positions must be calculated.
Takes the first root, returning Right(NoSingleRoot) if any of the subsequent roots don't match.
folder retrieves the current path
Each iteration folds the resulting tree back into the path. As this function must maintain the Path it does not expose the new path root until the result.
As per the non accumalating version, folds over positions within a given tree but allows for an additional accumalation.
As per the non accumalating version, folds over positions within a given tree but allows for an additional accumalation.
The progress through the document is in reverse document order. This ensures that transformations can always be safely composed, e.g. a delete of a path won't stop changes below it. This, however, implies the developer must also handle any accumulation in "reverse".
gets the next following:: sibling in document order
gets the next following:: sibling in document order
Warning: Id does not trampoline, consider trampolineIteratees or ioIteratees to import from
Warning: Id does not trampoline, consider trampolineIteratees or ioIteratees to import from
Makes a StringBuilder from an iterable using the builder parameter.
Makes a StringBuilder from an iterable using the builder parameter.
Navigates the path until the new position is reached, throws if either its a new root or the position is not reachable
Navigates the path until the new position is reached, throws if either its a new root or the position is not reachable
Obtain the positions for the paths
Obtain the positions for the paths
positions with tuples (T, Path)
positions with tuples (T, Path)
gets the next preceding:: sibling equivalent in document order, unlike XPath preceding:: it does not exclude parents
gets the next preceding:: sibling equivalent in document order, unlike XPath preceding:: it does not exclude parents
Removes the value, returning either it or a new item (stops end code worrying about nulls etc..
Removes the value, returning either it or a new item (stops end code worrying about nulls etc..
Simple grabber of resources
Returns the root path for its input, uses zipUp to ensure changes are kept
Returns the root path for its input, uses zipUp to ensure changes are kept
Sorts according to position of each path item, descending or descending based on a depth first then rightwise order.
Sorts according to position of each path item, descending or descending based on a depth first then rightwise order.
Sorts according to position of each path item, descending or descending based on a depth first then rightwise order.
Sorts according to position of each path item, descending or descending based on a depth first then rightwise order.
sortPositions with a tuple T, Path
sortPositions with a tuple T, Path
sort with a tuple T, Path
sort with a tuple T, Path
Provides an instance of the Equal type class for positional Equality
Provides an instance of the Equal type class for positional Equality
retrieves the value of a concurrent hashmap against a given key, creating if necessary.
retrieves the value of a concurrent hashmap against a given key, creating if necessary. Note it makes no gaurantee of once only semantics for the value generation
The scales.utils packages provide the basis functionality for scales.xml.
The Tree an Path collections that underpin the XML model, as well as the iteratee functionality are located in the relevant sub-packages.
The package object itself pulls in the main utility functions for tree, path and iteratee handling. Import the scales.utils.ScalesUtils object implicit members to provide the path & and | extension functions, the iteratorEnumerator and the +:+ lazy appender for scalaz.EphemeralStream.