Class SpanSquare

    • Field Summary

      Fields 
      Modifier and Type Field Description
      double density  
      long end  
      long mass  
      long start  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
        SpanSquare​(long start, long end)  
        SpanSquare​(long start, long end, long mass)  
      private SpanSquare​(long start, long end, long mass, double density)  
    • Field Detail

      • start

        public final long start
      • end

        public final long end
      • mass

        public final long mass
      • density

        public final double density
    • Constructor Detail

      • SpanSquare

        public SpanSquare​(long start,
                          long end)
      • SpanSquare

        public SpanSquare​(long start,
                          long end,
                          long mass)
      • SpanSquare

        private SpanSquare​(long start,
                           long end,
                           long mass,
                           double density)
    • Method Detail

      • combineWith

        public SpanSquare combineWith​(SpanSquare other)
        Description copied from interface: Combinable
        Combine this object with another object if it is possible and return a combined object. This method may determine that it is not possible to combine the objects and return null in that case.
        Specified by:
        combineWith in interface Combinable<SpanSquare>
        Parameters:
        other - an object to combine this object with
        Returns:
        a combined object, or null if the objects shouldn't be combined
      • calculateDensity

        private static double calculateDensity​(long start,
                                               long end,
                                               long mass)
      • toString

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