PSF-LoginServer/net/psforever/objects/guid/selector/index.html

56 lines
23 KiB
HTML

<!DOCTYPE html ><html><head><meta http-equiv="X-UA-Compatible" content="IE=edge"/><meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport"/><title>PSF-LoginServer - master - net.psforever.objects.guid.selector</title><meta content="PSF - LoginServer - master - net.psforever.objects.guid.selector" name="description"/><meta content="PSF LoginServer master net.psforever.objects.guid.selector" name="keywords"/><meta http-equiv="content-type" content="text/html; charset=UTF-8"/><link href="../../../../../lib/index.css" media="screen" type="text/css" rel="stylesheet"/><link href="../../../../../lib/template.css" media="screen" type="text/css" rel="stylesheet"/><link href="../../../../../lib/print.css" media="print" type="text/css" rel="stylesheet"/><link href="../../../../../lib/diagrams.css" media="screen" type="text/css" rel="stylesheet" id="diagrams-css"/><script type="text/javascript" src="../../../../../lib/jquery.min.js"></script><script type="text/javascript" src="../../../../../lib/index.js"></script><script type="text/javascript" src="../../../../../index.js"></script><script type="text/javascript" src="../../../../../lib/scheduler.js"></script><script type="text/javascript" src="../../../../../lib/template.js"></script><script type="text/javascript">/* this variable can be used by the JS to determine the path to the root document */
var toRoot = '../../../../../';</script></head><body><div id="search"><span id="doc-title">PSF-LoginServer - <span id="doc-version">master</span></span> <span class="close-results"><span class="left">&lt;</span> Back</span><div id="textfilter"><span class="input"><input autocapitalize="none" placeholder="Search" id="index-input" type="text" accesskey="/"/><i class="clear material-icons"></i><i id="search-icon" class="material-icons"></i></span></div></div><div id="search-results"><div id="search-progress"><div id="progress-fill"></div></div><div id="results-content"><div id="entity-results"></div><div id="member-results"></div></div></div><div id="content-scroll-container" style="-webkit-overflow-scrolling: touch;"><div id="content-container" style="-webkit-overflow-scrolling: touch;"><div id="subpackage-spacer"><div id="packages"><h1>Packages</h1><ul><li class="indented0 " name="_root_.root" group="Ungrouped" fullComment="yes" data-isabs="false" visbl="pub"><a id="_root_"></a><a id="root:_root_"></a> <span class="permalink"><a href="../../../../../index.html" title="Permalink"><i class="material-icons"></i></a></span> <span class="modifier_kind"><span class="modifier"></span> <span class="kind">package</span></span> <span class="symbol"><a href="../../../../../index.html" title=""><span class="name">root</span></a></span><div class="fullcomment"><dl class="attributes block"><dt>Definition Classes</dt><dd><a href="../../../../../index.html" name="_root_" id="_root_" class="extype">root</a></dd></dl></div></li><li class="indented1 " name="_root_.net" group="Ungrouped" fullComment="yes" data-isabs="false" visbl="pub"><a id="net"></a><a id="net:net"></a> <span class="permalink"><a href="../../../../../net/index.html" title="Permalink"><i class="material-icons"></i></a></span> <span class="modifier_kind"><span class="modifier"></span> <span class="kind">package</span></span> <span class="symbol"><a href="../../../../index.html" title=""><span class="name">net</span></a></span><div class="fullcomment"><dl class="attributes block"><dt>Definition Classes</dt><dd><a href="../../../../../index.html" name="_root_" id="_root_" class="extype">root</a></dd></dl></div></li><li class="indented2 " name="net.psforever" group="Ungrouped" fullComment="yes" data-isabs="false" visbl="pub"><a id="psforever"></a><a id="psforever:psforever"></a> <span class="permalink"><a href="../../../../../net/psforever/index.html" title="Permalink"><i class="material-icons"></i></a></span> <span class="modifier_kind"><span class="modifier"></span> <span class="kind">package</span></span> <span class="symbol"><a href="../../../index.html" title=""><span class="name">psforever</span></a></span><div class="fullcomment"><dl class="attributes block"><dt>Definition Classes</dt><dd><a href="../../../../index.html" name="net" id="net" class="extype">net</a></dd></dl></div></li><li class="indented3 " name="net.psforever.objects" group="Ungrouped" fullComment="yes" data-isabs="false" visbl="pub"><a id="objects"></a><a id="objects:objects"></a> <span class="permalink"><a href="../../../../../net/psforever/objects/index.html" title="Permalink"><i class="material-icons"></i></a></span> <span class="modifier_kind"><span class="modifier"></span> <span class="kind">package</span></span> <span class="symbol"><a href="../../index.html" title=""><span class="name">objects</span></a></span><div class="fullcomment"><dl class="attributes block"><dt>Definition Classes</dt><dd><a href="../../../index.html" name="net.psforever" id="net.psforever" class="extype">psforever</a></dd></dl></div></li><li class="indented4 " name="net.psforever.objects.guid" group="Ungrouped" fullComment="yes" data-isabs="false" visbl="pub"><a id="guid"></a><a id="guid:guid"></a> <span class="permalink"><a href="../../../../../net/psforever/objects/guid/index.html" title="Permalink"><i class="material-icons"></i></a></span> <span class="modifier_kind"><span class="modifier"></span> <span class="kind">package</span></span> <span class="symbol"><a href="../index.html" title=""><span class="name">guid</span></a></span><div class="fullcomment"><dl class="attributes block"><dt>Definition Classes</dt><dd><a href="../../index.html" name="net.psforever.objects" id="net.psforever.objects" class="extype">objects</a></dd></dl></div></li><li class="indented5 " name="net.psforever.objects.guid.key" group="Ungrouped" fullComment="yes" data-isabs="false" visbl="pub"><a id="key"></a><a id="key:key"></a> <span class="permalink"><a href="../../../../../net/psforever/objects/guid/key/index.html" title="Permalink"><i class="material-icons"></i></a></span> <span class="modifier_kind"><span class="modifier"></span> <span class="kind">package</span></span> <span class="symbol"><a href="../key/index.html" title=""><span class="name">key</span></a></span><div class="fullcomment"><dl class="attributes block"><dt>Definition Classes</dt><dd><a href="../index.html" name="net.psforever.objects.guid" id="net.psforever.objects.guid" class="extype">guid</a></dd></dl></div></li><li class="indented5 " name="net.psforever.objects.guid.pool" group="Ungrouped" fullComment="yes" data-isabs="false" visbl="pub"><a id="pool"></a><a id="pool:pool"></a> <span class="permalink"><a href="../../../../../net/psforever/objects/guid/pool/index.html" title="Permalink"><i class="material-icons"></i></a></span> <span class="modifier_kind"><span class="modifier"></span> <span class="kind">package</span></span> <span class="symbol"><a href="../pool/index.html" title=""><span class="name">pool</span></a></span><div class="fullcomment"><dl class="attributes block"><dt>Definition Classes</dt><dd><a href="../index.html" name="net.psforever.objects.guid" id="net.psforever.objects.guid" class="extype">guid</a></dd></dl></div></li><li class="indented5 current" name="net.psforever.objects.guid.selector" group="Ungrouped" fullComment="yes" data-isabs="false" visbl="pub"><a id="selector"></a><a id="selector:selector"></a> <span class="permalink"><a href="../../../../../net/psforever/objects/guid/selector/index.html" title="Permalink"><i class="material-icons"></i></a></span> <span class="modifier_kind"><span class="modifier"></span> <span class="kind">package</span></span> <span class="symbol"><span class="name">selector</span></span><div class="fullcomment"><dl class="attributes block"><dt>Definition Classes</dt><dd><a href="../index.html" name="net.psforever.objects.guid" id="net.psforever.objects.guid" class="extype">guid</a></dd></dl></div></li><li class="current-entities indented5"><span class="separator"></span> <a href="NumberSelector.html" title="The base class for all different sorts of number selection policies. The Arrays called out as method parameters is always an Array of indexes for some other list." class="class"></a><a href="NumberSelector.html" title="The base class for all different sorts of number selection policies. The Arrays called out as method parameters is always an Array of indexes for some other list.">NumberSelector</a></li><li class="current-entities indented5"><span class="separator"></span> <a href="OpportunisticSelector.html" title="Get whichever number is next available." class="class"></a><a href="OpportunisticSelector.html" title="Get whichever number is next available.">OpportunisticSelector</a></li><li class="current-entities indented5"><span class="separator"></span> <a href="RandomSelector.html" title="Get a pseudorandom number from a pool of numbers." class="class"></a><a href="RandomSelector.html" title="Get a pseudorandom number from a pool of numbers.">RandomSelector</a></li><li class="current-entities indented5"><span class="separator"></span> <a href="RandomSequenceSelector.html" title="Get a pseudorandom number from a pool of numbers." class="class"></a><a href="RandomSequenceSelector.html" title="Get a pseudorandom number from a pool of numbers.">RandomSequenceSelector</a></li><li class="current-entities indented5"><span class="separator"></span> <a href="SpecificSelector.html" title="Get a specific number from a pool of numbers." class="class"></a><a href="SpecificSelector.html" title="Get a specific number from a pool of numbers.">SpecificSelector</a></li><li class="current-entities indented5"><span class="separator"></span> <a href="StrictInOrderSelector.html" title="Get the next number in this pool incrementally." class="class"></a><a href="StrictInOrderSelector.html" title="Get the next number in this pool incrementally.">StrictInOrderSelector</a></li><li class="indented5 " name="net.psforever.objects.guid.source" group="Ungrouped" fullComment="yes" data-isabs="false" visbl="pub"><a id="source"></a><a id="source:source"></a> <span class="permalink"><a href="../../../../../net/psforever/objects/guid/source/index.html" title="Permalink"><i class="material-icons"></i></a></span> <span class="modifier_kind"><span class="modifier"></span> <span class="kind">package</span></span> <span class="symbol"><a href="../source/index.html" title=""><span class="name">source</span></a></span><div class="fullcomment"><dl class="attributes block"><dt>Definition Classes</dt><dd><a href="../index.html" name="net.psforever.objects.guid" id="net.psforever.objects.guid" class="extype">guid</a></dd></dl></div></li><li class="indented5 " name="net.psforever.objects.guid.uns" group="Ungrouped" fullComment="yes" data-isabs="false" visbl="pub"><a id="uns"></a><a id="uns:uns"></a> <span class="permalink"><a href="../../../../../net/psforever/objects/guid/uns/index.html" title="Permalink"><i class="material-icons"></i></a></span> <span class="modifier_kind"><span class="modifier"></span> <span class="kind">package</span></span> <span class="symbol"><a href="../uns/index.html" title=""><span class="name">uns</span></a></span><div class="fullcomment"><dl class="attributes block"><dt>Definition Classes</dt><dd><a href="../index.html" name="net.psforever.objects.guid" id="net.psforever.objects.guid" class="extype">guid</a></dd></dl></div></li></ul></div></div><div id="content"><body class="package value"><div id="definition"><div class="big-circle package">p</div><p id="owner"><a href="../../../../index.html" name="net" id="net" class="extype">net</a>.<a href="../../../index.html" name="net.psforever" id="net.psforever" class="extype">psforever</a>.<a href="../../index.html" name="net.psforever.objects" id="net.psforever.objects" class="extype">objects</a>.<a href="../index.html" name="net.psforever.objects.guid" id="net.psforever.objects.guid" class="extype">guid</a></p><h1>selector<span class="permalink"><a href="../../../../../net/psforever/objects/guid/selector/index.html" title="Permalink"><i class="material-icons"></i></a></span></h1></div><h4 id="signature" class="signature"><span class="modifier_kind"><span class="modifier"></span> <span class="kind">package</span></span> <span class="symbol"><span class="name">selector</span></span></h4><div id="comment" class="fullcommenttop"></div><div id="template"><div id="allMembers"><div id="types" class="types members"><h3>Type Members</h3><ol><li class="indented0 " name="net.psforever.objects.guid.selector.NumberSelector" group="Ungrouped" fullComment="yes" data-isabs="true" visbl="pub"><a id="NumberSelectorextendsAnyRef"></a><a id="NumberSelector:NumberSelector"></a> <span class="permalink"><a href="../../../../../net/psforever/objects/guid/selector/NumberSelector.html" title="Permalink"><i class="material-icons"></i></a></span> <span class="modifier_kind"><span class="modifier">abstract </span> <span class="kind">class</span></span> <span class="symbol"><a href="NumberSelector.html" title="The base class for all different sorts of number selection policies. The Arrays called out as method parameters is always an Array of indexes for some other list."><span class="name">NumberSelector</span></a><span class="result"> extends <span name="scala.AnyRef" class="extype">AnyRef</span></span></span><p class="shortcomment cmt">The base class for all different sorts of number selection policies.<br>
<br>
The <code>Array</code>s called out as method parameters is always an <code>Array</code> of indexes for some other list.</p><div class="fullcomment"><div class="comment cmt"><p>The base class for all different sorts of number selection policies.<br>
<br>
The <code>Array</code>s called out as method parameters is always an <code>Array</code> of indexes for some other list.
The indices in the <code>Array</code> are always the complete range of 0 to <code>n</code> numbers.
It is recommended to initialize the <code>Array</code> with the rule <code>array(number) = number</code>.
When they need to be flagged as "invalid" in some way, use some consistent system of negative numbers.
(Recommendation: unless doing something fancy, just use -1.)
</p></div></div></li><li class="indented0 " name="net.psforever.objects.guid.selector.OpportunisticSelector" group="Ungrouped" fullComment="yes" data-isabs="false" visbl="pub"><a id="OpportunisticSelectorextendsNumberSelector"></a><a id="OpportunisticSelector:OpportunisticSelector"></a> <span class="permalink"><a href="../../../../../net/psforever/objects/guid/selector/OpportunisticSelector.html" title="Permalink"><i class="material-icons"></i></a></span> <span class="modifier_kind"><span class="modifier"></span> <span class="kind">class</span></span> <span class="symbol"><a href="OpportunisticSelector.html" title="Get whichever number is next available."><span class="name">OpportunisticSelector</span></a><span class="result"> extends <a href="NumberSelector.html" name="net.psforever.objects.guid.selector.NumberSelector" id="net.psforever.objects.guid.selector.NumberSelector" class="extype">NumberSelector</a></span></span><p class="shortcomment cmt">Get whichever number is next available.</p><div class="fullcomment"><div class="comment cmt"><p>Get whichever number is next available.
It is similar to <code>StrictInOrderSelector</code> but it does not stop if it runs into an unavailable number.
It attempts to get each number in its listed incrementally from a starting index.
The search wraps back around to the zero index to the same start index if necessary.
</p></div></div></li><li class="indented0 " name="net.psforever.objects.guid.selector.RandomSelector" group="Ungrouped" fullComment="yes" data-isabs="false" visbl="pub"><a id="RandomSelectorextendsNumberSelector"></a><a id="RandomSelector:RandomSelector"></a> <span class="permalink"><a href="../../../../../net/psforever/objects/guid/selector/RandomSelector.html" title="Permalink"><i class="material-icons"></i></a></span> <span class="modifier_kind"><span class="modifier"></span> <span class="kind">class</span></span> <span class="symbol"><a href="RandomSelector.html" title="Get a pseudorandom number from a pool of numbers."><span class="name">RandomSelector</span></a><span class="result"> extends <a href="NumberSelector.html" name="net.psforever.objects.guid.selector.NumberSelector" id="net.psforever.objects.guid.selector.NumberSelector" class="extype">NumberSelector</a></span></span><p class="shortcomment cmt">Get a pseudorandom number from a pool of numbers.</p><div class="fullcomment"><div class="comment cmt"><p>Get a pseudorandom number from a pool of numbers.
The contained logic is similar to <code>RandomSequenceSelector</code>.
It is not reliant of a shrinking pool that composes into some sequence of all the numbers, however;
the numbers are re-introduced to the selection as long as the pool is used.
This allows for the sequence to contain repeat numbers far before ever visiting all of the numbers once.<br>
<br>
During the selection process:<br>
The index is the position from where the selection begins, and the end of the <code>Array</code> is where the selection ends.
Once a position between those two indices is selected, that number is extracted.
The number at the start position is swapped into the position where the selection number was extracted.
The start position is then set to an invalid number, and the start index is advanced.
Repeat next request.<br>
<br>
During the return process:<br>
The returned number is added to the input <code>Array</code> at the position just before the current selection position.
The selection index is then reversedback to re-include the returned number.
The normal return index is not used in this algorithm.</p></div><dl class="attributes block"><dt>See also</dt><dd><span class="cmt"><p><code>RandomSequenceSelector</code></p></span></dd></dl></div></li><li class="indented0 " name="net.psforever.objects.guid.selector.RandomSequenceSelector" group="Ungrouped" fullComment="yes" data-isabs="false" visbl="pub"><a id="RandomSequenceSelectorextendsNumberSelector"></a><a id="RandomSequenceSelector:RandomSequenceSelector"></a> <span class="permalink"><a href="../../../../../net/psforever/objects/guid/selector/RandomSequenceSelector.html" title="Permalink"><i class="material-icons"></i></a></span> <span class="modifier_kind"><span class="modifier"></span> <span class="kind">class</span></span> <span class="symbol"><a href="RandomSequenceSelector.html" title="Get a pseudorandom number from a pool of numbers."><span class="name">RandomSequenceSelector</span></a><span class="result"> extends <a href="NumberSelector.html" name="net.psforever.objects.guid.selector.NumberSelector" id="net.psforever.objects.guid.selector.NumberSelector" class="extype">NumberSelector</a></span></span><p class="shortcomment cmt">Get a pseudorandom number from a pool of numbers.</p><div class="fullcomment"><div class="comment cmt"><p>Get a pseudorandom number from a pool of numbers.
The output of this class, operating on an <code>Array</code> of <code>Int</code> values is contained to some sequence of all the numbers.
Only after every number is selected once, may any number repeat.
The pseudorandomness of any sequence of numbers is not only provided by an internal system <code>Random</code> but by the order or returned numbers.
Consequentially, as any single sequence nears completion, the numbers remaining become more and more predictable.<br>
<br>
During the selection process:<br>
The index is the position from where the selection begins, and the end of the <code>Array</code> is where the selection ends.
Once a position between those two indices is selected, that number is extracted.
The number at the start position is swapped into the position where the selection number was extracted.
The start position is then set to an invalid number, and the start index is advanced.
Repeat next request.<br>
<br>
The return index trails behind the selection index as far as the order of the array is concerned at first.
After some time, the selection index moves to the starting position of the array again and then the order is reversed.
Until the return index wraps around to the beginning of the array too, it is considered the valid selection end position.<br>
<br>
During the return process:<br>
As the <code>Array</code> empties out from the first to the last index, the return process starts at the first index again.
When a number is "returned," it is placed back into the input <code>Array</code> at the earliest available index.
The return index is advanced.
Neither the selection index nor the return index may pass each other,
except when one reaches the end of the <code>Array</code> and wraps back around to that start.</p></div><dl class="attributes block"><dt>See also</dt><dd><span class="cmt"><p><code>RandomSelector</code></p></span></dd></dl></div></li><li class="indented0 " name="net.psforever.objects.guid.selector.SpecificSelector" group="Ungrouped" fullComment="no" data-isabs="false" visbl="pub"><a id="SpecificSelectorextendsNumberSelector"></a><a id="SpecificSelector:SpecificSelector"></a> <span class="permalink"><a href="../../../../../net/psforever/objects/guid/selector/SpecificSelector.html" title="Permalink"><i class="material-icons"></i></a></span> <span class="modifier_kind"><span class="modifier"></span> <span class="kind">class</span></span> <span class="symbol"><a href="SpecificSelector.html" title="Get a specific number from a pool of numbers."><span class="name">SpecificSelector</span></a><span class="result"> extends <a href="NumberSelector.html" name="net.psforever.objects.guid.selector.NumberSelector" id="net.psforever.objects.guid.selector.NumberSelector" class="extype">NumberSelector</a></span></span><p class="shortcomment cmt">Get a specific number from a pool of numbers.</p></li><li class="indented0 " name="net.psforever.objects.guid.selector.StrictInOrderSelector" group="Ungrouped" fullComment="yes" data-isabs="false" visbl="pub"><a id="StrictInOrderSelectorextendsNumberSelector"></a><a id="StrictInOrderSelector:StrictInOrderSelector"></a> <span class="permalink"><a href="../../../../../net/psforever/objects/guid/selector/StrictInOrderSelector.html" title="Permalink"><i class="material-icons"></i></a></span> <span class="modifier_kind"><span class="modifier"></span> <span class="kind">class</span></span> <span class="symbol"><a href="StrictInOrderSelector.html" title="Get the next number in this pool incrementally."><span class="name">StrictInOrderSelector</span></a><span class="result"> extends <a href="NumberSelector.html" name="net.psforever.objects.guid.selector.NumberSelector" id="net.psforever.objects.guid.selector.NumberSelector" class="extype">NumberSelector</a></span></span><p class="shortcomment cmt">Get the next number in this pool incrementally.</p><div class="fullcomment"><div class="comment cmt"><p>Get the next number in this pool incrementally.
Starting at index 0, for example, select each subsequent number as it is available.
Do not progress if a number is not available when requested.
</p></div></div></li></ol></div></div><div id="inheritedMembers"></div><div id="groupedMembers"><div name="Ungrouped" class="group"><h3>Ungrouped</h3></div></div></div><div id="tooltip"></div><div id="footer"></div></body></div></div></div></body></html>