/** {@inheritDoc} */ @Override public IndexedItem get(Constant cst) { if (cst == null) { throw new NullPointerException("cst == null"); } if (!(cst instanceof CstProtoRef)) { throw new IllegalArgumentException("cst not instance of CstProtoRef"); } throwIfNotPrepared(); CstProtoRef protoRef = (CstProtoRef) cst; IndexedItem result = protoIds.get(protoRef.getPrototype()); if (result == null) { throw new IllegalArgumentException("not found"); } return result; }
/** * Gets the index of the given prototype, which must have * been added to this instance. * * @param prototype {@code non-null;} the prototype to look up * @return {@code >= 0;} the reference's index */ public int indexOf(Prototype prototype) { if (prototype == null) { throw new NullPointerException("prototype == null"); } throwIfNotPrepared(); ProtoIdItem item = protoIds.get(prototype); if (item == null) { throw new IllegalArgumentException("not found"); } return item.getIndex(); }
/** {@inheritDoc} */ @Override public IndexedItem get(Constant cst) { if (cst == null) { throw new NullPointerException("cst == null"); } if (!(cst instanceof CstProtoRef)) { throw new IllegalArgumentException("cst not instance of CstProtoRef"); } throwIfNotPrepared(); CstProtoRef protoRef = (CstProtoRef) cst; IndexedItem result = protoIds.get(protoRef.getPrototype()); if (result == null) { throw new IllegalArgumentException("not found"); } return result; }
/** * Gets the index of the given prototype, which must have * been added to this instance. * * @param prototype {@code non-null;} the prototype to look up * @return {@code >= 0;} the reference's index */ public int indexOf(Prototype prototype) { if (prototype == null) { throw new NullPointerException("prototype == null"); } throwIfNotPrepared(); ProtoIdItem item = protoIds.get(prototype); if (item == null) { throw new IllegalArgumentException("not found"); } return item.getIndex(); }
/** * Gets the index of the given prototype, which must have * been added to this instance. * * @param prototype {@code non-null;} the prototype to look up * @return {@code >= 0;} the reference's index */ public int indexOf(Prototype prototype) { if (prototype == null) { throw new NullPointerException("prototype == null"); } throwIfNotPrepared(); ProtoIdItem item = protoIds.get(prototype); if (item == null) { throw new IllegalArgumentException("not found"); } return item.getIndex(); }
/** * Gets the index of the given prototype, which must have * been added to this instance. * * @param prototype {@code non-null;} the prototype to look up * @return {@code >= 0;} the reference's index */ public int indexOf(Prototype prototype) { if (prototype == null) { throw new NullPointerException("prototype == null"); } throwIfNotPrepared(); ProtoIdItem item = protoIds.get(prototype); if (item == null) { throw new IllegalArgumentException("not found"); } return item.getIndex(); }
/** * Gets the index of the given prototype, which must have * been added to this instance. * * @param prototype {@code non-null;} the prototype to look up * @return {@code >= 0;} the reference's index */ public int indexOf(Prototype prototype) { if (prototype == null) { throw new NullPointerException("prototype == null"); } throwIfNotPrepared(); ProtoIdItem item = protoIds.get(prototype); if (item == null) { throw new IllegalArgumentException("not found"); } return item.getIndex(); }
/** * Gets the index of the given prototype, which must have * been added to this instance. * * @param prototype {@code non-null;} the prototype to look up * @return {@code >= 0;} the reference's index */ public int indexOf(Prototype prototype) { if (prototype == null) { throw new NullPointerException("prototype == null"); } throwIfNotPrepared(); ProtoIdItem item = protoIds.get(prototype); if (item == null) { throw new IllegalArgumentException("not found"); } return item.getIndex(); }
/** * Gets the index of the given prototype, which must have * been added to this instance. * * @param prototype {@code non-null;} the prototype to look up * @return {@code >= 0;} the reference's index */ public int indexOf(Prototype prototype) { if (prototype == null) { throw new NullPointerException("prototype == null"); } throwIfNotPrepared(); ProtoIdItem item = protoIds.get(prototype); if (item == null) { throw new IllegalArgumentException("not found"); } return item.getIndex(); }
/** * Gets the index of the given prototype, which must have * been added to this instance. * * @param prototype {@code non-null;} the prototype to look up * @return {@code >= 0;} the reference's index */ public int indexOf(Prototype prototype) { if (prototype == null) { throw new NullPointerException("prototype == null"); } throwIfNotPrepared(); ProtoIdItem item = protoIds.get(prototype); if (item == null) { throw new IllegalArgumentException("not found"); } return item.getIndex(); }
/** * Writes the portion of the file header that refers to this instance. * * @param out {@code non-null;} where to write */ public void writeHeaderPart(AnnotatedOutput out) { throwIfNotPrepared(); int sz = protoIds.size(); int offset = (sz == 0) ? 0 : getFileOffset(); if (sz > 65536) { throw new UnsupportedOperationException("too many proto ids"); } if (out.annotates()) { out.annotate(4, "proto_ids_size: " + Hex.u4(sz)); out.annotate(4, "proto_ids_off: " + Hex.u4(offset)); } out.writeInt(sz); out.writeInt(offset); }
/** * Writes the portion of the file header that refers to this instance. * * @param out {@code non-null;} where to write */ public void writeHeaderPart(AnnotatedOutput out) { throwIfNotPrepared(); int sz = protoIds.size(); int offset = (sz == 0) ? 0 : getFileOffset(); if (sz > 65536) { throw new UnsupportedOperationException("too many proto ids"); } if (out.annotates()) { out.annotate(4, "proto_ids_size: " + Hex.u4(sz)); out.annotate(4, "proto_ids_off: " + Hex.u4(offset)); } out.writeInt(sz); out.writeInt(offset); }
/** * Writes the portion of the file header that refers to this instance. * * @param out {@code non-null;} where to write */ public void writeHeaderPart(AnnotatedOutput out) { throwIfNotPrepared(); int sz = protoIds.size(); int offset = (sz == 0) ? 0 : getFileOffset(); if (sz > 65536) { throw new UnsupportedOperationException("too many proto ids"); } if (out.annotates()) { out.annotate(4, "proto_ids_size: " + Hex.u4(sz)); out.annotate(4, "proto_ids_off: " + Hex.u4(offset)); } out.writeInt(sz); out.writeInt(offset); }
/** * Writes the portion of the file header that refers to this instance. * * @param out {@code non-null;} where to write */ public void writeHeaderPart(AnnotatedOutput out) { throwIfNotPrepared(); int sz = protoIds.size(); int offset = (sz == 0) ? 0 : getFileOffset(); if (sz > 65536) { throw new UnsupportedOperationException("too many proto ids"); } if (out.annotates()) { out.annotate(4, "proto_ids_size: " + Hex.u4(sz)); out.annotate(4, "proto_ids_off: " + Hex.u4(offset)); } out.writeInt(sz); out.writeInt(offset); }
/** * Writes the portion of the file header that refers to this instance. * * @param out {@code non-null;} where to write */ public void writeHeaderPart(AnnotatedOutput out) { throwIfNotPrepared(); int sz = protoIds.size(); int offset = (sz == 0) ? 0 : getFileOffset(); if (sz > 65536) { throw new UnsupportedOperationException("too many proto ids"); } if (out.annotates()) { out.annotate(4, "proto_ids_size: " + Hex.u4(sz)); out.annotate(4, "proto_ids_off: " + Hex.u4(offset)); } out.writeInt(sz); out.writeInt(offset); }
/** * Writes the portion of the file header that refers to this instance. * * @param out {@code non-null;} where to write */ public void writeHeaderPart(AnnotatedOutput out) { throwIfNotPrepared(); int sz = protoIds.size(); int offset = (sz == 0) ? 0 : getFileOffset(); if (sz > 65536) { throw new UnsupportedOperationException("too many proto ids"); } if (out.annotates()) { out.annotate(4, "proto_ids_size: " + Hex.u4(sz)); out.annotate(4, "proto_ids_off: " + Hex.u4(offset)); } out.writeInt(sz); out.writeInt(offset); }
/** * Writes the portion of the file header that refers to this instance. * * @param out {@code non-null;} where to write */ public void writeHeaderPart(AnnotatedOutput out) { throwIfNotPrepared(); int sz = protoIds.size(); int offset = (sz == 0) ? 0 : getFileOffset(); if (sz > 65536) { throw new UnsupportedOperationException("too many proto ids"); } if (out.annotates()) { out.annotate(4, "proto_ids_size: " + Hex.u4(sz)); out.annotate(4, "proto_ids_off: " + Hex.u4(offset)); } out.writeInt(sz); out.writeInt(offset); }
/** * Writes the portion of the file header that refers to this instance. * * @param out {@code non-null;} where to write */ public void writeHeaderPart(AnnotatedOutput out) { throwIfNotPrepared(); int sz = protoIds.size(); int offset = (sz == 0) ? 0 : getFileOffset(); if (sz > 65536) { throw new UnsupportedOperationException("too many proto ids"); } if (out.annotates()) { out.annotate(4, "proto_ids_size: " + Hex.u4(sz)); out.annotate(4, "proto_ids_off: " + Hex.u4(offset)); } out.writeInt(sz); out.writeInt(offset); }