Module org.dyn4j

Class Capacity


  • public class Capacity
    extends java.lang.Object
    Represents the estimated number of objects of different types.

    This class is used to initially size internal structures to improve performance. These same structures will grow larger than the given sizes if necessary.

    Since:
    3.2.0
    Version:
    3.2.0
    Author:
    William Bittle
    • Field Detail

      • DEFAULT_CAPACITY

        public static final Capacity DEFAULT_CAPACITY
        The default capacity
    • Constructor Detail

      • Capacity

        public Capacity()
        Default constructor.

        Creates a default capacity with the default counts.

      • Capacity

        public Capacity​(int bodyCount,
                        int jointCount,
                        int listenerCount)
        Full constructor.
        Parameters:
        bodyCount - the estimated number of bodies
        jointCount - the estimated number of joints
        listenerCount - the estimated number of listeners
        Throws:
        java.lang.IllegalArgumentException - if any count is less than zero
    • Method Detail

      • equals

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

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

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

        public int getBodyCount()
        Returns the estimated number of bodies.
        Returns:
        int
      • getJointCount

        public int getJointCount()
        Returns the estimated number of joints.
        Returns:
        int
      • getListenerCount

        public int getListenerCount()
        Returns the estimated number of listeners.
        Returns:
        int