Package com.sun.j3d.internal

Source Code of com.sun.j3d.internal.BufferWrapper

/*     */ package com.sun.j3d.internal;
/*     */
/*     */ import java.nio.Buffer;
/*     */ import java.nio.ByteBuffer;
/*     */ import java.nio.DoubleBuffer;
/*     */ import java.nio.FloatBuffer;
/*     */ import javax.media.j3d.J3DBuffer;
/*     */
/*     */ public abstract class BufferWrapper
/*     */ {
/*     */   public static final int TYPE_NULL = 0;
/*     */   public static final int TYPE_UNKNOWN = 1;
/*     */   public static final int TYPE_BYTE = 2;
/*     */   public static final int TYPE_FLOAT = 3;
/*     */   public static final int TYPE_DOUBLE = 4;
/*     */
/*     */   abstract Buffer getBuffer();
/*     */
/*     */   public Object getBufferAsObject()
/*     */   {
/*  68 */     return getBuffer();
/*     */   }
/*     */
/*     */   public int capacity()
/*     */   {
/*  79 */     return getBuffer().capacity();
/*     */   }
/*     */
/*     */   public int limit()
/*     */   {
/*  86 */     return getBuffer().limit();
/*     */   }
/*     */
/*     */   public int position()
/*     */   {
/*  93 */     return getBuffer().position();
/*     */   }
/*     */
/*     */   public BufferWrapper position(int newPosition)
/*     */   {
/* 101 */     getBuffer().position(newPosition);
/* 102 */     return this;
/*     */   }
/*     */
/*     */   public BufferWrapper rewind()
/*     */   {
/* 111 */     getBuffer().rewind();
/* 112 */     return this;
/*     */   }
/*     */
/*     */   public static int getBufferType(J3DBuffer b)
/*     */   {
/* 126 */     Buffer buffer = b.getBuffer();
/*     */     int bufferType;
/*     */     int bufferType;
/* 128 */     if (buffer == null) {
/* 129 */       bufferType = 0;
/*     */     }
/*     */     else
/*     */     {
/*     */       int bufferType;
/* 131 */       if ((buffer instanceof ByteBuffer)) {
/* 132 */         bufferType = 2;
/*     */       }
/*     */       else
/*     */       {
/*     */         int bufferType;
/* 134 */         if ((buffer instanceof FloatBuffer)) {
/* 135 */           bufferType = 3;
/*     */         }
/*     */         else
/*     */         {
/*     */           int bufferType;
/* 137 */           if ((buffer instanceof DoubleBuffer)) {
/* 138 */             bufferType = 4;
/*     */           }
/*     */           else
/* 141 */             bufferType = 1;
/*     */         }
/*     */       }
/*     */     }
/* 143 */     return bufferType;
/*     */   }
/*     */ }

/* Location:           Z:\System\Library\Java\Extensions\j3dutils.jar
* Qualified Name:     com.sun.j3d.internal.BufferWrapper
* JD-Core Version:    0.6.2
*/
TOP

Related Classes of com.sun.j3d.internal.BufferWrapper

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.