Class TsFileResourceList
- java.lang.Object
-
- org.apache.iotdb.db.engine.storagegroup.TsFileResourceList
-
- All Implemented Interfaces:
java.lang.Iterable<TsFileResource>,java.util.Collection<TsFileResource>,java.util.List<TsFileResource>
public class TsFileResourceList extends java.lang.Object implements java.util.List<TsFileResource>
-
-
Constructor Summary
Constructors Constructor Description TsFileResourceList()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(int index, TsFileResource element)booleanadd(TsFileResource newNode)Insert a new tsFileResource node to the end of ListbooleanaddAll(int index, java.util.Collection<? extends TsFileResource> c)booleanaddAll(java.util.Collection<? extends TsFileResource> c)Only List type parameter is legal, because it is in order.voidclear()booleancontains(java.lang.Object o)booleancontainsAll(java.util.Collection<?> c)TsFileResourceget(int index)java.util.List<TsFileResource>getArrayList()TsFileResourcegetHeader()TsFileResourcegetTail()intindexOf(java.lang.Object o)voidinsertAfter(TsFileResource node, TsFileResource newNode)Insert a new node after an existing nodevoidinsertBefore(TsFileResource node, TsFileResource newNode)Insert a new node before an existing nodebooleanisEmpty()java.util.Iterator<TsFileResource>iterator()booleankeepOrderInsert(TsFileResource newNode)Insert a tsfile resource to the list, the tsfile will be inserted before the first tsfile whose timestamp is greater than its.intlastIndexOf(java.lang.Object o)java.util.ListIterator<TsFileResource>listIterator()java.util.ListIterator<TsFileResource>listIterator(int index)TsFileResourceremove(int index)booleanremove(java.lang.Object o)The tsFileResourceListNode to be removed must be in the list, otherwise may cause unknown behaviorbooleanremoveAll(java.util.Collection<?> c)booleanretainAll(java.util.Collection<?> c)java.util.Iterator<TsFileResource>reverseIterator()TsFileResourceset(int index, TsFileResource element)insert tsFileResource to a target pos(targetPos = index) e.g.intsize()java.util.List<TsFileResource>subList(int fromIndex, int toIndex)java.lang.Object[]toArray()<T> T[]toArray(T[] a)
-
-
-
Method Detail
-
insertBefore
public void insertBefore(TsFileResource node, TsFileResource newNode)
Insert a new node before an existing node- Parameters:
node- the existing nodenewNode- the file to insert
-
insertAfter
public void insertAfter(TsFileResource node, TsFileResource newNode)
Insert a new node after an existing node- Parameters:
node- the existing nodenewNode- the file to insert
-
size
public int size()
- Specified by:
sizein interfacejava.util.Collection<TsFileResource>- Specified by:
sizein interfacejava.util.List<TsFileResource>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfacejava.util.Collection<TsFileResource>- Specified by:
isEmptyin interfacejava.util.List<TsFileResource>
-
contains
public boolean contains(java.lang.Object o)
- Specified by:
containsin interfacejava.util.Collection<TsFileResource>- Specified by:
containsin interfacejava.util.List<TsFileResource>
-
iterator
public java.util.Iterator<TsFileResource> iterator()
- Specified by:
iteratorin interfacejava.util.Collection<TsFileResource>- Specified by:
iteratorin interfacejava.lang.Iterable<TsFileResource>- Specified by:
iteratorin interfacejava.util.List<TsFileResource>
-
reverseIterator
public java.util.Iterator<TsFileResource> reverseIterator()
-
add
public boolean add(TsFileResource newNode)
Insert a new tsFileResource node to the end of List- Specified by:
addin interfacejava.util.Collection<TsFileResource>- Specified by:
addin interfacejava.util.List<TsFileResource>
-
keepOrderInsert
public boolean keepOrderInsert(TsFileResource newNode) throws java.io.IOException
Insert a tsfile resource to the list, the tsfile will be inserted before the first tsfile whose timestamp is greater than its. If there is no tsfile whose timestamp is greater than the new node's, the new node will be inserted to the tail of the list.- Throws:
java.io.IOException
-
remove
public boolean remove(java.lang.Object o)
The tsFileResourceListNode to be removed must be in the list, otherwise may cause unknown behavior- Specified by:
removein interfacejava.util.Collection<TsFileResource>- Specified by:
removein interfacejava.util.List<TsFileResource>
-
containsAll
public boolean containsAll(java.util.Collection<?> c)
- Specified by:
containsAllin interfacejava.util.Collection<TsFileResource>- Specified by:
containsAllin interfacejava.util.List<TsFileResource>
-
addAll
public boolean addAll(java.util.Collection<? extends TsFileResource> c)
Only List type parameter is legal, because it is in order.- Specified by:
addAllin interfacejava.util.Collection<TsFileResource>- Specified by:
addAllin interfacejava.util.List<TsFileResource>
-
clear
public void clear()
- Specified by:
clearin interfacejava.util.Collection<TsFileResource>- Specified by:
clearin interfacejava.util.List<TsFileResource>
-
toArray
public java.lang.Object[] toArray()
- Specified by:
toArrayin interfacejava.util.Collection<TsFileResource>- Specified by:
toArrayin interfacejava.util.List<TsFileResource>
-
toArray
public <T> T[] toArray(T[] a)
- Specified by:
toArrayin interfacejava.util.Collection<TsFileResource>- Specified by:
toArrayin interfacejava.util.List<TsFileResource>
-
addAll
public boolean addAll(int index, java.util.Collection<? extends TsFileResource> c)- Specified by:
addAllin interfacejava.util.List<TsFileResource>
-
removeAll
public boolean removeAll(java.util.Collection<?> c)
- Specified by:
removeAllin interfacejava.util.Collection<TsFileResource>- Specified by:
removeAllin interfacejava.util.List<TsFileResource>
-
retainAll
public boolean retainAll(java.util.Collection<?> c)
- Specified by:
retainAllin interfacejava.util.Collection<TsFileResource>- Specified by:
retainAllin interfacejava.util.List<TsFileResource>
-
get
public TsFileResource get(int index)
- Specified by:
getin interfacejava.util.List<TsFileResource>
-
set
public TsFileResource set(int index, TsFileResource element)
insert tsFileResource to a target pos(targetPos = index) e.g. if index = 0, then to the first, if index = 1, then to the second.- Specified by:
setin interfacejava.util.List<TsFileResource>
-
add
public void add(int index, TsFileResource element)- Specified by:
addin interfacejava.util.List<TsFileResource>
-
remove
public TsFileResource remove(int index)
- Specified by:
removein interfacejava.util.List<TsFileResource>
-
indexOf
public int indexOf(java.lang.Object o)
- Specified by:
indexOfin interfacejava.util.List<TsFileResource>
-
lastIndexOf
public int lastIndexOf(java.lang.Object o)
- Specified by:
lastIndexOfin interfacejava.util.List<TsFileResource>
-
listIterator
public java.util.ListIterator<TsFileResource> listIterator()
- Specified by:
listIteratorin interfacejava.util.List<TsFileResource>
-
listIterator
public java.util.ListIterator<TsFileResource> listIterator(int index)
- Specified by:
listIteratorin interfacejava.util.List<TsFileResource>
-
subList
public java.util.List<TsFileResource> subList(int fromIndex, int toIndex)
- Specified by:
subListin interfacejava.util.List<TsFileResource>
-
getArrayList
public java.util.List<TsFileResource> getArrayList()
-
getHeader
public TsFileResource getHeader()
-
getTail
public TsFileResource getTail()
-
-