com.groovemanager.sampled.waveform
Class Selection

java.lang.Object
  extended by com.groovemanager.sampled.waveform.Selection

public class Selection
extends java.lang.Object

A selection is an immutable class, that represents a selection consisting of a left and a right border

Author:
Manu Robledo

Field Summary
protected  int left
          The left border
protected  int right
          The left border
 
Constructor Summary
Selection(int left)
          Create a new Selection which has the same left and right border
Selection(int left, int right)
          Create a new selection
 
Method Summary
 int getLeft()
          Get the value of the left border
 int getLength()
          Get the length of this selection
 int getRight()
          Get the value for the right border
 boolean isEmpty()
          Ask this Selection, if its left border is the same than its right border
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

left

protected final int left
The left border


right

protected final int right
The left border

Constructor Detail

Selection

public Selection(int left)
Create a new Selection which has the same left and right border

Parameters:
left - The value for the left and the right border

Selection

public Selection(int left,
                 int right)
Create a new selection

Parameters:
left - The value for the left border
right - The value for the right border
Method Detail

getLeft

public int getLeft()
Get the value of the left border

Returns:
The left border

getLength

public int getLength()
Get the length of this selection

Returns:
The length of this selection, that is the space between left and right border

getRight

public int getRight()
Get the value for the right border

Returns:
The right border

isEmpty

public boolean isEmpty()
Ask this Selection, if its left border is the same than its right border

Returns:
true, if left and right border are the same, false otherwise