public interface MSequence extends MData
MSequence
behaves like a list of typed objects. A size
limit can further constrain how many items this list can contain.
You create an MSequence
by calling the
MDataFactory.newSequence(String)
method.
Modifier and Type | Field and Description |
---|---|
static java.lang.String[] |
m_seqAttrName |
static int |
MSEQUENCE_ATTR_NAME_LIST_SIZE |
Modifier and Type | Method and Description |
---|---|
void |
append(java.lang.Object value)
Insert the data encapsulated by value at the end of the list encapsulated
by this
MSequence . |
void |
clear()
Remove all items from this
MSequence . |
java.lang.Object |
getAt(int index)
Retrieves the value at the specified index.
|
java.lang.Object |
getAt(int index,
java.lang.Object defaultVal)
Return the value at the specified index or a default value.
|
java.util.Enumeration |
getItems()
Enumerate over the list of items.
|
void |
insertAt(int index,
java.lang.Object value)
Insert a value into the sequence at the given index.
|
int |
itemCount()
Return the number of items in the sequence.
|
java.lang.Object |
newContainedData()
Return a new instance of the type contained by this sequence that can be added
|
void |
removeAt(int index)
Removes the item at the given index.
|
void |
setAt(int index,
java.lang.Object value)
Return the value at given index.
|
java.lang.String |
toXML()
Returns XML representation of this MSequence
|
clone, get, getCategory, getClassDescription, getTrackingInfo, hashCode, serialize, serialize, set, setTrackingInfo
static final int MSEQUENCE_ATTR_NAME_LIST_SIZE
static final java.lang.String[] m_seqAttrName
void insertAt(int index, java.lang.Object value) throws MException
MException
- under any of these conditions:
MSequence
has, for example,
3 elements, and you call MSequence.insertAt(3)
(that is, you're adding a 4th element),
an exception is thrown.append(Object)
,
removeAt(int)
void append(java.lang.Object value) throws MException
MSequence
.
This is a shorthand for insertAt( itemCount(), value)
.
MException
- if the index is out of bound, for example, if you declare
a sequence to consist of four integers and attempt to append a fifth integer.insertAt(int, Object)
java.lang.Object getAt(int index) throws MException
MException
- If the index is out of bound.java.lang.Object getAt(int index, java.lang.Object defaultVal)
If no value is found at the index specified by the accessor, return the default value specified by defaultVal.
void setAt(int index, java.lang.Object value) throws MException
MException
- If the index is out of bound.void removeAt(int index)
insertAt( int, Object)
void clear()
MSequence
. Applications can
then call append(Object)
to repopulate the sequence.int itemCount()
java.util.Enumeration getItems()
java.lang.Object newContainedData() throws MConstructionException
MConstructionException
java.lang.String toXML() throws MException
MException