org.archive.wayback.util.graph
Class GraphEncoder

java.lang.Object
  extended by org.archive.wayback.util.graph.GraphEncoder

public class GraphEncoder
extends Object

Author:
brad

Constructor Summary
GraphEncoder()
           
 
Method Summary
static Graph decode(String encodedGraph, boolean noMonth)
          convert a String-encoded graph into a usable Graph object, using default GraphConfiguration
static Graph decode(String encodedGraph, GraphConfiguration config)
          convert a String-encoded graph into a usable Graph object, using the provided GraphConfiguration.
static String encode(Graph g)
          Convert a complete Graph into an opaque String that can later be re-assembled into a Graph object.
static String encode(int width, int height, RegionData[] data)
          Convert a Graph fields into an opaque String that can later be re-assembled into a Graph object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GraphEncoder

public GraphEncoder()
Method Detail

decode

public static Graph decode(String encodedGraph,
                           boolean noMonth)
                    throws GraphEncodingException
convert a String-encoded graph into a usable Graph object, using default GraphConfiguration

Parameters:
encodedGraph - String encoded graph, as returned by getEncoded()
noMonth - if true, disable the month highlight color
Returns:
a Graph, ready to use
Throws:
GraphEncodingException - if there were problems with the encoded data

decode

public static Graph decode(String encodedGraph,
                           GraphConfiguration config)
                    throws GraphEncodingException
convert a String-encoded graph into a usable Graph object, using the provided GraphConfiguration.

Parameters:
encodedGraph - String encoded graph, as returned by getEncoded()
config - the GraphConfiguration to use
Returns:
a Graph, ready to use
Throws:
GraphEncodingException - if there were problems with the encoded data

encode

public static String encode(Graph g)
Convert a complete Graph into an opaque String that can later be re-assembled into a Graph object. Note that GraphConfiguration information is NOT encoded into the opaque String.

Parameters:
g - Graph to encode
Returns:
opaque String which can later be used with decode()

encode

public static String encode(int width,
                            int height,
                            RegionData[] data)
Convert a Graph fields into an opaque String that can later be re-assembled into a Graph object. Note that GraphConfiguration information is NOT encoded into the opaque String.

Parameters:
width - of the Graph
height - of the Graph
data - array of RegionData for the graph
Returns:
opaque String which can later be used with decode()


Copyright © 2005-2011 Internet Archive. All Rights Reserved.