All Packages  Class Hierarchy  This Package  Previous  Next  Index  

Class java.awt.swing.text.Segment

java.lang.Object
    |
    +----java.awt.swing.text.Segment

public class Segment
extends Object
A segment of a character array representing a fragment of text. It should be treated as immutable even though the array is directly accessable. This gives fast access to fragments of text without the overhead of copying around characters. This is effectively an unprotected String.


Variable Index

 o array
This is the array containing the text of interest.
 o count
This is the number of array elements that make up the text of interest.
 o offset
This is the offset into the array that the desired text begins.

Constructor Index

 o Segment()
Creates a new segment.
 o Segment(char[], int, int)
Creates a new segment referring to an existing array.

Method Index

 o toString()
Converts a segment into a String.

Variables

 o array
public char[] array
This is the array containing the text of interest. This array should never be modified; it is available only for efficiency.

 o offset
public int offset
This is the offset into the array that the desired text begins.

 o count
public int count
This is the number of array elements that make up the text of interest.

Constructors

 o Segment
public Segment()
Creates a new segment.

 o Segment
public Segment(char[] array,
               int offset,
               int count)
Creates a new segment referring to an existing array.

Parameters:
array - the array to refer to
offset - the offset into the array
count - the number of characters

Methods

 o toString
public String toString()
Converts a segment into a String.

Returns:
the string
Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index  

Submit a bug or feature