Package org.apache.flink.types
Class ListValue<V extends Value>
- java.lang.Object
-
- org.apache.flink.types.ListValue<V>
-
- Type Parameters:
V
- Type of the list elements.
- All Implemented Interfaces:
Serializable
,Iterable<V>
,Collection<V>
,List<V>
,IOReadableWritable
,Value
@Public public abstract class ListValue<V extends Value> extends Object implements Value, List<V>
Generic list base type for PACT programs that implements the Value and List interfaces. PactList encapsulates a Java ArrayList object.- See Also:
Value
,List
,ArrayList
, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ListValue()
Initializes the encapsulated list with an empty ArrayList.ListValue(Collection<V> c)
Initializes the encapsulated list with an ArrayList filled with all object contained in the specified Collection object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(int index, V element)
boolean
add(V e)
boolean
addAll(int index, Collection<? extends V> c)
boolean
addAll(Collection<? extends V> c)
void
clear()
boolean
contains(Object o)
boolean
containsAll(Collection<?> c)
boolean
equals(Object obj)
V
get(int index)
int
hashCode()
int
indexOf(Object o)
boolean
isEmpty()
Iterator<V>
iterator()
int
lastIndexOf(Object o)
ListIterator<V>
listIterator()
ListIterator<V>
listIterator(int index)
void
read(DataInputView in)
Reads the object's internal data from the given data input view.V
remove(int index)
boolean
remove(Object o)
boolean
removeAll(Collection<?> c)
boolean
retainAll(Collection<?> c)
V
set(int index, V element)
int
size()
List<V>
subList(int fromIndex, int toIndex)
Object[]
toArray()
<T> T[]
toArray(T[] a)
String
toString()
void
write(DataOutputView out)
Writes the object's internal data to the given data output view.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface java.util.List
replaceAll, sort, spliterator
-
-
-
-
Constructor Detail
-
ListValue
public ListValue()
Initializes the encapsulated list with an empty ArrayList.- See Also:
ArrayList
-
ListValue
public ListValue(Collection<V> c)
Initializes the encapsulated list with an ArrayList filled with all object contained in the specified Collection object.- Parameters:
c
- Collection of initial element of the encapsulated list.- See Also:
ArrayList
,Collection
-
-
Method Detail
-
read
public void read(DataInputView in) throws IOException
Description copied from interface:IOReadableWritable
Reads the object's internal data from the given data input view.- Specified by:
read
in interfaceIOReadableWritable
- Parameters:
in
- the input view to read the data from- Throws:
IOException
- thrown if any error occurs while reading from the input stream
-
write
public void write(DataOutputView out) throws IOException
Description copied from interface:IOReadableWritable
Writes the object's internal data to the given data output view.- Specified by:
write
in interfaceIOReadableWritable
- Parameters:
out
- the output view to receive the data.- Throws:
IOException
- thrown if any error occurs while writing to the output stream
-
hashCode
public int hashCode()
-
equals
public boolean equals(Object obj)
-
add
public boolean add(V e)
-
addAll
public boolean addAll(Collection<? extends V> c)
-
addAll
public boolean addAll(int index, Collection<? extends V> c)
-
clear
public void clear()
-
contains
public boolean contains(Object o)
-
containsAll
public boolean containsAll(Collection<?> c)
- Specified by:
containsAll
in interfaceCollection<V extends Value>
- Specified by:
containsAll
in interfaceList<V extends Value>
-
isEmpty
public boolean isEmpty()
-
lastIndexOf
public int lastIndexOf(Object o)
- Specified by:
lastIndexOf
in interfaceList<V extends Value>
-
listIterator
public ListIterator<V> listIterator()
- Specified by:
listIterator
in interfaceList<V extends Value>
-
listIterator
public ListIterator<V> listIterator(int index)
- Specified by:
listIterator
in interfaceList<V extends Value>
-
remove
public boolean remove(Object o)
-
removeAll
public boolean removeAll(Collection<?> c)
-
retainAll
public boolean retainAll(Collection<?> c)
-
size
public int size()
-
toArray
public Object[] toArray()
-
-