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

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

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

Default implementation of GenericArray.


Constructor Summary
GenericData.Array(int capacity, Schema schema)
           
 
Method Summary
 void add(T o)
          Add an element to this array.
 void clear()
          Reset the size of the array to zero.
 int compareTo(GenericData.Array<T> that)
           
 boolean equals(Object o)
           
 Schema getSchema()
          The schema of this instance.
 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.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

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 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

compareTo

public int compareTo(GenericData.Array<T> that)
Specified by:
compareTo in interface Comparable<GenericData.Array<T>>

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2010 The Apache Software Foundation