org.sourcejammer.project.controller
Class MasterFileNode

java.lang.Object
  |
  +--org.sourcejammer.project.controller.BranchNode
        |
        +--org.sourcejammer.project.controller.MasterFileNode
All Implemented Interfaces:
org.sourcejammer.project.Node
Direct Known Subclasses:
MasterFileNodeFS

public abstract class MasterFileNode
extends BranchNode
implements org.sourcejammer.project.Node

Title: $FileName: MasterFileNode.java$

Version:
$VerNum: 7$
Author:
$AuthorName: Rob MacGrogan$

$Description: $
$KeyWordsOff: $

Field Summary
private  java.util.HashMap branchesByFileID
           
private  java.util.HashMap identifiers
           
private  long key
           
private  boolean locked
           
private  long uniqueID
           
 
Fields inherited from class org.sourcejammer.project.controller.BranchNode
 
Constructor Summary
MasterFileNode()
           
 
Method Summary
protected  void applyIndex(BranchNode branch)
           
 void checkKey(long key)
          This method throws BadMethodArgumentException (runtime) if the node is not locked or if the keys do not match.
 int childCount()
           
 boolean containsIdentifier(java.lang.String identifier)
           
 BranchNode getBranchByFileID(long fileID)
           
 java.lang.String getNodeName()
           
 long getUniqueID()
          Returns the uniqueID.
protected  boolean isIdentifierUnique(java.lang.String identifier)
           
 boolean isLocked()
           
 boolean isShared()
           
 void lock(long key)
          Locks this node so that set methods can only be run if this combination is included.
 void setFileID(long fileID)
          Sets the fileID.
 void setParent()
           
 void setUniqueID(long uniqueID, long key)
          Sets the uniqueID.
abstract  void store(long key, ArchiveInfoFlex archive)
           
 void unlock(long key)
           
 
Methods inherited from class org.sourcejammer.project.controller.BranchNode
addBranchNode, getBranchNode, getBranchView, getFileID, getIdentifier, getInitialVersionID, setIdentifier, setInitialVersionID, setParent, subBranches
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

identifiers

private java.util.HashMap identifiers

branchesByFileID

private java.util.HashMap branchesByFileID

uniqueID

private long uniqueID

locked

private boolean locked

key

private long key
Constructor Detail

MasterFileNode

public MasterFileNode()
Method Detail

getBranchByFileID

public BranchNode getBranchByFileID(long fileID)

applyIndex

protected void applyIndex(BranchNode branch)
Overrides:
applyIndex in class BranchNode

containsIdentifier

public boolean containsIdentifier(java.lang.String identifier)

isIdentifierUnique

protected boolean isIdentifierUnique(java.lang.String identifier)
Overrides:
isIdentifierUnique in class BranchNode

setParent

public void setParent()

getUniqueID

public long getUniqueID()
Returns the uniqueID.

Specified by:
getUniqueID in interface org.sourcejammer.project.Node
Returns:
long

getNodeName

public java.lang.String getNodeName()
Specified by:
getNodeName in interface org.sourcejammer.project.Node

isShared

public boolean isShared()
Specified by:
isShared in interface org.sourcejammer.project.Node

childCount

public int childCount()
Specified by:
childCount in interface org.sourcejammer.project.Node

setUniqueID

public void setUniqueID(long uniqueID,
                        long key)
Sets the uniqueID.

Parameters:
uniqueID - The uniqueID to set

lock

public void lock(long key)
          throws SecurityException
Locks this node so that set methods can only be run if this combination is included.

SecurityException

isLocked

public boolean isLocked()

unlock

public void unlock(long key)
            throws SecurityException
SecurityException

checkKey

public void checkKey(long key)
This method throws BadMethodArgumentException (runtime) if the node is not locked or if the keys do not match. Otherwise, it returns nothing and makes no changes.

Overrides:
checkKey in class BranchNode

store

public abstract void store(long key,
                           ArchiveInfoFlex archive)
                    throws FileAccessException
FileAccessException

setFileID

public void setFileID(long fileID)
Description copied from class: BranchNode
Sets the fileID.

Overrides:
setFileID in class BranchNode
Parameters:
fileID - The fileID to set
See Also:
BranchNode.setFileID(long)


Copyright © 2003 Soucejammer project.