Skip to content

Commit

Permalink
Cleaned up superclass
Browse files Browse the repository at this point in the history
  • Loading branch information
OliviaYtterbrink committed Jan 16, 2018
1 parent ca8f632 commit 9a774c4
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 13 deletions.
Expand Up @@ -59,7 +59,7 @@ public char direction( int end )
}
}

public String name()
String name()
{
return String.valueOf( direction( npointValues[1] ) );
}
Expand All @@ -74,6 +74,12 @@ public CurveRule childAt( int npoint )
{
return children[npoint];
}

@Override
public String toString()
{
return name();
}
}

private static HashMap<String,HilbertCurve2D> curves = new LinkedHashMap<>();
Expand Down
Expand Up @@ -108,7 +108,7 @@ private char direction( int start, int end )
}
}

public String name()
String name()
{
return String.valueOf( direction( npointValues[0], npointValues[1] ) ) + direction( npointValues[1], npointValues[2] ) +
direction( npointValues[0], npointValues[length() - 1] );
Expand Down Expand Up @@ -209,6 +209,12 @@ public CurveRule childAt( int npoint )
}
return children[npoint];
}

@Override
public String toString()
{
return name();
}
}

static HashMap<String,HilbertCurve3D> curves = new LinkedHashMap<>();
Expand Down
Expand Up @@ -65,13 +65,6 @@ int indexForNPoint( int npoint )
}

abstract CurveRule childAt( int npoint );

abstract String name();

public String toString()
{
return name();
}
}

private final Envelope range;
Expand Down
Expand Up @@ -36,15 +36,16 @@ private ZOrderCurve2D( int... npointValues )
assert npointValues[0] == 1 && npointValues[3] == 2;
}

public String name()
@Override
public CurveRule childAt( int npoint )
{
return "Z";
return this;
}

@Override
public CurveRule childAt( int npoint )
public String toString()
{
return this;
return "Z";
}
}

Expand Down

0 comments on commit 9a774c4

Please sign in to comment.