org.apache.hadoop.hive.serde2.objectinspector
Class StandardListObjectInspector

java.lang.Object
  extended by org.apache.hadoop.hive.serde2.objectinspector.StandardListObjectInspector
All Implemented Interfaces:
ListObjectInspector, ObjectInspector
Direct Known Subclasses:
LazyBinaryListObjectInspector

public class StandardListObjectInspector
extends Object
implements ListObjectInspector

DefaultListObjectInspector works on list data that is stored as a Java List or Java Array object. Always use the ObjectInspectorFactory to create new ObjectInspector objects, instead of directly creating an instance of this class.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector
ObjectInspector.Category
 
Constructor Summary
protected StandardListObjectInspector(ObjectInspector listElementObjectInspector)
          Call ObjectInspectorFactory.getStandardListObjectInspector instead.
 
Method Summary
 ObjectInspector.Category getCategory()
          An ObjectInspector must inherit from one of the following interfaces if getCategory() returns: PRIMITIVE: PrimitiveObjectInspector LIST: ListObjectInspector MAP: MapObjectInspector STRUCT: StructObjectInspector
 List<?> getList(Object data)
          returns null for data = null.
 Object getListElement(Object data, int index)
          returns null for null list, out-of-the-range index.
 ObjectInspector getListElementObjectInspector()
           
 int getListLength(Object data)
          returns -1 for data = null.
 String getTypeName()
          Returns the name of the data type that is inspected by this ObjectInspector.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StandardListObjectInspector

protected StandardListObjectInspector(ObjectInspector listElementObjectInspector)
Call ObjectInspectorFactory.getStandardListObjectInspector instead.

Method Detail

getCategory

public final ObjectInspector.Category getCategory()
Description copied from interface: ObjectInspector
An ObjectInspector must inherit from one of the following interfaces if getCategory() returns: PRIMITIVE: PrimitiveObjectInspector LIST: ListObjectInspector MAP: MapObjectInspector STRUCT: StructObjectInspector

Specified by:
getCategory in interface ObjectInspector

getListElementObjectInspector

public ObjectInspector getListElementObjectInspector()
Specified by:
getListElementObjectInspector in interface ListObjectInspector

getListElement

public Object getListElement(Object data,
                             int index)
Description copied from interface: ListObjectInspector
returns null for null list, out-of-the-range index.

Specified by:
getListElement in interface ListObjectInspector

getListLength

public int getListLength(Object data)
Description copied from interface: ListObjectInspector
returns -1 for data = null.

Specified by:
getListLength in interface ListObjectInspector

getList

public List<?> getList(Object data)
Description copied from interface: ListObjectInspector
returns null for data = null. Note: This method should not return a List object that is reused by the same ListObjectInspector, because it's possible that the same ListObjectInspector will be used in multiple places in the code. However it's OK if the List object is part of the Object data.

Specified by:
getList in interface ListObjectInspector

getTypeName

public String getTypeName()
Description copied from interface: ObjectInspector
Returns the name of the data type that is inspected by this ObjectInspector. This is used to display the type information to the user. For primitive types, the type name is standardized. For other types, the type name can be something like "list", "map", java class names, or user-defined type names similar to typedef.

Specified by:
getTypeName in interface ObjectInspector


Copyright © 2009 The Apache Software Foundation