Class: Int64
- Inherits:
-
JAVA::Value
- Object
- JAVA::Value
- Int64
- Defined in:
- ext/primitive/primitive.c
Class Method Summary collapse
Instance Method Summary collapse
- #!=(o) ⇒ Object
- #%(o) ⇒ Object
- #&(o) ⇒ Object
- #*(o) ⇒ Object
- #+(o) ⇒ Object
- #+@ ⇒ Object
- #-(o) ⇒ Object
- #-@ ⇒ Object
- #/(o) ⇒ Object
- #<(o) ⇒ Object
- #<<(o) ⇒ Object
- #<=(o) ⇒ Object
- #<=>(o) ⇒ Object
- #==(o) ⇒ Object
- #===(o) ⇒ Object
- #>(o) ⇒ Object
- #>=(o) ⇒ Object
- #>>(o) ⇒ Object
- #^(o) ⇒ Object
- #as_i ⇒ Object
- #as_ruby ⇒ Object
- #count ⇒ Object
- #eql?(o) ⇒ Boolean
- #equals(o) ⇒ Object
- #hash ⇒ Object
- #hashCode ⇒ Object
- #inspect ⇒ Object
- #new_fixnum ⇒ Object
- #rol(o) ⇒ Object
- #ror(o) ⇒ Object
- #signum ⇒ Object
- #succ ⇒ Object
- #times ⇒ Object
- #to_byte ⇒ Object
- #to_char ⇒ Object
- #to_f ⇒ Object
- #to_fixnum ⇒ Object
- #to_float32 ⇒ Object
- #to_float64 ⇒ Object
- #to_hex ⇒ Object
- #to_i ⇒ Object
- #to_int ⇒ Object
- #to_int16 ⇒ Object
- #to_int32 ⇒ Object
- #to_int64 ⇒ Object
- #to_s ⇒ Object
- #toString ⇒ Object
- #ushr(o) ⇒ Object
- #|(o) ⇒ Object
- #~ ⇒ Object
Methods inherited from JAVA::Value
Class Method Details
.[](o) ⇒ Object
1794 1795 1796 1797 1798 1799 |
# File 'ext/primitive/primitive.c', line 1794 static VALUE r_Int64_new(VALUE self, VALUE o) { int64_t value = __accept_int64(o); return __allocate_Int64(value); } |
Instance Method Details
#!=(o) ⇒ Object
1912 1913 1914 1915 1916 1917 1918 1919 |
# File 'ext/primitive/primitive.c', line 1912 static VALUE r_Int64_ne(VALUE self, VALUE o) { Int64 *p; Data_Get_Struct(self, Int64, p); int64_t v = __accept_int64(o); return p->value != v ? Qtrue : Qfalse; } |
#%(o) ⇒ Object
1948 1949 1950 1951 1952 1953 1954 1955 |
# File 'ext/primitive/primitive.c', line 1948 static VALUE r_Int64_mod(VALUE self, VALUE o) { Int64 *p; Data_Get_Struct(self, Int64, p); int64_t v = __accept_int64(o); return __allocate_Int64(__mod_int64(p->value, v)); } |
#&(o) ⇒ Object
2048 2049 2050 2051 2052 2053 2054 2055 |
# File 'ext/primitive/primitive.c', line 2048 static VALUE r_Int64_and(VALUE self, VALUE o) { Int64 *p; Data_Get_Struct(self, Int64, p); int64_t v = __accept_int64(o); return __allocate_Int64(p->value & v); } |
#*(o) ⇒ Object
1932 1933 1934 1935 1936 1937 1938 1939 |
# File 'ext/primitive/primitive.c', line 1932 static VALUE r_Int64_mul(VALUE self, VALUE o) { Int64 *p; Data_Get_Struct(self, Int64, p); int64_t v = __accept_int64(o); return __allocate_Int64(p->value * v); } |
#+(o) ⇒ Object
1956 1957 1958 1959 1960 1961 1962 1963 |
# File 'ext/primitive/primitive.c', line 1956 static VALUE r_Int64_add(VALUE self, VALUE o) { Int64 *p; Data_Get_Struct(self, Int64, p); int64_t v = __accept_int64(o); return __allocate_Int64(p->value + v); } |
#+@ ⇒ Object
1920 1921 1922 1923 1924 |
# File 'ext/primitive/primitive.c', line 1920 static VALUE r_Int64_pos(VALUE self) { return self; } |
#-(o) ⇒ Object
1964 1965 1966 1967 1968 1969 1970 1971 |
# File 'ext/primitive/primitive.c', line 1964 static VALUE r_Int64_sub(VALUE self, VALUE o) { Int64 *p; Data_Get_Struct(self, Int64, p); int64_t v = __accept_int64(o); return __allocate_Int64(p->value - v); } |
#-@ ⇒ Object
1925 1926 1927 1928 1929 1930 1931 |
# File 'ext/primitive/primitive.c', line 1925 static VALUE r_Int64_neg(VALUE self) { Int64 *p; Data_Get_Struct(self, Int64, p); return __allocate_Int64(-p->value); } |
#/(o) ⇒ Object
1940 1941 1942 1943 1944 1945 1946 1947 |
# File 'ext/primitive/primitive.c', line 1940 static VALUE r_Int64_div(VALUE self, VALUE o) { Int64 *p; Data_Get_Struct(self, Int64, p); int64_t v = __accept_int64(o); return __allocate_Int64(__div_int64(p->value, v)); } |
#<(o) ⇒ Object
1984 1985 1986 1987 1988 1989 1990 1991 |
# File 'ext/primitive/primitive.c', line 1984 static VALUE r_Int64_lt(VALUE self, VALUE o) { Int64 *p; Data_Get_Struct(self, Int64, p); int64_t v = __accept_int64(o); return p->value < v ? Qtrue : Qfalse; } |
#<<(o) ⇒ Object
2023 2024 2025 2026 2027 2028 2029 2030 |
# File 'ext/primitive/primitive.c', line 2023 static VALUE r_Int64_shl(VALUE self, VALUE o) { Int64 *p; Data_Get_Struct(self, Int64, p); int32_t d = __accept_int32(o); return __allocate_Int64(p->value << d); } |
#<=(o) ⇒ Object
1992 1993 1994 1995 1996 1997 1998 1999 |
# File 'ext/primitive/primitive.c', line 1992 static VALUE r_Int64_le(VALUE self, VALUE o) { Int64 *p; Data_Get_Struct(self, Int64, p); int64_t v = __accept_int64(o); return p->value <= v ? Qtrue : Qfalse; } |
#<=>(o) ⇒ Object
1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 |
# File 'ext/primitive/primitive.c', line 1972 static VALUE r_Int64_cmp(VALUE self, VALUE o) { Int64 *p; Data_Get_Struct(self, Int64, p); int64_t v = __accept_int64(o); if (p->value < v) return r_INT32_M1; if (p->value > v) return r_INT32_1; return r_INT32_0; } |
#==(o) ⇒ Object
1904 1905 1906 1907 1908 1909 1910 1911 |
# File 'ext/primitive/primitive.c', line 1904 static VALUE r_Int64_eq(VALUE self, VALUE o) { Int64 *p; Data_Get_Struct(self, Int64, p); int64_t v = __accept_int64(o); return p->value == v ? Qtrue : Qfalse; } |
#===(o) ⇒ Object
1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 |
# File 'ext/primitive/primitive.c', line 1800 static VALUE r_Int64_equals(VALUE self, VALUE o) { Int64 *p; Data_Get_Struct(self, Int64, p); if (TYPE(o) == T_DATA) { if (RBASIC(o)->klass == r_Int64) { Int64 *op; Data_Get_Struct(o, Int64, op); if (p->value == op->value) return Qtrue; } } return Qfalse; } |
#>(o) ⇒ Object
2008 2009 2010 2011 2012 2013 2014 2015 |
# File 'ext/primitive/primitive.c', line 2008 static VALUE r_Int64_gt(VALUE self, VALUE o) { Int64 *p; Data_Get_Struct(self, Int64, p); int64_t v = __accept_int64(o); return p->value > v ? Qtrue : Qfalse; } |
#>=(o) ⇒ Object
2000 2001 2002 2003 2004 2005 2006 2007 |
# File 'ext/primitive/primitive.c', line 2000 static VALUE r_Int64_ge(VALUE self, VALUE o) { Int64 *p; Data_Get_Struct(self, Int64, p); int64_t v = __accept_int64(o); return p->value >= v ? Qtrue : Qfalse; } |
#>>(o) ⇒ Object
2031 2032 2033 2034 2035 2036 2037 2038 |
# File 'ext/primitive/primitive.c', line 2031 static VALUE r_Int64_shr(VALUE self, VALUE o) { Int64 *p; Data_Get_Struct(self, Int64, p); int32_t d = __accept_int32(o); return __allocate_Int64(p->value >> d); } |
#^(o) ⇒ Object
2056 2057 2058 2059 2060 2061 2062 2063 |
# File 'ext/primitive/primitive.c', line 2056 static VALUE r_Int64_xor(VALUE self, VALUE o) { Int64 *p; Data_Get_Struct(self, Int64, p); int64_t v = __accept_int64(o); return __allocate_Int64(p->value ^ v); } |
#as_i ⇒ Object
1890 1891 1892 1893 1894 1895 1896 |
# File 'ext/primitive/primitive.c', line 1890 static VALUE r_Int64_to_i(VALUE self) { Int64 *p; Data_Get_Struct(self, Int64, p); return __int64_to_i(p->value); } |
#as_ruby ⇒ Object
1890 1891 1892 1893 1894 1895 1896 |
# File 'ext/primitive/primitive.c', line 1890 static VALUE r_Int64_to_i(VALUE self) { Int64 *p; Data_Get_Struct(self, Int64, p); return __int64_to_i(p->value); } |
#count ⇒ Object
2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 |
# File 'ext/primitive/primitive.c', line 2134 static VALUE r_Int64_count(VALUE self) { Int64 *p; Data_Get_Struct(self, Int64, p); int32_t c = 0; uint64_t u = (uint64_t) p->value; while (u != 0) { u &= u - 1; c += 1; } return __allocate_Int32(c); } |
#eql?(o) ⇒ Boolean
1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 |
# File 'ext/primitive/primitive.c', line 1800 static VALUE r_Int64_equals(VALUE self, VALUE o) { Int64 *p; Data_Get_Struct(self, Int64, p); if (TYPE(o) == T_DATA) { if (RBASIC(o)->klass == r_Int64) { Int64 *op; Data_Get_Struct(o, Int64, op); if (p->value == op->value) return Qtrue; } } return Qfalse; } |
#equals(o) ⇒ Object
1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 |
# File 'ext/primitive/primitive.c', line 1800 static VALUE r_Int64_equals(VALUE self, VALUE o) { Int64 *p; Data_Get_Struct(self, Int64, p); if (TYPE(o) == T_DATA) { if (RBASIC(o)->klass == r_Int64) { Int64 *op; Data_Get_Struct(o, Int64, op); if (p->value == op->value) return Qtrue; } } return Qfalse; } |
#hash ⇒ Object
1829 1830 1831 1832 1833 1834 1835 |
# File 'ext/primitive/primitive.c', line 1829 static VALUE r_Int64_hash(VALUE self) { Int64 *p; Data_Get_Struct(self, Int64, p); return LONG2NUM((long) __hash_int64(p->value)); } |
#hashCode ⇒ Object
1815 1816 1817 1818 1819 1820 1821 |
# File 'ext/primitive/primitive.c', line 1815 static VALUE r_Int64_hashCode(VALUE self) { Int64 *p; Data_Get_Struct(self, Int64, p); return __allocate_Int32(__hash_int64(p->value)); } |
#inspect ⇒ Object
1836 1837 1838 1839 1840 1841 1842 |
# File 'ext/primitive/primitive.c', line 1836 static VALUE r_Int64_to_s(VALUE self) { Int64 *p; Data_Get_Struct(self, Int64, p); return __int64_to_s(p->value); } |
#new_fixnum ⇒ Object
2093 2094 2095 2096 2097 2098 2099 |
# File 'ext/primitive/primitive.c', line 2093 static VALUE r_Int64_to_fixnum(VALUE self) { Int64 *p; Data_Get_Struct(self, Int64, p); return LONG2NUM((long) p->value); } |
#rol(o) ⇒ Object
2116 2117 2118 2119 2120 2121 2122 2123 2124 |
# File 'ext/primitive/primitive.c', line 2116 static VALUE r_Int64_rol(VALUE self, VALUE o) { Int64 *p; Data_Get_Struct(self, Int64, p); uint64_t u = (uint64_t) p->value; int32_t d = __accept_int32(o); return __allocate_Int64((int64_t) (u << d | u >> (64 - d))); } |
#ror(o) ⇒ Object
2125 2126 2127 2128 2129 2130 2131 2132 2133 |
# File 'ext/primitive/primitive.c', line 2125 static VALUE r_Int64_ror(VALUE self, VALUE o) { Int64 *p; Data_Get_Struct(self, Int64, p); uint64_t u = (uint64_t) p->value; int32_t d = __accept_int32(o); return __allocate_Int64((int64_t) (u >> d | u << (64 - d))); } |
#signum ⇒ Object
2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 |
# File 'ext/primitive/primitive.c', line 2147 static VALUE r_Int64_signum(VALUE self) { Int64 *p; Data_Get_Struct(self, Int64, p); if (p->value < 0) return r_INT32_M1; if (p->value > 0) return r_INT32_1; return r_INT32_0; } |
#succ ⇒ Object
2107 2108 2109 2110 2111 2112 2113 2114 2115 |
# File 'ext/primitive/primitive.c', line 2107 static VALUE r_Int64_succ(VALUE self) { Int64 *p; Data_Get_Struct(self, Int64, p); if (p->value == 0x7FFFFFFFFFFFFFFFL) rb_raise(rb_eStopIteration, "StopIteration"); return __allocate_Int64(p->value + 1); } |
#times ⇒ Object
2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 |
# File 'ext/primitive/primitive.c', line 2158 static VALUE r_Int64_times(VALUE self) { Int64 *p; Data_Get_Struct(self, Int64, p); int64_t i = 0; while (i < p->value) { rb_yield(__allocate_Int64(i)); i += 1; } return Qnil; } |
#to_byte ⇒ Object
1843 1844 1845 1846 1847 1848 1849 |
# File 'ext/primitive/primitive.c', line 1843 static VALUE r_Int64_to_byte(VALUE self) { Int64 *p; Data_Get_Struct(self, Int64, p); return __allocate_Byte((int8_t) p->value); } |
#to_char ⇒ Object
1850 1851 1852 1853 1854 1855 1856 |
# File 'ext/primitive/primitive.c', line 1850 static VALUE r_Int64_to_char(VALUE self) { Int64 *p; Data_Get_Struct(self, Int64, p); return __allocate_Char((uint16_t) p->value); } |
#to_f ⇒ Object
1897 1898 1899 1900 1901 1902 1903 |
# File 'ext/primitive/primitive.c', line 1897 static VALUE r_Int64_to_f(VALUE self) { Int64 *p; Data_Get_Struct(self, Int64, p); return __int64_to_f(p->value); } |
#to_fixnum ⇒ Object
2093 2094 2095 2096 2097 2098 2099 |
# File 'ext/primitive/primitive.c', line 2093 static VALUE r_Int64_to_fixnum(VALUE self) { Int64 *p; Data_Get_Struct(self, Int64, p); return LONG2NUM((long) p->value); } |
#to_float32 ⇒ Object
1876 1877 1878 1879 1880 1881 1882 |
# File 'ext/primitive/primitive.c', line 1876 static VALUE r_Int64_to_float32(VALUE self) { Int64 *p; Data_Get_Struct(self, Int64, p); return __allocate_Float32((float) p->value); } |
#to_float64 ⇒ Object
1883 1884 1885 1886 1887 1888 1889 |
# File 'ext/primitive/primitive.c', line 1883 static VALUE r_Int64_to_float64(VALUE self) { Int64 *p; Data_Get_Struct(self, Int64, p); return __allocate_Float64((double) p->value); } |
#to_hex ⇒ Object
2100 2101 2102 2103 2104 2105 2106 |
# File 'ext/primitive/primitive.c', line 2100 static VALUE r_Int64_to_hex(VALUE self) { Int64 *p; Data_Get_Struct(self, Int64, p); return __int64_to_hex(p->value); } |
#to_i ⇒ Object
1890 1891 1892 1893 1894 1895 1896 |
# File 'ext/primitive/primitive.c', line 1890 static VALUE r_Int64_to_i(VALUE self) { Int64 *p; Data_Get_Struct(self, Int64, p); return __int64_to_i(p->value); } |
#to_int ⇒ Object
1890 1891 1892 1893 1894 1895 1896 |
# File 'ext/primitive/primitive.c', line 1890 static VALUE r_Int64_to_i(VALUE self) { Int64 *p; Data_Get_Struct(self, Int64, p); return __int64_to_i(p->value); } |
#to_int16 ⇒ Object
1857 1858 1859 1860 1861 1862 1863 |
# File 'ext/primitive/primitive.c', line 1857 static VALUE r_Int64_to_int16(VALUE self) { Int64 *p; Data_Get_Struct(self, Int64, p); return __allocate_Int16((int16_t) p->value); } |
#to_int32 ⇒ Object
1864 1865 1866 1867 1868 1869 1870 |
# File 'ext/primitive/primitive.c', line 1864 static VALUE r_Int64_to_int32(VALUE self) { Int64 *p; Data_Get_Struct(self, Int64, p); return __allocate_Int32((int32_t) p->value); } |
#to_int64 ⇒ Object
1871 1872 1873 1874 1875 |
# File 'ext/primitive/primitive.c', line 1871 static VALUE r_Int64_to_int64(VALUE self) { return self; } |
#to_s ⇒ Object
1836 1837 1838 1839 1840 1841 1842 |
# File 'ext/primitive/primitive.c', line 1836 static VALUE r_Int64_to_s(VALUE self) { Int64 *p; Data_Get_Struct(self, Int64, p); return __int64_to_s(p->value); } |
#toString ⇒ Object
1822 1823 1824 1825 1826 1827 1828 |
# File 'ext/primitive/primitive.c', line 1822 static VALUE r_Int64_toString(VALUE self) { Int64 *p; Data_Get_Struct(self, Int64, p); return rb_funcall(__int64_to_s(p->value), TO_J_ID, 0); } |
#ushr(o) ⇒ Object
2039 2040 2041 2042 2043 2044 2045 2046 2047 |
# File 'ext/primitive/primitive.c', line 2039 static VALUE r_Int64_ushr(VALUE self, VALUE o) { Int64 *p; Data_Get_Struct(self, Int64, p); uint64_t u = (uint64_t) p->value; int32_t d = __accept_int32(o); return __allocate_Int64((int64_t) (u >> d)); } |
#|(o) ⇒ Object
2064 2065 2066 2067 2068 2069 2070 2071 |
# File 'ext/primitive/primitive.c', line 2064 static VALUE r_Int64_or(VALUE self, VALUE o) { Int64 *p; Data_Get_Struct(self, Int64, p); int64_t v = __accept_int64(o); return __allocate_Int64(p->value | v); } |
#~ ⇒ Object
2016 2017 2018 2019 2020 2021 2022 |
# File 'ext/primitive/primitive.c', line 2016 static VALUE r_Int64_inv(VALUE self) { Int64 *p; Data_Get_Struct(self, Int64, p); return __allocate_Int64(~p->value); } |