01: /*
02: * $RCSfile: StreamSegment.java,v $
03: *
04: * Copyright (c) 2005 Sun Microsystems, Inc. All rights reserved.
05: *
06: * Use is subject to license terms.
07: *
08: * $Revision: 1.1 $
09: * $Date: 2005/02/11 04:55:33 $
10: * $State: Exp $
11: */
12: package com.sun.media.jai.codec;
13:
14: /**
15: * A utility class representing a segment within a stream as a
16: * <code>long</code> starting position and an <code>int</code>
17: * length.
18: *
19: * <p><b> This class is not a committed part of the JAI API. It may
20: * be removed or changed in future releases of JAI.</b>
21: */
22: public class StreamSegment {
23:
24: private long startPos = 0L;
25: private int segmentLength = 0;
26:
27: /**
28: * Constructs a <code>StreamSegment</code>.
29: * The starting position and length are set to 0.
30: */
31: public StreamSegment() {
32: }
33:
34: /**
35: * Constructs a <code>StreamSegment</code> with a
36: * given starting position and length.
37: */
38: public StreamSegment(long startPos, int segmentLength) {
39: this .startPos = startPos;
40: this .segmentLength = segmentLength;
41: }
42:
43: /**
44: * Returns the starting position of the segment.
45: */
46: public final long getStartPos() {
47: return startPos;
48: }
49:
50: /**
51: * Sets the starting position of the segment.
52: */
53: public final void setStartPos(long startPos) {
54: this .startPos = startPos;
55: }
56:
57: /**
58: * Returns the length of the segment.
59: */
60: public final int getSegmentLength() {
61: return segmentLength;
62: }
63:
64: /**
65: * Sets the length of the segment.
66: */
67: public final void setSegmentLength(int segmentLength) {
68: this.segmentLength = segmentLength;
69: }
70: }
|