1 package com.quantum.model;
3 import java.util.ArrayList;
4 import java.util.Collections;
10 /*package*/ class IndexImpl implements Index {
13 private List columnNames = Collections.synchronizedList(new ArrayList());
14 private Entity entity;
15 private List ascending = Collections.synchronizedList(new ArrayList());
17 IndexImpl(Entity entity, String name) {
23 void addColumn(String columnName, Boolean ascending) {
24 this.columnNames.add(columnName);
25 this.ascending.add(ascending);
28 public String getName() {
33 * @see com.quantum.model.Index#getNumberOfColumns()
35 public int getNumberOfColumns() {
36 return this.columnNames.size();
40 * @see com.quantum.model.Index#getColumnName(int)
42 public String getColumnName(int ordinalPosition) {
43 return (String) this.columnNames.get(ordinalPosition);
47 * @see com.quantum.model.Index#getParentEntity()
49 public Entity getParentEntity() {
54 * @see com.quantum.model.Index#isAscending()
56 public boolean isAscending(int ordinalPosition) {
57 Boolean ascending = (Boolean) this.ascending.get(ordinalPosition);
58 return Boolean.TRUE.equals(ascending);
62 * @see com.quantum.model.Index#isDescending()
64 public boolean isDescending(int ordinalPosition) {
65 Boolean ascending = (Boolean) this.ascending.get(ordinalPosition);
66 return Boolean.FALSE.equals(ascending);