Whole document tree
javax.swing
|
Constructor Summary | |
SizeSequence()
Creates a new SizeSequence object
that contains no entries. |
|
SizeSequence(int numEntries)
Creates a new SizeSequence object
that contains the specified number of entries,
all initialized to have size 0. |
|
SizeSequence(int[] sizes)
Creates a new SizeSequence object
that contains the specified sizes. |
|
SizeSequence(int numEntries,
int value)
Creates a new SizeSequence object
that contains the specified number of entries,
all initialized to have size value . |
Method Summary | |
int |
getIndex(int position)
Returns the index of the entry that corresponds to the specified position. |
int |
getPosition(int index)
Returns the start position for the specified entry. |
int |
getSize(int index)
Returns the size of the specified entry. |
int[] |
getSizes()
Returns the size of all entries. |
void |
insertEntries(int start,
int length,
int value)
Adds a contiguous group of entries to this SizeSequence . |
void |
removeEntries(int start,
int length)
Removes a contiguous group of entries from this SizeSequence . |
void |
setSize(int index,
int size)
Sets the size of the specified entry. |
void |
setSizes(int[] sizes)
Resets this SizeSequence object,
using the data in the sizes argument. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
public int[] getSizes()
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.index
- the index of the entry whose position is desiredpublic int getIndex(int position)
getIndex(0)
is 0,
since the first entry always starts at position 0.position
- the position of the entrypublic int getSize(int index)
index
- the index corresponding to the entrypublic void setSize(int index, int size)
index
- the index corresponding to the entrysize
- the size of the entrypublic void insertEntries(int start, int length, int value)
SizeSequence
.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
.start
- the index of the first entry to be removedlength
- the number of entries to be removed
|
JavaTM 2 Platform Std. Ed. v1.3.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Java, Java 2D, and JDBC are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-2001 Sun Microsystems, Inc. 901 San Antonio Road
Palo Alto, California, 94303, U.S.A. All Rights Reserved.