org.apache.avro.generic
Class GenericData.Array<T>

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<T>
          extended by org.apache.avro.generic.GenericData.Array<T>
All Implemented Interfaces:
Comparable<GenericArray<T>>, Iterable<T>, Collection<T>, List<T>, GenericArray<T>, GenericContainer
Enclosing class:
GenericData

public static class GenericData.Array<T>
extends AbstractList<T>
implements GenericArray<T>, Comparable<GenericArray<T>>

Default implementation of an array.


Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
GenericData.Array(int capacity, Schema schema)
           
 
Method Summary
 boolean add(T o)
           
 void clear()
           
 int compareTo(GenericArray<T> that)
           
 boolean equals(Object o)
           
 T get(int i)
           
 Schema getSchema()
          The schema of this instance.
 int hashCode()
           
 Iterator<T> iterator()
           
 T peek()
          The current content of the location where List.add(Object) would next store an element, if any.
 T remove(int i)
           
 void reverse()
          Reverses the order of the elements in this array.
 T set(int i, T o)
           
 int size()
           
 String toString()
           
 
Methods inherited from class java.util.AbstractList
add, addAll, indexOf, lastIndexOf, listIterator, listIterator, removeRange, subList
 
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
add, addAll, addAll, contains, containsAll, indexOf, isEmpty, lastIndexOf, listIterator, listIterator, remove, removeAll, retainAll, subList, toArray, toArray
 

Constructor Detail

GenericData.Array

public GenericData.Array(int capacity,
                         Schema schema)
Method Detail

getSchema

public Schema getSchema()
Description copied from interface: GenericContainer
The schema of this instance.

Specified by:
getSchema in interface GenericContainer

size

public int size()
Specified by:
size in interface Collection<T>
Specified by:
size in interface List<T>
Specified by:
size in class AbstractCollection<T>

clear

public void clear()
Specified by:
clear in interface Collection<T>
Specified by:
clear in interface List<T>
Overrides:
clear in class AbstractList<T>

iterator

public Iterator<T> iterator()
Specified by:
iterator in interface Iterable<T>
Specified by:
iterator in interface Collection<T>
Specified by:
iterator in interface List<T>
Overrides:
iterator in class AbstractList<T>

get

public T get(int i)
Specified by:
get in interface List<T>
Specified by:
get in class AbstractList<T>

add

public boolean add(T o)
Specified by:
add in interface Collection<T>
Specified by:
add in interface List<T>
Overrides:
add in class AbstractList<T>

set

public T set(int i,
             T o)
Specified by:
set in interface List<T>
Overrides:
set in class AbstractList<T>

remove

public T remove(int i)
Specified by:
remove in interface List<T>
Overrides:
remove in class AbstractList<T>

peek

public T peek()
Description copied from interface: GenericArray
The current content of the location where List.add(Object) would next store an element, if any. This permits reuse of arrays and their elements without allocating new objects.

Specified by:
peek in interface GenericArray<T>

hashCode

public int hashCode()
Specified by:
hashCode in interface Collection<T>
Specified by:
hashCode in interface List<T>
Overrides:
hashCode in class AbstractList<T>

equals

public boolean equals(Object o)
Specified by:
equals in interface Collection<T>
Specified by:
equals in interface List<T>
Overrides:
equals in class AbstractList<T>

compareTo

public int compareTo(GenericArray<T> that)
Specified by:
compareTo in interface Comparable<GenericArray<T>>

reverse

public void reverse()
Description copied from interface: GenericArray
Reverses the order of the elements in this array.

Specified by:
reverse in interface GenericArray<T>

toString

public String toString()
Overrides:
toString in class AbstractCollection<T>


Copyright © 2011 The Apache Software Foundation. All Rights Reserved.