ilog.views.graphic
Class IlvTextSelection.Range

java.lang.Object
  extended by ilog.views.graphic.IlvTextSelection.Range
Enclosing class:
IlvTextSelection

public static class IlvTextSelection.Range
extends Object

This inner class is used to indicate the selection interval while editing a graphic object implementing IlvTextInterface. The range might be empty or collapsed, both have different means according to the using context.

Since:
JViews 7.5

Field Summary
 int from
          The start index of the interval, must be less than or equal to the to parameter.
 int to
          The end index of the interval, must be greater than or equal to the from parameter.
 
Constructor Summary
IlvTextSelection.Range()
          Create an empty range.
IlvTextSelection.Range(int index)
          Creates a collapsed range.
IlvTextSelection.Range(int from, int to)
          Create a range for the specified interval.
 
Method Summary
 boolean isCollapsed()
          Tells if the range is collapsed, that means the from and the to index are the same.
 boolean isEmpty()
          Tells if the range is empty, that means the interval is not valid.
 void setRange(IlvTextSelection.Range range)
          Copies from another Range object.
 void setRange(int from, int to)
          Specifies the interval of the range.
 String toString()
          Converts the range to a string, examples: [1:20], [4:4].
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

from

public int from
The start index of the interval, must be less than or equal to the to parameter.


to

public int to
The end index of the interval, must be greater than or equal to the from parameter.

Constructor Detail

IlvTextSelection.Range

public IlvTextSelection.Range()
Create an empty range.


IlvTextSelection.Range

public IlvTextSelection.Range(int from,
                              int to)
Create a range for the specified interval.

Parameters:
from - The start index of the interval, must be less than or equal to the to parameter.
to - The end index of the interval, must be greater than or equal to the from parameter.

IlvTextSelection.Range

public IlvTextSelection.Range(int index)
Creates a collapsed range.

Parameters:
index - The start and the end index.
Method Detail

setRange

public void setRange(int from,
                     int to)
Specifies the interval of the range.

Parameters:
from - The start index of the interval, should be less than or equal to the to parameter.
to - The end index of the interval, should be grater than or equal to the from parameter.

setRange

public void setRange(IlvTextSelection.Range range)
Copies from another Range object.

Parameters:
range - The source Range object.

isEmpty

public boolean isEmpty()
Tells if the range is empty, that means the interval is not valid.

Returns:
True, if the interval in not valid.

isCollapsed

public boolean isCollapsed()
Tells if the range is collapsed, that means the from and the to index are the same.

Returns:
True, if the ranged is collapsed.

toString

public String toString()
Converts the range to a string, examples: [1:20], [4:4].

Overrides:
toString in class Object
Returns:
The text expression of the range.


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