Package org.jmol.adapter.readers.pymol
Class PickleReader
- java.lang.Object
-
- org.jmol.adapter.readers.pymol.PickleReader
-
class PickleReader extends java.lang.Objectgeneric Python Pickle file reader only utilizing records needed for PyMOL. It appears we must read integers littleEndian and doubles bigEndian. 2013.04.06 -- added memo functions. PyMOL pickling is using LONG_BINPUT way too often. This results in a huge unnecessary memory overhead. My only solution is to only cache Strings in memo, and then only selectively -- not parts of movie; not when markCount > 5 (residues). This seems to work, but it is still way overkill, since each atom generates several items. see http://www.picklingtools.com/- Author:
- Bob Hanson hansonr@stolaf.edu
-
-
Field Summary
Fields Modifier and Type Field Description private static byteAPPENDprivate static byteAPPENDS(package private) byte[]aTempprivate javajs.api.GenericBinaryDocumentbinaryDocprivate static byteBINFLOATprivate static byteBINGETprivate static byteBININTprivate static byteBININT1private static byteBININT2private static byteBINPUTprivate static byteBINSTRINGprivate static byteBINUNICODEprivate javajs.util.Lst<java.lang.Object>buildprivate static byteBUILDprivate static byteEMPTY_DICTprivate static byteEMPTY_LISTprivate intemptyListPtprivate intfilePtprivate static byteGLOBALprivate intidprivate booleaninMovieprivate booleaninNamesprivate static byteINTprivate intiptprivate intlastMarkprivate booleanloggingprivate static byteLONG_BINGETprivate static byteLONG_BINPUTprivate static byteMARKprivate intmarkCountprivate javajs.util.Lst<java.lang.Integer>marksprivate java.util.Map<java.lang.Object,java.lang.Object>memoprivate static byteNONEprivate static byteOBJprivate intretrieveCountprivate static byteSETITEMprivate static byteSETITEMSprivate static byteSHORT_BINSTRINGprivate javajs.util.Lst<java.lang.Object>stackprivate static byteSTOPprivate java.lang.StringthisNameprivate java.lang.ObjectthisSectionprivate static byteTUPLEprivate Viewervwr
-
Constructor Summary
Constructors Constructor Description PickleReader(javajs.api.GenericBinaryDocument doc, Viewer vwr)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.lang.StringbytesToString(java.lang.Object o)(package private) java.util.Map<java.lang.String,java.lang.Object>getMap(boolean logging)private intgetMark()private java.lang.ObjectgetMemo(int i)private javajs.util.Lst<java.lang.Object>getObjects(int mark)private voidlog(java.lang.String s)private java.lang.Objectpeek()private java.lang.Objectpop()private voidpush(java.lang.Object o)private voidputMark(int i)private voidputMemo(int i, boolean doCheck)private byte[]readStringAsBytes()
-
-
-
Field Detail
-
vwr
private Viewer vwr
-
binaryDoc
private javajs.api.GenericBinaryDocument binaryDoc
-
stack
private javajs.util.Lst<java.lang.Object> stack
-
marks
private javajs.util.Lst<java.lang.Integer> marks
-
build
private javajs.util.Lst<java.lang.Object> build
-
memo
private java.util.Map<java.lang.Object,java.lang.Object> memo
-
logging
private boolean logging
-
id
private int id
-
markCount
private int markCount
-
filePt
private int filePt
-
emptyListPt
private int emptyListPt
-
thisSection
private java.lang.Object thisSection
-
inMovie
private boolean inMovie
-
inNames
private boolean inNames
-
thisName
private java.lang.String thisName
-
lastMark
private int lastMark
-
retrieveCount
private int retrieveCount
-
APPEND
private static final byte APPEND
- See Also:
- Constant Field Values
-
APPENDS
private static final byte APPENDS
- See Also:
- Constant Field Values
-
BINFLOAT
private static final byte BINFLOAT
- See Also:
- Constant Field Values
-
BININT
private static final byte BININT
- See Also:
- Constant Field Values
-
BININT1
private static final byte BININT1
- See Also:
- Constant Field Values
-
BININT2
private static final byte BININT2
- See Also:
- Constant Field Values
-
BINPUT
private static final byte BINPUT
- See Also:
- Constant Field Values
-
BINSTRING
private static final byte BINSTRING
- See Also:
- Constant Field Values
-
BINUNICODE
private static final byte BINUNICODE
- See Also:
- Constant Field Values
-
BUILD
private static final byte BUILD
- See Also:
- Constant Field Values
-
EMPTY_DICT
private static final byte EMPTY_DICT
- See Also:
- Constant Field Values
-
EMPTY_LIST
private static final byte EMPTY_LIST
- See Also:
- Constant Field Values
-
GLOBAL
private static final byte GLOBAL
- See Also:
- Constant Field Values
-
LONG_BINPUT
private static final byte LONG_BINPUT
- See Also:
- Constant Field Values
-
MARK
private static final byte MARK
- See Also:
- Constant Field Values
-
NONE
private static final byte NONE
- See Also:
- Constant Field Values
-
OBJ
private static final byte OBJ
- See Also:
- Constant Field Values
-
SETITEM
private static final byte SETITEM
- See Also:
- Constant Field Values
-
SETITEMS
private static final byte SETITEMS
- See Also:
- Constant Field Values
-
SHORT_BINSTRING
private static final byte SHORT_BINSTRING
- See Also:
- Constant Field Values
-
STOP
private static final byte STOP
- See Also:
- Constant Field Values
-
BINGET
private static final byte BINGET
- See Also:
- Constant Field Values
-
LONG_BINGET
private static final byte LONG_BINGET
- See Also:
- Constant Field Values
-
TUPLE
private static final byte TUPLE
- See Also:
- Constant Field Values
-
INT
private static final byte INT
- See Also:
- Constant Field Values
-
ipt
private int ipt
-
aTemp
byte[] aTemp
-
-
Constructor Detail
-
PickleReader
PickleReader(javajs.api.GenericBinaryDocument doc, Viewer vwr)
-
-
Method Detail
-
log
private void log(java.lang.String s)
-
getMap
java.util.Map<java.lang.String,java.lang.Object> getMap(boolean logging) throws java.lang.Exception- Throws:
java.lang.Exception
-
bytesToString
private java.lang.String bytesToString(java.lang.Object o)
-
putMemo
private void putMemo(int i, boolean doCheck)
-
getMemo
private java.lang.Object getMemo(int i)
-
getObjects
private javajs.util.Lst<java.lang.Object> getObjects(int mark)
-
readStringAsBytes
private byte[] readStringAsBytes() throws java.lang.Exception- Throws:
java.lang.Exception
-
putMark
private void putMark(int i)
-
getMark
private int getMark()
-
push
private void push(java.lang.Object o)
-
peek
private java.lang.Object peek()
-
pop
private java.lang.Object pop()
-
-