org.apache.pig.data
Class DataMap

java.lang.Object
  extended by org.apache.pig.data.Datum
      extended by org.apache.pig.data.DataMap
All Implemented Interfaces:
Comparable

public class DataMap
extends Datum


Field Summary
 
Fields inherited from class org.apache.pig.data.Datum
ATOM, BAG, MAP, OBJECT_SIZE, RECORD_1, RECORD_2, RECORD_3, REF_SIZE, TUPLE
 
Constructor Summary
DataMap()
           
 
Method Summary
 int cardinality()
           
 int compareTo(Object other)
           
 Map<String,Datum> content()
           
 boolean equals(Object other)
           
 Datum get(String key)
          Fetch the value corresponding to a given key
 long getMemorySize()
           
 Set<String> keySet()
           
 void put(String key, Datum value)
          Adds the key value pair to the map
 void put(String key, int value)
          Adds the value as a data atom mapped to the given key
 void put(String key, String value)
          Adds the value as a data atom mapped to the given key
static DataMap read(DataInput in)
           
 Datum remove(String key)
           
 String toString()
           
 void write(DataOutput out)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DataMap

public DataMap()
Method Detail

equals

public boolean equals(Object other)
Specified by:
equals in class Datum

compareTo

public int compareTo(Object other)

cardinality

public int cardinality()
Returns:
the cardinality of the data map

put

public void put(String key,
                Datum value)
Adds the key value pair to the map

Parameters:
key -
value -

put

public void put(String key,
                String value)
Adds the value as a data atom mapped to the given key

Parameters:
key -
value -

put

public void put(String key,
                int value)
Adds the value as a data atom mapped to the given key

Parameters:
key -
value -

get

public Datum get(String key)
Fetch the value corresponding to a given key

Parameters:
key -
Returns:

toString

public String toString()
Overrides:
toString in class Object

read

public static DataMap read(DataInput in)
                    throws IOException
Throws:
IOException

write

public void write(DataOutput out)
           throws IOException
Specified by:
write in class Datum
Throws:
IOException

remove

public Datum remove(String key)

keySet

public Set<String> keySet()

content

public Map<String,Datum> content()

getMemorySize

public long getMemorySize()
Specified by:
getMemorySize in class Datum


Copyright © ${year} The Apache Software Foundation