RawDataEvent.java
Go to the documentation of this file.
00001 /*
00002  * Copyright 2006 Phidgets Inc.  All rights reserved.
00003  */
00004 
00005 package com.phidgets.event;
00006 
00007 import com.phidgets.Phidget;
00008 
00014 public class RawDataEvent
00015 {
00016         Phidget source;
00017         int[] data;
00018 
00024         public RawDataEvent(Phidget source, int[] data)
00025         {
00026                 this.source = source;
00027                 this.data = new int[data.length];
00028                 for(int i=0;i<data.length;i++)
00029                         this.data[i] = data[i];
00030         }
00031 
00039         public Phidget getSource() {
00040                 return source;
00041         }
00042 
00048         public int[] getData() {
00049                 return data;
00050         }
00051 
00057         public String toString() {
00058                 String out = " Raw data:";
00059                 for(int i=0;i<data.length;i++)
00060                 {
00061                         if(i%8 == 0) out = out + "\n";
00062                         if(data[i]==com.phidgets.IRPhidget.RAWDATA_LONGSPACE)
00063                                 out = out + "LONG";
00064                         else
00065                                 out = out + data[i];
00066                         if((i+1)%8 != 0) out = out + ", ";
00067                 }
00068                 return out;
00069         }
00070 }


pedal_monitor
Author(s): Pedro Mendes
autogenerated on Fri Jun 6 2014 18:37:21