Source code of MARS Assembler
First commit of the 4.5 version (latest version available)
This commit is contained in:
@@ -0,0 +1,916 @@
|
||||
<!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_33) on Tue Aug 20 12:20:30 EDT 2013 -->
|
||||
<TITLE>
|
||||
Binary
|
||||
</TITLE>
|
||||
|
||||
<META NAME="date" CONTENT="2013-08-20">
|
||||
|
||||
<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="Binary";
|
||||
}
|
||||
}
|
||||
</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">
|
||||
PREV CLASS
|
||||
<A HREF="../../mars/util/EditorFont.html" title="class in mars.util"><B>NEXT CLASS</B></A></FONT></TD>
|
||||
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||||
<A HREF="../../index.html?mars/util/Binary.html" target="_top"><B>FRAMES</B></A>
|
||||
<A HREF="Binary.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 | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
|
||||
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
|
||||
DETAIL: FIELD | <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">
|
||||
mars.util</FONT>
|
||||
<BR>
|
||||
Class Binary</H2>
|
||||
<PRE>
|
||||
<A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A>
|
||||
<IMG SRC="../../resources/inherit.gif" ALT="extended by "><B>mars.util.Binary</B>
|
||||
</PRE>
|
||||
<HR>
|
||||
<DL>
|
||||
<DT><PRE>public class <B>Binary</B><DT>extends <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></DL>
|
||||
</PRE>
|
||||
|
||||
<P>
|
||||
Some utility methods for working with binary representations.
|
||||
<P>
|
||||
|
||||
<P>
|
||||
<DL>
|
||||
<DT><B>Author:</B></DT>
|
||||
<DD>Pete Sanderson, Ken Vollmar, and Jason Bumgarner</DD>
|
||||
</DL>
|
||||
<HR>
|
||||
|
||||
<P>
|
||||
|
||||
<!-- ======== 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="../../mars/util/Binary.html#Binary()">Binary</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 char</CODE></FONT></TD>
|
||||
<TD><CODE><B><A HREF="../../mars/util/Binary.html#binaryStringToHexDigit(java.lang.String)">binaryStringToHexDigit</A></B>(<A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> value)</CODE>
|
||||
|
||||
<BR>
|
||||
Translate String consisting of '1's and '0's into char equivalent of the corresponding
|
||||
hexadecimal digit.</TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||||
<CODE>static <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
|
||||
<TD><CODE><B><A HREF="../../mars/util/Binary.html#binaryStringToHexString(java.lang.String)">binaryStringToHexString</A></B>(<A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> value)</CODE>
|
||||
|
||||
<BR>
|
||||
Translate String consisting of '1's and '0's into String equivalent of the corresponding
|
||||
hexadecimal value.</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="../../mars/util/Binary.html#binaryStringToInt(java.lang.String)">binaryStringToInt</A></B>(<A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> value)</CODE>
|
||||
|
||||
<BR>
|
||||
Translate String consisting of '1's and '0's into an int value having that binary representation.</TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||||
<CODE>static long</CODE></FONT></TD>
|
||||
<TD><CODE><B><A HREF="../../mars/util/Binary.html#binaryStringToLong(java.lang.String)">binaryStringToLong</A></B>(<A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> value)</CODE>
|
||||
|
||||
<BR>
|
||||
Translate String consisting of '1's and '0's into a long value having that binary representation.</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="../../mars/util/Binary.html#bitValue(int, int)">bitValue</A></B>(int value,
|
||||
int bit)</CODE>
|
||||
|
||||
<BR>
|
||||
Returns the bit value of the given bit position of the given int value.</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="../../mars/util/Binary.html#bitValue(long, int)">bitValue</A></B>(long value,
|
||||
int bit)</CODE>
|
||||
|
||||
<BR>
|
||||
Returns the bit value of the given bit position of the given long value.</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="../../mars/util/Binary.html#clearBit(int, int)">clearBit</A></B>(int value,
|
||||
int bit)</CODE>
|
||||
|
||||
<BR>
|
||||
Sets the specified bit of the specified value to 0, and returns the result.</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="../../mars/util/Binary.html#getByte(int, int)">getByte</A></B>(int value,
|
||||
int bite)</CODE>
|
||||
|
||||
<BR>
|
||||
Gets the specified byte of the specified value.</TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||||
<CODE>static <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
|
||||
<TD><CODE><B><A HREF="../../mars/util/Binary.html#hexStringToBinaryString(java.lang.String)">hexStringToBinaryString</A></B>(<A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> value)</CODE>
|
||||
|
||||
<BR>
|
||||
Translate String consisting of hexadecimal digits into String consisting of
|
||||
corresponding binary digits ('1's and '0's).</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="../../mars/util/Binary.html#highOrderLongToInt(long)">highOrderLongToInt</A></B>(long longValue)</CODE>
|
||||
|
||||
<BR>
|
||||
Returns int representing the bit values of the high order 32 bits of given
|
||||
64 bit long value.</TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||||
<CODE>static <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
|
||||
<TD><CODE><B><A HREF="../../mars/util/Binary.html#intToAscii(int)">intToAscii</A></B>(int d)</CODE>
|
||||
|
||||
<BR>
|
||||
Produce ASCII string equivalent of integer value, interpreting it as 4 one-byte
|
||||
characters.</TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||||
<CODE>static <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
|
||||
<TD><CODE><B><A HREF="../../mars/util/Binary.html#intToBinaryString(int)">intToBinaryString</A></B>(int value)</CODE>
|
||||
|
||||
<BR>
|
||||
Translate int value into a String consisting of '1's and '0's.</TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||||
<CODE>static <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
|
||||
<TD><CODE><B><A HREF="../../mars/util/Binary.html#intToBinaryString(int, int)">intToBinaryString</A></B>(int value,
|
||||
int length)</CODE>
|
||||
|
||||
<BR>
|
||||
Translate int value into a String consisting of '1's and '0's.</TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||||
<CODE>static <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
|
||||
<TD><CODE><B><A HREF="../../mars/util/Binary.html#intToHalfHexString(int)">intToHalfHexString</A></B>(int d)</CODE>
|
||||
|
||||
<BR>
|
||||
Returns a 6 character string representing the 16-bit hexadecimal equivalent of the
|
||||
given integer value.</TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||||
<CODE>static <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
|
||||
<TD><CODE><B><A HREF="../../mars/util/Binary.html#intToHexString(int)">intToHexString</A></B>(int d)</CODE>
|
||||
|
||||
<BR>
|
||||
Prefix a hexadecimal-indicating string "0x" to the string which is
|
||||
returned by the method "Integer.toHexString".</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="../../mars/util/Binary.html#isHex(java.lang.String)">isHex</A></B>(<A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> v)</CODE>
|
||||
|
||||
<BR>
|
||||
Parsing method to see if a string represents a hex number.</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="../../mars/util/Binary.html#isOctal(java.lang.String)">isOctal</A></B>(<A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> v)</CODE>
|
||||
|
||||
<BR>
|
||||
Parsing method to see if a string represents an octal number.</TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||||
<CODE>static <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
|
||||
<TD><CODE><B><A HREF="../../mars/util/Binary.html#longToBinaryString(long)">longToBinaryString</A></B>(long value)</CODE>
|
||||
|
||||
<BR>
|
||||
Translate long value into a String consisting of '1's and '0's.</TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||||
<CODE>static <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
|
||||
<TD><CODE><B><A HREF="../../mars/util/Binary.html#longToBinaryString(long, int)">longToBinaryString</A></B>(long value,
|
||||
int length)</CODE>
|
||||
|
||||
<BR>
|
||||
Translate long value into a String consisting of '1's and '0's.</TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||||
<CODE>static <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
|
||||
<TD><CODE><B><A HREF="../../mars/util/Binary.html#longToHexString(long)">longToHexString</A></B>(long value)</CODE>
|
||||
|
||||
<BR>
|
||||
Prefix a hexadecimal-indicating string "0x" to the string equivalent to the
|
||||
hexadecimal value in the long parameter.</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="../../mars/util/Binary.html#lowOrderLongToInt(long)">lowOrderLongToInt</A></B>(long longValue)</CODE>
|
||||
|
||||
<BR>
|
||||
Returns int representing the bit values of the low order 32 bits of given
|
||||
64 bit long value.</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="../../mars/util/Binary.html#setBit(int, int)">setBit</A></B>(int value,
|
||||
int bit)</CODE>
|
||||
|
||||
<BR>
|
||||
Sets the specified bit of the specified value to 1, and returns the result.</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="../../mars/util/Binary.html#setByte(int, int, int)">setByte</A></B>(int value,
|
||||
int bite,
|
||||
int replace)</CODE>
|
||||
|
||||
<BR>
|
||||
Sets the specified byte of the specified value to the low order 8 bits of
|
||||
specified replacement value, and returns the result.</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="../../mars/util/Binary.html#stringToInt(java.lang.String)">stringToInt</A></B>(<A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> s)</CODE>
|
||||
|
||||
<BR>
|
||||
Attempt to validate given string whose characters represent a 32 bit integer.</TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||||
<CODE>static long</CODE></FONT></TD>
|
||||
<TD><CODE><B><A HREF="../../mars/util/Binary.html#stringToLong(java.lang.String)">stringToLong</A></B>(<A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> s)</CODE>
|
||||
|
||||
<BR>
|
||||
Attempt to validate given string whose characters represent a 64 bit long.</TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||||
<CODE>static long</CODE></FONT></TD>
|
||||
<TD><CODE><B><A HREF="../../mars/util/Binary.html#twoIntsToLong(int, int)">twoIntsToLong</A></B>(int highOrder,
|
||||
int lowOrder)</CODE>
|
||||
|
||||
<BR>
|
||||
Returns long (64 bit integer) combining the bit values of two given 32 bit
|
||||
integer values.</TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||||
<CODE>static <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
|
||||
<TD><CODE><B><A HREF="../../mars/util/Binary.html#unsignedIntToIntString(int)">unsignedIntToIntString</A></B>(int d)</CODE>
|
||||
|
||||
<BR>
|
||||
Produce String equivalent of integer value interpreting it as an unsigned integer.</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.<A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<TD><CODE><A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
<P>
|
||||
|
||||
<!-- ========= 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="Binary()"><!-- --></A><H3>
|
||||
Binary</H3>
|
||||
<PRE>
|
||||
public <B>Binary</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="intToBinaryString(int, int)"><!-- --></A><H3>
|
||||
intToBinaryString</H3>
|
||||
<PRE>
|
||||
public static <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>intToBinaryString</B>(int value,
|
||||
int length)</PRE>
|
||||
<DL>
|
||||
<DD>Translate int value into a String consisting of '1's and '0's.
|
||||
<P>
|
||||
<DD><DL>
|
||||
<DT><B>Parameters:</B><DD><CODE>value</CODE> - The int value to convert.<DD><CODE>length</CODE> - The number of bit positions, starting at least significant, to process.
|
||||
<DT><B>Returns:</B><DD>String consisting of '1' and '0' characters corresponding to the requested binary sequence.</DL>
|
||||
</DD>
|
||||
</DL>
|
||||
<HR>
|
||||
|
||||
<A NAME="intToBinaryString(int)"><!-- --></A><H3>
|
||||
intToBinaryString</H3>
|
||||
<PRE>
|
||||
public static <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>intToBinaryString</B>(int value)</PRE>
|
||||
<DL>
|
||||
<DD>Translate int value into a String consisting of '1's and '0's. Assumes all 32 bits are
|
||||
to be translated.
|
||||
<P>
|
||||
<DD><DL>
|
||||
<DT><B>Parameters:</B><DD><CODE>value</CODE> - The int value to convert.
|
||||
<DT><B>Returns:</B><DD>String consisting of '1' and '0' characters corresponding to the requested binary sequence.</DL>
|
||||
</DD>
|
||||
</DL>
|
||||
<HR>
|
||||
|
||||
<A NAME="longToBinaryString(long, int)"><!-- --></A><H3>
|
||||
longToBinaryString</H3>
|
||||
<PRE>
|
||||
public static <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>longToBinaryString</B>(long value,
|
||||
int length)</PRE>
|
||||
<DL>
|
||||
<DD>Translate long value into a String consisting of '1's and '0's.
|
||||
<P>
|
||||
<DD><DL>
|
||||
<DT><B>Parameters:</B><DD><CODE>value</CODE> - The long value to convert.<DD><CODE>length</CODE> - The number of bit positions, starting at least significant, to process.
|
||||
<DT><B>Returns:</B><DD>String consisting of '1' and '0' characters corresponding to the requested binary sequence.</DL>
|
||||
</DD>
|
||||
</DL>
|
||||
<HR>
|
||||
|
||||
<A NAME="longToBinaryString(long)"><!-- --></A><H3>
|
||||
longToBinaryString</H3>
|
||||
<PRE>
|
||||
public static <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>longToBinaryString</B>(long value)</PRE>
|
||||
<DL>
|
||||
<DD>Translate long value into a String consisting of '1's and '0's. Assumes all 64 bits are
|
||||
to be translated.
|
||||
<P>
|
||||
<DD><DL>
|
||||
<DT><B>Parameters:</B><DD><CODE>value</CODE> - The long value to convert.
|
||||
<DT><B>Returns:</B><DD>String consisting of '1' and '0' characters corresponding to the requested binary sequence.</DL>
|
||||
</DD>
|
||||
</DL>
|
||||
<HR>
|
||||
|
||||
<A NAME="binaryStringToInt(java.lang.String)"><!-- --></A><H3>
|
||||
binaryStringToInt</H3>
|
||||
<PRE>
|
||||
public static int <B>binaryStringToInt</B>(<A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> value)</PRE>
|
||||
<DL>
|
||||
<DD>Translate String consisting of '1's and '0's into an int value having that binary representation.
|
||||
The String is assumed to be at most 32 characters long. No error checking is performed.
|
||||
String position 0 has most-significant bit, position length-1 has least-significant.
|
||||
<P>
|
||||
<DD><DL>
|
||||
<DT><B>Parameters:</B><DD><CODE>value</CODE> - The String value to convert.
|
||||
<DT><B>Returns:</B><DD>int whose binary value corresponds to decoded String.</DL>
|
||||
</DD>
|
||||
</DL>
|
||||
<HR>
|
||||
|
||||
<A NAME="binaryStringToLong(java.lang.String)"><!-- --></A><H3>
|
||||
binaryStringToLong</H3>
|
||||
<PRE>
|
||||
public static long <B>binaryStringToLong</B>(<A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> value)</PRE>
|
||||
<DL>
|
||||
<DD>Translate String consisting of '1's and '0's into a long value having that binary representation.
|
||||
The String is assumed to be at most 64 characters long. No error checking is performed.
|
||||
String position 0 has most-significant bit, position length-1 has least-significant.
|
||||
<P>
|
||||
<DD><DL>
|
||||
<DT><B>Parameters:</B><DD><CODE>value</CODE> - The String value to convert.
|
||||
<DT><B>Returns:</B><DD>long whose binary value corresponds to decoded String.</DL>
|
||||
</DD>
|
||||
</DL>
|
||||
<HR>
|
||||
|
||||
<A NAME="binaryStringToHexString(java.lang.String)"><!-- --></A><H3>
|
||||
binaryStringToHexString</H3>
|
||||
<PRE>
|
||||
public static <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>binaryStringToHexString</B>(<A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> value)</PRE>
|
||||
<DL>
|
||||
<DD>Translate String consisting of '1's and '0's into String equivalent of the corresponding
|
||||
hexadecimal value. No length limit.
|
||||
String position 0 has most-significant bit, position length-1 has least-significant.
|
||||
<P>
|
||||
<DD><DL>
|
||||
<DT><B>Parameters:</B><DD><CODE>value</CODE> - The String value to convert.
|
||||
<DT><B>Returns:</B><DD>String containing '0', '1', ...'F' characters which form hexadecimal
|
||||
equivalent of decoded String.</DL>
|
||||
</DD>
|
||||
</DL>
|
||||
<HR>
|
||||
|
||||
<A NAME="hexStringToBinaryString(java.lang.String)"><!-- --></A><H3>
|
||||
hexStringToBinaryString</H3>
|
||||
<PRE>
|
||||
public static <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>hexStringToBinaryString</B>(<A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> value)</PRE>
|
||||
<DL>
|
||||
<DD>Translate String consisting of hexadecimal digits into String consisting of
|
||||
corresponding binary digits ('1's and '0's). No length limit.
|
||||
String position 0 will have most-significant bit, position length-1 has least-significant.
|
||||
<P>
|
||||
<DD><DL>
|
||||
<DT><B>Parameters:</B><DD><CODE>value</CODE> - String containing '0', '1', ...'f'
|
||||
characters which form hexadecimal. Letters may be either upper or lower case.
|
||||
Works either with or without leading "Ox".
|
||||
<DT><B>Returns:</B><DD>String with equivalent value in binary.</DL>
|
||||
</DD>
|
||||
</DL>
|
||||
<HR>
|
||||
|
||||
<A NAME="binaryStringToHexDigit(java.lang.String)"><!-- --></A><H3>
|
||||
binaryStringToHexDigit</H3>
|
||||
<PRE>
|
||||
public static char <B>binaryStringToHexDigit</B>(<A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> value)</PRE>
|
||||
<DL>
|
||||
<DD>Translate String consisting of '1's and '0's into char equivalent of the corresponding
|
||||
hexadecimal digit. String limited to length 4.
|
||||
String position 0 has most-significant bit, position length-1 has least-significant.
|
||||
<P>
|
||||
<DD><DL>
|
||||
<DT><B>Parameters:</B><DD><CODE>value</CODE> - The String value to convert.
|
||||
<DT><B>Returns:</B><DD>char '0', '1', ...'F' which form hexadecimal equivalent of decoded String.
|
||||
If string length > 4, returns '0'.</DL>
|
||||
</DD>
|
||||
</DL>
|
||||
<HR>
|
||||
|
||||
<A NAME="intToHexString(int)"><!-- --></A><H3>
|
||||
intToHexString</H3>
|
||||
<PRE>
|
||||
public static <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>intToHexString</B>(int d)</PRE>
|
||||
<DL>
|
||||
<DD>Prefix a hexadecimal-indicating string "0x" to the string which is
|
||||
returned by the method "Integer.toHexString". Prepend leading zeroes
|
||||
to that string as necessary to make it always eight hexadecimal digits.
|
||||
<P>
|
||||
<DD><DL>
|
||||
<DT><B>Parameters:</B><DD><CODE>d</CODE> - The int value to convert.
|
||||
<DT><B>Returns:</B><DD>String containing '0', '1', ...'F' which form hexadecimal equivalent of int.</DL>
|
||||
</DD>
|
||||
</DL>
|
||||
<HR>
|
||||
|
||||
<A NAME="intToHalfHexString(int)"><!-- --></A><H3>
|
||||
intToHalfHexString</H3>
|
||||
<PRE>
|
||||
public static <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>intToHalfHexString</B>(int d)</PRE>
|
||||
<DL>
|
||||
<DD>Returns a 6 character string representing the 16-bit hexadecimal equivalent of the
|
||||
given integer value. First two characters are "0x". It assumes value will "fit"
|
||||
in 16 bits. If non-negative, prepend leading zeroes to that string as necessary
|
||||
to make it always four hexadecimal digits. If negative, chop off the first
|
||||
four 'f' digits so result is always four hexadecimal digits
|
||||
<P>
|
||||
<DD><DL>
|
||||
<DT><B>Parameters:</B><DD><CODE>d</CODE> - The int value to convert.
|
||||
<DT><B>Returns:</B><DD>String containing '0', '1', ...'F' which form hexadecimal equivalent of int.</DL>
|
||||
</DD>
|
||||
</DL>
|
||||
<HR>
|
||||
|
||||
<A NAME="longToHexString(long)"><!-- --></A><H3>
|
||||
longToHexString</H3>
|
||||
<PRE>
|
||||
public static <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>longToHexString</B>(long value)</PRE>
|
||||
<DL>
|
||||
<DD>Prefix a hexadecimal-indicating string "0x" to the string equivalent to the
|
||||
hexadecimal value in the long parameter. Prepend leading zeroes
|
||||
to that string as necessary to make it always sixteen hexadecimal digits.
|
||||
<P>
|
||||
<DD><DL>
|
||||
<DT><B>Parameters:</B><DD><CODE>value</CODE> - The long value to convert.
|
||||
<DT><B>Returns:</B><DD>String containing '0', '1', ...'F' which form hexadecimal equivalent of long.</DL>
|
||||
</DD>
|
||||
</DL>
|
||||
<HR>
|
||||
|
||||
<A NAME="unsignedIntToIntString(int)"><!-- --></A><H3>
|
||||
unsignedIntToIntString</H3>
|
||||
<PRE>
|
||||
public static <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>unsignedIntToIntString</B>(int d)</PRE>
|
||||
<DL>
|
||||
<DD>Produce String equivalent of integer value interpreting it as an unsigned integer.
|
||||
For instance, -1 (0xffffffff) produces "4294967295" instead of "-1".
|
||||
<P>
|
||||
<DD><DL>
|
||||
<DT><B>Parameters:</B><DD><CODE>d</CODE> - The int value to interpret.
|
||||
<DT><B>Returns:</B><DD>String which forms unsigned 32 bit equivalent of int.</DL>
|
||||
</DD>
|
||||
</DL>
|
||||
<HR>
|
||||
|
||||
<A NAME="intToAscii(int)"><!-- --></A><H3>
|
||||
intToAscii</H3>
|
||||
<PRE>
|
||||
public static <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>intToAscii</B>(int d)</PRE>
|
||||
<DL>
|
||||
<DD>Produce ASCII string equivalent of integer value, interpreting it as 4 one-byte
|
||||
characters. If the value in a given byte does not correspond to a printable
|
||||
character, it will be assigned a default character (defined in config.properties)
|
||||
for a placeholder.
|
||||
<P>
|
||||
<DD><DL>
|
||||
<DT><B>Parameters:</B><DD><CODE>d</CODE> - The int value to interpret
|
||||
<DT><B>Returns:</B><DD>String that represents ASCII equivalent</DL>
|
||||
</DD>
|
||||
</DL>
|
||||
<HR>
|
||||
|
||||
<A NAME="stringToInt(java.lang.String)"><!-- --></A><H3>
|
||||
stringToInt</H3>
|
||||
<PRE>
|
||||
public static int <B>stringToInt</B>(<A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> s)
|
||||
throws <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/NumberFormatException.html?is-external=true" title="class or interface in java.lang">NumberFormatException</A></PRE>
|
||||
<DL>
|
||||
<DD>Attempt to validate given string whose characters represent a 32 bit integer.
|
||||
Integer.decode() is insufficient because it will not allow incorporation of
|
||||
hex two's complement (i.e. 0x80...0 through 0xff...f). Allows
|
||||
optional negative (-) sign but no embedded spaces.
|
||||
<P>
|
||||
<DD><DL>
|
||||
<DT><B>Parameters:</B><DD><CODE>s</CODE> - candidate string
|
||||
<DT><B>Returns:</B><DD>returns int value represented by given string
|
||||
<DT><B>Throws:</B>
|
||||
<DD><CODE><A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/NumberFormatException.html?is-external=true" title="class or interface in java.lang">NumberFormatException</A></CODE> - if string cannot be translated into an int</DL>
|
||||
</DD>
|
||||
</DL>
|
||||
<HR>
|
||||
|
||||
<A NAME="stringToLong(java.lang.String)"><!-- --></A><H3>
|
||||
stringToLong</H3>
|
||||
<PRE>
|
||||
public static long <B>stringToLong</B>(<A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> s)
|
||||
throws <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/NumberFormatException.html?is-external=true" title="class or interface in java.lang">NumberFormatException</A></PRE>
|
||||
<DL>
|
||||
<DD>Attempt to validate given string whose characters represent a 64 bit long.
|
||||
Long.decode() is insufficient because it will not allow incorporation of
|
||||
hex two's complement (i.e. 0x80...0 through 0xff...f). Allows
|
||||
optional negative (-) sign but no embedded spaces.
|
||||
<P>
|
||||
<DD><DL>
|
||||
<DT><B>Parameters:</B><DD><CODE>s</CODE> - candidate string
|
||||
<DT><B>Returns:</B><DD>returns long value represented by given string
|
||||
<DT><B>Throws:</B>
|
||||
<DD><CODE><A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/NumberFormatException.html?is-external=true" title="class or interface in java.lang">NumberFormatException</A></CODE> - if string cannot be translated into a long</DL>
|
||||
</DD>
|
||||
</DL>
|
||||
<HR>
|
||||
|
||||
<A NAME="highOrderLongToInt(long)"><!-- --></A><H3>
|
||||
highOrderLongToInt</H3>
|
||||
<PRE>
|
||||
public static int <B>highOrderLongToInt</B>(long longValue)</PRE>
|
||||
<DL>
|
||||
<DD>Returns int representing the bit values of the high order 32 bits of given
|
||||
64 bit long value.
|
||||
<P>
|
||||
<DD><DL>
|
||||
<DT><B>Parameters:</B><DD><CODE>longValue</CODE> - The long value from which to extract bits.
|
||||
<DT><B>Returns:</B><DD>int containing high order 32 bits of argument</DL>
|
||||
</DD>
|
||||
</DL>
|
||||
<HR>
|
||||
|
||||
<A NAME="lowOrderLongToInt(long)"><!-- --></A><H3>
|
||||
lowOrderLongToInt</H3>
|
||||
<PRE>
|
||||
public static int <B>lowOrderLongToInt</B>(long longValue)</PRE>
|
||||
<DL>
|
||||
<DD>Returns int representing the bit values of the low order 32 bits of given
|
||||
64 bit long value.
|
||||
<P>
|
||||
<DD><DL>
|
||||
<DT><B>Parameters:</B><DD><CODE>longValue</CODE> - The long value from which to extract bits.
|
||||
<DT><B>Returns:</B><DD>int containing low order 32 bits of argument</DL>
|
||||
</DD>
|
||||
</DL>
|
||||
<HR>
|
||||
|
||||
<A NAME="twoIntsToLong(int, int)"><!-- --></A><H3>
|
||||
twoIntsToLong</H3>
|
||||
<PRE>
|
||||
public static long <B>twoIntsToLong</B>(int highOrder,
|
||||
int lowOrder)</PRE>
|
||||
<DL>
|
||||
<DD>Returns long (64 bit integer) combining the bit values of two given 32 bit
|
||||
integer values.
|
||||
<P>
|
||||
<DD><DL>
|
||||
<DT><B>Parameters:</B><DD><CODE>highOrder</CODE> - Integer to form the high-order 32 bits of result.<DD><CODE>lowOrder</CODE> - Integer to form the high-order 32 bits of result.
|
||||
<DT><B>Returns:</B><DD>long containing concatenated 32 bit int values.</DL>
|
||||
</DD>
|
||||
</DL>
|
||||
<HR>
|
||||
|
||||
<A NAME="bitValue(int, int)"><!-- --></A><H3>
|
||||
bitValue</H3>
|
||||
<PRE>
|
||||
public static int <B>bitValue</B>(int value,
|
||||
int bit)</PRE>
|
||||
<DL>
|
||||
<DD>Returns the bit value of the given bit position of the given int value.
|
||||
<P>
|
||||
<DD><DL>
|
||||
<DT><B>Parameters:</B><DD><CODE>value</CODE> - The value to read the bit from.<DD><CODE>bit</CODE> - bit position in range 0 (least significant) to 31 (most)
|
||||
<DT><B>Returns:</B><DD>0 if the bit position contains 0, and 1 otherwise.</DL>
|
||||
</DD>
|
||||
</DL>
|
||||
<HR>
|
||||
|
||||
<A NAME="bitValue(long, int)"><!-- --></A><H3>
|
||||
bitValue</H3>
|
||||
<PRE>
|
||||
public static int <B>bitValue</B>(long value,
|
||||
int bit)</PRE>
|
||||
<DL>
|
||||
<DD>Returns the bit value of the given bit position of the given long value.
|
||||
<P>
|
||||
<DD><DL>
|
||||
<DT><B>Parameters:</B><DD><CODE>value</CODE> - The value to read the bit from.<DD><CODE>bit</CODE> - bit position in range 0 (least significant) to 63 (most)
|
||||
<DT><B>Returns:</B><DD>0 if the bit position contains 0, and 1 otherwise.</DL>
|
||||
</DD>
|
||||
</DL>
|
||||
<HR>
|
||||
|
||||
<A NAME="setBit(int, int)"><!-- --></A><H3>
|
||||
setBit</H3>
|
||||
<PRE>
|
||||
public static int <B>setBit</B>(int value,
|
||||
int bit)</PRE>
|
||||
<DL>
|
||||
<DD>Sets the specified bit of the specified value to 1, and returns the result.
|
||||
<P>
|
||||
<DD><DL>
|
||||
<DT><B>Parameters:</B><DD><CODE>value</CODE> - The value in which the bit is to be set.<DD><CODE>bit</CODE> - bit position in range 0 (least significant) to 31 (most)
|
||||
<DT><B>Returns:</B><DD>value possibly modified with given bit set to 1.</DL>
|
||||
</DD>
|
||||
</DL>
|
||||
<HR>
|
||||
|
||||
<A NAME="clearBit(int, int)"><!-- --></A><H3>
|
||||
clearBit</H3>
|
||||
<PRE>
|
||||
public static int <B>clearBit</B>(int value,
|
||||
int bit)</PRE>
|
||||
<DL>
|
||||
<DD>Sets the specified bit of the specified value to 0, and returns the result.
|
||||
<P>
|
||||
<DD><DL>
|
||||
<DT><B>Parameters:</B><DD><CODE>value</CODE> - The value in which the bit is to be set.<DD><CODE>bit</CODE> - bit position in range 0 (least significant) to 31 (most)
|
||||
<DT><B>Returns:</B><DD>value possibly modified with given bit set to 0.</DL>
|
||||
</DD>
|
||||
</DL>
|
||||
<HR>
|
||||
|
||||
<A NAME="setByte(int, int, int)"><!-- --></A><H3>
|
||||
setByte</H3>
|
||||
<PRE>
|
||||
public static int <B>setByte</B>(int value,
|
||||
int bite,
|
||||
int replace)</PRE>
|
||||
<DL>
|
||||
<DD>Sets the specified byte of the specified value to the low order 8 bits of
|
||||
specified replacement value, and returns the result.
|
||||
<P>
|
||||
<DD><DL>
|
||||
<DT><B>Parameters:</B><DD><CODE>value</CODE> - The value in which the byte is to be set.<DD><CODE>bite</CODE> - byte position in range 0 (least significant) to 3 (most)<DD><CODE>replace</CODE> - value to place into that byte position - use low order 8 bits
|
||||
<DT><B>Returns:</B><DD>value modified value.</DL>
|
||||
</DD>
|
||||
</DL>
|
||||
<HR>
|
||||
|
||||
<A NAME="getByte(int, int)"><!-- --></A><H3>
|
||||
getByte</H3>
|
||||
<PRE>
|
||||
public static int <B>getByte</B>(int value,
|
||||
int bite)</PRE>
|
||||
<DL>
|
||||
<DD>Gets the specified byte of the specified value.
|
||||
<P>
|
||||
<DD><DL>
|
||||
<DT><B>Parameters:</B><DD><CODE>value</CODE> - The value in which the byte is to be retrieved.<DD><CODE>bite</CODE> - byte position in range 0 (least significant) to 3 (most)
|
||||
<DT><B>Returns:</B><DD>zero-extended byte value in low order byte.</DL>
|
||||
</DD>
|
||||
</DL>
|
||||
<HR>
|
||||
|
||||
<A NAME="isHex(java.lang.String)"><!-- --></A><H3>
|
||||
isHex</H3>
|
||||
<PRE>
|
||||
public static boolean <B>isHex</B>(<A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> v)</PRE>
|
||||
<DL>
|
||||
<DD>Parsing method to see if a string represents a hex number.
|
||||
As per http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Integer.html#decode(java.lang.String),
|
||||
a string represents a hex number if the string is in the forms:
|
||||
Signopt 0x HexDigits
|
||||
Signopt 0X HexDigits
|
||||
Signopt # HexDigits <---- Disallow this form since # is MIPS comment
|
||||
<P>
|
||||
<DD><DL>
|
||||
<DT><B>Parameters:</B><DD><CODE>v</CODE> - String containing numeric digits (could be decimal, octal, or hex)
|
||||
<DT><B>Returns:</B><DD>Returns <tt>true</tt> if string represents a hex number, else returns <tt>false</tt>.</DL>
|
||||
</DD>
|
||||
</DL>
|
||||
<HR>
|
||||
|
||||
<A NAME="isOctal(java.lang.String)"><!-- --></A><H3>
|
||||
isOctal</H3>
|
||||
<PRE>
|
||||
public static boolean <B>isOctal</B>(<A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> v)</PRE>
|
||||
<DL>
|
||||
<DD>Parsing method to see if a string represents an octal number.
|
||||
As per http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Integer.html#decode(java.lang.String),
|
||||
a string represents an octal number if the string is in the forms:
|
||||
Signopt 0 OctalDigits
|
||||
<P>
|
||||
<DD><DL>
|
||||
<DT><B>Parameters:</B><DD><CODE>v</CODE> - String containing numeric digits (could be decimal, octal, or hex)
|
||||
<DT><B>Returns:</B><DD>Returns <tt>true</tt> if string represents an octal number, else returns <tt>false</tt>.</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">
|
||||
PREV CLASS
|
||||
<A HREF="../../mars/util/EditorFont.html" title="class in mars.util"><B>NEXT CLASS</B></A></FONT></TD>
|
||||
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||||
<A HREF="../../index.html?mars/util/Binary.html" target="_top"><B>FRAMES</B></A>
|
||||
<A HREF="Binary.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 | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
|
||||
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
|
||||
DETAIL: FIELD | <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>
|
||||
Reference in New Issue
Block a user