org.javimmutable.collections.array.trie32
Class LeafTrieNode<T>

java.lang.Object
  extended by org.javimmutable.collections.array.trie32.TrieNode<T>
      extended by org.javimmutable.collections.array.trie32.LeafTrieNode<T>
All Implemented Interfaces:
Holder<T>

@Immutable
public class LeafTrieNode<T>
extends TrieNode<T>
implements Holder<T>


Field Summary
 
Fields inherited from class org.javimmutable.collections.array.trie32.TrieNode
ROOT_SHIFT
 
Method Summary
 Cursor<JImmutableMap.Entry<Integer,T>> anyOrderEntryCursor()
           
<K,V> Cursor<JImmutableMap.Entry<K,V>>
anyOrderEntryCursor(Transforms<T,K,V> transforms)
           
 Cursor<T> anyOrderValueCursor()
           
<K,V> TrieNode<T>
assign(int shift, int index, K key, V value, Transforms<T,K,V> transforms, MutableDelta sizeDelta)
           
 TrieNode<T> assign(int shift, int index, T value, MutableDelta sizeDelta)
           
<K,V> TrieNode<T>
delete(int shift, int index, K key, Transforms<T,K,V> transforms, MutableDelta sizeDelta)
           
 TrieNode<T> delete(int shift, int index, MutableDelta sizeDelta)
           
 boolean equals(Object o)
           
 Holder<T> find(int shift, int index)
           
<K,V> Holder<V>
find(int shift, int index, K key, Transforms<T,K,V> transforms)
           
 int getShift()
           
 T getValue()
          Retrieve the value of a filled Holder.
<K,V> V
getValueOr(int shift, int index, K key, Transforms<T,K,V> transforms, V defaultValue)
           
 T getValueOr(int shift, int index, T defaultValue)
           
 T getValueOr(T defaultValue)
          Retrieve the value of a filled Holder or the defaultValue if Holder is empty
 T getValueOrNull()
          Retrieve the value of a filled Holder or null if Holder is empty.
 int hashCode()
           
 boolean isEmpty()
           
 boolean isFilled()
           
 boolean isLeaf()
           
 TrieNode<T> paddedToMinimumDepthForShift(int shift)
           
 
Methods inherited from class org.javimmutable.collections.array.trie32.TrieNode
fromSource, of, shiftForIndex, signedOrderEntryCursor, signedOrderEntryCursor, signedOrderValueCursor, trimmedToMinimumDepth
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Holder<T>
Specified by:
isEmpty in class TrieNode<T>
Returns:
true iff this Holder has no value to return

getValueOr

public T getValueOr(int shift,
                    int index,
                    T defaultValue)
Specified by:
getValueOr in class TrieNode<T>

getValueOr

public <K,V> V getValueOr(int shift,
                          int index,
                          K key,
                          Transforms<T,K,V> transforms,
                          V defaultValue)
Specified by:
getValueOr in class TrieNode<T>

find

public Holder<T> find(int shift,
                      int index)
Specified by:
find in class TrieNode<T>

find

public <K,V> Holder<V> find(int shift,
                            int index,
                            K key,
                            Transforms<T,K,V> transforms)
Specified by:
find in class TrieNode<T>

assign

public TrieNode<T> assign(int shift,
                          int index,
                          T value,
                          MutableDelta sizeDelta)
Specified by:
assign in class TrieNode<T>

assign

public <K,V> TrieNode<T> assign(int shift,
                                int index,
                                K key,
                                V value,
                                Transforms<T,K,V> transforms,
                                MutableDelta sizeDelta)
Specified by:
assign in class TrieNode<T>

delete

public TrieNode<T> delete(int shift,
                          int index,
                          MutableDelta sizeDelta)
Specified by:
delete in class TrieNode<T>

delete

public <K,V> TrieNode<T> delete(int shift,
                                int index,
                                K key,
                                Transforms<T,K,V> transforms,
                                MutableDelta sizeDelta)
Specified by:
delete in class TrieNode<T>

getShift

public int getShift()
Specified by:
getShift in class TrieNode<T>

isLeaf

public boolean isLeaf()
Specified by:
isLeaf in class TrieNode<T>

paddedToMinimumDepthForShift

public TrieNode<T> paddedToMinimumDepthForShift(int shift)
Overrides:
paddedToMinimumDepthForShift in class TrieNode<T>

anyOrderEntryCursor

public Cursor<JImmutableMap.Entry<Integer,T>> anyOrderEntryCursor()
Specified by:
anyOrderEntryCursor in class TrieNode<T>

anyOrderEntryCursor

public <K,V> Cursor<JImmutableMap.Entry<K,V>> anyOrderEntryCursor(Transforms<T,K,V> transforms)
Specified by:
anyOrderEntryCursor in class TrieNode<T>

anyOrderValueCursor

public Cursor<T> anyOrderValueCursor()
Specified by:
anyOrderValueCursor in class TrieNode<T>

isFilled

public boolean isFilled()
Specified by:
isFilled in interface Holder<T>
Returns:
true iff this Holder has a value to return

getValue

public T getValue()
Description copied from interface: Holder
Retrieve the value of a filled Holder. Must throw if Holder is empty.

Specified by:
getValue in interface Holder<T>
Returns:
the (possibly null) value

getValueOrNull

public T getValueOrNull()
Description copied from interface: Holder
Retrieve the value of a filled Holder or null if Holder is empty.

Specified by:
getValueOrNull in interface Holder<T>
Returns:
null (empty) or value (filled)

getValueOr

public T getValueOr(T defaultValue)
Description copied from interface: Holder
Retrieve the value of a filled Holder or the defaultValue if Holder is empty

Specified by:
getValueOr in interface Holder<T>
Parameters:
defaultValue - value to return if Holder is empty
Returns:
value or defaultValue

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2014 Burton Computer Corporation. All rights reserved.