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

java.lang.Object
  extended by org.apache.avro.generic.GenericData.Array<T>
All Implemented Interfaces:
Iterable<T>, GenericArray<T>
Enclosing class:
GenericData

public static class GenericData.Array<T>
extends Object
implements GenericArray<T>

Default implementation of GenericArray.


Constructor Summary
GenericData.Array(int capacity)
           
 
Method Summary
 void add(T o)
          Add an element to this array.
 void clear()
          Reset the size of the array to zero.
 boolean equals(Object o)
           
 int hashCode()
           
 Iterator<T> iterator()
           
 T peek()
          The current content of the location where GenericArray.add(Object) would next store an element, if any.
 long size()
          The number of elements contained in this array.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenericData.Array

public GenericData.Array(int capacity)
Method Detail

size

public long size()
Description copied from interface: GenericArray
The number of elements contained in this array.

Specified by:
size in interface GenericArray<T>

clear

public void clear()
Description copied from interface: GenericArray
Reset the size of the array to zero.

Specified by:
clear in interface GenericArray<T>

iterator

public Iterator<T> iterator()
Specified by:
iterator in interface Iterable<T>

add

public void add(T o)
Description copied from interface: GenericArray
Add an element to this array.

Specified by:
add in interface GenericArray<T>

peek

public T peek()
Description copied from interface: GenericArray
The current content of the location where GenericArray.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()
Overrides:
hashCode in class Object

equals

public boolean equals(Object o)
Overrides:
equals in class Object


Copyright © 2009 The Apache Software Foundation