/** * Returns an empty VecBufferSequence. The returned VecBufferSequence has a size of zero and contains no * sub-buffers. * * @param coordsPerVec the number of coordinates per logical vector. * * @return the empty VecBufferSequence. */ public static VecBufferSequence emptyVecBufferSequence(int coordsPerVec) { if (coordsPerVec < 1) { String message = Logging.getMessage("generic.ArgumentOutOfRange", coordsPerVec); Logging.logger().severe(message); throw new ArgumentException(message); } return(new VecBufferSequence(VecBuffer.emptyVecBuffer(coordsPerVec))); }
/** * Returns the sub-buffer at the specified index as a {@link SharpEarth.util.VecBuffer}. * * @param index the index of the VecBuffer to return. * * @return the VecBuffer at the specified index. * * @throws ArgumentException if the index is out of range. */ public VecBuffer subBuffer(int index) { if (index < 0 || index >= this.count) { String message = Logging.getMessage("generic.indexOutOfRange", index); Logging.logger().severe(message); throw new ArgumentException(message); } int off = this.offsets.get(index); int len = this.lengths.get(index); if (len > 0) { return(this.createSubBuffer(off, len)); } else { return(VecBuffer.emptyVecBuffer(this.getCoordsPerVec())); } }