-
Notifications
You must be signed in to change notification settings - Fork 0
/
20_data_structures.html
33 lines (33 loc) · 6.77 KB
/
20_data_structures.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<!DOCTYPE html PUBLIC ""
"">
<html><head><meta charset="UTF-8" /><title>Data Structures</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script><link rel="stylesheet" type="text/css" href="css/randomseed.css" /></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Bankster</span> <span class="project-version">1.2.16</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Topics</span></h3><ul><li class="depth-1 "><a href="10_introduction.html"><div class="inner"><span>Introduction</span></div></a></li><li class="depth-1 current"><a href="20_data_structures.html"><div class="inner"><span>Data Structures</span></div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>io</span></div></div></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>randomseed</span></div></div></li><li class="depth-3"><a href="io.randomseed.bankster.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>bankster</span></div></a></li><li class="depth-4 branch"><a href="io.randomseed.bankster.config.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>config</span></div></a></li><li class="depth-4 branch"><a href="io.randomseed.bankster.currency.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>currency</span></div></a></li><li class="depth-4"><a href="io.randomseed.bankster.money.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>money</span></div></a></li><li class="depth-5 branch"><a href="io.randomseed.bankster.money.inter-ops.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>inter-ops</span></div></a></li><li class="depth-5"><a href="io.randomseed.bankster.money.ops.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>ops</span></div></a></li><li class="depth-4 branch"><a href="io.randomseed.bankster.registry.html"><div class="inner"><span class="tree" style="top: -83px;"><span class="top" style="height: 92px;"></span><span class="bottom"></span></span><span>registry</span></div></a></li><li class="depth-4 branch"><a href="io.randomseed.bankster.scale.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>scale</span></div></a></li><li class="depth-4"><a href="io.randomseed.bankster.util.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>util</span></div></a></li><li class="depth-5 branch"><a href="io.randomseed.bankster.util.fs.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>fs</span></div></a></li><li class="depth-5 branch"><a href="io.randomseed.bankster.util.importer.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>importer</span></div></a></li><li class="depth-5"><a href="io.randomseed.bankster.util.map.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>map</span></div></a></li></ul></div><div class="document" id="content"><div class="doc"><div class="markdown"><h1><a href="#data-structures" id="data-structures"></a>Data Structures</h1>
<h2><a href="#currency" id="currency"></a>Currency</h2>
<p>Currency is a record describing currency and having the following fields:</p>
<ul>
<li><code>id</code> – a keyword identifying a currency unit (e.g. <code>:EUR</code> or <code>:crypto/ETH</code>);</li>
<li><code>numeric</code> – a long value being a numeric identifier of ISO-standardized currencies (e.g. <code>978</code> or <code>-1</code> for none);</li>
<li><code>scale</code> – an integer of supported scale (decimal places, e.g. <code>2</code> or <code>-1</code> for auto);</li>
<li><code>kind</code> – a keyword with currency kind (e.g. <code>:FIAT</code> or <code>:DECENTRALIZED</code>);</li>
<li><code>domain</code> – a keyword with currency domain (e.g. <code>:ISO-4217</code> or <code>:CRYPTO</code>);</li>
<li><code>weight</code> – an integer value used when there are conflicting currency codes during lookup (defaults to <code>0</code>).</li>
</ul>
<p>Internally <code>numeric</code> can be <code>-1</code>, meaning there is no numeric ID and <code>scale</code> can be <code>-1</code> too, meaning the amount of currency can have any number of decimal places.</p>
<p>The currency domain is derived from an identifier if the identifier is namespaced. The derived ID is upper-cased. If there is no namespace the domain can be set to any keyword, with <code>:ISO-4217</code> having special meaning in some operations as it marks official currencies.</p>
<h2><a href="#registry" id="registry"></a>Registry</h2>
<p>Registry is a record describing a database of currencies with associated metdata and having the following fields:</p>
<ul>
<li><code>cur-id->cur</code> – a map of currency ID to currency record;</li>
<li><code>cur-nr->cur</code> – a map of currency numeric ID to currency record;</li>
<li><code>ctr-id->cur</code> – a map of country ID to currency record;</li>
<li><code>cur-id->ctr-ids</code> – a map of currency ID to set of country IDs;</li>
<li><code>cur-id->localized</code> – a map of locale ID to localized properties;</li>
<li><code>cur-code->currencies</code> – a map of currency codes to sorted sets of currencies;</li>
<li><code>version</code> – an optional string with registry version.</li>
</ul>
<h2><a href="#money" id="money"></a>Money</h2>
<p>Money is a record describing a monetary value and having the following fields:</p>
<ul>
<li><code>currency</code> – a Currency object;</li>
<li><code>amount</code> – an amount of currency stored as a <code>BigDecimal</code> number.</li>
</ul>
</div></div></div></body></html>