Terrier IR Platform
2.2.1

uk.ac.gla.terrier.structures.indexing.singlepass.hadoop
Class WritableByteArray

java.lang.Object
  extended by uk.ac.gla.terrier.structures.indexing.singlepass.hadoop.WritableByteArray
All Implemented Interfaces:
org.apache.hadoop.io.Writable
Direct Known Subclasses:
MapEmittedPostingList

public class WritableByteArray
extends java.lang.Object
implements org.apache.hadoop.io.Writable

Represents a Writable Posting List. Contains the Posting List, DOcument Frequency and Term Frequency.

Since:
2.2
Version:
$Revision: 1.2 $
Author:
Richard McCreadie

Constructor Summary
WritableByteArray()
          Empty Constructor
WritableByteArray(int c)
          Constructor - with Document Frequency
WritableByteArray(int c, int c2)
          Constructor - with Document Frequency and Term Frequency
 
Method Summary
static WritableByteArray create_Hadoop_WritableByteArray(byte[] b)
          Factory Method
static WritableByteArray create_Hadoop_WritableByteArray(byte[] b, int c)
          Factory Method
static WritableByteArray create_Hadoop_WritableByteArray(byte[] b, int c, int c2)
          Factory Method
 byte[] getArray()
           
 int getDocumentFreq()
           
 int getTermFreq()
           
 void readFields(java.io.DataInput arg0)
          Read this object from the input stream 'in'
 void setArray(byte[] b)
           
 void setDocumentFreq(int DocumentFreq)
           
 void setTermFrequency(int TermFreq)
           
 java.lang.String toString()
           
 void write(java.io.DataOutput arg0)
          Write this object to the output stream 'out'
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WritableByteArray

public WritableByteArray()
Empty Constructor


WritableByteArray

public WritableByteArray(int c)
Constructor - with Document Frequency

Parameters:
c - - Document Frequency

WritableByteArray

public WritableByteArray(int c,
                         int c2)
Constructor - with Document Frequency and Term Frequency

Parameters:
c - - Document Frequency
c2 - - Term Frequency
Method Detail

create_Hadoop_WritableByteArray

public static WritableByteArray create_Hadoop_WritableByteArray(byte[] b)
                                                         throws java.io.IOException
Factory Method

Parameters:
b - - Posting List
Returns:
a newly created object
Throws:
java.io.IOException

create_Hadoop_WritableByteArray

public static WritableByteArray create_Hadoop_WritableByteArray(byte[] b,
                                                                int c)
                                                         throws java.io.IOException
Factory Method

Parameters:
b - - Posting List
c - - Document Frequency
Returns:
a newly created object
Throws:
java.io.IOException

create_Hadoop_WritableByteArray

public static WritableByteArray create_Hadoop_WritableByteArray(byte[] b,
                                                                int c,
                                                                int c2)
                                                         throws java.io.IOException
Factory Method

Parameters:
b - - Posting List
c - - Document Frequency
c2 - - Term Frequency
Returns:
a newly created Indexing_WritableByteArray
Throws:
java.io.IOException

readFields

public void readFields(java.io.DataInput arg0)
                throws java.io.IOException
Read this object from the input stream 'in'

Specified by:
readFields in interface org.apache.hadoop.io.Writable
Throws:
java.io.IOException

write

public void write(java.io.DataOutput arg0)
           throws java.io.IOException
Write this object to the output stream 'out'

Specified by:
write in interface org.apache.hadoop.io.Writable
Throws:
java.io.IOException

setArray

public void setArray(byte[] b)

getArray

public byte[] getArray()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getDocumentFreq

public int getDocumentFreq()

setDocumentFreq

public void setDocumentFreq(int DocumentFreq)

getTermFreq

public int getTermFreq()

setTermFrequency

public void setTermFrequency(int TermFreq)

Terrier IR Platform
2.2.1

Terrier Information Retrieval Platform 2.2.1. Copyright 2004-2008 University of Glasgow