edu.nrao.sss.model.proposal
Class JustificationFileDescriptor

java.lang.Object
  extended by edu.nrao.sss.model.proposal.JustificationFileDescriptor

public class JustificationFileDescriptor
extends Object

Placeholder for time when we integrate proposal work. A description of a JustificationFile. This class represents the metadata, but not the data, for a justification file.

TODO Should we think about making this more general by removing the "Justification" label an putting this in a different package?

Since:
2006-03-23
Version:
1.1

Field Summary
static long EMPTY_FILE
          Representation of an empty file.
static String UNNAMED_FILE
          Representation of an unnamed file.
 
Constructor Summary
JustificationFileDescriptor()
          Creates a new instance.
 
Method Summary
 long getByteSize()
          Returns the size of the JustificationFile described by this object in bytes.
 String getFileName()
          Returns the name of the JustificationFile described by this object.
 JustificationFileType getFileType()
          Returns the type of the JustificationFile described by this object.
 void reset()
          Resets this descriptor to its initial state.
 void setByteSize(long byteSize)
          Sets the size of the JustificationFile described by this object in bytes.
 void setFileName(String fileName)
          Sets the name of the JustificationFile described by this object.
 void setFileType(JustificationFileType fileType)
          Sets the type of the JustificationFile described by this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY_FILE

public static final long EMPTY_FILE
Representation of an empty file. This is the initial state of the byteSize property of objects of this class.

See Also:
Constant Field Values

UNNAMED_FILE

public static final String UNNAMED_FILE
Representation of an unnamed file. This is the initial state of the fileName property of objects of this class.

See Also:
Constant Field Values
Constructor Detail

JustificationFileDescriptor

public JustificationFileDescriptor()
Creates a new instance.

Method Detail

reset

public void reset()
Resets this descriptor to its initial state. The state of this descriptor is the same as that of a newly created descriptor.


getByteSize

public long getByteSize()
Returns the size of the JustificationFile described by this object in bytes.

Returns:
the size of the described justification file in bytes.

setByteSize

public void setByteSize(long byteSize)
Sets the size of the JustificationFile described by this object in bytes.

If byteSize is less than zero, it will be treated as if it were EMPTY_FILE.

Parameters:
byteSize - the size of the described justification file in bytes.

getFileName

public String getFileName()
Returns the name of the JustificationFile described by this object.

Returns:
the name of the described justification file.

setFileName

public void setFileName(String fileName)
Sets the name of the JustificationFile described by this object.

If fileName is null, it will be treated as if it were UNNAMED_FILE.

Parameters:
fileName - the name of the described justification file.

getFileType

public JustificationFileType getFileType()
Returns the type of the JustificationFile described by this object.

Returns:
the type of the described justification file.

setFileType

public void setFileType(JustificationFileType fileType)
Sets the type of the JustificationFile described by this object.

If fileName is null, it will be treated as if it were JustificationFileType.UNKNOWN.

Parameters:
fileType - the type of the described justification file.


Copyright © 2009. All Rights Reserved.