TPTP 4.3.0 Testing Tools Project
Public API Specification

org.eclipse.hyades.test.core.util
Class CoreUtil

java.lang.Object
  extended byorg.eclipse.hyades.test.core.util.CoreUtil

public class CoreUtil
extends java.lang.Object

Contains non UI utility methods.

Since:
0.0.1

Constructor Summary
CoreUtil()
           
 
Method Summary
static int fromBynaryString(java.lang.String bits)
          Returns the integer value for the bits passed as a String.
static void moveDown(java.util.List owner, java.util.List elements)
          Changes the owner list by moving all the specified elements down.
static void moveUp(java.util.List owner, java.util.List elements)
          Changes the owner list by moving all the specified elements up.
static int removeBitFlag(int value, int flag)
          Removes the bit flag from the integer value returning the new value.
static void swap(java.util.List list, int index1, int index2)
          This method swaps two elements in a list identified by their indexes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CoreUtil

public CoreUtil()
Method Detail

removeBitFlag

public static int removeBitFlag(int value,
                                int flag)
Removes the bit flag from the integer value returning the new value.

Parameters:
value -
flag -
Returns:
int

fromBynaryString

public static int fromBynaryString(java.lang.String bits)
Returns the integer value for the bits passed as a String. Example: 5 = fromBynaryString("101") and 10 = fromBynaryString("1010");

Any character different than 1 is considered 0.

Parameters:
bits -
Returns:
int

moveUp

public static void moveUp(java.util.List owner,
                          java.util.List elements)
Changes the owner list by moving all the specified elements up. If one element is at the top, it is not moved.

Parameters:
owner -
elements -

moveDown

public static void moveDown(java.util.List owner,
                            java.util.List elements)
Changes the owner list by moving all the specified elements down. If one element is at the botton, it is not moved.

Parameters:
owner -
elements -

swap

public static void swap(java.util.List list,
                        int index1,
                        int index2)
This method swaps two elements in a list identified by their indexes. The elements are remvoed from the list and them reinserted which is save when manipulating unique lists.

Parameters:
list -
index1 -
index2 -

TPTP 4.3.0 Testing Tools Project
Public API Specification