001: /*
002: *
003: *
004: * Copyright 1990-2007 Sun Microsystems, Inc. All Rights Reserved.
005: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
006: *
007: * This program is free software; you can redistribute it and/or
008: * modify it under the terms of the GNU General Public License version
009: * 2 only, as published by the Free Software Foundation.
010: *
011: * This program is distributed in the hope that it will be useful, but
012: * WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * General Public License version 2 for more details (a copy is
015: * included at /legal/license.txt).
016: *
017: * You should have received a copy of the GNU General Public License
018: * version 2 along with this work; if not, write to the Free Software
019: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
020: * 02110-1301 USA
021: *
022: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
023: * Clara, CA 95054 or visit www.sun.com if you need additional
024: * information or have any questions.
025: */
026: package javax.microedition.location;
027:
028: /**
029: * This class is defined by the JSR-179 specification
030: * <em>Location API for J2ME for J2ME™.</em>
031: */
032: // JAVADOC COMMENT ELIDED
033: public class Criteria {
034: // JAVADOC COMMENT ELIDED
035: public final static int NO_REQUIREMENT = 0;
036: // JAVADOC COMMENT ELIDED
037: public final static int POWER_USAGE_LOW = 1;
038: // JAVADOC COMMENT ELIDED
039: public final static int POWER_USAGE_MEDIUM = 2;
040: // JAVADOC COMMENT ELIDED
041: public final static int POWER_USAGE_HIGH = 3;
042:
043: // JAVADOC COMMENT ELIDED
044: private int preferredPowerConsumption = NO_REQUIREMENT;
045: // JAVADOC COMMENT ELIDED
046: private boolean allowedToCost = true;
047: // JAVADOC COMMENT ELIDED
048: private boolean speedAndCourseRequired = false;
049: // JAVADOC COMMENT ELIDED
050: private boolean altitudeRequired = false;
051: // JAVADOC COMMENT ELIDED
052: private boolean addressInfoRequired = false;
053: // JAVADOC COMMENT ELIDED
054: private int horizontalAccuracy = NO_REQUIREMENT;
055: // JAVADOC COMMENT ELIDED
056: private int verticalAccuracy = NO_REQUIREMENT;
057: // JAVADOC COMMENT ELIDED
058: private int preferredResponseTime = NO_REQUIREMENT;
059:
060: // JAVADOC COMMENT ELIDED
061: public Criteria() {
062: }
063:
064: // JAVADOC COMMENT ELIDED
065: public int getPreferredPowerConsumption() {
066: return preferredPowerConsumption;
067: }
068:
069: // JAVADOC COMMENT ELIDED
070: public boolean isAllowedToCost() {
071: return allowedToCost;
072: }
073:
074: // JAVADOC COMMENT ELIDED
075: public int getVerticalAccuracy() {
076: return verticalAccuracy;
077: }
078:
079: // JAVADOC COMMENT ELIDED
080: public int getHorizontalAccuracy() {
081: return horizontalAccuracy;
082: }
083:
084: // JAVADOC COMMENT ELIDED
085: public int getPreferredResponseTime() {
086: return preferredResponseTime;
087: }
088:
089: // JAVADOC COMMENT ELIDED
090: public boolean isSpeedAndCourseRequired() {
091: return speedAndCourseRequired;
092: }
093:
094: // JAVADOC COMMENT ELIDED
095: public boolean isAltitudeRequired() {
096: return altitudeRequired;
097: }
098:
099: // JAVADOC COMMENT ELIDED
100: public boolean isAddressInfoRequired() {
101: return addressInfoRequired;
102: }
103:
104: // JAVADOC COMMENT ELIDED
105: public void setHorizontalAccuracy(int accuracy) {
106: horizontalAccuracy = accuracy;
107: }
108:
109: // JAVADOC COMMENT ELIDED
110: public void setVerticalAccuracy(int accuracy) {
111: verticalAccuracy = accuracy;
112: }
113:
114: // JAVADOC COMMENT ELIDED
115: public void setPreferredResponseTime(int time) {
116: preferredResponseTime = time;
117: }
118:
119: // JAVADOC COMMENT ELIDED
120: public void setPreferredPowerConsumption(int level) {
121: preferredPowerConsumption = level;
122: }
123:
124: // JAVADOC COMMENT ELIDED
125: public void setCostAllowed(boolean costAllowed) {
126: allowedToCost = costAllowed;
127: }
128:
129: // JAVADOC COMMENT ELIDED
130: public void setSpeedAndCourseRequired(boolean speedAndCourseRequired) {
131: this .speedAndCourseRequired = speedAndCourseRequired;
132: }
133:
134: // JAVADOC COMMENT ELIDED
135: public void setAltitudeRequired(boolean altitudeRequired) {
136: this .altitudeRequired = altitudeRequired;
137: }
138:
139: // JAVADOC COMMENT ELIDED
140: public void setAddressInfoRequired(boolean addressInfoRequired) {
141: this.addressInfoRequired = addressInfoRequired;
142: }
143:
144: }
|