SDARTS

edu.columbia.cs.sdarts.dbselection.util
Class SubcolInfo

java.lang.Object
  |
  +--edu.columbia.cs.sdarts.dbselection.util.SubcolInfo

public class SubcolInfo
extends java.lang.Object

This class represents a group of collections, with server url, collection name, collection description, and ranking score.

This class is used by DBSelectionServer to write subcol infos to client. Also used by web client to parse subcol info returned from dbselection server


Field Summary
 java.util.Vector subcols
           
 
Constructor Summary
SubcolInfo()
          default construtor do nothing
SubcolInfo(org.jdom.Element scie)
          constructor, takes a element, whose name is subcolInfo, parse it and create an SubcolInfo, with all namespace ignored.
SubcolInfo(java.io.InputStream is)
          construct a SubcolInfo from an InputStream is.
SubcolInfo(java.lang.String sci)
          construct a SubcolInfo from a string
 
Method Summary
 void addSubcol(Subcol sc)
          add one Subcol sc into this info list
static void main(java.lang.String[] args)
          This method is for testing purpose it takes a filename, and parse it into SubcolInfo, and spit the xml back.
 void sort(boolean descending)
          bubble sort subcols on their ranking score
 org.jdom.Element toElement()
          returns an element representation of this SubcolInfo with default element name "subcolInfo"
 org.jdom.Element toElement(java.lang.String name)
          returns an element representation of this SubcolInfo with element name name
 java.lang.String toXML()
          returns a string representation of this SubcolInfo, with default root element name "subcolInfo"
 java.lang.String toXML(java.lang.String name)
          returns a string representation of this SubcolInfo, with it's root element name name
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

subcols

public java.util.Vector subcols
Constructor Detail

SubcolInfo

public SubcolInfo()
default construtor do nothing

SubcolInfo

public SubcolInfo(java.io.InputStream is)
           throws org.jdom.JDOMException
construct a SubcolInfo from an InputStream is.
Parameters:
is - the input stream to read from

SubcolInfo

public SubcolInfo(java.lang.String sci)
           throws org.jdom.JDOMException
construct a SubcolInfo from a string
Parameters:
sci - the string to create SubcolInfo from

SubcolInfo

public SubcolInfo(org.jdom.Element scie)
constructor, takes a element, whose name is subcolInfo, parse it and create an SubcolInfo, with all namespace ignored.
Parameters:
scie - the element to create SubcolInfo from
Method Detail

main

public static void main(java.lang.String[] args)
                 throws org.jdom.JDOMException
This method is for testing purpose it takes a filename, and parse it into SubcolInfo, and spit the xml back.
Parameters:
args - the command line arguments, only need filename

addSubcol

public void addSubcol(Subcol sc)
add one Subcol sc into this info list
Parameters:
sc - the Subcol to add

sort

public void sort(boolean descending)
bubble sort subcols on their ranking score
Parameters:
descending - sorting order is descending?

toElement

public org.jdom.Element toElement(java.lang.String name)
returns an element representation of this SubcolInfo with element name name
Parameters:
name - the name of the result element
Returns:
the element created

toElement

public org.jdom.Element toElement()
returns an element representation of this SubcolInfo with default element name "subcolInfo"
Returns:
the element created

toXML

public java.lang.String toXML(java.lang.String name)
returns a string representation of this SubcolInfo, with it's root element name name
Parameters:
name - the root element name
Returns:
the string created

toXML

public java.lang.String toXML()
returns a string representation of this SubcolInfo, with default root element name "subcolInfo"
Returns:
the string created

SDARTS

Sdarts Homepage