Class CollectionField<C extends Collection<E>,E>

Type Parameters:
C - Java collection type
E - Java collection element type
Direct Known Subclasses:
ListField, SetField

public abstract class CollectionField<C extends Collection<E>,E> extends ComplexField<C>
Superclass of fields with types assignable to Collection.
  • Field Details

  • Method Details

    • getElementField

      public SimpleField<E> getElementField()
      Get the element field.
      Returns:
      collection element field
    • getElementIndex

      public CollectionElementIndex<C,E> getElementIndex()
      Get the index on this fields's "element" sub-field.
      Returns:
      the index on this field's "element" sub-field
      Throws:
      UnknownIndexException - if there is no index on the "element" sub-field
    • getSubFields

      public final List<SimpleField<E>> getSubFields()
      Description copied from class: ComplexField
      Get the sub-field(s) associated with this instance, ordered according to their meaning.
      Specified by:
      getSubFields in class ComplexField<C extends Collection<E>>
      Returns:
      unmodifiable list of simple fields
    • hasDefaultValue

      public boolean hasDefaultValue(Transaction tx, ObjId id)
      Description copied from class: Field
      Determine if this field in the specified object has its default value in the specified Transaction.
      Specified by:
      hasDefaultValue in class Field<C extends Collection<E>>
      Parameters:
      tx - Transaction containing field state
      id - object ID
      Returns:
      true if this field is set to its initial default value in object id, otherwise false
    • getValue

      public abstract C getValue(Transaction tx, ObjId id)
      Description copied from class: Field
      Get the value of this field in the given object. Does not alter the schema of the object.
      Specified by:
      getValue in class Field<C extends Collection<E>>
      Parameters:
      tx - transaction
      id - object id
      Returns:
      this field's value in the specified object