com.aspose.words
Class OdsoRecipientDataCollection

java.lang.Object
    extended by com.aspose.words.OdsoRecipientDataCollection
All Implemented Interfaces:
java.lang.Iterable

public class OdsoRecipientDataCollection 
extends java.lang.Object

A typed collection of OdsoRecipientData

Example:

Shows how to access the collection of data that designates merge data source records to be excluded from a merge.
Document doc = new Document(getMyDir() + "Odso data.docx");

// Records in this collection that do not have the "Active" flag set to true will be excluded from the mail merge
OdsoRecipientDataCollection dataCollection = doc.getMailMergeSettings().getOdso().getRecipientDatas();
Assert.assertEquals(70, dataCollection.getCount());

int index = 0;

for (OdsoRecipientData data : dataCollection) {
    System.out.println(MessageFormat.format("Odso recipient data index #{0}, will {1}be imported upon mail merge.", index++, (data.getActive() ? "" : "not ")));
    System.out.println(MessageFormat.format("\tColumn #{0}", data.getColumn()));
    System.out.println(MessageFormat.format("\tHash code: {0}", data.getHash()));
    System.out.println(MessageFormat.format("\tContents array length: {0}", data.getUniqueTag().length));            
}

// Elements of the collection can be cloned
Assert.assertNotEquals(dataCollection.get(0), dataCollection.get(0).deepClone());

// The collection can have individual entries removed or be cleared like this
dataCollection.removeAt(0);
dataCollection.clear();
See Also:
OdsoRecipientData, Odso.RecipientDatas

Constructor Summary
OdsoRecipientDataCollection()
          
 
Property Getters/Setters Summary
intgetCount()
           Gets the number of elements contained in the collection.
OdsoRecipientDataget(int index)
voidset(int index, OdsoRecipientData value)
           Gets or sets an item in this collection.
 
Method Summary
intadd(OdsoRecipientData value)
           Adds an object to the end of this collection.
voidclear()
           Removes all elements from this collection.
java.util.Iterator<OdsoRecipientData>iterator()
           Returns an iterator object that can be used to iterate over all items in the collection.
voidremoveAt(int index)
           Removes the element at the specified index.
 

Constructor Detail

OdsoRecipientDataCollection

public OdsoRecipientDataCollection()

Property Getters/Setters Detail

getCount

public int getCount()
Gets the number of elements contained in the collection.

Example:

Shows how to access the collection of data that designates merge data source records to be excluded from a merge.
Document doc = new Document(getMyDir() + "Odso data.docx");

// Records in this collection that do not have the "Active" flag set to true will be excluded from the mail merge
OdsoRecipientDataCollection dataCollection = doc.getMailMergeSettings().getOdso().getRecipientDatas();
Assert.assertEquals(70, dataCollection.getCount());

int index = 0;

for (OdsoRecipientData data : dataCollection) {
    System.out.println(MessageFormat.format("Odso recipient data index #{0}, will {1}be imported upon mail merge.", index++, (data.getActive() ? "" : "not ")));
    System.out.println(MessageFormat.format("\tColumn #{0}", data.getColumn()));
    System.out.println(MessageFormat.format("\tHash code: {0}", data.getHash()));
    System.out.println(MessageFormat.format("\tContents array length: {0}", data.getUniqueTag().length));            
}

// Elements of the collection can be cloned
Assert.assertNotEquals(dataCollection.get(0), dataCollection.get(0).deepClone());

// The collection can have individual entries removed or be cleared like this
dataCollection.removeAt(0);
dataCollection.clear();

get/set

public OdsoRecipientData get(int index) / public void set(int index, OdsoRecipientData value)
Gets or sets an item in this collection.

Example:

Shows how to access the collection of data that designates merge data source records to be excluded from a merge.
Document doc = new Document(getMyDir() + "Odso data.docx");

// Records in this collection that do not have the "Active" flag set to true will be excluded from the mail merge
OdsoRecipientDataCollection dataCollection = doc.getMailMergeSettings().getOdso().getRecipientDatas();
Assert.assertEquals(70, dataCollection.getCount());

int index = 0;

for (OdsoRecipientData data : dataCollection) {
    System.out.println(MessageFormat.format("Odso recipient data index #{0}, will {1}be imported upon mail merge.", index++, (data.getActive() ? "" : "not ")));
    System.out.println(MessageFormat.format("\tColumn #{0}", data.getColumn()));
    System.out.println(MessageFormat.format("\tHash code: {0}", data.getHash()));
    System.out.println(MessageFormat.format("\tContents array length: {0}", data.getUniqueTag().length));            
}

// Elements of the collection can be cloned
Assert.assertNotEquals(dataCollection.get(0), dataCollection.get(0).deepClone());

// The collection can have individual entries removed or be cleared like this
dataCollection.removeAt(0);
dataCollection.clear();

Method Detail

add

public int add(OdsoRecipientData value)
Adds an object to the end of this collection.
Parameters:
value - The object to add. Cannot be null.

Example:

Shows how to access the collection of data that designates merge data source records to be excluded from a merge.
Document doc = new Document(getMyDir() + "Odso data.docx");

// Records in this collection that do not have the "Active" flag set to true will be excluded from the mail merge
OdsoRecipientDataCollection dataCollection = doc.getMailMergeSettings().getOdso().getRecipientDatas();
Assert.assertEquals(70, dataCollection.getCount());

int index = 0;

for (OdsoRecipientData data : dataCollection) {
    System.out.println(MessageFormat.format("Odso recipient data index #{0}, will {1}be imported upon mail merge.", index++, (data.getActive() ? "" : "not ")));
    System.out.println(MessageFormat.format("\tColumn #{0}", data.getColumn()));
    System.out.println(MessageFormat.format("\tHash code: {0}", data.getHash()));
    System.out.println(MessageFormat.format("\tContents array length: {0}", data.getUniqueTag().length));            
}

// Elements of the collection can be cloned
Assert.assertNotEquals(dataCollection.get(0), dataCollection.get(0).deepClone());

// The collection can have individual entries removed or be cleared like this
dataCollection.removeAt(0);
dataCollection.clear();

clear

public void clear()
Removes all elements from this collection.

Example:

Shows how to access the collection of data that designates merge data source records to be excluded from a merge.
Document doc = new Document(getMyDir() + "Odso data.docx");

// Records in this collection that do not have the "Active" flag set to true will be excluded from the mail merge
OdsoRecipientDataCollection dataCollection = doc.getMailMergeSettings().getOdso().getRecipientDatas();
Assert.assertEquals(70, dataCollection.getCount());

int index = 0;

for (OdsoRecipientData data : dataCollection) {
    System.out.println(MessageFormat.format("Odso recipient data index #{0}, will {1}be imported upon mail merge.", index++, (data.getActive() ? "" : "not ")));
    System.out.println(MessageFormat.format("\tColumn #{0}", data.getColumn()));
    System.out.println(MessageFormat.format("\tHash code: {0}", data.getHash()));
    System.out.println(MessageFormat.format("\tContents array length: {0}", data.getUniqueTag().length));            
}

// Elements of the collection can be cloned
Assert.assertNotEquals(dataCollection.get(0), dataCollection.get(0).deepClone());

// The collection can have individual entries removed or be cleared like this
dataCollection.removeAt(0);
dataCollection.clear();

iterator

public java.util.Iterator<OdsoRecipientDataiterator()
Returns an iterator object that can be used to iterate over all items in the collection.

Example:

Shows how to access the collection of data that designates merge data source records to be excluded from a merge.
Document doc = new Document(getMyDir() + "Odso data.docx");

// Records in this collection that do not have the "Active" flag set to true will be excluded from the mail merge
OdsoRecipientDataCollection dataCollection = doc.getMailMergeSettings().getOdso().getRecipientDatas();
Assert.assertEquals(70, dataCollection.getCount());

int index = 0;

for (OdsoRecipientData data : dataCollection) {
    System.out.println(MessageFormat.format("Odso recipient data index #{0}, will {1}be imported upon mail merge.", index++, (data.getActive() ? "" : "not ")));
    System.out.println(MessageFormat.format("\tColumn #{0}", data.getColumn()));
    System.out.println(MessageFormat.format("\tHash code: {0}", data.getHash()));
    System.out.println(MessageFormat.format("\tContents array length: {0}", data.getUniqueTag().length));            
}

// Elements of the collection can be cloned
Assert.assertNotEquals(dataCollection.get(0), dataCollection.get(0).deepClone());

// The collection can have individual entries removed or be cleared like this
dataCollection.removeAt(0);
dataCollection.clear();

removeAt

public void removeAt(int index)
Removes the element at the specified index.
Parameters:
index - The zero-based index of the element.

Example:

Shows how to access the collection of data that designates merge data source records to be excluded from a merge.
Document doc = new Document(getMyDir() + "Odso data.docx");

// Records in this collection that do not have the "Active" flag set to true will be excluded from the mail merge
OdsoRecipientDataCollection dataCollection = doc.getMailMergeSettings().getOdso().getRecipientDatas();
Assert.assertEquals(70, dataCollection.getCount());

int index = 0;

for (OdsoRecipientData data : dataCollection) {
    System.out.println(MessageFormat.format("Odso recipient data index #{0}, will {1}be imported upon mail merge.", index++, (data.getActive() ? "" : "not ")));
    System.out.println(MessageFormat.format("\tColumn #{0}", data.getColumn()));
    System.out.println(MessageFormat.format("\tHash code: {0}", data.getHash()));
    System.out.println(MessageFormat.format("\tContents array length: {0}", data.getUniqueTag().length));            
}

// Elements of the collection can be cloned
Assert.assertNotEquals(dataCollection.get(0), dataCollection.get(0).deepClone());

// The collection can have individual entries removed or be cleared like this
dataCollection.removeAt(0);
dataCollection.clear();

See Also:
          Aspose.Words Documentation - the home page for the Aspose.Words Product Documentation.
          Aspose.Words Support Forum - our preferred method of support.