}
@Override
- public void addCriteria (final String key, final boolean value) {
+ public void addCriteria (final String key, final Boolean value) {
// Add to map
this.criteria.put(key, value);
}
this.criteria.put(key, value);
}
- /**
- * Gets all entries as a key-value pair
- *
- * @return Key-value paira of all entries
- */
@Override
public Set<Map.Entry<String, Object>> entrySet () {
return this.criteria.entrySet();
}
- /**
- * Gets all values from underlaying map in an iterator.
- *
- * @return Values iteratable
- */
@Override
public Iterable<Object> values () {
// Call map's method
}
/**
- * @param logcial the logcial to set
+ * Setter for Logical instance
+ *
+ * @param logcial the Logical instance to set
*/
public final void setLogcial (final Logical logcial) {
this.logcial = logcial;
}
+
+ @Override
+ public void addCriteria (final String key, final Number value) {
+ this.criteria.put(key, value);
+ }
}
* @param key Key of criteria
* @param value Value of criteria
*/
- public void addCriteria (final String key, final boolean value);
+ public void addCriteria (final String key, final Boolean value);
/**
* Adds a string criteria
*/
public void addCriteria (final String key, final String value);
+ /**
+ * Adds a number criteria
+ *
+ * @param key Key of criteria
+ * @param value Value of criteria
+ */
+ public void addCriteria (final String key, final Number value);
+
/**
* Gets all values from underlaying map in an iterator.
*
*
* @author Roland Haeder
*/
-public class SearchCriteria extends BaseCriteria implements SearchableCritera {
+public class SearchCriteria extends BaseCriteria implements SearchableCriteria {
/**
* Limit of matches
*/
+++ /dev/null
-/*
- * Copyright (C) 2015 Roland Haeder
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jcore.criteria.searchable;
-
-import java.lang.reflect.InvocationTargetException;
-import org.mxchange.jcore.criteria.Criteria;
-import org.mxchange.jcore.database.storage.Storeable;
-
-/**
- * A searchable criteria
- *
- * @author Roland Haeder
- */
-public interface SearchableCritera extends Criteria {
- /**
- * Checks if the given instance of a Storeable class matches
- *
- * @param storeable A Storeable instance to check
- * @return Whether the Storeable instance matches
- * @throws IllegalArgumentException Some implementations may throw this
- * @throws java.lang.NoSuchMethodException If the invoked method was not found
- * @throws java.lang.IllegalAccessException If the method cannot be accessed
- * @throws java.lang.reflect.InvocationTargetException Any other problems?
- */
- public boolean matches (final Storeable storeable) throws NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException;
-
- /**
- * Setter for limit of possible matches
- *
- * @param limit Limit of matches
- */
- public void setLimit (final int limit);
-
- /**
- * Getter for limit of possible matches
- *
- * @return Limit of matches
- */
- public int getLimit ();
-
- /**
- * Setter for skipping of possible matches
- *
- * @param skip Skipping of matches
- */
- public void setSkip (final int skip);
-
- /**
- * Getter for skipping of possible matches
- *
- * @return Skipping of matches
- */
- public int getSkip ();
-}
--- /dev/null
+/*
+ * Copyright (C) 2015 Roland Haeder
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jcore.criteria.searchable;
+
+import java.lang.reflect.InvocationTargetException;
+import org.mxchange.jcore.criteria.Criteria;
+import org.mxchange.jcore.database.storage.Storeable;
+
+/**
+ * A searchable criteria
+ *
+ * @author Roland Haeder
+ */
+public interface SearchableCriteria extends Criteria {
+ /**
+ * Checks if the given instance of a Storeable class matches
+ *
+ * @param storeable A Storeable instance to check
+ * @return Whether the Storeable instance matches
+ * @throws IllegalArgumentException Some implementations may throw this
+ * @throws java.lang.NoSuchMethodException If the invoked method was not found
+ * @throws java.lang.IllegalAccessException If the method cannot be accessed
+ * @throws java.lang.reflect.InvocationTargetException Any other problems?
+ */
+ public boolean matches (final Storeable storeable) throws NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException;
+
+ /**
+ * Setter for limit of possible matches
+ *
+ * @param limit Limit of matches
+ */
+ public void setLimit (final int limit);
+
+ /**
+ * Getter for limit of possible matches
+ *
+ * @return Limit of matches
+ */
+ public int getLimit ();
+
+ /**
+ * Setter for skipping of possible matches
+ *
+ * @param skip Skipping of matches
+ */
+ public void setSkip (final int skip);
+
+ /**
+ * Getter for skipping of possible matches
+ *
+ * @return Skipping of matches
+ */
+ public int getSkip ();
+}
import java.sql.SQLException;
import java.util.Map;
import org.mxchange.jcore.FrameworkInterface;
-import org.mxchange.jcore.criteria.searchable.SearchableCritera;
+import org.mxchange.jcore.criteria.searchable.SearchableCriteria;
import org.mxchange.jcore.database.result.Result;
import org.mxchange.jcore.database.storage.Storeable;
import org.mxchange.jcore.exceptions.BadTokenException;
* @throws java.lang.IllegalAccessException If the method cannot be accessed
* @throws java.lang.reflect.InvocationTargetException Any other problems?
*/
- public Result<? extends Storeable> doSelectByCriteria (final SearchableCritera critera) throws IOException, BadTokenException, CorruptedDatabaseFileException, SQLException, NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException;
+ public Result<? extends Storeable> doSelectByCriteria (final SearchableCriteria critera) throws IOException, BadTokenException, CorruptedDatabaseFileException, SQLException, NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException;
/**
* Shuts down this backend
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.apache.commons.codec.binary.Base64;
-import org.mxchange.jcore.criteria.searchable.SearchableCritera;
+import org.mxchange.jcore.criteria.searchable.SearchableCriteria;
import org.mxchange.jcore.database.backend.BaseDatabaseBackend;
import org.mxchange.jcore.database.backend.DatabaseBackend;
import org.mxchange.jcore.database.backend.file.SynchronizeableFile;
}
@Override
- public Result<? extends Storeable> doSelectByCriteria (final SearchableCritera critera) throws IOException, BadTokenException, CorruptedDatabaseFileException, NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
+ public Result<? extends Storeable> doSelectByCriteria (final SearchableCriteria critera) throws IOException, BadTokenException, CorruptedDatabaseFileException, NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
// Trace message
this.getLogger().trace(MessageFormat.format("criteria={0} - CALLED!", critera));
import java.util.LinkedHashSet;
import java.util.Map;
import java.util.Set;
-import org.mxchange.jcore.criteria.searchable.SearchableCritera;
+import org.mxchange.jcore.criteria.searchable.SearchableCriteria;
import org.mxchange.jcore.database.backend.BaseDatabaseBackend;
import org.mxchange.jcore.database.backend.DatabaseBackend;
import org.mxchange.jcore.database.frontend.DatabaseFrontend;
}
@Override
- public Result<? extends Storeable> doSelectByCriteria (final SearchableCritera critera) throws SQLException {
+ public Result<? extends Storeable> doSelectByCriteria (final SearchableCriteria critera) throws SQLException {
// Trace message
this.getLogger().trace(MessageFormat.format("criteria={0} - CALLED!", critera));