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 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760
|
<?xml version="1.0" encoding="ISO-8859-1"?>
<fpdoc-descriptions>
<package name="rtl">
<!--
====================================================================
fgl
====================================================================
-->
<module name="fgl">
<short>Free Pascal Generic Lists</short>
<descr>
The <var>fgl</var> unit contains some basic list-related generic classes.
</descr>
<!-- constant Visibility: default -->
<element name="MaxListSize">
<short>Maximum amount of elements in a list</short>
<descr>
<var>MaxListSize</var> is the maximum number of elements a list can contain
before the memory runs out.
</descr>
<seealso>
<link id="TFPSList.Capacity"/>
</seealso>
</element>
<!-- class Visibility: default -->
<element name="EListError">
<short>Exception thrown when a list-related error occurs</short>
<descr>
<var>EListError</var> is the exception used in the <link id="TFPSList"/>
class to indicate errors such as a list index out of bounds, wrong capacity
etc.
</descr>
<seealso>
<link id="TFPSList.Capacity"/>
<link id="TFPSList.Exchange"/>
<link id="TFPSList.Items"/>
</seealso>
</element>
<!-- class Visibility: default -->
<element name="TFPSList">
<short>Basic list of memory blocks</short>
<descr>
<p>
<var>TFPSList</var> can be seen as the generalized equivalent of the classes unit <link id="classes.TFPList">TFPList</link> list.
It is used as a base class for the <link id="TFPGList"/>, <link id="TFPGMap"/>, <link id="TFPGObjectList"/>,
<link id="TFPGInterfacedObjectList"/> and <link id="TFPGMapInterfacedObjectData"/> generic classes.
</p>
<p>
This list is not meant to be used directly, it is an auxiliary class for the actual generic list classes.
</p>
</descr>
<seealso>
<link id="classes.TFPList"/>
<link id="TFPGMap"/>
<link id="TFPGObjectList"/>
<link id="TFPGInterfacedObjectList"/>
<link id="TFPGMapInterfacedObjectData"/>
</seealso>
</element>
<!-- function type Visibility: default -->
<element name="TFPSListCompareFunc">
<short>Compare list items callback signature</short>
<descr>
<p>
<var>TFPSListCompareFunc</var> is used in the <link id="TFPSList.Sort"/>
method to compare 2 elements. The list passes 2 pointers to the actual items
to the compare function. The result of this function determines how the pointers will be sorted:
</p>
<ul>
<li>If the result of this function is negative, the first key (<var>key1</var>) is
assumed to be 'less' than the second key (<var>key2</var>) and will be moved before the second
in the list.</li>
<li>If the function result is positive, the first key (<var>key1</var>) pointer is assumed to
be 'greater than' the second key (<var>key2</var>)and will be moved after the second in the
list.</li>
<li>if the function result is zero, the keys are assumed to be 'equal'
and no moving will take place.</li>
</ul>
</descr>
<seealso>
<link id="TFPSList.Sort"/>
</seealso>
</element>
<!-- function result Visibility: default -->
<element name="TFPSListCompareFunc.Result">
<short>Is <var>key1</var> less than <var>key2</var></short>
</element>
<!-- argument Visibility: default -->
<element name="TFPSListCompareFunc.Key1">
<short>First key value</short>
</element>
<!-- argument Visibility: default -->
<element name="TFPSListCompareFunc.Key2">
<short>Second key value</short>
</element>
<!-- constructor Visibility: public -->
<element name="TFPSList.Create">
<short>Create a new instance of <var>TFPSList</var></short>
<descr>
<var>Create</var> creates a new instance of <var>TFPSList</var>, and
initializes the item size to <var>ItemSize</var>, which defaults to the size
of a pointer.
</descr>
<seealso>
<link id="TFPSList.ItemSize"/>
<link id="TFPSList.Destroy"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TFPSList.Create.AItemSize">
<short>Size of items in the list</short>
</element>
<!-- destructor Visibility: public -->
<element name="TFPSList.Destroy">
<short>Destroy the list instance.</short>
<descr>
<var>Destroy</var> clears and cleans up the list instance. Depending on the descendant,
this may also remove the items in the list from memory.
</descr>
<seealso>
<link id="TFPSList.Clear"/>
</seealso>
</element>
<!-- function Visibility: public -->
<element name="TFPSList.Add">
<short>Add a new item to the list</short>
<descr>
<p>
<var>Add</var> adds the item pointed to by <var>Item</var> to the list.
It is not the pointer <var>Item</var> itself which is added to the list, but
rather the <link id="TFPSList.ItemSize"/> bytes of memory to which <var>Item</var> is
pointing.
</p>
<p>
The function returns the index of the newly added item.
</p>
</descr>
<errors>
If the maximum list size is reached, an <link id="EListError"/> is raised.
</errors>
<seealso>
<link id="TFPSList.Delete"/>
<link id="TFPSList.Items"/>
<link id="TFPSList.Clear"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TFPSList.Add.Result">
<short>The index at which the item was added.</short>
</element>
<!-- argument Visibility: public -->
<element name="TFPSList.Add.Item">
<short>Pointer to the item to be added.</short>
</element>
<!-- procedure Visibility: public -->
<element name="TFPSList.Clear">
<short>Clear the list</short>
<descr>
<var>Clear</var> removes all the items in the list. Depending on the
descendent, the list items themselves may be cleared as well.
</descr>
<seealso>
<link id="TFPSList.Delete"/>
<link id="TFPSList.Items"/>
<link id="TFPSList.Add"/>
</seealso>
</element>
<!-- procedure Visibility: public -->
<element name="TFPSList.Delete">
<short>Delete an item from the list</short>
<descr>
<var>Delete</var> deletes the item at position <var>Index</var> from the list. Depending on the
descendent, the list items itself may be cleared as well.
</descr>
<errors>
If <var>Index</var> is out of bounds, an <link id="EListError"/> exception is raised.
</errors>
<seealso>
<link id="TFPSList.Clear"/>
<link id="TFPSList.Items"/>
<link id="TFPSList.Add"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TFPSList.Delete.Index">
<short>Item to delete from the list/</short>
</element>
<!-- class procedure Visibility: public -->
<element name="TFPSList.Error">
<short>Raise an <var>EListError</var> exception.</short>
<descr>
<var>Error</var> is an auxiliary routine which raises an <link
id="EListError"/> exception formatted from <var>Msg</var> and
<var>Data</var>.
</descr>
<seealso>
<link id="EListError"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TFPSList.Error.Msg">
<short>Message (will be formatted with Data)</short>
</element>
<!-- argument Visibility: public -->
<element name="TFPSList.Error.Data">
<short>Integer index</short>
</element>
<!-- procedure Visibility: public -->
<element name="TFPSList.Exchange">
<short>Exchange two items in the list</short>
<descr>
<var>Exchange</var> will exchange 2 items at positions <var>Index1</var> and <var>Index2</var> in the list.
</descr>
<errors>
If <var>Index1</var> or <var>Index2</var> are out of bounds, an <link id="EListError"/> exception is raised.
</errors>
<seealso>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TFPSList.Exchange.Index1">
<short>First item</short>
</element>
<!-- argument Visibility: public -->
<element name="TFPSList.Exchange.Index2">
<short>Second item</short>
</element>
<!-- function Visibility: public -->
<element name="TFPSList.Expand">
<short>Expand the capacity of the list</short>
<descr>
<var>Expand</var> will expand the capacity of the list, and returns itself.
</descr>
<errors>
If the size will become larger than <link id="MaxListSize"/> an <link
id="EListError"/> exception will be raised.
</errors>
<seealso>
<link id="MaxListSize"/>
<link id="TFPSList.Capacity"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TFPSList.Expand.Result">
<short>Self</short>
</element>
<!-- procedure Visibility: public -->
<element name="TFPSList.Extract">
<short>delete an element from the list</short>
<descr>
<p>
<var>Extract</var> removes the item pointed to by <var>Item</var> from the list.
It returns a pointer to the actually removed item from the list. The item is
searched using <link id="TFPSList.IndexOf"/>. If the item is not found, nil is returned.
</p>
<p>
Some descendents own the items in the list. <var>Extract</var> will not
dispose of the item, as <link id="TFPSList.Delete"/> does.
</p>
</descr>
<errors>
None.
</errors>
<seealso>
<link id="TFPSList.Delete"/>
<link id="TFPSList.Add"/>
<link id="TFPSList.IndexOf"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TFPSList.Extract.Item">
<short>Pointer to item to extract</short>
</element>
<!-- argument Visibility: public -->
<element name="TFPSList.Extract.ResultPtr">
<short>The actually removed item.</short>
</element>
<!-- function Visibility: public -->
<element name="TFPSList.IndexOf">
<short>Search an item in the list</short>
<descr>
<var>IndexOf</var> searches in the list for the item pointed to by
<var>Item</var>, and returns the position (0-based index) of the item in the list, or -1 if it
was not found. The items are compared using <link id="sysutils.CompareMem"/>,
so an exact memory layout match.
</descr>
<errors>
</errors>
<seealso>
<link id="TFPSList.Extract"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TFPSList.IndexOf.Result">
<short>Position in the list (0-based)</short>
</element>
<!-- argument Visibility: public -->
<element name="TFPSList.IndexOf.Item">
<short>Pointer to item to search for.</short>
</element>
<!-- procedure Visibility: public -->
<element name="TFPSList.Insert">
<short>Insert a new item in the list.</short>
<descr>
<p>
<var>Insert</var> comes in 2 overloaded version. The version without <var>Item</var>
creates a slot for a new item at position <var>Index</var> in the list, and returns a pointer to the new slot.
The slot will be of size <link id="TFPSList.ItemSize"/>.
</p>
<p>
The version with <var>Item</var> argument will allocate a slot in the list at position
<var>Index</var> and will copy the item pointed to by <var>Item</var> to the
slot in the list.
</p>
<p>
In both cases, <var>Index</var> must be 0-based.
</p>
</descr>
<errors>
If <var>Index</var> is invalid, an <link id="EListError"/> exception will be raised.
</errors>
<seealso>
<link id="TFPSList.Add"/>
<link id="TFPSList.Delete"/>
<link id="TFPSList.Extract"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TFPSList.Insert.Index">
<short>Index at which to insert the new item in the list</short>
</element>
<!-- argument Visibility: public -->
<element name="TFPSList.Insert.Item">
<short>Item to insert in the list</short>
</element>
<!-- function result Visibility: public -->
<element name="TFPSList.Insert.Result">
<short>Newly allocated slot in the list</short>
</element>
<!-- procedure Visibility: public -->
<element name="TFPSList.Move">
<short> Moves an item from one position in the list to another. </short>
<descr>
<p>
<var>Move</var> moves the item at position <var>CurIndex</var>
to position <var>NewIndex</var>. This is done by storing the value
at position <var>CurIndex</var>, deleting the pointer at position
<var>CurIndex</var>, and reinserting the value at position
<var>NewIndex</var>
</p>
</descr>
<errors>
If <var>CurIndex</var> or <var>Newindex</var> are not inside the valid
range of indices, an <link id="EListError"/> exception is raised.
</errors>
<seealso>
<link id="TFPSList.Exchange">Exchange</link>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TFPSList.Move.CurIndex">
<short>Item's current position in the list.</short>
</element>
<!-- argument Visibility: public -->
<element name="TFPSList.Move.NewIndex">
<short>Items new position in the list.</short>
</element>
<!-- procedure Visibility: public -->
<element name="TFPSList.Assign">
<short>Copy one list to another</short>
<descr>
<var>Assign</var> clears the list and will add all items from <var>Obj</var> to the list.
The items are copied one by one.
</descr>
<errors>
If the <link id="TFPSList.ItemSize"/> differs for the two lists, an <link
id="EListError"/> exception is raised.
</errors>
<seealso>
<link id="TFPSList.Add"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TFPSList.Assign.Obj">
<short>Source list from which to copy items.</short>
</element>
<!-- function Visibility: public -->
<element name="TFPSList.Remove">
<short>Remove the item from the list </short>
<descr>
<p>
<var>Remove</var> searches <var>Item</var> in the list, and deletes it from
the list. It returns the index of the item that was removed, or -1 if it was
not found. Only the first match is removed.
</p>
<p>
If a descendent of <var>TFPSList</var> owns the object of the list, the item
is removed from memory. If this is not desired, then <link
id="TFPSList.Extract"/> must be used instead.
</p>
</descr>
<seealso>
<link id="TFPSList.Extract"/>
<link id="TFPSList.IndexOf"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TFPSList.Remove.Result">
<short>Index of removed item</short>
</element>
<!-- argument Visibility: public -->
<element name="TFPSList.Remove.Item">
<short>Removed item</short>
</element>
<!-- procedure Visibility: public -->
<element name="TFPSList.Pack">
<short>Remove empty items from the list</short>
<descr>
<var>Pack</var> will remove all empty items from the list. An item is
considered to be empty if the memory location where the item is stored contains
only zero bytes.
</descr>
<seealso>
<link id="TFPSList.Clear"/>
<link id="TFPSList.Sort"/>
</seealso>
</element>
<!-- procedure Visibility: public -->
<element name="TFPSList.Sort">
<short>Sort the list</short>
<descr>
<p>
<var>Sort></var> sorts the items in the list. Two pointers are compared
by passing them to the <var>Compare</var> function. The result of this
function determines how the pointers will be sorted:
</p>
<ul>
<li>If the result of this function is negative, the first item is
assumed to be 'less' than the second and will be moved before the second
item in the list.
</li>
<li>If the function result is positive, the first item is assumed to
be 'greater than' the second and will be moved after the second item in the
list.
</li>
<li>if the function result is zero, the pointers are assumed to be 'equal'
and no moving will take place.
</li>
</ul>
<p>
The sort is done using a quicksort algorithm.
</p>
</descr>
<seealso>
<link id="TFPSListCompareFunc"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TFPSList.Sort.Compare">
<short>Function to compare 2 items in the list</short>
</element>
<!-- property Visibility: public -->
<element name="TFPSList.Capacity">
<short>Current capacity of the list</short>
<descr>
<var>Capacity</var> is the current capacity (maximum amount of elements) of the list.
The list capacity will expand automatically if an item is added and the capacity is reached
(i.e. <link id="TFPSList.Count"/> equals <var>capacity</var>. Expanding the
list is an expensive operation involving reallocation of memory and moving of list data in memory,
so capacity can be set to a large amount to avoid frequent reallocations.
</descr>
<seealso>
<link id="TFPSList.Count"/>
<link id="TFPSList.Expand"/>
<link id="TFPSList.Items"/>
</seealso>
</element>
<!-- property Visibility: public -->
<element name="TFPSList.Count">
<short>Current element count</short>
<descr>
<var>Count</var> is the current amount of elements in the list. It is
initially zero. A valid item index is always a value between zero and
<var>Count-1</var>.
</descr>
<seealso>
<link id="TFPSList.Items"/>
<link id="TFPSList.Capacity"/>
</seealso>
</element>
<!-- property Visibility: public -->
<element name="TFPSList.Items">
<short>Items in the list</short>
<descr>
<p>
<var>Items</var> provides indexed access to the items in the list, the
returned pointers are not the actual list items, but pointers to the
elements in the list. The items can be get or set.
</p>
<p>
When assigning to the <var>Items</var> property, the memory area
pointed to by the assigned pointer is copied to the list.
Exactly <link id="TFPSList.ItemSize"/> bytes are copied.
</p>
<p>
The index <var>Index</var> is zero based, and has a maximum value of <link
id="TFPSList.Count">Count-1</link>.
</p>
</descr>
<errors>
If an invalid index is used, an <link id="EListError"/> exception is raised.
</errors>
<seealso>
<link id="TFPSList.ItemSize"/>
<link id="TFPSList.Count"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TFPSList.Items.Index">
<short>Index of item to retrieve or set</short>
</element>
<!-- property Visibility: public -->
<element name="TFPSList.ItemSize">
<short>Size of the items in the list</short>
<descr>
<var>ItemSize</var> is the memory size of the items in the list. It is specified in
the constructor and cannot be changed during the lifetime of the list.
</descr>
<seealso>
<link id="TFPSList.Create"/>
</seealso>
</element>
<!-- property Visibility: public -->
<element name="TFPSList.List">
<short>Internal list pointer</short>
<descr>
<var>List</var> is a pointer to the memory area used for the items in the list.
It should not be manipulated.
</descr>
<seealso>
</seealso>
</element>
<!-- property Visibility: public -->
<element name="TFPSList.First">
<short>Pointer to first non-empty item in the list</short>
<descr>
<p>
<var>First</var> returns the value of the first non-empty item in the list.
An item is considered empty if consists of <link id="TFPSList.ItemSize"/>
zero bytes.
</p>
<p>
If there are no non-empty items in the list, then <var>Nil</var> is returned.
</p>
</descr>
<seealso>
<link id="TFPSList.Last"/>
<link id="TFPSList.Pack"/>
</seealso>
</element>
<!-- property Visibility: public -->
<element name="TFPSList.Last">
<short>Pointer to last non-empty item in the list</short>
<descr>
<p>
<var>Last</var> returns the value of the last non-empty item in the list.
An item is considered empty if consists of <link id="TFPSList.ItemSize"/>
zero bytes.
</p>
<p>If there are no non-empty items in the list, then <var>Nil</var> is
returned.
</p>
</descr>
<seealso>
<link id="TFPSList.Last"/>
<link id="TFPSList.Pack"/>
</seealso>
</element>
<!-- constant Visibility: default -->
<element name="MaxGListSize">
<short>TFPGList maximum list size</short>
<descr>
<var>MaxGListSize</var> is the maximum number of elements in the <link
id="TFPGList"/> list.
</descr>
<seealso>
<link id="TFPGList"/>
</seealso>
</element>
<!-- generic class Visibility: default -->
<element name="TFPGListEnumerator">
<short>Generic list enumerator</short>
<descr>
<p>
<var>TFPGListEnumerator</var> is a generic list enumerator. It is used in
the <link id="TFPGList"/> class to implement the enumerator for the list.
</p>
<p>
Normally there should be no need to instantiate or use this class directly.
</p>
</descr>
<seealso>
<link id="TFPGList"/>
</seealso>
</element>
<!-- generic element Visibility: default -->
<element name="TFPGListEnumerator.T">
<short>Enumerator Type template</short>
<descr>
<var>T</var> is the type of the element returned by the enumerator.
</descr>
</element>
<!-- constructor Visibility: public -->
<element name="TFPGListEnumerator.Create">
<short>Create a new list enumerator</short>
<descr>
<var>Create</var> is called by the list <var>AList</var> to initialize a new
enumerator. There should be no need to call this directly.
</descr>
<seealso>
<link id="TFPGList"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TFPGListEnumerator.Create.AList">
<short>List to be enumerated</short>
</element>
<!-- function Visibility: public -->
<element name="TFPGListEnumerator.MoveNext">
<short>Move to next element in the list</short>
<descr>
<var>MoveNext</var> moves to the next element in the list.
</descr>
<seealso>
<link id="TFPGListEnumerator.Current"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TFPGListEnumerator.MoveNext.Result">
<short>True if the enumerator successfully selected the next element</short>
</element>
<!-- property Visibility: public -->
<element name="TFPGListEnumerator.Current">
<short>Current enumerated element</short>
<descr>
<var>Current</var> returns the currently enumerated element. It is only valid
after <link id="TFPGListEnumerator.MoveNext"/> was called and returned
<var>True</var>.
</descr>
<seealso>
<link id="TFPGListEnumerator.MoveNext"/>
</seealso>
</element>
<!-- generic class Visibility: default -->
<element name="TFPGList">
<short>Generic list</short>
<descr>
<var>TFPGList</var> can be used to specialize a list for any type <var>T</var>
that does not require reference counting (such as interfaced objects). It
will specialize to a list with the same methods as <link id="TFPSList"/> or <link
id="classes.TFPList"/>
</descr>
<seealso>
<link id="TFPSList"/>
<link id="classes.TFPList"/>
</seealso>
</element>
<!-- generic element Visibility: default -->
<element name="TFPGList.T">
<short>Type to specialize the list with</short>
</element>
<!-- function result Visibility: default -->
<element name="TFPGList.TCompareFunc.Result">
<short>Generic compare function for 2 elements in the list</short>
</element>
<!-- argument Visibility: default -->
<element name="TFPGList.TCompareFunc.Item1">
<short>Item 1 in comparison</short>
</element>
<!-- argument Visibility: default -->
<element name="TFPGList.TCompareFunc.Item2">
<short>Item 2 in comparison</short>
</element>
<!-- generic element Visibility: default -->
<element name="TFPGList.TFPGListEnumeratorSpec.T">
<short>Enumerator for template type</short>
</element>
<!-- constructor Visibility: public -->
<element name="TFPGList.Create">
<short>Instantiate a new list</short>
<descr>
<var>Create</var> instantiates a new list. It will simply call the inherited
constructor with the correct item size: <var>sizeof(T)</var>.
</descr>
</element>
<!-- function Visibility: public -->
<element name="TFPGList.Add">
<short>Add new item of type <var>T</var> to the list.</short>
<descr>
<var>Add</var> adds a new item <var>Item</var> of generic type <var>T</var>
to the list and returns the position at which the item was added.
</descr>
<errors>
If the item could not be added, an <link id="EListError"/> exception is raised.
</errors>
<seealso>
<link id="TFPGList.Extract"/>
<link id="TFPGList.Items"/>
<link id="TFPGList.IndexOf"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TFPGList.Add.Result">
<short>Index at which item was added.</short>
</element>
<!-- argument Visibility: public -->
<element name="TFPGList.Add.Item">
<short>Item to add to the list.</short>
</element>
<!-- function Visibility: public -->
<element name="TFPGList.Extract">
<short>Extract an item from the list</short>
<descr>
<var>Extract</var> removes <var>Item</var> from the list and returns the
removed item, or an expression equivalent to <var>T(0)</var> if it was not found.
</descr>
<errors>
None.
</errors>
<seealso>
<link id="TFPSList.Delete"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TFPGList.Extract.Result">
<short>The extracted item</short>
</element>
<!-- argument Visibility: public -->
<element name="TFPGList.Extract.Item">
<short>Item to extract</short>
</element>
<!-- property Visibility: public -->
<element name="TFPGList.First">
<short>First non-empty item</short>
<descr>
<var>First</var> returns the first non-empty item, which means the first
item not equal to <var>T(0)</var>. If no such element is present,
<var>T(0)</var>. is returned.
</descr>
<seealso>
<link id="TFPSList.First"/>
<link id="TFPGList.Last"/>
</seealso>
</element>
<!-- function Visibility: public -->
<element name="TFPGList.GetEnumerator">
<short>Return a list enumerator for <var>T</var>.</short>
<descr>
<var>GetEnumerator</var> returns an enumerator for the elements in the list.
It is a specialized version of <link id="TFPGListEnumerator"/>.
</descr>
<seealso>
<link id="TFPGListEnumerator"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TFPGList.GetEnumerator.Result">
<short>A new enumerator</short>
</element>
<!-- function Visibility: public -->
<element name="TFPGList.IndexOf">
<short>Index of item</short>
<descr>
<var>IndexOf</var> returns the index of <var>Item</var> in the list, or -1
if the item does not appear in the list.
</descr>
<errors>
None.
</errors>
<seealso>
<link id="TFPGList.Items"/>
<link id="TFPGList.Insert"/>
<link id="TFPSList.Add"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TFPGList.IndexOf.Result">
<short>Index of <var>Item</var> in the list or -1 if it is not in the list.</short>
</element>
<!-- argument Visibility: public -->
<element name="TFPGList.IndexOf.Item">
<short>Item to search in the list.</short>
</element>
<!-- procedure Visibility: public -->
<element name="TFPGList.Insert">
<short>Insert a new item in the list</short>
<descr>
<var>Insert</var> inserts a new <var>item</var> in the list at position
<var>Index</var>. The index is zero based and must be less than <link
id="TFPSList.Count">Count</link>.
</descr>
<errors>
If an invalid index is specified, an <link id="EListError"/> exception is raised.
</errors>
<seealso>
<link id="TFPGList.Items"/>
<link id="TFPGList.Insert"/>
<link id="TFPSList.Add"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TFPGList.Insert.Index">
<short>Position to insert <var>item</var> at</short>
</element>
<!-- argument Visibility: public -->
<element name="TFPGList.Insert.Item">
<short>Item to insert in the list</short>
</element>
<!-- property Visibility: public -->
<element name="TFPGList.Last">
<short>Last non-empty item</short>
<descr>
<var>Last</var> returns the last non-empty item, which means the last
item not equal to <var>T(0)</var>. If no such element is present,
<var>T(0)</var>. is returned.
</descr>
<seealso>
<link id="TFPGList.First"/>
<link id="TFPSList.Last"/>
</seealso>
</element>
<!-- procedure Visibility: public -->
<element name="TFPGList.Assign">
<short>Copy elements from Source list</short>
<descr>
<var>Assign</var> clears the list and copies all items in <var>Source</var> to the list.
The source list must be of the same type as the destination list.
</descr>
<seealso>
<link id="TFPSList.Clear"/>
<link id="TFPGList.Add"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TFPGList.Assign.Source">
<short>Source list to copy items from.</short>
</element>
<!-- function Visibility: public -->
<element name="TFPGList.Remove">
<short>Remove an item from the list.</short>
<descr>
<var>Remove</var> removes the item <var>Item</var> from the list, and
returns the index of the removed item. If no item was removed, <var>-1</var> is
returned. Only the first item is removed.
</descr>
<errors>
None.
</errors>
<seealso>
<link id="TFPGList.IndexOf"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TFPGList.Remove.Result">
<short>Index of the removed item.</short>
</element>
<!-- argument Visibility: public -->
<element name="TFPGList.Remove.Item">
<short>Item to remove from the list.</short>
</element>
<!-- procedure Visibility: public -->
<element name="TFPGList.Sort">
<short>Sort the list</short>
<descr>
<p>
<var>Sort</var> sorts the elements in the list using the provided <var>Compare</var> function.
The list passes 2 items to the compare function. The result of this function determines how the
items will be sorted:
</p>
<ul>
<li>If the result of this function is negative, the first item (<var>Item1</var>) is
assumed to be 'less' than the second item (<var>Item2</var>) and will be moved before the second
in the list.
</li>
<li>If the function result is positive, the first item (<var>Item1</var>) is assumed to
be 'greater than' the second item (<var>Item2</var>)and will be moved after the second in the
list.
</li>
<li>if the function result is zero, the items are assumed to be 'equal'
and no moving will take place.
</li>
</ul>
</descr>
</element>
<!-- argument Visibility: public -->
<element name="TFPGList.Sort.Compare">
<short>Compare function for 2 items</short>
</element>
<!-- property Visibility: public -->
<element name="TFPGList.Items">
<short>Indexed access to items in the list</short>
<descr>
<p>
<var>Items</var> provides indexed access to the items in the list.
The items can be get or set.
</p>
<p>
The index <var>Index</var> is zero based, and has a maximum value of <link
id="TFPSList.Count">Count-1</link>.
</p>
</descr>
<errors>
If an invalid index is used, an <link id="EListError"/> exception is raised.
</errors>
<seealso>
<link id="TFPSList.Count"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TFPGList.Items.Index">
<short>Index of item to get or set</short>
</element>
<!-- property Visibility: public -->
<element name="TFPGList.List">
<short>Internal list object</short>
<descr>
<var>List</var> is the internal list of items. It should not be used directly.
</descr>
<seealso>
<link id="TFPGList.Items"/>
</seealso>
</element>
<!-- generic class Visibility: default -->
<element name="TFPGObjectList">
<short>Generic object list</short>
<descr>
<var>TFPGList</var> can be used to specialize a list for any class type <var>T</var>
that does not require reference counting (such as interfaced objects).
It will specialize to a list with the same methods as <link id="TFPSList"/> or
<link id="classes.TFPList"/> or <var>TFPObjectList</var>
</descr>
<seealso>
<link id="TFPSList"/>
<link id="classes.TFPList"/>
</seealso>
</element>
<!-- generic element Visibility: default -->
<element name="TFPGObjectList.T">
<short>Class type to specialize the list with</short>
</element>
<!-- function result Visibility: default -->
<element name="TFPGObjectList.TCompareFunc.Result">
<short>Generic compare function for 2 objects in the list</short>
</element>
<!-- argument Visibility: default -->
<element name="TFPGObjectList.TCompareFunc.Item1">
<short>Item 1 in comparison</short>
</element>
<!-- argument Visibility: default -->
<element name="TFPGObjectList.TCompareFunc.Item2">
<short>Item 2 in comparison</short>
</element>
<!-- generic element Visibility: default -->
<element name="TFPGObjectList.TFPGListEnumeratorSpec.T">
<short>Enumerator for template type</short>
</element>
<!-- constructor Visibility: public -->
<element name="TFPGObjectList.Create">
<short>Instantiate a new object list.</short>
<descr>
<p>
<var>Create</var> instantiates a new object list. It will simply call the inherited
constructor with the correct item size and will initialize <link
id="TFPGObjectList.FreeObjects"/> with <var>FreeObjects</var>.
</p>
<p>
If <var>FreeObjects</var> is true, then the list owns the objects. Freeing
or clearing the list will remove all objects from memory by calling the
destructor. Deleting or removing an item from the list will also dispose of
the element.
</p>
</descr>
<seealso>
<link id="TFPGObjectList.FreeObjects"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TFPGObjectList.Create.FreeObjects">
<short>When <var>True</var> the list owns the objects.</short>
</element>
<!-- function Visibility: public -->
<element name="TFPGObjectList.Add">
<short>Add new object of class <var>T</var> to the list.</short>
<descr>
<var>Add</var> adds a new item <var>Item</var> of class type <var>T</var>
to the list and returns the position at which the item was added.
</descr>
<errors>
If the item could not be added, an <link id="EListError"/> exception is
raised.
</errors>
<seealso>
<link id="TFPGObjectList.Extract"/>
<link id="TFPGObjectList.Items"/>
<link id="TFPGObjectList.IndexOf"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TFPGObjectList.Add.Result">
<short>Index at which item was added.</short>
</element>
<!-- argument Visibility: public -->
<element name="TFPGObjectList.Add.Item">
<short>Item to add to the list.</short>
</element>
<!-- function Visibility: public -->
<element name="TFPGObjectList.Extract">
<short>Extract an item from the list</short>
<descr>
<p>
<var>Extract</var> removes <var>Item</var> from the list and returns the
removed item, or <var>Nil</var> if it was not found.
</p>
<p>
The extracted object will not be destroyed even if the list owns the
objects.
</p>
</descr>
<errors>
None.
</errors>
<seealso>
<link id="TFPSList.Delete"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TFPGObjectList.Extract.Result">
<short>The actually removed item, or <var>Nil</var></short>
</element>
<!-- argument Visibility: public -->
<element name="TFPGObjectList.Extract.Item">
<short>The extracted item</short>
</element>
<!-- property Visibility: public -->
<element name="TFPGObjectList.First">
<short>First non-nil item</short>
<descr>
<var>First</var> returns the first non-nil item.
If no such element is present, <var>Nil</var> is returned.
</descr>
<seealso>
<link id="TFPSList.First"/>
<link id="TFPGList.Last"/>
<link id="TFPSList.Pack"/>
</seealso>
</element>
<!-- function Visibility: public -->
<element name="TFPGObjectList.GetEnumerator">
<short>Return a list enumerator for <var>T</var>.</short>
<descr>
<var>GetEnumerator</var> returns an enumerator for the elements in the list.
It is a specialized version of <link id="TFPGListEnumerator"/>.
</descr>
<seealso>
<link id="TFPGListEnumerator"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TFPGObjectList.GetEnumerator.Result">
<short>A new enumerator</short>
</element>
<!-- function Visibility: public -->
<element name="TFPGObjectList.IndexOf">
<short>Index of item</short>
<descr>
<var>IndexOf</var> returns the index of <var>Item</var> in the list, or -1
if the item does not appear in the list.
</descr>
<errors>
None.
</errors>
<seealso>
<link id="TFPGObjectList.Items"/>
<link id="TFPGObjectList.Insert"/>
<link id="TFPGObjectList.Add"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TFPGObjectList.IndexOf.Result">
<short>Index of <var>Item</var> in the list or -1 if it is not in the list.</short>
</element>
<!-- argument Visibility: public -->
<element name="TFPGObjectList.IndexOf.Item">
<short>Item to search in the list.</short>
</element>
<!-- procedure Visibility: public -->
<element name="TFPGObjectList.Insert">
<short>Insert a new object in the list</short>
<descr>
<var>Insert</var> inserts a new object (<var>Item</var>) in the list at position
<var>Index</var>. The index is zero based and must be less than <link
id="TFPSList.Count">Count</link>.
</descr>
<errors>
If an invalid index is specified, an <link id="EListError"/> exception is
raised.
</errors>
<seealso>
<link id="TFPGList.Items"/>
<link id="TFPGList.Insert"/>
<link id="TFPSList.Add"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TFPGObjectList.Insert.Index">
<short>Position to insert <var>Item</var> at</short>
</element>
<!-- argument Visibility: public -->
<element name="TFPGObjectList.Insert.Item">
<short>Object to insert in the list</short>
</element>
<!-- property Visibility: public -->
<element name="TFPGObjectList.Last">
<short>Last non-<var>Nil</var> object</short>
<descr>
<var>Last</var> returns the last non-<var>Nil</var> object.
If no such element is present, <var>Nil</var>. is returned.
</descr>
<seealso>
<link id="TFPGObjectList.First"/>
<link id="TFPSList.Last"/>
</seealso>
</element>
<!-- procedure Visibility: public -->
<element name="TFPGObjectList.Assign">
<short>Copy objects from Source list</short>
<descr>
<p>
<var>Assign</var> clears the list and copies all items in <var>Source</var>
to the list. The source list must be of the same type as the destination list.
</p>
<p>
Take care if both the list owns the objects (i.e. have <link id="TFPGObjectList.FreeObjects"/> set to
<var>True</var>), this may result to access violations.
</p>
</descr>
<seealso>
<link id="TFPSList.Clear"/>
<link id="TFPGObjectList.Add"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TFPGObjectList.Assign.Source">
<short>Source list to copy items from.</short>
</element>
<!-- function Visibility: public -->
<element name="TFPGObjectList.Remove">
<short>Remove an object from the list.</short>
<descr>
<p>
<var>Remove</var> removes the object <var>Item</var> from the list, and
returns the index of the removed item. If no item was removed, <var>-1</var>
is returned. Only the first object is removed.
</p>
<p>
If the list owns the objects, (<link id="TFPGObjectList.FreeObjects"/> is set to <var>True</var>) then the object is freed.
</p>
</descr>
<errors>
None.
</errors>
<seealso>
<link id="TFPGObjectList.IndexOf"/>
<link id="TFPSList.Delete"/>
<link id="TFPGObjectList.FreeObjects"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TFPGObjectList.Remove.Result">
<short>Index of removed object, prior to removal.</short>
</element>
<!-- argument Visibility: public -->
<element name="TFPGObjectList.Remove.Item">
<short>Object to remove from the list.</short>
</element>
<!-- procedure Visibility: public -->
<element name="TFPGObjectList.Sort">
<short>Sort the objects in the list</short>
<descr>
<p>
<var>Sort</var> sorts the elements in the list using the provided
<var>Compare</var> function.
The list passes 2 items to the compare function. The result of this function
determines how the
items will be sorted:
</p>
<ul>
<li>If the result of this function is negative, the first object (<var>Item1</var>) is
assumed to be 'less' than the second object (<var>Item2</var>) and will be
moved before the second
in the list.
</li>
<li>If the function result is positive, the first object (<var>Item1</var>) is
assumed to
be 'greater than' the second object (<var>Item2</var>)and will be moved after
the second in the
list.
</li>
<li>if the function result is zero, the objects are assumed to be 'equal'
and no moving will take place.
</li>
</ul>
</descr>
<errors>
None.
</errors>
</element>
<!-- argument Visibility: public -->
<element name="TFPGObjectList.Sort.Compare">
<short>Compare function for 2 objects</short>
</element>
<!-- property Visibility: public -->
<element name="TFPGObjectList.Items">
<short>Indexed access to objects in the list.</short>
<descr>
<p>
<var>Items</var> provides indexed access to the objects in the list.
The objects can be get or set.
</p>
<p>
The index <var>Index</var> is zero based, and has a maximum value of <link
id="TFPSList.Count">Count-1</link>.
</p>
<p>
If the list owns the objects, (<link id="TFPGObjectList.FreeObjects"/> is
set to <var>True</var>) then the previous object at position
<var>Index</var> is freed when setting the property.
</p>
</descr>
<errors>
If an invalid index is used, an <link id="EListError"/> exception is raised.
</errors>
<seealso>
<link id="TFPSList.Count"/>
<link id="TFPGObjectList.FreeObjects"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TFPGObjectList.Items.Index">
<short>Index of object to get or set</short>
</element>
<!-- property Visibility: public -->
<element name="TFPGObjectList.List">
<short>Internal list pointer</short>
<descr>
<var>List</var> is the internal list of objects. It should not be used directly.
</descr>
<seealso>
<link id="TFPGObjectList.Items"/>
</seealso>
</element>
<!-- property Visibility: public -->
<element name="TFPGObjectList.FreeObjects">
<short>Does the list own the objects or not?</short>
<descr>
<p>
<var>FreeObjects</var> indicates whether the list owns the objects or not.
If set to <var>True</var>, freeing or clearing the list will remove all
objects from memory by calling the destructor. Deleting or removing an
item from the list will also dispose of the element.
</p>
<p>
The initial value for this property is set in the constructor and is
<var>True</var> by default.
</p>
</descr>
<seealso>
<link id="TFPGObjectList.FreeObjects"/>
</seealso>
</element>
<!-- generic class Visibility: default -->
<element name="TFPGInterfacedObjectList">
<short>Generic interfaced object list</short>
<descr>
<p>
<var>TFPGList</var> can be used to specialize a list for any class type <var>T</var>
that requires reference counting (all objects that implement <var>IInterface</var> or <var>IUnknown</var>)).
It will specialize to a list with the same methods as <link id="TFPSList"/> or
<link id="classes.TFPList"/> or <var>TFPObjectList</var>
</p>
<p>
Classes that implement <var>IInterface</var> or <var>IUnknown</var> require
special care to maintain the reference count. The <var>TFPGInterfacedObjectList</var>
list provides the necessary functionality to deal with this.
</p>
</descr>
<seealso>
<link id="TFPSList"/>
<link id="classes.TFPList"/>
</seealso>
</element>
<!-- generic element Visibility: default -->
<element name="TFPGInterfacedObjectList.T">
<short>Interfaced class type</short>
</element>
<!-- function result Visibility: default -->
<element name="TFPGInterfacedObjectList.TCompareFunc.Result">
<short>Generic compare function for 2 objects in the list</short>
</element>
<!-- argument Visibility: default -->
<element name="TFPGInterfacedObjectList.TCompareFunc.Item1">
<short>Object 1 in comparison</short>
</element>
<!-- argument Visibility: default -->
<element name="TFPGInterfacedObjectList.TCompareFunc.Item2">
<short>Object 2 in comparison</short>
</element>
<!-- generic element Visibility: default -->
<element name="TFPGInterfacedObjectList.TFPGListEnumeratorSpec.T">
<short>Enumerator for template type</short>
</element>
<!-- constructor Visibility: public -->
<element name="TFPGInterfacedObjectList.Create">
<short>Instantiate a new interfaced object list.</short>
<descr>
<p>
<var>Create</var> instantiates a new object list. It will simply call the
inherited constructor with the correct item size.
</p>
</descr>
<seealso>
<link id="TFPSList.Destroy"/>
</seealso>
</element>
<!-- function Visibility: public -->
<element name="TFPGInterfacedObjectList.Add">
<short>Add new object of class <var>T</var> to the list.</short>
<descr>
<var>Add</var> adds a new item <var>Item</var> of class type <var>T</var>
to the list and returns the position at which the item was added. Add will
increase the reference count of the object.
</descr>
<errors>
If the item could not be added, an <link id="EListError"/> exception is
raised.
</errors>
<seealso>
<link id="TFPGInterfacedObjectList.Extract"/>
<link id="TFPGInterfacedObjectList.Items"/>
<link id="TFPGInterfacedObjectList.IndexOf"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TFPGInterfacedObjectList.Add.Result">
<short>Index at which the object was added.</short>
</element>
<!-- argument Visibility: public -->
<element name="TFPGInterfacedObjectList.Add.Item">
<short>Interfaced object to add to the list.</short>
</element>
<!-- function Visibility: public -->
<element name="TFPGInterfacedObjectList.Extract">
<short>Extract an item from the list</short>
<descr>
<p>
<var>Extract</var> removes <var>Item</var> from the list and returns the
removed item, or <var>Nil</var> if it was not found.
</p>
<p>
The extracted object will not be destroyed.
</p>
</descr>
<errors>
None.
</errors>
<seealso>
<link id="TFPSList.Delete"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TFPGInterfacedObjectList.Extract.Result">
<short>The actually removed object, or <var>Nil</var></short>
</element>
<!-- argument Visibility: public -->
<element name="TFPGInterfacedObjectList.Extract.Item">
<short>The extracted object</short>
</element>
<!-- property Visibility: public -->
<element name="TFPGInterfacedObjectList.First">
<short>First non-nil object</short>
<descr>
<var>First</var> returns the first non-nil object.
If no such element is present, <var>Nil</var> is returned.
</descr>
<seealso>
<link id="TFPSList.First"/>
<link id="TFPGInterfacedObjectList.Last"/>
<link id="TFPSList.Pack"/>
</seealso>
</element>
<!-- function Visibility: public -->
<element name="TFPGInterfacedObjectList.GetEnumerator">
<short>Return a list enumerator for <var>T</var></short>
<descr>
<var>GetEnumerator</var> returns an enumerator for the elements in the list.
It is a specialized version of <link id="TFPGListEnumerator"/>.
</descr>
<seealso>
<link id="TFPGListEnumerator"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TFPGInterfacedObjectList.GetEnumerator.Result">
<short>A new enumerator</short>
</element>
<!-- function Visibility: public -->
<element name="TFPGInterfacedObjectList.IndexOf">
<short>Index of object</short>
<descr>
<var>IndexOf</var> returns the index of <var>Item</var> in the list, or -1
if the object does not appear in the list.
</descr>
<errors>
None.
</errors>
<seealso>
<link id="TFPGInterfacedObjectList.Items"/>
<link id="TFPGInterfacedObjectList.Insert"/>
<link id="TFPGInterfacedObjectList.Add"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TFPGInterfacedObjectList.IndexOf.Result">
<short>Index of <var>Item</var> in the list or -1 if it is not in the list.</short>
</element>
<!-- argument Visibility: public -->
<element name="TFPGInterfacedObjectList.IndexOf.Item">
<short>Item to search in the list.</short>
</element>
<!-- procedure Visibility: public -->
<element name="TFPGInterfacedObjectList.Insert">
<short>Insert a new object in the list</short>
<descr>
<var>Insert</var> inserts a new object (<var>Item</var>) in the list at
position
<var>Index</var>. The index is zero based and must be less than <link
id="TFPSList.Count">Count</link>.
</descr>
<errors>
If an invalid index is specified, an <link id="EListError"/> exception is
raised.
</errors>
<seealso>
<link id="TFPGInterfacedObjectList.Items"/>
<link id="TFPGInterfacedObjectList.Add"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TFPGInterfacedObjectList.Insert.Index">
<short>Position to insert <var>Item</var> at</short>
</element>
<!-- argument Visibility: public -->
<element name="TFPGInterfacedObjectList.Insert.Item">
<short>Interfaced Object to insert in the list</short>
</element>
<!-- property Visibility: public -->
<element name="TFPGInterfacedObjectList.Last">
<short>Last non-<var>Nil</var> object</short>
<descr>
<var>Last</var> returns the last non-<var>Nil</var> object.
If no such element is present, <var>Nil</var> is returned.
</descr>
<seealso>
<link id="TFPGInterfacedObjectList.First"/>
<link id="TFPSList.Last"/>
</seealso>
</element>
<!-- procedure Visibility: public -->
<element name="TFPGInterfacedObjectList.Assign">
<short>Copy objects from Source list</short>
<descr>
<p>
<var>Assign</var> clears the list and copies all items in <var>Source</var>
to the list. The source list must be of the same type as the destination list.
</p>
</descr>
<seealso>
<link id="TFPSList.Clear"/>
<link id="TFPGObjectList.Add"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TFPGInterfacedObjectList.Assign.Source">
<short>Source list to copy items from.</short>
</element>
<!-- function Visibility: public -->
<element name="TFPGInterfacedObjectList.Remove">
<short>Remove an object from the list.</short>
<descr>
<p>
<var>Remove</var> removes the object <var>Item</var> from the list, and
returns the index of the removed item. If no item was removed, <var>-1</var>
is returned. Only the first object is removed.
</p>
<p>
Removing an object from the list may cause the object to be freed.
</p>
</descr>
<errors>
None.
</errors>
<seealso>
<link id="TFPGInterfacedObjectList.IndexOf"/>
<link id="TFPSList.Delete"/>
<link id="TFPGInterfacedObjectList.FreeObjects"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TFPGInterfacedObjectList.Remove.Result">
<short>Index of removed object, prior to removal.</short>
</element>
<!-- argument Visibility: public -->
<element name="TFPGInterfacedObjectList.Remove.Item">
<short>Object to remove from the list</short>
</element>
<!-- procedure Visibility: public -->
<element name="TFPGInterfacedObjectList.Sort">
<short>Sort the objects in the list</short>
<descr>
<p>
<var>Sort</var> sorts the elements in the list using the provided
<var>Compare</var> function. The list passes 2 items to the compare function.
The result of this function determines how the items will be sorted:
</p>
<ul>
<li>If the result of this function is negative, the first object (<var>Item1</var>) is
assumed to be 'less' than the second object (<var>Item2</var>) and will be moved before the second in the list.
</li>
<li>If the function result is positive, the first object (<var>Item1</var>) is assumed to
be 'greater than' the second object (<var>Item2</var>)and will be moved after the second in the list.
</li>
<li>if the function result is zero, the objects are assumed to be 'equal' and no moving will take place.
</li>
</ul>
</descr>
<errors>
None.
</errors>
<seealso>
<link id="TFPSList.Sorted"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TFPGInterfacedObjectList.Sort.Compare">
<short>Compare function for 2 objects</short>
</element>
<!-- property Visibility: public -->
<element name="TFPGInterfacedObjectList.Items">
<short>Indexed access to objects in the list.</short>
<descr>
<p>
<var>Items</var> provides indexed access to the objects in the list.
The objects can be get or set.
</p>
<p>
The index <var>Index</var> is zero based, and has a maximum value of <link
id="TFPSList.Count">Count-1</link>.
</p>
<p>
The previous object at position <var>Index</var> may be freed when setting the
property, depending on its reference count.
</p>
</descr>
<errors>
If an invalid index is used, an <link id="EListError"/> exception is raised.
</errors>
<seealso>
<link id="TFPSList.Count"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TFPGInterfacedObjectList.Items.Index">
<short>Index of object to get or set</short>
</element>
<!-- property Visibility: public -->
<element name="TFPGInterfacedObjectList.List">
<short>Internal list pointer</short>
<descr>
<var>List</var> is the internal list of objects. It should not be used directly.
</descr>
<seealso>
<link id="TFPGInterfacedObjectList.Items"/>
</seealso>
</element>
<!-- class Visibility: default -->
<element name="TFPSMap">
<short>Basic map object, used in generic maps</short>
<descr>
<p>
<var>TFPSMap</var> can be used to create a map for any type <var>T</var>
that does not require reference counting (such as interfaced objects).
It will specialize to a map which is a generalized list with an arbitrary
type as the list index (called the key).
</p>
<p>
This class should normally not be used directly, instead use one of the generic map
objects such as <link id="TFPGMap"/>.
</p>
</descr>
<seealso>
<link id="TFPGMap"/>
</seealso>
</element>
<!-- constructor Visibility: public -->
<element name="TFPSMap.Create">
<short>Create a new map with given key and data size.</short>
<descr>
<var>Create</var> instantiates a new <var>TFPSMap</var> instance and
initializes <link id="TFPSMap.KeySize"/> and <link id="TFPSMap.DataSize"/>
with <var>AKeySize</var> and <var>ADataSize</var>, respectively.
It also initializes the <link id="TFPSMap.OnDataPtrCompare"/> and <link
id="TFPSMap.OnKeyPtrCompare"/> properties to functions that compare memory
blocks.
</descr>
<errors>
None.
</errors>
<seealso>
<link id="TFPSMap.Destroy"/>
<link id="TFPSMap.KeySize"/>
<link id="TFPSMap.DataSize"/>
<link id="TFPSMap.OnDataPtrCompare"/>
<link id="TFPSMap.OnKeyPtrCompare"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TFPSMap.Create.AKeySize">
<short>Size for map keys</short>
</element>
<!-- argument Visibility: public -->
<element name="TFPSMap.Create.ADataSize">
<short>Size for map data</short>
</element>
<!-- function Visibility: public -->
<element name="TFPSMap.Add">
<short>Add a key, value pair to the map.</short>
<descr>
<var>Add</var> adds the memory pointed to by <var>AData</var> to the map using
the memory pointed to by <var>AKey</var> as the key. If no data is
specified, it allocates a slot for <var>AKey</var> and returns a pointer to
that slot.
</descr>
<errors>
If the maximum amount of values is reached, <var>Add</var> will raise an
<link id="EListError"/> exception.
</errors>
<seealso>
<link id="TFPSMap.Insert"/>
<link id="TFPSMap.IndexOf"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TFPSMap.Add.Result">
<short>Slot in the list for the key and data.</short>
</element>
<!-- argument Visibility: public -->
<element name="TFPSMap.Add.AKey">
<short>Pointer to key to add to list</short>
</element>
<!-- argument Visibility: public -->
<element name="TFPSMap.Add.AData">
<short>Pointer to data to add to list</short>
</element>
<!-- function Visibility: public -->
<element name="TFPSMap.Find">
<short>Find data using the associated key</short>
<descr>
<p>
<var>Find</var> searches for the first key less than or equal to <var>AKey</var> and
returns its index in the list in <var>Index</var>. It returns <var>True</var> if an exact match for the key was found.
It returns <var>False</var> if the key was not found, and <var>Index</var> is then set to <var>-1</var>
</p>
<p>
This function performs a binary search using the key comparing function
specified in <link id="TFPSMap.OnKeyPtrCompare">OnKeyPtrCompare</link>.
</p>
</descr>
<errors>
if <var>OnKeyPtrCompare</var> is not set, an access violation will occur.
</errors>
<seealso>
<link id="TFPSMap.OnKeyPtrCompare"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TFPSMap.Find.Result">
<short>True if an exact match was found</short>
</element>
<!-- argument Visibility: public -->
<element name="TFPSMap.Find.AKey">
<short>Key to search for</short>
</element>
<!-- argument Visibility: public -->
<element name="TFPSMap.Find.Index">
<short>Index of first key smaller than <var>Akey</var></short>
</element>
<!-- function Visibility: public -->
<element name="TFPSMap.IndexOf">
<short>Index of key pointed to by <var>AKey</var></short>
<descr>
<p>
<var>IndexOf</var> returns the index of the element with a key pointed to by
<var>AKey</var>. It returns -1 if the key was not found.
</p>
<p>
If the list is sorted, then a binary search is performed, otherwise a linear search is used to find the key.
</p>
</descr>
<errors>
None.
</errors>
<seealso>
<link id="TFPSMap.Find"/>
<link id="TFPSMap.IndexOfData"/>
<link id="TFPSMap.Keys"/>
<link id="TFPSMap.Data"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TFPSMap.IndexOf.Result">
<short>Index of <var>AKey</var> or -1 if <var>AKey</var> was not found.</short>
</element>
<!-- argument Visibility: public -->
<element name="TFPSMap.IndexOf.AKey">
<short>key to search for</short>
</element>
<!-- function Visibility: public -->
<element name="TFPSMap.IndexOfData">
<short>Index of data item <var>AData</var></short>
<descr>
<var>IndexOfData</var> returns the index of the element with data pointed to
by <var>AData</var>. It returns -1 if the data item was not found.
The search is always performed using a linear search.
</descr>
<seealso>
<link id="TFPSMap.Find"/>
<link id="TFPSMap.IndexOf"/>
<link id="TFPSMap.Keys"/>
<link id="TFPSMap.Data"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TFPSMap.IndexOfData.Result">
<short>Index of <var>AData</var> in the <var>Data</var></short>
</element>
<!-- argument Visibility: public -->
<element name="TFPSMap.IndexOfData.AData">
<short>Data item to search for.</short>
</element>
<!-- function Visibility: public -->
<element name="TFPSMap.Insert">
<short>Insert a new slot for key and associated data item in the list</short>
<descr>
<var>Insert</var> will allocate a new slot in the list. It returns a pointer
to the new slot. If <var>Akey</var> and <var>AData</var> are given, then
they will point to the positions in the slot for the key and data items.
</descr>
<errors>
If the maximum amount of values is reached or an invalid index is specified,
<var>Insert</var> will raise an <link id="EListError"/> exception.
</errors>
<seealso>
<link id="TFPSMap.Add"/>
<link id="TFPSMap.InsertKey"/>
<link id="TFPSMap.InsertKeyData"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TFPSMap.Insert.Result">
<short>Slot to add data to</short>
</element>
<!-- argument Visibility: public -->
<element name="TFPSMap.Insert.Index">
<short>Index to insert new key, value pair</short>
</element>
<!-- argument Visibility: public -->
<element name="TFPSMap.Insert.AKey">
<short>Pointer to location for key value</short>
</element>
<!-- argument Visibility: public -->
<element name="TFPSMap.Insert.AData">
<short>Pointer to location for data value</short>
</element>
<!-- procedure Visibility: public -->
<element name="TFPSMap.InsertKey">
<short>Insert a key in the list</short>
<descr>
<var>InsertKey</var> will allocate a new slot in the list for a key value as
pointed to by <var>AKey</var>, and copy the key pointed to by <var>AKey</var> to the slot.
</descr>
<errors>
If the maximum amount of values is reached or an invalid index is specified,
<var>InsertKey</var> will raise an <link id="EListError"/> exception.
</errors>
<seealso>
<link id="TFPSMap.Add"/>
<link id="TFPSMap.Insert"/>
<link id="TFPSMap.InsertKeyData"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TFPSMap.InsertKey.Index">
<short>Index at which position key must be inserted</short>
</element>
<!-- argument Visibility: public -->
<element name="TFPSMap.InsertKey.AKey">
<short>Pointer to Key value to insert</short>
</element>
<!-- procedure Visibility: public -->
<element name="TFPSMap.InsertKeyData">
<short>Insert a key and associated in the list</short>
<descr>
<var>InsertKeyData</var> will allocate a new slot in the list for a key value as
pointed to by <var>AKey</var>, and copy the key pointed to by
<var>AKey</var> as well as the data pointed to by <var>AData</var> to the
newly allocated slot.
</descr>
<errors>
If the maximum amount of values is reached or an invalid index is specified,
<var>InsertKeyData</var> will raise an <link id="EListError"/> exception.
</errors>
<seealso>
<link id="TFPSMap.Add"/>
<link id="TFPSMap.Insert"/>
<link id="TFPSMap.InsertKey"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TFPSMap.InsertKeyData.Index">
<short>Index at which to insert key and value</short>
</element>
<!-- argument Visibility: public -->
<element name="TFPSMap.InsertKeyData.AKey">
<short>Pointer to key value</short>
</element>
<!-- argument Visibility: public -->
<element name="TFPSMap.InsertKeyData.AData">
<short>Pointer to data value</short>
</element>
<!-- function Visibility: public -->
<element name="TFPSMap.Remove">
<short>Remove a key/value pair from the map.</short>
<descr>
<var>Remove</var> removes the key/value pair pointing to by <var>AKey</var> from the map.
It returns the index of <var>Akey</var> prior to removal from the list.
If <var>AKey</var> was not found, -1 is returned.
</descr>
<errors>
None.
</errors>
<seealso>
<link id="TFPSList.Delete"/>
<link id="TFPSMap.IndexOf"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TFPSMap.Remove.Result">
<short>Index of <var>AKey</var> prior to removal, or -1 if not found.</short>
</element>
<!-- argument Visibility: public -->
<element name="TFPSMap.Remove.AKey">
<short>Key to remove from the map.</short>
</element>
<!-- procedure Visibility: public -->
<element name="TFPSMap.Sort">
<short>Sort the list according to key</short>
<descr>
<var>Sort</var> sorts the list according to the key value, using the
compare function provided in <link id="TFPSMap.OnKeyPtrCompare"/>
</descr>
<errors>
None.
</errors>
<seealso>
<link id="TFPSMap.OnKeyPtrCompare"/>
<link id="TFPSMap.OnDataPtrCompare"/>
</seealso>
</element>
<!-- property Visibility: public -->
<element name="TFPSMap.Duplicates">
<short>What to do with duplicate key values</short>
<descr>
<p>
<var>Duplicates</var> can be set to determine what to do with duplicate key
values in the map:
</p>
<dl>
<dt>dupIgnore</dt><dd><printshort id="types.TDuplicates.dupIgnore"/></dd>
<dt>dupAccept</dt><dd><printshort id="types.TDuplicates.dupAccept"/></dd>
<dt>dupError</dt><dd><printshort id="types.TDuplicates.dupError"/></dd>
</dl>
<p>
The value is ignored if <link id="TFPSMap.Sorted">Sorted</link> is <var>False</var>.
</p>
</descr>
<seealso>
<link id="TFPSMap.Sorted"/>
<link id="types.TDuplicates"/>
</seealso>
</element>
<!-- property Visibility: public -->
<element name="TFPSMap.KeySize">
<short>Size (in bytes) for the key</short>
<descr>
<var>KeySize</var> is the size (in bytes) for the keys in the map.
This size is initialized during list construction and defaults to the size
of a pointer.
</descr>
<seealso>
<link id="TFPSMap.Create"/>
<link id="TFPSMap.DataSize"/>
<link id="TFPSMap.Keys"/>
<link id="TFPSMap.KeyData"/>
</seealso>
</element>
<!-- property Visibility: public -->
<element name="TFPSMap.DataSize">
<short>Size (in bytes) for the data associated with keys</short>
<descr>
<var>DataSize</var> is the size (in bytes) for the data in the map.
This size is initialized during list construction and defaults to the size
of a pointer.
</descr>
<seealso>
<link id="TFPSMap.Create"/>
<link id="TFPSMap.KeySize"/>
<link id="TFPSMap.Keys"/>
<link id="TFPSMap.KeyData"/>
<link id="TFPSMap.Data"/>
</seealso>
</element>
<!-- property Visibility: public -->
<element name="TFPSMap.Keys">
<short>Indexed access to the locations of all keys</short>
<descr>
<var>Keys</var> provides indexed access to all keys. It does not return the
key, but returns a pointer to the key value. When setting the <var>Keys</var>
property, a pointer to the key value must be set, and the key value is copied from the
pointer.
</descr>
<seealso>
<link id="TFPSMap.KeySize"/>
<link id="TFPSMap.KeyData"/>
<link id="TFPSMap.Data"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TFPSMap.Keys.Index">
<short>Index of key location to get or set</short>
</element>
<!-- property Visibility: public -->
<element name="TFPSMap.Data">
<short>Indexed access to the locations of all data items</short>
<descr>
<var>Data</var> provides indexed access to all data. It does not return the
actual data, but returns a pointer to the data. When setting the
<var>Data</var> property, a pointer to the data value must be set, and the
data value is copied from the pointer.
</descr>
<seealso>
<link id="TFPSMap.DataSize"/>
<link id="TFPSMap.KeyData"/>
<link id="TFPSMap.Keys"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TFPSMap.Data.Index">
<short>Index of data location to retrieve</short>
</element>
<!-- property Visibility: public -->
<element name="TFPSMap.KeyData">
<short>Access to data locations using key</short>
<descr>
<var>KeyData</var> provides access to the data items, using their key value (as pointed to by <var>AKey</var>) as an index.
When reading a non-existent key value, <var>Nil</var> is returned.
If the key is found, a pointer to the associated data's location is returned.
When writing, the key pointed to by <var>Key</var> is added if it was not
present, and the data data is copied from the written pointer.
</descr>
<seealso>
<link id="TFPSMap.DataSize"/>
<link id="TFPSMap.KeyData"/>
<link id="TFPSMap.Data"/>
<link id="TFPSMap.Keys"/>
<link id="TFPSMap.KeySize"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TFPSMap.KeyData.Key">
<short>Pointer to key data to use</short>
</element>
<!-- property Visibility: public -->
<element name="TFPSMap.Sorted">
<short>Is the map permanently sorted on key ?</short>
<descr>
<var>Sorted</var> can be set to true to keep the map permanently sorted on key value.
The sorting happens using <link id="TFPSMap.OnKeyPtrCompare"/>.
</descr>
<seealso>
<link id="TFPSMap.OnKeyPtrCompare"/>
<link id="TFPSMap.Sort"/>
<link id="TFPSMap.Duplicates"/>
</seealso>
</element>
<!-- property Visibility: public -->
<element name="TFPSMap.OnPtrCompare">
<short>Alias for <var>OnKeyPtrCompare</var></short>
<descr>
<var>OnPtrCompare</var> is a deprecated alias for <link
id="TFPSMap.OnKeyPtrCompare">OnKeyPtrCompare</link>.
</descr>
<seealso>
<link id="TFPSMap.OnKeyPtrCompare"/>
<link id="TFPSMap.OnDataPtrCompare"/>
</seealso>
</element>
<!-- property Visibility: public -->
<element name="TFPSMap.OnKeyPtrCompare">
<short>Callback to compare 2 keys</short>
<descr>
<p>
<var>OnKeyPtrCompare</var> is used to compare the values of 2 keys. By
default it simply compares the byte values of the key memory block. It can be
set to any function that performs another comparison. (e.g. a function that
treats the memory blocks as a string pointer and compare the actual strings).
</p>
<p>
This function is used to sort the list or find a key.
</p>
</descr>
<seealso>
<link id="TFPSListCompareFunc"/>
<link id="TFPSMap.OnDataPtrCompare"/>
<link id="TFPSMap.Sort"/>
<link id="TFPSMap.Find"/>
<link id="TFPSMap.IndexOf"/>
</seealso>
</element>
<!-- property Visibility: public -->
<element name="TFPSMap.OnDataPtrCompare">
<short>Callback to compare 2 data items</short>
<descr>
<p>
<var>OnKeyPtrCompare</var> is used to compare the values of 2 keys. By
default it simply compares the byte values of the key memory block. It can
be set to any function that performs another comparison. (e.g. a function that
treats the memory blocks as a string pointer and compare the actual strings).
</p>
<p>
This function is used to find a data item (<link id="TFPSMap.IndexOfData">IndexOf</link>).
</p>
</descr>
<seealso>
<link id="TFPSListCompareFunc"/>
<link id="TFPSMap.OnKeyPtrCompare"/>
<link id="TFPSMap.IndexOfData"/>
</seealso>
</element>
<!-- generic class Visibility: default -->
<element name="TFPGMap">
<short>Generic map</short>
<descr>
<var>TFPGMap</var> is a generic map class. It can be used to specialize a map for any key type and data
type that do not require manual reference counting: For reference counted interface objects, <link id="TFPGMapInterfacedObjectData"/> must be used.
</descr>
<seealso>
<link id="TFPGMapInterfacedObjectData"/>
</seealso>
</element>
<!-- generic element Visibility: default -->
<element name="TFPGMap.TKey">
<short>Map Key type</short>
</element>
<!-- generic element Visibility: default -->
<element name="TFPGMap.TData">
<short>Map data type</short>
</element>
<!-- constructor Visibility: public -->
<element name="TFPGMap.Create">
<short>Create a new instance of the map</short>
<descr>
<var>Create</var> instantiates a new map. It mainly initializes the
<link id="TFPSMap"/> parent with the sized of the key and data.
</descr>
<seealso>
<link id="TFPSMap.Create"/>
</seealso>
</element>
<!-- function Visibility: public -->
<element name="TFPGMap.Add">
<short>Add a key and value to the map</short>
<descr>
<var>Add</var> adds a new key <var>AKey</var> of generic type <var>TKey</var>
with data value <var>AData</var> to the list and returns the position at which
the key was added.
</descr>
<errors>
If the item could not be added, an <link id="EListError"/> exception is raised.
If <link id="TFPSMap.Duplicates">Duplicates</link> is set to <var>dupError</var>
and a duplicate key is added, an <link id="EListError"/> exception is raised.
</errors>
<seealso>
<link id="TFPGMap.Keys"/>
<link id="TFPGMap.IndexOf"/>
<link id="TFPGMap.KeyData"/>
<link id="TFPGMap.Data"/>
<link id="TFPSMap.Duplicates"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TFPGMap.Add.Result">
<short>Index of the new key</short>
</element>
<!-- argument Visibility: public -->
<element name="TFPGMap.Add.AKey">
<short>Key value</short>
</element>
<!-- argument Visibility: public -->
<element name="TFPGMap.Add.AData">
<short>Data item</short>
</element>
<!-- function Visibility: public -->
<element name="TFPGMap.Find">
<short>Find item based on key</short>
<descr>
<p>
<var>Find</var> will search the key equal to <var>AKey</var> and return its index in <var>AIndex</var>.
The return value of the function is <var>True</var> if an exact match for <var>AKey</var> is found, <var>False</var> otherwise.
</p>
<p>
The behaviour of Find is undefined if the map is not sorted.
For unsorted maps, use <link id="TFPGMap.IndexOf">IndexOf</link> instead.
</p>
</descr>
<seealso>
<link id="TFPGMap.IndexOf"/>
<link id="TFPGMap.IndexOfData"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TFPGMap.Find.Result">
<short>True if an exact match for <var>AKey</var> was found.</short>
</element>
<!-- argument Visibility: public -->
<element name="TFPGMap.Find.AKey">
<short>Key to search for.</short>
</element>
<!-- argument Visibility: public -->
<element name="TFPGMap.Find.Index">
<short>Index of found key</short>
</element>
<!-- function Visibility: public -->
<element name="TFPGMap.IndexOf">
<short>Find index of a key in the list.</short>
<descr>
<var>IndexOf</var> returns the index of <var>AKey</var> in the list, or -1
if the key was not found in the list.
</descr>
<errors>
None.
</errors>
<seealso>
<link id="TFPGMap.Find"/>
<link id="TFPGMap.IndexOfData"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TFPGMap.IndexOf.Result">
<short>Index of <var>AKey</var> in the list, -1 if not present.</short>
</element>
<!-- argument Visibility: public -->
<element name="TFPGMap.IndexOf.AKey">
<short>Key value to search.</short>
</element>
<!-- function Visibility: public -->
<element name="TFPGMap.IndexOfData">
<short>Find index of data value in the list.</short>
<descr>
<var>IndexOfData</var> returns the index of <var>AData</var> in the list, or -1
if the data was not found in the list.
</descr>
<errors>
None.
</errors>
<seealso>
<link id="TFPGMap.Find"/>
<link id="TFPGMap.IndexOf"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TFPGMap.IndexOfData.Result">
<short>Index of <var>AData</var> in the list, -1 if not present.</short>
</element>
<!-- argument Visibility: public -->
<element name="TFPGMap.IndexOfData.AData">
<short>Data value to search</short>
</element>
<!-- procedure Visibility: public -->
<element name="TFPGMap.InsertKey">
<short>Insert a new key in the list</short>
<descr>
<var>InsertKey</var> inserts key <var>AKey</var> at position <var>Index</var> in the list.
It is not allowed to insert a key in a sorted list.
</descr>
<errors>
If the index <var>AIndex</var> is out of range [0..Count-1], or the list is
sorted, an <link id="EListError"/> exception will be raised.
</errors>
<seealso>
<link id="TFPGMap.InsertKeyData"/>
<link id="TFPGMap.Add"/>
<link id="TFPSMap.Delete"/>
<link id="TFPSMap.Remove"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TFPGMap.InsertKey.Index">
<short>Index at which to insert <var>AKey</var></short>
</element>
<!-- argument Visibility: public -->
<element name="TFPGMap.InsertKey.AKey">
<short>Key to insert in the list.</short>
</element>
<!-- procedure Visibility: public -->
<element name="TFPGMap.InsertKeyData">
<short>Insert a new key with associated data in the list</short>
<descr>
<var>InsertKey</var> inserts key <var>AKey</var> with associated data
<var>AData</var> at position <var>Index</var> in the list.
It is not allowed to insert a key in a sorted list.
</descr>
<errors>
If the index <var>AIndex</var> is out of range [0..Count-1], or the list is
sorted, an <link id="EListError"/> exception will be raised.
</errors>
<seealso>
<link id="TFPGMap.InsertKey"/>
<link id="TFPGMap.Add"/>
<link id="TFPSMap.Delete"/>
<link id="TFPGMap.Remove"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TFPGMap.InsertKeyData.Index">
<short>Index at which to insert <var>AKey</var> and <var>AData</var></short>
</element>
<!-- argument Visibility: public -->
<element name="TFPGMap.InsertKeyData.AKey">
<short>Key to insert in the list.</short>
</element>
<!-- argument Visibility: public -->
<element name="TFPGMap.InsertKeyData.AData">
<short>Data to associate with <var>AKey</var></short>
</element>
<!-- function Visibility: public -->
<element name="TFPGMap.Remove">
<short>Remove a key from the list</short>
<descr>
<var>Remove</var> removes the key <var>AKey</var> from the list, together
with its associated data. The function returns the index of <var>AKey</var>
prior to removal from the list, or -1 if <var>AKey</var> was not present in
the list.
</descr>
<errors>
None.
</errors>
<seealso>
<link id="TFPGMap.InsertKey"/>
<link id="TFPGMap.InsertKeyData"/>
<link id="TFPGMap.Add"/>
<link id="TFPSMap.Delete"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TFPGMap.Remove.Result">
<short>Index of <var>AKey</var> prior to removal.</short>
</element>
<!-- argument Visibility: public -->
<element name="TFPGMap.Remove.AKey">
<short>Key to remove from the list.</short>
</element>
<!-- property Visibility: public -->
<element name="TFPGMap.Keys">
<short>Indexed access to the keys in the list.</short>
<descr>
<var>Keys</var> provides indexed access to the key values in the list.
Valid values for <var>Index</var> are in the range <var>[0..Count-1]</var>.
Key values can always be read, but can only be written if the list is unsorted.
</descr>
<errors>
If the index <var>AIndex</var> is out of range [0..Count-1], an <link id="EListError"/> exception will be
raised. The same exception is raised if a key is written and the list is sorted.
</errors>
<seealso>
<link id="TFPSList.Count"/>
<link id="TFPGMap.Data"/>
<link id="TFPGMap.KeyData"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TFPGMap.Keys.Index">
<short>Index of key value to retrieve</short>
</element>
<!-- property Visibility: public -->
<element name="TFPGMap.Data">
<short>Indexed access to the data in the list</short>
<descr>
<var>Data</var> provides indexed access to the data values in the list.
Valid values for <var>Index</var> are in the range <var>[0..Count-1]</var>.
Data can always be read or written.
</descr>
<errors>
If the index <var>AIndex</var> is out of range [0..Count-1], an <link
id="EListError"/> exception will be raised.
</errors>
<seealso>
<link id="TFPSList.Count"/>
<link id="TFPGMap.Keys"/>
<link id="TFPGMap.KeyData"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TFPGMap.Data.Index">
<short>Index of data value to retrieve</short>
</element>
<!-- property Visibility: public -->
<element name="TFPGMap.KeyData">
<short>Access to data based on key</short>
<descr>
<var>KeyData</var> allows access to the data based on the key value
<var>AKey</var>. The data can be read and written. When writing, writing
using an existing key will overwrite the current data. If it does not exist
yet, it will be created. When reading, if the key is not present, an
<link id="EListError"/> will be raised.
</descr>
<errors>
If the key does not exist, an <link id="EListError"/> exception will be raised.
</errors>
<seealso>
<link id="TFPSList.Count"/>
<link id="TFPGMap.Keys"/>
<link id="TFPGMap.Data"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TFPGMap.KeyData.AKey">
<short>Key associated with data value to read or write</short>
</element>
<!-- property Visibility: public -->
<element name="TFPGMap.OnCompare">
<short>Alias for <var>OnKeyCompare</var></short>
<descr>
<var>OnCompare</var> is a deprecated property, use <link id="TFPGMap.OnKeyCompare"/> instead.
</descr>
<seealso>
<link id="TFPGMap.OnKeyCompare"/>
</seealso>
</element>
<!-- property Visibility: public -->
<element name="TFPGMap.OnKeyCompare">
<short>Compare function for key values.</short>
<descr>
<p>
<var>OnKeyCompare</var> can be set to a function that compares key values.
The default value for this event is a function that compares keys based on a
byte-by-byte comparison of the memory block.
The function must have the following semantics:
</p>
<ul>
<li>If the result of this function is negative, the first key (<var>key1</var>) is
assumed to be 'less' than the second key (<var>key2</var>) and will be moved
before the second in the list.
</li>
<li>If the function result is positive, the first key (<var>key1</var>)
pointer is assumed to be 'greater than' the second key (<var>key2</var>)and will be moved after
the second in the list.
</li>
<li>if the function result is zero, the keys are assumed to be 'equal'
and no moving will take place.
</li>
</ul>
</descr>
<seealso>
<link id="TFPGMap.OnDataCompare"/>
</seealso>
</element>
<!-- property Visibility: public -->
<element name="TFPGMap.OnDataCompare">
<short>Compare function for data values.</short>
<descr>
<p>
<var>OnDataCompare</var> can be set to a function that compares data values.
The default value for this event is a function that compares data based on a
byte-by-byte comparison of the memory block.
The function must have the following semantics:
</p>
<ul>
<li>If the result of this function is negative, the first data item (<var>Data1</var>) is
assumed to be 'less' than the second data item (<var>Data2</var>) and will be moved
before the second in the list.
</li>
<li>If the function result is positive, the first data item (<var>Data1</var>)
pointer is assumed to be 'greater than' the second data item (<var>Data2</var>)and will be moved after
the second in the list.
</li>
<li>if the function result is zero, the data items are assumed to be 'equal'
and no moving will take place.
</li>
</ul>
</descr>
<seealso>
<link id="TFPGMap.OnKeyCompare"/>
</seealso>
</element>
<!-- generic class Visibility: default -->
<element name="TFPGMapInterfacedObjectData">
<short>Generic map for reference counted objects</short>
<descr>
<p>
<var>TFPGInterfacedObjectMap</var> is a generic map class. It can be used to specialize a map for any key
type, with associated data type that requires manual reference counting: any type which implements <var>IInterface</var>.
For non-reference counted objects, <link id="TFPGMap"/> should be used.
</p>
<p>
This map class is entirely equivalent to <link id="TFPGMap"/>, but operates on
data items that require additional reference counting code on the data.
</p>
</descr>
<seealso>
<link id="TFPGMap"/>
</seealso>
</element>
<!-- generic element Visibility: default -->
<element name="TFPGMapInterfacedObjectData.TKey">
<short>Map Key type</short>
</element>
<!-- generic element Visibility: default -->
<element name="TFPGMapInterfacedObjectData.TData">
<short>Map data type, any type which implements <var>IInterface</var></short>
</element>
<!-- constructor Visibility: public -->
<element name="TFPGMapInterfacedObjectData.Create">
<short>Create a new instance of the map</short>
<descr>
<var>Create</var> instantiates a new map. It mainly initializes the
<link id="TFPSMap"/> parent with the sized of the key and data.
</descr>
<seealso>
<link id="TFPSMap.Create"/>
</seealso>
</element>
<!-- function Visibility: public -->
<element name="TFPGMapInterfacedObjectData.Add">
<short>Add a key and value to the map</short>
<descr>
<var>Add</var> adds a new key <var>AKey</var> of generic type
<var>TKey</var>
with data value <var>AData</var> to the list and returns the position at
which
the key was added.
</descr>
<errors>
If the item could not be added, an <link id="EListError"/> exception is
raised.
If <link id="TFPSMap.Duplicates">Duplicates</link> is set to
<var>dupError</var>
and a duplicate key is added, an <link id="EListError"/> exception is
raised.
</errors>
<seealso>
<link id="TFPGMapInterfacedObjectData.Keys"/>
<link id="TFPGMapInterfacedObjectData.IndexOf"/>
<link id="TFPGMapInterfacedObjectData.KeyData"/>
<link id="TFPGMapInterfacedObjectData.Data"/>
<link id="TFPS.Duplicates"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TFPGMapInterfacedObjectData.Add.Result">
<short>Index of the new key</short>
</element>
<!-- argument Visibility: public -->
<element name="TFPGMapInterfacedObjectData.Add.AKey">
<short>Key value</short>
</element>
<!-- argument Visibility: public -->
<element name="TFPGMapInterfacedObjectData.Add.AData">
<short>Data item</short>
</element>
<!-- function Visibility: public -->
<element name="TFPGMapInterfacedObjectData.Find">
<short>Find item based on key</short>
<descr>
<var>Find</var> will search the first key smaller than or equal
to <var>AKey</var> and return its index in <var>AIndex</var>. If the key was
not found then -1 is returned. The return value of the function is
<var>True</var> if an exact match for <var>AKey</var> is found,
<var>False</var> otherwise.
</descr>
<seealso>
<link id="TFPGMapInterfacedObjectData.IndexOf"/>
<link id="TFPGMapInterfacedObjectData.IndexOfData"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TFPGMapInterfacedObjectData.Find.Result">
<short>True if an exact match for <var>AKey</var> was found.</short>
</element>
<!-- argument Visibility: public -->
<element name="TFPGMapInterfacedObjectData.Find.AKey">
<short>Key to search for</short>
</element>
<!-- argument Visibility: public -->
<element name="TFPGMapInterfacedObjectData.Find.Index">
<short>Index of found key</short>
</element>
<!-- function Visibility: public -->
<element name="TFPGMapInterfacedObjectData.IndexOf">
<short>Find index of a key in the list.</short>
<descr>
<var>IndexOf</var> returns the index of <var>AKey</var> in the list, or -1
if the key was not found in the list.
</descr>
<errors>
None.
</errors>
<seealso>
<link id="TFPGMapInterfacedObjectData.Find"/>
<link id="TFPGMapInterfacedObjectData.IndexOfData"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TFPGMapInterfacedObjectData.IndexOf.Result">
<short>Index of <var>AKey</var> in the list, -1 if not present.</short>
</element>
<!-- argument Visibility: public -->
<element name="TFPGMapInterfacedObjectData.IndexOf.AKey">
<short>Key value to search.</short>
</element>
<!-- function Visibility: public -->
<element name="TFPGMapInterfacedObjectData.IndexOfData">
<short>Find index of data value in the list.</short>
<descr>
<var>IndexOfData</var> returns the index of <var>AData</var> in the list, or
-1
if the data was not found in the list.
</descr>
<errors>
None.
</errors>
<seealso>
<link id="TFPGMapInterfacedObjectData.Find"/>
<link id="TFPGMapInterfacedObjectData.IndexOf"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TFPGMapInterfacedObjectData.IndexOfData.Result">
<short>Index of <var>AData</var> in the list, -1 if not present.</short>
</element>
<!-- argument Visibility: public -->
<element name="TFPGMapInterfacedObjectData.IndexOfData.AData">
<short>Data value to search</short>
</element>
<!-- procedure Visibility: public -->
<element name="TFPGMapInterfacedObjectData.InsertKey">
<short>Insert a new key in the list</short>
<descr>
<var>InsertKey</var> inserts key <var>AKey</var> at position
<var>Index</var> in the list.
It is not allowed to insert a key in a sorted list.
</descr>
<errors>
If the index <var>AIndex</var> is out of range [0..Count-1], or the list is
sorted, an <link id="EListError"/> exception will be raised.
</errors>
<seealso>
<link id="TFPGMapInterfacedObjectData.InsertKeyData"/>
<link id="TFPGMapInterfacedObjectData.Add"/>
<link id="TFPSMapInterfacedObjectData.Delete"/>
<link id="TFPSMapInterfacedObjectData.Remove"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TFPGMapInterfacedObjectData.InsertKey.Index">
<short>Index at which to insert <var>AKey</var></short>
</element>
<!-- argument Visibility: public -->
<element name="TFPGMapInterfacedObjectData.InsertKey.AKey">
<short>Key to insert in the list.</short>
</element>
<!-- procedure Visibility: public -->
<element name="TFPGMapInterfacedObjectData.InsertKeyData">
<short>Insert a new key with associated data in the list</short>
<descr>
<var>InsertKey</var> inserts key <var>AKey</var> with associated data
<var>AData</var> at position <var>Index</var> in the list.
It is not allowed to insert a key in a sorted list.
</descr>
<errors>
If the index <var>AIndex</var> is out of range [0..Count-1], or the list is
sorted, an <link id="EListError"/> exception will be raised.
</errors>
<seealso>
<link id="TFPGMapInterfacedObjectData.InsertKey"/>
<link id="TFPGMapInterfacedObjectData.Add"/>
<link id="TFPSMapInterfacedObjectData.Delete"/>
<link id="TFPGMapInterfacedObjectData.Remove"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TFPGMapInterfacedObjectData.InsertKeyData.Index">
<short>Index at which to insert <var>AKey</var> and <var>AData</var></short>
</element>
<!-- argument Visibility: public -->
<element name="TFPGMapInterfacedObjectData.InsertKeyData.AKey">
<short>Key to insert in the list</short>
</element>
<!-- argument Visibility: public -->
<element name="TFPGMapInterfacedObjectData.InsertKeyData.AData">
<short>Data to associate with <var>AKey</var></short>
</element>
<!-- function Visibility: public -->
<element name="TFPGMapInterfacedObjectData.Remove">
<short>Remove a key from the list</short>
<descr>
<var>Remove</var> removes the key <var>AKey</var> from the list, together
with its associated data. The function returns the index of <var>AKey</var>
prior to removal from the list, or -1 if <var>AKey</var> was not present in
the list.
</descr>
<errors>
None.
</errors>
<seealso>
<link id="TFPGMap.InsertKey"/>
<link id="TFPGMap.InsertKeyData"/>
<link id="TFPGMap.Add"/>
<link id="TFPGMapInterfacedObjectData.Delete"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TFPGMapInterfacedObjectData.Remove.Result">
<short>Index of <var>AKey</var> prior to removal</short>
</element>
<!-- argument Visibility: public -->
<element name="TFPGMapInterfacedObjectData.Remove.AKey">
<short>Key to remove from the list</short>
</element>
<!-- property Visibility: public -->
<element name="TFPGMapInterfacedObjectData.Keys">
<short>Indexed access to the keys in the list.</short>
<descr>
<var>Keys</var> provides indexed access to the key values in the list.
Valid values for <var>Index</var> are in the range <var>[0..Count-1]</var>.
Key values can always be read, but can only be written if the list is
unsorted.
</descr>
<errors>
If the index <var>AIndex</var> is out of range [0..Count-1], an <link
id="EListError"/> exception will be
raised. The same exception is raised if a key is written and the list is
sorted.
</errors>
<seealso>
<link id="TFPSList.Count"/>
<link id="TFPGMapInterfacedObjectData.Data"/>
<link id="TFPGMapInterfacedObjectData.KeyData"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TFPGMapInterfacedObjectData.Keys.Index">
<short>Index of key value to retrieve</short>
</element>
<!-- property Visibility: public -->
<element name="TFPGMapInterfacedObjectData.Data">
<short>Indexed access to the data in the list</short>
<descr>
<var>Data</var> provides indexed access to the data values in the list.
Valid values for <var>Index</var> are in the range <var>[0..Count-1]</var>.
Data can always be read or written.
</descr>
<errors>
If the index <var>AIndex</var> is out of range [0..Count-1], an <link
id="EListError"/> exception will be raised.
</errors>
<seealso>
<link id="TFPSList.Count"/>
<link id="TFPGMapInterfacedObjectData.Keys"/>
<link id="TFPGMapInterfacedObjectData.KeyData"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TFPGMapInterfacedObjectData.Data.Index">
<short>Index of data value to retrieve</short>
</element>
<!-- property Visibility: public -->
<element name="TFPGMapInterfacedObjectData.KeyData">
<short>Access to data based on key</short>
<descr>
<var>KeyData</var> allows access to the data based on the key value
<var>AKey</var>. The data can be read and written. When writing, writing
using an existing key will overwrite the current data. If it does not exist
yet, it will be created. When reading, if the key is not present, an
<link id="EListError"/> will be raised.
</descr>
<errors>
If the key does not exist, an <link id="EListError"/> exception will be
raised.
</errors>
<seealso>
<link id="TFPSList.Count"/>
<link id="TFPGMapInterfacedObjectData.Keys"/>
<link id="TFPGMapInterfacedObjectData.Data"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TFPGMapInterfacedObjectData.KeyData.AKey">
<short>Key associated with data value to read or write</short>
</element>
<!-- property Visibility: public -->
<element name="TFPGMapInterfacedObjectData.OnCompare">
<short>Alias for <var>OnKeyCompare</var></short>
<descr>
<var>OnCompare</var> is a deprecated property, use <link id="TFPGMapInterfacedObjectData.OnKeyCompare"/> instead.
</descr>
<seealso>
<link id="TFPGMapInterfacedObjectData.OnKeyCompare"/>
</seealso>
</element>
<!-- property Visibility: public -->
<element name="TFPGMapInterfacedObjectData.OnKeyCompare">
<short>Compare function for key values.</short>
<descr>
<p>
<var>OnKeyCompare</var> can be set to a function that compares key values.
The default value for this event is a function that compares keys based on a
byte-by-byte comparison of the memory block.
The function must have the following semantics:
</p>
<ul>
<li>If the result of this function is negative, the first key
(<var>key1</var>) is
assumed to be 'less' than the second key (<var>key2</var>) and will be moved
before the second in the list.
</li>
<li>If the function result is positive, the first key (<var>key1</var>)
pointer is assumed to be 'greater than' the second key (<var>key2</var>)and
will be moved after
the second in the list.
</li>
<li>if the function result is zero, the keys are assumed to be 'equal'
and no moving will take place.
</li>
</ul>
</descr>
<seealso>
<link id="TFPGMapInterfacedObjectData.OnDataCompare"/>
</seealso>
</element>
<!-- property Visibility: public -->
<element name="TFPGMapInterfacedObjectData.OnDataCompare">
<short>Compare function for data values.</short>
<descr>
<p>
<var>OnDataCompare</var> can be set to a function that compares data values.
The default value for this event is a function that compares data based on a
byte-by-byte comparison of the memory block.
The function must have the following semantics:
</p>
<ul>
<li>If the result of this function is negative, the first data item
(<var>Data1</var>) is
assumed to be 'less' than the second data item (<var>Data2</var>) and will
be moved
before the second in the list.
</li>
<li>If the function result is positive, the first data item
(<var>Data1</var>)
pointer is assumed to be 'greater than' the second data item
(<var>Data2</var>)and will be moved after
the second in the list.
</li>
<li>if the function result is zero, the data items are assumed to be 'equal'
and no moving will take place.
</li>
</ul>
</descr>
<seealso>
<link id="TFPGMapInterfacedObjectData.OnKeyCompare"/>
</seealso>
</element>
<!-- function Visibility: public -->
<element name="TFPGMap.TryGetData">
<short>Find data or return default</short>
<descr>
<var>TryGetData</var> will search the map for <var>AKey</var> and return
<var>True</var> or <var>False</var> depending on whether the value with the
given key was found. If the key was found, the associated value is returned
in <var>AData</var>, if it is not found a default value (using
<var>Default</var>) is returned.
</descr>
<errors>
None.
</errors>
<seealso>
<link id="TFPGMap.Find"/>
</seealso>
</element>
<!-- procedure Visibility: public -->
<element name="TFPGMap.AddOrSetData">
<short>Add data with given or set value if the key already exists.</short>
<descr>
<var>AddOrSetData</var> will check if key <var>AKey</var> already exists. if
yes, the value associated with it will be replaced with <var>AData</var>. If
the key does not yet exist, it will be added with value <var>AData</var>.
</descr>
<errors>
None.
</errors>
<seealso>
<link id="TFPGMap.TryGetData"/>
<link id="TFPGMap.Add"/>
<link id="TFPGMap.Find"/>
</seealso>
</element>
<!--
********************************************************************
#rtl.fgl.TFPGMapObject
********************************************************************
-->
<!-- generic class Visibility: default -->
<element name="TFPGMapObject">
<short>Generic map</short>
<descr>
<var>TFPGMapObject</var> is a generic map class. It can be used to specialize a map for object types,
but not objects with automated reference counting: For reference counted interface objects,
<link id="TFPGMapInterfacedObjectData"/> must be used.
</descr>
<seealso>
<link id="TFPGMapInterfacedObjectData"/>
</seealso>
</element>
<!-- generic element Visibility: default -->
<element name="TFPGMapObject.TKey">
<short>Map Key type</short>
</element>
<!-- generic element Visibility: default -->
<element name="TFPGMapObject.TData">
<short>Map data type. This must be a <var>TObject</var> descendent</short>
</element>
<!-- constructor Visibility: public -->
<element name="TFPGMapObject.Create">
<short>Create a new instance of the map</short>
<descr>
<var>Create</var> instantiates a new map. It mainly initializes the
<link id="TFPSMap"/> parent with the sized of the key and data.
</descr>
<seealso>
<link id="TFPSMap.Create"/>
</seealso>
</element>
<!-- function Visibility: public -->
<element name="TFPGMapObject.Add">
<short>Add a key and value to the map</short>
<descr>
<var>Add</var> adds a new key <var>AKey</var> of generic type <var>TKey</var>
with data object <var>AData</var> to the list and returns the position at which
the key was added.
</descr>
<errors>
If the item could not be added, an <link id="EListError"/> exception is raised.
If <link id="TFPSMap.Duplicates">Duplicates</link> is set to <var>dupError</var>
and a duplicate key is added, an <link id="EListError"/> exception is raised.
</errors>
<seealso>
<link id="TFPGMapObject.Keys"/>
<link id="TFPGMapObject.IndexOf"/>
<link id="TFPGMapObject.KeyData"/>
<link id="TFPGMapObject.Data"/>
<link id="TFPSMap.Duplicates"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TFPGMapObject.Add.Result">
<short>Index of the new key</short>
</element>
<!-- argument Visibility: public -->
<element name="TFPGMapObject.Add.AKey">
<short>Key value</short>
</element>
<!-- argument Visibility: public -->
<element name="TFPGMapObject.Add.AData">
<short>Data item</short>
</element>
<!-- function Visibility: public -->
<element name="TFPGMapObject.Find">
<short>Find item based on key</short>
<descr>
<var>Find</var> will search the first key smaller than or equal
to <var>AKey</var> and return its index in <var>AIndex</var>. If the key was
not found then -1 is returned. The return value of the function is
<var>True</var> if an exact match for <var>AKey</var> is found,
<var>False</var> otherwise.
</descr>
<seealso>
<link id="TFPGMapObject.IndexOf"/>
<link id="TFPGMapObject.IndexOfData"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TFPGMapObject.Find.Result">
<short>True if an exact match for <var>AKey</var> was found.</short>
</element>
<!-- argument Visibility: public -->
<element name="TFPGMapObject.Find.AKey">
<short>Key to search for.</short>
</element>
<!-- argument Visibility: public -->
<element name="TFPGMapObject.Find.Index">
<short>Index of found key</short>
</element>
<!-- function Visibility: public -->
<element name="TFPGMapObject.IndexOf">
<short>Find index of a key in the list.</short>
<descr>
<var>IndexOf</var> returns the index of <var>AKey</var> in the list, or -1
if the key was not found in the list.
</descr>
<errors>
None.
</errors>
<seealso>
<link id="TFPGMapObject.Find"/>
<link id="TFPGMapObject.IndexOfData"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TFPGMapObject.IndexOf.Result">
<short>Index of <var>AKey</var> in the list, -1 if not present.</short>
</element>
<!-- argument Visibility: public -->
<element name="TFPGMapObject.IndexOf.AKey">
<short>Key value to search.</short>
</element>
<!-- function Visibility: public -->
<element name="TFPGMapObject.IndexOfData">
<short>Find index of data value in the list.</short>
<descr>
<var>IndexOfData</var> returns the index of object <var>AData</var> in the list, or -1
if the data was not found in the list.
</descr>
<errors>
None.
</errors>
<seealso>
<link id="TFPGMapObject.Find"/>
<link id="TFPGMapObject.IndexOf"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TFPGMapObject.IndexOfData.Result">
<short>Index of <var>AData</var> in the list, -1 if not present.</short>
</element>
<!-- argument Visibility: public -->
<element name="TFPGMapObject.IndexOfData.AData">
<short>Data value to search</short>
</element>
<!-- procedure Visibility: public -->
<element name="TFPGMapObject.InsertKey">
<short>Insert a new key in the list</short>
<descr>
<var>InsertKey</var> inserts key <var>AKey</var> at position <var>Index</var> in the list.
It is not allowed to insert a key in a sorted list.
</descr>
<errors>
If the index <var>AIndex</var> is out of range [0..Count-1], or the list is
sorted, an <link id="EListError"/> exception will be raised.
</errors>
<seealso>
<link id="TFPGMapObject.InsertKeyData"/>
<link id="TFPGMapObject.Add"/>
<link id="TFPSMap.Delete"/>
<link id="TFPSMap.Remove"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TFPGMapObject.InsertKey.Index">
<short>Index at which to insert <var>AKey</var></short>
</element>
<!-- argument Visibility: public -->
<element name="TFPGMapObject.InsertKey.AKey">
<short>Key to insert in the list.</short>
</element>
<!-- procedure Visibility: public -->
<element name="TFPGMapObject.InsertKeyData">
<short>Insert a new key with associated data in the list</short>
<descr>
<var>InsertKey</var> inserts key <var>AKey</var> with associated data
<var>AData</var> at position <var>Index</var> in the list.
It is not allowed to insert a key in a sorted list.
</descr>
<errors>
If the index <var>AIndex</var> is out of range [0..Count-1], or the list is
sorted, an <link id="EListError"/> exception will be raised.
</errors>
<seealso>
<link id="TFPGMapObject.InsertKey"/>
<link id="TFPGMapObject.Add"/>
<link id="TFPSMap.Delete"/>
<link id="TFPGMapObject.Remove"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TFPGMapObject.InsertKeyData.Index">
<short>Index at which to insert <var>AKey</var> and <var>AData</var></short>
</element>
<!-- argument Visibility: public -->
<element name="TFPGMapObject.InsertKeyData.AKey">
<short>Key to insert in the list.</short>
</element>
<!-- argument Visibility: public -->
<element name="TFPGMapObject.InsertKeyData.AData">
<short>Data to associate with <var>AKey</var></short>
</element>
<!-- function Visibility: public -->
<element name="TFPGMapObject.Remove">
<short>Remove a key from the list</short>
<descr>
<var>Remove</var> removes the key <var>AKey</var> from the list, together
with its associated data. The function returns the index of <var>AKey</var>
prior to removal from the list, or -1 if <var>AKey</var> was not present in
the list.
</descr>
<errors>
None.
</errors>
<seealso>
<link id="TFPGMapObject.InsertKey"/>
<link id="TFPGMapObject.InsertKeyData"/>
<link id="TFPGMapObject.Add"/>
<link id="TFPSMap.Delete"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TFPGMapObject.Remove.Result">
<short>Index of <var>AKey</var> prior to removal.</short>
</element>
<!-- argument Visibility: public -->
<element name="TFPGMapObject.Remove.AKey">
<short>Key to remove from the list.</short>
</element>
<!-- property Visibility: public -->
<element name="TFPGMapObject.Keys">
<short>Indexed access to the keys in the list.</short>
<descr>
<var>Keys</var> provides indexed access to the key values in the list.
Valid values for <var>Index</var> are in the range <var>[0..Count-1]</var>.
Key values can always be read, but can only be written if the list is unsorted.
</descr>
<errors>
If the index <var>AIndex</var> is out of range [0..Count-1], an <link id="EListError"/> exception will be
raised. The same exception is raised if a key is written and the list is sorted.
</errors>
<seealso>
<link id="TFPSList.Count"/>
<link id="TFPGMapObject.Data"/>
<link id="TFPGMapObject.KeyData"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TFPGMapObject.Keys.Index">
<short>Index of key value to retrieve</short>
</element>
<!-- property Visibility: public -->
<element name="TFPGMapObject.Data">
<short>Indexed access to the data in the list</short>
<descr>
<var>Data</var> provides indexed access to the data values in the list.
Valid values for <var>Index</var> are in the range <var>[0..Count-1]</var>.
Data can always be read or written.
</descr>
<errors>
If the index <var>AIndex</var> is out of range [0..Count-1], an <link
id="EListError"/> exception will be raised.
</errors>
<seealso>
<link id="TFPSList.Count"/>
<link id="TFPGMapObject.Keys"/>
<link id="TFPGMapObject.KeyData"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TFPGMapObject.Data.Index">
<short>Index of data value to retrieve</short>
</element>
<!-- property Visibility: public -->
<element name="TFPGMapObject.KeyData">
<short>Access to data based on key</short>
<descr>
<var>KeyData</var> allows access to the data based on the key value
<var>AKey</var>. The data can be read and written. When writing, writing
using an existing key will overwrite the current data. If it does not exist
yet, it will be created. When reading, if the key is not present, an
<link id="EListError"/> will be raised.
</descr>
<errors>
If the key does not exist, an <link id="EListError"/> exception will be raised.
</errors>
<seealso>
<link id="TFPSList.Count"/>
<link id="TFPGMapObject.Keys"/>
<link id="TFPGMapObject.Data"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TFPGMapObject.KeyData.AKey">
<short>Key associated with data value to read or write</short>
</element>
<!-- property Visibility: public -->
<element name="TFPGMapObject.OnCompare">
<short>Alias for <var>OnKeyCompare</var></short>
<descr>
<var>OnCompare</var> is a deprecated property, use <link id="TFPGMapObject.OnKeyCompare"/> instead.
</descr>
<seealso>
<link id="TFPGMapObject.OnKeyCompare"/>
</seealso>
</element>
<!-- property Visibility: public -->
<element name="TFPGMapObject.OnKeyCompare">
<short>Compare function for key values.</short>
<descr>
<p>
<var>OnKeyCompare</var> can be set to a function that compares key values.
The default value for this event is a function that compares keys based on a
byte-by-byte comparison of the memory block.
The function must have the following semantics:
</p>
<ul>
<li>If the result of this function is negative, the first key (<var>key1</var>) is
assumed to be 'less' than the second key (<var>key2</var>) and will be moved
before the second in the list.
</li>
<li>If the function result is positive, the first key (<var>key1</var>)
pointer is assumed to be 'greater than' the second key (<var>key2</var>)and will be moved after
the second in the list.
</li>
<li>if the function result is zero, the keys are assumed to be 'equal'
and no moving will take place.
</li>
</ul>
</descr>
<seealso>
<link id="TFPGMapObject.OnDataCompare"/>
</seealso>
</element>
<!-- property Visibility: public -->
<element name="TFPGMapObject.OnDataCompare">
<short>Compare function for data values.</short>
<descr>
<p>
<var>OnDataCompare</var> can be set to a function that compares data values.
The default value for this event is a function that compares data based on a
byte-by-byte comparison of the memory block.
The function must have the following semantics:
</p>
<ul>
<li>If the result of this function is negative, the first data item (<var>Data1</var>) is
assumed to be 'less' than the second data item (<var>Data2</var>) and will be moved
before the second in the list.
</li>
<li>If the function result is positive, the first data item (<var>Data1</var>)
pointer is assumed to be 'greater than' the second data item (<var>Data2</var>)and will be moved after
the second in the list.
</li>
<li>if the function result is zero, the data items are assumed to be 'equal'
and no moving will take place.
</li>
</ul>
</descr>
<seealso>
<link id="TFPGMapObject.OnKeyCompare"/>
</seealso>
</element>
<!-- function Visibility: public -->
<element name="TFPGMapObject.TryGetData">
<short>Find data or return default</short>
<descr>
<var>TryGetData</var> will search the map for <var>AKey</var> and return
<var>True</var> or <var>False</var> depending on whether the value with the
given key was found. If the key was found, the associated value is returned
in <var>AData</var>, if it is not found a default value (using
<var>Default</var>) is returned.
</descr>
<errors>
None.
</errors>
<seealso>
<link id="TFPGMapObject.Find"/>
</seealso>
</element>
<!-- procedure Visibility: public -->
<element name="TFPGMapObject.AddOrSetData">
<short>Add data with given or set value if the key already exists.</short>
<descr>
<var>AddOrSetData</var> will check if key <var>AKey</var> already exists. if
yes, the value associated with it will be replaced with <var>AData</var>. If
the key does not yet exist, it will be added with value <var>AData</var>.
</descr>
<errors>
None.
</errors>
<seealso>
<link id="TFPGMapObject.TryGetData"/>
<link id="TFPGMapObject.Add"/>
<link id="TFPGMapObject.Find"/>
</seealso>
</element>
<!-- function Visibility: public -->
<element name="TFPGMapInterfacedObjectData.TryGetData">
<short>Find data or return default</short>
<descr>
<var>TryGetData</var> will search the map for <var>AKey</var> and return
<var>True</var> or <var>False</var> depending on whether the value with the
given key was found. If the key was found, the associated value is returned
in <var>AData</var>, if it is not found a default value (using
<var>Default</var>) is returned.
</descr>
<errors>
None.
</errors>
<seealso>
<link id="TFPGMapInterfacedObjectData.Find"/>
</seealso>
</element>
<!-- procedure Visibility: public -->
<element name="TFPGMapInterfacedObjectData.AddOrSetData">
<short>Add data with given or set value if the key already exists.</short>
<descr>
<var>AddOrSetData</var> will check if key <var>AKey</var> already exists. if
yes, the value associated with it will be replaced with <var>AData</var>. If
the key does not yet exist, it will be added with value <var>AData</var>.
</descr>
<errors>
None.
</errors>
<seealso>
<link id="TFPGMapInterfacedObjectData.TryGetData"/>
<link id="TFPGMapInterfacedObjectData.Add"/>
<link id="TFPGMapInterfacedObjectData.Find"/>
</seealso>
</element>
<!-- uses unit Visibility: default -->
<element name="types">
<short>Several base types</short>
</element>
<!-- uses unit Visibility: default -->
<element name="sysutils">
<short>Exceptions and other auxiliary routines</short>
</element>
<!-- procedure Visibility: public -->
<element name="TFPSList.DeleteRange">
<short>Delete a range of elements</short>
<descr>
<var>DeleteRange</var> deletes elements from <var>IndexFrom</var> till <var>IndexTo</var>. Both indexes are zero based, and
<var>IndexTo</var> must be bigger than <var>IndexFrom</var>.
Using this method results in less moving of data in memory,
and as such is more effective than deleting the elements one by one using <link id="TFPSList.Delete"/>.
</descr>
<errors>
If invalid indexes are specified, an <link id="EListError"/> exception will be raised.
</errors>
<seealso>
<link id="EListError"/>
<link id="TFPSList.Delete"/>
</seealso>
</element>
<!-- procedure Visibility: public -->
<element name="TFPSList.AddList">
<short>Adds the elements from another list</short>
<descr>
<var>AddList</var> adds all the elements from list <var>Obj</var> to the current list. A check is done that the 2 lists have the same element size.
</descr>
<errors>
If the lists have different element size, an <link id="EListError"/> exception will be raised.
</errors>
<seealso>
<link id="TFPSList.Add"/>
<link id="EListError"/>
</seealso>
</element>
<!-- generic type Visibility: default -->
<element name="TFPGListEnumerator.T">
<short>List enumerator type</short>
<descr>
<var>T</var> is the type of element in the enumerator
</descr>
</element>
<!-- generic type Visibility: default -->
<element name="TFPGList.T">
<short>List element type</short>
<descr>
<var>T</var> is the type of element in the list
</descr>
</element>
<!-- procedure Visibility: public -->
<element name="TFPGList.AddList">
<short>Adds the elements from another list</short>
<descr>
<var>AddList</var> adds all the elements from list <var>Source</var> to the current list.
</descr>
<seealso>
<link id="TFPGList.Add"/>
<link id="TFPSList.AddList"/>
<link id="TFPGObjectList.AddList"/>
</seealso>
</element>
<!-- generic type Visibility: default -->
<element name="TFPGObjectList.T">
<short>Object list element type</short>
<descr>
<var>T</var> is the type of element in the list.
</descr>
</element>
<!-- procedure Visibility: public -->
<element name="TFPGObjectList.AddList">
<short>Adds the elements from another list</short>
<descr>
<var>AddList</var> adds all the elements from list <var>Source</var> to the current list.
</descr>
<seealso>
<link id="TFPGList.AddList"/>
<link id="TFPSList.AddList"/>
<link id="TFPGObjectList.Add"/>
</seealso>
</element>
<!-- generic type Visibility: default -->
<element name="TFPGInterfacedObjectList.T">
<short>Interfaced object list element type</short>
<descr>
<var>AddList</var> adds all the elements from list <var>Source</var> to the current list.
</descr>
</element>
<!-- procedure Visibility: public -->
<element name="TFPGInterfacedObjectList.AddList">
<short>Adds the elements from another list</short>
<descr>
<var>AddList</var> adds all the elements from list <var>Source</var> to the current list.
</descr>
<seealso>
<link id="TFPGList.AddList"/>
<link id="TFPSList.AddList"/>
<link id="TFPGObjectList.AddList"/>
<link id="TFPGInterfacedObjectList.Add"/>
</seealso>
</element>
<!-- generic type Visibility: default -->
<element name="TFPGMap.TKey">
<short>Key type</short>
<descr>
<var>TKey</var> is the map key type.
</descr>
</element>
<!-- generic type Visibility: default -->
<element name="TFPGMap.TData">
<short>Data type</short>
<descr>
<var>TData</var> is the map data element type.
</descr>
</element>
<!-- generic type Visibility: default -->
<element name="TFPGMapObject.TKey">
<short>Key type</short>
<descr>
<var>TKey</var> is the map key type.
</descr>
</element>
<!-- generic type Visibility: default -->
<element name="TFPGMapObject.TData">
<short>Data type</short>
<descr>
<var>TData</var> is the map data type. It must be a descendent of <var>TObject</var>
</descr>
</element>
<!-- generic type Visibility: default -->
<element name="TFPGMapInterfacedObjectData.TKey">
<short>Key type</short>
<descr>
<var>TKey</var> is the map key type.
</descr>
</element>
<!-- generic type Visibility: default -->
<element name="TFPGMapInterfacedObjectData.TData">
<short>Data type</short>
<descr>
<var>TData</var> is the map data type. It must be a descendent of <var>TInterfacedObject</var>
</descr>
</element>
</module> <!-- fgl -->
</package>
</fpdoc-descriptions>
|