jdk/src/share/classes/java/nio/X-Buffer-bin.java.template
author ohair
Wed, 28 Oct 2009 12:54:37 -0700
changeset 4115 e09be02771b6
parent 2 jdk/src/share/classes/java/nio/X-Buffer-bin.java@90ce3da70b43
child 5506 202f599c92aa
permissions -rw-r--r--
6888701: Change all template java source files to a .java-template file suffix Reviewed-by: jjg, alanb, mr
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
     2
 * Copyright 2000-2002 Sun Microsystems, Inc.  All Rights Reserved.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Sun designates this
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
 * by Sun in the LICENSE file that accompanied this code.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    21
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
 * CA 95054 USA or visit www.sun.com if you need additional information or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
 * have any questions.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
#warn This file is preprocessed before being compiled
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
class XXX {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
#begin
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
     * Relative <i>get</i> method for reading $a$ $type$ value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
     * <p> Reads the next $nbytes$ bytes at this buffer's current position,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
     * composing them into $a$ $type$ value according to the current byte order,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
     * and then increments the position by $nbytes$.  </p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
     * @return  The $type$ value at the buffer's current position
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
     * @throws  BufferUnderflowException
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
     *          If there are fewer than $nbytes$ bytes
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
     *          remaining in this buffer
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
    public abstract $type$ get$Type$();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
     * Relative <i>put</i> method for writing $a$ $type$
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
     * value&nbsp;&nbsp;<i>(optional operation)</i>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
     * <p> Writes $nbytes$ bytes containing the given $type$ value, in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
     * current byte order, into this buffer at the current position, and then
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
     * increments the position by $nbytes$.  </p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
     * @param  value
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
     *         The $type$ value to be written
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
     * @return  This buffer
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
     * @throws  BufferOverflowException
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
     *          If there are fewer than $nbytes$ bytes
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
     *          remaining in this buffer
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
     * @throws  ReadOnlyBufferException
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
     *          If this buffer is read-only
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
    public abstract ByteBuffer put$Type$($type$ value);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
     * Absolute <i>get</i> method for reading $a$ $type$ value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
     * <p> Reads $nbytes$ bytes at the given index, composing them into a
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
     * $type$ value according to the current byte order.  </p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
     * @param  index
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
     *         The index from which the bytes will be read
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
     * @return  The $type$ value at the given index
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
     * @throws  IndexOutOfBoundsException
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
     *          If <tt>index</tt> is negative
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
     *          or not smaller than the buffer's limit,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
     *          minus $nbytesButOne$
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
    public abstract $type$ get$Type$(int index);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
     * Absolute <i>put</i> method for writing $a$ $type$
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
     * value&nbsp;&nbsp;<i>(optional operation)</i>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
     * <p> Writes $nbytes$ bytes containing the given $type$ value, in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
     * current byte order, into this buffer at the given index.  </p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
     * @param  index
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
     *         The index at which the bytes will be written
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
     * @param  value
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
     *         The $type$ value to be written
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
     * @return  This buffer
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
     * @throws  IndexOutOfBoundsException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
     *          If <tt>index</tt> is negative
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
     *          or not smaller than the buffer's limit,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
     *          minus $nbytesButOne$
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
     * @throws  ReadOnlyBufferException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
     *          If this buffer is read-only
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
    public abstract ByteBuffer put$Type$(int index, $type$ value);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
     * Creates a view of this byte buffer as $a$ $type$ buffer.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
     * <p> The content of the new buffer will start at this buffer's current
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
     * position.  Changes to this buffer's content will be visible in the new
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
     * buffer, and vice versa; the two buffers' position, limit, and mark
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
     * values will be independent.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
     * <p> The new buffer's position will be zero, its capacity and its limit
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
     * will be the number of bytes remaining in this buffer divided by
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
     * $nbytes$, and its mark will be undefined.  The new buffer will be direct
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
     * if, and only if, this buffer is direct, and it will be read-only if, and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
     * only if, this buffer is read-only.  </p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
     * @return  A new $type$ buffer
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
    public abstract $Type$Buffer as$Type$Buffer();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
#end
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
}