Class PropertyState

    • Constructor Detail

      • PropertyState

        public PropertyState​(PropertyState overlayedState,
                             int initialStatus,
                             boolean isTransient)
        Constructs a new property state that is initially connected to an overlayed state.
        Parameters:
        overlayedState - the backing property state being overlayed
        initialStatus - the initial status of the property state object
        isTransient - flag indicating whether this state is transient or not
      • PropertyState

        public PropertyState​(PropertyId id,
                             int initialStatus,
                             boolean isTransient)
        Create a new PropertyState
        Parameters:
        id - id of the property
        initialStatus - the initial status of the property state object
        isTransient - flag indicating whether this state is transient or not
    • Method Detail

      • copy

        public void copy​(ItemState state,
                         boolean syncModCount)
        Copy state information from another state into this state
        Specified by:
        copy in class ItemState
        Parameters:
        state - source state information
        syncModCount - if the modCount should be synchronized.
      • isNode

        public boolean isNode()
        Determines if this item state represents a node.
        Specified by:
        isNode in class ItemState
        Returns:
        always false
        See Also:
        ItemState.isNode()
      • getId

        public ItemId getId()
        Returns the identifier of this item.
        Specified by:
        getId in class ItemState
        Returns:
        the id of this item.
      • getPropertyId

        public PropertyId getPropertyId()
        Returns the identifier of this property.
        Returns:
        the id of this property.
      • getParentId

        public NodeId getParentId()
        Returns the NodeId of the parent NodeState or null if either this item state represents the root node or this item state is 'free floating', i.e. not attached to the repository's hierarchy.
        Specified by:
        getParentId in class ItemState
        Returns:
        the parent NodeState's Id
      • getName

        public Name getName()
        Returns the name of this property.
        Returns:
        the name of this property.
      • setType

        public void setType​(int type)
        Sets the type of this property.
        Parameters:
        type - the type to be set
        See Also:
        PropertyType
      • setMultiValued

        public void setMultiValued​(boolean multiValued)
        Sets the flag indicating whether this property is multi-valued.
        Parameters:
        multiValued - flag indicating whether this property is multi-valued
      • getType

        public int getType()
        Returns the type of this property.
        Returns:
        the type of this property.
        See Also:
        PropertyType
      • isMultiValued

        public boolean isMultiValued()
        Returns true if this property is multi-valued, otherwise false.
        Returns:
        true if this property is multi-valued, otherwise false.
      • setValues

        public void setValues​(InternalValue[] values)
        Sets the value(s) of this property.
        Parameters:
        values - the new values
      • getValues

        public InternalValue[] getValues()
        Returns the value(s) of this property.
        Returns:
        the value(s) of this property.
      • calculateMemoryFootprint

        public long calculateMemoryFootprint()
        Returns an estimate of the memory size of this property state. The return value actually highly overestimates the amount of required memory, but changing the estimates would likely cause OOMs in many downstream deployments that have set their cache sizes based on experience with these erroneous size estimates. So we don't change the formula used by this method.
        Specified by:
        calculateMemoryFootprint in class ItemState
        Returns:
        the approximate memory consumption of this state.