Class MapDataModel

java.lang.Object
swim.store.mem.MapDataModel
All Implemented Interfaces:
Iterable<Map.Entry<swim.structure.Value,swim.structure.Value>>, Map<swim.structure.Value,swim.structure.Value>, SortedMap<swim.structure.Value,swim.structure.Value>, swim.api.data.MapData<swim.structure.Value,swim.structure.Value>, swim.store.DataBinding, swim.store.MapDataBinding, swim.util.IterableMap<swim.structure.Value,swim.structure.Value>, swim.util.OrderedMap<swim.structure.Value,swim.structure.Value>

public class MapDataModel extends Object implements swim.store.MapDataBinding
  • Field Details

    • name

      protected final swim.structure.Value name
    • tree

      protected final swim.collections.BTreeMap<swim.structure.Value,swim.structure.Value,swim.structure.Value> tree
    • dataContext

      protected swim.store.MapDataContext dataContext
    • storeBinding

      protected swim.store.StoreBinding storeBinding
  • Constructor Details

    • MapDataModel

      public MapDataModel(swim.structure.Value name, swim.collections.BTreeMap<swim.structure.Value,swim.structure.Value,swim.structure.Value> tree)
  • Method Details

    • dataContext

      public swim.store.MapDataContext dataContext()
      Specified by:
      dataContext in interface swim.store.DataBinding
      Specified by:
      dataContext in interface swim.store.MapDataBinding
    • setDataContext

      public void setDataContext(swim.store.MapDataContext dataContext)
      Specified by:
      setDataContext in interface swim.store.MapDataBinding
    • storeBinding

      public swim.store.StoreBinding storeBinding()
      Specified by:
      storeBinding in interface swim.store.DataBinding
    • setStoreBinding

      public void setStoreBinding(swim.store.StoreBinding storeBinding)
      Specified by:
      setStoreBinding in interface swim.store.DataBinding
    • unwrapData

      public <T> T unwrapData(Class<T> dataClass)
      Specified by:
      unwrapData in interface swim.store.DataBinding
    • tree

      public final swim.collections.BTreeMap<swim.structure.Value,swim.structure.Value,swim.structure.Value> tree()
    • name

      public final swim.structure.Value name()
      Specified by:
      name in interface swim.store.DataBinding
      Specified by:
      name in interface swim.api.data.MapData<swim.structure.Value,swim.structure.Value>
    • keyForm

      public swim.structure.Form<swim.structure.Value> keyForm()
      Specified by:
      keyForm in interface swim.api.data.MapData<swim.structure.Value,swim.structure.Value>
    • keyForm

      public <K2> swim.api.data.MapData<K2,swim.structure.Value> keyForm(swim.structure.Form<K2> keyForm)
      Specified by:
      keyForm in interface swim.api.data.MapData<swim.structure.Value,swim.structure.Value>
    • keyClass

      public <K2> swim.api.data.MapData<K2,swim.structure.Value> keyClass(Class<K2> keyClass)
      Specified by:
      keyClass in interface swim.api.data.MapData<swim.structure.Value,swim.structure.Value>
    • valueForm

      public swim.structure.Form<swim.structure.Value> valueForm()
      Specified by:
      valueForm in interface swim.api.data.MapData<swim.structure.Value,swim.structure.Value>
    • valueForm

      public <V2> swim.api.data.MapData<swim.structure.Value,V2> valueForm(swim.structure.Form<V2> valueForm)
      Specified by:
      valueForm in interface swim.api.data.MapData<swim.structure.Value,swim.structure.Value>
    • valueClass

      public <V2> swim.api.data.MapData<swim.structure.Value,V2> valueClass(Class<V2> valueClass)
      Specified by:
      valueClass in interface swim.api.data.MapData<swim.structure.Value,swim.structure.Value>
    • dataSize

      public long dataSize()
      Specified by:
      dataSize in interface swim.store.DataBinding
    • isResident

      public boolean isResident()
      Specified by:
      isResident in interface swim.store.DataBinding
      Specified by:
      isResident in interface swim.api.data.MapData<swim.structure.Value,swim.structure.Value>
    • isResident

      public swim.store.MapDataBinding isResident(boolean isResident)
      Specified by:
      isResident in interface swim.store.DataBinding
      Specified by:
      isResident in interface swim.api.data.MapData<swim.structure.Value,swim.structure.Value>
      Specified by:
      isResident in interface swim.store.MapDataBinding
    • isTransient

      public boolean isTransient()
      Specified by:
      isTransient in interface swim.store.DataBinding
      Specified by:
      isTransient in interface swim.api.data.MapData<swim.structure.Value,swim.structure.Value>
    • isTransient

      public swim.store.MapDataBinding isTransient(boolean isTransient)
      Specified by:
      isTransient in interface swim.store.DataBinding
      Specified by:
      isTransient in interface swim.api.data.MapData<swim.structure.Value,swim.structure.Value>
      Specified by:
      isTransient in interface swim.store.MapDataBinding
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface swim.util.IterableMap<swim.structure.Value,swim.structure.Value>
      Specified by:
      isEmpty in interface Map<swim.structure.Value,swim.structure.Value>
      Specified by:
      isEmpty in interface swim.util.OrderedMap<swim.structure.Value,swim.structure.Value>
    • size

      public int size()
      Specified by:
      size in interface swim.util.IterableMap<swim.structure.Value,swim.structure.Value>
      Specified by:
      size in interface Map<swim.structure.Value,swim.structure.Value>
      Specified by:
      size in interface swim.util.OrderedMap<swim.structure.Value,swim.structure.Value>
    • containsKey

      public boolean containsKey(Object key)
      Specified by:
      containsKey in interface swim.util.IterableMap<swim.structure.Value,swim.structure.Value>
      Specified by:
      containsKey in interface Map<swim.structure.Value,swim.structure.Value>
      Specified by:
      containsKey in interface swim.util.OrderedMap<swim.structure.Value,swim.structure.Value>
    • containsValue

      public boolean containsValue(Object value)
      Specified by:
      containsValue in interface swim.util.IterableMap<swim.structure.Value,swim.structure.Value>
      Specified by:
      containsValue in interface Map<swim.structure.Value,swim.structure.Value>
      Specified by:
      containsValue in interface swim.util.OrderedMap<swim.structure.Value,swim.structure.Value>
    • indexOf

      public int indexOf(Object key)
      Specified by:
      indexOf in interface swim.util.OrderedMap<swim.structure.Value,swim.structure.Value>
    • get

      public swim.structure.Value get(Object key)
      Specified by:
      get in interface swim.util.IterableMap<swim.structure.Value,swim.structure.Value>
      Specified by:
      get in interface Map<swim.structure.Value,swim.structure.Value>
      Specified by:
      get in interface swim.util.OrderedMap<swim.structure.Value,swim.structure.Value>
    • getEntry

      public Map.Entry<swim.structure.Value,swim.structure.Value> getEntry(Object key)
      Specified by:
      getEntry in interface swim.util.OrderedMap<swim.structure.Value,swim.structure.Value>
    • getIndex

      public Map.Entry<swim.structure.Value,swim.structure.Value> getIndex(int index)
      Specified by:
      getIndex in interface swim.util.OrderedMap<swim.structure.Value,swim.structure.Value>
    • firstEntry

      public Map.Entry<swim.structure.Value,swim.structure.Value> firstEntry()
      Specified by:
      firstEntry in interface swim.util.OrderedMap<swim.structure.Value,swim.structure.Value>
    • firstKey

      public swim.structure.Value firstKey()
      Specified by:
      firstKey in interface swim.util.OrderedMap<swim.structure.Value,swim.structure.Value>
      Specified by:
      firstKey in interface SortedMap<swim.structure.Value,swim.structure.Value>
    • firstValue

      public swim.structure.Value firstValue()
      Specified by:
      firstValue in interface swim.util.OrderedMap<swim.structure.Value,swim.structure.Value>
    • lastEntry

      public Map.Entry<swim.structure.Value,swim.structure.Value> lastEntry()
      Specified by:
      lastEntry in interface swim.util.OrderedMap<swim.structure.Value,swim.structure.Value>
    • lastKey

      public swim.structure.Value lastKey()
      Specified by:
      lastKey in interface swim.util.OrderedMap<swim.structure.Value,swim.structure.Value>
      Specified by:
      lastKey in interface SortedMap<swim.structure.Value,swim.structure.Value>
    • lastValue

      public swim.structure.Value lastValue()
      Specified by:
      lastValue in interface swim.util.OrderedMap<swim.structure.Value,swim.structure.Value>
    • nextEntry

      public Map.Entry<swim.structure.Value,swim.structure.Value> nextEntry(swim.structure.Value key)
      Specified by:
      nextEntry in interface swim.util.OrderedMap<swim.structure.Value,swim.structure.Value>
    • nextKey

      public swim.structure.Value nextKey(swim.structure.Value key)
      Specified by:
      nextKey in interface swim.util.OrderedMap<swim.structure.Value,swim.structure.Value>
    • nextValue

      public swim.structure.Value nextValue(swim.structure.Value key)
      Specified by:
      nextValue in interface swim.util.OrderedMap<swim.structure.Value,swim.structure.Value>
    • previousEntry

      public Map.Entry<swim.structure.Value,swim.structure.Value> previousEntry(swim.structure.Value key)
      Specified by:
      previousEntry in interface swim.util.OrderedMap<swim.structure.Value,swim.structure.Value>
    • previousKey

      public swim.structure.Value previousKey(swim.structure.Value key)
      Specified by:
      previousKey in interface swim.util.OrderedMap<swim.structure.Value,swim.structure.Value>
    • previousValue

      public swim.structure.Value previousValue(swim.structure.Value key)
      Specified by:
      previousValue in interface swim.util.OrderedMap<swim.structure.Value,swim.structure.Value>
    • put

      public swim.structure.Value put(swim.structure.Value key, swim.structure.Value value)
      Specified by:
      put in interface swim.util.IterableMap<swim.structure.Value,swim.structure.Value>
      Specified by:
      put in interface Map<swim.structure.Value,swim.structure.Value>
      Specified by:
      put in interface swim.util.OrderedMap<swim.structure.Value,swim.structure.Value>
    • putAll

      public void putAll(Map<? extends swim.structure.Value,? extends swim.structure.Value> items)
      Specified by:
      putAll in interface swim.util.IterableMap<swim.structure.Value,swim.structure.Value>
      Specified by:
      putAll in interface Map<swim.structure.Value,swim.structure.Value>
      Specified by:
      putAll in interface swim.util.OrderedMap<swim.structure.Value,swim.structure.Value>
    • remove

      public swim.structure.Value remove(Object key)
      Specified by:
      remove in interface swim.util.IterableMap<swim.structure.Value,swim.structure.Value>
      Specified by:
      remove in interface Map<swim.structure.Value,swim.structure.Value>
      Specified by:
      remove in interface swim.util.OrderedMap<swim.structure.Value,swim.structure.Value>
    • drop

      public void drop(int lower)
      Specified by:
      drop in interface swim.api.data.MapData<swim.structure.Value,swim.structure.Value>
    • take

      public void take(int upper)
      Specified by:
      take in interface swim.api.data.MapData<swim.structure.Value,swim.structure.Value>
    • clear

      public void clear()
      Specified by:
      clear in interface swim.util.IterableMap<swim.structure.Value,swim.structure.Value>
      Specified by:
      clear in interface Map<swim.structure.Value,swim.structure.Value>
      Specified by:
      clear in interface swim.util.OrderedMap<swim.structure.Value,swim.structure.Value>
    • headMap

      public swim.util.OrderedMap<swim.structure.Value,swim.structure.Value> headMap(swim.structure.Value toKey)
      Specified by:
      headMap in interface swim.util.OrderedMap<swim.structure.Value,swim.structure.Value>
      Specified by:
      headMap in interface SortedMap<swim.structure.Value,swim.structure.Value>
    • tailMap

      public swim.util.OrderedMap<swim.structure.Value,swim.structure.Value> tailMap(swim.structure.Value fromKey)
      Specified by:
      tailMap in interface swim.util.OrderedMap<swim.structure.Value,swim.structure.Value>
      Specified by:
      tailMap in interface SortedMap<swim.structure.Value,swim.structure.Value>
    • subMap

      public swim.util.OrderedMap<swim.structure.Value,swim.structure.Value> subMap(swim.structure.Value fromKey, swim.structure.Value toKey)
      Specified by:
      subMap in interface swim.util.OrderedMap<swim.structure.Value,swim.structure.Value>
      Specified by:
      subMap in interface SortedMap<swim.structure.Value,swim.structure.Value>
    • entrySet

      public Set<Map.Entry<swim.structure.Value,swim.structure.Value>> entrySet()
      Specified by:
      entrySet in interface swim.util.IterableMap<swim.structure.Value,swim.structure.Value>
      Specified by:
      entrySet in interface Map<swim.structure.Value,swim.structure.Value>
      Specified by:
      entrySet in interface swim.util.OrderedMap<swim.structure.Value,swim.structure.Value>
      Specified by:
      entrySet in interface SortedMap<swim.structure.Value,swim.structure.Value>
    • keySet

      public Set<swim.structure.Value> keySet()
      Specified by:
      keySet in interface swim.util.IterableMap<swim.structure.Value,swim.structure.Value>
      Specified by:
      keySet in interface Map<swim.structure.Value,swim.structure.Value>
      Specified by:
      keySet in interface swim.util.OrderedMap<swim.structure.Value,swim.structure.Value>
      Specified by:
      keySet in interface SortedMap<swim.structure.Value,swim.structure.Value>
    • values

      public Collection<swim.structure.Value> values()
      Specified by:
      values in interface swim.util.IterableMap<swim.structure.Value,swim.structure.Value>
      Specified by:
      values in interface Map<swim.structure.Value,swim.structure.Value>
      Specified by:
      values in interface swim.util.OrderedMap<swim.structure.Value,swim.structure.Value>
      Specified by:
      values in interface SortedMap<swim.structure.Value,swim.structure.Value>
    • iterator

      public swim.util.OrderedMapCursor<swim.structure.Value,swim.structure.Value> iterator()
      Specified by:
      iterator in interface Iterable<Map.Entry<swim.structure.Value,swim.structure.Value>>
      Specified by:
      iterator in interface swim.util.IterableMap<swim.structure.Value,swim.structure.Value>
      Specified by:
      iterator in interface swim.util.OrderedMap<swim.structure.Value,swim.structure.Value>
    • keyIterator

      public swim.util.Cursor<swim.structure.Value> keyIterator()
      Specified by:
      keyIterator in interface swim.util.IterableMap<swim.structure.Value,swim.structure.Value>
      Specified by:
      keyIterator in interface swim.util.OrderedMap<swim.structure.Value,swim.structure.Value>
    • valueIterator

      public swim.util.Cursor<swim.structure.Value> valueIterator()
      Specified by:
      valueIterator in interface swim.util.IterableMap<swim.structure.Value,swim.structure.Value>
      Specified by:
      valueIterator in interface swim.util.OrderedMap<swim.structure.Value,swim.structure.Value>
    • snapshot

      public swim.util.OrderedMap<swim.structure.Value,swim.structure.Value> snapshot()
      Specified by:
      snapshot in interface swim.api.data.MapData<swim.structure.Value,swim.structure.Value>
    • comparator

      public Comparator<? super swim.structure.Value> comparator()
      Specified by:
      comparator in interface swim.util.OrderedMap<swim.structure.Value,swim.structure.Value>
      Specified by:
      comparator in interface SortedMap<swim.structure.Value,swim.structure.Value>
    • close

      public void close()
      Specified by:
      close in interface swim.store.DataBinding
      Specified by:
      close in interface swim.api.data.MapData<swim.structure.Value,swim.structure.Value>