Module org.maxicp

Class Profile

java.lang.Object
org.maxicp.cp.engine.constraints.Profile

public class Profile extends Object
Representation of a cumulated Profile data structure as a contiguous sequence of Profile.Rectangle built from a set of Profile.Rectangle using a sweep-line algorithm.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Profile(org.maxicp.cp.engine.constraints.Profile.Rectangle... rectangles)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.maxicp.cp.engine.constraints.Profile.Rectangle
    get(int i)
     
    int
    Retrieves the rectangle index of the profile that overlaps a given time.
    org.maxicp.cp.engine.constraints.Profile.Rectangle[]
    Get the cumulated Profile from the rectangles passed in argument to the constructor.
    int
    Return the number of rectangles in the profile.
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Profile

      public Profile(org.maxicp.cp.engine.constraints.Profile.Rectangle... rectangles)
  • Method Details

    • rectangles

      public org.maxicp.cp.engine.constraints.Profile.Rectangle[] rectangles()
      Get the cumulated Profile from the rectangles passed in argument to the constructor.
      Returns:
      the cumulated profile is a contiguous sequence of Profile.Rectangle
    • rectangleIndex

      public int rectangleIndex(int t)
      Retrieves the rectangle index of the profile that overlaps a given time.
      Parameters:
      t - the time at which we want to retrieve the overlapping rectangle
      Returns:
      the rectangle index r of the profile such that r.start <= t and r.end > t
    • size

      public int size()
      Return the number of rectangles in the profile.
      Returns:
      the number of rectangles in the profile
    • get

      public org.maxicp.cp.engine.constraints.Profile.Rectangle get(int i)
      Parameters:
      i - the rectangle index
      Returns:
      the rectangle of the profile at index i
      See Also:
    • toString

      public String toString()
      Overrides:
      toString in class Object