org.apache.jackrabbit.core.state
Class PropertyState

java.lang.Object
  extended by org.apache.jackrabbit.core.state.ItemState
      extended by org.apache.jackrabbit.core.state.PropertyState
Direct Known Subclasses:
VirtualPropertyState

public class PropertyState
extends ItemState

PropertyState represents the state of a Property.


Field Summary
 
Fields inherited from class org.apache.jackrabbit.core.state.ItemState
overlayedState, status, STATUS_EXISTING, STATUS_EXISTING_MODIFIED, STATUS_EXISTING_REMOVED, STATUS_NEW, STATUS_STALE_DESTROYED, STATUS_UNDEFINED
 
Constructor Summary
PropertyState(PropertyId id, int initialStatus, boolean isTransient)
          Create a new PropertyState
PropertyState(PropertyState overlayedState, int initialStatus, boolean isTransient)
          Constructs a new property state that is initially connected to an overlayed state.
 
Method Summary
 long calculateMemoryFootprint()
          Returns an estimate of the memory size of this property state.
 void copy(ItemState state, boolean syncModCount)
          Copy state information from another state into this state
 ItemId getId()
          Returns the identifier of this item.
 Name getName()
          Returns the name of this property.
 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.
 PropertyId getPropertyId()
          Returns the identifier of this property.
 int getType()
          Returns the type of this property.
 InternalValue[] getValues()
          Returns the value(s) of this property.
 boolean isMultiValued()
          Returns true if this property is multi-valued, otherwise false.
 boolean isNode()
          Determines if this item state represents a node.
 void setMultiValued(boolean multiValued)
          Sets the flag indicating whether this property is multi-valued.
 void setType(int type)
          Sets the type of this property.
 void setValues(InternalValue[] values)
          Sets the value(s) of this property.
 
Methods inherited from class org.apache.jackrabbit.core.state.ItemState
connect, discard, disconnect, getContainer, getModCount, getOverlayedState, getStatus, hasOverlayedState, isConnected, isStale, isTransient, notifyStateCreated, notifyStateDestroyed, notifyStateDiscarded, notifyStateUpdated, reconnect, setContainer, setModCount, setStatus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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.


Copyright © 2004-2010 The Apache Software Foundation. All Rights Reserved.