Class EntityArchive
- java.lang.Object
-
- uk.ac.warwick.dcs.sherlock.engine.storage.EntityArchive
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<ISubmission>
,ISubmission
@Entity(name="Archive") public class EntityArchive extends java.lang.Object implements ISubmission, java.io.Serializable
ISubmission object for base storage implementation- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description EntityArchive()
EntityArchive(java.lang.String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(@NotNull ISubmission o)
boolean
equals(ISubmission o)
submission equality checkjava.util.List<ISourceFile>
getAllFiles()
Returns a list of all files, across all levels of this submissionjava.util.List<ISubmission>
getContainedDirectories()
Returns a list of sub-directories on this level of the submission structurejava.util.List<ISourceFile>
getContainedFiles()
Returns a list of files on this level of the submission structureint
getFileCount()
Calculates the file count of this directory and all subdirectorieslong
getId()
Fetches the submission unique idjava.lang.String
getName()
The name of the submission, should uniquely identify the submission contentISubmission
getParent()
Get the parent, return null if no parent existsint
getTotalFileCount()
Returns the total count of all files in this submissionboolean
hasParent()
Does this instance have a parent submission.void
remove()
Remove the submission from the database, cannot be recovered.void
setSubmissionArchive(EntityWorkspace workspace)
-
-
-
Method Detail
-
compareTo
public int compareTo(@NotNull @NotNull ISubmission o)
- Specified by:
compareTo
in interfacejava.lang.Comparable<ISubmission>
-
equals
public boolean equals(ISubmission o)
Description copied from interface:ISubmission
submission equality check- Specified by:
equals
in interfaceISubmission
- Parameters:
o
- submission to check against- Returns:
- is submission equal
-
getAllFiles
public java.util.List<ISourceFile> getAllFiles()
Description copied from interface:ISubmission
Returns a list of all files, across all levels of this submission- Specified by:
getAllFiles
in interfaceISubmission
- Returns:
- total list of files
-
getContainedDirectories
public java.util.List<ISubmission> getContainedDirectories()
Description copied from interface:ISubmission
Returns a list of sub-directories on this level of the submission structure- Specified by:
getContainedDirectories
in interfaceISubmission
- Returns:
- the list of immediate sub-directories
-
getContainedFiles
public java.util.List<ISourceFile> getContainedFiles()
Description copied from interface:ISubmission
Returns a list of files on this level of the submission structure- Specified by:
getContainedFiles
in interfaceISubmission
- Returns:
- the list of files in this directory
-
getFileCount
public int getFileCount()
Description copied from interface:ISubmission
Calculates the file count of this directory and all subdirectories- Specified by:
getFileCount
in interfaceISubmission
- Returns:
- count
-
getId
public long getId()
Description copied from interface:ISubmission
Fetches the submission unique id- Specified by:
getId
in interfaceISubmission
- Returns:
- the unique id
-
getName
public java.lang.String getName()
Description copied from interface:ISubmission
The name of the submission, should uniquely identify the submission content- Specified by:
getName
in interfaceISubmission
- Returns:
- String containing the name
-
getParent
public ISubmission getParent()
Description copied from interface:ISubmission
Get the parent, return null if no parent exists- Specified by:
getParent
in interfaceISubmission
- Returns:
- parent or null if there isn't one
-
getTotalFileCount
public int getTotalFileCount()
Description copied from interface:ISubmission
Returns the total count of all files in this submission- Specified by:
getTotalFileCount
in interfaceISubmission
- Returns:
- the total file count
-
hasParent
public boolean hasParent()
Description copied from interface:ISubmission
Does this instance have a parent submission. If true this instance is a containedDirectory of the parent- Specified by:
hasParent
in interfaceISubmission
- Returns:
- has a parent
-
remove
public void remove()
Description copied from interface:ISubmission
Remove the submission from the database, cannot be recovered.- Specified by:
remove
in interfaceISubmission
-
setSubmissionArchive
public void setSubmissionArchive(EntityWorkspace workspace)
-
-