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 intcompareTo(@NotNull ISubmission o)booleanequals(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 structureintgetFileCount()Calculates the file count of this directory and all subdirectorieslonggetId()Fetches the submission unique idjava.lang.StringgetName()The name of the submission, should uniquely identify the submission contentISubmissiongetParent()Get the parent, return null if no parent existsintgetTotalFileCount()Returns the total count of all files in this submissionbooleanhasParent()Does this instance have a parent submission.voidremove()Remove the submission from the database, cannot be recovered.voidsetSubmissionArchive(EntityWorkspace workspace)
-
-
-
Method Detail
-
compareTo
public int compareTo(@NotNull @NotNull ISubmission o)- Specified by:
compareToin interfacejava.lang.Comparable<ISubmission>
-
equals
public boolean equals(ISubmission o)
Description copied from interface:ISubmissionsubmission equality check- Specified by:
equalsin interfaceISubmission- Parameters:
o- submission to check against- Returns:
- is submission equal
-
getAllFiles
public java.util.List<ISourceFile> getAllFiles()
Description copied from interface:ISubmissionReturns a list of all files, across all levels of this submission- Specified by:
getAllFilesin interfaceISubmission- Returns:
- total list of files
-
getContainedDirectories
public java.util.List<ISubmission> getContainedDirectories()
Description copied from interface:ISubmissionReturns a list of sub-directories on this level of the submission structure- Specified by:
getContainedDirectoriesin interfaceISubmission- Returns:
- the list of immediate sub-directories
-
getContainedFiles
public java.util.List<ISourceFile> getContainedFiles()
Description copied from interface:ISubmissionReturns a list of files on this level of the submission structure- Specified by:
getContainedFilesin interfaceISubmission- Returns:
- the list of files in this directory
-
getFileCount
public int getFileCount()
Description copied from interface:ISubmissionCalculates the file count of this directory and all subdirectories- Specified by:
getFileCountin interfaceISubmission- Returns:
- count
-
getId
public long getId()
Description copied from interface:ISubmissionFetches the submission unique id- Specified by:
getIdin interfaceISubmission- Returns:
- the unique id
-
getName
public java.lang.String getName()
Description copied from interface:ISubmissionThe name of the submission, should uniquely identify the submission content- Specified by:
getNamein interfaceISubmission- Returns:
- String containing the name
-
getParent
public ISubmission getParent()
Description copied from interface:ISubmissionGet the parent, return null if no parent exists- Specified by:
getParentin interfaceISubmission- Returns:
- parent or null if there isn't one
-
getTotalFileCount
public int getTotalFileCount()
Description copied from interface:ISubmissionReturns the total count of all files in this submission- Specified by:
getTotalFileCountin interfaceISubmission- Returns:
- the total file count
-
hasParent
public boolean hasParent()
Description copied from interface:ISubmissionDoes this instance have a parent submission. If true this instance is a containedDirectory of the parent- Specified by:
hasParentin interfaceISubmission- Returns:
- has a parent
-
remove
public void remove()
Description copied from interface:ISubmissionRemove the submission from the database, cannot be recovered.- Specified by:
removein interfaceISubmission
-
setSubmissionArchive
public void setSubmissionArchive(EntityWorkspace workspace)
-
-