﻿<!DOCTYPE html>
<! --[if IE]><![endif]-->
<html>
  
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>Interface IRangeFactory&lt;T, TRange&gt;
   | CodeJam </title>
    <meta name="viewport" content="width=device-width">
    <meta name="title" content="Interface IRangeFactory&lt;T, TRange&gt;
   | CodeJam ">
    <meta name="generator" content="docfx 2.23.1.0">
    
    <link rel="shortcut icon" href="../../favicon.ico">
    <link rel="stylesheet" href="../../styles/docfx.vendor.css">
    <link rel="stylesheet" href="../../styles/docfx.css">
    <link rel="stylesheet" href="../../styles/main.css">
    <meta property="docfx:navrel" content="../../toc.html">
    <meta property="docfx:tocrel" content="toc.html">
    <meta property="docfx:rel" content="../../">
    
  </head>
  <body data-spy="scroll" data-target="#affix">
    <div id="wrapper">
      <header>
        
        <nav id="autocollapse" class="navbar navbar-inverse ng-scope" role="navigation">
          <div class="container">
            <div class="navbar-header">
              <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
              </button>
              
              <a class="navbar-brand" href="../../index.html">
                <img id="logo" class="svg" src="../../images/CodeJam. Main. Icon.png" alt="">
              </a>
            </div>
            <div class="collapse navbar-collapse" id="navbar">
              <form class="navbar-form navbar-right" role="search" id="search">
                <div class="form-group">
                  <input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">
                </div>
              </form>
            </div>
          </div>
        </nav>
        
        <div class="subnav navbar navbar-default">
          <div class="container hide-when-search" id="breadcrumb">
            <ul class="breadcrumb">
              <li></li>
            </ul>
          </div>
        </div>
      </header>
      <div class="container body-content">
        
        <div id="search-results">
          <div class="search-list"></div>
          <div class="sr-items"></div>
          <ul id="pagination"></ul>
        </div>
      </div>
      <div role="main" class="container body-content hide-when-search">
        
        <div class="sidenav hide-when-search">
          <a class="btn toc-toggle collapse" data-toggle="collapse" href="#sidetoggle" aria-expanded="false" aria-controls="sidetoggle">Show / Hide Table of Contents</a>
          <div class="sidetoggle collapse" id="sidetoggle">
            <div id="sidetoc"></div>
          </div>
        </div>
        <div class="article row grid-right">
          <div class="col-md-10">
            <article class="content wrap" id="_content" data-uid="CodeJam. Ranges. IRangeFactory`2">
  
  
  <h1 id="CodeJam_Ranges_IRangeFactory_2" data-uid="CodeJam. Ranges. IRangeFactory`2" class="text-break">Interface IRangeFactory&lt;T, TRange&gt;
  </h1>
  <div class="markdown level0 summary"><p>Common factory interface to enable &apos;derived&apos; range creation. 
Use case example: preserve the key of the range on range intersection.</p>
</div>
  <div class="markdown level0 conceptual"></div>
  <div class="inheritedMembers">
    <h5>Inherited Members</h5>
    <div>
      <a class="xref" href="CodeJam. Ranges. IRange-1.html#CodeJam_Ranges_IRange_1_From">IRange&lt;T&gt;.From</a>
    </div>
    <div>
      <a class="xref" href="CodeJam. Ranges. IRange-1.html#CodeJam_Ranges_IRange_1_To">IRange&lt;T&gt;.To</a>
    </div>
    <div>
      <a class="xref" href="CodeJam. Ranges. IRange-1.html#CodeJam_Ranges_IRange_1_IsEmpty">IRange&lt;T&gt;.IsEmpty</a>
    </div>
    <div>
      <a class="xref" href="CodeJam. Ranges. IRange-1.html#CodeJam_Ranges_IRange_1_IsNotEmpty">IRange&lt;T&gt;.IsNotEmpty</a>
    </div>
  </div>
  <h6><strong>Namespace</strong>: <a class="xref" href="CodeJam. Ranges.html">CodeJam. Ranges</a></h6>
  <h6><strong>Assembly</strong>: CodeJam.dll</h6>
  <h5 id="CodeJam_Ranges_IRangeFactory_2_syntax">Syntax</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public interface IRangeFactory&lt;T, out TRange&gt; : IRange&lt;T&gt; where TRange : IRange&lt;T&gt;</code></pre>
  </div>
  <h5 class="typeParameters">Type Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="parametername">T</span></td>
        <td><p>The type of the value.  Should implement <span class="xref">System. IComparable&lt;T&gt;</span> or <span class="xref">System. IComparable</span>.</p>
</td>
      </tr>
      <tr>
        <td><span class="parametername">TRange</span></td>
        <td><p>The type of the resulting range</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="methods">Methods
  </h3>
  <span class="small pull-right mobile-hide">
    <span class="divider">|</span>
    <a href="https://github.com/rsdn/CodeJam/new/master/apiSpec/new?filename=CodeJam_Ranges_IRangeFactory_2_CreateRange_CodeJam_Ranges_RangeBoundaryFrom__0__CodeJam_Ranges_RangeBoundaryTo__0__.md&amp;value=---%0Auid%3A%20CodeJam. Ranges. IRangeFactory%602.CreateRange(CodeJam. Ranges. RangeBoundaryFrom%7B%600%7D%2CCodeJam. Ranges. RangeBoundaryTo%7B%600%7D)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
  </span>
  <span class="small pull-right mobile-hide">
    <a href="https://github.com/rsdn/CodeJam/blob/master/Main/src/Ranges/[Ranges]/IRangeFactory.cs/#L23">View Source</a>
  </span>
  <a id="CodeJam_Ranges_IRangeFactory_2_CreateRange_" data-uid="CodeJam. Ranges. IRangeFactory`2.CreateRange*"></a>
  <h4 id="CodeJam_Ranges_IRangeFactory_2_CreateRange_CodeJam_Ranges_RangeBoundaryFrom__0__CodeJam_Ranges_RangeBoundaryTo__0__" data-uid="CodeJam. Ranges. IRangeFactory`2.CreateRange(CodeJam. Ranges. RangeBoundaryFrom{`0},CodeJam. Ranges. RangeBoundaryTo{`0})">CreateRange(RangeBoundaryFrom&lt;T&gt;, RangeBoundaryTo&lt;T&gt;)</h4>
  <div class="markdown level1 summary"><p>Creates a new instance of the range.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">TRange CreateRange(RangeBoundaryFrom&lt;T&gt; from, RangeBoundaryTo&lt;T&gt; to)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><a class="xref" href="CodeJam. Ranges. RangeBoundaryFrom-1.html">RangeBoundaryFrom</a>&lt;T&gt;</td>
        <td><span class="parametername">from</span></td>
        <td><p>Boundary From.</p>
</td>
      </tr>
      <tr>
        <td><a class="xref" href="CodeJam. Ranges. RangeBoundaryTo-1.html">RangeBoundaryTo</a>&lt;T&gt;</td>
        <td><span class="parametername">to</span></td>
        <td><p>Boundary To.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">TRange</span></td>
        <td><p>A new instance of the range with specified From-To boundaries.</p>
</td>
      </tr>
    </tbody>
  </table>
  <span class="small pull-right mobile-hide">
    <span class="divider">|</span>
    <a href="https://github.com/rsdn/CodeJam/new/master/apiSpec/new?filename=CodeJam_Ranges_IRangeFactory_2_TryCreateRange_CodeJam_Ranges_RangeBoundaryFrom__0__CodeJam_Ranges_RangeBoundaryTo__0__.md&amp;value=---%0Auid%3A%20CodeJam. Ranges. IRangeFactory%602.TryCreateRange(CodeJam. Ranges. RangeBoundaryFrom%7B%600%7D%2CCodeJam. Ranges. RangeBoundaryTo%7B%600%7D)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
  </span>
  <span class="small pull-right mobile-hide">
    <a href="https://github.com/rsdn/CodeJam/blob/master/Main/src/Ranges/[Ranges]/IRangeFactory.cs/#L32">View Source</a>
  </span>
  <a id="CodeJam_Ranges_IRangeFactory_2_TryCreateRange_" data-uid="CodeJam. Ranges. IRangeFactory`2.TryCreateRange*"></a>
  <h4 id="CodeJam_Ranges_IRangeFactory_2_TryCreateRange_CodeJam_Ranges_RangeBoundaryFrom__0__CodeJam_Ranges_RangeBoundaryTo__0__" data-uid="CodeJam. Ranges. IRangeFactory`2.TryCreateRange(CodeJam. Ranges. RangeBoundaryFrom{`0},CodeJam. Ranges. RangeBoundaryTo{`0})">TryCreateRange(RangeBoundaryFrom&lt;T&gt;, RangeBoundaryTo&lt;T&gt;)</h4>
  <div class="markdown level1 summary"><p>Creates a new instance of the range, if possible.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">TRange TryCreateRange(RangeBoundaryFrom&lt;T&gt; from, RangeBoundaryTo&lt;T&gt; to)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><a class="xref" href="CodeJam. Ranges. RangeBoundaryFrom-1.html">RangeBoundaryFrom</a>&lt;T&gt;</td>
        <td><span class="parametername">from</span></td>
        <td><p>Boundary From.</p>
</td>
      </tr>
      <tr>
        <td><a class="xref" href="CodeJam. Ranges. RangeBoundaryTo-1.html">RangeBoundaryTo</a>&lt;T&gt;</td>
        <td><span class="parametername">to</span></td>
        <td><p>Boundary To.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">TRange</span></td>
        <td><p>A new instance of the range with specified From-To boundaries,
or empty range, if from-to boundaries forms invalid range pair.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="extensionmethods">Extension Methods</h3>
  <div>
      <a class="xref" href="CodeJam. Ranges. RangeExtensions.html#CodeJam_Ranges_RangeExtensions_Contains__2___1_CodeJam_Ranges_Range___0__">RangeExtensions. Contains&lt;T, TRange&gt;(TRange, Range&lt;T&gt;)</a>
  </div>
  <div>
      <a class="xref" href="CodeJam. Ranges. RangeExtensions.html#CodeJam_Ranges_RangeExtensions_StartsAfter__2___1_CodeJam_Ranges_Range___0__">RangeExtensions. StartsAfter&lt;T, TRange&gt;(TRange, Range&lt;T&gt;)</a>
  </div>
  <div>
      <a class="xref" href="CodeJam. Ranges. RangeExtensions.html#CodeJam_Ranges_RangeExtensions_EndsBefore__2___1_CodeJam_Ranges_Range___0__">RangeExtensions. EndsBefore&lt;T, TRange&gt;(TRange, Range&lt;T&gt;)</a>
  </div>
  <div>
      <a class="xref" href="CodeJam. Ranges. RangeExtensions.html#CodeJam_Ranges_RangeExtensions_Contains__3___2_CodeJam_Ranges_Range___0___1__">RangeExtensions. Contains&lt;T, TKey, TRange&gt;(TRange, Range&lt;T, TKey&gt;)</a>
  </div>
  <div>
      <a class="xref" href="CodeJam. Ranges. RangeExtensions.html#CodeJam_Ranges_RangeExtensions_StartsAfter__3___2_CodeJam_Ranges_Range___0___1__">RangeExtensions. StartsAfter&lt;T, TKey, TRange&gt;(TRange, Range&lt;T, TKey&gt;)</a>
  </div>
  <div>
      <a class="xref" href="CodeJam. Ranges. RangeExtensions.html#CodeJam_Ranges_RangeExtensions_EndsBefore__3___2_CodeJam_Ranges_Range___0___1__">RangeExtensions. EndsBefore&lt;T, TKey, TRange&gt;(TRange, Range&lt;T, TKey&gt;)</a>
  </div>
  <h3 id="seealso">See Also</h3>
  <div class="seealso">
      <div><a class="xref" href="CodeJam. Ranges. IRange-1.html">IRange</a>&lt;T&gt;</div>
  </div>
</article>
          </div>
          
          <div class="hidden-sm col-md-2" role="complementary">
            <div class="sideaffix">
              <div class="contribution">
                <ul class="nav">
                  <li>
                    <a href="https://github.com/rsdn/CodeJam/new/master/apiSpec/new?filename=CodeJam_Ranges_IRangeFactory_2.md&amp;value=---%0Auid%3A%20CodeJam. Ranges. IRangeFactory%602%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A" class="contribution-link">Improve this Doc</a>
                  </li>
                  <li>
                    <a href="https://github.com/rsdn/CodeJam/blob/master/Main/src/Ranges/[Ranges]/IRangeFactory.cs/#L16" class="contribution-link">View Source</a>
                  </li>
                </ul>
              </div>
              <nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
              <!--  <p><a class="back-to-top" href="#top">Back to top</a><p> -->
              </nav>
            </div>
          </div>
        </div>
      </div>
      
      <footer>
        <div class="grad-bottom"></div>
        <div class="footer">
          <div class="container">
            <span class="pull-right">
              <a href="#top">Back to top</a>
            </span>
            Copyright � 2015-2017
            
          </div>
        </div>
      </footer>
    </div>
    
    <script type="text/javascript" src="../../styles/docfx.vendor.js"></script>
    <script type="text/javascript" src="../../styles/docfx.js"></script>
    <script type="text/javascript" src="../../styles/main.js"></script>
  </body>
</html>
