Package swim.dataflow

Class RecordModel

All Implemented Interfaces:
Comparable<Item>, Iterable<Item>, Collection<Item>, List<Item>, Debug, Display, RecordOutlet, MapOutlet<Value,Value,Record>, Outlet<Record>, StreamletScope<Value>, Builder<Item,Record>, PairBuilder<Value,Value,Record>
Direct Known Subclasses:
RecordScope

public class RecordModel extends AbstractRecordOutlet
  • Field Details

  • Constructor Details

    • RecordModel

      public RecordModel(Record state)
    • RecordModel

      public RecordModel()
  • Method Details

    • isEmpty

      public boolean isEmpty()
      Description copied from class: Record
      Returns true if this Record has no members.
      Specified by:
      isEmpty in interface Collection<Item>
      Specified by:
      isEmpty in interface List<Item>
      Specified by:
      isEmpty in class Record
    • isArray

      public boolean isArray()
      Description copied from class: Record
      Returns true if this Record has only Value members–no Field members.
      Overrides:
      isArray in class Record
    • isObject

      public boolean isObject()
      Description copied from class: Record
      Returns true if this Record has only Field members–no Value members.
      Overrides:
      isObject in class Record
    • size

      public int size()
      Description copied from class: Record
      Returns the number of members contained in this Record.
      Specified by:
      size in interface Collection<Item>
      Specified by:
      size in interface List<Item>
      Specified by:
      size in class Record
    • fieldCount

      public int fieldCount()
      Description copied from class: Record
      Returns the number of Field members contained in this Record.
      Overrides:
      fieldCount in class Record
    • valueCount

      public int valueCount()
      Description copied from class: Record
      Returns the number of Value members contained in this Record.
      Overrides:
      valueCount in class Record
    • containsKey

      public boolean containsKey(Value key)
      Description copied from class: Record
      Returns true if this Record has a Field member with a key that is equal to the given key; otherwise returns false if this Record has no Field member with a key equal to the given key.
      Specified by:
      containsKey in interface MapOutlet<Value,Value,Record>
      Overrides:
      containsKey in class Record
    • containsOwnKey

      public boolean containsOwnKey(Value key)
      Overrides:
      containsOwnKey in class AbstractRecordOutlet
    • indexOf

      public int indexOf(Object item)
      Specified by:
      indexOf in interface List<Item>
      Overrides:
      indexOf in class Record
    • lastIndexOf

      public int lastIndexOf(Object item)
      Specified by:
      lastIndexOf in interface List<Item>
      Overrides:
      lastIndexOf in class Record
    • get

      public Value get(Value key)
      Description copied from class: Record
      Returns the value of the last Field member of this Record whose key is equal to the given key; returns Absent if this Record has no Field member with a key equal to the given key.
      Specified by:
      get in interface MapOutlet<Value,Value,Record>
      Overrides:
      get in class Record
    • getAttr

      public Value getAttr(Text key)
      Description copied from class: Record
      Returns the value of the last Attr member of this Record whose key is equal to the given key; returns Absent if this Record has no Attr member with a key equal to the given key.
      Overrides:
      getAttr in class Record
    • getSlot

      public Value getSlot(Value key)
      Description copied from class: Record
      Returns the value of the last Slot member of this Record whose key is equal to the given key; returns Absent if this Record has no Slot member with a key equal to the given key.
      Overrides:
      getSlot in class Record
    • getField

      public Field getField(Value key)
      Description copied from class: Record
      Returns the last Field member of this Record whose key is equal to the given key; returns null if this Record has no Field member with a key equal to the given key.
      Overrides:
      getField in class Record
    • get

      public Item get(int index)
      Description copied from class: Record
      Returns the member of this Record at the given index, if the index is greater than or equal to zero, and less than the length of this Record.
      Specified by:
      get in interface List<Item>
      Specified by:
      get in class Record
    • getItem

      public Item getItem(int index)
      Description copied from class: Record
      Returns the member of this Record at the given index, if the index is greater than or equal to zero, and less than the length of this Record; otherwise returns Absent if the index is out of bounds.
      Specified by:
      getItem in class Record
    • bindValue

      public void bindValue(Value key, Value expr)
    • put

      public Value put(Value key, Value newValue)
      Overrides:
      put in class Record
    • put

      public Value put(String key, Value newValue)
      Overrides:
      put in class Record
    • putAttr

      public Value putAttr(Text key, Value newValue)
      Overrides:
      putAttr in class Record
    • putAttr

      public Value putAttr(String key, Value newValue)
      Overrides:
      putAttr in class Record
    • putSlot

      public Value putSlot(Value key, Value newValue)
      Overrides:
      putSlot in class Record
    • putSlot

      public Value putSlot(String key, Value newValue)
      Overrides:
      putSlot in class Record
    • setItem

      public Item setItem(int index, Item newItem)
      Description copied from class: Record
      Replaces the member of this Record at the given index with a new item, returning the previous Item at the given index, if the index is greater than or equal to zero, and less than the length of this Record.
      Specified by:
      setItem in class Record
    • add

      public boolean add(Item item)
      Description copied from interface: Builder
      Adds a single input value to this builder, returning true if the state of the builder changed.
      Specified by:
      add in interface Builder<Item,Record>
      Specified by:
      add in interface Collection<Item>
      Specified by:
      add in interface List<Item>
      Specified by:
      add in class Record
    • add

      public void add(int index, Item item)
      Specified by:
      add in interface List<Item>
      Specified by:
      add in class Record
    • remove

      public Item remove(int index)
      Specified by:
      remove in interface List<Item>
      Specified by:
      remove in class Record
    • clear

      public void clear()
      Specified by:
      clear in interface Collection<Item>
      Specified by:
      clear in interface List<Item>
      Specified by:
      clear in class Record
    • subList

      public Record subList(int fromIndex, int toIndex)
      Specified by:
      subList in interface List<Item>
      Overrides:
      subList in class Record
    • keyIterator

      public final Iterator<Value> keyIterator()
      Description copied from interface: MapOutlet
      Returns an Iterator over the keys in the current state of this MapOutlet.
      Specified by:
      keyIterator in interface MapOutlet<Value,Value,Record>
      Specified by:
      keyIterator in class AbstractRecordOutlet
    • disconnectInputs

      public void disconnectInputs()
      Description copied from interface: Outlet
      Disconnects all Inlets dominated by this Outlet in the dataflow dependency graph. Used to recursively clean up chains of combinators passing through this Outlet.
      Specified by:
      disconnectInputs in interface Outlet<Record>
      Overrides:
      disconnectInputs in class AbstractRecordOutlet
    • memoize

      public MapOutlet<Value,Value,Record> memoize()
    • materialize

      public void materialize(Record record)
    • materializeItem

      public void materializeItem(Item item)
    • materializeField

      public void materializeField(Field field)
    • materializeValue

      public void materializeValue(Value value)
    • compile

      public void compile(Record record)
    • compileItem

      public void compileItem(Item item, int index)
    • compileField

      public void compileField(Field field, int index)
    • compileValue

      public void compileValue(Value value, int index)
    • reify

      public void reify(Reifier reifier)
    • reify

      public void reify()
    • reifyItem

      public Item reifyItem(Item item, Reifier reifier)
    • create

      public static RecordModel create(Record record)
    • of

      public static RecordModel of()
    • of

      public static RecordModel of(Object object)
    • of

      public static RecordModel of(Object... objects)
    • globalScope

      public static RecordModel globalScope()