[IoId("00000000-955f-4788-8d91-8c0271508d9a")] [DebuggerDisplay("{DebuggerDisplay}")] public sealed class Paths : IEnumerable<Path>, IStorable
A sorted collection of unique paths.

Constructors

Paths

#
public Paths(IEnumerable<Path> paths)
Create a new path collection.
paths (IEnumerable<Path>)Paths.

Paths

#
public Paths(IReader reader)
reader (IReader)

Paths

#
public Paths(params Path[] paths)
Create a new path collection.
paths (params Path[])Paths.

Properties

Backwards

#
public IEnumerable<Path> Backwards { get; }
Enumerate over all paths in a backwards fashion.

Count

#
public int Count { get; }
Gets the number of elements in this collection.

DebuggerDisplay

#
public string DebuggerDisplay { get; }
Gets a single line description of these paths.

Empty

#
public static Paths Empty { get; }
Gets an empty paths collection.

First

#
public Path First { get; }
Gets the first path in this collection, or null if this collection is empty.

Forwards

#
public IEnumerable<Path> Forwards { get; }
Enumerate over all paths in a forwards fashion.

Last

#
public Path Last { get; }
Gets the last path in this collection, or null if this collection is empty.

Longest

#
public Path Longest { get; }
Gets the last, longest path in this collection.

Shortest

#
public Path Shortest { get; }
Gets the first, shortest path in this collection.

Zero

#
public static Paths Zero { get; }
Gets a paths collection with a single path of value {0}.

Indexers

this[]

#
public Path this[int index, PathsIndexing method] { get; }
Gets the path at the given index. If implied is true, indices which exceed the collection size will yield valid results instead of IndexOutOfRange exceptions.
index (int)
method (PathsIndexing)

this[]

#
public Path this[int index] { get; }
Gets the path at the given index. If implied is true, indices which exceed the collection size will yield valid results instead of IndexOutOfRange exceptions.
index (int)

Methods

Append

#
public Paths Append(Path path)
Append a path to the end of this collection. The path must not already exist within this collection and must be sorted higher than the current ultimate path.
path (Path)

CanSimplify

#
public bool CanSimplify(PathAlignment align)
Test whether this collection of paths can be simplified.
align (PathAlignment)Simplification options.
True if the collection of paths can be simplified.

CreateConsecutive

#
public static Paths CreateConsecutive(int count, Path template, int index)
Create a number of consecutive paths by incrementing a template.
count (int)Number of paths.
template (Path)Template path.
index (int)Index of template path element to increment.

Cull

#
public Paths Cull(bool[] pattern)
Remove paths from this collection using a culling pattern.
pattern (bool[])Pattern, true=cull, false=keep.

Ensure

#
public Paths Ensure(Path path)
Ensure a path exists in this collection.
path (Path)

Equals

#
public override bool Equals(object obj)
Determines whether the specified object is equal to the current object.
obj (object)The object to compare with the current object.
true if the specified object is equal to the current object; otherwise, false.
Object.Equals

Exists

#
public bool Exists(Path path)
Gets whether this collection contains a specific path.
path (Path)

FromUnchecked

#
public static Paths FromUnchecked(IEnumerable<Path> paths)
Create a valid Paths collection from a potentially invalid collection. Null and colliding paths will be omitted.
paths (IEnumerable<Path>)Paths.

FromUnsorted

#
public static Paths FromUnsorted(IEnumerable<Path> paths)
Create a Paths instance from a collection of unsorted paths. If the collection contains identical paths, an exception will be thrown.
paths (IEnumerable<Path>)Paths.
Paths instance.

FromUnsorted<T>

#
public static Paths FromUnsorted<T>(IEnumerable<Path> paths, IEnumerable<T> data, out T[] sortedData)
Create a Paths instance from a collection of unsorted paths. If the collection contains identical paths, an exception will be thrown.
paths (IEnumerable<Path>)Paths.
data (IEnumerable<T>)Data to sort synchronously.
sortedData (out T[])Sorted data.
Paths instance.

GetHashCode

#
public override int GetHashCode()
Serves as the default hash function.
A hash code for the current object.
Explicit

IStorable.Store

#
void IStorable.Store(IWriter writer)
writer (IWriter)
Store

Index

#
public int Index(Path path)
Gets the index of the given path.
path (Path)Path to find.
Index of path or -1. Implied path indices are not returned.

Insert

#
public Paths Insert(Path path)
Insert a path into this collection. The path must not already exist within this collection.
path (Path)

MakeIncremental

#
public Paths MakeIncremental()
Simplify the numbering of a path collection. This means subsequent paths only ever increment by a single unit in a single location. If the paths in this collection have varying length, this method will do nothing.
Incremented path array.

PartialEquals

#
public bool PartialEquals(Paths superSet)
Test whether these paths are a partial subset of some other path collection. That is, whether each path in this collection can be matched up with a path in the super set which is either identical or which starts in a similar way.
superSet (Paths)

Remove

#
public Paths Remove(Path path)
Remove the given path if it exists.
path (Path)

RemoveAt

#
public Paths RemoveAt(int index)
Remove the path at the given index.
index (int)

Simplify

#
public Paths Simplify(PathAlignment align)
Simplify this path collection by removing those path elements shared amongst all paths.
align (PathAlignment)Simplification options.
Simplified path collection.
Explicit

IEnumerable<Path>.GetEnumerator

#
IEnumerator<Path> IEnumerable<Path>.GetEnumerator()
Explicit

IEnumerable.GetEnumerator

#
IEnumerator IEnumerable.GetEnumerator()

ToNodeHierarchy

#
public PathNode ToNodeHierarchy()
Create a path node hierarchy from this path list.

ToString

#
public override string ToString()
Object.ToString

Operators

OperationResultDescription
int+PathsPathsAdd a prefix to all the paths.
Path+PathsPathsAdd a prefix to all the paths.
Paths+intPathsAdd a suffix to all the paths.
Paths+PathPathsAdd a suffix to all the paths.
Paths==PathsboolCompare two Paths instances for equality.
Paths!=PathsboolCompare two Paths instances for inequality.