2 * Copyright 2015 Samsung Electronics All Rights Reserved.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 package org.oic.simulator;
19 class DoubleValueValidator implements
20 AttributeValueVisitor.VisitingMethods<Boolean> {
22 private DoubleProperty mProperty = null;
24 DoubleValueValidator(DoubleProperty property) {
28 public boolean validate(AttributeValue value) {
29 AttributeValueVisitor visitor = new AttributeValueVisitor(value, this);
30 return (Boolean) visitor.visit();
34 public Boolean visitingValue(Integer value) {
39 public Boolean visitingValue(Double value) {
40 if (null != mProperty)
41 return mProperty.validate(value);
46 public Boolean visitingValue(Boolean value) {
51 public Boolean visitingValue(String value) {
56 public Boolean visitingValue(SimulatorResourceModel value) {
61 public Boolean visitingValue(Integer[] value) {
66 public Boolean visitingValue(Double[] value) {
71 public Boolean visitingValue(Boolean[] value) {
76 public Boolean visitingValue(String[] value) {
81 public Boolean visitingValue(SimulatorResourceModel[] value) {
86 public Boolean visitingValue(Integer[][] value) {
91 public Boolean visitingValue(Double[][] value) {
96 public Boolean visitingValue(Boolean[][] value) {
101 public Boolean visitingValue(String[][] value) {
106 public Boolean visitingValue(SimulatorResourceModel[][] value) {
111 public Boolean visitingValue(Integer[][][] value) {
116 public Boolean visitingValue(Double[][][] value) {
121 public Boolean visitingValue(Boolean[][][] value) {
126 public Boolean visitingValue(String[][][] value) {
131 public Boolean visitingValue(SimulatorResourceModel[][][] value) {