microsoft.exchange.webservices.data
Class StringList

java.lang.Object
  extended by microsoft.exchange.webservices.data.ComplexProperty
      extended by microsoft.exchange.webservices.data.StringList
All Implemented Interfaces:
java.lang.Iterable<java.lang.String>

public class StringList
extends ComplexProperty
implements java.lang.Iterable<java.lang.String>

Represents a list of strings.


Constructor Summary
  StringList()
          Initializes a new instance of the "StringList" class.
  StringList(java.lang.Iterable<java.lang.String> strings)
          Initializes a new instance of the class.
protected StringList(java.lang.String itemXmlElementName)
          Initializes a new instance of the "StringList" class.
 
Method Summary
 void add(java.lang.String s)
          Adds a string to the list.
 void addRange(java.lang.Iterable<java.lang.String> strings)
          Adds multiple strings to the list.
 void clearList()
          Clears the list.
 boolean contains(java.lang.String s)
          Determines whether the list contains a specific string.
 boolean equals(java.lang.Object obj)
          Indicates whether some other object is "equal to" this one.
 java.util.Iterator<java.lang.String> getIterator()
          Gets an iterator that iterates through the elements of the collection.
 int getSize()
          Gets the number of strings in the list.
 java.lang.String getString(int index)
          Gets the string at the specified index.
 int hashCode()
          Serves as a hash function for a particular type.
 java.util.Iterator<java.lang.String> iterator()
          Returns an iterator over a set of elements of type T.
 boolean remove(java.lang.String s)
          Removes a string from the list.
 void removeAt(int index)
          Removes the string at the specified position from the list.
 void setString(int index, java.lang.Object object)
          Sets the string at the specified index.
 java.lang.String toString()
          Returns a string representation of the object.
protected  boolean tryReadElementFromXml(microsoft.exchange.webservices.data.EwsServiceXmlReader reader)
          * Tries to read element from XML.
protected  void writeElementsToXml(microsoft.exchange.webservices.data.EwsServiceXmlWriter writer)
          * Writes elements to XML.
 
Methods inherited from class microsoft.exchange.webservices.data.ComplexProperty
addOnChangeEvent, canSetFieldValue, changed, clearChangeEvents, clearChangeLog, func, getNamespace, internalValidate, loadFromXml, loadFromXml, readAttributesFromXml, readTextValueFromXml, removeChangeEvent, setNamespace, tryReadElementFromXmlToPatch, updateFromXml, updateFromXml, validate, writeAttributesToXml, writeToXml, writeToXml
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StringList

public StringList()
Initializes a new instance of the "StringList" class.


StringList

public StringList(java.lang.Iterable<java.lang.String> strings)
Initializes a new instance of the class.

Parameters:
strings - The strings.

StringList

protected StringList(java.lang.String itemXmlElementName)
Initializes a new instance of the "StringList" class.

Parameters:
itemXmlElementName - Name of the item XML element.
Method Detail

tryReadElementFromXml

protected boolean tryReadElementFromXml(microsoft.exchange.webservices.data.EwsServiceXmlReader reader)
                                 throws javax.xml.stream.XMLStreamException,
                                        ServiceXmlDeserializationException
* Tries to read element from XML.

Overrides:
tryReadElementFromXml in class ComplexProperty
Parameters:
reader - accepts EwsServiceXmlReader
Returns:
True if element was read
Throws:
javax.xml.stream.XMLStreamException - the xML stream exception
ServiceXmlDeserializationException - the service xml deserialization exception

writeElementsToXml

protected void writeElementsToXml(microsoft.exchange.webservices.data.EwsServiceXmlWriter writer)
                           throws ServiceXmlSerializationException,
                                  javax.xml.stream.XMLStreamException
* Writes elements to XML.

Overrides:
writeElementsToXml in class ComplexProperty
Parameters:
writer - accepts EwsServiceXmlWriter
Throws:
ServiceXmlSerializationException - the service xml serialization exception
javax.xml.stream.XMLStreamException - the xML stream exception

add

public void add(java.lang.String s)
Adds a string to the list.

Parameters:
s - The string to add.

addRange

public void addRange(java.lang.Iterable<java.lang.String> strings)
Adds multiple strings to the list.

Parameters:
strings - The strings to add.

contains

public boolean contains(java.lang.String s)
Determines whether the list contains a specific string.

Parameters:
s - The string to check the presence of.
Returns:
True if s is present in the list, false otherwise.

remove

public boolean remove(java.lang.String s)
Removes a string from the list.

Parameters:
s - The string to remove.
Returns:
True is s was removed, false otherwise.

removeAt

public void removeAt(int index)
Removes the string at the specified position from the list.

Parameters:
index - The index of the string to remove.

clearList

public void clearList()
Clears the list.


toString

public java.lang.String toString()
Returns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method.

The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of:

 getClass().getName() + '@' + Integer.toHexString(hashCode())
 

Overrides:
toString in class java.lang.Object
Returns:
a string representation of the object.

getSize

public int getSize()
Gets the number of strings in the list.

Returns:
the size

getString

public java.lang.String getString(int index)
Gets the string at the specified index.

Parameters:
index - The index of the string to get or set.
Returns:
The string at the specified index.

setString

public void setString(int index,
                      java.lang.Object object)
Sets the string at the specified index.

Parameters:
index - The index
object - The object.

getIterator

public java.util.Iterator<java.lang.String> getIterator()
Gets an iterator that iterates through the elements of the collection.

Returns:
An Iterator for the collection.

equals

public boolean equals(java.lang.Object obj)
Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

The equals method for class Object implements the most discriminating possible equivalence relation on objects; that is, for any non-null reference values x and y, this method returns true if and only if x and y refer to the same object (x == y has the value true).

Note that it is generally necessary to override the hashCode method whenever this method is overridden, so as to maintain the general contract for the hashCode method, which states that equal objects must have equal hash codes.

Overrides:
equals in class java.lang.Object
Parameters:
obj - the reference object with which to compare.
Returns:
if this object is the same as the obj argument; otherwise.
See Also:
hashCode(), Hashtable

hashCode

public int hashCode()
Serves as a hash function for a particular type.

Overrides:
hashCode in class java.lang.Object
Returns:
A hash code for the current "T:System.Object".

iterator

public java.util.Iterator<java.lang.String> iterator()
Returns an iterator over a set of elements of type T.

Specified by:
iterator in interface java.lang.Iterable<java.lang.String>
Returns:
an Iterator.