Skip to content

Commit

Permalink
Renamed direct value implementation to Direct*
Browse files Browse the repository at this point in the history
  • Loading branch information
fickludd committed May 31, 2017
1 parent 3132934 commit 57b0bbb
Show file tree
Hide file tree
Showing 26 changed files with 92 additions and 91 deletions.
Expand Up @@ -25,11 +25,11 @@
* This does not extend AbstractProperty since the JVM can take advantage of the 4 byte initial field alignment if * This does not extend AbstractProperty since the JVM can take advantage of the 4 byte initial field alignment if
* we don't extend a class that has fields. * we don't extend a class that has fields.
*/ */
final class BooleanValue extends ScalarValue implements ValueGroup.VBoolean final class DirectBoolean extends DirectScalar implements ValueGroup.VBoolean
{ {
private final boolean bool; private final boolean bool;


BooleanValue( boolean bool ) DirectBoolean( boolean bool )
{ {
this.bool = bool; this.bool = bool;
} }
Expand Down
Expand Up @@ -23,11 +23,11 @@


import static java.lang.String.format; import static java.lang.String.format;


class BooleanArrayValue extends ArrayValue implements ValueGroup.VBooleanArray final class DirectBooleanArray extends ArrayValue implements ValueGroup.VBooleanArray
{ {
private final boolean[] value; private final boolean[] value;


BooleanArrayValue( boolean[] value ) DirectBooleanArray( boolean[] value )
{ {
assert value != null; assert value != null;
this.value = value; this.value = value;
Expand Down Expand Up @@ -119,7 +119,7 @@ public int hashCode()


static boolean equals( boolean[] value, Value other ) static boolean equals( boolean[] value, Value other )
{ {
return other instanceof BooleanArrayValue && Arrays.equals( value, ((BooleanArrayValue) other).value ); return other instanceof DirectBooleanArray && Arrays.equals( value, ((DirectBooleanArray) other).value );
} }


static int hash( boolean[] value ) static int hash( boolean[] value )
Expand Down
Expand Up @@ -25,11 +25,11 @@
* This does not extend AbstractProperty since the JVM can take advantage of the 4 byte initial field alignment if * This does not extend AbstractProperty since the JVM can take advantage of the 4 byte initial field alignment if
* we don't extend a class that has fields. * we don't extend a class that has fields.
*/ */
final class ByteValue extends IntegralNumberValue final class DirectByte extends DirectIntegralNumber
{ {
private final byte value; private final byte value;


ByteValue( byte value ) DirectByte( byte value )
{ {
this.value = value; this.value = value;
} }
Expand Down
Expand Up @@ -23,11 +23,11 @@


import static java.lang.String.format; import static java.lang.String.format;


class ByteArrayValue extends IntegralArrayValue final class DirectByteArray extends DirectIntegralArray
{ {
private final byte[] value; private final byte[] value;


ByteArrayValue( byte[] value ) DirectByteArray( byte[] value )
{ {
assert value != null; assert value != null;
this.value = value; this.value = value;
Expand Down
Expand Up @@ -21,11 +21,11 @@


import static java.lang.String.format; import static java.lang.String.format;


final class CharValue extends ScalarValue implements ValueGroup.VText final class DirectChar extends DirectScalar implements ValueGroup.VText
{ {
final char value; final char value;


CharValue( char value ) DirectChar( char value )
{ {
this.value = value; this.value = value;
} }
Expand Down
Expand Up @@ -23,11 +23,11 @@


import static java.lang.String.format; import static java.lang.String.format;


class CharArrayValue extends ArrayValue final class DirectCharArray extends ArrayValue
{ {
final char[] value; final char[] value;


CharArrayValue( char[] value ) DirectCharArray( char[] value )
{ {
assert value != null; assert value != null;
this.value = value; this.value = value;
Expand Down
Expand Up @@ -21,11 +21,11 @@


import static java.lang.String.format; import static java.lang.String.format;


final class DoubleValue extends FloatingPointNumberValue final class DirectDouble extends DirectFloatingPointNumber
{ {
private final double value; private final double value;


DoubleValue( double value ) DirectDouble( double value )
{ {
this.value = value; this.value = value;
} }
Expand Down
Expand Up @@ -23,11 +23,11 @@


import static java.lang.String.format; import static java.lang.String.format;


class DoubleArrayValue extends FloatingPointArrayValue final class DirectDoubleArray extends DirectFloatingPointArray
{ {
private final double[] value; private final double[] value;


DoubleArrayValue( double[] value ) DirectDoubleArray( double[] value )
{ {
assert value != null; assert value != null;
this.value = value; this.value = value;
Expand Down
Expand Up @@ -21,11 +21,11 @@


import static java.lang.String.format; import static java.lang.String.format;


final class FloatValue extends FloatingPointNumberValue final class DirectFloat extends DirectFloatingPointNumber
{ {
private final float value; private final float value;


FloatValue( float value ) DirectFloat( float value )
{ {
this.value = value; this.value = value;
} }
Expand Down
Expand Up @@ -23,11 +23,11 @@


import static java.lang.String.format; import static java.lang.String.format;


class FloatArrayValue extends FloatingPointArrayValue final class DirectFloatArray extends DirectFloatingPointArray
{ {
private final float[] value; private final float[] value;


FloatArrayValue( float[] value ) DirectFloatArray( float[] value )
{ {
assert value != null; assert value != null;
this.value = value; this.value = value;
Expand Down
Expand Up @@ -19,7 +19,7 @@
*/ */
package org.neo4j.values; package org.neo4j.values;


abstract class FloatingPointArrayValue extends ArrayValue implements ValueGroup.VFloatingPointArray abstract class DirectFloatingPointArray extends ArrayValue implements ValueGroup.VFloatingPointArray
{ {
public abstract double doubleValue( int index ); public abstract double doubleValue( int index );


Expand Down
Expand Up @@ -19,7 +19,7 @@
*/ */
package org.neo4j.values; package org.neo4j.values;


abstract class FloatingPointNumberValue extends ScalarValue implements ValueGroup.VFloatingPoint abstract class DirectFloatingPointNumber extends DirectScalar implements ValueGroup.VFloatingPoint
{ {
@Override @Override
public final int hashCode() public final int hashCode()
Expand All @@ -36,14 +36,14 @@ public boolean equals( Object other )
@Override @Override
public final boolean equals( Value other ) public final boolean equals( Value other )
{ {
if ( other instanceof FloatingPointNumberValue ) if ( other instanceof DirectFloatingPointNumber )
{ {
FloatingPointNumberValue that = (FloatingPointNumberValue) other; DirectFloatingPointNumber that = (DirectFloatingPointNumber) other;
return this.doubleValue() == that.doubleValue(); return this.doubleValue() == that.doubleValue();
} }
else if ( other instanceof IntegralNumberValue ) else if ( other instanceof DirectIntegralNumber )
{ {
IntegralNumberValue that = (IntegralNumberValue) other; DirectIntegralNumber that = (DirectIntegralNumber) other;
return NumberValues.numbersEqual( this.doubleValue(), that.longValue() ); return NumberValues.numbersEqual( this.doubleValue(), that.longValue() );
} }
else else
Expand Down
Expand Up @@ -21,11 +21,11 @@


import static java.lang.String.format; import static java.lang.String.format;


final class IntValue extends IntegralNumberValue final class DirectInt extends DirectIntegralNumber
{ {
private final int value; private final int value;


IntValue( int value ) DirectInt( int value )
{ {
this.value = value; this.value = value;
} }
Expand Down
Expand Up @@ -23,11 +23,11 @@


import static java.lang.String.format; import static java.lang.String.format;


class IntArrayValue extends IntegralArrayValue final class DirectIntArray extends DirectIntegralArray
{ {
private final int[] value; private final int[] value;


IntArrayValue( int[] value ) DirectIntArray( int[] value )
{ {
assert value != null; assert value != null;
this.value = value; this.value = value;
Expand Down
Expand Up @@ -19,7 +19,7 @@
*/ */
package org.neo4j.values; package org.neo4j.values;


abstract class IntegralArrayValue extends ArrayValue implements ValueGroup.VIntegerArray abstract class DirectIntegralArray extends ArrayValue implements ValueGroup.VIntegerArray
{ {
@Override @Override
boolean equals( boolean[] x ) boolean equals( boolean[] x )
Expand Down
Expand Up @@ -19,7 +19,7 @@
*/ */
package org.neo4j.values; package org.neo4j.values;


abstract class IntegralNumberValue extends ScalarValue implements ValueGroup.VInteger abstract class DirectIntegralNumber extends DirectScalar implements ValueGroup.VInteger
{ {
@Override @Override
public final int hashCode() public final int hashCode()
Expand All @@ -36,14 +36,14 @@ public boolean equals( Object other )
@Override @Override
public final boolean equals( Value other ) public final boolean equals( Value other )
{ {
if ( other instanceof IntegralNumberValue ) if ( other instanceof DirectIntegralNumber )
{ {
IntegralNumberValue that = (IntegralNumberValue) other; DirectIntegralNumber that = (DirectIntegralNumber) other;
return this.longValue() == that.longValue(); return this.longValue() == that.longValue();
} }
else if ( other instanceof FloatingPointNumberValue ) else if ( other instanceof DirectFloatingPointNumber )
{ {
FloatingPointNumberValue that = (FloatingPointNumberValue) other; DirectFloatingPointNumber that = (DirectFloatingPointNumber) other;
return NumberValues.numbersEqual( that.doubleValue(), this.longValue() ); return NumberValues.numbersEqual( that.doubleValue(), this.longValue() );
} }
else else
Expand Down
Expand Up @@ -21,11 +21,11 @@


import static java.lang.String.format; import static java.lang.String.format;


final class LongValue extends IntegralNumberValue final class DirectLong extends DirectIntegralNumber
{ {
private final long value; private final long value;


LongValue( long value ) DirectLong( long value )
{ {
this.value = value; this.value = value;
} }
Expand Down
Expand Up @@ -23,11 +23,11 @@


import static java.lang.String.format; import static java.lang.String.format;


class LongArrayValue extends IntegralArrayValue final class DirectLongArray extends DirectIntegralArray
{ {
private final long[] value; private final long[] value;


LongArrayValue( long[] value ) DirectLongArray( long[] value )
{ {
assert value != null; assert value != null;
this.value = value; this.value = value;
Expand Down
Expand Up @@ -19,7 +19,7 @@
*/ */
package org.neo4j.values; package org.neo4j.values;


abstract class ScalarValue extends Value abstract class DirectScalar extends Value
{ {
@Override @Override
boolean equals( byte[] x ) boolean equals( byte[] x )
Expand Down
Expand Up @@ -25,11 +25,11 @@
* This does not extend AbstractProperty since the JVM can take advantage of the 4 byte initial field alignment if * This does not extend AbstractProperty since the JVM can take advantage of the 4 byte initial field alignment if
* we don't extend a class that has fields. * we don't extend a class that has fields.
*/ */
final class ShortValue extends IntegralNumberValue final class DirectShort extends DirectIntegralNumber
{ {
private final short value; private final short value;


ShortValue( short value ) DirectShort( short value )
{ {
this.value = value; this.value = value;
} }
Expand Down
Expand Up @@ -23,11 +23,11 @@


import static java.lang.String.format; import static java.lang.String.format;


class ShortArrayValue extends IntegralArrayValue final class DirectShortArray extends DirectIntegralArray
{ {
private final short[] value; private final short[] value;


ShortArrayValue( short[] value ) DirectShortArray( short[] value )
{ {
assert value != null; assert value != null;
this.value = value; this.value = value;
Expand Down
Expand Up @@ -21,11 +21,11 @@


import static java.lang.String.format; import static java.lang.String.format;


final class StringValue extends ScalarValue implements ValueGroup.VText final class DirectString extends DirectScalar implements ValueGroup.VText
{ {
final String string; final String string;


StringValue( String string ) DirectString( String string )
{ {
assert string != null; assert string != null;
this.string = string; this.string = string;
Expand Down
Expand Up @@ -23,11 +23,11 @@


import static java.lang.String.format; import static java.lang.String.format;


class StringArrayValue extends ArrayValue final class DirectStringArray extends ArrayValue
{ {
final String[] value; final String[] value;


StringArrayValue( String[] value ) DirectStringArray( String[] value )
{ {
assert value != null; assert value != null;
this.value = value; this.value = value;
Expand Down Expand Up @@ -128,7 +128,7 @@ public String toString()
return format( "StringArray(%s)", Arrays.toString( value ) ); return format( "StringArray(%s)", Arrays.toString( value ) );
} }


public int compareTo( StringArrayValue other ) public int compareTo( DirectStringArray other )
{ {
int i = 0; int i = 0;
int x = value.length - other.value.length; int x = value.length - other.value.length;
Expand Down
Expand Up @@ -238,7 +238,7 @@ void writeTo( Object value, ValueWriter writer )
@Override @Override
int hashCode( Object array ) int hashCode( Object array )
{ {
return BooleanArrayValue.hash( (boolean[]) array ); return DirectBooleanArray.hash( (boolean[]) array );
} }


@Override @Override
Expand Down

0 comments on commit 57b0bbb

Please sign in to comment.