jsparky
クラス Utils

java.lang.Object
  拡張jsparky.Utils

public class Utils
extends java.lang.Object

simple utils


フィールドの概要
static java.util.Random rand
          global static for random
 
コンストラクタの概要
Utils()
           
 
メソッドの概要
static void addHashtable(java.util.Hashtable h1, java.util.Hashtable h2)
           
static void copyAttributes(org.w3c.dom.Element src, org.w3c.dom.Element target)
          copy attributes from src to target
static int countItem(java.util.List lis, java.lang.Object target)
          count object in a list
static org.w3c.dom.traversal.TreeWalker createTreeWalker(org.w3c.dom.Element elem)
           
static java.util.List getAllDSS(Aggregatable a)
          get dss under aggregatable
static java.util.List getAllDSS(AggregatedElement elem)
          process all dss under an aggregated element
static void getAllDSS(AggregatedElement elem, java.util.List lis)
           
static java.util.Hashtable getAllDSSHash(AggregatedElement elem)
          process all dss under an aggregated element with an associated proposition list
static void getAllDSSHash(AggregatedElement elem, java.util.Hashtable hash)
           
static java.util.List getChildrenByTagAndAttr(org.w3c.dom.Element parent, java.lang.String tagName, java.lang.String attrname, java.lang.String attrvalue)
          getchildren
static java.util.List getChildrenByTagName(org.w3c.dom.Element parent, java.lang.String tagName)
          getchildren
static java.util.List getElementsByTagAndAttr(org.w3c.dom.Document document, java.lang.String tag, java.lang.String attrname, java.lang.String attrvalue)
          get specified elements from a document
static java.util.List getElementsByTagAndAttr(org.w3c.dom.Element el, java.lang.String tag, java.lang.String attrname, java.lang.String attrvalue)
          get specified elements from a document
static java.util.Vector getFiles(java.lang.String dir, java.lang.String ext)
          get file list under a directory
static org.w3c.dom.Element getFirstElementByTagAndAttr(org.w3c.dom.Element el, java.lang.String tag, java.lang.String attrname, java.lang.String attrvalue)
          get first specified element under an element
static java.util.List getPropositionList(Aggregatable a)
          get propositions under aggregatable
static org.w3c.dom.Element getSingleElementByTagAndAttr(org.w3c.dom.Document document, java.lang.String tag, java.lang.String attrname, java.lang.String attrvalue)
          get a single specified element from a document
static org.w3c.dom.Element getSingleElementByTagAndAttr(org.w3c.dom.Element el, java.lang.String tag, java.lang.String attrname, java.lang.String attrvalue)
          get a single specified element from a document
static java.lang.String getText(org.w3c.dom.Node node)
          XML Utility
static java.lang.String getText(org.w3c.dom.Node node, java.io.StringWriter sw)
           
static boolean hasSingleObject(java.util.List lis)
          has only one elements in the list
static boolean isIdentical(org.w3c.dom.Element e1, org.w3c.dom.Element e2, boolean deep)
          Same structure
static boolean isIdenticalElement(org.w3c.dom.Element e1, org.w3c.dom.Element e2)
           
static boolean isIdenticalStructure(org.w3c.dom.Element e1, org.w3c.dom.Element e2)
           
static java.lang.String join(java.util.List lis, java.lang.String delim)
          join (as in perl)
static java.util.List nodeListToList(org.w3c.dom.NodeList nl)
          convert nodelist to a list
static org.w3c.dom.Document parseDocument(java.lang.String filename)
          parse XML document
static java.lang.String process_rightmost_comma(java.lang.String text)
           
static java.util.List safeShuffle(java.util.List lis)
          shuffle safe
static boolean sameHashtable(java.util.Hashtable h1, java.util.Hashtable h2)
           
static boolean sameKeysInHashtable(java.util.Hashtable h1, java.util.Hashtable h2)
           
static java.lang.Object selectOne(java.util.List lis)
          selectOne
static java.lang.Object[] selectTwo(java.util.List lis)
          selectTwo
static java.lang.String serialize(org.w3c.dom.Document doc)
          serialize
static java.lang.String serialize(org.w3c.dom.Element elem)
          serialize function
static void shuffle(java.util.List lis)
          shuffle
static boolean trueOrFalse()
          binary choice
static boolean trueOrFalse(int percent)
          binary choice : out of 100
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

フィールドの詳細

rand

public static java.util.Random rand
global static for random

コンストラクタの詳細

Utils

public Utils()
メソッドの詳細

getText

public static java.lang.String getText(org.w3c.dom.Node node)
XML Utility


getText

public static java.lang.String getText(org.w3c.dom.Node node,
                                       java.io.StringWriter sw)

parseDocument

public static org.w3c.dom.Document parseDocument(java.lang.String filename)
parse XML document


serialize

public static java.lang.String serialize(org.w3c.dom.Document doc)
serialize


serialize

public static java.lang.String serialize(org.w3c.dom.Element elem)
serialize function


getSingleElementByTagAndAttr

public static org.w3c.dom.Element getSingleElementByTagAndAttr(org.w3c.dom.Document document,
                                                               java.lang.String tag,
                                                               java.lang.String attrname,
                                                               java.lang.String attrvalue)
get a single specified element from a document


getSingleElementByTagAndAttr

public static org.w3c.dom.Element getSingleElementByTagAndAttr(org.w3c.dom.Element el,
                                                               java.lang.String tag,
                                                               java.lang.String attrname,
                                                               java.lang.String attrvalue)
get a single specified element from a document


getFirstElementByTagAndAttr

public static org.w3c.dom.Element getFirstElementByTagAndAttr(org.w3c.dom.Element el,
                                                              java.lang.String tag,
                                                              java.lang.String attrname,
                                                              java.lang.String attrvalue)
get first specified element under an element


getElementsByTagAndAttr

public static java.util.List getElementsByTagAndAttr(org.w3c.dom.Document document,
                                                     java.lang.String tag,
                                                     java.lang.String attrname,
                                                     java.lang.String attrvalue)
get specified elements from a document


getElementsByTagAndAttr

public static java.util.List getElementsByTagAndAttr(org.w3c.dom.Element el,
                                                     java.lang.String tag,
                                                     java.lang.String attrname,
                                                     java.lang.String attrvalue)
get specified elements from a document


getChildrenByTagName

public static java.util.List getChildrenByTagName(org.w3c.dom.Element parent,
                                                  java.lang.String tagName)
getchildren


getChildrenByTagAndAttr

public static java.util.List getChildrenByTagAndAttr(org.w3c.dom.Element parent,
                                                     java.lang.String tagName,
                                                     java.lang.String attrname,
                                                     java.lang.String attrvalue)
getchildren


nodeListToList

public static java.util.List nodeListToList(org.w3c.dom.NodeList nl)
convert nodelist to a list


copyAttributes

public static void copyAttributes(org.w3c.dom.Element src,
                                  org.w3c.dom.Element target)
copy attributes from src to target


isIdentical

public static boolean isIdentical(org.w3c.dom.Element e1,
                                  org.w3c.dom.Element e2,
                                  boolean deep)
Same structure


isIdenticalStructure

public static boolean isIdenticalStructure(org.w3c.dom.Element e1,
                                           org.w3c.dom.Element e2)

isIdenticalElement

public static boolean isIdenticalElement(org.w3c.dom.Element e1,
                                         org.w3c.dom.Element e2)

createTreeWalker

public static org.w3c.dom.traversal.TreeWalker createTreeWalker(org.w3c.dom.Element elem)

selectOne

public static java.lang.Object selectOne(java.util.List lis)
selectOne


selectTwo

public static java.lang.Object[] selectTwo(java.util.List lis)
selectTwo


trueOrFalse

public static boolean trueOrFalse()
binary choice


trueOrFalse

public static boolean trueOrFalse(int percent)
binary choice : out of 100


addHashtable

public static void addHashtable(java.util.Hashtable h1,
                                java.util.Hashtable h2)

sameKeysInHashtable

public static boolean sameKeysInHashtable(java.util.Hashtable h1,
                                          java.util.Hashtable h2)

sameHashtable

public static boolean sameHashtable(java.util.Hashtable h1,
                                    java.util.Hashtable h2)

getFiles

public static java.util.Vector getFiles(java.lang.String dir,
                                        java.lang.String ext)
get file list under a directory


shuffle

public static void shuffle(java.util.List lis)
shuffle


safeShuffle

public static java.util.List safeShuffle(java.util.List lis)
shuffle safe


hasSingleObject

public static boolean hasSingleObject(java.util.List lis)
has only one elements in the list


countItem

public static int countItem(java.util.List lis,
                            java.lang.Object target)
count object in a list


join

public static java.lang.String join(java.util.List lis,
                                    java.lang.String delim)
join (as in perl)


getPropositionList

public static java.util.List getPropositionList(Aggregatable a)
get propositions under aggregatable


getAllDSS

public static java.util.List getAllDSS(Aggregatable a)
get dss under aggregatable


getAllDSS

public static java.util.List getAllDSS(AggregatedElement elem)
process all dss under an aggregated element


getAllDSS

public static void getAllDSS(AggregatedElement elem,
                             java.util.List lis)

getAllDSSHash

public static java.util.Hashtable getAllDSSHash(AggregatedElement elem)
process all dss under an aggregated element with an associated proposition list


getAllDSSHash

public static void getAllDSSHash(AggregatedElement elem,
                                 java.util.Hashtable hash)

process_rightmost_comma

public static java.lang.String process_rightmost_comma(java.lang.String text)