Class IntArray

  • All Implemented Interfaces:
    java.io.Serializable

    public class IntArray
    extends java.lang.Object
    implements java.io.Serializable
    See Also:
    Serialized Form
    • Constructor Detail

      • IntArray

        public IntArray()
      • IntArray

        public IntArray​(int capacity)
      • IntArray

        public IntArray​(int[] a)
        Shallow constructor.
        Parameters:
        a -
      • IntArray

        public IntArray​(IntArray ia)
        Deep constructor.
        Parameters:
        ia -
    • Method Detail

      • calculateHashCode

        public void calculateHashCode()
      • getCapacity

        public int getCapacity()
      • removeValue

        public void removeValue​(int value)
        Computational expensive operation!
        Parameters:
        value -
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • get

        public int get​(int i)
      • get

        public int[] get()
        Returns:
        shallow copy.
      • add

        public int add​(int v)
      • max

        public int max()
      • add

        public void add​(int[] a)
      • add

        public void add​(java.util.List<java.lang.Integer> li)
      • add

        public void add​(byte[] a)
      • length

        public int length()
        Returns:
        number of occupied fields.
      • removeLast

        public int removeLast()
        Returns:
        last value in the array and removes it.
      • set

        public void set​(int index,
                        int value)
      • toList

        public java.util.List<java.lang.Integer> toList()
      • clear

        public void clear()
      • reset

        public void reset()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • toString

        public java.lang.String toString​(java.lang.String seperator)
      • read

        public static IntArray read​(java.io.InputStream s)
                             throws java.io.IOException
        Throws:
        java.io.IOException
      • write2String

        public java.lang.String write2String()
                                      throws java.io.IOException
        Throws:
        java.io.IOException
      • parseInteger

        public static int parseInteger​(java.io.InputStream s)
                                throws java.io.IOException
        Throws:
        java.io.IOException
      • sort

        public void sort()
      • shuffle

        public static void shuffle​(IntArray arr)
      • read

        public static IntArray read​(java.lang.String l)
      • equals

        public static boolean equals​(int[] a,
                                     int[] b)
      • toList

        public static java.util.List<java.lang.Integer> toList​(int[] a)
      • resize

        public static int[] resize​(int[] data,
                                   int newlen)