All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class xset.SETutils

java.lang.Object
   |
   +----xset.SETutils

public class SETutils
extends Object

Constructor Index

 o SETutils()

Method Index

 o getChildren(Element)
Methods that takes an XML4J/DOM element and returns its children, ignoring whitespaces between tags
 o hasher(Document, String)
 o hasher(String, String)
Method that implements a hashing algorithm (MD5 or SHA-1).
 o numChildren(Element)
Method to take an XML4J DOM element and count its number of children Whitespaces here are not ignored.
 o parseFile(String)
Method that packages up a file into an inputstream
 o printElement(Element)
Simplistic method to print out an element with its immediate children
 o queryMax(Vector, String)
Vector queryMax(Vector, String) *** Method that returns the desired document or tags that represents the maximum value in a given tag.
 o queryMin(Vector, String)
Vector queryMin(Vector, String) *** Method that returns the desired document or tags that represents the minimum value in a given tag.
 o stringMaxMin(Vector, int)
String stringMaxMin(Vector, int) *** Method that rerturns the min or max string from a vector of strings

Constructors

 o SETutils
 public SETutils()

Methods

 o queryMax
 public static Vector queryMax(Vector xmlVector,
                               String rangeTag)
Vector queryMax(Vector, String) *** Method that returns the desired document or tags that represents the maximum value in a given tag. Just a wrapper for queryMaxMin

Parameters:
xmlVector - The vector of XML documents to be compared
rangeTag - The string name of the tag the max is executed on
Returns:
vector of simple xml documents as strings
 o queryMin
 public static Vector queryMin(Vector xmlVector,
                               String rangeTag)
Vector queryMin(Vector, String) *** Method that returns the desired document or tags that represents the minimum value in a given tag. Just a wrapper for queryMaxMin

Parameters:
xmlVector - The vector of XML documents to be compared
rangeTag - The string name of the tag the min is executed on
Returns:
vector of simple xml documents as strings
 o stringMaxMin
 public static String stringMaxMin(Vector stringV,
                                   int maxmin)
String stringMaxMin(Vector, int) *** Method that rerturns the min or max string from a vector of strings

Parameters:
stringV - the vector of strings that we take the max or min from
maxmin, - indicator of max or min, if <0 min, if >0 max, if 0 null
Returns:
string that is the end result value as the max or min
 o numChildren
 public static int numChildren(Element e)
Method to take an XML4J DOM element and count its number of children Whitespaces here are not ignored. For that value, do getChildren().size()

Parameters:
e - The DOM element in question
Returns:
integer that represents the number of children it has
 o getChildren
 public static Vector getChildren(Element e)
Methods that takes an XML4J/DOM element and returns its children, ignoring whitespaces between tags

Parameters:
e - The DOM element that we find nonwhitespace children for
Returns:
Vector containing the child DOM elements
 o printElement
 public static void printElement(Element n)
Simplistic method to print out an element with its immediate children

 o parseFile
 public static InputStream parseFile(String f) throws FileNotFoundException
Method that packages up a file into an inputstream

 o hasher
 public static String hasher(String inString,
                             String alg) throws NoSuchAlgorithmException
Method that implements a hashing algorithm (MD5 or SHA-1). Takes in a string and returns a string that represented the hashed value.

Parameters:
inString - The input that is to be hashed
alg - The algorithm to be used, either "MD5" or "SHA-1"
Returns:
the hashed value of inString
Throws: NoSuchAlgorithmException
thrown when algorithm is unknown
 o hasher
 public static String hasher(Document d,
                             String alg) throws NoSuchAlgorithmException

All Packages  Class Hierarchy  This Package  Previous  Next  Index