eu.scape_project.watch.adaptor.c3po
Class C3POProfileReader

java.lang.Object
  extended by eu.scape_project.watch.adaptor.c3po.C3POProfileReader

public class C3POProfileReader
extends Object

A content profile parser. Currently it parses the preliminary content profile aggregation and gets only a few values out of it.

Author:
Petar Petrov

Field Summary
protected static String MISSING_VALUE
          Indicates a missing value.
 
Constructor Summary
C3POProfileReader(File f)
          A file based constructor for test purposes.
C3POProfileReader(InputStream is)
          Creates the reader based on the xml document representation stored in the input stream.
 
Method Summary
 String getCollectionName()
          Retrieves the collection name or identifier of the content profile.
 String getCollectionSize()
          Retrieves the size of the whole collection.
 Map<String,String> getDistribution(String name)
           
 String getObjectsAvgSize()
          Retrieves the average size of all objects in the collection.
 String getObjectsCount()
          Retrieves the objects count in the collection.
 String getObjectsMaxSize()
          Retrieves the size of the largest object in the collection.
 String getObjectsMinSize()
          Retrieves the size of the smallest object in the collection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MISSING_VALUE

protected static final String MISSING_VALUE
Indicates a missing value.

See Also:
Constant Field Values
Constructor Detail

C3POProfileReader

public C3POProfileReader(File f)
                  throws FileNotFoundException
A file based constructor for test purposes. Used mainly in tests and the dummy adaptor.

Parameters:
f - the file that has the content profile.
Throws:
FileNotFoundException - if no file was found.

C3POProfileReader

public C3POProfileReader(InputStream is)
Creates the reader based on the xml document representation stored in the input stream.

Parameters:
is - the input stream of the content profile document.
Method Detail

getCollectionName

public String getCollectionName()
Retrieves the collection name or identifier of the content profile.

Returns:
the identifying name.

getObjectsCount

public String getObjectsCount()
Retrieves the objects count in the collection.

Returns:
a string representation of the count of objects.

getCollectionSize

public String getCollectionSize()
Retrieves the size of the whole collection.

Returns:
a string representation of the size.

getObjectsMaxSize

public String getObjectsMaxSize()
Retrieves the size of the largest object in the collection.

Returns:
a string representation of the max size.

getObjectsMinSize

public String getObjectsMinSize()
Retrieves the size of the smallest object in the collection.

Returns:
a string representation of the min size.

getObjectsAvgSize

public String getObjectsAvgSize()
Retrieves the average size of all objects in the collection.

Returns:
the average size.

getDistribution

public Map<String,String> getDistribution(String name)


Copyright © 2012. All Rights Reserved.