Enum FlyweightType

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<FlyweightType>

    enum FlyweightType
    extends java.lang.Enum<FlyweightType>
    Enum with all the flyweight types that we check for sizeOf measurements
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.Class<?> clazz  
      private static java.util.Set<java.util.Locale> GLOBAL_LOCALES  
      private static java.util.Map<java.lang.Class<?>,​FlyweightType> TYPE_MAPPINGS  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private FlyweightType​(java.lang.Class<?> clazz)  
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) static FlyweightType getFlyweightType​(java.lang.Class<?> aClazz)
      Will return the Flyweight enum instance for the flyweight Class, or null if type isn't flyweight
      (package private) abstract boolean isShared​(java.lang.Object obj)
      Whether this is a shared object
      static FlyweightType valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static FlyweightType[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • BOOLEAN

        public static final FlyweightType BOOLEAN
        java.lang.Boolean
      • INTEGER

        public static final FlyweightType INTEGER
        java.lang.Integer
      • BIGINTEGER

        public static final FlyweightType BIGINTEGER
        java.math.BigInteger
      • BIGDECIMAL

        public static final FlyweightType BIGDECIMAL
        java.math.BigDecimal
      • MATHCONTEXT

        public static final FlyweightType MATHCONTEXT
        java.math.MathContext
      • CHARACTER

        public static final FlyweightType CHARACTER
        java.lang.Character
      • LOCALE

        public static final FlyweightType LOCALE
        java.lang.Locale
      • LOGGER

        public static final FlyweightType LOGGER
        java.util.Logger
      • CODINGERRORACTION

        public static final FlyweightType CODINGERRORACTION
        java.nio.charset.CodingErrorAction
      • DATATYPECONSTANTS_FIELD

        public static final FlyweightType DATATYPECONSTANTS_FIELD
        javax.xml.datatype.DatatypeConstants.Field
      • QNAME

        public static final FlyweightType QNAME
        javax.xml.namespace.QName
      • MISC

        public static final FlyweightType MISC
        misc comparisons that can not rely on the object's class.
    • Field Detail

      • TYPE_MAPPINGS

        private static final java.util.Map<java.lang.Class<?>,​FlyweightType> TYPE_MAPPINGS
      • GLOBAL_LOCALES

        private static final java.util.Set<java.util.Locale> GLOBAL_LOCALES
      • clazz

        private final java.lang.Class<?> clazz
    • Constructor Detail

      • FlyweightType

        private FlyweightType​(java.lang.Class<?> clazz)
    • Method Detail

      • values

        public static FlyweightType[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (FlyweightType c : FlyweightType.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static FlyweightType valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • isShared

        abstract boolean isShared​(java.lang.Object obj)
        Whether this is a shared object
        Parameters:
        obj - the object to check for
        Returns:
        true, if shared
      • getFlyweightType

        static FlyweightType getFlyweightType​(java.lang.Class<?> aClazz)
        Will return the Flyweight enum instance for the flyweight Class, or null if type isn't flyweight
        Parameters:
        aClazz - the class we need the FlyweightType instance for
        Returns:
        the FlyweightType, or null