org.eclipse.core.internal.resources
Class ResourceInfo

java.lang.Object
  extended by org.eclipse.core.internal.resources.ResourceInfo
All Implemented Interfaces:
java.lang.Cloneable, ICoreConstants, IStringPoolParticipant, IElementTreeData
Direct Known Subclasses:
ProjectInfo, RootInfo

public class ResourceInfo
extends java.lang.Object
implements IElementTreeData, ICoreConstants, IStringPoolParticipant

A data structure containing the in-memory state of a resource in the workspace.


Field Summary
 
Fields inherited from interface org.eclipse.core.internal.resources.ICoreConstants
CRASH_DETECTED, EMPTY_FILE_STATES, EMPTY_PROJECT_ARRAY, EMPTY_RESOURCE_ARRAY, I_NULL_SYNC_INFO, K_BUILD_LIST, M_CHILDREN_UNKNOWN, M_CONTENT_CACHE, M_DEFAULT_CONTENT_DESCRIPTION, M_DERIVED, M_HIDDEN, M_LINK, M_LOCAL_EXISTS, M_MARKERS_SNAP_DIRTY, M_NO_CONTENT_DESCRIPTION, M_OPEN, M_PHANTOM, M_SYNCINFO_SNAP_DIRTY, M_TEAM_PRIVATE_MEMBER, M_TYPE, M_TYPE_START, M_USED, MINIMUM_FILE_SEGMENT_LENGTH, MINIMUM_FOLDER_SEGMENT_LENGTH, NULL_FLAG, PREF_VERSION, PREF_VERSION_KEY, PROJECT_SEGMENT_LENGTH, REFRESH_ON_STARTUP, WORKSPACE_TREE_VERSION_1, WORKSPACE_TREE_VERSION_2
 
Constructor Summary
ResourceInfo()
           
 
Method Summary
 void clear(int mask)
          Clears all of the bits indicated by the mask.
 void clearModificationStamp()
           
 void clearSessionProperties()
           
 java.lang.Object clone()
          ElementTreeData must define a publicly accessible clone method.
 int getCharsetGenerationCount()
           
 int getContentId()
           
 FileStoreRoot getFileStoreRoot()
           
 int getFlags()
          Returns the set of flags for this info.
 long getLocalSyncInfo()
          Gets the local-relative sync information.
 int getMarkerGenerationCount()
          Returns the marker generation count.
 MarkerSet getMarkers()
          Returns a copy of the collection of makers on this resource.
 MarkerSet getMarkers(boolean makeCopy)
          Returns the collection of makers on this resource.
 long getModificationStamp()
           
 long getNodeId()
           
 java.lang.Object getPropertyStore()
          Returns the property store associated with this info.
 java.util.Map getSessionProperties()
          Returns a copy of the map of this resource session properties.
 java.lang.Object getSessionProperty(org.eclipse.core.runtime.QualifiedName name)
          Returns the value of the identified session property
 ObjectMap getSyncInfo(boolean makeCopy)
          The parameter to this method is the implementing class rather than the interface so we ensure that we get it right since we are making certain assumptions about the object type w.r.t.
 byte[] getSyncInfo(org.eclipse.core.runtime.QualifiedName id, boolean makeCopy)
           
 int getSyncInfoGenerationCount()
          Returns the sync information generation count.
 int getType()
          Returns the type setting for this info.
static int getType(int flags)
          Returns the type setting for this info.
 void incrementCharsetGenerationCount()
          Increments the charset generation count.
 void incrementContentId()
          Mark this resource info as having changed content
 void incrementMarkerGenerationCount()
          Increments the marker generation count.
 void incrementModificationStamp()
          Change the modification stamp to indicate that this resource has changed.
 void incrementSyncInfoGenerationCount()
          Increments the sync information generation count.
 boolean isSet(int mask)
          Returns true if all of the bits indicated by the mask are set.
static boolean isSet(int flags, int mask)
          Returns true if all of the bits indicated by the mask are set.
 void readFrom(int newFlags, java.io.DataInput input)
           
 void set(int mask)
          Sets all of the bits indicated by the mask.
 void setFileStoreRoot(FileStoreRoot fileStoreRoot)
           
 void setLocalSyncInfo(long info)
          Sets the local-relative sync information.
 void setMarkers(MarkerSet value)
          Sets the collection of makers for this resource.
 void setModificationStamp(long value)
          Sets the resource modification stamp.
 void setNodeId(long id)
           
 void setPropertyStore(java.lang.Object value)
          Sets the property store associated with this info.
 void setSessionProperty(org.eclipse.core.runtime.QualifiedName name, java.lang.Object value)
          Sets the identified session property to the given value.
 void setSyncInfo(org.eclipse.core.runtime.QualifiedName id, byte[] value)
           
 void setType(int value)
          Sets the type for this info to the given value.
 void shareStrings(StringPool set)
          Instructs this participant to share its strings in the provided pool.
 void writeTo(java.io.DataOutput output)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceInfo

public ResourceInfo()
Method Detail

getType

public static int getType(int flags)
Returns the type setting for this info. Valid values are FILE, FOLDER, PROJECT,


isSet

public static boolean isSet(int flags,
                            int mask)
Returns true if all of the bits indicated by the mask are set.


clear

public void clear(int mask)
Clears all of the bits indicated by the mask.


clearModificationStamp

public void clearModificationStamp()

clearSessionProperties

public void clearSessionProperties()

clone

public java.lang.Object clone()
Description copied from interface: IElementTreeData
ElementTreeData must define a publicly accessible clone method. This method can simply invoke Object's clone method.

Specified by:
clone in interface IElementTreeData
Overrides:
clone in class java.lang.Object

getCharsetGenerationCount

public int getCharsetGenerationCount()

getContentId

public int getContentId()

getFileStoreRoot

public FileStoreRoot getFileStoreRoot()

getFlags

public int getFlags()
Returns the set of flags for this info.


getLocalSyncInfo

public long getLocalSyncInfo()
Gets the local-relative sync information.


getMarkerGenerationCount

public int getMarkerGenerationCount()
Returns the marker generation count. The count is incremented whenever markers on the resource change.


getMarkers

public MarkerSet getMarkers()
Returns a copy of the collection of makers on this resource. null is returned if there are none.


getMarkers

public MarkerSet getMarkers(boolean makeCopy)
Returns the collection of makers on this resource. null is returned if there are none.


getModificationStamp

public long getModificationStamp()

getNodeId

public long getNodeId()

getPropertyStore

public java.lang.Object getPropertyStore()
Returns the property store associated with this info. The return value may be null.


getSessionProperties

public java.util.Map getSessionProperties()
Returns a copy of the map of this resource session properties. An empty map is returned if there are none.


getSessionProperty

public java.lang.Object getSessionProperty(org.eclipse.core.runtime.QualifiedName name)
Returns the value of the identified session property


getSyncInfo

public ObjectMap getSyncInfo(boolean makeCopy)
The parameter to this method is the implementing class rather than the interface so we ensure that we get it right since we are making certain assumptions about the object type w.r.t. casting.


getSyncInfo

public byte[] getSyncInfo(org.eclipse.core.runtime.QualifiedName id,
                          boolean makeCopy)

getSyncInfoGenerationCount

public int getSyncInfoGenerationCount()
Returns the sync information generation count. The count is incremented whenever sync info on the resource changes.


getType

public int getType()
Returns the type setting for this info. Valid values are FILE, FOLDER, PROJECT,


incrementCharsetGenerationCount

public void incrementCharsetGenerationCount()
Increments the charset generation count. The count is incremented whenever the encoding on the resource changes.


incrementContentId

public void incrementContentId()
Mark this resource info as having changed content


incrementMarkerGenerationCount

public void incrementMarkerGenerationCount()
Increments the marker generation count. The count is incremented whenever markers on the resource change.


incrementModificationStamp

public void incrementModificationStamp()
Change the modification stamp to indicate that this resource has changed. The exact value of the stamp doesn't matter, as long as it can be used to distinguish two arbitrary resource generations.


incrementSyncInfoGenerationCount

public void incrementSyncInfoGenerationCount()
Increments the sync information generation count. The count is incremented whenever sync info on the resource changes.


isSet

public boolean isSet(int mask)
Returns true if all of the bits indicated by the mask are set.


readFrom

public void readFrom(int newFlags,
                     java.io.DataInput input)
              throws java.io.IOException
Throws:
java.io.IOException

set

public void set(int mask)
Sets all of the bits indicated by the mask.


setFileStoreRoot

public void setFileStoreRoot(FileStoreRoot fileStoreRoot)

setLocalSyncInfo

public void setLocalSyncInfo(long info)
Sets the local-relative sync information.


setMarkers

public void setMarkers(MarkerSet value)
Sets the collection of makers for this resource. null is passed in if there are no markers.


setModificationStamp

public void setModificationStamp(long value)
Sets the resource modification stamp.


setNodeId

public void setNodeId(long id)

setPropertyStore

public void setPropertyStore(java.lang.Object value)
Sets the property store associated with this info. The value may be null.


setSessionProperty

public void setSessionProperty(org.eclipse.core.runtime.QualifiedName name,
                               java.lang.Object value)
Sets the identified session property to the given value. If the value is null, the property is removed.


setSyncInfo

public void setSyncInfo(org.eclipse.core.runtime.QualifiedName id,
                        byte[] value)

setType

public void setType(int value)
Sets the type for this info to the given value. Valid values are FILE, FOLDER, PROJECT


shareStrings

public void shareStrings(StringPool set)
Description copied from interface: IStringPoolParticipant
Instructs this participant to share its strings in the provided pool.

Specified by:
shareStrings in interface IStringPoolParticipant

writeTo

public void writeTo(java.io.DataOutput output)
             throws java.io.IOException
Throws:
java.io.IOException