Oracle® Fusion Middleware C++ API Reference for Oracle Coherence
12c (12.2.1.3.0)

E80355-01

coherence/lang/Integer64.hpp

00001 /*
00002 * Integer64.hpp
00003 *
00004 * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
00005 *
00006 * Oracle is a registered trademarks of Oracle Corporation and/or its
00007 * affiliates.
00008 *
00009 * This software is the confidential and proprietary information of Oracle
00010 * Corporation. You shall not disclose such confidential and proprietary
00011 * information and shall use it only in accordance with the terms of the
00012 * license agreement you entered into with Oracle.
00013 *
00014 * This notice may not be removed or altered.
00015 */
00016 #ifndef COH_INTEGER64_HPP
00017 #define COH_INTEGER64_HPP
00018 
00019 #include "coherence/lang/compatibility.hpp"
00020 
00021 #include "coherence/lang/Number.hpp"
00022 #include "coherence/lang/Primitive.hpp"
00023 #include "coherence/lang/TypedHandle.hpp"
00024 
00025 COH_OPEN_NAMESPACE2(coherence,lang)
00026 
00027 
00028 /**
00029 * An immutable 64-bit integer value.
00030 *
00031 * @author jh  2008.04.01
00032 */
00033 class COH_EXPORT Integer64
00034     : public cloneable_spec<Integer64,
00035         extends<Primitive<int64_t> >,
00036         implements<Number, Comparable> >
00037     {
00038     friend class factory<Integer64>;
00039 
00040     // ----- constructors ---------------------------------------------------
00041 
00042     private:
00043         /**
00044         * Create a new Integer64 instance.
00045         *
00046         * @param l the value of the new Integer64
00047         */
00048         Integer64(int64_t l);
00049 
00050         /**
00051         * Copy constructor.
00052         */
00053         Integer64(const Integer64& that);
00054 
00055 
00056     // ----- Number interface -----------------------------------------------
00057 
00058     public:
00059         /**
00060         * {@inheritDoc}
00061         */
00062         virtual int16_t getInt16Value() const;
00063 
00064         /**
00065         * {@inheritDoc}
00066         */
00067         virtual int32_t getInt32Value() const;
00068 
00069         /**
00070         * {@inheritDoc}
00071         */
00072         virtual int64_t getInt64Value() const;
00073 
00074         /**
00075         * {@inheritDoc}
00076         */
00077         virtual float32_t getFloat32Value() const;
00078 
00079         /**
00080         * {@inheritDoc}
00081         */
00082         virtual float64_t getFloat64Value() const;
00083 
00084 
00085     // ----- static methods -------------------------------------------------
00086 
00087     public:
00088         /**
00089         * Factory method to produce Integer64 objects with an optimization
00090         * that uses cached objects for all relatively-low numbers.
00091         *
00092         * @param l  an int64_t
00093         *
00094         * @return an Integer64 whose value is the passed int64_t
00095         */
00096         static Handle valueOf(int64_t l);
00097 
00098 
00099     // ----- constants ------------------------------------------------------
00100 
00101     public:
00102         /**
00103         * A constant for the minimum representable value.
00104         */
00105         static const int64_t min_value = COH_INT64(0x80000000U, 0x0);
00106 
00107         /**
00108         * A constant for the maximum representable value.
00109         */
00110         static const int64_t max_value = COH_INT64(0x7FFFFFFFU, 0xFFFFFFFFU);
00111     };
00112 
00113 COH_CLOSE_NAMESPACE2
00114 
00115 #endif // COH_INTEGER64_HPP
Copyright © 2000, 2017, Oracle and/or its affiliates. All rights reserved.