org.apache.pivot.wtk.content
Class CalendarDateSpinnerData

java.lang.Object
  extended by org.apache.pivot.wtk.content.CalendarDateSpinnerData
All Implemented Interfaces:
Iterable<org.apache.pivot.util.CalendarDate>, org.apache.pivot.collections.Collection<org.apache.pivot.util.CalendarDate>, org.apache.pivot.collections.List<org.apache.pivot.util.CalendarDate>, org.apache.pivot.collections.Sequence<org.apache.pivot.util.CalendarDate>

public class CalendarDateSpinnerData
extends Object
implements org.apache.pivot.collections.List<org.apache.pivot.util.CalendarDate>

Spinner data model that presents a bounded list of calendar dates.

This is a lightweight class that spoofs the actual list data by using an internal calendar instance from which CalendarDate instances are created on demand.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.pivot.collections.List
org.apache.pivot.collections.List.ItemIterator<T>, org.apache.pivot.collections.List.ListListenerList<T>
 
Nested classes/interfaces inherited from interface org.apache.pivot.collections.Sequence
org.apache.pivot.collections.Sequence.Tree<T>
 
Constructor Summary
CalendarDateSpinnerData()
          Creates a new CalendarDateSpinnerData bounded from 1900-01-01 to 2099-12-31.
CalendarDateSpinnerData(org.apache.pivot.util.CalendarDate lowerBound, org.apache.pivot.util.CalendarDate upperBound)
          Creates a new CalendarDateSpinnerData bounded by the specified calendar dates (inclusive).
 
Method Summary
 int add(org.apache.pivot.util.CalendarDate item)
          Throws UnsupportedOperationException.
 void clear()
          Throws UnsupportedOperationException.
 org.apache.pivot.util.CalendarDate get(int index)
          Gets the calendar date at the specified index.
 Comparator<org.apache.pivot.util.CalendarDate> getComparator()
          Gets the comparator for this list, which is guaranteed to always be null.
 int getLength()
          Gets the number of entries in this list.
 org.apache.pivot.util.ListenerList<org.apache.pivot.collections.ListListener<org.apache.pivot.util.CalendarDate>> getListListeners()
           
 int indexOf(org.apache.pivot.util.CalendarDate item)
           
 void insert(org.apache.pivot.util.CalendarDate item, int index)
          Throws UnsupportedOperationException.
 boolean isEmpty()
           
 Iterator<org.apache.pivot.util.CalendarDate> iterator()
           
 int remove(org.apache.pivot.util.CalendarDate item)
          Throws UnsupportedOperationException.
 org.apache.pivot.collections.Sequence<org.apache.pivot.util.CalendarDate> remove(int index, int count)
          Throws UnsupportedOperationException.
 void setComparator(Comparator<org.apache.pivot.util.CalendarDate> comparator)
          Throws UnsupportedOperationException.
 org.apache.pivot.util.CalendarDate update(int index, org.apache.pivot.util.CalendarDate item)
          Throws UnsupportedOperationException.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CalendarDateSpinnerData

public CalendarDateSpinnerData()
Creates a new CalendarDateSpinnerData bounded from 1900-01-01 to 2099-12-31.


CalendarDateSpinnerData

public CalendarDateSpinnerData(org.apache.pivot.util.CalendarDate lowerBound,
                               org.apache.pivot.util.CalendarDate upperBound)
Creates a new CalendarDateSpinnerData bounded by the specified calendar dates (inclusive).

Parameters:
lowerBound - The earliest date to include in this spinner data.
upperBound - The latest date to include in this spinner data.
Method Detail

add

public int add(org.apache.pivot.util.CalendarDate item)
Throws UnsupportedOperationException.

Specified by:
add in interface org.apache.pivot.collections.List<org.apache.pivot.util.CalendarDate>
Specified by:
add in interface org.apache.pivot.collections.Sequence<org.apache.pivot.util.CalendarDate>

insert

public void insert(org.apache.pivot.util.CalendarDate item,
                   int index)
Throws UnsupportedOperationException.

Specified by:
insert in interface org.apache.pivot.collections.List<org.apache.pivot.util.CalendarDate>
Specified by:
insert in interface org.apache.pivot.collections.Sequence<org.apache.pivot.util.CalendarDate>

update

public org.apache.pivot.util.CalendarDate update(int index,
                                                 org.apache.pivot.util.CalendarDate item)
Throws UnsupportedOperationException.

Specified by:
update in interface org.apache.pivot.collections.List<org.apache.pivot.util.CalendarDate>
Specified by:
update in interface org.apache.pivot.collections.Sequence<org.apache.pivot.util.CalendarDate>

remove

public int remove(org.apache.pivot.util.CalendarDate item)
Throws UnsupportedOperationException.

Specified by:
remove in interface org.apache.pivot.collections.Sequence<org.apache.pivot.util.CalendarDate>

remove

public org.apache.pivot.collections.Sequence<org.apache.pivot.util.CalendarDate> remove(int index,
                                                                                        int count)
Throws UnsupportedOperationException.

Specified by:
remove in interface org.apache.pivot.collections.List<org.apache.pivot.util.CalendarDate>
Specified by:
remove in interface org.apache.pivot.collections.Sequence<org.apache.pivot.util.CalendarDate>

get

public org.apache.pivot.util.CalendarDate get(int index)
Gets the calendar date at the specified index.

Specified by:
get in interface org.apache.pivot.collections.Sequence<org.apache.pivot.util.CalendarDate>
Parameters:
index - The index of the calendar date to retrieve.

indexOf

public int indexOf(org.apache.pivot.util.CalendarDate item)
Specified by:
indexOf in interface org.apache.pivot.collections.Sequence<org.apache.pivot.util.CalendarDate>

clear

public void clear()
Throws UnsupportedOperationException.

Specified by:
clear in interface org.apache.pivot.collections.Collection<org.apache.pivot.util.CalendarDate>
Specified by:
clear in interface org.apache.pivot.collections.List<org.apache.pivot.util.CalendarDate>

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface org.apache.pivot.collections.Collection<org.apache.pivot.util.CalendarDate>

getLength

public int getLength()
Gets the number of entries in this list.

Specified by:
getLength in interface org.apache.pivot.collections.List<org.apache.pivot.util.CalendarDate>
Specified by:
getLength in interface org.apache.pivot.collections.Sequence<org.apache.pivot.util.CalendarDate>
Returns:
The number of calendar dates in this list.

getComparator

public Comparator<org.apache.pivot.util.CalendarDate> getComparator()
Gets the comparator for this list, which is guaranteed to always be null. This class does not support comparators since there's no real data to sort (it's all spoofed).

Specified by:
getComparator in interface org.apache.pivot.collections.Collection<org.apache.pivot.util.CalendarDate>

setComparator

public void setComparator(Comparator<org.apache.pivot.util.CalendarDate> comparator)
Throws UnsupportedOperationException.

Specified by:
setComparator in interface org.apache.pivot.collections.Collection<org.apache.pivot.util.CalendarDate>
Specified by:
setComparator in interface org.apache.pivot.collections.List<org.apache.pivot.util.CalendarDate>

iterator

public Iterator<org.apache.pivot.util.CalendarDate> iterator()
Specified by:
iterator in interface Iterable<org.apache.pivot.util.CalendarDate>

getListListeners

public org.apache.pivot.util.ListenerList<org.apache.pivot.collections.ListListener<org.apache.pivot.util.CalendarDate>> getListListeners()
Specified by:
getListListeners in interface org.apache.pivot.collections.List<org.apache.pivot.util.CalendarDate>