Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* ModeShape (http://www.modeshape.org)
*
* Licensed 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 org.modeshape.jcr.value;
import java.io.IOException;
import java.io.InputStream;
import java.io.Serializable;
import java.math.BigDecimal;
import java.net.URI;
import java.util.Calendar;
import java.util.Comparator;
import java.util.Date;
import java.util.UUID;
import javax.jcr.RepositoryException;
import org.modeshape.common.annotation.Immutable;
import org.modeshape.common.util.SecureHash;
import org.modeshape.jcr.GraphI18n;
import org.modeshape.jcr.api.value.DateTime;
import org.modeshape.jcr.value.basic.StringValueFactory;
/**
* A set of {@link Comparator} objects for the different kinds of property values.
*
* @see PropertyType#getComparator()
*/
@Immutable
public final class ValueComparators {
/**
* A comparator of string values.
*/
public static final Comparator STRING_COMPARATOR = new StringComparator();
/**
* A comparator of long values.
*/
public static final Comparator LONG_COMPARATOR = new LongComparator();
/**
* A comparator of double values.
*/
public static final Comparator DOUBLE_COMPARATOR = new DoubleComparator();
/**
* A comparator of decimal values.
*/
public static final Comparator DECIMAL_COMPARATOR = new DecimalComparator();
/**
* A comparator of boolean values.
*/
public static final Comparator BOOLEAN_COMPARATOR = new BooleanComparator();
/**
* A comparator of binary values. Although {@link BinaryValue} is {@link Comparable}, this comparator does not rely upon any
* particular Binary implementation. Thus, Binary implementations can use this for their {@link Comparable#compareTo(Object)}
* implementation.
*/
public static final Comparator BINARY_COMPARATOR = new BinaryValueComparator();
/**
* A comparator of date-time instances.
*/
public static final Comparator DATE_TIME_COMPARATOR = new DateTimeComparator();
/**
* A comparator of date values.
*/
public static final Comparator DATE_COMPARATOR = new DateComparator();
/**
* A comparator of calendar values.
*/
public static final Comparator CALENDAR_COMPARATOR = new CalendarComparator();
/**
* A comparator of name values.
*/
public static final Comparator NAME_COMPARATOR = new NameComparator();
/**
* A comparator of path values.
*/
public static final Comparator PATH_COMPARATOR = new PathComparator();
/**
* A comparator of path segment values.
*/
public static final Comparator PATH_SEGMENT_COMPARATOR = new PathSegmentComparator();
/**
* A comparator of path segment names, excluding same-name-sibling indexes.
*/
public static final Comparator PATH_SEGMENT_NAME_COMPARATOR = new PathSegmentNameComparator();
/**
* A comparator of URI values.
*/
public static final Comparator URI_COMPARATOR = new UriComparator();
/**
* A comparator of UUID values.
*/
public static final Comparator UUID_COMPARATOR = new UuidComparator();
/**
* A comparator of reference values.
*/
public static final Comparator REFERENCE_COMPARATOR = new ReferenceComparator();
/**
* A comparator of other values.
*/
public static final Comparator