ru.novosoft.dc.core.util
Class Values

java.lang.Object
  |
  +--ru.novosoft.dc.core.util.Values
Direct Known Subclasses:
CellSpacing, CharacterSpacing, Indentation, Layout, Padding

public class Values
extends java.lang.Object
implements java.lang.Cloneable

The class contains an array of values of the int type. The array length is specifed while constructing. Four primitive operations, namely set, get, add, and mul, are provided. The class allows the deep copy and deep compare operations.


Constructor Summary
Values(int size)
          Construct an array of values of the specified size.
Values(int[] parameters)
          Construct an object as a wrapper of the specified array of values.
 
Method Summary
 int add(int index, int value)
          Add to the value of the specified index and return the result.
 java.lang.Object clone()
          Create a deep copy of this object.
 boolean equals(java.lang.Object obj)
          Compare this object with another vector of values and return true if they coinside.
 int get(int index)
          Return the value of the specified index.
 int mul(int index, int value)
          Multiply the value of the specified index and return the result.
 int set(int index, int value)
          Set a value of the specified index and return it.
 int size()
          Return a length of the array.
 int[] values()
          Return the array of values wrapped by this object.
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Values

public Values(int size)
Construct an array of values of the specified size.

Values

public Values(int[] parameters)
Construct an object as a wrapper of the specified array of values.
Method Detail

size

public final int size()
Return a length of the array.

values

public final int[] values()
Return the array of values wrapped by this object.

get

public final int get(int index)
Return the value of the specified index.

set

public final int set(int index,
                     int value)
Set a value of the specified index and return it.

add

public final int add(int index,
                     int value)
Add to the value of the specified index and return the result.

mul

public final int mul(int index,
                     int value)
Multiply the value of the specified index and return the result.

clone

public java.lang.Object clone()
Create a deep copy of this object.
Overrides:
clone in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Compare this object with another vector of values and return true if they coinside.
Overrides:
equals in class java.lang.Object