Page Menu
Home
HEPForge
Search
Configure Global Search
Log In
Files
F9501326
Paper.java
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
4 KB
Subscribers
None
Paper.java
View Options
package
cedar.hepdata.model
;
import
cedar.hepdata.db.*
;
import
cedar.hepdata.file.*
;
import
cedar.hepdata.migration.model.*
;
import
cedar.hepdata.util.HDException
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Vector
;
/**
* Published document containing one or many {@link Dataset}s.
*
* @author S Butterworth
* @version $Date: 2006-02-03 13:27:58 +0000 (Fri, 03 Feb 2006) $ $Revision: 505 $
*
*/
public
class
Paper
implements
HDPersistable
{
public
static
int
MAXCOMMENTLENGTH
=
50000
;
private
int
paperId
;
private
Integer
irn
;
private
Integer
irn2
;
private
Integer
red
;
private
Integer
red2
;
private
String
dbname
;
private
String
dbname2
;
private
String
comment
;
private
String
additionalComment
;
private
Date
encodedDate
;
private
String
encodedBy
;
private
Date
modifiedDate
;
private
String
modifiedBy
;
private
String
spare
;
private
List
<
Dataset
>
datasets
=
new
Vector
<
Dataset
>();
/**
* builds a paper from a file
*/
public
Paper
(
HDObjectReader
reader
)
throws
HDException
{
reader
.
fill
(
this
);
DBManager
.
add
(
this
);
}
/**
* Build a paper from the DB.
*
* @param paperId int, the unique ID.
* @exception JetWebException
*/
public
Paper
(
int
paperId
)
throws
HDException
{
this
.
paperId
=
paperId
;
DBOut
.
selectFromDb
(
this
);
}
/**
* Build a paper from the DB.
*
* @param irn Integer, unique ID.
* @exception JetWebException
*/
public
Paper
(
Integer
irn
)
throws
HDException
{
this
.
irn
=
irn
;
DBOut
.
selectFromDb
(
this
);
}
/**
* Return the unique ID of this paper
*
* @return paperId
*/
public
int
getId
()
{
return
paperId
;
}
public
void
setId
(
int
id
)
{
this
.
paperId
=
id
;
}
public
Integer
getIrn
()
{
return
irn
;
}
public
void
setIrn
(
Integer
i
)
{
irn
=
i
;
}
public
Integer
getIrn2
()
{
return
irn2
;
}
public
void
setIrn2
(
Integer
i
)
{
irn2
=
i
;
}
public
Integer
getRed
()
{
return
red
;
}
public
void
setRed
(
Integer
i
)
{
red
=
i
;
}
public
Integer
getRed2
()
{
return
red2
;
}
public
void
setRed2
(
Integer
i
)
{
red2
=
i
;
}
public
String
getDBName
()
{
return
dbname
;
}
public
void
setDBName
(
String
s
)
{
dbname
=
s
;
}
public
String
getDBName2
()
{
return
dbname2
;
}
public
void
setDBName2
(
String
s
)
{
dbname2
=
s
;
}
public
Date
getEncodedDate
()
{
return
encodedDate
;
}
public
void
setEncodedDate
(
Date
dt
)
{
encodedDate
=
dt
;
}
public
String
getEncodedBy
()
{
return
encodedBy
;
}
public
void
setEncodedBy
(
String
s
)
{
encodedBy
=
s
;
}
public
Date
getModifiedDate
()
{
return
modifiedDate
;
}
public
void
setModifiedDate
(
Date
dt
)
{
modifiedDate
=
dt
;
}
public
String
getModifiedBy
()
{
return
modifiedBy
;
}
public
void
setModifiedBy
(
String
s
)
{
modifiedBy
=
s
;
}
public
String
getSpare
()
{
return
spare
;
}
public
void
setSpare
(
String
s
)
{
spare
=
s
;
}
public
String
getComment
()
{
return
comment
;
}
public
void
setComment
(
String
s
)
{
comment
=
s
;
}
public
String
getAdditionalComment
()
{
return
additionalComment
;
}
public
void
setAdditionalComment
(
String
s
)
{
additionalComment
=
s
;
}
public
void
add
(
Dataset
ds
)
{
datasets
.
add
(
ds
);
}
public
List
<
Dataset
>
getDatasets
()
{
//return (Vector<Dataset>) datasets.clone();
// I think this is now a type-safe version of clone()
return
new
Vector
<
Dataset
>(
datasets
);
}
public
String
toString
()
{
StringBuffer
s
=
new
StringBuffer
(
"Paper ID:"
+
paperId
);
s
.
append
(
"\n"
);
s
.
append
(
"IRN:"
+
irn
+
" IRN2:"
+
irn2
+
" RED:"
+
red
+
" RED2:"
+
red2
);
s
.
append
(
"\n"
);
s
.
append
(
"DBName:"
+
dbname
+
" DBName2:"
+
dbname2
);
s
.
append
(
"\n"
);
s
.
append
(
"Encoded on "
+
encodedDate
+
" by "
+
encodedBy
);
s
.
append
(
"\n"
);
s
.
append
(
"Modified on "
+
modifiedDate
+
" by "
+
modifiedBy
);
s
.
append
(
"\n"
);
s
.
append
(
"Comment "
+
comment
);
s
.
append
(
"\n"
);
s
.
append
(
"AddComment "
+
additionalComment
);
s
.
append
(
"\n"
);
s
.
append
(
"Spare "
+
spare
);
if
(!
datasets
.
isEmpty
())
{
s
.
append
(
"\n"
);
s
.
append
(
datasets
.
size
()
+
" Datasets"
);
for
(
Dataset
ds
:
datasets
)
{
s
.
append
(
"\n"
);
s
.
append
(
ds
.
toString
());
}
}
return
s
.
toString
();
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Feb 23, 2:19 PM (2 h, 35 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4486522
Default Alt Text
Paper.java (4 KB)
Attached To
rHEPDATASVN hepdatasvn
Event Timeline
Log In to Comment