Click here to Skip to main content
15,891,906 members
Articles / Web Development / HTML

Continuous Wavelet Transforms, a Java Implementation

Rate me:
Please Sign up or sign in to vote.
4.31/5 (5 votes)
7 Mar 2015CPOL12 min read 29.8K   1.3K   10  
This article presents a Java example application that performs continuous wavelet transforms.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_03) on Fri Oct 12 20:27:18 EEST 2007 -->
<TITLE>
OP (JEL API)
</TITLE>

<META NAME="date" CONTENT="2007-10-12">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style">

<SCRIPT type="text/javascript">
function windowTitle()
{
    if (location.href.indexOf('is-external=true') == -1) {
        parent.document.title="OP (JEL API)";
    }
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>

</HEAD>

<BODY BGCOLOR="white" onload="windowTitle();">
<HR>


<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/OP.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../gnu/jel/LocalMethod.html" title="class in gnu.jel"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../gnu/jel/OPbinary.html" title="class in gnu.jel"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../index.html?gnu/jel/OP.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="OP.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>


</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->

<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
gnu.jel</FONT>
<BR>
Class OP</H2>
<PRE>
java.lang.Object
  <IMG SRC="../../resources/inherit.gif" ALT="extended by "><B>gnu.jel.OP</B>
</PRE>
<DL>
<DT><B>Direct Known Subclasses:</B> <DD><A HREF="../../gnu/jel/OPbinary.html" title="class in gnu.jel">OPbinary</A>, <A HREF="../../gnu/jel/OPcall.html" title="class in gnu.jel">OPcall</A>, <A HREF="../../gnu/jel/OPcondtnl.html" title="class in gnu.jel">OPcondtnl</A>, <A HREF="../../gnu/jel/OPload.html" title="class in gnu.jel">OPload</A>, <A HREF="../../gnu/jel/OPunary.html" title="class in gnu.jel">OPunary</A></DD>
</DL>
<HR>
<DL>
<DT><PRE>public abstract class <B>OP</B><DT>extends java.lang.Object</DL>
</PRE>

<P>
A tree node, representing an operation.
<P>

<P>
<HR>

<P>
<!-- =========== FIELD SUMMARY =========== -->

<A NAME="field_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Field Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../gnu/jel/OP.html" title="class in gnu.jel">OP</A>[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../gnu/jel/OP.html#chi">chi</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Holds references to children of this node</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../gnu/jel/OP.html#resID">resID</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Holds type ID of the result of this OP</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.Class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../gnu/jel/OP.html#resType">resType</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Holds type of the result of this OP</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;java.lang.Class[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../gnu/jel/OP.html#specialTypes">specialTypes</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Classes of the special types by ID.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;byte[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../gnu/jel/OP.html#unwrapType">unwrapType</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Unwraps the type ID.</TD>
</TR>
</TABLE>
&nbsp;
<!-- ======== CONSTRUCTOR SUMMARY ======== -->

<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../gnu/jel/OP.html#OP()">OP</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
</TABLE>
&nbsp;
<!-- ========== METHOD SUMMARY =========== -->

<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>abstract &nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../gnu/jel/OP.html#compile(gnu.jel.ClassFile)">compile</A></B>(<A HREF="../../gnu/jel/ClassFile.html" title="class in gnu.jel">ClassFile</A>&nbsp;cf)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Called to generate the code implementing this OP.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>abstract &nbsp;java.lang.Object</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../gnu/jel/OP.html#eval()">eval</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Called to evaluate this node and all its sub-nodes.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../gnu/jel/OP.html#isWidening(java.lang.Class, java.lang.Class)">isWidening</A></B>(java.lang.Class&nbsp;c1,
           java.lang.Class&nbsp;c2)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Used to find out if the conversion t1->t2 is widening.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../gnu/jel/OP.html#isWidening(int, java.lang.Class, int, java.lang.Class)">isWidening</A></B>(int&nbsp;id1,
           java.lang.Class&nbsp;c1,
           int&nbsp;id2,
           java.lang.Class&nbsp;c2)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Used to find out if the conversion t1->t2 is widening.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected static&nbsp;java.lang.Object</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../gnu/jel/OP.html#narrow(java.lang.Number, int)">narrow</A></B>(java.lang.Number&nbsp;val,
       int&nbsp;clsID)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Narrows the value back to desired primitiva type.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../gnu/jel/OP.html#typeID(java.lang.Class)">typeID</A></B>(java.lang.Class&nbsp;c)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Identifies the primitive type of the given class.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../gnu/jel/OP.html#typeIDObject(java.lang.Object)">typeIDObject</A></B>(java.lang.Object&nbsp;o)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Identify the primitive type corresponding to the given reflection object.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected static&nbsp;java.lang.Number</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../gnu/jel/OP.html#widen(java.lang.Object, int)">widen</A></B>(java.lang.Object&nbsp;o,
      int&nbsp;clsID)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Makes widest possible representation of a value of Java primitive type.</TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>

<!-- ============ FIELD DETAIL =========== -->

<A NAME="field_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Field Detail</B></FONT></TH>
</TR>
</TABLE>

<A NAME="chi"><!-- --></A><H3>
chi</H3>
<PRE>
public <A HREF="../../gnu/jel/OP.html" title="class in gnu.jel">OP</A>[] <B>chi</B></PRE>
<DL>
<DD>Holds references to children of this node
<P>
<DL>
</DL>
</DL>
<HR>

<A NAME="resID"><!-- --></A><H3>
resID</H3>
<PRE>
public int <B>resID</B></PRE>
<DL>
<DD>Holds type ID of the result of this OP
<P>
<DL>
</DL>
</DL>
<HR>

<A NAME="resType"><!-- --></A><H3>
resType</H3>
<PRE>
public java.lang.Class <B>resType</B></PRE>
<DL>
<DD>Holds type of the result of this OP
<P>
<DL>
</DL>
</DL>
<HR>

<A NAME="specialTypes"><!-- --></A><H3>
specialTypes</H3>
<PRE>
public static final java.lang.Class[] <B>specialTypes</B></PRE>
<DL>
<DD>Classes of the special types by ID.
  <P> The frequently used types (those on which many operations are
  defined) are identified by an integer number. The advantage is 
  the possibility to have almost completely table driven code generator.
  <P> So, the special types are only special in the fact that except
  of the reference to their class object they are also identified by an
  integer number.
<P>
<DL>
</DL>
</DL>
<HR>

<A NAME="unwrapType"><!-- --></A><H3>
unwrapType</H3>
<PRE>
public static final byte[] <B>unwrapType</B></PRE>
<DL>
<DD>Unwraps the type ID.
 <P>That is all special types which are references are translated into 8.
<P>
<DL>
</DL>
</DL>

<!-- ========= CONSTRUCTOR DETAIL ======== -->

<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TH>
</TR>
</TABLE>

<A NAME="OP()"><!-- --></A><H3>
OP</H3>
<PRE>
public <B>OP</B>()</PRE>
<DL>
</DL>

<!-- ============ METHOD DETAIL ========== -->

<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>

<A NAME="eval()"><!-- --></A><H3>
eval</H3>
<PRE>
public abstract java.lang.Object <B>eval</B>()
                               throws java.lang.Exception</PRE>
<DL>
<DD>Called to evaluate this node and all its sub-nodes.
 <P>Upon success this node is to be replaced by the constant node
 holding the returned object.
<P>
<DD><DL>

<DT><B>Returns:</B><DD>an object to which this node evaluates
<DT><B>Throws:</B>
<DD><CODE>if</CODE> - can't evaluate, in this case the sub-nodes
<DD><CODE>java.lang.Exception</CODE></DL>
</DD>
</DL>
<HR>

<A NAME="compile(gnu.jel.ClassFile)"><!-- --></A><H3>
compile</H3>
<PRE>
public abstract void <B>compile</B>(<A HREF="../../gnu/jel/ClassFile.html" title="class in gnu.jel">ClassFile</A>&nbsp;cf)</PRE>
<DL>
<DD>Called to generate the code implementing this OP.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>cf</CODE> - class file with a new open method to write the code into.</DL>
</DD>
</DL>
<HR>

<A NAME="typeID(java.lang.Class)"><!-- --></A><H3>
typeID</H3>
<PRE>
public static final int <B>typeID</B>(java.lang.Class&nbsp;c)</PRE>
<DL>
<DD>Identifies the primitive type of the given class.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>c</CODE> - class to identify.
<DT><B>Returns:</B><DD>id of the corresponding primitive type.</DL>
</DD>
</DL>
<HR>

<A NAME="typeIDObject(java.lang.Object)"><!-- --></A><H3>
typeIDObject</H3>
<PRE>
public static final int <B>typeIDObject</B>(java.lang.Object&nbsp;o)</PRE>
<DL>
<DD>Identify the primitive type corresponding to the given reflection object.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>o</CODE> - object to identify.
<DT><B>Returns:</B><DD>id of the corresponding primitive type.</DL>
</DD>
</DL>
<HR>

<A NAME="isWidening(int, java.lang.Class, int, java.lang.Class)"><!-- --></A><H3>
isWidening</H3>
<PRE>
public static boolean <B>isWidening</B>(int&nbsp;id1,
                                 java.lang.Class&nbsp;c1,
                                 int&nbsp;id2,
                                 java.lang.Class&nbsp;c2)</PRE>
<DL>
<DD>Used to find out if the conversion t1->t2 is widening.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>id1</CODE> - type ID to convert from<DD><CODE>c1</CODE> - class to convert from (used if id1==8)<DD><CODE>id2</CODE> - type ID to convert to<DD><CODE>c2</CODE> - class to convert to (used if id2==8)
<DT><B>Returns:</B><DD>true if the given conversion is widening (can be done
         automatically)</DL>
</DD>
</DL>
<HR>

<A NAME="isWidening(java.lang.Class, java.lang.Class)"><!-- --></A><H3>
isWidening</H3>
<PRE>
public static boolean <B>isWidening</B>(java.lang.Class&nbsp;c1,
                                 java.lang.Class&nbsp;c2)</PRE>
<DL>
<DD>Used to find out if the conversion t1->t2 is widening.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>c1</CODE> - class to convert from (used if id1==8)<DD><CODE>c2</CODE> - class to convert to (used if id2==8)
<DT><B>Returns:</B><DD>true if the given conversion is widening (can be done
         automatically)</DL>
</DD>
</DL>
<HR>

<A NAME="widen(java.lang.Object, int)"><!-- --></A><H3>
widen</H3>
<PRE>
protected static java.lang.Number <B>widen</B>(java.lang.Object&nbsp;o,
                                        int&nbsp;clsID)</PRE>
<DL>
<DD>Makes widest possible representation of a value of Java primitive type.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>o</CODE> - reflection object, containing value to represent.<DD><CODE>clsID</CODE> - ID of a type of this reflection object (to save lookup).
<DT><B>Returns:</B><DD>Number, representing the given value.</DL>
</DD>
</DL>
<HR>

<A NAME="narrow(java.lang.Number, int)"><!-- --></A><H3>
narrow</H3>
<PRE>
protected static java.lang.Object <B>narrow</B>(java.lang.Number&nbsp;val,
                                         int&nbsp;clsID)</PRE>
<DL>
<DD>Narrows the value back to desired primitiva type.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>val</CODE> - reflection object, containing value to narrow.<DD><CODE>clsID</CODE> - ID of a type to narrow the given object into.
<DT><B>Returns:</B><DD>narrowed reflection object.</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>


<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/OP.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../gnu/jel/LocalMethod.html" title="class in gnu.jel"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../gnu/jel/OPbinary.html" title="class in gnu.jel"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../index.html?gnu/jel/OP.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="OP.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>


</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->

<HR>
<i>Copyright &#169; 1998-2007 Konstantin L. Metlov All Rights Reserved.</i>
</BODY>
</HTML>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Founder PEI Watershed Alliance, Inc.
United States United States
I am an analytical chemist and an educator. I program primarily to perform matrix computations for regression analysis, process signals, acquire data from sensors, and to control devices.

I participate in many open source development communities and Linux user forums. I do contract work for an environmental analytical laboratory, where I am primarily focused on LIMS programming and network administration.

I am a member of several community-interest groups such as the Prince Edward Island Watershed Alliance, the Lot 11 and Area Watershed Management Group, and the Petersham Historic Commission.

Comments and Discussions