Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: org/ydp/jai/StreamSegment.java


1   /*
2    * The contents of this file are subject to the  JAVA ADVANCED IMAGING
3    * SAMPLE INPUT-OUTPUT CODECS AND WIDGET HANDLING SOURCE CODE  License
4    * Version 1.0 (the "License"); You may not use this file except in
5    * compliance with the License. You may obtain a copy of the License at
6    * http://www.sun.com/software/imaging/JAI/index.html
7    *
8    * Software distributed under the License is distributed on an "AS IS"
9    * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
10   * the License for the specific language governing rights and limitations
11   * under the License. 
12   *
13   * The Original Code is JAVA ADVANCED IMAGING SAMPLE INPUT-OUTPUT CODECS
14   * AND WIDGET HANDLING SOURCE CODE. 
15   * The Initial Developer of the Original Code is: Sun Microsystems, Inc..
16   * Portions created by: _______________________________________
17   * are Copyright (C): _______________________________________
18   * All Rights Reserved.
19   * Contributor(s): _______________________________________
20   */
21  
22  package org.ydp.jai;
23  
24  
25  /**
26   * A utility class representing a segment within a stream as a
27   * <code>long</code> starting position and an <code>int</code>
28   * length.
29   *
30   * <p><b> This class is not a committed part of the JAI API.  It may
31   * be removed or changed in future releases of JAI.</b>
32   */
33  public class StreamSegment {
34      
35      private long startPos = 0L;
36      private int segmentLength = 0;
37  
38      /**
39       * Constructs a <code>StreamSegment</code>.
40       * The starting position and length are set to 0.
41       */
42      public StreamSegment() {}
43  
44      /**
45       * Constructs a <code>StreamSegment</code> with a
46       * given starting position and length.
47       */
48      public StreamSegment(long startPos, int segmentLength) {
49          this.startPos = startPos;
50          this.segmentLength = segmentLength;
51      }
52  
53      /**
54       * Returns the starting position of the segment.
55       */
56      public final long getStartPos() {
57          return startPos;
58      }
59  
60      /**
61       * Sets the starting position of the segment.
62       */
63      public final void setStartPos(long startPos) {
64          this.startPos = startPos;
65      }
66  
67      /**
68       * Returns the length of the segment.
69       */
70      public final int getSegmentLength() {
71          return segmentLength;
72      }
73  
74      /**
75       * Sets the length of the segment.
76       */
77      public final void setSegmentLength(int segmentLength) {
78          this.segmentLength = segmentLength;
79      }
80  }