public abstract class SequenceOf<T extends AbstractData> extends AbstractData implements java.lang.Iterable<T>
Modifier and Type | Method and Description |
---|---|
void |
add(T element)
Appends new elements to the
SequenceOf . |
java.util.Collection<T> |
asCollection()
Returns a
Collection view of the elements of this SequenceOf . |
java.lang.Object |
clone()
Creates a deep copy of
this object. |
boolean |
equals(java.lang.Object that)
Compares this object to another
SequenceOf to see if they are equal. |
T |
get(int atIndex)
Returns the value of the
SequenceOf element at the specified
position. |
int |
getSize()
Returns the number of elements in the
SequenceOf . |
int |
hashCode()
Returns a hash code value for the object.
|
void |
insert(T element,
int atIndex)
Inserts a new element into the
SequenceOf at the specified position. |
java.util.Iterator<T> |
iterator()
Returns an iterator over the elements of
this SequenceOf . |
void |
remove(int index)
Removes the
SequenceOf element at the specified position. |
void |
remove(T element)
Removes the first occurrence of the element that is equal to the
specified value.
|
void |
removeAllElements()
Removes all elements from the
SequenceOf . |
void |
set(T element,
int atIndex)
Replaces the
SequenceOf element at the specified position. |
public void add(T element)
SequenceOf
.element
- the value of the new element.public void set(T element, int atIndex)
SequenceOf
element at the specified position.element
- the new value of the element.atIndex
- specifies the position of the element to be replaced.java.lang.IndexOutOfBoundsException
- when the position is out of the range
(atIndex < 0 || atIndex >= getSize())
.public T get(int atIndex)
SequenceOf
element at the specified
position.atIndex
- the position of the element.java.lang.IndexOutOfBoundsException
- when the position is out of the range
(atIndex < 0 || atIndex >= getSize())
.public void insert(T element, int atIndex)
SequenceOf
at the specified position.element
- the value of the new element.atIndex
- specifies the position where the new element is inserted.java.lang.IndexOutOfBoundsException
- when the position is out of the range
(atIndex < 0 || atIndex >= getSize())
.public void remove(T element)
element
- specifies the value of the element to remove.public void remove(int index)
SequenceOf
element at the specified position.index
- the index of the element to remove.java.lang.IndexOutOfBoundsException
- when the position is out of the range
(atIndex < 0 || atIndex >= getSize())
.public void removeAllElements()
SequenceOf
.public final int getSize()
SequenceOf
.public java.util.Iterator<T> iterator()
this
SequenceOf
.iterator
in interface java.lang.Iterable<T extends AbstractData>
SequenceOf
.public java.util.Collection<T> asCollection()
Collection
view of the elements of this
SequenceOf
.public java.lang.Object clone()
AbstractData
this
object.clone
in class AbstractData
public boolean equals(java.lang.Object that)
SequenceOf
to see if they are equal. Two SequenceOf
objects are considered equal if and only if they have the same type, the same size,
and corresponding pairs of elements in the two objects are equal. (Two
elements, e1
and e2
, are equal if
e1 == null ? e2 == null : e1.equals(e2)
).equals
in class java.lang.Object
that
- the SequenceOf
object to be compared to.public int hashCode()
hashCode
in class java.lang.Object
Copyright © 2023 OSS Nokalva, Inc. All rights reserved.
This document is proprietary to OSS Nokalva, Inc., and may be used only by their direct licensees. Distribution is not permitted. This copyright statement must not be removed.