|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
A basic SizeSequence functionality in the form of an interface.
This object can answer queries about the size and positions of the items.
Since this is meant to be a low-level interface, we do not make it a source of events. Yet it is a model, albeit a simple one, and notifications about change may be needed. For instance, a caching proxy would need to be aware of the modifications, and it would be difficult to guarantee that the model would only be accessed through the proxy.
| Inner Class Summary | |
static class |
Intervals.Factory
A factory to clone Interval objects and create default ones. |
| Method Summary | |
java.lang.Object |
clone()
Necessary to allow public access to the clone method. |
int |
getCount()
Returns the number of entries in this Intervals object |
int |
getDefaultSize()
returns the default size for new entries |
int |
getIndex(int position)
Returns the index of the entry that contains 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 array of sizes for all entries. |
boolean |
hasFixedSize()
Tests whether all the entries are the same size |
void |
insertEntries(int start,
int length,
int value)
Adds a continuous group of entries to this Intervals. |
void |
removeEntries(int start,
int length)
Removes a continuous group of entries from this Intervals. |
void |
setFixedSize(int size)
Sets a common size for all entries. |
void |
setSize(int index,
int size)
Sets the size of the specified entry. |
void |
setSizes(int[] sizes)
Sets the sizes for all entries from an array |
| Method Detail |
public int getDefaultSize()
public int getCount()
Intervals objectpublic int getSize(int index)
index - the index corresponding to the entry
public void setSize(int index,
int size)
index - the index corresponding to the entrysize - the size of the entrypublic void setFixedSize(int size)
size - the size of the entriespublic boolean hasFixedSize()
public int getIndex(int position)
position - the position of the entrypublic int getPosition(int index)
index - the index of the entry with the desired position.getSize(int).public int[] getSizes()
public void setSizes(int[] sizes)
public void insertEntries(int start,
int length,
int value)
Intervals.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 entry
public void removeEntries(int start,
int length)
Intervals.start - the index of the first entry to be removedlength - the number of entries to be removed
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||