lexx.trie
Class MultiTrie

java.lang.Object
  |
  +--lexx.trie.MultiTrie
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable, Trie

public final class MultiTrie
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable, Trie

MultiTrie takes many Tries and emaulates it as one big Trie

This can save also of memory as you don't need to copy the Tries into single Trie

Copyright (c) 2002-2003

Since:
18/02/2003
Version:
1.0
Author:
Mohammed Imran
See Also:
Serialized Form

Constructor Summary
MultiTrie(java.util.List trieNodes)
           
MultiTrie(Trie[] trieNodes)
           
 
Method Summary
 java.lang.Object clone()
           
 java.util.Vector getAllNodes()
          Returns all the objects node and all its sub-nodes
(package private)  Trie[] getCharMapBase()
           
 java.util.List getCurrentObjects()
          As Trie can have multiple objects with the same key, instead of returning an object, it returns a list of objects
 Trie getNode(java.lang.String key)
          Returns a specific sub-tree
 java.lang.Object getObject()
           
(package private)  Trie[] getTries()
           
 boolean isLeaf()
           
 boolean isSingleLeaf()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultiTrie

public MultiTrie(Trie[] trieNodes)

MultiTrie

public MultiTrie(java.util.List trieNodes)
Method Detail

clone

public java.lang.Object clone()
Specified by:
clone in interface Trie
Overrides:
clone in class java.lang.Object

getTries

Trie[] getTries()

getCharMapBase

Trie[] getCharMapBase()

getNode

public final Trie getNode(java.lang.String key)
Description copied from interface: Trie
Returns a specific sub-tree

Specified by:
getNode in interface Trie
Parameters:
key - sub-tree that has that specific key value
Returns:
Returns a specific sub-tree

getObject

public final java.lang.Object getObject()
Specified by:
getObject in interface Trie

isLeaf

public final boolean isLeaf()
Specified by:
isLeaf in interface Trie

isSingleLeaf

public final boolean isSingleLeaf()
Specified by:
isSingleLeaf in interface Trie

getAllNodes

public final java.util.Vector getAllNodes()
Description copied from interface: Trie
Returns all the objects node and all its sub-nodes

Specified by:
getAllNodes in interface Trie
Returns:
Returns all the objects node and all its sub-nodes

getCurrentObjects

public final java.util.List getCurrentObjects()
Description copied from interface: Trie
As Trie can have multiple objects with the same key, instead of returning an object, it returns a list of objects

Specified by:
getCurrentObjects in interface Trie
Returns:
list of objects