ilog.cpl.graphic.views
Class IlpSlotSizes

java.lang.Object
  extended by ilog.cpl.graphic.views.IlpSlotSizes
All Implemented Interfaces:
Cloneable

public class IlpSlotSizes
extends Object
implements Cloneable

This class encapsulates a bi-dimensional array of slots containing the size of each row and column.

It does not provide methods to set values, to avoid synchronization problems with the attribute value SlotSizes from IltShelf.

It is also internally used by implementations of IltShelfItemContainer classes.

Since:
JTGO 3.0

Constructor Summary
IlpSlotSizes()
          Creates a new zero-length array of slots.
IlpSlotSizes(int[] width, int[] height)
          Creates a new array based on two given arrays.
IlpSlotSizes(int columns, int rows, int width, int height)
          Creates a new array with fixed width and height.
 
Method Summary
 Object clone()
           
protected  int[] createArray(int count, int slotSize)
          Creates a array to be used internally based on the given parameters.
 boolean equals(Object obj)
           
 int[] getHeights()
          Method to access the whole array of height sizes.
 int getHeightSize(int heightIndex)
          Method to access the height size of a slot.
 int[] getWidths()
          Returns the whole array of width sizes.
 int getWidthSize(int widthIndex)
          Method to access the width size of a slot.
 int hashCode()
           
protected  void setHeights(int[] h)
          Sets the whole array of height sizes.
protected  void setWidths(int[] w)
          Sets the whole array of width sizes.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlpSlotSizes

public IlpSlotSizes()
Creates a new zero-length array of slots.


IlpSlotSizes

public IlpSlotSizes(int[] width,
                    int[] height)
Creates a new array based on two given arrays.

Both arrays must be non-null.

Parameters:
width - The array representing the width sizes.
height - The array representing the height sizes.
Throws:
IllegalArgumentException - When at least one of the parameters is null.

IlpSlotSizes

public IlpSlotSizes(int columns,
                    int rows,
                    int width,
                    int height)
Creates a new array with fixed width and height.

Non negative values are allowed.

Parameters:
columns - The number of columns in the array.
rows - The number of rows in the array.
width - The width of each slot.
height - The height of each slot.
Throws:
IllegalArgumentException - When the parameters are invalid (negative values)
Method Detail

getWidthSize

public int getWidthSize(int widthIndex)
Method to access the width size of a slot.

Parameters:
widthIndex - The width index to address the slot.
Returns:
The width size of the slot.
Throws:
ArrayOutOfBoundsException - if the index is out of bounds.

getHeightSize

public int getHeightSize(int heightIndex)
Method to access the height size of a slot.

Parameters:
heightIndex - The height index to address the slot.
Returns:
The height size of the slot.
Throws:
ArrayOutOfBoundsException - if the index is out of bounds.

getWidths

public int[] getWidths()
Returns the whole array of width sizes.

Returns:
A copy of the whole array of widths

setWidths

protected void setWidths(int[] w)
Sets the whole array of width sizes.

Parameters:
w - New slot width
Since:
JViews 7.5

getHeights

public int[] getHeights()
Method to access the whole array of height sizes.

Returns:
A copy of the whole array of heights.

setHeights

protected void setHeights(int[] h)
Sets the whole array of height sizes.

Parameters:
h - New slot heights
Since:
JViews 7.5

createArray

protected int[] createArray(int count,
                            int slotSize)
Creates a array to be used internally based on the given parameters.

Parameters:
count - Slot count
slotSize - Slot size
Returns:
Array of size values with count slots

clone

public Object clone()
Overrides:
clone in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.   . All Rights Reserved.