Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## lp.trans
Class IntArrayWrapper

    java.lang.Object
      lp.trans.IntArrayWrapper

     class IntArrayWrapper

extends Object

A class used for storing an increasing sequence of nonnegative integers. It is very simple and error-prone. Designed only for internal use by the `DlpTransformer` and `EvolpTransformer` classes.

Version:
  1.0.0
Author:
  Martin Slota

Field Summary
`private int[]` | `members` An array with the sequence's members.
`private int` | `top` Index of the getTop element.

Constructor Summary
`IntArrayWrapper(int maxCount)` Constructs a new instance which can hold up to `maxCount` elements.

Method Summary
`void` | `add(int newMember)` Adds a new element to the sequence.
`boolean` | `contains(int number)` Returns `true` iff this sequence contains `number`.
`int` | `get(int i)` Returns the i-th member of this sequence.
`int` | `getMax()`
`int` | `getMaxLeqThan(int limit)` Returns the maximum element of this sequence that is less or equal than `limit`, or -1 if no such element exists.
`int` | `getTop()` Returns the index of the last element.
`boolean` | `isEmpty()` Returns `true` iff this sequence has 0 elements.
`int` | `length()` Returns current number of elements in this sequence.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### members

    private final int[] members

  An array with the sequence's members.

### top

    private int top

  Index of the getTop element.

Constructor Detail

### IntArrayWrapper

    public IntArrayWrapper(int maxCount)

  Constructs a new instance which can hold up to `maxCount` elements.

  Parameters:
    `maxCount` - capacity of this instance

Method Detail

### add

    public void add(int newMember)

  Adds a new element to the sequence. Doesn't check whether the capacity limit given in the constructor has been exceeded. The new member is only added in case it is bigger than the getTop element. If it's less or equal, nothing happens.

  Parameters:
    `newMember` - candidate for a new member of this sequence

### length

    public int length()

  Returns current number of elements in this sequence.

  Returns:
    current number of elements in this sequence

### getTop

    public int getTop()

  Returns the index of the last element.

  Returns:
    the index of the last element.

### get

    public int get(int i)

  Returns the i-th member of this sequence. DOESN'T CHECK whether `i` is a valid member index.

  Parameters:
    `i` -
  Returns:
    the i-th member of this sequence

### getMax

    public int getMax()

### getMaxLeqThan

    public int getMaxLeqThan(int limit)

  Returns the maximum element of this sequence that is less or equal than `limit`, or -1 if no such element exists.

  Parameters:
    `limit` - upper limit for the element returned
  Returns:
    the maximum element of this sequence that is less or equal than `limit`, or -1 if no such element exists.

### contains

    public boolean contains(int number)

  Returns `true` iff this sequence contains `number`.

  Parameters:
    `number` - the element to search for
  Returns:
    `true` if this sequence contains `number`, `false` otherwise

### isEmpty

    public boolean isEmpty()

  Returns `true` iff this sequence has 0 elements.

  Returns:
    `true` if this sequence has 0 elements, `false` otherwise.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD