java.lang.Object Object120
abstract class Object120
Constructor Summary | |
---|---|
Object120(java.lang.Object... args)
Automated constructor: Initialize each field of the subclass with the provided args, in the order the fields are declared within the subclass' file. |
Method Summary | ||
---|---|---|
static char |
charAt(java.lang.String _this,
int i)
Select a single character from a string, by index (starting at 0). |
|
static int |
charToInt(char c)
Return the unicode value of a character. |
|
static java.lang.String |
charToString(char c)
Convert a char to a String-of-length-1. |
|
static
|
compareTo(java.lang.Comparable<T> _this,
S that)
Check whether one value is greater, equal, or lesser than another. |
|
static boolean |
contains(java.lang.String _this,
java.lang.CharSequence target)
Return whether or not one String contains another. |
|
static int |
doubleToInt(double x)
Convert a double to an int (truncating towards zero). |
|
boolean |
equals(java.lang.Object oth)
|
|
static boolean |
equals(java.lang.Object _this,
java.lang.Object that)
Are two values equal? Works on any values (non-null). |
|
static boolean |
equalsIgnoreCase(java.lang.String a,
java.lang.String b)
Are two Strings equal (up to case, but including punctuation). |
|
static java.lang.String |
getVersion()
Return the version number of this library (since it might get updated through the semester). |
|
int |
hashCode()
|
|
static int |
indexOf(java.lang.String _this,
java.lang.String target)
Return where one string is contained inside another. |
|
static char |
intToChar(int n)
Return character corresponding to a particular the unicode value. |
|
static double |
intToDouble(int n)
Convert an int to a double. |
|
static java.lang.String |
intToString(int n)
Convert an int to a String. |
|
static boolean |
isEmpty(java.lang.String _this)
Return whether or not a String is the empty string "" (0 letters long). |
|
static int |
length(java.lang.String _this)
Return the number of characters in a string. |
|
static void |
printVersion()
Print version information to the console window. |
|
static int |
randomInt(int n)
Return a random integer in [0,n). |
|
static char |
stringToChar(java.lang.String s)
Convert a String-of-length-1 to a char. |
|
static double |
stringToDouble(java.lang.String s)
Convert a String to a double. |
|
static int |
stringToInt(java.lang.String s)
Convert a String into an int. |
|
static java.lang.String |
substring(java.lang.String _this,
int from)
Return a substring of the given string from index `from` up through the last character. |
|
static java.lang.String |
substring(java.lang.String _this,
int from,
int to)
Return a substring of the given string, from index `from` up to but not including index `to`. |
|
static java.lang.String |
toLowerCase(java.lang.String _this)
Return a lower-case version of the given string. |
|
java.lang.String |
toString()
|
|
java.lang.String |
toString(boolean includeFieldNames)
Return a String which looks like a constructor call: |
|
static java.lang.String |
toString(java.lang.Object _this)
Convert any value into a String. |
|
static java.lang.String |
toUpperCase(java.lang.String _this)
Return an upper-case version of the given string. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Object120(java.lang.Object... args)
Method Detail |
---|
public static char charAt(java.lang.String _this, int i)
_this
- The `String` to select a character from. Cannot be null.i
- The index of the character to select from s; 0 <= i < length(s).
String.toLowerCase()
public static int charToInt(char c)
c
- The character to get the unicode value of.
http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters
public static java.lang.String charToString(char c)
c
- The char to convert.
Character.toString()
,
toString(Object)
public static <T,S extends T> int compareTo(java.lang.Comparable<T> _this, S that)
_this
- The first value to compare.that
- The second value to compare.
Comparable.compareTo(Object)
public static boolean contains(java.lang.String _this, java.lang.CharSequence target)
_this
- The `String` to look inside of. Cannot be null.target
- The String to look for in `_this`.
String.contains(CharSequence)
,
indexOf(String,String)
,
String.indexOf(String)
public static int doubleToInt(double x)
x
- The double to convert to an int.
doubleToInt(0.0) = 0 doubleToInt(3.1) = 3 doubleToInt(3.9) = 3 doubleToInt(-3.1) = -3.0 doubleToInt(-3.9) = -3.0
Double.intValue()
,
Math.floor(double)
,
Math.ceil(double)
,
Math.round(double)
public boolean equals(java.lang.Object oth)
equals
in class java.lang.Object
public static boolean equals(java.lang.Object _this, java.lang.Object that)
_this
- the first value to compare. (Must be non-null.)that
- the second value to compare. (Must be non-null.)
equals( "hello", "howdy" ) = false equals( "hello", "hello" ) = true equals( 23, 22+1 ) = true
Object.equals(Object)
public static boolean equalsIgnoreCase(java.lang.String a, java.lang.String b)
a
- The first string to compare. Cannot be null.b
- The second string to compare. Cannot be null.
equalsIgnoreCase( "hi", "HI" ) = true equalsIgnoreCase( "hi", "hi " ) = false equalsIgnoreCase( "", "" ) = true
String.equalsIgnoreCase(String)
public static java.lang.String getVersion()
public int hashCode()
hashCode
in class java.lang.Object
public static int indexOf(java.lang.String _this, java.lang.String target)
_this
- The `String` to look inside. Cannot be null.target
- The String to try to find occuring inside `_this`. Cannot be null.
String.indexOf(String)
public static char intToChar(int n)
n
- The unicode(ascii) value to convert to a char.
Must be valid as a short -- in [0,65536).
http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters
public static double intToDouble(int n)
n
- the int to convert.
intToDouble(0) = 0.0 intToDouble(-2) = -2.0 intToDouble(2000000000) = 2e9 intToDouble(2000000001) = 2.000000001e9
public static java.lang.String intToString(int n)
n
- The int to convert to a String.
intToString(0) = "0" intToString(-2) = "-2" intToString(34) = "34"
Integer.toString()
,
Integer.toString(int)
,
toString(Object)
public static boolean isEmpty(java.lang.String _this)
_this
- The String to compare to "". Cannot be null.
String.isEmpty()
public static int length(java.lang.String _this)
_this
- The string to find the length of. Cannot be null.
length( "hi ho" ) = 5 length( "z" ) = 1 length( "" ) = 0
String.length()
public static void printVersion()
public static int randomInt(int n)
n
- the top end of the range.
Random.nextInt(int)
public static char stringToChar(java.lang.String s)
s
- A string of length 1.
String.charAt(int)
public static double stringToDouble(java.lang.String s)
s
- A string which is a valid representation of a double.
stringToDouble("43.2") = 43.2 stringToDouble("2") = 2.0 stringToDouble("007") = 7.0
java.lang.NumberFormatException
- if `s` does not represent a valid double.
For example: stringToDouble("2+3") -> NumberFormatException
public static int stringToInt(java.lang.String s)
s
- A string which is a valid representation of an int; cannot be empty.
stringToDouble("2") = 2 stringToDouble("007") = 7
java.lang.NumberFormatException
- if `s` does not represent a valid double.
stringToDouble("2+3") throws NumberFormatExceptionpublic static java.lang.String substring(java.lang.String _this, int from)
_this
- The `String` to take a substring from. Cannot be null.start
- The index of the first character of the substring.
String.substring(int)
public static java.lang.String substring(java.lang.String _this, int from, int to)
_this
- The `String` to take a substring from. Cannot be null.start
- The index of the first character of the substring.stop
- The index of the first character after the substring.
String.substring(int,int)
public static java.lang.String toLowerCase(java.lang.String _this)
_this
- The `String` to take a substring from. Cannot be null.
String.toLowerCase()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toString(boolean includeFieldNames)
includeFieldNames
- If true, include the field names along with their values.
class Foo extends Object120 { int n; String s } new Foo(7,"hi").toString(false) = "new Foo( 7, \"hi\" )" new Foo(8,"ho").toString(true) = "new Foo( n=8, s=\"ho\" )"Bug: Depending on the Java compiler, the field names might not be given in the same order they are declared in the class. (This is because java.lang.reflect doesn't provide access to the declared order; however, many implementations happen to to use that order.)
public static java.lang.String toString(java.lang.Object _this)
_this
- The value to stringify. Cannot be null.
toString(43) = "43" toString(true) = "true"
Object.toString()
public static java.lang.String toUpperCase(java.lang.String _this)
_this
- The `String` to convert to upper case. Cannot be null.
String.toUpperCase()