org.xbrlapi.impl
Class FragmentListImpl<F extends Fragment>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.ArrayList<F>
org.xbrlapi.impl.FragmentListImpl<F>
- All Implemented Interfaces:
- Serializable, Cloneable, Iterable<F>, Collection<F>, List<F>, RandomAccess, FragmentList<F>
public class FragmentListImpl<F extends Fragment>
- extends ArrayList<F>
- implements FragmentList<F>
- Author:
- Geoffrey Shuetrim (geoff@galexy.net)
- See Also:
- Serialized Form
|
Field Summary |
protected static org.apache.log4j.Logger |
logger
|
|
Method Summary |
void |
addAll(FragmentList<F> fragmentList)
Appends a list of fragments to this fragment list. |
void |
addFragment(F fragment)
Adds a specified fragment to the end of the list of fragments. |
F |
getFragment(int index)
Returns the indexth fragment in the collection. |
int |
getLength()
Get length of the list of fragments. |
void |
removeFragment(F fragment)
Removes a specified fragment from the list |
| 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 interface java.util.List |
add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, size, subList, toArray, toArray |
logger
protected static org.apache.log4j.Logger logger
FragmentListImpl
public FragmentListImpl()
FragmentListImpl
public FragmentListImpl(F fragment)
- Parameters:
fragment - The fragment to include in the list of fragments.
getLength
public int getLength()
- Get length of the list of fragments.
- Specified by:
getLength in interface FragmentList<F extends Fragment>
- Returns:
- The length of the list of fragments.
- See Also:
FragmentList.getLength()
getFragment
public F getFragment(int index)
- Returns the indexth fragment in the collection. If index
is greater than or equal to the number of fragments in the list,
this returns null.
- Specified by:
getFragment in interface FragmentList<F extends Fragment>
- Parameters:
index - The index of the required fragment
- Returns:
- The fragment at the
indexth position in the
FragmentList, or null if that is not a valid index. - See Also:
FragmentList.getFragment(int)
removeFragment
public void removeFragment(F fragment)
throws XBRLException
- Removes a specified fragment from the list
- Specified by:
removeFragment in interface FragmentList<F extends Fragment>
- Parameters:
fragment - The fragment to be removed
- Throws:
XBRLException - if the fragment could not be removed.
addFragment
public void addFragment(F fragment)
throws XBRLException
- Adds a specified fragment to the end of the list of fragments.
- Specified by:
addFragment in interface FragmentList<F extends Fragment>
- Throws:
XBRLException - if the fragment cannot be added to the list of fragments
or if the fragment is null.
addAll
public void addAll(FragmentList<F> fragmentList)
throws XBRLException
- Appends a list of fragments to this fragment list.
- Specified by:
addAll in interface FragmentList<F extends Fragment>
- Parameters:
fragmentList - The list of fragments to append to this fragment list.
- Throws:
XBRLException- See Also:
FragmentList.addAll(FragmentList)