UC Berkeley Group for User Interface Research
Updated November 17, 2000

edu.berkeley.guir.lib.util
Class VectorLib

java.lang.Object
  |
  +--edu.berkeley.guir.lib.util.VectorLib

public final class VectorLib
extends Object

Utilities for modifying and manipulating Vectors.

This software is distributed under the Berkeley Software License.

 Revisions:  - GUIRLib-v1.0-1.0.0, Mar 29 1999, JH
               Created class
             - GUIRLib-v1.2-1.0.0, Jun 22 2000, JH
               Touched for GUIRLib release
             - GUIRLib-v1.3-1.0.0, Aug 11 2000, JH
               Touched for GUIRLib release
             - GUIRLib-v1.4-1.0.0, Aug 31 2000, JH
               Touched for GUIRLib release
 

Since:
JDK 1.2
Version:
GUIRLib-v1.4-1.0.0, Aug 31 2000
Author:
Jason Hong ( jasonh@cs.berkeley.edu )

Method Summary
static void main(String[] argv)
           
static void moveTo(Vector vec, int xx, int yy)
          Move an item in a Vector from one position to another.
static void moveToBack(Vector vec, int xx)
          Move the item at the specified position to the back of the Vector.
static void moveToFront(Vector vec, int xx)
          Move the item at the specified position to the front of the Vector.
static void swap(Vector vec, int xx, int yy)
          Swap two elements in a Vector given positions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

swap

public static void swap(Vector vec,
                        int xx,
                        int yy)
Swap two elements in a Vector given positions. Handles boundary conditions by not doing anything if out of bounds.
Parameters:
vec - is the Vector to use.
xx - is the index of one of the items to swap. It is zero-based.
yy - is the index of one of the items to swap. It is zero-based.

moveTo

public static void moveTo(Vector vec,
                          int xx,
                          int yy)
Move an item in a Vector from one position to another. Items are shifted over to the left as needed. Handles boundary conditions by not doing anything if out of bounds.
Parameters:
vec - is the Vector to use.
xx - is the index of the item to move from. It is zero-based.
yy - is the index of the position to move to. It is zero-based.

moveToFront

public static void moveToFront(Vector vec,
                               int xx)
Move the item at the specified position to the front of the Vector.
Parameters:
vec - is the Vector to use.
xx - is the index of the item to move to the front. It is zero-based.

moveToBack

public static void moveToBack(Vector vec,
                              int xx)
Move the item at the specified position to the back of the Vector.
Parameters:
vec - is the Vector to use.
xx - is the index of the item to move to the back. It is zero-based.

main

public static void main(String[] argv)

Copyright Information