Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

sosc::Utils Class Reference

List of all members.

Static Public Methods

int[] toDigits (final String val)
int add (final int val)
int[] toDigits (final int val)

Detailed Description

The purpose of the Utils class is to encapsulate general purpose methods that will be useful in various situations.

Author:
Brad Johnson, Set E, ID# A00253700

Definition at line 10 of file Utils.java.


Member Function Documentation

int sosc::Utils::add final int    val [inline, static]
 

This add method does not return the sum of two numbers (ie 2 + 2 = 4) in the traditional sense. Instead it sums the digits in a single number and returns that result. If the result is greater than or equal to 10 the digits are sumed again and again until the addition results in a number less than 10. For example, if you pass add the number 51 the return value will be 6, (5 + 1 = 6). However, if you pass in the number 55 the return value will be 1, (5 + 5 = 10, 1 + 0 = 1).

Parameters:
<final  int val> <pass in an integer value>
Returns:
<int>

Definition at line 44 of file Utils.java.

int [] sosc::Utils::toDigits final int    val [inline, static]
 

Definition at line 59 of file Utils.java.

References sosc::Utils::toDigits().

int [] sosc::Utils::toDigits final String    val [inline, static]
 

The toDigits method is used to convert a String into an array of integers.

Parameters:
<final  String val> <pass in a String value>
Returns:
<int[]>

Definition at line 19 of file Utils.java.

Referenced by sosc::Utils::toDigits().


The documentation for this class was generated from the following file:
Generated on Mon Jul 14 17:19:22 2003 for SOSC by doxygen1.2.15