001 /*
002 * The contents of this file are subject to the Mozilla Public License
003 * Version 1.1 (the "License"); you may not use this file except in
004 * compliance with the License. You may obtain a copy of the License at
005 * http://www.mozilla.org/MPL/
006 *
007 * Software distributed under the License is distributed on an "AS IS" basis,
008 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
009 * the specific language governing rights and limitations under the License.
010 *
011 * The Original Code is Protege-2000.
012 *
013 * The Initial Developer of the Original Code is Stanford University. Portions
014 * created by Stanford University are Copyright (C) 2007. All Rights Reserved.
015 *
016 * Protege was developed by Stanford Medical Informatics
017 * (http://www.smi.stanford.edu) at the Stanford University School of Medicine
018 * with support from the National Library of Medicine, the National Science
019 * Foundation, and the Defense Advanced Research Projects Agency. Current
020 * information about Protege can be obtained at http://protege.stanford.edu.
021 *
022 */
023
024 package edu.stanford.smi.protegex.owlx.examples.javaDemo.model.impl;
025
026 import edu.stanford.smi.protege.model.FrameID;
027 import edu.stanford.smi.protegex.owl.model.OWLModel;
028 import edu.stanford.smi.protegex.owl.model.RDFProperty;
029 import edu.stanford.smi.protegex.owl.model.impl.DefaultRDFIndividual;
030 import edu.stanford.smi.protegex.owlx.examples.javaDemo.model.Customer_;
031 import edu.stanford.smi.protegex.owlx.examples.javaDemo.model.Purchase;
032
033 import java.util.Collection;
034 import java.util.Iterator;
035
036 /**
037 * Generated by Protege-OWL (http://protege.stanford.edu/plugins/owl).
038 * Source OWL Class: http://www.owl-ontologies.com/javaDemo.owl#Customer
039 *
040 * @version generated on Sat Feb 19 17:10:28 EST 2005
041 */
042 public class DefaultCustomer_ extends DefaultRDFIndividual
043 implements Customer_ {
044
045 public DefaultCustomer_(OWLModel owlModel, FrameID id) {
046 super(owlModel, id);
047 }
048
049
050 public DefaultCustomer_() {
051 }
052
053 // Property http://www.owl-ontologies.com/javaDemo.owl#firstName
054
055
056 public String getFirstName() {
057 return (String) getPropertyValue(getFirstNameProperty());
058 }
059
060
061 public RDFProperty getFirstNameProperty() {
062 final String uri = "http://www.owl-ontologies.com/javaDemo.owl#firstName";
063 final String name = getOWLModel().getResourceNameForURI(uri);
064 return getOWLModel().getRDFProperty(name);
065 }
066
067
068 public boolean hasFirstName() {
069 return getPropertyValueCount(getFirstNameProperty()) > 0;
070 }
071
072
073 public void setFirstName(String newFirstName) {
074 setPropertyValue(getFirstNameProperty(), newFirstName);
075 }
076
077 // Property http://www.owl-ontologies.com/javaDemo.owl#lastName
078
079
080 public String getLastName() {
081 return (String) getPropertyValue(getLastNameProperty());
082 }
083
084
085 public RDFProperty getLastNameProperty() {
086 final String uri = "http://www.owl-ontologies.com/javaDemo.owl#lastName";
087 final String name = getOWLModel().getResourceNameForURI(uri);
088 return getOWLModel().getRDFProperty(name);
089 }
090
091
092 public boolean hasLastName() {
093 return getPropertyValueCount(getLastNameProperty()) > 0;
094 }
095
096
097 public void setLastName(String newLastName) {
098 setPropertyValue(getLastNameProperty(), newLastName);
099 }
100
101 // Property http://www.owl-ontologies.com/javaDemo.owl#purchases
102
103
104 public Collection getPurchases() {
105 return getPropertyValuesAs(getPurchasesProperty(), Purchase.class);
106 }
107
108
109 public RDFProperty getPurchasesProperty() {
110 final String uri = "http://www.owl-ontologies.com/javaDemo.owl#purchases";
111 final String name = getOWLModel().getResourceNameForURI(uri);
112 return getOWLModel().getRDFProperty(name);
113 }
114
115
116 public boolean hasPurchases() {
117 return getPropertyValueCount(getPurchasesProperty()) > 0;
118 }
119
120
121 public Iterator listPurchases() {
122 return listPropertyValuesAs(getPurchasesProperty(), Purchase.class);
123 }
124
125
126 public void addPurchases(Purchase newPurchases) {
127 addPropertyValue(getPurchasesProperty(), newPurchases);
128 }
129
130
131 public void removePurchases(Purchase oldPurchases) {
132 removePropertyValue(getPurchasesProperty(), oldPurchases);
133 }
134
135
136 public void setPurchases(Collection newPurchases) {
137 setPropertyValues(getPurchasesProperty(), newPurchases);
138 }
139
140 // Property http://www.owl-ontologies.com/javaDemo.owl#zipCode
141
142
143 public int getZipCode() {
144 return getPropertyValueLiteral(getZipCodeProperty()).getInt();
145 }
146
147
148 public RDFProperty getZipCodeProperty() {
149 final String uri = "http://www.owl-ontologies.com/javaDemo.owl#zipCode";
150 final String name = getOWLModel().getResourceNameForURI(uri);
151 return getOWLModel().getRDFProperty(name);
152 }
153
154
155 public boolean hasZipCode() {
156 return getPropertyValueCount(getZipCodeProperty()) > 0;
157 }
158
159
160 public void setZipCode(int newZipCode) {
161 setPropertyValue(getZipCodeProperty(), new Integer(newZipCode));
162 }
163 }
164