com.crystaldecisions.sdk.occa.report.data
Class Fields

java.lang.Object
  extended by java.util.AbstractCollection
      extended by java.util.AbstractList
          extended by java.util.ArrayList
              extended by com.crystaldecisions.sdk.occa.report.lib.ReportSDKVector
                  extended by com.crystaldecisions.sdk.occa.report.data.Fields
All Implemented Interfaces:
IClone, java.io.Serializable, java.lang.Cloneable, java.lang.Iterable, java.util.Collection, java.util.List, java.util.RandomAccess
Direct Known Subclasses:
SummaryFields

public class Fields
extends ReportSDKVector
implements IClone

This object stores an array of fields. The fields may be one of the following types:

See Also:
Serialized Form

Constructor Summary
Fields()
           
Fields(Fields src)
           
 
Method Summary
 void add(int index, java.lang.Object element)
          Inserts the specified element at the specified position in this collection.
 boolean add(java.lang.Object o)
          Appends the specified element to the end of this collection.
 java.lang.Object createMember(java.lang.String eleName, org.xml.sax.Attributes attrs, com.crystaldecisions.xml.serialization.XMLSerializationContext ctxt, java.util.Map objState, boolean[] bLoaded)
           For internal use only.
 void endElement(java.lang.String eleName, java.util.Map objState)
           For internal use only.
 int find(java.lang.String fieldName, FieldDisplayNameType displayType, java.util.Locale locale)
           Searches for a field with a particular name and returns its index.
 IField findField(java.lang.String fieldName, FieldDisplayNameType displayType, java.util.Locale locale)
           Searches for a field with a particular name in the Fields collection and returns a reference to the field.
 IField getField(int index)
           Returns the field at the specified index.
 void readElement(java.lang.String eleName, java.lang.String sVal, org.xml.sax.Attributes attrs, java.util.Map objState)
           For internal use only.
 void save(com.crystaldecisions.xml.serialization.XMLWriter writer, com.crystaldecisions.xml.serialization.XMLSerializationContext ctxt)
           For internal use only.
 void save(com.crystaldecisions.xml.serialization.XMLWriter writer, java.lang.String sTag, com.crystaldecisions.xml.serialization.XMLSerializationContext ctxt)
           For internal use only.
 void saveContents(XMLWriter writer, XMLSerializationContext ctxt)
           For internal use only.
 void startElement(java.lang.String eleName, java.util.Map objState, org.xml.sax.Attributes attrs)
           For internal use only.
 
Methods inherited from class com.crystaldecisions.sdk.occa.report.lib.ReportSDKVector
addElement, clone, copyTo, elementAt, findIndexOf, hasContent, insertElementAt, removeAllElements
 
Methods inherited from class java.util.ArrayList
addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, set, size, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, removeAll, retainAll, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList
 

Constructor Detail

Fields

public Fields(Fields src)

Fields

public Fields()
Method Detail

createMember

public java.lang.Object createMember(java.lang.String eleName,
                                     org.xml.sax.Attributes attrs,
                                     com.crystaldecisions.xml.serialization.XMLSerializationContext ctxt,
                                     java.util.Map objState,
                                     boolean[] bLoaded)

For internal use only.


endElement

public void endElement(java.lang.String eleName,
                       java.util.Map objState)

For internal use only.


find

public int find(java.lang.String fieldName,
                FieldDisplayNameType displayType,
                java.util.Locale locale)

Searches for a field with a particular name and returns its index. If the item is not found, -1 is returned. The field's display name is used in the search.

Parameters:
fieldName - The name of field you want to find.
displayType - Indicates the form in which fieldName appears. It may be one of the values in FieldDisplayNameType.
locale - The locale of the field.
Returns:
The index of the field with the specified name.

findField

public IField findField(java.lang.String fieldName,
                        FieldDisplayNameType displayType,
                        java.util.Locale locale)

Searches for a field with a particular name in the Fields collection and returns a reference to the field.

Example:

This sample shows how to search the Fields collection for a field with a specific display name and to return its index. The display name property specifies how the name of the field has been formatted. The FieldDisplayNameType provides the different ways a display name can be formatted.

 DatabaseController databaseController = clientDoc.getDatabaseController();
 IDatabase database = databaseController.getDatabase();
 Tables tables = database.getTables();
 ITable table = (Table)tables.getTable(0);
 Fields fields = table.getDataFields();
 IField field = (Field)fields.findField("{Customer.Region}", FieldDisplayNameType.fieldName, java.util.Locale.CANADA);
 

Parameters:
fieldName - the name of the field you want to find
displayType - the form in which the fieldName appears as defined by FieldDisplayNameType
locale - the locale of the field as defined by Locale
Returns:
IField a reference to the IField object
See Also:
FieldDisplayNameType

getField

public IField getField(int index)

Returns the field at the specified index.

Parameters:
index - The index of the desired field.
Returns:
The IField object at the specified index.

readElement

public void readElement(java.lang.String eleName,
                        java.lang.String sVal,
                        org.xml.sax.Attributes attrs,
                        java.util.Map objState)

For internal use only.


save

public void save(com.crystaldecisions.xml.serialization.XMLWriter writer,
                 com.crystaldecisions.xml.serialization.XMLSerializationContext ctxt)
          throws java.io.IOException

For internal use only.

Throws:
java.io.IOException

save

public void save(com.crystaldecisions.xml.serialization.XMLWriter writer,
                 java.lang.String sTag,
                 com.crystaldecisions.xml.serialization.XMLSerializationContext ctxt)
          throws java.io.IOException

For internal use only.

Throws:
java.io.IOException

saveContents

public void saveContents(XMLWriter writer,
                         XMLSerializationContext ctxt)
                  throws java.io.IOException

For internal use only.

Throws:
java.io.IOException

startElement

public void startElement(java.lang.String eleName,
                         java.util.Map objState,
                         org.xml.sax.Attributes attrs)

For internal use only.


add

public boolean add(java.lang.Object o)
Appends the specified element to the end of this collection.

Specified by:
add in interface java.util.Collection
Specified by:
add in interface java.util.List
Overrides:
add in class java.util.ArrayList
Parameters:
o - element to be added into the collection.
Returns:
true if this collection changed as a result of the call.
Throws:
java.lang.ClassCastException - class of the specified element prevents it from being added to this collection.
java.lang.NullPointerException - if the specified element is null and this collection does not support null elements.

add

public void add(int index,
                java.lang.Object element)
Inserts the specified element at the specified position in this collection. Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).

Specified by:
add in interface java.util.List
Overrides:
add in class java.util.ArrayList
Parameters:
index - index at which the specified element is to be inserted.
element - element to be inserted.
Throws:
java.lang.IndexOutOfBoundsException - if index is out of range (index < 0 || index > size()).
java.lang.ClassCastException - class of the specified element prevents it from being added to this collection.
java.lang.NullPointerException - if the specified element is null and this collection does not support null elements.