Class PrimitiveArrayImpl

    • Constructor Detail

      • PrimitiveArrayImpl

        public PrimitiveArrayImpl​(int objectId,
                                  long address,
                                  ClassImpl classInstance,
                                  int length,
                                  int type)
        Constructs a primitive array
        Parameters:
        objectId - the id of the array
        address - the address of the array
        classInstance - the type (class) of the array
        length - the length in elements
        type - the actual type IObject.Type
    • Method Detail

      • getValueAt

        public Object getValueAt​(int index)
        Description copied from interface: IPrimitiveArray
        Returns the value of the array at the specified index
        Specified by:
        getValueAt in interface IPrimitiveArray
        Parameters:
        index - from 0 to length-1
        Returns:
        Byte - for a byte array Short - for a short array Integer - for an int array Long - for a long array Boolean - for a boolean array Char - for a char array Float - for a float array Double - for a double array
      • getValueArray

        public Object getValueArray()
        Description copied from interface: IPrimitiveArray
        Get the primitive Java array. The return value can be cast into the correct component type, e.g.
         if (char.class == array.getComponentType())
         {
             char[] content = (char[]) array.getValueArray();
             System.out.println(content.length);
         }
         
        The return value must not be modified because it is cached by the heap dump adapter. This method does not return a copy of the array for performance reasons.
        Specified by:
        getValueArray in interface IPrimitiveArray
      • getValueArray

        public Object getValueArray​(int offset,
                                    int length)
        Description copied from interface: IPrimitiveArray
        Get the primitive Java array, beginning at offset and length number of elements.

        The return value must not be modified because it is cached by the heap dump adapter. This method does not return a copy of the array for performance reasons.

        Specified by:
        getValueArray in interface IPrimitiveArray
      • getOutboundReferences

        public List<NamedReference> getOutboundReferences()
        Description copied from interface: IObject
        Get list of snapshot objects referenced from this snapshot object with the name of the field over which it was referenced.
        Specified by:
        getOutboundReferences in interface IObject
        Returns:
        list of snapshot objects referenced from this snapshot object with the name of the field over which it was referenced
      • doGetUsedHeapSize

        public static long doGetUsedHeapSize​(ClassImpl clazz,
                                             int length,
                                             int type)
        Calculates the size of a primitive array
        Parameters:
        clazz - the type
        length - the length in elements
        type - the actual type IObject.Type
        Returns:
        the size in bytes
        Since:
        1.0