Source code: com/phoenixst/plexus/examples/Prism.java
1 /*
2 * $Id: Prism.java,v 1.1 2003/09/02 20:31:17 rconner Exp $
3 *
4 * Copyright (C) 1994-2003 by Phoenix Software Technologists,
5 * Inc. and others. All rights reserved.
6 *
7 * THIS PROGRAM AND DOCUMENTATION IS PROVIDED UNDER THE TERMS OF THE
8 * COMMON PUBLIC LICENSE ("AGREEMENT") WHICH ACCOMPANIES IT. ANY
9 * USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
10 * RECIPIENT'S ACCEPTANCE OF THE AGREEMENT.
11 *
12 * The license text can also be found at
13 * http://opensource.org/licenses/cpl.php
14 */
15
16 package com.phoenixst.plexus.examples;
17
18 import com.phoenixst.plexus.operations.*;
19
20
21 /**
22 * An <code>m x n</code> prism, where <code>m</code> is the size of
23 * the cycle and <code>n</code> is the size of the path. This graph
24 * is pretty much a cylinder, but takes its name from the fact that
25 * if the cycle is of size 3, then it looks like a prism.
26 *
27 * @version $Revision: 1.1 $
28 * @author Ray A. Conner
29 *
30 * @since 1.0
31 */
32 public class Prism extends Product
33 {
34
35 private int m;
36 private int n;
37
38
39 /**
40 * Creates a new <code>Prism</code>.
41 */
42 public Prism( int m, int n )
43 {
44 super( new Cycle( m ),
45 new Path( n ) );
46 this.m = m;
47 this.n = n;
48 }
49
50
51 public String toString()
52 {
53 return "Prism( " + m + ", " + n + " )";
54 }
55
56 }