org.archive.crawler.settings
Class LongList

java.lang.Object
  extended by javax.management.Attribute
      extended by org.archive.crawler.settings.Type
          extended by org.archive.crawler.settings.ListType<java.lang.Long>
              extended by org.archive.crawler.settings.LongList
All Implemented Interfaces:
java.io.Serializable, java.lang.Iterable<java.lang.Object>, java.util.Collection<java.lang.Object>, java.util.List<java.lang.Object>

public class LongList
extends ListType<java.lang.Long>

List of Long values

Author:
John Erik Halse
See Also:
Serialized Form

Constructor Summary
LongList(java.lang.String name, java.lang.String description)
          Creates a new LongList.
LongList(java.lang.String name, java.lang.String description, long[] l)
          Creates a new LongList and initializes it with the values from an array of long.
LongList(java.lang.String name, java.lang.String description, java.lang.Long[] l)
          Creates a new LongList and initializes it with the values from an array of Long.
LongList(java.lang.String name, java.lang.String description, LongList l)
          Creates a new LongList and initializes it with the values from another LongList.
 
Method Summary
 void add(int index, long element)
          Add a new long at the specified index to this list.
 void add(int index, java.lang.Long element)
          Add a new Long at the specified index to this list.
 void add(long element)
          Add a new long at the end of this list.
 void add(java.lang.Long element)
          Add a new Long at the end of this list.
 void addAll(long[] l)
          Appends all of the elements in the specified array to the end of this list, in the same order that they are in the array.
 void addAll(java.lang.Long[] l)
          Appends all of the elements in the specified array to the end of this list, in the same order that they are in the array.
 void addAll(LongList l)
          Appends all of the elements in the specified list to the end of this list, in the order that they are returned by the specified lists's iterator.
 java.lang.Long checkType(java.lang.Object element)
          Check if element is of right type for this list.
 java.lang.Long set(int index, java.lang.Long element)
          Replaces the element at the specified position in this list with the specified element.
 
Methods inherited from class org.archive.crawler.settings.ListType
add, add, addAll, addAll, addAll, clear, contains, containsAll, get, getDefaultValue, getDescription, getLegalValues, getValue, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, size, subList, toArray, toArray, typesafe
 
Methods inherited from class org.archive.crawler.settings.Type
addConstraint, equals, getConstraints, getLegalValueType, isExpertSetting, isOverrideable, isTransient, setExpertSetting, setLegalValueType, setOverrideable, setTransient
 
Methods inherited from class javax.management.Attribute
getName, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
equals, hashCode
 

Constructor Detail

LongList

public LongList(java.lang.String name,
                java.lang.String description)
Creates a new LongList.

Parameters:
name - of the list.
description - of the list. This string should be suitable for using in a user interface.

LongList

public LongList(java.lang.String name,
                java.lang.String description,
                LongList l)
Creates a new LongList and initializes it with the values from another LongList.

Parameters:
name - of the list.
description - of the list. This string should be suitable for using in a user interface.
l - the list from which this lists gets its initial values.

LongList

public LongList(java.lang.String name,
                java.lang.String description,
                java.lang.Long[] l)
Creates a new LongList and initializes it with the values from an array of Long.

Parameters:
name - of the list.
description - of the list. This string should be suitable for using in a user interface.
l - the array from which this lists gets its initial values.

LongList

public LongList(java.lang.String name,
                java.lang.String description,
                long[] l)
Creates a new LongList and initializes it with the values from an array of long.

Parameters:
name - of the list.
description - of the list. This string should be suitable for using in a user interface.
l - the array from which this lists gets its initial values.
Method Detail

add

public void add(int index,
                java.lang.Long element)
Add a new Long at the specified index to this list.

Parameters:
index - index at which the specified element is to be inserted.
element - the value to be added.

add

public void add(int index,
                long element)
Add a new long at the specified index to this list.

Parameters:
index - index at which the specified element is to be inserted.
element - the value to be added.

add

public void add(java.lang.Long element)
Add a new Long at the end of this list.

Parameters:
element - the value to be added.

add

public void add(long element)
Add a new long at the end of this list.

Parameters:
element - the value to be added.

addAll

public void addAll(LongList l)
Appends all of the elements in the specified list to the end of this list, in the order that they are returned by the specified lists's iterator. The behavior of this operation is unspecified if the specified collection is modified while the operation is in progress.

Parameters:
l - list whose elements are to be added to this list.

addAll

public void addAll(java.lang.Long[] l)
Appends all of the elements in the specified array to the end of this list, in the same order that they are in the array.

Parameters:
l - array whose elements are to be added to this list.

addAll

public void addAll(long[] l)
Appends all of the elements in the specified array to the end of this list, in the same order that they are in the array.

Parameters:
l - array whose elements are to be added to this list.

set

public java.lang.Long set(int index,
                          java.lang.Long element)
Replaces the element at the specified position in this list with the specified element.

Parameters:
index - index at which the specified element is to be inserted.
element - element to be inserted.
Returns:
the element previously at the specified position.

checkType

public java.lang.Long checkType(java.lang.Object element)
                         throws java.lang.ClassCastException
Check if element is of right type for this list. If this method gets a String, it tries to convert it to the an Long before eventually throwing an exception.

Specified by:
checkType in class ListType<java.lang.Long>
Parameters:
element - element to check.
Returns:
element of the right type.
Throws:
java.lang.ClassCastException - is thrown if the element was of wrong type and could not be converted.


Copyright © 2003-2011 Internet Archive. All Rights Reserved.