📄 encobjecttype.java
字号:
/* * $Source: /home/data/cvsroot/src/jacomma/icm/io/EncObjectType.java,v $ * $Revision: 1.9 $ * $Date: 2000/10/28 20:09:07 $ * * This file is part of the jacomma framework * Copyright (c) 2000 Dimitrios Vyzovitis * mailto:dviz@egnatia.ee.auth.gr * * * * * * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307 USA */package jacomma.icm.io;/** * TBA **/public class EncObjectType { public final byte getByteCode() { return bc_; } public final String toString() { return string_; } public final boolean isComposite() { return comp_; } private final byte bc_; private final String string_; private final boolean comp_; private EncObjectType( byte bc, String string, boolean comp ) { bc_ = bc; string_ = string; comp_ = comp; } // factory method for type look-up public static final EncObjectType typeOf( int b ) { return typeOf( (byte)(0xff & b) ); } public static final EncObjectType typeOf( byte b ){ switch ( (byte)0xf0 & b ) { case (byte)0x00: return Any; case (byte)0x10: return Int; case (byte)0x20: return PosFloat; case (byte)0x30: return NegFloat; case (byte)0x40: return Symbol; case (byte)0x50: return Handle; case (byte)0x60: return String; case (byte)0x70: return Code; case (byte)0x80: return List; case (byte)0x90: return Tuple; case (byte)0xa0: return Tag; case (byte)0xb0: return Ref; case (byte)0xc0: return Short; case (byte)0xd0: return Signed; case (byte)0xe0: return Opaque; default: throw new IOException( "Bad Type: " + ((byte)0xf0 & b)); } } // factory method for parsing (case sensitive!!!) public static final EncObjectType typeOf( String s ) { try { return (EncObjectType)EncObjectType.class.getField( s ).get( null ); } catch ( Exception exc ) { throw new IOException( "No such type: " + s + " [" + exc.getMessage() +"]" ); } } // Generic Type public static final EncObjectType Any = new EncObjectType( (byte)0x00, "Any", true ); // standard types public static final EncObjectType Int = new EncObjectType( (byte)0x10, "Int[0x10]", false ); public static final EncObjectType PosFloat = new EncObjectType( (byte)0x20, "PosFloat[0x20]", false ); public static final EncObjectType NegFloat = new EncObjectType( (byte)0x30, "NegFloat[0x30]", false ); public static final EncObjectType Symbol = new EncObjectType( (byte)0x40, "Symbol[0x40]", false ); public static final EncObjectType Handle = new EncObjectType( (byte)0x50, "Handle[0x50]", false ); public static final EncObjectType String = new EncObjectType( (byte)0x60, "String[0x60]", false ); public static final EncObjectType Code = new EncObjectType( (byte)0x70, "Code[0x70]", false ); public static final EncObjectType List = new EncObjectType( (byte)0x80, "List[0x80]", true ); public static final EncObjectType Tuple = new EncObjectType( (byte)0x90, "Tuple[0x90]", true ); public static final EncObjectType Tag = new EncObjectType( (byte)0xa0, "Tag[0xa0]", true ); public static final EncObjectType Ref = new EncObjectType( (byte)0xb0, "Ref[0xb0]", false ); public static final EncObjectType Short = new EncObjectType( (byte)0xc0, "Short[0xc0]", false ); public static final EncObjectType Signed = new EncObjectType( (byte)0xd0, "Signed[0xd0]", true ); public static final EncObjectType Opaque = new EncObjectType( (byte)0xe0, "Opaque[0xe0]", true );}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -