/aima-all/release/javadoc/aima-core/aima/core/util/Util.html
HTML | 840 lines | 733 code | 83 blank | 24 comment | 0 complexity | 31af5eb528f02ce1141eb595eb5590ca MD5 | raw file
Possible License(s): GPL-3.0, Apache-2.0
- <!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_20) on Sun Jan 08 15:29:14 PST 2012 -->
- <TITLE>
- Util
- </TITLE>
-
- <META NAME="date" CONTENT="2012-01-08">
-
- <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="Util";
- }
- }
- </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> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
- <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
- </TR>
- </TABLE>
- </TD>
- <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
- </EM>
- </TD>
- </TR>
-
- <TR>
- <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
- <A HREF="../../../aima/core/util/SetOps.html" title="class in aima.core.util"><B>PREV CLASS</B></A>
- NEXT CLASS</FONT></TD>
- <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
- <A HREF="../../../index.html?aima/core/util/Util.html" target="_top"><B>FRAMES</B></A>
- <A HREF="Util.html" target="_top"><B>NO FRAMES</B></A>
- <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: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
- <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
- DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <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">
- aima.core.util</FONT>
- <BR>
- Class Util</H2>
- <PRE>
- java.lang.Object
- <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>aima.core.util.Util</B>
- </PRE>
- <HR>
- <DL>
- <DT><PRE>public class <B>Util</B><DT>extends java.lang.Object</DL>
- </PRE>
-
- <P>
- <DL>
- <DT><B>Author:</B></DT>
- <DD>Ravi Mohan</DD>
- </DL>
- <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>static java.lang.String</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../aima/core/util/Util.html#NO">NO</A></B></CODE>
-
- <BR>
- </TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>static java.lang.String</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../aima/core/util/Util.html#YES">YES</A></B></CODE>
-
- <BR>
- </TD>
- </TR>
- </TABLE>
-
- <!-- ======== 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="../../../aima/core/util/Util.html#Util()">Util</A></B>()</CODE>
-
- <BR>
- </TD>
- </TR>
- </TABLE>
-
- <!-- ========== 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>static double</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../aima/core/util/Util.html#calculateMean(java.util.List)">calculateMean</A></B>(java.util.List<java.lang.Double> lst)</CODE>
-
- <BR>
- </TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>static double</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../aima/core/util/Util.html#calculateStDev(java.util.List, double)">calculateStDev</A></B>(java.util.List<java.lang.Double> values,
- double mean)</CODE>
-
- <BR>
- </TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>static void</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../aima/core/util/Util.html#checkForNanOrInfinity(double)">checkForNanOrInfinity</A></B>(double d)</CODE>
-
- <BR>
- </TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>static
- <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
- <TR ALIGN="right" VALIGN="">
- <TD NOWRAP><FONT SIZE="-1">
- <CODE><K,V> java.util.Map<K,V></CODE></FONT></TD>
- </TR>
- </TABLE>
- </CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../aima/core/util/Util.html#create(java.util.Collection, V)">create</A></B>(java.util.Collection<K> keys,
- V value)</CODE>
-
- <BR>
- Create a Map<K, V> with the passed in keys having their values
- initialized to the passed in value.</TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>static
- <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
- <TR ALIGN="right" VALIGN="">
- <TD NOWRAP><FONT SIZE="-1">
- <CODE><T> T</CODE></FONT></TD>
- </TR>
- </TABLE>
- </CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../aima/core/util/Util.html#first(java.util.List)">first</A></B>(java.util.List<T> l)</CODE>
-
- <BR>
- Get the first element from a list.</TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>static double</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../aima/core/util/Util.html#generateRandomDoubleBetween(double, double)">generateRandomDoubleBetween</A></B>(double lowerLimit,
- double upperLimit)</CODE>
-
- <BR>
- </TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>static double</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../aima/core/util/Util.html#information(double[])">information</A></B>(double[] probabilities)</CODE>
-
- <BR>
- </TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>static double</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../aima/core/util/Util.html#log2(double)">log2</A></B>(double d)</CODE>
-
- <BR>
- </TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>static int</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../aima/core/util/Util.html#max(int, int)">max</A></B>(int i,
- int j)</CODE>
-
- <BR>
- </TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>static int</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../aima/core/util/Util.html#max(int, int, int)">max</A></B>(int i,
- int j,
- int k)</CODE>
-
- <BR>
- </TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>static int</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../aima/core/util/Util.html#min(int, int)">min</A></B>(int i,
- int j)</CODE>
-
- <BR>
- </TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>static int</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../aima/core/util/Util.html#min(int, int, int)">min</A></B>(int i,
- int j,
- int k)</CODE>
-
- <BR>
- </TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>static
- <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
- <TR ALIGN="right" VALIGN="">
- <TD NOWRAP><FONT SIZE="-1">
- <CODE><T> T</CODE></FONT></TD>
- </TR>
- </TABLE>
- </CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../aima/core/util/Util.html#mode(java.util.List)">mode</A></B>(java.util.List<T> l)</CODE>
-
- <BR>
- </TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>static double[]</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../aima/core/util/Util.html#normalize(double[])">normalize</A></B>(double[] probDist)</CODE>
-
- <BR>
- </TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>static java.util.List<java.lang.Double></CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../aima/core/util/Util.html#normalize(java.util.List)">normalize</A></B>(java.util.List<java.lang.Double> values)</CODE>
-
- <BR>
- </TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>static java.util.List<java.lang.Double></CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../aima/core/util/Util.html#normalizeFromMeanAndStdev(java.util.List, double, double)">normalizeFromMeanAndStdev</A></B>(java.util.List<java.lang.Double> values,
- double mean,
- double stdev)</CODE>
-
- <BR>
- </TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>static java.lang.String</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../aima/core/util/Util.html#ntimes(java.lang.String, int)">ntimes</A></B>(java.lang.String s,
- int n)</CODE>
-
- <BR>
- </TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>static boolean</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../aima/core/util/Util.html#randomBoolean()">randomBoolean</A></B>()</CODE>
-
- <BR>
- </TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>static int</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../aima/core/util/Util.html#randomNumberBetween(int, int)">randomNumberBetween</A></B>(int i,
- int j)</CODE>
-
- <BR>
- </TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>static
- <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
- <TR ALIGN="right" VALIGN="">
- <TD NOWRAP><FONT SIZE="-1">
- <CODE><T> java.util.List<T></CODE></FONT></TD>
- </TR>
- </TABLE>
- </CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../aima/core/util/Util.html#removeFrom(java.util.List, T)">removeFrom</A></B>(java.util.List<T> list,
- T member)</CODE>
-
- <BR>
- </TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>static
- <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
- <TR ALIGN="right" VALIGN="">
- <TD NOWRAP><FONT SIZE="-1">
- <CODE><T> java.util.List<T></CODE></FONT></TD>
- </TR>
- </TABLE>
- </CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../aima/core/util/Util.html#rest(java.util.List)">rest</A></B>(java.util.List<T> l)</CODE>
-
- <BR>
- Get a sublist of all of the elements in the list except for first.</TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>static
- <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
- <TR ALIGN="right" VALIGN="">
- <TD NOWRAP><FONT SIZE="-1">
- <CODE><T> T</CODE></FONT></TD>
- </TR>
- </TABLE>
- </CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../aima/core/util/Util.html#selectRandomlyFromList(java.util.List)">selectRandomlyFromList</A></B>(java.util.List<T> l)</CODE>
-
- <BR>
- Randomly select an element from a list.</TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>static
- <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
- <TR ALIGN="right" VALIGN="">
- <TD NOWRAP><FONT SIZE="-1">
- <CODE><T extends java.lang.Number>
- <BR>
- double</CODE></FONT></TD>
- </TR>
- </TABLE>
- </CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../aima/core/util/Util.html#sumOfSquares(java.util.List)">sumOfSquares</A></B>(java.util.List<T> list)</CODE>
-
- <BR>
- </TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>static java.lang.String[]</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../aima/core/util/Util.html#yesno()">yesno</A></B>()</CODE>
-
- <BR>
- </TD>
- </TR>
- </TABLE>
- <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>
-
- <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="NO"><!-- --></A><H3>
- NO</H3>
- <PRE>
- public static final java.lang.String <B>NO</B></PRE>
- <DL>
- <DL>
- <DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#aima.core.util.Util.NO">Constant Field Values</A></DL>
- </DL>
- <HR>
-
- <A NAME="YES"><!-- --></A><H3>
- YES</H3>
- <PRE>
- public static final java.lang.String <B>YES</B></PRE>
- <DL>
- <DL>
- <DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#aima.core.util.Util.YES">Constant Field Values</A></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="Util()"><!-- --></A><H3>
- Util</H3>
- <PRE>
- public <B>Util</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="first(java.util.List)"><!-- --></A><H3>
- first</H3>
- <PRE>
- public static <T> T <B>first</B>(java.util.List<T> l)</PRE>
- <DL>
- <DD>Get the first element from a list.
- <P>
- <DD><DL>
- <DT><B>Parameters:</B><DD><CODE>l</CODE> - the list the first element is to be extracted from.
- <DT><B>Returns:</B><DD>the first element of the passed in list.</DL>
- </DD>
- </DL>
- <HR>
-
- <A NAME="rest(java.util.List)"><!-- --></A><H3>
- rest</H3>
- <PRE>
- public static <T> java.util.List<T> <B>rest</B>(java.util.List<T> l)</PRE>
- <DL>
- <DD>Get a sublist of all of the elements in the list except for first.
- <P>
- <DD><DL>
- <DT><B>Parameters:</B><DD><CODE>l</CODE> - the list the rest of the elements are to be extracted from.
- <DT><B>Returns:</B><DD>a list of all of the elements in the passed in list except for
- the first element.</DL>
- </DD>
- </DL>
- <HR>
-
- <A NAME="create(java.util.Collection,java.lang.Object)"><!-- --></A><A NAME="create(java.util.Collection, V)"><!-- --></A><H3>
- create</H3>
- <PRE>
- public static <K,V> java.util.Map<K,V> <B>create</B>(java.util.Collection<K> keys,
- V value)</PRE>
- <DL>
- <DD>Create a Map<K, V> with the passed in keys having their values
- initialized to the passed in value.
- <P>
- <DD><DL>
- <DT><B>Parameters:</B><DD><CODE>keys</CODE> - the keys for the newly constructed map.<DD><CODE>value</CODE> - the value to be associated with each of the maps keys.
- <DT><B>Returns:</B><DD>a map with the passed in keys initialized to value.</DL>
- </DD>
- </DL>
- <HR>
-
- <A NAME="selectRandomlyFromList(java.util.List)"><!-- --></A><H3>
- selectRandomlyFromList</H3>
- <PRE>
- public static <T> T <B>selectRandomlyFromList</B>(java.util.List<T> l)</PRE>
- <DL>
- <DD>Randomly select an element from a list.
- <P>
- <DD><DL>
- <DT><B>Type Parameters:</B><DD><CODE>T</CODE> - the type of element to be returned from the list l.<DT><B>Parameters:</B><DD><CODE>l</CODE> - a list of type T from which an element is to be selected
- randomly.
- <DT><B>Returns:</B><DD>a randomly selected element from l.</DL>
- </DD>
- </DL>
- <HR>
-
- <A NAME="randomBoolean()"><!-- --></A><H3>
- randomBoolean</H3>
- <PRE>
- public static boolean <B>randomBoolean</B>()</PRE>
- <DL>
- <DD><DL>
- </DL>
- </DD>
- </DL>
- <HR>
-
- <A NAME="normalize(double[])"><!-- --></A><H3>
- normalize</H3>
- <PRE>
- public static double[] <B>normalize</B>(double[] probDist)</PRE>
- <DL>
- <DD><DL>
- </DL>
- </DD>
- </DL>
- <HR>
-
- <A NAME="normalize(java.util.List)"><!-- --></A><H3>
- normalize</H3>
- <PRE>
- public static java.util.List<java.lang.Double> <B>normalize</B>(java.util.List<java.lang.Double> values)</PRE>
- <DL>
- <DD><DL>
- </DL>
- </DD>
- </DL>
- <HR>
-
- <A NAME="min(int, int)"><!-- --></A><H3>
- min</H3>
- <PRE>
- public static int <B>min</B>(int i,
- int j)</PRE>
- <DL>
- <DD><DL>
- </DL>
- </DD>
- </DL>
- <HR>
-
- <A NAME="max(int, int)"><!-- --></A><H3>
- max</H3>
- <PRE>
- public static int <B>max</B>(int i,
- int j)</PRE>
- <DL>
- <DD><DL>
- </DL>
- </DD>
- </DL>
- <HR>
-
- <A NAME="max(int, int, int)"><!-- --></A><H3>
- max</H3>
- <PRE>
- public static int <B>max</B>(int i,
- int j,
- int k)</PRE>
- <DL>
- <DD><DL>
- </DL>
- </DD>
- </DL>
- <HR>
-
- <A NAME="min(int, int, int)"><!-- --></A><H3>
- min</H3>
- <PRE>
- public static int <B>min</B>(int i,
- int j,
- int k)</PRE>
- <DL>
- <DD><DL>
- </DL>
- </DD>
- </DL>
- <HR>
-
- <A NAME="mode(java.util.List)"><!-- --></A><H3>
- mode</H3>
- <PRE>
- public static <T> T <B>mode</B>(java.util.List<T> l)</PRE>
- <DL>
- <DD><DL>
- </DL>
- </DD>
- </DL>
- <HR>
-
- <A NAME="yesno()"><!-- --></A><H3>
- yesno</H3>
- <PRE>
- public static java.lang.String[] <B>yesno</B>()</PRE>
- <DL>
- <DD><DL>
- </DL>
- </DD>
- </DL>
- <HR>
-
- <A NAME="log2(double)"><!-- --></A><H3>
- log2</H3>
- <PRE>
- public static double <B>log2</B>(double d)</PRE>
- <DL>
- <DD><DL>
- </DL>
- </DD>
- </DL>
- <HR>
-
- <A NAME="information(double[])"><!-- --></A><H3>
- information</H3>
- <PRE>
- public static double <B>information</B>(double[] probabilities)</PRE>
- <DL>
- <DD><DL>
- </DL>
- </DD>
- </DL>
- <HR>
-
- <A NAME="removeFrom(java.util.List,java.lang.Object)"><!-- --></A><A NAME="removeFrom(java.util.List, T)"><!-- --></A><H3>
- removeFrom</H3>
- <PRE>
- public static <T> java.util.List<T> <B>removeFrom</B>(java.util.List<T> list,
- T member)</PRE>
- <DL>
- <DD><DL>
- </DL>
- </DD>
- </DL>
- <HR>
-
- <A NAME="sumOfSquares(java.util.List)"><!-- --></A><H3>
- sumOfSquares</H3>
- <PRE>
- public static <T extends java.lang.Number> double <B>sumOfSquares</B>(java.util.List<T> list)</PRE>
- <DL>
- <DD><DL>
- </DL>
- </DD>
- </DL>
- <HR>
-
- <A NAME="ntimes(java.lang.String, int)"><!-- --></A><H3>
- ntimes</H3>
- <PRE>
- public static java.lang.String <B>ntimes</B>(java.lang.String s,
- int n)</PRE>
- <DL>
- <DD><DL>
- </DL>
- </DD>
- </DL>
- <HR>
-
- <A NAME="checkForNanOrInfinity(double)"><!-- --></A><H3>
- checkForNanOrInfinity</H3>
- <PRE>
- public static void <B>checkForNanOrInfinity</B>(double d)</PRE>
- <DL>
- <DD><DL>
- </DL>
- </DD>
- </DL>
- <HR>
-
- <A NAME="randomNumberBetween(int, int)"><!-- --></A><H3>
- randomNumberBetween</H3>
- <PRE>
- public static int <B>randomNumberBetween</B>(int i,
- int j)</PRE>
- <DL>
- <DD><DL>
- </DL>
- </DD>
- </DL>
- <HR>
-
- <A NAME="calculateMean(java.util.List)"><!-- --></A><H3>
- calculateMean</H3>
- <PRE>
- public static double <B>calculateMean</B>(java.util.List<java.lang.Double> lst)</PRE>
- <DL>
- <DD><DL>
- </DL>
- </DD>
- </DL>
- <HR>
-
- <A NAME="calculateStDev(java.util.List, double)"><!-- --></A><H3>
- calculateStDev</H3>
- <PRE>
- public static double <B>calculateStDev</B>(java.util.List<java.lang.Double> values,
- double mean)</PRE>
- <DL>
- <DD><DL>
- </DL>
- </DD>
- </DL>
- <HR>
-
- <A NAME="normalizeFromMeanAndStdev(java.util.List, double, double)"><!-- --></A><H3>
- normalizeFromMeanAndStdev</H3>
- <PRE>
- public static java.util.List<java.lang.Double> <B>normalizeFromMeanAndStdev</B>(java.util.List<java.lang.Double> values,
- double mean,
- double stdev)</PRE>
- <DL>
- <DD><DL>
- </DL>
- </DD>
- </DL>
- <HR>
-
- <A NAME="generateRandomDoubleBetween(double, double)"><!-- --></A><H3>
- generateRandomDoubleBetween</H3>
- <PRE>
- public static double <B>generateRandomDoubleBetween</B>(double lowerLimit,
- double upperLimit)</PRE>
- <DL>
- <DD><DL>
- </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> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
- <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
- </TR>
- </TABLE>
- </TD>
- <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
- </EM>
- </TD>
- </TR>
-
- <TR>
- <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
- <A HREF="../../../aima/core/util/SetOps.html" title="class in aima.core.util"><B>PREV CLASS</B></A>
- NEXT CLASS</FONT></TD>
- <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
- <A HREF="../../../index.html?aima/core/util/Util.html" target="_top"><B>FRAMES</B></A>
- <A HREF="Util.html" target="_top"><B>NO FRAMES</B></A>
- <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: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
- <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
- DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
- </TR>
- </TABLE>
- <A NAME="skip-navbar_bottom"></A>
- <!-- ======== END OF BOTTOM NAVBAR ======= -->
-
- <HR>
-
- </BODY>
- </HTML>