|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.swing.SizeSequence
Safe:
Field Summary | |
private int[] |
a
|
private static int[] |
emptyArray
|
Constructor Summary | |
SizeSequence()
Enabled: Creates a new SizeSequence object
that contains no entries. |
|
SizeSequence(int numEntries)
Enabled: Creates a new SizeSequence object
that contains the specified number of entries,
all initialized to have size 0. |
|
SizeSequence(int[] sizes)
Enabled: Creates a new SizeSequence object
that contains the specified sizes. |
|
SizeSequence(int numEntries,
int value)
Enabled: Creates a new SizeSequence object
that contains the specified number of entries,
all initialized to have size value . |
Method Summary | |
private void |
changeSize(int from,
int to,
int index,
int delta)
|
int |
getIndex(int position)
Enabled: Returns the index of the entry that corresponds to the specified position. |
private int |
getIndex(int from,
int to,
int position)
|
int |
getPosition(int index)
Enabled: Returns the start position for the specified entry. |
private int |
getPosition(int from,
int to,
int index)
|
int |
getSize(int index)
Enabled: Returns the size of the specified entry. |
int[] |
getSizes()
Enabled: Returns the size of all entries. |
private int |
getSizes(int from,
int to,
int[] sizes)
|
void |
insertEntries(int start,
int length,
int value)
Enabled: Adds a contiguous group of entries to this SizeSequence . |
void |
removeEntries(int start,
int length)
Enabled: Removes a contiguous group of entries from this SizeSequence . |
void |
setSize(int index,
int size)
Enabled: Sets the size of the specified entry. |
void |
setSizes(int[] sizes)
Enabled: Resets this SizeSequence object,
using the data in the sizes argument. |
private int |
setSizes(int from,
int to,
int[] sizes)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static int[] emptyArray
private int[] a
Constructor Detail |
public SizeSequence()
SizeSequence
object
that contains no entries. To add entries, you
can use insertEntries
or setSizes
.
insertEntries(int, int, int)
,
setSizes(int[])
public SizeSequence(int numEntries)
SizeSequence
object
that contains the specified number of entries,
all initialized to have size 0.
numEntries
- the number of sizes to trackpublic SizeSequence(int numEntries, int value)
SizeSequence
object
that contains the specified number of entries,
all initialized to have size value
.
numEntries
- the number of sizes to trackvalue
- the initial value of each sizepublic SizeSequence(int[] sizes)
SizeSequence
object
that contains the specified sizes.
sizes
- the array of sizes to be contained in
the SizeSequence
Method Detail |
public void setSizes(int[] sizes)
SizeSequence
object,
using the data in the sizes
argument.
This method reinitializes this object so that it
contains as many entries as the sizes
array.
Each entry's size is initialized to the value of the
corresponding item in sizes
.
sizes
- the array of sizes to be contained in
this SizeSequence
private int setSizes(int from, int to, int[] sizes)
public int[] getSizes()
private int getSizes(int from, int to, int[] sizes)
public int getPosition(int index)
getPosition(0)
returns 0,
getPosition(1)
is equal to
getSize(0)
,
getPosition(2)
is equal to
getSize(0)
+ getSize(1)
,
and so on.
Note that if index
is greater than
length
the value returned may
be meaningless.
index
- the index of the entry whose position is desired
private int getPosition(int from, int to, int index)
public int getIndex(int position)
getIndex(0)
is 0,
since the first entry always starts at position 0.
position
- the position of the entry
private int getIndex(int from, int to, int position)
public int getSize(int index)
index
is out of the range
(0 <= index < getSizes().length)
the behavior is unspecified.
index
- the index corresponding to the entry
public void setSize(int index, int size)
index
does not fall in the range:
(0 <= index < getSizes().length)
the behavior is unspecified.
index
- the index corresponding to the entrysize
- the size of the entryprivate void changeSize(int from, int to, int index, int delta)
public void insertEntries(int start, int length, int value)
SizeSequence
.
Note that the values of start
and
length
must satisfy the following
conditions: (0 <= start < getSizes().length)
AND (length >= 0)
. If these conditions are
not met, the behavior is unspecified and an exception
may be thrown.
start
- the index to be assigned to the first entry
in the grouplength
- the number of entries in the groupvalue
- the size to be assigned to each new entrypublic void removeEntries(int start, int length)
SizeSequence
.
Note that the values of start
and
length
must satisfy the following
conditions: (0 <= start < getSizes().length)
AND (length >= 0)
. If these conditions are
not met, the behavior is unspecified and an exception
may be thrown.
start
- the index of the first entry to be removedlength
- the number of entries to be removed
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |