1
//////////////////////////////////////////////////////////////////////
3
// JCSP ("CSP for Java") Libraries //
4
// Copyright (C) 1996-2008 Peter Welch and Paul Austin. //
5
// 2001-2004 Quickstone Technologies Limited. //
7
// This library is free software; you can redistribute it and/or //
8
// modify it under the terms of the GNU Lesser General Public //
9
// License as published by the Free Software Foundation; either //
10
// version 2.1 of the License, or (at your option) any later //
13
// This library is distributed in the hope that it will be //
14
// useful, but WITHOUT ANY WARRANTY; without even the implied //
15
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR //
16
// PURPOSE. See the GNU Lesser General Public License for more //
19
// You should have received a copy of the GNU Lesser General //
20
// Public License along with this library; if not, write to the //
21
// Free Software Foundation, Inc., 59 Temple Place, Suite 330, //
22
// Boston, MA 02111-1307, USA. //
24
// Author contact: P.H.Welch@kent.ac.uk //
27
//////////////////////////////////////////////////////////////////////
29
package org.jcsp.net.settings;
32
* Used internally within the JCSP network infrastructure to represent a connection oriented protocol.
34
* @author Quickstone Technologies Limited
36
public class ConnectionOriented extends Spec implements Req
38
ConnectionOriented(boolean connectionOriented, boolean isReq)
40
super(SPEC_NAME_CONNECTION_ORIENTED, true, isReq);
41
this.connectionOriented = connectionOriented;
44
public String getStringValue()
46
return "" + connectionOriented;
49
public boolean getValue()
51
return connectionOriented;
54
public Class getType()
59
public String getComparator()
61
return REQ_COMPARATOR_EQUALS;
64
public int getIntValue()
66
throw new UnsupportedOperationException("Type is boolean");
69
public double getDoubleValue()
71
throw new UnsupportedOperationException("Type is boolean");
74
public boolean getBooleanValue()
79
public boolean equals(Object o)
81
if(o instanceof ConnectionOriented)
83
ConnectionOriented other = (ConnectionOriented) o;
84
return connectionOriented == other.connectionOriented;
91
if(connectionOriented)
97
private boolean connectionOriented;
b'\\ No newline at end of file'