fiftyone.mobile.detection.entities
Class Values

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.ArrayList<Value>
              extended by fiftyone.mobile.detection.entities.Values
All Implemented Interfaces:
Serializable, Cloneable, Iterable<Value>, Collection<Value>, List<Value>, RandomAccess

public class Values
extends ArrayList<Value>

Encapsulates a list of one or more values. Provides methods to return boolean, double and string representations of the values list.

The class contains helper methods to make consuming the data set easier.

For more information see http://51degrees.mobi/Support/Documentation/Java

See Also:
Serialized Form

Field Summary
private  Property property
          The property the list of values relates to.
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
Values(Property property, Collection<Value> values)
          Constructs a new instance of the values list.
 
Method Summary
 boolean getIsDefault()
          Returns true if any of the values are the null values for the property.
 boolean toBool()
          The value represented as a boolean.
 double toDouble()
          The value represented as a double.
 String toString()
          The values represented as a string where multiple values are seperated by colons.
 String[] toStringArray()
          Returns the values as a string array.
 
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, removeRange, 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
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList
 

Field Detail

property

private final Property property
The property the list of values relates to.

Constructor Detail

Values

Values(Property property,
       Collection<Value> values)
Constructs a new instance of the values list.

Parameters:
property - Property the values list relates to
values - IEnumerable of values to use to initialise the list
Method Detail

toBool

public boolean toBool()
               throws IOException
The value represented as a boolean. return A boolean representation of the only item in the list. MobileException Thrown if the method is called for a property with multiple values

Throws:
IOException

toDouble

public double toDouble()
                throws IOException
The value represented as a double.

Returns:
A double representation of the only item in the list.
Throws:
IOException
MobileException - Thrown if the method is called for a property with multiple values

toStringArray

public String[] toStringArray()
                       throws IOException
Returns the values as a string array.

Returns:
a string array of values
Throws:
IOException

toString

public String toString()
The values represented as a string where multiple values are seperated by colons.

Overrides:
toString in class AbstractCollection<Value>
Returns:
The values as a string

getIsDefault

public boolean getIsDefault()
                     throws IOException
Returns true if any of the values are the null values for the property.

Returns:
Throws:
IOException