Class BlockingList<T>
java.lang.Object
com.sportradar.livedata.sdk.common.classes.BlockingList<T>
A list whose {code compareAndRemove} methods block until the specified item is removed.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidAdds the passed instance to the list.voidcompareAndRemove(T item, long timeout) Blocks until the searched item is found and removed from the list.voidcompareAndRemove(T item, Comparator<T> comparator, long timeout) Blocks until the searched item is found and removed from the list.booleanisEmpty()Returns true if this list contains no elements.intsize()Returns the number of elements in this list.
- 
Constructor Details- 
BlockingListpublic BlockingList()
 
- 
- 
Method Details- 
sizepublic int size()Returns the number of elements in this list. If this list contains more than Integer.MAX_VALUE elements, returns Integer.MAX_VALUE.- Returns:
- the number of elements in this list.
 
- 
isEmptypublic boolean isEmpty()Returns true if this list contains no elements.- Returns:
- true if this list contains no elements.
 
- 
addAdds the passed instance to the list.- Parameters:
- item- the item to be added to the list.
 
- 
compareAndRemoveBlocks until the searched item is found and removed from the list.- Parameters:
- item- The item which is to be removed from the list or null to remove the first item.
- timeout- The time in milliseconds to wait for the item.
- Throws:
- InterruptedException- item was not found in the list in the time allowed time window.
 
- 
compareAndRemovepublic void compareAndRemove(T item, Comparator<T> comparator, long timeout) throws InterruptedException Blocks until the searched item is found and removed from the list.- Parameters:
- item- The item which is to be removed from the list or null to remove the first item.
- comparator- the- Comparatorused to compare the stored items to the passed one.
- timeout- The time in milliseconds to wait for the item.
- Throws:
- InterruptedException- item was not found in the list in the time allowed time window.
 
 
-