PHSensorPhidget.java
Go to the documentation of this file.
00001 
00002 /*
00003  * Copyright 2006 Phidgets Inc.  All rights reserved.
00004  */
00005 
00006 package com.phidgets;
00007 import java.util.Iterator;
00008 import java.util.LinkedList;
00009 import com.phidgets.event.*;
00018 public final class PHSensorPhidget extends Phidget
00019 {
00020         public PHSensorPhidget () throws PhidgetException
00021         {
00022                 super (create ());
00023         }
00024         private static native long create () throws PhidgetException;
00033         public native double getPH () throws PhidgetException;
00040         public native double getPHMax () throws PhidgetException;
00047         public native double getPHMin () throws PhidgetException;
00056         public native double getPotential () throws PhidgetException;
00063         public native double getPotentialMax () throws PhidgetException;
00070         public native double getPotentialMin () throws PhidgetException;
00083         public native void setTemperature (double newVal) throws PhidgetException;
00091         public native void setPHChangeTrigger (double newVal) throws PhidgetException;
00099         public native double getPHChangeTrigger () throws PhidgetException;
00100 
00101         private final void enableDeviceSpecificEvents (boolean b)
00102         {
00103                 enablePHChangeEvents (b && phChangeListeners.size () > 0);
00104         }
00113         public final void addPHChangeListener (PHChangeListener l)
00114         {
00115                 synchronized (phChangeListeners)
00116                 {
00117                         phChangeListeners.add (l);
00118                         enablePHChangeEvents (true);
00119         }} private LinkedList phChangeListeners = new LinkedList ();
00120         private long nativePHChangeHandler = 0;
00121         public final void removePHChangeListener (PHChangeListener l)
00122         {
00123                 synchronized (phChangeListeners)
00124                 {
00125                         phChangeListeners.remove (l);
00126                         enablePHChangeEvents (phChangeListeners.size () > 0);
00127         }} private void firePHChange (PHChangeEvent e)
00128         {
00129                 synchronized (phChangeListeners)
00130                 {
00131                         for (Iterator it = phChangeListeners.iterator (); it.hasNext ();)
00132                                 ((PHChangeListener) it.next ()).phChanged (e);
00133                 }
00134         }
00135         private native void enablePHChangeEvents (boolean b);
00136 }


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