From 195774c489a1a671aca514b0afa88332bf9c6ee3 Mon Sep 17 00:00:00 2001 From: lresende Date: Tue, 10 Nov 2009 19:20:12 +0000 Subject: Moving SDO tags git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@834617 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/com/example/simple/impl/QuoteImpl.java | 1045 ++++++++++++++++++++ 1 file changed, 1045 insertions(+) create mode 100644 sdo-java/tags/1.1.1-RC2a/impl/src/test/java/com/example/simple/impl/QuoteImpl.java (limited to 'sdo-java/tags/1.1.1-RC2a/impl/src/test/java/com/example/simple/impl/QuoteImpl.java') diff --git a/sdo-java/tags/1.1.1-RC2a/impl/src/test/java/com/example/simple/impl/QuoteImpl.java b/sdo-java/tags/1.1.1-RC2a/impl/src/test/java/com/example/simple/impl/QuoteImpl.java new file mode 100644 index 0000000000..39af3bbdb2 --- /dev/null +++ b/sdo-java/tags/1.1.1-RC2a/impl/src/test/java/com/example/simple/impl/QuoteImpl.java @@ -0,0 +1,1045 @@ +/** + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package com.example.simple.impl; + +import com.example.simple.Quote; +import com.example.simple.SimpleFactory; + +import commonj.sdo.Type; + +import java.math.BigDecimal; + +import java.util.Collection; +import java.util.List; + +import org.apache.tuscany.sdo.impl.DataObjectBase; + +/** + * + * An implementation of the model object 'Quote'. + * + *

+ * The following features are implemented: + *

+ *

+ * + * @generated + */ +public class QuoteImpl extends DataObjectBase implements Quote +{ + + public final static int SYMBOL = 0; + + public final static int COMPANY_NAME = 1; + + public final static int PRICE = 2; + + public final static int OPEN1 = 3; + + public final static int HIGH = 4; + + public final static int LOW = 5; + + public final static int VOLUME = 6; + + public final static int CHANGE1 = 7; + + public final static int QUOTES = 8; + + public final static int SDO_PROPERTY_COUNT = 9; + + public final static int EXTENDED_PROPERTY_COUNT = 0; + + + /** + * The internal feature id for the 'Symbol' attribute. + * + * + * @generated + * @ordered + */ + public final static int INTERNAL_SYMBOL = 0; + + /** + * The internal feature id for the 'Company Name' attribute. + * + * + * @generated + * @ordered + */ + public final static int INTERNAL_COMPANY_NAME = 1; + + /** + * The internal feature id for the 'Price' attribute. + * + * + * @generated + * @ordered + */ + public final static int INTERNAL_PRICE = 2; + + /** + * The internal feature id for the 'Open1' attribute. + * + * + * @generated + * @ordered + */ + public final static int INTERNAL_OPEN1 = 3; + + /** + * The internal feature id for the 'High' attribute. + * + * + * @generated + * @ordered + */ + public final static int INTERNAL_HIGH = 4; + + /** + * The internal feature id for the 'Low' attribute. + * + * + * @generated + * @ordered + */ + public final static int INTERNAL_LOW = 5; + + /** + * The internal feature id for the 'Volume' attribute. + * + * + * @generated + * @ordered + */ + public final static int INTERNAL_VOLUME = 6; + + /** + * The internal feature id for the 'Change1' attribute. + * + * + * @generated + * @ordered + */ + public final static int INTERNAL_CHANGE1 = 7; + + /** + * The internal feature id for the 'Quotes' containment reference list. + * + * + * @generated + * @ordered + */ + public final static int INTERNAL_QUOTES = 8; + + /** + * The number of properties for this type. + * + * + * @generated + * @ordered + */ + public final static int INTERNAL_PROPERTY_COUNT = 9; + + protected int internalConvertIndex(int internalIndex) + { + switch (internalIndex) + { + case INTERNAL_SYMBOL: return SYMBOL; + case INTERNAL_COMPANY_NAME: return COMPANY_NAME; + case INTERNAL_PRICE: return PRICE; + case INTERNAL_OPEN1: return OPEN1; + case INTERNAL_HIGH: return HIGH; + case INTERNAL_LOW: return LOW; + case INTERNAL_VOLUME: return VOLUME; + case INTERNAL_CHANGE1: return CHANGE1; + case INTERNAL_QUOTES: return QUOTES; + } + return super.internalConvertIndex(internalIndex); + } + + + /** + * The default value of the '{@link #getSymbol() Symbol}' attribute. + * + * + * @see #getSymbol() + * @generated + * @ordered + */ + protected static final String SYMBOL_DEFAULT_ = null; + + /** + * The cached value of the '{@link #getSymbol() Symbol}' attribute. + * + * + * @see #getSymbol() + * @generated + * @ordered + */ + protected String symbol = SYMBOL_DEFAULT_; + + /** + * This is true if the Symbol attribute has been set. + * + * + * @generated + * @ordered + */ + protected boolean symbol_set_ = false; + + /** + * The default value of the '{@link #getCompanyName() Company Name}' attribute. + * + * + * @see #getCompanyName() + * @generated + * @ordered + */ + protected static final String COMPANY_NAME_DEFAULT_ = null; + + /** + * The cached value of the '{@link #getCompanyName() Company Name}' attribute. + * + * + * @see #getCompanyName() + * @generated + * @ordered + */ + protected String companyName = COMPANY_NAME_DEFAULT_; + + /** + * This is true if the Company Name attribute has been set. + * + * + * @generated + * @ordered + */ + protected boolean companyName_set_ = false; + + /** + * The default value of the '{@link #getPrice() Price}' attribute. + * + * + * @see #getPrice() + * @generated + * @ordered + */ + protected static final BigDecimal PRICE_DEFAULT_ = null; + + /** + * The cached value of the '{@link #getPrice() Price}' attribute. + * + * + * @see #getPrice() + * @generated + * @ordered + */ + protected BigDecimal price = PRICE_DEFAULT_; + + /** + * This is true if the Price attribute has been set. + * + * + * @generated + * @ordered + */ + protected boolean price_set_ = false; + + /** + * The default value of the '{@link #getOpen1() Open1}' attribute. + * + * + * @see #getOpen1() + * @generated + * @ordered + */ + protected static final BigDecimal OPEN1_DEFAULT_ = null; + + /** + * The cached value of the '{@link #getOpen1() Open1}' attribute. + * + * + * @see #getOpen1() + * @generated + * @ordered + */ + protected BigDecimal open1 = OPEN1_DEFAULT_; + + /** + * This is true if the Open1 attribute has been set. + * + * + * @generated + * @ordered + */ + protected boolean open1_set_ = false; + + /** + * The default value of the '{@link #getHigh() High}' attribute. + * + * + * @see #getHigh() + * @generated + * @ordered + */ + protected static final BigDecimal HIGH_DEFAULT_ = null; + + /** + * The cached value of the '{@link #getHigh() High}' attribute. + * + * + * @see #getHigh() + * @generated + * @ordered + */ + protected BigDecimal high = HIGH_DEFAULT_; + + /** + * This is true if the High attribute has been set. + * + * + * @generated + * @ordered + */ + protected boolean high_set_ = false; + + /** + * The default value of the '{@link #getLow() Low}' attribute. + * + * + * @see #getLow() + * @generated + * @ordered + */ + protected static final BigDecimal LOW_DEFAULT_ = null; + + /** + * The cached value of the '{@link #getLow() Low}' attribute. + * + * + * @see #getLow() + * @generated + * @ordered + */ + protected BigDecimal low = LOW_DEFAULT_; + + /** + * This is true if the Low attribute has been set. + * + * + * @generated + * @ordered + */ + protected boolean low_set_ = false; + + /** + * The default value of the '{@link #getVolume() Volume}' attribute. + * + * + * @see #getVolume() + * @generated + * @ordered + */ + protected static final double VOLUME_DEFAULT_ = 0.0; + + /** + * The cached value of the '{@link #getVolume() Volume}' attribute. + * + * + * @see #getVolume() + * @generated + * @ordered + */ + protected double volume = VOLUME_DEFAULT_; + + /** + * This is true if the Volume attribute has been set. + * + * + * @generated + * @ordered + */ + protected boolean volume_set_ = false; + + /** + * The default value of the '{@link #getChange1() Change1}' attribute. + * + * + * @see #getChange1() + * @generated + * @ordered + */ + protected static final double CHANGE1_DEFAULT_ = 0.0; + + /** + * The cached value of the '{@link #getChange1() Change1}' attribute. + * + * + * @see #getChange1() + * @generated + * @ordered + */ + protected double change1 = CHANGE1_DEFAULT_; + + /** + * This is true if the Change1 attribute has been set. + * + * + * @generated + * @ordered + */ + protected boolean change1_set_ = false; + + /** + * The cached value of the '{@link #getQuotes() Quotes}' containment reference list. + * + * + * @see #getQuotes() + * @generated + * @ordered + */ + + protected List quotes = null; + + /** + * + * + * @generated + */ + public QuoteImpl() + { + super(); + } + + /** + * + * + * @generated + */ + public Type getStaticType() + { + return ((SimpleFactoryImpl)SimpleFactory.INSTANCE).getQuote(); + } + + /** + * + * + * @generated + */ + public String getSymbol() + { + return symbol; + } + /** + * + * + * @generated + */ + public void setSymbol(String newSymbol) + { + String oldSymbol = symbol; + symbol = newSymbol; + boolean oldSymbol_set_ = symbol_set_; + symbol_set_ = true; + if (isNotifying()) + notify(ChangeKind.SET, SYMBOL, oldSymbol, symbol, !oldSymbol_set_); + } + + /** + * + * + * @generated + */ + public void unsetSymbol() + { + String oldSymbol = symbol; + boolean oldSymbol_set_ = symbol_set_; + symbol = SYMBOL_DEFAULT_; + symbol_set_ = false; + if (isNotifying()) + notify(ChangeKind.UNSET, SYMBOL, oldSymbol, SYMBOL_DEFAULT_, oldSymbol_set_); + } + + /** + * + * + * @generated + */ + public boolean isSetSymbol() + { + return symbol_set_; + } + + /** + * + * + * @generated + */ + public String getCompanyName() + { + return companyName; + } + /** + * + * + * @generated + */ + public void setCompanyName(String newCompanyName) + { + String oldCompanyName = companyName; + companyName = newCompanyName; + boolean oldCompanyName_set_ = companyName_set_; + companyName_set_ = true; + if (isNotifying()) + notify(ChangeKind.SET, COMPANY_NAME, oldCompanyName, companyName, !oldCompanyName_set_); + } + + /** + * + * + * @generated + */ + public void unsetCompanyName() + { + String oldCompanyName = companyName; + boolean oldCompanyName_set_ = companyName_set_; + companyName = COMPANY_NAME_DEFAULT_; + companyName_set_ = false; + if (isNotifying()) + notify(ChangeKind.UNSET, COMPANY_NAME, oldCompanyName, COMPANY_NAME_DEFAULT_, oldCompanyName_set_); + } + + /** + * + * + * @generated + */ + public boolean isSetCompanyName() + { + return companyName_set_; + } + + /** + * + * + * @generated + */ + public BigDecimal getPrice() + { + return price; + } + /** + * + * + * @generated + */ + public void setPrice(BigDecimal newPrice) + { + BigDecimal oldPrice = price; + price = newPrice; + boolean oldPrice_set_ = price_set_; + price_set_ = true; + if (isNotifying()) + notify(ChangeKind.SET, PRICE, oldPrice, price, !oldPrice_set_); + } + + /** + * + * + * @generated + */ + public void unsetPrice() + { + BigDecimal oldPrice = price; + boolean oldPrice_set_ = price_set_; + price = PRICE_DEFAULT_; + price_set_ = false; + if (isNotifying()) + notify(ChangeKind.UNSET, PRICE, oldPrice, PRICE_DEFAULT_, oldPrice_set_); + } + + /** + * + * + * @generated + */ + public boolean isSetPrice() + { + return price_set_; + } + + /** + * + * + * @generated + */ + public BigDecimal getOpen1() + { + return open1; + } + /** + * + * + * @generated + */ + public void setOpen1(BigDecimal newOpen1) + { + BigDecimal oldOpen1 = open1; + open1 = newOpen1; + boolean oldOpen1_set_ = open1_set_; + open1_set_ = true; + if (isNotifying()) + notify(ChangeKind.SET, OPEN1, oldOpen1, open1, !oldOpen1_set_); + } + + /** + * + * + * @generated + */ + public void unsetOpen1() + { + BigDecimal oldOpen1 = open1; + boolean oldOpen1_set_ = open1_set_; + open1 = OPEN1_DEFAULT_; + open1_set_ = false; + if (isNotifying()) + notify(ChangeKind.UNSET, OPEN1, oldOpen1, OPEN1_DEFAULT_, oldOpen1_set_); + } + + /** + * + * + * @generated + */ + public boolean isSetOpen1() + { + return open1_set_; + } + + /** + * + * + * @generated + */ + public BigDecimal getHigh() + { + return high; + } + /** + * + * + * @generated + */ + public void setHigh(BigDecimal newHigh) + { + BigDecimal oldHigh = high; + high = newHigh; + boolean oldHigh_set_ = high_set_; + high_set_ = true; + if (isNotifying()) + notify(ChangeKind.SET, HIGH, oldHigh, high, !oldHigh_set_); + } + + /** + * + * + * @generated + */ + public void unsetHigh() + { + BigDecimal oldHigh = high; + boolean oldHigh_set_ = high_set_; + high = HIGH_DEFAULT_; + high_set_ = false; + if (isNotifying()) + notify(ChangeKind.UNSET, HIGH, oldHigh, HIGH_DEFAULT_, oldHigh_set_); + } + + /** + * + * + * @generated + */ + public boolean isSetHigh() + { + return high_set_; + } + + /** + * + * + * @generated + */ + public BigDecimal getLow() + { + return low; + } + /** + * + * + * @generated + */ + public void setLow(BigDecimal newLow) + { + BigDecimal oldLow = low; + low = newLow; + boolean oldLow_set_ = low_set_; + low_set_ = true; + if (isNotifying()) + notify(ChangeKind.SET, LOW, oldLow, low, !oldLow_set_); + } + + /** + * + * + * @generated + */ + public void unsetLow() + { + BigDecimal oldLow = low; + boolean oldLow_set_ = low_set_; + low = LOW_DEFAULT_; + low_set_ = false; + if (isNotifying()) + notify(ChangeKind.UNSET, LOW, oldLow, LOW_DEFAULT_, oldLow_set_); + } + + /** + * + * + * @generated + */ + public boolean isSetLow() + { + return low_set_; + } + + /** + * + * + * @generated + */ + public double getVolume() + { + return volume; + } + /** + * + * + * @generated + */ + public void setVolume(double newVolume) + { + double oldVolume = volume; + volume = newVolume; + boolean oldVolume_set_ = volume_set_; + volume_set_ = true; + if (isNotifying()) + notify(ChangeKind.SET, VOLUME, oldVolume, volume, !oldVolume_set_); + } + + /** + * + * + * @generated + */ + public void unsetVolume() + { + double oldVolume = volume; + boolean oldVolume_set_ = volume_set_; + volume = VOLUME_DEFAULT_; + volume_set_ = false; + if (isNotifying()) + notify(ChangeKind.UNSET, VOLUME, oldVolume, VOLUME_DEFAULT_, oldVolume_set_); + } + + /** + * + * + * @generated + */ + public boolean isSetVolume() + { + return volume_set_; + } + + /** + * + * + * @generated + */ + public double getChange1() + { + return change1; + } + /** + * + * + * @generated + */ + public void setChange1(double newChange1) + { + double oldChange1 = change1; + change1 = newChange1; + boolean oldChange1_set_ = change1_set_; + change1_set_ = true; + if (isNotifying()) + notify(ChangeKind.SET, CHANGE1, oldChange1, change1, !oldChange1_set_); + } + + /** + * + * + * @generated + */ + public void unsetChange1() + { + double oldChange1 = change1; + boolean oldChange1_set_ = change1_set_; + change1 = CHANGE1_DEFAULT_; + change1_set_ = false; + if (isNotifying()) + notify(ChangeKind.UNSET, CHANGE1, oldChange1, CHANGE1_DEFAULT_, oldChange1_set_); + } + + /** + * + * + * @generated + */ + public boolean isSetChange1() + { + return change1_set_; + } + + /** + * + * + * @generated + */ + public List getQuotes() + { + if (quotes == null) + { + quotes = createPropertyList(ListKind.CONTAINMENT, Quote.class, QUOTES, 0); + } + return quotes; + } + /** + * + * + * @generated + */ + public ChangeContext inverseRemove(Object otherEnd, int propertyIndex, ChangeContext changeContext) + { + switch (propertyIndex) + { + case QUOTES: + return removeFromList(getQuotes(), otherEnd, changeContext); + } + return super.inverseRemove(otherEnd, propertyIndex, changeContext); + } + + /** + * + * + * @generated + */ + public Object get(int propertyIndex, boolean resolve) + { + switch (propertyIndex) + { + case SYMBOL: + return getSymbol(); + case COMPANY_NAME: + return getCompanyName(); + case PRICE: + return getPrice(); + case OPEN1: + return getOpen1(); + case HIGH: + return getHigh(); + case LOW: + return getLow(); + case VOLUME: + return new Double(getVolume()); + case CHANGE1: + return new Double(getChange1()); + case QUOTES: + return getQuotes(); + } + return super.get(propertyIndex, resolve); + } + + /** + * + * + * @generated + */ + public void set(int propertyIndex, Object newValue) + { + switch (propertyIndex) + { + case SYMBOL: + setSymbol((String)newValue); + return; + case COMPANY_NAME: + setCompanyName((String)newValue); + return; + case PRICE: + setPrice((BigDecimal)newValue); + return; + case OPEN1: + setOpen1((BigDecimal)newValue); + return; + case HIGH: + setHigh((BigDecimal)newValue); + return; + case LOW: + setLow((BigDecimal)newValue); + return; + case VOLUME: + setVolume(((Double)newValue).doubleValue()); + return; + case CHANGE1: + setChange1(((Double)newValue).doubleValue()); + return; + case QUOTES: + getQuotes().clear(); + getQuotes().addAll((Collection)newValue); + return; + } + super.set(propertyIndex, newValue); + } + + /** + * + * + * @generated + */ + public void unset(int propertyIndex) + { + switch (propertyIndex) + { + case SYMBOL: + unsetSymbol(); + return; + case COMPANY_NAME: + unsetCompanyName(); + return; + case PRICE: + unsetPrice(); + return; + case OPEN1: + unsetOpen1(); + return; + case HIGH: + unsetHigh(); + return; + case LOW: + unsetLow(); + return; + case VOLUME: + unsetVolume(); + return; + case CHANGE1: + unsetChange1(); + return; + case QUOTES: + getQuotes().clear(); + return; + } + super.unset(propertyIndex); + } + + /** + * + * + * @generated + */ + public boolean isSet(int propertyIndex) + { + switch (propertyIndex) + { + case SYMBOL: + return isSetSymbol(); + case COMPANY_NAME: + return isSetCompanyName(); + case PRICE: + return isSetPrice(); + case OPEN1: + return isSetOpen1(); + case HIGH: + return isSetHigh(); + case LOW: + return isSetLow(); + case VOLUME: + return isSetVolume(); + case CHANGE1: + return isSetChange1(); + case QUOTES: + return quotes != null && !quotes.isEmpty(); + } + return super.isSet(propertyIndex); + } + + /** + * + * + * @generated + */ + public String toString() + { + if (isProxy(this)) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (symbol: "); + if (symbol_set_) result.append(symbol); else result.append(""); + result.append(", companyName: "); + if (companyName_set_) result.append(companyName); else result.append(""); + result.append(", price: "); + if (price_set_) result.append(price); else result.append(""); + result.append(", open1: "); + if (open1_set_) result.append(open1); else result.append(""); + result.append(", high: "); + if (high_set_) result.append(high); else result.append(""); + result.append(", low: "); + if (low_set_) result.append(low); else result.append(""); + result.append(", volume: "); + if (volume_set_) result.append(volume); else result.append(""); + result.append(", change1: "); + if (change1_set_) result.append(change1); else result.append(""); + result.append(')'); + return result.toString(); + } + +} //QuoteImpl -- cgit v1.2.3