OpMath

com.opmath.util.datastruct
Class ComparableArrayRO

java.lang.Object
  |
  +--com.opmath.util.datastruct.ComparableArray
        |
        +--com.opmath.util.datastruct.ComparableArrayRO
All Implemented Interfaces:
ComparableList

public class ComparableArrayRO
extends ComparableArray
implements ComparableList

An object which can serve as a ComparableTable column, implemented using a Comparable[].

ComparableArrayRO implements the ComparableList interface, thus it provides a storage structure for columns of a ComparableTable with exactly the access methods required by the containing class.

ComparableArrayRO is used to store data that will not change after the column has been created. There are two motivations for this class:

Copyright: (c) 2002 The Open Math Company Limited

The Terms of Distribution of this software are stipulated in the javadoc Overview for this project.

Since:
J2SE 1.3
Version:
utilities-v011
Author:
Bruno Beloff bruno.beloff@opmath.com

Fields inherited from class com.opmath.util.datastruct.ComparableArray
a
 
Constructor Summary
ComparableArrayRO(Comparable[] src)
          Constructs a ComparableArrayRO.
 
Method Summary
 void clear()
          Does nothing.
 Comparable set(int index, Comparable element)
          Always thows an UnsupportedOperationException.
 
Methods inherited from class com.opmath.util.datastruct.ComparableArray
add, elements, get, indexOf, size, toString
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.opmath.util.datastruct.ComparableList
add, elements, get, indexOf, size, toString
 

Constructor Detail

ComparableArrayRO

public ComparableArrayRO(Comparable[] src)
Constructs a ComparableArrayRO. The data for the new instance is a System.arraycopy(..) of the given Compararble[].

Parameters:
src - a Compararble[] used to populate the ComparableArrayRO.
Since:
J2SE 1.3
Method Detail

clear

public void clear()
Does nothing.

Specified by:
clear in interface ComparableList
Overrides:
clear in class ComparableArray
Since:
J2SE 1.3

set

public Comparable set(int index,
                      Comparable element)
               throws UnsupportedOperationException
Always thows an UnsupportedOperationException.

NOTE: Although it is declared as returning a Comparable, set(int, Comparable) never returns anything.

Specified by:
set in interface ComparableList
Overrides:
set in class ComparableArray
Parameters:
index - the int index of element to replace.
element - the Comparable element to be stored at the specified position.
Throws:
UnsupportedOperationException - always.
Since:
J2SE 1.3

OpMath

Submit a bug or feature to Open Math
Copyright © 2002 Open Math Company Limited, Brighton, UK