Package org.jmol.adapter.readers.pymol
Class PickleReader
- java.lang.Object
-
- org.jmol.adapter.readers.pymol.PickleReader
-
class PickleReader extends Object
generic 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<Object>buildprivate static byteBUILDprivate static byteEMPTY_DICTprivate static byteEMPTY_LISTprivate static byteEMPTY_TUPLEprivate intemptyListPtprivate intfilePtprivate static byteGLOBALprivate intidprivate booleaninMovieprivate booleaninNamesprivate static byteINTprivate intiptprivate intlastMarkprivate booleanloggingprivate static byteLONGprivate static byteLONG_BINGETprivate static byteLONG_BINPUTprivate static byteMARKprivate intmarkCountprivate javajs.util.Lst<Integer>marksprivate Map<Object,Object>memoprivate static byteNONEprivate static byteOBJprivate static byteREDUCEprivate intretrieveCountprivate static byteSETITEMprivate static byteSETITEMSprivate static byteSHORT_BINSTRINGprivate javajs.util.Lst<Object>stackprivate static byteSTOPprivate StringthisNameprivate 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 StringbytesToString(Object o)(package private) Map<String,Object>getMap(boolean logging)private intgetMark()private ObjectgetMemo(int i)private javajs.util.Lst<Object>getObjects(int mark)private voidlog(String s)private Objectpeek()private Objectpop()private voidpush(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<Object> stack
-
marks
private javajs.util.Lst<Integer> marks
-
build
private javajs.util.Lst<Object> build
-
logging
private boolean logging
-
id
private int id
-
markCount
private int markCount
-
filePt
private int filePt
-
emptyListPt
private int emptyListPt
-
thisSection
private Object thisSection
-
inMovie
private boolean inMovie
-
inNames
private boolean inNames
-
thisName
private 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
-
EMPTY_TUPLE
private static final byte EMPTY_TUPLE
- See Also:
- Constant Field Values
-
LONG
private static final byte LONG
- See Also:
- Constant Field Values
-
REDUCE
private static final byte REDUCE
- 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(String s)
-
getMap
Map<String,Object> getMap(boolean logging) throws Exception
- Parameters:
logging-- Returns:
- Throws:
Exception
-
putMemo
private void putMemo(int i, boolean doCheck)
-
getMemo
private Object getMemo(int i)
-
getObjects
private javajs.util.Lst<Object> getObjects(int mark)
-
putMark
private void putMark(int i)
-
getMark
private int getMark()
-
push
private void push(Object o)
-
peek
private Object peek()
-
pop
private Object pop()
-
-