import java.util.Collection;
import com.rti.dds.infrastructure.Copyable;
import com.rti.dds.util.Enum;
import com.rti.dds.util.Sequence;
import com.rti.dds.util.LoanableSequence;
public final class HelloWorldSeq extends LoanableSequence implements Copyable {
transient Sequence _loanedInfoSequence = null;
public HelloWorldSeq() {
super(HelloWorld.class);
}
public HelloWorldSeq (int initialMaximum) {
super(HelloWorld.class, initialMaximum);
}
public HelloWorldSeq (Collection<?> elements) {
super(HelloWorld.class, elements);
}
public HelloWorld get(int index) {
return (HelloWorld) super.get(index);
}
public Object copy_from(Object src) {
Sequence typedSrc = (Sequence) src;
final int srcSize = typedSrc.size();
final int origSize = size();
if (getMaximum() < srcSize) {
setMaximum(srcSize);
}
if (srcSize < origSize){
removeRange(srcSize, origSize);
}
for(int i = 0; (i < origSize) && (i < srcSize); i++){
if (typedSrc.get(i) == null){
set(i, null);
} else {
if (get(i) == null){
set(i, HelloWorld.create());
}
set(i, ((Copyable) get(i)).copy_from(typedSrc.get(i)));
}
}
for(int i = origSize; i < srcSize; i++){
if (typedSrc.get(i) == null) {
add(null);
} else {
add(HelloWorld.create());
set(i, ((Copyable) get(i)).copy_from(typedSrc.get(i)));
}
}
return this;
}
}