query
stringlengths
7
33.1k
document
stringlengths
7
335k
metadata
dict
negatives
listlengths
3
101
negative_scores
listlengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Connecting to a secondary interface is the same as any other interface
@Override public void onServiceConnected(ComponentName name, IBinder service) { mSecondService = ISecondary.Stub.asInterface(service); mKillBtn.setEnabled(true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void connect();", "public void connect();", "public void connect();", "@Override\n public abstract void connect();", "public void connect() {}", "public abstract void connectSystem();", "Interface getInterfaceByName(ConnectPoint connectPoint, String name);", "void onConnectToNetByIPSucces();", "public interface Connector {\n}", "@Override\n\tpublic void connect() {\n\t\t\n\t}", "@Override\n\tpublic void connect() {\n\t\t\n\t}", "void onConnect(SocketIOOutbound outbound);", "public static interface IUserInterfaceConnection {\n\n public void onLoginMsg(LoginResponse msg);\n\n public void onMessageMsg(MessageResponse msg);\n\n }", "@Override\n \tpublic void setOutboundInterface(InetAddress arg0) {\n \t}", "@Override\n public boolean isConnectable() {\n return true;\n }", "public interface InputPort extends Component, AbstractConnectionSource {\n}", "public interface InterfaceClient extends Remote {\n\n double seConnecter(Client client) throws RemoteException;\n\n \n\n boolean peutReserver(Reservation rv) throws RemoteException;\n\n void visualiser(Vehicule voiture) throws RemoteException;\n\n \n \n \n void deconnexion() throws RemoteException;\n\n boolean sinscrire(Client client) throws RemoteException;\n\n void inscriptionReussite(Client client) throws RemoteException;\n}", "public void connecting() {\n\n }", "private void connect(InProgInfo inProg, String address, String port, String interfaceName) throws InterruptedException\n {\n \n System.out.println(\"Starting connection to Real Time Session...\");\n \n channelSessions.add(new EDFChannelSession());\n if (channelSessions.get(channelSessions.size() - 1).initTransport(false, error) < CodecReturnCodes.SUCCESS)\n System.exit(error.errorId());\n\n // enable XML tracing\n if (CommandLine.booleanValue(\"x\"))\n {\n channelSessions.get(channelSessions.size() - 1).enableXmlTrace(dictionaryHandler.dictionary());\n }\n\n // get connect options from the channel session\n ConnectOptions copts = channelSessions.get(channelSessions.size() - 1).getConnectOptions();\n\n // set the connection parameters on the connect options\n copts.unifiedNetworkInfo().address(address);\n copts.unifiedNetworkInfo().serviceName(port);\n copts.unifiedNetworkInfo().interfaceName(interfaceName);\n copts.blocking(false);\n copts.connectionType(ConnectionTypes.SEQUENCED_MCAST);\n\n channelSessions.get(channelSessions.size() - 1).connect(inProg, error);\n }", "@Override\n public void establishConnectionWithYourTower() {\n }", "public interface DataRelayClient {\n\n /**\n * Send data in a loop over UDP\n */\n public void streamData(String pathToFile) throws IOException;\n\n /**\n * Receive data in a loop via UDP\n */\n public void receiveData() throws IOException;\n\n /**\n * Initialize TCP connection\n */\n public void initializeTCP() throws IOException;\n /**\n * Initialize UDP connection\n */\n public void initializeUDP() throws IOException;\n\n /**\n * Get client ID from the server\n */\n public void setID() throws IOException;\n\n /**\n * Check if client is first to connect\n */\n public boolean isFirstToConnect() throws IOException;\n\n /**\n * Initialize the client\n */\n public void initialize() throws Exception;\n}", "@Override\r\n public void onDeviceConnecting(GenericDevice mDeviceHolder,\r\n PDeviceHolder innerDevice) {\n\r\n }", "public interface IConnectService {\n\n\n}", "interface Connect extends RconConnectionEvent, Cancellable {}", "protected abstract void onConnect();", "public abstract void onConnect();", "public interface ISocketEchoServer extends ISocketServer\r\n{\r\n\r\n}", "public void connect() throws IOException {\n/* 151 */ this.delegate.connect();\n/* */ }", "public interface DsViaListenInterface extends DsListenInterface {\n\n /** @return port to be used as the source port of outgoing requests */\n public int getSourcePort();\n\n /** @return the interface to be used as the source port of outgoing requests */\n public InetAddress getSourceAddress();\n}", "abstract void onConnect();", "@ArchTypeComponent(\n patterns = {@Pattern(name=\"testLayered\", kind = \"Layered\", role=\"Layer{1}\")}\n )\npublic interface ServerConnector { \n \n /** Send the on-the-wire string to the server side. \n * \n * @param onTheWireFormat the observation in the adopted \n * on-the-wire format. \n * @return a future that will eventually tell the status \n * of the transmission. \n */ \n public FutureResult sendToServer(String onTheWireFormat) throws IOException; \n \n /** Send a query for a set of observations to the server. \n * \n * @param query the query for observations. Use one of \n * those defined in the forwarder.query sub package as \n * these are the ONLY ones the server understands. \n * @param reponseType define the type of the \n * returned observations, either as a list of \n * StandardTeleObserations or as PHMR documents. \n * @return a future with the query result as one big \n * string that needs deserializing before it can \n * by understood. \n * @throws IOException \n * @throws Net4CareException \n * @throws UnknownCPRException \n */ \n\tpublic FutureResultWithAnswer queryToServer(Query query) throws IOException, Net4CareException; \n\t \n }", "public interface RobotCommunicationProtocol {\n}", "public void connect() { \t\n \tbindService(IChatService.class, apiConnection);\n }", "abstract T connect();", "interface Fixable extends TcpSocket, Connector.Fixable {}", "default void connect() { }", "public interface RobotConnectionManager {\n RobotConnection getConnection();\n}", "public void connectInterface(int interfaceNumber, SimEnt link, SimEnt node)\n\t{\n\t\tif(!uniqueAddress(node._id))\n\t\t{\n\t\t\tSystem.out.println(\"IP Address is not unique\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif (interfaceNumber<_interfaces && _routingTable[interfaceNumber] == null)\n\t\t{\n\t\t\t_routingTable[interfaceNumber] = new RouteTableEntry(node._id, link);\n\t\t\tSystem.out.println(node.toString() + \" Successfully connected to \" + this.toString());\n\t\t}\n\t\telse\n\t\t{\n\t\t\tSystem.out.println(\"Trying to connect to port not in router\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t((Link) link).setConnector(this);\n\t}", "public interface NetworkInterface {\n\n\t// starting the network on the given port at the localhost\n\tpublic void startNetwork(int port);\n\n\t// stopping the local network\n\tpublic void stopNetwork();\n\t\n\t\n}", "public interface ServerIF extends RemoteIF{\n void RegisterClient(ClientIF client) throws RemoteException;\n void WelcomeScreen() throws RemoteException;\n ArrayList<ClientIF> getClients() throws RemoteException;\n}", "@Override\n\tpublic void connect() throws IOException {\n\n\t}", "public interface IsisInterface {\n\n /**\n * Sets interface index.\n *\n * @param interfaceIndex interface index\n */\n void setInterfaceIndex(int interfaceIndex);\n\n /**\n * Sets intermediate system name.\n *\n * @param intermediateSystemName intermediate system name\n */\n void setIntermediateSystemName(String intermediateSystemName);\n\n /**\n * Sets system ID.\n *\n * @param systemId system ID\n */\n void setSystemId(String systemId);\n\n /**\n * Sets LAN ID.\n *\n * @param lanId LAN ID\n */\n void setLanId(String lanId);\n\n /**\n * Sets ID length.\n *\n * @param idLength ID length\n */\n void setIdLength(int idLength);\n\n /**\n * Sets max area addresses.\n *\n * @param maxAreaAddresses max area addresses\n */\n void setMaxAreaAddresses(int maxAreaAddresses);\n\n /**\n * Sets reserved packet circuit type.\n *\n * @param reservedPacketCircuitType reserved packet circuit type\n */\n void setReservedPacketCircuitType(int reservedPacketCircuitType);\n\n /**\n * Sets point to point.\n *\n * @param p2p point to point\n */\n void setP2p(int p2p);\n\n /**\n * Sets area address.\n *\n * @param areaAddress area address\n */\n void setAreaAddress(String areaAddress);\n\n /**\n * Sets area length.\n *\n * @param areaLength area length\n */\n void setAreaLength(int areaLength);\n\n /**\n * Sets link state packet ID.\n *\n * @param lspId link state packet ID\n */\n void setLspId(String lspId);\n\n /**\n * Sets holding time.\n *\n * @param holdingTime holding time\n */\n void setHoldingTime(int holdingTime);\n\n /**\n * Sets priority.\n *\n * @param priority priority\n */\n void setPriority(int priority);\n\n /**\n * Sets hello interval.\n *\n * @param helloInterval hello interval\n */\n void setHelloInterval(int helloInterval);\n}", "public void connectTo(IReceiver receiver) {\n\t\tConnector s = receiver.newConnector();\n\t\tconnectTo(s);\n\t}", "@Override\n public void connecterFibreOptique() throws ConnecteurException, RemoteException, MalformedURLException, NotBoundException {\n Naming.rebind(url, (ConnecteurRemoteInterface) this);\n \n // Enregistrement de tous les autres connecteurs\n // et notification a tous les autres connecteurs\n for (String name : Naming.list(\"rmi://localhost:1099/\")) {\n name = \"rmi:\" + name;\n if (!name.equals(url)) {\n Remote o = Naming.lookup(name);\n if (o instanceof ConnecteurRemoteInterface) {\n // Enregistrement du connecteur courant\n System.out.println(url + \": \\tEnregistrement auprès de \" + name);\n ((ConnecteurRemoteInterface) o).enregistrerConnecteur(url, controleurUrl);\n // Enregistrement d'un connecteur distant\n enregistrerConnecteur(name, (ConnecteurRemoteInterface) o);\n }\n else if (o instanceof PrismeRemoteInterface) {\n if (prisme == null) {\n this.prismeUrl = name;\n prisme = (PrismeRemoteInterface) o;\n prisme.enregisterConnecteur(url);\n }\n else {\n throw new ConnecteurException(\"Plusieurs prismes semblent exister.\");\n }\n }\n }\n }\n connecteur.connecter();\n }", "public interface CommunicationDevice {\n String getAddress();\n\n CommunicationSocket createCommunicationSocket(UUID uuid) throws IOException;\n}", "public interface IMainView {\n void openSocket();\n void closeSocket();\n}", "@Override\n\tpublic void connect() throws IOException {\n\t}", "private void connect(InProgInfo inProg, int serverSelect) throws InterruptedException\n {\n String hostName = new String(seqMcastInfo.streamingMCastChanServerList().get(serverSelect).data().array());\n String portNumber = seqMcastInfo.streamingMCastChanPortList().get(serverSelect).toString();\n String interfaceName = CommandLine.value(\"rtif\");\n \n System.out.println(\"Starting connection to Real Time Session...\");\n \n channelSessions.add(new EDFChannelSession(this));\n if (channelSessions.get(channelSessions.size() - 1).initTransport(false, error) < CodecReturnCodes.SUCCESS)\n System.exit(error.errorId());\n\n // enable XML tracing\n if (CommandLine.booleanValue(\"x\"))\n {\n channelSessions.get(channelSessions.size() - 1).enableXmlTrace(dictionaryHandler.dictionary());\n }\n\n // get connect options from the channel session\n ConnectOptions copts = channelSessions.get(channelSessions.size() - 1).getConnectOptions();\n\n // set the connection parameters on the connect options\n copts.unifiedNetworkInfo().address(hostName);\n copts.unifiedNetworkInfo().serviceName(portNumber);\n copts.unifiedNetworkInfo().interfaceName(interfaceName);\n copts.blocking(false);\n copts.connectionType(ConnectionTypes.SEQUENCED_MCAST);\n\n channelSessions.get(channelSessions.size() - 1).connect(inProg, error);\n \n channelSessions.get(channelSessions.size() - 1).channelInfo().connectOptions(copts);\n\n serversConnectedTo.add(serverSelect);\n }", "public interface ChannelConnection {\n public Channel getChannel();\n public Connector getConnector();\n}", "public interface TCNetworkManageInterface {\n\n public String serviceIdentifier();\n\n public String apiClassPath();\n\n public String apiMethodName();\n}", "public void connect() throws IOException;", "@Override\n \tpublic void setOutboundInterface(InetSocketAddress arg0) {\n \t\t\n \t}", "private boolean isConnectable (RoadInterface newObj) {\n boolean result = false;\n if (newObj instanceof Intersection) {\n result = true;\n }\n return (result);\n }", "public interface ModuleConnector {\n /**\n * Connection the reader through serial port.\n * @param port The serial port;\n * @param baud The baud rate;\n * @return if true connecting success,or failed.\n */\n ReaderHelper connectCom(final String port, final int baud);\n\n /**\n * Connection the reader through the network;\n * @param host The ip address;\n * @param port The prot;\n * @return if true connecting success,or failed.\n */\n ReaderHelper connectNet(final String host, final int port);\n\n /**\n * Different data transmission form can import via I/O stream. \n * @param in read steam.\n * @param out write steam.\n * @return {@link #ReaderHelper} return the core class to operate Reader.\n */\n ReaderHelper connect(final InputStream in, final OutputStream out);\n /**\n * Verify the the connection is available or not.\n * @return if true connection available,or unavailable;\n */\n boolean isConnected();\n\n /**\n * Interrupt the connection;\n */\n void disConnect();\n}", "interface ConnectToNetByIPCallback {\n\n /**\n * Method is called after user connected to net via specific IP number ended with success.\n */\n void onConnectToNetByIPSucces();\n\n /**\n * Method is called after host with specific IP number reject user request.\n */\n void onConnectToNetByIPReject();\n\n /**\n * Method is called after failure when connecting to specific net.\n */\n void onConnectToNetByIPFailure();\n\n\n void onIPFormatFailure();\n }", "public interface InterFace2 extends InterFace2Operations, org.omg.CORBA.Object, org.omg.CORBA.portable.IDLEntity \r\n{\r\n}", "public interface ChatInterface extends Remote {\r\n void postMessage(String msg) throws RemoteException;\r\n\r\n String getName() throws RemoteException;\r\n\r\n void setClient(ChatInterface c) throws RemoteException;\r\n\r\n ChatInterface getClient() throws RemoteException;\r\n\r\n}", "public void connectTo(NAddress address) throws IOException;", "public void connectedTo(ServerDescriptor desc);", "public interface RemoteDBConnection extends Remote, DBConnection {\n\n\t/**\n\t * Key the database connection in registered with in RMI registry.\n\t */\n\tpublic static final String REGISTRY_KEY = \"DBConnection\";\n}", "public interface Switchable {\n\n /**\n * This method connects device to energy network, and change flag (to true) responsible for the condition of the network device.\n */\n public void switchOn();\n\n /**\n * This method disconnects device from energy network, and change flag (to false) responsible for the condition of the network device.\n */\n public void switchOff();\n\n /**\n * Method return the state of device in energy network.\n * True - the power switched on, false - switched off.\n */\n public boolean isSwitched();\n\n}", "public interface ClientRemoteDoor extends Remote{\n public int query_state_door(int id) throws RemoteException;\n\n}", "public interface WifiConnectionStateInterface {\n void checkSocketConnection();\n}", "public interface connect {\n\t\t/**\n\t\t * 连接 获取推送\n\t\t */\n\t\tpublic String connect = \"/user/connect\";\n\n\t}", "public void bind(Interface i) {\n\t\t_interface = i;\n\t}", "@Test\n public void testGetInterfaceForPeer() {\n replay(participantsConfig);\n\n peerManager.activate();\n\n assertEquals(intfSw1Eth1, peerManager\n .getInterfaceForPeer(IpAddress.valueOf(PEER_IP)));\n }", "public abstract Object getInterface(String strInterfaceName_p, Object oObject_p) throws Exception;", "public interface Protocol {\n\n void startup();\n}", "public interface ClientCallbackSIMON_IF // extends ClientCallback_IF\n{\n public void callback(String text);\n\n public void ping();\n\n}", "public interface Main2Ipresenter {\n void sendString(String name);\n}", "public interface ErisConnectionListener extends ErisInternetConnectionListner{\n public void onConnect(boolean value);\n public void onDisconnect();\n public void onException(Exception e);\n}", "public interface RMIInterface extends Remote {\n\n public String helloTo(String name) throws RemoteException;\n\n}", "public synchronized void connect(java.io.PipedReader snk) throws java.io.IOException { throw new RuntimeException(\"Stub!\"); }", "NetworkInterface getNetworkInterface(int id);", "public void addVlanHostInterface2() throws JNCException {\n setLeafValue(Routing.NAMESPACE,\n \"vlan-host-interface2\",\n null,\n childrenNames());\n }", "@Override\n \tpublic void reconnectingIn(int arg0) {\n \t}", "public interface Communicator {\n public void respond(String data);\n public void goTo(String data);\n public void createSession(String key,String Value);\n public String getSession();\n}", "public void setOdlOpenflowInterface2(String x) throws SnmpStatusException;", "@Override\n\tprotected void onNetworkConnected(NetType type) {\n\n\t}", "private void openConnection () {\n String[] labels = {\"Host :\", \"Port :\"};\n String[] initialValues = {\"localhost\", \"1111\"};\n StandardDialogClient openHandler = new StandardDialogClient () {\n\t@Override\n\tpublic void dialogDismissed (StandardDialog d, int code) {\n\t try {\n\t InputDialog inputD = (InputDialog)d;\n\t if (inputD.wasCancelled ()) return;\n\t String[] results = inputD.getResults ();\n\t String host = results[0];\n\t String port = results[1];\n\t TwGateway connection =\n\t (TwGateway)TwGateway.openConnection (host, port);\n\t // The following call will fail if the G2 is secure.\n\t connection.login();\n\t setConnection (connection);\n\t } catch (Exception e) {\n\t new WarningDialog (null, \"Error During Connect\", true, e.toString (), null).setVisible (true);\n\t }\n\t}\n };\t \n\n new ConnectionInputDialog (getCurrentFrame (), \"Open Connection\",\n\t\t\t\t true, labels, initialValues,\n\t\t\t\t (StandardDialogClient) openHandler).setVisible (true);\n }", "public void testAddRelay2ToAnAlreadyConnectedChannel() throws Exception {\n // Create and connect a channel.\n a=new JChannel();\n a.connect(SFO_CLUSTER);\n System.out.println(\"Channel \" + a.getName() + \" is connected. View: \" + a.getView());\n\n // Add RELAY2 protocol to the already connected channel.\n RELAY2 relayToInject = createRELAY2(SFO);\n // Util.setField(Util.getField(relayToInject.getClass(), \"local_addr\"), relayToInject, a.getAddress());\n\n a.getProtocolStack().insertProtocolAtTop(relayToInject);\n for(Protocol p=relayToInject; p != null; p=p.getDownProtocol())\n p.setAddress(a.getAddress());\n relayToInject.setProtocolStack(a.getProtocolStack());\n relayToInject.configure();\n relayToInject.handleView(a.getView());\n\n // Check for RELAY2 presence\n RELAY2 ar=a.getProtocolStack().findProtocol(RELAY2.class);\n assert ar != null;\n\n waitUntilRoute(SFO, true, 10000, 500, a);\n\n assert !ar.printRoutes().equals(\"n/a (not site master)\") : \"This member should be site master\";\n\n Route route=getRoute(a, SFO);\n System.out.println(\"Route at sfo to sfo: \" + route);\n assert route != null;\n }", "public interface IConnectionManager {\n void dial(String phoneNumber);\n\n void hangup();\n}", "public abstract boolean SourceSinkSide( Communicator comm);", "public void connect() {\n try {\n // ghetto hardcode the parameters\n ORB orb = ORB.init(new String[]{\"-ORBInitialHost\", \"localhost\", \"-ORBInitialPort\", \"8989\"}, null);\n\n org.omg.CORBA.Object objRef = orb.resolve_initial_references(\"NameService\");\n NamingContext ncRef = NamingContextHelper.narrow(objRef);\n\n NameComponent nc = new NameComponent(station, \"\");\n NameComponent path[] = {nc};\n instance = StationInterfaceHelper.narrow(ncRef.resolve(path));\n\n this.log.log(\"Connected!\");\n } catch (Exception ex) {\n log.log(ex.toString() + ex.getMessage());\n }\n }", "@Override\n\tpublic void common() {\n\t\tSystem.out.println(\"hello from common() for MyInterface2,MyInterface1 \");\n\t}", "public void connect() {\n\t\tint index = shell.getConnectionsCombo().getSelectionIndex();\n\t\tif (profiles.length == 0 || index < 0 || index >= profiles.length) {\n\t\t\tupdateSelection();\n\t\t\treturn;\n\t\t}\n\t\tIConnectionProfile profile = profiles[index];\n\t\tshell.setEnabled(false);\n\t\tnetworkManager.connect(profile, (s, r) -> {\n\t\t\tif (s) {\n\t\t\t\tcompleted = true;\n\t\t\t\tclose();\n\t\t\t} else {\n\t\t\t\tplugin.sync(() -> {\n\t\t\t\t\tMessageBox messageBox = new MessageBox(shell.isDisposed() ? null : shell, SWT.ICON_ERROR);\n\t\t\t\t\tmessageBox.setMessage(\"Failed to connect!\\n\" + r);\n\t\t\t\t\tmessageBox.open();\n\t\t\t\t\tshell.setEnabled(true);\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}", "private ISocket acceptISocket() throws IOException {\n // Manage client depending the connection\n if (serverSocket instanceof AdHocServerSocketBluetooth) {\n return new AdHocSocketBluetooth((BluetoothSocket) serverSocket.accept());\n } else {\n return new AdHocSocketWifi((Socket) serverSocket.accept());\n }\n }", "Port getPort2();", "public void connect(FilterFramework filter) {\n try {\n // Connect this filter's input to the upstream pipe's output stream\n PipedInputStream pis = new PipedInputStream();\n PipedOutputStream pos = new PipedOutputStream();\n pis.connect(pos);\n inputPipedReadPorts.add(pis);\n ObjectOutputStream objectOutputStream = new ObjectOutputStream(pos);\n ObjectInputStream objectInputStream = new ObjectInputStream(pis);\n inputReadPorts.add(objectInputStream);\n filter.addOutputStream(pos, objectOutputStream);\n } catch (Exception Error) {\n System.out.println(\"\\n\" + this.getName() + \" FilterFramework error connecting::\" + Error);\n } // try-catch\n }", "private Link moveInterface(NetworkAddr networkAddr, int newInterface) {\n\t\tif(_routingTable[newInterface] != null) {\n\t\t\treturn null;\n\t\t}\n\t\tLink link = (Link)removeFromInterface(networkAddr);\n\t\tLink newLink = new Link();\n\t\tnewLink.setConnector(link.getOther(this));\n\t\tnewLink.setConnector(this);\n\t\tconnectInterface(newInterface, newLink , link.getOther(this));\n\t\tlink.removeConnector(link.getOther(this));\n\t\tlink.removeConnector(this);\n\t\t\n\t\treturn newLink;\n\t}", "public interface IsisInterface {\n\n /**\n * Returns interface index.\n *\n * @return interface index\n */\n int interfaceIndex();\n\n /**\n * Sets interface index.\n *\n * @param interfaceIndex interface index\n */\n void setInterfaceIndex(int interfaceIndex);\n\n /**\n * Returns the interface IP address.\n *\n * @return interface IP address\n */\n Ip4Address interfaceIpAddress();\n\n /**\n * Sets the interface IP address.\n *\n * @param interfaceIpAddress interface IP address interface IP address\n */\n void setInterfaceIpAddress(Ip4Address interfaceIpAddress);\n\n /**\n * Returns the network mask.\n *\n * @return network mask\n */\n byte[] networkMask();\n\n /**\n * Sets the network mask.\n *\n * @param networkMask network mask\n */\n void setNetworkMask(byte[] networkMask);\n\n /**\n * Sets the interface MAC address.\n *\n * @param interfaceMacAddress interface MAC address\n */\n void setInterfaceMacAddress(MacAddress interfaceMacAddress);\n\n /**\n * Returns the neighbors list.\n *\n * @return neighbors list\n */\n Set<MacAddress> neighbors();\n\n /**\n * Sets intermediate system name.\n *\n * @param intermediateSystemName intermediate system name\n */\n void setIntermediateSystemName(String intermediateSystemName);\n\n /**\n * Returns system ID.\n *\n * @return systemID system ID\n */\n String systemId();\n\n /**\n * Sets system ID.\n *\n * @param systemId system ID\n */\n void setSystemId(String systemId);\n\n /**\n * Returns LAN ID.\n *\n * @return LAN ID\n */\n String l1LanId();\n\n /**\n * Sets LAN ID.\n *\n * @param lanId LAN ID\n */\n void setL1LanId(String lanId);\n\n /**\n * Returns LAN ID.\n *\n * @return LAN ID\n */\n String l2LanId();\n\n /**\n * Sets LAN ID.\n *\n * @param lanId LAN ID\n */\n void setL2LanId(String lanId);\n\n /**\n * Sets ID length.\n *\n * @param idLength ID length\n */\n void setIdLength(int idLength);\n\n /**\n * Sets max area addresses.\n *\n * @param maxAreaAddresses max area addresses\n */\n void setMaxAreaAddresses(int maxAreaAddresses);\n\n /**\n * Returns reserved packet circuit type.\n *\n * @return reserved packet circuit type\n */\n int reservedPacketCircuitType();\n\n /**\n * Sets reserved packet circuit type.\n *\n * @param reservedPacketCircuitType reserved packet circuit type\n */\n void setReservedPacketCircuitType(int reservedPacketCircuitType);\n\n /**\n * Returns point to point or broadcast.\n *\n * @return 1 if point to point, 2 broadcast\n */\n IsisNetworkType networkType();\n\n /**\n * Sets point to point.\n *\n * @param networkType point to point\n */\n void setNetworkType(IsisNetworkType networkType);\n\n /**\n * Returns area address.\n *\n * @return area address\n */\n String areaAddress();\n\n /**\n * Sets area address.\n *\n * @param areaAddress area address\n */\n void setAreaAddress(String areaAddress);\n\n /**\n * Sets area length.\n *\n * @param areaLength area length\n */\n void setAreaLength(int areaLength);\n\n /**\n * Returns holding time.\n *\n * @return holding time\n */\n int holdingTime();\n\n /**\n * Sets holding time.\n *\n * @param holdingTime holding time\n */\n void setHoldingTime(int holdingTime);\n\n /**\n * Returns priority.\n *\n * @return priority\n */\n int priority();\n\n /**\n * Sets priority.\n *\n * @param priority priority\n */\n void setPriority(int priority);\n\n /**\n * Returns hello interval.\n *\n * @return hello interval\n */\n public int helloInterval();\n\n /**\n * Sets hello interval.\n *\n * @param helloInterval hello interval\n */\n void setHelloInterval(int helloInterval);\n\n /**\n * Starts the hello timer which sends hello packet every configured seconds.\n *\n * @param channel netty channel instance\n */\n void startHelloSender(Channel channel);\n\n /**\n * Stops the hello timer which sends hello packet every configured seconds.\n */\n void stopHelloSender();\n\n /**\n * Processes an ISIS message which is received on this interface.\n *\n * @param isisMessage ISIS message instance\n * @param isisLsdb ISIS LSDB instance\n * @param channel channel instance\n */\n void processIsisMessage(IsisMessage isisMessage, IsisLsdb isisLsdb, Channel channel);\n\n /**\n * Returns the interface state.\n *\n * @return interface state\n */\n IsisInterfaceState interfaceState();\n\n /**\n * Sets the interface state.\n *\n * @param interfaceState the interface state\n */\n void setInterfaceState(IsisInterfaceState interfaceState);\n\n /**\n * Returns the LSDB instance.\n *\n * @return LSDB instance\n */\n IsisLsdb isisLsdb();\n\n /**\n * Returns intermediate system name.\n *\n * @return intermediate system name\n */\n String intermediateSystemName();\n\n /**\n * Returns the ISIS neighbor instance if exists.\n *\n * @param isisNeighborMac mac address of the neighbor router\n * @return ISIS neighbor instance if exists else null\n */\n IsisNeighbor lookup(MacAddress isisNeighborMac);\n\n /**\n * Returns circuit ID.\n *\n * @return circuit ID\n */\n String circuitId();\n\n /**\n * Sets circuit ID.\n *\n * @param circuitId circuit ID\n */\n void setCircuitId(String circuitId);\n\n /**\n * Removes neighbor from the interface neighbor map.\n *\n * @param isisNeighbor ISIS neighbor instance\n */\n void removeNeighbor(IsisNeighbor isisNeighbor);\n\n /**\n * Removes all the neighbors.\n */\n void removeNeighbors();\n}", "public void connectObject(Remote remoteObj)\n\tthrows RemoteException\n {\n StubAdapter.connect\n (remoteObj, (com.sun.corba.ee.spi.orb.ORB)ORBManager.getORB()); \n }", "public interface IECTwistedPairMACAddressSetup extends MACaddresssetup {\n}", "public void connect() {\n try {\n socket = connectToBackEnd();\n } catch (IOException ioe) {\n ioe.printStackTrace();\n }\n }", "@Override\n\tpublic boolean canConnect() {\n return false;\n }", "public interface NetInterface {\r\n /**\r\n * 接口有正确响应\r\n * @param result\r\n */\r\n public void onNetResult(String interfaceAction,Object result);\r\n\r\n /**\r\n * 接口调用异常\r\n * @param ex\r\n * @param isOnCallback\r\n */\r\n public void onNetError(String interfaceAction,Throwable ex, boolean isOnCallback);\r\n\r\n public void onNetFinished(String interfaceAction);\r\n\r\n}", "public interface IThingPeerData {\r\n\r\n}", "@Override\n\tpublic boolean connect() {\n\t\treturn false;\n\t}", "interface myClient {\n}", "public void connect() {\n\t\ttry {\n\t\t\tconnection = new Socket(ip, serverPort); // 128.39.83.87 // 127.0.0.1\n\t\t\t\n\t\t\toutput = new BufferedWriter(new OutputStreamWriter(\n connection.getOutputStream()));\n\t\t\tinput = new BufferedReader(new InputStreamReader(\n connection.getInputStream()));\n\t\t\t\n\t\t\tif (hostName.equals(Constants.IDGK + Main.userName))\n\t\t\t\tsendText(\"1\" + Main.userName);\n\t\t\telse\n\t\t\t\tsendText(\"2\" + Main.userName);\n\t\t\t\n\t\t} catch (UnknownHostException e) {\n\t\t\tMain.LOGGER.log(Level.SEVERE, \"Error connecting server\", e);\n\t\t} catch (IOException e) {\n\t\t\tMain.LOGGER.log(Level.WARNING, \"Error making output/input\", e);\n\t\t}\n\t}", "@Override\n\tpublic ConnectionHolder getConnection(Object input, Object input2) throws IOException {\n\t\treturn null;\n\t}" ]
[ "0.64749545", "0.64749545", "0.64749545", "0.6458632", "0.6416273", "0.63553", "0.6299324", "0.6271532", "0.6203072", "0.6135668", "0.6135668", "0.60929036", "0.60532224", "0.60474324", "0.60450524", "0.60396326", "0.59959215", "0.59840107", "0.5955052", "0.5951037", "0.5920367", "0.59163946", "0.5900498", "0.5885097", "0.58793885", "0.5871594", "0.5859233", "0.58514464", "0.58392584", "0.5822735", "0.5807688", "0.5802988", "0.5796519", "0.5789244", "0.5783692", "0.5757943", "0.57572955", "0.5752952", "0.57506317", "0.5744962", "0.5729511", "0.57277864", "0.5722118", "0.57151127", "0.5707402", "0.57056755", "0.5691763", "0.5666912", "0.5648012", "0.5642936", "0.56336385", "0.5631643", "0.56306076", "0.56287885", "0.56147766", "0.5613932", "0.5612331", "0.5606895", "0.5601763", "0.56007063", "0.5596113", "0.5591836", "0.55862075", "0.5578182", "0.55588484", "0.55533177", "0.55510885", "0.55473083", "0.55451053", "0.5544344", "0.55345917", "0.5531256", "0.55308354", "0.552493", "0.5518364", "0.5515671", "0.5514539", "0.55138016", "0.55127263", "0.55036503", "0.5503469", "0.5503363", "0.5501619", "0.5497798", "0.5496479", "0.548907", "0.54878706", "0.5485907", "0.54855293", "0.54754287", "0.54744726", "0.5473397", "0.5472717", "0.5464219", "0.54628307", "0.54564285", "0.5452107", "0.5447062", "0.5443929", "0.54416585", "0.5436161" ]
0.0
-1
A description of item.
@ApiModelProperty(required = true, value = "A description of item.") public String getItemName() { return itemName; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getItemDescription() {\n return itemDescription;\n }", "public String getItemDescription() {\r\n\t\treturn itemDescription;\r\n\t}", "public String getItemDesc() {\n return itemDesc;\n }", "@Override\n\tpublic ItemDescription getItemDescription() {\n\t\tItemDescription item = new ItemDescription();\n\t\titem.title = \"电池充电测试\";\n\t\titem.board = \"通用\";\n\t\titem.desc = \"电池充电\";\n\t\treturn item;\n\t}", "public String getDescription() {return \"Use an item in your inventory\"; }", "public void setItemDescription(String description){\r\n\t\tthis.itemDescription = description;\r\n\t}", "public synchronized String getDescription(){\n \treturn item_description;\n }", "public Item(String description) {\n this.description = description;\n }", "private String getAgendaItemDescription(AgendaItem item) {\n StringBuilder description = new StringBuilder();\n description.append(Parser.parseToHTML(item.getDescription(), true));\n description.append(\"<br/>\");\n description.append(\"<br/><b>Wie</b>: \" + item.getWho());\n description.append(\"<br/><b>Wat</b>: \" + item.getWhat());\n description.append(\"<br/><b>Waar</b>: \" + item.getLocation());\n description.append(\"<br/><b>Wanneer</b>: \" + item.getWhen());\n description.append(\"<br/><b>Kosten</b>: \" + item.getCosts());\n\n return description.toString();\n }", "public CharSequence getDescription() {\n return description;\n }", "public CharSequence getDescription() {\n return description;\n }", "public String getDescription(){\n return getString(KEY_DESCRIPTION);\n }", "@Override\r\n\tpublic String getDescription() {\n\t\treturn description;\r\n\t}", "public String getDesc()\r\n {\r\n return description;\r\n }", "@Override\n public String getDescription()\n {\n return m_description;\n }", "@Override\n\tpublic String getDescription() {\n\t\treturn description;\n\t}", "public String getDescription() { return description; }", "public String getDescription()\r\n\t{\r\n\t\treturn description;\r\n\t}", "public String getItemInformation()\n {\n return this.aDescription + \" qui a un poids de \" + this.aWeight;\n\n }", "public String getDescription() {\n return (desc);\n }", "@Override\n public String getDescription() {\n return descriptionText;\n }", "@Test\n\tvoid descriptionTest() {\n\t\tfor(MedicalItem item: itemList) {\n\t\t\tString expected = \"Name: \" + item.toString() + \"\\nHeal Amount: \" + item.getHealAmount() +\n\t\t\t\t\t\"\\nCures Plague: \" + item.getCure() +\"\\nOutpost Cost: $\" + item.getPrice();\n\t\t\tassertEquals(item.itemDescription(), expected);\n\t\t}\n\t}", "public String getDescription() {\n return description; \n }", "public String getDescription()\n {\n return description;\n }", "@Override\n public String getItemDescription() {\n\treturn \"<html>The rare goblin sword: <br>+4 Strength, +1 craft<br>\"\n\t\t+ \"If you unequipped or loose the sword, you lose 2 lives,<br> unless it would kill you.\";\n }", "@Override\r\n\tpublic String getDescription() {\n\t\treturn this.description;\r\n\t}", "public String getDescription()\r\n {\r\n return description;\r\n }", "public String getDescription() {\n return description;\n }", "public final String getDescription() { return mDescription; }", "@Override\n public String getDescription() {\n return description;\n }", "public String getDescription()\n\t{\n\t\treturn description;\n\t}", "public String getDescription () {\n return description;\n }", "public String getDescription() {\n return desc;\n }", "public String getDescription() {\r\n return Description; \r\n }", "public String getDescription() {\n return desc;\n }", "public String getDescription() {\r\n return description;\r\n }", "public String getDescription() {\r\n return description;\r\n }", "public String getDescription() {\r\n return description;\r\n }", "public String getDescription() {\r\n return description;\r\n }", "public String getDescription() {\r\n return description;\r\n }", "public String getDescription() {\r\n return description;\r\n }", "public String getDescription() {\r\n return description;\r\n }", "public String getDescription() {\r\n return description;\r\n }", "public String getDescription() {\r\n return description;\r\n }", "public String getDescription() {\r\n return description;\r\n }", "public String getDescription() {\n return getString(KEY_DESCRIPTION);\n }", "public String getDescription() {\r\n\t\treturn description;\r\n\t}", "public String getDescription() {\r\n\t\treturn description;\r\n\t}", "public String getDescription() {\r\n\t\treturn description;\r\n\t}", "public String getDescription() {\r\n\t\treturn description;\r\n\t}", "public String getDescription() {\r\n\t\treturn description;\r\n\t}", "public String getDescription() {\r\n\t\treturn description;\r\n\t}", "public String getDescription() {\r\n\t\treturn description;\r\n\t}", "public String getDescription() {\r\n\t\treturn description;\r\n\t}", "public String getDescription()\n {\n return description;\n }", "public String getDescription()\r\n {\r\n\treturn desc;\r\n }", "@Override\n public String getDescription() {\n return this.description;\n }", "public String getDescription() {\n return description;\n }", "public String getDescription() {\n return getGenericFieldValue(\"Description\");\n }", "public String getDescription()\n {\n return description;\n }", "public String getDescription()\n {\n return description;\n }", "public String getDescription()\n {\n return description;\n }", "public String getDescription()\n {\n return description;\n }", "public String getDescription()\n {\n return description;\n }", "public String getDescription()\n {\n return description;\n }", "public String getDescription()\n {\n return description;\n }", "public String getDescription()\n {\n return description;\n }", "public String getDescription()\n {\n return description;\n }", "public String getDescription()\n {\n return description;\n }", "public String getDescription()\n {\n return description;\n }", "public String getDescription()\n {\n return description;\n }", "public String getDescription() {\n return description;\n }", "public String getDescription() {\n return description;\n }", "public String getDescription() {\n return description;\n }", "public String getDescription() {\n return description;\n }", "public String getDescription() {\n return description;\n }", "public String getDescription() {\n return description;\n }", "public String getDescription() {\n return description;\n }", "public String getDescription() {\n return description;\n }", "public String getDescription() {\n return description;\n }", "public String get_description() {\n return description;\n }", "public String getDescription() {\r\n return _description;\r\n }", "public String getDescription() {\n return description;\n }", "public String getDescription() {\n return description;\n }", "public String getDescription() {\n return description;\n }", "public String getDescription() {\n return description;\n }", "public String getDescription() {\n return description;\n }", "public String getDescription() {\n return description;\n }", "public String getDescription() {\n return description;\n }", "public String getDescription() {\n return description;\n }", "public String getDescription() {\n return description;\n }", "public String getDescription() {\n return description;\n }", "public String getDescription() {\n return description;\n }", "public String getDescription() {\n return description;\n }", "public String getDescription() {\n return description;\n }", "public String getDescription() {\n return description;\n }", "public String getDescription() {\n return description;\n }", "public String getDescription() {\n return description;\n }", "public String getDescription() {\n return description;\n }", "public String getDescription() {\n return description;\n }", "public String getDescription() {\n return description;\n }" ]
[ "0.84232825", "0.8388654", "0.8358318", "0.79767036", "0.79290617", "0.78048915", "0.778417", "0.7754086", "0.76555693", "0.7565727", "0.75585455", "0.7504303", "0.7503827", "0.74931794", "0.7482425", "0.74687386", "0.7451296", "0.7451075", "0.74207836", "0.74141985", "0.7407878", "0.7390071", "0.73815286", "0.73761714", "0.73757154", "0.7373162", "0.7368006", "0.73606414", "0.7359418", "0.7349613", "0.73431593", "0.73419476", "0.7337545", "0.733504", "0.7329384", "0.73266894", "0.73266894", "0.73266894", "0.73266894", "0.73266894", "0.73266894", "0.73266894", "0.73266894", "0.73266894", "0.73266894", "0.7325781", "0.7321746", "0.7321746", "0.7321746", "0.7321746", "0.7321746", "0.7321746", "0.7321746", "0.7321746", "0.7318499", "0.73119444", "0.7311332", "0.73047507", "0.7304232", "0.7300052", "0.7300052", "0.7300052", "0.7300052", "0.7300052", "0.7300052", "0.7300052", "0.7300052", "0.7300052", "0.7300052", "0.7300052", "0.7300052", "0.7294535", "0.7294535", "0.7294535", "0.7294535", "0.7294535", "0.7294535", "0.7294535", "0.7294535", "0.7294535", "0.7285221", "0.7284992", "0.72844535", "0.72844535", "0.72844535", "0.72844535", "0.72844535", "0.72844535", "0.72844535", "0.72844535", "0.72844535", "0.72844535", "0.72844535", "0.72844535", "0.72844535", "0.72844535", "0.72844535", "0.72844535", "0.72844535", "0.72844535", "0.72844535" ]
0.0
-1
The amount of the purchase. The tax was calculated on this amount.
@ApiModelProperty(required = true, value = "The amount of the purchase. The tax was calculated on this amount.") public BigDecimal getChargeAmount() { return chargeAmount; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "double getTaxAmount();", "public double getTaxAmount() {\n return taxAmount;\n }", "public MMDecimal getTaxAmount() {\r\n return this.taxAmount;\r\n }", "public double getTax() {\r\n\r\n return getSubtotal() * 0.06;\r\n\r\n }", "public BigDecimal getTotalTaxAmt() {\n\t\treturn totalTaxAmt;\n\t}", "public BigDecimal getTax() {\n return tax;\n }", "public double getTax() {\n return tax_;\n }", "public double getTax() {\n return tax_;\n }", "public BigDecimal getTaxAmt() {\n\t\treturn taxAmt;\n\t}", "public int totalTax()\n {\n double tax = taxRate / 100;\n return (int)Math.round(totalCost() * tax);\n }", "BigDecimal getTax();", "public double getTax(){\n\n return this.tax;\n }", "@Override\n\tpublic double getTax() {\n\t\treturn 0.04;\n\t}", "public CoreComponentTypes.apis.ebay.BasicAmountType getTaxAmount() {\r\n return taxAmount;\r\n }", "public double calcTax() {\n\t\treturn 0.2 * calcGrossWage() ;\n\t}", "public double taxRate () {\n return taxRate;\n }", "public double taxPaying() {\r\n double tax;\r\n if (profit == true) {\r\n tax = revenue / 10.00;\r\n }\r\n\r\n else\r\n tax = revenue / 2.00;\r\n return tax;\r\n }", "public double calculateTax(double amount){\n return (amount*TAX_4_1000)/1000;\n }", "@Override\r\n\tpublic double getTaxValue() {\n\t\treturn 0;\r\n\t}", "public double calculateTax() {\n taxSubtotal = (saleAmount * SALESTAXRATE);\n\n return taxSubtotal;\n }", "@Override\t\n\tpublic double getTax() {\n\t\treturn 0;\n\t}", "public double useTax() {\n \n return super.useTax() + getValue()\n * PER_AXLE_TAX_RATE * getAxles();\n }", "public double getTotal() {\r\n\r\n return getSubtotal() + getTax();\r\n }", "double getTax();", "public BigDecimal getTaxRate() {\n return taxRate;\n }", "public int calculateTax() {\n int premium = calculateCost();\n return (int) Math.round(premium * vehicle.getType().getTax(surety.getSuretyType()));\n }", "public BigDecimal getTaxRate() {\n\n\t\tBigDecimal totalTaxRate = getBasicTaxRate().add(getImportTaxRate());\n\n\t\treturn totalTaxRate;\n\t}", "public Double getTax();", "public double getTaxRate() {\n return taxRate;\n }", "public double taxCharged (){\n return discountedPrice() * taxRate;\n }", "double taxReturn() {\n\t\tdouble ddv = 0;\n\t\tif (d == 'A') {\n\t\t\tddv = 18;\n\t\t} else if (d == 'B') {\n\t\t\tddv = 5;\n\t\t}\n\t\t\n\t\tif (ddv = 0) {\n\t\t\treturn 0;\n\t\t}\n\t\t\n\t\tdouble percent = price / 100.0;\n\t\tdouble tax = ddv * percent;\n\t\treturn tax / 100.0 * 15.0;\n\t}", "public double getTaxValue() {\n\t\treturn TaxCalculatorUtil.getTaxValue(getConfiguredPrice(),getPromotionValue(), getCouponDiscountValue(), getTaxRate(), getTaxationType());\n\t}", "public double getTaxRate() {\r\n\t\treturn .07;\r\n\t}", "public double dollarTorp()\r\n\t{\r\n\t\treturn getAmount() * 14251.25;\r\n\t}", "public double getAmount() {\r\n\t\treturn amount;\r\n\t}", "public double getAmount() {\r\n\t\treturn amount;\r\n\t}", "@Override\r\n\tpublic double taxAmount(long itemSold, double price) {\n\t\treturn 100.230;\r\n\t}", "public double getAmount () {\r\n\t\treturn amount;\r\n\t}", "public double getAmount() {\n\t\treturn amount;\n\t}", "public double getAmount() {\n\t\treturn amount;\n\t}", "public double getAmount() {\n\t\treturn amount;\n\t}", "@Override\n public double calcTaxes() {\n return getCost() * 0.07;\n }", "public double calculateCost() {\n double output = price * (1 + taxRate);\n return output;\n }", "public BigDecimal getIncludedTax()\r\n\t{\r\n\t\treturn m_includedTax;\r\n\t}", "public double getMarketValueTaxRate(){\r\n taxlist.add(new Tax(this.estValue,this.PPR,this.yearsowned,this.locationCategory));\r\n count++;\r\n return taxlist.get(count-1).MarketValueTax();\r\n }", "public double getAmount() {\n return this.amount;\n }", "public double getAmount() {\n return amount;\n }", "public double getAmount() {\n return amount;\n }", "public double getAmount() {\n return amount;\n }", "public double getAmount() {\n return amount;\n }", "public double getAmount() {\n return amount;\n }", "public double getAmount() {\n return amount;\n }", "public double getAmount() {\n return amount;\n }", "public BigDecimal getIncludedTaxDifference()\r\n\t{\r\n\t\treturn m_amount.subtract(m_includedTax);\r\n\t}", "@Override \r\n public double getPaymentAmount() \r\n { \r\n return getQuantity() * getPricePerItem(); // calculate total cost\r\n }", "public BigDecimal getLBR_TaxAmt();", "public double getSalesTax() {\r\n return salesTax;\r\n }", "public double getTaxedCost()\n\t{\n\t\treturn taxedCost;\n\t}", "public Double getAmount() {\r\n return amount;\r\n }", "public double getAmount() {\r\n\t\treturn investmentAmount;\r\n\t}", "public double getAmount() {\n return amount;\n }", "public double calculate_total_sales_of_transaction() {\n char ismember = 'n';\n discounts = 1;\n String member_typ = \"null\";\n ismember = order.getIsMember();\n member_typ = order_member.getMemberType();\n\n total_sales_of_transaction = order.getBike().getPrice();\n\n if (Character.toUpperCase(ismember) == 'Y') {\n if (member_typ == \"Premium\") {\n discounts = 0.85;\n } else {\n discounts = 0.9;\n }\n }\n double price = total_sales_of_transaction * discounts;\n return price;\n }", "abstract protected BigDecimal getBasicTaxRate();", "public double getInvoiceAmount(){\n\t\t// declare a local variable of type double to store the invoice's total price\n\t\tdouble totalPrice;\n\t\t// the total price is given my multiplying the price per unit with the quantity\n\t\ttotalPrice = price * quantity;\t\t\n\t\t// return the value stored in the local variable totalPrice\n\t\treturn totalPrice;\n\t}", "public double getPaymentAmount() {\n\t\treturn baseSalary+this.grossSales*this.commissionRate;\r\n\t}", "public BigDecimal getTaxAmtPriceStd();", "public void setTaxAmount(double value) {\n this.taxAmount = value;\n }", "TotalInvoiceAmountType getTotalInvoiceAmount();", "public BigDecimal getTotalAmount() {\n return totalAmount;\n }", "@ApiModelProperty(value = \"Total amount of TAX paid(or should be paid)\")\n @JsonProperty(\"tax\")\n public String getTax() {\n return tax;\n }", "public double getAmount() { return amount; }", "public double netPrice () {\n return discountedPrice() + taxCharged();\n }", "public BigDecimal getLBR_TaxBaseAmt();", "public float getPayableAmount() {\n /**\n * { var_description }.\n */\n float dscnt = NUM3 * coupon;\n /**\n * { item_description }.\n */\n return (getTotalAmount() * (1f - dscnt)) * NUM5;\n }", "public Double getTotalBuyMoney() {\r\n return totalBuyMoney;\r\n }", "public Double getTotalBuyFee() {\r\n return totalBuyFee;\r\n }", "public double getCustomerPurchase() { return this.customerPurchase; }", "public double getDepositAmount()\n\t{\n\t\treturn this.getFlightCosts() + this.totalPrice * this.half;\n\t}", "public double getAmount() \r\n {\r\n assert(true);\r\n return amount;\r\n }", "public abstract double calculateTax();", "public BigDecimal getAmount() {\r\n return amount;\r\n }", "public java.math.BigDecimal getAmount() {\n return amount;\n }", "float getAmount();", "public BigDecimal getTotalPrice() {\n\t\t// the current total cost which the customer owes in the transaction\n\t\tBigDecimal total = new BigDecimal(0);\n\n\t\tArrayList<Item> currentPurchases = purchaseList.getCurrentPurchases(); \n\n\t\tfor (Item item : currentPurchases) {\n\t\t\ttotal = total.add(this.getItemPrice(item));\n\t\t}\n\n\t\treturn total;\n\t}", "public BigDecimal getAmount()\n {\n return amount;\n }", "public BigDecimal getAmount() {\n return this.amount;\n }", "public BigDecimal getAmount() {\n return amount;\n }", "public BigDecimal getAmount() {\n return amount;\n }", "public BigDecimal getAmount() {\n return amount;\n }", "public BigDecimal getAmount() {\n return amount;\n }", "public BigDecimal getAmount() {\n return amount;\n }", "public BigDecimal getAmount() {\n return amount;\n }", "public BigDecimal getAmount() {\n return amount;\n }", "public BigDecimal getAmount() {\n return amount;\n }", "public BigDecimal getAMOUNT() {\r\n return AMOUNT;\r\n }", "public float getAmount() {\n System.out.println(\"Account Balance:\" + amount);\n return amount;\n }", "public BigDecimal getPriceStdWTax();", "public Float getAmount() {\n\t\treturn amount;\n\t}", "public BigDecimal getAmount() {\n return this.amount;\n }", "public void tvqTax() {\n TextView tvqView = findViewById(R.id.checkoutPage_TVQtaxValue);\n tvqTaxTotal = beforeTaxTotal * 0.09975;\n tvqView.setText(String.format(\"$%.2f\", tvqTaxTotal));\n }", "public String getTotalTaxes(){\n String tax = driver.findElement(oTotalTaxes).getText();\n logger.debug(\"total taxes is\" + tax);\n return tax;\n }" ]
[ "0.7913285", "0.7797283", "0.77430594", "0.76909614", "0.75924623", "0.75585896", "0.7520494", "0.75043917", "0.74814075", "0.747426", "0.74648213", "0.74141", "0.74037963", "0.7367551", "0.73588187", "0.73505765", "0.7349087", "0.73014635", "0.7285855", "0.72571784", "0.72454643", "0.7225484", "0.72203434", "0.72138476", "0.72132486", "0.7202715", "0.7112077", "0.7106771", "0.7106121", "0.7100185", "0.7013085", "0.69747376", "0.69539565", "0.69507855", "0.6909383", "0.6909383", "0.6896113", "0.6864051", "0.68621576", "0.68621576", "0.68621576", "0.6856995", "0.6849116", "0.6839043", "0.68352103", "0.68033504", "0.6791176", "0.6791176", "0.6791176", "0.6791176", "0.6791176", "0.6791176", "0.6791176", "0.6785531", "0.67840993", "0.6775186", "0.6773989", "0.6770978", "0.676711", "0.67588854", "0.67525786", "0.6736719", "0.6734136", "0.67317057", "0.6727194", "0.67018497", "0.67008257", "0.6699768", "0.6695816", "0.6690857", "0.6684074", "0.66786855", "0.66686416", "0.6658639", "0.6657586", "0.66497916", "0.6648392", "0.6645957", "0.6630064", "0.6624736", "0.66234905", "0.6616587", "0.661319", "0.66068774", "0.65962815", "0.65915924", "0.658576", "0.658576", "0.658576", "0.658576", "0.658576", "0.658576", "0.658576", "0.658576", "0.6578312", "0.65782005", "0.6576175", "0.65675956", "0.6566332", "0.6560823", "0.65515834" ]
0.0
-1
Convert the given object to string with each line indented by 4 spaces (except the first line).
private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private String toIndentedString(Object object) {\n if (object == null) {\n return EndpointCentralConstants.NULL_STRING;\n }\n return object.toString().replace(EndpointCentralConstants.LINE_BREAK,\n EndpointCentralConstants.LINE_BREAK + EndpointCentralConstants.TAB_SPACES);\n }", "private String toIndentedString(Object o)\n/* */ {\n/* 128 */ if (o == null) {\n/* 129 */ return \"null\";\n/* */ }\n/* 131 */ return o.toString().replace(\"\\n\", \"\\n \");\n/* */ }", "private String toIndentedString( Object o )\n {\n if ( o == null )\n {\n return \"null\";\n }\n return o.toString().replace( \"\\n\", \"\\n \" );\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }" ]
[ "0.78847593", "0.75493765", "0.74971926", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168", "0.746168" ]
0.0
-1
Test 'clustering_0 = 1' with only one clustering column
@Test public void testBoundsAsCompositesWithOneEqRestrictionsAndOneClusteringColumn() { CFMetaData cfMetaData = newCFMetaData(Sort.ASC); ByteBuffer clustering_0 = ByteBufferUtil.bytes(1); Restriction eq = newSingleEq(cfMetaData, 0, clustering_0); PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(eq); List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), clustering_0, EOC.START); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), clustering_0, EOC.END); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean hasCluster();", "boolean getIsClusteringKey();", "boolean hasClusterName();", "public void decideCluster(){\n\tdouble shortest = 1000000;\n\tfor(int i = 0; i < clusterDist.length; i++)\n\t{\n\t\tif(clusterDist[i] < shortest)\n\t\t{\tshortest = clusterDist[i];\n\t\t\tthis.clusterid = i;\n\t\t}\n\t\t\n\t}\n}", "@Override\n public boolean getIsClusteringKey() {\n return isClusteringKey_;\n }", "@Override\n public boolean getIsClusteringKey() {\n return isClusteringKey_;\n }", "protected boolean isClusterRequired() {\n return true;\n }", "boolean hasPermissionOfCluster(String clusterId, String userName);", "boolean isAllowClusterGet();", "public Builder clearIsClusteringKey() {\n\n isClusteringKey_ = false;\n onChanged();\n return this;\n }", "public boolean hasClusterName() {\n return endpointConfigCase_ == 2;\n }", "private void runSomClustering(int linkage, int distanceMeasure, final boolean clusterColumns) {\r\n DivaClientService.computeSomClustering(linkage, distanceMeasure, clusterColumns,\r\n new AsyncCallback<SomClusteringResult>() {\r\n @Override\r\n public void onFailure(Throwable caught) {\r\n\r\n Selection_Manager.connError();\r\n SelectionManager.Busy_Task(false, true);\r\n }\r\n\r\n @Override\r\n public void onSuccess(SomClusteringResult result) {\r\n hierarchicalClustering = new SomClustComponent(result, Selection_Manager, DivaClientService, true, rightPanelWidth, leftPanelHeight);\r\n RootPanel.get(\"SomClusteringResults\").clear();\r\n RootPanel.get(\"SomClusteringResults\").add(hierarchicalClustering.getSomclusteringLayout());\r\n Timer t = new Timer() {\r\n @Override\r\n public void run() {\r\n hierarchicalClustering.selectRootNode();\r\n }\r\n };\r\n// Schedule the timer to run once in 0.5 seconds.\r\n// if (result.getRowNames().length < 5000) {\r\n//// t.schedule(500);\r\n// SelectionManager.Busy_Task(false, true);\r\n// } else {\r\n SelectionManager.Busy_Task(false, true);\r\n// }\r\n init = false;\r\n }\r\n });\r\n\r\n }", "@Test\n public void testHardClustersWithOverlappingPartitions()\n {\n check(hardClustersWithOverlappingPartitions(), 0.0, 1.0);\n }", "public boolean isSetNumClusteringCols() {\n return EncodingUtils.testBit(__isset_bitfield, __NUMCLUSTERINGCOLS_ISSET_ID);\n }", "@Test\n public void testOverlappingPartitionsOverlappingClusters()\n {\n check(overlappingClustersWithOverlappingPartitions(), 0.75, 1.0);\n }", "public Builder setIsClusteringKey(boolean value) {\n\n isClusteringKey_ = value;\n onChanged();\n return this;\n }", "public void processFoundCluster(NodeSet cluster) {\n\t}", "public boolean isEqualTo(Cluster c)\n {\n int len = this.size();\n if (len != c.size()){\n return false;\n }\n if (len == 0){\n return true;\n }\n if (this.getLeader() != c.getLeader()){\n return false;\n }\n for (Integer n : this._elems){\n if (!c.contains(n)){\n return false;\n }\n }\n return true;\n }", "@java.lang.Override\n public boolean hasClusterName() {\n return endpointConfigCase_ == 2;\n }", "public interface IStoppingCriteria {\n\n /**\n * Determine the degree of clustering agreement\n * @param cluster1 one clustering results\n * @param cluster2 the other clustering results\n * @return the degree of clustering agreement; 1 refers to be the same clustering results; 0 refers to be the totally different clustering results\n */\n public double computeSimilarity(int[] cluster1, int[] cluster2);\n\n}", "public void activateCluster(){\n for (int row = 0; row < matrix.length; row++) {\n// Cell[] matrix1 = matrix[i];\n for (int col = 0; col < matrix[row].length; col++) {\n Cell cell = matrix[row][col];\n // check every if null it means there is no cell at that position\n // get fist occured cell and meet it with the next one\n // run the loop while\n // while cell.getRow < cell.bestRow && cell.getCol < cell.bestCol\n if(cell != null) {\n while (cell.getRow() <= this.cellBiggestRow && cell.getCol() <= this.cellBiggestCol) {\n\n if (cell.getCol() >= matrix[row].length) {\n if (!(cell.getRow() >= matrix.length)) {\n cell.setRow(cell.getRow() + 1);\n }\n } else {\n cell.setCol(cell.getCol() + 1);\n }\n\n // if cell.getCol + 1 < matrix[row].length && matrix[row] != null\n // get the next cell and do the fight\n }\n }\n }\n }\n\n }", "private static void clustering() {\n \tclustering(clArgs.clusteringInFile, clArgs.clusteringOutDir,\n \t\t\tclArgs.clusteringOpticsXi, clArgs.clusteringOpticsMinPts);\n }", "@Test\n public void testBoundsAsCompositesWithOneEqRestrictionsAndTwoClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer clustering_0 = ByteBufferUtil.bytes(1);\n Restriction eq = newSingleEq(cfMetaData, 0, clustering_0);\n\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.END);\n }", "boolean isNeedSharding();", "int getClusteringKeyCount();", "public boolean isReviewed(int index) {\n if (index % 2 != 0) {\n index -= 1;\n }\n index = index / 2;\n if ( ( (Integer) clusters[index][3]).intValue() == 1) {\n return true;\n }\n else {\n return false;\n }\n }", "static double clusterVerticesOneStep(Mesh mesh) {\n\t\t\n\t\t// for each pair of the vertices\n\t\tdouble mindis = 1.0e+30;\n\t\tfor(int i = 0; i < mesh.getNumVertices(); i++) {\n\t\t\tVertex v1 = mesh.getVertex(i);\n\t\t\tfor(int j = (i + 1); j < mesh.getNumVertices(); j++) {\n\t\t\t\tVertex v2 = mesh.getVertex(j);\n\t\t\t\n\t\t\t\t// for each pair of the nodes\n\t\t\t\tdouble maxdis = 0.0;\n\t\t\t\tfor(int ii = 0; ii < v1.nodes.size(); ii++) {\n\t\t\t\t\tNode n1 = (Node)v1.nodes.get(ii);\n\t\t\t\t\tfor(int jj = 0; jj < v2.nodes.size(); jj++) {\n\t\t\t\t\t\tNode n2 = (Node)v2.nodes.get(jj);\n\t\t\t\t\t\tif(n1.getDisSim2(n2.getId()) > maxdis) {\n\t\t\t\t\t\t\tmaxdis = n1.getDisSim2(n2.getId());\n\t\t\t\t\t\t\tif(maxdis > mindis) {\n\t\t\t\t\t\t\t\tii = v1.nodes.size(); break;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// update mindis\n\t\t\t\tif(mindis > maxdis) {\n\t\t\t\t\tmindis = maxdis;\n\t\t\t\t\t//System.out.println(\" updated mindis=\" + mindis);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Determine the threshold\n\t\tdouble threshold = mindis * clusteringThreshold;\n\t\t\n\t\t// Combine close two vertices \n\t\tfor(int i = 0; i < mesh.getNumVertices(); i++) {\n\t\t\tVertex v1 = mesh.getVertex(i);\n\t\t\tfor(int j = (i + 1); j < mesh.getNumVertices(); j++) {\n\t\t\t\tVertex v2 = mesh.getVertex(j);\n\t\t\t\n\t\t\t\t// for each pair of the nodes\n\t\t\t\tdouble maxdis = -1.0;\n\t\t\t\tfor(int ii = 0; ii < v1.nodes.size(); ii++) {\n\t\t\t\t\tNode n1 = (Node)v1.nodes.get(ii);\n\t\t\t\t\tfor(int jj = 0; jj < v2.nodes.size(); jj++) {\n\t\t\t\t\t\tNode n2 = (Node)v2.nodes.get(jj);\n\t\t\t\t\t\tif(n1.getDisSim2(n2.getId()) > maxdis) {\n\t\t\t\t\t\t\tmaxdis = n1.getDisSim2(n2.getId());\n\t\t\t\t\t\t\tif(maxdis > threshold) {\n\t\t\t\t\t\t\t\tii = v1.nodes.size(); break;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(maxdis > threshold) continue;\n\t\t\t\t\n\t\t\t\t//System.out.println(\" combine: i=\" + i + \" j=\" + j + \" names=\" + authors + \" maxdis=\" + maxdis + \" th=\" + threshold);\n\t\t\t\t\n\t\t\t\t// combine the two vertices\n\t\t\t\tfor(int jj = 0; jj < v2.nodes.size(); jj++) {\n\t\t\t\t\tNode n2 = (Node)v2.nodes.get(jj);\n\t\t\t\t\tv1.nodes.add(n2);\n\t\t\t\t\tn2.setVertex(v1);\n\t\t\t\t}\n\t\t\t\tmesh.removeOneVertex(v2);\n\t\t\t\tj--;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn threshold;\n\t}", "private Set<String> findEmptyCluster(Map<double[], Set<String>> restaurantClusters) {\n for (Set<String> cluster : restaurantClusters.values()) {\n if (cluster.isEmpty()) {\n return cluster;\n }\n }\n return null;\n }", "public static boolean isClusterOK() {\n\t\ttry {\n\t\t\tHealthStatus status = getRESTClient().cluster().health().status();\n\t\t\treturn !HealthStatus.Red.equals(status);\n\t\t} catch (Exception e) {\n\t\t\tlogger.error(null, e);\n\t\t}\n\t\treturn false;\n\t}", "public void doInitialClustering(AddressIF me, Matrix_4_HSH tmp) {\n\t\t\n\t}", "public static void main(String[] args)\r\n\t{\n\t\tList<Location> locations = new ArrayList<Location>();\r\n\t\tlocations.add(new Location(150, 981));\r\n\t\tlocations.add(new Location(136, 0));\r\n\t\tlocations.add(new Location(158, 88));\r\n\t\tlocations.add(new Location(330, 60));\r\n\t\tlocations.add(new Location(0, 1001));\r\n\t\tlocations.add(new Location(150, 0));\r\n\t\tlocations.add(new Location(0, 0));\r\n\t\tlocations.add(new Location(0, 0));\r\n\t\tlocations.add(new Location(0, 0));\r\n\t\tlocations.add(new Location(446, 88));\r\n\t\tlocations.add(new Location(562, 88));\r\n\t\tlocations.add(new Location(256, 88));\r\n\t\tlocations.add(new Location(678, 88));\r\n\t\tlocations.add(new Location(794, 88));\r\n\t\tlocations.add(new Location(0, 1028));\r\n\t\tlocations.add(new Location(136, 0));\r\n\t\tlocations.add(new Location(150, 0));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 1028));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(136, 103));\r\n\t\tlocations.add(new Location(150, 0));\r\n\t\tList<LocationWrapper> clusterInput = new ArrayList<LocationWrapper>(locations.size());\r\n\t\tfor (Location location : locations)\r\n\t\t\tclusterInput.add(new LocationWrapper(location));\r\n\r\n\t\t// initialize a new clustering algorithm.\r\n\t\t// we use KMeans++ with 10 clusters and 10000 iterations maximum.\r\n\t\t// we did not specify a distance measure; the default (euclidean\r\n\t\t// distance) is used.\r\n\t\t// org.apache.commons.math3.ml.clustering.FuzzyKMeansClusterer<LocationWrapper>\r\n\t\t// clusterer = new\r\n\t\t// org.apache.commons.math3.ml.clustering.FuzzyKMeansClusterer<LocationWrapper>(2,\r\n\t\t// 2);\r\n\t\t// KMeansPlusPlusClusterer<LocationWrapper> clusterer = new\r\n\t\t// KMeansPlusPlusClusterer<LocationWrapper>(2, 10);\r\n\r\n\t\tDBSCANClusterer<LocationWrapper> clusterer = new DBSCANClusterer<LocationWrapper>(1200.0, 5);\r\n\t\tList<Cluster<LocationWrapper>> clusterResults = clusterer.cluster(clusterInput);\r\n\t\t// List<CentroidCluster<LocationWrapper>> clusterResults =\r\n\t\t// clusterer.cluster(clusterInput);\r\n\r\n\t\t// output the clusters\r\n\t\tSystem.out.println(\"clusterResults.size() = \" + clusterResults.size());\r\n\t\tfor (int i = 0; i < clusterResults.size(); i++)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Cluster \" + i);\r\n\t\t\tfor (LocationWrapper locationWrapper : clusterResults.get(i).getPoints())\r\n\t\t\t\tSystem.out.println(locationWrapper.getLocation());\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\t}", "public static boolean tile_in_cluster(int x, int y){\n int cx = (int)Math.floor((float)x / WorldChunk.CHUNK_SIZE);\n int cy = (int)Math.floor((float)y / WorldChunk.CHUNK_SIZE);\n\n return chunk_in_cluster(cx,cy);\n }", "public void setClusterId(String id) {\n clusterId = id;\n }", "@Override\n\tpublic int compareTo(Cluster o) {\n\t\treturn 0;\n\t}", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithTwoClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.END);\n }", "public void compareWithinClusters() {\n\t\tList<Cluster> clusterList = clusterDao.getClusterList();\n\n\t\tfor (Cluster cluster : clusterList) {\n\t\t\tList<Document> docList = documentDao.getDocListByClusterId(cluster.getId());\n\t\t\tint size = docList.size();\n\t\t\t\n\t\t\tdouble[][] matrix = new double[size][size];\n\t\t\t\n\t\t\tfor(int i =0; i<size; i++){\n\t\t\t\tmatrix[i][i] = 1;\n\t\t\t\tmatrix[i][i] = 1;\n\t\t\t}\n\t\t\t\n\t\t\tif (size > 1) {\n\t\t\t\t//List<Document> docList2 = docList1;\n\t\t\t\tfor (int i=0; i<size; i++){\n\t\t\t\t\tfor(int j=i+1; j<size; j++){\n\t\t\t\t\t\t//match docs docList.get(i) & docList.get(j)\n\t\t\t\t\t\tMap<String, Double> map = datumboxCaller.compareDocs(docList.get(i).getDocName(), docList.get(j).getDocName());\n\t\t\t\t\t\tmatrix[i][j] = map.get(\"Oliver\");\n\t\t\t\t\t\tmatrix[j][i] = map.get(\"Shingle\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//persist both metrics in a file \n\t\t\tpersist(matrix, cluster, docList);\n\t\t\t\n\t\t\t//printing the matrix\n\t\t\tSystem.out.println(\"\\nDocument Similarity Matrix for Cluster \"+cluster.getId());\n\t\t\tSystem.out.println(\"\\nOliver Metric\");\n\t\t\tSystem.out.print(\"id\");\n\t\t\tfor(int i=0; i<size; i++)\n\t\t\t\tSystem.out.print(\"\\t\"+docList.get(i).getId());\n\t\t\t\n\t\t\tfor(int i=0; i<size; i++){\n\t\t\t\tSystem.out.println(docList.get(i).getId());\n\t\t\t\tfor(int j=0; j<size; j++){\n\t\t\t\t\tSystem.out.print(\"\\t\");\n\t\t\t\t\tif(j>=i)\n\t\t\t\t\t\tSystem.out.print(matrix[i][j]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(\"\\nShingle Metric\");\n\t\t\tSystem.out.print(\"id\");\n\t\t\tfor(int i=0; i<size; i++)\n\t\t\t\tSystem.out.print(\"\\t\"+docList.get(i).getId());\n\t\t\t\n\t\t\tfor(int i=0; i<size; i++){\n\t\t\t\tSystem.out.print(\"\\n\"+docList.get(i).getId());\n\t\t\t\tfor(int j=0; j<size; j++){\n\t\t\t\t\tSystem.out.print(\"\\t\");\n\t\t\t\t\tif(j>=i)\n\t\t\t\t\t\tSystem.out.print(matrix[j][i]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t//print ends\n\t\t\t\n\t\t}\n\n\t}", "String getClusteringKey(int index);", "public boolean percolates()\r\n { return uf.find(0) == uf.find(dimension*dimension + 1); }", "ClusterSet() {\n }", "public Clusters()\r\n\t{\r\n\t\tcluster = new boolean[MAX_CLUSTERS];\r\n\t}", "io.envoyproxy.envoy.type.metadata.v3.MetadataKind.Cluster getCluster();", "public boolean isSparseColumnSet(int column) throws SQLServerException\n {\n checkClosed();\n \n CryptoMetadata cryptoMetadata = rs.getColumn(column).getCryptoMetadata();\n if(null != cryptoMetadata){\n \treturn cryptoMetadata.getBaseTypeInfo().isSparseColumnSet();\n }\n \n return rs.getColumn(column).getTypeInfo().isSparseColumnSet();\n }", "@Test\n public void testBoundsAsCompositesWithSliceRestrictionsAndOneClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newSingleSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newSingleSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n }", "boolean isClusterBulkLoadEnabled();", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneDescendingAndOneAscendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0) > (1) AND (clustering_0, clustering1) < (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.END);\n assertComposite(bounds.get(2), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.END);\n assertComposite(bounds.get(1), value1, EOC.START);\n assertComposite(bounds.get(2), value1, EOC.END);\n }", "public ImmutableMap<String, Boolean> getAttributeClusteringConfig();", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneAscendingAndOneDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n assertComposite(bounds.get(2), value2, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertComposite(bounds.get(1), value2, EOC.START);\n assertComposite(bounds.get(2), value2, EOC.END);\n }", "public boolean percolates() {\n\t\treturn linearGrid.connected(0, 1);\n\t}", "public String getCluster() {\n return this.cluster;\n }", "public String getCluster() {\n return this.cluster;\n }", "public float compare(Cluster other) {\n \treturn compare(center, other.center);\n }", "private boolean containsCentroid(SparseVector vector) {\n for (int i = 0; i < K; i++) {\n if (centroids[i].equals(vector)) {\n return true;\n }\n }\n return false;\n }", "@Test\n public void should_iterate_with_default_params() throws Exception {\n long partitionKey = RandomUtils.nextLong(0,Long.MAX_VALUE);\n insertClusteredValues(partitionKey, 1, \"name1\", 5);\n\n Iterator<ClusteredEntity> iter = manager.sliceQuery(ClusteredEntity.class)\n .forIteration()\n .withPartitionComponents(partitionKey)\n .iterator();\n\n assertThat(iter.hasNext()).isTrue();\n ClusteredEntity next = iter.next();\n assertThat(next.getId().getCount()).isEqualTo(1);\n assertThat(next.getId().getName()).isEqualTo(\"name11\");\n assertThat(next.getValue()).isEqualTo(\"value11\");\n\n assertThat(iter.hasNext()).isTrue();\n next = iter.next();\n assertThat(next.getId().getCount()).isEqualTo(1);\n assertThat(next.getId().getName()).isEqualTo(\"name12\");\n assertThat(next.getValue()).isEqualTo(\"value12\");\n\n assertThat(iter.hasNext()).isTrue();\n next = iter.next();\n assertThat(next.getId().getCount()).isEqualTo(1);\n assertThat(next.getId().getName()).isEqualTo(\"name13\");\n assertThat(next.getValue()).isEqualTo(\"value13\");\n\n assertThat(iter.hasNext()).isTrue();\n next = iter.next();\n assertThat(next.getId().getCount()).isEqualTo(1);\n assertThat(next.getId().getName()).isEqualTo(\"name14\");\n assertThat(next.getValue()).isEqualTo(\"value14\");\n\n assertThat(iter.hasNext()).isTrue();\n next = iter.next();\n assertThat(next.getId().getCount()).isEqualTo(1);\n assertThat(next.getId().getName()).isEqualTo(\"name15\");\n assertThat(next.getValue()).isEqualTo(\"value15\");\n\n assertThat(iter.hasNext()).isFalse();\n }", "private boolean checkColoumnForQuadPair(int j1) {\n for(int i=0;i<4;i++)\r\n {\r\n if(Kmap[i][j1]==0 || Kmap[i][j1]==-1)\r\n return false;\r\n }\r\n for(int i=0;i<4;i++)\r\n {\r\n Kmap[i][j1]=-1;\r\n }\r\n return true; \r\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsMixingAscendingDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.DESC, Sort.ASC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(3));\n\n // clustering_0 = 1 AND (clustering_1, clustering_2, clustering_3) > (2, 3, 4)\n Restriction eq = newSingleEq(cfMetaData, 0, value1);\n slice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n restrictions = restrictions.mergeWith(eq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(3));\n\n\n // (clustering_0, clustering1, clustering_2, clustering_3) <= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, value4, EOC.NONE);\n assertComposite(bounds.get(3), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) < (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(3), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4) AND (clustering_0, clustering_1) < (2, 3)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2, value3);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(5, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n assertComposite(bounds.get(4), value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(5, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertComposite(bounds.get(3), value2, EOC.START);\n assertComposite(bounds.get(4), value2, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4) AND (clustering_0, clustering1, clustering_2, clustering_3) <= (4, 3, 2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value4, value3, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(7, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n assertComposite(bounds.get(4), value4, value3, EOC.START);\n assertComposite(bounds.get(5), value4, value3, value2, value1, EOC.NONE);\n assertComposite(bounds.get(6), value4, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(7, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertComposite(bounds.get(3), value4, EOC.START);\n assertComposite(bounds.get(4), value4, value3, value2, EOC.START);\n assertComposite(bounds.get(5), value4, value3, value2, EOC.END);\n assertComposite(bounds.get(6), value4, EOC.END);\n }", "public void setCluster(String cluster) {\n this.cluster = cluster;\n }", "public void setCluster(String cluster) {\n this.cluster = cluster;\n }", "@Test\r\n public void testGroupSimilarity() throws Exception {\r\n final List<ICluster> originalCLuster = ClusteringTestUtilities.readSpectraClustersFromResource();\r\n Collections.sort(originalCLuster);\r\n List<ICluster> l1 = new ArrayList<ICluster>(originalCLuster);\r\n\r\n final List<ICluster> originalCLuster2 = ClusteringTestUtilities.readSpectraClustersFromResource();\r\n Collections.sort(originalCLuster2);\r\n List<ICluster> l2 = new ArrayList<ICluster>(originalCLuster2);\r\n\r\n ClusterListSimilarity cd = new ClusterListSimilarity(distanceMeasure);\r\n final List<ICluster> identical = cd.identicalClusters(l1, l2);\r\n\r\n Assert.assertEquals(originalCLuster.size(), identical.size());\r\n Assert.assertTrue(l1.isEmpty());\r\n Assert.assertTrue(l2.isEmpty());\r\n }", "java.lang.String getClusterId();", "java.lang.String getClusterId();", "java.lang.String getClusterId();", "java.lang.String getClusterId();", "java.lang.String getClusterId();", "java.lang.String getClusterId();", "public static double computeClusterIndex(Map<String, List<String>> mCl) {\n\n\t\tdouble minCompactness = 0;\n\t\tdouble tempIsolation = 0;\n\t\tdouble maxIsolation = 0;\n\n\t\tList<String> arg1 = null;\n\t\tList<String> arg2 = null;\n\n\t\tdouble clusterGoodness = 0;\n\t\t// long n = (mCl.size()) * (mCl.size() - 1) / 2;\n\t\tfor (Entry<String, List<String>> e1 : mCl.entrySet()) {\n\n\t\t\tmaxIsolation = 0;\n\n\t\t\tfor (Entry<String, List<String>> e2 : mCl.entrySet()) {\n\t\t\t\tif (e2.getKey().hashCode() != e1.getKey().hashCode()) {\n\n\t\t\t\t\targ1 = e1.getValue();\n\t\t\t\t\targ2 = e2.getValue();\n\t\t\t\t\ttempIsolation = intraClusterScore(arg1, arg2);\n\n\t\t\t\t\t// get the maximum score, i.e the strongest intra-cluster\n\t\t\t\t\t// pair..\n\t\t\t\t\tmaxIsolation = (maxIsolation < tempIsolation) ? tempIsolation\n\t\t\t\t\t\t\t: maxIsolation;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// perform its own compactness\n\t\t\tminCompactness = getInterClusterScore(e1.getValue());\n\n\t\t\tclusterGoodness = clusterGoodness + (double) minCompactness\n\t\t\t\t\t/ ((maxIsolation == 0) ? Math.pow(10, -1) : maxIsolation);\n\n\t\t}\n\n\t\tclusterGoodness = (clusterGoodness == 0) ? (Math.pow(10, -8) - clusterGoodness)\n\t\t\t\t: clusterGoodness;\n\n\t\treturn (double) 1 / clusterGoodness;\n\n\t}", "public void addCluster()\r\n\t{\r\n\t\tcluster[nextAvailableCluster()] = true;\r\n\t}", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithTwoDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n }", "public void setCacheClusterEnabled(Boolean cacheClusterEnabled) {\n this.cacheClusterEnabled = cacheClusterEnabled;\n }", "public static int[][] getCentroid(int data[],int noofcluster,int centroid[][],int flag){\n\t\tSystem.out.println(\"no of cluster:\"+noofcluster);\n\t\tint distance[][]=new int[noofcluster][data.length];\n\t\tint cluster[] =new int[data.length];\n\t\tint nodecnt[]=new int[noofcluster];\n\t\t\n\t\t\n\t\tSystem.out.println(\"..........new Cluster .........\");\n\t\t\n\t\t// this loop is for finding the minimum distance form depot to all the other bikestation\n\t\t\tfor(int j=0;j<data.length;j++) {\n\t\t\t\tdistance[0][j]=gr.dijkstra(adj,233,data[j]);\n\t\t\t\tMcluster.put(data[j],distance[0][j]);\n\t\t\t}\n\t\tSystem.out.println(\"Cluster=\"+Mcluster);\n\t\t\n\t\tSystem.out.println(\"............New Centroid..............\");\n\t\t// to find a random centroid for 1st time \n\t\tSet<Integer> tempp = new HashSet<Integer>();\n\t\tif(flag == 0) {\n\t\t\tfor(int i=0;i<noofcluster;i++) {\n\t\t\t\tcentroid[1][i]=Mcluster.get(getRandom(143,220));\n\t\t\t\twhile(tempp.contains(centroid[1][i])) {\n\t\t\t\t\tcentroid[1][i]=Mcluster.get(getRandom(143,220));\n\t\t\t\t}\n\t\t\t\ttempp.add(centroid[1][i]);\n\t\t\t\t//System.out.println(\"Centroid\"+centroid[1][i]);\n\t\t\t}\n\t\t\tflag=1;\n\t\t}\n\t\t\n\t\tSystem.out.println(\"...........Creating temp Cluster.......\");\n\t\t\n\t\t// creating a list of all the bikestation nodes difference the centroid \n\t\tfor(int i=0;i<noofcluster;i++) {\n\t\t\tHashMap<Integer,Integer> mpp=new HashMap<Integer,Integer>();\n\t\t\tfor(int j : Mcluster.keySet()) {\n\t\t\t\tif(centroid[1][i]>Mcluster.get(j)) {\n\t\t\t\t\tint mp = centroid[1][i]-Mcluster.get(j);\n\t\t\t\t\tmpp.put(j,mp);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tint mp = Mcluster.get(j)-centroid[1][i];\n\t\t\t\t\tmpp.put(j,mp);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcls.put(i, mpp);\n\t\t}\n\t\t\n\t\tSystem.out.println(\"...........Creating Final Cluster.......\");\n\t\t\n\t\t// getting a cluster from given centroid \n\t\tfor(int i=0;i<noofcluster;i++) {\n\t\t\tArrayList<Integer> temp = new ArrayList<>();\n\t\t\tfinalCluster.put(i,temp);\n\t\t}\n\t\tint smallestDistance;\n\t\tfor(int j : Mcluster.keySet()) {\n\t\t\tint f = 0;\n\t\t\tsmallestDistance=Integer.MAX_VALUE;\n\t\t\tfor(int i=0;i<noofcluster;i++) {\n\t\t\t\tif(cls.get(i).get(j)<=smallestDistance) {\n\t\t\t\t\tsmallestDistance=cls.get(i).get(j);\n\t\t\t\t\tf=i;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfinalCluster.get(f).add(j);\n\t\t}\n\t\t\n\t\t\n\t\tSystem.out.println(\"Final\"+finalCluster);\n\t\tSystem.out.println(\"........new centroid......\");\n\t\t\n\t\t//final cluster\n\t\tfor(int i : finalCluster.keySet()) {\n\t\t\tint sum=0, avg=0, count=0;\n\t\t\tfor(int j=0;j<finalCluster.get(i).size();j++) {\n\t\t\t\tint temp=finalCluster.get(i).get(j);\n\t\t\t\tsum=sum+Mcluster.get(temp);\n\t\t\t\tcount++;\n\t\t\t}\n\t\t\tavg=(int)sum/count;\n\t\t\tcentroid[0][i]=avg;\n\t\t}\n\t\t\n\t\tboolean finalcentroid=true;\n\t\t//if (i-1) and (i)th cluster have the same centroid then we stop the loop\n\t\tfor(int i=0;i<noofcluster;i++) {\n\t\t\tif(finalcentroid && centroid[0][i]==centroid[1][i]) {\n\t\t\t\tfinalcentroid=true;\n\t\t\t\tcontinue;\n\t\t\t}else {\n\t\t\t\tfinalcentroid=false;\n\t\t\t\tSystem.out.println(\"Different\");\n\t\t\t\tcnt++;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(!finalcentroid) { \n\t\t\t//if (i-1) and (i)th cluster dont have the same centroid then we continue the loop iteration\n\t\t\tcentroid[1] = Arrays.copyOf(centroid[0], centroid[0].length);\n\t\t\tgetCentroid(data,noofcluster,centroid,flag);\n\t\t}\n\t\t\n\t\tif(finalcentroid) {\n\t\t\tSystem.out.println(\"Final Cluster: \"+finalCluster);\n\t\t\tfor(int i=0;i<5;i++) {\n\t\t\t\tSystem.out.print(\"Final Centroid: \"+centroid[1][i]+\" \");\n\t\t\t}\n\t\t}\n\t\treturn centroid;\n\t}", "@Parameters(name = \"{index}: clustered={0}\")\n\tpublic static Collection<Object[]> data() {\n\t\treturn Arrays.asList(new Object[][] {\n\t\t\t{ true },\n\t\t\t{ false }\n\t\t});\n\t}", "public String getClusterId() {\n return clusterId;\n }", "public boolean isWebsiteInCluster(String website) {\r\n\t\tCluster temp = getACluster(website);\r\n\t\tif(temp == null) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tfor(Cluster c : this.clusters) {\r\n\t\t\tfor(Cluster.Point point : c.getPoints()) {\r\n\t\t\t\tfor(Cluster.Point tempPoint : temp.getPoints()) {\r\n\t\t\t\t\tif(point == tempPoint)\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public void updateClusteringPanel(SomClusteringResult result, boolean clusterColumn) {\r\n SelectionManager.Busy_Task(true, true);\r\n hierarchicalClustering = new SomClustComponent(result, Selection_Manager, DivaClientService, clusterColumn, rightPanelWidth, leftPanelHeight - 2);\r\n RootPanel.get(\"SomClusteringResults\").clear();\r\n RootPanel.get(\"SomClusteringResults\").add(hierarchicalClustering.getSomclusteringLayout());\r\n SelectionManager.Busy_Task(false, true);\r\n\r\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithTwoAscendingAndTwoDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.DESC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertEmptyComposite(bounds.get(1));\n\n // clustering_0 = 1 AND (clustering_1, clustering_2, clustering_3) > (2, 3, 4)\n Restriction eq = newSingleEq(cfMetaData, 0, value1);\n slice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n restrictions = restrictions.mergeWith(eq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2, clustering_3) > (2, 3, 4)\n Restriction in = newSingleIN(cfMetaData, 0, value1, value2);\n slice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n restrictions = restrictions.mergeWith(in);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n assertComposite(bounds.get(2), value2, value2, EOC.START);\n assertComposite(bounds.get(3), value2, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n assertComposite(bounds.get(2), value2, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(3), value2, EOC.END);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1, clustering_2, clustering_3) <= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) < (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4) AND (clustering_0, clustering_1) < (2, 3)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2, value3);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(1), value2, value3, EOC.START);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4) AND (clustering_0, clustering1, clustering_2, clustering_3) <= (4, 3, 2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value4, value3, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n assertComposite(bounds.get(2), value4, value3, value2, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(1), value4, value3, EOC.START);\n assertComposite(bounds.get(2), value4, value3, EOC.END);\n }", "static boolean isClusterCandidate_(double x_1, double y1, double x2,\n\t\t\tdouble y2, double sqr_tolerance) {\n\t\tdouble dx = x_1 - x2;\n\t\tdouble dy = y1 - y2;\n\t\treturn dx * dx + dy * dy <= sqr_tolerance;\n\t}", "@Override\n public boolean onClusterClick(Cluster<Parking> cluster) {\n Toast.makeText(this, \"cluster clicked\", Toast.LENGTH_SHORT).show();\n\n // Zoom in the cluster. Need to create LatLngBounds and including all the cluster items\n // inside of bounds, then animate to center of the bounds.\n\n // Create the builder to collect all essential cluster items for the bounds.\n LatLngBounds.Builder builder = LatLngBounds.builder();\n for (ClusterItem item : cluster.getItems()) {\n builder.include(item.getPosition());\n }\n // Get the LatLngBounds\n final LatLngBounds bounds = builder.build();\n\n // Animate camera to the bounds\n try {\n getMap().animateCamera(CameraUpdateFactory.newLatLngBounds(bounds, 100));\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n return true;\n }", "void setAllowClusterGet( boolean r );", "public Clustering<V> compute() {\n if (graph.vertexSet().isEmpty()) {\n return new ClusteringImpl<>(Collections.emptyList());\n }\n\n matrix = Matrices.buildAdjacencyMatrix(graph, mapping, true);\n\n normalize();\n\n for (var i = 0; i < iterations; i++) {\n final var previous = matrix.copy();\n\n expand();\n inflate();\n normalize();\n\n if (matrix.equals(previous)) break;\n }\n\n // matrix can contain identical clusters of elements which are less than one\n final var clusters = new HashSet<Set<V>>(matrix.getRowDimension());\n\n for (var i = 0; i < matrix.getRowDimension(); i++) {\n final var cluster = new HashSet<V>();\n\n for (var j = 0; j < matrix.getColumnDimension(); j++) {\n if (matrix.getEntry(i, j) > 0) cluster.add(mapping.getIndexList().get(j));\n }\n\n if (!cluster.isEmpty()) clusters.add(cluster);\n }\n\n return new ClusteringImpl<>(new ArrayList<>(clusters));\n }", "public boolean deleteSpectralCluster(){\r\n\t\tList<TagCluster> tagClusters = this.listTagCluster();\r\n\t\tfor (TagCluster tagCluster : tagClusters) {\r\n\t\t\tentityManager.remove(tagCluster);\r\n//\t\t\tentityManager.flush();\r\n\t\t}\r\n\t\treturn listTagCluster().isEmpty();\r\n\t}", "public Builder setCluster(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n cluster_ = value;\n onChanged();\n return this;\n }", "public double computeSimilarity(int[] cluster1, int[] cluster2);", "public boolean isRedisClusterMode()\n\t{\n\t\tString isCluster = provider.getRedisSettings().get(IConfigProvider.REDIS_CLUSTER_MODE);\n\t\tif( StringUtils.isNotBlank( isCluster ) && \"true\".equals(isCluster)){\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "String getClusterName();", "@Test\n @Transactional\n public void test_indexWithClusterShowsData() throws Exception {\n // Create a cluster\n final String cluster1Name = \"My Test Cluster\";\n final String cluster2Name = \"My Other Test Cluster\";\n final Cluster cluster1 = clusterTestTools.createCluster(cluster1Name);\n final Cluster cluster2 = clusterTestTools.createCluster(cluster2Name);\n\n // Hit the index page.\n mockMvc\n .perform(get(\"/cluster/\")\n .with(user(adminUserDetails)))\n .andDo(print())\n .andExpect(status().isOk())\n // Should contain this text\n .andExpect(content().string(containsString(\"Kafka Clusters\")))\n .andExpect(content().string(containsString(cluster1Name)))\n .andExpect(content().string(containsString(cluster2Name)))\n .andExpect(content().string(containsString(\"\\\"/cluster/\" + cluster1.getId() + \"\\\"\")))\n .andExpect(content().string(containsString(\"\\\"/cluster/\" + cluster2.getId() + \"\\\"\")))\n .andExpect(content().string(containsString(\"\\\"/view?cluster.id=\" + cluster1.getId() + \"\\\"\")))\n .andExpect(content().string(containsString(\"\\\"/view?cluster.id=\" + cluster2.getId() + \"\\\"\")))\n // But not this\n .andExpect(content().string(not(containsString(ClusterTestTools.NO_CLUSTERS_SETUP_TEXT))));\n }", "public String getClusterId() {\n return this.ClusterId;\n }", "@Test\n public void testClusterForgetNode() throws InterruptedException {\n node1.clusterMeet(\"127.0.0.1\", nodeInfo4.getPort());\n\n String node7Id = JedisClusterTestUtil.getNodeId(node4.clusterNodes());\n\n JedisClusterTestUtil.assertNodeIsKnown(node3, node7Id, 1000);\n JedisClusterTestUtil.assertNodeIsKnown(node2, node7Id, 1000);\n JedisClusterTestUtil.assertNodeIsKnown(node1, node7Id, 1000);\n\n assertNodeHandshakeEnded(node3, 1000);\n assertNodeHandshakeEnded(node2, 1000);\n assertNodeHandshakeEnded(node1, 1000);\n\n assertEquals(4, node1.clusterNodes().split(\"\\n\").length);\n assertEquals(4, node2.clusterNodes().split(\"\\n\").length);\n assertEquals(4, node3.clusterNodes().split(\"\\n\").length);\n\n // do cluster forget\n node1.clusterForget(node7Id);\n node2.clusterForget(node7Id);\n node3.clusterForget(node7Id);\n\n JedisClusterTestUtil.assertNodeIsUnknown(node1, node7Id, 1000);\n JedisClusterTestUtil.assertNodeIsUnknown(node2, node7Id, 1000);\n JedisClusterTestUtil.assertNodeIsUnknown(node3, node7Id, 1000);\n\n assertEquals(3, node1.clusterNodes().split(\"\\n\").length);\n assertEquals(3, node2.clusterNodes().split(\"\\n\").length);\n assertEquals(3, node3.clusterNodes().split(\"\\n\").length);\n }", "@Test\r\n public void testMerge() throws Exception {\r\n// List<ISpectrum> spectra = ClusteringTestUtilities.readConsensusSpectralItems();\r\n//\r\n// List<ICluster> list = ClusterUtilities.asClusters(spectra);\r\n// IClusteringEngine engine = new ClusteringEngineFactory().getClusteringEngine();\r\n// for (ICluster sc : list) {\r\n// engine.addClusters(sc);\r\n// }\r\n// for (int i = 0; i < Defaults.getNumberReclusteringPasses(); i++) {\r\n// if (!engine.processClusters())\r\n// break;\r\n// }\r\n// // we have solved for these\r\n// List<ICluster> found = (List<ICluster>) engine.getClusters();\r\n//\r\n//\r\n// final ISimilarityChecker similarityChecker = new FrankEtAlDotProduct(Defaults.getFragmentIonTolerance(), Defaults.getNumberComparedPeaks());\r\n// final List<ICluster> newClusters = ClusterUtilities.mergeClusters(found, similarityChecker, 1);\r\n//\r\n// // because we just did this in the engine we expect little further merging\r\n// Assert.assertEquals(newClusters.size(), found.size());\r\n\r\n\r\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithSliceRestrictionsAndOneDescendingClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newSingleSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newSingleSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n }", "private int getClusterIndex(int element)\n\t{\n\t\tfor(int i=0; i<clusters.size(); i++)\n\t\t{\n\t\t\tVector v = (Vector)clusters.elementAt(i);\n\t\t\t\n\t\t\tif (v.contains(new Integer(element)))\n\t\t\t\treturn i;\n\t\t}\n\t\t\n\t\treturn -1;\n\t}", "boolean isKey( ImmutableBitSet columns );", "public void clusterNetTrained() {\n useClustersCheckBoxMenuItem.setEnabled(true);\n }", "java.lang.String getClusterName();", "private static int findNoK(double[][] X){\n int noK = 0;\n int high = X.length / 2;\n\n if (OverrideClusterNo > 0){\n \treturn OverrideClusterNo;\n }\n \n if (high <= 0){\n \tnoK = -1; //TODO JMC Break\n }\n else if (high == 1){\n noK = 1;\n }\n else if (high == 2){\n noK = 2;\n }\n else if (high > MaxClusters){\n \tnoK = MaxClusters;\n }\n else{\n noK = (int)(Math.random() * (high - 2) + 2) + 1;\n }\n \n return noK;\n }", "public static void cluster(String[] args, boolean converged)\n\t\t\tthrows IOException, InterruptedException, ClassNotFoundException {\n\t\tSystem.out.println(\"Using mapper to output clustering information...\");\n\t\tConfiguration conf = new Configuration();\n\t\tString[] otherArgs = new GenericOptionsParser(conf, args).getRemainingArgs();\n\t\tconf.set(\"old.center.path\", otherArgs[3]);\n\t\tconf.set(\"K\", otherArgs[5]);\n\t\tconf.set(\"include.center.in.mapper\", \"1\");\n\t\tconf.set(\"converged\", converged ? \"1\" : \"0\");\n\t\tJob job = new Job(conf, \"KMeansCluster\");\n\t\tjob.setJarByClass(KMeansDriver.class);\n\n\t\tPath in = new Path(otherArgs[1]);\n\t\tPath out = new Path(otherArgs[2] + \"/\" + \"clustering_info\");\n\t\tFileInputFormat.addInputPath(job, in);\n\t\tFileSystem fs = FileSystem.get(conf);\n\t\tif (fs.exists(out)) {\n\t\t\tfs.delete(out, true);\n\t\t}\n\t\tFileOutputFormat.setOutputPath(job, out);\n\n\t\t//No reducer needed here.\n\t\tjob.setMapperClass(KMeansMapper.class);\n\t\tjob.setOutputKeyClass(IntWritable.class);\n\t\tjob.setOutputValueClass(Text.class);\n\t\tjob.setNumReduceTasks(0);\n\t\tjob.waitForCompletion(true);\n\t}", "public Boolean getCacheClusterEnabled() {\n return cacheClusterEnabled;\n }", "public boolean isBkgGray(int index) {\n if (index % 2 != 0) {\n index -= 1;\n }\n index = index / 2;\n if ( ( (Integer) clusters[index][4]).intValue() == 1) {\n return true;\n }\n else {\n return false;\n }\n }", "protected boolean waitForClusterToStart() throws HoneycombTestException {\n\n Log.INFO(\"Waiting for cluster to come Online...\");\n boolean ready = false;\n int i = MAX_ONLINE_ITERATIONS;\n while (i > 0 && !ready) {\n try {\n i--;\n ArrayList lines = readSysstat();\n if (lines.toString().contains(nodesOnlineString)) {\n ready = true;\n } \n if (!ready)\n pause(SLEEP_WAKEUP_TIMEOUT);\n } catch (Throwable e) {\n pause(SLEEP_WAKEUP_TIMEOUT);\n }\n }\n if (i == 0) {\n Log.WARN(\"Cluster is not Online\");\n }\n if (!ready)\n okToProceed = false;\n return ready;\n }", "public boolean checkGradient() {\r\n boolean temp = true;\r\n for (int i = 0; i<clusters.length; i++) {\r\n for (int j = 0; j<clusters[i].length; j++) {\r\n try {\r\n if (this.data.getProbeColor(this.experiment.getGeneIndexMappedToData(clusters[i][j])) != null) {\r\n temp = false;\r\n }\r\n } catch (Exception e) {\r\n }\r\n }\r\n }\r\n return temp;\r\n }", "boolean hasMetricTreatment();" ]
[ "0.6966537", "0.6900383", "0.6391728", "0.61760414", "0.6170022", "0.6149921", "0.60524374", "0.57367706", "0.5714012", "0.5708318", "0.57000613", "0.56846195", "0.56577516", "0.55612725", "0.5550161", "0.5536463", "0.5534219", "0.5491301", "0.5436463", "0.54107153", "0.5394367", "0.5390368", "0.53414637", "0.53369415", "0.52991444", "0.5279277", "0.52766323", "0.52400565", "0.5224661", "0.5222905", "0.5220324", "0.5218689", "0.52162063", "0.52152973", "0.5155898", "0.5149701", "0.51394385", "0.5131852", "0.51268417", "0.5087199", "0.50840735", "0.50756186", "0.5074825", "0.50625056", "0.50614256", "0.50481606", "0.5040607", "0.5037277", "0.5037184", "0.5037184", "0.50174636", "0.501534", "0.5005011", "0.49942663", "0.49881798", "0.4979699", "0.4979699", "0.49620032", "0.49587795", "0.49587795", "0.49587795", "0.49587795", "0.49587795", "0.49587795", "0.49559247", "0.49544877", "0.49478945", "0.49432224", "0.4942252", "0.4941931", "0.4932465", "0.49301383", "0.49179694", "0.4909557", "0.49077374", "0.49021676", "0.49008855", "0.4896182", "0.48943597", "0.4893282", "0.48829648", "0.48752514", "0.4860085", "0.48532414", "0.48524755", "0.48517895", "0.48501357", "0.48490718", "0.48469925", "0.48342016", "0.48332712", "0.48272732", "0.4824103", "0.48225173", "0.48190117", "0.48156843", "0.48132083", "0.4801504", "0.4785299", "0.4784472" ]
0.5678409
12
Test 'clustering_1 = 1' with 2 clustering columns
@Test public void testBoundsAsCompositesWithOneEqRestrictionsAndTwoClusteringColumns() { CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC); ByteBuffer clustering_0 = ByteBufferUtil.bytes(1); Restriction eq = newSingleEq(cfMetaData, 0, clustering_0); PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(eq); List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), clustering_0, EOC.START); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), clustering_0, EOC.END); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean hasCluster();", "boolean getIsClusteringKey();", "public interface IStoppingCriteria {\n\n /**\n * Determine the degree of clustering agreement\n * @param cluster1 one clustering results\n * @param cluster2 the other clustering results\n * @return the degree of clustering agreement; 1 refers to be the same clustering results; 0 refers to be the totally different clustering results\n */\n public double computeSimilarity(int[] cluster1, int[] cluster2);\n\n}", "public double computeSimilarity(int[] cluster1, int[] cluster2);", "public void decideCluster(){\n\tdouble shortest = 1000000;\n\tfor(int i = 0; i < clusterDist.length; i++)\n\t{\n\t\tif(clusterDist[i] < shortest)\n\t\t{\tshortest = clusterDist[i];\n\t\t\tthis.clusterid = i;\n\t\t}\n\t\t\n\t}\n}", "@Test\n public void testOverlappingPartitionsOverlappingClusters()\n {\n check(overlappingClustersWithOverlappingPartitions(), 0.75, 1.0);\n }", "boolean hasClusterName();", "private void runSomClustering(int linkage, int distanceMeasure, final boolean clusterColumns) {\r\n DivaClientService.computeSomClustering(linkage, distanceMeasure, clusterColumns,\r\n new AsyncCallback<SomClusteringResult>() {\r\n @Override\r\n public void onFailure(Throwable caught) {\r\n\r\n Selection_Manager.connError();\r\n SelectionManager.Busy_Task(false, true);\r\n }\r\n\r\n @Override\r\n public void onSuccess(SomClusteringResult result) {\r\n hierarchicalClustering = new SomClustComponent(result, Selection_Manager, DivaClientService, true, rightPanelWidth, leftPanelHeight);\r\n RootPanel.get(\"SomClusteringResults\").clear();\r\n RootPanel.get(\"SomClusteringResults\").add(hierarchicalClustering.getSomclusteringLayout());\r\n Timer t = new Timer() {\r\n @Override\r\n public void run() {\r\n hierarchicalClustering.selectRootNode();\r\n }\r\n };\r\n// Schedule the timer to run once in 0.5 seconds.\r\n// if (result.getRowNames().length < 5000) {\r\n//// t.schedule(500);\r\n// SelectionManager.Busy_Task(false, true);\r\n// } else {\r\n SelectionManager.Busy_Task(false, true);\r\n// }\r\n init = false;\r\n }\r\n });\r\n\r\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithTwoClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.END);\n }", "public void compareWithinClusters() {\n\t\tList<Cluster> clusterList = clusterDao.getClusterList();\n\n\t\tfor (Cluster cluster : clusterList) {\n\t\t\tList<Document> docList = documentDao.getDocListByClusterId(cluster.getId());\n\t\t\tint size = docList.size();\n\t\t\t\n\t\t\tdouble[][] matrix = new double[size][size];\n\t\t\t\n\t\t\tfor(int i =0; i<size; i++){\n\t\t\t\tmatrix[i][i] = 1;\n\t\t\t\tmatrix[i][i] = 1;\n\t\t\t}\n\t\t\t\n\t\t\tif (size > 1) {\n\t\t\t\t//List<Document> docList2 = docList1;\n\t\t\t\tfor (int i=0; i<size; i++){\n\t\t\t\t\tfor(int j=i+1; j<size; j++){\n\t\t\t\t\t\t//match docs docList.get(i) & docList.get(j)\n\t\t\t\t\t\tMap<String, Double> map = datumboxCaller.compareDocs(docList.get(i).getDocName(), docList.get(j).getDocName());\n\t\t\t\t\t\tmatrix[i][j] = map.get(\"Oliver\");\n\t\t\t\t\t\tmatrix[j][i] = map.get(\"Shingle\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//persist both metrics in a file \n\t\t\tpersist(matrix, cluster, docList);\n\t\t\t\n\t\t\t//printing the matrix\n\t\t\tSystem.out.println(\"\\nDocument Similarity Matrix for Cluster \"+cluster.getId());\n\t\t\tSystem.out.println(\"\\nOliver Metric\");\n\t\t\tSystem.out.print(\"id\");\n\t\t\tfor(int i=0; i<size; i++)\n\t\t\t\tSystem.out.print(\"\\t\"+docList.get(i).getId());\n\t\t\t\n\t\t\tfor(int i=0; i<size; i++){\n\t\t\t\tSystem.out.println(docList.get(i).getId());\n\t\t\t\tfor(int j=0; j<size; j++){\n\t\t\t\t\tSystem.out.print(\"\\t\");\n\t\t\t\t\tif(j>=i)\n\t\t\t\t\t\tSystem.out.print(matrix[i][j]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(\"\\nShingle Metric\");\n\t\t\tSystem.out.print(\"id\");\n\t\t\tfor(int i=0; i<size; i++)\n\t\t\t\tSystem.out.print(\"\\t\"+docList.get(i).getId());\n\t\t\t\n\t\t\tfor(int i=0; i<size; i++){\n\t\t\t\tSystem.out.print(\"\\n\"+docList.get(i).getId());\n\t\t\t\tfor(int j=0; j<size; j++){\n\t\t\t\t\tSystem.out.print(\"\\t\");\n\t\t\t\t\tif(j>=i)\n\t\t\t\t\t\tSystem.out.print(matrix[j][i]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t//print ends\n\t\t\t\n\t\t}\n\n\t}", "@Test\n public void testBoundsAsCompositesWithOneEqRestrictionsAndOneClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC);\n\n ByteBuffer clustering_0 = ByteBufferUtil.bytes(1);\n Restriction eq = newSingleEq(cfMetaData, 0, clustering_0);\n\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.END);\n }", "private void clusterElements(int element1,int element2)\n\t{\n\t\tint index1 = getClusterIndex(element1);\n\t\tint index2 = getClusterIndex(element2);\n\t\t\n\t\t\n\t\tif (index1 != index2)\n\t\t\tif((index1 != -1) && (index2 != -1))\n\t\t\t\tcombineClusters(index1,index2);\n\t}", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneAscendingAndOneDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n assertComposite(bounds.get(2), value2, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertComposite(bounds.get(1), value2, EOC.START);\n assertComposite(bounds.get(2), value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneDescendingAndOneAscendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0) > (1) AND (clustering_0, clustering1) < (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.END);\n assertComposite(bounds.get(2), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.END);\n assertComposite(bounds.get(1), value1, EOC.START);\n assertComposite(bounds.get(2), value1, EOC.END);\n }", "@Test\n public void testHardClustersWithOverlappingPartitions()\n {\n check(hardClustersWithOverlappingPartitions(), 0.0, 1.0);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithTwoDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsMixingAscendingDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.DESC, Sort.ASC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(3));\n\n // clustering_0 = 1 AND (clustering_1, clustering_2, clustering_3) > (2, 3, 4)\n Restriction eq = newSingleEq(cfMetaData, 0, value1);\n slice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n restrictions = restrictions.mergeWith(eq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(3));\n\n\n // (clustering_0, clustering1, clustering_2, clustering_3) <= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, value4, EOC.NONE);\n assertComposite(bounds.get(3), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) < (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(3), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4) AND (clustering_0, clustering_1) < (2, 3)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2, value3);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(5, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n assertComposite(bounds.get(4), value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(5, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertComposite(bounds.get(3), value2, EOC.START);\n assertComposite(bounds.get(4), value2, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4) AND (clustering_0, clustering1, clustering_2, clustering_3) <= (4, 3, 2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value4, value3, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(7, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n assertComposite(bounds.get(4), value4, value3, EOC.START);\n assertComposite(bounds.get(5), value4, value3, value2, value1, EOC.NONE);\n assertComposite(bounds.get(6), value4, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(7, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertComposite(bounds.get(3), value4, EOC.START);\n assertComposite(bounds.get(4), value4, value3, value2, EOC.START);\n assertComposite(bounds.get(5), value4, value3, value2, EOC.END);\n assertComposite(bounds.get(6), value4, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithTwoAscendingAndTwoDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.DESC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertEmptyComposite(bounds.get(1));\n\n // clustering_0 = 1 AND (clustering_1, clustering_2, clustering_3) > (2, 3, 4)\n Restriction eq = newSingleEq(cfMetaData, 0, value1);\n slice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n restrictions = restrictions.mergeWith(eq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2, clustering_3) > (2, 3, 4)\n Restriction in = newSingleIN(cfMetaData, 0, value1, value2);\n slice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n restrictions = restrictions.mergeWith(in);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n assertComposite(bounds.get(2), value2, value2, EOC.START);\n assertComposite(bounds.get(3), value2, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n assertComposite(bounds.get(2), value2, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(3), value2, EOC.END);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1, clustering_2, clustering_3) <= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) < (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4) AND (clustering_0, clustering_1) < (2, 3)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2, value3);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(1), value2, value3, EOC.START);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4) AND (clustering_0, clustering1, clustering_2, clustering_3) <= (4, 3, 2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value4, value3, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n assertComposite(bounds.get(2), value4, value3, value2, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(1), value4, value3, EOC.START);\n assertComposite(bounds.get(2), value4, value3, EOC.END);\n }", "public float compare(Cluster other) {\n \treturn compare(center, other.center);\n }", "@Override\n public boolean getIsClusteringKey() {\n return isClusteringKey_;\n }", "@Override\n public boolean getIsClusteringKey() {\n return isClusteringKey_;\n }", "private static void clustering() {\n \tclustering(clArgs.clusteringInFile, clArgs.clusteringOutDir,\n \t\t\tclArgs.clusteringOpticsXi, clArgs.clusteringOpticsMinPts);\n }", "public static void main(String[] args)\r\n\t{\n\t\tList<Location> locations = new ArrayList<Location>();\r\n\t\tlocations.add(new Location(150, 981));\r\n\t\tlocations.add(new Location(136, 0));\r\n\t\tlocations.add(new Location(158, 88));\r\n\t\tlocations.add(new Location(330, 60));\r\n\t\tlocations.add(new Location(0, 1001));\r\n\t\tlocations.add(new Location(150, 0));\r\n\t\tlocations.add(new Location(0, 0));\r\n\t\tlocations.add(new Location(0, 0));\r\n\t\tlocations.add(new Location(0, 0));\r\n\t\tlocations.add(new Location(446, 88));\r\n\t\tlocations.add(new Location(562, 88));\r\n\t\tlocations.add(new Location(256, 88));\r\n\t\tlocations.add(new Location(678, 88));\r\n\t\tlocations.add(new Location(794, 88));\r\n\t\tlocations.add(new Location(0, 1028));\r\n\t\tlocations.add(new Location(136, 0));\r\n\t\tlocations.add(new Location(150, 0));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 1028));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(136, 103));\r\n\t\tlocations.add(new Location(150, 0));\r\n\t\tList<LocationWrapper> clusterInput = new ArrayList<LocationWrapper>(locations.size());\r\n\t\tfor (Location location : locations)\r\n\t\t\tclusterInput.add(new LocationWrapper(location));\r\n\r\n\t\t// initialize a new clustering algorithm.\r\n\t\t// we use KMeans++ with 10 clusters and 10000 iterations maximum.\r\n\t\t// we did not specify a distance measure; the default (euclidean\r\n\t\t// distance) is used.\r\n\t\t// org.apache.commons.math3.ml.clustering.FuzzyKMeansClusterer<LocationWrapper>\r\n\t\t// clusterer = new\r\n\t\t// org.apache.commons.math3.ml.clustering.FuzzyKMeansClusterer<LocationWrapper>(2,\r\n\t\t// 2);\r\n\t\t// KMeansPlusPlusClusterer<LocationWrapper> clusterer = new\r\n\t\t// KMeansPlusPlusClusterer<LocationWrapper>(2, 10);\r\n\r\n\t\tDBSCANClusterer<LocationWrapper> clusterer = new DBSCANClusterer<LocationWrapper>(1200.0, 5);\r\n\t\tList<Cluster<LocationWrapper>> clusterResults = clusterer.cluster(clusterInput);\r\n\t\t// List<CentroidCluster<LocationWrapper>> clusterResults =\r\n\t\t// clusterer.cluster(clusterInput);\r\n\r\n\t\t// output the clusters\r\n\t\tSystem.out.println(\"clusterResults.size() = \" + clusterResults.size());\r\n\t\tfor (int i = 0; i < clusterResults.size(); i++)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Cluster \" + i);\r\n\t\t\tfor (LocationWrapper locationWrapper : clusterResults.get(i).getPoints())\r\n\t\t\t\tSystem.out.println(locationWrapper.getLocation());\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\t}", "private ClusterCombination checkAndDoJoinMultiPearson(ClusterCombination CC1, ClusterCombination CC2) {\n boolean doJoin = true;\r\n ArrayList<Cluster> CCList = new ArrayList<>(CC1.getClusters().size()+1); //list of output clusters for new CC if join is succesfull\r\n\r\n ArrayList<Cluster> CC1Clusters = CC1.getClusters();\r\n ArrayList<Cluster> CC2Clusters = CC2.getClusters();\r\n\r\n ArrayList<Cluster> LHS1 = CC1.getLHS();\r\n ArrayList<Cluster> LHS2 = CC2.getLHS();\r\n\r\n ArrayList<Cluster> RHS1 = CC1.getRHS();\r\n ArrayList<Cluster> RHS2 = CC2.getRHS();\r\n\r\n for(int i =0; i<CC1Clusters.size()-1; i++) {\r\n Cluster C1 = CC1Clusters.get(i);\r\n Cluster C2 = CC2Clusters.get(i);\r\n\r\n boolean overlap = checkClusterOverlap(C1, C2); // check if there is some overlap\r\n\r\n\r\n\r\n if(!overlap){ //the cluster in this position does not overlap, we don't need to join\r\n doJoin=false;\r\n break;\r\n }else{ // there is overlap, add the intersection of C1 and C2\r\n if(C1.getNPoints() <= C2.getNPoints()){\r\n CCList.add(C1);\r\n }else{\r\n CCList.add(C2);\r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n\r\n if(doJoin){ // each cluster in the candidate (except the last) does overlap\r\n // so, according to apriori, we join -> return the overlapping clusters + the last clusters of CC1 and CC2\r\n Cluster lastCC1 = CC1Clusters.get(CC1Clusters.size()-1);\r\n Cluster lastCC2 = CC2Clusters.get(CC2Clusters.size()-1);\r\n if(lastCC1.getClusterId() <= lastCC2.getClusterId()){ // make sure to respect ordering of clusters within a candidate by ID. otherwise this could be designated as a duplicate\r\n CCList.add(lastCC1); CCList.add(lastCC2);\r\n }else{\r\n CCList.add(lastCC2); CCList.add(lastCC1);\r\n }\r\n\r\n ArrayList<Cluster> newLHS = new ArrayList<>();\r\n ArrayList<Cluster> newRHS = new ArrayList<>();\r\n for(int i = 0; i<LHS1.size(); i++){\r\n newLHS.add(CCList.get(i));\r\n }\r\n for(int i = LHS1.size(); i<CCList.size(); i++){\r\n newRHS.add(CCList.get(i));\r\n }\r\n\r\n ClusterCombination newCC = new MultiPearsonClusterCombination(newLHS, newRHS);\r\n newCC.checkAndSetMaxSubsetLowerBound(Math.max(CC1.getLB(), CC1.getMaxLowerBoundSubset()));\r\n newCC.checkAndSetMaxSubsetLowerBound(Math.max(CC2.getLB(), CC2.getMaxLowerBoundSubset()));\r\n\r\n return newCC;\r\n\r\n }else{\r\n return null;\r\n }\r\n }", "protected boolean isClusterRequired() {\n return true;\n }", "public int[] findClusterCorrespondence(int[] idx1, int[] idx2) {\n\t\tint n = idx1.length;\n\t\tif (n != idx2.length) {\n\t\t\tSystem.out.println(\"Cluster Utils: findClusterCorrespondence: idx1 and idx2 has to have same number of elements\");\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t// find unique values in idx1 and idx2\n\t\tUniqueResult<Integer> ur_idx1 = utils.findUnique(idx1);\n\t\tUniqueResult<Integer> ur_idx2 = utils.findUnique(idx2);\n\t\tif (ur_idx1.domain.length != ur_idx2.domain.length) {\n\t\t\tSystem.out.println(\"Cluster Utils: findClusterCorrespondence: idx1 and idx2 has different number of clusters\");\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t// find Jaccard coefficient\n\t\tdouble[][] J = findJaccardIndex(idx1, idx2);\n\t\t\n\t\t// use Hungarian method - use any kind of Hungarian algorithm\n\t\tHungarianAlgorithm h = new HungarianAlgorithm();\n\t\t@SuppressWarnings(\"static-access\")\n\t\tint[][] match = h.hgAlgorithm(J, \"max\");\n\t\t\n\t\t// print match matrix\n\t\tif (verbose) {\n\t\t\tSystem.out.println(\"Hunguarian Cost Matrix\");\n\t\t\tutils.printMatrix(match);\n\t\t}\n\t\t\n\t\t// relabel the idx2\n\t\tif (verbose) System.out.println(\"Class correspondents matrix:\");\n\t\tint[] target = idx1.clone();\n\t\tfor (int i = 0; i < match.length; i++) {\n\t\t\tint idx1_index = ur_idx1.domain[match[i][0]];\n\t\t\tint idx2_index = ur_idx2.domain[match[i][1]];\n\t\t\tif (verbose) System.out.printf(\"%d\\t%d\", idx1_index, idx2_index);\t\t\t\n\t\t\tif (idx1_index != idx2_index) {\n\t\t\t\tif (verbose) System.out.printf(\"\\t(will replace all %d in idx2 by %d)\", idx2_index, idx1_index);\n\t\t\t\tboolean[] index = utils.getIndexByValue(idx2, idx2_index);\n\t\t\t\tfor (int j = 0; j < n; j++) {\n\t\t\t\t\tif (index[j]) target[j] = idx1_index;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (verbose) System.out.printf(\"\\n\");\n\t\t}\n\t\t\n\t\tif (verbose) {\n\t\t\tint v_tt = 15;\n\t\t\tif (target.length < v_tt) v_tt = target.length;\n\t\t\tSystem.out.printf(\"Printing first %d elements of input and output arrays\\n\", v_tt);\n\t\t\tSystem.out.printf(\"IDX1\\tIDX2\\tFINAL IDX\\n\");\n\t\t\tfor (int i = 0; i < v_tt; i++) System.out.printf(\"%d\\t%d\\t%d\\n\", idx1[i], idx2[i], target[i]);\n\t\t}\n\t\t\n\t\treturn target;\n\t}", "@Test\r\n public void testGroupSimilarity() throws Exception {\r\n final List<ICluster> originalCLuster = ClusteringTestUtilities.readSpectraClustersFromResource();\r\n Collections.sort(originalCLuster);\r\n List<ICluster> l1 = new ArrayList<ICluster>(originalCLuster);\r\n\r\n final List<ICluster> originalCLuster2 = ClusteringTestUtilities.readSpectraClustersFromResource();\r\n Collections.sort(originalCLuster2);\r\n List<ICluster> l2 = new ArrayList<ICluster>(originalCLuster2);\r\n\r\n ClusterListSimilarity cd = new ClusterListSimilarity(distanceMeasure);\r\n final List<ICluster> identical = cd.identicalClusters(l1, l2);\r\n\r\n Assert.assertEquals(originalCLuster.size(), identical.size());\r\n Assert.assertTrue(l1.isEmpty());\r\n Assert.assertTrue(l2.isEmpty());\r\n }", "public void processFoundCluster(NodeSet cluster) {\n\t}", "@Test\n public void testBoundsAsCompositesWithSliceRestrictionsAndOneClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newSingleSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newSingleSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n }", "boolean hasPermissionOfCluster(String clusterId, String userName);", "@Test\r\n public void testMerge() throws Exception {\r\n// List<ISpectrum> spectra = ClusteringTestUtilities.readConsensusSpectralItems();\r\n//\r\n// List<ICluster> list = ClusterUtilities.asClusters(spectra);\r\n// IClusteringEngine engine = new ClusteringEngineFactory().getClusteringEngine();\r\n// for (ICluster sc : list) {\r\n// engine.addClusters(sc);\r\n// }\r\n// for (int i = 0; i < Defaults.getNumberReclusteringPasses(); i++) {\r\n// if (!engine.processClusters())\r\n// break;\r\n// }\r\n// // we have solved for these\r\n// List<ICluster> found = (List<ICluster>) engine.getClusters();\r\n//\r\n//\r\n// final ISimilarityChecker similarityChecker = new FrankEtAlDotProduct(Defaults.getFragmentIonTolerance(), Defaults.getNumberComparedPeaks());\r\n// final List<ICluster> newClusters = ClusterUtilities.mergeClusters(found, similarityChecker, 1);\r\n//\r\n// // because we just did this in the engine we expect little further merging\r\n// Assert.assertEquals(newClusters.size(), found.size());\r\n\r\n\r\n }", "static double clusterVerticesOneStep(Mesh mesh) {\n\t\t\n\t\t// for each pair of the vertices\n\t\tdouble mindis = 1.0e+30;\n\t\tfor(int i = 0; i < mesh.getNumVertices(); i++) {\n\t\t\tVertex v1 = mesh.getVertex(i);\n\t\t\tfor(int j = (i + 1); j < mesh.getNumVertices(); j++) {\n\t\t\t\tVertex v2 = mesh.getVertex(j);\n\t\t\t\n\t\t\t\t// for each pair of the nodes\n\t\t\t\tdouble maxdis = 0.0;\n\t\t\t\tfor(int ii = 0; ii < v1.nodes.size(); ii++) {\n\t\t\t\t\tNode n1 = (Node)v1.nodes.get(ii);\n\t\t\t\t\tfor(int jj = 0; jj < v2.nodes.size(); jj++) {\n\t\t\t\t\t\tNode n2 = (Node)v2.nodes.get(jj);\n\t\t\t\t\t\tif(n1.getDisSim2(n2.getId()) > maxdis) {\n\t\t\t\t\t\t\tmaxdis = n1.getDisSim2(n2.getId());\n\t\t\t\t\t\t\tif(maxdis > mindis) {\n\t\t\t\t\t\t\t\tii = v1.nodes.size(); break;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// update mindis\n\t\t\t\tif(mindis > maxdis) {\n\t\t\t\t\tmindis = maxdis;\n\t\t\t\t\t//System.out.println(\" updated mindis=\" + mindis);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Determine the threshold\n\t\tdouble threshold = mindis * clusteringThreshold;\n\t\t\n\t\t// Combine close two vertices \n\t\tfor(int i = 0; i < mesh.getNumVertices(); i++) {\n\t\t\tVertex v1 = mesh.getVertex(i);\n\t\t\tfor(int j = (i + 1); j < mesh.getNumVertices(); j++) {\n\t\t\t\tVertex v2 = mesh.getVertex(j);\n\t\t\t\n\t\t\t\t// for each pair of the nodes\n\t\t\t\tdouble maxdis = -1.0;\n\t\t\t\tfor(int ii = 0; ii < v1.nodes.size(); ii++) {\n\t\t\t\t\tNode n1 = (Node)v1.nodes.get(ii);\n\t\t\t\t\tfor(int jj = 0; jj < v2.nodes.size(); jj++) {\n\t\t\t\t\t\tNode n2 = (Node)v2.nodes.get(jj);\n\t\t\t\t\t\tif(n1.getDisSim2(n2.getId()) > maxdis) {\n\t\t\t\t\t\t\tmaxdis = n1.getDisSim2(n2.getId());\n\t\t\t\t\t\t\tif(maxdis > threshold) {\n\t\t\t\t\t\t\t\tii = v1.nodes.size(); break;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(maxdis > threshold) continue;\n\t\t\t\t\n\t\t\t\t//System.out.println(\" combine: i=\" + i + \" j=\" + j + \" names=\" + authors + \" maxdis=\" + maxdis + \" th=\" + threshold);\n\t\t\t\t\n\t\t\t\t// combine the two vertices\n\t\t\t\tfor(int jj = 0; jj < v2.nodes.size(); jj++) {\n\t\t\t\t\tNode n2 = (Node)v2.nodes.get(jj);\n\t\t\t\t\tv1.nodes.add(n2);\n\t\t\t\t\tn2.setVertex(v1);\n\t\t\t\t}\n\t\t\t\tmesh.removeOneVertex(v2);\n\t\t\t\tj--;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn threshold;\n\t}", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n }", "static boolean isClusterCandidate_(double x_1, double y1, double x2,\n\t\t\tdouble y2, double sqr_tolerance) {\n\t\tdouble dx = x_1 - x2;\n\t\tdouble dy = y1 - y2;\n\t\treturn dx * dx + dy * dy <= sqr_tolerance;\n\t}", "public void activateCluster(){\n for (int row = 0; row < matrix.length; row++) {\n// Cell[] matrix1 = matrix[i];\n for (int col = 0; col < matrix[row].length; col++) {\n Cell cell = matrix[row][col];\n // check every if null it means there is no cell at that position\n // get fist occured cell and meet it with the next one\n // run the loop while\n // while cell.getRow < cell.bestRow && cell.getCol < cell.bestCol\n if(cell != null) {\n while (cell.getRow() <= this.cellBiggestRow && cell.getCol() <= this.cellBiggestCol) {\n\n if (cell.getCol() >= matrix[row].length) {\n if (!(cell.getRow() >= matrix.length)) {\n cell.setRow(cell.getRow() + 1);\n }\n } else {\n cell.setCol(cell.getCol() + 1);\n }\n\n // if cell.getCol + 1 < matrix[row].length && matrix[row] != null\n // get the next cell and do the fight\n }\n }\n }\n }\n\n }", "public boolean hasClusterName() {\n return endpointConfigCase_ == 2;\n }", "int getClusteringKeyCount();", "boolean isAllowClusterGet();", "public boolean isEqualTo(Cluster c)\n {\n int len = this.size();\n if (len != c.size()){\n return false;\n }\n if (len == 0){\n return true;\n }\n if (this.getLeader() != c.getLeader()){\n return false;\n }\n for (Integer n : this._elems){\n if (!c.contains(n)){\n return false;\n }\n }\n return true;\n }", "@Test\n public void testBoundsAsCompositesWithSliceRestrictionsAndOneDescendingClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newSingleSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newSingleSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n }", "private void doClustering(double[][] data, String[] names) {\n\t\ttry {\n\t\t\tClusteringAlgorithm algorithm = new DefaultClusteringAlgorithm();\n\t\t\tCluster cluster = algorithm.performClustering(data, names, new AverageLinkageStrategy());\n\t\t\tparentCluster = cluster;\n\t\t\tfillClusteredOrderedDataFromChildren(cluster);\n\t\t}catch(Exception e){\n\t\t\tJOptionPane.showMessageDialog(null, \"Duplicate identifiers found, the feature names should be unique\", \"Clustering error\", JOptionPane.ERROR_MESSAGE);\n\t\t\treturn;\n\t\t}\n\t}", "@Test\n public void testBoundsAsCompositesWithSingleEqAndMultiEqRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) = (2, 3)\n Restriction singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction multiEq = newMultiEq(cfMetaData, 1, value2, value3);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiEq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n // clustering_0 = 1 AND clustering_1 = 2 AND (clustering_2, clustering_3) = (3, 4)\n singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction singleEq2 = newSingleEq(cfMetaData, 1, value2);\n multiEq = newMultiEq(cfMetaData, 2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(singleEq2).mergeWith(multiEq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n\n // (clustering_0, clustering_1) = (1, 2) AND clustering_2 = 3\n singleEq = newSingleEq(cfMetaData, 2, value3);\n multiEq = newMultiEq(cfMetaData, 0, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiEq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) = (2, 3) AND clustering_3 = 4\n singleEq = newSingleEq(cfMetaData, 0, value1);\n singleEq2 = newSingleEq(cfMetaData, 3, value4);\n multiEq = newMultiEq(cfMetaData, 1, value2, value3);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiEq).mergeWith(singleEq2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneDescendingClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n }", "@java.lang.Override\n public boolean hasClusterName() {\n return endpointConfigCase_ == 2;\n }", "public Builder setIsClusteringKey(boolean value) {\n\n isClusteringKey_ = value;\n onChanged();\n return this;\n }", "private DataForSingleCluster[] clusterInstances(Instances i1, Instances i2) {\n DataForSingleCluster[] toReturn =\n new DataForSingleCluster[OCCTFineGrainedJaccardSplitModel.NUM_OF_CLUSTERS];\n // Make a single instances object in order to run the clustering algorithm with it\n Instances joinedInstances = this.joinInstances(i1, i2);\n // TODO: Maybe allow various clustering algorithms\n SimpleKMeans kMeansClusterer = new SimpleKMeans();\n try {\n // Build the clusterer using the joined instances\n kMeansClusterer.setNumClusters(OCCTFineGrainedJaccardSplitModel.NUM_OF_CLUSTERS);\n kMeansClusterer.buildClusterer(joinedInstances);\n // Initialize the array to return\n for (int i = 0; i < toReturn.length; ++i) {\n toReturn[i] = new DataForSingleCluster(i);\n }\n // Now, go over all the instances and separate them according their clustering result\n this.clusterSingleInstances(i1, true, kMeansClusterer, toReturn);\n this.clusterSingleInstances(i2, false, kMeansClusterer, toReturn);\n } catch (Exception e) {\n // TODO: What should we do in this case?\n e.printStackTrace();\n System.exit(-1);\n }\n return toReturn;\n }", "private static double intraClusterScore(List<String> arg1, List<String> arg2) {\n\t\t// compare each elements from argList1 vs argList2\n\n\t\tPair<String, String> pair = null;\n\t\tdouble tempScore = 0;\n\t\tdouble maxScore = 0;\n\n\t\tfor (int list1Id = 0; list1Id < arg1.size(); list1Id++) {\n\t\t\tfor (int list2Id = 0; list2Id < arg2.size(); list2Id++) {\n\n\t\t\t\t// create a pair\n\t\t\t\tpair = new ImmutablePair<String, String>(arg1.get(list1Id)\n\t\t\t\t\t\t.trim(), arg2.get(list2Id).trim());\n\n\t\t\t\ttry {\n\t\t\t\t\t// retrieve the key from the collection\n\t\t\t\t\ttempScore = SCORE_MAP.get(pair);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tpair = new ImmutablePair<String, String>(arg2.get(\n\t\t\t\t\t\t\t\tlist2Id).trim(), arg1.get(list1Id).trim());\n\t\t\t\t\t\ttempScore = SCORE_MAP.get(pair);\n\n\t\t\t\t\t} catch (Exception e1) {\n\t\t\t\t\t\ttempScore = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// System.out.println(\" temp score = \" + tempScore);\n\t\t\t\tmaxScore = (tempScore > maxScore) ? tempScore : maxScore;\n\t\t\t}\n\t\t}\n\n\t\t// System.out.println(\"max = \" + maxScore);\n\t\treturn maxScore;\n\t}", "public static void cluster(String[] args, boolean converged)\n\t\t\tthrows IOException, InterruptedException, ClassNotFoundException {\n\t\tSystem.out.println(\"Using mapper to output clustering information...\");\n\t\tConfiguration conf = new Configuration();\n\t\tString[] otherArgs = new GenericOptionsParser(conf, args).getRemainingArgs();\n\t\tconf.set(\"old.center.path\", otherArgs[3]);\n\t\tconf.set(\"K\", otherArgs[5]);\n\t\tconf.set(\"include.center.in.mapper\", \"1\");\n\t\tconf.set(\"converged\", converged ? \"1\" : \"0\");\n\t\tJob job = new Job(conf, \"KMeansCluster\");\n\t\tjob.setJarByClass(KMeansDriver.class);\n\n\t\tPath in = new Path(otherArgs[1]);\n\t\tPath out = new Path(otherArgs[2] + \"/\" + \"clustering_info\");\n\t\tFileInputFormat.addInputPath(job, in);\n\t\tFileSystem fs = FileSystem.get(conf);\n\t\tif (fs.exists(out)) {\n\t\t\tfs.delete(out, true);\n\t\t}\n\t\tFileOutputFormat.setOutputPath(job, out);\n\n\t\t//No reducer needed here.\n\t\tjob.setMapperClass(KMeansMapper.class);\n\t\tjob.setOutputKeyClass(IntWritable.class);\n\t\tjob.setOutputValueClass(Text.class);\n\t\tjob.setNumReduceTasks(0);\n\t\tjob.waitForCompletion(true);\n\t}", "@Test\n public void testBoundsAsCompositesWithSingleEqAndSliceRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n ByteBuffer value5 = ByteBufferUtil.bytes(5);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) > (2, 3)\n Restriction singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction multiSlice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiSlice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) > (2, 3) AND (clustering_1) < (4)\n singleEq = newSingleEq(cfMetaData, 0, value1);\n multiSlice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3);\n Restriction multiSlice2 = newMultiSlice(cfMetaData, 1, Bound.END, false, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiSlice2).mergeWith(singleEq).mergeWith(multiSlice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value4, EOC.START);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) => (2, 3) AND (clustering_1, clustering_2) <= (4, 5)\n singleEq = newSingleEq(cfMetaData, 0, value1);\n multiSlice = newMultiSlice(cfMetaData, 1, Bound.START, true, value2, value3);\n multiSlice2 = newMultiSlice(cfMetaData, 1, Bound.END, true, value4, value5);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiSlice2).mergeWith(singleEq).mergeWith(multiSlice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value4, value5, EOC.END);\n }", "private static int getClusterCorrespondance(Integer cl1, Integer cl2,\n HashMap<Integer, HashMap<Integer, Integer>> clusterCorresp, int nextId)\n{\n HashMap<Integer, Integer> map = clusterCorresp.get(cl1);\n if (map == null) {\n map = new HashMap<Integer, Integer>();\n map.put(cl2, nextId);\n clusterCorresp.put(cl1, map);\n return nextId;\n }\n Integer corresp = map.get(cl2);\n if (corresp == null) {\n map.put(cl2, nextId);\n return nextId;\n }\n return corresp.intValue();\n}", "public ImmutableMap<String, Boolean> getAttributeClusteringConfig();", "public boolean isSetNumClusteringCols() {\n return EncodingUtils.testBit(__isset_bitfield, __NUMCLUSTERINGCOLS_ISSET_ID);\n }", "public Builder clearIsClusteringKey() {\n\n isClusteringKey_ = false;\n onChanged();\n return this;\n }", "public interface ClusterMeasure {\n\n /**\n * Returns an index to measure the quality of clustering.\n * @param y1 the cluster labels.\n * @param y2 the alternative cluster labels.\n */\n public double measure(int[] y1, int[] y2);\n\n}", "public void testDifferentClusters() throws Exception {\n JChannel first1 = new JChannel(\"stacks/tcp_mping/tcp1.xml\");\n JChannel first2 = new JChannel(\"stacks/tcp_mping/tcp1.xml\");\n JChannel first3 = new JChannel(\"stacks/tcp_mping/tcp1.xml\");\n initiChannel(first1);\n initiChannel(first2);\n initiChannel(first3);\n\n expectView(first1, first2, first3);\n\n JChannel second1 = new JChannel(\"stacks/tcp_mping/tcp2.xml\");\n JChannel second2 = new JChannel(\"stacks/tcp_mping/tcp2.xml\");\n JChannel second3 = new JChannel(\"stacks/tcp_mping/tcp2.xml\");\n initiChannel(second1);\n initiChannel(second2);\n initiChannel(second3);\n\n expectView(first1, first2, first3);\n expectView(second1, second2, second3);\n success = true;\n }", "public static int[][] getCentroid(int data[],int noofcluster,int centroid[][],int flag){\n\t\tSystem.out.println(\"no of cluster:\"+noofcluster);\n\t\tint distance[][]=new int[noofcluster][data.length];\n\t\tint cluster[] =new int[data.length];\n\t\tint nodecnt[]=new int[noofcluster];\n\t\t\n\t\t\n\t\tSystem.out.println(\"..........new Cluster .........\");\n\t\t\n\t\t// this loop is for finding the minimum distance form depot to all the other bikestation\n\t\t\tfor(int j=0;j<data.length;j++) {\n\t\t\t\tdistance[0][j]=gr.dijkstra(adj,233,data[j]);\n\t\t\t\tMcluster.put(data[j],distance[0][j]);\n\t\t\t}\n\t\tSystem.out.println(\"Cluster=\"+Mcluster);\n\t\t\n\t\tSystem.out.println(\"............New Centroid..............\");\n\t\t// to find a random centroid for 1st time \n\t\tSet<Integer> tempp = new HashSet<Integer>();\n\t\tif(flag == 0) {\n\t\t\tfor(int i=0;i<noofcluster;i++) {\n\t\t\t\tcentroid[1][i]=Mcluster.get(getRandom(143,220));\n\t\t\t\twhile(tempp.contains(centroid[1][i])) {\n\t\t\t\t\tcentroid[1][i]=Mcluster.get(getRandom(143,220));\n\t\t\t\t}\n\t\t\t\ttempp.add(centroid[1][i]);\n\t\t\t\t//System.out.println(\"Centroid\"+centroid[1][i]);\n\t\t\t}\n\t\t\tflag=1;\n\t\t}\n\t\t\n\t\tSystem.out.println(\"...........Creating temp Cluster.......\");\n\t\t\n\t\t// creating a list of all the bikestation nodes difference the centroid \n\t\tfor(int i=0;i<noofcluster;i++) {\n\t\t\tHashMap<Integer,Integer> mpp=new HashMap<Integer,Integer>();\n\t\t\tfor(int j : Mcluster.keySet()) {\n\t\t\t\tif(centroid[1][i]>Mcluster.get(j)) {\n\t\t\t\t\tint mp = centroid[1][i]-Mcluster.get(j);\n\t\t\t\t\tmpp.put(j,mp);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tint mp = Mcluster.get(j)-centroid[1][i];\n\t\t\t\t\tmpp.put(j,mp);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcls.put(i, mpp);\n\t\t}\n\t\t\n\t\tSystem.out.println(\"...........Creating Final Cluster.......\");\n\t\t\n\t\t// getting a cluster from given centroid \n\t\tfor(int i=0;i<noofcluster;i++) {\n\t\t\tArrayList<Integer> temp = new ArrayList<>();\n\t\t\tfinalCluster.put(i,temp);\n\t\t}\n\t\tint smallestDistance;\n\t\tfor(int j : Mcluster.keySet()) {\n\t\t\tint f = 0;\n\t\t\tsmallestDistance=Integer.MAX_VALUE;\n\t\t\tfor(int i=0;i<noofcluster;i++) {\n\t\t\t\tif(cls.get(i).get(j)<=smallestDistance) {\n\t\t\t\t\tsmallestDistance=cls.get(i).get(j);\n\t\t\t\t\tf=i;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfinalCluster.get(f).add(j);\n\t\t}\n\t\t\n\t\t\n\t\tSystem.out.println(\"Final\"+finalCluster);\n\t\tSystem.out.println(\"........new centroid......\");\n\t\t\n\t\t//final cluster\n\t\tfor(int i : finalCluster.keySet()) {\n\t\t\tint sum=0, avg=0, count=0;\n\t\t\tfor(int j=0;j<finalCluster.get(i).size();j++) {\n\t\t\t\tint temp=finalCluster.get(i).get(j);\n\t\t\t\tsum=sum+Mcluster.get(temp);\n\t\t\t\tcount++;\n\t\t\t}\n\t\t\tavg=(int)sum/count;\n\t\t\tcentroid[0][i]=avg;\n\t\t}\n\t\t\n\t\tboolean finalcentroid=true;\n\t\t//if (i-1) and (i)th cluster have the same centroid then we stop the loop\n\t\tfor(int i=0;i<noofcluster;i++) {\n\t\t\tif(finalcentroid && centroid[0][i]==centroid[1][i]) {\n\t\t\t\tfinalcentroid=true;\n\t\t\t\tcontinue;\n\t\t\t}else {\n\t\t\t\tfinalcentroid=false;\n\t\t\t\tSystem.out.println(\"Different\");\n\t\t\t\tcnt++;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(!finalcentroid) { \n\t\t\t//if (i-1) and (i)th cluster dont have the same centroid then we continue the loop iteration\n\t\t\tcentroid[1] = Arrays.copyOf(centroid[0], centroid[0].length);\n\t\t\tgetCentroid(data,noofcluster,centroid,flag);\n\t\t}\n\t\t\n\t\tif(finalcentroid) {\n\t\t\tSystem.out.println(\"Final Cluster: \"+finalCluster);\n\t\t\tfor(int i=0;i<5;i++) {\n\t\t\t\tSystem.out.print(\"Final Centroid: \"+centroid[1][i]+\" \");\n\t\t\t}\n\t\t}\n\t\treturn centroid;\n\t}", "public void doInitialClustering(AddressIF me, Matrix_4_HSH tmp) {\n\t\t\n\t}", "@Test\n public void testTopicCluster() throws InterruptedException {\n String topicName = \"TestMessages\" + generateRandomString(5);\n Config cfg = new Config();\n\n TestHazelcastInstanceFactory factory = createHazelcastInstanceFactory(2);\n HazelcastInstance[] instances = factory.newInstances(cfg);\n HazelcastInstance instance1 = instances[0];\n HazelcastInstance instance2 = instances[1];\n\n ITopic<String> topic1 = instance1.getTopic(topicName);\n final CountDownLatch latch1 = new CountDownLatch(1);\n final String message = \"Test\" + randomString();\n\n topic1.addMessageListener(new MessageListener<String>() {\n public void onMessage(Message msg) {\n assertEquals(message, msg.getMessageObject());\n latch1.countDown();\n }\n });\n\n ITopic<String> topic2 = instance2.getTopic(topicName);\n final CountDownLatch latch2 = new CountDownLatch(2);\n topic2.addMessageListener(new MessageListener<String>() {\n public void onMessage(Message msg) {\n assertEquals(message, msg.getMessageObject());\n latch2.countDown();\n }\n });\n\n topic1.publish(message);\n assertOpenEventually(latch1);\n\n instance1.shutdown();\n topic2.publish(message);\n assertOpenEventually(latch2);\n }", "boolean isNeedSharding();", "public static double computeClusterIndex(Map<String, List<String>> mCl) {\n\n\t\tdouble minCompactness = 0;\n\t\tdouble tempIsolation = 0;\n\t\tdouble maxIsolation = 0;\n\n\t\tList<String> arg1 = null;\n\t\tList<String> arg2 = null;\n\n\t\tdouble clusterGoodness = 0;\n\t\t// long n = (mCl.size()) * (mCl.size() - 1) / 2;\n\t\tfor (Entry<String, List<String>> e1 : mCl.entrySet()) {\n\n\t\t\tmaxIsolation = 0;\n\n\t\t\tfor (Entry<String, List<String>> e2 : mCl.entrySet()) {\n\t\t\t\tif (e2.getKey().hashCode() != e1.getKey().hashCode()) {\n\n\t\t\t\t\targ1 = e1.getValue();\n\t\t\t\t\targ2 = e2.getValue();\n\t\t\t\t\ttempIsolation = intraClusterScore(arg1, arg2);\n\n\t\t\t\t\t// get the maximum score, i.e the strongest intra-cluster\n\t\t\t\t\t// pair..\n\t\t\t\t\tmaxIsolation = (maxIsolation < tempIsolation) ? tempIsolation\n\t\t\t\t\t\t\t: maxIsolation;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// perform its own compactness\n\t\t\tminCompactness = getInterClusterScore(e1.getValue());\n\n\t\t\tclusterGoodness = clusterGoodness + (double) minCompactness\n\t\t\t\t\t/ ((maxIsolation == 0) ? Math.pow(10, -1) : maxIsolation);\n\n\t\t}\n\n\t\tclusterGoodness = (clusterGoodness == 0) ? (Math.pow(10, -8) - clusterGoodness)\n\t\t\t\t: clusterGoodness;\n\n\t\treturn (double) 1 / clusterGoodness;\n\n\t}", "@Test\n public void testBoundsAsCompositesWithMultiEqAndSingleSliceRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n\n // (clustering_0, clustering_1) = (1, 2) AND clustering_2 > 3\n Restriction multiEq = newMultiEq(cfMetaData, 0, value1, value2);\n Restriction singleSlice = newSingleSlice(cfMetaData, 2, Bound.START, false, value3);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiEq).mergeWith(singleSlice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n }", "private static void assignCluster(int[] cluster, final double[][] centers, final double[][] data){\n int N = data.length;\n int M = data[0].length;\n int numCluster = centers.length;\n\n for (int n = 0; n < N; n++) {\n double minDistance = Double.MAX_VALUE;\n for (int c = 0; c < numCluster; c++) {\n double distance = EuclideanDistance(data[n], centers[c]);\n if (minDistance > distance) {\n minDistance = distance;\n cluster[n] = c;\n }\n }\n }\n }", "@Override\n\tpublic int compareTo(Cluster o) {\n\t\treturn 0;\n\t}", "public void updateClusteringPanel(SomClusteringResult result, boolean clusterColumn) {\r\n SelectionManager.Busy_Task(true, true);\r\n hierarchicalClustering = new SomClustComponent(result, Selection_Manager, DivaClientService, clusterColumn, rightPanelWidth, leftPanelHeight - 2);\r\n RootPanel.get(\"SomClusteringResults\").clear();\r\n RootPanel.get(\"SomClusteringResults\").add(hierarchicalClustering.getSomclusteringLayout());\r\n SelectionManager.Busy_Task(false, true);\r\n\r\n }", "private double intersection(HardClustering hard1, int comm1,\n HardClustering hard2, int comm2) {\n final TIntArrayList duplicate = new TIntArrayList(hard1.members(comm1));\n duplicate.retainAll(hard2.members(comm2));\n\n return duplicate.size();\n }", "public List<ParameterValueObject> getClustering(Filter filter);", "@Test\n public void testColocatedPartitionedRegion() throws Throwable {\n createCacheInAllVms();\n redundancy = 0;\n localMaxmemory = 50;\n totalNumBuckets = 11;\n\n regionName = \"A\";\n colocatedWith = null;\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"B\";\n colocatedWith = SEPARATOR + \"A\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"C\";\n colocatedWith = SEPARATOR + \"A\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"D\";\n colocatedWith = SEPARATOR + \"B\";\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"E\";\n colocatedWith = SEPARATOR + \"B\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"F\";\n colocatedWith = SEPARATOR + \"B\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"G\";\n colocatedWith = SEPARATOR + \"C\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"H\";\n colocatedWith = SEPARATOR + \"C\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"I\";\n colocatedWith = SEPARATOR + \"C\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"J\";\n colocatedWith = SEPARATOR + \"D\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"K\";\n colocatedWith = SEPARATOR + \"D\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"L\";\n colocatedWith = SEPARATOR + \"E\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"M\";\n colocatedWith = SEPARATOR + \"F\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"N\";\n colocatedWith = SEPARATOR + \"G\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"O\";\n colocatedWith = SEPARATOR + \"I\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n accessor.invoke(() -> PRColocationDUnitTest.validateColocatedRegions(\"A\"));\n\n accessor.invoke(() -> PRColocationDUnitTest.validateColocatedRegions(\"D\"));\n\n accessor.invoke(() -> PRColocationDUnitTest.validateColocatedRegions(\"H\"));\n\n accessor.invoke(() -> PRColocationDUnitTest.validateColocatedRegions(\"B\"));\n\n accessor.invoke(() -> PRColocationDUnitTest.validateColocatedRegions(\"K\"));\n }", "public int compare(Cluster cluster1, Cluster cluster2) {\n for (Node n1 : cluster1) {\n for (Node n2 : cluster2) {\n if (n1.isAncestorOf(n2)) {\n return -1;\n } else if (n2.isAncestorOf(n1)) {\n return 1;\n }\n }\n }\n return 0;\n }", "public Cluster(Cluster one, Cluster two) {\n this();\n // merge locations by just averaging\n// location.x=(one.location.x+two.location.x)/2;\n// location.y=(one.location.y+two.location.y)/2;\n\n Cluster older = one.firstTimestamp < two.firstTimestamp ? one : two;\n// Cluster older=one.numEvents>two.numEvents? one:two;\n\n // merge locations by average weighted by number of events supporting cluster\n int sumEvents = one.numEvents + two.numEvents;\n location.x = (one.location.x * one.numEvents + two.location.x * two.numEvents) / (sumEvents);\n location.y = (one.location.y * one.numEvents + two.location.y * two.numEvents) / (sumEvents);\n angle = older.angle;\n cosAngle = older.cosAngle;\n sinAngle = older.sinAngle;\n averageEventDistance = (one.averageEventDistance * one.numEvents + two.averageEventDistance * two.numEvents) / sumEvents;\n averageEventXDistance = (one.averageEventXDistance * one.numEvents + two.averageEventXDistance * two.numEvents) / sumEvents;\n averageEventYDistance = (one.averageEventYDistance * one.numEvents + two.averageEventYDistance * two.numEvents) / sumEvents;\n \n lastTimestamp = one.lastTimestamp > two.lastTimestamp ? one.lastTimestamp : two.lastTimestamp;\n numEvents = sumEvents;\n firstTimestamp = older.firstTimestamp; // make lifetime the oldest src cluster\n path = older.path;\n birthLocation = older.birthLocation;\n velocityFitter = older.velocityFitter;\n velocityPPT.x = older.velocityPPT.x;\n velocityPPT.y = older.velocityPPT.y;\n velocityPPS.x = older.velocityPPS.x;\n velocityPPS.y = older.velocityPPS.y;\n velocityValid = older.velocityValid;\n// vxFilter=older.vxFilter;\n// vyFilter=older.vyFilter;\n avgEventRate = older.avgEventRate;\n avgISI = older.avgISI;\n hasObtainedSupport = older.hasObtainedSupport;\n setAspectRatio(older.getAspectRatio());\n\n// Color c1=one.getColor(), c2=two.getColor();\n setColor(older.getColor());\n// System.out.println(\"merged \"+one+\" with \"+two);\n //the radius should increase\n// setRadius((one.getRadius()+two.getRadius())/2);\n if (growMergedSizeEnabled) {\n float R = (one.getRadius() + two.getRadius()) / 2;\n setRadius(R + getMixingFactor() * R);\n } else {\n setRadius(older.getRadius());\n }\n\n }", "ClusterSet() {\n }", "String getClusteringKey(int index);", "CreateClusterResult createCluster(CreateClusterRequest createClusterRequest);", "public static void main(String args[]){\n ClientConfig remoteConfig = getCluster2();\n\n remoteClient = HazelcastClient.newHazelcastClient(remoteConfig);\n\n Map usCarMap = remoteClient.getMap(\"cars\");\n\n System.out.println(usCarMap.size());\n\n //ClientConfig localConfig = getEUClientConfig();\n Config localConfig = getHCCluster1();\n\n localClient = Hazelcast.newHazelcastInstance(localConfig);\n localClient.getMap(\"cars\");\n\n ClusterReconTask clusterReconTask = new ClusterReconTask(localClient, localClusterName, remoteClient, remoteClusterName);\n\n ClusterReconTask clusterReconTask1 = clusterReconTask;\n\n ClusterReconResults reconResults = null;\n\n try {\n reconResults = clusterReconTask1.call();\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n System.out.println(reconResults.getMissingKeysByMap().size());\n\n System.out.println(reconResults.getMissingKeysByMap().toString());\n\n // Run Repair Task if needed\n if (reconResults.getMissingKeysByMap().size() > 0){\n ClusterRepairTask clusterRepairTask = new ClusterRepairTask(localClient, localClusterName, remoteClient, remoteClusterName, reconResults);\n try {\n clusterRepairTask.call();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n\n\n }", "@Test\n @Transactional\n public void test_indexWithClusterShowsData() throws Exception {\n // Create a cluster\n final String cluster1Name = \"My Test Cluster\";\n final String cluster2Name = \"My Other Test Cluster\";\n final Cluster cluster1 = clusterTestTools.createCluster(cluster1Name);\n final Cluster cluster2 = clusterTestTools.createCluster(cluster2Name);\n\n // Hit the index page.\n mockMvc\n .perform(get(\"/cluster/\")\n .with(user(adminUserDetails)))\n .andDo(print())\n .andExpect(status().isOk())\n // Should contain this text\n .andExpect(content().string(containsString(\"Kafka Clusters\")))\n .andExpect(content().string(containsString(cluster1Name)))\n .andExpect(content().string(containsString(cluster2Name)))\n .andExpect(content().string(containsString(\"\\\"/cluster/\" + cluster1.getId() + \"\\\"\")))\n .andExpect(content().string(containsString(\"\\\"/cluster/\" + cluster2.getId() + \"\\\"\")))\n .andExpect(content().string(containsString(\"\\\"/view?cluster.id=\" + cluster1.getId() + \"\\\"\")))\n .andExpect(content().string(containsString(\"\\\"/view?cluster.id=\" + cluster2.getId() + \"\\\"\")))\n // But not this\n .andExpect(content().string(not(containsString(ClusterTestTools.NO_CLUSTERS_SETUP_TEXT))));\n }", "public String Km() throws Exception {\n int x = 0;\n System.out.println(x+\" hlikiaaaaaa\");\n ΑrffCreator gen = new ΑrffCreator();\n\t\t\tgen.ArffGenerator();\n\t\t\t\n\t\t\tSimpleKMeans kmeans = new SimpleKMeans();\n\t \n\t\t\tkmeans.setSeed(2);\n\t \n\t\t\t//important parameter to set: preserver order, number of cluster.\n\t\t\tkmeans.setPreserveInstancesOrder(true);\n\t\t\tkmeans.setNumClusters(2);\n\t \n\t\t\tBufferedReader datafile = readDataFile(\"E:\\\\Users\\\\Filippos\\\\Documents\\\\NetBeansProjects\\\\MapsCopy\\\\mytext.arff\"); \n\t\t\tInstances data = new Instances(datafile);\n\t \n\t \n\t\t\tkmeans.buildClusterer(data);\n\t \n\t\t\t// This array returns the cluster number (starting with 0) for each instance\n\t\t\t// The array has as many elements as the number of instances\n\t\t\tint[] assignments = kmeans.getAssignments();\n int noNoobs=-1;\n\t\t\t//int i=0;\n\t\t\tint g = assignments.length;\n String studentsLvl = \"\";\n String quizAns = \"\";\n int clusterResult;\n\t\t\t/*----------------------------------------->xeirokinitos upologismos<----------------------------------------\n \n /*for(int clusterNum : assignments) {\n if(i==x){\n noNoobs = assignments[i];\n System.out.println(\"to \"+g+\"o einai \"+ clusterNum+\"= \"+x+\" o cluster EINAI PROXORIMENOS\");\n\t\t\t\t}\t\n if(i==g-1) {\n \n if(assignments[i] == noNoobs){\n studentsLvl = \"advanced\";\n System.out.println(\"MPAINEI STOUS PROXORIMENOUS\"+assignments[i]);\n \n }\n else{\n studentsLvl = \"beginner\";\n System.out.println(\"DEN PAEI POY8ENA ETSI\") ; \n }\n \n\t\t\t i++;\n\t\t\t}\n ---------------------------------------------------------------------------------------------------------*/\n /*upologizw thn euklideia apostash twn telikwn cluster cendroids apo to shmeio 0,0 \n auto pou apexei perissotero apo to kentro twn a3onwn , 8a einai to cluster advanced epeidi oso megaluterh hlikia \n kai kalutero scor sto preliminary test , toso pio advanced. Ka8w h logiki einai oti enas pio megalos kai diavasmenos ma8hths\n kaluteros apo enan pio pio mikro kai e3isou diavasmeno ma8hth h enan sunmoliko alla ligotero diavasmeno\n ----------------------------------------------------------------------------------------------------------*/\n \n //1 vazw ta teleutaia clusterCendroids se ena instance\t\t\t\n\t\t\tInstances clusterCendroid = kmeans.getClusterCentroids();\n //ta metatrepw se string\n\t\t\tString cluster0 = (clusterCendroid.firstInstance()).toString();\n\t\t\tString cluster1 = (clusterCendroid.lastInstance()).toString();\n\t\t\tSystem.out.println(cluster0+\"++++++++++++++++\"+cluster1);\n\t\t\t\n //2 spaw to ka8e string sto \",\" gt einai tis morfhs cluster0=\"x0,y0\" cluster1=\"x1,y1\"\n\t\t\tString[] parts = cluster0.split(\",\");\n\t\t\tString partx0 = parts[0]; // 004\n\t\t\tString party0 = parts[1]; // 034556\n\t\n\t\t\tSystem.out.println(partx0+\" || \"+party0);\n \n //3 Metatrepw ta String se double metavlites gia na epitrepontai oi pra3eis\n\t\t\tdouble clusterDx0 = Double.parseDouble(partx0);\n\t\t\tdouble clusterDy0 = Double.parseDouble(party0);\n\t\t\tSystem.out.println(clusterDx0+clusterDy0);\n\t\t\t\n //epanalamvanoume thn diadikasia apo to vhma 2\n\t\t\tString[] parts1 = cluster1.split(\",\");\n\t\t\tString partx1 = parts1[0]; // 004\n\t\t\tString party1 = parts1[1]; // 034556\n\t\t\t\n\t\t\tSystem.out.println(partx1+\" || \"+party1);\n\t\t\t\n \n double clusterDx1 = Double.parseDouble(partx1);\n\t\t\tdouble clusterDy1 = Double.parseDouble(party1);\n\t\t\t//System.out.println(clusterDx1+clusterDy2);\n //ypologizw thn euklidia apostasi twn 2 shmeivn ws pros to 0,0\n\t\t\tdouble popo = Math.sqrt((Math.pow(clusterDx0,2)+Math.pow(clusterDy0,2)));\n\t\t\tdouble popo2 = Math.sqrt((Math.pow(clusterDx1,2)+Math.pow(clusterDy1,2)));\n \n\t\t\tif (Math.max(popo, popo2)==popo) {\n \n clusterResult=0;\n\t\t\t\tSystem.out.println(\"0=advanced -- \"+popo+\"--1=begginer \"+popo2);\n\t\t\t}\n\t\t\telse {\n clusterResult=1;\n\t\t\t\tSystem.out.println(\"1=advanced -- \"+popo2+\"--0=begginer \"+popo);\n\t\t\t}\n\t\t\tSystem.out.println(popo+\"||\"+popo2+\"||\");\n \n if (assignments[data.numInstances()-1]==clusterResult){\n studentsLvl = \"advanced\";\n quizAns = \"yes\";\n System.out.println(\"MPAINEI STOUS PROXORIMENOUS \"+assignments[data.numInstances()-1]);\n }\n else{\n quizAns = \"no\";\n studentsLvl = \"beginner\";\n System.out.println(\"MPAINEI STOUS MH PROXORIMENOUS \"+assignments[data.numInstances()-1]) ; \n }\n \n coursequizs lev = new coursequizs();\n lev.studentLevel(studentsLvl,quizAns);\n \n System.out.println(Arrays.toString(assignments));\n return \"home.jsf\";\n\t\t}", "public void setClusterId(String id) {\n clusterId = id;\n }", "public Clusters()\r\n\t{\r\n\t\tcluster = new boolean[MAX_CLUSTERS];\r\n\t}", "private void clusterSingleInstances(Instances instances, boolean firstOrSecondTable,\n Clusterer clusterer, DataForSingleCluster[] toUpdate)\n throws Exception {\n Enumeration instancesEnum = instances.enumerateInstances();\n while (instancesEnum.hasMoreElements()) {\n Instance currentInstance = (Instance)instancesEnum.nextElement();\n int clusterID = clusterer.clusterInstance(currentInstance);\n DataForSingleCluster currentDataForSingleCluster = toUpdate[clusterID];\n if (firstOrSecondTable) {\n currentDataForSingleCluster.addInstanceToD1(currentInstance);\n } else {\n currentDataForSingleCluster.addInstanceToD2(currentInstance);\n }\n }\n }", "@Test\n public void testBoundsAsCompositesWithOneInRestrictionsAndOneClusteringColumn()\n {\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n Restriction in = newSingleIN(cfMetaData, 0, value1, value2, value3);\n\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(in);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.START);\n assertComposite(bounds.get(2), value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n assertComposite(bounds.get(1), value2, EOC.END);\n assertComposite(bounds.get(2), value3, EOC.END);\n }", "public boolean matchSameColumns(Key key);", "@Test\n public void testIntersection6()\n {\n List<Integer> expected = new ArrayList<>();\n ConciseSet set1 = new ConciseSet();\n for (int i = 0; i < 5; i++) {\n set1.add(i);\n }\n for (int i = 1000; i < 1005; i++) {\n set1.add(i);\n }\n\n ConciseSet set2 = new ConciseSet();\n for (int i = 800; i < 805; i++) {\n set2.add(i);\n }\n for (int i = 806; i < 1005; i++) {\n set2.add(i);\n }\n\n for (int i = 1000; i < 1005; i++) {\n expected.add(i);\n }\n\n verifyIntersection(expected, set1, set2);\n }", "public void addCluster()\r\n\t{\r\n\t\tcluster[nextAvailableCluster()] = true;\r\n\t}", "io.envoyproxy.envoy.type.metadata.v3.MetadataKind.Cluster getCluster();", "public KCluster3_HammingDistance_Stanford_Coursera() {\n\n }", "@Override\n public Point[] chooseCentroids(AbstractCluster self) {\n if (K!=2) {\n System.err.println(\"The used splitter is not suppose to be used with K>2. This program will shut down\"); //#like\n exit(1);\n }\n Point[] result={self.get(0),self.get(0)};\n double max=0;\n for (int i=0; i<self.size(); ++i)\n for (int j=0; j<i; ++j)\n if (max<_distances.get(self.get(i).getId(),self.get(j).getId())) {\n max=_distances.get(self.get(i).getId(),self.get(j).getId());\n result[0]=self.get(i);\n result[1]=self.get(j);\n }\n return result;\n }", "private void prepareCluster(GoogleMap googleMap){\n Log.d(\"CLUSTER\",\"IN PREPARAZIONE\");\n mClusterManager = new CustomClusterManager<>(this, googleMap);\n googleMap.setOnCameraIdleListener(mClusterManager);\n googleMap.setOnMarkerClickListener(mClusterManager);\n googleMap.setOnInfoWindowClickListener(mClusterManager);\n mClusterManager.setMapMarkerList(mapMarkers);\n mClusterManager.cluster();\n }", "@Test\n public void testBoundsAsCompositesWithSingleEqAndMultiINRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n ByteBuffer value5 = ByteBufferUtil.bytes(5);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) IN ((2, 3), (4, 5))\n Restriction singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction multiIN = newMultiIN(cfMetaData, 1, asList(value2, value3), asList(value4, value5));\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiIN);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(1), value1, value4, value5, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(1), value1, value4, value5, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) IN ((2, 3))\n singleEq = newSingleEq(cfMetaData, 0, value1);\n multiIN = newMultiIN(cfMetaData, 1, asList(value2, value3));\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiIN).mergeWith(singleEq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n // clustering_0 = 1 AND clustering_1 = 5 AND (clustering_2, clustering_3) IN ((2, 3), (4, 5))\n singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction singleEq2 = newSingleEq(cfMetaData, 1, value5);\n multiIN = newMultiIN(cfMetaData, 2, asList(value2, value3), asList(value4, value5));\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiIN).mergeWith(singleEq2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value5, value2, value3, EOC.START);\n assertComposite(bounds.get(1), value1, value5, value4, value5, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value5, value2, value3, EOC.END);\n assertComposite(bounds.get(1), value1, value5, value4, value5, EOC.END);\n }", "private static double getInterClusterScore(List<String> cluster) {\n\n\t\tPair<String, String> pair = null;\n\n\t\tdouble score = 1;\n\t\tdouble tempScore = 0;\n\n\t\t// System.out.println(\"CL size \" + cluster.size());\n\t\tif (cluster.size() <= 1)\n\t\t\treturn 0;\n\n\t\tfor (int outer = 0; outer < cluster.size(); outer++) {\n\t\t\tfor (int inner = outer + 1; inner < cluster.size(); inner++) {\n\t\t\t\t// create a pair\n\t\t\t\tpair = new ImmutablePair<String, String>(cluster.get(outer)\n\t\t\t\t\t\t.trim(), cluster.get(inner).trim());\n\n\t\t\t\ttry {\n\t\t\t\t\t// retrieve the key from the collection\n\t\t\t\t\ttempScore = SCORE_MAP.get(pair);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tpair = new ImmutablePair<String, String>(cluster.get(\n\t\t\t\t\t\t\t\tinner).trim(), cluster.get(outer).trim());\n\t\t\t\t\t\ttempScore = SCORE_MAP.get(pair);\n\n\t\t\t\t\t} catch (Exception e1) {\n\t\t\t\t\t\ttempScore = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// for sum of all pairwise scores\n\t\t\t\t// score = score + tempScore;\n\n\t\t\t\t// for the minimum inter cluster score\n\t\t\t\tscore = (score >= tempScore) ? tempScore : score;\n\t\t\t}\n\t\t}\n\t\treturn score;\n\t}", "private void partitionImpl(Collection<S> vocab, HashMap<Dimension<T>, MutableDouble> center) {\n double firstVal = Double.POSITIVE_INFINITY;\n double secondVal = Double.POSITIVE_INFINITY;\n S firstWord = null;\n S secondWord = null;\n\n LinkedList<S> cluster1 = new LinkedList<S>();\n LinkedList<S> cluster2 = new LinkedList<S>();\n HashMap<Dimension<T>, MutableDouble> newCenter1 = null;\n HashMap<Dimension<T>, MutableDouble> newCenter2 = null;\n\n if (vocab.size() > 2) {\n for (S word : vocab) {\n double dist = distanceToCenter(word, center);\n if (dist < secondVal) {\n if (dist < firstVal) {\n secondVal = firstVal;\n secondWord = firstWord;\n firstVal = dist;\n firstWord = word;\n } else {\n secondVal = dist;\n secondWord = word;\n }\n }\n }\n if (distance(firstWord, secondWord) <= 0.0) {\n System.out.printf(\"zero distance between '%s' and '%s'\\n\", firstWord, secondWord);\n // pick an arbitrary second word\n for (S word : vocab) {\n if (word.equals(firstWord) || word.equals(secondWord)) {\n continue;\n }\n if (distance(firstWord, word) > 0.0) {\n secondWord = word;\n break;\n }\n }\n System.out.printf(\"selected '%s' and '%s'\\n\", firstWord, secondWord);\n }\n\n HashMap<Dimension<T>, MutableDouble> center1 = wordToVector(firstWord);\n HashMap<Dimension<T>, MutableDouble> center2 = wordToVector(secondWord);\n for (S word : vocab) {\n double dist1 = distanceToCenter(word, center1);\n double dist2 = distanceToCenter(word, center2);\n if (dist1 < dist2) {\n cluster1.add(word);\n } else {\n cluster2.add(word);\n }\n }\n\n int changed = 1;\n int iteration = 0;\n while (++iteration <= MAX_ITERATIONS && changed > 0) {\n System.out.printf(\"Iteration %d/%d\\n\", iteration, MAX_ITERATIONS);\n changed = 0;\n newCenter1 = getCenter(cluster1);\n newCenter2 = getCenter(cluster2);\n\n LinkedList<S> tmpCluster1 = new LinkedList<S>();\n LinkedList<S> tmpCluster2 = new LinkedList<S>();\n\n for (ListIterator<S> it = cluster1.listIterator(); it.hasNext();) {\n S word = it.next();\n double dist1 = distanceToCenter(word, newCenter1);\n double dist2 = distanceToCenter(word, newCenter2);\n if (dist1 <= dist2) {\n tmpCluster1.add(word);\n } else {\n tmpCluster2.add(word);\n changed++;\n System.out.printf(\"changing %s : %g > %g\\n\", word, dist1, dist2);\n }\n }\n\n for (ListIterator<S> it = cluster2.listIterator(); it.hasNext();) {\n S word = it.next();\n double dist1 = distanceToCenter(word, newCenter1);\n double dist2 = distanceToCenter(word, newCenter2);\n if (dist2 <= dist1) {\n tmpCluster2.add(word);\n } else {\n tmpCluster1.add(word);\n changed++;\n System.out.printf(\"changing %s : %g < %g\\n\", word, dist1, dist2);\n }\n }\n cluster1 = tmpCluster1;\n cluster2 = tmpCluster2;\n System.out.printf(\"changed: %d/%d\\n\", changed, vocab.size());\n if (cluster1.size() == 0 || cluster2.size() == 0) {\n LinkedList<S> cl = cluster1.size() == 0 ? cluster2 : cluster1;\n System.out.printf(\"Cannot split %s, split them randomly\\n\", cl.toString());\n tmpCluster1 = new LinkedList<S>();\n tmpCluster2 = new LinkedList<S>();\n boolean b = true;\n for (S word : cl) {\n if (b) {\n tmpCluster1.add(word);\n } else {\n tmpCluster2.add(word);\n }\n b = !b;\n }\n cluster1 = tmpCluster1;\n cluster2 = tmpCluster2;\n }\n }\n } else if (vocab.size() == 2) {\n Iterator<S> it = vocab.iterator();\n S word1 = it.next();\n S word2 = it.next();\n cluster1.add(word1);\n cluster2.add(word2);\n newCenter1 = wordToVector(word1);\n newCenter2 = wordToVector(word2);\n } else {\n return;\n }\n\n if (notifyNewCluster(vocab, cluster1, cluster2)) {\n partition(cluster1, newCenter1);\n partition(cluster2, newCenter2);\n }\n\n }", "public boolean isWebsiteInCluster(String website) {\r\n\t\tCluster temp = getACluster(website);\r\n\t\tif(temp == null) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tfor(Cluster c : this.clusters) {\r\n\t\t\tfor(Cluster.Point point : c.getPoints()) {\r\n\t\t\t\tfor(Cluster.Point tempPoint : temp.getPoints()) {\r\n\t\t\t\t\tif(point == tempPoint)\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public boolean percolates()\r\n { return uf.find(0) == uf.find(dimension*dimension + 1); }", "public int compare(Dataset object1, Dataset object2){\n if(object1.getAttributeCount() != candidate.getAttributeCount() ||\n object2.getAttributeCount() != candidate.getAttributeCount()){\n return 0;\n }\n\n double dist1 = 0.0, dist2 = 0.0;\n double tmp1 = 0.0, tmp2 = 0.0;\n\n for(int i = 0; i < candidate.getAttributeCount(); i++){\n if(candidate.getOutputColumnCount() == (i+1)){\n continue;\n }\n\n Attribute ac = candidate.getAttribute(i);\n Attribute a1 = object1.getAttribute(i);\n Attribute a2 = object2.getAttribute(i);\n\n if(ac.getType() == AttributeTypes.TEXT){\n dist1 += DatasetEuklidianComparator.unlimitedCompare((String)ac.getValue(), (String)a1.getValue());\n dist2 += DatasetEuklidianComparator.unlimitedCompare((String)ac.getValue(), (String)a2.getValue());\n }else{\n /*\n double acDouble = 0.0;\n double a1Double = 0.0;\n double a2Double = 0.0;\n switch(ac.getType()){\n case INTEGER: acDouble = (double)((Integer)ac.getValue()).intValue(); break;\n case DECIMAL: acDouble = (double)ac.getValue();\n }\n switch(a1.getType()){\n case INTEGER: a1Double = (double)((Integer)a1.getValue()).intValue(); break;\n case DECIMAL: a1Double = (double)a1.getValue();\n }\n switch(a2.getType()){\n case INTEGER: a2Double = (double)((Integer)a2.getValue()).intValue(); break;\n case DECIMAL: a2Double = (double)a2.getValue();\n }*/\n double acDouble = (double)ac.getValue();\n double a1Double = (double)a1.getValue();\n double a2Double = (double)a2.getValue();\n\n tmp1 += Math.pow(a1Double-acDouble, 2);\n tmp2 += Math.pow(a2Double-acDouble, 2);\n }\n }\n\n dist1 += Math.sqrt(tmp1);\n dist2 += Math.sqrt(tmp2);\n\n if (dist1 > dist2) {\n return 1;\n }\n if (dist1 < dist2) {\n return -1;\n }\n return 0;\n }", "public void setCluster(String cluster) {\n this.cluster = cluster;\n }", "public void setCluster(String cluster) {\n this.cluster = cluster;\n }", "@Test\n public void testIntersection3()\n {\n List<Integer> expected = new ArrayList<>();\n ConciseSet set1 = new ConciseSet();\n ConciseSet set2 = new ConciseSet();\n for (int i = 0; i < 1000; i++) {\n set1.add(i);\n set2.add(i);\n expected.add(i);\n }\n\n verifyIntersection(expected, set1, set2);\n }", "private boolean checkColoumnForOctPair(int j1, int j2) {\n for(int i=0;i<4;i++)\r\n {\r\n if(Kmap[i][j1]==0 || Kmap[i][j1]==-1)\r\n return false;\r\n }\r\n for(int i=0;i<4;i++)\r\n {\r\n if(Kmap[i][j2]==0 || Kmap[i][j2]==-1)\r\n return false;\r\n }\r\n for(int i=0;i<4;i++)\r\n {\r\n Kmap[i][j1]=-1;\r\n }\r\n for(int i=0;i<4;i++)\r\n {\r\n Kmap[i][j2]=-1;\r\n } \r\n return true; \r\n }", "public boolean percolates() {\n\t\treturn linearGrid.connected(0, 1);\n\t}", "public static boolean tile_in_cluster(int x, int y){\n int cx = (int)Math.floor((float)x / WorldChunk.CHUNK_SIZE);\n int cy = (int)Math.floor((float)y / WorldChunk.CHUNK_SIZE);\n\n return chunk_in_cluster(cx,cy);\n }", "protected boolean hasOverlap(Cluster cluster1, Cluster cluster2) {\n return (cluster1.startTime < cluster2.endTime &&\n cluster2.startTime < cluster1.endTime);\n }", "boolean isClusterBulkLoadEnabled();" ]
[ "0.655288", "0.6452693", "0.61712265", "0.61235535", "0.6081428", "0.5923896", "0.5921431", "0.5905439", "0.5904474", "0.5900855", "0.5894897", "0.578866", "0.5782568", "0.57572764", "0.5738719", "0.5731623", "0.5707706", "0.5683512", "0.5670555", "0.56246656", "0.5621857", "0.56081194", "0.5605137", "0.5551733", "0.5542825", "0.5541996", "0.5521357", "0.54683864", "0.54542106", "0.5438539", "0.5394288", "0.53933924", "0.53548", "0.53524816", "0.532877", "0.53285444", "0.5281978", "0.52802694", "0.52749044", "0.5264197", "0.52416086", "0.5231272", "0.52078086", "0.51917607", "0.51911825", "0.51846635", "0.5145969", "0.5131778", "0.51223624", "0.51158553", "0.5110692", "0.5100162", "0.50990975", "0.50831133", "0.50790155", "0.5074499", "0.50550884", "0.5054824", "0.50134903", "0.50071126", "0.5005073", "0.49984297", "0.499694", "0.49930254", "0.49927235", "0.49785686", "0.49716207", "0.49516332", "0.49484527", "0.49241117", "0.4914983", "0.4909438", "0.48994407", "0.48923695", "0.48834464", "0.4877265", "0.4876142", "0.48662695", "0.48589325", "0.48492008", "0.48484114", "0.4829347", "0.482894", "0.48271522", "0.48203316", "0.48184165", "0.4816543", "0.4803653", "0.4802482", "0.47992972", "0.47949624", "0.4794702", "0.4786838", "0.4786838", "0.4776898", "0.47666645", "0.4763856", "0.47509044", "0.47468907", "0.47449303" ]
0.60379845
5
Test 'clustering_0 IN (1, 2, 3)' with only one clustering column
@Test public void testBoundsAsCompositesWithOneInRestrictionsAndOneClusteringColumn() { ByteBuffer value1 = ByteBufferUtil.bytes(1); ByteBuffer value2 = ByteBufferUtil.bytes(2); ByteBuffer value3 = ByteBufferUtil.bytes(3); CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC); Restriction in = newSingleIN(cfMetaData, 0, value1, value2, value3); PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(in); List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(3, bounds.size()); assertComposite(bounds.get(0), value1, EOC.START); assertComposite(bounds.get(1), value2, EOC.START); assertComposite(bounds.get(2), value3, EOC.START); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(3, bounds.size()); assertComposite(bounds.get(0), value1, EOC.END); assertComposite(bounds.get(1), value2, EOC.END); assertComposite(bounds.get(2), value3, EOC.END); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean hasCluster();", "boolean getIsClusteringKey();", "@Test\n public void testBoundsAsCompositesWithOneEqRestrictionsAndOneClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC);\n\n ByteBuffer clustering_0 = ByteBufferUtil.bytes(1);\n Restriction eq = newSingleEq(cfMetaData, 0, clustering_0);\n\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithSingleEqAndMultiINRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n ByteBuffer value5 = ByteBufferUtil.bytes(5);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) IN ((2, 3), (4, 5))\n Restriction singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction multiIN = newMultiIN(cfMetaData, 1, asList(value2, value3), asList(value4, value5));\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiIN);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(1), value1, value4, value5, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(1), value1, value4, value5, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) IN ((2, 3))\n singleEq = newSingleEq(cfMetaData, 0, value1);\n multiIN = newMultiIN(cfMetaData, 1, asList(value2, value3));\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiIN).mergeWith(singleEq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n // clustering_0 = 1 AND clustering_1 = 5 AND (clustering_2, clustering_3) IN ((2, 3), (4, 5))\n singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction singleEq2 = newSingleEq(cfMetaData, 1, value5);\n multiIN = newMultiIN(cfMetaData, 2, asList(value2, value3), asList(value4, value5));\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiIN).mergeWith(singleEq2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value5, value2, value3, EOC.START);\n assertComposite(bounds.get(1), value1, value5, value4, value5, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value5, value2, value3, EOC.END);\n assertComposite(bounds.get(1), value1, value5, value4, value5, EOC.END);\n }", "@Test\n public void should_iterate_with_partition_keys_and_partition_keys_IN() throws Exception {\n //Given\n long partitionKey = RandomUtils.nextLong(0,Long.MAX_VALUE);\n\n insertCompositeClusteredValues(partitionKey,\"bucket1\",1,\"name1\",1);\n insertCompositeClusteredValues(partitionKey,\"bucket2\",1,\"name2\",1);\n insertCompositeClusteredValues(partitionKey,\"bucket3\",1,\"name3\",1);\n\n //When\n final Iterator<CompositeClusteredEntity> iterator = manager.sliceQuery(CompositeClusteredEntity.class)\n .forIteration()\n .withPartitionComponents(partitionKey)\n .andPartitionComponentsIN(\"bucket1\", \"bucket3\")\n .iterator();\n\n //Then\n assertThat(iterator.hasNext()).isTrue();\n CompositeClusteredEntity next = iterator.next();\n assertThat(next.getId().getId()).isEqualTo(partitionKey);\n assertThat(next.getId().getBucket()).isEqualTo(\"bucket1\");\n assertThat(next.getId().getName()).isEqualTo(\"name11\");\n assertThat(next.getValue()).isEqualTo(\"value11\");\n\n assertThat(iterator.hasNext()).isTrue();\n next = iterator.next();\n assertThat(next.getId().getId()).isEqualTo(partitionKey);\n assertThat(next.getId().getBucket()).isEqualTo(\"bucket3\");\n assertThat(next.getId().getName()).isEqualTo(\"name31\");\n assertThat(next.getValue()).isEqualTo(\"value11\");\n }", "@Test\n public void testBoundsAsCompositesWithOneEqRestrictionsAndTwoClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer clustering_0 = ByteBufferUtil.bytes(1);\n Restriction eq = newSingleEq(cfMetaData, 0, clustering_0);\n\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithTwoClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsMixingAscendingDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.DESC, Sort.ASC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(3));\n\n // clustering_0 = 1 AND (clustering_1, clustering_2, clustering_3) > (2, 3, 4)\n Restriction eq = newSingleEq(cfMetaData, 0, value1);\n slice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n restrictions = restrictions.mergeWith(eq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(3));\n\n\n // (clustering_0, clustering1, clustering_2, clustering_3) <= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, value4, EOC.NONE);\n assertComposite(bounds.get(3), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) < (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(3), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4) AND (clustering_0, clustering_1) < (2, 3)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2, value3);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(5, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n assertComposite(bounds.get(4), value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(5, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertComposite(bounds.get(3), value2, EOC.START);\n assertComposite(bounds.get(4), value2, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4) AND (clustering_0, clustering1, clustering_2, clustering_3) <= (4, 3, 2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value4, value3, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(7, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n assertComposite(bounds.get(4), value4, value3, EOC.START);\n assertComposite(bounds.get(5), value4, value3, value2, value1, EOC.NONE);\n assertComposite(bounds.get(6), value4, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(7, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertComposite(bounds.get(3), value4, EOC.START);\n assertComposite(bounds.get(4), value4, value3, value2, EOC.START);\n assertComposite(bounds.get(5), value4, value3, value2, EOC.END);\n assertComposite(bounds.get(6), value4, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithTwoAscendingAndTwoDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.DESC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertEmptyComposite(bounds.get(1));\n\n // clustering_0 = 1 AND (clustering_1, clustering_2, clustering_3) > (2, 3, 4)\n Restriction eq = newSingleEq(cfMetaData, 0, value1);\n slice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n restrictions = restrictions.mergeWith(eq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2, clustering_3) > (2, 3, 4)\n Restriction in = newSingleIN(cfMetaData, 0, value1, value2);\n slice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n restrictions = restrictions.mergeWith(in);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n assertComposite(bounds.get(2), value2, value2, EOC.START);\n assertComposite(bounds.get(3), value2, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n assertComposite(bounds.get(2), value2, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(3), value2, EOC.END);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1, clustering_2, clustering_3) <= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) < (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4) AND (clustering_0, clustering_1) < (2, 3)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2, value3);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(1), value2, value3, EOC.START);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4) AND (clustering_0, clustering1, clustering_2, clustering_3) <= (4, 3, 2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value4, value3, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n assertComposite(bounds.get(2), value4, value3, value2, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(1), value4, value3, EOC.START);\n assertComposite(bounds.get(2), value4, value3, EOC.END);\n }", "public boolean isEqualTo(Cluster c)\n {\n int len = this.size();\n if (len != c.size()){\n return false;\n }\n if (len == 0){\n return true;\n }\n if (this.getLeader() != c.getLeader()){\n return false;\n }\n for (Integer n : this._elems){\n if (!c.contains(n)){\n return false;\n }\n }\n return true;\n }", "boolean hasClusterName();", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneDescendingAndOneAscendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0) > (1) AND (clustering_0, clustering1) < (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.END);\n assertComposite(bounds.get(2), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.END);\n assertComposite(bounds.get(1), value1, EOC.START);\n assertComposite(bounds.get(2), value1, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneAscendingAndOneDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n assertComposite(bounds.get(2), value2, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertComposite(bounds.get(1), value2, EOC.START);\n assertComposite(bounds.get(2), value2, EOC.END);\n }", "@Test\n public void should_iterate_with_default_params() throws Exception {\n long partitionKey = RandomUtils.nextLong(0,Long.MAX_VALUE);\n insertClusteredValues(partitionKey, 1, \"name1\", 5);\n\n Iterator<ClusteredEntity> iter = manager.sliceQuery(ClusteredEntity.class)\n .forIteration()\n .withPartitionComponents(partitionKey)\n .iterator();\n\n assertThat(iter.hasNext()).isTrue();\n ClusteredEntity next = iter.next();\n assertThat(next.getId().getCount()).isEqualTo(1);\n assertThat(next.getId().getName()).isEqualTo(\"name11\");\n assertThat(next.getValue()).isEqualTo(\"value11\");\n\n assertThat(iter.hasNext()).isTrue();\n next = iter.next();\n assertThat(next.getId().getCount()).isEqualTo(1);\n assertThat(next.getId().getName()).isEqualTo(\"name12\");\n assertThat(next.getValue()).isEqualTo(\"value12\");\n\n assertThat(iter.hasNext()).isTrue();\n next = iter.next();\n assertThat(next.getId().getCount()).isEqualTo(1);\n assertThat(next.getId().getName()).isEqualTo(\"name13\");\n assertThat(next.getValue()).isEqualTo(\"value13\");\n\n assertThat(iter.hasNext()).isTrue();\n next = iter.next();\n assertThat(next.getId().getCount()).isEqualTo(1);\n assertThat(next.getId().getName()).isEqualTo(\"name14\");\n assertThat(next.getValue()).isEqualTo(\"value14\");\n\n assertThat(iter.hasNext()).isTrue();\n next = iter.next();\n assertThat(next.getId().getCount()).isEqualTo(1);\n assertThat(next.getId().getName()).isEqualTo(\"name15\");\n assertThat(next.getValue()).isEqualTo(\"value15\");\n\n assertThat(iter.hasNext()).isFalse();\n }", "@Test\n public void testBoundsAsCompositesWithSingleEqAndMultiEqRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) = (2, 3)\n Restriction singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction multiEq = newMultiEq(cfMetaData, 1, value2, value3);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiEq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n // clustering_0 = 1 AND clustering_1 = 2 AND (clustering_2, clustering_3) = (3, 4)\n singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction singleEq2 = newSingleEq(cfMetaData, 1, value2);\n multiEq = newMultiEq(cfMetaData, 2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(singleEq2).mergeWith(multiEq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n\n // (clustering_0, clustering_1) = (1, 2) AND clustering_2 = 3\n singleEq = newSingleEq(cfMetaData, 2, value3);\n multiEq = newMultiEq(cfMetaData, 0, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiEq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) = (2, 3) AND clustering_3 = 4\n singleEq = newSingleEq(cfMetaData, 0, value1);\n singleEq2 = newSingleEq(cfMetaData, 3, value4);\n multiEq = newMultiEq(cfMetaData, 1, value2, value3);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiEq).mergeWith(singleEq2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n }", "public void decideCluster(){\n\tdouble shortest = 1000000;\n\tfor(int i = 0; i < clusterDist.length; i++)\n\t{\n\t\tif(clusterDist[i] < shortest)\n\t\t{\tshortest = clusterDist[i];\n\t\t\tthis.clusterid = i;\n\t\t}\n\t\t\n\t}\n}", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithTwoDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithSliceRestrictionsAndOneClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newSingleSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newSingleSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n }", "boolean isAllowClusterGet();", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithSingleEqAndSliceRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n ByteBuffer value5 = ByteBufferUtil.bytes(5);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) > (2, 3)\n Restriction singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction multiSlice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiSlice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) > (2, 3) AND (clustering_1) < (4)\n singleEq = newSingleEq(cfMetaData, 0, value1);\n multiSlice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3);\n Restriction multiSlice2 = newMultiSlice(cfMetaData, 1, Bound.END, false, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiSlice2).mergeWith(singleEq).mergeWith(multiSlice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value4, EOC.START);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) => (2, 3) AND (clustering_1, clustering_2) <= (4, 5)\n singleEq = newSingleEq(cfMetaData, 0, value1);\n multiSlice = newMultiSlice(cfMetaData, 1, Bound.START, true, value2, value3);\n multiSlice2 = newMultiSlice(cfMetaData, 1, Bound.END, true, value4, value5);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiSlice2).mergeWith(singleEq).mergeWith(multiSlice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value4, value5, EOC.END);\n }", "public interface IStoppingCriteria {\n\n /**\n * Determine the degree of clustering agreement\n * @param cluster1 one clustering results\n * @param cluster2 the other clustering results\n * @return the degree of clustering agreement; 1 refers to be the same clustering results; 0 refers to be the totally different clustering results\n */\n public double computeSimilarity(int[] cluster1, int[] cluster2);\n\n}", "boolean hasPermissionOfCluster(String clusterId, String userName);", "@Test\n public void testBoundsAsCompositesWithMultiEqAndSingleSliceRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n\n // (clustering_0, clustering_1) = (1, 2) AND clustering_2 > 3\n Restriction multiEq = newMultiEq(cfMetaData, 0, value1, value2);\n Restriction singleSlice = newSingleSlice(cfMetaData, 2, Bound.START, false, value3);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiEq).mergeWith(singleSlice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n }", "private boolean isSubsetOf(int firstRow, int secondRow) {\n for (int i = 0; i < universalSetSize; i++) {\n if (input[firstRow][i] && !input[secondRow][i]) {\n return false;\n }\n }\n return true;\n }", "@Test\n\t public void test_Is_Subset_Positive() throws Exception{\t\n\t\t SET setarray= new SET( new int[]{1,2,3,4,5});\n\t\t SET subsetarray= new SET( new int[]{1,2,3});\n\t\t assertTrue(setarray.isSubSet(subsetarray));\t \n\t }", "public List<ParameterValueObject> getClustering(Filter filter);", "@Test\n public void whereNormalColumn() throws Exception {\n String sql = \"desc verbose select k1, e1 from db1.tbl1 lateral view explode_split(k2, \\\",\\\") tmp as e1 \"\n + \"where k1=1; \";\n String explainString = UtFrameUtils.getSQLPlanOrErrorMsg(ctx, sql, true);\n Assert.assertTrue(explainString.contains(\"1:TABLE FUNCTION NODE\"));\n Assert.assertTrue(explainString.contains(\"table function: explode_split(`k2`, ',')\"));\n Assert.assertTrue(explainString.contains(\"tuple ids: 0 1\"));\n Assert.assertTrue(explainString.contains(\"TupleDescriptor{id=1, tbl=tmp, byteSize=32, materialized=true}\"));\n Assert.assertTrue(explainString.contains(\"SlotDescriptor{id=1, col=e1, type=VARCHAR(*)}\"));\n Assert.assertTrue(explainString.contains(\"0:OlapScanNode\"));\n Assert.assertTrue(explainString.contains(\"PREDICATES: `k1` = 1\"));\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneDescendingClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithSliceRestrictionsAndOneDescendingClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newSingleSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newSingleSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n }", "public void processFoundCluster(NodeSet cluster) {\n\t}", "@Test\n public void testContainsAll_Contains() {\n\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>();\n instance.add(3);\n instance.add(2);\n instance.add(1);\n instance.add(4);\n\n Collection c = Arrays.asList(1, 2, 3);\n\n boolean expResult = true;\n boolean result = instance.containsAll(c);\n assertEquals(expResult, result);\n }", "boolean contains(int vertex);", "public static boolean tile_in_cluster(int x, int y){\n int cx = (int)Math.floor((float)x / WorldChunk.CHUNK_SIZE);\n int cy = (int)Math.floor((float)y / WorldChunk.CHUNK_SIZE);\n\n return chunk_in_cluster(cx,cy);\n }", "@Test\n\t public void test_Is_Subset_Negative() throws Exception{\t\n\t\t SET setarray= new SET( new int[]{1,2,3,4,5});\n\t\t SET subsetarray= new SET( new int[]{7,8});\n\t\t assertFalse(setarray.isSubSet(subsetarray));\t \n\t }", "@Test\n public void testOverlappingPartitionsOverlappingClusters()\n {\n check(overlappingClustersWithOverlappingPartitions(), 0.75, 1.0);\n }", "@Override\n public boolean getIsClusteringKey() {\n return isClusteringKey_;\n }", "@Override\n public boolean getIsClusteringKey() {\n return isClusteringKey_;\n }", "private void runSomClustering(int linkage, int distanceMeasure, final boolean clusterColumns) {\r\n DivaClientService.computeSomClustering(linkage, distanceMeasure, clusterColumns,\r\n new AsyncCallback<SomClusteringResult>() {\r\n @Override\r\n public void onFailure(Throwable caught) {\r\n\r\n Selection_Manager.connError();\r\n SelectionManager.Busy_Task(false, true);\r\n }\r\n\r\n @Override\r\n public void onSuccess(SomClusteringResult result) {\r\n hierarchicalClustering = new SomClustComponent(result, Selection_Manager, DivaClientService, true, rightPanelWidth, leftPanelHeight);\r\n RootPanel.get(\"SomClusteringResults\").clear();\r\n RootPanel.get(\"SomClusteringResults\").add(hierarchicalClustering.getSomclusteringLayout());\r\n Timer t = new Timer() {\r\n @Override\r\n public void run() {\r\n hierarchicalClustering.selectRootNode();\r\n }\r\n };\r\n// Schedule the timer to run once in 0.5 seconds.\r\n// if (result.getRowNames().length < 5000) {\r\n//// t.schedule(500);\r\n// SelectionManager.Busy_Task(false, true);\r\n// } else {\r\n SelectionManager.Busy_Task(false, true);\r\n// }\r\n init = false;\r\n }\r\n });\r\n\r\n }", "@Test\n\tpublic void testExistsInGroupSuccess() {\n\n\t\tgrupo.addColaborador(col1);\n\t\tboolean result = grupo.existsInGroup(col1);\n\n\t\tassertTrue(result);\n\t}", "boolean isKey( ImmutableBitSet columns );", "private Set<String> findEmptyCluster(Map<double[], Set<String>> restaurantClusters) {\n for (Set<String> cluster : restaurantClusters.values()) {\n if (cluster.isEmpty()) {\n return cluster;\n }\n }\n return null;\n }", "@Test\r\n\tpublic void testAdjacency33() {\r\n\t\tBoardCell cell = board.getCell(3, 3);\r\n\t\tSet<BoardCell> testList = board.getAdjList(cell);\r\n\t\tassertTrue(testList != null);\r\n\t\tassertTrue(testList.contains(board.getCell(2, 3)));\r\n\t\tassertTrue(testList.contains(board.getCell(3, 2)));\r\n\t\tassertEquals(2, testList.size());\r\n\t}", "@Test\n public void testHardClustersWithOverlappingPartitions()\n {\n check(hardClustersWithOverlappingPartitions(), 0.0, 1.0);\n }", "@Test\n void testSubset() throws IOException {\n Long expectedNumberOfVariables = 13L;\n Long expectedNumberOfCases = 24L; // aka the number of lines in the TAB file produced by the ingest plugin\n\n TabularDataIngest ingestResult;\n File file = getFile(\"csv/ingest/election_precincts.csv\");\n try (BufferedInputStream stream = new BufferedInputStream(new FileInputStream(file))) {\n CSVFileReader instance = createInstance();\n ingestResult = instance.read(Tuple.of(stream, file), null);\n }\n\n File generatedTabFile = ingestResult.getTabDelimitedFile();\n DataTable generatedDataTable = ingestResult.getDataTable();\n\n assertThat(generatedDataTable).isNotNull();\n assertThat(generatedDataTable.getDataVariables()).isNotNull();\n assertThat(generatedDataTable.getVarQuantity()).isEqualTo((long) generatedDataTable.getDataVariables().size());\n assertThat(generatedDataTable.getVarQuantity()).isEqualTo(expectedNumberOfVariables);\n assertThat(generatedDataTable.getCaseQuantity()).isEqualTo(expectedNumberOfCases);\n\n // And now let's try and subset the individual vectors\n // First, the \"continuous\" vectors (we should be able to read these as Double[]):\n int[] floatColumns = {2};\n\n Double[][] floatVectors = {\n { 1.0, 3.0, 4.0, 6.0, 7.0, 8.0, 11.0, 12.0, 76.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0 },\n };\n\n IngestDataProvider dataProvider = new InMemoryIngestDataProvider();\n dataProvider.initialize(generatedDataTable, generatedTabFile);\n\n int vectorCount = 0;\n for (int i : floatColumns) {\n // We'll be subsetting the column vectors one by one, re-opening the\n // file each time. Inefficient - but we don't care here.\n\n if (!generatedDataTable.getDataVariables().get(i).isIntervalContinuous()) {\n fail(\"Column \" + i + \" was not properly processed as \\\"continuous\\\"\");\n }\n\n Double[] columnVector = dataProvider.getDoubleColumn(i);\n\n assertThat(columnVector).isEqualTo(floatVectors[vectorCount++]);\n }\n\n // Discrete Numerics (aka, integers):\n int[] integerColumns = { 1, 4, 6, 7, 8, 9, 10, 11, 12 };\n\n Long[][] longVectors = {\n { 1L, 3L, 4L, 6L, 7L, 8L, 11L, 12L, 76L, 77L, 77L, 77L, 77L, 77L, 77L, 77L, 77L, 77L, 77L, 77L, 77L, 77L, 77L, 77L },\n { 1L, 2L, 3L, 4L, 5L, 11L, 13L, 15L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L },\n { 85729227L, 85699791L, 640323976L, 85695847L, 637089796L, 637089973L, 85695001L, 85695077L, 1111111L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L },\n { 205871733L, 205871735L, 205871283L, 258627915L, 257444575L, 205871930L, 260047422L, 262439738L, 1111111L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L },\n { 205871673L, 205871730L, 205871733L, 205872857L, 258627915L, 257444584L, 205873413L, 262439738L, 1111111L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L },\n { 25025000201L, 25025081001L, 25025000701L, 25025050901L, 25025040600L, 25025000502L, 25025040401L, 25025100900L, 1111111L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L },\n { 250250502002L, 250250502003L, 250250501013L, 250250408011L, 250250503001L, 250250103001L, 250250406002L, 250250406001L, 1111111L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L },\n { 250251011024001L, 250251011013003L, 250251304041007L, 250251011013006L, 250251010016000L, 250251011024002L, 250251001005004L, 250251002003002L, 1111111L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L },\n { 2109L, 2110L, 2111L, 2120L, 2121L, 2115L, 2116L, 2122L, 11111L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L }\n };\n\n vectorCount = 0;\n\n for (int i : integerColumns) {\n if (!generatedDataTable.getDataVariables().get(i).isIntervalDiscrete()\n || !generatedDataTable.getDataVariables().get(i).isTypeNumeric()) {\n fail(\"Column \" + i + \" was not properly processed as \\\"discrete numeric\\\"\");\n }\n\n Long[] columnVector = dataProvider.getLongColumn(i);\n\n assertThat(columnVector).isEqualTo(longVectors[vectorCount++]);\n }\n\n // And finally, Strings:\n int[] stringColumns = {0, 3, 5};\n\n String[][] stringVectors = {\n { \"Dog\", \"Squirrel\", \"Antelope\", \"Zebra\", \"Lion\", \"Gazelle\", \"Cat\", \"Giraffe\", \"Cat\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\" },\n { \"East Boston\", \"Charlestown\", \"South Boston\", \"Bronx\", \"Roslindale\", \"Mission Hill\", \"Jamaica Plain\", \"Hyde Park\", \"Fenway/Kenmore\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\" },\n { \"2-06\", \"1-09\", \"1-1A\", \"1-1B\", \"2-04\", \"3-05\", \"1-1C\", \"1-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", }\n };\n\n vectorCount = 0;\n\n for (int i : stringColumns) {\n if (!generatedDataTable.getDataVariables().get(i).isTypeCharacter()) {\n fail(\"Column \" + i + \" was not properly processed as a character vector\");\n }\n String[] columnVector = dataProvider.getStringColumn(i);\n\n assertThat(columnVector).isEqualTo(stringVectors[vectorCount++]);\n }\n }", "private String[] findSuitableK(String[] trainingDataSet){\n\t\ttry{\n\t\t\t\n\t\t}\n\t\tcatch(Exception ex){\n\t\t\tthrow ex;\n\t\t}\n\t\tfinally{\n\t\t\t\n\t\t}\n\t\t\n\t\treturn new String[]{\"neighbor1\", \"neighbor2\", \"neighbor3\"};\n\t}", "public boolean hasClusterName() {\n return endpointConfigCase_ == 2;\n }", "public boolean isSetNumClusteringCols() {\n return EncodingUtils.testBit(__isset_bitfield, __NUMCLUSTERINGCOLS_ISSET_ID);\n }", "@Test\n public void testIntersection6()\n {\n List<Integer> expected = new ArrayList<>();\n ConciseSet set1 = new ConciseSet();\n for (int i = 0; i < 5; i++) {\n set1.add(i);\n }\n for (int i = 1000; i < 1005; i++) {\n set1.add(i);\n }\n\n ConciseSet set2 = new ConciseSet();\n for (int i = 800; i < 805; i++) {\n set2.add(i);\n }\n for (int i = 806; i < 1005; i++) {\n set2.add(i);\n }\n\n for (int i = 1000; i < 1005; i++) {\n expected.add(i);\n }\n\n verifyIntersection(expected, set1, set2);\n }", "private int getClusterIndex(int element)\n\t{\n\t\tfor(int i=0; i<clusters.size(); i++)\n\t\t{\n\t\t\tVector v = (Vector)clusters.elementAt(i);\n\t\t\t\n\t\t\tif (v.contains(new Integer(element)))\n\t\t\t\treturn i;\n\t\t}\n\t\t\n\t\treturn -1;\n\t}", "protected boolean isClusterRequired() {\n return true;\n }", "private boolean containsCentroid(SparseVector vector) {\n for (int i = 0; i < K; i++) {\n if (centroids[i].equals(vector)) {\n return true;\n }\n }\n return false;\n }", "public boolean isReviewed(int index) {\n if (index % 2 != 0) {\n index -= 1;\n }\n index = index / 2;\n if ( ( (Integer) clusters[index][3]).intValue() == 1) {\n return true;\n }\n else {\n return false;\n }\n }", "@Test\n \tpublic void whereClauseForNodeEdgeAnnotation() {\n \t\tnode23.addEdgeAnnotation(new Annotation(\"namespace1\", \"name1\"));\n \t\tnode23.addEdgeAnnotation(new Annotation(\"namespace2\", \"name2\", \"value2\", TextMatching.EXACT_EQUAL));\n \t\tnode23.addEdgeAnnotation(new Annotation(\"namespace3\", \"name3\", \"value3\", TextMatching.REGEXP_EQUAL));\n \t\tcheckWhereCondition(\n \t\t\t\tjoin(\"=\", \"_rank_annotation23_1.edge_annotation_namespace\", \"'namespace1'\"),\n \t\t\t\tjoin(\"=\", \"_rank_annotation23_1.edge_annotation_name\", \"'name1'\"),\n \t\t\t\tjoin(\"=\", \"_rank_annotation23_2.edge_annotation_namespace\", \"'namespace2'\"),\n \t\t\t\tjoin(\"=\", \"_rank_annotation23_2.edge_annotation_name\", \"'name2'\"),\n \t\t\t\tjoin(\"=\", \"_rank_annotation23_2.edge_annotation_value\", \"'value2'\"),\n \t\t\t\tjoin(\"=\", \"_rank_annotation23_3.edge_annotation_namespace\", \"'namespace3'\"),\n \t\t\t\tjoin(\"=\", \"_rank_annotation23_3.edge_annotation_name\", \"'name3'\"),\n \t\t\t\tjoin(\"~\", \"_rank_annotation23_3.edge_annotation_value\", \"'^value3$'\")\n \t\t);\n \t}", "public boolean isSparseColumnSet(int column) throws SQLServerException\n {\n checkClosed();\n \n CryptoMetadata cryptoMetadata = rs.getColumn(column).getCryptoMetadata();\n if(null != cryptoMetadata){\n \treturn cryptoMetadata.getBaseTypeInfo().isSparseColumnSet();\n }\n \n return rs.getColumn(column).getTypeInfo().isSparseColumnSet();\n }", "@Test\r\n\tpublic void testContains() {\r\n\t\tAssert.assertTrue(list.contains(new Munitions(2, 3, \"iron\")));\r\n\t\tAssert.assertFalse(list.contains(new Munitions(2, 5, \"ferrum\")));\r\n\t}", "@Test\n public void testSqlExistsMultiValuedWithForeignRestriction() {\n Query<Garage> garagesQuery = existsIn(cars,\n Garage.BRANDS_SERVICED,\n Car.NAME,\n equal(Car.FEATURES, \"convertible\")\n );\n\n Set<Garage> results = asSet(garages.retrieve(garagesQuery));\n\n assertEquals(\"should have 2 results\", 2, results.size());\n assertTrue(\"results should contain garage2\", results.contains(garage2));\n assertTrue(\"results should contain garage5\", results.contains(garage5));\n }", "@Test\n public void testIntersection3()\n {\n List<Integer> expected = new ArrayList<>();\n ConciseSet set1 = new ConciseSet();\n ConciseSet set2 = new ConciseSet();\n for (int i = 0; i < 1000; i++) {\n set1.add(i);\n set2.add(i);\n expected.add(i);\n }\n\n verifyIntersection(expected, set1, set2);\n }", "@Test\n public void testDAM31201001() {\n // In this test case the where clause is specified in a common sql shared in multiple queries.\n testDAM30505001();\n }", "@Test\n public void testContainsAll_Contains_Overflow() {\n\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>(2, 2);\n instance.add(3);\n instance.add(2);\n instance.add(1);\n instance.add(4);\n instance.add(5);\n instance.add(4);\n instance.add(7);\n\n Collection c = Arrays.asList(3, 4, 5, 7);\n\n boolean expResult = true;\n boolean result = instance.containsAll(c);\n assertEquals(expResult, result);\n }", "@Test\n @WithMockUhUser(username = \"iamtst04\")\n public void optInTest() throws Exception {\n assertFalse(isInCompositeGrouping(GROUPING, tst[0], tst[3]));\n assertTrue(isInBasisGroup(GROUPING, tst[0], tst[3]));\n assertTrue(isInExcludeGroup(GROUPING, tst[0], tst[3]));\n\n //tst[3] opts into Grouping\n mapGSRs(API_BASE + GROUPING + \"/optIn\");\n }", "private int[] matches(int[] partition, int feature, boolean value) {\r\n\t\t// to allocate the array we first check how many samples we're talking\r\n\t\t// about\r\n\t\tint nMatches = 0;\r\n\t\tfor (int i = 0; i < partition.length; i++) {\r\n\t\t\tif (input[partition[i]][feature] == value)\r\n\t\t\t\tnMatches++;\r\n\t\t}\r\n\t\tint[] subset = new int[nMatches]; // allocate the array holding the\r\n\t\t\t\t\t\t\t\t\t\t\t// matching sample indices\r\n\t\tint cnt = 0;\r\n\t\t// collect the matching samples\r\n\t\tfor (int i = 0; i < partition.length; i++) {\r\n\t\t\tif (input[partition[i]][feature] == value)\r\n\t\t\t\tsubset[cnt++] = partition[i];\r\n\t\t}\r\n\t\treturn subset;\r\n\t}", "@Test\n public void testHeterogeneousSegmentFilterConditionLimit() throws SqlParseException {\n\n val project = \"heterogeneous_segment\";\n // val dfId = \"747f864b-9721-4b97-acde-0aa8e8656cba\"\n // val seg1Id = \"8892fa3f-f607-4eec-8159-7c5ae2f16942\"\n // val seg2Id = \"d75a822c-788a-4592-a500-cf20186dded1\"\n // val seg3Id = \"54eaf96d-6146-45d2-b94e-d5d187f89919\"\n // val seg4Id = \"411f40b9-a80a-4453-90a9-409aac6f7632\"\n // val seg5Id = \"a8318597-cb75-416f-8eb8-96ea285dd2b4\"\n // \n val sql = \"with T1 as (select cal_dt, trans_id \\n\" + \"from test_kylin_fact inner join test_account \\n\"\n + \"on test_kylin_fact.seller_id = test_account.account_id \\n\"\n + \"where cal_dt between date'2012-01-01' and date'2012-01-03'\\n\" + \"group by cal_dt, trans_id)\\n\";\n\n {\n val sqlWithTooManyOrs = sql + \" select * from T1 where \" + \"(cal_dt='2012-01-01' and trans_id = 1) or \\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 2) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 3) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 4) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 5) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 6) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 7) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 8) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 9) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 10) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 12) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 13) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 14) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 15) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 16) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 17) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 18) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 19) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 20)\";\n val contexts = OlapContextTestUtil.getOlapContexts(project, sqlWithTooManyOrs);\n Assert.assertEquals(\n \">=(DEFAULT.TEST_KYLIN_FACT.CAL_DT, 2012-01-01),<=(DEFAULT.TEST_KYLIN_FACT.CAL_DT, 2012-01-03)\",\n contexts.get(0).getExpandedFilterConditions().stream().map(RexNode::toString)\n .collect(Collectors.joining(\",\")));\n }\n\n {\n val sqlWithFilter = sql + \" select * from T1 where \" + \"(cal_dt='2012-01-01' and trans_id = 1) or \\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 2) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 3) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 4) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 5) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 6) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 7) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 8) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 9) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 10)\";\n val contexts = OlapContextTestUtil.getOlapContexts(project, sqlWithFilter);\n Assert.assertNotEquals(\n \">=(DEFAULT.TEST_KYLIN_FACT.CAL_DT, 2012-01-01),<=(DEFAULT.TEST_KYLIN_FACT.CAL_DT, 2012-01-03)\",\n contexts.get(0).getExpandedFilterConditions().stream().map(RexNode::toString)\n .collect(Collectors.joining(\",\")));\n }\n\n }", "private boolean in(Integer e, ArrayList<Integer> l) {\n for (int i=0; i<l.size();i++) {\n if (l.get(i) == e) {\n return true;\n }\n }\n return false;\n }", "@Test\n public void testIntersection4()\n {\n List<Integer> expected = new ArrayList<>();\n ConciseSet set1 = new ConciseSet();\n ConciseSet set2 = new ConciseSet();\n for (int i = 0; i < 1000; i++) {\n set1.add(i);\n if (i != 500) {\n set2.add(i);\n expected.add(i);\n }\n }\n\n verifyIntersection(expected, set1, set2);\n }", "@Override // Client and Server\n public void validateClusterSpec(ClusterDescription clusterSpec) throws\n HoyaException {\n super.validateClusterSpec(clusterSpec);\n Set<String> unknownRoles = clusterSpec.getRoleNames();\n unknownRoles.removeAll(knownRoleNames);\n if (!unknownRoles.isEmpty()) {\n throw new BadCommandArgumentsException(\"There is unknown role: %s\",\n unknownRoles.iterator().next());\n }\n providerUtils.validateNodeCount(HBaseKeys.ROLE_WORKER,\n clusterSpec.getDesiredInstanceCount(\n HBaseKeys.ROLE_WORKER,\n 0), 0, -1);\n\n\n providerUtils.validateNodeCount(HBaseKeys.ROLE_MASTER,\n clusterSpec.getDesiredInstanceCount(\n HBaseKeys.ROLE_MASTER,\n 0),\n 0,\n -1);\n }", "public void testFilterOnAggregationColumn() throws Exception {\n \t\tccName = new String[] { \"cc1\", \"cc2\", \"cc3\" };\n \t\tccExpr = new String[] { \"row.COL0+row.COL1\",\n \t\t\t\t\"Total.runningSum(row.cc1,row.COL0==0,0)\",\n \t\t\t\t\"Total.runningSum(row.cc1,row.COL0>0,0)\" };\n \n \t\tfor (int i = 0; i < ccName.length; i++) {\n \t\t\tComputedColumn computedColumn = new ComputedColumn(ccName[i],\n \t\t\t\t\tccExpr[i], DataType.ANY_TYPE);\n \t\t\t((BaseDataSetDesign) this.dataSet)\n \t\t\t\t\t.addComputedColumn(computedColumn);\n \t\t}\n \n \t\tString[] bindingNameRow = new String[7];\n \t\tbindingNameRow[0] = \"ROW_COL0\";\n \t\tbindingNameRow[1] = \"ROW_COL1\";\n \t\tbindingNameRow[2] = \"ROW_COL2\";\n \t\tbindingNameRow[3] = \"ROW_COL3\";\n \t\tbindingNameRow[4] = \"ROW_cc1\";\n \t\tbindingNameRow[5] = \"ROW_cc2\";\n \t\tbindingNameRow[6] = \"ROW_cc3\";\n \t\tScriptExpression[] bindingExprRow = new ScriptExpression[] {\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL0\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL1\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL2\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL3\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + ccName[0], 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + ccName[1], 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + ccName[2], 0) };\n \n \t\tIResultIterator resultIt = this.executeQuery(this.createQuery(null,\n \t\t\t\tnull, null, null, null, null, null, null, null, bindingNameRow,\n \t\t\t\tbindingExprRow));\n \n \t\tprintResult(resultIt, bindingNameRow, bindingExprRow);\n \t\t// assert\n \t\tcheckOutputFile();\n \n \t}", "public ImmutableMap<String, Boolean> getAttributeClusteringConfig();", "public boolean containsSoldier(Soldier test, ArrayList<Soldier> gamePiece){\n for (int i=0;i<gamePiece.size();i++)\n if(test.i == gamePiece.get(i).i && test.j == gamePiece.get(i).j && test.C.equals(gamePiece.get(i).C))\n return true;\n return false;\n }", "private boolean isSubset(List<ConceptLabel> outer, List<ConceptLabel> inner){\n\t\tfor(ConceptLabel in: inner){\n\t\t\tboolean c = false;\n\t\t\tfor(ConceptLabel l: outer){\n\t\t\t\tif(l.getText().equals(in.getText())){\n\t\t\t\t\tc = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(!c)\n\t\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "@Test\r\n public void testIsSubset1() {\r\n Assert.assertEquals(false, set1.isSubset(set2));\r\n }", "public boolean checkIfCompleteSearchRowExists(int i, int n, int m, int k, String distribution) throws SQLException {\n String sql = \"SELECT * FROM complete_search_singleminded WHERE i = ? AND n = ? AND m = ? AND k = ? AND distribution = ?\";\n PreparedStatement preparedStatement = (PreparedStatement) this.getConn().prepareStatement(sql);\n preparedStatement.setInt(1, i);\n preparedStatement.setInt(2, n);\n preparedStatement.setInt(3, m);\n preparedStatement.setInt(4, k);\n preparedStatement.setString(5, distribution);\n return ((ResultSet) preparedStatement.executeQuery()).next();\n }", "boolean hasContains();", "@Ignore\n\t@Test(expected=UnsupportedOperationException.class)\n\tpublic void testcClusterSpecIterator()\n\t{\n\t\tfinal DCRGraph graph = DCRGraphTest.randomGraph();\n\n\t\tAssert.assertTrue(0 < graph.getClusterCount());\n\t\tfinal OrdinaryCluster cl = graph.getGroundTruth().getCluster(0);\n\t\tfinal OrdinaryCluster other = graph.getGroundTruth().getCluster(1);\n\n\t\tcl.interClusterEdgeIterator(other).remove();\n\t}", "@Test\n public void testIntersection1()\n {\n final int[] ints1 = {33, 100000};\n final int[] ints2 = {33, 100000};\n List<Integer> expected = Arrays.asList(33, 100000);\n\n ConciseSet set1 = new ConciseSet();\n for (int i : ints1) {\n set1.add(i);\n }\n ConciseSet set2 = new ConciseSet();\n for (int i : ints2) {\n set2.add(i);\n }\n\n verifyIntersection(expected, set1, set2);\n }", "@Test\n public void testSqlExistsMultiValuedNoForeignRestriction() {\n Query<Garage> garagesQuery = not(\n existsIn(cars,\n Garage.BRANDS_SERVICED,\n Car.NAME\n )\n );\n\n Set<Garage> results = asSet(garages.retrieve(garagesQuery));\n\n assertEquals(\"should have 1 result\", 1, results.size());\n assertTrue(\"results should contain garage6\", results.contains(garage6));\n }", "private String checksubset(HashMap<String, ArrayList<String>> cn) {\n\t\tObject[] cnkeys = cn.keySet().toArray();\r\n\t\tfor (int i = 0; i < cnkeys.length; i++) {\r\n\t\t\tfor (int j = cnkeys.length - 1; j > i; j--) {\r\n\t\t\t\tif (cn.get(cnkeys[i]).size() < cn.get(cnkeys[j]).size()) {\r\n\t\t\t\t\tif (cn.get(cnkeys[j]).containsAll(cn.get(cnkeys[i]))) {\r\n\t\t\t\t\t\treturn (String) cnkeys[i];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (cn.get(cnkeys[i]).containsAll(cn.get(cnkeys[j]))) {\r\n\t\t\t\t\treturn (String) cnkeys[j];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "static boolean isClusterCandidate_(double x_1, double y1, double x2,\n\t\t\tdouble y2, double sqr_tolerance) {\n\t\tdouble dx = x_1 - x2;\n\t\tdouble dy = y1 - y2;\n\t\treturn dx * dx + dy * dy <= sqr_tolerance;\n\t}", "@Test\n public void testContainsAll_Not_Contain() {\n\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>();\n instance.add(3);\n instance.add(2);\n instance.add(1);\n instance.add(4);\n\n Collection c = Arrays.asList(1, 2, 5);\n\n boolean expResult = false;\n boolean result = instance.containsAll(c);\n assertEquals(expResult, result);\n }", "public SME_Cluster[] getClusters();", "Boolean subset(MultiSet<X> s);", "@Test\n public void testIntersection5()\n {\n final int[] ints1 = {33, 100000};\n final int[] ints2 = {34, 200000};\n List<Integer> expected = new ArrayList<>();\n\n ConciseSet set1 = new ConciseSet();\n for (int i : ints1) {\n set1.add(i);\n }\n ConciseSet set2 = new ConciseSet();\n for (int i : ints2) {\n set2.add(i);\n }\n\n verifyIntersection(expected, set1, set2);\n }", "@Test\n public void tableFunctionInWhere() throws Exception {\n String sql = \"explain select k1 from db1.tbl1 where explode_split(k2, \\\",\\\");\";\n String explainString = UtFrameUtils.getSQLPlanOrErrorMsg(ctx, sql);\n Assert.assertTrue(\n explainString.contains(\"No matching function with signature: explode_split(varchar(-1), varchar(-1)).\"));\n }", "private boolean subGridCheck() {\n\t\tint sqRt = (int)Math.sqrt(dimension);\n\t\tfor(int i = 0; i < sqRt; i++) {\n\t\t\tint increment = i * sqRt;\n\t\t\tfor(int val = 1; val <= dimension; val++) {\n\t\t\t\tint valCounter = 0;\n\t\t\t\tfor(int row = 0 + increment; row < sqRt + increment; row++) {\n\t\t\t\t\tfor(int col = 0 + increment; col < sqRt + increment; col++) {\n\t\t\t\t\t\tif(puzzle[row][col] == val)\n\t\t\t\t\t\t\tvalCounter++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(valCounter >= 2)\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "int getClusteringKeyCount();", "private boolean doAllDataSourcesHaveSamples(List<ILogicalOperator> leafInputs, IOptimizationContext context)\n throws AlgebricksException {\n for (ILogicalOperator li : leafInputs) {\n DataSourceScanOperator scanOp = (DataSourceScanOperator) findDataSourceScanOperator(li);\n if (scanOp == null)\n continue;\n Index index = joinEnum.getStatsHandle().findSampleIndex(scanOp, context);\n if (index == null) {\n return false;\n }\n }\n return true;\n }", "List<Trueorfalse> selectByExample(RowBounds rowBounds);", "boolean hasSearchNodeCharacteristicIds();", "boolean hasGroupByCategory();", "private Object isValidColumnVector(List<List<Double>> vector) {\n\t\tInteger nrows = vector.size();\n\n\t\tList<Integer> rowLengths = vector.stream().map(List::size).toList();\n\t\tInteger ncols = rowLengths.stream().mapToInt(Integer::intValue).sum() / rowLengths.size();\n\n\t\treturn (nrows == 3) && (ncols == 1);\n\t}", "public boolean isWebsiteInCluster(String website) {\r\n\t\tCluster temp = getACluster(website);\r\n\t\tif(temp == null) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tfor(Cluster c : this.clusters) {\r\n\t\t\tfor(Cluster.Point point : c.getPoints()) {\r\n\t\t\t\tfor(Cluster.Point tempPoint : temp.getPoints()) {\r\n\t\t\t\t\tif(point == tempPoint)\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public static void main(String[] args)\r\n\t{\n\t\tList<Location> locations = new ArrayList<Location>();\r\n\t\tlocations.add(new Location(150, 981));\r\n\t\tlocations.add(new Location(136, 0));\r\n\t\tlocations.add(new Location(158, 88));\r\n\t\tlocations.add(new Location(330, 60));\r\n\t\tlocations.add(new Location(0, 1001));\r\n\t\tlocations.add(new Location(150, 0));\r\n\t\tlocations.add(new Location(0, 0));\r\n\t\tlocations.add(new Location(0, 0));\r\n\t\tlocations.add(new Location(0, 0));\r\n\t\tlocations.add(new Location(446, 88));\r\n\t\tlocations.add(new Location(562, 88));\r\n\t\tlocations.add(new Location(256, 88));\r\n\t\tlocations.add(new Location(678, 88));\r\n\t\tlocations.add(new Location(794, 88));\r\n\t\tlocations.add(new Location(0, 1028));\r\n\t\tlocations.add(new Location(136, 0));\r\n\t\tlocations.add(new Location(150, 0));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 1028));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(136, 103));\r\n\t\tlocations.add(new Location(150, 0));\r\n\t\tList<LocationWrapper> clusterInput = new ArrayList<LocationWrapper>(locations.size());\r\n\t\tfor (Location location : locations)\r\n\t\t\tclusterInput.add(new LocationWrapper(location));\r\n\r\n\t\t// initialize a new clustering algorithm.\r\n\t\t// we use KMeans++ with 10 clusters and 10000 iterations maximum.\r\n\t\t// we did not specify a distance measure; the default (euclidean\r\n\t\t// distance) is used.\r\n\t\t// org.apache.commons.math3.ml.clustering.FuzzyKMeansClusterer<LocationWrapper>\r\n\t\t// clusterer = new\r\n\t\t// org.apache.commons.math3.ml.clustering.FuzzyKMeansClusterer<LocationWrapper>(2,\r\n\t\t// 2);\r\n\t\t// KMeansPlusPlusClusterer<LocationWrapper> clusterer = new\r\n\t\t// KMeansPlusPlusClusterer<LocationWrapper>(2, 10);\r\n\r\n\t\tDBSCANClusterer<LocationWrapper> clusterer = new DBSCANClusterer<LocationWrapper>(1200.0, 5);\r\n\t\tList<Cluster<LocationWrapper>> clusterResults = clusterer.cluster(clusterInput);\r\n\t\t// List<CentroidCluster<LocationWrapper>> clusterResults =\r\n\t\t// clusterer.cluster(clusterInput);\r\n\r\n\t\t// output the clusters\r\n\t\tSystem.out.println(\"clusterResults.size() = \" + clusterResults.size());\r\n\t\tfor (int i = 0; i < clusterResults.size(); i++)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Cluster \" + i);\r\n\t\t\tfor (LocationWrapper locationWrapper : clusterResults.get(i).getPoints())\r\n\t\t\t\tSystem.out.println(locationWrapper.getLocation());\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\t}", "private boolean runMultiSampleCase() {\n\t\tArrayList<Candidate> candidates = collectTrioCandidates();\n\n\t\t// Then, check the candidates for all trios around affected individuals.\n\t\tfor (Candidate c : candidates)\n\t\t\tif (isCompatibleWithTriosAroundAffected(c))\n\t\t\t\treturn true;\n\t\treturn false;\n\t}", "private static double intraClusterScore(List<String> arg1, List<String> arg2) {\n\t\t// compare each elements from argList1 vs argList2\n\n\t\tPair<String, String> pair = null;\n\t\tdouble tempScore = 0;\n\t\tdouble maxScore = 0;\n\n\t\tfor (int list1Id = 0; list1Id < arg1.size(); list1Id++) {\n\t\t\tfor (int list2Id = 0; list2Id < arg2.size(); list2Id++) {\n\n\t\t\t\t// create a pair\n\t\t\t\tpair = new ImmutablePair<String, String>(arg1.get(list1Id)\n\t\t\t\t\t\t.trim(), arg2.get(list2Id).trim());\n\n\t\t\t\ttry {\n\t\t\t\t\t// retrieve the key from the collection\n\t\t\t\t\ttempScore = SCORE_MAP.get(pair);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tpair = new ImmutablePair<String, String>(arg2.get(\n\t\t\t\t\t\t\t\tlist2Id).trim(), arg1.get(list1Id).trim());\n\t\t\t\t\t\ttempScore = SCORE_MAP.get(pair);\n\n\t\t\t\t\t} catch (Exception e1) {\n\t\t\t\t\t\ttempScore = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// System.out.println(\" temp score = \" + tempScore);\n\t\t\t\tmaxScore = (tempScore > maxScore) ? tempScore : maxScore;\n\t\t\t}\n\t\t}\n\n\t\t// System.out.println(\"max = \" + maxScore);\n\t\treturn maxScore;\n\t}", "@Test\n public void whereExplodeColumn() throws Exception {\n String sql = \"desc verbose select k1, e1 from db1.tbl1 lateral view explode_split(k2, \\\",\\\") tmp as e1 \"\n + \"where e1='1'; \";\n String explainString = UtFrameUtils.getSQLPlanOrErrorMsg(ctx, sql, true);\n Assert.assertTrue(explainString.contains(\"1:TABLE FUNCTION NODE\"));\n Assert.assertTrue(explainString.contains(\"table function: explode_split(`k2`, ',')\"));\n Assert.assertTrue(explainString.contains(\"PREDICATES: `e1` = '1'\"));\n Assert.assertTrue(explainString.contains(\"tuple ids: 0 1\"));\n Assert.assertTrue(explainString.contains(\"TupleDescriptor{id=1, tbl=tmp, byteSize=32, materialized=true}\"));\n Assert.assertTrue(explainString.contains(\"SlotDescriptor{id=1, col=e1, type=VARCHAR(*)}\"));\n }", "@java.lang.Override\n public boolean hasClusterName() {\n return endpointConfigCase_ == 2;\n }", "@Test\n public void testPartitionColumnSelection() {\n Path filePath = new Path(\"hdfs:///w/x/y/z.csv\");\n ImplicitColumnManager implictColManager = new ImplicitColumnManager(\n fixture.getOptionManager(),\n standardOptions(filePath));\n\n String dir0 = ScanTestUtils.partitionColName(0);\n // Sic: case insensitivity, but name in project list\n // is preferred over \"natural\" name.\n String dir1 = \"DIR1\";\n String dir2 = ScanTestUtils.partitionColName(2);\n ScanLevelProjection scanProj = ScanLevelProjection.build(\n RowSetTestUtils.projectList(dir2, dir1, dir0, \"a\"),\n Lists.newArrayList(implictColManager.projectionParser()));\n\n assertEquals(4, scanProj.columns().size());\n assertEquals(dir2, scanProj.columns().get(0).name());\n assertEquals(dir1, scanProj.columns().get(1).name());\n assertEquals(dir0, scanProj.columns().get(2).name());\n assertEquals(\"a\", scanProj.columns().get(3).name());\n\n // Verify column type\n\n assertTrue(scanProj.columns().get(0) instanceof PartitionColumn);\n }", "private boolean checksetunions(Set<String> set, HashMap<String, ArrayList<String>> c) {\n\t\tObject[] ckeys = c.keySet().toArray();\r\n\t\tfor (int i = 0; i < c.keySet().size(); i++) {\r\n\t\t\tif (c.get(ckeys[i]).containsAll(set)) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "boolean inCommunities(String element);", "private boolean isSubsetOf(List<String> permissions2,\n\t\t\tList<String> permissions3) {\n\t\treturn false;\n\t}" ]
[ "0.5754629", "0.5694628", "0.5685817", "0.5570394", "0.5541948", "0.54724354", "0.5430311", "0.5372573", "0.5360609", "0.5355168", "0.5311278", "0.52593815", "0.5256902", "0.521996", "0.51848376", "0.5184197", "0.51364034", "0.5129655", "0.51064694", "0.50841904", "0.50794065", "0.50755817", "0.5074655", "0.50564677", "0.5052526", "0.500459", "0.4907595", "0.48904645", "0.4820756", "0.48193136", "0.47938445", "0.47883373", "0.47555742", "0.47356936", "0.4732689", "0.47052425", "0.46869335", "0.46864977", "0.46851826", "0.46818694", "0.4631491", "0.46254477", "0.46252677", "0.4620574", "0.46193257", "0.4602858", "0.45947102", "0.45935565", "0.45848158", "0.4582731", "0.45756632", "0.45737654", "0.45655477", "0.45648143", "0.45604044", "0.4557659", "0.45574218", "0.4547468", "0.45451877", "0.45422226", "0.45328876", "0.45288712", "0.45275763", "0.45210996", "0.45209306", "0.45183843", "0.4514952", "0.45115316", "0.45082214", "0.45037654", "0.4503266", "0.44996095", "0.4490548", "0.44880438", "0.44836298", "0.44756868", "0.44724014", "0.44704124", "0.44661304", "0.44588014", "0.4454522", "0.44459355", "0.44448513", "0.44431674", "0.44360626", "0.44325197", "0.44303173", "0.44295025", "0.4429208", "0.44254708", "0.44242626", "0.44231978", "0.44199798", "0.44130403", "0.44084832", "0.44005504", "0.43995786", "0.439383", "0.43877438", "0.43875906" ]
0.54780084
5
Test slice restriction (e.g 'clustering_0 > 1') with only one clustering column
@Test public void testBoundsAsCompositesWithSliceRestrictionsAndOneClusteringColumn() { CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC); ByteBuffer value1 = ByteBufferUtil.bytes(1); ByteBuffer value2 = ByteBufferUtil.bytes(2); Restriction slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1); PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(slice); List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value1, EOC.END); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertEmptyComposite(bounds.get(0)); slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1); restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(slice); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value1, EOC.NONE); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertEmptyComposite(bounds.get(0)); slice = newSingleSlice(cfMetaData, 0, Bound.END, true, value1); restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(slice); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertEmptyComposite(bounds.get(0)); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value1, EOC.END); slice = newSingleSlice(cfMetaData, 0, Bound.END, false, value1); restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(slice); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertEmptyComposite(bounds.get(0)); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value1, EOC.START); slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1); Restriction slice2 = newSingleSlice(cfMetaData, 0, Bound.END, false, value2); restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(slice).mergeWith(slice2); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value1, EOC.END); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value2, EOC.START); slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1); slice2 = newSingleSlice(cfMetaData, 0, Bound.END, true, value2); restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(slice).mergeWith(slice2); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value1, EOC.NONE); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value2, EOC.END); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithTwoClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneAscendingAndOneDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n assertComposite(bounds.get(2), value2, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertComposite(bounds.get(1), value2, EOC.START);\n assertComposite(bounds.get(2), value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneDescendingAndOneAscendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0) > (1) AND (clustering_0, clustering1) < (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.END);\n assertComposite(bounds.get(2), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.END);\n assertComposite(bounds.get(1), value1, EOC.START);\n assertComposite(bounds.get(2), value1, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithTwoDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsMixingAscendingDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.DESC, Sort.ASC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(3));\n\n // clustering_0 = 1 AND (clustering_1, clustering_2, clustering_3) > (2, 3, 4)\n Restriction eq = newSingleEq(cfMetaData, 0, value1);\n slice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n restrictions = restrictions.mergeWith(eq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(3));\n\n\n // (clustering_0, clustering1, clustering_2, clustering_3) <= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, value4, EOC.NONE);\n assertComposite(bounds.get(3), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) < (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(3), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4) AND (clustering_0, clustering_1) < (2, 3)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2, value3);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(5, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n assertComposite(bounds.get(4), value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(5, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertComposite(bounds.get(3), value2, EOC.START);\n assertComposite(bounds.get(4), value2, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4) AND (clustering_0, clustering1, clustering_2, clustering_3) <= (4, 3, 2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value4, value3, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(7, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n assertComposite(bounds.get(4), value4, value3, EOC.START);\n assertComposite(bounds.get(5), value4, value3, value2, value1, EOC.NONE);\n assertComposite(bounds.get(6), value4, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(7, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertComposite(bounds.get(3), value4, EOC.START);\n assertComposite(bounds.get(4), value4, value3, value2, EOC.START);\n assertComposite(bounds.get(5), value4, value3, value2, EOC.END);\n assertComposite(bounds.get(6), value4, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithTwoAscendingAndTwoDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.DESC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertEmptyComposite(bounds.get(1));\n\n // clustering_0 = 1 AND (clustering_1, clustering_2, clustering_3) > (2, 3, 4)\n Restriction eq = newSingleEq(cfMetaData, 0, value1);\n slice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n restrictions = restrictions.mergeWith(eq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2, clustering_3) > (2, 3, 4)\n Restriction in = newSingleIN(cfMetaData, 0, value1, value2);\n slice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n restrictions = restrictions.mergeWith(in);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n assertComposite(bounds.get(2), value2, value2, EOC.START);\n assertComposite(bounds.get(3), value2, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n assertComposite(bounds.get(2), value2, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(3), value2, EOC.END);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1, clustering_2, clustering_3) <= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) < (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4) AND (clustering_0, clustering_1) < (2, 3)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2, value3);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(1), value2, value3, EOC.START);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4) AND (clustering_0, clustering1, clustering_2, clustering_3) <= (4, 3, 2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value4, value3, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n assertComposite(bounds.get(2), value4, value3, value2, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(1), value4, value3, EOC.START);\n assertComposite(bounds.get(2), value4, value3, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithSliceRestrictionsAndOneDescendingClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newSingleSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newSingleSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneDescendingClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithSingleEqAndSliceRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n ByteBuffer value5 = ByteBufferUtil.bytes(5);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) > (2, 3)\n Restriction singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction multiSlice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiSlice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) > (2, 3) AND (clustering_1) < (4)\n singleEq = newSingleEq(cfMetaData, 0, value1);\n multiSlice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3);\n Restriction multiSlice2 = newMultiSlice(cfMetaData, 1, Bound.END, false, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiSlice2).mergeWith(singleEq).mergeWith(multiSlice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value4, EOC.START);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) => (2, 3) AND (clustering_1, clustering_2) <= (4, 5)\n singleEq = newSingleEq(cfMetaData, 0, value1);\n multiSlice = newMultiSlice(cfMetaData, 1, Bound.START, true, value2, value3);\n multiSlice2 = newMultiSlice(cfMetaData, 1, Bound.END, true, value4, value5);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiSlice2).mergeWith(singleEq).mergeWith(multiSlice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value4, value5, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiEqAndSingleSliceRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n\n // (clustering_0, clustering_1) = (1, 2) AND clustering_2 > 3\n Restriction multiEq = newMultiEq(cfMetaData, 0, value1, value2);\n Restriction singleSlice = newSingleSlice(cfMetaData, 2, Bound.START, false, value3);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiEq).mergeWith(singleSlice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithOneEqRestrictionsAndOneClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC);\n\n ByteBuffer clustering_0 = ByteBufferUtil.bytes(1);\n Restriction eq = newSingleEq(cfMetaData, 0, clustering_0);\n\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithOneEqRestrictionsAndTwoClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer clustering_0 = ByteBufferUtil.bytes(1);\n Restriction eq = newSingleEq(cfMetaData, 0, clustering_0);\n\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.END);\n }", "@Test\n public void testHardClustersWithOverlappingPartitions()\n {\n check(hardClustersWithOverlappingPartitions(), 0.0, 1.0);\n }", "@Test\n public void testBoundsAsCompositesWithEqAndSliceRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n\n Restriction eq = newSingleEq(cfMetaData, 0, value3);\n\n Restriction slice = newSingleSlice(cfMetaData, 1, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 1, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 1, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 1, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 1, Bound.START, false, value1);\n Restriction slice2 = newSingleSlice(cfMetaData, 1, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value2, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 1, Bound.START, true, value1);\n slice2 = newSingleSlice(cfMetaData, 1, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value2, EOC.END);\n }", "@Test\n public void testOverlappingPartitionsOverlappingClusters()\n {\n check(overlappingClustersWithOverlappingPartitions(), 0.75, 1.0);\n }", "private static Restriction newSingleSlice(CFMetaData cfMetaData, int index, Bound bound, boolean inclusive, ByteBuffer value)\n {\n ColumnDefinition columnDef = getClusteringColumnDefinition(cfMetaData, index);\n return new SingleColumnRestriction.Slice(columnDef, bound, inclusive, toTerm(value));\n }", "@Test\n public void testBoundsAsCompositesWithOneInRestrictionsAndOneClusteringColumn()\n {\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n Restriction in = newSingleIN(cfMetaData, 0, value1, value2, value3);\n\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(in);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.START);\n assertComposite(bounds.get(2), value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n assertComposite(bounds.get(1), value2, EOC.END);\n assertComposite(bounds.get(2), value3, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithSingleEqAndMultiEqRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) = (2, 3)\n Restriction singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction multiEq = newMultiEq(cfMetaData, 1, value2, value3);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiEq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n // clustering_0 = 1 AND clustering_1 = 2 AND (clustering_2, clustering_3) = (3, 4)\n singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction singleEq2 = newSingleEq(cfMetaData, 1, value2);\n multiEq = newMultiEq(cfMetaData, 2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(singleEq2).mergeWith(multiEq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n\n // (clustering_0, clustering_1) = (1, 2) AND clustering_2 = 3\n singleEq = newSingleEq(cfMetaData, 2, value3);\n multiEq = newMultiEq(cfMetaData, 0, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiEq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) = (2, 3) AND clustering_3 = 4\n singleEq = newSingleEq(cfMetaData, 0, value1);\n singleEq2 = newSingleEq(cfMetaData, 3, value4);\n multiEq = newMultiEq(cfMetaData, 1, value2, value3);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiEq).mergeWith(singleEq2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n }", "public interface IStoppingCriteria {\n\n /**\n * Determine the degree of clustering agreement\n * @param cluster1 one clustering results\n * @param cluster2 the other clustering results\n * @return the degree of clustering agreement; 1 refers to be the same clustering results; 0 refers to be the totally different clustering results\n */\n public double computeSimilarity(int[] cluster1, int[] cluster2);\n\n}", "boolean hasCluster();", "private boolean isSubsetOf(int firstRow, int secondRow) {\n for (int i = 0; i < universalSetSize; i++) {\n if (input[firstRow][i] && !input[secondRow][i]) {\n return false;\n }\n }\n return true;\n }", "private static Restriction newMultiSlice(CFMetaData cfMetaData, int firstIndex, Bound bound, boolean inclusive, ByteBuffer... values)\n {\n List<ColumnDefinition> columnDefinitions = new ArrayList<>();\n for (int i = 0; i < values.length; i++)\n {\n columnDefinitions.add(getClusteringColumnDefinition(cfMetaData, i + firstIndex));\n }\n return new MultiColumnRestriction.Slice(columnDefinitions, bound, inclusive, toMultiItemTerminal(values));\n }", "boolean hasPartitionLimit();", "boolean hasPermissionOfCluster(String clusterId, String userName);", "public static boolean shouldProcessSlice(OBSlice x) throws Exception {\n return x.size() <= maxSliceSize;\n }", "boolean getIsClusteringKey();", "public void decideCluster(){\n\tdouble shortest = 1000000;\n\tfor(int i = 0; i < clusterDist.length; i++)\n\t{\n\t\tif(clusterDist[i] < shortest)\n\t\t{\tshortest = clusterDist[i];\n\t\t\tthis.clusterid = i;\n\t\t}\n\t\t\n\t}\n}", "@Test\n public void testBoundsAsCompositesWithSingleEqAndMultiINRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n ByteBuffer value5 = ByteBufferUtil.bytes(5);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) IN ((2, 3), (4, 5))\n Restriction singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction multiIN = newMultiIN(cfMetaData, 1, asList(value2, value3), asList(value4, value5));\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiIN);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(1), value1, value4, value5, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(1), value1, value4, value5, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) IN ((2, 3))\n singleEq = newSingleEq(cfMetaData, 0, value1);\n multiIN = newMultiIN(cfMetaData, 1, asList(value2, value3));\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiIN).mergeWith(singleEq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n // clustering_0 = 1 AND clustering_1 = 5 AND (clustering_2, clustering_3) IN ((2, 3), (4, 5))\n singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction singleEq2 = newSingleEq(cfMetaData, 1, value5);\n multiIN = newMultiIN(cfMetaData, 2, asList(value2, value3), asList(value4, value5));\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiIN).mergeWith(singleEq2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value5, value2, value3, EOC.START);\n assertComposite(bounds.get(1), value1, value5, value4, value5, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value5, value2, value3, EOC.END);\n assertComposite(bounds.get(1), value1, value5, value4, value5, EOC.END);\n }", "protected void checkSlice(int slice) {\n\tif (slice < 0 || slice >= slices) throw new IndexOutOfBoundsException(\"Attempted to access \"+toStringShort()+\" at slice=\"+slice);\n}", "public void testLearnFullDimensions()\n {\n RandomSubVectorThresholdLearner<String> instance = new RandomSubVectorThresholdLearner<>(\n new VectorThresholdInformationGainLearner<String>(),\n 0.9999, random);\n\n \n VectorFactory<?> vectorFactory = VectorFactory.getDefault();\n ArrayList<InputOutputPair<Vector, String>> data = new ArrayList<>();\n for (int i = 0; i < 10; i++)\n {\n data.add(new DefaultInputOutputPair<>(vectorFactory.createUniformRandom(\n 100, 1.0, 10.0, random), \"a\"));\n }\n\n for (int i = 0; i < 10; i++)\n {\n data.add(new DefaultInputOutputPair<>(vectorFactory.createUniformRandom(\n 100, 1.0, 10.0, random), \"b\"));\n }\n\n VectorElementThresholdCategorizer result = instance.learn(data);\n assertTrue(result.getIndex() >= 0);\n assertTrue(result.getIndex() < 100);\n \n // Change the dimensions to consider.\n instance.setDimensionsToConsider(new int[] {10});\n\n result = instance.learn(data);\n assertTrue(result.getIndex() == 10);\n }", "@Test\n\tpublic void testGetSlice() {\n\t}", "@Test(timeout = 4000)\n public void test03() throws Throwable {\n Discretize discretize0 = new Discretize();\n discretize0.setAttributeIndices(\"\");\n Filter.makeCopy(discretize0);\n discretize0.setDesiredWeightOfInstancesPerInterval(2.0);\n boolean boolean0 = true;\n discretize0.m_ClassIndex = 0;\n discretize0.setUseBinNumbers(true);\n discretize0.listOptions();\n discretize0.makeBinaryTipText();\n discretize0.getInvertSelection();\n // Undeclared exception!\n try { \n discretize0.calculateCutPointsByEqualWidthBinning((-458));\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"weka.filters.unsupervised.attribute.Discretize\", e);\n }\n }", "private int restrictSection(Message msg, String parameter) {\n int sec = Integer.parseInt(parameter);\n\n if(sec > 2) {\n MessageChannel ch = msg.getChannel();\n ch.sendMessage(\"`Error: Invalid query [section not 0-2]. Query terminated.`\").queue();\n return -1;\n }\n else if(sec == 2) {\n partTwo = true;\n upperProblem = 8;\n }\n\n return sec;\n }", "boolean isAllowClusterGet();", "public boolean percolates()\r\n { return uf.find(0) == uf.find(dimension*dimension + 1); }", "@Test\n\t public void test_Is_Subset_Negative() throws Exception{\t\n\t\t SET setarray= new SET( new int[]{1,2,3,4,5});\n\t\t SET subsetarray= new SET( new int[]{7,8});\n\t\t assertFalse(setarray.isSubSet(subsetarray));\t \n\t }", "boolean isNeedSharding();", "@Nullable\n public abstract GridAxis subset(GridSubset params, Formatter errlog);", "@Test\n\t public void test_Is_Subset_Positive() throws Exception{\t\n\t\t SET setarray= new SET( new int[]{1,2,3,4,5});\n\t\t SET subsetarray= new SET( new int[]{1,2,3});\n\t\t assertTrue(setarray.isSubSet(subsetarray));\t \n\t }", "protected void checkBox(int slice, int row, int column, int depth, int height, int width) {\n\tif (slice<0 || depth<0 || slice+depth>slices || row<0 || height<0 || row+height>rows || column<0 || width<0 || column+width>columns) throw new IndexOutOfBoundsException(toStringShort()+\", slice:\"+slice+\", row:\"+row+\" ,column:\"+column+\", depth:\"+depth+\" ,height:\"+height+\", width:\"+width);\n}", "public boolean isReviewed(int index) {\n if (index % 2 != 0) {\n index -= 1;\n }\n index = index / 2;\n if ( ( (Integer) clusters[index][3]).intValue() == 1) {\n return true;\n }\n else {\n return false;\n }\n }", "@Test\r\n public void testIsSubset1() {\r\n Assert.assertEquals(false, set1.isSubset(set2));\r\n }", "public abstract Optional<GridAxis> subsetDependent(GridAxis1D subsetIndAxis, Formatter errlog);", "boolean hasClusterName();", "@Test\n public void testRedundancyRestriction() throws Exception {\n final String rName = getUniqueName();\n final Integer red0 = 0;\n final Integer red1 = 1;\n\n CacheSerializableRunnable createPRsWithRed =\n new CacheSerializableRunnable(\"createPrsWithDifferentRedundancy\") {\n @Override\n public void run2() throws CacheException {\n getCache();\n IgnoredException.addIgnoredException(\"redundancy should be same as the redundancy\");\n createPR(rName, red1, 100, 3, null, Boolean.FALSE,\n Boolean.FALSE);\n try {\n createPR(rName + \"colo\", red0, 100, 3, rName,\n Boolean.FALSE, Boolean.FALSE);\n fail(\"Expected different redundancy levels to throw.\");\n } catch (IllegalStateException expected) {\n assertEquals(\n \"Current PartitionedRegion's redundancy should be same as the redundancy of colocated PartitionedRegion\",\n expected.getMessage());\n }\n }\n };\n dataStore1.invoke(createPRsWithRed);\n }", "private boolean subGridCheck() {\n\t\tint sqRt = (int)Math.sqrt(dimension);\n\t\tfor(int i = 0; i < sqRt; i++) {\n\t\t\tint increment = i * sqRt;\n\t\t\tfor(int val = 1; val <= dimension; val++) {\n\t\t\t\tint valCounter = 0;\n\t\t\t\tfor(int row = 0 + increment; row < sqRt + increment; row++) {\n\t\t\t\t\tfor(int col = 0 + increment; col < sqRt + increment; col++) {\n\t\t\t\t\t\tif(puzzle[row][col] == val)\n\t\t\t\t\t\t\tvalCounter++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(valCounter >= 2)\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public void testFilterOnAggregationColumn() throws Exception {\n \t\tccName = new String[] { \"cc1\", \"cc2\", \"cc3\" };\n \t\tccExpr = new String[] { \"row.COL0+row.COL1\",\n \t\t\t\t\"Total.runningSum(row.cc1,row.COL0==0,0)\",\n \t\t\t\t\"Total.runningSum(row.cc1,row.COL0>0,0)\" };\n \n \t\tfor (int i = 0; i < ccName.length; i++) {\n \t\t\tComputedColumn computedColumn = new ComputedColumn(ccName[i],\n \t\t\t\t\tccExpr[i], DataType.ANY_TYPE);\n \t\t\t((BaseDataSetDesign) this.dataSet)\n \t\t\t\t\t.addComputedColumn(computedColumn);\n \t\t}\n \n \t\tString[] bindingNameRow = new String[7];\n \t\tbindingNameRow[0] = \"ROW_COL0\";\n \t\tbindingNameRow[1] = \"ROW_COL1\";\n \t\tbindingNameRow[2] = \"ROW_COL2\";\n \t\tbindingNameRow[3] = \"ROW_COL3\";\n \t\tbindingNameRow[4] = \"ROW_cc1\";\n \t\tbindingNameRow[5] = \"ROW_cc2\";\n \t\tbindingNameRow[6] = \"ROW_cc3\";\n \t\tScriptExpression[] bindingExprRow = new ScriptExpression[] {\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL0\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL1\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL2\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL3\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + ccName[0], 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + ccName[1], 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + ccName[2], 0) };\n \n \t\tIResultIterator resultIt = this.executeQuery(this.createQuery(null,\n \t\t\t\tnull, null, null, null, null, null, null, null, bindingNameRow,\n \t\t\t\tbindingExprRow));\n \n \t\tprintResult(resultIt, bindingNameRow, bindingExprRow);\n \t\t// assert\n \t\tcheckOutputFile();\n \n \t}", "private static boolean sliceIsValid(final int[] slice, final int flowOrderLength) {\n int consecutiveZeros = 0;\n for ( int key : slice ) {\n if ( key != 0 ) {\n consecutiveZeros = 0;\n } else {\n consecutiveZeros++;\n if ( consecutiveZeros >= (flowOrderLength - 1) ) {\n return false;\n }\n }\n }\n\n // if here, not found -> valid\n return true;\n }", "@Override\n public boolean onClusterClick(Cluster<Person> cluster) {\n LatLngBounds.Builder builder = LatLngBounds.builder();\n for (ClusterItem item : cluster.getItems()) {\n builder.include(item.getPosition());\n }\n // Get the LatLngBounds\n final LatLngBounds bounds = builder.build();\n\n // Animate camera to the bounds\n try {\n getMap().animateCamera(CameraUpdateFactory.newLatLngBounds(bounds, 100));\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n return true;\n }", "public void testGetSubDimensionality()\n {\n RandomSubVectorThresholdLearner<String> instance = new RandomSubVectorThresholdLearner<String>();\n\n instance.setPercentToSample(0.5);\n assertEquals(5, instance.getSubDimensionality(10));\n\n instance.setPercentToSample(0.25);\n assertEquals(2, instance.getSubDimensionality(9));\n\n instance.setPercentToSample(1.0);\n assertEquals(9, instance.getSubDimensionality(9));\n\n instance.setPercentToSample(0.0);\n assertEquals(1, instance.getSubDimensionality(9));\n }", "boolean hasDimension();", "private boolean isValid(int index) {\r\n return index >= 0 && index < dimension;\r\n }", "public List<ParameterValueObject> getClustering(Filter filter);", "private boolean inBounds(int row, int col){\n if (row > -1 && row < 120 && col > -1 && col < 160)\n return true;\n return false;\n }", "@Test\n public void should_iterate_with_default_params() throws Exception {\n long partitionKey = RandomUtils.nextLong(0,Long.MAX_VALUE);\n insertClusteredValues(partitionKey, 1, \"name1\", 5);\n\n Iterator<ClusteredEntity> iter = manager.sliceQuery(ClusteredEntity.class)\n .forIteration()\n .withPartitionComponents(partitionKey)\n .iterator();\n\n assertThat(iter.hasNext()).isTrue();\n ClusteredEntity next = iter.next();\n assertThat(next.getId().getCount()).isEqualTo(1);\n assertThat(next.getId().getName()).isEqualTo(\"name11\");\n assertThat(next.getValue()).isEqualTo(\"value11\");\n\n assertThat(iter.hasNext()).isTrue();\n next = iter.next();\n assertThat(next.getId().getCount()).isEqualTo(1);\n assertThat(next.getId().getName()).isEqualTo(\"name12\");\n assertThat(next.getValue()).isEqualTo(\"value12\");\n\n assertThat(iter.hasNext()).isTrue();\n next = iter.next();\n assertThat(next.getId().getCount()).isEqualTo(1);\n assertThat(next.getId().getName()).isEqualTo(\"name13\");\n assertThat(next.getValue()).isEqualTo(\"value13\");\n\n assertThat(iter.hasNext()).isTrue();\n next = iter.next();\n assertThat(next.getId().getCount()).isEqualTo(1);\n assertThat(next.getId().getName()).isEqualTo(\"name14\");\n assertThat(next.getValue()).isEqualTo(\"value14\");\n\n assertThat(iter.hasNext()).isTrue();\n next = iter.next();\n assertThat(next.getId().getCount()).isEqualTo(1);\n assertThat(next.getId().getName()).isEqualTo(\"name15\");\n assertThat(next.getValue()).isEqualTo(\"value15\");\n\n assertThat(iter.hasNext()).isFalse();\n }", "@Test\n public void testMultiLevelPartitionPruning() throws SqlParseException {\n\n val project = \"multi_level_partition\";\n val dfId = \"747f864b-9721-4b97-acde-0aa8e8656cba\";\n val expectedRanges = Lists.<Pair<String, String>> newArrayList();\n val segmentRange1 = Pair.newPair(\"2012-01-01\", \"2012-01-02\");\n val segment1Uuid = \"8892fa3f-f607-4eec-8159-7c5ae2f16942\";\n val segmentRange2 = Pair.newPair(\"2012-01-02\", \"2012-01-03\");\n val segment2Uuid = \"d75a822c-788a-4592-a500-cf20186dded1\";\n val segmentRange3 = Pair.newPair(\"2012-01-03\", \"2012-01-04\");\n val segment3Uuid = \"54eaf96d-6146-45d2-b94e-d5d187f89919\";\n val segmentRange4 = Pair.newPair(\"2012-01-04\", \"2012-01-05\");\n val segment4Uuid = \"411f40b9-a80a-4453-90a9-409aac6f7632\";\n val segmentRange5 = Pair.newPair(\"2012-01-05\", \"2012-01-06\");\n val segment5Uuid = \"a8318597-cb75-416f-8eb8-96ea285dd2b4\";\n val expectedPartitionMap = Maps.<String, List<Long>> newHashMap();\n\n val sqlBase = \"select cal_dt, sum(price) from test_kylin_fact inner join test_account on test_kylin_fact.seller_id = test_account.account_id \";\n\n // no filter\n val noFilterSql = sqlBase + \"group by cal_dt\";\n expectedRanges.add(segmentRange1);\n expectedRanges.add(segmentRange2);\n expectedRanges.add(segmentRange3);\n expectedRanges.add(segmentRange4);\n expectedRanges.add(segmentRange5);\n expectedPartitionMap.put(segment1Uuid, Lists.newArrayList(0L, 1L, 2L, 3L));\n expectedPartitionMap.put(segment2Uuid, Lists.newArrayList(0L, 1L, 2L));\n expectedPartitionMap.put(segment3Uuid, Lists.newArrayList(1L, 2L, 3L));\n expectedPartitionMap.put(segment4Uuid, Lists.newArrayList(0L, 1L));\n expectedPartitionMap.put(segment5Uuid, Lists.newArrayList(2L, 3L));\n assertPrunedSegmentsRange(project, noFilterSql, dfId, expectedRanges, 1L, expectedPartitionMap);\n\n val andSql0 = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-04' and lstg_site_id = 1 group by cal_dt\";\n val andMappingSql0 = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-04' and lstg_format_name = 'FP-non GTC' group by cal_dt\";\n val andMixSql0 = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-04' and lstg_site_id = 1 and lstg_format_name = 'FP-non GTC' group by cal_dt\";\n expectedRanges.clear();\n expectedRanges.add(segmentRange1);\n expectedRanges.add(segmentRange2);\n expectedRanges.add(segmentRange3);\n expectedPartitionMap.clear();\n expectedPartitionMap.put(segment1Uuid, Lists.newArrayList(1L));\n expectedPartitionMap.put(segment2Uuid, Lists.newArrayList(1L));\n expectedPartitionMap.put(segment3Uuid, Lists.newArrayList(1L));\n assertPrunedSegmentsRange(project, andSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n assertPrunedSegmentsRange(project, andMappingSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n assertPrunedSegmentsRange(project, andMixSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n\n val notInSql0 = sqlBase\n + \"where cal_dt > '2012-01-02' and cal_dt < '2012-01-04' and lstg_site_id not in (0, 2, 3) group by cal_dt\";\n val notInMappingSql0 = sqlBase\n + \"where cal_dt > '2012-01-02' and cal_dt < '2012-01-04' and lstg_format_name not in ('FP-GTC', 'ABIN', 'Auction') group by cal_dt\";\n val notInMixSql0 = sqlBase\n + \"where cal_dt > '2012-01-02' and cal_dt < '2012-01-04' and lstg_site_id not in (0, 2, 3) and lstg_format_name not in ('FP-GTC', 'ABIN', 'Auction') group by cal_dt\";\n expectedRanges.clear();\n expectedRanges.add(segmentRange2);\n expectedRanges.add(segmentRange3);\n expectedPartitionMap.clear();\n expectedPartitionMap.put(segment2Uuid, Lists.newArrayList(1L));\n expectedPartitionMap.put(segment3Uuid, Lists.newArrayList(1L));\n assertPrunedSegmentsRange(project, notInSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n assertPrunedSegmentsRange(project, notInMappingSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n assertPrunedSegmentsRange(project, notInMixSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n\n // return empty data case\n val emptyData = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-03' and lstg_site_id = 5 group by cal_dt\";\n val emptyDataMapping = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-03' and lstg_format_name = 'not_exist_name' group by cal_dt\";\n val emptyDataMix = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-03' and lstg_site_id = 5 and lstg_format_name = 'not_exist_name' group by cal_dt\";\n expectedRanges.clear();\n expectedPartitionMap.clear();\n assertPrunedSegmentsRange(project, emptyData, dfId, expectedRanges, -1L, expectedPartitionMap);\n assertPrunedSegmentsRange(project, emptyDataMapping, dfId, expectedRanges, -1L, expectedPartitionMap);\n assertPrunedSegmentsRange(project, emptyDataMix, dfId, expectedRanges, -1L, expectedPartitionMap);\n\n // query data out of current built segments range\n val inSql0 = sqlBase\n + \"where cal_dt > '2011-12-30' and cal_dt < '2012-01-03' and lstg_site_id in (1, 2) group by cal_dt\";\n val inMappingSql0 = sqlBase\n + \"where cal_dt > '2011-12-30' and cal_dt < '2012-01-03' and lstg_format_name in ('FP-non GTC', 'ABIN') group by cal_dt\";\n val inMixSql0 = sqlBase\n + \"where cal_dt > '2011-12-30' and cal_dt < '2012-01-03' and lstg_site_id in (1, 2) and lstg_format_name in ('FP-non GTC', 'ABIN') group by cal_dt\";\n expectedRanges.add(segmentRange1);\n expectedRanges.add(segmentRange2);\n expectedPartitionMap.put(segment1Uuid, Lists.newArrayList(1L, 2L));\n expectedPartitionMap.put(segment2Uuid, Lists.newArrayList(1L, 2L));\n assertPrunedSegmentsRange(project, inSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n assertPrunedSegmentsRange(project, inMappingSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n assertPrunedSegmentsRange(project, inMixSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n\n val pushDownSql0 = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-03' and lstg_site_id = 3 group by cal_dt\";\n assertNoRealizationFound(project, pushDownSql0);\n\n val pushDownMappingSql0 = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-03' and lstg_format_name = 'Auction' group by cal_dt\";\n assertNoRealizationFound(project, pushDownMappingSql0);\n\n val pushDownMixSql0 = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-03' and lstg_site_id = 3 and lstg_format_name = 'Auction' group by cal_dt\";\n assertNoRealizationFound(project, pushDownMixSql0);\n\n // return empty result\n val wrongMapping0 = sqlBase\n + \"where cal_dt between '2012-01-01' and '2012-01-02' and lstg_site_id = 0 and lstg_format_name = 'FP-non GTC' group by cal_dt\";\n assertPrunedSegmentsRange(project, wrongMapping0, dfId, null, -1L, null);\n\n val orSql0 = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-02' and (lstg_site_id = 0 or lstg_format_name = 'FP-non GTC') group by cal_dt\";\n expectedRanges.clear();\n expectedPartitionMap.clear();\n expectedRanges.add(segmentRange1);\n expectedPartitionMap.put(segment1Uuid, Lists.newArrayList(0L, 1L));\n assertPrunedSegmentsRange(project, orSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n }", "protected boolean isClusterRequired() {\n return true;\n }", "@Override\n public boolean onClusterClick(Cluster<Company> cluster) {\n LatLngBounds.Builder builder = LatLngBounds.builder();\n for (ClusterItem item : cluster.getItems()) {\n builder.include(item.getPosition());\n }\n // Get the LatLngBounds\n final LatLngBounds bounds = builder.build();\n\n // Animate camera to the bounds\n try {\n mMap.animateCamera(CameraUpdateFactory.newLatLngBounds(bounds, 200));\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n return true;\n }", "default DiscreteSet2D subLevelSet(double value) {\r\n\t\treturn pointsSatisfying(d -> d <= value);\r\n\t}", "List<Trueorfalse> selectByExample(RowBounds rowBounds);", "Boolean isCollinearTo(IVec3 v);", "public final PythonParser.sliceop_return sliceop() throws RecognitionException {\n PythonParser.sliceop_return retval = new PythonParser.sliceop_return();\n retval.start = input.LT(1);\n\n PythonTree root_0 = null;\n\n Token COLON256=null;\n PythonParser.test_return test257 = null;\n\n\n PythonTree COLON256_tree=null;\n RewriteRuleTokenStream stream_COLON=new RewriteRuleTokenStream(adaptor,\"token COLON\");\n RewriteRuleSubtreeStream stream_test=new RewriteRuleSubtreeStream(adaptor,\"rule test\");\n try {\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1506:5: ( COLON ( test[expr_contextType.Load] -> test | -> ^( COLON[$COLON, \\\"None\\\", expr_contextType.Load] ) ) )\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1506:7: COLON ( test[expr_contextType.Load] -> test | -> ^( COLON[$COLON, \\\"None\\\", expr_contextType.Load] ) )\n {\n COLON256=(Token)match(input,COLON,FOLLOW_COLON_in_sliceop6943); if (state.failed) return retval; \n if ( state.backtracking==0 ) stream_COLON.add(COLON256);\n\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1507:6: ( test[expr_contextType.Load] -> test | -> ^( COLON[$COLON, \\\"None\\\", expr_contextType.Load] ) )\n int alt128=2;\n int LA128_0 = input.LA(1);\n\n if ( (LA128_0==NAME||(LA128_0>=LAMBDA && LA128_0<=NOT)||LA128_0==LPAREN||(LA128_0>=PLUS && LA128_0<=MINUS)||(LA128_0>=TILDE && LA128_0<=LBRACK)||LA128_0==LCURLY||(LA128_0>=BACKQUOTE && LA128_0<=STRING)) ) {\n alt128=1;\n }\n else if ( (LA128_0==COMMA||LA128_0==RBRACK) ) {\n alt128=2;\n }\n else {\n if (state.backtracking>0) {state.failed=true; return retval;}\n NoViableAltException nvae =\n new NoViableAltException(\"\", 128, 0, input);\n\n throw nvae;\n }\n switch (alt128) {\n case 1 :\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1507:7: test[expr_contextType.Load]\n {\n pushFollow(FOLLOW_test_in_sliceop6951);\n test257=test(expr_contextType.Load);\n\n state._fsp--;\n if (state.failed) return retval;\n if ( state.backtracking==0 ) stream_test.add(test257.getTree());\n\n\n // AST REWRITE\n // elements: test\n // token labels: \n // rule labels: retval\n // token list labels: \n // rule list labels: \n // wildcard labels: \n if ( state.backtracking==0 ) {\n retval.tree = root_0;\n RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,\"rule retval\",retval!=null?retval.tree:null);\n\n root_0 = (PythonTree)adaptor.nil();\n // 1508:5: -> test\n {\n adaptor.addChild(root_0, stream_test.nextTree());\n\n }\n\n retval.tree = root_0;}\n }\n break;\n case 2 :\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1510:5: \n {\n\n // AST REWRITE\n // elements: COLON\n // token labels: \n // rule labels: retval\n // token list labels: \n // rule list labels: \n // wildcard labels: \n if ( state.backtracking==0 ) {\n retval.tree = root_0;\n RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,\"rule retval\",retval!=null?retval.tree:null);\n\n root_0 = (PythonTree)adaptor.nil();\n // 1510:5: -> ^( COLON[$COLON, \\\"None\\\", expr_contextType.Load] )\n {\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1510:8: ^( COLON[$COLON, \\\"None\\\", expr_contextType.Load] )\n {\n PythonTree root_1 = (PythonTree)adaptor.nil();\n root_1 = (PythonTree)adaptor.becomeRoot(new Name(COLON, COLON256, \"None\", expr_contextType.Load), root_1);\n\n adaptor.addChild(root_0, root_1);\n }\n\n }\n\n retval.tree = root_0;}\n }\n break;\n\n }\n\n\n }\n\n retval.stop = input.LT(-1);\n\n if ( state.backtracking==0 ) {\n\n retval.tree = (PythonTree)adaptor.rulePostProcessing(root_0);\n adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);\n }\n }\n\n catch (RecognitionException re) {\n errorHandler.reportError(this, re);\n errorHandler.recover(this, input,re);\n retval.tree = (PythonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);\n }\n finally {\n }\n return retval;\n }", "boolean isSliceParent();", "private boolean isSubsetOf(List<String> permissions2,\n\t\t\tList<String> permissions3) {\n\t\treturn false;\n\t}", "public static boolean IS_SUBFEATURE(Feature a, int index_a, Feature b, int index_b) {\n\n boolean anotinb, bnotina;\n int i, ia, ib;\n\n if (index_a != index_b)\n Dataset.perror(\"Feature.class :: not the same feature (\" + index_a + \" != \" + index_b + \")\");\n if (!a.type.equals(b.type))\n Dataset.perror(\n \"Feature.class :: not the same type of feature (\" + a.type + \" != \" + b.type + \")\");\n\n if (IS_CONTINUOUS(a.type)) {\n if (a.dmin >= b.dmin) {\n if (a.dmax <= b.dmax) return true;\n else\n Dataset.perror(\n \"Feature.class :: inconsistency for subfeature check for : (\"\n + a.dmin\n + \", \"\n + a.dmax\n + \") subseteq (\"\n + b.dmin\n + \", \"\n + b.dmax\n + \") ? \");\n } else if (a.dmax < b.dmax)\n Dataset.perror(\n \"Feature.class :: inconsistency for subfeature check for : (\"\n + a.dmin\n + \", \"\n + a.dmax\n + \") subseteq (\"\n + b.dmin\n + \", \"\n + b.dmax\n + \") ? \");\n } else if (IS_INTEGER(a.type)) {\n if (a.imin >= b.imin) {\n if (a.imax <= b.imax) return true;\n else\n Dataset.perror(\n \"Feature.class :: inconsistency for subfeature check for : (\"\n + a.imin\n + \", \"\n + a.imax\n + \") subseteq (\"\n + b.imin\n + \", \"\n + b.imax\n + \") ? \");\n } else if (a.imax < b.imax)\n Dataset.perror(\n \"Feature.class :: inconsistency for subfeature check for : (\"\n + a.imin\n + \", \"\n + a.imax\n + \") subseteq (\"\n + b.imin\n + \", \"\n + b.imax\n + \") ? \");\n } else if (IS_NOMINAL(a.type)) {\n if (a.modalities == null) return true;\n else if (b.modalities != null) {\n anotinb = bnotina = false;\n ia = ib = -1;\n for (i = 0; i < a.modalities.size(); i++)\n if (!b.modalities.contains((String) a.modalities.elementAt(i))) {\n anotinb = true;\n ia = i;\n }\n for (i = 0; i < b.modalities.size(); i++)\n if (!a.modalities.contains((String) b.modalities.elementAt(i))) {\n bnotina = true;\n ib = i;\n }\n if ((anotinb) && (bnotina))\n Dataset.perror(\n \"Feature.class :: inconsistency for subfeature check for : \"\n + ((String) a.modalities.elementAt(ia))\n + \" not in b and \"\n + ((String) b.modalities.elementAt(ib))\n + \" not in a \");\n else if (!anotinb) return true;\n }\n } else Dataset.perror(\"Feature.class :: no Feature type for \" + a.type);\n\n return false;\n }", "public boolean isSubset() {\n return isSubset;\n }", "public boolean isSubset() {\n return isSubset;\n }", "void setAllowClusterGet( boolean r );", "private boolean inBounds(int row, int col)\n {\n return ((row >= 0) && (row < NUM_ROWS) &&\n (col >= 0) && (col < NUM_COLS)); \n }", "@Test\n void testSubset() throws IOException {\n Long expectedNumberOfVariables = 13L;\n Long expectedNumberOfCases = 24L; // aka the number of lines in the TAB file produced by the ingest plugin\n\n TabularDataIngest ingestResult;\n File file = getFile(\"csv/ingest/election_precincts.csv\");\n try (BufferedInputStream stream = new BufferedInputStream(new FileInputStream(file))) {\n CSVFileReader instance = createInstance();\n ingestResult = instance.read(Tuple.of(stream, file), null);\n }\n\n File generatedTabFile = ingestResult.getTabDelimitedFile();\n DataTable generatedDataTable = ingestResult.getDataTable();\n\n assertThat(generatedDataTable).isNotNull();\n assertThat(generatedDataTable.getDataVariables()).isNotNull();\n assertThat(generatedDataTable.getVarQuantity()).isEqualTo((long) generatedDataTable.getDataVariables().size());\n assertThat(generatedDataTable.getVarQuantity()).isEqualTo(expectedNumberOfVariables);\n assertThat(generatedDataTable.getCaseQuantity()).isEqualTo(expectedNumberOfCases);\n\n // And now let's try and subset the individual vectors\n // First, the \"continuous\" vectors (we should be able to read these as Double[]):\n int[] floatColumns = {2};\n\n Double[][] floatVectors = {\n { 1.0, 3.0, 4.0, 6.0, 7.0, 8.0, 11.0, 12.0, 76.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0 },\n };\n\n IngestDataProvider dataProvider = new InMemoryIngestDataProvider();\n dataProvider.initialize(generatedDataTable, generatedTabFile);\n\n int vectorCount = 0;\n for (int i : floatColumns) {\n // We'll be subsetting the column vectors one by one, re-opening the\n // file each time. Inefficient - but we don't care here.\n\n if (!generatedDataTable.getDataVariables().get(i).isIntervalContinuous()) {\n fail(\"Column \" + i + \" was not properly processed as \\\"continuous\\\"\");\n }\n\n Double[] columnVector = dataProvider.getDoubleColumn(i);\n\n assertThat(columnVector).isEqualTo(floatVectors[vectorCount++]);\n }\n\n // Discrete Numerics (aka, integers):\n int[] integerColumns = { 1, 4, 6, 7, 8, 9, 10, 11, 12 };\n\n Long[][] longVectors = {\n { 1L, 3L, 4L, 6L, 7L, 8L, 11L, 12L, 76L, 77L, 77L, 77L, 77L, 77L, 77L, 77L, 77L, 77L, 77L, 77L, 77L, 77L, 77L, 77L },\n { 1L, 2L, 3L, 4L, 5L, 11L, 13L, 15L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L },\n { 85729227L, 85699791L, 640323976L, 85695847L, 637089796L, 637089973L, 85695001L, 85695077L, 1111111L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L },\n { 205871733L, 205871735L, 205871283L, 258627915L, 257444575L, 205871930L, 260047422L, 262439738L, 1111111L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L },\n { 205871673L, 205871730L, 205871733L, 205872857L, 258627915L, 257444584L, 205873413L, 262439738L, 1111111L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L },\n { 25025000201L, 25025081001L, 25025000701L, 25025050901L, 25025040600L, 25025000502L, 25025040401L, 25025100900L, 1111111L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L },\n { 250250502002L, 250250502003L, 250250501013L, 250250408011L, 250250503001L, 250250103001L, 250250406002L, 250250406001L, 1111111L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L },\n { 250251011024001L, 250251011013003L, 250251304041007L, 250251011013006L, 250251010016000L, 250251011024002L, 250251001005004L, 250251002003002L, 1111111L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L },\n { 2109L, 2110L, 2111L, 2120L, 2121L, 2115L, 2116L, 2122L, 11111L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L }\n };\n\n vectorCount = 0;\n\n for (int i : integerColumns) {\n if (!generatedDataTable.getDataVariables().get(i).isIntervalDiscrete()\n || !generatedDataTable.getDataVariables().get(i).isTypeNumeric()) {\n fail(\"Column \" + i + \" was not properly processed as \\\"discrete numeric\\\"\");\n }\n\n Long[] columnVector = dataProvider.getLongColumn(i);\n\n assertThat(columnVector).isEqualTo(longVectors[vectorCount++]);\n }\n\n // And finally, Strings:\n int[] stringColumns = {0, 3, 5};\n\n String[][] stringVectors = {\n { \"Dog\", \"Squirrel\", \"Antelope\", \"Zebra\", \"Lion\", \"Gazelle\", \"Cat\", \"Giraffe\", \"Cat\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\" },\n { \"East Boston\", \"Charlestown\", \"South Boston\", \"Bronx\", \"Roslindale\", \"Mission Hill\", \"Jamaica Plain\", \"Hyde Park\", \"Fenway/Kenmore\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\" },\n { \"2-06\", \"1-09\", \"1-1A\", \"1-1B\", \"2-04\", \"3-05\", \"1-1C\", \"1-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", }\n };\n\n vectorCount = 0;\n\n for (int i : stringColumns) {\n if (!generatedDataTable.getDataVariables().get(i).isTypeCharacter()) {\n fail(\"Column \" + i + \" was not properly processed as a character vector\");\n }\n String[] columnVector = dataProvider.getStringColumn(i);\n\n assertThat(columnVector).isEqualTo(stringVectors[vectorCount++]);\n }\n }", "@Test\n public void testHeterogeneousSegmentFilterConditionLimit() throws SqlParseException {\n\n val project = \"heterogeneous_segment\";\n // val dfId = \"747f864b-9721-4b97-acde-0aa8e8656cba\"\n // val seg1Id = \"8892fa3f-f607-4eec-8159-7c5ae2f16942\"\n // val seg2Id = \"d75a822c-788a-4592-a500-cf20186dded1\"\n // val seg3Id = \"54eaf96d-6146-45d2-b94e-d5d187f89919\"\n // val seg4Id = \"411f40b9-a80a-4453-90a9-409aac6f7632\"\n // val seg5Id = \"a8318597-cb75-416f-8eb8-96ea285dd2b4\"\n // \n val sql = \"with T1 as (select cal_dt, trans_id \\n\" + \"from test_kylin_fact inner join test_account \\n\"\n + \"on test_kylin_fact.seller_id = test_account.account_id \\n\"\n + \"where cal_dt between date'2012-01-01' and date'2012-01-03'\\n\" + \"group by cal_dt, trans_id)\\n\";\n\n {\n val sqlWithTooManyOrs = sql + \" select * from T1 where \" + \"(cal_dt='2012-01-01' and trans_id = 1) or \\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 2) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 3) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 4) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 5) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 6) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 7) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 8) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 9) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 10) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 12) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 13) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 14) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 15) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 16) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 17) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 18) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 19) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 20)\";\n val contexts = OlapContextTestUtil.getOlapContexts(project, sqlWithTooManyOrs);\n Assert.assertEquals(\n \">=(DEFAULT.TEST_KYLIN_FACT.CAL_DT, 2012-01-01),<=(DEFAULT.TEST_KYLIN_FACT.CAL_DT, 2012-01-03)\",\n contexts.get(0).getExpandedFilterConditions().stream().map(RexNode::toString)\n .collect(Collectors.joining(\",\")));\n }\n\n {\n val sqlWithFilter = sql + \" select * from T1 where \" + \"(cal_dt='2012-01-01' and trans_id = 1) or \\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 2) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 3) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 4) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 5) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 6) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 7) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 8) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 9) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 10)\";\n val contexts = OlapContextTestUtil.getOlapContexts(project, sqlWithFilter);\n Assert.assertNotEquals(\n \">=(DEFAULT.TEST_KYLIN_FACT.CAL_DT, 2012-01-01),<=(DEFAULT.TEST_KYLIN_FACT.CAL_DT, 2012-01-03)\",\n contexts.get(0).getExpandedFilterConditions().stream().map(RexNode::toString)\n .collect(Collectors.joining(\",\")));\n }\n\n }", "@Test\n public void testColocatedPartitionedRegion() throws Throwable {\n createCacheInAllVms();\n redundancy = 0;\n localMaxmemory = 50;\n totalNumBuckets = 11;\n\n regionName = \"A\";\n colocatedWith = null;\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"B\";\n colocatedWith = SEPARATOR + \"A\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"C\";\n colocatedWith = SEPARATOR + \"A\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"D\";\n colocatedWith = SEPARATOR + \"B\";\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"E\";\n colocatedWith = SEPARATOR + \"B\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"F\";\n colocatedWith = SEPARATOR + \"B\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"G\";\n colocatedWith = SEPARATOR + \"C\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"H\";\n colocatedWith = SEPARATOR + \"C\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"I\";\n colocatedWith = SEPARATOR + \"C\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"J\";\n colocatedWith = SEPARATOR + \"D\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"K\";\n colocatedWith = SEPARATOR + \"D\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"L\";\n colocatedWith = SEPARATOR + \"E\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"M\";\n colocatedWith = SEPARATOR + \"F\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"N\";\n colocatedWith = SEPARATOR + \"G\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"O\";\n colocatedWith = SEPARATOR + \"I\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n accessor.invoke(() -> PRColocationDUnitTest.validateColocatedRegions(\"A\"));\n\n accessor.invoke(() -> PRColocationDUnitTest.validateColocatedRegions(\"D\"));\n\n accessor.invoke(() -> PRColocationDUnitTest.validateColocatedRegions(\"H\"));\n\n accessor.invoke(() -> PRColocationDUnitTest.validateColocatedRegions(\"B\"));\n\n accessor.invoke(() -> PRColocationDUnitTest.validateColocatedRegions(\"K\"));\n }", "public boolean isMember(int k) {\n\t \n\t int a = sparse[k];\n\n\t if (a < members && dense[a] == k) \n\t \treturn true;\n\t else\n\t \treturn false;\n\n\t}", "public void addRestrictions()\n\t{\n\t\tfor(int i=0;i<n;i++)\n\t\t{\n\t\t\tfor(int j=0;j<n;j++)\n\t\t\t{\t\t\t\t\n\t\t\t\tif(restriction[i][j] == 1 )\n\t\t\t\t{\n\t\t\t\t\tcost[i][j] = 1000000000;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private boolean isNeedCut(Map<Set<String>, Integer> preMap, Set<String> set) {\n\t\tboolean flag = false;\n\t\tList<Set<String>> subSets = getSubSets(set);\n\t\tfor(Set<String> subSet : subSets){\n\t\t\tif(!preMap.containsKey(subSet)){\n\t\t\t\tflag = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn flag;\n\t}", "public boolean drill(int edge, int layer, int slice, int flags) throws EdgeOutOfRangeException, LayerOutOfRangeException, SliceOutOfRangeException, DataDirectorException {\n return true;\n }", "PlaneSubset(final Plane plane) {\n this.plane = plane;\n }", "public Map getPartitionRestrictions() {\n\t\t\treturn this.partitionRestrictions;\n\t\t}", "public Map getPartitionRestrictions() {\n\t\t\treturn this.partitionRestrictions;\n\t\t}", "public void testGetColumnIndex() {\n TaskSeriesCollection c = createCollection1();\n }", "private boolean checkOverlap(int row, int col, int length){\n \tif(!inBounds(row,col)){\n \t\treturn false;\n \t}\n \tfor(int i = row; i < row + length; i++ ){\n\t\t\tfor(int j = col; j < col + length; j++){\n\t\t\t\tif(grid[i][col] == 1 || row + length >= 10)\n\t\t\t\t\treturn false;\n\t\t\t\tif(grid[row][j] == 1 || col + length >= 10)\n\t\t\t\t\treturn false;\n\t\t\t}\n \t\t\n \t}\n \treturn true;\n }", "@Override\n public boolean onClusterClick(Cluster<Parking> cluster) {\n Toast.makeText(this, \"cluster clicked\", Toast.LENGTH_SHORT).show();\n\n // Zoom in the cluster. Need to create LatLngBounds and including all the cluster items\n // inside of bounds, then animate to center of the bounds.\n\n // Create the builder to collect all essential cluster items for the bounds.\n LatLngBounds.Builder builder = LatLngBounds.builder();\n for (ClusterItem item : cluster.getItems()) {\n builder.include(item.getPosition());\n }\n // Get the LatLngBounds\n final LatLngBounds bounds = builder.build();\n\n // Animate camera to the bounds\n try {\n getMap().animateCamera(CameraUpdateFactory.newLatLngBounds(bounds, 100));\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n return true;\n }", "private static boolean isCut(Spreadsheet ss) {\r\n \t\treturn Boolean.valueOf( (Boolean)ss.getAttribute(KEY_IS_CUT) ); //if attr is null return false\r\n \t}", "List<Collect> selectByExampleWithRowbounds(CollectExample example, RowBounds rowBounds);", "@Test\n public void computeResult_resultAlwaysInsideProvidedBoundaries() {\n int datasetSize = 10;\n for (int i = 0; i < 100; ++i) {\n Random random = new Random();\n double lower = random.nextDouble() * 100;\n double upper = lower + random.nextDouble() * 100;\n\n variance =\n BoundedVariance.builder()\n .epsilon(EPSILON)\n .noise(new LaplaceNoise())\n .maxPartitionsContributed(1)\n .maxContributionsPerPartition(1)\n .lower(lower)\n .upper(upper)\n .build();\n\n List<Double> dataset =\n random\n .doubles()\n .map(x -> x * 300 * getRandomSign(random))\n .limit(datasetSize)\n .boxed()\n .collect(toImmutableList());\n\n variance.addEntries(dataset);\n\n assertWithMessage(\n \"lower = %s\\nupper = %s\\ndataset = [%s]\",\n lower, upper, dataset.stream().map(x -> Double.toString(x)).collect(joining(\",\\n\")))\n .that(variance.computeResult())\n .isIn(Range.closed(0.0, (upper - lower) * (upper - lower) / 4.0));\n }\n }", "@Override\n public boolean isInBounds(int row, int col) {\n return row >= 0 && row < grid.length && col >= 0 && col < grid[0].length;\n }", "List<Online> selectByExampleWithRowbounds(OnlineExample example, RowBounds rowBounds);", "public int getSliceMemberCount(int edge, int slice) throws EdgeOutOfRangeException, SliceOutOfRangeException {\n if (edge==DataDirector.PAGE_EDGE)\n return 0;\n else\n return 1;\n }", "public boolean percolates() {\n for (int i = 0; i < size; i++) {\r\n if (flowGrid[size * (size - 1) + i] < size) { // if any of the bottom row points at any of the index in the top row\r\n return true;\r\n }\r\n }\r\n return false;\r\n }", "@Test\n\tpublic void testEliminationByColumn(){\n\t\tsetBoardUp();\n\t\tColumn col = new Column(board, 1);\n\t\tint[] toBeRemoved = {1, 3, 4};\n\t\tint[] fromCesll = {1, 2, 3, 5, 6, 8};\n\t\talgorithm.applyEliminationInColumn(col);\n\t\tboolean condition = true;\n\t\tfor(int i = 0; i < toBeRemoved.length; i++)\n\t\t\tfor(int j = 0; j < fromCesll.length; j++)\n\t\t\t\tcondition &= !col.cell[fromCesll[j]].possibilities.contains(toBeRemoved[i]);\t\t\n\t\tassertTrue(condition);\n\t}", "@Test\n public void whereNormalColumn() throws Exception {\n String sql = \"desc verbose select k1, e1 from db1.tbl1 lateral view explode_split(k2, \\\",\\\") tmp as e1 \"\n + \"where k1=1; \";\n String explainString = UtFrameUtils.getSQLPlanOrErrorMsg(ctx, sql, true);\n Assert.assertTrue(explainString.contains(\"1:TABLE FUNCTION NODE\"));\n Assert.assertTrue(explainString.contains(\"table function: explode_split(`k2`, ',')\"));\n Assert.assertTrue(explainString.contains(\"tuple ids: 0 1\"));\n Assert.assertTrue(explainString.contains(\"TupleDescriptor{id=1, tbl=tmp, byteSize=32, materialized=true}\"));\n Assert.assertTrue(explainString.contains(\"SlotDescriptor{id=1, col=e1, type=VARCHAR(*)}\"));\n Assert.assertTrue(explainString.contains(\"0:OlapScanNode\"));\n Assert.assertTrue(explainString.contains(\"PREDICATES: `k1` = 1\"));\n }", "@Override\n public boolean isUsableIndex(int idx) {\n if ( idx < 0 )\n return false;\n if ( idx >= numDataCols )\n return false;\n return Boolean.TRUE.equals(standardized[idx]);\n }", "protected boolean applySubsetRule(Node value) {\n\n int type;\n int sizeParents;\n boolean isAppliedRule = false;\n Node auxI;\n Node auxJ;\n int i;\n NodeList auxNodeList = new NodeList();\n Node auxNode;\n\n\n //If the subset rule is forbidden then the methods finishes\n if (canApplySubsetRule == false) {\n return false;\n } else {\n\n type = value.getKindOfNode();\n\n if (type == Node.UTILITY) {\n return false;\n } else {//(type == Node.SUPER_VALUE)\n NodeList parents = diag.parents(value);\n sizeParents = parents.size();\n\n //See if subset rule can be applied to some ancestors\t\t\t\n for (i = 0; (i < sizeParents) && (isAppliedRule == false); i++) {\n isAppliedRule = applySubsetRule(parents.elementAt(i));\n }\n if (isAppliedRule) {\n indexOperation++;\n try {\n diag.save(\"debug-operation-\" + indexOperation + \".elv\");\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n }\n if (isAppliedRule == false) {\n //See if subset rule can be applied to two utility parents\n for (i = 0; (i < sizeParents - 1) && (isAppliedRule == false); i++) {\n auxI = parents.elementAt(i);\n if (auxI.getKindOfNode() == Node.UTILITY) {\n for (int j = i + 1; (j < sizeParents) && (isAppliedRule == false); j++) {\n auxJ = parents.elementAt(j);\n if (auxJ.getKindOfNode() == Node.UTILITY) {\n if (verifySubsetRule(auxI, auxJ)) {\n String operation =\n \"Apply subset rule to: \" + auxI.getName() + \" and \" + auxJ.getName();\n\n statistics.addOperation(operation);\n System.out.println(operation);\n\n auxNodeList.insertNode(auxI);\n auxNodeList.insertNode(auxJ);\n auxNode = introduceSVNode(auxNodeList, value);\n System.out.println(\"Nodo introducido por la subset rule anterior: \" + auxNode.getName());\n ReductionAndEvalID.reduceNode((IDWithSVNodes) diag, auxNode);\n System.out.println(\"Reducción del nodo: \" + auxNode.getName());\n\n statistics.addSize(diag.calculateSizeOfPotentials());\n statistics.addTime(crono.getTime());\n\n\n isAppliedRule = true;\n\n indexOperation++;\n try {\n diag.save(\"debug-operation-\" + indexOperation + \".elv\");\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n\n\n }\n }\n }\n }\n }\n\n }\n }\n\n return isAppliedRule;\n }\n }", "public DeleteCollectionClusterOperator limit(Number limit) {\n put(\"limit\", limit);\n return this;\n }", "@ParameterizedTest\n @ArgumentsSource(TestForestProvider.class)\n public void testMultipleAttributions(RandomCutForest forest) {\n int hardPass=0;\n int causal=0;\n double [] point ={6.0,0.0,0.0};\n DiVector result = forest.getAnomalyAttribution(point);\n assertTrue(result.low[0] < 0.2);\n if (result.getHighLowSum(1) < 0.5) ++hardPass;\n if (result.getHighLowSum(2) < 0.5) ++hardPass;\n assertTrue(result.getHighLowSum(1) + result.getHighLowSum(2) < 1.0);\n assertTrue(result.high[0] > forest.getAnomalyScore(point)/3);\n if (result.high[0] > 0.5 * forest.getAnomalyScore(point)) ++causal;\n\n // the last line states that first coordinate was high and was a majority contributor to the score\n // the previous test states that the contribution is twice the average of the 12 possible contributors.\n // these tests all subparts of the score at once\n\n point=new double [] {-6.0,0.0,0.0};\n result = forest.getAnomalyAttribution(point);\n assertTrue(result.getHighLowSum()>1.0);\n assertTrue(result.high[0] < 0.5);\n if (result.getHighLowSum(1) < 0.5) ++hardPass;\n if (result.getHighLowSum(2) < 0.5) ++hardPass;\n assertTrue(result.low[0] > forest.getAnomalyScore(point)/3);\n if (result.low[0] > 0.5 * forest.getAnomalyScore(point)) ++causal;\n\n\n point=new double [] {0.0,6.0,0.0};\n assertTrue(result.getHighLowSum()>1.0);\n result = forest.getAnomalyAttribution(point);\n if (result.getHighLowSum(0) < 0.5) ++hardPass;\n if (result.getHighLowSum(2) < 0.5) ++hardPass;\n assertTrue(result.low[1] < 0.5);\n assertTrue(result.high[1] > forest.getAnomalyScore(point)/3);\n if (result.high[1] > 0.5 * forest.getAnomalyScore(point)) ++causal;\n\n\n point=new double [] {0.0,-6.0,0.0};\n assertTrue(result.getHighLowSum()>1.0);\n result = forest.getAnomalyAttribution(point);\n if (result.getHighLowSum(0) < 0.5) ++hardPass;\n if (result.getHighLowSum(2) < 0.5) ++hardPass;\n assertTrue(result.high[1] < 0.5);\n assertTrue(result.low[1] > forest.getAnomalyScore(point)/3);\n if (result.low[1] > 0.5 * forest.getAnomalyScore(point)) ++causal;\n\n\n point=new double [] {0.0,0.0,6.0};\n assertTrue(result.getHighLowSum()>1.0);\n result = forest.getAnomalyAttribution(point);\n if (result.getHighLowSum(0) < 0.5) ++hardPass;\n if (result.getHighLowSum(1) < 0.5) ++hardPass;\n assertTrue(result.low[2] < 0.5);\n assertTrue(result.high[2] > forest.getAnomalyScore(point)/3);\n if (result.high[2] > 0.5 * forest.getAnomalyScore(point)) ++causal;\n\n point=new double [] {0.0,0.0,-6.0};\n assertTrue(result.getHighLowSum()>1.0);\n result = forest.getAnomalyAttribution(point);\n if (result.getHighLowSum(0) < 0.5) ++hardPass;\n if (result.getHighLowSum(1) < 0.5) ++hardPass;\n assertTrue(result.high[2] < 0.5);\n assertTrue(result.low[2] > forest.getAnomalyScore(point)/3);\n if (result.low[2] > 0.5 * forest.getAnomalyScore(point)) ++causal;\n\n\n assertTrue(causal>=5); // maximum is 6; there can be skew in one direction\n\n point=new double [] {-3.0,0.0,0.0};\n result = forest.getAnomalyAttribution(point);\n assertTrue(result.high[0] < 0.5);\n if (result.getHighLowSum(1) < 0.5) ++hardPass;\n if (result.getHighLowSum(2) < 0.5) ++hardPass;\n assertTrue(result.low[0] >\n forest.getAnomalyScore(point)/3);\n\n /* For multiple causes, the relationship of scores only hold for larger\n * distances.\n */\n\n point=new double [] {-3.0,6.0,0.0};\n assertTrue(result.getHighLowSum()>1.0);\n result = forest.getAnomalyAttribution(point);\n if (result.low[0] > 0.5) ++hardPass;\n assertTrue(result.high[0] < 0.5);\n assertTrue(result.low[1] < 0.5);\n assertTrue(result.high[1] > 0.5);\n if (result.high[1]>0.9) ++hardPass;\n assertTrue(result.getHighLowSum(2)< 0.5);\n assertTrue(result.high[1]+result.low[0]>\n 0.8*forest.getAnomalyScore(point));\n\n point=new double [] {6.0,-3.0,0.0};\n assertTrue(result.getHighLowSum()>1.0);\n result = forest.getAnomalyAttribution(point);\n assertTrue(result.low[0] < 0.5);\n assertTrue(result.high[0] > 0.5);\n if (result.high[0]>0.9) ++hardPass;\n if (result.low[1] > 0.5) ++hardPass;\n assertTrue(result.high[1] < 0.5);\n assertTrue(result.getHighLowSum(2) < 0.5);\n assertTrue(result.high[0]+result.low[1]>\n 0.8*forest.getAnomalyScore(point));\n\n point=new double [] {20.0,-10.0,0.0};\n assertTrue(result.getHighLowSum()>1.0);\n result = forest.getAnomalyAttribution(point);\n assertTrue(result.high[0]+result.low[1]>\n 0.8*forest.getAnomalyScore(point));\n if (result.high[0]>1.8*result.low[1]) ++hardPass;\n if (result.low[1]>result.high[0]/2.2) ++hardPass;\n\n assertTrue(hardPass>=15); //maximum is 20\n }", "DataFrame<R,C> select(Predicate<DataFrameRow<R,C>> rowPredicate, Predicate<DataFrameColumn<R,C>> colPredicate);", "public abstract boolean isRestricted();", "public boolean isProperSubset(/*@ non_null @*/ JMLObjectSet<E> s2) {\n return size < s2.int_size() && isSubset(s2);\n }", "private boolean outOfBounds(int nidx1){\n\t\treturn (nidx1 < 0 || nidx1 >= numofvert);\n\t}" ]
[ "0.69050986", "0.68582433", "0.68553466", "0.673374", "0.6673362", "0.6672858", "0.6641989", "0.65723604", "0.6481072", "0.6337122", "0.62584287", "0.6246907", "0.60668314", "0.57359785", "0.5690934", "0.56857824", "0.5592548", "0.5509543", "0.54721624", "0.52888", "0.5213097", "0.5203902", "0.52026373", "0.5193771", "0.513301", "0.5131325", "0.5100503", "0.5095245", "0.50581425", "0.5034453", "0.50125104", "0.49964565", "0.49679908", "0.49637517", "0.49485305", "0.49364617", "0.491861", "0.49100655", "0.48976496", "0.48931006", "0.4888427", "0.48824507", "0.4832222", "0.48317286", "0.48048916", "0.48047525", "0.4796679", "0.47532257", "0.47475144", "0.47440073", "0.4732458", "0.4731944", "0.47141543", "0.471381", "0.469851", "0.46961945", "0.46938804", "0.46850878", "0.46717682", "0.4668492", "0.4667195", "0.46648684", "0.46608302", "0.46584553", "0.4652565", "0.46407574", "0.46381867", "0.46381867", "0.4632759", "0.46161976", "0.46068683", "0.4590442", "0.45888147", "0.45880672", "0.45870697", "0.4585609", "0.4577657", "0.45769316", "0.45767322", "0.45767322", "0.45530808", "0.4547704", "0.45460618", "0.45402098", "0.453871", "0.4538504", "0.45349282", "0.45299372", "0.45290044", "0.45230195", "0.45110095", "0.45069635", "0.45035148", "0.44984582", "0.44838947", "0.44691232", "0.44626996", "0.44564173", "0.44418174", "0.44409075" ]
0.68287116
3
Test slice restriction (e.g 'clustering_0 > 1') with only one descending clustering column
@Test public void testBoundsAsCompositesWithSliceRestrictionsAndOneDescendingClusteringColumn() { CFMetaData cfMetaData = newCFMetaData(Sort.DESC, Sort.DESC); ByteBuffer value1 = ByteBufferUtil.bytes(1); ByteBuffer value2 = ByteBufferUtil.bytes(2); Restriction slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1); PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(slice); List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertEmptyComposite(bounds.get(0)); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value1, EOC.START); slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1); restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(slice); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertEmptyComposite(bounds.get(0)); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value1, EOC.END); slice = newSingleSlice(cfMetaData, 0, Bound.END, true, value1); restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(slice); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value1, EOC.NONE); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertEmptyComposite(bounds.get(0)); slice = newSingleSlice(cfMetaData, 0, Bound.END, false, value1); restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(slice); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value1, EOC.END); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertEmptyComposite(bounds.get(0)); slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1); Restriction slice2 = newSingleSlice(cfMetaData, 0, Bound.END, false, value2); restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(slice).mergeWith(slice2); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value2, EOC.END); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value1, EOC.START); slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1); slice2 = newSingleSlice(cfMetaData, 0, Bound.END, true, value2); restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(slice).mergeWith(slice2); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value2, EOC.NONE); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value1, EOC.END); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneDescendingAndOneAscendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0) > (1) AND (clustering_0, clustering1) < (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.END);\n assertComposite(bounds.get(2), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.END);\n assertComposite(bounds.get(1), value1, EOC.START);\n assertComposite(bounds.get(2), value1, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneAscendingAndOneDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n assertComposite(bounds.get(2), value2, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertComposite(bounds.get(1), value2, EOC.START);\n assertComposite(bounds.get(2), value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithTwoDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsMixingAscendingDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.DESC, Sort.ASC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(3));\n\n // clustering_0 = 1 AND (clustering_1, clustering_2, clustering_3) > (2, 3, 4)\n Restriction eq = newSingleEq(cfMetaData, 0, value1);\n slice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n restrictions = restrictions.mergeWith(eq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(3));\n\n\n // (clustering_0, clustering1, clustering_2, clustering_3) <= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, value4, EOC.NONE);\n assertComposite(bounds.get(3), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) < (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(3), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4) AND (clustering_0, clustering_1) < (2, 3)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2, value3);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(5, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n assertComposite(bounds.get(4), value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(5, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertComposite(bounds.get(3), value2, EOC.START);\n assertComposite(bounds.get(4), value2, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4) AND (clustering_0, clustering1, clustering_2, clustering_3) <= (4, 3, 2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value4, value3, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(7, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n assertComposite(bounds.get(4), value4, value3, EOC.START);\n assertComposite(bounds.get(5), value4, value3, value2, value1, EOC.NONE);\n assertComposite(bounds.get(6), value4, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(7, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertComposite(bounds.get(3), value4, EOC.START);\n assertComposite(bounds.get(4), value4, value3, value2, EOC.START);\n assertComposite(bounds.get(5), value4, value3, value2, EOC.END);\n assertComposite(bounds.get(6), value4, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithTwoClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithTwoAscendingAndTwoDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.DESC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertEmptyComposite(bounds.get(1));\n\n // clustering_0 = 1 AND (clustering_1, clustering_2, clustering_3) > (2, 3, 4)\n Restriction eq = newSingleEq(cfMetaData, 0, value1);\n slice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n restrictions = restrictions.mergeWith(eq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2, clustering_3) > (2, 3, 4)\n Restriction in = newSingleIN(cfMetaData, 0, value1, value2);\n slice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n restrictions = restrictions.mergeWith(in);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n assertComposite(bounds.get(2), value2, value2, EOC.START);\n assertComposite(bounds.get(3), value2, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n assertComposite(bounds.get(2), value2, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(3), value2, EOC.END);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1, clustering_2, clustering_3) <= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) < (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4) AND (clustering_0, clustering_1) < (2, 3)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2, value3);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(1), value2, value3, EOC.START);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4) AND (clustering_0, clustering1, clustering_2, clustering_3) <= (4, 3, 2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value4, value3, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n assertComposite(bounds.get(2), value4, value3, value2, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(1), value4, value3, EOC.START);\n assertComposite(bounds.get(2), value4, value3, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneDescendingClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithSliceRestrictionsAndOneClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newSingleSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newSingleSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithSingleEqAndSliceRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n ByteBuffer value5 = ByteBufferUtil.bytes(5);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) > (2, 3)\n Restriction singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction multiSlice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiSlice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) > (2, 3) AND (clustering_1) < (4)\n singleEq = newSingleEq(cfMetaData, 0, value1);\n multiSlice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3);\n Restriction multiSlice2 = newMultiSlice(cfMetaData, 1, Bound.END, false, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiSlice2).mergeWith(singleEq).mergeWith(multiSlice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value4, EOC.START);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) => (2, 3) AND (clustering_1, clustering_2) <= (4, 5)\n singleEq = newSingleEq(cfMetaData, 0, value1);\n multiSlice = newMultiSlice(cfMetaData, 1, Bound.START, true, value2, value3);\n multiSlice2 = newMultiSlice(cfMetaData, 1, Bound.END, true, value4, value5);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiSlice2).mergeWith(singleEq).mergeWith(multiSlice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value4, value5, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithOneEqRestrictionsAndOneClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC);\n\n ByteBuffer clustering_0 = ByteBufferUtil.bytes(1);\n Restriction eq = newSingleEq(cfMetaData, 0, clustering_0);\n\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiEqAndSingleSliceRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n\n // (clustering_0, clustering_1) = (1, 2) AND clustering_2 > 3\n Restriction multiEq = newMultiEq(cfMetaData, 0, value1, value2);\n Restriction singleSlice = newSingleSlice(cfMetaData, 2, Bound.START, false, value3);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiEq).mergeWith(singleSlice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithOneEqRestrictionsAndTwoClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer clustering_0 = ByteBufferUtil.bytes(1);\n Restriction eq = newSingleEq(cfMetaData, 0, clustering_0);\n\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.END);\n }", "@Test\n public void testHardClustersWithOverlappingPartitions()\n {\n check(hardClustersWithOverlappingPartitions(), 0.0, 1.0);\n }", "public interface IStoppingCriteria {\n\n /**\n * Determine the degree of clustering agreement\n * @param cluster1 one clustering results\n * @param cluster2 the other clustering results\n * @return the degree of clustering agreement; 1 refers to be the same clustering results; 0 refers to be the totally different clustering results\n */\n public double computeSimilarity(int[] cluster1, int[] cluster2);\n\n}", "@Test\n public void testOverlappingPartitionsOverlappingClusters()\n {\n check(overlappingClustersWithOverlappingPartitions(), 0.75, 1.0);\n }", "@Test\n public void testBoundsAsCompositesWithEqAndSliceRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n\n Restriction eq = newSingleEq(cfMetaData, 0, value3);\n\n Restriction slice = newSingleSlice(cfMetaData, 1, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 1, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 1, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 1, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 1, Bound.START, false, value1);\n Restriction slice2 = newSingleSlice(cfMetaData, 1, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value2, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 1, Bound.START, true, value1);\n slice2 = newSingleSlice(cfMetaData, 1, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value2, EOC.END);\n }", "public void decideCluster(){\n\tdouble shortest = 1000000;\n\tfor(int i = 0; i < clusterDist.length; i++)\n\t{\n\t\tif(clusterDist[i] < shortest)\n\t\t{\tshortest = clusterDist[i];\n\t\t\tthis.clusterid = i;\n\t\t}\n\t\t\n\t}\n}", "boolean hasPartitionLimit();", "@Test\n public void testBoundsAsCompositesWithSingleEqAndMultiEqRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) = (2, 3)\n Restriction singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction multiEq = newMultiEq(cfMetaData, 1, value2, value3);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiEq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n // clustering_0 = 1 AND clustering_1 = 2 AND (clustering_2, clustering_3) = (3, 4)\n singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction singleEq2 = newSingleEq(cfMetaData, 1, value2);\n multiEq = newMultiEq(cfMetaData, 2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(singleEq2).mergeWith(multiEq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n\n // (clustering_0, clustering_1) = (1, 2) AND clustering_2 = 3\n singleEq = newSingleEq(cfMetaData, 2, value3);\n multiEq = newMultiEq(cfMetaData, 0, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiEq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) = (2, 3) AND clustering_3 = 4\n singleEq = newSingleEq(cfMetaData, 0, value1);\n singleEq2 = newSingleEq(cfMetaData, 3, value4);\n multiEq = newMultiEq(cfMetaData, 1, value2, value3);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiEq).mergeWith(singleEq2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithOneInRestrictionsAndOneClusteringColumn()\n {\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n Restriction in = newSingleIN(cfMetaData, 0, value1, value2, value3);\n\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(in);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.START);\n assertComposite(bounds.get(2), value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n assertComposite(bounds.get(1), value2, EOC.END);\n assertComposite(bounds.get(2), value3, EOC.END);\n }", "boolean hasCluster();", "private static Restriction newSingleSlice(CFMetaData cfMetaData, int index, Bound bound, boolean inclusive, ByteBuffer value)\n {\n ColumnDefinition columnDef = getClusteringColumnDefinition(cfMetaData, index);\n return new SingleColumnRestriction.Slice(columnDef, bound, inclusive, toTerm(value));\n }", "boolean getIsClusteringKey();", "default DiscreteSet2D subLevelSet(double value) {\r\n\t\treturn pointsSatisfying(d -> d <= value);\r\n\t}", "public boolean percolates()\r\n { return uf.find(0) == uf.find(dimension*dimension + 1); }", "public void testLearnFullDimensions()\n {\n RandomSubVectorThresholdLearner<String> instance = new RandomSubVectorThresholdLearner<>(\n new VectorThresholdInformationGainLearner<String>(),\n 0.9999, random);\n\n \n VectorFactory<?> vectorFactory = VectorFactory.getDefault();\n ArrayList<InputOutputPair<Vector, String>> data = new ArrayList<>();\n for (int i = 0; i < 10; i++)\n {\n data.add(new DefaultInputOutputPair<>(vectorFactory.createUniformRandom(\n 100, 1.0, 10.0, random), \"a\"));\n }\n\n for (int i = 0; i < 10; i++)\n {\n data.add(new DefaultInputOutputPair<>(vectorFactory.createUniformRandom(\n 100, 1.0, 10.0, random), \"b\"));\n }\n\n VectorElementThresholdCategorizer result = instance.learn(data);\n assertTrue(result.getIndex() >= 0);\n assertTrue(result.getIndex() < 100);\n \n // Change the dimensions to consider.\n instance.setDimensionsToConsider(new int[] {10});\n\n result = instance.learn(data);\n assertTrue(result.getIndex() == 10);\n }", "public static boolean shouldProcessSlice(OBSlice x) throws Exception {\n return x.size() <= maxSliceSize;\n }", "@Test(timeout = 4000)\n public void test03() throws Throwable {\n Discretize discretize0 = new Discretize();\n discretize0.setAttributeIndices(\"\");\n Filter.makeCopy(discretize0);\n discretize0.setDesiredWeightOfInstancesPerInterval(2.0);\n boolean boolean0 = true;\n discretize0.m_ClassIndex = 0;\n discretize0.setUseBinNumbers(true);\n discretize0.listOptions();\n discretize0.makeBinaryTipText();\n discretize0.getInvertSelection();\n // Undeclared exception!\n try { \n discretize0.calculateCutPointsByEqualWidthBinning((-458));\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"weka.filters.unsupervised.attribute.Discretize\", e);\n }\n }", "public void testGetSubDimensionality()\n {\n RandomSubVectorThresholdLearner<String> instance = new RandomSubVectorThresholdLearner<String>();\n\n instance.setPercentToSample(0.5);\n assertEquals(5, instance.getSubDimensionality(10));\n\n instance.setPercentToSample(0.25);\n assertEquals(2, instance.getSubDimensionality(9));\n\n instance.setPercentToSample(1.0);\n assertEquals(9, instance.getSubDimensionality(9));\n\n instance.setPercentToSample(0.0);\n assertEquals(1, instance.getSubDimensionality(9));\n }", "private static Restriction newMultiSlice(CFMetaData cfMetaData, int firstIndex, Bound bound, boolean inclusive, ByteBuffer... values)\n {\n List<ColumnDefinition> columnDefinitions = new ArrayList<>();\n for (int i = 0; i < values.length; i++)\n {\n columnDefinitions.add(getClusteringColumnDefinition(cfMetaData, i + firstIndex));\n }\n return new MultiColumnRestriction.Slice(columnDefinitions, bound, inclusive, toMultiItemTerminal(values));\n }", "boolean isNeedSharding();", "private boolean isSubsetOf(int firstRow, int secondRow) {\n for (int i = 0; i < universalSetSize; i++) {\n if (input[firstRow][i] && !input[secondRow][i]) {\n return false;\n }\n }\n return true;\n }", "@Test\n\tpublic void testGetSlice() {\n\t}", "boolean hasPermissionOfCluster(String clusterId, String userName);", "@Test\n\t public void test_Is_Subset_Negative() throws Exception{\t\n\t\t SET setarray= new SET( new int[]{1,2,3,4,5});\n\t\t SET subsetarray= new SET( new int[]{7,8});\n\t\t assertFalse(setarray.isSubSet(subsetarray));\t \n\t }", "@Test\n public void testBoundsAsCompositesWithSingleEqAndMultiINRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n ByteBuffer value5 = ByteBufferUtil.bytes(5);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) IN ((2, 3), (4, 5))\n Restriction singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction multiIN = newMultiIN(cfMetaData, 1, asList(value2, value3), asList(value4, value5));\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiIN);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(1), value1, value4, value5, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(1), value1, value4, value5, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) IN ((2, 3))\n singleEq = newSingleEq(cfMetaData, 0, value1);\n multiIN = newMultiIN(cfMetaData, 1, asList(value2, value3));\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiIN).mergeWith(singleEq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n // clustering_0 = 1 AND clustering_1 = 5 AND (clustering_2, clustering_3) IN ((2, 3), (4, 5))\n singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction singleEq2 = newSingleEq(cfMetaData, 1, value5);\n multiIN = newMultiIN(cfMetaData, 2, asList(value2, value3), asList(value4, value5));\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiIN).mergeWith(singleEq2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value5, value2, value3, EOC.START);\n assertComposite(bounds.get(1), value1, value5, value4, value5, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value5, value2, value3, EOC.END);\n assertComposite(bounds.get(1), value1, value5, value4, value5, EOC.END);\n }", "protected void checkSlice(int slice) {\n\tif (slice < 0 || slice >= slices) throw new IndexOutOfBoundsException(\"Attempted to access \"+toStringShort()+\" at slice=\"+slice);\n}", "public boolean percolates() {\n for (int i = 0; i < size; i++) {\r\n if (flowGrid[size * (size - 1) + i] < size) { // if any of the bottom row points at any of the index in the top row\r\n return true;\r\n }\r\n }\r\n return false;\r\n }", "private int restrictSection(Message msg, String parameter) {\n int sec = Integer.parseInt(parameter);\n\n if(sec > 2) {\n MessageChannel ch = msg.getChannel();\n ch.sendMessage(\"`Error: Invalid query [section not 0-2]. Query terminated.`\").queue();\n return -1;\n }\n else if(sec == 2) {\n partTwo = true;\n upperProblem = 8;\n }\n\n return sec;\n }", "public boolean drill(int edge, int layer, int slice, int flags) throws EdgeOutOfRangeException, LayerOutOfRangeException, SliceOutOfRangeException, DataDirectorException {\n return true;\n }", "public boolean isReviewed(int index) {\n if (index % 2 != 0) {\n index -= 1;\n }\n index = index / 2;\n if ( ( (Integer) clusters[index][3]).intValue() == 1) {\n return true;\n }\n else {\n return false;\n }\n }", "public List<ParameterValueObject> getClustering(Filter filter);", "@Override\n public boolean onClusterClick(Cluster<Person> cluster) {\n LatLngBounds.Builder builder = LatLngBounds.builder();\n for (ClusterItem item : cluster.getItems()) {\n builder.include(item.getPosition());\n }\n // Get the LatLngBounds\n final LatLngBounds bounds = builder.build();\n\n // Animate camera to the bounds\n try {\n getMap().animateCamera(CameraUpdateFactory.newLatLngBounds(bounds, 100));\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n return true;\n }", "boolean isAllowClusterGet();", "protected int _sliceOffset(int absRank) {\n\treturn absRank;\n}", "boolean isSliceParent();", "Boolean isCollinearTo(IVec3 v);", "private static boolean sliceIsValid(final int[] slice, final int flowOrderLength) {\n int consecutiveZeros = 0;\n for ( int key : slice ) {\n if ( key != 0 ) {\n consecutiveZeros = 0;\n } else {\n consecutiveZeros++;\n if ( consecutiveZeros >= (flowOrderLength - 1) ) {\n return false;\n }\n }\n }\n\n // if here, not found -> valid\n return true;\n }", "static public int getAtLeastKVisitors(int[][] rectangles, int k) {\n\n if(rectangles.length==0)\n return 0;\n if(k > rectangles.length)\n return 0;\n\n TreeSet<Rectangle> avlTree = new TreeSet<>();//To store the rectangles ordered\n TreeSet<Integer> Ys = new TreeSet<>();\n\n for(int[] coordinates: rectangles) {\n //x2 = x2 + 1 , y2 = y2 +1 for the inclusive constraints\n Rectangle r = new Rectangle(coordinates[0], coordinates[1], coordinates[2]+1, coordinates[3]+1);\n avlTree.add(r);\n if(!Ys.contains(r.getY1()))\n Ys.add(r.getY1());\n if(!Ys.contains(r.getY2()))\n Ys.add(r.getY2());\n }\n\n int ans = 0;\n Iterator<Integer> yIterator = Ys.iterator();\n int previousY = yIterator.next();\n\n //Traverse by slices of Y's\n while(yIterator.hasNext()) {\n\n int currentY = yIterator.next();\n List<int[]> segments = new ArrayList<>();\n Iterator<Rectangle> treeIterator = avlTree.iterator();\n\n //Look for the rectangles that fall in the slice and create a segment's list\n while(treeIterator.hasNext()) {\n Rectangle r = treeIterator.next();\n //We stop traversing the tree once the rectangles are completely above the slice\n if(r.getY1()>currentY)\n break;\n if(r.getY1()<= previousY && r.getY2()>=currentY) {\n int[] segmentL = new int[2]; int[] segmentR = new int[2];\n segmentL[0] = r.getX1(); segmentL[1] = Type.OPEN.getValue();\n segmentR[0] = r.getX2(); segmentR[1] = Type.CLOSED.getValue();\n segments.add(segmentL); segments.add(segmentR);\n }\n //We remove the rectangles that are left behind by the slice\n if(r.getY2() < previousY)\n treeIterator.remove();\n }\n\n //Sort the segments to analyze them\n Collections.sort(segments, (a, b) -> Integer.compare(a[0], b[0]));\n Iterator<int[]> it = segments.iterator();\n int[] segmentEnd, segmentStart = it.next();\n int nRectangles = Type.OPEN.getValue(); //The first interval will always be opening\n\n while(it.hasNext()) {\n segmentEnd = it.next();\n if(nRectangles >=k) {\n ans+= (currentY - previousY) * (segmentEnd[0] - segmentStart[0]);\n }\n segmentStart = segmentEnd;\n nRectangles += segmentEnd[1];\n }\n\n previousY = currentY;\n }\n\n return ans;\n }", "public int getSliceMemberCount(int edge, int slice) throws EdgeOutOfRangeException, SliceOutOfRangeException {\n if (edge==DataDirector.PAGE_EDGE)\n return 0;\n else\n return 1;\n }", "protected void checkBox(int slice, int row, int column, int depth, int height, int width) {\n\tif (slice<0 || depth<0 || slice+depth>slices || row<0 || height<0 || row+height>rows || column<0 || width<0 || column+width>columns) throw new IndexOutOfBoundsException(toStringShort()+\", slice:\"+slice+\", row:\"+row+\" ,column:\"+column+\", depth:\"+depth+\" ,height:\"+height+\", width:\"+width);\n}", "@Test\n public void testMultiLevelPartitionPruning() throws SqlParseException {\n\n val project = \"multi_level_partition\";\n val dfId = \"747f864b-9721-4b97-acde-0aa8e8656cba\";\n val expectedRanges = Lists.<Pair<String, String>> newArrayList();\n val segmentRange1 = Pair.newPair(\"2012-01-01\", \"2012-01-02\");\n val segment1Uuid = \"8892fa3f-f607-4eec-8159-7c5ae2f16942\";\n val segmentRange2 = Pair.newPair(\"2012-01-02\", \"2012-01-03\");\n val segment2Uuid = \"d75a822c-788a-4592-a500-cf20186dded1\";\n val segmentRange3 = Pair.newPair(\"2012-01-03\", \"2012-01-04\");\n val segment3Uuid = \"54eaf96d-6146-45d2-b94e-d5d187f89919\";\n val segmentRange4 = Pair.newPair(\"2012-01-04\", \"2012-01-05\");\n val segment4Uuid = \"411f40b9-a80a-4453-90a9-409aac6f7632\";\n val segmentRange5 = Pair.newPair(\"2012-01-05\", \"2012-01-06\");\n val segment5Uuid = \"a8318597-cb75-416f-8eb8-96ea285dd2b4\";\n val expectedPartitionMap = Maps.<String, List<Long>> newHashMap();\n\n val sqlBase = \"select cal_dt, sum(price) from test_kylin_fact inner join test_account on test_kylin_fact.seller_id = test_account.account_id \";\n\n // no filter\n val noFilterSql = sqlBase + \"group by cal_dt\";\n expectedRanges.add(segmentRange1);\n expectedRanges.add(segmentRange2);\n expectedRanges.add(segmentRange3);\n expectedRanges.add(segmentRange4);\n expectedRanges.add(segmentRange5);\n expectedPartitionMap.put(segment1Uuid, Lists.newArrayList(0L, 1L, 2L, 3L));\n expectedPartitionMap.put(segment2Uuid, Lists.newArrayList(0L, 1L, 2L));\n expectedPartitionMap.put(segment3Uuid, Lists.newArrayList(1L, 2L, 3L));\n expectedPartitionMap.put(segment4Uuid, Lists.newArrayList(0L, 1L));\n expectedPartitionMap.put(segment5Uuid, Lists.newArrayList(2L, 3L));\n assertPrunedSegmentsRange(project, noFilterSql, dfId, expectedRanges, 1L, expectedPartitionMap);\n\n val andSql0 = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-04' and lstg_site_id = 1 group by cal_dt\";\n val andMappingSql0 = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-04' and lstg_format_name = 'FP-non GTC' group by cal_dt\";\n val andMixSql0 = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-04' and lstg_site_id = 1 and lstg_format_name = 'FP-non GTC' group by cal_dt\";\n expectedRanges.clear();\n expectedRanges.add(segmentRange1);\n expectedRanges.add(segmentRange2);\n expectedRanges.add(segmentRange3);\n expectedPartitionMap.clear();\n expectedPartitionMap.put(segment1Uuid, Lists.newArrayList(1L));\n expectedPartitionMap.put(segment2Uuid, Lists.newArrayList(1L));\n expectedPartitionMap.put(segment3Uuid, Lists.newArrayList(1L));\n assertPrunedSegmentsRange(project, andSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n assertPrunedSegmentsRange(project, andMappingSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n assertPrunedSegmentsRange(project, andMixSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n\n val notInSql0 = sqlBase\n + \"where cal_dt > '2012-01-02' and cal_dt < '2012-01-04' and lstg_site_id not in (0, 2, 3) group by cal_dt\";\n val notInMappingSql0 = sqlBase\n + \"where cal_dt > '2012-01-02' and cal_dt < '2012-01-04' and lstg_format_name not in ('FP-GTC', 'ABIN', 'Auction') group by cal_dt\";\n val notInMixSql0 = sqlBase\n + \"where cal_dt > '2012-01-02' and cal_dt < '2012-01-04' and lstg_site_id not in (0, 2, 3) and lstg_format_name not in ('FP-GTC', 'ABIN', 'Auction') group by cal_dt\";\n expectedRanges.clear();\n expectedRanges.add(segmentRange2);\n expectedRanges.add(segmentRange3);\n expectedPartitionMap.clear();\n expectedPartitionMap.put(segment2Uuid, Lists.newArrayList(1L));\n expectedPartitionMap.put(segment3Uuid, Lists.newArrayList(1L));\n assertPrunedSegmentsRange(project, notInSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n assertPrunedSegmentsRange(project, notInMappingSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n assertPrunedSegmentsRange(project, notInMixSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n\n // return empty data case\n val emptyData = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-03' and lstg_site_id = 5 group by cal_dt\";\n val emptyDataMapping = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-03' and lstg_format_name = 'not_exist_name' group by cal_dt\";\n val emptyDataMix = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-03' and lstg_site_id = 5 and lstg_format_name = 'not_exist_name' group by cal_dt\";\n expectedRanges.clear();\n expectedPartitionMap.clear();\n assertPrunedSegmentsRange(project, emptyData, dfId, expectedRanges, -1L, expectedPartitionMap);\n assertPrunedSegmentsRange(project, emptyDataMapping, dfId, expectedRanges, -1L, expectedPartitionMap);\n assertPrunedSegmentsRange(project, emptyDataMix, dfId, expectedRanges, -1L, expectedPartitionMap);\n\n // query data out of current built segments range\n val inSql0 = sqlBase\n + \"where cal_dt > '2011-12-30' and cal_dt < '2012-01-03' and lstg_site_id in (1, 2) group by cal_dt\";\n val inMappingSql0 = sqlBase\n + \"where cal_dt > '2011-12-30' and cal_dt < '2012-01-03' and lstg_format_name in ('FP-non GTC', 'ABIN') group by cal_dt\";\n val inMixSql0 = sqlBase\n + \"where cal_dt > '2011-12-30' and cal_dt < '2012-01-03' and lstg_site_id in (1, 2) and lstg_format_name in ('FP-non GTC', 'ABIN') group by cal_dt\";\n expectedRanges.add(segmentRange1);\n expectedRanges.add(segmentRange2);\n expectedPartitionMap.put(segment1Uuid, Lists.newArrayList(1L, 2L));\n expectedPartitionMap.put(segment2Uuid, Lists.newArrayList(1L, 2L));\n assertPrunedSegmentsRange(project, inSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n assertPrunedSegmentsRange(project, inMappingSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n assertPrunedSegmentsRange(project, inMixSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n\n val pushDownSql0 = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-03' and lstg_site_id = 3 group by cal_dt\";\n assertNoRealizationFound(project, pushDownSql0);\n\n val pushDownMappingSql0 = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-03' and lstg_format_name = 'Auction' group by cal_dt\";\n assertNoRealizationFound(project, pushDownMappingSql0);\n\n val pushDownMixSql0 = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-03' and lstg_site_id = 3 and lstg_format_name = 'Auction' group by cal_dt\";\n assertNoRealizationFound(project, pushDownMixSql0);\n\n // return empty result\n val wrongMapping0 = sqlBase\n + \"where cal_dt between '2012-01-01' and '2012-01-02' and lstg_site_id = 0 and lstg_format_name = 'FP-non GTC' group by cal_dt\";\n assertPrunedSegmentsRange(project, wrongMapping0, dfId, null, -1L, null);\n\n val orSql0 = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-02' and (lstg_site_id = 0 or lstg_format_name = 'FP-non GTC') group by cal_dt\";\n expectedRanges.clear();\n expectedPartitionMap.clear();\n expectedRanges.add(segmentRange1);\n expectedPartitionMap.put(segment1Uuid, Lists.newArrayList(0L, 1L));\n assertPrunedSegmentsRange(project, orSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n }", "@Test\n\tpublic void testEliminationByColumn(){\n\t\tsetBoardUp();\n\t\tColumn col = new Column(board, 1);\n\t\tint[] toBeRemoved = {1, 3, 4};\n\t\tint[] fromCesll = {1, 2, 3, 5, 6, 8};\n\t\talgorithm.applyEliminationInColumn(col);\n\t\tboolean condition = true;\n\t\tfor(int i = 0; i < toBeRemoved.length; i++)\n\t\t\tfor(int j = 0; j < fromCesll.length; j++)\n\t\t\t\tcondition &= !col.cell[fromCesll[j]].possibilities.contains(toBeRemoved[i]);\t\t\n\t\tassertTrue(condition);\n\t}", "@Override\n public boolean onClusterClick(Cluster<Company> cluster) {\n LatLngBounds.Builder builder = LatLngBounds.builder();\n for (ClusterItem item : cluster.getItems()) {\n builder.include(item.getPosition());\n }\n // Get the LatLngBounds\n final LatLngBounds bounds = builder.build();\n\n // Animate camera to the bounds\n try {\n mMap.animateCamera(CameraUpdateFactory.newLatLngBounds(bounds, 200));\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n return true;\n }", "public abstract Optional<GridAxis> subsetDependent(GridAxis1D subsetIndAxis, Formatter errlog);", "@Test(timeout = 4000)\n public void test26() throws Throwable {\n Discretize discretize0 = new Discretize();\n discretize0.m_FindNumBins = true;\n int[] intArray0 = new int[6];\n intArray0[0] = (-388);\n intArray0[1] = (-2121610348);\n intArray0[2] = 11;\n intArray0[3] = (-1);\n intArray0[4] = 1062;\n intArray0[5] = 70;\n discretize0.setAttributeIndicesArray(intArray0);\n discretize0.setDesiredWeightOfInstancesPerInterval((-1149.15832593));\n discretize0.getOptions();\n assertEquals((-1149.15832593), discretize0.getDesiredWeightOfInstancesPerInterval(), 0.01);\n }", "public final PythonParser.sliceop_return sliceop() throws RecognitionException {\n PythonParser.sliceop_return retval = new PythonParser.sliceop_return();\n retval.start = input.LT(1);\n\n PythonTree root_0 = null;\n\n Token COLON256=null;\n PythonParser.test_return test257 = null;\n\n\n PythonTree COLON256_tree=null;\n RewriteRuleTokenStream stream_COLON=new RewriteRuleTokenStream(adaptor,\"token COLON\");\n RewriteRuleSubtreeStream stream_test=new RewriteRuleSubtreeStream(adaptor,\"rule test\");\n try {\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1506:5: ( COLON ( test[expr_contextType.Load] -> test | -> ^( COLON[$COLON, \\\"None\\\", expr_contextType.Load] ) ) )\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1506:7: COLON ( test[expr_contextType.Load] -> test | -> ^( COLON[$COLON, \\\"None\\\", expr_contextType.Load] ) )\n {\n COLON256=(Token)match(input,COLON,FOLLOW_COLON_in_sliceop6943); if (state.failed) return retval; \n if ( state.backtracking==0 ) stream_COLON.add(COLON256);\n\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1507:6: ( test[expr_contextType.Load] -> test | -> ^( COLON[$COLON, \\\"None\\\", expr_contextType.Load] ) )\n int alt128=2;\n int LA128_0 = input.LA(1);\n\n if ( (LA128_0==NAME||(LA128_0>=LAMBDA && LA128_0<=NOT)||LA128_0==LPAREN||(LA128_0>=PLUS && LA128_0<=MINUS)||(LA128_0>=TILDE && LA128_0<=LBRACK)||LA128_0==LCURLY||(LA128_0>=BACKQUOTE && LA128_0<=STRING)) ) {\n alt128=1;\n }\n else if ( (LA128_0==COMMA||LA128_0==RBRACK) ) {\n alt128=2;\n }\n else {\n if (state.backtracking>0) {state.failed=true; return retval;}\n NoViableAltException nvae =\n new NoViableAltException(\"\", 128, 0, input);\n\n throw nvae;\n }\n switch (alt128) {\n case 1 :\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1507:7: test[expr_contextType.Load]\n {\n pushFollow(FOLLOW_test_in_sliceop6951);\n test257=test(expr_contextType.Load);\n\n state._fsp--;\n if (state.failed) return retval;\n if ( state.backtracking==0 ) stream_test.add(test257.getTree());\n\n\n // AST REWRITE\n // elements: test\n // token labels: \n // rule labels: retval\n // token list labels: \n // rule list labels: \n // wildcard labels: \n if ( state.backtracking==0 ) {\n retval.tree = root_0;\n RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,\"rule retval\",retval!=null?retval.tree:null);\n\n root_0 = (PythonTree)adaptor.nil();\n // 1508:5: -> test\n {\n adaptor.addChild(root_0, stream_test.nextTree());\n\n }\n\n retval.tree = root_0;}\n }\n break;\n case 2 :\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1510:5: \n {\n\n // AST REWRITE\n // elements: COLON\n // token labels: \n // rule labels: retval\n // token list labels: \n // rule list labels: \n // wildcard labels: \n if ( state.backtracking==0 ) {\n retval.tree = root_0;\n RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,\"rule retval\",retval!=null?retval.tree:null);\n\n root_0 = (PythonTree)adaptor.nil();\n // 1510:5: -> ^( COLON[$COLON, \\\"None\\\", expr_contextType.Load] )\n {\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1510:8: ^( COLON[$COLON, \\\"None\\\", expr_contextType.Load] )\n {\n PythonTree root_1 = (PythonTree)adaptor.nil();\n root_1 = (PythonTree)adaptor.becomeRoot(new Name(COLON, COLON256, \"None\", expr_contextType.Load), root_1);\n\n adaptor.addChild(root_0, root_1);\n }\n\n }\n\n retval.tree = root_0;}\n }\n break;\n\n }\n\n\n }\n\n retval.stop = input.LT(-1);\n\n if ( state.backtracking==0 ) {\n\n retval.tree = (PythonTree)adaptor.rulePostProcessing(root_0);\n adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);\n }\n }\n\n catch (RecognitionException re) {\n errorHandler.reportError(this, re);\n errorHandler.recover(this, input,re);\n retval.tree = (PythonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);\n }\n finally {\n }\n return retval;\n }", "@Test\n public void testColocatedPartitionedRegion() throws Throwable {\n createCacheInAllVms();\n redundancy = 0;\n localMaxmemory = 50;\n totalNumBuckets = 11;\n\n regionName = \"A\";\n colocatedWith = null;\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"B\";\n colocatedWith = SEPARATOR + \"A\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"C\";\n colocatedWith = SEPARATOR + \"A\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"D\";\n colocatedWith = SEPARATOR + \"B\";\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"E\";\n colocatedWith = SEPARATOR + \"B\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"F\";\n colocatedWith = SEPARATOR + \"B\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"G\";\n colocatedWith = SEPARATOR + \"C\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"H\";\n colocatedWith = SEPARATOR + \"C\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"I\";\n colocatedWith = SEPARATOR + \"C\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"J\";\n colocatedWith = SEPARATOR + \"D\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"K\";\n colocatedWith = SEPARATOR + \"D\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"L\";\n colocatedWith = SEPARATOR + \"E\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"M\";\n colocatedWith = SEPARATOR + \"F\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"N\";\n colocatedWith = SEPARATOR + \"G\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"O\";\n colocatedWith = SEPARATOR + \"I\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n accessor.invoke(() -> PRColocationDUnitTest.validateColocatedRegions(\"A\"));\n\n accessor.invoke(() -> PRColocationDUnitTest.validateColocatedRegions(\"D\"));\n\n accessor.invoke(() -> PRColocationDUnitTest.validateColocatedRegions(\"H\"));\n\n accessor.invoke(() -> PRColocationDUnitTest.validateColocatedRegions(\"B\"));\n\n accessor.invoke(() -> PRColocationDUnitTest.validateColocatedRegions(\"K\"));\n }", "boolean hasClusterName();", "private void partitionImpl(Collection<S> vocab, HashMap<Dimension<T>, MutableDouble> center) {\n double firstVal = Double.POSITIVE_INFINITY;\n double secondVal = Double.POSITIVE_INFINITY;\n S firstWord = null;\n S secondWord = null;\n\n LinkedList<S> cluster1 = new LinkedList<S>();\n LinkedList<S> cluster2 = new LinkedList<S>();\n HashMap<Dimension<T>, MutableDouble> newCenter1 = null;\n HashMap<Dimension<T>, MutableDouble> newCenter2 = null;\n\n if (vocab.size() > 2) {\n for (S word : vocab) {\n double dist = distanceToCenter(word, center);\n if (dist < secondVal) {\n if (dist < firstVal) {\n secondVal = firstVal;\n secondWord = firstWord;\n firstVal = dist;\n firstWord = word;\n } else {\n secondVal = dist;\n secondWord = word;\n }\n }\n }\n if (distance(firstWord, secondWord) <= 0.0) {\n System.out.printf(\"zero distance between '%s' and '%s'\\n\", firstWord, secondWord);\n // pick an arbitrary second word\n for (S word : vocab) {\n if (word.equals(firstWord) || word.equals(secondWord)) {\n continue;\n }\n if (distance(firstWord, word) > 0.0) {\n secondWord = word;\n break;\n }\n }\n System.out.printf(\"selected '%s' and '%s'\\n\", firstWord, secondWord);\n }\n\n HashMap<Dimension<T>, MutableDouble> center1 = wordToVector(firstWord);\n HashMap<Dimension<T>, MutableDouble> center2 = wordToVector(secondWord);\n for (S word : vocab) {\n double dist1 = distanceToCenter(word, center1);\n double dist2 = distanceToCenter(word, center2);\n if (dist1 < dist2) {\n cluster1.add(word);\n } else {\n cluster2.add(word);\n }\n }\n\n int changed = 1;\n int iteration = 0;\n while (++iteration <= MAX_ITERATIONS && changed > 0) {\n System.out.printf(\"Iteration %d/%d\\n\", iteration, MAX_ITERATIONS);\n changed = 0;\n newCenter1 = getCenter(cluster1);\n newCenter2 = getCenter(cluster2);\n\n LinkedList<S> tmpCluster1 = new LinkedList<S>();\n LinkedList<S> tmpCluster2 = new LinkedList<S>();\n\n for (ListIterator<S> it = cluster1.listIterator(); it.hasNext();) {\n S word = it.next();\n double dist1 = distanceToCenter(word, newCenter1);\n double dist2 = distanceToCenter(word, newCenter2);\n if (dist1 <= dist2) {\n tmpCluster1.add(word);\n } else {\n tmpCluster2.add(word);\n changed++;\n System.out.printf(\"changing %s : %g > %g\\n\", word, dist1, dist2);\n }\n }\n\n for (ListIterator<S> it = cluster2.listIterator(); it.hasNext();) {\n S word = it.next();\n double dist1 = distanceToCenter(word, newCenter1);\n double dist2 = distanceToCenter(word, newCenter2);\n if (dist2 <= dist1) {\n tmpCluster2.add(word);\n } else {\n tmpCluster1.add(word);\n changed++;\n System.out.printf(\"changing %s : %g < %g\\n\", word, dist1, dist2);\n }\n }\n cluster1 = tmpCluster1;\n cluster2 = tmpCluster2;\n System.out.printf(\"changed: %d/%d\\n\", changed, vocab.size());\n if (cluster1.size() == 0 || cluster2.size() == 0) {\n LinkedList<S> cl = cluster1.size() == 0 ? cluster2 : cluster1;\n System.out.printf(\"Cannot split %s, split them randomly\\n\", cl.toString());\n tmpCluster1 = new LinkedList<S>();\n tmpCluster2 = new LinkedList<S>();\n boolean b = true;\n for (S word : cl) {\n if (b) {\n tmpCluster1.add(word);\n } else {\n tmpCluster2.add(word);\n }\n b = !b;\n }\n cluster1 = tmpCluster1;\n cluster2 = tmpCluster2;\n }\n }\n } else if (vocab.size() == 2) {\n Iterator<S> it = vocab.iterator();\n S word1 = it.next();\n S word2 = it.next();\n cluster1.add(word1);\n cluster2.add(word2);\n newCenter1 = wordToVector(word1);\n newCenter2 = wordToVector(word2);\n } else {\n return;\n }\n\n if (notifyNewCluster(vocab, cluster1, cluster2)) {\n partition(cluster1, newCenter1);\n partition(cluster2, newCenter2);\n }\n\n }", "public void testFilterOnAggregationColumn() throws Exception {\n \t\tccName = new String[] { \"cc1\", \"cc2\", \"cc3\" };\n \t\tccExpr = new String[] { \"row.COL0+row.COL1\",\n \t\t\t\t\"Total.runningSum(row.cc1,row.COL0==0,0)\",\n \t\t\t\t\"Total.runningSum(row.cc1,row.COL0>0,0)\" };\n \n \t\tfor (int i = 0; i < ccName.length; i++) {\n \t\t\tComputedColumn computedColumn = new ComputedColumn(ccName[i],\n \t\t\t\t\tccExpr[i], DataType.ANY_TYPE);\n \t\t\t((BaseDataSetDesign) this.dataSet)\n \t\t\t\t\t.addComputedColumn(computedColumn);\n \t\t}\n \n \t\tString[] bindingNameRow = new String[7];\n \t\tbindingNameRow[0] = \"ROW_COL0\";\n \t\tbindingNameRow[1] = \"ROW_COL1\";\n \t\tbindingNameRow[2] = \"ROW_COL2\";\n \t\tbindingNameRow[3] = \"ROW_COL3\";\n \t\tbindingNameRow[4] = \"ROW_cc1\";\n \t\tbindingNameRow[5] = \"ROW_cc2\";\n \t\tbindingNameRow[6] = \"ROW_cc3\";\n \t\tScriptExpression[] bindingExprRow = new ScriptExpression[] {\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL0\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL1\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL2\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL3\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + ccName[0], 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + ccName[1], 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + ccName[2], 0) };\n \n \t\tIResultIterator resultIt = this.executeQuery(this.createQuery(null,\n \t\t\t\tnull, null, null, null, null, null, null, null, bindingNameRow,\n \t\t\t\tbindingExprRow));\n \n \t\tprintResult(resultIt, bindingNameRow, bindingExprRow);\n \t\t// assert\n \t\tcheckOutputFile();\n \n \t}", "private boolean subGridCheck() {\n\t\tint sqRt = (int)Math.sqrt(dimension);\n\t\tfor(int i = 0; i < sqRt; i++) {\n\t\t\tint increment = i * sqRt;\n\t\t\tfor(int val = 1; val <= dimension; val++) {\n\t\t\t\tint valCounter = 0;\n\t\t\t\tfor(int row = 0 + increment; row < sqRt + increment; row++) {\n\t\t\t\t\tfor(int col = 0 + increment; col < sqRt + increment; col++) {\n\t\t\t\t\t\tif(puzzle[row][col] == val)\n\t\t\t\t\t\t\tvalCounter++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(valCounter >= 2)\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "@Test\r\n public void testIsSubset1() {\r\n Assert.assertEquals(false, set1.isSubset(set2));\r\n }", "public static boolean IS_SUBFEATURE(Feature a, int index_a, Feature b, int index_b) {\n\n boolean anotinb, bnotina;\n int i, ia, ib;\n\n if (index_a != index_b)\n Dataset.perror(\"Feature.class :: not the same feature (\" + index_a + \" != \" + index_b + \")\");\n if (!a.type.equals(b.type))\n Dataset.perror(\n \"Feature.class :: not the same type of feature (\" + a.type + \" != \" + b.type + \")\");\n\n if (IS_CONTINUOUS(a.type)) {\n if (a.dmin >= b.dmin) {\n if (a.dmax <= b.dmax) return true;\n else\n Dataset.perror(\n \"Feature.class :: inconsistency for subfeature check for : (\"\n + a.dmin\n + \", \"\n + a.dmax\n + \") subseteq (\"\n + b.dmin\n + \", \"\n + b.dmax\n + \") ? \");\n } else if (a.dmax < b.dmax)\n Dataset.perror(\n \"Feature.class :: inconsistency for subfeature check for : (\"\n + a.dmin\n + \", \"\n + a.dmax\n + \") subseteq (\"\n + b.dmin\n + \", \"\n + b.dmax\n + \") ? \");\n } else if (IS_INTEGER(a.type)) {\n if (a.imin >= b.imin) {\n if (a.imax <= b.imax) return true;\n else\n Dataset.perror(\n \"Feature.class :: inconsistency for subfeature check for : (\"\n + a.imin\n + \", \"\n + a.imax\n + \") subseteq (\"\n + b.imin\n + \", \"\n + b.imax\n + \") ? \");\n } else if (a.imax < b.imax)\n Dataset.perror(\n \"Feature.class :: inconsistency for subfeature check for : (\"\n + a.imin\n + \", \"\n + a.imax\n + \") subseteq (\"\n + b.imin\n + \", \"\n + b.imax\n + \") ? \");\n } else if (IS_NOMINAL(a.type)) {\n if (a.modalities == null) return true;\n else if (b.modalities != null) {\n anotinb = bnotina = false;\n ia = ib = -1;\n for (i = 0; i < a.modalities.size(); i++)\n if (!b.modalities.contains((String) a.modalities.elementAt(i))) {\n anotinb = true;\n ia = i;\n }\n for (i = 0; i < b.modalities.size(); i++)\n if (!a.modalities.contains((String) b.modalities.elementAt(i))) {\n bnotina = true;\n ib = i;\n }\n if ((anotinb) && (bnotina))\n Dataset.perror(\n \"Feature.class :: inconsistency for subfeature check for : \"\n + ((String) a.modalities.elementAt(ia))\n + \" not in b and \"\n + ((String) b.modalities.elementAt(ib))\n + \" not in a \");\n else if (!anotinb) return true;\n }\n } else Dataset.perror(\"Feature.class :: no Feature type for \" + a.type);\n\n return false;\n }", "int getMaxUnavailable(ClusterSpec clusterSpec);", "private static int findNoK(double[][] X){\n int noK = 0;\n int high = X.length / 2;\n\n if (OverrideClusterNo > 0){\n \treturn OverrideClusterNo;\n }\n \n if (high <= 0){\n \tnoK = -1; //TODO JMC Break\n }\n else if (high == 1){\n noK = 1;\n }\n else if (high == 2){\n noK = 2;\n }\n else if (high > MaxClusters){\n \tnoK = MaxClusters;\n }\n else{\n noK = (int)(Math.random() * (high - 2) + 2) + 1;\n }\n \n return noK;\n }", "public abstract int Compare(Slice a, Slice b);", "@Test\n public void computeResult_resultAlwaysInsideProvidedBoundaries() {\n int datasetSize = 10;\n for (int i = 0; i < 100; ++i) {\n Random random = new Random();\n double lower = random.nextDouble() * 100;\n double upper = lower + random.nextDouble() * 100;\n\n variance =\n BoundedVariance.builder()\n .epsilon(EPSILON)\n .noise(new LaplaceNoise())\n .maxPartitionsContributed(1)\n .maxContributionsPerPartition(1)\n .lower(lower)\n .upper(upper)\n .build();\n\n List<Double> dataset =\n random\n .doubles()\n .map(x -> x * 300 * getRandomSign(random))\n .limit(datasetSize)\n .boxed()\n .collect(toImmutableList());\n\n variance.addEntries(dataset);\n\n assertWithMessage(\n \"lower = %s\\nupper = %s\\ndataset = [%s]\",\n lower, upper, dataset.stream().map(x -> Double.toString(x)).collect(joining(\",\\n\")))\n .that(variance.computeResult())\n .isIn(Range.closed(0.0, (upper - lower) * (upper - lower) / 4.0));\n }\n }", "@ParameterizedTest\n @ArgumentsSource(TestForestProvider.class)\n public void testMultipleAttributions(RandomCutForest forest) {\n int hardPass=0;\n int causal=0;\n double [] point ={6.0,0.0,0.0};\n DiVector result = forest.getAnomalyAttribution(point);\n assertTrue(result.low[0] < 0.2);\n if (result.getHighLowSum(1) < 0.5) ++hardPass;\n if (result.getHighLowSum(2) < 0.5) ++hardPass;\n assertTrue(result.getHighLowSum(1) + result.getHighLowSum(2) < 1.0);\n assertTrue(result.high[0] > forest.getAnomalyScore(point)/3);\n if (result.high[0] > 0.5 * forest.getAnomalyScore(point)) ++causal;\n\n // the last line states that first coordinate was high and was a majority contributor to the score\n // the previous test states that the contribution is twice the average of the 12 possible contributors.\n // these tests all subparts of the score at once\n\n point=new double [] {-6.0,0.0,0.0};\n result = forest.getAnomalyAttribution(point);\n assertTrue(result.getHighLowSum()>1.0);\n assertTrue(result.high[0] < 0.5);\n if (result.getHighLowSum(1) < 0.5) ++hardPass;\n if (result.getHighLowSum(2) < 0.5) ++hardPass;\n assertTrue(result.low[0] > forest.getAnomalyScore(point)/3);\n if (result.low[0] > 0.5 * forest.getAnomalyScore(point)) ++causal;\n\n\n point=new double [] {0.0,6.0,0.0};\n assertTrue(result.getHighLowSum()>1.0);\n result = forest.getAnomalyAttribution(point);\n if (result.getHighLowSum(0) < 0.5) ++hardPass;\n if (result.getHighLowSum(2) < 0.5) ++hardPass;\n assertTrue(result.low[1] < 0.5);\n assertTrue(result.high[1] > forest.getAnomalyScore(point)/3);\n if (result.high[1] > 0.5 * forest.getAnomalyScore(point)) ++causal;\n\n\n point=new double [] {0.0,-6.0,0.0};\n assertTrue(result.getHighLowSum()>1.0);\n result = forest.getAnomalyAttribution(point);\n if (result.getHighLowSum(0) < 0.5) ++hardPass;\n if (result.getHighLowSum(2) < 0.5) ++hardPass;\n assertTrue(result.high[1] < 0.5);\n assertTrue(result.low[1] > forest.getAnomalyScore(point)/3);\n if (result.low[1] > 0.5 * forest.getAnomalyScore(point)) ++causal;\n\n\n point=new double [] {0.0,0.0,6.0};\n assertTrue(result.getHighLowSum()>1.0);\n result = forest.getAnomalyAttribution(point);\n if (result.getHighLowSum(0) < 0.5) ++hardPass;\n if (result.getHighLowSum(1) < 0.5) ++hardPass;\n assertTrue(result.low[2] < 0.5);\n assertTrue(result.high[2] > forest.getAnomalyScore(point)/3);\n if (result.high[2] > 0.5 * forest.getAnomalyScore(point)) ++causal;\n\n point=new double [] {0.0,0.0,-6.0};\n assertTrue(result.getHighLowSum()>1.0);\n result = forest.getAnomalyAttribution(point);\n if (result.getHighLowSum(0) < 0.5) ++hardPass;\n if (result.getHighLowSum(1) < 0.5) ++hardPass;\n assertTrue(result.high[2] < 0.5);\n assertTrue(result.low[2] > forest.getAnomalyScore(point)/3);\n if (result.low[2] > 0.5 * forest.getAnomalyScore(point)) ++causal;\n\n\n assertTrue(causal>=5); // maximum is 6; there can be skew in one direction\n\n point=new double [] {-3.0,0.0,0.0};\n result = forest.getAnomalyAttribution(point);\n assertTrue(result.high[0] < 0.5);\n if (result.getHighLowSum(1) < 0.5) ++hardPass;\n if (result.getHighLowSum(2) < 0.5) ++hardPass;\n assertTrue(result.low[0] >\n forest.getAnomalyScore(point)/3);\n\n /* For multiple causes, the relationship of scores only hold for larger\n * distances.\n */\n\n point=new double [] {-3.0,6.0,0.0};\n assertTrue(result.getHighLowSum()>1.0);\n result = forest.getAnomalyAttribution(point);\n if (result.low[0] > 0.5) ++hardPass;\n assertTrue(result.high[0] < 0.5);\n assertTrue(result.low[1] < 0.5);\n assertTrue(result.high[1] > 0.5);\n if (result.high[1]>0.9) ++hardPass;\n assertTrue(result.getHighLowSum(2)< 0.5);\n assertTrue(result.high[1]+result.low[0]>\n 0.8*forest.getAnomalyScore(point));\n\n point=new double [] {6.0,-3.0,0.0};\n assertTrue(result.getHighLowSum()>1.0);\n result = forest.getAnomalyAttribution(point);\n assertTrue(result.low[0] < 0.5);\n assertTrue(result.high[0] > 0.5);\n if (result.high[0]>0.9) ++hardPass;\n if (result.low[1] > 0.5) ++hardPass;\n assertTrue(result.high[1] < 0.5);\n assertTrue(result.getHighLowSum(2) < 0.5);\n assertTrue(result.high[0]+result.low[1]>\n 0.8*forest.getAnomalyScore(point));\n\n point=new double [] {20.0,-10.0,0.0};\n assertTrue(result.getHighLowSum()>1.0);\n result = forest.getAnomalyAttribution(point);\n assertTrue(result.high[0]+result.low[1]>\n 0.8*forest.getAnomalyScore(point));\n if (result.high[0]>1.8*result.low[1]) ++hardPass;\n if (result.low[1]>result.high[0]/2.2) ++hardPass;\n\n assertTrue(hardPass>=15); //maximum is 20\n }", "@Test\n public void should_iterate_with_default_params() throws Exception {\n long partitionKey = RandomUtils.nextLong(0,Long.MAX_VALUE);\n insertClusteredValues(partitionKey, 1, \"name1\", 5);\n\n Iterator<ClusteredEntity> iter = manager.sliceQuery(ClusteredEntity.class)\n .forIteration()\n .withPartitionComponents(partitionKey)\n .iterator();\n\n assertThat(iter.hasNext()).isTrue();\n ClusteredEntity next = iter.next();\n assertThat(next.getId().getCount()).isEqualTo(1);\n assertThat(next.getId().getName()).isEqualTo(\"name11\");\n assertThat(next.getValue()).isEqualTo(\"value11\");\n\n assertThat(iter.hasNext()).isTrue();\n next = iter.next();\n assertThat(next.getId().getCount()).isEqualTo(1);\n assertThat(next.getId().getName()).isEqualTo(\"name12\");\n assertThat(next.getValue()).isEqualTo(\"value12\");\n\n assertThat(iter.hasNext()).isTrue();\n next = iter.next();\n assertThat(next.getId().getCount()).isEqualTo(1);\n assertThat(next.getId().getName()).isEqualTo(\"name13\");\n assertThat(next.getValue()).isEqualTo(\"value13\");\n\n assertThat(iter.hasNext()).isTrue();\n next = iter.next();\n assertThat(next.getId().getCount()).isEqualTo(1);\n assertThat(next.getId().getName()).isEqualTo(\"name14\");\n assertThat(next.getValue()).isEqualTo(\"value14\");\n\n assertThat(iter.hasNext()).isTrue();\n next = iter.next();\n assertThat(next.getId().getCount()).isEqualTo(1);\n assertThat(next.getId().getName()).isEqualTo(\"name15\");\n assertThat(next.getValue()).isEqualTo(\"value15\");\n\n assertThat(iter.hasNext()).isFalse();\n }", "List<Trueorfalse> selectByExample(RowBounds rowBounds);", "public Range findRangeBounds(CategoryDataset dataset) { return findRangeBounds(dataset, true); }", "public DeleteCollectionClusterOperator limit(Number limit) {\n put(\"limit\", limit);\n return this;\n }", "@Override\n public boolean onClusterClick(Cluster<Parking> cluster) {\n Toast.makeText(this, \"cluster clicked\", Toast.LENGTH_SHORT).show();\n\n // Zoom in the cluster. Need to create LatLngBounds and including all the cluster items\n // inside of bounds, then animate to center of the bounds.\n\n // Create the builder to collect all essential cluster items for the bounds.\n LatLngBounds.Builder builder = LatLngBounds.builder();\n for (ClusterItem item : cluster.getItems()) {\n builder.include(item.getPosition());\n }\n // Get the LatLngBounds\n final LatLngBounds bounds = builder.build();\n\n // Animate camera to the bounds\n try {\n getMap().animateCamera(CameraUpdateFactory.newLatLngBounds(bounds, 100));\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n return true;\n }", "private boolean inBounds(int row, int col){\n if (row > -1 && row < 120 && col > -1 && col < 160)\n return true;\n return false;\n }", "@Test\n public void testHeterogeneousSegmentFilterConditionLimit() throws SqlParseException {\n\n val project = \"heterogeneous_segment\";\n // val dfId = \"747f864b-9721-4b97-acde-0aa8e8656cba\"\n // val seg1Id = \"8892fa3f-f607-4eec-8159-7c5ae2f16942\"\n // val seg2Id = \"d75a822c-788a-4592-a500-cf20186dded1\"\n // val seg3Id = \"54eaf96d-6146-45d2-b94e-d5d187f89919\"\n // val seg4Id = \"411f40b9-a80a-4453-90a9-409aac6f7632\"\n // val seg5Id = \"a8318597-cb75-416f-8eb8-96ea285dd2b4\"\n // \n val sql = \"with T1 as (select cal_dt, trans_id \\n\" + \"from test_kylin_fact inner join test_account \\n\"\n + \"on test_kylin_fact.seller_id = test_account.account_id \\n\"\n + \"where cal_dt between date'2012-01-01' and date'2012-01-03'\\n\" + \"group by cal_dt, trans_id)\\n\";\n\n {\n val sqlWithTooManyOrs = sql + \" select * from T1 where \" + \"(cal_dt='2012-01-01' and trans_id = 1) or \\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 2) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 3) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 4) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 5) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 6) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 7) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 8) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 9) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 10) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 12) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 13) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 14) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 15) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 16) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 17) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 18) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 19) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 20)\";\n val contexts = OlapContextTestUtil.getOlapContexts(project, sqlWithTooManyOrs);\n Assert.assertEquals(\n \">=(DEFAULT.TEST_KYLIN_FACT.CAL_DT, 2012-01-01),<=(DEFAULT.TEST_KYLIN_FACT.CAL_DT, 2012-01-03)\",\n contexts.get(0).getExpandedFilterConditions().stream().map(RexNode::toString)\n .collect(Collectors.joining(\",\")));\n }\n\n {\n val sqlWithFilter = sql + \" select * from T1 where \" + \"(cal_dt='2012-01-01' and trans_id = 1) or \\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 2) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 3) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 4) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 5) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 6) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 7) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 8) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 9) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 10)\";\n val contexts = OlapContextTestUtil.getOlapContexts(project, sqlWithFilter);\n Assert.assertNotEquals(\n \">=(DEFAULT.TEST_KYLIN_FACT.CAL_DT, 2012-01-01),<=(DEFAULT.TEST_KYLIN_FACT.CAL_DT, 2012-01-03)\",\n contexts.get(0).getExpandedFilterConditions().stream().map(RexNode::toString)\n .collect(Collectors.joining(\",\")));\n }\n\n }", "private boolean isNeedCut(Map<Set<String>, Integer> preMap, Set<String> set) {\n\t\tboolean flag = false;\n\t\tList<Set<String>> subSets = getSubSets(set);\n\t\tfor(Set<String> subSet : subSets){\n\t\t\tif(!preMap.containsKey(subSet)){\n\t\t\t\tflag = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn flag;\n\t}", "PlaneSubset(final Plane plane) {\n this.plane = plane;\n }", "@Test\n\t public void test_Is_Subset_Positive() throws Exception{\t\n\t\t SET setarray= new SET( new int[]{1,2,3,4,5});\n\t\t SET subsetarray= new SET( new int[]{1,2,3});\n\t\t assertTrue(setarray.isSubSet(subsetarray));\t \n\t }", "@Test\n public void testRedundancyRestriction() throws Exception {\n final String rName = getUniqueName();\n final Integer red0 = 0;\n final Integer red1 = 1;\n\n CacheSerializableRunnable createPRsWithRed =\n new CacheSerializableRunnable(\"createPrsWithDifferentRedundancy\") {\n @Override\n public void run2() throws CacheException {\n getCache();\n IgnoredException.addIgnoredException(\"redundancy should be same as the redundancy\");\n createPR(rName, red1, 100, 3, null, Boolean.FALSE,\n Boolean.FALSE);\n try {\n createPR(rName + \"colo\", red0, 100, 3, rName,\n Boolean.FALSE, Boolean.FALSE);\n fail(\"Expected different redundancy levels to throw.\");\n } catch (IllegalStateException expected) {\n assertEquals(\n \"Current PartitionedRegion's redundancy should be same as the redundancy of colocated PartitionedRegion\",\n expected.getMessage());\n }\n }\n };\n dataStore1.invoke(createPRsWithRed);\n }", "private boolean outOfBounds(int nidx1){\n\t\treturn (nidx1 < 0 || nidx1 >= numofvert);\n\t}", "@Test(timeout = 4000)\n public void test07() throws Throwable {\n Discretize discretize0 = new Discretize();\n discretize0.setInvertSelection(true);\n discretize0.useEqualFrequencyTipText();\n int int0 = (-501);\n // Undeclared exception!\n try { \n discretize0.calculateCutPointsByEqualWidthBinning((-501));\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"weka.filters.unsupervised.attribute.Discretize\", e);\n }\n }", "private boolean canPartitionDP(int[] array, int sum) {\n int len = array.length;\n boolean[][] dp = new boolean[len + 1][sum + 1];\n\n for (int i = 0; i < len + 1; i++) dp[i][0] = true;\n\n for (int i = 1; i < len + 1; i++) {\n for (int j = 1; j < sum + 1; j++) {\n if (array[i - 1] <= j) dp[i][j] = dp[i - 1][j] || dp[i - 1][j - array[i - 1]];\n else dp[i][j] = dp[i - 1][j];\n }\n }\n\n return dp[len][sum];\n }", "public boolean canPartition(int[] nums) {\n int sum = 0;\n int n = nums.length;\n for (int num : nums) sum += num;\n // sum cannot be splitted evenly\n if ((sum & 1) == 1) return false;\n int target = sum / 2;\n \n // dp[i][j] represents whether 0~i-1 numbers can reach\n // weight capacity j\n boolean[][] dp = new boolean[n+1][target+1];\n \n for (int i = 1; i <= n; i++) dp[i][0] = true;\n for (int j = 1; j <= target; j++) dp[0][j] = false;\n dp[0][0] = true;\n \n for (int i = 1; i <= n; i++) {\n for (int j = 1; j <= target; j++) {\n // if don't pick current number\n dp[i][j] = dp[i-1][j];\n if (j >= nums[i-1]) {\n dp[i][j] = dp[i][j] || dp[i-1][j-nums[i-1]];\n }\n }\n }\n return dp[n][target];\n \n \n // Solution2: optimizing to save space\n // https://leetcode.com/problems/partition-equal-subset-sum/discuss/90592/01-knapsack-detailed-explanation/94996\n int sum = 0;\n int n = nums.length;\n for (int num : nums) sum += num;\n if ((sum & 1) == 1) return false;\n int target = sum / 2;\n boolean[] dp = new boolean[target+1];\n dp[0] = true;\n for (int num : nums) {\n // here is the trick to save space\n // because we have to update dp[j] based on \n // previous dp[j-num] and dp[j] from previous loop.\n // if we update dp from left to right\n // we first update smaller dp which is dp[j-num]\n // then we won't be able to get original dp[j-num] and dp[j]\n // from previous loop, and eventually we get the wrong\n // answer. But if we update dp from right to left\n // we can assure everything is based on previous state\n for (int j = target; j >= num; j--) {\n // if (j >= num) {\n dp[j] = dp[j] || dp[j-num];\n // }\n }\n }\n return dp[target];\n }", "private boolean canSetSafelyDownColumn(MTreeNode row, MTreeNode col, UnionDoubleIntervals newVal) {\n\t\tMTreeNode rowKids[]=row.getChildren();\n\t\tif (rowKids.length==0) return true;\n\t\tUnionDoubleIntervals rowKidsInts[]=new UnionDoubleIntervals[rowKids.length];\n\t\tfor(int i=0; i<rowKids.length; i++) {\n\t\t\trowKidsInts[i]=get(rowKids[i], col);\n\t\t\tif (rowKidsInts[i]==null) {\n\t\t\t\t//If a sibling is null, I cannot check, so just return\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\tUnionDoubleIntervals sum=UnionDoubleIntervals.sum(rowKidsInts);\n\t\treturn newVal.intersects(sum);\n\t}", "private boolean checkifCollinear(Point[] ptArr, Comparator<Point> cmp, int start){\n\t\tif(start +2 >= ptArr.length) return false;\t\n\t\tif(cmp.compare(ptArr[start],ptArr[start+1]) == cmp.compare(ptArr[start+1],ptArr[start+2]) && cmp.compare(ptArr[start],ptArr[start+1]) == 0){\n\t\t\treturn true;\n\t\t}\t\t\n\t\treturn false;\t\n\t}", "@Nullable\n public abstract GridAxis subset(GridSubset params, Formatter errlog);", "@Test\n public void testColocatedPartitionedRegion_NoFullPath() throws Throwable {\n createCacheInAllVms();\n redundancy = 0;\n localMaxmemory = 50;\n totalNumBuckets = 11;\n\n regionName = \"A\";\n colocatedWith = null;\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"B\";\n colocatedWith = \"A\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"C\";\n colocatedWith = \"A\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"D\";\n colocatedWith = \"B\";\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"E\";\n colocatedWith = \"B\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"F\";\n colocatedWith = \"B\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"G\";\n colocatedWith = \"C\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"H\";\n colocatedWith = \"C\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"I\";\n colocatedWith = \"C\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"J\";\n colocatedWith = \"D\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"K\";\n colocatedWith = \"D\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"L\";\n colocatedWith = \"E\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"M\";\n colocatedWith = \"F\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"N\";\n colocatedWith = \"G\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"O\";\n colocatedWith = \"I\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n accessor.invoke(() -> PRColocationDUnitTest.validateColocatedRegions(\"A\"));\n\n accessor.invoke(() -> PRColocationDUnitTest.validateColocatedRegions(\"D\"));\n\n accessor.invoke(() -> PRColocationDUnitTest.validateColocatedRegions(\"H\"));\n\n accessor.invoke(() -> PRColocationDUnitTest.validateColocatedRegions(\"B\"));\n\n accessor.invoke(() -> PRColocationDUnitTest.validateColocatedRegions(\"K\"));\n }", "@Test(timeout = 4000)\n public void test29() throws Throwable {\n Discretize discretize0 = new Discretize();\n double[][] doubleArray0 = new double[3][6];\n discretize0.setIgnoreClass(false);\n discretize0.m_CutPoints = doubleArray0;\n double[] doubleArray1 = new double[4];\n // Undeclared exception!\n try { \n discretize0.getCutPoints((-831));\n fail(\"Expecting exception: ArrayIndexOutOfBoundsException\");\n \n } catch(ArrayIndexOutOfBoundsException e) {\n //\n // -831\n //\n verifyException(\"weka.filters.unsupervised.attribute.Discretize\", e);\n }\n }", "static int paintersPartition(int a[], int n, int k)\r\n\t {\r\n\t int start = a[0], end = a[0], minOfMax = -1;\r\n\t \r\n\t //this is to initialise start as max of all array elements and end as sum of all array elements\r\n\t for(int i = 1; i < n; i++)\r\n\t {\r\n\t end += a[i];\r\n\t \r\n\t if(a[i] > start)\r\n\t start = a[i];\r\n\t }\r\n\t \r\n\t while(start <= end)\r\n\t {\r\n\t int mid = start + ((end - start) / 2);\r\n\t \r\n\t if(isValid(a, n, k, mid))\r\n\t {\r\n\t minOfMax = mid; //this will hold one of the valid solution but then to get the most optimal one, we need check further on left side of search space\r\n\t end = mid - 1;\r\n\t }\r\n\t else\r\n\t start = mid + 1;\r\n\t }\r\n\t \r\n\t return minOfMax;\r\n\t }", "private static boolean isCut(Spreadsheet ss) {\r\n \t\treturn Boolean.valueOf( (Boolean)ss.getAttribute(KEY_IS_CUT) ); //if attr is null return false\r\n \t}", "public Map getPartitionRestrictions() {\n\t\t\treturn this.partitionRestrictions;\n\t\t}", "public Map getPartitionRestrictions() {\n\t\t\treturn this.partitionRestrictions;\n\t\t}", "protected boolean isClusterRequired() {\n return true;\n }", "static double binarySearchForBuckets (double[] splits, double feature, boolean keepInvalid) { throw new RuntimeException(); }", "public boolean percolates() {\n\t\tint top = uf.find(0);\n\t\tint bottom = uf.find(size * size + 1);\n\t\treturn top == bottom;\n\t}", "void setAllowClusterGet( boolean r );", "public interface ClusterMeasure {\n\n /**\n * Returns an index to measure the quality of clustering.\n * @param y1 the cluster labels.\n * @param y2 the alternative cluster labels.\n */\n public double measure(int[] y1, int[] y2);\n\n}", "private void runSomClustering(int linkage, int distanceMeasure, final boolean clusterColumns) {\r\n DivaClientService.computeSomClustering(linkage, distanceMeasure, clusterColumns,\r\n new AsyncCallback<SomClusteringResult>() {\r\n @Override\r\n public void onFailure(Throwable caught) {\r\n\r\n Selection_Manager.connError();\r\n SelectionManager.Busy_Task(false, true);\r\n }\r\n\r\n @Override\r\n public void onSuccess(SomClusteringResult result) {\r\n hierarchicalClustering = new SomClustComponent(result, Selection_Manager, DivaClientService, true, rightPanelWidth, leftPanelHeight);\r\n RootPanel.get(\"SomClusteringResults\").clear();\r\n RootPanel.get(\"SomClusteringResults\").add(hierarchicalClustering.getSomclusteringLayout());\r\n Timer t = new Timer() {\r\n @Override\r\n public void run() {\r\n hierarchicalClustering.selectRootNode();\r\n }\r\n };\r\n// Schedule the timer to run once in 0.5 seconds.\r\n// if (result.getRowNames().length < 5000) {\r\n//// t.schedule(500);\r\n// SelectionManager.Busy_Task(false, true);\r\n// } else {\r\n SelectionManager.Busy_Task(false, true);\r\n// }\r\n init = false;\r\n }\r\n });\r\n\r\n }" ]
[ "0.6938485", "0.6923774", "0.6864263", "0.6708734", "0.67000085", "0.66666853", "0.6598758", "0.6563316", "0.62897927", "0.606274", "0.58658755", "0.58408505", "0.5778646", "0.56070775", "0.54490256", "0.54332536", "0.54237306", "0.52661717", "0.5180933", "0.51592827", "0.50909346", "0.5000596", "0.50000364", "0.49815467", "0.49198398", "0.49124315", "0.48917505", "0.48600414", "0.4859576", "0.4839167", "0.48252156", "0.48097858", "0.48083892", "0.47791916", "0.47588804", "0.4742965", "0.47404954", "0.4728329", "0.47140712", "0.4686546", "0.46702257", "0.46689638", "0.46655366", "0.4646126", "0.46431154", "0.4634182", "0.46307585", "0.46270633", "0.46144715", "0.4609734", "0.4604723", "0.4599484", "0.4589548", "0.45850012", "0.45749044", "0.45687348", "0.45637974", "0.45622164", "0.45513108", "0.4545516", "0.45394057", "0.45363474", "0.4531926", "0.45201722", "0.45119375", "0.45115334", "0.45093197", "0.45025724", "0.45023578", "0.44995147", "0.44977042", "0.44834974", "0.4472256", "0.44655225", "0.4454862", "0.44459814", "0.44452584", "0.44251302", "0.44243148", "0.44185883", "0.44185776", "0.4416713", "0.4415751", "0.4413689", "0.4405413", "0.44033355", "0.44029793", "0.44010955", "0.4382759", "0.43825567", "0.4380899", "0.43779033", "0.43713027", "0.43713027", "0.4366643", "0.43621057", "0.43605143", "0.43564844", "0.43526712", "0.43477997" ]
0.680214
3
Test 'clustering_0 = 1 AND clustering_1 IN (1, 2, 3)'
@Test public void testBoundsAsCompositesWithEqAndInRestrictions() { CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC); ByteBuffer value1 = ByteBufferUtil.bytes(1); ByteBuffer value2 = ByteBufferUtil.bytes(2); ByteBuffer value3 = ByteBufferUtil.bytes(3); Restriction eq = newSingleEq(cfMetaData, 0, value1); Restriction in = newSingleIN(cfMetaData, 1, value1, value2, value3); PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(eq).mergeWith(in); List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(3, bounds.size()); assertComposite(bounds.get(0), value1, value1, EOC.START); assertComposite(bounds.get(1), value1, value2, EOC.START); assertComposite(bounds.get(2), value1, value3, EOC.START); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(3, bounds.size()); assertComposite(bounds.get(0), value1, value1, EOC.END); assertComposite(bounds.get(1), value1, value2, EOC.END); assertComposite(bounds.get(2), value1, value3, EOC.END); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void testBoundsAsCompositesWithSingleEqAndMultiINRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n ByteBuffer value5 = ByteBufferUtil.bytes(5);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) IN ((2, 3), (4, 5))\n Restriction singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction multiIN = newMultiIN(cfMetaData, 1, asList(value2, value3), asList(value4, value5));\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiIN);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(1), value1, value4, value5, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(1), value1, value4, value5, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) IN ((2, 3))\n singleEq = newSingleEq(cfMetaData, 0, value1);\n multiIN = newMultiIN(cfMetaData, 1, asList(value2, value3));\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiIN).mergeWith(singleEq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n // clustering_0 = 1 AND clustering_1 = 5 AND (clustering_2, clustering_3) IN ((2, 3), (4, 5))\n singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction singleEq2 = newSingleEq(cfMetaData, 1, value5);\n multiIN = newMultiIN(cfMetaData, 2, asList(value2, value3), asList(value4, value5));\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiIN).mergeWith(singleEq2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value5, value2, value3, EOC.START);\n assertComposite(bounds.get(1), value1, value5, value4, value5, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value5, value2, value3, EOC.END);\n assertComposite(bounds.get(1), value1, value5, value4, value5, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithSingleEqAndMultiEqRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) = (2, 3)\n Restriction singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction multiEq = newMultiEq(cfMetaData, 1, value2, value3);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiEq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n // clustering_0 = 1 AND clustering_1 = 2 AND (clustering_2, clustering_3) = (3, 4)\n singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction singleEq2 = newSingleEq(cfMetaData, 1, value2);\n multiEq = newMultiEq(cfMetaData, 2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(singleEq2).mergeWith(multiEq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n\n // (clustering_0, clustering_1) = (1, 2) AND clustering_2 = 3\n singleEq = newSingleEq(cfMetaData, 2, value3);\n multiEq = newMultiEq(cfMetaData, 0, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiEq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) = (2, 3) AND clustering_3 = 4\n singleEq = newSingleEq(cfMetaData, 0, value1);\n singleEq2 = newSingleEq(cfMetaData, 3, value4);\n multiEq = newMultiEq(cfMetaData, 1, value2, value3);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiEq).mergeWith(singleEq2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithTwoAscendingAndTwoDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.DESC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertEmptyComposite(bounds.get(1));\n\n // clustering_0 = 1 AND (clustering_1, clustering_2, clustering_3) > (2, 3, 4)\n Restriction eq = newSingleEq(cfMetaData, 0, value1);\n slice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n restrictions = restrictions.mergeWith(eq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2, clustering_3) > (2, 3, 4)\n Restriction in = newSingleIN(cfMetaData, 0, value1, value2);\n slice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n restrictions = restrictions.mergeWith(in);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n assertComposite(bounds.get(2), value2, value2, EOC.START);\n assertComposite(bounds.get(3), value2, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n assertComposite(bounds.get(2), value2, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(3), value2, EOC.END);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1, clustering_2, clustering_3) <= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) < (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4) AND (clustering_0, clustering_1) < (2, 3)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2, value3);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(1), value2, value3, EOC.START);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4) AND (clustering_0, clustering1, clustering_2, clustering_3) <= (4, 3, 2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value4, value3, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n assertComposite(bounds.get(2), value4, value3, value2, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(1), value4, value3, EOC.START);\n assertComposite(bounds.get(2), value4, value3, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsMixingAscendingDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.DESC, Sort.ASC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(3));\n\n // clustering_0 = 1 AND (clustering_1, clustering_2, clustering_3) > (2, 3, 4)\n Restriction eq = newSingleEq(cfMetaData, 0, value1);\n slice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n restrictions = restrictions.mergeWith(eq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(3));\n\n\n // (clustering_0, clustering1, clustering_2, clustering_3) <= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, value4, EOC.NONE);\n assertComposite(bounds.get(3), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) < (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(3), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4) AND (clustering_0, clustering_1) < (2, 3)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2, value3);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(5, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n assertComposite(bounds.get(4), value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(5, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertComposite(bounds.get(3), value2, EOC.START);\n assertComposite(bounds.get(4), value2, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4) AND (clustering_0, clustering1, clustering_2, clustering_3) <= (4, 3, 2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value4, value3, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(7, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n assertComposite(bounds.get(4), value4, value3, EOC.START);\n assertComposite(bounds.get(5), value4, value3, value2, value1, EOC.NONE);\n assertComposite(bounds.get(6), value4, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(7, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertComposite(bounds.get(3), value4, EOC.START);\n assertComposite(bounds.get(4), value4, value3, value2, EOC.START);\n assertComposite(bounds.get(5), value4, value3, value2, EOC.END);\n assertComposite(bounds.get(6), value4, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithTwoClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithSingleEqAndSliceRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n ByteBuffer value5 = ByteBufferUtil.bytes(5);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) > (2, 3)\n Restriction singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction multiSlice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiSlice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) > (2, 3) AND (clustering_1) < (4)\n singleEq = newSingleEq(cfMetaData, 0, value1);\n multiSlice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3);\n Restriction multiSlice2 = newMultiSlice(cfMetaData, 1, Bound.END, false, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiSlice2).mergeWith(singleEq).mergeWith(multiSlice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value4, EOC.START);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) => (2, 3) AND (clustering_1, clustering_2) <= (4, 5)\n singleEq = newSingleEq(cfMetaData, 0, value1);\n multiSlice = newMultiSlice(cfMetaData, 1, Bound.START, true, value2, value3);\n multiSlice2 = newMultiSlice(cfMetaData, 1, Bound.END, true, value4, value5);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiSlice2).mergeWith(singleEq).mergeWith(multiSlice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value4, value5, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithOneEqRestrictionsAndTwoClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer clustering_0 = ByteBufferUtil.bytes(1);\n Restriction eq = newSingleEq(cfMetaData, 0, clustering_0);\n\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiEqAndSingleSliceRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n\n // (clustering_0, clustering_1) = (1, 2) AND clustering_2 > 3\n Restriction multiEq = newMultiEq(cfMetaData, 0, value1, value2);\n Restriction singleSlice = newSingleSlice(cfMetaData, 2, Bound.START, false, value3);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiEq).mergeWith(singleSlice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n }", "@Test\n public void should_iterate_with_partition_keys_and_partition_keys_IN() throws Exception {\n //Given\n long partitionKey = RandomUtils.nextLong(0,Long.MAX_VALUE);\n\n insertCompositeClusteredValues(partitionKey,\"bucket1\",1,\"name1\",1);\n insertCompositeClusteredValues(partitionKey,\"bucket2\",1,\"name2\",1);\n insertCompositeClusteredValues(partitionKey,\"bucket3\",1,\"name3\",1);\n\n //When\n final Iterator<CompositeClusteredEntity> iterator = manager.sliceQuery(CompositeClusteredEntity.class)\n .forIteration()\n .withPartitionComponents(partitionKey)\n .andPartitionComponentsIN(\"bucket1\", \"bucket3\")\n .iterator();\n\n //Then\n assertThat(iterator.hasNext()).isTrue();\n CompositeClusteredEntity next = iterator.next();\n assertThat(next.getId().getId()).isEqualTo(partitionKey);\n assertThat(next.getId().getBucket()).isEqualTo(\"bucket1\");\n assertThat(next.getId().getName()).isEqualTo(\"name11\");\n assertThat(next.getValue()).isEqualTo(\"value11\");\n\n assertThat(iterator.hasNext()).isTrue();\n next = iterator.next();\n assertThat(next.getId().getId()).isEqualTo(partitionKey);\n assertThat(next.getId().getBucket()).isEqualTo(\"bucket3\");\n assertThat(next.getId().getName()).isEqualTo(\"name31\");\n assertThat(next.getValue()).isEqualTo(\"value11\");\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneAscendingAndOneDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n assertComposite(bounds.get(2), value2, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertComposite(bounds.get(1), value2, EOC.START);\n assertComposite(bounds.get(2), value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithOneEqRestrictionsAndOneClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC);\n\n ByteBuffer clustering_0 = ByteBufferUtil.bytes(1);\n Restriction eq = newSingleEq(cfMetaData, 0, clustering_0);\n\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneDescendingAndOneAscendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0) > (1) AND (clustering_0, clustering1) < (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.END);\n assertComposite(bounds.get(2), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.END);\n assertComposite(bounds.get(1), value1, EOC.START);\n assertComposite(bounds.get(2), value1, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithTwoDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n }", "@Test\n public void testContainsAll_Contains() {\n\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>();\n instance.add(3);\n instance.add(2);\n instance.add(1);\n instance.add(4);\n\n Collection c = Arrays.asList(1, 2, 3);\n\n boolean expResult = true;\n boolean result = instance.containsAll(c);\n assertEquals(expResult, result);\n }", "@Test\n public void testIntersection3()\n {\n List<Integer> expected = new ArrayList<>();\n ConciseSet set1 = new ConciseSet();\n ConciseSet set2 = new ConciseSet();\n for (int i = 0; i < 1000; i++) {\n set1.add(i);\n set2.add(i);\n expected.add(i);\n }\n\n verifyIntersection(expected, set1, set2);\n }", "@Test\n public void testBoundsAsCompositesWithOneInRestrictionsAndOneClusteringColumn()\n {\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n Restriction in = newSingleIN(cfMetaData, 0, value1, value2, value3);\n\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(in);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.START);\n assertComposite(bounds.get(2), value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n assertComposite(bounds.get(1), value2, EOC.END);\n assertComposite(bounds.get(2), value3, EOC.END);\n }", "@Test\n public void testSqlExistsMultiValuedWithForeignRestriction() {\n Query<Garage> garagesQuery = existsIn(cars,\n Garage.BRANDS_SERVICED,\n Car.NAME,\n equal(Car.FEATURES, \"convertible\")\n );\n\n Set<Garage> results = asSet(garages.retrieve(garagesQuery));\n\n assertEquals(\"should have 2 results\", 2, results.size());\n assertTrue(\"results should contain garage2\", results.contains(garage2));\n assertTrue(\"results should contain garage5\", results.contains(garage5));\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n }", "public boolean isEqualTo(Cluster c)\n {\n int len = this.size();\n if (len != c.size()){\n return false;\n }\n if (len == 0){\n return true;\n }\n if (this.getLeader() != c.getLeader()){\n return false;\n }\n for (Integer n : this._elems){\n if (!c.contains(n)){\n return false;\n }\n }\n return true;\n }", "boolean hasCluster();", "@Test\n public void testIntersection6()\n {\n List<Integer> expected = new ArrayList<>();\n ConciseSet set1 = new ConciseSet();\n for (int i = 0; i < 5; i++) {\n set1.add(i);\n }\n for (int i = 1000; i < 1005; i++) {\n set1.add(i);\n }\n\n ConciseSet set2 = new ConciseSet();\n for (int i = 800; i < 805; i++) {\n set2.add(i);\n }\n for (int i = 806; i < 1005; i++) {\n set2.add(i);\n }\n\n for (int i = 1000; i < 1005; i++) {\n expected.add(i);\n }\n\n verifyIntersection(expected, set1, set2);\n }", "@Test\n public void testIntersection4()\n {\n List<Integer> expected = new ArrayList<>();\n ConciseSet set1 = new ConciseSet();\n ConciseSet set2 = new ConciseSet();\n for (int i = 0; i < 1000; i++) {\n set1.add(i);\n if (i != 500) {\n set2.add(i);\n expected.add(i);\n }\n }\n\n verifyIntersection(expected, set1, set2);\n }", "private boolean isSubsetOf(List<String> permissions2,\n\t\t\tList<String> permissions3) {\n\t\treturn false;\n\t}", "Condition in(QueryParameter parameter, Object... values);", "@Test\n public void testBatchedInQuery() {\n TestDataCreator creator = new TestDataCreator(getSessionFactory());\n Town town = creator.createTestTown();\n\n int n = 10;\n List<Long> ids = new ArrayList<>(n);\n for (long i=0; i < n; i++) {\n Person savedPerson = creator.createTestPerson(town, \"P\" + i);\n ids.add(savedPerson.getId());\n }\n for (long i=0; i < n; i++) {\n creator.createTestPerson(town, \"P\" + i);\n }\n\n Person person = query.from(Person.class);\n query.where(person.getId()).in(ids, 2);\n\n validate(\"from Person hobj1 where hobj1.id in (:np1)\", ids);\n assertEquals(n, doQueryResult.size());\n }", "@Test\r\n public void testIsSubset1() {\r\n Assert.assertEquals(false, set1.isSubset(set2));\r\n }", "@Test\n public void testBoundsAsCompositesWithSliceRestrictionsAndOneClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newSingleSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newSingleSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n }", "@Test\r\n\tpublic void testContains() {\r\n\t\tAssert.assertTrue(list.contains(new Munitions(2, 3, \"iron\")));\r\n\t\tAssert.assertFalse(list.contains(new Munitions(2, 5, \"ferrum\")));\r\n\t}", "@Test\n @WithMockUhUser(username = \"iamtst04\")\n public void optInTest() throws Exception {\n assertFalse(isInCompositeGrouping(GROUPING, tst[0], tst[3]));\n assertTrue(isInBasisGroup(GROUPING, tst[0], tst[3]));\n assertTrue(isInExcludeGroup(GROUPING, tst[0], tst[3]));\n\n //tst[3] opts into Grouping\n mapGSRs(API_BASE + GROUPING + \"/optIn\");\n }", "@Test\n public void testDAM31201001() {\n // In this test case the where clause is specified in a common sql shared in multiple queries.\n testDAM30505001();\n }", "@Test\n \tpublic void whereClauseForNodeEdgeAnnotation() {\n \t\tnode23.addEdgeAnnotation(new Annotation(\"namespace1\", \"name1\"));\n \t\tnode23.addEdgeAnnotation(new Annotation(\"namespace2\", \"name2\", \"value2\", TextMatching.EXACT_EQUAL));\n \t\tnode23.addEdgeAnnotation(new Annotation(\"namespace3\", \"name3\", \"value3\", TextMatching.REGEXP_EQUAL));\n \t\tcheckWhereCondition(\n \t\t\t\tjoin(\"=\", \"_rank_annotation23_1.edge_annotation_namespace\", \"'namespace1'\"),\n \t\t\t\tjoin(\"=\", \"_rank_annotation23_1.edge_annotation_name\", \"'name1'\"),\n \t\t\t\tjoin(\"=\", \"_rank_annotation23_2.edge_annotation_namespace\", \"'namespace2'\"),\n \t\t\t\tjoin(\"=\", \"_rank_annotation23_2.edge_annotation_name\", \"'name2'\"),\n \t\t\t\tjoin(\"=\", \"_rank_annotation23_2.edge_annotation_value\", \"'value2'\"),\n \t\t\t\tjoin(\"=\", \"_rank_annotation23_3.edge_annotation_namespace\", \"'namespace3'\"),\n \t\t\t\tjoin(\"=\", \"_rank_annotation23_3.edge_annotation_name\", \"'name3'\"),\n \t\t\t\tjoin(\"~\", \"_rank_annotation23_3.edge_annotation_value\", \"'^value3$'\")\n \t\t);\n \t}", "@Test\r\n\t\tpublic void testIntersection() {\n\t\t\ttestingSet = new IntegerSet(list1);\r\n\t\t\ttestingSet2= new IntegerSet(list2);\r\n\t\t\t// create 3rdset = to the intersection list \r\n\t\t\ttestingSet3= new IntegerSet(intersection);\r\n\t\t\t// create 4th set =to the intersection of set1 and set2\r\n\t\t\ttestingSet4= testingSet.intersection(testingSet, testingSet2);\r\n\t\t\t// sets 3 and set 4 should be equal \r\n\t\t\t// assertEquals for these parameters is a deprecated method \r\n\t\t\tassertArrayEquals(testingSet3.toArray(),testingSet4.toArray());\t \r\n\t\t}", "@Test\n public void testIntersection1()\n {\n final int[] ints1 = {33, 100000};\n final int[] ints2 = {33, 100000};\n List<Integer> expected = Arrays.asList(33, 100000);\n\n ConciseSet set1 = new ConciseSet();\n for (int i : ints1) {\n set1.add(i);\n }\n ConciseSet set2 = new ConciseSet();\n for (int i : ints2) {\n set2.add(i);\n }\n\n verifyIntersection(expected, set1, set2);\n }", "@Test\n public void mapContains() {\n check(MAPCONT);\n query(MAPCONT.args(MAPNEW.args(), 1), false);\n query(MAPCONT.args(MAPENTRY.args(1, 2), 1), true);\n }", "@Test\n public void testIntersection5()\n {\n final int[] ints1 = {33, 100000};\n final int[] ints2 = {34, 200000};\n List<Integer> expected = new ArrayList<>();\n\n ConciseSet set1 = new ConciseSet();\n for (int i : ints1) {\n set1.add(i);\n }\n ConciseSet set2 = new ConciseSet();\n for (int i : ints2) {\n set2.add(i);\n }\n\n verifyIntersection(expected, set1, set2);\n }", "@Test\n\t public void test_Is_Subset_Positive() throws Exception{\t\n\t\t SET setarray= new SET( new int[]{1,2,3,4,5});\n\t\t SET subsetarray= new SET( new int[]{1,2,3});\n\t\t assertTrue(setarray.isSubSet(subsetarray));\t \n\t }", "@Test\n \tpublic void whereClauseForNodeInclusion() {\n \t\tnode23.addJoin(new Inclusion(node42));\n \t\tcheckWhereCondition(\n \t\t\t\tjoin(\"=\", \"_node23.text_ref\", \"_node42.text_ref\"),\n \t\t\t\tjoin(\"<=\", \"_node23.left\", \"_node42.left\"),\n \t\t\t\tjoin(\">=\", \"_node23.right\", \"_node42.right\")\n \t\t);\n \t}", "boolean hasConditionList();", "private static boolean fun3(List<String> res, List<String> ac1) {\n\t\tHashSet<String> hs=new HashSet<String>();\r\n\t\tfor(int i=0;i<res.size();i++){\r\n\t\t\ths.add(res.get(i));\r\n\t\t}\r\n\t\tfor(int i=0;i<ac1.size();i++){\r\n\t\t\tif(hs.contains(ac1.get(i)))\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "@Test\n public void should_iterate_with_default_params() throws Exception {\n long partitionKey = RandomUtils.nextLong(0,Long.MAX_VALUE);\n insertClusteredValues(partitionKey, 1, \"name1\", 5);\n\n Iterator<ClusteredEntity> iter = manager.sliceQuery(ClusteredEntity.class)\n .forIteration()\n .withPartitionComponents(partitionKey)\n .iterator();\n\n assertThat(iter.hasNext()).isTrue();\n ClusteredEntity next = iter.next();\n assertThat(next.getId().getCount()).isEqualTo(1);\n assertThat(next.getId().getName()).isEqualTo(\"name11\");\n assertThat(next.getValue()).isEqualTo(\"value11\");\n\n assertThat(iter.hasNext()).isTrue();\n next = iter.next();\n assertThat(next.getId().getCount()).isEqualTo(1);\n assertThat(next.getId().getName()).isEqualTo(\"name12\");\n assertThat(next.getValue()).isEqualTo(\"value12\");\n\n assertThat(iter.hasNext()).isTrue();\n next = iter.next();\n assertThat(next.getId().getCount()).isEqualTo(1);\n assertThat(next.getId().getName()).isEqualTo(\"name13\");\n assertThat(next.getValue()).isEqualTo(\"value13\");\n\n assertThat(iter.hasNext()).isTrue();\n next = iter.next();\n assertThat(next.getId().getCount()).isEqualTo(1);\n assertThat(next.getId().getName()).isEqualTo(\"name14\");\n assertThat(next.getValue()).isEqualTo(\"value14\");\n\n assertThat(iter.hasNext()).isTrue();\n next = iter.next();\n assertThat(next.getId().getCount()).isEqualTo(1);\n assertThat(next.getId().getName()).isEqualTo(\"name15\");\n assertThat(next.getValue()).isEqualTo(\"value15\");\n\n assertThat(iter.hasNext()).isFalse();\n }", "@Test\n public void testSqlExistsBasedJoin() {\n Query<Car> carsQuery = and(\n in(Car.FEATURES, \"sunroof\", \"convertible\"),\n existsIn(garages,\n Car.NAME,\n Garage.BRANDS_SERVICED,\n equal(Garage.LOCATION, \"Dublin\")\n )\n );\n\n Map<Car, Set<Garage>> results = new LinkedHashMap<Car, Set<Garage>>();\n for (Car car : cars.retrieve(carsQuery)) {\n Query<Garage> garagesWhichServiceThisCarInDublin\n = and(equal(Garage.BRANDS_SERVICED, car.name), equal(Garage.LOCATION, \"Dublin\"));\n for (Garage garage : garages.retrieve(garagesWhichServiceThisCarInDublin)) {\n Set<Garage> garagesWhichCanServiceThisCar = results.get(car);\n if (garagesWhichCanServiceThisCar == null) {\n garagesWhichCanServiceThisCar = new LinkedHashSet<Garage>();\n results.put(car, garagesWhichCanServiceThisCar);\n }\n garagesWhichCanServiceThisCar.add(garage);\n }\n }\n\n assertEquals(\"join results should contain 2 cars\", 2, results.size());\n Assert.assertTrue(\"join results should contain car1\", results.containsKey(car1));\n Assert.assertTrue(\"join results should contain car4\", results.containsKey(car4));\n\n assertEquals(\"join results for car1\", asSet(garage3, garage4), results.get(car1));\n assertEquals(\"join results for car4\", asSet(garage2), results.get(car4));\n }", "private boolean isSubset(List<ConceptLabel> outer, List<ConceptLabel> inner){\n\t\tfor(ConceptLabel in: inner){\n\t\t\tboolean c = false;\n\t\t\tfor(ConceptLabel l: outer){\n\t\t\t\tif(l.getText().equals(in.getText())){\n\t\t\t\t\tc = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(!c)\n\t\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneDescendingClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n }", "@Test\n public void testHeterogeneousSegmentFilterConditionLimit() throws SqlParseException {\n\n val project = \"heterogeneous_segment\";\n // val dfId = \"747f864b-9721-4b97-acde-0aa8e8656cba\"\n // val seg1Id = \"8892fa3f-f607-4eec-8159-7c5ae2f16942\"\n // val seg2Id = \"d75a822c-788a-4592-a500-cf20186dded1\"\n // val seg3Id = \"54eaf96d-6146-45d2-b94e-d5d187f89919\"\n // val seg4Id = \"411f40b9-a80a-4453-90a9-409aac6f7632\"\n // val seg5Id = \"a8318597-cb75-416f-8eb8-96ea285dd2b4\"\n // \n val sql = \"with T1 as (select cal_dt, trans_id \\n\" + \"from test_kylin_fact inner join test_account \\n\"\n + \"on test_kylin_fact.seller_id = test_account.account_id \\n\"\n + \"where cal_dt between date'2012-01-01' and date'2012-01-03'\\n\" + \"group by cal_dt, trans_id)\\n\";\n\n {\n val sqlWithTooManyOrs = sql + \" select * from T1 where \" + \"(cal_dt='2012-01-01' and trans_id = 1) or \\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 2) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 3) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 4) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 5) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 6) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 7) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 8) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 9) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 10) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 12) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 13) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 14) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 15) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 16) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 17) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 18) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 19) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 20)\";\n val contexts = OlapContextTestUtil.getOlapContexts(project, sqlWithTooManyOrs);\n Assert.assertEquals(\n \">=(DEFAULT.TEST_KYLIN_FACT.CAL_DT, 2012-01-01),<=(DEFAULT.TEST_KYLIN_FACT.CAL_DT, 2012-01-03)\",\n contexts.get(0).getExpandedFilterConditions().stream().map(RexNode::toString)\n .collect(Collectors.joining(\",\")));\n }\n\n {\n val sqlWithFilter = sql + \" select * from T1 where \" + \"(cal_dt='2012-01-01' and trans_id = 1) or \\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 2) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 3) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 4) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 5) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 6) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 7) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 8) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 9) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 10)\";\n val contexts = OlapContextTestUtil.getOlapContexts(project, sqlWithFilter);\n Assert.assertNotEquals(\n \">=(DEFAULT.TEST_KYLIN_FACT.CAL_DT, 2012-01-01),<=(DEFAULT.TEST_KYLIN_FACT.CAL_DT, 2012-01-03)\",\n contexts.get(0).getExpandedFilterConditions().stream().map(RexNode::toString)\n .collect(Collectors.joining(\",\")));\n }\n\n }", "@Test\n public void testBoundsAsCompositesWithMultiInRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n Restriction in = newMultiIN(cfMetaData, 0, asList(value1, value2), asList(value2, value3));\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(in);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertComposite(bounds.get(1), value2, value3, EOC.END);\n }", "public interface IStoppingCriteria {\n\n /**\n * Determine the degree of clustering agreement\n * @param cluster1 one clustering results\n * @param cluster2 the other clustering results\n * @return the degree of clustering agreement; 1 refers to be the same clustering results; 0 refers to be the totally different clustering results\n */\n public double computeSimilarity(int[] cluster1, int[] cluster2);\n\n}", "@Test\n public void testSqlExistsMultiValuedNoForeignRestriction() {\n Query<Garage> garagesQuery = not(\n existsIn(cars,\n Garage.BRANDS_SERVICED,\n Car.NAME\n )\n );\n\n Set<Garage> results = asSet(garages.retrieve(garagesQuery));\n\n assertEquals(\"should have 1 result\", 1, results.size());\n assertTrue(\"results should contain garage6\", results.contains(garage6));\n }", "@Test\n public void testOverlappingPartitionsOverlappingClusters()\n {\n check(overlappingClustersWithOverlappingPartitions(), 0.75, 1.0);\n }", "private boolean runMultiSampleCase() {\n\t\tArrayList<Candidate> candidates = collectTrioCandidates();\n\n\t\t// Then, check the candidates for all trios around affected individuals.\n\t\tfor (Candidate c : candidates)\n\t\t\tif (isCompatibleWithTriosAroundAffected(c))\n\t\t\t\treturn true;\n\t\treturn false;\n\t}", "@Override\r\n public boolean isSatisfied(Configuration cfg) {\r\n Set<Node> firstNodes = new HashSet<Node>();\r\n Set<Node> secondNodes = new HashSet<Node>();\r\n if (getFirstSet().size() == 0 || getSecondSet().size() == 0) {\r\n //FIXME debug log VJob.logger.error(this.toString() + \": Some sets of virtual machines are empty\");\r\n return false;\r\n }\r\n\r\n for (VirtualMachine vm : getFirstSet()) {\r\n if (cfg.isRunning(vm)) {\r\n firstNodes.add(cfg.getLocation(vm));\r\n }\r\n }\r\n for (VirtualMachine vm : getSecondSet()) {\r\n if (cfg.isRunning(vm)) {\r\n secondNodes.add(cfg.getLocation(vm));\r\n }\r\n }\r\n\r\n for (Node n : firstNodes) {\r\n if (secondNodes.contains(n)) {\r\n \tManagedElementList<Node> ns = new SimpleManagedElementList<Node>();\r\n ns.addAll(firstNodes);\r\n ns.retainAll(secondNodes);\r\n //FIXME debug log VJob.logger.error(this.toString() + \": Nodes host VMs of the two groups: \" + ns);\r\n return false;\r\n }\r\n }\r\n for (Node n : secondNodes) {\r\n if (firstNodes.contains(n)) {\r\n \tManagedElementList<Node> ns = new SimpleManagedElementList<Node>();\r\n ns.addAll(secondNodes);\r\n ns.retainAll(firstNodes);\r\n //FIXME debug log VJob.logger.error(this.toString() + \": Nodes host VMs of the two groups: \" + ns);\r\n return false;\r\n }\r\n }\r\n return true;\r\n }", "boolean hasContains();", "@Test\n public void testSqlExistsWithForeignRestriction() {\n Query<Car> carsQuery = and(\n in(Car.FEATURES, \"sunroof\", \"convertible\"),\n existsIn(garages,\n Car.NAME,\n Garage.BRANDS_SERVICED,\n equal(Garage.LOCATION, \"Dublin\")\n )\n );\n\n Set<Car> results = asSet(cars.retrieve(carsQuery));\n\n assertEquals(\"should have 2 results\", 2, results.size());\n assertTrue(\"results should contain car1\", results.contains(car1));\n assertTrue(\"results should contain car4\", results.contains(car4));\n }", "@Test(timeout = 4000)\n public void test056() throws Throwable {\n boolean boolean0 = SQLUtil.isQuery(\"SELECT * FROM join SELECT * FROM as SELECT * FROM on SELECT * FROM .SELECT * FROM = SELECT * FROM .SELECT * FROM and SELECT * FROM .null = SELECT * FROM .null and SELECT * FROM .SELECT * FROM = SELECT * FROM .SELECT * FROM and SELECT * FROM .null = SELECT * FROM .null and SELECT * FROM .null = SELECT * FROM .null and SELECT * FROM .null = SELECT * FROM .null\");\n assertTrue(boolean0);\n }", "@Test\n public void testBoundsAsCompositesWithMultiEqRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n Restriction eq = newMultiEq(cfMetaData, 0, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n }", "private static Restriction newMultiEq(CFMetaData cfMetaData, int firstIndex, ByteBuffer... values)\n {\n List<ColumnDefinition> columnDefinitions = new ArrayList<>();\n for (int i = 0; i < values.length; i++)\n {\n columnDefinitions.add(getClusteringColumnDefinition(cfMetaData, firstIndex + i));\n }\n return new MultiColumnRestriction.EQ(columnDefinitions, toMultiItemTerminal(values));\n }", "@Test\n public void allTrue() {\n assertTrue(getPredicateInstance(true, true).evaluate(getTestValue()),\n \"multiple true predicates evaluated to false\");\n assertTrue(getPredicateInstance(true, true, true).evaluate(getTestValue()),\n \"multiple true predicates evaluated to false\");\n }", "@Test\n public void testContainsAll_Contains_Overflow() {\n\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>(2, 2);\n instance.add(3);\n instance.add(2);\n instance.add(1);\n instance.add(4);\n instance.add(5);\n instance.add(4);\n instance.add(7);\n\n Collection c = Arrays.asList(3, 4, 5, 7);\n\n boolean expResult = true;\n boolean result = instance.containsAll(c);\n assertEquals(expResult, result);\n }", "@Test\n public void testBoundsAsCompositesWithSliceRestrictionsAndOneDescendingClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newSingleSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newSingleSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n }", "@Test\n public void testIntersection2()\n {\n final int[] ints1 = {33, 100000};\n final int[] ints2 = {34, 100000};\n List<Integer> expected = Collections.singletonList(100000);\n\n ConciseSet set1 = new ConciseSet();\n for (int i : ints1) {\n set1.add(i);\n }\n ConciseSet set2 = new ConciseSet();\n for (int i : ints2) {\n set2.add(i);\n }\n\n verifyIntersection(expected, set1, set2);\n }", "@Test\n public void testGetValues(){\n assertTrue(vector.x == 1 && vector.z == 1);\n }", "boolean hasPermissionOfCluster(String clusterId, String userName);", "public void execute_multipleParameterPredicate_test(int expectedNum, String userInput, String parameter,\n boolean isIgnoreCase, boolean isAnd,\n List<Person> expectedList) throws ParseException {\n String expectedMessage = String.format(MESSAGE_PERSONS_LISTED_OVERVIEW, expectedNum);\n ContainsKeywordsPredicate predicate = prepareMultiPredicate(isIgnoreCase, isAnd, userInput, parameter);\n PatientFindCommand command = new PatientFindCommand(predicate);\n expectedModel.updateFilteredPersonList(predicate);\n assertCommandSuccess(command, model, commandHistory, expectedMessage, expectedModel);\n assertEquals(expectedList, model.getFilteredPersonList());\n }", "public void testQuery() throws Exception {\n DummyApprovalRequest req1 = new DummyApprovalRequest(reqadmin, null, caid, SecConst.EMPTY_ENDENTITYPROFILE, false);\n DummyApprovalRequest req2 = new DummyApprovalRequest(admin1, null, caid, SecConst.EMPTY_ENDENTITYPROFILE, false);\n DummyApprovalRequest req3 = new DummyApprovalRequest(admin2, null, 3, 2, false);\n\n approvalSessionRemote.addApprovalRequest(admin1, req1, gc);\n approvalSessionRemote.addApprovalRequest(admin1, req2, gc);\n approvalSessionRemote.addApprovalRequest(admin1, req3, gc);\n\n // Make som queries\n Query q1 = new Query(Query.TYPE_APPROVALQUERY);\n q1.add(ApprovalMatch.MATCH_WITH_APPROVALTYPE, BasicMatch.MATCH_TYPE_EQUALS, \"\" + req1.getApprovalType());\n\n List result = approvalSessionRemote.query(admin1, q1, 0, 3, \"cAId=\" + caid, \"(endEntityProfileId=\" + SecConst.EMPTY_ENDENTITYPROFILE + \")\");\n assertTrue(\"Result size \" + result.size(), result.size() >= 2 && result.size() <= 3);\n\n result = approvalSessionRemote.query(admin1, q1, 1, 3, \"cAId=\" + caid, \"(endEntityProfileId=\" + SecConst.EMPTY_ENDENTITYPROFILE + \")\");\n assertTrue(\"Result size \" + result.size(), result.size() >= 1 && result.size() <= 3);\n\n result = approvalSessionRemote.query(admin1, q1, 0, 1, \"cAId=\" + caid, \"(endEntityProfileId=\" + SecConst.EMPTY_ENDENTITYPROFILE + \")\");\n assertTrue(\"Result size \" + result.size(), result.size() == 1);\n\n Query q2 = new Query(Query.TYPE_APPROVALQUERY);\n q2.add(ApprovalMatch.MATCH_WITH_STATUS, BasicMatch.MATCH_TYPE_EQUALS, \"\" + ApprovalDataVO.STATUS_WAITINGFORAPPROVAL, Query.CONNECTOR_AND);\n q2.add(ApprovalMatch.MATCH_WITH_REQUESTADMINCERTSERIALNUMBER, BasicMatch.MATCH_TYPE_EQUALS, reqadmincert.getSerialNumber().toString(16));\n\n result = approvalSessionRemote.query(admin1, q1, 1, 3, \"cAId=\" + caid, \"(endEntityProfileId=\" + SecConst.EMPTY_ENDENTITYPROFILE + \")\");\n assertTrue(\"Result size \" + result.size(), result.size() >= 1 && result.size() <= 3);\n\n // Remove the requests\n int id1 = ((ApprovalDataVO) approvalSessionRemote.findApprovalDataVO(admin1, req1.generateApprovalId()).iterator().next()).getId();\n int id2 = ((ApprovalDataVO) approvalSessionRemote.findApprovalDataVO(admin1, req2.generateApprovalId()).iterator().next()).getId();\n int id3 = ((ApprovalDataVO) approvalSessionRemote.findApprovalDataVO(admin1, req3.generateApprovalId()).iterator().next()).getId();\n approvalSessionRemote.removeApprovalRequest(admin1, id1);\n approvalSessionRemote.removeApprovalRequest(admin1, id2);\n approvalSessionRemote.removeApprovalRequest(admin1, id3);\n }", "@Test\n public void testMultiCrossJoin() throws Exception {\n String sql = \"SELECT * FROM (g1 cross join g2) cross join g3\";\n Node fileNode = sequenceSql(sql, TSQL_QUERY);\n Node queryNode = verify(fileNode, Query.ID, Query.ID);\n\n Node selectNode = verify(queryNode, Query.SELECT_REF_NAME, Select.ID);\n\n verify(selectNode, Select.SYMBOLS_REF_NAME, MultipleElementSymbol.ID);\n\n Node fromNode = verify(queryNode, Query.FROM_REF_NAME, From.ID);\n\n Node jpNode1 = verify(fromNode, From.CLAUSES_REF_NAME, JoinPredicate.ID);\n verifyJoin(jpNode1, JoinTypeTypes.JOIN_CROSS);\n\n Node jpNode2 = verify(jpNode1, JoinPredicate.LEFT_CLAUSE_REF_NAME, JoinPredicate.ID);\n verifyJoin(jpNode2, JoinTypeTypes.JOIN_CROSS);\n\n verifyUnaryFromClauseGroup(jpNode2, JoinPredicate.LEFT_CLAUSE_REF_NAME, \"g1\");\n verifyUnaryFromClauseGroup(jpNode2, JoinPredicate.RIGHT_CLAUSE_REF_NAME, \"g2\");\n verifyUnaryFromClauseGroup(jpNode1, JoinPredicate.RIGHT_CLAUSE_REF_NAME, \"g3\");\n \n verifySql(\"SELECT * FROM (g1 CROSS JOIN g2) CROSS JOIN g3\", fileNode);\n }", "@Test\n public void testMultipleLabelsWithAndOperatorCriteria() throws Exception {\n JobQueryCriteria<TitusTaskState, TitusJobType> query = queryBuilder.withLabels(\n expectedLabels().with(\"labelA\").with(\"labelB\").build()\n ).withLabelsAndOp(true).build();\n\n assertThat(JobQueryCriteriaEvaluator.matches(job, query)).isTrue();\n\n // One of the labels is missing\n JobQueryCriteria<TitusTaskState, TitusJobType> query2 = queryBuilder.withLabels(\n expectedLabels().with(\"labelB\").with(\"missing_label\").build()\n ).withLabelsAndOp(true).build();\n\n assertThat(JobQueryCriteriaEvaluator.matches(job, query2)).isFalse();\n }", "@Test\n public void testMultiCrossJoin2() throws Exception {\n String sql = \"SELECT * FROM (g1 cross join g2) cross join (g3 cross join g4)\";\n Node fileNode = sequenceSql(sql, TSQL_QUERY);\n\n Node queryNode = verify(fileNode, Query.ID, Query.ID);\n\n Node selectNode = verify(queryNode, Query.SELECT_REF_NAME, Select.ID);\n\n verify(selectNode, Select.SYMBOLS_REF_NAME, MultipleElementSymbol.ID);\n\n Node fromNode = verify(queryNode, Query.FROM_REF_NAME, From.ID);\n\n Node jpNode1 = verify(fromNode, From.CLAUSES_REF_NAME, JoinPredicate.ID);\n verifyJoin(jpNode1, JoinTypeTypes.JOIN_CROSS);\n\n Node jpNode2 = verify(jpNode1, JoinPredicate.LEFT_CLAUSE_REF_NAME, JoinPredicate.ID);\n verifyJoin(jpNode2, JoinTypeTypes.JOIN_CROSS);\n\n Node jpNode3 = verify(jpNode1, JoinPredicate.RIGHT_CLAUSE_REF_NAME, JoinPredicate.ID);\n verifyJoin(jpNode3, JoinTypeTypes.JOIN_CROSS);\n \n verifyUnaryFromClauseGroup(jpNode2, JoinPredicate.LEFT_CLAUSE_REF_NAME, \"g1\");\n verifyUnaryFromClauseGroup(jpNode2, JoinPredicate.RIGHT_CLAUSE_REF_NAME, \"g2\");\n\n verifyUnaryFromClauseGroup(jpNode3, JoinPredicate.LEFT_CLAUSE_REF_NAME, \"g3\");\n verifyUnaryFromClauseGroup(jpNode3, JoinPredicate.RIGHT_CLAUSE_REF_NAME, \"g4\");\n \n verifySql(\"SELECT * FROM (g1 CROSS JOIN g2) CROSS JOIN (g3 CROSS JOIN g4)\", fileNode);\n }", "private boolean doAllDataSourcesHaveSamples(List<ILogicalOperator> leafInputs, IOptimizationContext context)\n throws AlgebricksException {\n for (ILogicalOperator li : leafInputs) {\n DataSourceScanOperator scanOp = (DataSourceScanOperator) findDataSourceScanOperator(li);\n if (scanOp == null)\n continue;\n Index index = joinEnum.getStatsHandle().findSampleIndex(scanOp, context);\n if (index == null) {\n return false;\n }\n }\n return true;\n }", "public void matchesDemo() \n {\n Map<String, Set<String>> clientMap = new HashMap<>();\n Set<String> interests = new HashSet<>();\n\n interests.add(\"Food\");\n interests.add(\"Wine\");\n interests.add(\"Tandems\");\n clientMap.put(\"Hal\", interests);\n\t \n interests = new HashSet<>();\n interests.add(\"Food\");\n interests.add(\"Walking\");\n interests.add(\"Welding\");\n clientMap.put(\"Gemma\", interests);\n\t \n interests = new HashSet<>();\n interests.add(\"Food\");\n interests.add(\"Cinema\");\n interests.add(\"Wine\");\n clientMap.put(\"Caroline\", interests);\n\n Set<String> halsInterests = clientMap.get(\"Hal\");\n String outputString;\n Set<String> eachClientInterests;\n Set<String> intersection;\n\n for (String eachClient : clientMap.keySet()) \n {\n eachClientInterests = clientMap.get(eachClient);\n intersection = new HashSet<>(halsInterests);\n intersection.retainAll(eachClientInterests);\n outputString = \"Hal and \" + eachClient \n + \" have common interests: \"\n + intersection;\n System.out.println(outputString) ;\n }\n }", "@Test\n public void testContainsAll_Not_Contain() {\n\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>();\n instance.add(3);\n instance.add(2);\n instance.add(1);\n instance.add(4);\n\n Collection c = Arrays.asList(1, 2, 5);\n\n boolean expResult = false;\n boolean result = instance.containsAll(c);\n assertEquals(expResult, result);\n }", "@Test\n public void testMultiCrossJoin3() throws Exception {\n String sql = \"SELECT * FROM g1 cross join (g2 cross join g3)\";\n Node fileNode = sequenceSql(sql, TSQL_QUERY);\n\n Node queryNode = verify(fileNode, Query.ID, Query.ID);\n\n Node selectNode = verify(queryNode, Query.SELECT_REF_NAME, Select.ID);\n verify(selectNode, Select.SYMBOLS_REF_NAME, MultipleElementSymbol.ID);\n\n Node fromNode = verify(queryNode, Query.FROM_REF_NAME, From.ID);\n\n Node jpNode1 = verify(fromNode, From.CLAUSES_REF_NAME, JoinPredicate.ID);\n verifyJoin(jpNode1, JoinTypeTypes.JOIN_CROSS);\n \n Node jpNode2 = verify(jpNode1, JoinPredicate.RIGHT_CLAUSE_REF_NAME, JoinPredicate.ID);\n verifyJoin(jpNode2, JoinTypeTypes.JOIN_CROSS);\n \n verifyUnaryFromClauseGroup(jpNode1, JoinPredicate.LEFT_CLAUSE_REF_NAME, \"g1\");\n\n verifyUnaryFromClauseGroup(jpNode2, JoinPredicate.LEFT_CLAUSE_REF_NAME, \"g2\");\n verifyUnaryFromClauseGroup(jpNode2, JoinPredicate.RIGHT_CLAUSE_REF_NAME, \"g3\");\n \n verifySql(\"SELECT * FROM g1 CROSS JOIN (g2 CROSS JOIN g3)\", fileNode);\n }", "@Test\n public void getGraph1() throws Exception {\n try (final Graph g1 = dataset.getGraph(graph1).get()) {\n assertEquals(4, g1.size());\n\n assertTrue(g1.contains(alice, name, aliceName));\n assertTrue(g1.contains(alice, knows, bob));\n assertTrue(g1.contains(alice, member, null));\n assertTrue(g1.contains(null, name, secretClubName));\n }\n }", "@Test\n public void testContains_Contain() {\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>();\n instance.add(1);\n instance.add(2);\n instance.add(3);\n\n boolean expResult = true;\n boolean result = instance.contains(1);\n assertEquals(expResult, result);\n }", "private boolean isSubsetOf(int firstRow, int secondRow) {\n for (int i = 0; i < universalSetSize; i++) {\n if (input[firstRow][i] && !input[secondRow][i]) {\n return false;\n }\n }\n return true;\n }", "public void test_containsII() {\n\tfinal int COUNT = 60000000;\n\t\n\tRectangle r = new Rectangle(1, 2, 3, 4);\n\n\tPerformanceMeter meter = createMeter(\"contains\");\n\tmeter.start();\n\tfor (int i = 0; i < COUNT; i++) {\n\t\tr.contains(2, 3);\t// does contain\n\t}\n\tmeter.stop();\n\t\n\tdisposeMeter(meter);\n\t\n\tmeter = createMeter(\"disjoint\");\n\tmeter.start();\n\tfor (int i = 0; i < COUNT; i++) {\n\t\tr.contains(9, 12);\t// does not contain\n\t}\n\tmeter.stop();\n\t\n\tdisposeMeter(meter);\n}", "private boolean checksetunions(Set<String> set, HashMap<String, ArrayList<String>> c) {\n\t\tObject[] ckeys = c.keySet().toArray();\r\n\t\tfor (int i = 0; i < c.keySet().size(); i++) {\r\n\t\t\tif (c.get(ckeys[i]).containsAll(set)) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "private ClusterCombination checkAndDoJoinMultiPearson(ClusterCombination CC1, ClusterCombination CC2) {\n boolean doJoin = true;\r\n ArrayList<Cluster> CCList = new ArrayList<>(CC1.getClusters().size()+1); //list of output clusters for new CC if join is succesfull\r\n\r\n ArrayList<Cluster> CC1Clusters = CC1.getClusters();\r\n ArrayList<Cluster> CC2Clusters = CC2.getClusters();\r\n\r\n ArrayList<Cluster> LHS1 = CC1.getLHS();\r\n ArrayList<Cluster> LHS2 = CC2.getLHS();\r\n\r\n ArrayList<Cluster> RHS1 = CC1.getRHS();\r\n ArrayList<Cluster> RHS2 = CC2.getRHS();\r\n\r\n for(int i =0; i<CC1Clusters.size()-1; i++) {\r\n Cluster C1 = CC1Clusters.get(i);\r\n Cluster C2 = CC2Clusters.get(i);\r\n\r\n boolean overlap = checkClusterOverlap(C1, C2); // check if there is some overlap\r\n\r\n\r\n\r\n if(!overlap){ //the cluster in this position does not overlap, we don't need to join\r\n doJoin=false;\r\n break;\r\n }else{ // there is overlap, add the intersection of C1 and C2\r\n if(C1.getNPoints() <= C2.getNPoints()){\r\n CCList.add(C1);\r\n }else{\r\n CCList.add(C2);\r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n\r\n if(doJoin){ // each cluster in the candidate (except the last) does overlap\r\n // so, according to apriori, we join -> return the overlapping clusters + the last clusters of CC1 and CC2\r\n Cluster lastCC1 = CC1Clusters.get(CC1Clusters.size()-1);\r\n Cluster lastCC2 = CC2Clusters.get(CC2Clusters.size()-1);\r\n if(lastCC1.getClusterId() <= lastCC2.getClusterId()){ // make sure to respect ordering of clusters within a candidate by ID. otherwise this could be designated as a duplicate\r\n CCList.add(lastCC1); CCList.add(lastCC2);\r\n }else{\r\n CCList.add(lastCC2); CCList.add(lastCC1);\r\n }\r\n\r\n ArrayList<Cluster> newLHS = new ArrayList<>();\r\n ArrayList<Cluster> newRHS = new ArrayList<>();\r\n for(int i = 0; i<LHS1.size(); i++){\r\n newLHS.add(CCList.get(i));\r\n }\r\n for(int i = LHS1.size(); i<CCList.size(); i++){\r\n newRHS.add(CCList.get(i));\r\n }\r\n\r\n ClusterCombination newCC = new MultiPearsonClusterCombination(newLHS, newRHS);\r\n newCC.checkAndSetMaxSubsetLowerBound(Math.max(CC1.getLB(), CC1.getMaxLowerBoundSubset()));\r\n newCC.checkAndSetMaxSubsetLowerBound(Math.max(CC2.getLB(), CC2.getMaxLowerBoundSubset()));\r\n\r\n return newCC;\r\n\r\n }else{\r\n return null;\r\n }\r\n }", "public void sensibleMatches1() \n { \n Map<String, Set<String>> clientMap = new HashMap<>();\n Set<String> interests = new HashSet<>();\n\n interests.add(\"Food\");\n interests.add(\"Wine\");\n interests.add(\"Tandems\");\n clientMap.put(\"Hal\", interests);\n\t \n interests = new HashSet<>();\n interests.add(\"Food\");\n interests.add(\"Walking\");\n interests.add(\"Welding\");\n clientMap.put(\"Gemma\", interests);\n\t \n interests = new HashSet<>();\n interests.add(\"Food\");\n interests.add(\"Cinema\");\n interests.add(\"Wine\");\n clientMap.put(\"Caroline\", interests);\n\n Set<String> halsInterests = clientMap.get(\"Hal\");\n String outputString;\n Set<String> eachClientInterests;\n Set<String> intersection ;\n\n Map<String, Set<String>> mapWithoutHal = new HashMap<>(clientMap);\n mapWithoutHal.remove(\"Hal\");\n for (String eachClient : mapWithoutHal.keySet()) \n {\n eachClientInterests = clientMap.get(eachClient);\n intersection = new HashSet<>(halsInterests);\n intersection.retainAll(eachClientInterests);\n outputString = \"Hal and \" + eachClient \n + \" have common interests: \"\n + intersection;\n System.out.println(outputString);\n }\n }", "@Test\n\tpublic void testBooleanTrueMultipleSource() throws Exception {\n\t\tprepareTest(Arrays.asList(\"/tests/basic/data01endpoint1.ttl\", \"/tests/basic/data01endpoint2.ttl\"));\n\t\texecute(\"/tests/basic/query03a.rq\", \"/tests/basic/query03.srx\", false);\n\t}", "@Test\n void shouldBeInsideMap()\n {\n assertTrue(map.isInsideMap(new Vector2(0,0)));\n\n assertTrue(map.isInsideMap(new Vector2(4,0)));\n\n assertTrue(map.isInsideMap(new Vector2(4,4)));\n\n assertTrue(map.isInsideMap(new Vector2(1,3)));\n }", "private boolean in(Integer e, ArrayList<Integer> l) {\n for (int i=0; i<l.size();i++) {\n if (l.get(i) == e) {\n return true;\n }\n }\n return false;\n }", "public void sensibleMatches2() \n { \n Map<String, Set<String>> clientMap = new HashMap<>();\n Set<String> interests = new HashSet<>();\n\n interests.add(\"Food\");\n interests.add(\"Wine\");\n interests.add(\"Tandems\");\n clientMap.put(\"Hal\", interests);\n\t \n interests = new HashSet<>();\n interests.add(\"Food\");\n interests.add(\"Walking\");\n interests.add(\"Welding\");\n clientMap.put(\"Gemma\", interests);\n\n interests = new HashSet<>();\n interests.add(\"Food\");\n interests.add(\"Cinema\");\n interests.add(\"Wine\");\n clientMap.put(\"Caroline\", interests);\n\n Set<String> halsInterests = clientMap.get(\"Hal\");\n String outputString;\n Set<String> eachClientInterests;\n Set<String> intersection ;\n\n for (String eachClient : clientMap.keySet()) \n {\n if (!eachClient.equals(\"Hal\")) \n {\n eachClientInterests = clientMap.get(eachClient);\n intersection = new HashSet<>(halsInterests);\n intersection.retainAll(eachClientInterests);\n outputString = \"Hal and \" + eachClient \n + \" have common interests: \"\n + intersection;\n System.out.println(outputString);\n }\n }\n }", "@Test\n public void sharedFilterEnsuresUniqueResults() {\n Filter filter = new Filter(\"test-filter\");\n final Dataset dataset1 = new Dataset(\"TEST1\", \"sql\", filter);\n final Dataset dataset2 = new Dataset(\"TEST2\", \"sql2\", filter); // shared same filter\n\n List<String> entry1 = new ArrayList<>();\n entry1.add(\"001\");\n entry1.add(\"aaa\");\n\n List<String> entry2 = new ArrayList<>();\n entry2.add(\"002\");\n entry2.add(\"bbb\");\n\n List<String> entry3 = new ArrayList<>();\n entry3.add(\"003\");\n entry3.add(\"ccc\");\n\n List<String> entry4 = new ArrayList<>();\n entry4.add(\"004\");\n entry4.add(\"ddd\");\n\n List<List<String>> queryResults1 = new ArrayList<>();\n queryResults1.add(entry1);\n queryResults1.add(entry2);\n queryResults1.add(entry3);\n queryResults1.add(entry4);\n\n List<String> entry5 = new ArrayList<>();\n entry5.add(\"005\"); // different\n entry5.add(\"eee\");\n\n List<String> entry6 = new ArrayList<>();\n entry6.add(\"002\"); // same\n entry6.add(\"bbb\");\n\n List<String> entry7 = new ArrayList<>();\n entry7.add(\"007\"); // different\n entry7.add(\"fff\");\n\n List<String> entry8 = new ArrayList<>();\n entry8.add(\"004\"); // same\n entry8.add(\"ddd\");\n\n List<List<String>> queryResults2 = new ArrayList<>();\n queryResults2.add(entry5);\n queryResults2.add(entry6);\n queryResults2.add(entry7);\n queryResults2.add(entry8);\n\n // given\n dataset1.populateCache(queryResults1, 200L);\n dataset2.populateCache(queryResults2, 300L);\n\n // when\n final List<String> result1 = dataset1.getCachedResult();\n final List<String> result2 = dataset1.getCachedResult();\n final List<String> result3 = dataset1.getCachedResult();\n final List<String> result4 = dataset1.getCachedResult();\n final List<String> result5 = dataset2.getCachedResult();\n final List<String> result6 = dataset2.getCachedResult();\n\n // then\n assertEquals(\"Wrong result 1\", entry1, result1); // first datset is as-is\n assertEquals(\"Wrong result 2\", entry2, result2); // first datset is as-is\n assertEquals(\"Wrong result 3\", entry3, result3); // first datset is as-is\n assertEquals(\"Wrong result 4\", entry4, result4); // first datset is as-is\n assertEquals(\"Wrong result 3\", entry5, result5); // second datset, not filtered out\n assertEquals(\"Wrong result 3\", entry7, result6); // second dataset, entry6 is filtered out\n\n // and\n try {\n dataset1.getCachedResult();\n fail(\"Expected to run out of data\");\n\n } catch (IllegalStateException ex) {\n assertEquals(\"Wrong error\", \"No more data available for dataset: TEST1\", ex.getMessage());\n }\n\n try {\n // entry7 should be filtered out, resulting in no more data\n dataset2.getCachedResult();\n fail(\"Expected to run out of data\");\n\n } catch (IllegalStateException ex) {\n assertEquals(\"Wrong error\", \"No more data available for dataset: TEST2\", ex.getMessage());\n }\n\n // and\n assertEquals(\"Wrong cache size\", Optional.of(4), dataset1.getMetrics().getCacheSize());\n assertEquals(\"Wrong timing\", Optional.of(200L), dataset1.getMetrics().getTimingMilliseconds());\n assertEquals(\"Wrong cache requested\", Optional.of(5), dataset1.getMetrics().getCacheRequested());\n assertEquals(\"Wrong filtered out\", Optional.empty(), dataset1.getMetrics().getFilteredOut());\n\n // and\n assertEquals(\"Wrong cache size\", Optional.of(4), dataset2.getMetrics().getCacheSize());\n assertEquals(\"Wrong timing\", Optional.of(300L), dataset2.getMetrics().getTimingMilliseconds());\n assertEquals(\"Wrong cache requested\", Optional.of(3), dataset2.getMetrics().getCacheRequested());\n assertEquals(\"Wrong filtered out\", Optional.of(2), dataset2.getMetrics().getFilteredOut());\n }", "@Test\n \tpublic void whereClauseForNodeAnnotation() {\n \t\tnode23.addNodeAnnotation(new Annotation(\"namespace1\", \"name1\"));\n \t\tnode23.addNodeAnnotation(new Annotation(\"namespace2\", \"name2\", \"value2\", TextMatching.EXACT_EQUAL));\n \t\tnode23.addNodeAnnotation(new Annotation(\"namespace3\", \"name3\", \"value3\", TextMatching.REGEXP_EQUAL));\n \t\tcheckWhereCondition(\n \t\t\t\tjoin(\"=\", \"_annotation23_1.node_annotation_namespace\", \"'namespace1'\"),\n \t\t\t\tjoin(\"=\", \"_annotation23_1.node_annotation_name\", \"'name1'\"),\n \t\t\t\tjoin(\"=\", \"_annotation23_2.node_annotation_namespace\", \"'namespace2'\"),\n \t\t\t\tjoin(\"=\", \"_annotation23_2.node_annotation_name\", \"'name2'\"),\n \t\t\t\tjoin(\"=\", \"_annotation23_2.node_annotation_value\", \"'value2'\"),\n \t\t\t\tjoin(\"=\", \"_annotation23_3.node_annotation_namespace\", \"'namespace3'\"),\n \t\t\t\tjoin(\"=\", \"_annotation23_3.node_annotation_name\", \"'name3'\"),\n \t\t\t\tjoin(\"~\", \"_annotation23_3.node_annotation_value\", \"'^value3$'\")\n \t\t);\n \t}", "@Test\r\n\tpublic void testAdjacency33() {\r\n\t\tBoardCell cell = board.getCell(3, 3);\r\n\t\tSet<BoardCell> testList = board.getAdjList(cell);\r\n\t\tassertTrue(testList != null);\r\n\t\tassertTrue(testList.contains(board.getCell(2, 3)));\r\n\t\tassertTrue(testList.contains(board.getCell(3, 2)));\r\n\t\tassertEquals(2, testList.size());\r\n\t}", "@Test\n public void testSetCriteria0() throws Exception {\n String sql = \"SELECT a FROM db.g WHERE b IN (1000,5000)\";\n Node fileNode = sequenceSql(sql, TSQL_QUERY);\n\n Node queryNode = verify(fileNode, Query.ID, Query.ID);\n\n Node selectNode = verify(queryNode, Query.SELECT_REF_NAME, Select.ID);\n verifyElementSymbol(selectNode, Select.SYMBOLS_REF_NAME, \"a\");\n\n Node fromNode = verify(queryNode, Query.FROM_REF_NAME, From.ID);\n verifyUnaryFromClauseGroup(fromNode, From.CLAUSES_REF_NAME, \"db.g\");\n\n Node criteriaNode = verify(queryNode, Query.CRITERIA_REF_NAME, SetCriteria.ID);\n verifyElementSymbol(criteriaNode, AbstractSetCriteria.EXPRESSION_REF_NAME, \"b\");\n verifyConstant(criteriaNode, SetCriteria.VALUES_REF_NAME, 1, 1000);\n verifyConstant(criteriaNode, SetCriteria.VALUES_REF_NAME, 2, 5000);\n\n verifySql(\"SELECT a FROM db.g WHERE b IN (1000, 5000)\", fileNode);\n }", "@Test\n public void testBoundsAsCompositesWithEqAndSliceRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n\n Restriction eq = newSingleEq(cfMetaData, 0, value3);\n\n Restriction slice = newSingleSlice(cfMetaData, 1, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 1, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 1, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 1, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 1, Bound.START, false, value1);\n Restriction slice2 = newSingleSlice(cfMetaData, 1, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value2, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 1, Bound.START, true, value1);\n slice2 = newSingleSlice(cfMetaData, 1, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value2, EOC.END);\n }", "@Test\n @IfProfileValue(name=\"dept-test-group\", values={\"all\",\"role\"})\n public void _4_2_4_findMultiRolesByOccupant() throws Exception {\n /*d_2---r_2---s_1*/\n /*d_1_1---r_1_1-occupant-s_1*/\n this.mockMvc.perform(get(\"/api/v1.0/companies/\"+\n c_1.getId()+\"/departments/**/roles?occupant=\"+\n s_1.getId())\n .header(AUTHORIZATION, ACCESS_TOKEN))\n .andDo(print())\n .andExpect(status().isOk())\n .andExpect(jsonPath(\"$._embedded.roles\",hasSize(2)));\n }", "@Test\n \tpublic void whereClauseForNodeSameSpan() {\n \t\tnode23.addJoin(new SameSpan(node42));\n \t\tcheckWhereCondition(\n \t\t\t\tjoin(\"=\", \"_node23.text_ref\", \"_node42.text_ref\"),\n \t\t\t\tjoin(\"=\", \"_node23.left\", \"_node42.left\"),\n \t\t\t\tjoin(\"=\", \"_node23.right\", \"_node42.right\")\n \t\t);\n \t}", "public static void main (String args[])\n\t {\n\t int set[] = {3, 34, 4, 12, 5, 2};\n\t int sum = 9;\n\t int n = set.length;\n\t if (isSubsetSum(set, n, sum) == true)\n\t System.out.println(\"Found a subset with given sum\");\n\t else\n\t System.out.println(\"No subset with given sum\");\n\t }", "@Test(timeout = 4000)\n public void test056() throws Throwable {\n boolean boolean0 = SQLUtil.isQuery(\"SELECT * FROM null WHERE delete = 'delete' AND delete = 'delete' AND delete = 'delete' AND delete = 'delete' AND delete = 'delete' AND delete = 'delete' AND delete = 'delete'\");\n assertTrue(boolean0);\n }", "private boolean allTrue(CompositeTrue predicate) {\n if (kids.isEmpty()) {\n return false;\n }\n\n Iterator<E> i = kids.iterator();\n while (i.hasNext()) {\n E future = i.next();\n if (!predicate.isTrue(future)) {\n return false;\n }\n }\n return true;\n }", "@Test\n public void testHardClustersWithOverlappingPartitions()\n {\n check(hardClustersWithOverlappingPartitions(), 0.0, 1.0);\n }", "@Test\n \tpublic void whereClauseForNodeOverlap() {\n \t\tnode23.addJoin(new Overlap(node42));\n \t\tcheckWhereCondition(\n \t\t\t\tjoin(\"=\", \"_node23.text_ref\", \"_node42.text_ref\"),\n \t\t\t\tjoin(\"<=\", \"_node23.left\", \"_node42.right\"),\n \t\t\t\tjoin(\"<=\", \"_node42.left\", \"_node23.right\")\n \t\t);\n \t}", "Boolean subset(MultiSet<X> s);", "boolean inCommunities(String element);", "public void testContainsVertex() {\n System.out.println(\"containsVertex\");\n\n Graph<Integer, Edge<Integer>> graph = generateGraph();\n\n for (int i = 0; i < 25; i++) {\n Assert.assertTrue(graph.containsVertex(new Integer(i)));\n }\n }", "@Test\n @IfProfileValue(name=\"dept-test-group\", values={\"all\",\"role\"})\n public void _4_2_6_findMultiRolesByNameRecusiveExist() throws Exception {\n this.mockMvc.perform(get(\"/api/v1.0/companies/\"+\n c_1.getId()+\"/departments/\"+\n d_1.getId()+\n \"/roles?name=VP\")\n .header(AUTHORIZATION, ACCESS_TOKEN))\n .andDo(print())\n .andExpect(status().isOk())\n .andExpect(jsonPath(\"$._embedded.roles\",hasSize(1)))\n .andExpect(jsonPath(\"$._embedded.roles[0].id\",is(r_1.getId().toString())));\n }", "@Test\n\t public void test_Is_Subset_Negative() throws Exception{\t\n\t\t SET setarray= new SET( new int[]{1,2,3,4,5});\n\t\t SET subsetarray= new SET( new int[]{7,8});\n\t\t assertFalse(setarray.isSubSet(subsetarray));\t \n\t }", "@Test\n public void testContains_Contain_Overflow_Boundary() {\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>(2, 2);\n instance.add(1);\n instance.add(2);\n instance.add(3);\n instance.add(4);\n instance.add(5);\n instance.add(6);\n\n boolean expResult = true;\n boolean result = instance.contains(6);\n assertEquals(expResult, result);\n }", "public void testContainsEdge() {\n System.out.println(\"containsEdge\");\n\n Graph<Integer, Edge<Integer>> graph = generateGraph();\n\n for (int i = 0; i < 25; i++) {\n for (int j = 0; j < 25; j++) {\n if ((i + j) % 2 != 0) {\n Assert.assertFalse(graph.containsEdge(new Integer(i), new Integer(j)));\n } else {\n Assert.assertTrue(graph.containsEdge(new Integer(i), new Integer(j)));\n }\n }\n }\n\n }" ]
[ "0.61198837", "0.5869325", "0.5798154", "0.5756744", "0.57301205", "0.56089854", "0.5600606", "0.5582519", "0.5569344", "0.5557465", "0.55423385", "0.5537578", "0.5461619", "0.5334623", "0.53114283", "0.52911013", "0.5275716", "0.5253202", "0.5250204", "0.5236934", "0.5223572", "0.5204292", "0.52035093", "0.5197964", "0.5187981", "0.51854074", "0.51543456", "0.5149168", "0.51362973", "0.5099037", "0.5096493", "0.5093673", "0.5082579", "0.5069697", "0.50672406", "0.50594014", "0.50348973", "0.50278705", "0.50097954", "0.50054014", "0.49911737", "0.4989652", "0.4989564", "0.49849734", "0.49718994", "0.495687", "0.4953636", "0.49488708", "0.49397552", "0.4935331", "0.49255076", "0.4917646", "0.49030197", "0.48957586", "0.48935184", "0.48865357", "0.48840114", "0.48824522", "0.48806232", "0.48793837", "0.48790532", "0.4878025", "0.485346", "0.48534206", "0.48527294", "0.4849199", "0.48468086", "0.48335537", "0.4817184", "0.48148593", "0.4810356", "0.4805137", "0.4801433", "0.47845018", "0.47842455", "0.47681767", "0.47604623", "0.474795", "0.47462398", "0.47437713", "0.47425273", "0.47420177", "0.47394538", "0.47289848", "0.4721423", "0.47199413", "0.4716103", "0.47158784", "0.47019678", "0.46999305", "0.46965802", "0.46951693", "0.4694945", "0.4694435", "0.46874323", "0.46861386", "0.46853748", "0.4678024", "0.46741414", "0.46667227" ]
0.47174302
86
Test equal and slice restrictions (e.g 'clustering_0 = 0 clustering_1 > 1')
@Test public void testBoundsAsCompositesWithEqAndSliceRestrictions() { CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC); ByteBuffer value1 = ByteBufferUtil.bytes(1); ByteBuffer value2 = ByteBufferUtil.bytes(2); ByteBuffer value3 = ByteBufferUtil.bytes(3); Restriction eq = newSingleEq(cfMetaData, 0, value3); Restriction slice = newSingleSlice(cfMetaData, 1, Bound.START, false, value1); PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(eq).mergeWith(slice); List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value3, value1, EOC.END); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value3, EOC.END); slice = newSingleSlice(cfMetaData, 1, Bound.START, true, value1); restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(eq).mergeWith(slice); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value3, value1, EOC.NONE); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value3, EOC.END); slice = newSingleSlice(cfMetaData, 1, Bound.END, true, value1); restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(eq).mergeWith(slice); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value3, EOC.START); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value3, value1, EOC.END); slice = newSingleSlice(cfMetaData, 1, Bound.END, false, value1); restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(eq).mergeWith(slice); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value3, EOC.START); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value3, value1, EOC.START); slice = newSingleSlice(cfMetaData, 1, Bound.START, false, value1); Restriction slice2 = newSingleSlice(cfMetaData, 1, Bound.END, false, value2); restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(eq).mergeWith(slice).mergeWith(slice2); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value3, value1, EOC.END); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value3, value2, EOC.START); slice = newSingleSlice(cfMetaData, 1, Bound.START, true, value1); slice2 = newSingleSlice(cfMetaData, 1, Bound.END, true, value2); restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(eq).mergeWith(slice).mergeWith(slice2); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value3, value1, EOC.NONE); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value3, value2, EOC.END); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithTwoClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneAscendingAndOneDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n assertComposite(bounds.get(2), value2, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertComposite(bounds.get(1), value2, EOC.START);\n assertComposite(bounds.get(2), value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneDescendingAndOneAscendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0) > (1) AND (clustering_0, clustering1) < (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.END);\n assertComposite(bounds.get(2), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.END);\n assertComposite(bounds.get(1), value1, EOC.START);\n assertComposite(bounds.get(2), value1, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsMixingAscendingDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.DESC, Sort.ASC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(3));\n\n // clustering_0 = 1 AND (clustering_1, clustering_2, clustering_3) > (2, 3, 4)\n Restriction eq = newSingleEq(cfMetaData, 0, value1);\n slice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n restrictions = restrictions.mergeWith(eq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(3));\n\n\n // (clustering_0, clustering1, clustering_2, clustering_3) <= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, value4, EOC.NONE);\n assertComposite(bounds.get(3), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) < (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(3), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4) AND (clustering_0, clustering_1) < (2, 3)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2, value3);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(5, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n assertComposite(bounds.get(4), value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(5, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertComposite(bounds.get(3), value2, EOC.START);\n assertComposite(bounds.get(4), value2, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4) AND (clustering_0, clustering1, clustering_2, clustering_3) <= (4, 3, 2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value4, value3, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(7, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n assertComposite(bounds.get(4), value4, value3, EOC.START);\n assertComposite(bounds.get(5), value4, value3, value2, value1, EOC.NONE);\n assertComposite(bounds.get(6), value4, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(7, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertComposite(bounds.get(3), value4, EOC.START);\n assertComposite(bounds.get(4), value4, value3, value2, EOC.START);\n assertComposite(bounds.get(5), value4, value3, value2, EOC.END);\n assertComposite(bounds.get(6), value4, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithTwoAscendingAndTwoDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.DESC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertEmptyComposite(bounds.get(1));\n\n // clustering_0 = 1 AND (clustering_1, clustering_2, clustering_3) > (2, 3, 4)\n Restriction eq = newSingleEq(cfMetaData, 0, value1);\n slice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n restrictions = restrictions.mergeWith(eq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2, clustering_3) > (2, 3, 4)\n Restriction in = newSingleIN(cfMetaData, 0, value1, value2);\n slice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n restrictions = restrictions.mergeWith(in);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n assertComposite(bounds.get(2), value2, value2, EOC.START);\n assertComposite(bounds.get(3), value2, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n assertComposite(bounds.get(2), value2, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(3), value2, EOC.END);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1, clustering_2, clustering_3) <= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) < (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4) AND (clustering_0, clustering_1) < (2, 3)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2, value3);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(1), value2, value3, EOC.START);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4) AND (clustering_0, clustering1, clustering_2, clustering_3) <= (4, 3, 2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value4, value3, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n assertComposite(bounds.get(2), value4, value3, value2, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(1), value4, value3, EOC.START);\n assertComposite(bounds.get(2), value4, value3, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithTwoDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithSingleEqAndSliceRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n ByteBuffer value5 = ByteBufferUtil.bytes(5);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) > (2, 3)\n Restriction singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction multiSlice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiSlice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) > (2, 3) AND (clustering_1) < (4)\n singleEq = newSingleEq(cfMetaData, 0, value1);\n multiSlice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3);\n Restriction multiSlice2 = newMultiSlice(cfMetaData, 1, Bound.END, false, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiSlice2).mergeWith(singleEq).mergeWith(multiSlice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value4, EOC.START);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) => (2, 3) AND (clustering_1, clustering_2) <= (4, 5)\n singleEq = newSingleEq(cfMetaData, 0, value1);\n multiSlice = newMultiSlice(cfMetaData, 1, Bound.START, true, value2, value3);\n multiSlice2 = newMultiSlice(cfMetaData, 1, Bound.END, true, value4, value5);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiSlice2).mergeWith(singleEq).mergeWith(multiSlice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value4, value5, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiEqAndSingleSliceRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n\n // (clustering_0, clustering_1) = (1, 2) AND clustering_2 > 3\n Restriction multiEq = newMultiEq(cfMetaData, 0, value1, value2);\n Restriction singleSlice = newSingleSlice(cfMetaData, 2, Bound.START, false, value3);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiEq).mergeWith(singleSlice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithSliceRestrictionsAndOneClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newSingleSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newSingleSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithSliceRestrictionsAndOneDescendingClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newSingleSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newSingleSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithOneEqRestrictionsAndTwoClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer clustering_0 = ByteBufferUtil.bytes(1);\n Restriction eq = newSingleEq(cfMetaData, 0, clustering_0);\n\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneDescendingClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithOneEqRestrictionsAndOneClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC);\n\n ByteBuffer clustering_0 = ByteBufferUtil.bytes(1);\n Restriction eq = newSingleEq(cfMetaData, 0, clustering_0);\n\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithSingleEqAndMultiEqRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) = (2, 3)\n Restriction singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction multiEq = newMultiEq(cfMetaData, 1, value2, value3);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiEq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n // clustering_0 = 1 AND clustering_1 = 2 AND (clustering_2, clustering_3) = (3, 4)\n singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction singleEq2 = newSingleEq(cfMetaData, 1, value2);\n multiEq = newMultiEq(cfMetaData, 2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(singleEq2).mergeWith(multiEq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n\n // (clustering_0, clustering_1) = (1, 2) AND clustering_2 = 3\n singleEq = newSingleEq(cfMetaData, 2, value3);\n multiEq = newMultiEq(cfMetaData, 0, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiEq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) = (2, 3) AND clustering_3 = 4\n singleEq = newSingleEq(cfMetaData, 0, value1);\n singleEq2 = newSingleEq(cfMetaData, 3, value4);\n multiEq = newMultiEq(cfMetaData, 1, value2, value3);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiEq).mergeWith(singleEq2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n }", "public interface IStoppingCriteria {\n\n /**\n * Determine the degree of clustering agreement\n * @param cluster1 one clustering results\n * @param cluster2 the other clustering results\n * @return the degree of clustering agreement; 1 refers to be the same clustering results; 0 refers to be the totally different clustering results\n */\n public double computeSimilarity(int[] cluster1, int[] cluster2);\n\n}", "@Test\n public void testOverlappingPartitionsOverlappingClusters()\n {\n check(overlappingClustersWithOverlappingPartitions(), 0.75, 1.0);\n }", "@Test\n public void testHardClustersWithOverlappingPartitions()\n {\n check(hardClustersWithOverlappingPartitions(), 0.0, 1.0);\n }", "@Test\n public void testBoundsAsCompositesWithSingleEqAndMultiINRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n ByteBuffer value5 = ByteBufferUtil.bytes(5);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) IN ((2, 3), (4, 5))\n Restriction singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction multiIN = newMultiIN(cfMetaData, 1, asList(value2, value3), asList(value4, value5));\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiIN);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(1), value1, value4, value5, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(1), value1, value4, value5, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) IN ((2, 3))\n singleEq = newSingleEq(cfMetaData, 0, value1);\n multiIN = newMultiIN(cfMetaData, 1, asList(value2, value3));\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiIN).mergeWith(singleEq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n // clustering_0 = 1 AND clustering_1 = 5 AND (clustering_2, clustering_3) IN ((2, 3), (4, 5))\n singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction singleEq2 = newSingleEq(cfMetaData, 1, value5);\n multiIN = newMultiIN(cfMetaData, 2, asList(value2, value3), asList(value4, value5));\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiIN).mergeWith(singleEq2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value5, value2, value3, EOC.START);\n assertComposite(bounds.get(1), value1, value5, value4, value5, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value5, value2, value3, EOC.END);\n assertComposite(bounds.get(1), value1, value5, value4, value5, EOC.END);\n }", "@Test\r\n public void testIsSubset1() {\r\n Assert.assertEquals(false, set1.isSubset(set2));\r\n }", "@Test\n public void testBoundsAsCompositesWithOneInRestrictionsAndOneClusteringColumn()\n {\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n Restriction in = newSingleIN(cfMetaData, 0, value1, value2, value3);\n\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(in);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.START);\n assertComposite(bounds.get(2), value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n assertComposite(bounds.get(1), value2, EOC.END);\n assertComposite(bounds.get(2), value3, EOC.END);\n }", "@Test\n public void testIntersection4()\n {\n List<Integer> expected = new ArrayList<>();\n ConciseSet set1 = new ConciseSet();\n ConciseSet set2 = new ConciseSet();\n for (int i = 0; i < 1000; i++) {\n set1.add(i);\n if (i != 500) {\n set2.add(i);\n expected.add(i);\n }\n }\n\n verifyIntersection(expected, set1, set2);\n }", "private boolean isSubsetOf(List<String> permissions2,\n\t\t\tList<String> permissions3) {\n\t\treturn false;\n\t}", "@Test\n public void testBoundsAsCompositesWithMultiEqRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n Restriction eq = newMultiEq(cfMetaData, 0, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n }", "boolean verifications(int i, int j, int val) { \r\n return (verifCarre(i-i%nCarre, j-j%nCarre, val) && verifLigne(i, val) && verifColonne(j, val)); \r\n }", "private boolean subGridCheck() {\n\t\tint sqRt = (int)Math.sqrt(dimension);\n\t\tfor(int i = 0; i < sqRt; i++) {\n\t\t\tint increment = i * sqRt;\n\t\t\tfor(int val = 1; val <= dimension; val++) {\n\t\t\t\tint valCounter = 0;\n\t\t\t\tfor(int row = 0 + increment; row < sqRt + increment; row++) {\n\t\t\t\t\tfor(int col = 0 + increment; col < sqRt + increment; col++) {\n\t\t\t\t\t\tif(puzzle[row][col] == val)\n\t\t\t\t\t\t\tvalCounter++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(valCounter >= 2)\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "@Test\n public void testIntersection6()\n {\n List<Integer> expected = new ArrayList<>();\n ConciseSet set1 = new ConciseSet();\n for (int i = 0; i < 5; i++) {\n set1.add(i);\n }\n for (int i = 1000; i < 1005; i++) {\n set1.add(i);\n }\n\n ConciseSet set2 = new ConciseSet();\n for (int i = 800; i < 805; i++) {\n set2.add(i);\n }\n for (int i = 806; i < 1005; i++) {\n set2.add(i);\n }\n\n for (int i = 1000; i < 1005; i++) {\n expected.add(i);\n }\n\n verifyIntersection(expected, set1, set2);\n }", "@Test\n\t public void test_Is_Subset_Positive() throws Exception{\t\n\t\t SET setarray= new SET( new int[]{1,2,3,4,5});\n\t\t SET subsetarray= new SET( new int[]{1,2,3});\n\t\t assertTrue(setarray.isSubSet(subsetarray));\t \n\t }", "boolean hasCluster();", "private boolean isSubset(List<ConceptLabel> outer, List<ConceptLabel> inner){\n\t\tfor(ConceptLabel in: inner){\n\t\t\tboolean c = false;\n\t\t\tfor(ConceptLabel l: outer){\n\t\t\t\tif(l.getText().equals(in.getText())){\n\t\t\t\t\tc = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(!c)\n\t\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "@Test\n public void testIntersection3()\n {\n List<Integer> expected = new ArrayList<>();\n ConciseSet set1 = new ConciseSet();\n ConciseSet set2 = new ConciseSet();\n for (int i = 0; i < 1000; i++) {\n set1.add(i);\n set2.add(i);\n expected.add(i);\n }\n\n verifyIntersection(expected, set1, set2);\n }", "@Test\n public void testRedundancyRestriction() throws Exception {\n final String rName = getUniqueName();\n final Integer red0 = 0;\n final Integer red1 = 1;\n\n CacheSerializableRunnable createPRsWithRed =\n new CacheSerializableRunnable(\"createPrsWithDifferentRedundancy\") {\n @Override\n public void run2() throws CacheException {\n getCache();\n IgnoredException.addIgnoredException(\"redundancy should be same as the redundancy\");\n createPR(rName, red1, 100, 3, null, Boolean.FALSE,\n Boolean.FALSE);\n try {\n createPR(rName + \"colo\", red0, 100, 3, rName,\n Boolean.FALSE, Boolean.FALSE);\n fail(\"Expected different redundancy levels to throw.\");\n } catch (IllegalStateException expected) {\n assertEquals(\n \"Current PartitionedRegion's redundancy should be same as the redundancy of colocated PartitionedRegion\",\n expected.getMessage());\n }\n }\n };\n dataStore1.invoke(createPRsWithRed);\n }", "public boolean percolates()\r\n { return uf.find(0) == uf.find(dimension*dimension + 1); }", "@Test\n public void testColocatedPartitionedRegion() throws Throwable {\n createCacheInAllVms();\n redundancy = 0;\n localMaxmemory = 50;\n totalNumBuckets = 11;\n\n regionName = \"A\";\n colocatedWith = null;\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"B\";\n colocatedWith = SEPARATOR + \"A\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"C\";\n colocatedWith = SEPARATOR + \"A\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"D\";\n colocatedWith = SEPARATOR + \"B\";\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"E\";\n colocatedWith = SEPARATOR + \"B\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"F\";\n colocatedWith = SEPARATOR + \"B\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"G\";\n colocatedWith = SEPARATOR + \"C\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"H\";\n colocatedWith = SEPARATOR + \"C\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"I\";\n colocatedWith = SEPARATOR + \"C\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"J\";\n colocatedWith = SEPARATOR + \"D\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"K\";\n colocatedWith = SEPARATOR + \"D\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"L\";\n colocatedWith = SEPARATOR + \"E\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"M\";\n colocatedWith = SEPARATOR + \"F\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"N\";\n colocatedWith = SEPARATOR + \"G\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"O\";\n colocatedWith = SEPARATOR + \"I\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n accessor.invoke(() -> PRColocationDUnitTest.validateColocatedRegions(\"A\"));\n\n accessor.invoke(() -> PRColocationDUnitTest.validateColocatedRegions(\"D\"));\n\n accessor.invoke(() -> PRColocationDUnitTest.validateColocatedRegions(\"H\"));\n\n accessor.invoke(() -> PRColocationDUnitTest.validateColocatedRegions(\"B\"));\n\n accessor.invoke(() -> PRColocationDUnitTest.validateColocatedRegions(\"K\"));\n }", "private boolean isSubsetOf(int firstRow, int secondRow) {\n for (int i = 0; i < universalSetSize; i++) {\n if (input[firstRow][i] && !input[secondRow][i]) {\n return false;\n }\n }\n return true;\n }", "@Test\n\t public void test_Is_Subset_Negative() throws Exception{\t\n\t\t SET setarray= new SET( new int[]{1,2,3,4,5});\n\t\t SET subsetarray= new SET( new int[]{7,8});\n\t\t assertFalse(setarray.isSubSet(subsetarray));\t \n\t }", "@Test\n \tpublic void testOverlapsWith()\n \t{\n \t\tAssert.assertTrue(PDL.new Alignment(\"\", \"\", 0.0, 1, 4, 0, 0)\n \t\t .overlapsWith(PDL.new Alignment(\"\", \"\", 0.0, 1, 4, 0, 0)));\n \t\t\n \t\t// 1. [1,2] [2,4] => false\n \t\tAssert.assertFalse(PDL.new Alignment(\"\", \"\", 0.0, 1, 2, 0, 0)\n \t\t .overlapsWith(PDL.new Alignment(\"\", \"\", 0.0, 2, 4, 0, 0)));\n \t\t\n \t\t// 2. [1,3] [2,5] => true\n \t\tAssert.assertTrue(PDL.new Alignment(\"\", \"\", 0.0, 1, 3, 0, 0)\n \t\t .overlapsWith(PDL.new Alignment(\"\", \"\", 0.0, 2, 5, 0, 0)));\n \t\t\n \t\t// 3. [1,5] [0,6] => true\n \t\tAssert.assertTrue(PDL.new Alignment(\"\", \"\", 0.0, 1, 5, 0, 0)\n \t\t .overlapsWith(PDL.new Alignment(\"\", \"\", 0.0, 0, 6, 0, 0)));\n \t\t\n \t\t// 4. [2,4] [1,2] => false\n \t\tAssert.assertFalse(PDL.new Alignment(\"\", \"\", 0.0, 2, 4, 0, 0)\n \t\t .overlapsWith(PDL.new Alignment(\"\", \"\", 0.0, 1, 2, 0, 0)));\n \t\t\n \t\t// 5. [2,5] [1,3] => true\n \t\tAssert.assertTrue(PDL.new Alignment(\"\", \"\", 0.0, 2, 5, 0, 0)\n \t\t .overlapsWith(PDL.new Alignment(\"\", \"\", 0.0, 1, 3, 0, 0)));\n \t}", "public static boolean IS_SUBFEATURE(Feature a, int index_a, Feature b, int index_b) {\n\n boolean anotinb, bnotina;\n int i, ia, ib;\n\n if (index_a != index_b)\n Dataset.perror(\"Feature.class :: not the same feature (\" + index_a + \" != \" + index_b + \")\");\n if (!a.type.equals(b.type))\n Dataset.perror(\n \"Feature.class :: not the same type of feature (\" + a.type + \" != \" + b.type + \")\");\n\n if (IS_CONTINUOUS(a.type)) {\n if (a.dmin >= b.dmin) {\n if (a.dmax <= b.dmax) return true;\n else\n Dataset.perror(\n \"Feature.class :: inconsistency for subfeature check for : (\"\n + a.dmin\n + \", \"\n + a.dmax\n + \") subseteq (\"\n + b.dmin\n + \", \"\n + b.dmax\n + \") ? \");\n } else if (a.dmax < b.dmax)\n Dataset.perror(\n \"Feature.class :: inconsistency for subfeature check for : (\"\n + a.dmin\n + \", \"\n + a.dmax\n + \") subseteq (\"\n + b.dmin\n + \", \"\n + b.dmax\n + \") ? \");\n } else if (IS_INTEGER(a.type)) {\n if (a.imin >= b.imin) {\n if (a.imax <= b.imax) return true;\n else\n Dataset.perror(\n \"Feature.class :: inconsistency for subfeature check for : (\"\n + a.imin\n + \", \"\n + a.imax\n + \") subseteq (\"\n + b.imin\n + \", \"\n + b.imax\n + \") ? \");\n } else if (a.imax < b.imax)\n Dataset.perror(\n \"Feature.class :: inconsistency for subfeature check for : (\"\n + a.imin\n + \", \"\n + a.imax\n + \") subseteq (\"\n + b.imin\n + \", \"\n + b.imax\n + \") ? \");\n } else if (IS_NOMINAL(a.type)) {\n if (a.modalities == null) return true;\n else if (b.modalities != null) {\n anotinb = bnotina = false;\n ia = ib = -1;\n for (i = 0; i < a.modalities.size(); i++)\n if (!b.modalities.contains((String) a.modalities.elementAt(i))) {\n anotinb = true;\n ia = i;\n }\n for (i = 0; i < b.modalities.size(); i++)\n if (!a.modalities.contains((String) b.modalities.elementAt(i))) {\n bnotina = true;\n ib = i;\n }\n if ((anotinb) && (bnotina))\n Dataset.perror(\n \"Feature.class :: inconsistency for subfeature check for : \"\n + ((String) a.modalities.elementAt(ia))\n + \" not in b and \"\n + ((String) b.modalities.elementAt(ib))\n + \" not in a \");\n else if (!anotinb) return true;\n }\n } else Dataset.perror(\"Feature.class :: no Feature type for \" + a.type);\n\n return false;\n }", "@Test\n public void testColocationPartitionedRegionWithRedundancy() throws Throwable {\n\n // Create Cache in all VMs VM0,VM1,VM2,VM3\n createCacheInAllVms();\n\n redundancy = 1;\n localMaxmemory = 50;\n totalNumBuckets = 11;\n\n // Create Customer PartitionedRegion in All VMs\n regionName = CustomerPartitionedRegionName;\n colocatedWith = null;\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n // Create Customer PartitionedRegion in All VMs\n regionName = OrderPartitionedRegionName;\n colocatedWith = CustomerPartitionedRegionName;\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n // Create Customer PartitionedRegion in All VMs\n regionName = ShipmentPartitionedRegionName;\n colocatedWith = OrderPartitionedRegionName;\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n // Initial Validation for the number of data stores and number of profiles\n accessor.invoke(() -> PRColocationDUnitTest\n .validateBeforePutCustomerPartitionedRegion(CustomerPartitionedRegionName));\n\n // Put the customer 1-10 in CustomerPartitionedRegion\n accessor.invoke(\n () -> PRColocationDUnitTest.putCustomerPartitionedRegion(CustomerPartitionedRegionName));\n\n // Put the order 1-10 for each Customer in OrderPartitionedRegion\n accessor\n .invoke(() -> PRColocationDUnitTest.putOrderPartitionedRegion(OrderPartitionedRegionName));\n\n // Put the shipment 1-10 for each order in ShipmentPartitionedRegion\n accessor.invoke(\n () -> PRColocationDUnitTest.putShipmentPartitionedRegion(ShipmentPartitionedRegionName));\n\n // This is the importatnt check. Checks that the colocated Customer,Order\n // and Shipment are in the same VM\n accessor.invoke(() -> PRColocationDUnitTest.validateAfterPutPartitionedRegion(\n CustomerPartitionedRegionName, OrderPartitionedRegionName, ShipmentPartitionedRegionName));\n\n // for VM0 DataStore check the number of buckets created and the size of\n // bucket for all partitionedRegion\n Integer totalBucketsInDataStore1 = dataStore1\n .invoke(() -> PRColocationDUnitTest.validateDataStore(CustomerPartitionedRegionName,\n OrderPartitionedRegionName, ShipmentPartitionedRegionName));\n\n // for VM1 DataStore check the number of buckets created and the size of\n // bucket for all partitionedRegion\n Integer totalBucketsInDataStore2 = dataStore2\n .invoke(() -> PRColocationDUnitTest.validateDataStore(CustomerPartitionedRegionName,\n OrderPartitionedRegionName, ShipmentPartitionedRegionName));\n\n // for VM3 Datastore check the number of buckets created and the size of\n // bucket for all partitionedRegion\n Integer totalBucketsInDataStore3 = dataStore3\n .invoke(() -> PRColocationDUnitTest.validateDataStore(CustomerPartitionedRegionName,\n OrderPartitionedRegionName, ShipmentPartitionedRegionName));\n\n if (redundancy > 0) {\n // for VM0 DataStore check the number of buckets created and the size of\n // bucket for all partitionedRegion\n dataStore1.invoke(\n () -> PRColocationDUnitTest.validateDataStoreForRedundancy(CustomerPartitionedRegionName,\n OrderPartitionedRegionName, ShipmentPartitionedRegionName));\n\n // for VM1 DataStore check the number of buckets created and the size of\n // bucket for all partitionedRegion\n dataStore2.invoke(\n () -> PRColocationDUnitTest.validateDataStoreForRedundancy(CustomerPartitionedRegionName,\n OrderPartitionedRegionName, ShipmentPartitionedRegionName));\n\n // for VM3 Datastore check the number of buckets created and the size of\n // bucket for all partitionedRegion\n dataStore3.invoke(\n () -> PRColocationDUnitTest.validateDataStoreForRedundancy(CustomerPartitionedRegionName,\n OrderPartitionedRegionName, ShipmentPartitionedRegionName));\n }\n\n // Check the total number of buckets created in all three Vms are equalto 60\n totalNumBucketsInTest = totalBucketsInDataStore1\n + totalBucketsInDataStore2 + totalBucketsInDataStore3;\n assertEquals(totalNumBucketsInTest, 60);\n }", "@Test\n public void testBoundsAsCompositesWithEqAndInRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n Restriction eq = newSingleEq(cfMetaData, 0, value1);\n Restriction in = newSingleIN(cfMetaData, 1, value1, value2, value3);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(in);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.START);\n assertComposite(bounds.get(2), value1, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value1, EOC.END);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n assertComposite(bounds.get(2), value1, value3, EOC.END);\n }", "@Test\n public void testIntersection5()\n {\n final int[] ints1 = {33, 100000};\n final int[] ints2 = {34, 200000};\n List<Integer> expected = new ArrayList<>();\n\n ConciseSet set1 = new ConciseSet();\n for (int i : ints1) {\n set1.add(i);\n }\n ConciseSet set2 = new ConciseSet();\n for (int i : ints2) {\n set2.add(i);\n }\n\n verifyIntersection(expected, set1, set2);\n }", "static boolean isClusterCandidate_(double x_1, double y1, double x2,\n\t\t\tdouble y2, double sqr_tolerance) {\n\t\tdouble dx = x_1 - x2;\n\t\tdouble dy = y1 - y2;\n\t\treturn dx * dx + dy * dy <= sqr_tolerance;\n\t}", "private void createConstraintsForSingleton() {\n \t\tSet s = slice.entrySet();\n \t\tfor (Iterator iterator = s.iterator(); iterator.hasNext();) {\n \t\t\tMap.Entry entry = (Map.Entry) iterator.next();\n \t\t\tHashMap conflictingEntries = (HashMap) entry.getValue();\n \t\t\tif (conflictingEntries.size() < 2)\n \t\t\t\tcontinue;\n \n \t\t\tCollection conflictingVersions = conflictingEntries.values();\n \t\t\tString singletonRule = \"\"; //$NON-NLS-1$\n \t\t\tArrayList nonSingleton = new ArrayList();\n \t\t\tint countSingleton = 0;\n \t\t\tfor (Iterator conflictIterator = conflictingVersions.iterator(); conflictIterator.hasNext();) {\n \t\t\t\tIInstallableUnit conflictElt = (IInstallableUnit) conflictIterator.next();\n \t\t\t\tif (conflictElt.isSingleton()) {\n \t\t\t\t\tsingletonRule += \" -1 \" + getVariable(conflictElt); //$NON-NLS-1$\n \t\t\t\t\tcountSingleton++;\n \t\t\t\t} else {\n \t\t\t\t\tnonSingleton.add(conflictElt);\n \t\t\t\t}\n \t\t\t}\n \t\t\tif (countSingleton == 0)\n \t\t\t\tcontinue;\n \n \t\t\tfor (Iterator iterator2 = nonSingleton.iterator(); iterator2.hasNext();) {\n \t\t\t\tconstraints.add(singletonRule + \" -1 \" + getVariable((IInstallableUnit) iterator2.next()) + \" >= -1;\"); //$NON-NLS-1$ //$NON-NLS-2$\n \t\t\t}\n \t\t\tsingletonRule += \" >= -1;\"; //$NON-NLS-1$\n \t\t\tconstraints.add(singletonRule);\n \t\t}\n \t}", "public boolean isEqualTo(Cluster c)\n {\n int len = this.size();\n if (len != c.size()){\n return false;\n }\n if (len == 0){\n return true;\n }\n if (this.getLeader() != c.getLeader()){\n return false;\n }\n for (Integer n : this._elems){\n if (!c.contains(n)){\n return false;\n }\n }\n return true;\n }", "boolean hasPermissionOfCluster(String clusterId, String userName);", "@Test\n public void computeResult_resultAlwaysInsideProvidedBoundaries() {\n int datasetSize = 10;\n for (int i = 0; i < 100; ++i) {\n Random random = new Random();\n double lower = random.nextDouble() * 100;\n double upper = lower + random.nextDouble() * 100;\n\n variance =\n BoundedVariance.builder()\n .epsilon(EPSILON)\n .noise(new LaplaceNoise())\n .maxPartitionsContributed(1)\n .maxContributionsPerPartition(1)\n .lower(lower)\n .upper(upper)\n .build();\n\n List<Double> dataset =\n random\n .doubles()\n .map(x -> x * 300 * getRandomSign(random))\n .limit(datasetSize)\n .boxed()\n .collect(toImmutableList());\n\n variance.addEntries(dataset);\n\n assertWithMessage(\n \"lower = %s\\nupper = %s\\ndataset = [%s]\",\n lower, upper, dataset.stream().map(x -> Double.toString(x)).collect(joining(\",\\n\")))\n .that(variance.computeResult())\n .isIn(Range.closed(0.0, (upper - lower) * (upper - lower) / 4.0));\n }\n }", "public boolean isReviewed(int index) {\n if (index % 2 != 0) {\n index -= 1;\n }\n index = index / 2;\n if ( ( (Integer) clusters[index][3]).intValue() == 1) {\n return true;\n }\n else {\n return false;\n }\n }", "protected boolean applySubsetRule(Node value) {\n\n int type;\n int sizeParents;\n boolean isAppliedRule = false;\n Node auxI;\n Node auxJ;\n int i;\n NodeList auxNodeList = new NodeList();\n Node auxNode;\n\n\n //If the subset rule is forbidden then the methods finishes\n if (canApplySubsetRule == false) {\n return false;\n } else {\n\n type = value.getKindOfNode();\n\n if (type == Node.UTILITY) {\n return false;\n } else {//(type == Node.SUPER_VALUE)\n NodeList parents = diag.parents(value);\n sizeParents = parents.size();\n\n //See if subset rule can be applied to some ancestors\t\t\t\n for (i = 0; (i < sizeParents) && (isAppliedRule == false); i++) {\n isAppliedRule = applySubsetRule(parents.elementAt(i));\n }\n if (isAppliedRule) {\n indexOperation++;\n try {\n diag.save(\"debug-operation-\" + indexOperation + \".elv\");\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n }\n if (isAppliedRule == false) {\n //See if subset rule can be applied to two utility parents\n for (i = 0; (i < sizeParents - 1) && (isAppliedRule == false); i++) {\n auxI = parents.elementAt(i);\n if (auxI.getKindOfNode() == Node.UTILITY) {\n for (int j = i + 1; (j < sizeParents) && (isAppliedRule == false); j++) {\n auxJ = parents.elementAt(j);\n if (auxJ.getKindOfNode() == Node.UTILITY) {\n if (verifySubsetRule(auxI, auxJ)) {\n String operation =\n \"Apply subset rule to: \" + auxI.getName() + \" and \" + auxJ.getName();\n\n statistics.addOperation(operation);\n System.out.println(operation);\n\n auxNodeList.insertNode(auxI);\n auxNodeList.insertNode(auxJ);\n auxNode = introduceSVNode(auxNodeList, value);\n System.out.println(\"Nodo introducido por la subset rule anterior: \" + auxNode.getName());\n ReductionAndEvalID.reduceNode((IDWithSVNodes) diag, auxNode);\n System.out.println(\"Reducción del nodo: \" + auxNode.getName());\n\n statistics.addSize(diag.calculateSizeOfPotentials());\n statistics.addTime(crono.getTime());\n\n\n isAppliedRule = true;\n\n indexOperation++;\n try {\n diag.save(\"debug-operation-\" + indexOperation + \".elv\");\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n\n\n }\n }\n }\n }\n }\n\n }\n }\n\n return isAppliedRule;\n }\n }", "public void decideCluster(){\n\tdouble shortest = 1000000;\n\tfor(int i = 0; i < clusterDist.length; i++)\n\t{\n\t\tif(clusterDist[i] < shortest)\n\t\t{\tshortest = clusterDist[i];\n\t\t\tthis.clusterid = i;\n\t\t}\n\t\t\n\t}\n}", "private static boolean areOverlapping( int ix0, int ix1, int len )\n {\n if( ix0<ix1 ){\n return ix0+len>ix1;\n }\n else {\n return ix1+len>ix0;\n }\n }", "@Test\n\tpublic void evalCrispDistanceWithCrispOverlaped1(){\n\t\tFuzzySet res = (CrispSet)cs4.distance(cs5);\n\t\tassertTrue(res instanceof CrispSet);\n\t\tCrispSet resCrisp = (CrispSet)res;\n\t\t//Puntos limite\t\t\n\t\tassertTrue(resCrisp.getLeftBoundary()==0);\n\t\tassertTrue(resCrisp.getRightBoundary()==4);\n\t\t//Valores extremos\n\t\tassertTrue(resCrisp.getMembershipValue(0)==1);\n\t\tassertTrue(resCrisp.getMembershipValue(1)==1);\n\t\tassertTrue(resCrisp.getMembershipValue(2)==1);\n\t\tassertTrue(resCrisp.getMembershipValue(3)==1);\n\t\tassertTrue(resCrisp.getMembershipValue(4)==1);\n\t\tassertTrue(resCrisp.getMembershipValue(5)==0);\n\t\tassertTrue(resCrisp.getMembershipValue(6)==0);\n\t\tassertTrue(resCrisp.getMembershipValue(-1)==0);\n\t}", "private void partitionImpl(Collection<S> vocab, HashMap<Dimension<T>, MutableDouble> center) {\n double firstVal = Double.POSITIVE_INFINITY;\n double secondVal = Double.POSITIVE_INFINITY;\n S firstWord = null;\n S secondWord = null;\n\n LinkedList<S> cluster1 = new LinkedList<S>();\n LinkedList<S> cluster2 = new LinkedList<S>();\n HashMap<Dimension<T>, MutableDouble> newCenter1 = null;\n HashMap<Dimension<T>, MutableDouble> newCenter2 = null;\n\n if (vocab.size() > 2) {\n for (S word : vocab) {\n double dist = distanceToCenter(word, center);\n if (dist < secondVal) {\n if (dist < firstVal) {\n secondVal = firstVal;\n secondWord = firstWord;\n firstVal = dist;\n firstWord = word;\n } else {\n secondVal = dist;\n secondWord = word;\n }\n }\n }\n if (distance(firstWord, secondWord) <= 0.0) {\n System.out.printf(\"zero distance between '%s' and '%s'\\n\", firstWord, secondWord);\n // pick an arbitrary second word\n for (S word : vocab) {\n if (word.equals(firstWord) || word.equals(secondWord)) {\n continue;\n }\n if (distance(firstWord, word) > 0.0) {\n secondWord = word;\n break;\n }\n }\n System.out.printf(\"selected '%s' and '%s'\\n\", firstWord, secondWord);\n }\n\n HashMap<Dimension<T>, MutableDouble> center1 = wordToVector(firstWord);\n HashMap<Dimension<T>, MutableDouble> center2 = wordToVector(secondWord);\n for (S word : vocab) {\n double dist1 = distanceToCenter(word, center1);\n double dist2 = distanceToCenter(word, center2);\n if (dist1 < dist2) {\n cluster1.add(word);\n } else {\n cluster2.add(word);\n }\n }\n\n int changed = 1;\n int iteration = 0;\n while (++iteration <= MAX_ITERATIONS && changed > 0) {\n System.out.printf(\"Iteration %d/%d\\n\", iteration, MAX_ITERATIONS);\n changed = 0;\n newCenter1 = getCenter(cluster1);\n newCenter2 = getCenter(cluster2);\n\n LinkedList<S> tmpCluster1 = new LinkedList<S>();\n LinkedList<S> tmpCluster2 = new LinkedList<S>();\n\n for (ListIterator<S> it = cluster1.listIterator(); it.hasNext();) {\n S word = it.next();\n double dist1 = distanceToCenter(word, newCenter1);\n double dist2 = distanceToCenter(word, newCenter2);\n if (dist1 <= dist2) {\n tmpCluster1.add(word);\n } else {\n tmpCluster2.add(word);\n changed++;\n System.out.printf(\"changing %s : %g > %g\\n\", word, dist1, dist2);\n }\n }\n\n for (ListIterator<S> it = cluster2.listIterator(); it.hasNext();) {\n S word = it.next();\n double dist1 = distanceToCenter(word, newCenter1);\n double dist2 = distanceToCenter(word, newCenter2);\n if (dist2 <= dist1) {\n tmpCluster2.add(word);\n } else {\n tmpCluster1.add(word);\n changed++;\n System.out.printf(\"changing %s : %g < %g\\n\", word, dist1, dist2);\n }\n }\n cluster1 = tmpCluster1;\n cluster2 = tmpCluster2;\n System.out.printf(\"changed: %d/%d\\n\", changed, vocab.size());\n if (cluster1.size() == 0 || cluster2.size() == 0) {\n LinkedList<S> cl = cluster1.size() == 0 ? cluster2 : cluster1;\n System.out.printf(\"Cannot split %s, split them randomly\\n\", cl.toString());\n tmpCluster1 = new LinkedList<S>();\n tmpCluster2 = new LinkedList<S>();\n boolean b = true;\n for (S word : cl) {\n if (b) {\n tmpCluster1.add(word);\n } else {\n tmpCluster2.add(word);\n }\n b = !b;\n }\n cluster1 = tmpCluster1;\n cluster2 = tmpCluster2;\n }\n }\n } else if (vocab.size() == 2) {\n Iterator<S> it = vocab.iterator();\n S word1 = it.next();\n S word2 = it.next();\n cluster1.add(word1);\n cluster2.add(word2);\n newCenter1 = wordToVector(word1);\n newCenter2 = wordToVector(word2);\n } else {\n return;\n }\n\n if (notifyNewCluster(vocab, cluster1, cluster2)) {\n partition(cluster1, newCenter1);\n partition(cluster2, newCenter2);\n }\n\n }", "@Test\n public void testColocatedPartitionedRegion_NoFullPath() throws Throwable {\n createCacheInAllVms();\n redundancy = 0;\n localMaxmemory = 50;\n totalNumBuckets = 11;\n\n regionName = \"A\";\n colocatedWith = null;\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"B\";\n colocatedWith = \"A\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"C\";\n colocatedWith = \"A\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"D\";\n colocatedWith = \"B\";\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"E\";\n colocatedWith = \"B\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"F\";\n colocatedWith = \"B\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"G\";\n colocatedWith = \"C\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"H\";\n colocatedWith = \"C\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"I\";\n colocatedWith = \"C\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"J\";\n colocatedWith = \"D\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"K\";\n colocatedWith = \"D\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"L\";\n colocatedWith = \"E\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"M\";\n colocatedWith = \"F\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"N\";\n colocatedWith = \"G\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"O\";\n colocatedWith = \"I\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n accessor.invoke(() -> PRColocationDUnitTest.validateColocatedRegions(\"A\"));\n\n accessor.invoke(() -> PRColocationDUnitTest.validateColocatedRegions(\"D\"));\n\n accessor.invoke(() -> PRColocationDUnitTest.validateColocatedRegions(\"H\"));\n\n accessor.invoke(() -> PRColocationDUnitTest.validateColocatedRegions(\"B\"));\n\n accessor.invoke(() -> PRColocationDUnitTest.validateColocatedRegions(\"K\"));\n }", "static boolean isSubset(int Tab1[], int Tab2[], int m, int n)\n {\n // compléter\n //Trouver le max de Tab1[]\n int max=Tab1[0];\n for(int i = 1; i < m; i++) {\n\t\t\tif (Tab1[i]>max){\n max=Tab1[i];\n }\n\t\t}\n \n\t\t//Stockage de la Tab1 dans une table de hashage\n\t\tint[] hashTable = new int[max];\n\t\tfor(int i = 0; i < m; i++) {\n\t\t\thashTable[hash(Tab1[i], max)] = Tab1[i];\n\t\t}\n\t\t\n\t\t//verifier que chaque element (de Tab2) existe dans la hashtable\n\t\tfor(int j = 0; j < n; j++) {\n\t\t\tif(Tab2[j] != hashTable[hash(Tab2[j], max)]) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t}\n return true;\n \n //Complexite aymptotique :\n /*\n Puisque la boucle qui a le plus d'itérations est celle avec l'élément m, la compléxité\n asymptotique est O(m).\n f(m,n) = 2m + n = O(m), puisque m > n\n */\n \n\n }", "@Test\n\tpublic void rangeOverlapTest() {\n\n\t\tsetup();\n\t\tSystem.out.println(\"overlaptest\");\n\t\t// dataset 1\n\t\tZipCodeRange z1 = new ZipCodeRange(new ZipCode(94133), new ZipCode(94133));\n\t\tZipCodeRange z2 = new ZipCodeRange(new ZipCode(94200), new ZipCode(94299));\n\t\tZipCodeRange z3 = new ZipCodeRange(new ZipCode(94226), new ZipCode(94399));\n\n\t\t// Testing\n\t\tZipRangeControl zrc = new ZipRangeControl();\n\t\tzrc.processNewRange(z1);\n\t\tzrc.processNewRange(z2);\n\t\tzrc.processNewRange(z3);\n\n\t\tZipCodeRange z5 = new ZipCodeRange(new ZipCode(94133), new ZipCode(94133));\n\t\tZipCodeRange z4 = new ZipCodeRange(new ZipCode(94200), new ZipCode(94399));\n\t\trequiredList.add(z5);\n\t\trequiredList.add(z4);\n\n\t\tfor (ZipCodeRange z : zrc.getFinalZipRanges()) {\n\t\t\tSystem.out.println(z.lower.zipcode + \",\" + z.upper.zipcode);\n\t\t}\n\t\tfor (ZipCodeRange z : requiredList) {\n\t\t\tSystem.out.println(z.lower.zipcode + \",\" + z.upper.zipcode);\n\t\t}\n\n\t\tAssert.assertEquals(\"Overlap test Size check passed \", requiredList.size(), zrc.getFinalZipRanges().size());\n\n\t\tZipCodeRange[] ziparray = new ZipCodeRange[requiredList.size()];\n\t\tList<ZipCodeRange> zlist = zrc.getFinalZipRanges();\n\n\t\tfor (int i = 0; i < requiredList.size(); i++) {\n\t\t\tAssert.assertThat(\"Lower Limit match failed at entry\" + i, requiredList.get(i).lower.zipcode,\n\t\t\t\t\torg.hamcrest.CoreMatchers.equalTo(zlist.get(i).lower.zipcode));\n\t\t\tAssert.assertThat(\"Upper Limit match failed at entry\" + i, requiredList.get(i).upper.zipcode,\n\t\t\t\t\torg.hamcrest.CoreMatchers.equalTo(zlist.get(i).upper.zipcode));\n\t\t}\n\n\t\tclimax();\n\n\t}", "boolean getIsClusteringKey();", "private boolean checking(int testIndex){\n\t\tint remainder = testIndex % order;//remainder for testIndex corresponding cols\n\t\tint quotient = testIndex / order;//quotient for testIndex corresponding rows\n\t\t\n\t\t/**\n\t\t * Section1: Check Number Repetition\n\t\t * Description:check and not allow has the same number before\n\t\t * @Author: Zeyu Ni, Binglin Xie, Yingbin Zheng / CS-593-B / Final Project\n\t\t * @Create Date:: 4/10/2016\n\t\t */\n\t\tfor(int i = 0; i < testIndex; i++){ //\n\t\t\tif(m[testIndex] == m[i]){\n\t\t\t\treturn false;\n\t\t\t}\t\n\t\t}\n\t\t\n\t\t/**\n\t\t * Section2: Check Row Sum\n\t\t * Description: check the last one in the row, if row sum != Magic_Constant,\n\t\t * return false.\n\t\t * @Author: Zeyu Ni, Binglin Xie, Yingbin Zheng / CS-593-B / Final Project\n\t\t * @Create Date:: 4/10/2016\n\t\t */\n\t\tif(remainder == order - 1){//last one in the row sum = Magic_Constant\n\t\t\tint sum = 0;\n\t\t\tfor(int i = testIndex - order + 1; i <= testIndex; i++){\n\t\t\t\tsum += m[i];\n\t\t\t}\n\t\t\tif(sum != Magic_Constant){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t/**\n\t\t * Section3: Check Column Sum\n\t\t * Description: check the last one in the column, if row sum != Magic_Constant,\n\t\t * return false.\n\t\t * @Author: Zeyu Ni, Binglin Xie, Yingbin Zheng / CS-593-B / Final Project\n\t\t * @Create Date:: 4/15/2016\n\t\t */\n\t\tif(testIndex >= maxNum - order){//last one in the column sum = Magic_Constant\n\t\t\tint sum = 0;\n\t\t\tfor(int i = 0; i < maxNum; i++){\n\t\t\t\tif( i % order == remainder){\n\t\t\t\t\tsum += m[i];\n\t\t\t\t}\t\n\t\t\t}\n\t\t\tif(sum != Magic_Constant){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\n\t\t/**\n\t\t * Section4: Check main diagonal sum\n\t\t * Description: check the last one in the main diagonal, if main diagonal sum != Magic_Constant,\n\t\t * return false.\n\t\t * @Author: Zeyu Ni, Binglin Xie, Yingbin Zheng / CS-593-B / Final Project\n\t\t * @Create Date:: 4/17/2016\n\t\t */\n\t\tif(testIndex == maxNum - 1){///last one in the main diagonal sum = Magic_Constant\n\t\t\tint sum = 0;\n\t\t\tfor (int i = 0; i < order; i++) {\n\t\t\t\tfor(int j = i * order; j < (i + 1) * order; j++){\n\t\t\t\t\tif(j % order == i){\n\t\t\t\t\t\tsum += m[j];\n\t\t\t\t\t}\n\t\t\t\t}\t\n\t\t\t}\n\t\t\tif(sum != Magic_Constant){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t/**\n\t\t * Section5: Check minor diagonal sum\n\t\t * Description: check the last one in the minor diagonal, if minor diagonal sum != Magic_Constant,\n\t\t * return false.\n\t\t * @Author: Zeyu Ni, Binglin Xie, Yingbin Zheng / CS-593-B / Final Project\n\t\t * @Create Date:: 4/17/2016\n\t\t */\n\t\tif(testIndex == maxNum - order){///last one in the minor diagonal sum = Magic_Constant\n\t\t\tint sum = 0;\n\t\t\tfor (int i = 0; i < order; i++) {\n\t\t\t\tfor(int j = i * order; j < (i + 1) * order; j++){\n\t\t\t\t\tif(j % order == order - i - 1){\n\t\t\t\t\t\tsum += m[j];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(sum != Magic_Constant){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t/**\n\t\t * Section6: Check Row too small or too big for first several numbers \n\t\t * Description: check if the first several numbers in a row too small or too big \n\t\t * return false.\n\t\t * @Author: Zeyu Ni, Binglin Xie, Yingbin Zheng / CS-593-B / Final Project\n\t\t * @Create Date:: 4/19/2016\n\t\t */\n\t\tif(remainder > 0 && remainder != order - 1){\n\t\t\t//calculate the sum of passed numbers in the row\n\t\t\tint rowSum = 0;\n\t\t\tfor(int i = testIndex - remainder; i <= testIndex; i++){\n\t\t\t\trowSum += m[i];\n\t\t\t}\n\t\t\t//judge the rowSum whether too small\n\t\t\tint bigNum = maxNum;\n\t\t\tint bigNumSum = 0;\n\t\t\tfor(int j = 0; j < order - remainder - 1; j++){\n\t\t\t\tbigNumSum += bigNum;\n\t\t\t\tbigNum--;\n\t\t\t}\n\t\t\tif(rowSum < Magic_Constant - bigNumSum){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t//judge the rowSum whether too big\n\t\t\tint smallNum = 1;\n\t\t\tint smallNumSum = 0;\n\t\t\tfor(int j = 0; j < order - remainder - 1; j++){\n\t\t\t\tsmallNumSum += smallNum;\n\t\t\t\tsmallNum++;\n\t\t\t}\n\t\t\tif(rowSum > Magic_Constant - smallNumSum){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\t\t\n\t\t/**\n\t\t * Section7: Check Column too small or too big for first several numbers \n\t\t * Description: check if the first several numbers in a column too small or too big\n\t\t * return false.\n\t\t * @Author: Zeyu Ni, Binglin Xie, Yingbin Zheng / CS-593-B / Final Project\n\t\t * @Create Date:: 4/21/2016\n\t\t */\n\t\tif(testIndex >= order){\n\t\t\t//calculate the sum of passed numbers in the column\n\t\t\tint colSum = 0;\n\t\t\tfor(int i = 0; i <= testIndex; i++){\n\t\t\t\tif(i % order == remainder){\n\t\t\t\t\tcolSum += m[i];\n\t\t\t\t}\t\n\t\t\t}\n\t\t\t//judge the colSum whether too small\n\t\t\tint bigNum = maxNum;\n\t\t\tint bigNumSum = 0;\n\t\t\tfor(int j = 0; j < order - quotient - 1; j++){\n\t\t\t\tbigNumSum += bigNum;\n\t\t\t\tbigNum--;\n\t\t\t}\n\t\t\tif(colSum < Magic_Constant - bigNumSum){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t//judge the colSum whether too big\n\t\t\tint smallNum = 1;\n\t\t\tint smallNumSum = 0;\n\t\t\tfor(int j = 0; j < order - quotient - 1; j++){\n\t\t\t\tsmallNumSum += smallNum;\n\t\t\t\tsmallNum++;\n\t\t\t}\n\t\t\tif(colSum > Magic_Constant - smallNumSum){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;//if all conditions pass, return ture\n\t}", "private boolean runMultiSampleCase() {\n\t\tArrayList<Candidate> candidates = collectTrioCandidates();\n\n\t\t// Then, check the candidates for all trios around affected individuals.\n\t\tfor (Candidate c : candidates)\n\t\t\tif (isCompatibleWithTriosAroundAffected(c))\n\t\t\t\treturn true;\n\t\treturn false;\n\t}", "@Test(timeout = 4000)\n public void test043() throws Throwable {\n Range range0 = Range.ofLength(0L);\n Range range1 = Range.of(0L);\n Range range2 = range1.intersection(range0);\n boolean boolean0 = range0.equals(range2);\n assertFalse(range1.isEmpty());\n assertTrue(range2.isEmpty());\n assertFalse(range2.equals((Object)range1));\n assertTrue(boolean0);\n }", "@Test\r\n public void testGroupSimilarity() throws Exception {\r\n final List<ICluster> originalCLuster = ClusteringTestUtilities.readSpectraClustersFromResource();\r\n Collections.sort(originalCLuster);\r\n List<ICluster> l1 = new ArrayList<ICluster>(originalCLuster);\r\n\r\n final List<ICluster> originalCLuster2 = ClusteringTestUtilities.readSpectraClustersFromResource();\r\n Collections.sort(originalCLuster2);\r\n List<ICluster> l2 = new ArrayList<ICluster>(originalCLuster2);\r\n\r\n ClusterListSimilarity cd = new ClusterListSimilarity(distanceMeasure);\r\n final List<ICluster> identical = cd.identicalClusters(l1, l2);\r\n\r\n Assert.assertEquals(originalCLuster.size(), identical.size());\r\n Assert.assertTrue(l1.isEmpty());\r\n Assert.assertTrue(l2.isEmpty());\r\n }", "@Test\n public void testConnectedComponents()\n {\n Collection<IIntArray> cc1 = MarkovModel.util.connectedComponents(P1);\n assertTrue(cc1.containsAll(C1));\n assertEquals(cc1.size(), C1.size());\n\n Collection<IIntArray> cc2 = MarkovModel.util.connectedComponents(P2);\n assertTrue(cc2.containsAll(C2));\n assertEquals(cc2.size(), C2.size());\n\n Collection<IIntArray> cc3 = MarkovModel.util.connectedComponents(P3);\n assertTrue(cc3.containsAll(C3));\n assertEquals(cc3.size(), C3.size()); \n }", "@Test\n void test_setDeny_multi_range() {\n String[] denyRules = {\"1.0.0.10/30\", \"1.0.1.2/31\", \"1.0.1.3/31\", \"1.0.20.3/30\", \"1.0.20.1/29\"};\n ipFilterConfiguration.setDeny(Arrays.asList(denyRules));\n TreeMap<Long, Ipv4Subnet> deny = ipFilterConfiguration.getDeny();\n\n // when\n String[] expectDenyRanges = {\"1.0.0.8/30\", \"1.0.1.2/31\", \"1.0.20.0/29\"};\n Map<Long, Ipv4Subnet> expect = new HashMap<>();\n for (String expectDenyRange : expectDenyRanges) {\n Ipv4Subnet subnet = new Ipv4Subnet(expectDenyRange);\n expect.put(subnet.getStartIpLong(), subnet);\n }\n\n // then\n Stream<Executable> executables = expect.keySet().stream()\n .map(expect::get)\n .map(expectValues -> () -> assertAll(\n String.format(\"test range start with %s\", expectValues.getIpLong()),\n () -> assertNotNull(deny.get(expectValues.getStartIpLong())),\n () -> assertEquals(expectValues.getCidr(), deny.get(expectValues.getStartIpLong()).getCidr()),\n () -> assertEquals(expectValues.getStartIpLong(), deny.get(expectValues.getStartIpLong()).getStartIpLong()),\n () -> assertEquals(expectValues.getEndIpLong(), deny.get(expectValues.getStartIpLong()).getEndIpLong())\n ));\n assertAll(\"test if deny rules are nested, then aggregate (even if different mask)\",\n () -> assertEquals(3, deny.size()),\n () -> assertAll(executables));\n }", "@Test\n public void testIntersection1()\n {\n final int[] ints1 = {33, 100000};\n final int[] ints2 = {33, 100000};\n List<Integer> expected = Arrays.asList(33, 100000);\n\n ConciseSet set1 = new ConciseSet();\n for (int i : ints1) {\n set1.add(i);\n }\n ConciseSet set2 = new ConciseSet();\n for (int i : ints2) {\n set2.add(i);\n }\n\n verifyIntersection(expected, set1, set2);\n }", "@Test\n\tpublic void testGetSlice() {\n\t}", "public boolean isIntersectionSatisfiable(OWLClass[] clses, ReasonerTaskListener taskListener) throws DIGReasonerException;", "@Test(timeout = 4000)\n public void test03() throws Throwable {\n Discretize discretize0 = new Discretize();\n discretize0.setAttributeIndices(\"\");\n Filter.makeCopy(discretize0);\n discretize0.setDesiredWeightOfInstancesPerInterval(2.0);\n boolean boolean0 = true;\n discretize0.m_ClassIndex = 0;\n discretize0.setUseBinNumbers(true);\n discretize0.listOptions();\n discretize0.makeBinaryTipText();\n discretize0.getInvertSelection();\n // Undeclared exception!\n try { \n discretize0.calculateCutPointsByEqualWidthBinning((-458));\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"weka.filters.unsupervised.attribute.Discretize\", e);\n }\n }", "private static boolean sliceIsValid(final int[] slice, final int flowOrderLength) {\n int consecutiveZeros = 0;\n for ( int key : slice ) {\n if ( key != 0 ) {\n consecutiveZeros = 0;\n } else {\n consecutiveZeros++;\n if ( consecutiveZeros >= (flowOrderLength - 1) ) {\n return false;\n }\n }\n }\n\n // if here, not found -> valid\n return true;\n }", "boolean isNeedSharding();", "@Test\n public void testColocationPartitionedRegion() throws Throwable {\n // Create Cache in all VMs VM0,VM1,VM2,VM3\n\n createCacheInAllVms();\n\n redundancy = 0;\n localMaxmemory = 50;\n totalNumBuckets = 11;\n\n // Create Customer PartitionedRegion in All VMs\n regionName = CustomerPartitionedRegionName;\n colocatedWith = null;\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n // Create Order PartitionedRegion in All VMs\n regionName = OrderPartitionedRegionName;\n colocatedWith = CustomerPartitionedRegionName;\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n // Create Shipment PartitionedRegion in All VMs\n regionName = ShipmentPartitionedRegionName;\n colocatedWith = OrderPartitionedRegionName;\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n // Initial Validation for the number of data stores and number of profiles\n accessor.invoke(() -> PRColocationDUnitTest\n .validateBeforePutCustomerPartitionedRegion(CustomerPartitionedRegionName));\n\n // Put the customer 1-10 in CustomerPartitionedRegion\n accessor.invoke(\n () -> PRColocationDUnitTest.putCustomerPartitionedRegion(CustomerPartitionedRegionName));\n\n // Put the order 1-10 for each Customer in OrderPartitionedRegion\n accessor\n .invoke(() -> PRColocationDUnitTest.putOrderPartitionedRegion(OrderPartitionedRegionName));\n\n // Put the shipment 1-10 for each order in ShipmentPartitionedRegion\n accessor.invoke(\n () -> PRColocationDUnitTest.putShipmentPartitionedRegion(ShipmentPartitionedRegionName));\n\n // for VM0 DataStore check the number of buckets created and the size of\n // bucket for all partitionedRegion\n Integer totalBucketsInDataStore1 = dataStore1\n .invoke(() -> PRColocationDUnitTest.validateDataStore(CustomerPartitionedRegionName,\n OrderPartitionedRegionName, ShipmentPartitionedRegionName));\n\n // for VM1 DataStore check the number of buckets created and the size of\n // bucket for all partitionedRegion\n Integer totalBucketsInDataStore2 = dataStore2\n .invoke(() -> PRColocationDUnitTest.validateDataStore(CustomerPartitionedRegionName,\n OrderPartitionedRegionName, ShipmentPartitionedRegionName));\n\n // for VM3 Datastore check the number of buckets created and the size of\n // bucket for all partitionedRegion\n Integer totalBucketsInDataStore3 = dataStore3\n .invoke(() -> PRColocationDUnitTest.validateDataStore(CustomerPartitionedRegionName,\n OrderPartitionedRegionName, ShipmentPartitionedRegionName));\n\n // Check the total number of buckets created in all three Vms are equalto 30\n totalNumBucketsInTest = totalBucketsInDataStore1\n + totalBucketsInDataStore2 + totalBucketsInDataStore3;\n assertEquals(totalNumBucketsInTest, 30);\n\n // This is the importatnt check. Checks that the colocated Customer,Order\n // and Shipment are in the same VM\n\n accessor.invoke(() -> PRColocationDUnitTest.validateAfterPutPartitionedRegion(\n CustomerPartitionedRegionName, OrderPartitionedRegionName, ShipmentPartitionedRegionName));\n }", "boolean sameDimensions(List<Layer> layers);", "public static void main(String[]args){\n\r\n int []arr = new int[100];\r\n int []arr2 = new int[50];\r\n int []arr3 = {1,2,3,4,5,6,7,8};\r\n int number = 5;\r\n LogicalOp op = new LogicalOp();\r\n// op.writeOnArray(arr);\r\n\r\n// arr2 = op.evenArray(arr2);\r\n// for(int i=0;i<arr2.length;i++)\r\n// System.out.println(arr2[i]);\r\n\r\n //System.out.println(\"Mean value: \"+op.meanValue(arr3));\r\n\r\n// String[] arrOfStr = {\"ana\",\"are\",\"mere\",\"pere\",\"mere\"};\r\n// String str = \"mere\";\r\n// System.out.println(op.isContaingString(arrOfStr,str));\r\n\r\n// System.out.println(op.findPosition(arr3,number));\r\n\r\n //op.displayLines();\r\n\r\n// int[]modifArr = op.modifiedArr(arr3,number);\r\n// for(int item: modifArr)\r\n// System.out.print(item+\" \");\r\n\r\n\r\n //System.out.println(\"Second minimum: \"+op.secondMin(arr3));\r\n\r\n int[] empty = new int[arr3.length];\r\n empty = op.populateArray(arr3,empty);\r\n for(int item:empty)\r\n System.out.print(item+\" \");\r\n\r\n\r\n\r\n }", "private boolean kcss(int[] i, long[] e, long y) {\n int I = i.length;\n long[] x = new long[I];\n while (true) {\n x[0] = ll(i[0]); // 1\n snapshot(i, 1, I, x); // 2\n if (Arrays.compare(x, e) != 0) { // 3\n sc(i[0], x[0]); // 3a\n return false; // 3a\n }\n if (sc(i[0], y)) return true; // 3b\n } // 3c\n }", "boolean hasSharedCriterion();", "public void test_containsII() {\n\tfinal int COUNT = 60000000;\n\t\n\tRectangle r = new Rectangle(1, 2, 3, 4);\n\n\tPerformanceMeter meter = createMeter(\"contains\");\n\tmeter.start();\n\tfor (int i = 0; i < COUNT; i++) {\n\t\tr.contains(2, 3);\t// does contain\n\t}\n\tmeter.stop();\n\t\n\tdisposeMeter(meter);\n\t\n\tmeter = createMeter(\"disjoint\");\n\tmeter.start();\n\tfor (int i = 0; i < COUNT; i++) {\n\t\tr.contains(9, 12);\t// does not contain\n\t}\n\tmeter.stop();\n\t\n\tdisposeMeter(meter);\n}", "public void compareWithinClusters() {\n\t\tList<Cluster> clusterList = clusterDao.getClusterList();\n\n\t\tfor (Cluster cluster : clusterList) {\n\t\t\tList<Document> docList = documentDao.getDocListByClusterId(cluster.getId());\n\t\t\tint size = docList.size();\n\t\t\t\n\t\t\tdouble[][] matrix = new double[size][size];\n\t\t\t\n\t\t\tfor(int i =0; i<size; i++){\n\t\t\t\tmatrix[i][i] = 1;\n\t\t\t\tmatrix[i][i] = 1;\n\t\t\t}\n\t\t\t\n\t\t\tif (size > 1) {\n\t\t\t\t//List<Document> docList2 = docList1;\n\t\t\t\tfor (int i=0; i<size; i++){\n\t\t\t\t\tfor(int j=i+1; j<size; j++){\n\t\t\t\t\t\t//match docs docList.get(i) & docList.get(j)\n\t\t\t\t\t\tMap<String, Double> map = datumboxCaller.compareDocs(docList.get(i).getDocName(), docList.get(j).getDocName());\n\t\t\t\t\t\tmatrix[i][j] = map.get(\"Oliver\");\n\t\t\t\t\t\tmatrix[j][i] = map.get(\"Shingle\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//persist both metrics in a file \n\t\t\tpersist(matrix, cluster, docList);\n\t\t\t\n\t\t\t//printing the matrix\n\t\t\tSystem.out.println(\"\\nDocument Similarity Matrix for Cluster \"+cluster.getId());\n\t\t\tSystem.out.println(\"\\nOliver Metric\");\n\t\t\tSystem.out.print(\"id\");\n\t\t\tfor(int i=0; i<size; i++)\n\t\t\t\tSystem.out.print(\"\\t\"+docList.get(i).getId());\n\t\t\t\n\t\t\tfor(int i=0; i<size; i++){\n\t\t\t\tSystem.out.println(docList.get(i).getId());\n\t\t\t\tfor(int j=0; j<size; j++){\n\t\t\t\t\tSystem.out.print(\"\\t\");\n\t\t\t\t\tif(j>=i)\n\t\t\t\t\t\tSystem.out.print(matrix[i][j]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(\"\\nShingle Metric\");\n\t\t\tSystem.out.print(\"id\");\n\t\t\tfor(int i=0; i<size; i++)\n\t\t\t\tSystem.out.print(\"\\t\"+docList.get(i).getId());\n\t\t\t\n\t\t\tfor(int i=0; i<size; i++){\n\t\t\t\tSystem.out.print(\"\\n\"+docList.get(i).getId());\n\t\t\t\tfor(int j=0; j<size; j++){\n\t\t\t\t\tSystem.out.print(\"\\t\");\n\t\t\t\t\tif(j>=i)\n\t\t\t\t\t\tSystem.out.print(matrix[j][i]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t//print ends\n\t\t\t\n\t\t}\n\n\t}", "private boolean checkSubBoundary(Index3D idx, Index3D center) {\n if (idx.i1() - center.i1() <= subVolumeSizeRadius &&\n idx.i2() - center.i2() <= subVolumeSizeRadius &&\n idx.i3() - center.i3() <= subVolumeSizeRadius &&\n center.i1() - idx.i1() <= subVolumeSizeRadius &&\n center.i2() - idx.i2() <= subVolumeSizeRadius &&\n center.i3() - idx.i3() <= subVolumeSizeRadius\n ) {\n return true;\n } else {\n return false;\n }\n }", "@ParameterizedTest\n @ArgumentsSource(TestForestProvider.class)\n public void testMultipleAttributions(RandomCutForest forest) {\n int hardPass=0;\n int causal=0;\n double [] point ={6.0,0.0,0.0};\n DiVector result = forest.getAnomalyAttribution(point);\n assertTrue(result.low[0] < 0.2);\n if (result.getHighLowSum(1) < 0.5) ++hardPass;\n if (result.getHighLowSum(2) < 0.5) ++hardPass;\n assertTrue(result.getHighLowSum(1) + result.getHighLowSum(2) < 1.0);\n assertTrue(result.high[0] > forest.getAnomalyScore(point)/3);\n if (result.high[0] > 0.5 * forest.getAnomalyScore(point)) ++causal;\n\n // the last line states that first coordinate was high and was a majority contributor to the score\n // the previous test states that the contribution is twice the average of the 12 possible contributors.\n // these tests all subparts of the score at once\n\n point=new double [] {-6.0,0.0,0.0};\n result = forest.getAnomalyAttribution(point);\n assertTrue(result.getHighLowSum()>1.0);\n assertTrue(result.high[0] < 0.5);\n if (result.getHighLowSum(1) < 0.5) ++hardPass;\n if (result.getHighLowSum(2) < 0.5) ++hardPass;\n assertTrue(result.low[0] > forest.getAnomalyScore(point)/3);\n if (result.low[0] > 0.5 * forest.getAnomalyScore(point)) ++causal;\n\n\n point=new double [] {0.0,6.0,0.0};\n assertTrue(result.getHighLowSum()>1.0);\n result = forest.getAnomalyAttribution(point);\n if (result.getHighLowSum(0) < 0.5) ++hardPass;\n if (result.getHighLowSum(2) < 0.5) ++hardPass;\n assertTrue(result.low[1] < 0.5);\n assertTrue(result.high[1] > forest.getAnomalyScore(point)/3);\n if (result.high[1] > 0.5 * forest.getAnomalyScore(point)) ++causal;\n\n\n point=new double [] {0.0,-6.0,0.0};\n assertTrue(result.getHighLowSum()>1.0);\n result = forest.getAnomalyAttribution(point);\n if (result.getHighLowSum(0) < 0.5) ++hardPass;\n if (result.getHighLowSum(2) < 0.5) ++hardPass;\n assertTrue(result.high[1] < 0.5);\n assertTrue(result.low[1] > forest.getAnomalyScore(point)/3);\n if (result.low[1] > 0.5 * forest.getAnomalyScore(point)) ++causal;\n\n\n point=new double [] {0.0,0.0,6.0};\n assertTrue(result.getHighLowSum()>1.0);\n result = forest.getAnomalyAttribution(point);\n if (result.getHighLowSum(0) < 0.5) ++hardPass;\n if (result.getHighLowSum(1) < 0.5) ++hardPass;\n assertTrue(result.low[2] < 0.5);\n assertTrue(result.high[2] > forest.getAnomalyScore(point)/3);\n if (result.high[2] > 0.5 * forest.getAnomalyScore(point)) ++causal;\n\n point=new double [] {0.0,0.0,-6.0};\n assertTrue(result.getHighLowSum()>1.0);\n result = forest.getAnomalyAttribution(point);\n if (result.getHighLowSum(0) < 0.5) ++hardPass;\n if (result.getHighLowSum(1) < 0.5) ++hardPass;\n assertTrue(result.high[2] < 0.5);\n assertTrue(result.low[2] > forest.getAnomalyScore(point)/3);\n if (result.low[2] > 0.5 * forest.getAnomalyScore(point)) ++causal;\n\n\n assertTrue(causal>=5); // maximum is 6; there can be skew in one direction\n\n point=new double [] {-3.0,0.0,0.0};\n result = forest.getAnomalyAttribution(point);\n assertTrue(result.high[0] < 0.5);\n if (result.getHighLowSum(1) < 0.5) ++hardPass;\n if (result.getHighLowSum(2) < 0.5) ++hardPass;\n assertTrue(result.low[0] >\n forest.getAnomalyScore(point)/3);\n\n /* For multiple causes, the relationship of scores only hold for larger\n * distances.\n */\n\n point=new double [] {-3.0,6.0,0.0};\n assertTrue(result.getHighLowSum()>1.0);\n result = forest.getAnomalyAttribution(point);\n if (result.low[0] > 0.5) ++hardPass;\n assertTrue(result.high[0] < 0.5);\n assertTrue(result.low[1] < 0.5);\n assertTrue(result.high[1] > 0.5);\n if (result.high[1]>0.9) ++hardPass;\n assertTrue(result.getHighLowSum(2)< 0.5);\n assertTrue(result.high[1]+result.low[0]>\n 0.8*forest.getAnomalyScore(point));\n\n point=new double [] {6.0,-3.0,0.0};\n assertTrue(result.getHighLowSum()>1.0);\n result = forest.getAnomalyAttribution(point);\n assertTrue(result.low[0] < 0.5);\n assertTrue(result.high[0] > 0.5);\n if (result.high[0]>0.9) ++hardPass;\n if (result.low[1] > 0.5) ++hardPass;\n assertTrue(result.high[1] < 0.5);\n assertTrue(result.getHighLowSum(2) < 0.5);\n assertTrue(result.high[0]+result.low[1]>\n 0.8*forest.getAnomalyScore(point));\n\n point=new double [] {20.0,-10.0,0.0};\n assertTrue(result.getHighLowSum()>1.0);\n result = forest.getAnomalyAttribution(point);\n assertTrue(result.high[0]+result.low[1]>\n 0.8*forest.getAnomalyScore(point));\n if (result.high[0]>1.8*result.low[1]) ++hardPass;\n if (result.low[1]>result.high[0]/2.2) ++hardPass;\n\n assertTrue(hardPass>=15); //maximum is 20\n }", "@Test\n public void testSegmentSelection() {\n assertMetrics(\"segments:2 absoluteProximity:0.1 proximity:1 segmentStarts:19,41\",\n \"a b c d e\",\"x a b x c x x x x x x x x x x x x x x a b c x x x x x x x x x e x d x c d x x x c d e\");\n // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2\n // 0 1 2 3 4\n // Should choose - - - - -\n\n // Same as above but best matching segment have too low exactness\n assertMetrics(\"segments:2 absoluteProximity:0.0903 proximity:0.9033 segmentStarts:1,41\",\n \"a b c d e\",\"x a b x c x x x x x x x x x x x x x x a:0.2 b:0.3 c:0.4 x x x x x x x x x e x d x c d x x x c d e\");\n // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2\n // 0 1 2 3 4\n // Should choose - - - - -\n\n assertMetrics(\"segments:1 absoluteProximity:0.0778 proximity:0.778\",\"a b c d e f\",\"x x a b b b c f e d a b c d x e x x x x x f d e f a b c a a b b c c d d e e f f\");\n\n // Prefer one segment with ok proximity over two segments with great proximity\n assertMetrics(\"segments:1 segmentStarts:0\",\"a b c d\",\"a b x c d x x x x x x x x x x x a b x x x x x x x x x x x c d\");\n assertMetrics(\"segments:1 segmentStarts:0\",\"a b c d\",\"a b x x x x x x x x c d x x x x x x x x x x x a b x x x x x x x x x x x c d\");\n }", "@Test\n\tpublic void evalCrispDistanceWithFuzzyNumberOverlap2(){\n\t\tFuzzySet res = cs4.distance(dfn3);\n\t\tassertTrue(res instanceof FuzzyInterval);\n\t\tFuzzyInterval fuzzyRes = (FuzzyInterval)res;\n\t\t//Puntos limite\n\t\tassertTrue(fuzzyRes.getMembershipValue(0)==1);\n\t\tassertTrue(fuzzyRes.getMembershipValue(1)==1);\n\t\tassertTrue(fuzzyRes.getMembershipValue(2)==0);\n\t\t//Valores exteriores\n\t\tassertTrue(fuzzyRes.getMembershipValue(3)==0);\n\t\tassertTrue(fuzzyRes.getMembershipValue(-1)==0);\n\t}", "private boolean checkSharedVertex(Segment s1, Segment s2){\n\t\tdouble wp1x = s1.w1.getX();\n\t\tdouble wp1y = s1.w1.getY();\n\t\tdouble wp2x = s1.w2.getX();\n\t\tdouble wp2y = s1.w2.getY();\n\t\tdouble wp3x = s2.w1.getX();\n\t\tdouble wp3y = s2.w1.getY();\n\t\tdouble wp4x = s2.w2.getX();\n\t\tdouble wp4y = s2.w2.getY();\n\n\t\tif (((wp1x == wp3x && wp1y == wp3y) || (wp1x == wp4x && wp1y == wp4y)) \n\t\t|| ((wp2x == wp3x && wp2y == wp3y) || (wp2x == wp4x && wp2y == wp4y)))\n\t\t\treturn true;\n\t\t\n\t\treturn false;\n\t}", "@Test\n public void testIntersection2()\n {\n final int[] ints1 = {33, 100000};\n final int[] ints2 = {34, 100000};\n List<Integer> expected = Collections.singletonList(100000);\n\n ConciseSet set1 = new ConciseSet();\n for (int i : ints1) {\n set1.add(i);\n }\n ConciseSet set2 = new ConciseSet();\n for (int i : ints2) {\n set2.add(i);\n }\n\n verifyIntersection(expected, set1, set2);\n }", "private boolean checkOverlap(int row, int col, int length){\n \tif(!inBounds(row,col)){\n \t\treturn false;\n \t}\n \tfor(int i = row; i < row + length; i++ ){\n\t\t\tfor(int j = col; j < col + length; j++){\n\t\t\t\tif(grid[i][col] == 1 || row + length >= 10)\n\t\t\t\t\treturn false;\n\t\t\t\tif(grid[row][j] == 1 || col + length >= 10)\n\t\t\t\t\treturn false;\n\t\t\t}\n \t\t\n \t}\n \treturn true;\n }", "public boolean isSubset() {\n return isSubset;\n }", "public boolean isSubset() {\n return isSubset;\n }", "@Override\n protected void doAlgorithmA1() {\n int xP = 0;\n int yP = 0;\n\n\n //Taking the variable out of the list that are in the bounds\n //Testing that the bound has variables\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getX() != null) {\n xP = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getX().getPosition();\n }\n int xU = 0;\n int xL = 0;\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getY() != null) {\n yP = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getY().getPosition();\n }\n int yU = 0;\n int yL = 0;\n int cright = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getCright();\n int cleft = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getCleft();\n\n\n\n for (Variable variable : csp.getVars()) {\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getX() != null) {\n if (variable.getPosition() == xP) {\n xU = variable.getUpperDomainBound();\n xL = variable.getLowerDomainBound();\n }\n }\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getY() != null) {\n if (variable.getPosition() == yP) {\n yU = variable.getUpperDomainBound();\n yL = variable.getLowerDomainBound();\n }\n }\n }\n\n boolean first = false;\n boolean second = false;\n\n //Testing if the bound is true, false or inconclusive\n\n if (xL + cleft >= yU + cright) {\n first = true;\n }\n if (xU + cleft < yL + cright) {\n second = true;\n }\n\n //are first and second not equal is the bound not inconclusive\n if (first != second) {\n if (first) { //a true Simple Bound was found\n //checks if it was the last constraint in a csp\n //If so the csp is true\n //else check the next constraint and do this method again\n if (csp.getSimpleConstraints().size() - 1 == cIndex) {\n System.out.println(\"P is satisfiable\");\n System.out.println(System.nanoTime()-startTime);\n return;\n } else {\n bIndex = 0;\n cIndex++;\n unit=false;\n doAlgorithmA1();\n }\n } else if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().size() - 1 == bIndex) { //a false Simple Bound was found\n //\n bIndex = 0;\n cIndex = 0;\n if (isInconclusive) {\n if(unit){\n doDeduction();\n }else {\n doAlgorithmA3();\n }\n } else {\n doAlgorithmA2();\n }\n } else {\n bIndex++;\n doAlgorithmA1();\n }\n } else {//an inconclusive Simple Bound was found\n //checks if the bound wasn't already inconclusive\n if(!isInconclusive){\n unit=true;\n unitSB = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex);\n }else {\n unit=false;\n }\n isInconclusive = true;\n\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().size() - 1 == bIndex) {\n cIndex = 0;\n bIndex = 0;\n if(unit){\n doDeduction();\n }else {\n doAlgorithmA3();\n }\n } else {\n bIndex++;\n doAlgorithmA1();\n }\n }\n }", "@Test(timeout = 4000)\n public void test104() throws Throwable {\n Range.CoordinateSystem range_CoordinateSystem0 = Range.CoordinateSystem.RESIDUE_BASED;\n Range range0 = Range.of(range_CoordinateSystem0, 9223372036854775806L, 9223372036854775806L);\n Range.CoordinateSystem range_CoordinateSystem1 = Range.CoordinateSystem.RESIDUE_BASED;\n Range.of(range_CoordinateSystem1, 9223372032559808516L, 9223372032559808516L);\n Range range1 = Range.of(9223372036854775806L, 9223372036854775806L);\n range1.split(9223372032559808516L);\n boolean boolean0 = range1.endsBefore(range0);\n assertFalse(boolean0);\n \n boolean boolean1 = range0.equals(range1);\n assertFalse(boolean1);\n }", "public void testLearnFullDimensions()\n {\n RandomSubVectorThresholdLearner<String> instance = new RandomSubVectorThresholdLearner<>(\n new VectorThresholdInformationGainLearner<String>(),\n 0.9999, random);\n\n \n VectorFactory<?> vectorFactory = VectorFactory.getDefault();\n ArrayList<InputOutputPair<Vector, String>> data = new ArrayList<>();\n for (int i = 0; i < 10; i++)\n {\n data.add(new DefaultInputOutputPair<>(vectorFactory.createUniformRandom(\n 100, 1.0, 10.0, random), \"a\"));\n }\n\n for (int i = 0; i < 10; i++)\n {\n data.add(new DefaultInputOutputPair<>(vectorFactory.createUniformRandom(\n 100, 1.0, 10.0, random), \"b\"));\n }\n\n VectorElementThresholdCategorizer result = instance.learn(data);\n assertTrue(result.getIndex() >= 0);\n assertTrue(result.getIndex() < 100);\n \n // Change the dimensions to consider.\n instance.setDimensionsToConsider(new int[] {10});\n\n result = instance.learn(data);\n assertTrue(result.getIndex() == 10);\n }", "@Test\n public void testBoundsAsCompositesWithMultiInRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n Restriction in = newMultiIN(cfMetaData, 0, asList(value1, value2), asList(value2, value3));\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(in);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertComposite(bounds.get(1), value2, value3, EOC.END);\n }", "boolean isAllowClusterGet();", "private static Restriction newMultiSlice(CFMetaData cfMetaData, int firstIndex, Bound bound, boolean inclusive, ByteBuffer... values)\n {\n List<ColumnDefinition> columnDefinitions = new ArrayList<>();\n for (int i = 0; i < values.length; i++)\n {\n columnDefinitions.add(getClusteringColumnDefinition(cfMetaData, i + firstIndex));\n }\n return new MultiColumnRestriction.Slice(columnDefinitions, bound, inclusive, toMultiItemTerminal(values));\n }", "private boolean validationPhase(Secret secretA, Secret secretB, int smallestSize, double[] optimalBox) {\n\n\t\t// number of all possible subsets with a size of smallestSize\n\t\tint numberSubsets; \n\t\tif((secretA.getTimes().size() / smallestSize) <= (secretB.getTimes().size() / smallestSize)) {\n\t\t\tnumberSubsets = (secretA.getTimes().size() / smallestSize);\n\t\t} else {\n\t\t\tnumberSubsets = (secretB.getTimes().size() / smallestSize);\n\t\t}\n\n\t\t// rest of the size modulo all subsets\n\t\tint restA = secretA.getTimes().size() % (numberSubsets * smallestSize);\n\t\tint restB = secretB.getTimes().size() % (numberSubsets * smallestSize);\n\n\t\tArrayList<Time> subsetA; \n\t\tArrayList<Time> subsetB;\n\n\t\tint countWrongResults = 0;\n\n\t\tArrayList<String> validateSubsetSignificantDifferent = new ArrayList<String>();\n\t\tArrayList<String> validateSubsetOverlapA = new ArrayList<String>();\n\t\tArrayList<String> validateSubsetOverlapB = new ArrayList<String>();\n\t\tArrayList<Time> prevSubsetA = new ArrayList<Time>();\n\t\tArrayList<Time> prevSubsetB = new ArrayList<Time>();\n\n\n\t\tfor (int i = 0; i < numberSubsets; ++i) {\n\n\t\t\tint countInvalid = 0;\n\t\t\t// the rest will be deducted at the beginning\n\t\t\tsubsetA = secretA.getBisectedTimes(restA + (smallestSize * i), smallestSize);\n\t\t\tsubsetB = secretB.getBisectedTimes(restB + (smallestSize * i), smallestSize);\n\n\t\t\tCollections.sort(subsetA);\n\t\t\tCollections.sort(subsetB);\n\n\t\t\tif (BoxTest.boxTestSmaller(subsetA, subsetB, optimalBox)) {\n\t\t\t\tvalidateSubsetSignificantDifferent.add(\"o\");\n\n\t\t\t} else {\n\t\t\t\tvalidateSubsetSignificantDifferent.add(\"x\");\n\t\t\t\t//logger.info(\"subset \" + i + \": wrong result\");\n\t\t\t\t++countInvalid;\n\t\t\t}\n\t\t\t\n\t\t\tif(i != 0) {\n\t\t\t\tif (BoxTest.boxTestOverlap(prevSubsetA, subsetA, optimalBox)) {\n\t\t\t\t\tvalidateSubsetOverlapA.add(\"o\");\n\n\t\t\t\t} else {\n\t\t\t\t\tvalidateSubsetOverlapA.add(\"x\");\n\t\t\t\t\t//logger.info(\"subset \" + i + \": only significant different\");\n\t\t\t\t\t++countInvalid;\n\t\t\t\t} \n\n\t\t\t\tif (BoxTest.boxTestOverlap(prevSubsetB, subsetB, optimalBox)) {\n\t\t\t\t\tvalidateSubsetOverlapB.add(\"o\");\n\t\t\t\t\t//logger.info(\"subset \" + i + \": right result\");\n\n\t\t\t\t} else {\n\t\t\t\t\tvalidateSubsetOverlapB.add(\"x\");\n\t\t\t\t\t//logger.info(\"subset \" + i + \": only significant different, subset A overlaps\");\n\t\t\t\t\t++countInvalid;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(countInvalid > 0) {\n\t\t\t\t++countWrongResults;\n\t\t\t}\n\n\t\t\tprevSubsetA = new ArrayList<Time>();\n\t\t\tprevSubsetB = new ArrayList<Time>();\n\n\t\t\tprevSubsetA = subsetA;\n\t\t\tprevSubsetB = subsetB;\n\t\t}\n\n\t\tdouble confidenceInterval = 100 - (countWrongResults * 100 / numberSubsets);\n\n\t\tthis.boxTestResults.get(this.boxTestResults.size() - 1).saveValidation(smallestSize, confidenceInterval, validateSubsetOverlapA, validateSubsetOverlapB, validateSubsetSignificantDifferent);\n\t\tlogger.finest(\"\\n\\\"o\\\" = successful box test \\n\\\"x\\\" = unsuccesful box test\\n\");\n\t\tlogger.finest(secretA.getName() + \" overlaps: \" + Folder.convertArrayListToString(validateSubsetOverlapA));\n\t\tlogger.finest(secretB.getName() + \" overlaps: \" + Folder.convertArrayListToString(validateSubsetOverlapB));\n\t\tlogger.finest(secretA.getName() + \" < \" + secretB.getName() + \": \" + Folder.convertArrayListToString(validateSubsetSignificantDifferent));\n\n\t\tlogger.info(secretA.getName() + \" < \" + secretB.getName() + \": validate smallest size \" + smallestSize + \": \" + countWrongResults + \" out of \" + numberSubsets + \" comparisons returned wrong results.\");\n\n\t\tif(countWrongResults != 0) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "protected boolean checkConcurrency(DNode cutoff, DNode corr,\n\t\t\tDNode[] cutoff_cut, DNode[] corr_cut) {\n\t\tSet<Integer> cutoffSet = new HashSet<Integer>();\n\t\tSet<Integer> corrSet = new HashSet<Integer>();\n\n\t\tint i = 0;\n\t\tfor (i = 0; i < cutoff_cut.length; i++)\n\t\t\tcutoffSet.add(cutoff_cut[i].globalId);\n\t\tfor (i = 0; i < corr_cut.length; i++)\n\t\t\tcorrSet.add(corr_cut[i].globalId);\n\t\tfor (i = 0; i < cutoff.post.length; i++)\n\t\t\tcutoffSet.remove(cutoff.post[i].globalId);\n\t\tfor (i = 0; i < corr.post.length; i++)\n\t\t\tcorrSet.remove(corr.post[i].globalId);\n\n\t\tif (cutoffSet.size() != corrSet.size())\n\t\t\treturn false;\n\t\tfor (Integer n : cutoffSet) {\n\t\t\tif (!corrSet.contains(n))\n\t\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "@Test\n\tvoid attributeCardinality() {\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(CLINICAL_FINDING, DISORDER, BLEEDING, BLEEDING_SKIN, PENTALOGY_OF_FALLOT, PENTALOGY_OF_FALLOT_INCORRECT_GROUPING),\n\t\t\t\tstrings(selectConceptIds(\"<<\" + CLINICAL_FINDING + \":[0..*]\" + FINDING_SITE + \"=*\")));\n\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(CLINICAL_FINDING, DISORDER, BLEEDING, BLEEDING_SKIN, PENTALOGY_OF_FALLOT, PENTALOGY_OF_FALLOT_INCORRECT_GROUPING),\n\t\t\t\tstrings(selectConceptIds(\"<<\" + CLINICAL_FINDING + \":[0..2]\" + FINDING_SITE + \"=*\")));\n\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(BLEEDING_SKIN, PENTALOGY_OF_FALLOT, PENTALOGY_OF_FALLOT_INCORRECT_GROUPING),\n\t\t\t\tstrings(selectConceptIds(\"<<\" + CLINICAL_FINDING + \":[1..2]\" + FINDING_SITE + \"=*\")));\n\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(BLEEDING_SKIN),\n\t\t\t\tstrings(selectConceptIds(\"<<\" + CLINICAL_FINDING + \":[1..1]\" + FINDING_SITE + \"=*\")));\n\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(BLEEDING_SKIN, CLINICAL_FINDING, DISORDER, BLEEDING),\n\t\t\t\tstrings(selectConceptIds(\"<<\" + CLINICAL_FINDING + \":[0..1]\" + FINDING_SITE + \"=*\")));\n\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(CLINICAL_FINDING, DISORDER, BLEEDING),\n\t\t\t\tstrings(selectConceptIds(\"<<\" + CLINICAL_FINDING + \":[0..0]\" + FINDING_SITE + \"=*\")));\n\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(BLEEDING_SKIN, PENTALOGY_OF_FALLOT, PENTALOGY_OF_FALLOT_INCORRECT_GROUPING),\n\t\t\t\tstrings(selectConceptIds(\"<<\" + CLINICAL_FINDING + \":[1..2]\" + FINDING_SITE + \"= <<\" + BODY_STRUCTURE)));\n\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(BLEEDING_SKIN),\n\t\t\t\tstrings(selectConceptIds(\n\t\t\t\t\t\t\"<<\" + CLINICAL_FINDING + \":\" +\n\t\t\t\t\t\t\t\t\"[1..2]\" + FINDING_SITE + \"= <<\" + BODY_STRUCTURE + \",\" +\n\t\t\t\t\t\t\t\t\"[0..0]\" + ASSOCIATED_MORPHOLOGY + \"= <<\" + STENOSIS)));\n\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(BLEEDING_SKIN, PENTALOGY_OF_FALLOT, PENTALOGY_OF_FALLOT_INCORRECT_GROUPING),\n\t\t\t\tstrings(selectConceptIds(\n\t\t\t\t\t\t\"<<\" + CLINICAL_FINDING + \":\" +\n\t\t\t\t\t\t\t\t\"[1..2]\" + FINDING_SITE + \"= <<\" + BODY_STRUCTURE + \",\" +\n\t\t\t\t\t\t\t\t\"[0..1]\" + ASSOCIATED_MORPHOLOGY + \"= <<\" + STENOSIS)));\n\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(PENTALOGY_OF_FALLOT, PENTALOGY_OF_FALLOT_INCORRECT_GROUPING),\n\t\t\t\tstrings(selectConceptIds(\n\t\t\t\t\t\t\"<<\" + CLINICAL_FINDING + \":\" +\n\t\t\t\t\t\t\t\t\"[1..2]\" + FINDING_SITE + \"= <<\" + BODY_STRUCTURE + \",\" +\n\t\t\t\t\t\t\t\t\"[1..*]\" + ASSOCIATED_MORPHOLOGY + \"= <<\" + STENOSIS)));\n\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(PENTALOGY_OF_FALLOT_INCORRECT_GROUPING),\n\t\t\t\tstrings(selectConceptIds(\n\t\t\t\t\t\t\"<<\" + CLINICAL_FINDING + \":\" +\n\t\t\t\t\t\t\t\t\"{\" +\n\t\t\t\t\t\t\t\t\"[1..1]\" + FINDING_SITE + \" != <<\" + PULMONARY_VALVE_STRUCTURE + \",\" +\n\t\t\t\t\t\t\t\t\"[1..*]\" + ASSOCIATED_MORPHOLOGY + \"= <<\" + STENOSIS + \"\" +\n\t\t\t\t\t\t\t\t\"}\")));\n\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(PENTALOGY_OF_FALLOT, PENTALOGY_OF_FALLOT_INCORRECT_GROUPING),\n\t\t\t\tstrings(selectConceptIds(\n\t\t\t\t\t\t\"<<\" + CLINICAL_FINDING + \":\" +\n\t\t\t\t\t\t\t\t\"[0..0]\" + FINDING_SITE + \" != <<\" + BODY_STRUCTURE + \",\" +\n\t\t\t\t\t\t\t\t\"[1..*]\" + ASSOCIATED_MORPHOLOGY + \"= <<\" + STENOSIS)));\n\n\t}", "public static boolean shouldProcessSlice(OBSlice x) throws Exception {\n return x.size() <= maxSliceSize;\n }", "private static boolean hasVisibleRegion(int begin,int end,int first,int last) {\n return (end > first && begin < last);\n }", "@Test\n\tpublic void evalCrispDistanceWithFuzzyNumberOverlap3(){\n\t\tFuzzySet res = cs1.distance(dfn4);\n\t\tassertTrue(res instanceof FuzzyInterval);\n\t\tFuzzyInterval fuzzyRes = (FuzzyInterval)res;\n\t\t//Puntos limite\n\t\tassertTrue(fuzzyRes.getMembershipValue(1)==1);\n\t\tassertTrue(fuzzyRes.getMembershipValue(3)==1);\n\t\tassertTrue(fuzzyRes.getMembershipValue(5)==0);\n\t\t//assertTrue(fuzzyRes.getMembershipValue(5)==0);\n\t\t//Valores exteriores\n\t\tassertTrue(fuzzyRes.getMembershipValue(6)==0);\n\t\tassertTrue(fuzzyRes.getMembershipValue(-1)==0);\n\t}", "private boolean consistencyCheckC2Constraints(double[][] xResults, double[][] yResults, double[] alpha) {\n\t\tint n = mExplicitMDP.getNumStates();\n\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tdouble outxValue = GRBSolverUtils.getOutValue(i, xResults, mExplicitMDP);\n\t\t\tdouble outyValue = GRBSolverUtils.getOutValue(i, yResults, mExplicitMDP);\n\t\t\tdouble inyValue = GRBSolverUtils.getInValue(i, yResults, mExplicitMDP);\n\t\t\tboolean satisfied = GRBSolverUtils.approximatelyEqual(outxValue + outyValue - inyValue, alpha[i],\n\t\t\t\t\tmSettings.getFeasibilityTolerance());\n\n\t\t\tif (!satisfied) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "boolean belongsToPool(int x);", "@Test\n public void should_iterate_with_default_params() throws Exception {\n long partitionKey = RandomUtils.nextLong(0,Long.MAX_VALUE);\n insertClusteredValues(partitionKey, 1, \"name1\", 5);\n\n Iterator<ClusteredEntity> iter = manager.sliceQuery(ClusteredEntity.class)\n .forIteration()\n .withPartitionComponents(partitionKey)\n .iterator();\n\n assertThat(iter.hasNext()).isTrue();\n ClusteredEntity next = iter.next();\n assertThat(next.getId().getCount()).isEqualTo(1);\n assertThat(next.getId().getName()).isEqualTo(\"name11\");\n assertThat(next.getValue()).isEqualTo(\"value11\");\n\n assertThat(iter.hasNext()).isTrue();\n next = iter.next();\n assertThat(next.getId().getCount()).isEqualTo(1);\n assertThat(next.getId().getName()).isEqualTo(\"name12\");\n assertThat(next.getValue()).isEqualTo(\"value12\");\n\n assertThat(iter.hasNext()).isTrue();\n next = iter.next();\n assertThat(next.getId().getCount()).isEqualTo(1);\n assertThat(next.getId().getName()).isEqualTo(\"name13\");\n assertThat(next.getValue()).isEqualTo(\"value13\");\n\n assertThat(iter.hasNext()).isTrue();\n next = iter.next();\n assertThat(next.getId().getCount()).isEqualTo(1);\n assertThat(next.getId().getName()).isEqualTo(\"name14\");\n assertThat(next.getValue()).isEqualTo(\"value14\");\n\n assertThat(iter.hasNext()).isTrue();\n next = iter.next();\n assertThat(next.getId().getCount()).isEqualTo(1);\n assertThat(next.getId().getName()).isEqualTo(\"name15\");\n assertThat(next.getValue()).isEqualTo(\"value15\");\n\n assertThat(iter.hasNext()).isFalse();\n }", "@Test\r\n\tpublic void testEqualsMunitions() {\r\n\t\tAssert.assertEquals(true,\r\n\t\t\t\tlist.getFirst().getData().equals(new Munitions(0, 1, \"iron\")));\r\n\t\tAssert.assertEquals(\r\n\t\t\t\tfalse,\r\n\t\t\t\tlist.getFirst().getNext().getData()\r\n\t\t\t\t\t\t.equals(new Munitions(4, 5, \"iron\")));\r\n\t}" ]
[ "0.7154399", "0.714508", "0.7102851", "0.7071646", "0.70400655", "0.70215666", "0.6899557", "0.68419933", "0.6808379", "0.66468716", "0.6644203", "0.66304994", "0.6546314", "0.6497844", "0.63617647", "0.6202963", "0.6139936", "0.5985461", "0.5802134", "0.5745651", "0.55448246", "0.5522221", "0.542131", "0.53729707", "0.53656447", "0.5319235", "0.52925426", "0.52830684", "0.52742904", "0.525719", "0.52529675", "0.51868486", "0.51782364", "0.5177115", "0.5162712", "0.51554966", "0.5133921", "0.51011366", "0.5097911", "0.5096719", "0.5094278", "0.50857824", "0.50545263", "0.50322366", "0.49984503", "0.49928826", "0.4974599", "0.4967763", "0.4963208", "0.49620566", "0.49492308", "0.4948389", "0.49127424", "0.4878155", "0.48777613", "0.487448", "0.48705748", "0.48655403", "0.4861456", "0.48562792", "0.48411322", "0.48410758", "0.48335373", "0.48299918", "0.48265246", "0.48180908", "0.4815708", "0.481386", "0.48078823", "0.48062542", "0.48050374", "0.47976446", "0.47895697", "0.4788172", "0.47768414", "0.47744086", "0.47635695", "0.47572142", "0.47504127", "0.47479385", "0.47467223", "0.47457892", "0.47443488", "0.47443488", "0.47434545", "0.47406977", "0.47392893", "0.47380576", "0.47370505", "0.47356874", "0.47331652", "0.4728947", "0.47265187", "0.47235405", "0.47174788", "0.47173014", "0.4714828", "0.4712634", "0.47125182", "0.47054684" ]
0.63417643
15
Test '(clustering_0, clustering_1) = (1, 2)' with two clustering column
@Test public void testBoundsAsCompositesWithMultiEqRestrictions() { CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC); ByteBuffer value1 = ByteBufferUtil.bytes(1); ByteBuffer value2 = ByteBufferUtil.bytes(2); Restriction eq = newMultiEq(cfMetaData, 0, value1, value2); PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(eq); List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value1, value2, EOC.START); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value1, value2, EOC.END); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface IStoppingCriteria {\n\n /**\n * Determine the degree of clustering agreement\n * @param cluster1 one clustering results\n * @param cluster2 the other clustering results\n * @return the degree of clustering agreement; 1 refers to be the same clustering results; 0 refers to be the totally different clustering results\n */\n public double computeSimilarity(int[] cluster1, int[] cluster2);\n\n}", "public double computeSimilarity(int[] cluster1, int[] cluster2);", "boolean getIsClusteringKey();", "public void decideCluster(){\n\tdouble shortest = 1000000;\n\tfor(int i = 0; i < clusterDist.length; i++)\n\t{\n\t\tif(clusterDist[i] < shortest)\n\t\t{\tshortest = clusterDist[i];\n\t\t\tthis.clusterid = i;\n\t\t}\n\t\t\n\t}\n}", "private void clusterElements(int element1,int element2)\n\t{\n\t\tint index1 = getClusterIndex(element1);\n\t\tint index2 = getClusterIndex(element2);\n\t\t\n\t\t\n\t\tif (index1 != index2)\n\t\t\tif((index1 != -1) && (index2 != -1))\n\t\t\t\tcombineClusters(index1,index2);\n\t}", "boolean hasCluster();", "public void compareWithinClusters() {\n\t\tList<Cluster> clusterList = clusterDao.getClusterList();\n\n\t\tfor (Cluster cluster : clusterList) {\n\t\t\tList<Document> docList = documentDao.getDocListByClusterId(cluster.getId());\n\t\t\tint size = docList.size();\n\t\t\t\n\t\t\tdouble[][] matrix = new double[size][size];\n\t\t\t\n\t\t\tfor(int i =0; i<size; i++){\n\t\t\t\tmatrix[i][i] = 1;\n\t\t\t\tmatrix[i][i] = 1;\n\t\t\t}\n\t\t\t\n\t\t\tif (size > 1) {\n\t\t\t\t//List<Document> docList2 = docList1;\n\t\t\t\tfor (int i=0; i<size; i++){\n\t\t\t\t\tfor(int j=i+1; j<size; j++){\n\t\t\t\t\t\t//match docs docList.get(i) & docList.get(j)\n\t\t\t\t\t\tMap<String, Double> map = datumboxCaller.compareDocs(docList.get(i).getDocName(), docList.get(j).getDocName());\n\t\t\t\t\t\tmatrix[i][j] = map.get(\"Oliver\");\n\t\t\t\t\t\tmatrix[j][i] = map.get(\"Shingle\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//persist both metrics in a file \n\t\t\tpersist(matrix, cluster, docList);\n\t\t\t\n\t\t\t//printing the matrix\n\t\t\tSystem.out.println(\"\\nDocument Similarity Matrix for Cluster \"+cluster.getId());\n\t\t\tSystem.out.println(\"\\nOliver Metric\");\n\t\t\tSystem.out.print(\"id\");\n\t\t\tfor(int i=0; i<size; i++)\n\t\t\t\tSystem.out.print(\"\\t\"+docList.get(i).getId());\n\t\t\t\n\t\t\tfor(int i=0; i<size; i++){\n\t\t\t\tSystem.out.println(docList.get(i).getId());\n\t\t\t\tfor(int j=0; j<size; j++){\n\t\t\t\t\tSystem.out.print(\"\\t\");\n\t\t\t\t\tif(j>=i)\n\t\t\t\t\t\tSystem.out.print(matrix[i][j]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(\"\\nShingle Metric\");\n\t\t\tSystem.out.print(\"id\");\n\t\t\tfor(int i=0; i<size; i++)\n\t\t\t\tSystem.out.print(\"\\t\"+docList.get(i).getId());\n\t\t\t\n\t\t\tfor(int i=0; i<size; i++){\n\t\t\t\tSystem.out.print(\"\\n\"+docList.get(i).getId());\n\t\t\t\tfor(int j=0; j<size; j++){\n\t\t\t\t\tSystem.out.print(\"\\t\");\n\t\t\t\t\tif(j>=i)\n\t\t\t\t\t\tSystem.out.print(matrix[j][i]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t//print ends\n\t\t\t\n\t\t}\n\n\t}", "@Test\n public void testBoundsAsCompositesWithOneEqRestrictionsAndTwoClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer clustering_0 = ByteBufferUtil.bytes(1);\n Restriction eq = newSingleEq(cfMetaData, 0, clustering_0);\n\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithTwoClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.END);\n }", "private static double intraClusterScore(List<String> arg1, List<String> arg2) {\n\t\t// compare each elements from argList1 vs argList2\n\n\t\tPair<String, String> pair = null;\n\t\tdouble tempScore = 0;\n\t\tdouble maxScore = 0;\n\n\t\tfor (int list1Id = 0; list1Id < arg1.size(); list1Id++) {\n\t\t\tfor (int list2Id = 0; list2Id < arg2.size(); list2Id++) {\n\n\t\t\t\t// create a pair\n\t\t\t\tpair = new ImmutablePair<String, String>(arg1.get(list1Id)\n\t\t\t\t\t\t.trim(), arg2.get(list2Id).trim());\n\n\t\t\t\ttry {\n\t\t\t\t\t// retrieve the key from the collection\n\t\t\t\t\ttempScore = SCORE_MAP.get(pair);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tpair = new ImmutablePair<String, String>(arg2.get(\n\t\t\t\t\t\t\t\tlist2Id).trim(), arg1.get(list1Id).trim());\n\t\t\t\t\t\ttempScore = SCORE_MAP.get(pair);\n\n\t\t\t\t\t} catch (Exception e1) {\n\t\t\t\t\t\ttempScore = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// System.out.println(\" temp score = \" + tempScore);\n\t\t\t\tmaxScore = (tempScore > maxScore) ? tempScore : maxScore;\n\t\t\t}\n\t\t}\n\n\t\t// System.out.println(\"max = \" + maxScore);\n\t\treturn maxScore;\n\t}", "public int[] findClusterCorrespondence(int[] idx1, int[] idx2) {\n\t\tint n = idx1.length;\n\t\tif (n != idx2.length) {\n\t\t\tSystem.out.println(\"Cluster Utils: findClusterCorrespondence: idx1 and idx2 has to have same number of elements\");\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t// find unique values in idx1 and idx2\n\t\tUniqueResult<Integer> ur_idx1 = utils.findUnique(idx1);\n\t\tUniqueResult<Integer> ur_idx2 = utils.findUnique(idx2);\n\t\tif (ur_idx1.domain.length != ur_idx2.domain.length) {\n\t\t\tSystem.out.println(\"Cluster Utils: findClusterCorrespondence: idx1 and idx2 has different number of clusters\");\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t// find Jaccard coefficient\n\t\tdouble[][] J = findJaccardIndex(idx1, idx2);\n\t\t\n\t\t// use Hungarian method - use any kind of Hungarian algorithm\n\t\tHungarianAlgorithm h = new HungarianAlgorithm();\n\t\t@SuppressWarnings(\"static-access\")\n\t\tint[][] match = h.hgAlgorithm(J, \"max\");\n\t\t\n\t\t// print match matrix\n\t\tif (verbose) {\n\t\t\tSystem.out.println(\"Hunguarian Cost Matrix\");\n\t\t\tutils.printMatrix(match);\n\t\t}\n\t\t\n\t\t// relabel the idx2\n\t\tif (verbose) System.out.println(\"Class correspondents matrix:\");\n\t\tint[] target = idx1.clone();\n\t\tfor (int i = 0; i < match.length; i++) {\n\t\t\tint idx1_index = ur_idx1.domain[match[i][0]];\n\t\t\tint idx2_index = ur_idx2.domain[match[i][1]];\n\t\t\tif (verbose) System.out.printf(\"%d\\t%d\", idx1_index, idx2_index);\t\t\t\n\t\t\tif (idx1_index != idx2_index) {\n\t\t\t\tif (verbose) System.out.printf(\"\\t(will replace all %d in idx2 by %d)\", idx2_index, idx1_index);\n\t\t\t\tboolean[] index = utils.getIndexByValue(idx2, idx2_index);\n\t\t\t\tfor (int j = 0; j < n; j++) {\n\t\t\t\t\tif (index[j]) target[j] = idx1_index;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (verbose) System.out.printf(\"\\n\");\n\t\t}\n\t\t\n\t\tif (verbose) {\n\t\t\tint v_tt = 15;\n\t\t\tif (target.length < v_tt) v_tt = target.length;\n\t\t\tSystem.out.printf(\"Printing first %d elements of input and output arrays\\n\", v_tt);\n\t\t\tSystem.out.printf(\"IDX1\\tIDX2\\tFINAL IDX\\n\");\n\t\t\tfor (int i = 0; i < v_tt; i++) System.out.printf(\"%d\\t%d\\t%d\\n\", idx1[i], idx2[i], target[i]);\n\t\t}\n\t\t\n\t\treturn target;\n\t}", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithTwoAscendingAndTwoDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.DESC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertEmptyComposite(bounds.get(1));\n\n // clustering_0 = 1 AND (clustering_1, clustering_2, clustering_3) > (2, 3, 4)\n Restriction eq = newSingleEq(cfMetaData, 0, value1);\n slice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n restrictions = restrictions.mergeWith(eq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2, clustering_3) > (2, 3, 4)\n Restriction in = newSingleIN(cfMetaData, 0, value1, value2);\n slice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n restrictions = restrictions.mergeWith(in);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n assertComposite(bounds.get(2), value2, value2, EOC.START);\n assertComposite(bounds.get(3), value2, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n assertComposite(bounds.get(2), value2, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(3), value2, EOC.END);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1, clustering_2, clustering_3) <= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) < (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4) AND (clustering_0, clustering_1) < (2, 3)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2, value3);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(1), value2, value3, EOC.START);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4) AND (clustering_0, clustering1, clustering_2, clustering_3) <= (4, 3, 2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value4, value3, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n assertComposite(bounds.get(2), value4, value3, value2, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(1), value4, value3, EOC.START);\n assertComposite(bounds.get(2), value4, value3, EOC.END);\n }", "private void runSomClustering(int linkage, int distanceMeasure, final boolean clusterColumns) {\r\n DivaClientService.computeSomClustering(linkage, distanceMeasure, clusterColumns,\r\n new AsyncCallback<SomClusteringResult>() {\r\n @Override\r\n public void onFailure(Throwable caught) {\r\n\r\n Selection_Manager.connError();\r\n SelectionManager.Busy_Task(false, true);\r\n }\r\n\r\n @Override\r\n public void onSuccess(SomClusteringResult result) {\r\n hierarchicalClustering = new SomClustComponent(result, Selection_Manager, DivaClientService, true, rightPanelWidth, leftPanelHeight);\r\n RootPanel.get(\"SomClusteringResults\").clear();\r\n RootPanel.get(\"SomClusteringResults\").add(hierarchicalClustering.getSomclusteringLayout());\r\n Timer t = new Timer() {\r\n @Override\r\n public void run() {\r\n hierarchicalClustering.selectRootNode();\r\n }\r\n };\r\n// Schedule the timer to run once in 0.5 seconds.\r\n// if (result.getRowNames().length < 5000) {\r\n//// t.schedule(500);\r\n// SelectionManager.Busy_Task(false, true);\r\n// } else {\r\n SelectionManager.Busy_Task(false, true);\r\n// }\r\n init = false;\r\n }\r\n });\r\n\r\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsMixingAscendingDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.DESC, Sort.ASC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(3));\n\n // clustering_0 = 1 AND (clustering_1, clustering_2, clustering_3) > (2, 3, 4)\n Restriction eq = newSingleEq(cfMetaData, 0, value1);\n slice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n restrictions = restrictions.mergeWith(eq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(3));\n\n\n // (clustering_0, clustering1, clustering_2, clustering_3) <= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, value4, EOC.NONE);\n assertComposite(bounds.get(3), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) < (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(3), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4) AND (clustering_0, clustering_1) < (2, 3)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2, value3);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(5, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n assertComposite(bounds.get(4), value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(5, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertComposite(bounds.get(3), value2, EOC.START);\n assertComposite(bounds.get(4), value2, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4) AND (clustering_0, clustering1, clustering_2, clustering_3) <= (4, 3, 2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value4, value3, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(7, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n assertComposite(bounds.get(4), value4, value3, EOC.START);\n assertComposite(bounds.get(5), value4, value3, value2, value1, EOC.NONE);\n assertComposite(bounds.get(6), value4, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(7, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertComposite(bounds.get(3), value4, EOC.START);\n assertComposite(bounds.get(4), value4, value3, value2, EOC.START);\n assertComposite(bounds.get(5), value4, value3, value2, EOC.END);\n assertComposite(bounds.get(6), value4, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneAscendingAndOneDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n assertComposite(bounds.get(2), value2, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertComposite(bounds.get(1), value2, EOC.START);\n assertComposite(bounds.get(2), value2, EOC.END);\n }", "boolean hasClusterName();", "@Test\n public void testBoundsAsCompositesWithOneEqRestrictionsAndOneClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC);\n\n ByteBuffer clustering_0 = ByteBufferUtil.bytes(1);\n Restriction eq = newSingleEq(cfMetaData, 0, clustering_0);\n\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithTwoDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneDescendingAndOneAscendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0) > (1) AND (clustering_0, clustering1) < (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.END);\n assertComposite(bounds.get(2), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.END);\n assertComposite(bounds.get(1), value1, EOC.START);\n assertComposite(bounds.get(2), value1, EOC.END);\n }", "private ClusterCombination checkAndDoJoinMultiPearson(ClusterCombination CC1, ClusterCombination CC2) {\n boolean doJoin = true;\r\n ArrayList<Cluster> CCList = new ArrayList<>(CC1.getClusters().size()+1); //list of output clusters for new CC if join is succesfull\r\n\r\n ArrayList<Cluster> CC1Clusters = CC1.getClusters();\r\n ArrayList<Cluster> CC2Clusters = CC2.getClusters();\r\n\r\n ArrayList<Cluster> LHS1 = CC1.getLHS();\r\n ArrayList<Cluster> LHS2 = CC2.getLHS();\r\n\r\n ArrayList<Cluster> RHS1 = CC1.getRHS();\r\n ArrayList<Cluster> RHS2 = CC2.getRHS();\r\n\r\n for(int i =0; i<CC1Clusters.size()-1; i++) {\r\n Cluster C1 = CC1Clusters.get(i);\r\n Cluster C2 = CC2Clusters.get(i);\r\n\r\n boolean overlap = checkClusterOverlap(C1, C2); // check if there is some overlap\r\n\r\n\r\n\r\n if(!overlap){ //the cluster in this position does not overlap, we don't need to join\r\n doJoin=false;\r\n break;\r\n }else{ // there is overlap, add the intersection of C1 and C2\r\n if(C1.getNPoints() <= C2.getNPoints()){\r\n CCList.add(C1);\r\n }else{\r\n CCList.add(C2);\r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n\r\n if(doJoin){ // each cluster in the candidate (except the last) does overlap\r\n // so, according to apriori, we join -> return the overlapping clusters + the last clusters of CC1 and CC2\r\n Cluster lastCC1 = CC1Clusters.get(CC1Clusters.size()-1);\r\n Cluster lastCC2 = CC2Clusters.get(CC2Clusters.size()-1);\r\n if(lastCC1.getClusterId() <= lastCC2.getClusterId()){ // make sure to respect ordering of clusters within a candidate by ID. otherwise this could be designated as a duplicate\r\n CCList.add(lastCC1); CCList.add(lastCC2);\r\n }else{\r\n CCList.add(lastCC2); CCList.add(lastCC1);\r\n }\r\n\r\n ArrayList<Cluster> newLHS = new ArrayList<>();\r\n ArrayList<Cluster> newRHS = new ArrayList<>();\r\n for(int i = 0; i<LHS1.size(); i++){\r\n newLHS.add(CCList.get(i));\r\n }\r\n for(int i = LHS1.size(); i<CCList.size(); i++){\r\n newRHS.add(CCList.get(i));\r\n }\r\n\r\n ClusterCombination newCC = new MultiPearsonClusterCombination(newLHS, newRHS);\r\n newCC.checkAndSetMaxSubsetLowerBound(Math.max(CC1.getLB(), CC1.getMaxLowerBoundSubset()));\r\n newCC.checkAndSetMaxSubsetLowerBound(Math.max(CC2.getLB(), CC2.getMaxLowerBoundSubset()));\r\n\r\n return newCC;\r\n\r\n }else{\r\n return null;\r\n }\r\n }", "public boolean isEqualTo(Cluster c)\n {\n int len = this.size();\n if (len != c.size()){\n return false;\n }\n if (len == 0){\n return true;\n }\n if (this.getLeader() != c.getLeader()){\n return false;\n }\n for (Integer n : this._elems){\n if (!c.contains(n)){\n return false;\n }\n }\n return true;\n }", "private static double getInterClusterScore(List<String> cluster) {\n\n\t\tPair<String, String> pair = null;\n\n\t\tdouble score = 1;\n\t\tdouble tempScore = 0;\n\n\t\t// System.out.println(\"CL size \" + cluster.size());\n\t\tif (cluster.size() <= 1)\n\t\t\treturn 0;\n\n\t\tfor (int outer = 0; outer < cluster.size(); outer++) {\n\t\t\tfor (int inner = outer + 1; inner < cluster.size(); inner++) {\n\t\t\t\t// create a pair\n\t\t\t\tpair = new ImmutablePair<String, String>(cluster.get(outer)\n\t\t\t\t\t\t.trim(), cluster.get(inner).trim());\n\n\t\t\t\ttry {\n\t\t\t\t\t// retrieve the key from the collection\n\t\t\t\t\ttempScore = SCORE_MAP.get(pair);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tpair = new ImmutablePair<String, String>(cluster.get(\n\t\t\t\t\t\t\t\tinner).trim(), cluster.get(outer).trim());\n\t\t\t\t\t\ttempScore = SCORE_MAP.get(pair);\n\n\t\t\t\t\t} catch (Exception e1) {\n\t\t\t\t\t\ttempScore = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// for sum of all pairwise scores\n\t\t\t\t// score = score + tempScore;\n\n\t\t\t\t// for the minimum inter cluster score\n\t\t\t\tscore = (score >= tempScore) ? tempScore : score;\n\t\t\t}\n\t\t}\n\t\treturn score;\n\t}", "public static void main(String[] args)\r\n\t{\n\t\tList<Location> locations = new ArrayList<Location>();\r\n\t\tlocations.add(new Location(150, 981));\r\n\t\tlocations.add(new Location(136, 0));\r\n\t\tlocations.add(new Location(158, 88));\r\n\t\tlocations.add(new Location(330, 60));\r\n\t\tlocations.add(new Location(0, 1001));\r\n\t\tlocations.add(new Location(150, 0));\r\n\t\tlocations.add(new Location(0, 0));\r\n\t\tlocations.add(new Location(0, 0));\r\n\t\tlocations.add(new Location(0, 0));\r\n\t\tlocations.add(new Location(446, 88));\r\n\t\tlocations.add(new Location(562, 88));\r\n\t\tlocations.add(new Location(256, 88));\r\n\t\tlocations.add(new Location(678, 88));\r\n\t\tlocations.add(new Location(794, 88));\r\n\t\tlocations.add(new Location(0, 1028));\r\n\t\tlocations.add(new Location(136, 0));\r\n\t\tlocations.add(new Location(150, 0));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 1028));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(136, 103));\r\n\t\tlocations.add(new Location(150, 0));\r\n\t\tList<LocationWrapper> clusterInput = new ArrayList<LocationWrapper>(locations.size());\r\n\t\tfor (Location location : locations)\r\n\t\t\tclusterInput.add(new LocationWrapper(location));\r\n\r\n\t\t// initialize a new clustering algorithm.\r\n\t\t// we use KMeans++ with 10 clusters and 10000 iterations maximum.\r\n\t\t// we did not specify a distance measure; the default (euclidean\r\n\t\t// distance) is used.\r\n\t\t// org.apache.commons.math3.ml.clustering.FuzzyKMeansClusterer<LocationWrapper>\r\n\t\t// clusterer = new\r\n\t\t// org.apache.commons.math3.ml.clustering.FuzzyKMeansClusterer<LocationWrapper>(2,\r\n\t\t// 2);\r\n\t\t// KMeansPlusPlusClusterer<LocationWrapper> clusterer = new\r\n\t\t// KMeansPlusPlusClusterer<LocationWrapper>(2, 10);\r\n\r\n\t\tDBSCANClusterer<LocationWrapper> clusterer = new DBSCANClusterer<LocationWrapper>(1200.0, 5);\r\n\t\tList<Cluster<LocationWrapper>> clusterResults = clusterer.cluster(clusterInput);\r\n\t\t// List<CentroidCluster<LocationWrapper>> clusterResults =\r\n\t\t// clusterer.cluster(clusterInput);\r\n\r\n\t\t// output the clusters\r\n\t\tSystem.out.println(\"clusterResults.size() = \" + clusterResults.size());\r\n\t\tfor (int i = 0; i < clusterResults.size(); i++)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Cluster \" + i);\r\n\t\t\tfor (LocationWrapper locationWrapper : clusterResults.get(i).getPoints())\r\n\t\t\t\tSystem.out.println(locationWrapper.getLocation());\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\t}", "private static int getClusterCorrespondance(Integer cl1, Integer cl2,\n HashMap<Integer, HashMap<Integer, Integer>> clusterCorresp, int nextId)\n{\n HashMap<Integer, Integer> map = clusterCorresp.get(cl1);\n if (map == null) {\n map = new HashMap<Integer, Integer>();\n map.put(cl2, nextId);\n clusterCorresp.put(cl1, map);\n return nextId;\n }\n Integer corresp = map.get(cl2);\n if (corresp == null) {\n map.put(cl2, nextId);\n return nextId;\n }\n return corresp.intValue();\n}", "static boolean isClusterCandidate_(double x_1, double y1, double x2,\n\t\t\tdouble y2, double sqr_tolerance) {\n\t\tdouble dx = x_1 - x2;\n\t\tdouble dy = y1 - y2;\n\t\treturn dx * dx + dy * dy <= sqr_tolerance;\n\t}", "boolean hasPermissionOfCluster(String clusterId, String userName);", "public interface ClusterMeasure {\n\n /**\n * Returns an index to measure the quality of clustering.\n * @param y1 the cluster labels.\n * @param y2 the alternative cluster labels.\n */\n public double measure(int[] y1, int[] y2);\n\n}", "public float compare(Cluster other) {\n \treturn compare(center, other.center);\n }", "@Test\n public void testOverlappingPartitionsOverlappingClusters()\n {\n check(overlappingClustersWithOverlappingPartitions(), 0.75, 1.0);\n }", "String getClusteringKey(int index);", "private static void assignCluster(int[] cluster, final double[][] centers, final double[][] data){\n int N = data.length;\n int M = data[0].length;\n int numCluster = centers.length;\n\n for (int n = 0; n < N; n++) {\n double minDistance = Double.MAX_VALUE;\n for (int c = 0; c < numCluster; c++) {\n double distance = EuclideanDistance(data[n], centers[c]);\n if (minDistance > distance) {\n minDistance = distance;\n cluster[n] = c;\n }\n }\n }\n }", "public void activateCluster(){\n for (int row = 0; row < matrix.length; row++) {\n// Cell[] matrix1 = matrix[i];\n for (int col = 0; col < matrix[row].length; col++) {\n Cell cell = matrix[row][col];\n // check every if null it means there is no cell at that position\n // get fist occured cell and meet it with the next one\n // run the loop while\n // while cell.getRow < cell.bestRow && cell.getCol < cell.bestCol\n if(cell != null) {\n while (cell.getRow() <= this.cellBiggestRow && cell.getCol() <= this.cellBiggestCol) {\n\n if (cell.getCol() >= matrix[row].length) {\n if (!(cell.getRow() >= matrix.length)) {\n cell.setRow(cell.getRow() + 1);\n }\n } else {\n cell.setCol(cell.getCol() + 1);\n }\n\n // if cell.getCol + 1 < matrix[row].length && matrix[row] != null\n // get the next cell and do the fight\n }\n }\n }\n }\n\n }", "public void processFoundCluster(NodeSet cluster) {\n\t}", "public static double computeClusterIndex(Map<String, List<String>> mCl) {\n\n\t\tdouble minCompactness = 0;\n\t\tdouble tempIsolation = 0;\n\t\tdouble maxIsolation = 0;\n\n\t\tList<String> arg1 = null;\n\t\tList<String> arg2 = null;\n\n\t\tdouble clusterGoodness = 0;\n\t\t// long n = (mCl.size()) * (mCl.size() - 1) / 2;\n\t\tfor (Entry<String, List<String>> e1 : mCl.entrySet()) {\n\n\t\t\tmaxIsolation = 0;\n\n\t\t\tfor (Entry<String, List<String>> e2 : mCl.entrySet()) {\n\t\t\t\tif (e2.getKey().hashCode() != e1.getKey().hashCode()) {\n\n\t\t\t\t\targ1 = e1.getValue();\n\t\t\t\t\targ2 = e2.getValue();\n\t\t\t\t\ttempIsolation = intraClusterScore(arg1, arg2);\n\n\t\t\t\t\t// get the maximum score, i.e the strongest intra-cluster\n\t\t\t\t\t// pair..\n\t\t\t\t\tmaxIsolation = (maxIsolation < tempIsolation) ? tempIsolation\n\t\t\t\t\t\t\t: maxIsolation;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// perform its own compactness\n\t\t\tminCompactness = getInterClusterScore(e1.getValue());\n\n\t\t\tclusterGoodness = clusterGoodness + (double) minCompactness\n\t\t\t\t\t/ ((maxIsolation == 0) ? Math.pow(10, -1) : maxIsolation);\n\n\t\t}\n\n\t\tclusterGoodness = (clusterGoodness == 0) ? (Math.pow(10, -8) - clusterGoodness)\n\t\t\t\t: clusterGoodness;\n\n\t\treturn (double) 1 / clusterGoodness;\n\n\t}", "@Test\r\n public void testGroupSimilarity() throws Exception {\r\n final List<ICluster> originalCLuster = ClusteringTestUtilities.readSpectraClustersFromResource();\r\n Collections.sort(originalCLuster);\r\n List<ICluster> l1 = new ArrayList<ICluster>(originalCLuster);\r\n\r\n final List<ICluster> originalCLuster2 = ClusteringTestUtilities.readSpectraClustersFromResource();\r\n Collections.sort(originalCLuster2);\r\n List<ICluster> l2 = new ArrayList<ICluster>(originalCLuster2);\r\n\r\n ClusterListSimilarity cd = new ClusterListSimilarity(distanceMeasure);\r\n final List<ICluster> identical = cd.identicalClusters(l1, l2);\r\n\r\n Assert.assertEquals(originalCLuster.size(), identical.size());\r\n Assert.assertTrue(l1.isEmpty());\r\n Assert.assertTrue(l2.isEmpty());\r\n }", "public static int[][] getCentroid(int data[],int noofcluster,int centroid[][],int flag){\n\t\tSystem.out.println(\"no of cluster:\"+noofcluster);\n\t\tint distance[][]=new int[noofcluster][data.length];\n\t\tint cluster[] =new int[data.length];\n\t\tint nodecnt[]=new int[noofcluster];\n\t\t\n\t\t\n\t\tSystem.out.println(\"..........new Cluster .........\");\n\t\t\n\t\t// this loop is for finding the minimum distance form depot to all the other bikestation\n\t\t\tfor(int j=0;j<data.length;j++) {\n\t\t\t\tdistance[0][j]=gr.dijkstra(adj,233,data[j]);\n\t\t\t\tMcluster.put(data[j],distance[0][j]);\n\t\t\t}\n\t\tSystem.out.println(\"Cluster=\"+Mcluster);\n\t\t\n\t\tSystem.out.println(\"............New Centroid..............\");\n\t\t// to find a random centroid for 1st time \n\t\tSet<Integer> tempp = new HashSet<Integer>();\n\t\tif(flag == 0) {\n\t\t\tfor(int i=0;i<noofcluster;i++) {\n\t\t\t\tcentroid[1][i]=Mcluster.get(getRandom(143,220));\n\t\t\t\twhile(tempp.contains(centroid[1][i])) {\n\t\t\t\t\tcentroid[1][i]=Mcluster.get(getRandom(143,220));\n\t\t\t\t}\n\t\t\t\ttempp.add(centroid[1][i]);\n\t\t\t\t//System.out.println(\"Centroid\"+centroid[1][i]);\n\t\t\t}\n\t\t\tflag=1;\n\t\t}\n\t\t\n\t\tSystem.out.println(\"...........Creating temp Cluster.......\");\n\t\t\n\t\t// creating a list of all the bikestation nodes difference the centroid \n\t\tfor(int i=0;i<noofcluster;i++) {\n\t\t\tHashMap<Integer,Integer> mpp=new HashMap<Integer,Integer>();\n\t\t\tfor(int j : Mcluster.keySet()) {\n\t\t\t\tif(centroid[1][i]>Mcluster.get(j)) {\n\t\t\t\t\tint mp = centroid[1][i]-Mcluster.get(j);\n\t\t\t\t\tmpp.put(j,mp);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tint mp = Mcluster.get(j)-centroid[1][i];\n\t\t\t\t\tmpp.put(j,mp);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcls.put(i, mpp);\n\t\t}\n\t\t\n\t\tSystem.out.println(\"...........Creating Final Cluster.......\");\n\t\t\n\t\t// getting a cluster from given centroid \n\t\tfor(int i=0;i<noofcluster;i++) {\n\t\t\tArrayList<Integer> temp = new ArrayList<>();\n\t\t\tfinalCluster.put(i,temp);\n\t\t}\n\t\tint smallestDistance;\n\t\tfor(int j : Mcluster.keySet()) {\n\t\t\tint f = 0;\n\t\t\tsmallestDistance=Integer.MAX_VALUE;\n\t\t\tfor(int i=0;i<noofcluster;i++) {\n\t\t\t\tif(cls.get(i).get(j)<=smallestDistance) {\n\t\t\t\t\tsmallestDistance=cls.get(i).get(j);\n\t\t\t\t\tf=i;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfinalCluster.get(f).add(j);\n\t\t}\n\t\t\n\t\t\n\t\tSystem.out.println(\"Final\"+finalCluster);\n\t\tSystem.out.println(\"........new centroid......\");\n\t\t\n\t\t//final cluster\n\t\tfor(int i : finalCluster.keySet()) {\n\t\t\tint sum=0, avg=0, count=0;\n\t\t\tfor(int j=0;j<finalCluster.get(i).size();j++) {\n\t\t\t\tint temp=finalCluster.get(i).get(j);\n\t\t\t\tsum=sum+Mcluster.get(temp);\n\t\t\t\tcount++;\n\t\t\t}\n\t\t\tavg=(int)sum/count;\n\t\t\tcentroid[0][i]=avg;\n\t\t}\n\t\t\n\t\tboolean finalcentroid=true;\n\t\t//if (i-1) and (i)th cluster have the same centroid then we stop the loop\n\t\tfor(int i=0;i<noofcluster;i++) {\n\t\t\tif(finalcentroid && centroid[0][i]==centroid[1][i]) {\n\t\t\t\tfinalcentroid=true;\n\t\t\t\tcontinue;\n\t\t\t}else {\n\t\t\t\tfinalcentroid=false;\n\t\t\t\tSystem.out.println(\"Different\");\n\t\t\t\tcnt++;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(!finalcentroid) { \n\t\t\t//if (i-1) and (i)th cluster dont have the same centroid then we continue the loop iteration\n\t\t\tcentroid[1] = Arrays.copyOf(centroid[0], centroid[0].length);\n\t\t\tgetCentroid(data,noofcluster,centroid,flag);\n\t\t}\n\t\t\n\t\tif(finalcentroid) {\n\t\t\tSystem.out.println(\"Final Cluster: \"+finalCluster);\n\t\t\tfor(int i=0;i<5;i++) {\n\t\t\t\tSystem.out.print(\"Final Centroid: \"+centroid[1][i]+\" \");\n\t\t\t}\n\t\t}\n\t\treturn centroid;\n\t}", "private int getClusterIndex(int element)\n\t{\n\t\tfor(int i=0; i<clusters.size(); i++)\n\t\t{\n\t\t\tVector v = (Vector)clusters.elementAt(i);\n\t\t\t\n\t\t\tif (v.contains(new Integer(element)))\n\t\t\t\treturn i;\n\t\t}\n\t\t\n\t\treturn -1;\n\t}", "@Test\n public void testBoundsAsCompositesWithSingleEqAndMultiEqRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) = (2, 3)\n Restriction singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction multiEq = newMultiEq(cfMetaData, 1, value2, value3);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiEq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n // clustering_0 = 1 AND clustering_1 = 2 AND (clustering_2, clustering_3) = (3, 4)\n singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction singleEq2 = newSingleEq(cfMetaData, 1, value2);\n multiEq = newMultiEq(cfMetaData, 2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(singleEq2).mergeWith(multiEq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n\n // (clustering_0, clustering_1) = (1, 2) AND clustering_2 = 3\n singleEq = newSingleEq(cfMetaData, 2, value3);\n multiEq = newMultiEq(cfMetaData, 0, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiEq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) = (2, 3) AND clustering_3 = 4\n singleEq = newSingleEq(cfMetaData, 0, value1);\n singleEq2 = newSingleEq(cfMetaData, 3, value4);\n multiEq = newMultiEq(cfMetaData, 1, value2, value3);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiEq).mergeWith(singleEq2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithSliceRestrictionsAndOneClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newSingleSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newSingleSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n }", "@Override\n public boolean getIsClusteringKey() {\n return isClusteringKey_;\n }", "@Override\n public boolean getIsClusteringKey() {\n return isClusteringKey_;\n }", "public static void main(String[] args) {\n\n Scanner sc = new Scanner(System.in); //assign size of input\n System.out.println(\"enter the number of elements\");\n String str = sc.nextLine();\n int N = Integer.parseInt(str);\n\n int[] arr = new int[N];\n\n for (int i = 0; i < N; i++) { //assign values of input\n System.out.println(\"enter element \" + (i + 1));\n String str2 = sc.nextLine();\n int number = Integer.parseInt(str2);\n\n arr[i] = number;\n }\n\n //find cluster count\n int clusterCount = 0;\n\n for (int h = 0; h < N - 1; h++) {\n if (arr[h] == arr[h + 1]) {\n int count = h + 1;\n while (arr[h] == arr[count]) {\n count++;\n }\n h = count;\n clusterCount++;\n }\n } //output \n System.out.println(clusterCount);\n\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiEqAndSingleSliceRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n\n // (clustering_0, clustering_1) = (1, 2) AND clustering_2 > 3\n Restriction multiEq = newMultiEq(cfMetaData, 0, value1, value2);\n Restriction singleSlice = newSingleSlice(cfMetaData, 2, Bound.START, false, value3);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiEq).mergeWith(singleSlice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithSingleEqAndMultiINRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n ByteBuffer value5 = ByteBufferUtil.bytes(5);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) IN ((2, 3), (4, 5))\n Restriction singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction multiIN = newMultiIN(cfMetaData, 1, asList(value2, value3), asList(value4, value5));\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiIN);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(1), value1, value4, value5, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(1), value1, value4, value5, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) IN ((2, 3))\n singleEq = newSingleEq(cfMetaData, 0, value1);\n multiIN = newMultiIN(cfMetaData, 1, asList(value2, value3));\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiIN).mergeWith(singleEq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n // clustering_0 = 1 AND clustering_1 = 5 AND (clustering_2, clustering_3) IN ((2, 3), (4, 5))\n singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction singleEq2 = newSingleEq(cfMetaData, 1, value5);\n multiIN = newMultiIN(cfMetaData, 2, asList(value2, value3), asList(value4, value5));\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiIN).mergeWith(singleEq2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value5, value2, value3, EOC.START);\n assertComposite(bounds.get(1), value1, value5, value4, value5, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value5, value2, value3, EOC.END);\n assertComposite(bounds.get(1), value1, value5, value4, value5, EOC.END);\n }", "private boolean checkColoumnForOctPair(int j1, int j2) {\n for(int i=0;i<4;i++)\r\n {\r\n if(Kmap[i][j1]==0 || Kmap[i][j1]==-1)\r\n return false;\r\n }\r\n for(int i=0;i<4;i++)\r\n {\r\n if(Kmap[i][j2]==0 || Kmap[i][j2]==-1)\r\n return false;\r\n }\r\n for(int i=0;i<4;i++)\r\n {\r\n Kmap[i][j1]=-1;\r\n }\r\n for(int i=0;i<4;i++)\r\n {\r\n Kmap[i][j2]=-1;\r\n } \r\n return true; \r\n }", "int getClusteringKeyCount();", "@Test\n public void testHardClustersWithOverlappingPartitions()\n {\n check(hardClustersWithOverlappingPartitions(), 0.0, 1.0);\n }", "boolean hasXYPairs();", "java.lang.String getClusterId();", "java.lang.String getClusterId();", "java.lang.String getClusterId();", "java.lang.String getClusterId();", "java.lang.String getClusterId();", "java.lang.String getClusterId();", "@Test\n public void testBoundsAsCompositesWithSingleEqAndSliceRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n ByteBuffer value5 = ByteBufferUtil.bytes(5);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) > (2, 3)\n Restriction singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction multiSlice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiSlice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) > (2, 3) AND (clustering_1) < (4)\n singleEq = newSingleEq(cfMetaData, 0, value1);\n multiSlice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3);\n Restriction multiSlice2 = newMultiSlice(cfMetaData, 1, Bound.END, false, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiSlice2).mergeWith(singleEq).mergeWith(multiSlice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value4, EOC.START);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) => (2, 3) AND (clustering_1, clustering_2) <= (4, 5)\n singleEq = newSingleEq(cfMetaData, 0, value1);\n multiSlice = newMultiSlice(cfMetaData, 1, Bound.START, true, value2, value3);\n multiSlice2 = newMultiSlice(cfMetaData, 1, Bound.END, true, value4, value5);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiSlice2).mergeWith(singleEq).mergeWith(multiSlice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value4, value5, EOC.END);\n }", "private boolean checkRowCol(int c1, int c2, int c3) \r\n {\r\n return ((c1 != -1) && (c1 == c2) && (c2 == c3)); //eida ekhon porjonto kaaj e lage nai\r\n }", "static double clusterVerticesOneStep(Mesh mesh) {\n\t\t\n\t\t// for each pair of the vertices\n\t\tdouble mindis = 1.0e+30;\n\t\tfor(int i = 0; i < mesh.getNumVertices(); i++) {\n\t\t\tVertex v1 = mesh.getVertex(i);\n\t\t\tfor(int j = (i + 1); j < mesh.getNumVertices(); j++) {\n\t\t\t\tVertex v2 = mesh.getVertex(j);\n\t\t\t\n\t\t\t\t// for each pair of the nodes\n\t\t\t\tdouble maxdis = 0.0;\n\t\t\t\tfor(int ii = 0; ii < v1.nodes.size(); ii++) {\n\t\t\t\t\tNode n1 = (Node)v1.nodes.get(ii);\n\t\t\t\t\tfor(int jj = 0; jj < v2.nodes.size(); jj++) {\n\t\t\t\t\t\tNode n2 = (Node)v2.nodes.get(jj);\n\t\t\t\t\t\tif(n1.getDisSim2(n2.getId()) > maxdis) {\n\t\t\t\t\t\t\tmaxdis = n1.getDisSim2(n2.getId());\n\t\t\t\t\t\t\tif(maxdis > mindis) {\n\t\t\t\t\t\t\t\tii = v1.nodes.size(); break;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// update mindis\n\t\t\t\tif(mindis > maxdis) {\n\t\t\t\t\tmindis = maxdis;\n\t\t\t\t\t//System.out.println(\" updated mindis=\" + mindis);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Determine the threshold\n\t\tdouble threshold = mindis * clusteringThreshold;\n\t\t\n\t\t// Combine close two vertices \n\t\tfor(int i = 0; i < mesh.getNumVertices(); i++) {\n\t\t\tVertex v1 = mesh.getVertex(i);\n\t\t\tfor(int j = (i + 1); j < mesh.getNumVertices(); j++) {\n\t\t\t\tVertex v2 = mesh.getVertex(j);\n\t\t\t\n\t\t\t\t// for each pair of the nodes\n\t\t\t\tdouble maxdis = -1.0;\n\t\t\t\tfor(int ii = 0; ii < v1.nodes.size(); ii++) {\n\t\t\t\t\tNode n1 = (Node)v1.nodes.get(ii);\n\t\t\t\t\tfor(int jj = 0; jj < v2.nodes.size(); jj++) {\n\t\t\t\t\t\tNode n2 = (Node)v2.nodes.get(jj);\n\t\t\t\t\t\tif(n1.getDisSim2(n2.getId()) > maxdis) {\n\t\t\t\t\t\t\tmaxdis = n1.getDisSim2(n2.getId());\n\t\t\t\t\t\t\tif(maxdis > threshold) {\n\t\t\t\t\t\t\t\tii = v1.nodes.size(); break;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(maxdis > threshold) continue;\n\t\t\t\t\n\t\t\t\t//System.out.println(\" combine: i=\" + i + \" j=\" + j + \" names=\" + authors + \" maxdis=\" + maxdis + \" th=\" + threshold);\n\t\t\t\t\n\t\t\t\t// combine the two vertices\n\t\t\t\tfor(int jj = 0; jj < v2.nodes.size(); jj++) {\n\t\t\t\t\tNode n2 = (Node)v2.nodes.get(jj);\n\t\t\t\t\tv1.nodes.add(n2);\n\t\t\t\t\tn2.setVertex(v1);\n\t\t\t\t}\n\t\t\t\tmesh.removeOneVertex(v2);\n\t\t\t\tj--;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn threshold;\n\t}", "private DataForSingleCluster[] clusterInstances(Instances i1, Instances i2) {\n DataForSingleCluster[] toReturn =\n new DataForSingleCluster[OCCTFineGrainedJaccardSplitModel.NUM_OF_CLUSTERS];\n // Make a single instances object in order to run the clustering algorithm with it\n Instances joinedInstances = this.joinInstances(i1, i2);\n // TODO: Maybe allow various clustering algorithms\n SimpleKMeans kMeansClusterer = new SimpleKMeans();\n try {\n // Build the clusterer using the joined instances\n kMeansClusterer.setNumClusters(OCCTFineGrainedJaccardSplitModel.NUM_OF_CLUSTERS);\n kMeansClusterer.buildClusterer(joinedInstances);\n // Initialize the array to return\n for (int i = 0; i < toReturn.length; ++i) {\n toReturn[i] = new DataForSingleCluster(i);\n }\n // Now, go over all the instances and separate them according their clustering result\n this.clusterSingleInstances(i1, true, kMeansClusterer, toReturn);\n this.clusterSingleInstances(i2, false, kMeansClusterer, toReturn);\n } catch (Exception e) {\n // TODO: What should we do in this case?\n e.printStackTrace();\n System.exit(-1);\n }\n return toReturn;\n }", "public void updateClusteringPanel(SomClusteringResult result, boolean clusterColumn) {\r\n SelectionManager.Busy_Task(true, true);\r\n hierarchicalClustering = new SomClustComponent(result, Selection_Manager, DivaClientService, clusterColumn, rightPanelWidth, leftPanelHeight - 2);\r\n RootPanel.get(\"SomClusteringResults\").clear();\r\n RootPanel.get(\"SomClusteringResults\").add(hierarchicalClustering.getSomclusteringLayout());\r\n SelectionManager.Busy_Task(false, true);\r\n\r\n }", "private boolean isSameColumnKeyComponent(ByteBuffer[] components1, ByteBuffer[] components2) {\n\t\tfor (int i = columnAliasNames.length - 1; i >= 0; i--) {\n\t\t\tif (!components1[i].equals(components2[i]))\n\t\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "boolean isTwoPair();", "public static void pseudoTrueTuples(LogicProblem logicProblem, boolean applyChanges)\r\n throws RelationshipConflictException {\n \r\n HashMap<ItemPair,Relationship> relationshipTable = logicProblem.getRelationshipTable();\r\n HashSet<CategoryPair> categoryPairs = logicProblem.getCategoryPairs();\r\n \r\n// System.out.println(\"searching...\");\r\n //within a subgrid\r\n for (CategoryPair categoryPair : categoryPairs) {\r\n// System.out.println(\"Category pair:\" + categoryPair);\r\n //vertical and horizontal search\r\n for (final boolean verticalOrientation : new boolean[] { false, true } ) {\r\n\r\n Category subrowCategory = verticalOrientation?categoryPair.first():categoryPair.last();\r\n Category subcolumnCategory = verticalOrientation?categoryPair.last():categoryPair.first();\r\n\r\n //commenting \"vertical search\" \r\n //(subrows match first category's items\r\n // subcolumns match second category's items)\r\n\r\n //i (2 to floor(n/2)) is the number of elements in the combination tuple\r\n // i=2 in pseudoTrue pairs\r\n //(for subgrids of 5x5 items, looking for both pairs and triplets becomes redundant\r\n for (int i=2; i<=floor(logicProblem.getNumCategories()/2);i++) {\r\n\r\n //https://github.com/dpaukov/combinatoricslib3/wiki/v3.3.0#1-simple-combinations\r\n List<List<Item>> columnCombinations = Generator.combination(subcolumnCategory.getItems())\r\n .simple(i) //for pseudo true pairs, i=2\r\n .stream()\r\n .collect(Collectors.<List<Item>>toList());\r\n //for i=2, this would contain \r\n //Bethany, Donovan\r\n //Bethany, Elizabeth\r\n //...\r\n //Frederick, Peyton\r\n// columnCombinations.stream().forEach(l -> System.out.println(\r\n// (verticalOrientation?\"vertical\":\"horizontal\")+ \" combo: \"+l.toString()));\r\n\r\n //create the sets\r\n //for each combination, start over\r\n \r\n //columnTuple contains i items with which we will compute set intersections\r\n for (List<Item> columnItemTuple : columnCombinations) {\r\n //Bethany, Donovan\r\n \r\n //similarly, valueNoSets contains i sets of VALUE_NO relationships\r\n List<Set<Item>> valueNoSets = new ArrayList<>(); //size=i\r\n //build a set for each i item of columnTuple\r\n for (Item columnItem : columnItemTuple) {\r\n //Bethany\r\n Set<Item> valueNoSet = new HashSet<>(); //size = n\r\n for (Item rowItem : subrowCategory.getItems()) {\r\n //Haley's Comet ....\r\n if (relationshipTable.get(new ItemPair(rowItem, columnItem)).getValue() == Relationship.ValueType.VALUE_NO)\r\n //stacking all VALUE_NO relationship into vertical set\r\n valueNoSet.add(rowItem); //store into single subcolumn set \r\n }\r\n //adding each vertical set into list of sets\r\n if (valueNoSet.size() >= logicProblem.getNumItems() - i //for pairs, we need three VALUE_NO in the set\r\n && valueNoSet.size() < logicProblem.getNumItems()-1) //uniqueness will take or n-1 cases\r\n valueNoSets.add(valueNoSet); //store single subcolumn into multi-set\r\n }\r\n //magic!\r\n Set<Item> intersectionSet = new HashSet<>(); //avoid NPE when the next call is made\r\n if (valueNoSets.size()>=2) //don't compute intersections otherwise\r\n intersectionSet = Processor.multiSetIntersection(valueNoSets);\r\n\r\n if (intersectionSet.size()==logicProblem.getNumItems()-i) {\r\n \r\n// System.out.println(\"----> found candidates for pseudo true pairs!\");\r\n// intersectionSet.stream().forEach(l -> System.out.println(\"\\t\" + l.toString()));\r\n// System.out.println(\"\\t\\tvs.\");\r\n// columnItemTuple.stream().forEach(l -> System.out.println(\"\\t\" + l.toString()));\r\n \r\n //create predecessor list\r\n //we can only add the intersection output as predecessors\r\n ArrayList<Dependable> predecessors = new ArrayList<Dependable>();\r\n for (Item intersectionColumn : intersectionSet) {\r\n for (Item rowItem : columnItemTuple) {\r\n predecessors.add(relationshipTable.get(new ItemPair(rowItem, intersectionColumn)));\r\n }\r\n }\r\n\r\n\r\n //we have a bunch of work to do\r\n for (Item everyRowItem : subrowCategory.getItems()) {\r\n //for every row item not in the intersectionSet\r\n if (!intersectionSet.contains(everyRowItem)) {\r\n for (Item everyColumnItem : subcolumnCategory.getItems()) {\r\n //for every column item not in any of the columnTuple list\r\n if (!columnItemTuple.contains(everyColumnItem)) {\r\n Relationship rel = relationshipTable.get(new ItemPair(everyRowItem,everyColumnItem));\r\n if (rel.getValue()!=Relationship.ValueType.VALUE_NO)\r\n Processor.setRelationship(logicProblem, applyChanges, rel, \r\n Relationship.ValueType.VALUE_NO, Relationship.LogicType.PSEUDOTRUE,\r\n predecessors.toArray(new Relationship[predecessors.size()])); \r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneDescendingClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n }", "public boolean isWebsiteInCluster(String website) {\r\n\t\tCluster temp = getACluster(website);\r\n\t\tif(temp == null) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tfor(Cluster c : this.clusters) {\r\n\t\t\tfor(Cluster.Point point : c.getPoints()) {\r\n\t\t\t\tfor(Cluster.Point tempPoint : temp.getPoints()) {\r\n\t\t\t\t\tif(point == tempPoint)\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "boolean isAllowClusterGet();", "public ImmutableMap<String, Boolean> getAttributeClusteringConfig();", "public static boolean tile_in_cluster(int x, int y){\n int cx = (int)Math.floor((float)x / WorldChunk.CHUNK_SIZE);\n int cy = (int)Math.floor((float)y / WorldChunk.CHUNK_SIZE);\n\n return chunk_in_cluster(cx,cy);\n }", "public int compare(Cluster cluster1, Cluster cluster2) {\n for (Node n1 : cluster1) {\n for (Node n2 : cluster2) {\n if (n1.isAncestorOf(n2)) {\n return -1;\n } else if (n2.isAncestorOf(n1)) {\n return 1;\n }\n }\n }\n return 0;\n }", "private void doClustering(double[][] data, String[] names) {\n\t\ttry {\n\t\t\tClusteringAlgorithm algorithm = new DefaultClusteringAlgorithm();\n\t\t\tCluster cluster = algorithm.performClustering(data, names, new AverageLinkageStrategy());\n\t\t\tparentCluster = cluster;\n\t\t\tfillClusteredOrderedDataFromChildren(cluster);\n\t\t}catch(Exception e){\n\t\t\tJOptionPane.showMessageDialog(null, \"Duplicate identifiers found, the feature names should be unique\", \"Clustering error\", JOptionPane.ERROR_MESSAGE);\n\t\t\treturn;\n\t\t}\n\t}", "@Test\n public void testBoundsAsCompositesWithSliceRestrictionsAndOneDescendingClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newSingleSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newSingleSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n }", "public Builder setCluster(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n cluster_ = value;\n onChanged();\n return this;\n }", "public Cluster getCluster(int whichOne)\r\n/* 46: */ {\r\n/* 47:74 */ if ((whichOne >= 0) && (whichOne < size())) {\r\n/* 48:75 */ return (Cluster)this.pop.elementAt(whichOne);\r\n/* 49: */ }\r\n/* 50:77 */ return null;\r\n/* 51: */ }", "public List<ParameterValueObject> getClustering(Filter filter);", "@Override\n public Point[] chooseCentroids(AbstractCluster self) {\n if (K!=2) {\n System.err.println(\"The used splitter is not suppose to be used with K>2. This program will shut down\"); //#like\n exit(1);\n }\n Point[] result={self.get(0),self.get(0)};\n double max=0;\n for (int i=0; i<self.size(); ++i)\n for (int j=0; j<i; ++j)\n if (max<_distances.get(self.get(i).getId(),self.get(j).getId())) {\n max=_distances.get(self.get(i).getId(),self.get(j).getId());\n result[0]=self.get(i);\n result[1]=self.get(j);\n }\n return result;\n }", "public static void cluster(String[] args, boolean converged)\n\t\t\tthrows IOException, InterruptedException, ClassNotFoundException {\n\t\tSystem.out.println(\"Using mapper to output clustering information...\");\n\t\tConfiguration conf = new Configuration();\n\t\tString[] otherArgs = new GenericOptionsParser(conf, args).getRemainingArgs();\n\t\tconf.set(\"old.center.path\", otherArgs[3]);\n\t\tconf.set(\"K\", otherArgs[5]);\n\t\tconf.set(\"include.center.in.mapper\", \"1\");\n\t\tconf.set(\"converged\", converged ? \"1\" : \"0\");\n\t\tJob job = new Job(conf, \"KMeansCluster\");\n\t\tjob.setJarByClass(KMeansDriver.class);\n\n\t\tPath in = new Path(otherArgs[1]);\n\t\tPath out = new Path(otherArgs[2] + \"/\" + \"clustering_info\");\n\t\tFileInputFormat.addInputPath(job, in);\n\t\tFileSystem fs = FileSystem.get(conf);\n\t\tif (fs.exists(out)) {\n\t\t\tfs.delete(out, true);\n\t\t}\n\t\tFileOutputFormat.setOutputPath(job, out);\n\n\t\t//No reducer needed here.\n\t\tjob.setMapperClass(KMeansMapper.class);\n\t\tjob.setOutputKeyClass(IntWritable.class);\n\t\tjob.setOutputValueClass(Text.class);\n\t\tjob.setNumReduceTasks(0);\n\t\tjob.waitForCompletion(true);\n\t}", "private static void clustering() {\n \tclustering(clArgs.clusteringInFile, clArgs.clusteringOutDir,\n \t\t\tclArgs.clusteringOpticsXi, clArgs.clusteringOpticsMinPts);\n }", "public boolean hasClusterName() {\n return endpointConfigCase_ == 2;\n }", "public void setCluster(String cluster) {\n this.cluster = cluster;\n }", "public void setCluster(String cluster) {\n this.cluster = cluster;\n }", "public Builder setIsClusteringKey(boolean value) {\n\n isClusteringKey_ = value;\n onChanged();\n return this;\n }", "@Test\n public void should_iterate_with_partition_keys_and_partition_keys_IN() throws Exception {\n //Given\n long partitionKey = RandomUtils.nextLong(0,Long.MAX_VALUE);\n\n insertCompositeClusteredValues(partitionKey,\"bucket1\",1,\"name1\",1);\n insertCompositeClusteredValues(partitionKey,\"bucket2\",1,\"name2\",1);\n insertCompositeClusteredValues(partitionKey,\"bucket3\",1,\"name3\",1);\n\n //When\n final Iterator<CompositeClusteredEntity> iterator = manager.sliceQuery(CompositeClusteredEntity.class)\n .forIteration()\n .withPartitionComponents(partitionKey)\n .andPartitionComponentsIN(\"bucket1\", \"bucket3\")\n .iterator();\n\n //Then\n assertThat(iterator.hasNext()).isTrue();\n CompositeClusteredEntity next = iterator.next();\n assertThat(next.getId().getId()).isEqualTo(partitionKey);\n assertThat(next.getId().getBucket()).isEqualTo(\"bucket1\");\n assertThat(next.getId().getName()).isEqualTo(\"name11\");\n assertThat(next.getValue()).isEqualTo(\"value11\");\n\n assertThat(iterator.hasNext()).isTrue();\n next = iterator.next();\n assertThat(next.getId().getId()).isEqualTo(partitionKey);\n assertThat(next.getId().getBucket()).isEqualTo(\"bucket3\");\n assertThat(next.getId().getName()).isEqualTo(\"name31\");\n assertThat(next.getValue()).isEqualTo(\"value11\");\n }", "private int pairContains(HashMap<Integer,HashSet<Integer>> pairs, int k1, int k2){\n\t\t\n\t\t\n\t\t\tif(pairs.containsKey(k1))\n\t\t\t\tif(pairs.get(k1).contains(k2))\n\t\t\t\t\treturn 2;\n\t\t\t\telse\n\t\t\t\t\treturn 1;\n\t\t\n\t\treturn 0;\n\t}", "public String Km() throws Exception {\n int x = 0;\n System.out.println(x+\" hlikiaaaaaa\");\n ΑrffCreator gen = new ΑrffCreator();\n\t\t\tgen.ArffGenerator();\n\t\t\t\n\t\t\tSimpleKMeans kmeans = new SimpleKMeans();\n\t \n\t\t\tkmeans.setSeed(2);\n\t \n\t\t\t//important parameter to set: preserver order, number of cluster.\n\t\t\tkmeans.setPreserveInstancesOrder(true);\n\t\t\tkmeans.setNumClusters(2);\n\t \n\t\t\tBufferedReader datafile = readDataFile(\"E:\\\\Users\\\\Filippos\\\\Documents\\\\NetBeansProjects\\\\MapsCopy\\\\mytext.arff\"); \n\t\t\tInstances data = new Instances(datafile);\n\t \n\t \n\t\t\tkmeans.buildClusterer(data);\n\t \n\t\t\t// This array returns the cluster number (starting with 0) for each instance\n\t\t\t// The array has as many elements as the number of instances\n\t\t\tint[] assignments = kmeans.getAssignments();\n int noNoobs=-1;\n\t\t\t//int i=0;\n\t\t\tint g = assignments.length;\n String studentsLvl = \"\";\n String quizAns = \"\";\n int clusterResult;\n\t\t\t/*----------------------------------------->xeirokinitos upologismos<----------------------------------------\n \n /*for(int clusterNum : assignments) {\n if(i==x){\n noNoobs = assignments[i];\n System.out.println(\"to \"+g+\"o einai \"+ clusterNum+\"= \"+x+\" o cluster EINAI PROXORIMENOS\");\n\t\t\t\t}\t\n if(i==g-1) {\n \n if(assignments[i] == noNoobs){\n studentsLvl = \"advanced\";\n System.out.println(\"MPAINEI STOUS PROXORIMENOUS\"+assignments[i]);\n \n }\n else{\n studentsLvl = \"beginner\";\n System.out.println(\"DEN PAEI POY8ENA ETSI\") ; \n }\n \n\t\t\t i++;\n\t\t\t}\n ---------------------------------------------------------------------------------------------------------*/\n /*upologizw thn euklideia apostash twn telikwn cluster cendroids apo to shmeio 0,0 \n auto pou apexei perissotero apo to kentro twn a3onwn , 8a einai to cluster advanced epeidi oso megaluterh hlikia \n kai kalutero scor sto preliminary test , toso pio advanced. Ka8w h logiki einai oti enas pio megalos kai diavasmenos ma8hths\n kaluteros apo enan pio pio mikro kai e3isou diavasmeno ma8hth h enan sunmoliko alla ligotero diavasmeno\n ----------------------------------------------------------------------------------------------------------*/\n \n //1 vazw ta teleutaia clusterCendroids se ena instance\t\t\t\n\t\t\tInstances clusterCendroid = kmeans.getClusterCentroids();\n //ta metatrepw se string\n\t\t\tString cluster0 = (clusterCendroid.firstInstance()).toString();\n\t\t\tString cluster1 = (clusterCendroid.lastInstance()).toString();\n\t\t\tSystem.out.println(cluster0+\"++++++++++++++++\"+cluster1);\n\t\t\t\n //2 spaw to ka8e string sto \",\" gt einai tis morfhs cluster0=\"x0,y0\" cluster1=\"x1,y1\"\n\t\t\tString[] parts = cluster0.split(\",\");\n\t\t\tString partx0 = parts[0]; // 004\n\t\t\tString party0 = parts[1]; // 034556\n\t\n\t\t\tSystem.out.println(partx0+\" || \"+party0);\n \n //3 Metatrepw ta String se double metavlites gia na epitrepontai oi pra3eis\n\t\t\tdouble clusterDx0 = Double.parseDouble(partx0);\n\t\t\tdouble clusterDy0 = Double.parseDouble(party0);\n\t\t\tSystem.out.println(clusterDx0+clusterDy0);\n\t\t\t\n //epanalamvanoume thn diadikasia apo to vhma 2\n\t\t\tString[] parts1 = cluster1.split(\",\");\n\t\t\tString partx1 = parts1[0]; // 004\n\t\t\tString party1 = parts1[1]; // 034556\n\t\t\t\n\t\t\tSystem.out.println(partx1+\" || \"+party1);\n\t\t\t\n \n double clusterDx1 = Double.parseDouble(partx1);\n\t\t\tdouble clusterDy1 = Double.parseDouble(party1);\n\t\t\t//System.out.println(clusterDx1+clusterDy2);\n //ypologizw thn euklidia apostasi twn 2 shmeivn ws pros to 0,0\n\t\t\tdouble popo = Math.sqrt((Math.pow(clusterDx0,2)+Math.pow(clusterDy0,2)));\n\t\t\tdouble popo2 = Math.sqrt((Math.pow(clusterDx1,2)+Math.pow(clusterDy1,2)));\n \n\t\t\tif (Math.max(popo, popo2)==popo) {\n \n clusterResult=0;\n\t\t\t\tSystem.out.println(\"0=advanced -- \"+popo+\"--1=begginer \"+popo2);\n\t\t\t}\n\t\t\telse {\n clusterResult=1;\n\t\t\t\tSystem.out.println(\"1=advanced -- \"+popo2+\"--0=begginer \"+popo);\n\t\t\t}\n\t\t\tSystem.out.println(popo+\"||\"+popo2+\"||\");\n \n if (assignments[data.numInstances()-1]==clusterResult){\n studentsLvl = \"advanced\";\n quizAns = \"yes\";\n System.out.println(\"MPAINEI STOUS PROXORIMENOUS \"+assignments[data.numInstances()-1]);\n }\n else{\n quizAns = \"no\";\n studentsLvl = \"beginner\";\n System.out.println(\"MPAINEI STOUS MH PROXORIMENOUS \"+assignments[data.numInstances()-1]) ; \n }\n \n coursequizs lev = new coursequizs();\n lev.studentLevel(studentsLvl,quizAns);\n \n System.out.println(Arrays.toString(assignments));\n return \"home.jsf\";\n\t\t}", "@Test\n public void testBoundsAsCompositesWithOneInRestrictionsAndOneClusteringColumn()\n {\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n Restriction in = newSingleIN(cfMetaData, 0, value1, value2, value3);\n\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(in);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.START);\n assertComposite(bounds.get(2), value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n assertComposite(bounds.get(1), value2, EOC.END);\n assertComposite(bounds.get(2), value3, EOC.END);\n }", "@Test\n public void testClusterKeySlot() {\n assertEquals(node1.clusterKeySlot(\"foo{bar}zap}\").intValue(),\n JedisClusterCRC16.getSlot(\"foo{bar}zap\"));\n assertEquals(node1.clusterKeySlot(\"{user1000}.following\").intValue(),\n JedisClusterCRC16.getSlot(\"{user1000}.following\"));\n }", "public boolean isReviewed(int index) {\n if (index % 2 != 0) {\n index -= 1;\n }\n index = index / 2;\n if ( ( (Integer) clusters[index][3]).intValue() == 1) {\n return true;\n }\n else {\n return false;\n }\n }", "private void partitionImpl(Collection<S> vocab, HashMap<Dimension<T>, MutableDouble> center) {\n double firstVal = Double.POSITIVE_INFINITY;\n double secondVal = Double.POSITIVE_INFINITY;\n S firstWord = null;\n S secondWord = null;\n\n LinkedList<S> cluster1 = new LinkedList<S>();\n LinkedList<S> cluster2 = new LinkedList<S>();\n HashMap<Dimension<T>, MutableDouble> newCenter1 = null;\n HashMap<Dimension<T>, MutableDouble> newCenter2 = null;\n\n if (vocab.size() > 2) {\n for (S word : vocab) {\n double dist = distanceToCenter(word, center);\n if (dist < secondVal) {\n if (dist < firstVal) {\n secondVal = firstVal;\n secondWord = firstWord;\n firstVal = dist;\n firstWord = word;\n } else {\n secondVal = dist;\n secondWord = word;\n }\n }\n }\n if (distance(firstWord, secondWord) <= 0.0) {\n System.out.printf(\"zero distance between '%s' and '%s'\\n\", firstWord, secondWord);\n // pick an arbitrary second word\n for (S word : vocab) {\n if (word.equals(firstWord) || word.equals(secondWord)) {\n continue;\n }\n if (distance(firstWord, word) > 0.0) {\n secondWord = word;\n break;\n }\n }\n System.out.printf(\"selected '%s' and '%s'\\n\", firstWord, secondWord);\n }\n\n HashMap<Dimension<T>, MutableDouble> center1 = wordToVector(firstWord);\n HashMap<Dimension<T>, MutableDouble> center2 = wordToVector(secondWord);\n for (S word : vocab) {\n double dist1 = distanceToCenter(word, center1);\n double dist2 = distanceToCenter(word, center2);\n if (dist1 < dist2) {\n cluster1.add(word);\n } else {\n cluster2.add(word);\n }\n }\n\n int changed = 1;\n int iteration = 0;\n while (++iteration <= MAX_ITERATIONS && changed > 0) {\n System.out.printf(\"Iteration %d/%d\\n\", iteration, MAX_ITERATIONS);\n changed = 0;\n newCenter1 = getCenter(cluster1);\n newCenter2 = getCenter(cluster2);\n\n LinkedList<S> tmpCluster1 = new LinkedList<S>();\n LinkedList<S> tmpCluster2 = new LinkedList<S>();\n\n for (ListIterator<S> it = cluster1.listIterator(); it.hasNext();) {\n S word = it.next();\n double dist1 = distanceToCenter(word, newCenter1);\n double dist2 = distanceToCenter(word, newCenter2);\n if (dist1 <= dist2) {\n tmpCluster1.add(word);\n } else {\n tmpCluster2.add(word);\n changed++;\n System.out.printf(\"changing %s : %g > %g\\n\", word, dist1, dist2);\n }\n }\n\n for (ListIterator<S> it = cluster2.listIterator(); it.hasNext();) {\n S word = it.next();\n double dist1 = distanceToCenter(word, newCenter1);\n double dist2 = distanceToCenter(word, newCenter2);\n if (dist2 <= dist1) {\n tmpCluster2.add(word);\n } else {\n tmpCluster1.add(word);\n changed++;\n System.out.printf(\"changing %s : %g < %g\\n\", word, dist1, dist2);\n }\n }\n cluster1 = tmpCluster1;\n cluster2 = tmpCluster2;\n System.out.printf(\"changed: %d/%d\\n\", changed, vocab.size());\n if (cluster1.size() == 0 || cluster2.size() == 0) {\n LinkedList<S> cl = cluster1.size() == 0 ? cluster2 : cluster1;\n System.out.printf(\"Cannot split %s, split them randomly\\n\", cl.toString());\n tmpCluster1 = new LinkedList<S>();\n tmpCluster2 = new LinkedList<S>();\n boolean b = true;\n for (S word : cl) {\n if (b) {\n tmpCluster1.add(word);\n } else {\n tmpCluster2.add(word);\n }\n b = !b;\n }\n cluster1 = tmpCluster1;\n cluster2 = tmpCluster2;\n }\n }\n } else if (vocab.size() == 2) {\n Iterator<S> it = vocab.iterator();\n S word1 = it.next();\n S word2 = it.next();\n cluster1.add(word1);\n cluster2.add(word2);\n newCenter1 = wordToVector(word1);\n newCenter2 = wordToVector(word2);\n } else {\n return;\n }\n\n if (notifyNewCluster(vocab, cluster1, cluster2)) {\n partition(cluster1, newCenter1);\n partition(cluster2, newCenter2);\n }\n\n }", "private int[][] generateCandidates(int[][] usageM){\n\t\t// 1. start with the complete set of attributes\n\t\tMap<Integer, List<Integer>> partitionAttributes = new HashMap<Integer,List<Integer>>();\n\t\tList<Integer> attributes = new ArrayList<Integer>();\n\t\tfor(int i=0;i<usageM[0].length;i++)\n\t\t\tattributes.add(i);\n\t\tpartitionAttributes.put(0, attributes);\n\t\t\n\t\t// 2. for each query, split this set of attributes into two set:\n\t\t// (i) attributes accessed by the query\n\t\t//\t (ii) attributes not-accessed by the query\n\t\tfor(int[] query: usageM){\n\t\t\tMap<Integer, List<Integer>> newPartitionAttributes = new HashMap<Integer,List<Integer>>();\n\t\t\tint partitionCount = partitionAttributes.size();\n\t\t\t\n\t\t\t// check each partition\n\t\t\tfor(int p: partitionAttributes.keySet()){\n\t\t\t\tList<Integer> attrs = partitionAttributes.get(p);\n\t\t\t\tboolean fullPartitionAccess = true;\n\t\t\t\tfor(int a: attrs){\n\t\t\t\t\tif(query[a]==0)\n\t\t\t\t\t\tfullPartitionAccess = false;\n\t\t\t\t}\n\n\t\t\t\tif(fullPartitionAccess){\n\t\t\t\t\tnewPartitionAttributes.put(p, attrs);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t//int newPartition = partitionAttributes.size();\n\t\t\t\t\tList<Integer> accessedAttrs = new ArrayList<Integer>();\n\t\t\t\t\tList<Integer> nonAccessedAttrs = new ArrayList<Integer>();\n\t\t\t\t\tfor(int a: attrs){\n\t\t\t\t\t\tif(query[a]==1)\n\t\t\t\t\t\t\taccessedAttrs.add(a);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tnonAccessedAttrs.add(a);\n\t\t\t\t\t}\n\t\t\t\t\tif(nonAccessedAttrs.size() > 0)\n\t\t\t\t\t\tnewPartitionAttributes.put(p, nonAccessedAttrs);\n\t\t\t\t\tif(accessedAttrs.size() > 0)\n\t\t\t\t\t\tnewPartitionAttributes.put(partitionCount++, accessedAttrs);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//System.out.println(newPartitionAttributes);\n\t\t\t\n\t\t\tpartitionAttributes = newPartitionAttributes;\n\t\t}\n\t\t\n\t\t\n\t\t// 3. we end up with a set of attribute sets; all attributes in \n\t\t//\t an attribute set are always accessed together.\n\t\tint[][] primaryPartitions = new int[partitionAttributes.size()][];\n\t\tint i=0;\n\t\tfor(int p: partitionAttributes.keySet()){\n\t\t\tList<Integer> attrs = partitionAttributes.get(p);\n\t\t\tprimaryPartitions[i] = new int[attrs.size()];\n\t\t\tfor(int j=0;j<attrs.size();j++)\n\t\t\t\tprimaryPartitions[i][j] = attrs.get(j);\n\t\t\ti++;\n\t\t}\n\t\t\n\t\treturn primaryPartitions;\n\t}", "public JavaPairRDD<String, Tuple2<Iterable<Integer>, Iterable<Integer>>> cogroupExample(){\n return firstSet\n .cogroup(secondSet);\n }", "@Test\n public void testSegmentSelection() {\n assertMetrics(\"segments:2 absoluteProximity:0.1 proximity:1 segmentStarts:19,41\",\n \"a b c d e\",\"x a b x c x x x x x x x x x x x x x x a b c x x x x x x x x x e x d x c d x x x c d e\");\n // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2\n // 0 1 2 3 4\n // Should choose - - - - -\n\n // Same as above but best matching segment have too low exactness\n assertMetrics(\"segments:2 absoluteProximity:0.0903 proximity:0.9033 segmentStarts:1,41\",\n \"a b c d e\",\"x a b x c x x x x x x x x x x x x x x a:0.2 b:0.3 c:0.4 x x x x x x x x x e x d x c d x x x c d e\");\n // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2\n // 0 1 2 3 4\n // Should choose - - - - -\n\n assertMetrics(\"segments:1 absoluteProximity:0.0778 proximity:0.778\",\"a b c d e f\",\"x x a b b b c f e d a b c d x e x x x x x f d e f a b c a a b b c c d d e e f f\");\n\n // Prefer one segment with ok proximity over two segments with great proximity\n assertMetrics(\"segments:1 segmentStarts:0\",\"a b c d\",\"a b x c d x x x x x x x x x x x a b x x x x x x x x x x x c d\");\n assertMetrics(\"segments:1 segmentStarts:0\",\"a b c d\",\"a b x x x x x x x x c d x x x x x x x x x x x a b x x x x x x x x x x x c d\");\n }", "public void testDifferentClusters() throws Exception {\n JChannel first1 = new JChannel(\"stacks/tcp_mping/tcp1.xml\");\n JChannel first2 = new JChannel(\"stacks/tcp_mping/tcp1.xml\");\n JChannel first3 = new JChannel(\"stacks/tcp_mping/tcp1.xml\");\n initiChannel(first1);\n initiChannel(first2);\n initiChannel(first3);\n\n expectView(first1, first2, first3);\n\n JChannel second1 = new JChannel(\"stacks/tcp_mping/tcp2.xml\");\n JChannel second2 = new JChannel(\"stacks/tcp_mping/tcp2.xml\");\n JChannel second3 = new JChannel(\"stacks/tcp_mping/tcp2.xml\");\n initiChannel(second1);\n initiChannel(second2);\n initiChannel(second3);\n\n expectView(first1, first2, first3);\n expectView(second1, second2, second3);\n success = true;\n }", "private static boolean knows(int a, int b) {\n\t\treturn MATRIX[a][b] == 1;\n\t}", "static int lcs(int x, int y, String s1, String s2)\n {\n // your code here\n \n int len1 = x;\n \n int len2 = y;\n \n int dp[][] = new int[len1+1][len2+1];\n \n for(int i=0;i<=len1;i++){\n dp[i][0] = 0;\n }\n \n for(int i=0;i<=len2;i++){\n dp[0][i] = 0;\n }\n \n for(int i=1;i<=len1;i++){\n for(int j=1;j<=len2;j++){\n \n if(s1.charAt(i-1)==s2.charAt(j-1)){\n dp[i][j]=1+dp[i-1][j-1];\n }\n else {\n dp[i][j] = Math.max(dp[i-1][j],dp[i][j-1]);\n }\n \n }\n }\n \n return dp[len1][len2];\n }", "public boolean matchSameColumns(Key key);", "Boolean isCollinearTo(IVec3 v);", "public void setClusterId(String id) {\n clusterId = id;\n }", "public int compare(Dataset object1, Dataset object2){\n if(object1.getAttributeCount() != candidate.getAttributeCount() ||\n object2.getAttributeCount() != candidate.getAttributeCount()){\n return 0;\n }\n\n double dist1 = 0.0, dist2 = 0.0;\n double tmp1 = 0.0, tmp2 = 0.0;\n\n for(int i = 0; i < candidate.getAttributeCount(); i++){\n if(candidate.getOutputColumnCount() == (i+1)){\n continue;\n }\n\n Attribute ac = candidate.getAttribute(i);\n Attribute a1 = object1.getAttribute(i);\n Attribute a2 = object2.getAttribute(i);\n\n if(ac.getType() == AttributeTypes.TEXT){\n dist1 += DatasetEuklidianComparator.unlimitedCompare((String)ac.getValue(), (String)a1.getValue());\n dist2 += DatasetEuklidianComparator.unlimitedCompare((String)ac.getValue(), (String)a2.getValue());\n }else{\n /*\n double acDouble = 0.0;\n double a1Double = 0.0;\n double a2Double = 0.0;\n switch(ac.getType()){\n case INTEGER: acDouble = (double)((Integer)ac.getValue()).intValue(); break;\n case DECIMAL: acDouble = (double)ac.getValue();\n }\n switch(a1.getType()){\n case INTEGER: a1Double = (double)((Integer)a1.getValue()).intValue(); break;\n case DECIMAL: a1Double = (double)a1.getValue();\n }\n switch(a2.getType()){\n case INTEGER: a2Double = (double)((Integer)a2.getValue()).intValue(); break;\n case DECIMAL: a2Double = (double)a2.getValue();\n }*/\n double acDouble = (double)ac.getValue();\n double a1Double = (double)a1.getValue();\n double a2Double = (double)a2.getValue();\n\n tmp1 += Math.pow(a1Double-acDouble, 2);\n tmp2 += Math.pow(a2Double-acDouble, 2);\n }\n }\n\n dist1 += Math.sqrt(tmp1);\n dist2 += Math.sqrt(tmp2);\n\n if (dist1 > dist2) {\n return 1;\n }\n if (dist1 < dist2) {\n return -1;\n }\n return 0;\n }", "public boolean verificaLinhaEColuna(int x, int y){\n for(int i = 0; i < 9; i++){\n if(matriz[x][y] == matriz[x][i] && y!=i){\n return false;\n }\n }\n\n for (int j = 0; j < 9; j++){\n if(matriz[x][y] == matriz[j][y] && x!=j){\n return false;\n }\n }\n\n return true;\n }", "@Test\r\n\tpublic void testAdjacency33() {\r\n\t\tBoardCell cell = board.getCell(3, 3);\r\n\t\tSet<BoardCell> testList = board.getAdjList(cell);\r\n\t\tassertTrue(testList != null);\r\n\t\tassertTrue(testList.contains(board.getCell(2, 3)));\r\n\t\tassertTrue(testList.contains(board.getCell(3, 2)));\r\n\t\tassertEquals(2, testList.size());\r\n\t}", "io.envoyproxy.envoy.type.metadata.v3.MetadataKind.Cluster getCluster();" ]
[ "0.6016142", "0.59664255", "0.582602", "0.58245015", "0.56683433", "0.56623054", "0.5468462", "0.54600275", "0.54583234", "0.541432", "0.5369806", "0.5315496", "0.52900255", "0.5286375", "0.5260932", "0.5257752", "0.52531886", "0.5232511", "0.5202972", "0.52017224", "0.5174464", "0.51536524", "0.5145955", "0.51419634", "0.51017183", "0.5082309", "0.5070624", "0.5005206", "0.49506253", "0.49498203", "0.49487662", "0.4921493", "0.49199876", "0.48465824", "0.48230442", "0.48066288", "0.47503856", "0.47480148", "0.47366184", "0.472913", "0.47211203", "0.47146434", "0.47054517", "0.47037017", "0.47022256", "0.46961877", "0.4691448", "0.46898523", "0.468259", "0.46733844", "0.46733844", "0.46733844", "0.46733844", "0.46733844", "0.46733844", "0.4673069", "0.46677747", "0.4655525", "0.46193263", "0.46149164", "0.46089196", "0.46067646", "0.45929426", "0.45836514", "0.45826668", "0.45819932", "0.45742983", "0.45692304", "0.45684126", "0.45666867", "0.45662782", "0.45534915", "0.45531827", "0.45464152", "0.4544877", "0.45395273", "0.45341963", "0.4530676", "0.4529765", "0.4529765", "0.45276445", "0.4522303", "0.45186275", "0.45142305", "0.4511724", "0.45110345", "0.45081216", "0.45070243", "0.45035788", "0.44979858", "0.44921958", "0.44848827", "0.44834703", "0.44644645", "0.44591102", "0.44579616", "0.44522154", "0.44473982", "0.4439921", "0.443426", "0.442905" ]
0.0
-1
Test '(clustering_0, clustering_1) IN ((1, 2), (2, 3))' with two clustering column
@Test public void testBoundsAsCompositesWithMultiInRestrictions() { CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC); ByteBuffer value1 = ByteBufferUtil.bytes(1); ByteBuffer value2 = ByteBufferUtil.bytes(2); ByteBuffer value3 = ByteBufferUtil.bytes(3); Restriction in = newMultiIN(cfMetaData, 0, asList(value1, value2), asList(value2, value3)); PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(in); List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(2, bounds.size()); assertComposite(bounds.get(0), value1, value2, EOC.START); assertComposite(bounds.get(1), value2, value3, EOC.START); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(2, bounds.size()); assertComposite(bounds.get(0), value1, value2, EOC.END); assertComposite(bounds.get(1), value2, value3, EOC.END); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void testBoundsAsCompositesWithSingleEqAndMultiINRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n ByteBuffer value5 = ByteBufferUtil.bytes(5);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) IN ((2, 3), (4, 5))\n Restriction singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction multiIN = newMultiIN(cfMetaData, 1, asList(value2, value3), asList(value4, value5));\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiIN);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(1), value1, value4, value5, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(1), value1, value4, value5, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) IN ((2, 3))\n singleEq = newSingleEq(cfMetaData, 0, value1);\n multiIN = newMultiIN(cfMetaData, 1, asList(value2, value3));\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiIN).mergeWith(singleEq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n // clustering_0 = 1 AND clustering_1 = 5 AND (clustering_2, clustering_3) IN ((2, 3), (4, 5))\n singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction singleEq2 = newSingleEq(cfMetaData, 1, value5);\n multiIN = newMultiIN(cfMetaData, 2, asList(value2, value3), asList(value4, value5));\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiIN).mergeWith(singleEq2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value5, value2, value3, EOC.START);\n assertComposite(bounds.get(1), value1, value5, value4, value5, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value5, value2, value3, EOC.END);\n assertComposite(bounds.get(1), value1, value5, value4, value5, EOC.END);\n }", "@Test\n public void should_iterate_with_partition_keys_and_partition_keys_IN() throws Exception {\n //Given\n long partitionKey = RandomUtils.nextLong(0,Long.MAX_VALUE);\n\n insertCompositeClusteredValues(partitionKey,\"bucket1\",1,\"name1\",1);\n insertCompositeClusteredValues(partitionKey,\"bucket2\",1,\"name2\",1);\n insertCompositeClusteredValues(partitionKey,\"bucket3\",1,\"name3\",1);\n\n //When\n final Iterator<CompositeClusteredEntity> iterator = manager.sliceQuery(CompositeClusteredEntity.class)\n .forIteration()\n .withPartitionComponents(partitionKey)\n .andPartitionComponentsIN(\"bucket1\", \"bucket3\")\n .iterator();\n\n //Then\n assertThat(iterator.hasNext()).isTrue();\n CompositeClusteredEntity next = iterator.next();\n assertThat(next.getId().getId()).isEqualTo(partitionKey);\n assertThat(next.getId().getBucket()).isEqualTo(\"bucket1\");\n assertThat(next.getId().getName()).isEqualTo(\"name11\");\n assertThat(next.getValue()).isEqualTo(\"value11\");\n\n assertThat(iterator.hasNext()).isTrue();\n next = iterator.next();\n assertThat(next.getId().getId()).isEqualTo(partitionKey);\n assertThat(next.getId().getBucket()).isEqualTo(\"bucket3\");\n assertThat(next.getId().getName()).isEqualTo(\"name31\");\n assertThat(next.getValue()).isEqualTo(\"value11\");\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithTwoAscendingAndTwoDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.DESC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertEmptyComposite(bounds.get(1));\n\n // clustering_0 = 1 AND (clustering_1, clustering_2, clustering_3) > (2, 3, 4)\n Restriction eq = newSingleEq(cfMetaData, 0, value1);\n slice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n restrictions = restrictions.mergeWith(eq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2, clustering_3) > (2, 3, 4)\n Restriction in = newSingleIN(cfMetaData, 0, value1, value2);\n slice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n restrictions = restrictions.mergeWith(in);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n assertComposite(bounds.get(2), value2, value2, EOC.START);\n assertComposite(bounds.get(3), value2, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n assertComposite(bounds.get(2), value2, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(3), value2, EOC.END);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1, clustering_2, clustering_3) <= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) < (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4) AND (clustering_0, clustering_1) < (2, 3)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2, value3);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(1), value2, value3, EOC.START);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4) AND (clustering_0, clustering1, clustering_2, clustering_3) <= (4, 3, 2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value4, value3, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n assertComposite(bounds.get(2), value4, value3, value2, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(1), value4, value3, EOC.START);\n assertComposite(bounds.get(2), value4, value3, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithTwoClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsMixingAscendingDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.DESC, Sort.ASC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(3));\n\n // clustering_0 = 1 AND (clustering_1, clustering_2, clustering_3) > (2, 3, 4)\n Restriction eq = newSingleEq(cfMetaData, 0, value1);\n slice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n restrictions = restrictions.mergeWith(eq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(3));\n\n\n // (clustering_0, clustering1, clustering_2, clustering_3) <= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, value4, EOC.NONE);\n assertComposite(bounds.get(3), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) < (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(3), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4) AND (clustering_0, clustering_1) < (2, 3)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2, value3);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(5, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n assertComposite(bounds.get(4), value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(5, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertComposite(bounds.get(3), value2, EOC.START);\n assertComposite(bounds.get(4), value2, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4) AND (clustering_0, clustering1, clustering_2, clustering_3) <= (4, 3, 2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value4, value3, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(7, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n assertComposite(bounds.get(4), value4, value3, EOC.START);\n assertComposite(bounds.get(5), value4, value3, value2, value1, EOC.NONE);\n assertComposite(bounds.get(6), value4, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(7, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertComposite(bounds.get(3), value4, EOC.START);\n assertComposite(bounds.get(4), value4, value3, value2, EOC.START);\n assertComposite(bounds.get(5), value4, value3, value2, EOC.END);\n assertComposite(bounds.get(6), value4, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithOneEqRestrictionsAndTwoClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer clustering_0 = ByteBufferUtil.bytes(1);\n Restriction eq = newSingleEq(cfMetaData, 0, clustering_0);\n\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.END);\n }", "Condition in(QueryParameter parameter, Object... values);", "@Test\n public void testBoundsAsCompositesWithOneInRestrictionsAndOneClusteringColumn()\n {\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n Restriction in = newSingleIN(cfMetaData, 0, value1, value2, value3);\n\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(in);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.START);\n assertComposite(bounds.get(2), value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n assertComposite(bounds.get(1), value2, EOC.END);\n assertComposite(bounds.get(2), value3, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithOneEqRestrictionsAndOneClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC);\n\n ByteBuffer clustering_0 = ByteBufferUtil.bytes(1);\n Restriction eq = newSingleEq(cfMetaData, 0, clustering_0);\n\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneAscendingAndOneDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n assertComposite(bounds.get(2), value2, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertComposite(bounds.get(1), value2, EOC.START);\n assertComposite(bounds.get(2), value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithSingleEqAndMultiEqRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) = (2, 3)\n Restriction singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction multiEq = newMultiEq(cfMetaData, 1, value2, value3);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiEq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n // clustering_0 = 1 AND clustering_1 = 2 AND (clustering_2, clustering_3) = (3, 4)\n singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction singleEq2 = newSingleEq(cfMetaData, 1, value2);\n multiEq = newMultiEq(cfMetaData, 2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(singleEq2).mergeWith(multiEq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n\n // (clustering_0, clustering_1) = (1, 2) AND clustering_2 = 3\n singleEq = newSingleEq(cfMetaData, 2, value3);\n multiEq = newMultiEq(cfMetaData, 0, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiEq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) = (2, 3) AND clustering_3 = 4\n singleEq = newSingleEq(cfMetaData, 0, value1);\n singleEq2 = newSingleEq(cfMetaData, 3, value4);\n multiEq = newMultiEq(cfMetaData, 1, value2, value3);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiEq).mergeWith(singleEq2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n }", "public interface IStoppingCriteria {\n\n /**\n * Determine the degree of clustering agreement\n * @param cluster1 one clustering results\n * @param cluster2 the other clustering results\n * @return the degree of clustering agreement; 1 refers to be the same clustering results; 0 refers to be the totally different clustering results\n */\n public double computeSimilarity(int[] cluster1, int[] cluster2);\n\n}", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneDescendingAndOneAscendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0) > (1) AND (clustering_0, clustering1) < (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.END);\n assertComposite(bounds.get(2), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.END);\n assertComposite(bounds.get(1), value1, EOC.START);\n assertComposite(bounds.get(2), value1, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithTwoDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n }", "boolean inCommunities(String element);", "@Test\n public void testBoundsAsCompositesWithMultiEqAndSingleSliceRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n\n // (clustering_0, clustering_1) = (1, 2) AND clustering_2 > 3\n Restriction multiEq = newMultiEq(cfMetaData, 0, value1, value2);\n Restriction singleSlice = newSingleSlice(cfMetaData, 2, Bound.START, false, value3);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiEq).mergeWith(singleSlice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n }", "public boolean isEqualTo(Cluster c)\n {\n int len = this.size();\n if (len != c.size()){\n return false;\n }\n if (len == 0){\n return true;\n }\n if (this.getLeader() != c.getLeader()){\n return false;\n }\n for (Integer n : this._elems){\n if (!c.contains(n)){\n return false;\n }\n }\n return true;\n }", "@Test\n public void testBoundsAsCompositesWithSingleEqAndSliceRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n ByteBuffer value5 = ByteBufferUtil.bytes(5);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) > (2, 3)\n Restriction singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction multiSlice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiSlice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) > (2, 3) AND (clustering_1) < (4)\n singleEq = newSingleEq(cfMetaData, 0, value1);\n multiSlice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3);\n Restriction multiSlice2 = newMultiSlice(cfMetaData, 1, Bound.END, false, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiSlice2).mergeWith(singleEq).mergeWith(multiSlice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value4, EOC.START);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) => (2, 3) AND (clustering_1, clustering_2) <= (4, 5)\n singleEq = newSingleEq(cfMetaData, 0, value1);\n multiSlice = newMultiSlice(cfMetaData, 1, Bound.START, true, value2, value3);\n multiSlice2 = newMultiSlice(cfMetaData, 1, Bound.END, true, value4, value5);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiSlice2).mergeWith(singleEq).mergeWith(multiSlice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value4, value5, EOC.END);\n }", "@Test\n public void whereExplodeColumn() throws Exception {\n String sql = \"desc verbose select k1, e1 from db1.tbl1 lateral view explode_split(k2, \\\",\\\") tmp as e1 \"\n + \"where e1='1'; \";\n String explainString = UtFrameUtils.getSQLPlanOrErrorMsg(ctx, sql, true);\n Assert.assertTrue(explainString.contains(\"1:TABLE FUNCTION NODE\"));\n Assert.assertTrue(explainString.contains(\"table function: explode_split(`k2`, ',')\"));\n Assert.assertTrue(explainString.contains(\"PREDICATES: `e1` = '1'\"));\n Assert.assertTrue(explainString.contains(\"tuple ids: 0 1\"));\n Assert.assertTrue(explainString.contains(\"TupleDescriptor{id=1, tbl=tmp, byteSize=32, materialized=true}\"));\n Assert.assertTrue(explainString.contains(\"SlotDescriptor{id=1, col=e1, type=VARCHAR(*)}\"));\n }", "@Test\n public void tableFunctionInWhere() throws Exception {\n String sql = \"explain select k1 from db1.tbl1 where explode_split(k2, \\\",\\\");\";\n String explainString = UtFrameUtils.getSQLPlanOrErrorMsg(ctx, sql);\n Assert.assertTrue(\n explainString.contains(\"No matching function with signature: explode_split(varchar(-1), varchar(-1)).\"));\n }", "@Test\n \tpublic void whereClauseForNodeEdgeAnnotation() {\n \t\tnode23.addEdgeAnnotation(new Annotation(\"namespace1\", \"name1\"));\n \t\tnode23.addEdgeAnnotation(new Annotation(\"namespace2\", \"name2\", \"value2\", TextMatching.EXACT_EQUAL));\n \t\tnode23.addEdgeAnnotation(new Annotation(\"namespace3\", \"name3\", \"value3\", TextMatching.REGEXP_EQUAL));\n \t\tcheckWhereCondition(\n \t\t\t\tjoin(\"=\", \"_rank_annotation23_1.edge_annotation_namespace\", \"'namespace1'\"),\n \t\t\t\tjoin(\"=\", \"_rank_annotation23_1.edge_annotation_name\", \"'name1'\"),\n \t\t\t\tjoin(\"=\", \"_rank_annotation23_2.edge_annotation_namespace\", \"'namespace2'\"),\n \t\t\t\tjoin(\"=\", \"_rank_annotation23_2.edge_annotation_name\", \"'name2'\"),\n \t\t\t\tjoin(\"=\", \"_rank_annotation23_2.edge_annotation_value\", \"'value2'\"),\n \t\t\t\tjoin(\"=\", \"_rank_annotation23_3.edge_annotation_namespace\", \"'namespace3'\"),\n \t\t\t\tjoin(\"=\", \"_rank_annotation23_3.edge_annotation_name\", \"'name3'\"),\n \t\t\t\tjoin(\"~\", \"_rank_annotation23_3.edge_annotation_value\", \"'^value3$'\")\n \t\t);\n \t}", "public String createWhereIN(int iterations) {\n StringBuilder sb = new StringBuilder();\n sb.append(\" IN (\");\n for (int ndx = 0; ndx < iterations; ndx++) {\n sb.append(\"?,\");\n }\n sb.deleteCharAt(sb.length() - 1); // remove last comma.\n sb.append(\")\");\n return sb.toString();\n }", "private boolean isSubsetOf(int firstRow, int secondRow) {\n for (int i = 0; i < universalSetSize; i++) {\n if (input[firstRow][i] && !input[secondRow][i]) {\n return false;\n }\n }\n return true;\n }", "private boolean isSubset(List<ConceptLabel> outer, List<ConceptLabel> inner){\n\t\tfor(ConceptLabel in: inner){\n\t\t\tboolean c = false;\n\t\t\tfor(ConceptLabel l: outer){\n\t\t\t\tif(l.getText().equals(in.getText())){\n\t\t\t\t\tc = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(!c)\n\t\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "boolean getIsClusteringKey();", "private static boolean fun3(List<String> res, List<String> ac1) {\n\t\tHashSet<String> hs=new HashSet<String>();\r\n\t\tfor(int i=0;i<res.size();i++){\r\n\t\t\ths.add(res.get(i));\r\n\t\t}\r\n\t\tfor(int i=0;i<ac1.size();i++){\r\n\t\t\tif(hs.contains(ac1.get(i)))\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "private static Restriction newMultiEq(CFMetaData cfMetaData, int firstIndex, ByteBuffer... values)\n {\n List<ColumnDefinition> columnDefinitions = new ArrayList<>();\n for (int i = 0; i < values.length; i++)\n {\n columnDefinitions.add(getClusteringColumnDefinition(cfMetaData, firstIndex + i));\n }\n return new MultiColumnRestriction.EQ(columnDefinitions, toMultiItemTerminal(values));\n }", "boolean hasCluster();", "@Test\n public void whereNormalColumn() throws Exception {\n String sql = \"desc verbose select k1, e1 from db1.tbl1 lateral view explode_split(k2, \\\",\\\") tmp as e1 \"\n + \"where k1=1; \";\n String explainString = UtFrameUtils.getSQLPlanOrErrorMsg(ctx, sql, true);\n Assert.assertTrue(explainString.contains(\"1:TABLE FUNCTION NODE\"));\n Assert.assertTrue(explainString.contains(\"table function: explode_split(`k2`, ',')\"));\n Assert.assertTrue(explainString.contains(\"tuple ids: 0 1\"));\n Assert.assertTrue(explainString.contains(\"TupleDescriptor{id=1, tbl=tmp, byteSize=32, materialized=true}\"));\n Assert.assertTrue(explainString.contains(\"SlotDescriptor{id=1, col=e1, type=VARCHAR(*)}\"));\n Assert.assertTrue(explainString.contains(\"0:OlapScanNode\"));\n Assert.assertTrue(explainString.contains(\"PREDICATES: `k1` = 1\"));\n }", "@Test\n public void testSqlExistsMultiValuedWithForeignRestriction() {\n Query<Garage> garagesQuery = existsIn(cars,\n Garage.BRANDS_SERVICED,\n Car.NAME,\n equal(Car.FEATURES, \"convertible\")\n );\n\n Set<Garage> results = asSet(garages.retrieve(garagesQuery));\n\n assertEquals(\"should have 2 results\", 2, results.size());\n assertTrue(\"results should contain garage2\", results.contains(garage2));\n assertTrue(\"results should contain garage5\", results.contains(garage5));\n }", "private ClusterCombination checkAndDoJoinMultiPearson(ClusterCombination CC1, ClusterCombination CC2) {\n boolean doJoin = true;\r\n ArrayList<Cluster> CCList = new ArrayList<>(CC1.getClusters().size()+1); //list of output clusters for new CC if join is succesfull\r\n\r\n ArrayList<Cluster> CC1Clusters = CC1.getClusters();\r\n ArrayList<Cluster> CC2Clusters = CC2.getClusters();\r\n\r\n ArrayList<Cluster> LHS1 = CC1.getLHS();\r\n ArrayList<Cluster> LHS2 = CC2.getLHS();\r\n\r\n ArrayList<Cluster> RHS1 = CC1.getRHS();\r\n ArrayList<Cluster> RHS2 = CC2.getRHS();\r\n\r\n for(int i =0; i<CC1Clusters.size()-1; i++) {\r\n Cluster C1 = CC1Clusters.get(i);\r\n Cluster C2 = CC2Clusters.get(i);\r\n\r\n boolean overlap = checkClusterOverlap(C1, C2); // check if there is some overlap\r\n\r\n\r\n\r\n if(!overlap){ //the cluster in this position does not overlap, we don't need to join\r\n doJoin=false;\r\n break;\r\n }else{ // there is overlap, add the intersection of C1 and C2\r\n if(C1.getNPoints() <= C2.getNPoints()){\r\n CCList.add(C1);\r\n }else{\r\n CCList.add(C2);\r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n\r\n if(doJoin){ // each cluster in the candidate (except the last) does overlap\r\n // so, according to apriori, we join -> return the overlapping clusters + the last clusters of CC1 and CC2\r\n Cluster lastCC1 = CC1Clusters.get(CC1Clusters.size()-1);\r\n Cluster lastCC2 = CC2Clusters.get(CC2Clusters.size()-1);\r\n if(lastCC1.getClusterId() <= lastCC2.getClusterId()){ // make sure to respect ordering of clusters within a candidate by ID. otherwise this could be designated as a duplicate\r\n CCList.add(lastCC1); CCList.add(lastCC2);\r\n }else{\r\n CCList.add(lastCC2); CCList.add(lastCC1);\r\n }\r\n\r\n ArrayList<Cluster> newLHS = new ArrayList<>();\r\n ArrayList<Cluster> newRHS = new ArrayList<>();\r\n for(int i = 0; i<LHS1.size(); i++){\r\n newLHS.add(CCList.get(i));\r\n }\r\n for(int i = LHS1.size(); i<CCList.size(); i++){\r\n newRHS.add(CCList.get(i));\r\n }\r\n\r\n ClusterCombination newCC = new MultiPearsonClusterCombination(newLHS, newRHS);\r\n newCC.checkAndSetMaxSubsetLowerBound(Math.max(CC1.getLB(), CC1.getMaxLowerBoundSubset()));\r\n newCC.checkAndSetMaxSubsetLowerBound(Math.max(CC2.getLB(), CC2.getMaxLowerBoundSubset()));\r\n\r\n return newCC;\r\n\r\n }else{\r\n return null;\r\n }\r\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n }", "private static double intraClusterScore(List<String> arg1, List<String> arg2) {\n\t\t// compare each elements from argList1 vs argList2\n\n\t\tPair<String, String> pair = null;\n\t\tdouble tempScore = 0;\n\t\tdouble maxScore = 0;\n\n\t\tfor (int list1Id = 0; list1Id < arg1.size(); list1Id++) {\n\t\t\tfor (int list2Id = 0; list2Id < arg2.size(); list2Id++) {\n\n\t\t\t\t// create a pair\n\t\t\t\tpair = new ImmutablePair<String, String>(arg1.get(list1Id)\n\t\t\t\t\t\t.trim(), arg2.get(list2Id).trim());\n\n\t\t\t\ttry {\n\t\t\t\t\t// retrieve the key from the collection\n\t\t\t\t\ttempScore = SCORE_MAP.get(pair);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tpair = new ImmutablePair<String, String>(arg2.get(\n\t\t\t\t\t\t\t\tlist2Id).trim(), arg1.get(list1Id).trim());\n\t\t\t\t\t\ttempScore = SCORE_MAP.get(pair);\n\n\t\t\t\t\t} catch (Exception e1) {\n\t\t\t\t\t\ttempScore = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// System.out.println(\" temp score = \" + tempScore);\n\t\t\t\tmaxScore = (tempScore > maxScore) ? tempScore : maxScore;\n\t\t\t}\n\t\t}\n\n\t\t// System.out.println(\"max = \" + maxScore);\n\t\treturn maxScore;\n\t}", "boolean hasXYPairs();", "long findValues(List<Object> values, List<Column> columns);", "private boolean isSubsetOf(List<String> permissions2,\n\t\t\tList<String> permissions3) {\n\t\treturn false;\n\t}", "private boolean checksetunions(Set<String> set, HashMap<String, ArrayList<String>> c) {\n\t\tObject[] ckeys = c.keySet().toArray();\r\n\t\tfor (int i = 0; i < c.keySet().size(); i++) {\r\n\t\t\tif (c.get(ckeys[i]).containsAll(set)) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "private boolean in(Integer e, ArrayList<Integer> l) {\n for (int i=0; i<l.size();i++) {\n if (l.get(i) == e) {\n return true;\n }\n }\n return false;\n }", "protected <INPUT_1, INGREDIENT_1 extends InputIngredient<INPUT_1>, CACHE_1 extends IInputCache<INPUT_1, INGREDIENT_1, RECIPE>, INPUT_2,\n INGREDIENT_2 extends InputIngredient<INPUT_2>, CACHE_2 extends IInputCache<INPUT_2, INGREDIENT_2, RECIPE>> boolean containsPairing(@Nullable Level world,\n INPUT_1 input1, Function<RECIPE, INGREDIENT_1> input1Extractor, CACHE_1 cache1, Set<RECIPE> complexIngredients1, INPUT_2 input2,\n Function<RECIPE, INGREDIENT_2> input2Extractor, CACHE_2 cache2, Set<RECIPE> complexIngredients2) {\n if (cache1.isEmpty(input1)) {\n //Note: We don't bother checking if 2 is empty here as it will be verified in containsInput\n return containsInput(world, input2, input2Extractor, cache2, complexIngredients2);\n } else if (cache2.isEmpty(input2)) {\n return true;\n }\n initCacheIfNeeded(world);\n //Note: If cache 1 contains input 1 then we only need to test the type of input 2 as we already know input 1 matches\n if (cache1.contains(input1, recipe -> input2Extractor.apply(recipe).testType(input2))) {\n return true;\n }\n //Our quick lookup 1 cache does not contain it, check any recipes where the 1 ingredient was complex\n return complexIngredients1.stream().anyMatch(recipe -> input1Extractor.apply(recipe).testType(input1) && input2Extractor.apply(recipe).testType(input2));\n }", "@Test\n public void testBoundsAsCompositesWithSliceRestrictionsAndOneClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newSingleSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newSingleSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n }", "private boolean isIntersectWithSource(List<Pair<Tuple,String>> list1, List<Pair<Tuple,String>> list2) {\n\t\tboolean intersect = false;\n\t\t\n\t\tfor (Pair<Tuple,String> tuple : list1) {\n\t\t\tif (list2.contains(tuple)) {\n\t\t\t\tintersect = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn intersect;\n\t}", "public void addWhereIn(String attributeName, Collection values, String operator) {\r\n\t\tif (!values.isEmpty()) {\r\n\t\t\tString valueListString = StringUtils.join(values, ',');\r\n\t\t\taddWhere(attributeName + \" in (\"+valueListString+\")\", operator);\r\n\t\t}\r\n\t}", "public void matchesDemo() \n {\n Map<String, Set<String>> clientMap = new HashMap<>();\n Set<String> interests = new HashSet<>();\n\n interests.add(\"Food\");\n interests.add(\"Wine\");\n interests.add(\"Tandems\");\n clientMap.put(\"Hal\", interests);\n\t \n interests = new HashSet<>();\n interests.add(\"Food\");\n interests.add(\"Walking\");\n interests.add(\"Welding\");\n clientMap.put(\"Gemma\", interests);\n\t \n interests = new HashSet<>();\n interests.add(\"Food\");\n interests.add(\"Cinema\");\n interests.add(\"Wine\");\n clientMap.put(\"Caroline\", interests);\n\n Set<String> halsInterests = clientMap.get(\"Hal\");\n String outputString;\n Set<String> eachClientInterests;\n Set<String> intersection;\n\n for (String eachClient : clientMap.keySet()) \n {\n eachClientInterests = clientMap.get(eachClient);\n intersection = new HashSet<>(halsInterests);\n intersection.retainAll(eachClientInterests);\n outputString = \"Hal and \" + eachClient \n + \" have common interests: \"\n + intersection;\n System.out.println(outputString) ;\n }\n }", "static boolean isClusterCandidate_(double x_1, double y1, double x2,\n\t\t\tdouble y2, double sqr_tolerance) {\n\t\tdouble dx = x_1 - x2;\n\t\tdouble dy = y1 - y2;\n\t\treturn dx * dx + dy * dy <= sqr_tolerance;\n\t}", "protected abstract NativeSQLStatement createNativeIntersectsStatement(Geometry geom);", "boolean hasClusterName();", "boolean hasPermissionOfCluster(String clusterId, String userName);", "@Test\n public void testHeterogeneousSegmentFilterConditionLimit() throws SqlParseException {\n\n val project = \"heterogeneous_segment\";\n // val dfId = \"747f864b-9721-4b97-acde-0aa8e8656cba\"\n // val seg1Id = \"8892fa3f-f607-4eec-8159-7c5ae2f16942\"\n // val seg2Id = \"d75a822c-788a-4592-a500-cf20186dded1\"\n // val seg3Id = \"54eaf96d-6146-45d2-b94e-d5d187f89919\"\n // val seg4Id = \"411f40b9-a80a-4453-90a9-409aac6f7632\"\n // val seg5Id = \"a8318597-cb75-416f-8eb8-96ea285dd2b4\"\n // \n val sql = \"with T1 as (select cal_dt, trans_id \\n\" + \"from test_kylin_fact inner join test_account \\n\"\n + \"on test_kylin_fact.seller_id = test_account.account_id \\n\"\n + \"where cal_dt between date'2012-01-01' and date'2012-01-03'\\n\" + \"group by cal_dt, trans_id)\\n\";\n\n {\n val sqlWithTooManyOrs = sql + \" select * from T1 where \" + \"(cal_dt='2012-01-01' and trans_id = 1) or \\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 2) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 3) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 4) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 5) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 6) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 7) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 8) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 9) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 10) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 12) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 13) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 14) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 15) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 16) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 17) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 18) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 19) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 20)\";\n val contexts = OlapContextTestUtil.getOlapContexts(project, sqlWithTooManyOrs);\n Assert.assertEquals(\n \">=(DEFAULT.TEST_KYLIN_FACT.CAL_DT, 2012-01-01),<=(DEFAULT.TEST_KYLIN_FACT.CAL_DT, 2012-01-03)\",\n contexts.get(0).getExpandedFilterConditions().stream().map(RexNode::toString)\n .collect(Collectors.joining(\",\")));\n }\n\n {\n val sqlWithFilter = sql + \" select * from T1 where \" + \"(cal_dt='2012-01-01' and trans_id = 1) or \\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 2) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 3) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 4) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 5) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 6) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 7) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 8) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 9) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 10)\";\n val contexts = OlapContextTestUtil.getOlapContexts(project, sqlWithFilter);\n Assert.assertNotEquals(\n \">=(DEFAULT.TEST_KYLIN_FACT.CAL_DT, 2012-01-01),<=(DEFAULT.TEST_KYLIN_FACT.CAL_DT, 2012-01-03)\",\n contexts.get(0).getExpandedFilterConditions().stream().map(RexNode::toString)\n .collect(Collectors.joining(\",\")));\n }\n\n }", "private String checksubset(HashMap<String, ArrayList<String>> cn) {\n\t\tObject[] cnkeys = cn.keySet().toArray();\r\n\t\tfor (int i = 0; i < cnkeys.length; i++) {\r\n\t\t\tfor (int j = cnkeys.length - 1; j > i; j--) {\r\n\t\t\t\tif (cn.get(cnkeys[i]).size() < cn.get(cnkeys[j]).size()) {\r\n\t\t\t\t\tif (cn.get(cnkeys[j]).containsAll(cn.get(cnkeys[i]))) {\r\n\t\t\t\t\t\treturn (String) cnkeys[i];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (cn.get(cnkeys[i]).containsAll(cn.get(cnkeys[j]))) {\r\n\t\t\t\t\treturn (String) cnkeys[j];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public static boolean in(String strs, String str) {\n\treturn null != strs && null != str && Arrays.asList(strs.split(\",\")).contains(str);\n }", "public boolean matchResult(String expected,String count){\r\n List<String> expected_Result=new ArrayList<String>();\r\n String s1[];\r\n if(expected.contains(\",\")){\r\n s1 =expected.split(\",\");\r\n for(int i=0;i<s1.length;i++){\r\n expected_Result.add(s1[i]);\r\n }\r\n }\r\n else if(expected.length()!=0){\r\n expected_Result.add(expected);\r\n }\r\n\r\n Boolean match=islistmatching(expected_Result,getResult());\r\n\r\n return match;\r\n\r\n }", "boolean isMultiple(String val) {\n\t\tif (val == null) return false;\n\t\treturn val.indexOf(VcfEntry.WITHIN_FIELD_SEP) >= 0;\n\t}", "public double computeSimilarity(int[] cluster1, int[] cluster2);", "boolean contains(int vertex);", "protected abstract NativeSQLStatement createNativeContainsStatement(Geometry geom);", "private String getContainsList(){\n\t\t\n\t\tArrayList<String> containsList = new ArrayList<String>();\n\t\t\n\t\tIterator<String> it = tagArray.iterator();\n\t\tString tag;\n\t\t\n\t\twhile (it.hasNext()) {\n\t\t\t\n\t\t\ttag = it.next();\n\t\t\t\n\t\t\tString containsClause = \"PrimaryTag='\" + \n\t\t\t tag + \"'\";\n\t\t\t \n\t\t\tcontainsList.add(containsClause);\n\t\t\t\n\t\t}\n\t\t\n\t\tString retVal = StringUtils.join(containsList, \" or \");\n\n\t\treturn retVal;\n\t}", "public List<ParameterValueObject> getClustering(Filter filter);", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneDescendingClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n }", "private void clusterElements(int element1,int element2)\n\t{\n\t\tint index1 = getClusterIndex(element1);\n\t\tint index2 = getClusterIndex(element2);\n\t\t\n\t\t\n\t\tif (index1 != index2)\n\t\t\tif((index1 != -1) && (index2 != -1))\n\t\t\t\tcombineClusters(index1,index2);\n\t}", "public boolean matchSameColumns(Key key);", "private int[] matches(int[] partition, int feature, boolean value) {\r\n\t\t// to allocate the array we first check how many samples we're talking\r\n\t\t// about\r\n\t\tint nMatches = 0;\r\n\t\tfor (int i = 0; i < partition.length; i++) {\r\n\t\t\tif (input[partition[i]][feature] == value)\r\n\t\t\t\tnMatches++;\r\n\t\t}\r\n\t\tint[] subset = new int[nMatches]; // allocate the array holding the\r\n\t\t\t\t\t\t\t\t\t\t\t// matching sample indices\r\n\t\tint cnt = 0;\r\n\t\t// collect the matching samples\r\n\t\tfor (int i = 0; i < partition.length; i++) {\r\n\t\t\tif (input[partition[i]][feature] == value)\r\n\t\t\t\tsubset[cnt++] = partition[i];\r\n\t\t}\r\n\t\treturn subset;\r\n\t}", "boolean hasContains();", "PivotInClause createPivotInClause();", "private boolean isIntersect(List<Tuple> list1, List<Tuple> list2) {\n\t\tboolean intersect = false;\n\t\tfor (Tuple tuple : list1) {\n\t\t\tif (list2.contains(tuple)) {\n\t\t\t\tintersect = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn intersect;\n\t}", "private static boolean checkForMultipleIDs(String id)\n\t{\n\t\tif (id.indexOf(',') >= 0)\n\t\t{\n\t\t\treturn false; \n\t\t}\n\t\t\n\t\treturn true; \n\t}", "@Test\n \tpublic void whereClauseForNodeSpanString() {\n \t\tnode23.setSpannedText(\"string\", TextMatching.EXACT_EQUAL);\n \t\tcheckWhereCondition(join(\"=\", \"_node23.span\", \"'string'\"));\n \t}", "private int pairContains(HashMap<Integer,HashSet<Integer>> pairs, int k1, int k2){\n\t\t\n\t\t\n\t\t\tif(pairs.containsKey(k1))\n\t\t\t\tif(pairs.get(k1).contains(k2))\n\t\t\t\t\treturn 2;\n\t\t\t\telse\n\t\t\t\t\treturn 1;\n\t\t\n\t\treturn 0;\n\t}", "public List<Integer> selectRangeWherePar(byte[][] selectCols, byte[] whereCol, long value1, long value2, ResultSet result){\n List<Integer> oidList = new ArrayList<Integer>();\n \n //assuming the where col is in type LONG\n boolean[] access = new boolean[keyForLong.length];\n int whereIndex = -1;\n \n for(int i = 0; i < keyForLong.length; i++){\n if(keyForLong[i].equals( new String(whereCol) + separator + \"LONG\" )) whereIndex = i;\n \n access[i] = false;\n for(int j = 0; j < selectCols.length; j++){\n if(keyForLong[i].equals( new String(selectCols[j]) + separator + \"LONG\" )){\n access[i] = true;\n break;\n }\n }\n }\n \n int numOfFields = keyForLong.length;\n for(int i = 0; i < numObject; i++){\n //first check if this object meet the where condition\n long value = longValues[i*numOfFields + whereIndex];\n if( (value >= value1) && (value <= value2)){\n //this object meets condition\n int oid=objectIds[i];\n oidList.add(oid);\n \n //select fields in the select clause\n for(int j = 0; j < access.length; j++){\n if(access[j]){\n String key = keyForLong[j];\n if(j == whereIndex){\n result.addLong(key, oid, value);\n continue;\n }\n long longnum = longValues[i*numOfFields + j];\n if(longnum != UNDEFINED)\n result.addLong(key, oid, longnum);\n }\n }\n }\n }\n \n if(oidList.size() > 0){\n //if this partition also has other data types, also select those based on oidList\n if(keyForString.length != 0)\n selectConditionString(oidList, selectCols, result);\n if(keyForDouble.length != 0)\n selectConditionDouble(oidList, selectCols, result);\n if(keyForBool.length != 0)\n selectConditionBool(oidList, selectCols, result);\n }\n return oidList;\n }", "public boolean containsAll(String c) {\r\n int[] elements = new int[(c.length() / 2) + 1];\r\n for (int i = 0; i < elements.length; i++) {\r\n elements[i] = Integer.parseInt(c.substring(0, c.indexOf(\",\")));\r\n if (!contains(elements[i])) {\r\n return false;\r\n }\r\n c = c.substring((c.indexOf(\",\") + 1));\r\n }\r\n return true;\r\n }", "@Test\n void shouldBeInsideMap()\n {\n assertTrue(map.isInsideMap(new Vector2(0,0)));\n\n assertTrue(map.isInsideMap(new Vector2(4,0)));\n\n assertTrue(map.isInsideMap(new Vector2(4,4)));\n\n assertTrue(map.isInsideMap(new Vector2(1,3)));\n }", "Multimap<String, String> intersects(PointLatLng point);", "@Test\n public void testContainsAll_Contains() {\n\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>();\n instance.add(3);\n instance.add(2);\n instance.add(1);\n instance.add(4);\n\n Collection c = Arrays.asList(1, 2, 3);\n\n boolean expResult = true;\n boolean result = instance.containsAll(c);\n assertEquals(expResult, result);\n }", "public static void main (String[] args) {\n System.out.println(findIntersection(new String[] {\"1, 3, 4, 7, 13\", \"1, 2, 4, 13, 15\"})); \n System.out.println(findIntersection(new String[] {\"2, 3, 4\", \"3\"})); \n System.out.println(findIntersection(new String[] {\"1, 5, 6, 7, 10, 11, 12\", \"5, 6, 8, 11, 17\"})); \n System.out.println(findIntersection(new String[] {\"1, 2, 3, 4, 5\", \"6, 7, 8, 9, 10\"})); \n System.out.println(findIntersection(new String[] {\"1, 2, 4, 5, 6, 9\", \"2, 3, 4, 8, 10\"})); \n System.out.println(findIntersection(new String[] {\"21, 22, 23, 25, 27, 28\", \"21, 24, 25, 29\"})); \n }", "public void compareWithinClusters() {\n\t\tList<Cluster> clusterList = clusterDao.getClusterList();\n\n\t\tfor (Cluster cluster : clusterList) {\n\t\t\tList<Document> docList = documentDao.getDocListByClusterId(cluster.getId());\n\t\t\tint size = docList.size();\n\t\t\t\n\t\t\tdouble[][] matrix = new double[size][size];\n\t\t\t\n\t\t\tfor(int i =0; i<size; i++){\n\t\t\t\tmatrix[i][i] = 1;\n\t\t\t\tmatrix[i][i] = 1;\n\t\t\t}\n\t\t\t\n\t\t\tif (size > 1) {\n\t\t\t\t//List<Document> docList2 = docList1;\n\t\t\t\tfor (int i=0; i<size; i++){\n\t\t\t\t\tfor(int j=i+1; j<size; j++){\n\t\t\t\t\t\t//match docs docList.get(i) & docList.get(j)\n\t\t\t\t\t\tMap<String, Double> map = datumboxCaller.compareDocs(docList.get(i).getDocName(), docList.get(j).getDocName());\n\t\t\t\t\t\tmatrix[i][j] = map.get(\"Oliver\");\n\t\t\t\t\t\tmatrix[j][i] = map.get(\"Shingle\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//persist both metrics in a file \n\t\t\tpersist(matrix, cluster, docList);\n\t\t\t\n\t\t\t//printing the matrix\n\t\t\tSystem.out.println(\"\\nDocument Similarity Matrix for Cluster \"+cluster.getId());\n\t\t\tSystem.out.println(\"\\nOliver Metric\");\n\t\t\tSystem.out.print(\"id\");\n\t\t\tfor(int i=0; i<size; i++)\n\t\t\t\tSystem.out.print(\"\\t\"+docList.get(i).getId());\n\t\t\t\n\t\t\tfor(int i=0; i<size; i++){\n\t\t\t\tSystem.out.println(docList.get(i).getId());\n\t\t\t\tfor(int j=0; j<size; j++){\n\t\t\t\t\tSystem.out.print(\"\\t\");\n\t\t\t\t\tif(j>=i)\n\t\t\t\t\t\tSystem.out.print(matrix[i][j]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(\"\\nShingle Metric\");\n\t\t\tSystem.out.print(\"id\");\n\t\t\tfor(int i=0; i<size; i++)\n\t\t\t\tSystem.out.print(\"\\t\"+docList.get(i).getId());\n\t\t\t\n\t\t\tfor(int i=0; i<size; i++){\n\t\t\t\tSystem.out.print(\"\\n\"+docList.get(i).getId());\n\t\t\t\tfor(int j=0; j<size; j++){\n\t\t\t\t\tSystem.out.print(\"\\t\");\n\t\t\t\t\tif(j>=i)\n\t\t\t\t\t\tSystem.out.print(matrix[j][i]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t//print ends\n\t\t\t\n\t\t}\n\n\t}", "@Override\r\n\t\t\tpublic boolean matches(Object list) {\n\t\t\t\treturn ((List<String>) list).size() == 2;\r\n\t\t\t}", "@Override\r\n\t\t\tpublic boolean matches(Object list) {\n\t\t\t\treturn ((List<String>) list).size() == 2;\r\n\t\t\t}", "@Override\r\n\t\t\tpublic boolean matches(Object list) {\n\t\t\t\treturn ((List<String>) list).size() == 2;\r\n\t\t\t}", "@Override\r\n\t\t\tpublic boolean matches(Object list) {\n\t\t\t\treturn ((List<String>) list).size() == 2;\r\n\t\t\t}", "@Override\r\n\t\t\tpublic boolean matches(Object list) {\n\t\t\t\treturn ((List<String>) list).size() == 2;\r\n\t\t\t}", "@Override\r\n\t\t\tpublic boolean matches(Object list) {\n\t\t\t\treturn ((List<String>) list).size() == 2;\r\n\t\t\t}", "public void sensibleMatches2() \n { \n Map<String, Set<String>> clientMap = new HashMap<>();\n Set<String> interests = new HashSet<>();\n\n interests.add(\"Food\");\n interests.add(\"Wine\");\n interests.add(\"Tandems\");\n clientMap.put(\"Hal\", interests);\n\t \n interests = new HashSet<>();\n interests.add(\"Food\");\n interests.add(\"Walking\");\n interests.add(\"Welding\");\n clientMap.put(\"Gemma\", interests);\n\n interests = new HashSet<>();\n interests.add(\"Food\");\n interests.add(\"Cinema\");\n interests.add(\"Wine\");\n clientMap.put(\"Caroline\", interests);\n\n Set<String> halsInterests = clientMap.get(\"Hal\");\n String outputString;\n Set<String> eachClientInterests;\n Set<String> intersection ;\n\n for (String eachClient : clientMap.keySet()) \n {\n if (!eachClient.equals(\"Hal\")) \n {\n eachClientInterests = clientMap.get(eachClient);\n intersection = new HashSet<>(halsInterests);\n intersection.retainAll(eachClientInterests);\n outputString = \"Hal and \" + eachClient \n + \" have common interests: \"\n + intersection;\n System.out.println(outputString);\n }\n }\n }", "public void execute_multipleParameterPredicate_test(int expectedNum, String userInput, String parameter,\n boolean isIgnoreCase, boolean isAnd,\n List<Person> expectedList) throws ParseException {\n String expectedMessage = String.format(MESSAGE_PERSONS_LISTED_OVERVIEW, expectedNum);\n ContainsKeywordsPredicate predicate = prepareMultiPredicate(isIgnoreCase, isAnd, userInput, parameter);\n PatientFindCommand command = new PatientFindCommand(predicate);\n expectedModel.updateFilteredPersonList(predicate);\n assertCommandSuccess(command, model, commandHistory, expectedMessage, expectedModel);\n assertEquals(expectedList, model.getFilteredPersonList());\n }", "public void decideCluster(){\n\tdouble shortest = 1000000;\n\tfor(int i = 0; i < clusterDist.length; i++)\n\t{\n\t\tif(clusterDist[i] < shortest)\n\t\t{\tshortest = clusterDist[i];\n\t\t\tthis.clusterid = i;\n\t\t}\n\t\t\n\t}\n}", "void findMatchings(boolean isProtein) {\n\n GraphDatabaseFactory dbFactory = new GraphDatabaseFactory();\n HashSet<String > searchSpaceList = new HashSet<>();\n GraphDatabaseService databaseService = dbFactory.newEmbeddedDatabase(graphFile);\n for (int id: queryGraphNodes.keySet()) {\n if(isProtein)\n searchSpaceList.add(queryGraphNodes.get(id).label);\n else\n searchSpaceList.add(String.valueOf(queryGraphNodes.get(id).labels.get(0)));\n }\n for(String x: searchSpaceList) {\n ResourceIterator<Node> xNodes;\n try(Transaction tx = databaseService.beginTx()) {\n xNodes = databaseService.findNodes(Label.label(x));\n tx.success();\n }\n\n while (xNodes.hasNext()) {\n Node node = xNodes.next();\n if (searchSpaceProtein.containsKey(x))\n searchSpaceProtein.get(x).add(node.getId());\n else {\n HashSet<Long> set = new HashSet<>();\n set.add(node.getId());\n searchSpaceProtein.put(x, set);\n }\n }\n\n }\n\n if(isProtein)\n search(0, databaseService, true);\n else\n search(0, databaseService, false);\n databaseService.shutdown();\n }", "public void sensibleMatches1() \n { \n Map<String, Set<String>> clientMap = new HashMap<>();\n Set<String> interests = new HashSet<>();\n\n interests.add(\"Food\");\n interests.add(\"Wine\");\n interests.add(\"Tandems\");\n clientMap.put(\"Hal\", interests);\n\t \n interests = new HashSet<>();\n interests.add(\"Food\");\n interests.add(\"Walking\");\n interests.add(\"Welding\");\n clientMap.put(\"Gemma\", interests);\n\t \n interests = new HashSet<>();\n interests.add(\"Food\");\n interests.add(\"Cinema\");\n interests.add(\"Wine\");\n clientMap.put(\"Caroline\", interests);\n\n Set<String> halsInterests = clientMap.get(\"Hal\");\n String outputString;\n Set<String> eachClientInterests;\n Set<String> intersection ;\n\n Map<String, Set<String>> mapWithoutHal = new HashMap<>(clientMap);\n mapWithoutHal.remove(\"Hal\");\n for (String eachClient : mapWithoutHal.keySet()) \n {\n eachClientInterests = clientMap.get(eachClient);\n intersection = new HashSet<>(halsInterests);\n intersection.retainAll(eachClientInterests);\n outputString = \"Hal and \" + eachClient \n + \" have common interests: \"\n + intersection;\n System.out.println(outputString);\n }\n }", "public boolean checkIfCompleteSearchRowExists(int i, int n, int m, int k, String distribution) throws SQLException {\n String sql = \"SELECT * FROM complete_search_singleminded WHERE i = ? AND n = ? AND m = ? AND k = ? AND distribution = ?\";\n PreparedStatement preparedStatement = (PreparedStatement) this.getConn().prepareStatement(sql);\n preparedStatement.setInt(1, i);\n preparedStatement.setInt(2, n);\n preparedStatement.setInt(3, m);\n preparedStatement.setInt(4, k);\n preparedStatement.setString(5, distribution);\n return ((ResultSet) preparedStatement.executeQuery()).next();\n }", "public boolean isIntersection( Set<String> a, Set<String> b ) {\n\t\tfor ( String v1 : a ) {\n\t\t\tif ( b.contains( v1 ) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "@Test\n public void testBoundsAsCompositesWithMultiEqRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n Restriction eq = newMultiEq(cfMetaData, 0, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n }", "@Test\n \tpublic void whereClauseForNodeSameSpan() {\n \t\tnode23.addJoin(new SameSpan(node42));\n \t\tcheckWhereCondition(\n \t\t\t\tjoin(\"=\", \"_node23.text_ref\", \"_node42.text_ref\"),\n \t\t\t\tjoin(\"=\", \"_node23.left\", \"_node42.left\"),\n \t\t\t\tjoin(\"=\", \"_node23.right\", \"_node42.right\")\n \t\t);\n \t}", "@Test\n public void testBoundsAsCompositesWithSliceRestrictionsAndOneDescendingClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newSingleSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newSingleSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n }", "public boolean contains(Interest i);", "public boolean matches(String value) {\n\t\treturn value != null && splitValue(value).length == columns.size() + 1 \n\t\t\t\t&& id.equals(splitValue(value)[0]);\n\t}", "void checkIntervalConv(\n String sql,\n String expected);", "@Test\n public void testMultipleLabelsWithAndOperatorCriteria() throws Exception {\n JobQueryCriteria<TitusTaskState, TitusJobType> query = queryBuilder.withLabels(\n expectedLabels().with(\"labelA\").with(\"labelB\").build()\n ).withLabelsAndOp(true).build();\n\n assertThat(JobQueryCriteriaEvaluator.matches(job, query)).isTrue();\n\n // One of the labels is missing\n JobQueryCriteria<TitusTaskState, TitusJobType> query2 = queryBuilder.withLabels(\n expectedLabels().with(\"labelB\").with(\"missing_label\").build()\n ).withLabelsAndOp(true).build();\n\n assertThat(JobQueryCriteriaEvaluator.matches(job, query2)).isFalse();\n }", "@Test\n \tpublic void whereClauseForNodeInclusion() {\n \t\tnode23.addJoin(new Inclusion(node42));\n \t\tcheckWhereCondition(\n \t\t\t\tjoin(\"=\", \"_node23.text_ref\", \"_node42.text_ref\"),\n \t\t\t\tjoin(\"<=\", \"_node23.left\", \"_node42.left\"),\n \t\t\t\tjoin(\">=\", \"_node23.right\", \"_node42.right\")\n \t\t);\n \t}", "private boolean contains(ArrayList<int[]> list, int[] element) {\n for (int[] temp : list) {\n if (temp[0] == element[0] && temp[1] == element[1]) {\n return true;\n }\n }\n return false;\n }", "public boolean containsSoldier(Soldier test, ArrayList<Soldier> gamePiece){\n for (int i=0;i<gamePiece.size();i++)\n if(test.i == gamePiece.get(i).i && test.j == gamePiece.get(i).j && test.C.equals(gamePiece.get(i).C))\n return true;\n return false;\n }", "boolean isTwoPair();", "@Test\n public void testIntersection1()\n {\n final int[] ints1 = {33, 100000};\n final int[] ints2 = {33, 100000};\n List<Integer> expected = Arrays.asList(33, 100000);\n\n ConciseSet set1 = new ConciseSet();\n for (int i : ints1) {\n set1.add(i);\n }\n ConciseSet set2 = new ConciseSet();\n for (int i : ints2) {\n set2.add(i);\n }\n\n verifyIntersection(expected, set1, set2);\n }", "boolean contains(SimpleFeature feature);" ]
[ "0.55134296", "0.5277081", "0.5206049", "0.5164937", "0.5151129", "0.5130439", "0.49877012", "0.49743792", "0.49434733", "0.49287423", "0.4918437", "0.49025583", "0.4889417", "0.48695078", "0.48301366", "0.48156768", "0.47719947", "0.47314805", "0.47260517", "0.47125053", "0.46611124", "0.46546894", "0.46426627", "0.46426108", "0.46385095", "0.4636937", "0.46340638", "0.46218315", "0.4605215", "0.4573867", "0.4562507", "0.45376763", "0.45359588", "0.45152572", "0.44914788", "0.44908273", "0.44881076", "0.44811532", "0.44495267", "0.44448054", "0.44193265", "0.4415358", "0.44116586", "0.4382198", "0.43808454", "0.4380559", "0.43803963", "0.43669242", "0.43669152", "0.43554175", "0.434804", "0.43454063", "0.43447706", "0.43340015", "0.43318674", "0.43292272", "0.43257666", "0.43140298", "0.43096226", "0.4305549", "0.4288751", "0.42848223", "0.42750642", "0.42715403", "0.42683983", "0.4266338", "0.42639455", "0.4257323", "0.4254031", "0.42529824", "0.42474684", "0.4245879", "0.42450252", "0.42435685", "0.42427775", "0.42427775", "0.42427775", "0.42427775", "0.42427775", "0.42427775", "0.42425224", "0.42391646", "0.4236164", "0.42300498", "0.4225499", "0.42252547", "0.4207188", "0.42051706", "0.42050356", "0.4190851", "0.41880354", "0.41862294", "0.418272", "0.41797972", "0.41769856", "0.41758144", "0.41752407", "0.41740933", "0.41722366", "0.41671312" ]
0.45906082
29
Test multicolumn slice restrictions (e.g '(clustering_0) > (1)') with only one clustering column
@Test public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneClusteringColumn() { CFMetaData cfMetaData = newCFMetaData(Sort.ASC); ByteBuffer value1 = ByteBufferUtil.bytes(1); ByteBuffer value2 = ByteBufferUtil.bytes(2); Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1); PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(slice); List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value1, EOC.END); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertEmptyComposite(bounds.get(0)); slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1); restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(slice); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value1, EOC.NONE); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertEmptyComposite(bounds.get(0)); slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1); restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(slice); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertEmptyComposite(bounds.get(0)); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value1, EOC.END); slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1); restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(slice); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertEmptyComposite(bounds.get(0)); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value1, EOC.START); slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1); Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2); restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(slice).mergeWith(slice2); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value1, EOC.END); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value2, EOC.START); slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1); slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2); restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(slice).mergeWith(slice2); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value1, EOC.NONE); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value2, EOC.END); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithTwoClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneAscendingAndOneDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n assertComposite(bounds.get(2), value2, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertComposite(bounds.get(1), value2, EOC.START);\n assertComposite(bounds.get(2), value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneDescendingAndOneAscendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0) > (1) AND (clustering_0, clustering1) < (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.END);\n assertComposite(bounds.get(2), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.END);\n assertComposite(bounds.get(1), value1, EOC.START);\n assertComposite(bounds.get(2), value1, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithTwoAscendingAndTwoDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.DESC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertEmptyComposite(bounds.get(1));\n\n // clustering_0 = 1 AND (clustering_1, clustering_2, clustering_3) > (2, 3, 4)\n Restriction eq = newSingleEq(cfMetaData, 0, value1);\n slice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n restrictions = restrictions.mergeWith(eq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2, clustering_3) > (2, 3, 4)\n Restriction in = newSingleIN(cfMetaData, 0, value1, value2);\n slice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n restrictions = restrictions.mergeWith(in);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n assertComposite(bounds.get(2), value2, value2, EOC.START);\n assertComposite(bounds.get(3), value2, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n assertComposite(bounds.get(2), value2, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(3), value2, EOC.END);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1, clustering_2, clustering_3) <= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) < (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4) AND (clustering_0, clustering_1) < (2, 3)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2, value3);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(1), value2, value3, EOC.START);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4) AND (clustering_0, clustering1, clustering_2, clustering_3) <= (4, 3, 2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value4, value3, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n assertComposite(bounds.get(2), value4, value3, value2, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(1), value4, value3, EOC.START);\n assertComposite(bounds.get(2), value4, value3, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsMixingAscendingDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.DESC, Sort.ASC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(3));\n\n // clustering_0 = 1 AND (clustering_1, clustering_2, clustering_3) > (2, 3, 4)\n Restriction eq = newSingleEq(cfMetaData, 0, value1);\n slice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n restrictions = restrictions.mergeWith(eq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(3));\n\n\n // (clustering_0, clustering1, clustering_2, clustering_3) <= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, value4, EOC.NONE);\n assertComposite(bounds.get(3), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) < (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(3), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4) AND (clustering_0, clustering_1) < (2, 3)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2, value3);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(5, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n assertComposite(bounds.get(4), value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(5, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertComposite(bounds.get(3), value2, EOC.START);\n assertComposite(bounds.get(4), value2, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4) AND (clustering_0, clustering1, clustering_2, clustering_3) <= (4, 3, 2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value4, value3, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(7, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n assertComposite(bounds.get(4), value4, value3, EOC.START);\n assertComposite(bounds.get(5), value4, value3, value2, value1, EOC.NONE);\n assertComposite(bounds.get(6), value4, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(7, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertComposite(bounds.get(3), value4, EOC.START);\n assertComposite(bounds.get(4), value4, value3, value2, EOC.START);\n assertComposite(bounds.get(5), value4, value3, value2, EOC.END);\n assertComposite(bounds.get(6), value4, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithTwoDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithSliceRestrictionsAndOneClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newSingleSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newSingleSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiEqAndSingleSliceRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n\n // (clustering_0, clustering_1) = (1, 2) AND clustering_2 > 3\n Restriction multiEq = newMultiEq(cfMetaData, 0, value1, value2);\n Restriction singleSlice = newSingleSlice(cfMetaData, 2, Bound.START, false, value3);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiEq).mergeWith(singleSlice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithSingleEqAndSliceRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n ByteBuffer value5 = ByteBufferUtil.bytes(5);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) > (2, 3)\n Restriction singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction multiSlice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiSlice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) > (2, 3) AND (clustering_1) < (4)\n singleEq = newSingleEq(cfMetaData, 0, value1);\n multiSlice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3);\n Restriction multiSlice2 = newMultiSlice(cfMetaData, 1, Bound.END, false, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiSlice2).mergeWith(singleEq).mergeWith(multiSlice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value4, EOC.START);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) => (2, 3) AND (clustering_1, clustering_2) <= (4, 5)\n singleEq = newSingleEq(cfMetaData, 0, value1);\n multiSlice = newMultiSlice(cfMetaData, 1, Bound.START, true, value2, value3);\n multiSlice2 = newMultiSlice(cfMetaData, 1, Bound.END, true, value4, value5);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiSlice2).mergeWith(singleEq).mergeWith(multiSlice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value4, value5, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneDescendingClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithSliceRestrictionsAndOneDescendingClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newSingleSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newSingleSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithOneEqRestrictionsAndOneClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC);\n\n ByteBuffer clustering_0 = ByteBufferUtil.bytes(1);\n Restriction eq = newSingleEq(cfMetaData, 0, clustering_0);\n\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithOneEqRestrictionsAndTwoClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer clustering_0 = ByteBufferUtil.bytes(1);\n Restriction eq = newSingleEq(cfMetaData, 0, clustering_0);\n\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithSingleEqAndMultiEqRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) = (2, 3)\n Restriction singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction multiEq = newMultiEq(cfMetaData, 1, value2, value3);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiEq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n // clustering_0 = 1 AND clustering_1 = 2 AND (clustering_2, clustering_3) = (3, 4)\n singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction singleEq2 = newSingleEq(cfMetaData, 1, value2);\n multiEq = newMultiEq(cfMetaData, 2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(singleEq2).mergeWith(multiEq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n\n // (clustering_0, clustering_1) = (1, 2) AND clustering_2 = 3\n singleEq = newSingleEq(cfMetaData, 2, value3);\n multiEq = newMultiEq(cfMetaData, 0, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiEq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) = (2, 3) AND clustering_3 = 4\n singleEq = newSingleEq(cfMetaData, 0, value1);\n singleEq2 = newSingleEq(cfMetaData, 3, value4);\n multiEq = newMultiEq(cfMetaData, 1, value2, value3);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiEq).mergeWith(singleEq2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n }", "private static Restriction newMultiSlice(CFMetaData cfMetaData, int firstIndex, Bound bound, boolean inclusive, ByteBuffer... values)\n {\n List<ColumnDefinition> columnDefinitions = new ArrayList<>();\n for (int i = 0; i < values.length; i++)\n {\n columnDefinitions.add(getClusteringColumnDefinition(cfMetaData, i + firstIndex));\n }\n return new MultiColumnRestriction.Slice(columnDefinitions, bound, inclusive, toMultiItemTerminal(values));\n }", "private boolean isSubsetOf(int firstRow, int secondRow) {\n for (int i = 0; i < universalSetSize; i++) {\n if (input[firstRow][i] && !input[secondRow][i]) {\n return false;\n }\n }\n return true;\n }", "@Test\n public void testBoundsAsCompositesWithOneInRestrictionsAndOneClusteringColumn()\n {\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n Restriction in = newSingleIN(cfMetaData, 0, value1, value2, value3);\n\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(in);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.START);\n assertComposite(bounds.get(2), value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n assertComposite(bounds.get(1), value2, EOC.END);\n assertComposite(bounds.get(2), value3, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithEqAndSliceRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n\n Restriction eq = newSingleEq(cfMetaData, 0, value3);\n\n Restriction slice = newSingleSlice(cfMetaData, 1, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 1, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 1, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 1, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 1, Bound.START, false, value1);\n Restriction slice2 = newSingleSlice(cfMetaData, 1, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value2, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 1, Bound.START, true, value1);\n slice2 = newSingleSlice(cfMetaData, 1, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithSingleEqAndMultiINRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n ByteBuffer value5 = ByteBufferUtil.bytes(5);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) IN ((2, 3), (4, 5))\n Restriction singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction multiIN = newMultiIN(cfMetaData, 1, asList(value2, value3), asList(value4, value5));\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiIN);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(1), value1, value4, value5, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(1), value1, value4, value5, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) IN ((2, 3))\n singleEq = newSingleEq(cfMetaData, 0, value1);\n multiIN = newMultiIN(cfMetaData, 1, asList(value2, value3));\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiIN).mergeWith(singleEq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n // clustering_0 = 1 AND clustering_1 = 5 AND (clustering_2, clustering_3) IN ((2, 3), (4, 5))\n singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction singleEq2 = newSingleEq(cfMetaData, 1, value5);\n multiIN = newMultiIN(cfMetaData, 2, asList(value2, value3), asList(value4, value5));\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiIN).mergeWith(singleEq2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value5, value2, value3, EOC.START);\n assertComposite(bounds.get(1), value1, value5, value4, value5, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value5, value2, value3, EOC.END);\n assertComposite(bounds.get(1), value1, value5, value4, value5, EOC.END);\n }", "private static Restriction newSingleSlice(CFMetaData cfMetaData, int index, Bound bound, boolean inclusive, ByteBuffer value)\n {\n ColumnDefinition columnDef = getClusteringColumnDefinition(cfMetaData, index);\n return new SingleColumnRestriction.Slice(columnDef, bound, inclusive, toTerm(value));\n }", "@Test\n public void whereNormalColumn() throws Exception {\n String sql = \"desc verbose select k1, e1 from db1.tbl1 lateral view explode_split(k2, \\\",\\\") tmp as e1 \"\n + \"where k1=1; \";\n String explainString = UtFrameUtils.getSQLPlanOrErrorMsg(ctx, sql, true);\n Assert.assertTrue(explainString.contains(\"1:TABLE FUNCTION NODE\"));\n Assert.assertTrue(explainString.contains(\"table function: explode_split(`k2`, ',')\"));\n Assert.assertTrue(explainString.contains(\"tuple ids: 0 1\"));\n Assert.assertTrue(explainString.contains(\"TupleDescriptor{id=1, tbl=tmp, byteSize=32, materialized=true}\"));\n Assert.assertTrue(explainString.contains(\"SlotDescriptor{id=1, col=e1, type=VARCHAR(*)}\"));\n Assert.assertTrue(explainString.contains(\"0:OlapScanNode\"));\n Assert.assertTrue(explainString.contains(\"PREDICATES: `k1` = 1\"));\n }", "public void testFilterOnAggregationColumn() throws Exception {\n \t\tccName = new String[] { \"cc1\", \"cc2\", \"cc3\" };\n \t\tccExpr = new String[] { \"row.COL0+row.COL1\",\n \t\t\t\t\"Total.runningSum(row.cc1,row.COL0==0,0)\",\n \t\t\t\t\"Total.runningSum(row.cc1,row.COL0>0,0)\" };\n \n \t\tfor (int i = 0; i < ccName.length; i++) {\n \t\t\tComputedColumn computedColumn = new ComputedColumn(ccName[i],\n \t\t\t\t\tccExpr[i], DataType.ANY_TYPE);\n \t\t\t((BaseDataSetDesign) this.dataSet)\n \t\t\t\t\t.addComputedColumn(computedColumn);\n \t\t}\n \n \t\tString[] bindingNameRow = new String[7];\n \t\tbindingNameRow[0] = \"ROW_COL0\";\n \t\tbindingNameRow[1] = \"ROW_COL1\";\n \t\tbindingNameRow[2] = \"ROW_COL2\";\n \t\tbindingNameRow[3] = \"ROW_COL3\";\n \t\tbindingNameRow[4] = \"ROW_cc1\";\n \t\tbindingNameRow[5] = \"ROW_cc2\";\n \t\tbindingNameRow[6] = \"ROW_cc3\";\n \t\tScriptExpression[] bindingExprRow = new ScriptExpression[] {\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL0\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL1\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL2\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL3\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + ccName[0], 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + ccName[1], 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + ccName[2], 0) };\n \n \t\tIResultIterator resultIt = this.executeQuery(this.createQuery(null,\n \t\t\t\tnull, null, null, null, null, null, null, null, bindingNameRow,\n \t\t\t\tbindingExprRow));\n \n \t\tprintResult(resultIt, bindingNameRow, bindingExprRow);\n \t\t// assert\n \t\tcheckOutputFile();\n \n \t}", "@Test\n public void testOverlappingPartitionsOverlappingClusters()\n {\n check(overlappingClustersWithOverlappingPartitions(), 0.75, 1.0);\n }", "@Test\n public void testHardClustersWithOverlappingPartitions()\n {\n check(hardClustersWithOverlappingPartitions(), 0.0, 1.0);\n }", "private boolean checkRowCol(int c1, int c2, int c3) \r\n {\r\n return ((c1 != -1) && (c1 == c2) && (c2 == c3)); //eida ekhon porjonto kaaj e lage nai\r\n }", "boolean hasPermissionOfCluster(String clusterId, String userName);", "private boolean isSubsetOf(List<String> permissions2,\n\t\t\tList<String> permissions3) {\n\t\treturn false;\n\t}", "private boolean subGridCheck() {\n\t\tint sqRt = (int)Math.sqrt(dimension);\n\t\tfor(int i = 0; i < sqRt; i++) {\n\t\t\tint increment = i * sqRt;\n\t\t\tfor(int val = 1; val <= dimension; val++) {\n\t\t\t\tint valCounter = 0;\n\t\t\t\tfor(int row = 0 + increment; row < sqRt + increment; row++) {\n\t\t\t\t\tfor(int col = 0 + increment; col < sqRt + increment; col++) {\n\t\t\t\t\t\tif(puzzle[row][col] == val)\n\t\t\t\t\t\t\tvalCounter++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(valCounter >= 2)\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "@Nullable\n public abstract GridAxis subset(GridSubset params, Formatter errlog);", "private Object isValidColumnVector(List<List<Double>> vector) {\n\t\tInteger nrows = vector.size();\n\n\t\tList<Integer> rowLengths = vector.stream().map(List::size).toList();\n\t\tInteger ncols = rowLengths.stream().mapToInt(Integer::intValue).sum() / rowLengths.size();\n\n\t\treturn (nrows == 3) && (ncols == 1);\n\t}", "public boolean isSetNumClusteringCols() {\n return EncodingUtils.testBit(__isset_bitfield, __NUMCLUSTERINGCOLS_ISSET_ID);\n }", "public boolean percolates()\r\n { return uf.find(0) == uf.find(dimension*dimension + 1); }", "public interface IStoppingCriteria {\n\n /**\n * Determine the degree of clustering agreement\n * @param cluster1 one clustering results\n * @param cluster2 the other clustering results\n * @return the degree of clustering agreement; 1 refers to be the same clustering results; 0 refers to be the totally different clustering results\n */\n public double computeSimilarity(int[] cluster1, int[] cluster2);\n\n}", "@Test\n\t public void test_Is_Subset_Positive() throws Exception{\t\n\t\t SET setarray= new SET( new int[]{1,2,3,4,5});\n\t\t SET subsetarray= new SET( new int[]{1,2,3});\n\t\t assertTrue(setarray.isSubSet(subsetarray));\t \n\t }", "boolean hasCluster();", "private boolean checkColoumnForQuadPair(int j1) {\n for(int i=0;i<4;i++)\r\n {\r\n if(Kmap[i][j1]==0 || Kmap[i][j1]==-1)\r\n return false;\r\n }\r\n for(int i=0;i<4;i++)\r\n {\r\n Kmap[i][j1]=-1;\r\n }\r\n return true; \r\n }", "boolean getIsClusteringKey();", "Boolean isCollinearTo(IVec3 v);", "@Test\n\tpublic void testEliminationByColumn(){\n\t\tsetBoardUp();\n\t\tColumn col = new Column(board, 1);\n\t\tint[] toBeRemoved = {1, 3, 4};\n\t\tint[] fromCesll = {1, 2, 3, 5, 6, 8};\n\t\talgorithm.applyEliminationInColumn(col);\n\t\tboolean condition = true;\n\t\tfor(int i = 0; i < toBeRemoved.length; i++)\n\t\t\tfor(int j = 0; j < fromCesll.length; j++)\n\t\t\t\tcondition &= !col.cell[fromCesll[j]].possibilities.contains(toBeRemoved[i]);\t\t\n\t\tassertTrue(condition);\n\t}", "protected void checkBox(int slice, int row, int column, int depth, int height, int width) {\n\tif (slice<0 || depth<0 || slice+depth>slices || row<0 || height<0 || row+height>rows || column<0 || width<0 || column+width>columns) throw new IndexOutOfBoundsException(toStringShort()+\", slice:\"+slice+\", row:\"+row+\" ,column:\"+column+\", depth:\"+depth+\" ,height:\"+height+\", width:\"+width);\n}", "private Boolean isValidColumnMatrix(SimpleMatrix matrix) {\n\t\tInteger nrows = matrix.numRows();\n\t\tInteger ncols = matrix.numCols();\n\n\t\treturn (ncols == 1) && (nrows == 3);\n\t}", "DataFrame<R,C> select(Predicate<DataFrameRow<R,C>> rowPredicate, Predicate<DataFrameColumn<R,C>> colPredicate);", "private boolean canSetSafelyDownColumn(MTreeNode row, MTreeNode col, UnionDoubleIntervals newVal) {\n\t\tMTreeNode rowKids[]=row.getChildren();\n\t\tif (rowKids.length==0) return true;\n\t\tUnionDoubleIntervals rowKidsInts[]=new UnionDoubleIntervals[rowKids.length];\n\t\tfor(int i=0; i<rowKids.length; i++) {\n\t\t\trowKidsInts[i]=get(rowKids[i], col);\n\t\t\tif (rowKidsInts[i]==null) {\n\t\t\t\t//If a sibling is null, I cannot check, so just return\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\tUnionDoubleIntervals sum=UnionDoubleIntervals.sum(rowKidsInts);\n\t\treturn newVal.intersects(sum);\n\t}", "@Test\n public void testPartitionColumnSelection() {\n Path filePath = new Path(\"hdfs:///w/x/y/z.csv\");\n ImplicitColumnManager implictColManager = new ImplicitColumnManager(\n fixture.getOptionManager(),\n standardOptions(filePath));\n\n String dir0 = ScanTestUtils.partitionColName(0);\n // Sic: case insensitivity, but name in project list\n // is preferred over \"natural\" name.\n String dir1 = \"DIR1\";\n String dir2 = ScanTestUtils.partitionColName(2);\n ScanLevelProjection scanProj = ScanLevelProjection.build(\n RowSetTestUtils.projectList(dir2, dir1, dir0, \"a\"),\n Lists.newArrayList(implictColManager.projectionParser()));\n\n assertEquals(4, scanProj.columns().size());\n assertEquals(dir2, scanProj.columns().get(0).name());\n assertEquals(dir1, scanProj.columns().get(1).name());\n assertEquals(dir0, scanProj.columns().get(2).name());\n assertEquals(\"a\", scanProj.columns().get(3).name());\n\n // Verify column type\n\n assertTrue(scanProj.columns().get(0) instanceof PartitionColumn);\n }", "public void checkBounds() {\n\t\tfor (int k = 0; k < numDataCols; k++) {\n\t\t\tDashDataType<?> dtype = dataTypes[k];\n\n\t\t\tif ( dtype instanceof StringDashDataType ) {\n\t\t\t\tStringDashDataType strtype = (StringDashDataType) dtype;\n\t\t\t\tfor (int j = 0; j < numSamples; j++) {\n\t\t\t\t\tADCMessage msg = strtype.boundsCheckStandardValue(\n\t\t\t\t\t\t\t\t\t\t\t(String) stdObjects[j][k]);\n\t\t\t\t\tif ( msg != null ) {\n\t\t\t\t\t\tmsg.setRowNumber(j+1);\n\t\t\t\t\t\tmsg.setColNumber(k+1);\n\t\t\t\t\t\tmsg.setColName(userColNames[k]);\n\t\t\t\t\t\tstdMsgList.add(msg);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if ( dtype instanceof CharDashDataType ) {\n\t\t\t\tCharDashDataType chartype = (CharDashDataType) dtype;\n\t\t\t\tfor (int j = 0; j < numSamples; j++) {\n\t\t\t\t\tADCMessage msg = chartype.boundsCheckStandardValue(\n\t\t\t\t\t\t\t\t\t\t\t(Character) stdObjects[j][k]);\n\t\t\t\t\tif ( msg != null ) {\n\t\t\t\t\t\tmsg.setRowNumber(j+1);\n\t\t\t\t\t\tmsg.setColNumber(k+1);\n\t\t\t\t\t\tmsg.setColName(userColNames[k]);\n\t\t\t\t\t\tstdMsgList.add(msg);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if ( dtype instanceof IntDashDataType ) {\n\t\t\t\tIntDashDataType inttype = (IntDashDataType) dtype;\n\t\t\t\tfor (int j = 0; j < numSamples; j++) {\n\t\t\t\t\tADCMessage msg = inttype.boundsCheckStandardValue(\n\t\t\t\t\t\t\t\t\t\t\t(Integer) stdObjects[j][k]);\n\t\t\t\t\tif ( msg != null ) {\n\t\t\t\t\t\tmsg.setRowNumber(j+1);\n\t\t\t\t\t\tmsg.setColNumber(k+1);\n\t\t\t\t\t\tmsg.setColName(userColNames[k]);\n\t\t\t\t\t\tstdMsgList.add(msg);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if ( dtype instanceof DoubleDashDataType ) {\n\t\t\t\tDoubleDashDataType dbltype = (DoubleDashDataType) dtype;\n\t\t\t\tfor (int j = 0; j < numSamples; j++) {\n\t\t\t\t\tADCMessage msg = dbltype.boundsCheckStandardValue(\n\t\t\t\t\t\t\t\t\t\t\t(Double) stdObjects[j][k]);\n\t\t\t\t\tif ( msg != null ) {\n\t\t\t\t\t\tmsg.setRowNumber(j+1);\n\t\t\t\t\t\tmsg.setColNumber(k+1);\n\t\t\t\t\t\tmsg.setColName(userColNames[k]);\n\t\t\t\t\t\tstdMsgList.add(msg);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthrow new IllegalArgumentException(\"unexpected data type encountered \" + \n\t\t\t\t\t\t\"in bounds checking: \" + dtype);\n\t\t\t}\n\t\t}\n\t}", "@Test\n\t public void test_Is_Subset_Negative() throws Exception{\t\n\t\t SET setarray= new SET( new int[]{1,2,3,4,5});\n\t\t SET subsetarray= new SET( new int[]{7,8});\n\t\t assertFalse(setarray.isSubSet(subsetarray));\t \n\t }", "boolean hasCol();", "@Test\r\n public void testIsSubset1() {\r\n Assert.assertEquals(false, set1.isSubset(set2));\r\n }", "List<Trueorfalse> selectByExample(RowBounds rowBounds);", "boolean isAllowClusterGet();", "@Test\n public void testHeterogeneousSegmentFilterConditionLimit() throws SqlParseException {\n\n val project = \"heterogeneous_segment\";\n // val dfId = \"747f864b-9721-4b97-acde-0aa8e8656cba\"\n // val seg1Id = \"8892fa3f-f607-4eec-8159-7c5ae2f16942\"\n // val seg2Id = \"d75a822c-788a-4592-a500-cf20186dded1\"\n // val seg3Id = \"54eaf96d-6146-45d2-b94e-d5d187f89919\"\n // val seg4Id = \"411f40b9-a80a-4453-90a9-409aac6f7632\"\n // val seg5Id = \"a8318597-cb75-416f-8eb8-96ea285dd2b4\"\n // \n val sql = \"with T1 as (select cal_dt, trans_id \\n\" + \"from test_kylin_fact inner join test_account \\n\"\n + \"on test_kylin_fact.seller_id = test_account.account_id \\n\"\n + \"where cal_dt between date'2012-01-01' and date'2012-01-03'\\n\" + \"group by cal_dt, trans_id)\\n\";\n\n {\n val sqlWithTooManyOrs = sql + \" select * from T1 where \" + \"(cal_dt='2012-01-01' and trans_id = 1) or \\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 2) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 3) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 4) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 5) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 6) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 7) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 8) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 9) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 10) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 12) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 13) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 14) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 15) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 16) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 17) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 18) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 19) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 20)\";\n val contexts = OlapContextTestUtil.getOlapContexts(project, sqlWithTooManyOrs);\n Assert.assertEquals(\n \">=(DEFAULT.TEST_KYLIN_FACT.CAL_DT, 2012-01-01),<=(DEFAULT.TEST_KYLIN_FACT.CAL_DT, 2012-01-03)\",\n contexts.get(0).getExpandedFilterConditions().stream().map(RexNode::toString)\n .collect(Collectors.joining(\",\")));\n }\n\n {\n val sqlWithFilter = sql + \" select * from T1 where \" + \"(cal_dt='2012-01-01' and trans_id = 1) or \\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 2) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 3) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 4) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 5) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 6) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 7) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 8) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 9) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 10)\";\n val contexts = OlapContextTestUtil.getOlapContexts(project, sqlWithFilter);\n Assert.assertNotEquals(\n \">=(DEFAULT.TEST_KYLIN_FACT.CAL_DT, 2012-01-01),<=(DEFAULT.TEST_KYLIN_FACT.CAL_DT, 2012-01-03)\",\n contexts.get(0).getExpandedFilterConditions().stream().map(RexNode::toString)\n .collect(Collectors.joining(\",\")));\n }\n\n }", "@Test\n public void testBoundsAsCompositesWithMultiEqRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n Restriction eq = newMultiEq(cfMetaData, 0, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n }", "public abstract Optional<GridAxis> subsetDependent(GridAxis1D subsetIndAxis, Formatter errlog);", "boolean hasDimension();", "public boolean columnFull(int column);", "private static Restriction newMultiEq(CFMetaData cfMetaData, int firstIndex, ByteBuffer... values)\n {\n List<ColumnDefinition> columnDefinitions = new ArrayList<>();\n for (int i = 0; i < values.length; i++)\n {\n columnDefinitions.add(getClusteringColumnDefinition(cfMetaData, firstIndex + i));\n }\n return new MultiColumnRestriction.EQ(columnDefinitions, toMultiItemTerminal(values));\n }", "private int restrictSection(Message msg, String parameter) {\n int sec = Integer.parseInt(parameter);\n\n if(sec > 2) {\n MessageChannel ch = msg.getChannel();\n ch.sendMessage(\"`Error: Invalid query [section not 0-2]. Query terminated.`\").queue();\n return -1;\n }\n else if(sec == 2) {\n partTwo = true;\n upperProblem = 8;\n }\n\n return sec;\n }", "boolean hasClusterName();", "private boolean checkOverlap(int row, int col, int length){\n \tif(!inBounds(row,col)){\n \t\treturn false;\n \t}\n \tfor(int i = row; i < row + length; i++ ){\n\t\t\tfor(int j = col; j < col + length; j++){\n\t\t\t\tif(grid[i][col] == 1 || row + length >= 10)\n\t\t\t\t\treturn false;\n\t\t\t\tif(grid[row][j] == 1 || col + length >= 10)\n\t\t\t\t\treturn false;\n\t\t\t}\n \t\t\n \t}\n \treturn true;\n }", "public static boolean IS_SUBFEATURE(Feature a, int index_a, Feature b, int index_b) {\n\n boolean anotinb, bnotina;\n int i, ia, ib;\n\n if (index_a != index_b)\n Dataset.perror(\"Feature.class :: not the same feature (\" + index_a + \" != \" + index_b + \")\");\n if (!a.type.equals(b.type))\n Dataset.perror(\n \"Feature.class :: not the same type of feature (\" + a.type + \" != \" + b.type + \")\");\n\n if (IS_CONTINUOUS(a.type)) {\n if (a.dmin >= b.dmin) {\n if (a.dmax <= b.dmax) return true;\n else\n Dataset.perror(\n \"Feature.class :: inconsistency for subfeature check for : (\"\n + a.dmin\n + \", \"\n + a.dmax\n + \") subseteq (\"\n + b.dmin\n + \", \"\n + b.dmax\n + \") ? \");\n } else if (a.dmax < b.dmax)\n Dataset.perror(\n \"Feature.class :: inconsistency for subfeature check for : (\"\n + a.dmin\n + \", \"\n + a.dmax\n + \") subseteq (\"\n + b.dmin\n + \", \"\n + b.dmax\n + \") ? \");\n } else if (IS_INTEGER(a.type)) {\n if (a.imin >= b.imin) {\n if (a.imax <= b.imax) return true;\n else\n Dataset.perror(\n \"Feature.class :: inconsistency for subfeature check for : (\"\n + a.imin\n + \", \"\n + a.imax\n + \") subseteq (\"\n + b.imin\n + \", \"\n + b.imax\n + \") ? \");\n } else if (a.imax < b.imax)\n Dataset.perror(\n \"Feature.class :: inconsistency for subfeature check for : (\"\n + a.imin\n + \", \"\n + a.imax\n + \") subseteq (\"\n + b.imin\n + \", \"\n + b.imax\n + \") ? \");\n } else if (IS_NOMINAL(a.type)) {\n if (a.modalities == null) return true;\n else if (b.modalities != null) {\n anotinb = bnotina = false;\n ia = ib = -1;\n for (i = 0; i < a.modalities.size(); i++)\n if (!b.modalities.contains((String) a.modalities.elementAt(i))) {\n anotinb = true;\n ia = i;\n }\n for (i = 0; i < b.modalities.size(); i++)\n if (!a.modalities.contains((String) b.modalities.elementAt(i))) {\n bnotina = true;\n ib = i;\n }\n if ((anotinb) && (bnotina))\n Dataset.perror(\n \"Feature.class :: inconsistency for subfeature check for : \"\n + ((String) a.modalities.elementAt(ia))\n + \" not in b and \"\n + ((String) b.modalities.elementAt(ib))\n + \" not in a \");\n else if (!anotinb) return true;\n }\n } else Dataset.perror(\"Feature.class :: no Feature type for \" + a.type);\n\n return false;\n }", "public boolean isReviewed(int index) {\n if (index % 2 != 0) {\n index -= 1;\n }\n index = index / 2;\n if ( ( (Integer) clusters[index][3]).intValue() == 1) {\n return true;\n }\n else {\n return false;\n }\n }", "@Test\n void testSubset() throws IOException {\n Long expectedNumberOfVariables = 13L;\n Long expectedNumberOfCases = 24L; // aka the number of lines in the TAB file produced by the ingest plugin\n\n TabularDataIngest ingestResult;\n File file = getFile(\"csv/ingest/election_precincts.csv\");\n try (BufferedInputStream stream = new BufferedInputStream(new FileInputStream(file))) {\n CSVFileReader instance = createInstance();\n ingestResult = instance.read(Tuple.of(stream, file), null);\n }\n\n File generatedTabFile = ingestResult.getTabDelimitedFile();\n DataTable generatedDataTable = ingestResult.getDataTable();\n\n assertThat(generatedDataTable).isNotNull();\n assertThat(generatedDataTable.getDataVariables()).isNotNull();\n assertThat(generatedDataTable.getVarQuantity()).isEqualTo((long) generatedDataTable.getDataVariables().size());\n assertThat(generatedDataTable.getVarQuantity()).isEqualTo(expectedNumberOfVariables);\n assertThat(generatedDataTable.getCaseQuantity()).isEqualTo(expectedNumberOfCases);\n\n // And now let's try and subset the individual vectors\n // First, the \"continuous\" vectors (we should be able to read these as Double[]):\n int[] floatColumns = {2};\n\n Double[][] floatVectors = {\n { 1.0, 3.0, 4.0, 6.0, 7.0, 8.0, 11.0, 12.0, 76.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0 },\n };\n\n IngestDataProvider dataProvider = new InMemoryIngestDataProvider();\n dataProvider.initialize(generatedDataTable, generatedTabFile);\n\n int vectorCount = 0;\n for (int i : floatColumns) {\n // We'll be subsetting the column vectors one by one, re-opening the\n // file each time. Inefficient - but we don't care here.\n\n if (!generatedDataTable.getDataVariables().get(i).isIntervalContinuous()) {\n fail(\"Column \" + i + \" was not properly processed as \\\"continuous\\\"\");\n }\n\n Double[] columnVector = dataProvider.getDoubleColumn(i);\n\n assertThat(columnVector).isEqualTo(floatVectors[vectorCount++]);\n }\n\n // Discrete Numerics (aka, integers):\n int[] integerColumns = { 1, 4, 6, 7, 8, 9, 10, 11, 12 };\n\n Long[][] longVectors = {\n { 1L, 3L, 4L, 6L, 7L, 8L, 11L, 12L, 76L, 77L, 77L, 77L, 77L, 77L, 77L, 77L, 77L, 77L, 77L, 77L, 77L, 77L, 77L, 77L },\n { 1L, 2L, 3L, 4L, 5L, 11L, 13L, 15L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L },\n { 85729227L, 85699791L, 640323976L, 85695847L, 637089796L, 637089973L, 85695001L, 85695077L, 1111111L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L },\n { 205871733L, 205871735L, 205871283L, 258627915L, 257444575L, 205871930L, 260047422L, 262439738L, 1111111L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L },\n { 205871673L, 205871730L, 205871733L, 205872857L, 258627915L, 257444584L, 205873413L, 262439738L, 1111111L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L },\n { 25025000201L, 25025081001L, 25025000701L, 25025050901L, 25025040600L, 25025000502L, 25025040401L, 25025100900L, 1111111L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L },\n { 250250502002L, 250250502003L, 250250501013L, 250250408011L, 250250503001L, 250250103001L, 250250406002L, 250250406001L, 1111111L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L },\n { 250251011024001L, 250251011013003L, 250251304041007L, 250251011013006L, 250251010016000L, 250251011024002L, 250251001005004L, 250251002003002L, 1111111L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L },\n { 2109L, 2110L, 2111L, 2120L, 2121L, 2115L, 2116L, 2122L, 11111L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L }\n };\n\n vectorCount = 0;\n\n for (int i : integerColumns) {\n if (!generatedDataTable.getDataVariables().get(i).isIntervalDiscrete()\n || !generatedDataTable.getDataVariables().get(i).isTypeNumeric()) {\n fail(\"Column \" + i + \" was not properly processed as \\\"discrete numeric\\\"\");\n }\n\n Long[] columnVector = dataProvider.getLongColumn(i);\n\n assertThat(columnVector).isEqualTo(longVectors[vectorCount++]);\n }\n\n // And finally, Strings:\n int[] stringColumns = {0, 3, 5};\n\n String[][] stringVectors = {\n { \"Dog\", \"Squirrel\", \"Antelope\", \"Zebra\", \"Lion\", \"Gazelle\", \"Cat\", \"Giraffe\", \"Cat\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\" },\n { \"East Boston\", \"Charlestown\", \"South Boston\", \"Bronx\", \"Roslindale\", \"Mission Hill\", \"Jamaica Plain\", \"Hyde Park\", \"Fenway/Kenmore\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\" },\n { \"2-06\", \"1-09\", \"1-1A\", \"1-1B\", \"2-04\", \"3-05\", \"1-1C\", \"1-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", }\n };\n\n vectorCount = 0;\n\n for (int i : stringColumns) {\n if (!generatedDataTable.getDataVariables().get(i).isTypeCharacter()) {\n fail(\"Column \" + i + \" was not properly processed as a character vector\");\n }\n String[] columnVector = dataProvider.getStringColumn(i);\n\n assertThat(columnVector).isEqualTo(stringVectors[vectorCount++]);\n }\n }", "protected void checkSlice(int slice) {\n\tif (slice < 0 || slice >= slices) throw new IndexOutOfBoundsException(\"Attempted to access \"+toStringShort()+\" at slice=\"+slice);\n}", "public void testGetColumnIndex() {\n TaskSeriesCollection c = createCollection1();\n }", "private boolean inBounds(int row, int col){\n if (row > -1 && row < 120 && col > -1 && col < 160)\n return true;\n return false;\n }", "private boolean isSubset(List<ConceptLabel> outer, List<ConceptLabel> inner){\n\t\tfor(ConceptLabel in: inner){\n\t\t\tboolean c = false;\n\t\t\tfor(ConceptLabel l: outer){\n\t\t\t\tif(l.getText().equals(in.getText())){\n\t\t\t\t\tc = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(!c)\n\t\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "private void coverColumnsOfStarredZeroes( final int[] starsByCol, final int[] coveredCols )\n\t{\n\t\tfor ( int i = 0; i < starsByCol.length; i++ )\n\t\t{\n\t\t\tcoveredCols[ i ] = -1 == starsByCol[ i ] ? 0 : 1;\n\t\t}\n\t}", "public static ASTNode evaluateSlice(ASTNode compound_matrix, ArrayList<ASTNode> indices) {\n\t if(indices.size()==0) {\n\t assert !(compound_matrix instanceof CompoundMatrix || compound_matrix instanceof EmptyMatrix);\n\t return compound_matrix;\n\t }\n\t \n\t ASTNode sliceindex=indices.get(0);\n\t \n\t if(compound_matrix instanceof EmptyMatrix) {\n // Construct new matrix domain for empty matrix.\n // First get the matrix domain for compound_matrix (which is itself an empty matrix)\n ASTNode matdom=compound_matrix.getChild(0);\n \n // Get indices\n ArrayList<ASTNode> empty_idx=matdom.getChildren(3);\n \n assert empty_idx.size()==indices.size();\n \n for(int i=empty_idx.size()-1; i>=0; i--) {\n if(! indices.get(i).equals(new IntegerDomain(new Range(null, null)))) {\n // If indices.get(i) is a constant, remove that dimension. \n empty_idx.remove(i);\n }\n }\n \n return new EmptyMatrix(new MatrixDomain(compound_matrix.getChild(0).getChild(0), // get original base domain. \n empty_idx));\n }\n\t \n // Must be a compound matrix from here on. \n if(sliceindex.isSet()) {\n assert ! sliceindex.isFiniteSetUpper() && ! sliceindex.isFiniteSetLower(); // Should be ..\n ArrayList<ASTNode> newcm=new ArrayList<ASTNode>();\n \n ArrayList<ASTNode> restindices=new ArrayList<ASTNode>(indices);\n restindices.remove(0);\n \n for(int i=1; i<compound_matrix.numChildren(); i++) {\n ASTNode tmp=evaluateSlice(compound_matrix.getChildConst(i), restindices);\n if(tmp==null) return null;\n newcm.add(tmp);\n }\n return new CompoundMatrix(compound_matrix.getChild(0), newcm); // Take index domain from original CM.\n\t }\n\t else {\n\t // This index must be a constant\n\t ArrayList<Long> cmindex;\n if(compound_matrix instanceof CompoundMatrix) {\n cmindex=compound_matrix.getChild(0).getValueSet();\n }\n else if (compound_matrix instanceof EmptyMatrix) {\n cmindex=new ArrayList<Long>();\n }\n else {\n cmindex=null;\n }\n\t \n\t long val=sliceindex.getValue();\n\t int idxval=cmindex.indexOf(val);\n\t \n\t if(idxval==-1) {\n\t // Matrix is indexed out of range. Undefined. Delay evaluation. \n\t return null;\n\t }\n\t \n ArrayList<ASTNode> restindices=new ArrayList<ASTNode>(indices);\n restindices.remove(0);\n\t \n\t return evaluateSlice(compound_matrix.getChildConst(idxval+1), restindices);\n\t }\n\t}", "private int adequateDimensions(int cols, int rows) {\r\n\r\n if ((cols >= MINALG) && (cols <= MAXALG)) {\r\n if ((rows >= MINDATA) && (rows <= MAXDATA)) {\r\n return 0;\r\n } else {\r\n return 1;\r\n }\r\n } else {\r\n return 2;\r\n }\r\n\r\n }", "public boolean percolates() {\n for (int i = 0; i < size; i++) {\r\n if (flowGrid[size * (size - 1) + i] < size) { // if any of the bottom row points at any of the index in the top row\r\n return true;\r\n }\r\n }\r\n return false;\r\n }", "@Test\n public void testRevisedWildcardAndPartition() {\n Path filePath = new Path(\"hdfs:///w/x/y/z.csv\");\n ImplicitColumnManager implictColManager = new ImplicitColumnManager(\n fixture.getOptionManager(),\n standardOptions(filePath));\n\n ScanLevelProjection scanProj = ScanLevelProjection.build(\n RowSetTestUtils.projectList(SchemaPath.DYNAMIC_STAR,\n ScanTestUtils.partitionColName(8)),\n Lists.newArrayList(implictColManager.projectionParser()));\n\n List<ColumnProjection> cols = scanProj.columns();\n assertEquals(2, cols.size());\n assertTrue(scanProj.columns().get(0) instanceof UnresolvedWildcardColumn);\n assertTrue(scanProj.columns().get(1) instanceof PartitionColumn);\n }", "public boolean subset(ZYSet<ElementType> potentialSubset){\n for(ElementType e:potentialSubset){\n if(!this.contains(e)){\n return false;\n }\n }\n return true;\n }", "public boolean isMember(int k) {\n\t \n\t int a = sparse[k];\n\n\t if (a < members && dense[a] == k) \n\t \treturn true;\n\t else\n\t \treturn false;\n\n\t}", "private boolean checkColoumnForOctPair(int j1, int j2) {\n for(int i=0;i<4;i++)\r\n {\r\n if(Kmap[i][j1]==0 || Kmap[i][j1]==-1)\r\n return false;\r\n }\r\n for(int i=0;i<4;i++)\r\n {\r\n if(Kmap[i][j2]==0 || Kmap[i][j2]==-1)\r\n return false;\r\n }\r\n for(int i=0;i<4;i++)\r\n {\r\n Kmap[i][j1]=-1;\r\n }\r\n for(int i=0;i<4;i++)\r\n {\r\n Kmap[i][j2]=-1;\r\n } \r\n return true; \r\n }", "boolean isKey( ImmutableBitSet columns );", "@Override\n public boolean isUsableIndex(int idx) {\n if ( idx < 0 )\n return false;\n if ( idx >= numDataCols )\n return false;\n return Boolean.TRUE.equals(standardized[idx]);\n }", "protected void checkColumn(int column) {\n\tif (column < 0 || column >= columns) throw new IndexOutOfBoundsException(\"Attempted to access \"+toStringShort()+\" at column=\"+column);\n}", "public static boolean shouldProcessSlice(OBSlice x) throws Exception {\n return x.size() <= maxSliceSize;\n }", "boolean hasPartitionLimit();", "public static boolean isAllowedToCollied(Marker marker, Marker m2){\n\t\tif( m2.letter.getX() < marker.letter.getX()){\n\t\t\tif(m2.rightValue != 0 && marker.leftValue !=0 && m2.rightValue + marker.leftValue == 0){\n\t\t\t\tm2.rightValue =0;\n\t\t\t\tmarker.leftValue=0;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\t//if collied on right \n\t\telse if( m2.letter.getX() > marker.letter.getX()){\n\t\t\tif(m2.leftValue != 0 && marker.rightValue != 0 && m2.leftValue+ marker.rightValue == 0){\n\t\t\t\tm2.leftValue = 0;\n\t\t\t\tmarker.rightValue = 0; \n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "private boolean isNeedCut(Map<Set<String>, Integer> preMap, Set<String> set) {\n\t\tboolean flag = false;\n\t\tList<Set<String>> subSets = getSubSets(set);\n\t\tfor(Set<String> subSet : subSets){\n\t\t\tif(!preMap.containsKey(subSet)){\n\t\t\t\tflag = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn flag;\n\t}", "boolean isCriterionSpecified();", "Boolean subset(MultiSet<X> s);", "boolean isNeedSharding();", "private ArrayList<Integer> coverSatisfiedColumns(boolean[] ecmCoveredCols, int rowIndex)\n {\n ArrayList<Integer> coveredCols = new ArrayList<>();\n for(int j = 0; j < dimSquared * CONSTRAINTS; j++)\n {\n if(ecMatrix[rowIndex][j])\n {\n ecmCoveredCols[j] = true;\n coveredCols.add(j);\n }\n }\n return coveredCols;\n }", "private boolean columnCheck() {\n\t\tfor(int col = 0; col < puzzle[0].length; col++) {\n\t\t\tfor(int i = 0; i < puzzle[0].length; i++) {\n\t\t\t\tif(puzzle[i][col] != 0) {\n\t\t\t\t\tfor(int j = i + 1; j < puzzle[0].length; j++) {\n\t\t\t\t\t\tif(puzzle[i][col] == puzzle[j][col])\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "private boolean isValid(int index) {\r\n return index >= 0 && index < dimension;\r\n }", "@Test\n public void testBoundsAsCompositesWithMultiInRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n Restriction in = newMultiIN(cfMetaData, 0, asList(value1, value2), asList(value2, value3));\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(in);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertComposite(bounds.get(1), value2, value3, EOC.END);\n }", "private boolean esColumnaValida(int columna) {\n return (columna>=0 && columna<=casillas[0].length);\n }", "private boolean inBounds(int row, int col)\n {\n return ((row >= 0) && (row < NUM_ROWS) &&\n (col >= 0) && (col < NUM_COLS)); \n }", "@Override\n public boolean isInBounds(int row, int col) {\n return row >= 0 && row < grid.length && col >= 0 && col < grid[0].length;\n }", "public boolean supportsColumnCheck() {\n \t\treturn true;\n \t}", "private static boolean isCut(Spreadsheet ss) {\r\n \t\treturn Boolean.valueOf( (Boolean)ss.getAttribute(KEY_IS_CUT) ); //if attr is null return false\r\n \t}", "public Map<ByteBuffer, List<ColumnOrSuperColumn>> forced_2round_multiget_slice(List<ByteBuffer> allKeys, ColumnParent column_parent, SlicePredicate predicate)\n throws Exception\n {\n //if (logger.isTraceEnabled()) {\n // logger.trace(\"forced_2round_multiget_slice(allKeys = {}, column_parent = {}, predicate = {})\", new Object[]{printKeys(allKeys), column_parent, predicate});\n //}\n //Split up into one request for each server in the local cluster\n Map<Cassandra.AsyncClient, List<ByteBuffer>> asyncClientToFirstRoundKeys = partitionByAsyncClients(allKeys);\n\n //Send Round 1 Requests\n Queue<BlockingQueueCallback<multiget_slice_call>> firstRoundCallbacks = new LinkedList<BlockingQueueCallback<multiget_slice_call>>();\n for (Entry<Cassandra.AsyncClient, List<ByteBuffer>> entry : asyncClientToFirstRoundKeys.entrySet()) {\n Cassandra.AsyncClient asyncClient = entry.getKey();\n List<ByteBuffer> keysForThisClient = entry.getValue();\n\n BlockingQueueCallback<multiget_slice_call> callback = new BlockingQueueCallback<multiget_slice_call>();\n firstRoundCallbacks.add(callback);\n\n //if (logger.isTraceEnabled()) { logger.trace(\"round 1: get \" + printKeys(keysForThisClient) + \" from \" + asyncClient); }\n asyncClient.multiget_slice(keysForThisClient, column_parent, predicate, consistencyLevel, LamportClock.sendTimestamp(), callback);\n }\n\n //Gather responses, track both max_evt and min_lvt\n long overallMaxEvt = Long.MIN_VALUE;\n long overallMinLvt = Long.MAX_VALUE;\n\n Map<ByteBuffer, List<ColumnOrSuperColumn>> keyToResult = new HashMap<ByteBuffer, List<ColumnOrSuperColumn>>();\n NavigableMap<Long, List<ByteBuffer>> lvtToKeys = new TreeMap<Long, List<ByteBuffer>>();\n for (BlockingQueueCallback<multiget_slice_call> callback : firstRoundCallbacks) {\n\n MultigetSliceResult result = callback.getResponseNoInterruption().getResult();\n LamportClock.updateTime(result.lts);\n\n for (Entry<ByteBuffer, List<ColumnOrSuperColumn>> entry : result.value.entrySet()) {\n ByteBuffer key = entry.getKey();\n List<ColumnOrSuperColumn> coscList = entry.getValue();\n keyToResult.put(key, coscList);\n\n //find the evt and lvt for the entire row\n EvtAndLvt evtAndLvt = ColumnOrSuperColumnHelper.extractEvtAndLvt(coscList);\n if (!lvtToKeys.containsKey(evtAndLvt.getLatestValidTime())) {\n lvtToKeys.put(evtAndLvt.getLatestValidTime(), new LinkedList<ByteBuffer>());\n }\n lvtToKeys.get(evtAndLvt.getLatestValidTime()).add(key);\n //if (logger.isTraceEnabled()) { logger.trace(\"round 1 response for \" + printKey(key) + \" evt: \" + evtAndLvt.getEarliestValidTime() + \" lvt: \" + evtAndLvt.getLatestValidTime()); }\n\n overallMaxEvt = Math.max(overallMaxEvt, evtAndLvt.getEarliestValidTime());\n overallMinLvt = Math.min(overallMinLvt, evtAndLvt.getLatestValidTime());\n }\n }\n //if (logger.isTraceEnabled()) { logger.trace(\"Min LVT:\" + overallMinLvt + \" Max EVT: \" + overallMaxEvt); }\n\n //Always Execute 2nd round for micro-benchmarking\n if (true) {\n //get the smallest lvt > maxEvt\n long chosenTime = lvtToKeys.navigableKeySet().higher(overallMaxEvt);\n\n List<ByteBuffer> secondRoundKeys = new LinkedList<ByteBuffer>();\n secondRoundKeys.addAll(allKeys);\n\n //Send Round 2 Requests\n Map<Cassandra.AsyncClient, List<ByteBuffer>> asyncClientToSecondRoundKeys = partitionByAsyncClients(secondRoundKeys);\n Queue<BlockingQueueCallback<multiget_slice_by_time_call>> secondRoundCallbacks = new LinkedList<BlockingQueueCallback<multiget_slice_by_time_call>>();\n for (Entry<Cassandra.AsyncClient, List<ByteBuffer>> entry : asyncClientToSecondRoundKeys.entrySet()) {\n Cassandra.AsyncClient asyncClient = entry.getKey();\n List<ByteBuffer> keysForThisClient = entry.getValue();\n\n BlockingQueueCallback<multiget_slice_by_time_call> callback = new BlockingQueueCallback<multiget_slice_by_time_call>();\n secondRoundCallbacks.add(callback);\n\n //if (logger.isTraceEnabled()) { logger.trace(\"round 2: get \" + printKeys(keysForThisClient) + \" from \" + asyncClient); }\n\n asyncClient.multiget_slice_by_time(keysForThisClient, column_parent, predicate, consistencyLevel, chosenTime, LamportClock.sendTimestamp(), callback);\n }\n\n //Gather second round responses\n for (BlockingQueueCallback<multiget_slice_by_time_call> callback : secondRoundCallbacks) {\n MultigetSliceResult result = callback.getResponseNoInterruption().getResult();\n LamportClock.updateTime(result.lts);\n\n substituteValidFirstRoundResults(result, keyToResult);\n\n //if (logger.isTraceEnabled()) { logger.trace(\"round 2 responses for \" + printKeys(result.getValue().keySet())); }\n\n keyToResult.putAll(result.getValue());\n }\n }\n\n //Add dependencies on anything returned and removed deleted columns\n for (Entry<ByteBuffer, List<ColumnOrSuperColumn>> entry : keyToResult.entrySet()) {\n ByteBuffer key = entry.getKey();\n List<ColumnOrSuperColumn> coscList = entry.getValue();\n\n for (Iterator<ColumnOrSuperColumn> cosc_it = coscList.iterator(); cosc_it.hasNext(); ) {\n ColumnOrSuperColumn cosc = cosc_it.next();\n try {\n clientContext.addDep(key, cosc);\n } catch (NotFoundException nfe) {\n //remove deleted results, it's okay for all result to be removed\n cosc_it.remove();\n }\n }\n }\n //if (logger.isTraceEnabled()) {\n // logger.trace(\"forced_2round_multiget_slice result = {}\", keyToResult);\n //}\n return keyToResult;\n }", "private boolean colCheck(Point point, int num) {\n return Search.getCellsFromCol(point).stream().allMatch(cell -> cell.getNumber() != num);\n }", "public boolean isSubset() {\n return isSubset;\n }", "public boolean isSubset() {\n return isSubset;\n }", "private boolean isExplode(int row, int col){\r\n if(map[row][col].getSafe() == true){\r\n return false;\r\n }\r\n else{\r\n return true;\r\n }\r\n }", "private boolean checkColumn(int i, int j, int n){\n\t\tfor(int k = 0; k < 9; k++){\n\t\t\tif(k == i){\n\t\t\t}else if(sudoku[k][j] == n){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public boolean isProperSubset(/*@ non_null @*/ JMLObjectSet<E> s2) {\n return size < s2.int_size() && isSubset(s2);\n }" ]
[ "0.7035176", "0.6894662", "0.68665797", "0.6858747", "0.6838168", "0.67742574", "0.6698097", "0.6545424", "0.644481", "0.6426601", "0.641349", "0.631177", "0.6243663", "0.5747856", "0.57330954", "0.56544596", "0.56334513", "0.5632327", "0.55277467", "0.53221786", "0.52115816", "0.52035856", "0.52002615", "0.5195224", "0.5167593", "0.5166512", "0.515863", "0.5156121", "0.51235396", "0.5115053", "0.5097733", "0.50677896", "0.5065535", "0.50351053", "0.503283", "0.5031574", "0.5030349", "0.5024569", "0.50079167", "0.4979165", "0.49721965", "0.4967221", "0.4953416", "0.49377784", "0.49004516", "0.48948917", "0.48912016", "0.4878974", "0.48769176", "0.48663735", "0.48527977", "0.48483947", "0.48366678", "0.48256272", "0.4825601", "0.4819375", "0.48143196", "0.4810225", "0.4802271", "0.48009476", "0.47929043", "0.47835577", "0.47742128", "0.47627288", "0.47591177", "0.4743248", "0.47331798", "0.47177038", "0.470614", "0.47006813", "0.46999824", "0.469967", "0.46894243", "0.46767637", "0.4675426", "0.46674737", "0.46636826", "0.4654786", "0.46490794", "0.46488357", "0.46426767", "0.46415412", "0.46368828", "0.4632551", "0.46245274", "0.4619359", "0.46170607", "0.46073836", "0.46047944", "0.4603885", "0.46009427", "0.45912042", "0.45896146", "0.45823097", "0.45769337", "0.45736936", "0.45736936", "0.45715612", "0.45684773", "0.45536608" ]
0.6627161
7
Test multicolumn slice restrictions (e.g '(clustering_0) > (1)') with only one clustering column in reverse order
@Test public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneDescendingClusteringColumn() { CFMetaData cfMetaData = newCFMetaData(Sort.DESC); ByteBuffer value1 = ByteBufferUtil.bytes(1); ByteBuffer value2 = ByteBufferUtil.bytes(2); Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1); PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(slice); List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertEmptyComposite(bounds.get(0)); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value1, EOC.START); slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1); restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(slice); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertEmptyComposite(bounds.get(0)); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value1, EOC.END); slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1); restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(slice); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value1, EOC.NONE); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertEmptyComposite(bounds.get(0)); slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1); restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(slice); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value1, EOC.END); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertEmptyComposite(bounds.get(0)); slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1); Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2); restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(slice).mergeWith(slice2); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value2, EOC.END); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value1, EOC.START); slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1); slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2); restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(slice).mergeWith(slice2); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value2, EOC.NONE); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value1, EOC.END); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneDescendingAndOneAscendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0) > (1) AND (clustering_0, clustering1) < (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.END);\n assertComposite(bounds.get(2), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.END);\n assertComposite(bounds.get(1), value1, EOC.START);\n assertComposite(bounds.get(2), value1, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneAscendingAndOneDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n assertComposite(bounds.get(2), value2, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertComposite(bounds.get(1), value2, EOC.START);\n assertComposite(bounds.get(2), value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithTwoDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsMixingAscendingDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.DESC, Sort.ASC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(3));\n\n // clustering_0 = 1 AND (clustering_1, clustering_2, clustering_3) > (2, 3, 4)\n Restriction eq = newSingleEq(cfMetaData, 0, value1);\n slice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n restrictions = restrictions.mergeWith(eq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(3));\n\n\n // (clustering_0, clustering1, clustering_2, clustering_3) <= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, value4, EOC.NONE);\n assertComposite(bounds.get(3), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) < (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(3), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4) AND (clustering_0, clustering_1) < (2, 3)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2, value3);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(5, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n assertComposite(bounds.get(4), value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(5, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertComposite(bounds.get(3), value2, EOC.START);\n assertComposite(bounds.get(4), value2, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4) AND (clustering_0, clustering1, clustering_2, clustering_3) <= (4, 3, 2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value4, value3, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(7, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n assertComposite(bounds.get(4), value4, value3, EOC.START);\n assertComposite(bounds.get(5), value4, value3, value2, value1, EOC.NONE);\n assertComposite(bounds.get(6), value4, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(7, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertComposite(bounds.get(3), value4, EOC.START);\n assertComposite(bounds.get(4), value4, value3, value2, EOC.START);\n assertComposite(bounds.get(5), value4, value3, value2, EOC.END);\n assertComposite(bounds.get(6), value4, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithTwoAscendingAndTwoDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.DESC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertEmptyComposite(bounds.get(1));\n\n // clustering_0 = 1 AND (clustering_1, clustering_2, clustering_3) > (2, 3, 4)\n Restriction eq = newSingleEq(cfMetaData, 0, value1);\n slice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n restrictions = restrictions.mergeWith(eq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2, clustering_3) > (2, 3, 4)\n Restriction in = newSingleIN(cfMetaData, 0, value1, value2);\n slice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n restrictions = restrictions.mergeWith(in);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n assertComposite(bounds.get(2), value2, value2, EOC.START);\n assertComposite(bounds.get(3), value2, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n assertComposite(bounds.get(2), value2, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(3), value2, EOC.END);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1, clustering_2, clustering_3) <= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) < (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4) AND (clustering_0, clustering_1) < (2, 3)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2, value3);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(1), value2, value3, EOC.START);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4) AND (clustering_0, clustering1, clustering_2, clustering_3) <= (4, 3, 2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value4, value3, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n assertComposite(bounds.get(2), value4, value3, value2, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(1), value4, value3, EOC.START);\n assertComposite(bounds.get(2), value4, value3, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithTwoClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithSliceRestrictionsAndOneDescendingClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newSingleSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newSingleSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithSliceRestrictionsAndOneClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newSingleSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newSingleSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithSingleEqAndSliceRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n ByteBuffer value5 = ByteBufferUtil.bytes(5);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) > (2, 3)\n Restriction singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction multiSlice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiSlice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) > (2, 3) AND (clustering_1) < (4)\n singleEq = newSingleEq(cfMetaData, 0, value1);\n multiSlice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3);\n Restriction multiSlice2 = newMultiSlice(cfMetaData, 1, Bound.END, false, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiSlice2).mergeWith(singleEq).mergeWith(multiSlice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value4, EOC.START);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) => (2, 3) AND (clustering_1, clustering_2) <= (4, 5)\n singleEq = newSingleEq(cfMetaData, 0, value1);\n multiSlice = newMultiSlice(cfMetaData, 1, Bound.START, true, value2, value3);\n multiSlice2 = newMultiSlice(cfMetaData, 1, Bound.END, true, value4, value5);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiSlice2).mergeWith(singleEq).mergeWith(multiSlice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value4, value5, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiEqAndSingleSliceRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n\n // (clustering_0, clustering_1) = (1, 2) AND clustering_2 > 3\n Restriction multiEq = newMultiEq(cfMetaData, 0, value1, value2);\n Restriction singleSlice = newSingleSlice(cfMetaData, 2, Bound.START, false, value3);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiEq).mergeWith(singleSlice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithOneEqRestrictionsAndTwoClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer clustering_0 = ByteBufferUtil.bytes(1);\n Restriction eq = newSingleEq(cfMetaData, 0, clustering_0);\n\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithOneEqRestrictionsAndOneClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC);\n\n ByteBuffer clustering_0 = ByteBufferUtil.bytes(1);\n Restriction eq = newSingleEq(cfMetaData, 0, clustering_0);\n\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithEqAndSliceRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n\n Restriction eq = newSingleEq(cfMetaData, 0, value3);\n\n Restriction slice = newSingleSlice(cfMetaData, 1, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 1, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 1, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 1, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 1, Bound.START, false, value1);\n Restriction slice2 = newSingleSlice(cfMetaData, 1, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value2, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 1, Bound.START, true, value1);\n slice2 = newSingleSlice(cfMetaData, 1, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithSingleEqAndMultiEqRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) = (2, 3)\n Restriction singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction multiEq = newMultiEq(cfMetaData, 1, value2, value3);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiEq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n // clustering_0 = 1 AND clustering_1 = 2 AND (clustering_2, clustering_3) = (3, 4)\n singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction singleEq2 = newSingleEq(cfMetaData, 1, value2);\n multiEq = newMultiEq(cfMetaData, 2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(singleEq2).mergeWith(multiEq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n\n // (clustering_0, clustering_1) = (1, 2) AND clustering_2 = 3\n singleEq = newSingleEq(cfMetaData, 2, value3);\n multiEq = newMultiEq(cfMetaData, 0, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiEq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) = (2, 3) AND clustering_3 = 4\n singleEq = newSingleEq(cfMetaData, 0, value1);\n singleEq2 = newSingleEq(cfMetaData, 3, value4);\n multiEq = newMultiEq(cfMetaData, 1, value2, value3);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiEq).mergeWith(singleEq2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n }", "private static Restriction newMultiSlice(CFMetaData cfMetaData, int firstIndex, Bound bound, boolean inclusive, ByteBuffer... values)\n {\n List<ColumnDefinition> columnDefinitions = new ArrayList<>();\n for (int i = 0; i < values.length; i++)\n {\n columnDefinitions.add(getClusteringColumnDefinition(cfMetaData, i + firstIndex));\n }\n return new MultiColumnRestriction.Slice(columnDefinitions, bound, inclusive, toMultiItemTerminal(values));\n }", "@Test\n public void testBoundsAsCompositesWithSingleEqAndMultiINRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n ByteBuffer value5 = ByteBufferUtil.bytes(5);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) IN ((2, 3), (4, 5))\n Restriction singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction multiIN = newMultiIN(cfMetaData, 1, asList(value2, value3), asList(value4, value5));\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiIN);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(1), value1, value4, value5, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(1), value1, value4, value5, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) IN ((2, 3))\n singleEq = newSingleEq(cfMetaData, 0, value1);\n multiIN = newMultiIN(cfMetaData, 1, asList(value2, value3));\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiIN).mergeWith(singleEq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n // clustering_0 = 1 AND clustering_1 = 5 AND (clustering_2, clustering_3) IN ((2, 3), (4, 5))\n singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction singleEq2 = newSingleEq(cfMetaData, 1, value5);\n multiIN = newMultiIN(cfMetaData, 2, asList(value2, value3), asList(value4, value5));\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiIN).mergeWith(singleEq2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value5, value2, value3, EOC.START);\n assertComposite(bounds.get(1), value1, value5, value4, value5, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value5, value2, value3, EOC.END);\n assertComposite(bounds.get(1), value1, value5, value4, value5, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithOneInRestrictionsAndOneClusteringColumn()\n {\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n Restriction in = newSingleIN(cfMetaData, 0, value1, value2, value3);\n\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(in);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.START);\n assertComposite(bounds.get(2), value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n assertComposite(bounds.get(1), value2, EOC.END);\n assertComposite(bounds.get(2), value3, EOC.END);\n }", "private boolean isSubsetOf(int firstRow, int secondRow) {\n for (int i = 0; i < universalSetSize; i++) {\n if (input[firstRow][i] && !input[secondRow][i]) {\n return false;\n }\n }\n return true;\n }", "@Test\n\tpublic void testEliminationByColumn(){\n\t\tsetBoardUp();\n\t\tColumn col = new Column(board, 1);\n\t\tint[] toBeRemoved = {1, 3, 4};\n\t\tint[] fromCesll = {1, 2, 3, 5, 6, 8};\n\t\talgorithm.applyEliminationInColumn(col);\n\t\tboolean condition = true;\n\t\tfor(int i = 0; i < toBeRemoved.length; i++)\n\t\t\tfor(int j = 0; j < fromCesll.length; j++)\n\t\t\t\tcondition &= !col.cell[fromCesll[j]].possibilities.contains(toBeRemoved[i]);\t\t\n\t\tassertTrue(condition);\n\t}", "public boolean percolates()\r\n { return uf.find(0) == uf.find(dimension*dimension + 1); }", "private boolean checkColoumnForQuadPair(int j1) {\n for(int i=0;i<4;i++)\r\n {\r\n if(Kmap[i][j1]==0 || Kmap[i][j1]==-1)\r\n return false;\r\n }\r\n for(int i=0;i<4;i++)\r\n {\r\n Kmap[i][j1]=-1;\r\n }\r\n return true; \r\n }", "Boolean isCollinearTo(IVec3 v);", "private boolean isSubsetOf(List<String> permissions2,\n\t\t\tList<String> permissions3) {\n\t\treturn false;\n\t}", "@Test\n\t public void test_Is_Subset_Negative() throws Exception{\t\n\t\t SET setarray= new SET( new int[]{1,2,3,4,5});\n\t\t SET subsetarray= new SET( new int[]{7,8});\n\t\t assertFalse(setarray.isSubSet(subsetarray));\t \n\t }", "@Test\n public void whereNormalColumn() throws Exception {\n String sql = \"desc verbose select k1, e1 from db1.tbl1 lateral view explode_split(k2, \\\",\\\") tmp as e1 \"\n + \"where k1=1; \";\n String explainString = UtFrameUtils.getSQLPlanOrErrorMsg(ctx, sql, true);\n Assert.assertTrue(explainString.contains(\"1:TABLE FUNCTION NODE\"));\n Assert.assertTrue(explainString.contains(\"table function: explode_split(`k2`, ',')\"));\n Assert.assertTrue(explainString.contains(\"tuple ids: 0 1\"));\n Assert.assertTrue(explainString.contains(\"TupleDescriptor{id=1, tbl=tmp, byteSize=32, materialized=true}\"));\n Assert.assertTrue(explainString.contains(\"SlotDescriptor{id=1, col=e1, type=VARCHAR(*)}\"));\n Assert.assertTrue(explainString.contains(\"0:OlapScanNode\"));\n Assert.assertTrue(explainString.contains(\"PREDICATES: `k1` = 1\"));\n }", "private boolean checkRowCol(int c1, int c2, int c3) \r\n {\r\n return ((c1 != -1) && (c1 == c2) && (c2 == c3)); //eida ekhon porjonto kaaj e lage nai\r\n }", "private boolean subGridCheck() {\n\t\tint sqRt = (int)Math.sqrt(dimension);\n\t\tfor(int i = 0; i < sqRt; i++) {\n\t\t\tint increment = i * sqRt;\n\t\t\tfor(int val = 1; val <= dimension; val++) {\n\t\t\t\tint valCounter = 0;\n\t\t\t\tfor(int row = 0 + increment; row < sqRt + increment; row++) {\n\t\t\t\t\tfor(int col = 0 + increment; col < sqRt + increment; col++) {\n\t\t\t\t\t\tif(puzzle[row][col] == val)\n\t\t\t\t\t\t\tvalCounter++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(valCounter >= 2)\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "private boolean canSetSafelyDownColumn(MTreeNode row, MTreeNode col, UnionDoubleIntervals newVal) {\n\t\tMTreeNode rowKids[]=row.getChildren();\n\t\tif (rowKids.length==0) return true;\n\t\tUnionDoubleIntervals rowKidsInts[]=new UnionDoubleIntervals[rowKids.length];\n\t\tfor(int i=0; i<rowKids.length; i++) {\n\t\t\trowKidsInts[i]=get(rowKids[i], col);\n\t\t\tif (rowKidsInts[i]==null) {\n\t\t\t\t//If a sibling is null, I cannot check, so just return\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\tUnionDoubleIntervals sum=UnionDoubleIntervals.sum(rowKidsInts);\n\t\treturn newVal.intersects(sum);\n\t}", "private static Restriction newSingleSlice(CFMetaData cfMetaData, int index, Bound bound, boolean inclusive, ByteBuffer value)\n {\n ColumnDefinition columnDef = getClusteringColumnDefinition(cfMetaData, index);\n return new SingleColumnRestriction.Slice(columnDef, bound, inclusive, toTerm(value));\n }", "List<Trueorfalse> selectByExample(RowBounds rowBounds);", "public interface IStoppingCriteria {\n\n /**\n * Determine the degree of clustering agreement\n * @param cluster1 one clustering results\n * @param cluster2 the other clustering results\n * @return the degree of clustering agreement; 1 refers to be the same clustering results; 0 refers to be the totally different clustering results\n */\n public double computeSimilarity(int[] cluster1, int[] cluster2);\n\n}", "public boolean percolates() {\n for (int i = 0; i < size; i++) {\r\n if (flowGrid[size * (size - 1) + i] < size) { // if any of the bottom row points at any of the index in the top row\r\n return true;\r\n }\r\n }\r\n return false;\r\n }", "@Test\n public void testBoundsAsCompositesWithMultiEqRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n Restriction eq = newMultiEq(cfMetaData, 0, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n }", "boolean isOrderedOn(ColumnReference[] crs, boolean permuteOrdering, Vector fbtVector)\n\t{\n\t\t/* RESOLVE - DistinctNodes are ordered on their RCLs.\n\t\t * Walk RCL to see if cr is 1st non-constant column in the\n\t\t * ordered result.\n\t\t */\n\t\treturn false;\n\t}", "public void testFilterOnAggregationColumn() throws Exception {\n \t\tccName = new String[] { \"cc1\", \"cc2\", \"cc3\" };\n \t\tccExpr = new String[] { \"row.COL0+row.COL1\",\n \t\t\t\t\"Total.runningSum(row.cc1,row.COL0==0,0)\",\n \t\t\t\t\"Total.runningSum(row.cc1,row.COL0>0,0)\" };\n \n \t\tfor (int i = 0; i < ccName.length; i++) {\n \t\t\tComputedColumn computedColumn = new ComputedColumn(ccName[i],\n \t\t\t\t\tccExpr[i], DataType.ANY_TYPE);\n \t\t\t((BaseDataSetDesign) this.dataSet)\n \t\t\t\t\t.addComputedColumn(computedColumn);\n \t\t}\n \n \t\tString[] bindingNameRow = new String[7];\n \t\tbindingNameRow[0] = \"ROW_COL0\";\n \t\tbindingNameRow[1] = \"ROW_COL1\";\n \t\tbindingNameRow[2] = \"ROW_COL2\";\n \t\tbindingNameRow[3] = \"ROW_COL3\";\n \t\tbindingNameRow[4] = \"ROW_cc1\";\n \t\tbindingNameRow[5] = \"ROW_cc2\";\n \t\tbindingNameRow[6] = \"ROW_cc3\";\n \t\tScriptExpression[] bindingExprRow = new ScriptExpression[] {\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL0\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL1\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL2\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL3\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + ccName[0], 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + ccName[1], 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + ccName[2], 0) };\n \n \t\tIResultIterator resultIt = this.executeQuery(this.createQuery(null,\n \t\t\t\tnull, null, null, null, null, null, null, null, bindingNameRow,\n \t\t\t\tbindingExprRow));\n \n \t\tprintResult(resultIt, bindingNameRow, bindingExprRow);\n \t\t// assert\n \t\tcheckOutputFile();\n \n \t}", "@Test\n public void testHardClustersWithOverlappingPartitions()\n {\n check(hardClustersWithOverlappingPartitions(), 0.0, 1.0);\n }", "protected void checkBox(int slice, int row, int column, int depth, int height, int width) {\n\tif (slice<0 || depth<0 || slice+depth>slices || row<0 || height<0 || row+height>rows || column<0 || width<0 || column+width>columns) throw new IndexOutOfBoundsException(toStringShort()+\", slice:\"+slice+\", row:\"+row+\" ,column:\"+column+\", depth:\"+depth+\" ,height:\"+height+\", width:\"+width);\n}", "public static ASTNode evaluateSlice(ASTNode compound_matrix, ArrayList<ASTNode> indices) {\n\t if(indices.size()==0) {\n\t assert !(compound_matrix instanceof CompoundMatrix || compound_matrix instanceof EmptyMatrix);\n\t return compound_matrix;\n\t }\n\t \n\t ASTNode sliceindex=indices.get(0);\n\t \n\t if(compound_matrix instanceof EmptyMatrix) {\n // Construct new matrix domain for empty matrix.\n // First get the matrix domain for compound_matrix (which is itself an empty matrix)\n ASTNode matdom=compound_matrix.getChild(0);\n \n // Get indices\n ArrayList<ASTNode> empty_idx=matdom.getChildren(3);\n \n assert empty_idx.size()==indices.size();\n \n for(int i=empty_idx.size()-1; i>=0; i--) {\n if(! indices.get(i).equals(new IntegerDomain(new Range(null, null)))) {\n // If indices.get(i) is a constant, remove that dimension. \n empty_idx.remove(i);\n }\n }\n \n return new EmptyMatrix(new MatrixDomain(compound_matrix.getChild(0).getChild(0), // get original base domain. \n empty_idx));\n }\n\t \n // Must be a compound matrix from here on. \n if(sliceindex.isSet()) {\n assert ! sliceindex.isFiniteSetUpper() && ! sliceindex.isFiniteSetLower(); // Should be ..\n ArrayList<ASTNode> newcm=new ArrayList<ASTNode>();\n \n ArrayList<ASTNode> restindices=new ArrayList<ASTNode>(indices);\n restindices.remove(0);\n \n for(int i=1; i<compound_matrix.numChildren(); i++) {\n ASTNode tmp=evaluateSlice(compound_matrix.getChildConst(i), restindices);\n if(tmp==null) return null;\n newcm.add(tmp);\n }\n return new CompoundMatrix(compound_matrix.getChild(0), newcm); // Take index domain from original CM.\n\t }\n\t else {\n\t // This index must be a constant\n\t ArrayList<Long> cmindex;\n if(compound_matrix instanceof CompoundMatrix) {\n cmindex=compound_matrix.getChild(0).getValueSet();\n }\n else if (compound_matrix instanceof EmptyMatrix) {\n cmindex=new ArrayList<Long>();\n }\n else {\n cmindex=null;\n }\n\t \n\t long val=sliceindex.getValue();\n\t int idxval=cmindex.indexOf(val);\n\t \n\t if(idxval==-1) {\n\t // Matrix is indexed out of range. Undefined. Delay evaluation. \n\t return null;\n\t }\n\t \n ArrayList<ASTNode> restindices=new ArrayList<ASTNode>(indices);\n restindices.remove(0);\n\t \n\t return evaluateSlice(compound_matrix.getChildConst(idxval+1), restindices);\n\t }\n\t}", "public abstract Optional<GridAxis> subsetDependent(GridAxis1D subsetIndAxis, Formatter errlog);", "private static Restriction newMultiEq(CFMetaData cfMetaData, int firstIndex, ByteBuffer... values)\n {\n List<ColumnDefinition> columnDefinitions = new ArrayList<>();\n for (int i = 0; i < values.length; i++)\n {\n columnDefinitions.add(getClusteringColumnDefinition(cfMetaData, firstIndex + i));\n }\n return new MultiColumnRestriction.EQ(columnDefinitions, toMultiItemTerminal(values));\n }", "public static boolean isAllowedToCollied(Marker marker, Marker m2){\n\t\tif( m2.letter.getX() < marker.letter.getX()){\n\t\t\tif(m2.rightValue != 0 && marker.leftValue !=0 && m2.rightValue + marker.leftValue == 0){\n\t\t\t\tm2.rightValue =0;\n\t\t\t\tmarker.leftValue=0;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\t//if collied on right \n\t\telse if( m2.letter.getX() > marker.letter.getX()){\n\t\t\tif(m2.leftValue != 0 && marker.rightValue != 0 && m2.leftValue+ marker.rightValue == 0){\n\t\t\t\tm2.leftValue = 0;\n\t\t\t\tmarker.rightValue = 0; \n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public boolean columnFull(int column);", "private boolean checkColoumnForOctPair(int j1, int j2) {\n for(int i=0;i<4;i++)\r\n {\r\n if(Kmap[i][j1]==0 || Kmap[i][j1]==-1)\r\n return false;\r\n }\r\n for(int i=0;i<4;i++)\r\n {\r\n if(Kmap[i][j2]==0 || Kmap[i][j2]==-1)\r\n return false;\r\n }\r\n for(int i=0;i<4;i++)\r\n {\r\n Kmap[i][j1]=-1;\r\n }\r\n for(int i=0;i<4;i++)\r\n {\r\n Kmap[i][j2]=-1;\r\n } \r\n return true; \r\n }", "public boolean percolates() {\n\t\tint top = uf.find(0);\n\t\tint bottom = uf.find(size * size + 1);\n\t\treturn top == bottom;\n\t}", "public Map<ByteBuffer, List<ColumnOrSuperColumn>> forced_2round_multiget_slice(List<ByteBuffer> allKeys, ColumnParent column_parent, SlicePredicate predicate)\n throws Exception\n {\n //if (logger.isTraceEnabled()) {\n // logger.trace(\"forced_2round_multiget_slice(allKeys = {}, column_parent = {}, predicate = {})\", new Object[]{printKeys(allKeys), column_parent, predicate});\n //}\n //Split up into one request for each server in the local cluster\n Map<Cassandra.AsyncClient, List<ByteBuffer>> asyncClientToFirstRoundKeys = partitionByAsyncClients(allKeys);\n\n //Send Round 1 Requests\n Queue<BlockingQueueCallback<multiget_slice_call>> firstRoundCallbacks = new LinkedList<BlockingQueueCallback<multiget_slice_call>>();\n for (Entry<Cassandra.AsyncClient, List<ByteBuffer>> entry : asyncClientToFirstRoundKeys.entrySet()) {\n Cassandra.AsyncClient asyncClient = entry.getKey();\n List<ByteBuffer> keysForThisClient = entry.getValue();\n\n BlockingQueueCallback<multiget_slice_call> callback = new BlockingQueueCallback<multiget_slice_call>();\n firstRoundCallbacks.add(callback);\n\n //if (logger.isTraceEnabled()) { logger.trace(\"round 1: get \" + printKeys(keysForThisClient) + \" from \" + asyncClient); }\n asyncClient.multiget_slice(keysForThisClient, column_parent, predicate, consistencyLevel, LamportClock.sendTimestamp(), callback);\n }\n\n //Gather responses, track both max_evt and min_lvt\n long overallMaxEvt = Long.MIN_VALUE;\n long overallMinLvt = Long.MAX_VALUE;\n\n Map<ByteBuffer, List<ColumnOrSuperColumn>> keyToResult = new HashMap<ByteBuffer, List<ColumnOrSuperColumn>>();\n NavigableMap<Long, List<ByteBuffer>> lvtToKeys = new TreeMap<Long, List<ByteBuffer>>();\n for (BlockingQueueCallback<multiget_slice_call> callback : firstRoundCallbacks) {\n\n MultigetSliceResult result = callback.getResponseNoInterruption().getResult();\n LamportClock.updateTime(result.lts);\n\n for (Entry<ByteBuffer, List<ColumnOrSuperColumn>> entry : result.value.entrySet()) {\n ByteBuffer key = entry.getKey();\n List<ColumnOrSuperColumn> coscList = entry.getValue();\n keyToResult.put(key, coscList);\n\n //find the evt and lvt for the entire row\n EvtAndLvt evtAndLvt = ColumnOrSuperColumnHelper.extractEvtAndLvt(coscList);\n if (!lvtToKeys.containsKey(evtAndLvt.getLatestValidTime())) {\n lvtToKeys.put(evtAndLvt.getLatestValidTime(), new LinkedList<ByteBuffer>());\n }\n lvtToKeys.get(evtAndLvt.getLatestValidTime()).add(key);\n //if (logger.isTraceEnabled()) { logger.trace(\"round 1 response for \" + printKey(key) + \" evt: \" + evtAndLvt.getEarliestValidTime() + \" lvt: \" + evtAndLvt.getLatestValidTime()); }\n\n overallMaxEvt = Math.max(overallMaxEvt, evtAndLvt.getEarliestValidTime());\n overallMinLvt = Math.min(overallMinLvt, evtAndLvt.getLatestValidTime());\n }\n }\n //if (logger.isTraceEnabled()) { logger.trace(\"Min LVT:\" + overallMinLvt + \" Max EVT: \" + overallMaxEvt); }\n\n //Always Execute 2nd round for micro-benchmarking\n if (true) {\n //get the smallest lvt > maxEvt\n long chosenTime = lvtToKeys.navigableKeySet().higher(overallMaxEvt);\n\n List<ByteBuffer> secondRoundKeys = new LinkedList<ByteBuffer>();\n secondRoundKeys.addAll(allKeys);\n\n //Send Round 2 Requests\n Map<Cassandra.AsyncClient, List<ByteBuffer>> asyncClientToSecondRoundKeys = partitionByAsyncClients(secondRoundKeys);\n Queue<BlockingQueueCallback<multiget_slice_by_time_call>> secondRoundCallbacks = new LinkedList<BlockingQueueCallback<multiget_slice_by_time_call>>();\n for (Entry<Cassandra.AsyncClient, List<ByteBuffer>> entry : asyncClientToSecondRoundKeys.entrySet()) {\n Cassandra.AsyncClient asyncClient = entry.getKey();\n List<ByteBuffer> keysForThisClient = entry.getValue();\n\n BlockingQueueCallback<multiget_slice_by_time_call> callback = new BlockingQueueCallback<multiget_slice_by_time_call>();\n secondRoundCallbacks.add(callback);\n\n //if (logger.isTraceEnabled()) { logger.trace(\"round 2: get \" + printKeys(keysForThisClient) + \" from \" + asyncClient); }\n\n asyncClient.multiget_slice_by_time(keysForThisClient, column_parent, predicate, consistencyLevel, chosenTime, LamportClock.sendTimestamp(), callback);\n }\n\n //Gather second round responses\n for (BlockingQueueCallback<multiget_slice_by_time_call> callback : secondRoundCallbacks) {\n MultigetSliceResult result = callback.getResponseNoInterruption().getResult();\n LamportClock.updateTime(result.lts);\n\n substituteValidFirstRoundResults(result, keyToResult);\n\n //if (logger.isTraceEnabled()) { logger.trace(\"round 2 responses for \" + printKeys(result.getValue().keySet())); }\n\n keyToResult.putAll(result.getValue());\n }\n }\n\n //Add dependencies on anything returned and removed deleted columns\n for (Entry<ByteBuffer, List<ColumnOrSuperColumn>> entry : keyToResult.entrySet()) {\n ByteBuffer key = entry.getKey();\n List<ColumnOrSuperColumn> coscList = entry.getValue();\n\n for (Iterator<ColumnOrSuperColumn> cosc_it = coscList.iterator(); cosc_it.hasNext(); ) {\n ColumnOrSuperColumn cosc = cosc_it.next();\n try {\n clientContext.addDep(key, cosc);\n } catch (NotFoundException nfe) {\n //remove deleted results, it's okay for all result to be removed\n cosc_it.remove();\n }\n }\n }\n //if (logger.isTraceEnabled()) {\n // logger.trace(\"forced_2round_multiget_slice result = {}\", keyToResult);\n //}\n return keyToResult;\n }", "boolean getIsClusteringKey();", "@Nullable\n public abstract GridAxis subset(GridSubset params, Formatter errlog);", "@Test\n public void testOverlappingPartitionsOverlappingClusters()\n {\n check(overlappingClustersWithOverlappingPartitions(), 0.75, 1.0);\n }", "@Test\n public void testHeterogeneousSegmentFilterConditionLimit() throws SqlParseException {\n\n val project = \"heterogeneous_segment\";\n // val dfId = \"747f864b-9721-4b97-acde-0aa8e8656cba\"\n // val seg1Id = \"8892fa3f-f607-4eec-8159-7c5ae2f16942\"\n // val seg2Id = \"d75a822c-788a-4592-a500-cf20186dded1\"\n // val seg3Id = \"54eaf96d-6146-45d2-b94e-d5d187f89919\"\n // val seg4Id = \"411f40b9-a80a-4453-90a9-409aac6f7632\"\n // val seg5Id = \"a8318597-cb75-416f-8eb8-96ea285dd2b4\"\n // \n val sql = \"with T1 as (select cal_dt, trans_id \\n\" + \"from test_kylin_fact inner join test_account \\n\"\n + \"on test_kylin_fact.seller_id = test_account.account_id \\n\"\n + \"where cal_dt between date'2012-01-01' and date'2012-01-03'\\n\" + \"group by cal_dt, trans_id)\\n\";\n\n {\n val sqlWithTooManyOrs = sql + \" select * from T1 where \" + \"(cal_dt='2012-01-01' and trans_id = 1) or \\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 2) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 3) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 4) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 5) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 6) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 7) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 8) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 9) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 10) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 12) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 13) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 14) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 15) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 16) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 17) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 18) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 19) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 20)\";\n val contexts = OlapContextTestUtil.getOlapContexts(project, sqlWithTooManyOrs);\n Assert.assertEquals(\n \">=(DEFAULT.TEST_KYLIN_FACT.CAL_DT, 2012-01-01),<=(DEFAULT.TEST_KYLIN_FACT.CAL_DT, 2012-01-03)\",\n contexts.get(0).getExpandedFilterConditions().stream().map(RexNode::toString)\n .collect(Collectors.joining(\",\")));\n }\n\n {\n val sqlWithFilter = sql + \" select * from T1 where \" + \"(cal_dt='2012-01-01' and trans_id = 1) or \\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 2) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 3) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 4) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 5) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 6) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 7) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 8) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 9) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 10)\";\n val contexts = OlapContextTestUtil.getOlapContexts(project, sqlWithFilter);\n Assert.assertNotEquals(\n \">=(DEFAULT.TEST_KYLIN_FACT.CAL_DT, 2012-01-01),<=(DEFAULT.TEST_KYLIN_FACT.CAL_DT, 2012-01-03)\",\n contexts.get(0).getExpandedFilterConditions().stream().map(RexNode::toString)\n .collect(Collectors.joining(\",\")));\n }\n\n }", "private Object isValidColumnVector(List<List<Double>> vector) {\n\t\tInteger nrows = vector.size();\n\n\t\tList<Integer> rowLengths = vector.stream().map(List::size).toList();\n\t\tInteger ncols = rowLengths.stream().mapToInt(Integer::intValue).sum() / rowLengths.size();\n\n\t\treturn (nrows == 3) && (ncols == 1);\n\t}", "private boolean isSubset(List<ConceptLabel> outer, List<ConceptLabel> inner){\n\t\tfor(ConceptLabel in: inner){\n\t\t\tboolean c = false;\n\t\t\tfor(ConceptLabel l: outer){\n\t\t\t\tif(l.getText().equals(in.getText())){\n\t\t\t\t\tc = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(!c)\n\t\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "@Test\r\n public void testIsSubset1() {\r\n Assert.assertEquals(false, set1.isSubset(set2));\r\n }", "public void testSortOnComputedColumn1() throws Exception {\n \t\tccName = new String[] { \"cc\" };\n \t\tccExpr = new String[] { \"(row.COL0%2==0?1:2)\" };\n \n \t\tfor (int i = 0; i < ccName.length; i++) {\n \t\t\tComputedColumn computedColumn = new ComputedColumn(ccName[i],\n \t\t\t\t\tccExpr[i], DataType.ANY_TYPE);\n \t\t\t((BaseDataSetDesign) this.dataSet)\n \t\t\t\t\t.addComputedColumn(computedColumn);\n \t\t}\n \n \t\tString[] bindingNameSort = new String[1];\n \t\tbindingNameSort[0] = \"SORT_DEFINITION\";\n \t\tIBaseExpression[] bindingExprSort = new IBaseExpression[1];\n \t\tbindingExprSort[0] = new ScriptExpression(\"dataSetRow.cc\");\n \n \t\tSortDefinition[] sortDefn = new SortDefinition[] { new SortDefinition() };\n \t\tsortDefn[0].setColumn(\"SORT_DEFINITION\");\n \t\tsortDefn[0].setSortDirection(ISortDefinition.SORT_DESC);\n \n \t\tString[] bindingNameRow = new String[5];\n \t\tbindingNameRow[0] = \"ROW_COL0\";\n \t\tbindingNameRow[1] = \"ROW_COL1\";\n \t\tbindingNameRow[2] = \"ROW_COL2\";\n \t\tbindingNameRow[3] = \"ROW_COL3\";\n \t\tbindingNameRow[4] = \"ROW_cc\";\n \t\tScriptExpression[] bindingExprRow = new ScriptExpression[] {\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL0\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL1\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL2\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL3\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + ccName[0], 0), };\n \n \t\tIResultIterator resultIt = this.executeQuery(this.createQuery(null,\n \t\t\t\tnull, null, bindingNameSort, bindingExprSort, sortDefn, null,\n \t\t\t\tnull, null, bindingNameRow, bindingExprRow));\n \n \t\tprintResult(resultIt, bindingNameRow, bindingExprRow);\n \t\t// assert\n \t\tcheckOutputFile();\n \t}", "protected void checkSlice(int slice) {\n\tif (slice < 0 || slice >= slices) throw new IndexOutOfBoundsException(\"Attempted to access \"+toStringShort()+\" at slice=\"+slice);\n}", "public static boolean IS_SUBFEATURE(Feature a, int index_a, Feature b, int index_b) {\n\n boolean anotinb, bnotina;\n int i, ia, ib;\n\n if (index_a != index_b)\n Dataset.perror(\"Feature.class :: not the same feature (\" + index_a + \" != \" + index_b + \")\");\n if (!a.type.equals(b.type))\n Dataset.perror(\n \"Feature.class :: not the same type of feature (\" + a.type + \" != \" + b.type + \")\");\n\n if (IS_CONTINUOUS(a.type)) {\n if (a.dmin >= b.dmin) {\n if (a.dmax <= b.dmax) return true;\n else\n Dataset.perror(\n \"Feature.class :: inconsistency for subfeature check for : (\"\n + a.dmin\n + \", \"\n + a.dmax\n + \") subseteq (\"\n + b.dmin\n + \", \"\n + b.dmax\n + \") ? \");\n } else if (a.dmax < b.dmax)\n Dataset.perror(\n \"Feature.class :: inconsistency for subfeature check for : (\"\n + a.dmin\n + \", \"\n + a.dmax\n + \") subseteq (\"\n + b.dmin\n + \", \"\n + b.dmax\n + \") ? \");\n } else if (IS_INTEGER(a.type)) {\n if (a.imin >= b.imin) {\n if (a.imax <= b.imax) return true;\n else\n Dataset.perror(\n \"Feature.class :: inconsistency for subfeature check for : (\"\n + a.imin\n + \", \"\n + a.imax\n + \") subseteq (\"\n + b.imin\n + \", \"\n + b.imax\n + \") ? \");\n } else if (a.imax < b.imax)\n Dataset.perror(\n \"Feature.class :: inconsistency for subfeature check for : (\"\n + a.imin\n + \", \"\n + a.imax\n + \") subseteq (\"\n + b.imin\n + \", \"\n + b.imax\n + \") ? \");\n } else if (IS_NOMINAL(a.type)) {\n if (a.modalities == null) return true;\n else if (b.modalities != null) {\n anotinb = bnotina = false;\n ia = ib = -1;\n for (i = 0; i < a.modalities.size(); i++)\n if (!b.modalities.contains((String) a.modalities.elementAt(i))) {\n anotinb = true;\n ia = i;\n }\n for (i = 0; i < b.modalities.size(); i++)\n if (!a.modalities.contains((String) b.modalities.elementAt(i))) {\n bnotina = true;\n ib = i;\n }\n if ((anotinb) && (bnotina))\n Dataset.perror(\n \"Feature.class :: inconsistency for subfeature check for : \"\n + ((String) a.modalities.elementAt(ia))\n + \" not in b and \"\n + ((String) b.modalities.elementAt(ib))\n + \" not in a \");\n else if (!anotinb) return true;\n }\n } else Dataset.perror(\"Feature.class :: no Feature type for \" + a.type);\n\n return false;\n }", "private boolean checkifCollinear(Point[] ptArr, Comparator<Point> cmp, int start){\n\t\tif(start +2 >= ptArr.length) return false;\t\n\t\tif(cmp.compare(ptArr[start],ptArr[start+1]) == cmp.compare(ptArr[start+1],ptArr[start+2]) && cmp.compare(ptArr[start],ptArr[start+1]) == 0){\n\t\t\treturn true;\n\t\t}\t\t\n\t\treturn false;\t\n\t}", "@Test\n\t public void test_Is_Subset_Positive() throws Exception{\t\n\t\t SET setarray= new SET( new int[]{1,2,3,4,5});\n\t\t SET subsetarray= new SET( new int[]{1,2,3});\n\t\t assertTrue(setarray.isSubSet(subsetarray));\t \n\t }", "public void checkBounds() {\n\t\tfor (int k = 0; k < numDataCols; k++) {\n\t\t\tDashDataType<?> dtype = dataTypes[k];\n\n\t\t\tif ( dtype instanceof StringDashDataType ) {\n\t\t\t\tStringDashDataType strtype = (StringDashDataType) dtype;\n\t\t\t\tfor (int j = 0; j < numSamples; j++) {\n\t\t\t\t\tADCMessage msg = strtype.boundsCheckStandardValue(\n\t\t\t\t\t\t\t\t\t\t\t(String) stdObjects[j][k]);\n\t\t\t\t\tif ( msg != null ) {\n\t\t\t\t\t\tmsg.setRowNumber(j+1);\n\t\t\t\t\t\tmsg.setColNumber(k+1);\n\t\t\t\t\t\tmsg.setColName(userColNames[k]);\n\t\t\t\t\t\tstdMsgList.add(msg);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if ( dtype instanceof CharDashDataType ) {\n\t\t\t\tCharDashDataType chartype = (CharDashDataType) dtype;\n\t\t\t\tfor (int j = 0; j < numSamples; j++) {\n\t\t\t\t\tADCMessage msg = chartype.boundsCheckStandardValue(\n\t\t\t\t\t\t\t\t\t\t\t(Character) stdObjects[j][k]);\n\t\t\t\t\tif ( msg != null ) {\n\t\t\t\t\t\tmsg.setRowNumber(j+1);\n\t\t\t\t\t\tmsg.setColNumber(k+1);\n\t\t\t\t\t\tmsg.setColName(userColNames[k]);\n\t\t\t\t\t\tstdMsgList.add(msg);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if ( dtype instanceof IntDashDataType ) {\n\t\t\t\tIntDashDataType inttype = (IntDashDataType) dtype;\n\t\t\t\tfor (int j = 0; j < numSamples; j++) {\n\t\t\t\t\tADCMessage msg = inttype.boundsCheckStandardValue(\n\t\t\t\t\t\t\t\t\t\t\t(Integer) stdObjects[j][k]);\n\t\t\t\t\tif ( msg != null ) {\n\t\t\t\t\t\tmsg.setRowNumber(j+1);\n\t\t\t\t\t\tmsg.setColNumber(k+1);\n\t\t\t\t\t\tmsg.setColName(userColNames[k]);\n\t\t\t\t\t\tstdMsgList.add(msg);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if ( dtype instanceof DoubleDashDataType ) {\n\t\t\t\tDoubleDashDataType dbltype = (DoubleDashDataType) dtype;\n\t\t\t\tfor (int j = 0; j < numSamples; j++) {\n\t\t\t\t\tADCMessage msg = dbltype.boundsCheckStandardValue(\n\t\t\t\t\t\t\t\t\t\t\t(Double) stdObjects[j][k]);\n\t\t\t\t\tif ( msg != null ) {\n\t\t\t\t\t\tmsg.setRowNumber(j+1);\n\t\t\t\t\t\tmsg.setColNumber(k+1);\n\t\t\t\t\t\tmsg.setColName(userColNames[k]);\n\t\t\t\t\t\tstdMsgList.add(msg);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthrow new IllegalArgumentException(\"unexpected data type encountered \" + \n\t\t\t\t\t\t\"in bounds checking: \" + dtype);\n\t\t\t}\n\t\t}\n\t}", "private void checkVertical() {\n\n for(int i = 0; i < 2; i++){ // winning column can be either 0-1-2-(3) or (0)-1-2-3\n for (int j = 0; j < stateArray[3].length; j++) {\n\n if (check3Vertical(i, j)) {\n maskResultArray[stateArray[i][j]] = 1;\n maskArray[i][j] = 1;\n maskArray[i+1][j] = 1;\n maskArray[i+2][j] = 1;\n }\n\n }\n }\n\n }", "private boolean columnCheck() {\n\t\tfor(int col = 0; col < puzzle[0].length; col++) {\n\t\t\tfor(int i = 0; i < puzzle[0].length; i++) {\n\t\t\t\tif(puzzle[i][col] != 0) {\n\t\t\t\t\tfor(int j = i + 1; j < puzzle[0].length; j++) {\n\t\t\t\t\t\tif(puzzle[i][col] == puzzle[j][col])\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "boolean hasCluster();", "public boolean isSetNumClusteringCols() {\n return EncodingUtils.testBit(__isset_bitfield, __NUMCLUSTERINGCOLS_ISSET_ID);\n }", "@Test\n public void testColumnControlInvisibleColumns() {\n final JXTable table = new JXTable(sortableTableModel);\n // columns set to invisible before setting the columnControl\n // will not be inserted into the column control's list\n// table.getColumnExt(\"Last Name\").setVisible(false);\n table.setColumnControlVisible(true);\n int totalColumnCount = table.getColumnCount();\n final TableColumnExt priorityColumn = table.getColumnExt(\"First Name\");\n priorityColumn.setVisible(false);\n ColumnControlButton columnControl = (ColumnControlButton) table.getColumnControl();\n assertNotNull(\"popup menu not null\", columnControl.popup);\n int columnMenuItems = 0;\n Component[] items = ((DefaultColumnControlPopup) columnControl.getColumnControlPopup()).getPopupMenu().getComponents();\n for (int i = 0; i < items.length; i++) {\n if (!(items[i] instanceof JMenuItem)) {\n break;\n }\n columnMenuItems++;\n }\n // wrong assumption - has separator and actions!\n assertEquals(\"menu items must be equal to columns\", totalColumnCount, \n columnMenuItems);\n JCheckBoxMenuItem menuItem = (JCheckBoxMenuItem) ((DefaultColumnControlPopup) columnControl.getColumnControlPopup()).getPopupMenu()\n .getComponent(0);\n // sanit assert\n assertEquals(priorityColumn.getHeaderValue(), menuItem.getText());\n assertEquals(\"selection of menu must be equal to column visibility\", \n priorityColumn.isVisible(), menuItem.isSelected());\n }", "public boolean percolates(){\n return uf.connected(ufSize - 2, ufSize - 1);\n }", "boolean hasPermissionOfCluster(String clusterId, String userName);", "private Boolean isValidColumnMatrix(SimpleMatrix matrix) {\n\t\tInteger nrows = matrix.numRows();\n\t\tInteger ncols = matrix.numCols();\n\n\t\treturn (ncols == 1) && (nrows == 3);\n\t}", "@Test\n public void testWrongNumberColumns() throws SetUpException {\n List<VariableWithFeatureEffect> effects = run(new File(TESTDATA, \"wrong_columns.csv\"));\n \n Formula disjunctonFE = or(\"VAR_B\", not(\"VAR_C\"));\n \n assertThat(effects, is(Arrays.asList(new VariableWithFeatureEffect[] {\n new VariableWithFeatureEffect(\"VAR_A\", disjunctonFE),\n new VariableWithFeatureEffect(\"VAR_C\", True.INSTANCE),\n new VariableWithFeatureEffect(\"VAR_D\", disjunctonFE),\n new VariableWithFeatureEffect(\"VAR_E\", True.INSTANCE)\n })));\n }", "boolean isRight() {\r\n\t\tint maxlength;\r\n\t\tmaxlength = Math.max(Math.max(side1, side2), side3);\r\n\t\treturn (maxlength * maxlength == (side1 * side1) + (side2 * side2) + (side3 * side3) - (maxlength * maxlength));\r\n\t}", "@Test\n public void testBoundsAsCompositesWithMultiInRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n Restriction in = newMultiIN(cfMetaData, 0, asList(value1, value2), asList(value2, value3));\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(in);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertComposite(bounds.get(1), value2, value3, EOC.END);\n }", "private boolean columnIsFree(int column){\n return this.tiles[0][column - 1] == 'O';\n }", "boolean hasCol();", "private void coverColumnsOfStarredZeroes( final int[] starsByCol, final int[] coveredCols )\n\t{\n\t\tfor ( int i = 0; i < starsByCol.length; i++ )\n\t\t{\n\t\t\tcoveredCols[ i ] = -1 == starsByCol[ i ] ? 0 : 1;\n\t\t}\n\t}", "private static boolean sliceIsValid(final int[] slice, final int flowOrderLength) {\n int consecutiveZeros = 0;\n for ( int key : slice ) {\n if ( key != 0 ) {\n consecutiveZeros = 0;\n } else {\n consecutiveZeros++;\n if ( consecutiveZeros >= (flowOrderLength - 1) ) {\n return false;\n }\n }\n }\n\n // if here, not found -> valid\n return true;\n }", "@Test\n public void testColocatedPartitionedRegion() throws Throwable {\n createCacheInAllVms();\n redundancy = 0;\n localMaxmemory = 50;\n totalNumBuckets = 11;\n\n regionName = \"A\";\n colocatedWith = null;\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"B\";\n colocatedWith = SEPARATOR + \"A\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"C\";\n colocatedWith = SEPARATOR + \"A\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"D\";\n colocatedWith = SEPARATOR + \"B\";\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"E\";\n colocatedWith = SEPARATOR + \"B\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"F\";\n colocatedWith = SEPARATOR + \"B\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"G\";\n colocatedWith = SEPARATOR + \"C\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"H\";\n colocatedWith = SEPARATOR + \"C\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"I\";\n colocatedWith = SEPARATOR + \"C\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"J\";\n colocatedWith = SEPARATOR + \"D\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"K\";\n colocatedWith = SEPARATOR + \"D\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"L\";\n colocatedWith = SEPARATOR + \"E\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"M\";\n colocatedWith = SEPARATOR + \"F\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"N\";\n colocatedWith = SEPARATOR + \"G\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"O\";\n colocatedWith = SEPARATOR + \"I\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n accessor.invoke(() -> PRColocationDUnitTest.validateColocatedRegions(\"A\"));\n\n accessor.invoke(() -> PRColocationDUnitTest.validateColocatedRegions(\"D\"));\n\n accessor.invoke(() -> PRColocationDUnitTest.validateColocatedRegions(\"H\"));\n\n accessor.invoke(() -> PRColocationDUnitTest.validateColocatedRegions(\"B\"));\n\n accessor.invoke(() -> PRColocationDUnitTest.validateColocatedRegions(\"K\"));\n }", "private boolean isNeedCut(Map<Set<String>, Integer> preMap, Set<String> set) {\n\t\tboolean flag = false;\n\t\tList<Set<String>> subSets = getSubSets(set);\n\t\tfor(Set<String> subSet : subSets){\n\t\t\tif(!preMap.containsKey(subSet)){\n\t\t\t\tflag = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn flag;\n\t}", "List<Online> selectByExampleWithRowbounds(OnlineExample example, RowBounds rowBounds);", "boolean isNeedSharding();", "private boolean checkRowForQuadPair(int i1) {\n for(int j=0;j<4;j++)\r\n {\r\n if(Kmap[i1][j]==0 || Kmap[i1][j]==-1)\r\n return false;\r\n }\r\n for(int j=0;j<4;j++)\r\n {\r\n Kmap[i1][j]=-1;\r\n }\r\n return true;\r\n }", "public static boolean shouldProcessSlice(OBSlice x) throws Exception {\n return x.size() <= maxSliceSize;\n }", "public boolean hasThreeSides() { return hasNMarkedSides(3); }", "public boolean percolates() {\n\t\treturn linearGrid.connected(0, 1);\n\t}", "private boolean outOfBounds(int nidx1){\n\t\treturn (nidx1 < 0 || nidx1 >= numofvert);\n\t}", "public boolean percolates(){\n \tif(this.gridLength == 1){\n \t\treturn isOpen(1,1);\n \t}\n \treturn (this.bottom[unionTest.find(0)]);\n }", "public void testColumnaIzquierdaLlena( )\n {\n setupEscenario2( );\n triqui.limpiarTablero( );\n triqui.marcarCasilla( 1, marcaJugador1 );\n triqui.marcarCasilla( 4, marcaJugador1 );\n triqui.marcarCasilla( 7, marcaJugador1 );\n assertTrue( triqui.columnaIzquierdaLlena( marcaJugador1 ) );\n assertTrue( triqui.ganoJuego( marcaJugador1 ) );\n }", "private boolean canSetSafelyDownRow(MTreeNode row, MTreeNode col, UnionDoubleIntervals newVal) {\n\t\tMTreeNode colKids[]=col.getChildren();\n\t\tif (colKids.length==0) return true;\n\t\tUnionDoubleIntervals colKidsInts[]=new UnionDoubleIntervals[colKids.length];\n\t\tfor(int i=0; i<colKids.length; i++) {\n\t\t\tcolKidsInts[i]=get(row, colKids[i]);\n\t\t\tif (colKidsInts[i]==null) {\n\t\t\t\t//If a sibling is null, I cannot check, so just return\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\tUnionDoubleIntervals sum=UnionDoubleIntervals.sum(colKidsInts);\n\t\treturn newVal.intersects(sum);\n\t}", "Boolean isValid(ArrayList<Integer> colQ){\n \n int curcol = colQ.size() - 1;\n int row = colQ.get(colQ.size() - 1);\n\n int i = 0;\n int j = 0;\n for(i = curcol-1, j = 1; i >= 0; i--, j++)\n {\n // check if we have two of the same row || check diags\n if(row == colQ.get(i) || row+j == colQ.get(i) || row-j == colQ.get(i)) return false;\n }\n return true;\n \n }", "private boolean inBounds(int row, int col){\n if (row > -1 && row < 120 && col > -1 && col < 160)\n return true;\n return false;\n }", "public boolean isReviewed(int index) {\n if (index % 2 != 0) {\n index -= 1;\n }\n index = index / 2;\n if ( ( (Integer) clusters[index][3]).intValue() == 1) {\n return true;\n }\n else {\n return false;\n }\n }", "private List<Integer> chooseInnerModelFeatureColumns(Matrix inputs, Matrix labels)\n\t{\n\t\tMatrix inputsShuffled = new Matrix(inputs);\n\t\tMatrix labelsShuffled = new Matrix(labels);\n\t\tinputs = null;\n\t\tlabels = null;\n\t\tinputsShuffled.shuffle(rand, labelsShuffled);\n\n\t\tMatrix[] sets = createValidationSet(inputsShuffled, labelsShuffled, validationSetPercent);\n\t\tMatrix tInputs = sets[0];\n\t\tMatrix tLabels = sets[1];\n\t\tMatrix vInputs = sets[2];\n\t\tMatrix vLabels = sets[3];\n\n\t\t// Greedily search for the best columns to train model i on.\n\t\t\t\n\t\tList<Integer> keepColumns = new ArrayList<>(featureColumnsToAlwaysUse);\n\t\t\n\t\tdouble lastIterationScore;\n\t\tif (featureColumnsToAlwaysUse.isEmpty())\n\t\t{\n\t\t\tlastIterationScore = Double.NEGATIVE_INFINITY;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tSupervisedLearner initialModel = trainOnColumns(tInputs, tLabels, keepColumns);\n\t\t\tlastIterationScore = validateOnColumns(vInputs, vLabels, keepColumns, initialModel);\n\t\t}\n\t\t\n\t\tLogger.println(\"initial lastIterationScore: \" + lastIterationScore);\n\t\t\n\t\tList<Integer> featureSelectionCols = Helper.iteratorToList(new Range(tInputs.cols()));\n\t\tfeatureSelectionCols.removeAll(featureColumnsToAlwaysUse);\n\t\t\n\t\twhile (!featureSelectionCols.isEmpty())\n\t\t{\n\t\t\t// Find the feature selection column which helps the model the most.\n\t\t\tTuple2<Integer, Double> bestTuple = featureSelectionCols.stream()\n\t\t\t\t\t.map(c -> \n\t\t\t\t\t{\n\t\t\t\t\t\tList<Integer> columns = new ArrayList<>(keepColumns);\n\t\t\t\t\t\tcolumns.add(c);\n\t\t\t\t\t\tSupervisedLearner model = trainOnColumns(tInputs, tLabels, columns);\n\t\t\t\t\t\tdouble score = validateOnColumns(vInputs, vLabels, columns, model);\n\t\t\t\t\t\treturn new Tuple2<Integer, Double>(c, score);\n\t\t\t\t\t})\n\t\t\t\t\t.max((t1, t2) -> Double.compare(t1.getSecond(), t2.getSecond())).get();\n\n\t\t\tif (bestTuple.getSecond() > lastIterationScore)\n\t\t\t{\n\t\t\t\tLogger.println(\"Keeping column \" + bestTuple.getFirst() + \", new score: \" + bestTuple.getSecond());\n\t\t\t\tkeepColumns.add(bestTuple.getFirst());\n\t\t\t\tfeatureSelectionCols.remove(bestTuple.getFirst());\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tlastIterationScore = bestTuple.getSecond();\n\t\t}\n\t\t\n\t\treturn keepColumns;\n\t}", "private boolean checkOverlap(int row, int col, int length){\n \tif(!inBounds(row,col)){\n \t\treturn false;\n \t}\n \tfor(int i = row; i < row + length; i++ ){\n\t\t\tfor(int j = col; j < col + length; j++){\n\t\t\t\tif(grid[i][col] == 1 || row + length >= 10)\n\t\t\t\t\treturn false;\n\t\t\t\tif(grid[row][j] == 1 || col + length >= 10)\n\t\t\t\t\treturn false;\n\t\t\t}\n \t\t\n \t}\n \treturn true;\n }", "private boolean columnOkay(int row, int column) throws Exception {\n ArrayList<Integer> clue = puzzle.getColumnClue(column);\n var filledGroups = searchBoard.getFilledGroups(column, TraversalType.COLUMN);\n if(filledGroups.size() > clue.size()) {\n return false;\n }\n int availableSquares = puzzle.getRows()-row-1;\n int tilesRequired;\n if(filledGroups.size() == 0) {\n tilesRequired = clue.size()-1;\n for(int s : clue) {\n tilesRequired += s;\n }\n } else {\n int index = filledGroups.size()-1;\n if(filledGroups.get(index) > clue.get(index)) {\n return false;\n }\n if(searchBoard.getState(row, column) == CellState.EMPTY && !filledGroups.get(index).equals(clue.get(index))) {\n return false;\n }\n tilesRequired = clue.get(index)-filledGroups.get(index);\n tilesRequired += clue.size()-filledGroups.size();\n if(searchBoard.getState(row, column) == CellState.EMPTY) {\n --tilesRequired;\n }\n for(int i = index+1; i < clue.size(); ++i) {\n tilesRequired += clue.get(i);\n }\n }\n return availableSquares >= tilesRequired;\n }", "@Test\n \tpublic void whereClauseForNodeRightOverlap() {\n \t\tnode23.addJoin(new RightOverlap(node42));\n \t\tcheckWhereCondition(\n \t\t\t\tjoin(\"=\", \"_node23.text_ref\", \"_node42.text_ref\"),\n \t\t\t\tjoin(\">=\", \"_node23.right\", \"_node42.right\"),\n \t\t\t\tjoin(\">=\", \"_node42.right\", \"_node23.left\"),\n \t\t\t\tjoin(\">=\", \"_node23.left\", \"_node42.left\")\n \t\t);\n \t}", "private boolean checkSecondaryDiagonal() {\n int diagonalSum = 0;\n for (int i = 0; i < dimensions; i++) {\n diagonalSum += square[(dimensions - 1) * i + dimensions - 1];\n }\n\n return diagonalSum == magicConst;\n }", "public void testGetColumnIndex() {\n TaskSeriesCollection c = createCollection1();\n }", "@Test\n\tpublic void testGetSlice() {\n\t}", "private boolean isExplode(int row, int col){\r\n if(map[row][col].getSafe() == true){\r\n return false;\r\n }\r\n else{\r\n return true;\r\n }\r\n }", "public boolean colision(Nave nave) {\r\n\t\t\r\n\t\tint[] arrayY = cargarPuntoColisionY();\r\n\t\tint[] arrayX = cargarPuntoColisionX();\r\n\t\tboolean A,B,C,D,E,F,G,H;\r\n\t\tboolean fColision = false;\r\n\t\tint i = 0;\r\n\t\t\r\n\t\twhile(i + 1 < arrayY.length && !fColision){\r\n\t\t\r\n\t\t\tA = x + arrayX[i] >= nave.getX();\r\n\t\t\tB = x + arrayX[i] <= (nave.getX() + nave.getWidth());\r\n\t\t\tC = y + arrayY[i] >= nave.getY();\r\n\t\t\tD = y + arrayY[i] <= (nave.getY() + nave.getHeight());\r\n\t\t\tE = (x + arrayX[i+1]) >= nave.getX();\r\n\t\t\tF = (x + arrayX[i+1]) <= (nave.getX() + nave.getWidth());\r\n\t\t\tG = (y + arrayY[i+1]) >= nave.getY();\r\n\t\t\tH = (y + arrayY[i+1]) <= (nave.getY() + nave.getHeight());\r\n\t\t\r\n\t\t\t// funcion de colicion que verifica si uno o mas puntos del borde del objeto nave intersectan con el borde del objeto que ejecuta la funcion\r\n\t\t\tfColision = fColision || (A && B || E && F) && (C && D || G && H) || !A && !F && ( !H && D || G && H) || !C && !H && (B && !F || !A && E);\r\n\t\t\ti = i+2;\r\n\t\t}\r\n\t\t\r\n\t\treturn getVisible() && nave.getVisible() && fColision;\r\n\t\t\t\r\n\t\t\t\t\r\n\t}", "private static int[][] removeCollinear(int[][] pointSet)\n {\n int numCollinear = 0;\n for (int i = 1; i<= pointSet[0].length-2; i++)\n {\n if (((pointSet[0][i]-pointSet[0][0])*(pointSet[1][i+1]-pointSet[1][0]))-\n ((pointSet[0][i+1]-pointSet[0][0])*(pointSet[1][i]-pointSet[1][0])) == 0)\n numCollinear++;\n }\n if (numCollinear == 0)\n return pointSet;\n\n int[][] pointSetTemp = new int[2][pointSet[0].length-numCollinear];\n pointSetTemp[0][0] = pointSet[0][0]; pointSetTemp[1][0] = pointSet[1][0];\n int j=1;\n for (int i = 1; i<= pointSet[0].length-2; i++)\n {\n if (((pointSet[0][i]-pointSet[0][0])*(pointSet[1][i+1]-pointSet[1][0]))-\n ((pointSet[0][i+1]-pointSet[0][0])*(pointSet[1][i]-pointSet[1][0])) == 0)\n {\n int d1 = Math.abs((pointSet[0][i]-pointSet[0][0])^2 + (pointSet[1][i]-pointSet[1][0])^2);\n int d2 = Math.abs((pointSet[0][i+1]-pointSet[0][0])^2 + (pointSet[1][i+1]-pointSet[1][0])^2);\n if (d1 > d2)\n {\n pointSetTemp[0][j] = pointSet[0][i]; pointSetTemp[1][j] = pointSet[1][i];\n i++; j++;\n }\n else\n {\n pointSetTemp[0][j] = pointSet[0][i+1]; pointSetTemp[1][j] = pointSet[1][i+1];\n i++; j++;\n }\n }\n else\n {\n pointSetTemp[0][j] = pointSet[0][i]; pointSetTemp[1][j] = pointSet[1][i];\n j++;\n }\n }\n if (j < pointSetTemp[0].length)\n {\n pointSetTemp[0][j] = pointSet[0][pointSet[0].length-1];\n pointSetTemp[1][j] = pointSet[1][pointSet[0].length-1];\n }\n return pointSetTemp;\n }", "private boolean check3Vertical(int i, int j) {\n if(stateArray[i][j] == stateArray[i+1][j] && stateArray[i][j] == stateArray[i+2][j]) {\n return true;\n }\n return false;\n }" ]
[ "0.71079266", "0.7107773", "0.7075577", "0.70683056", "0.7041993", "0.6992055", "0.67844117", "0.6641395", "0.6572737", "0.6390872", "0.6334486", "0.6077441", "0.60113037", "0.569806", "0.56356424", "0.56186855", "0.537637", "0.53422374", "0.5258379", "0.5230412", "0.5190661", "0.51642096", "0.51598495", "0.49897948", "0.49588948", "0.49566", "0.49454963", "0.48917437", "0.4890722", "0.48812214", "0.48719552", "0.4870272", "0.48526472", "0.48198482", "0.48009866", "0.47986254", "0.47904602", "0.47793475", "0.47738346", "0.472491", "0.47234523", "0.4715065", "0.471221", "0.47053728", "0.46810415", "0.4678409", "0.46633267", "0.4656244", "0.4651245", "0.4649927", "0.46423635", "0.46348962", "0.4621612", "0.462108", "0.46166214", "0.4591223", "0.45910612", "0.45799378", "0.4578189", "0.45729885", "0.4566677", "0.45602605", "0.4559847", "0.45578086", "0.45544952", "0.4535139", "0.45266467", "0.45155483", "0.45141244", "0.4513815", "0.45021945", "0.45005003", "0.4497188", "0.44937584", "0.44743335", "0.44737214", "0.44727755", "0.44683725", "0.4465127", "0.44648334", "0.4462892", "0.4462371", "0.4454753", "0.4453516", "0.4450396", "0.4449793", "0.44476676", "0.44463357", "0.44429022", "0.4442649", "0.4441575", "0.4439386", "0.44343594", "0.4434328", "0.44266114", "0.44234124", "0.44200012", "0.44198784", "0.44169223", "0.44065532" ]
0.6795704
6
Test multicolumn slice restrictions (e.g '(clustering_0, clustering_1) > (1, 2)')
@Test public void testBoundsAsCompositesWithMultiSliceRestrictionsWithTwoClusteringColumn() { CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC); ByteBuffer value1 = ByteBufferUtil.bytes(1); ByteBuffer value2 = ByteBufferUtil.bytes(2); // (clustering_0, clustering1) > (1, 2) Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2); PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(slice); List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value1, value2, EOC.END); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertEmptyComposite(bounds.get(0)); // (clustering_0, clustering1) >= (1, 2) slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2); restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(slice); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value1, value2, EOC.NONE); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertEmptyComposite(bounds.get(0)); // (clustering_0, clustering1) <= (1, 2) slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2); restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(slice); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertEmptyComposite(bounds.get(0)); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value1, value2, EOC.END); // (clustering_0, clustering1) < (1, 2) slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2); restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(slice); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertEmptyComposite(bounds.get(0)); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value1, value2, EOC.START); // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2) slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2); Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2); restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(slice).mergeWith(slice2); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value1, value2, EOC.END); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value2, EOC.START); // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1) slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2); slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1); restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(slice).mergeWith(slice2); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value1, value2, EOC.NONE); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value2, value1, EOC.END); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithTwoAscendingAndTwoDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.DESC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertEmptyComposite(bounds.get(1));\n\n // clustering_0 = 1 AND (clustering_1, clustering_2, clustering_3) > (2, 3, 4)\n Restriction eq = newSingleEq(cfMetaData, 0, value1);\n slice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n restrictions = restrictions.mergeWith(eq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2, clustering_3) > (2, 3, 4)\n Restriction in = newSingleIN(cfMetaData, 0, value1, value2);\n slice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n restrictions = restrictions.mergeWith(in);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n assertComposite(bounds.get(2), value2, value2, EOC.START);\n assertComposite(bounds.get(3), value2, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n assertComposite(bounds.get(2), value2, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(3), value2, EOC.END);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1, clustering_2, clustering_3) <= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) < (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4) AND (clustering_0, clustering_1) < (2, 3)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2, value3);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(1), value2, value3, EOC.START);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4) AND (clustering_0, clustering1, clustering_2, clustering_3) <= (4, 3, 2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value4, value3, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n assertComposite(bounds.get(2), value4, value3, value2, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(1), value4, value3, EOC.START);\n assertComposite(bounds.get(2), value4, value3, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneAscendingAndOneDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n assertComposite(bounds.get(2), value2, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertComposite(bounds.get(1), value2, EOC.START);\n assertComposite(bounds.get(2), value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsMixingAscendingDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.DESC, Sort.ASC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(3));\n\n // clustering_0 = 1 AND (clustering_1, clustering_2, clustering_3) > (2, 3, 4)\n Restriction eq = newSingleEq(cfMetaData, 0, value1);\n slice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n restrictions = restrictions.mergeWith(eq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(3));\n\n\n // (clustering_0, clustering1, clustering_2, clustering_3) <= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, value4, EOC.NONE);\n assertComposite(bounds.get(3), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) < (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(3), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4) AND (clustering_0, clustering_1) < (2, 3)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2, value3);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(5, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n assertComposite(bounds.get(4), value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(5, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertComposite(bounds.get(3), value2, EOC.START);\n assertComposite(bounds.get(4), value2, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4) AND (clustering_0, clustering1, clustering_2, clustering_3) <= (4, 3, 2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value4, value3, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(7, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n assertComposite(bounds.get(4), value4, value3, EOC.START);\n assertComposite(bounds.get(5), value4, value3, value2, value1, EOC.NONE);\n assertComposite(bounds.get(6), value4, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(7, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertComposite(bounds.get(3), value4, EOC.START);\n assertComposite(bounds.get(4), value4, value3, value2, EOC.START);\n assertComposite(bounds.get(5), value4, value3, value2, EOC.END);\n assertComposite(bounds.get(6), value4, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneDescendingAndOneAscendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0) > (1) AND (clustering_0, clustering1) < (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.END);\n assertComposite(bounds.get(2), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.END);\n assertComposite(bounds.get(1), value1, EOC.START);\n assertComposite(bounds.get(2), value1, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithTwoDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiEqAndSingleSliceRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n\n // (clustering_0, clustering_1) = (1, 2) AND clustering_2 > 3\n Restriction multiEq = newMultiEq(cfMetaData, 0, value1, value2);\n Restriction singleSlice = newSingleSlice(cfMetaData, 2, Bound.START, false, value3);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiEq).mergeWith(singleSlice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithSingleEqAndSliceRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n ByteBuffer value5 = ByteBufferUtil.bytes(5);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) > (2, 3)\n Restriction singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction multiSlice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiSlice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) > (2, 3) AND (clustering_1) < (4)\n singleEq = newSingleEq(cfMetaData, 0, value1);\n multiSlice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3);\n Restriction multiSlice2 = newMultiSlice(cfMetaData, 1, Bound.END, false, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiSlice2).mergeWith(singleEq).mergeWith(multiSlice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value4, EOC.START);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) => (2, 3) AND (clustering_1, clustering_2) <= (4, 5)\n singleEq = newSingleEq(cfMetaData, 0, value1);\n multiSlice = newMultiSlice(cfMetaData, 1, Bound.START, true, value2, value3);\n multiSlice2 = newMultiSlice(cfMetaData, 1, Bound.END, true, value4, value5);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiSlice2).mergeWith(singleEq).mergeWith(multiSlice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value4, value5, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithSliceRestrictionsAndOneClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newSingleSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newSingleSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneDescendingClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithSliceRestrictionsAndOneDescendingClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newSingleSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newSingleSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n }", "private static Restriction newMultiSlice(CFMetaData cfMetaData, int firstIndex, Bound bound, boolean inclusive, ByteBuffer... values)\n {\n List<ColumnDefinition> columnDefinitions = new ArrayList<>();\n for (int i = 0; i < values.length; i++)\n {\n columnDefinitions.add(getClusteringColumnDefinition(cfMetaData, i + firstIndex));\n }\n return new MultiColumnRestriction.Slice(columnDefinitions, bound, inclusive, toMultiItemTerminal(values));\n }", "@Test\n public void testBoundsAsCompositesWithOneEqRestrictionsAndTwoClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer clustering_0 = ByteBufferUtil.bytes(1);\n Restriction eq = newSingleEq(cfMetaData, 0, clustering_0);\n\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithOneEqRestrictionsAndOneClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC);\n\n ByteBuffer clustering_0 = ByteBufferUtil.bytes(1);\n Restriction eq = newSingleEq(cfMetaData, 0, clustering_0);\n\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithEqAndSliceRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n\n Restriction eq = newSingleEq(cfMetaData, 0, value3);\n\n Restriction slice = newSingleSlice(cfMetaData, 1, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 1, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 1, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 1, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 1, Bound.START, false, value1);\n Restriction slice2 = newSingleSlice(cfMetaData, 1, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value2, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 1, Bound.START, true, value1);\n slice2 = newSingleSlice(cfMetaData, 1, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithSingleEqAndMultiEqRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) = (2, 3)\n Restriction singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction multiEq = newMultiEq(cfMetaData, 1, value2, value3);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiEq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n // clustering_0 = 1 AND clustering_1 = 2 AND (clustering_2, clustering_3) = (3, 4)\n singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction singleEq2 = newSingleEq(cfMetaData, 1, value2);\n multiEq = newMultiEq(cfMetaData, 2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(singleEq2).mergeWith(multiEq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n\n // (clustering_0, clustering_1) = (1, 2) AND clustering_2 = 3\n singleEq = newSingleEq(cfMetaData, 2, value3);\n multiEq = newMultiEq(cfMetaData, 0, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiEq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) = (2, 3) AND clustering_3 = 4\n singleEq = newSingleEq(cfMetaData, 0, value1);\n singleEq2 = newSingleEq(cfMetaData, 3, value4);\n multiEq = newMultiEq(cfMetaData, 1, value2, value3);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiEq).mergeWith(singleEq2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithSingleEqAndMultiINRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n ByteBuffer value5 = ByteBufferUtil.bytes(5);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) IN ((2, 3), (4, 5))\n Restriction singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction multiIN = newMultiIN(cfMetaData, 1, asList(value2, value3), asList(value4, value5));\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiIN);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(1), value1, value4, value5, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(1), value1, value4, value5, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) IN ((2, 3))\n singleEq = newSingleEq(cfMetaData, 0, value1);\n multiIN = newMultiIN(cfMetaData, 1, asList(value2, value3));\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiIN).mergeWith(singleEq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n // clustering_0 = 1 AND clustering_1 = 5 AND (clustering_2, clustering_3) IN ((2, 3), (4, 5))\n singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction singleEq2 = newSingleEq(cfMetaData, 1, value5);\n multiIN = newMultiIN(cfMetaData, 2, asList(value2, value3), asList(value4, value5));\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiIN).mergeWith(singleEq2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value5, value2, value3, EOC.START);\n assertComposite(bounds.get(1), value1, value5, value4, value5, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value5, value2, value3, EOC.END);\n assertComposite(bounds.get(1), value1, value5, value4, value5, EOC.END);\n }", "private boolean isSubsetOf(List<String> permissions2,\n\t\t\tList<String> permissions3) {\n\t\treturn false;\n\t}", "private boolean isSubsetOf(int firstRow, int secondRow) {\n for (int i = 0; i < universalSetSize; i++) {\n if (input[firstRow][i] && !input[secondRow][i]) {\n return false;\n }\n }\n return true;\n }", "@Test\n public void testBoundsAsCompositesWithOneInRestrictionsAndOneClusteringColumn()\n {\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n Restriction in = newSingleIN(cfMetaData, 0, value1, value2, value3);\n\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(in);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.START);\n assertComposite(bounds.get(2), value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n assertComposite(bounds.get(1), value2, EOC.END);\n assertComposite(bounds.get(2), value3, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiEqRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n Restriction eq = newMultiEq(cfMetaData, 0, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n }", "private static Restriction newMultiEq(CFMetaData cfMetaData, int firstIndex, ByteBuffer... values)\n {\n List<ColumnDefinition> columnDefinitions = new ArrayList<>();\n for (int i = 0; i < values.length; i++)\n {\n columnDefinitions.add(getClusteringColumnDefinition(cfMetaData, firstIndex + i));\n }\n return new MultiColumnRestriction.EQ(columnDefinitions, toMultiItemTerminal(values));\n }", "@Test\n public void testBoundsAsCompositesWithMultiInRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n Restriction in = newMultiIN(cfMetaData, 0, asList(value1, value2), asList(value2, value3));\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(in);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertComposite(bounds.get(1), value2, value3, EOC.END);\n }", "protected void checkBox(int slice, int row, int column, int depth, int height, int width) {\n\tif (slice<0 || depth<0 || slice+depth>slices || row<0 || height<0 || row+height>rows || column<0 || width<0 || column+width>columns) throw new IndexOutOfBoundsException(toStringShort()+\", slice:\"+slice+\", row:\"+row+\" ,column:\"+column+\", depth:\"+depth+\" ,height:\"+height+\", width:\"+width);\n}", "@Test\n\t public void test_Is_Subset_Positive() throws Exception{\t\n\t\t SET setarray= new SET( new int[]{1,2,3,4,5});\n\t\t SET subsetarray= new SET( new int[]{1,2,3});\n\t\t assertTrue(setarray.isSubSet(subsetarray));\t \n\t }", "private static Restriction newSingleSlice(CFMetaData cfMetaData, int index, Bound bound, boolean inclusive, ByteBuffer value)\n {\n ColumnDefinition columnDef = getClusteringColumnDefinition(cfMetaData, index);\n return new SingleColumnRestriction.Slice(columnDef, bound, inclusive, toTerm(value));\n }", "@Nullable\n public abstract GridAxis subset(GridSubset params, Formatter errlog);", "private boolean subGridCheck() {\n\t\tint sqRt = (int)Math.sqrt(dimension);\n\t\tfor(int i = 0; i < sqRt; i++) {\n\t\t\tint increment = i * sqRt;\n\t\t\tfor(int val = 1; val <= dimension; val++) {\n\t\t\t\tint valCounter = 0;\n\t\t\t\tfor(int row = 0 + increment; row < sqRt + increment; row++) {\n\t\t\t\t\tfor(int col = 0 + increment; col < sqRt + increment; col++) {\n\t\t\t\t\t\tif(puzzle[row][col] == val)\n\t\t\t\t\t\t\tvalCounter++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(valCounter >= 2)\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "@Test\n public void testOverlappingPartitionsOverlappingClusters()\n {\n check(overlappingClustersWithOverlappingPartitions(), 0.75, 1.0);\n }", "public interface IStoppingCriteria {\n\n /**\n * Determine the degree of clustering agreement\n * @param cluster1 one clustering results\n * @param cluster2 the other clustering results\n * @return the degree of clustering agreement; 1 refers to be the same clustering results; 0 refers to be the totally different clustering results\n */\n public double computeSimilarity(int[] cluster1, int[] cluster2);\n\n}", "protected void checkSlice(int slice) {\n\tif (slice < 0 || slice >= slices) throw new IndexOutOfBoundsException(\"Attempted to access \"+toStringShort()+\" at slice=\"+slice);\n}", "@Test\r\n public void testIsSubset1() {\r\n Assert.assertEquals(false, set1.isSubset(set2));\r\n }", "private Object isValidColumnVector(List<List<Double>> vector) {\n\t\tInteger nrows = vector.size();\n\n\t\tList<Integer> rowLengths = vector.stream().map(List::size).toList();\n\t\tInteger ncols = rowLengths.stream().mapToInt(Integer::intValue).sum() / rowLengths.size();\n\n\t\treturn (nrows == 3) && (ncols == 1);\n\t}", "private boolean checkRowCol(int c1, int c2, int c3) \r\n {\r\n return ((c1 != -1) && (c1 == c2) && (c2 == c3)); //eida ekhon porjonto kaaj e lage nai\r\n }", "@Test\n public void testHardClustersWithOverlappingPartitions()\n {\n check(hardClustersWithOverlappingPartitions(), 0.0, 1.0);\n }", "@Test\n\t public void test_Is_Subset_Negative() throws Exception{\t\n\t\t SET setarray= new SET( new int[]{1,2,3,4,5});\n\t\t SET subsetarray= new SET( new int[]{7,8});\n\t\t assertFalse(setarray.isSubSet(subsetarray));\t \n\t }", "public static ASTNode evaluateSlice(ASTNode compound_matrix, ArrayList<ASTNode> indices) {\n\t if(indices.size()==0) {\n\t assert !(compound_matrix instanceof CompoundMatrix || compound_matrix instanceof EmptyMatrix);\n\t return compound_matrix;\n\t }\n\t \n\t ASTNode sliceindex=indices.get(0);\n\t \n\t if(compound_matrix instanceof EmptyMatrix) {\n // Construct new matrix domain for empty matrix.\n // First get the matrix domain for compound_matrix (which is itself an empty matrix)\n ASTNode matdom=compound_matrix.getChild(0);\n \n // Get indices\n ArrayList<ASTNode> empty_idx=matdom.getChildren(3);\n \n assert empty_idx.size()==indices.size();\n \n for(int i=empty_idx.size()-1; i>=0; i--) {\n if(! indices.get(i).equals(new IntegerDomain(new Range(null, null)))) {\n // If indices.get(i) is a constant, remove that dimension. \n empty_idx.remove(i);\n }\n }\n \n return new EmptyMatrix(new MatrixDomain(compound_matrix.getChild(0).getChild(0), // get original base domain. \n empty_idx));\n }\n\t \n // Must be a compound matrix from here on. \n if(sliceindex.isSet()) {\n assert ! sliceindex.isFiniteSetUpper() && ! sliceindex.isFiniteSetLower(); // Should be ..\n ArrayList<ASTNode> newcm=new ArrayList<ASTNode>();\n \n ArrayList<ASTNode> restindices=new ArrayList<ASTNode>(indices);\n restindices.remove(0);\n \n for(int i=1; i<compound_matrix.numChildren(); i++) {\n ASTNode tmp=evaluateSlice(compound_matrix.getChildConst(i), restindices);\n if(tmp==null) return null;\n newcm.add(tmp);\n }\n return new CompoundMatrix(compound_matrix.getChild(0), newcm); // Take index domain from original CM.\n\t }\n\t else {\n\t // This index must be a constant\n\t ArrayList<Long> cmindex;\n if(compound_matrix instanceof CompoundMatrix) {\n cmindex=compound_matrix.getChild(0).getValueSet();\n }\n else if (compound_matrix instanceof EmptyMatrix) {\n cmindex=new ArrayList<Long>();\n }\n else {\n cmindex=null;\n }\n\t \n\t long val=sliceindex.getValue();\n\t int idxval=cmindex.indexOf(val);\n\t \n\t if(idxval==-1) {\n\t // Matrix is indexed out of range. Undefined. Delay evaluation. \n\t return null;\n\t }\n\t \n ArrayList<ASTNode> restindices=new ArrayList<ASTNode>(indices);\n restindices.remove(0);\n\t \n\t return evaluateSlice(compound_matrix.getChildConst(idxval+1), restindices);\n\t }\n\t}", "@Test\n public void testHeterogeneousSegmentFilterConditionLimit() throws SqlParseException {\n\n val project = \"heterogeneous_segment\";\n // val dfId = \"747f864b-9721-4b97-acde-0aa8e8656cba\"\n // val seg1Id = \"8892fa3f-f607-4eec-8159-7c5ae2f16942\"\n // val seg2Id = \"d75a822c-788a-4592-a500-cf20186dded1\"\n // val seg3Id = \"54eaf96d-6146-45d2-b94e-d5d187f89919\"\n // val seg4Id = \"411f40b9-a80a-4453-90a9-409aac6f7632\"\n // val seg5Id = \"a8318597-cb75-416f-8eb8-96ea285dd2b4\"\n // \n val sql = \"with T1 as (select cal_dt, trans_id \\n\" + \"from test_kylin_fact inner join test_account \\n\"\n + \"on test_kylin_fact.seller_id = test_account.account_id \\n\"\n + \"where cal_dt between date'2012-01-01' and date'2012-01-03'\\n\" + \"group by cal_dt, trans_id)\\n\";\n\n {\n val sqlWithTooManyOrs = sql + \" select * from T1 where \" + \"(cal_dt='2012-01-01' and trans_id = 1) or \\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 2) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 3) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 4) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 5) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 6) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 7) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 8) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 9) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 10) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 12) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 13) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 14) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 15) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 16) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 17) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 18) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 19) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 20)\";\n val contexts = OlapContextTestUtil.getOlapContexts(project, sqlWithTooManyOrs);\n Assert.assertEquals(\n \">=(DEFAULT.TEST_KYLIN_FACT.CAL_DT, 2012-01-01),<=(DEFAULT.TEST_KYLIN_FACT.CAL_DT, 2012-01-03)\",\n contexts.get(0).getExpandedFilterConditions().stream().map(RexNode::toString)\n .collect(Collectors.joining(\",\")));\n }\n\n {\n val sqlWithFilter = sql + \" select * from T1 where \" + \"(cal_dt='2012-01-01' and trans_id = 1) or \\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 2) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 3) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 4) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 5) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 6) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 7) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 8) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 9) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 10)\";\n val contexts = OlapContextTestUtil.getOlapContexts(project, sqlWithFilter);\n Assert.assertNotEquals(\n \">=(DEFAULT.TEST_KYLIN_FACT.CAL_DT, 2012-01-01),<=(DEFAULT.TEST_KYLIN_FACT.CAL_DT, 2012-01-03)\",\n contexts.get(0).getExpandedFilterConditions().stream().map(RexNode::toString)\n .collect(Collectors.joining(\",\")));\n }\n\n }", "public void checkBounds() {\n\t\tfor (int k = 0; k < numDataCols; k++) {\n\t\t\tDashDataType<?> dtype = dataTypes[k];\n\n\t\t\tif ( dtype instanceof StringDashDataType ) {\n\t\t\t\tStringDashDataType strtype = (StringDashDataType) dtype;\n\t\t\t\tfor (int j = 0; j < numSamples; j++) {\n\t\t\t\t\tADCMessage msg = strtype.boundsCheckStandardValue(\n\t\t\t\t\t\t\t\t\t\t\t(String) stdObjects[j][k]);\n\t\t\t\t\tif ( msg != null ) {\n\t\t\t\t\t\tmsg.setRowNumber(j+1);\n\t\t\t\t\t\tmsg.setColNumber(k+1);\n\t\t\t\t\t\tmsg.setColName(userColNames[k]);\n\t\t\t\t\t\tstdMsgList.add(msg);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if ( dtype instanceof CharDashDataType ) {\n\t\t\t\tCharDashDataType chartype = (CharDashDataType) dtype;\n\t\t\t\tfor (int j = 0; j < numSamples; j++) {\n\t\t\t\t\tADCMessage msg = chartype.boundsCheckStandardValue(\n\t\t\t\t\t\t\t\t\t\t\t(Character) stdObjects[j][k]);\n\t\t\t\t\tif ( msg != null ) {\n\t\t\t\t\t\tmsg.setRowNumber(j+1);\n\t\t\t\t\t\tmsg.setColNumber(k+1);\n\t\t\t\t\t\tmsg.setColName(userColNames[k]);\n\t\t\t\t\t\tstdMsgList.add(msg);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if ( dtype instanceof IntDashDataType ) {\n\t\t\t\tIntDashDataType inttype = (IntDashDataType) dtype;\n\t\t\t\tfor (int j = 0; j < numSamples; j++) {\n\t\t\t\t\tADCMessage msg = inttype.boundsCheckStandardValue(\n\t\t\t\t\t\t\t\t\t\t\t(Integer) stdObjects[j][k]);\n\t\t\t\t\tif ( msg != null ) {\n\t\t\t\t\t\tmsg.setRowNumber(j+1);\n\t\t\t\t\t\tmsg.setColNumber(k+1);\n\t\t\t\t\t\tmsg.setColName(userColNames[k]);\n\t\t\t\t\t\tstdMsgList.add(msg);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if ( dtype instanceof DoubleDashDataType ) {\n\t\t\t\tDoubleDashDataType dbltype = (DoubleDashDataType) dtype;\n\t\t\t\tfor (int j = 0; j < numSamples; j++) {\n\t\t\t\t\tADCMessage msg = dbltype.boundsCheckStandardValue(\n\t\t\t\t\t\t\t\t\t\t\t(Double) stdObjects[j][k]);\n\t\t\t\t\tif ( msg != null ) {\n\t\t\t\t\t\tmsg.setRowNumber(j+1);\n\t\t\t\t\t\tmsg.setColNumber(k+1);\n\t\t\t\t\t\tmsg.setColName(userColNames[k]);\n\t\t\t\t\t\tstdMsgList.add(msg);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthrow new IllegalArgumentException(\"unexpected data type encountered \" + \n\t\t\t\t\t\t\"in bounds checking: \" + dtype);\n\t\t\t}\n\t\t}\n\t}", "private boolean isSubset(List<ConceptLabel> outer, List<ConceptLabel> inner){\n\t\tfor(ConceptLabel in: inner){\n\t\t\tboolean c = false;\n\t\t\tfor(ConceptLabel l: outer){\n\t\t\t\tif(l.getText().equals(in.getText())){\n\t\t\t\t\tc = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(!c)\n\t\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "List<Trueorfalse> selectByExample(RowBounds rowBounds);", "public static boolean IS_SUBFEATURE(Feature a, int index_a, Feature b, int index_b) {\n\n boolean anotinb, bnotina;\n int i, ia, ib;\n\n if (index_a != index_b)\n Dataset.perror(\"Feature.class :: not the same feature (\" + index_a + \" != \" + index_b + \")\");\n if (!a.type.equals(b.type))\n Dataset.perror(\n \"Feature.class :: not the same type of feature (\" + a.type + \" != \" + b.type + \")\");\n\n if (IS_CONTINUOUS(a.type)) {\n if (a.dmin >= b.dmin) {\n if (a.dmax <= b.dmax) return true;\n else\n Dataset.perror(\n \"Feature.class :: inconsistency for subfeature check for : (\"\n + a.dmin\n + \", \"\n + a.dmax\n + \") subseteq (\"\n + b.dmin\n + \", \"\n + b.dmax\n + \") ? \");\n } else if (a.dmax < b.dmax)\n Dataset.perror(\n \"Feature.class :: inconsistency for subfeature check for : (\"\n + a.dmin\n + \", \"\n + a.dmax\n + \") subseteq (\"\n + b.dmin\n + \", \"\n + b.dmax\n + \") ? \");\n } else if (IS_INTEGER(a.type)) {\n if (a.imin >= b.imin) {\n if (a.imax <= b.imax) return true;\n else\n Dataset.perror(\n \"Feature.class :: inconsistency for subfeature check for : (\"\n + a.imin\n + \", \"\n + a.imax\n + \") subseteq (\"\n + b.imin\n + \", \"\n + b.imax\n + \") ? \");\n } else if (a.imax < b.imax)\n Dataset.perror(\n \"Feature.class :: inconsistency for subfeature check for : (\"\n + a.imin\n + \", \"\n + a.imax\n + \") subseteq (\"\n + b.imin\n + \", \"\n + b.imax\n + \") ? \");\n } else if (IS_NOMINAL(a.type)) {\n if (a.modalities == null) return true;\n else if (b.modalities != null) {\n anotinb = bnotina = false;\n ia = ib = -1;\n for (i = 0; i < a.modalities.size(); i++)\n if (!b.modalities.contains((String) a.modalities.elementAt(i))) {\n anotinb = true;\n ia = i;\n }\n for (i = 0; i < b.modalities.size(); i++)\n if (!a.modalities.contains((String) b.modalities.elementAt(i))) {\n bnotina = true;\n ib = i;\n }\n if ((anotinb) && (bnotina))\n Dataset.perror(\n \"Feature.class :: inconsistency for subfeature check for : \"\n + ((String) a.modalities.elementAt(ia))\n + \" not in b and \"\n + ((String) b.modalities.elementAt(ib))\n + \" not in a \");\n else if (!anotinb) return true;\n }\n } else Dataset.perror(\"Feature.class :: no Feature type for \" + a.type);\n\n return false;\n }", "private boolean checkOverlap(int row, int col, int length){\n \tif(!inBounds(row,col)){\n \t\treturn false;\n \t}\n \tfor(int i = row; i < row + length; i++ ){\n\t\t\tfor(int j = col; j < col + length; j++){\n\t\t\t\tif(grid[i][col] == 1 || row + length >= 10)\n\t\t\t\t\treturn false;\n\t\t\t\tif(grid[row][j] == 1 || col + length >= 10)\n\t\t\t\t\treturn false;\n\t\t\t}\n \t\t\n \t}\n \treturn true;\n }", "Boolean subset(MultiSet<X> s);", "@Test\n\tpublic void testGetSlice() {\n\t}", "Boolean isCollinearTo(IVec3 v);", "private int restrictSection(Message msg, String parameter) {\n int sec = Integer.parseInt(parameter);\n\n if(sec > 2) {\n MessageChannel ch = msg.getChannel();\n ch.sendMessage(\"`Error: Invalid query [section not 0-2]. Query terminated.`\").queue();\n return -1;\n }\n else if(sec == 2) {\n partTwo = true;\n upperProblem = 8;\n }\n\n return sec;\n }", "@Test\n public void testBoundsAsCompositesWithEqAndInRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n Restriction eq = newSingleEq(cfMetaData, 0, value1);\n Restriction in = newSingleIN(cfMetaData, 1, value1, value2, value3);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(in);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.START);\n assertComposite(bounds.get(2), value1, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value1, EOC.END);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n assertComposite(bounds.get(2), value1, value3, EOC.END);\n }", "@Test\n public void whereNormalColumn() throws Exception {\n String sql = \"desc verbose select k1, e1 from db1.tbl1 lateral view explode_split(k2, \\\",\\\") tmp as e1 \"\n + \"where k1=1; \";\n String explainString = UtFrameUtils.getSQLPlanOrErrorMsg(ctx, sql, true);\n Assert.assertTrue(explainString.contains(\"1:TABLE FUNCTION NODE\"));\n Assert.assertTrue(explainString.contains(\"table function: explode_split(`k2`, ',')\"));\n Assert.assertTrue(explainString.contains(\"tuple ids: 0 1\"));\n Assert.assertTrue(explainString.contains(\"TupleDescriptor{id=1, tbl=tmp, byteSize=32, materialized=true}\"));\n Assert.assertTrue(explainString.contains(\"SlotDescriptor{id=1, col=e1, type=VARCHAR(*)}\"));\n Assert.assertTrue(explainString.contains(\"0:OlapScanNode\"));\n Assert.assertTrue(explainString.contains(\"PREDICATES: `k1` = 1\"));\n }", "public Map<ByteBuffer, List<ColumnOrSuperColumn>> forced_2round_multiget_slice(List<ByteBuffer> allKeys, ColumnParent column_parent, SlicePredicate predicate)\n throws Exception\n {\n //if (logger.isTraceEnabled()) {\n // logger.trace(\"forced_2round_multiget_slice(allKeys = {}, column_parent = {}, predicate = {})\", new Object[]{printKeys(allKeys), column_parent, predicate});\n //}\n //Split up into one request for each server in the local cluster\n Map<Cassandra.AsyncClient, List<ByteBuffer>> asyncClientToFirstRoundKeys = partitionByAsyncClients(allKeys);\n\n //Send Round 1 Requests\n Queue<BlockingQueueCallback<multiget_slice_call>> firstRoundCallbacks = new LinkedList<BlockingQueueCallback<multiget_slice_call>>();\n for (Entry<Cassandra.AsyncClient, List<ByteBuffer>> entry : asyncClientToFirstRoundKeys.entrySet()) {\n Cassandra.AsyncClient asyncClient = entry.getKey();\n List<ByteBuffer> keysForThisClient = entry.getValue();\n\n BlockingQueueCallback<multiget_slice_call> callback = new BlockingQueueCallback<multiget_slice_call>();\n firstRoundCallbacks.add(callback);\n\n //if (logger.isTraceEnabled()) { logger.trace(\"round 1: get \" + printKeys(keysForThisClient) + \" from \" + asyncClient); }\n asyncClient.multiget_slice(keysForThisClient, column_parent, predicate, consistencyLevel, LamportClock.sendTimestamp(), callback);\n }\n\n //Gather responses, track both max_evt and min_lvt\n long overallMaxEvt = Long.MIN_VALUE;\n long overallMinLvt = Long.MAX_VALUE;\n\n Map<ByteBuffer, List<ColumnOrSuperColumn>> keyToResult = new HashMap<ByteBuffer, List<ColumnOrSuperColumn>>();\n NavigableMap<Long, List<ByteBuffer>> lvtToKeys = new TreeMap<Long, List<ByteBuffer>>();\n for (BlockingQueueCallback<multiget_slice_call> callback : firstRoundCallbacks) {\n\n MultigetSliceResult result = callback.getResponseNoInterruption().getResult();\n LamportClock.updateTime(result.lts);\n\n for (Entry<ByteBuffer, List<ColumnOrSuperColumn>> entry : result.value.entrySet()) {\n ByteBuffer key = entry.getKey();\n List<ColumnOrSuperColumn> coscList = entry.getValue();\n keyToResult.put(key, coscList);\n\n //find the evt and lvt for the entire row\n EvtAndLvt evtAndLvt = ColumnOrSuperColumnHelper.extractEvtAndLvt(coscList);\n if (!lvtToKeys.containsKey(evtAndLvt.getLatestValidTime())) {\n lvtToKeys.put(evtAndLvt.getLatestValidTime(), new LinkedList<ByteBuffer>());\n }\n lvtToKeys.get(evtAndLvt.getLatestValidTime()).add(key);\n //if (logger.isTraceEnabled()) { logger.trace(\"round 1 response for \" + printKey(key) + \" evt: \" + evtAndLvt.getEarliestValidTime() + \" lvt: \" + evtAndLvt.getLatestValidTime()); }\n\n overallMaxEvt = Math.max(overallMaxEvt, evtAndLvt.getEarliestValidTime());\n overallMinLvt = Math.min(overallMinLvt, evtAndLvt.getLatestValidTime());\n }\n }\n //if (logger.isTraceEnabled()) { logger.trace(\"Min LVT:\" + overallMinLvt + \" Max EVT: \" + overallMaxEvt); }\n\n //Always Execute 2nd round for micro-benchmarking\n if (true) {\n //get the smallest lvt > maxEvt\n long chosenTime = lvtToKeys.navigableKeySet().higher(overallMaxEvt);\n\n List<ByteBuffer> secondRoundKeys = new LinkedList<ByteBuffer>();\n secondRoundKeys.addAll(allKeys);\n\n //Send Round 2 Requests\n Map<Cassandra.AsyncClient, List<ByteBuffer>> asyncClientToSecondRoundKeys = partitionByAsyncClients(secondRoundKeys);\n Queue<BlockingQueueCallback<multiget_slice_by_time_call>> secondRoundCallbacks = new LinkedList<BlockingQueueCallback<multiget_slice_by_time_call>>();\n for (Entry<Cassandra.AsyncClient, List<ByteBuffer>> entry : asyncClientToSecondRoundKeys.entrySet()) {\n Cassandra.AsyncClient asyncClient = entry.getKey();\n List<ByteBuffer> keysForThisClient = entry.getValue();\n\n BlockingQueueCallback<multiget_slice_by_time_call> callback = new BlockingQueueCallback<multiget_slice_by_time_call>();\n secondRoundCallbacks.add(callback);\n\n //if (logger.isTraceEnabled()) { logger.trace(\"round 2: get \" + printKeys(keysForThisClient) + \" from \" + asyncClient); }\n\n asyncClient.multiget_slice_by_time(keysForThisClient, column_parent, predicate, consistencyLevel, chosenTime, LamportClock.sendTimestamp(), callback);\n }\n\n //Gather second round responses\n for (BlockingQueueCallback<multiget_slice_by_time_call> callback : secondRoundCallbacks) {\n MultigetSliceResult result = callback.getResponseNoInterruption().getResult();\n LamportClock.updateTime(result.lts);\n\n substituteValidFirstRoundResults(result, keyToResult);\n\n //if (logger.isTraceEnabled()) { logger.trace(\"round 2 responses for \" + printKeys(result.getValue().keySet())); }\n\n keyToResult.putAll(result.getValue());\n }\n }\n\n //Add dependencies on anything returned and removed deleted columns\n for (Entry<ByteBuffer, List<ColumnOrSuperColumn>> entry : keyToResult.entrySet()) {\n ByteBuffer key = entry.getKey();\n List<ColumnOrSuperColumn> coscList = entry.getValue();\n\n for (Iterator<ColumnOrSuperColumn> cosc_it = coscList.iterator(); cosc_it.hasNext(); ) {\n ColumnOrSuperColumn cosc = cosc_it.next();\n try {\n clientContext.addDep(key, cosc);\n } catch (NotFoundException nfe) {\n //remove deleted results, it's okay for all result to be removed\n cosc_it.remove();\n }\n }\n }\n //if (logger.isTraceEnabled()) {\n // logger.trace(\"forced_2round_multiget_slice result = {}\", keyToResult);\n //}\n return keyToResult;\n }", "public abstract Optional<GridAxis> subsetDependent(GridAxis1D subsetIndAxis, Formatter errlog);", "DataFrame<R,C> select(Predicate<DataFrameRow<R,C>> rowPredicate, Predicate<DataFrameColumn<R,C>> colPredicate);", "private void createConstraintsForSingleton() {\n \t\tSet s = slice.entrySet();\n \t\tfor (Iterator iterator = s.iterator(); iterator.hasNext();) {\n \t\t\tMap.Entry entry = (Map.Entry) iterator.next();\n \t\t\tHashMap conflictingEntries = (HashMap) entry.getValue();\n \t\t\tif (conflictingEntries.size() < 2)\n \t\t\t\tcontinue;\n \n \t\t\tCollection conflictingVersions = conflictingEntries.values();\n \t\t\tString singletonRule = \"\"; //$NON-NLS-1$\n \t\t\tArrayList nonSingleton = new ArrayList();\n \t\t\tint countSingleton = 0;\n \t\t\tfor (Iterator conflictIterator = conflictingVersions.iterator(); conflictIterator.hasNext();) {\n \t\t\t\tIInstallableUnit conflictElt = (IInstallableUnit) conflictIterator.next();\n \t\t\t\tif (conflictElt.isSingleton()) {\n \t\t\t\t\tsingletonRule += \" -1 \" + getVariable(conflictElt); //$NON-NLS-1$\n \t\t\t\t\tcountSingleton++;\n \t\t\t\t} else {\n \t\t\t\t\tnonSingleton.add(conflictElt);\n \t\t\t\t}\n \t\t\t}\n \t\t\tif (countSingleton == 0)\n \t\t\t\tcontinue;\n \n \t\t\tfor (Iterator iterator2 = nonSingleton.iterator(); iterator2.hasNext();) {\n \t\t\t\tconstraints.add(singletonRule + \" -1 \" + getVariable((IInstallableUnit) iterator2.next()) + \" >= -1;\"); //$NON-NLS-1$ //$NON-NLS-2$\n \t\t\t}\n \t\t\tsingletonRule += \" >= -1;\"; //$NON-NLS-1$\n \t\t\tconstraints.add(singletonRule);\n \t\t}\n \t}", "public static boolean shouldProcessSlice(OBSlice x) throws Exception {\n return x.size() <= maxSliceSize;\n }", "private boolean inBounds(int row, int col){\n if (row > -1 && row < 120 && col > -1 && col < 160)\n return true;\n return false;\n }", "private Boolean isValidColumnMatrix(SimpleMatrix matrix) {\n\t\tInteger nrows = matrix.numRows();\n\t\tInteger ncols = matrix.numCols();\n\n\t\treturn (ncols == 1) && (nrows == 3);\n\t}", "private boolean canSetSafelyDownColumn(MTreeNode row, MTreeNode col, UnionDoubleIntervals newVal) {\n\t\tMTreeNode rowKids[]=row.getChildren();\n\t\tif (rowKids.length==0) return true;\n\t\tUnionDoubleIntervals rowKidsInts[]=new UnionDoubleIntervals[rowKids.length];\n\t\tfor(int i=0; i<rowKids.length; i++) {\n\t\t\trowKidsInts[i]=get(rowKids[i], col);\n\t\t\tif (rowKidsInts[i]==null) {\n\t\t\t\t//If a sibling is null, I cannot check, so just return\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\tUnionDoubleIntervals sum=UnionDoubleIntervals.sum(rowKidsInts);\n\t\treturn newVal.intersects(sum);\n\t}", "static boolean isSubset(int Tab1[], int Tab2[], int m, int n)\n {\n // compléter\n //Trouver le max de Tab1[]\n int max=Tab1[0];\n for(int i = 1; i < m; i++) {\n\t\t\tif (Tab1[i]>max){\n max=Tab1[i];\n }\n\t\t}\n \n\t\t//Stockage de la Tab1 dans une table de hashage\n\t\tint[] hashTable = new int[max];\n\t\tfor(int i = 0; i < m; i++) {\n\t\t\thashTable[hash(Tab1[i], max)] = Tab1[i];\n\t\t}\n\t\t\n\t\t//verifier que chaque element (de Tab2) existe dans la hashtable\n\t\tfor(int j = 0; j < n; j++) {\n\t\t\tif(Tab2[j] != hashTable[hash(Tab2[j], max)]) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t}\n return true;\n \n //Complexite aymptotique :\n /*\n Puisque la boucle qui a le plus d'itérations est celle avec l'élément m, la compléxité\n asymptotique est O(m).\n f(m,n) = 2m + n = O(m), puisque m > n\n */\n \n\n }", "boolean checkValidity(int side1, int side2, int side3);", "List<Online> selectByExampleWithRowbounds(OnlineExample example, RowBounds rowBounds);", "@Test\n \tpublic void whereClauseForNodeRangedDominance() {\n \t\tnode23.addJoin(new Dominance(node42, 10, 20));\n \t\tcheckWhereCondition(\n //\t\t\t\tjoin(\"=\", \"_rank23.component_ref\", \"_rank42.component_ref\"),\n \t\t\t\tjoin(\"=\", \"_component23.type\", \"'d'\"),\n \t\t\t\t\"_component23.name IS NULL\",\n \t\t\t\tjoin(\"<\", \"_rank23.pre\", \"_rank42.pre\"),\n \t\t\t\tjoin(\"<\", \"_rank42.pre\", \"_rank23.post\"),\n \t\t\t\t\"_rank23.level BETWEEN SYMMETRIC _rank42.level - 10 AND _rank42.level - 20\"\n \n \t\t);\n \t}", "@Test\n public void testPartitionColumnSelection() {\n Path filePath = new Path(\"hdfs:///w/x/y/z.csv\");\n ImplicitColumnManager implictColManager = new ImplicitColumnManager(\n fixture.getOptionManager(),\n standardOptions(filePath));\n\n String dir0 = ScanTestUtils.partitionColName(0);\n // Sic: case insensitivity, but name in project list\n // is preferred over \"natural\" name.\n String dir1 = \"DIR1\";\n String dir2 = ScanTestUtils.partitionColName(2);\n ScanLevelProjection scanProj = ScanLevelProjection.build(\n RowSetTestUtils.projectList(dir2, dir1, dir0, \"a\"),\n Lists.newArrayList(implictColManager.projectionParser()));\n\n assertEquals(4, scanProj.columns().size());\n assertEquals(dir2, scanProj.columns().get(0).name());\n assertEquals(dir1, scanProj.columns().get(1).name());\n assertEquals(dir0, scanProj.columns().get(2).name());\n assertEquals(\"a\", scanProj.columns().get(3).name());\n\n // Verify column type\n\n assertTrue(scanProj.columns().get(0) instanceof PartitionColumn);\n }", "public static boolean isAllowedToCollied(Marker marker, Marker m2){\n\t\tif( m2.letter.getX() < marker.letter.getX()){\n\t\t\tif(m2.rightValue != 0 && marker.leftValue !=0 && m2.rightValue + marker.leftValue == 0){\n\t\t\t\tm2.rightValue =0;\n\t\t\t\tmarker.leftValue=0;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\t//if collied on right \n\t\telse if( m2.letter.getX() > marker.letter.getX()){\n\t\t\tif(m2.leftValue != 0 && marker.rightValue != 0 && m2.leftValue+ marker.rightValue == 0){\n\t\t\t\tm2.leftValue = 0;\n\t\t\t\tmarker.rightValue = 0; \n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "private static boolean areOverlapping( int ix0, int ix1, int len )\n {\n if( ix0<ix1 ){\n return ix0+len>ix1;\n }\n else {\n return ix1+len>ix0;\n }\n }", "private boolean checkifCollinear(Point[] ptArr, Comparator<Point> cmp, int start){\n\t\tif(start +2 >= ptArr.length) return false;\t\n\t\tif(cmp.compare(ptArr[start],ptArr[start+1]) == cmp.compare(ptArr[start+1],ptArr[start+2]) && cmp.compare(ptArr[start],ptArr[start+1]) == 0){\n\t\t\treturn true;\n\t\t}\t\t\n\t\treturn false;\t\n\t}", "List<Collect> selectByExampleWithRowbounds(CollectExample example, RowBounds rowBounds);", "boolean hasPermissionOfCluster(String clusterId, String userName);", "@Test\n \tpublic void whereClauseForNodeLeftOverlap() {\n \t\tnode23.addJoin(new LeftOverlap(node42));\n \t\tcheckWhereCondition(\n \t\t\t\tjoin(\"=\", \"_node23.text_ref\", \"_node42.text_ref\"),\n \t\t\t\tjoin(\"<=\", \"_node23.left\", \"_node42.left\"),\n \t\t\t\tjoin(\"<=\", \"_node42.left\", \"_node23.right\"),\n \t\t\t\tjoin(\"<=\", \"_node23.right\", \"_node42.right\")\n \t\t);\n \t}", "private int adequateDimensions(int cols, int rows) {\r\n\r\n if ((cols >= MINALG) && (cols <= MAXALG)) {\r\n if ((rows >= MINDATA) && (rows <= MAXDATA)) {\r\n return 0;\r\n } else {\r\n return 1;\r\n }\r\n } else {\r\n return 2;\r\n }\r\n\r\n }", "private boolean isValid( int r, int c )\n {\n return r >= 0 && r < rows && c >= 0 && c < cols ; \n }", "private boolean checkColoumnForQuadPair(int j1) {\n for(int i=0;i<4;i++)\r\n {\r\n if(Kmap[i][j1]==0 || Kmap[i][j1]==-1)\r\n return false;\r\n }\r\n for(int i=0;i<4;i++)\r\n {\r\n Kmap[i][j1]=-1;\r\n }\r\n return true; \r\n }", "private static boolean sliceIsValid(final int[] slice, final int flowOrderLength) {\n int consecutiveZeros = 0;\n for ( int key : slice ) {\n if ( key != 0 ) {\n consecutiveZeros = 0;\n } else {\n consecutiveZeros++;\n if ( consecutiveZeros >= (flowOrderLength - 1) ) {\n return false;\n }\n }\n }\n\n // if here, not found -> valid\n return true;\n }", "public void testGetSubDimensionality()\n {\n RandomSubVectorThresholdLearner<String> instance = new RandomSubVectorThresholdLearner<String>();\n\n instance.setPercentToSample(0.5);\n assertEquals(5, instance.getSubDimensionality(10));\n\n instance.setPercentToSample(0.25);\n assertEquals(2, instance.getSubDimensionality(9));\n\n instance.setPercentToSample(1.0);\n assertEquals(9, instance.getSubDimensionality(9));\n\n instance.setPercentToSample(0.0);\n assertEquals(1, instance.getSubDimensionality(9));\n }", "public void checkBounds() {\n for (int k = 0; k < numDataCols; k++) {\n DashDataType<?> dtype = dataTypes[k];\n\n if ( dtype instanceof StringDashDataType ) {\n StringDashDataType strtype = (StringDashDataType) dtype;\n for (int j = 0; j < numSamples; j++) {\n ADCMessage msg = strtype.boundsCheckStandardValue((String) stdObjects[j][k]);\n if ( msg != null ) {\n msg.setRowNumber(j + 1);\n msg.setColNumber(k + 1);\n msg.setColName(userColNames[k]);\n stdMsgList.add(msg);\n }\n }\n }\n else if ( dtype instanceof IntDashDataType ) {\n IntDashDataType inttype = (IntDashDataType) dtype;\n for (int j = 0; j < numSamples; j++) {\n ADCMessage msg = inttype.boundsCheckStandardValue((Integer) stdObjects[j][k]);\n if ( msg != null ) {\n msg.setRowNumber(j + 1);\n msg.setColNumber(k + 1);\n msg.setColName(userColNames[k]);\n stdMsgList.add(msg);\n }\n }\n }\n else if ( dtype instanceof DoubleDashDataType ) {\n DoubleDashDataType dbltype = (DoubleDashDataType) dtype;\n for (int j = 0; j < numSamples; j++) {\n ADCMessage msg = dbltype.boundsCheckStandardValue((Double) stdObjects[j][k]);\n if ( msg != null ) {\n msg.setRowNumber(j + 1);\n msg.setColNumber(k + 1);\n msg.setColName(userColNames[k]);\n stdMsgList.add(msg);\n }\n }\n }\n else {\n throw new IllegalArgumentException(\n \"unexpected data type encountered in bounds checking: \" + dtype);\n }\n }\n }", "private String checksubset(HashMap<String, ArrayList<String>> cn) {\n\t\tObject[] cnkeys = cn.keySet().toArray();\r\n\t\tfor (int i = 0; i < cnkeys.length; i++) {\r\n\t\t\tfor (int j = cnkeys.length - 1; j > i; j--) {\r\n\t\t\t\tif (cn.get(cnkeys[i]).size() < cn.get(cnkeys[j]).size()) {\r\n\t\t\t\t\tif (cn.get(cnkeys[j]).containsAll(cn.get(cnkeys[i]))) {\r\n\t\t\t\t\t\treturn (String) cnkeys[i];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (cn.get(cnkeys[i]).containsAll(cn.get(cnkeys[j]))) {\r\n\t\t\t\t\treturn (String) cnkeys[j];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "private boolean inBounds(int row, int col)\n {\n return ((row >= 0) && (row < NUM_ROWS) &&\n (col >= 0) && (col < NUM_COLS)); \n }", "@Test\n \tpublic void whereClauseForNodeOverlap() {\n \t\tnode23.addJoin(new Overlap(node42));\n \t\tcheckWhereCondition(\n \t\t\t\tjoin(\"=\", \"_node23.text_ref\", \"_node42.text_ref\"),\n \t\t\t\tjoin(\"<=\", \"_node23.left\", \"_node42.right\"),\n \t\t\t\tjoin(\"<=\", \"_node42.left\", \"_node23.right\")\n \t\t);\n \t}", "public void testFilterOnAggregationColumn() throws Exception {\n \t\tccName = new String[] { \"cc1\", \"cc2\", \"cc3\" };\n \t\tccExpr = new String[] { \"row.COL0+row.COL1\",\n \t\t\t\t\"Total.runningSum(row.cc1,row.COL0==0,0)\",\n \t\t\t\t\"Total.runningSum(row.cc1,row.COL0>0,0)\" };\n \n \t\tfor (int i = 0; i < ccName.length; i++) {\n \t\t\tComputedColumn computedColumn = new ComputedColumn(ccName[i],\n \t\t\t\t\tccExpr[i], DataType.ANY_TYPE);\n \t\t\t((BaseDataSetDesign) this.dataSet)\n \t\t\t\t\t.addComputedColumn(computedColumn);\n \t\t}\n \n \t\tString[] bindingNameRow = new String[7];\n \t\tbindingNameRow[0] = \"ROW_COL0\";\n \t\tbindingNameRow[1] = \"ROW_COL1\";\n \t\tbindingNameRow[2] = \"ROW_COL2\";\n \t\tbindingNameRow[3] = \"ROW_COL3\";\n \t\tbindingNameRow[4] = \"ROW_cc1\";\n \t\tbindingNameRow[5] = \"ROW_cc2\";\n \t\tbindingNameRow[6] = \"ROW_cc3\";\n \t\tScriptExpression[] bindingExprRow = new ScriptExpression[] {\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL0\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL1\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL2\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL3\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + ccName[0], 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + ccName[1], 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + ccName[2], 0) };\n \n \t\tIResultIterator resultIt = this.executeQuery(this.createQuery(null,\n \t\t\t\tnull, null, null, null, null, null, null, null, bindingNameRow,\n \t\t\t\tbindingExprRow));\n \n \t\tprintResult(resultIt, bindingNameRow, bindingExprRow);\n \t\t// assert\n \t\tcheckOutputFile();\n \n \t}", "private boolean checkIllegallIndexes(Set<Integer> mintermSet, Set<Integer> dontCareSet, int size) {\n\t\tSet<Integer> mintermAndDontCareUnion = new HashSet<>(mintermSet);\n\t\tmintermAndDontCareUnion.addAll(dontCareSet);\n\n\t\tdouble maxMinterm = Math.pow(2, size) - 1;\n\t\tfor (Integer integer : mintermAndDontCareUnion) {\n\t\t\tif (integer > maxMinterm) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public void testGetColumnIndex() {\n TaskSeriesCollection c = createCollection1();\n }", "private boolean isValid(int index) {\r\n return index >= 0 && index < dimension;\r\n }", "@Test\n\tpublic void testEliminationByColumn(){\n\t\tsetBoardUp();\n\t\tColumn col = new Column(board, 1);\n\t\tint[] toBeRemoved = {1, 3, 4};\n\t\tint[] fromCesll = {1, 2, 3, 5, 6, 8};\n\t\talgorithm.applyEliminationInColumn(col);\n\t\tboolean condition = true;\n\t\tfor(int i = 0; i < toBeRemoved.length; i++)\n\t\t\tfor(int j = 0; j < fromCesll.length; j++)\n\t\t\t\tcondition &= !col.cell[fromCesll[j]].possibilities.contains(toBeRemoved[i]);\t\t\n\t\tassertTrue(condition);\n\t}", "protected boolean applySubsetRule(Node value) {\n\n int type;\n int sizeParents;\n boolean isAppliedRule = false;\n Node auxI;\n Node auxJ;\n int i;\n NodeList auxNodeList = new NodeList();\n Node auxNode;\n\n\n //If the subset rule is forbidden then the methods finishes\n if (canApplySubsetRule == false) {\n return false;\n } else {\n\n type = value.getKindOfNode();\n\n if (type == Node.UTILITY) {\n return false;\n } else {//(type == Node.SUPER_VALUE)\n NodeList parents = diag.parents(value);\n sizeParents = parents.size();\n\n //See if subset rule can be applied to some ancestors\t\t\t\n for (i = 0; (i < sizeParents) && (isAppliedRule == false); i++) {\n isAppliedRule = applySubsetRule(parents.elementAt(i));\n }\n if (isAppliedRule) {\n indexOperation++;\n try {\n diag.save(\"debug-operation-\" + indexOperation + \".elv\");\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n }\n if (isAppliedRule == false) {\n //See if subset rule can be applied to two utility parents\n for (i = 0; (i < sizeParents - 1) && (isAppliedRule == false); i++) {\n auxI = parents.elementAt(i);\n if (auxI.getKindOfNode() == Node.UTILITY) {\n for (int j = i + 1; (j < sizeParents) && (isAppliedRule == false); j++) {\n auxJ = parents.elementAt(j);\n if (auxJ.getKindOfNode() == Node.UTILITY) {\n if (verifySubsetRule(auxI, auxJ)) {\n String operation =\n \"Apply subset rule to: \" + auxI.getName() + \" and \" + auxJ.getName();\n\n statistics.addOperation(operation);\n System.out.println(operation);\n\n auxNodeList.insertNode(auxI);\n auxNodeList.insertNode(auxJ);\n auxNode = introduceSVNode(auxNodeList, value);\n System.out.println(\"Nodo introducido por la subset rule anterior: \" + auxNode.getName());\n ReductionAndEvalID.reduceNode((IDWithSVNodes) diag, auxNode);\n System.out.println(\"Reducción del nodo: \" + auxNode.getName());\n\n statistics.addSize(diag.calculateSizeOfPotentials());\n statistics.addTime(crono.getTime());\n\n\n isAppliedRule = true;\n\n indexOperation++;\n try {\n diag.save(\"debug-operation-\" + indexOperation + \".elv\");\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n\n\n }\n }\n }\n }\n }\n\n }\n }\n\n return isAppliedRule;\n }\n }", "@Test\n void test_setDeny_multi_range() {\n String[] denyRules = {\"1.0.0.10/30\", \"1.0.1.2/31\", \"1.0.1.3/31\", \"1.0.20.3/30\", \"1.0.20.1/29\"};\n ipFilterConfiguration.setDeny(Arrays.asList(denyRules));\n TreeMap<Long, Ipv4Subnet> deny = ipFilterConfiguration.getDeny();\n\n // when\n String[] expectDenyRanges = {\"1.0.0.8/30\", \"1.0.1.2/31\", \"1.0.20.0/29\"};\n Map<Long, Ipv4Subnet> expect = new HashMap<>();\n for (String expectDenyRange : expectDenyRanges) {\n Ipv4Subnet subnet = new Ipv4Subnet(expectDenyRange);\n expect.put(subnet.getStartIpLong(), subnet);\n }\n\n // then\n Stream<Executable> executables = expect.keySet().stream()\n .map(expect::get)\n .map(expectValues -> () -> assertAll(\n String.format(\"test range start with %s\", expectValues.getIpLong()),\n () -> assertNotNull(deny.get(expectValues.getStartIpLong())),\n () -> assertEquals(expectValues.getCidr(), deny.get(expectValues.getStartIpLong()).getCidr()),\n () -> assertEquals(expectValues.getStartIpLong(), deny.get(expectValues.getStartIpLong()).getStartIpLong()),\n () -> assertEquals(expectValues.getEndIpLong(), deny.get(expectValues.getStartIpLong()).getEndIpLong())\n ));\n assertAll(\"test if deny rules are nested, then aggregate (even if different mask)\",\n () -> assertEquals(3, deny.size()),\n () -> assertAll(executables));\n }", "public boolean percolates()\r\n { return uf.find(0) == uf.find(dimension*dimension + 1); }", "public boolean checkDeskSubset(ArrayList<Furniture> subset){\n boolean legs = false;\n boolean top = false;\n boolean drawer = false;\n\n for(Furniture d : subset){\n if(d instanceof Desk){\n Desk desk = (Desk)d;\n if(desk.getLegs().equals(\"Y\")){\n legs = true;\n }\n if(desk.getTop().equals(\"Y\")){\n top = true;\n }\n if(desk.getDrawer().equals(\"Y\")){\n drawer = true;\n }\n }\n }\n // check if any of the desk pieces are missing and if so the combination is invalid\n if(!legs || !top || !drawer){\n return false;\n }\n return true;\n }", "@Test\n \tpublic void whereClauseForNodeRightOverlap() {\n \t\tnode23.addJoin(new RightOverlap(node42));\n \t\tcheckWhereCondition(\n \t\t\t\tjoin(\"=\", \"_node23.text_ref\", \"_node42.text_ref\"),\n \t\t\t\tjoin(\">=\", \"_node23.right\", \"_node42.right\"),\n \t\t\t\tjoin(\">=\", \"_node42.right\", \"_node23.left\"),\n \t\t\t\tjoin(\">=\", \"_node23.left\", \"_node42.left\")\n \t\t);\n \t}", "private boolean[][] buildCoverTable(Mask[] implicants, Integer[] minterms,\n\t\t\tMap<Integer, Integer> mintermToColumnMap) {\n\n\t\tboolean[][] coverTable = new boolean[implicants.length][minterms.length];\n\n\t\tfor (int i = 0; i < implicants.length; i++) {\n\t\t\tfor (int j = 0; j < minterms.length; j++) {\n\t\t\t\tif (implicants[i].getIndexes().contains(minterms[j])) {\n\t\t\t\t\tcoverTable[i][j] = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn coverTable;\n\t}", "Boolean isValid(ArrayList<Integer> colQ){\n \n int curcol = colQ.size() - 1;\n int row = colQ.get(colQ.size() - 1);\n\n int i = 0;\n int j = 0;\n for(i = curcol-1, j = 1; i >= 0; i--, j++)\n {\n // check if we have two of the same row || check diags\n if(row == colQ.get(i) || row+j == colQ.get(i) || row-j == colQ.get(i)) return false;\n }\n return true;\n \n }", "public static void main(String[]args){\n\r\n int []arr = new int[100];\r\n int []arr2 = new int[50];\r\n int []arr3 = {1,2,3,4,5,6,7,8};\r\n int number = 5;\r\n LogicalOp op = new LogicalOp();\r\n// op.writeOnArray(arr);\r\n\r\n// arr2 = op.evenArray(arr2);\r\n// for(int i=0;i<arr2.length;i++)\r\n// System.out.println(arr2[i]);\r\n\r\n //System.out.println(\"Mean value: \"+op.meanValue(arr3));\r\n\r\n// String[] arrOfStr = {\"ana\",\"are\",\"mere\",\"pere\",\"mere\"};\r\n// String str = \"mere\";\r\n// System.out.println(op.isContaingString(arrOfStr,str));\r\n\r\n// System.out.println(op.findPosition(arr3,number));\r\n\r\n //op.displayLines();\r\n\r\n// int[]modifArr = op.modifiedArr(arr3,number);\r\n// for(int item: modifArr)\r\n// System.out.print(item+\" \");\r\n\r\n\r\n //System.out.println(\"Second minimum: \"+op.secondMin(arr3));\r\n\r\n int[] empty = new int[arr3.length];\r\n empty = op.populateArray(arr3,empty);\r\n for(int item:empty)\r\n System.out.print(item+\" \");\r\n\r\n\r\n\r\n }", "@Test\n void testSubset() throws IOException {\n Long expectedNumberOfVariables = 13L;\n Long expectedNumberOfCases = 24L; // aka the number of lines in the TAB file produced by the ingest plugin\n\n TabularDataIngest ingestResult;\n File file = getFile(\"csv/ingest/election_precincts.csv\");\n try (BufferedInputStream stream = new BufferedInputStream(new FileInputStream(file))) {\n CSVFileReader instance = createInstance();\n ingestResult = instance.read(Tuple.of(stream, file), null);\n }\n\n File generatedTabFile = ingestResult.getTabDelimitedFile();\n DataTable generatedDataTable = ingestResult.getDataTable();\n\n assertThat(generatedDataTable).isNotNull();\n assertThat(generatedDataTable.getDataVariables()).isNotNull();\n assertThat(generatedDataTable.getVarQuantity()).isEqualTo((long) generatedDataTable.getDataVariables().size());\n assertThat(generatedDataTable.getVarQuantity()).isEqualTo(expectedNumberOfVariables);\n assertThat(generatedDataTable.getCaseQuantity()).isEqualTo(expectedNumberOfCases);\n\n // And now let's try and subset the individual vectors\n // First, the \"continuous\" vectors (we should be able to read these as Double[]):\n int[] floatColumns = {2};\n\n Double[][] floatVectors = {\n { 1.0, 3.0, 4.0, 6.0, 7.0, 8.0, 11.0, 12.0, 76.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0 },\n };\n\n IngestDataProvider dataProvider = new InMemoryIngestDataProvider();\n dataProvider.initialize(generatedDataTable, generatedTabFile);\n\n int vectorCount = 0;\n for (int i : floatColumns) {\n // We'll be subsetting the column vectors one by one, re-opening the\n // file each time. Inefficient - but we don't care here.\n\n if (!generatedDataTable.getDataVariables().get(i).isIntervalContinuous()) {\n fail(\"Column \" + i + \" was not properly processed as \\\"continuous\\\"\");\n }\n\n Double[] columnVector = dataProvider.getDoubleColumn(i);\n\n assertThat(columnVector).isEqualTo(floatVectors[vectorCount++]);\n }\n\n // Discrete Numerics (aka, integers):\n int[] integerColumns = { 1, 4, 6, 7, 8, 9, 10, 11, 12 };\n\n Long[][] longVectors = {\n { 1L, 3L, 4L, 6L, 7L, 8L, 11L, 12L, 76L, 77L, 77L, 77L, 77L, 77L, 77L, 77L, 77L, 77L, 77L, 77L, 77L, 77L, 77L, 77L },\n { 1L, 2L, 3L, 4L, 5L, 11L, 13L, 15L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L },\n { 85729227L, 85699791L, 640323976L, 85695847L, 637089796L, 637089973L, 85695001L, 85695077L, 1111111L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L },\n { 205871733L, 205871735L, 205871283L, 258627915L, 257444575L, 205871930L, 260047422L, 262439738L, 1111111L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L },\n { 205871673L, 205871730L, 205871733L, 205872857L, 258627915L, 257444584L, 205873413L, 262439738L, 1111111L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L },\n { 25025000201L, 25025081001L, 25025000701L, 25025050901L, 25025040600L, 25025000502L, 25025040401L, 25025100900L, 1111111L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L },\n { 250250502002L, 250250502003L, 250250501013L, 250250408011L, 250250503001L, 250250103001L, 250250406002L, 250250406001L, 1111111L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L },\n { 250251011024001L, 250251011013003L, 250251304041007L, 250251011013006L, 250251010016000L, 250251011024002L, 250251001005004L, 250251002003002L, 1111111L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L },\n { 2109L, 2110L, 2111L, 2120L, 2121L, 2115L, 2116L, 2122L, 11111L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L }\n };\n\n vectorCount = 0;\n\n for (int i : integerColumns) {\n if (!generatedDataTable.getDataVariables().get(i).isIntervalDiscrete()\n || !generatedDataTable.getDataVariables().get(i).isTypeNumeric()) {\n fail(\"Column \" + i + \" was not properly processed as \\\"discrete numeric\\\"\");\n }\n\n Long[] columnVector = dataProvider.getLongColumn(i);\n\n assertThat(columnVector).isEqualTo(longVectors[vectorCount++]);\n }\n\n // And finally, Strings:\n int[] stringColumns = {0, 3, 5};\n\n String[][] stringVectors = {\n { \"Dog\", \"Squirrel\", \"Antelope\", \"Zebra\", \"Lion\", \"Gazelle\", \"Cat\", \"Giraffe\", \"Cat\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\" },\n { \"East Boston\", \"Charlestown\", \"South Boston\", \"Bronx\", \"Roslindale\", \"Mission Hill\", \"Jamaica Plain\", \"Hyde Park\", \"Fenway/Kenmore\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\" },\n { \"2-06\", \"1-09\", \"1-1A\", \"1-1B\", \"2-04\", \"3-05\", \"1-1C\", \"1-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", }\n };\n\n vectorCount = 0;\n\n for (int i : stringColumns) {\n if (!generatedDataTable.getDataVariables().get(i).isTypeCharacter()) {\n fail(\"Column \" + i + \" was not properly processed as a character vector\");\n }\n String[] columnVector = dataProvider.getStringColumn(i);\n\n assertThat(columnVector).isEqualTo(stringVectors[vectorCount++]);\n }\n }", "public boolean isProperSubset(/*@ non_null @*/ JMLObjectSet<E> s2) {\n return size < s2.int_size() && isSubset(s2);\n }", "private int[][] generateCandidates(int[][] usageM){\n\t\t// 1. start with the complete set of attributes\n\t\tMap<Integer, List<Integer>> partitionAttributes = new HashMap<Integer,List<Integer>>();\n\t\tList<Integer> attributes = new ArrayList<Integer>();\n\t\tfor(int i=0;i<usageM[0].length;i++)\n\t\t\tattributes.add(i);\n\t\tpartitionAttributes.put(0, attributes);\n\t\t\n\t\t// 2. for each query, split this set of attributes into two set:\n\t\t// (i) attributes accessed by the query\n\t\t//\t (ii) attributes not-accessed by the query\n\t\tfor(int[] query: usageM){\n\t\t\tMap<Integer, List<Integer>> newPartitionAttributes = new HashMap<Integer,List<Integer>>();\n\t\t\tint partitionCount = partitionAttributes.size();\n\t\t\t\n\t\t\t// check each partition\n\t\t\tfor(int p: partitionAttributes.keySet()){\n\t\t\t\tList<Integer> attrs = partitionAttributes.get(p);\n\t\t\t\tboolean fullPartitionAccess = true;\n\t\t\t\tfor(int a: attrs){\n\t\t\t\t\tif(query[a]==0)\n\t\t\t\t\t\tfullPartitionAccess = false;\n\t\t\t\t}\n\n\t\t\t\tif(fullPartitionAccess){\n\t\t\t\t\tnewPartitionAttributes.put(p, attrs);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t//int newPartition = partitionAttributes.size();\n\t\t\t\t\tList<Integer> accessedAttrs = new ArrayList<Integer>();\n\t\t\t\t\tList<Integer> nonAccessedAttrs = new ArrayList<Integer>();\n\t\t\t\t\tfor(int a: attrs){\n\t\t\t\t\t\tif(query[a]==1)\n\t\t\t\t\t\t\taccessedAttrs.add(a);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tnonAccessedAttrs.add(a);\n\t\t\t\t\t}\n\t\t\t\t\tif(nonAccessedAttrs.size() > 0)\n\t\t\t\t\t\tnewPartitionAttributes.put(p, nonAccessedAttrs);\n\t\t\t\t\tif(accessedAttrs.size() > 0)\n\t\t\t\t\t\tnewPartitionAttributes.put(partitionCount++, accessedAttrs);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//System.out.println(newPartitionAttributes);\n\t\t\t\n\t\t\tpartitionAttributes = newPartitionAttributes;\n\t\t}\n\t\t\n\t\t\n\t\t// 3. we end up with a set of attribute sets; all attributes in \n\t\t//\t an attribute set are always accessed together.\n\t\tint[][] primaryPartitions = new int[partitionAttributes.size()][];\n\t\tint i=0;\n\t\tfor(int p: partitionAttributes.keySet()){\n\t\t\tList<Integer> attrs = partitionAttributes.get(p);\n\t\t\tprimaryPartitions[i] = new int[attrs.size()];\n\t\t\tfor(int j=0;j<attrs.size();j++)\n\t\t\t\tprimaryPartitions[i][j] = attrs.get(j);\n\t\t\ti++;\n\t\t}\n\t\t\n\t\treturn primaryPartitions;\n\t}", "@Override\n public boolean indexAccessible(final IndexInfo ii) throws QueryException {\n if(coll != null || min == null || max == null) return false;\n\n // accept only location path, string and equality expressions\n final Data data = ii.db.data();\n // sequential main memory scan is usually faster than range index access\n if(data == null ? !ii.enforce() : data.inMemory()) return false;\n\n final IndexType type = ii.type(expr, null);\n if(type == null) return false;\n\n // create range access\n final StringRange sr = new StringRange(type, min, mni, max, mxi);\n ii.costs = IndexInfo.costs(data, sr);\n if(ii.costs == null) return false;\n\n final TokenBuilder tb = new TokenBuilder();\n tb.add(mni ? '[' : '(').add(min).add(',').add(max).add(mxi ? ']' : ')');\n ii.create(new StringRangeAccess(info, sr, ii.db), true,\n Util.info(OPTINDEX_X_X, type + \" string range\", tb), info);\n return true;\n }", "public boolean subset(ZYSet<ElementType> potentialSubset){\n for(ElementType e:potentialSubset){\n if(!this.contains(e)){\n return false;\n }\n }\n return true;\n }", "public abstract int Compare(Slice a, Slice b);", "private boolean checkRange(int rowIndex, int columnIndex) {\n return rowIndex >= 0 && rowIndex < matrix.length\n && columnIndex >= 0 && columnIndex < matrix[rowIndex].length;\n\n }", "@Override\n public boolean isInBounds(int row, int col) {\n return row >= 0 && row < grid.length && col >= 0 && col < grid[0].length;\n }", "public boolean isSubset() {\n return isSubset;\n }", "public boolean isSubset() {\n return isSubset;\n }" ]
[ "0.7158963", "0.7123606", "0.70991635", "0.705466", "0.7004295", "0.69189924", "0.66595685", "0.6623466", "0.6592054", "0.6497857", "0.6349571", "0.63176143", "0.6154024", "0.5980809", "0.59069383", "0.5850658", "0.5775508", "0.563109", "0.5578095", "0.5533329", "0.54270524", "0.53039944", "0.52517253", "0.52139294", "0.51945037", "0.51842237", "0.51715165", "0.51699674", "0.5124158", "0.51029205", "0.50985676", "0.50801736", "0.5045298", "0.50371677", "0.49553904", "0.49506375", "0.49472633", "0.48986122", "0.48632807", "0.48566565", "0.48475885", "0.48432845", "0.48267806", "0.48235536", "0.48085412", "0.4808194", "0.4797184", "0.4790391", "0.47777537", "0.47758326", "0.4753173", "0.47451422", "0.47286874", "0.47167778", "0.47158492", "0.47150064", "0.47126174", "0.47115806", "0.4693667", "0.4687079", "0.4682436", "0.46798274", "0.4677465", "0.46764567", "0.46711823", "0.46511218", "0.46418378", "0.46316135", "0.46239012", "0.46229577", "0.46221316", "0.46178925", "0.46162784", "0.45990297", "0.45959675", "0.4595329", "0.45894012", "0.45890915", "0.45794523", "0.45750916", "0.45630372", "0.45598567", "0.45542574", "0.45538878", "0.45506385", "0.45494056", "0.4540929", "0.45394865", "0.45350963", "0.45335418", "0.45295563", "0.4527096", "0.45259237", "0.4515422", "0.45152363", "0.45142362", "0.4506681", "0.44921568", "0.44895282", "0.44895282" ]
0.72285795
0
Test multicolumn slice restrictions with 2 descending clustering columns (e.g '(clustering_0, clustering_1) > (1, 2)')
@Test public void testBoundsAsCompositesWithMultiSliceRestrictionsWithTwoDescendingClusteringColumns() { CFMetaData cfMetaData = newCFMetaData(Sort.DESC, Sort.DESC); ByteBuffer value1 = ByteBufferUtil.bytes(1); ByteBuffer value2 = ByteBufferUtil.bytes(2); // (clustering_0, clustering1) > (1, 2) Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2); PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(slice); List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertEmptyComposite(bounds.get(0)); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value1, value2, EOC.START); // (clustering_0, clustering1) >= (1, 2) slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2); restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(slice); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertEmptyComposite(bounds.get(0)); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value1, value2, EOC.END); // (clustering_0, clustering1) <= (1, 2) slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2); restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(slice); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value1, value2, EOC.NONE); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertEmptyComposite(bounds.get(0)); // (clustering_0, clustering1) < (1, 2) slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2); restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(slice); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value1, value2, EOC.END); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertEmptyComposite(bounds.get(0)); // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2) slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2); Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2); restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(slice).mergeWith(slice2); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value2, EOC.END); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value1, value2, EOC.START); // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1) slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2); slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1); restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(slice).mergeWith(slice2); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value2, value1, EOC.NONE); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value1, value2, EOC.END); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithTwoAscendingAndTwoDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.DESC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertEmptyComposite(bounds.get(1));\n\n // clustering_0 = 1 AND (clustering_1, clustering_2, clustering_3) > (2, 3, 4)\n Restriction eq = newSingleEq(cfMetaData, 0, value1);\n slice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n restrictions = restrictions.mergeWith(eq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2, clustering_3) > (2, 3, 4)\n Restriction in = newSingleIN(cfMetaData, 0, value1, value2);\n slice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n restrictions = restrictions.mergeWith(in);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n assertComposite(bounds.get(2), value2, value2, EOC.START);\n assertComposite(bounds.get(3), value2, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n assertComposite(bounds.get(2), value2, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(3), value2, EOC.END);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1, clustering_2, clustering_3) <= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) < (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4) AND (clustering_0, clustering_1) < (2, 3)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2, value3);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(1), value2, value3, EOC.START);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4) AND (clustering_0, clustering1, clustering_2, clustering_3) <= (4, 3, 2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value4, value3, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n assertComposite(bounds.get(2), value4, value3, value2, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(1), value4, value3, EOC.START);\n assertComposite(bounds.get(2), value4, value3, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneAscendingAndOneDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n assertComposite(bounds.get(2), value2, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertComposite(bounds.get(1), value2, EOC.START);\n assertComposite(bounds.get(2), value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithTwoClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneDescendingAndOneAscendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0) > (1) AND (clustering_0, clustering1) < (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.END);\n assertComposite(bounds.get(2), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.END);\n assertComposite(bounds.get(1), value1, EOC.START);\n assertComposite(bounds.get(2), value1, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsMixingAscendingDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.DESC, Sort.ASC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(3));\n\n // clustering_0 = 1 AND (clustering_1, clustering_2, clustering_3) > (2, 3, 4)\n Restriction eq = newSingleEq(cfMetaData, 0, value1);\n slice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n restrictions = restrictions.mergeWith(eq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(3));\n\n\n // (clustering_0, clustering1, clustering_2, clustering_3) <= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, value4, EOC.NONE);\n assertComposite(bounds.get(3), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) < (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(3), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4) AND (clustering_0, clustering_1) < (2, 3)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2, value3);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(5, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n assertComposite(bounds.get(4), value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(5, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertComposite(bounds.get(3), value2, EOC.START);\n assertComposite(bounds.get(4), value2, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4) AND (clustering_0, clustering1, clustering_2, clustering_3) <= (4, 3, 2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value4, value3, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(7, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n assertComposite(bounds.get(4), value4, value3, EOC.START);\n assertComposite(bounds.get(5), value4, value3, value2, value1, EOC.NONE);\n assertComposite(bounds.get(6), value4, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(7, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertComposite(bounds.get(3), value4, EOC.START);\n assertComposite(bounds.get(4), value4, value3, value2, EOC.START);\n assertComposite(bounds.get(5), value4, value3, value2, EOC.END);\n assertComposite(bounds.get(6), value4, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneDescendingClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithSliceRestrictionsAndOneDescendingClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newSingleSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newSingleSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiEqAndSingleSliceRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n\n // (clustering_0, clustering_1) = (1, 2) AND clustering_2 > 3\n Restriction multiEq = newMultiEq(cfMetaData, 0, value1, value2);\n Restriction singleSlice = newSingleSlice(cfMetaData, 2, Bound.START, false, value3);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiEq).mergeWith(singleSlice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithSliceRestrictionsAndOneClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newSingleSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newSingleSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithSingleEqAndSliceRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n ByteBuffer value5 = ByteBufferUtil.bytes(5);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) > (2, 3)\n Restriction singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction multiSlice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiSlice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) > (2, 3) AND (clustering_1) < (4)\n singleEq = newSingleEq(cfMetaData, 0, value1);\n multiSlice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3);\n Restriction multiSlice2 = newMultiSlice(cfMetaData, 1, Bound.END, false, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiSlice2).mergeWith(singleEq).mergeWith(multiSlice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value4, EOC.START);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) => (2, 3) AND (clustering_1, clustering_2) <= (4, 5)\n singleEq = newSingleEq(cfMetaData, 0, value1);\n multiSlice = newMultiSlice(cfMetaData, 1, Bound.START, true, value2, value3);\n multiSlice2 = newMultiSlice(cfMetaData, 1, Bound.END, true, value4, value5);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiSlice2).mergeWith(singleEq).mergeWith(multiSlice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value4, value5, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithOneEqRestrictionsAndTwoClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer clustering_0 = ByteBufferUtil.bytes(1);\n Restriction eq = newSingleEq(cfMetaData, 0, clustering_0);\n\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithOneEqRestrictionsAndOneClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC);\n\n ByteBuffer clustering_0 = ByteBufferUtil.bytes(1);\n Restriction eq = newSingleEq(cfMetaData, 0, clustering_0);\n\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithSingleEqAndMultiEqRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) = (2, 3)\n Restriction singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction multiEq = newMultiEq(cfMetaData, 1, value2, value3);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiEq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n // clustering_0 = 1 AND clustering_1 = 2 AND (clustering_2, clustering_3) = (3, 4)\n singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction singleEq2 = newSingleEq(cfMetaData, 1, value2);\n multiEq = newMultiEq(cfMetaData, 2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(singleEq2).mergeWith(multiEq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n\n // (clustering_0, clustering_1) = (1, 2) AND clustering_2 = 3\n singleEq = newSingleEq(cfMetaData, 2, value3);\n multiEq = newMultiEq(cfMetaData, 0, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiEq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) = (2, 3) AND clustering_3 = 4\n singleEq = newSingleEq(cfMetaData, 0, value1);\n singleEq2 = newSingleEq(cfMetaData, 3, value4);\n multiEq = newMultiEq(cfMetaData, 1, value2, value3);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiEq).mergeWith(singleEq2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n }", "private static Restriction newMultiSlice(CFMetaData cfMetaData, int firstIndex, Bound bound, boolean inclusive, ByteBuffer... values)\n {\n List<ColumnDefinition> columnDefinitions = new ArrayList<>();\n for (int i = 0; i < values.length; i++)\n {\n columnDefinitions.add(getClusteringColumnDefinition(cfMetaData, i + firstIndex));\n }\n return new MultiColumnRestriction.Slice(columnDefinitions, bound, inclusive, toMultiItemTerminal(values));\n }", "@Test\n public void testBoundsAsCompositesWithSingleEqAndMultiINRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n ByteBuffer value5 = ByteBufferUtil.bytes(5);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) IN ((2, 3), (4, 5))\n Restriction singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction multiIN = newMultiIN(cfMetaData, 1, asList(value2, value3), asList(value4, value5));\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiIN);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(1), value1, value4, value5, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(1), value1, value4, value5, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) IN ((2, 3))\n singleEq = newSingleEq(cfMetaData, 0, value1);\n multiIN = newMultiIN(cfMetaData, 1, asList(value2, value3));\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiIN).mergeWith(singleEq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n // clustering_0 = 1 AND clustering_1 = 5 AND (clustering_2, clustering_3) IN ((2, 3), (4, 5))\n singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction singleEq2 = newSingleEq(cfMetaData, 1, value5);\n multiIN = newMultiIN(cfMetaData, 2, asList(value2, value3), asList(value4, value5));\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiIN).mergeWith(singleEq2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value5, value2, value3, EOC.START);\n assertComposite(bounds.get(1), value1, value5, value4, value5, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value5, value2, value3, EOC.END);\n assertComposite(bounds.get(1), value1, value5, value4, value5, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithEqAndSliceRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n\n Restriction eq = newSingleEq(cfMetaData, 0, value3);\n\n Restriction slice = newSingleSlice(cfMetaData, 1, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 1, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 1, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 1, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 1, Bound.START, false, value1);\n Restriction slice2 = newSingleSlice(cfMetaData, 1, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value2, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 1, Bound.START, true, value1);\n slice2 = newSingleSlice(cfMetaData, 1, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value2, EOC.END);\n }", "public interface IStoppingCriteria {\n\n /**\n * Determine the degree of clustering agreement\n * @param cluster1 one clustering results\n * @param cluster2 the other clustering results\n * @return the degree of clustering agreement; 1 refers to be the same clustering results; 0 refers to be the totally different clustering results\n */\n public double computeSimilarity(int[] cluster1, int[] cluster2);\n\n}", "private boolean isSubsetOf(int firstRow, int secondRow) {\n for (int i = 0; i < universalSetSize; i++) {\n if (input[firstRow][i] && !input[secondRow][i]) {\n return false;\n }\n }\n return true;\n }", "private boolean isSubsetOf(List<String> permissions2,\n\t\t\tList<String> permissions3) {\n\t\treturn false;\n\t}", "@Test\n public void testBoundsAsCompositesWithOneInRestrictionsAndOneClusteringColumn()\n {\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n Restriction in = newSingleIN(cfMetaData, 0, value1, value2, value3);\n\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(in);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.START);\n assertComposite(bounds.get(2), value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n assertComposite(bounds.get(1), value2, EOC.END);\n assertComposite(bounds.get(2), value3, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiEqRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n Restriction eq = newMultiEq(cfMetaData, 0, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n }", "private static Restriction newMultiEq(CFMetaData cfMetaData, int firstIndex, ByteBuffer... values)\n {\n List<ColumnDefinition> columnDefinitions = new ArrayList<>();\n for (int i = 0; i < values.length; i++)\n {\n columnDefinitions.add(getClusteringColumnDefinition(cfMetaData, firstIndex + i));\n }\n return new MultiColumnRestriction.EQ(columnDefinitions, toMultiItemTerminal(values));\n }", "private boolean checkRowCol(int c1, int c2, int c3) \r\n {\r\n return ((c1 != -1) && (c1 == c2) && (c2 == c3)); //eida ekhon porjonto kaaj e lage nai\r\n }", "@Test\n public void testOverlappingPartitionsOverlappingClusters()\n {\n check(overlappingClustersWithOverlappingPartitions(), 0.75, 1.0);\n }", "private boolean subGridCheck() {\n\t\tint sqRt = (int)Math.sqrt(dimension);\n\t\tfor(int i = 0; i < sqRt; i++) {\n\t\t\tint increment = i * sqRt;\n\t\t\tfor(int val = 1; val <= dimension; val++) {\n\t\t\t\tint valCounter = 0;\n\t\t\t\tfor(int row = 0 + increment; row < sqRt + increment; row++) {\n\t\t\t\t\tfor(int col = 0 + increment; col < sqRt + increment; col++) {\n\t\t\t\t\t\tif(puzzle[row][col] == val)\n\t\t\t\t\t\t\tvalCounter++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(valCounter >= 2)\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "@Test\n public void whereNormalColumn() throws Exception {\n String sql = \"desc verbose select k1, e1 from db1.tbl1 lateral view explode_split(k2, \\\",\\\") tmp as e1 \"\n + \"where k1=1; \";\n String explainString = UtFrameUtils.getSQLPlanOrErrorMsg(ctx, sql, true);\n Assert.assertTrue(explainString.contains(\"1:TABLE FUNCTION NODE\"));\n Assert.assertTrue(explainString.contains(\"table function: explode_split(`k2`, ',')\"));\n Assert.assertTrue(explainString.contains(\"tuple ids: 0 1\"));\n Assert.assertTrue(explainString.contains(\"TupleDescriptor{id=1, tbl=tmp, byteSize=32, materialized=true}\"));\n Assert.assertTrue(explainString.contains(\"SlotDescriptor{id=1, col=e1, type=VARCHAR(*)}\"));\n Assert.assertTrue(explainString.contains(\"0:OlapScanNode\"));\n Assert.assertTrue(explainString.contains(\"PREDICATES: `k1` = 1\"));\n }", "@Test\n public void testHardClustersWithOverlappingPartitions()\n {\n check(hardClustersWithOverlappingPartitions(), 0.0, 1.0);\n }", "public static boolean isAllowedToCollied(Marker marker, Marker m2){\n\t\tif( m2.letter.getX() < marker.letter.getX()){\n\t\t\tif(m2.rightValue != 0 && marker.leftValue !=0 && m2.rightValue + marker.leftValue == 0){\n\t\t\t\tm2.rightValue =0;\n\t\t\t\tmarker.leftValue=0;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\t//if collied on right \n\t\telse if( m2.letter.getX() > marker.letter.getX()){\n\t\t\tif(m2.leftValue != 0 && marker.rightValue != 0 && m2.leftValue+ marker.rightValue == 0){\n\t\t\t\tm2.leftValue = 0;\n\t\t\t\tmarker.rightValue = 0; \n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "@Test\n public void testHeterogeneousSegmentFilterConditionLimit() throws SqlParseException {\n\n val project = \"heterogeneous_segment\";\n // val dfId = \"747f864b-9721-4b97-acde-0aa8e8656cba\"\n // val seg1Id = \"8892fa3f-f607-4eec-8159-7c5ae2f16942\"\n // val seg2Id = \"d75a822c-788a-4592-a500-cf20186dded1\"\n // val seg3Id = \"54eaf96d-6146-45d2-b94e-d5d187f89919\"\n // val seg4Id = \"411f40b9-a80a-4453-90a9-409aac6f7632\"\n // val seg5Id = \"a8318597-cb75-416f-8eb8-96ea285dd2b4\"\n // \n val sql = \"with T1 as (select cal_dt, trans_id \\n\" + \"from test_kylin_fact inner join test_account \\n\"\n + \"on test_kylin_fact.seller_id = test_account.account_id \\n\"\n + \"where cal_dt between date'2012-01-01' and date'2012-01-03'\\n\" + \"group by cal_dt, trans_id)\\n\";\n\n {\n val sqlWithTooManyOrs = sql + \" select * from T1 where \" + \"(cal_dt='2012-01-01' and trans_id = 1) or \\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 2) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 3) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 4) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 5) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 6) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 7) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 8) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 9) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 10) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 12) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 13) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 14) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 15) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 16) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 17) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 18) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 19) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 20)\";\n val contexts = OlapContextTestUtil.getOlapContexts(project, sqlWithTooManyOrs);\n Assert.assertEquals(\n \">=(DEFAULT.TEST_KYLIN_FACT.CAL_DT, 2012-01-01),<=(DEFAULT.TEST_KYLIN_FACT.CAL_DT, 2012-01-03)\",\n contexts.get(0).getExpandedFilterConditions().stream().map(RexNode::toString)\n .collect(Collectors.joining(\",\")));\n }\n\n {\n val sqlWithFilter = sql + \" select * from T1 where \" + \"(cal_dt='2012-01-01' and trans_id = 1) or \\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 2) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 3) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 4) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 5) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 6) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 7) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 8) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 9) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 10)\";\n val contexts = OlapContextTestUtil.getOlapContexts(project, sqlWithFilter);\n Assert.assertNotEquals(\n \">=(DEFAULT.TEST_KYLIN_FACT.CAL_DT, 2012-01-01),<=(DEFAULT.TEST_KYLIN_FACT.CAL_DT, 2012-01-03)\",\n contexts.get(0).getExpandedFilterConditions().stream().map(RexNode::toString)\n .collect(Collectors.joining(\",\")));\n }\n\n }", "@Test\n\tpublic void testEliminationByColumn(){\n\t\tsetBoardUp();\n\t\tColumn col = new Column(board, 1);\n\t\tint[] toBeRemoved = {1, 3, 4};\n\t\tint[] fromCesll = {1, 2, 3, 5, 6, 8};\n\t\talgorithm.applyEliminationInColumn(col);\n\t\tboolean condition = true;\n\t\tfor(int i = 0; i < toBeRemoved.length; i++)\n\t\t\tfor(int j = 0; j < fromCesll.length; j++)\n\t\t\t\tcondition &= !col.cell[fromCesll[j]].possibilities.contains(toBeRemoved[i]);\t\t\n\t\tassertTrue(condition);\n\t}", "public Map<ByteBuffer, List<ColumnOrSuperColumn>> forced_2round_multiget_slice(List<ByteBuffer> allKeys, ColumnParent column_parent, SlicePredicate predicate)\n throws Exception\n {\n //if (logger.isTraceEnabled()) {\n // logger.trace(\"forced_2round_multiget_slice(allKeys = {}, column_parent = {}, predicate = {})\", new Object[]{printKeys(allKeys), column_parent, predicate});\n //}\n //Split up into one request for each server in the local cluster\n Map<Cassandra.AsyncClient, List<ByteBuffer>> asyncClientToFirstRoundKeys = partitionByAsyncClients(allKeys);\n\n //Send Round 1 Requests\n Queue<BlockingQueueCallback<multiget_slice_call>> firstRoundCallbacks = new LinkedList<BlockingQueueCallback<multiget_slice_call>>();\n for (Entry<Cassandra.AsyncClient, List<ByteBuffer>> entry : asyncClientToFirstRoundKeys.entrySet()) {\n Cassandra.AsyncClient asyncClient = entry.getKey();\n List<ByteBuffer> keysForThisClient = entry.getValue();\n\n BlockingQueueCallback<multiget_slice_call> callback = new BlockingQueueCallback<multiget_slice_call>();\n firstRoundCallbacks.add(callback);\n\n //if (logger.isTraceEnabled()) { logger.trace(\"round 1: get \" + printKeys(keysForThisClient) + \" from \" + asyncClient); }\n asyncClient.multiget_slice(keysForThisClient, column_parent, predicate, consistencyLevel, LamportClock.sendTimestamp(), callback);\n }\n\n //Gather responses, track both max_evt and min_lvt\n long overallMaxEvt = Long.MIN_VALUE;\n long overallMinLvt = Long.MAX_VALUE;\n\n Map<ByteBuffer, List<ColumnOrSuperColumn>> keyToResult = new HashMap<ByteBuffer, List<ColumnOrSuperColumn>>();\n NavigableMap<Long, List<ByteBuffer>> lvtToKeys = new TreeMap<Long, List<ByteBuffer>>();\n for (BlockingQueueCallback<multiget_slice_call> callback : firstRoundCallbacks) {\n\n MultigetSliceResult result = callback.getResponseNoInterruption().getResult();\n LamportClock.updateTime(result.lts);\n\n for (Entry<ByteBuffer, List<ColumnOrSuperColumn>> entry : result.value.entrySet()) {\n ByteBuffer key = entry.getKey();\n List<ColumnOrSuperColumn> coscList = entry.getValue();\n keyToResult.put(key, coscList);\n\n //find the evt and lvt for the entire row\n EvtAndLvt evtAndLvt = ColumnOrSuperColumnHelper.extractEvtAndLvt(coscList);\n if (!lvtToKeys.containsKey(evtAndLvt.getLatestValidTime())) {\n lvtToKeys.put(evtAndLvt.getLatestValidTime(), new LinkedList<ByteBuffer>());\n }\n lvtToKeys.get(evtAndLvt.getLatestValidTime()).add(key);\n //if (logger.isTraceEnabled()) { logger.trace(\"round 1 response for \" + printKey(key) + \" evt: \" + evtAndLvt.getEarliestValidTime() + \" lvt: \" + evtAndLvt.getLatestValidTime()); }\n\n overallMaxEvt = Math.max(overallMaxEvt, evtAndLvt.getEarliestValidTime());\n overallMinLvt = Math.min(overallMinLvt, evtAndLvt.getLatestValidTime());\n }\n }\n //if (logger.isTraceEnabled()) { logger.trace(\"Min LVT:\" + overallMinLvt + \" Max EVT: \" + overallMaxEvt); }\n\n //Always Execute 2nd round for micro-benchmarking\n if (true) {\n //get the smallest lvt > maxEvt\n long chosenTime = lvtToKeys.navigableKeySet().higher(overallMaxEvt);\n\n List<ByteBuffer> secondRoundKeys = new LinkedList<ByteBuffer>();\n secondRoundKeys.addAll(allKeys);\n\n //Send Round 2 Requests\n Map<Cassandra.AsyncClient, List<ByteBuffer>> asyncClientToSecondRoundKeys = partitionByAsyncClients(secondRoundKeys);\n Queue<BlockingQueueCallback<multiget_slice_by_time_call>> secondRoundCallbacks = new LinkedList<BlockingQueueCallback<multiget_slice_by_time_call>>();\n for (Entry<Cassandra.AsyncClient, List<ByteBuffer>> entry : asyncClientToSecondRoundKeys.entrySet()) {\n Cassandra.AsyncClient asyncClient = entry.getKey();\n List<ByteBuffer> keysForThisClient = entry.getValue();\n\n BlockingQueueCallback<multiget_slice_by_time_call> callback = new BlockingQueueCallback<multiget_slice_by_time_call>();\n secondRoundCallbacks.add(callback);\n\n //if (logger.isTraceEnabled()) { logger.trace(\"round 2: get \" + printKeys(keysForThisClient) + \" from \" + asyncClient); }\n\n asyncClient.multiget_slice_by_time(keysForThisClient, column_parent, predicate, consistencyLevel, chosenTime, LamportClock.sendTimestamp(), callback);\n }\n\n //Gather second round responses\n for (BlockingQueueCallback<multiget_slice_by_time_call> callback : secondRoundCallbacks) {\n MultigetSliceResult result = callback.getResponseNoInterruption().getResult();\n LamportClock.updateTime(result.lts);\n\n substituteValidFirstRoundResults(result, keyToResult);\n\n //if (logger.isTraceEnabled()) { logger.trace(\"round 2 responses for \" + printKeys(result.getValue().keySet())); }\n\n keyToResult.putAll(result.getValue());\n }\n }\n\n //Add dependencies on anything returned and removed deleted columns\n for (Entry<ByteBuffer, List<ColumnOrSuperColumn>> entry : keyToResult.entrySet()) {\n ByteBuffer key = entry.getKey();\n List<ColumnOrSuperColumn> coscList = entry.getValue();\n\n for (Iterator<ColumnOrSuperColumn> cosc_it = coscList.iterator(); cosc_it.hasNext(); ) {\n ColumnOrSuperColumn cosc = cosc_it.next();\n try {\n clientContext.addDep(key, cosc);\n } catch (NotFoundException nfe) {\n //remove deleted results, it's okay for all result to be removed\n cosc_it.remove();\n }\n }\n }\n //if (logger.isTraceEnabled()) {\n // logger.trace(\"forced_2round_multiget_slice result = {}\", keyToResult);\n //}\n return keyToResult;\n }", "@Test\n public void testBoundsAsCompositesWithMultiInRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n Restriction in = newMultiIN(cfMetaData, 0, asList(value1, value2), asList(value2, value3));\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(in);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertComposite(bounds.get(1), value2, value3, EOC.END);\n }", "public static boolean IS_SUBFEATURE(Feature a, int index_a, Feature b, int index_b) {\n\n boolean anotinb, bnotina;\n int i, ia, ib;\n\n if (index_a != index_b)\n Dataset.perror(\"Feature.class :: not the same feature (\" + index_a + \" != \" + index_b + \")\");\n if (!a.type.equals(b.type))\n Dataset.perror(\n \"Feature.class :: not the same type of feature (\" + a.type + \" != \" + b.type + \")\");\n\n if (IS_CONTINUOUS(a.type)) {\n if (a.dmin >= b.dmin) {\n if (a.dmax <= b.dmax) return true;\n else\n Dataset.perror(\n \"Feature.class :: inconsistency for subfeature check for : (\"\n + a.dmin\n + \", \"\n + a.dmax\n + \") subseteq (\"\n + b.dmin\n + \", \"\n + b.dmax\n + \") ? \");\n } else if (a.dmax < b.dmax)\n Dataset.perror(\n \"Feature.class :: inconsistency for subfeature check for : (\"\n + a.dmin\n + \", \"\n + a.dmax\n + \") subseteq (\"\n + b.dmin\n + \", \"\n + b.dmax\n + \") ? \");\n } else if (IS_INTEGER(a.type)) {\n if (a.imin >= b.imin) {\n if (a.imax <= b.imax) return true;\n else\n Dataset.perror(\n \"Feature.class :: inconsistency for subfeature check for : (\"\n + a.imin\n + \", \"\n + a.imax\n + \") subseteq (\"\n + b.imin\n + \", \"\n + b.imax\n + \") ? \");\n } else if (a.imax < b.imax)\n Dataset.perror(\n \"Feature.class :: inconsistency for subfeature check for : (\"\n + a.imin\n + \", \"\n + a.imax\n + \") subseteq (\"\n + b.imin\n + \", \"\n + b.imax\n + \") ? \");\n } else if (IS_NOMINAL(a.type)) {\n if (a.modalities == null) return true;\n else if (b.modalities != null) {\n anotinb = bnotina = false;\n ia = ib = -1;\n for (i = 0; i < a.modalities.size(); i++)\n if (!b.modalities.contains((String) a.modalities.elementAt(i))) {\n anotinb = true;\n ia = i;\n }\n for (i = 0; i < b.modalities.size(); i++)\n if (!a.modalities.contains((String) b.modalities.elementAt(i))) {\n bnotina = true;\n ib = i;\n }\n if ((anotinb) && (bnotina))\n Dataset.perror(\n \"Feature.class :: inconsistency for subfeature check for : \"\n + ((String) a.modalities.elementAt(ia))\n + \" not in b and \"\n + ((String) b.modalities.elementAt(ib))\n + \" not in a \");\n else if (!anotinb) return true;\n }\n } else Dataset.perror(\"Feature.class :: no Feature type for \" + a.type);\n\n return false;\n }", "DataFrame<R,C> select(Predicate<DataFrameRow<R,C>> rowPredicate, Predicate<DataFrameColumn<R,C>> colPredicate);", "public void testFilterOnAggregationColumn() throws Exception {\n \t\tccName = new String[] { \"cc1\", \"cc2\", \"cc3\" };\n \t\tccExpr = new String[] { \"row.COL0+row.COL1\",\n \t\t\t\t\"Total.runningSum(row.cc1,row.COL0==0,0)\",\n \t\t\t\t\"Total.runningSum(row.cc1,row.COL0>0,0)\" };\n \n \t\tfor (int i = 0; i < ccName.length; i++) {\n \t\t\tComputedColumn computedColumn = new ComputedColumn(ccName[i],\n \t\t\t\t\tccExpr[i], DataType.ANY_TYPE);\n \t\t\t((BaseDataSetDesign) this.dataSet)\n \t\t\t\t\t.addComputedColumn(computedColumn);\n \t\t}\n \n \t\tString[] bindingNameRow = new String[7];\n \t\tbindingNameRow[0] = \"ROW_COL0\";\n \t\tbindingNameRow[1] = \"ROW_COL1\";\n \t\tbindingNameRow[2] = \"ROW_COL2\";\n \t\tbindingNameRow[3] = \"ROW_COL3\";\n \t\tbindingNameRow[4] = \"ROW_cc1\";\n \t\tbindingNameRow[5] = \"ROW_cc2\";\n \t\tbindingNameRow[6] = \"ROW_cc3\";\n \t\tScriptExpression[] bindingExprRow = new ScriptExpression[] {\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL0\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL1\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL2\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL3\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + ccName[0], 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + ccName[1], 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + ccName[2], 0) };\n \n \t\tIResultIterator resultIt = this.executeQuery(this.createQuery(null,\n \t\t\t\tnull, null, null, null, null, null, null, null, bindingNameRow,\n \t\t\t\tbindingExprRow));\n \n \t\tprintResult(resultIt, bindingNameRow, bindingExprRow);\n \t\t// assert\n \t\tcheckOutputFile();\n \n \t}", "Boolean isCollinearTo(IVec3 v);", "private boolean checkColoumnForOctPair(int j1, int j2) {\n for(int i=0;i<4;i++)\r\n {\r\n if(Kmap[i][j1]==0 || Kmap[i][j1]==-1)\r\n return false;\r\n }\r\n for(int i=0;i<4;i++)\r\n {\r\n if(Kmap[i][j2]==0 || Kmap[i][j2]==-1)\r\n return false;\r\n }\r\n for(int i=0;i<4;i++)\r\n {\r\n Kmap[i][j1]=-1;\r\n }\r\n for(int i=0;i<4;i++)\r\n {\r\n Kmap[i][j2]=-1;\r\n } \r\n return true; \r\n }", "List<Trueorfalse> selectByExample(RowBounds rowBounds);", "@Test\n \tpublic void whereClauseForNodeRightOverlap() {\n \t\tnode23.addJoin(new RightOverlap(node42));\n \t\tcheckWhereCondition(\n \t\t\t\tjoin(\"=\", \"_node23.text_ref\", \"_node42.text_ref\"),\n \t\t\t\tjoin(\">=\", \"_node23.right\", \"_node42.right\"),\n \t\t\t\tjoin(\">=\", \"_node42.right\", \"_node23.left\"),\n \t\t\t\tjoin(\">=\", \"_node23.left\", \"_node42.left\")\n \t\t);\n \t}", "private boolean canSetSafelyDownColumn(MTreeNode row, MTreeNode col, UnionDoubleIntervals newVal) {\n\t\tMTreeNode rowKids[]=row.getChildren();\n\t\tif (rowKids.length==0) return true;\n\t\tUnionDoubleIntervals rowKidsInts[]=new UnionDoubleIntervals[rowKids.length];\n\t\tfor(int i=0; i<rowKids.length; i++) {\n\t\t\trowKidsInts[i]=get(rowKids[i], col);\n\t\t\tif (rowKidsInts[i]==null) {\n\t\t\t\t//If a sibling is null, I cannot check, so just return\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\tUnionDoubleIntervals sum=UnionDoubleIntervals.sum(rowKidsInts);\n\t\treturn newVal.intersects(sum);\n\t}", "@Test\r\n public void testIsSubset1() {\r\n Assert.assertEquals(false, set1.isSubset(set2));\r\n }", "private Object isValidColumnVector(List<List<Double>> vector) {\n\t\tInteger nrows = vector.size();\n\n\t\tList<Integer> rowLengths = vector.stream().map(List::size).toList();\n\t\tInteger ncols = rowLengths.stream().mapToInt(Integer::intValue).sum() / rowLengths.size();\n\n\t\treturn (nrows == 3) && (ncols == 1);\n\t}", "private boolean checkColoumnForQuadPair(int j1) {\n for(int i=0;i<4;i++)\r\n {\r\n if(Kmap[i][j1]==0 || Kmap[i][j1]==-1)\r\n return false;\r\n }\r\n for(int i=0;i<4;i++)\r\n {\r\n Kmap[i][j1]=-1;\r\n }\r\n return true; \r\n }", "protected void checkBox(int slice, int row, int column, int depth, int height, int width) {\n\tif (slice<0 || depth<0 || slice+depth>slices || row<0 || height<0 || row+height>rows || column<0 || width<0 || column+width>columns) throw new IndexOutOfBoundsException(toStringShort()+\", slice:\"+slice+\", row:\"+row+\" ,column:\"+column+\", depth:\"+depth+\" ,height:\"+height+\", width:\"+width);\n}", "@Test\n public void testPartitionColumnSelection() {\n Path filePath = new Path(\"hdfs:///w/x/y/z.csv\");\n ImplicitColumnManager implictColManager = new ImplicitColumnManager(\n fixture.getOptionManager(),\n standardOptions(filePath));\n\n String dir0 = ScanTestUtils.partitionColName(0);\n // Sic: case insensitivity, but name in project list\n // is preferred over \"natural\" name.\n String dir1 = \"DIR1\";\n String dir2 = ScanTestUtils.partitionColName(2);\n ScanLevelProjection scanProj = ScanLevelProjection.build(\n RowSetTestUtils.projectList(dir2, dir1, dir0, \"a\"),\n Lists.newArrayList(implictColManager.projectionParser()));\n\n assertEquals(4, scanProj.columns().size());\n assertEquals(dir2, scanProj.columns().get(0).name());\n assertEquals(dir1, scanProj.columns().get(1).name());\n assertEquals(dir0, scanProj.columns().get(2).name());\n assertEquals(\"a\", scanProj.columns().get(3).name());\n\n // Verify column type\n\n assertTrue(scanProj.columns().get(0) instanceof PartitionColumn);\n }", "@Nullable\n public abstract GridAxis subset(GridSubset params, Formatter errlog);", "@Test\n public void whereExplodeColumn() throws Exception {\n String sql = \"desc verbose select k1, e1 from db1.tbl1 lateral view explode_split(k2, \\\",\\\") tmp as e1 \"\n + \"where e1='1'; \";\n String explainString = UtFrameUtils.getSQLPlanOrErrorMsg(ctx, sql, true);\n Assert.assertTrue(explainString.contains(\"1:TABLE FUNCTION NODE\"));\n Assert.assertTrue(explainString.contains(\"table function: explode_split(`k2`, ',')\"));\n Assert.assertTrue(explainString.contains(\"PREDICATES: `e1` = '1'\"));\n Assert.assertTrue(explainString.contains(\"tuple ids: 0 1\"));\n Assert.assertTrue(explainString.contains(\"TupleDescriptor{id=1, tbl=tmp, byteSize=32, materialized=true}\"));\n Assert.assertTrue(explainString.contains(\"SlotDescriptor{id=1, col=e1, type=VARCHAR(*)}\"));\n }", "private boolean isSubset(List<ConceptLabel> outer, List<ConceptLabel> inner){\n\t\tfor(ConceptLabel in: inner){\n\t\t\tboolean c = false;\n\t\t\tfor(ConceptLabel l: outer){\n\t\t\t\tif(l.getText().equals(in.getText())){\n\t\t\t\t\tc = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(!c)\n\t\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "static boolean isSubset(int Tab1[], int Tab2[], int m, int n)\n {\n // compléter\n //Trouver le max de Tab1[]\n int max=Tab1[0];\n for(int i = 1; i < m; i++) {\n\t\t\tif (Tab1[i]>max){\n max=Tab1[i];\n }\n\t\t}\n \n\t\t//Stockage de la Tab1 dans une table de hashage\n\t\tint[] hashTable = new int[max];\n\t\tfor(int i = 0; i < m; i++) {\n\t\t\thashTable[hash(Tab1[i], max)] = Tab1[i];\n\t\t}\n\t\t\n\t\t//verifier que chaque element (de Tab2) existe dans la hashtable\n\t\tfor(int j = 0; j < n; j++) {\n\t\t\tif(Tab2[j] != hashTable[hash(Tab2[j], max)]) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t}\n return true;\n \n //Complexite aymptotique :\n /*\n Puisque la boucle qui a le plus d'itérations est celle avec l'élément m, la compléxité\n asymptotique est O(m).\n f(m,n) = 2m + n = O(m), puisque m > n\n */\n \n\n }", "@Test\n \tpublic void whereClauseForNodeRangedDominance() {\n \t\tnode23.addJoin(new Dominance(node42, 10, 20));\n \t\tcheckWhereCondition(\n //\t\t\t\tjoin(\"=\", \"_rank23.component_ref\", \"_rank42.component_ref\"),\n \t\t\t\tjoin(\"=\", \"_component23.type\", \"'d'\"),\n \t\t\t\t\"_component23.name IS NULL\",\n \t\t\t\tjoin(\"<\", \"_rank23.pre\", \"_rank42.pre\"),\n \t\t\t\tjoin(\"<\", \"_rank42.pre\", \"_rank23.post\"),\n \t\t\t\t\"_rank23.level BETWEEN SYMMETRIC _rank42.level - 10 AND _rank42.level - 20\"\n \n \t\t);\n \t}", "private boolean checkifCollinear(Point[] ptArr, Comparator<Point> cmp, int start){\n\t\tif(start +2 >= ptArr.length) return false;\t\n\t\tif(cmp.compare(ptArr[start],ptArr[start+1]) == cmp.compare(ptArr[start+1],ptArr[start+2]) && cmp.compare(ptArr[start],ptArr[start+1]) == 0){\n\t\t\treturn true;\n\t\t}\t\t\n\t\treturn false;\t\n\t}", "boolean hasPermissionOfCluster(String clusterId, String userName);", "public void testSortOnComputedColumn1() throws Exception {\n \t\tccName = new String[] { \"cc\" };\n \t\tccExpr = new String[] { \"(row.COL0%2==0?1:2)\" };\n \n \t\tfor (int i = 0; i < ccName.length; i++) {\n \t\t\tComputedColumn computedColumn = new ComputedColumn(ccName[i],\n \t\t\t\t\tccExpr[i], DataType.ANY_TYPE);\n \t\t\t((BaseDataSetDesign) this.dataSet)\n \t\t\t\t\t.addComputedColumn(computedColumn);\n \t\t}\n \n \t\tString[] bindingNameSort = new String[1];\n \t\tbindingNameSort[0] = \"SORT_DEFINITION\";\n \t\tIBaseExpression[] bindingExprSort = new IBaseExpression[1];\n \t\tbindingExprSort[0] = new ScriptExpression(\"dataSetRow.cc\");\n \n \t\tSortDefinition[] sortDefn = new SortDefinition[] { new SortDefinition() };\n \t\tsortDefn[0].setColumn(\"SORT_DEFINITION\");\n \t\tsortDefn[0].setSortDirection(ISortDefinition.SORT_DESC);\n \n \t\tString[] bindingNameRow = new String[5];\n \t\tbindingNameRow[0] = \"ROW_COL0\";\n \t\tbindingNameRow[1] = \"ROW_COL1\";\n \t\tbindingNameRow[2] = \"ROW_COL2\";\n \t\tbindingNameRow[3] = \"ROW_COL3\";\n \t\tbindingNameRow[4] = \"ROW_cc\";\n \t\tScriptExpression[] bindingExprRow = new ScriptExpression[] {\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL0\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL1\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL2\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL3\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + ccName[0], 0), };\n \n \t\tIResultIterator resultIt = this.executeQuery(this.createQuery(null,\n \t\t\t\tnull, null, bindingNameSort, bindingExprSort, sortDefn, null,\n \t\t\t\tnull, null, bindingNameRow, bindingExprRow));\n \n \t\tprintResult(resultIt, bindingNameRow, bindingExprRow);\n \t\t// assert\n \t\tcheckOutputFile();\n \t}", "@Test\n \tpublic void whereClauseForNodeOverlap() {\n \t\tnode23.addJoin(new Overlap(node42));\n \t\tcheckWhereCondition(\n \t\t\t\tjoin(\"=\", \"_node23.text_ref\", \"_node42.text_ref\"),\n \t\t\t\tjoin(\"<=\", \"_node23.left\", \"_node42.right\"),\n \t\t\t\tjoin(\"<=\", \"_node42.left\", \"_node23.right\")\n \t\t);\n \t}", "private int[][] generateCandidates(int[][] usageM){\n\t\t// 1. start with the complete set of attributes\n\t\tMap<Integer, List<Integer>> partitionAttributes = new HashMap<Integer,List<Integer>>();\n\t\tList<Integer> attributes = new ArrayList<Integer>();\n\t\tfor(int i=0;i<usageM[0].length;i++)\n\t\t\tattributes.add(i);\n\t\tpartitionAttributes.put(0, attributes);\n\t\t\n\t\t// 2. for each query, split this set of attributes into two set:\n\t\t// (i) attributes accessed by the query\n\t\t//\t (ii) attributes not-accessed by the query\n\t\tfor(int[] query: usageM){\n\t\t\tMap<Integer, List<Integer>> newPartitionAttributes = new HashMap<Integer,List<Integer>>();\n\t\t\tint partitionCount = partitionAttributes.size();\n\t\t\t\n\t\t\t// check each partition\n\t\t\tfor(int p: partitionAttributes.keySet()){\n\t\t\t\tList<Integer> attrs = partitionAttributes.get(p);\n\t\t\t\tboolean fullPartitionAccess = true;\n\t\t\t\tfor(int a: attrs){\n\t\t\t\t\tif(query[a]==0)\n\t\t\t\t\t\tfullPartitionAccess = false;\n\t\t\t\t}\n\n\t\t\t\tif(fullPartitionAccess){\n\t\t\t\t\tnewPartitionAttributes.put(p, attrs);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t//int newPartition = partitionAttributes.size();\n\t\t\t\t\tList<Integer> accessedAttrs = new ArrayList<Integer>();\n\t\t\t\t\tList<Integer> nonAccessedAttrs = new ArrayList<Integer>();\n\t\t\t\t\tfor(int a: attrs){\n\t\t\t\t\t\tif(query[a]==1)\n\t\t\t\t\t\t\taccessedAttrs.add(a);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tnonAccessedAttrs.add(a);\n\t\t\t\t\t}\n\t\t\t\t\tif(nonAccessedAttrs.size() > 0)\n\t\t\t\t\t\tnewPartitionAttributes.put(p, nonAccessedAttrs);\n\t\t\t\t\tif(accessedAttrs.size() > 0)\n\t\t\t\t\t\tnewPartitionAttributes.put(partitionCount++, accessedAttrs);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//System.out.println(newPartitionAttributes);\n\t\t\t\n\t\t\tpartitionAttributes = newPartitionAttributes;\n\t\t}\n\t\t\n\t\t\n\t\t// 3. we end up with a set of attribute sets; all attributes in \n\t\t//\t an attribute set are always accessed together.\n\t\tint[][] primaryPartitions = new int[partitionAttributes.size()][];\n\t\tint i=0;\n\t\tfor(int p: partitionAttributes.keySet()){\n\t\t\tList<Integer> attrs = partitionAttributes.get(p);\n\t\t\tprimaryPartitions[i] = new int[attrs.size()];\n\t\t\tfor(int j=0;j<attrs.size();j++)\n\t\t\t\tprimaryPartitions[i][j] = attrs.get(j);\n\t\t\ti++;\n\t\t}\n\t\t\n\t\treturn primaryPartitions;\n\t}", "public abstract int Compare(Slice a, Slice b);", "public List<Integer> selectRangeWherePar(byte[][] selectCols, byte[] whereCol, long value1, long value2, ResultSet result){\n List<Integer> oidList = new ArrayList<Integer>();\n \n //assuming the where col is in type LONG\n boolean[] access = new boolean[keyForLong.length];\n int whereIndex = -1;\n \n for(int i = 0; i < keyForLong.length; i++){\n if(keyForLong[i].equals( new String(whereCol) + separator + \"LONG\" )) whereIndex = i;\n \n access[i] = false;\n for(int j = 0; j < selectCols.length; j++){\n if(keyForLong[i].equals( new String(selectCols[j]) + separator + \"LONG\" )){\n access[i] = true;\n break;\n }\n }\n }\n \n int numOfFields = keyForLong.length;\n for(int i = 0; i < numObject; i++){\n //first check if this object meet the where condition\n long value = longValues[i*numOfFields + whereIndex];\n if( (value >= value1) && (value <= value2)){\n //this object meets condition\n int oid=objectIds[i];\n oidList.add(oid);\n \n //select fields in the select clause\n for(int j = 0; j < access.length; j++){\n if(access[j]){\n String key = keyForLong[j];\n if(j == whereIndex){\n result.addLong(key, oid, value);\n continue;\n }\n long longnum = longValues[i*numOfFields + j];\n if(longnum != UNDEFINED)\n result.addLong(key, oid, longnum);\n }\n }\n }\n }\n \n if(oidList.size() > 0){\n //if this partition also has other data types, also select those based on oidList\n if(keyForString.length != 0)\n selectConditionString(oidList, selectCols, result);\n if(keyForDouble.length != 0)\n selectConditionDouble(oidList, selectCols, result);\n if(keyForBool.length != 0)\n selectConditionBool(oidList, selectCols, result);\n }\n return oidList;\n }", "public static void pseudoTrueTuples(LogicProblem logicProblem, boolean applyChanges)\r\n throws RelationshipConflictException {\n \r\n HashMap<ItemPair,Relationship> relationshipTable = logicProblem.getRelationshipTable();\r\n HashSet<CategoryPair> categoryPairs = logicProblem.getCategoryPairs();\r\n \r\n// System.out.println(\"searching...\");\r\n //within a subgrid\r\n for (CategoryPair categoryPair : categoryPairs) {\r\n// System.out.println(\"Category pair:\" + categoryPair);\r\n //vertical and horizontal search\r\n for (final boolean verticalOrientation : new boolean[] { false, true } ) {\r\n\r\n Category subrowCategory = verticalOrientation?categoryPair.first():categoryPair.last();\r\n Category subcolumnCategory = verticalOrientation?categoryPair.last():categoryPair.first();\r\n\r\n //commenting \"vertical search\" \r\n //(subrows match first category's items\r\n // subcolumns match second category's items)\r\n\r\n //i (2 to floor(n/2)) is the number of elements in the combination tuple\r\n // i=2 in pseudoTrue pairs\r\n //(for subgrids of 5x5 items, looking for both pairs and triplets becomes redundant\r\n for (int i=2; i<=floor(logicProblem.getNumCategories()/2);i++) {\r\n\r\n //https://github.com/dpaukov/combinatoricslib3/wiki/v3.3.0#1-simple-combinations\r\n List<List<Item>> columnCombinations = Generator.combination(subcolumnCategory.getItems())\r\n .simple(i) //for pseudo true pairs, i=2\r\n .stream()\r\n .collect(Collectors.<List<Item>>toList());\r\n //for i=2, this would contain \r\n //Bethany, Donovan\r\n //Bethany, Elizabeth\r\n //...\r\n //Frederick, Peyton\r\n// columnCombinations.stream().forEach(l -> System.out.println(\r\n// (verticalOrientation?\"vertical\":\"horizontal\")+ \" combo: \"+l.toString()));\r\n\r\n //create the sets\r\n //for each combination, start over\r\n \r\n //columnTuple contains i items with which we will compute set intersections\r\n for (List<Item> columnItemTuple : columnCombinations) {\r\n //Bethany, Donovan\r\n \r\n //similarly, valueNoSets contains i sets of VALUE_NO relationships\r\n List<Set<Item>> valueNoSets = new ArrayList<>(); //size=i\r\n //build a set for each i item of columnTuple\r\n for (Item columnItem : columnItemTuple) {\r\n //Bethany\r\n Set<Item> valueNoSet = new HashSet<>(); //size = n\r\n for (Item rowItem : subrowCategory.getItems()) {\r\n //Haley's Comet ....\r\n if (relationshipTable.get(new ItemPair(rowItem, columnItem)).getValue() == Relationship.ValueType.VALUE_NO)\r\n //stacking all VALUE_NO relationship into vertical set\r\n valueNoSet.add(rowItem); //store into single subcolumn set \r\n }\r\n //adding each vertical set into list of sets\r\n if (valueNoSet.size() >= logicProblem.getNumItems() - i //for pairs, we need three VALUE_NO in the set\r\n && valueNoSet.size() < logicProblem.getNumItems()-1) //uniqueness will take or n-1 cases\r\n valueNoSets.add(valueNoSet); //store single subcolumn into multi-set\r\n }\r\n //magic!\r\n Set<Item> intersectionSet = new HashSet<>(); //avoid NPE when the next call is made\r\n if (valueNoSets.size()>=2) //don't compute intersections otherwise\r\n intersectionSet = Processor.multiSetIntersection(valueNoSets);\r\n\r\n if (intersectionSet.size()==logicProblem.getNumItems()-i) {\r\n \r\n// System.out.println(\"----> found candidates for pseudo true pairs!\");\r\n// intersectionSet.stream().forEach(l -> System.out.println(\"\\t\" + l.toString()));\r\n// System.out.println(\"\\t\\tvs.\");\r\n// columnItemTuple.stream().forEach(l -> System.out.println(\"\\t\" + l.toString()));\r\n \r\n //create predecessor list\r\n //we can only add the intersection output as predecessors\r\n ArrayList<Dependable> predecessors = new ArrayList<Dependable>();\r\n for (Item intersectionColumn : intersectionSet) {\r\n for (Item rowItem : columnItemTuple) {\r\n predecessors.add(relationshipTable.get(new ItemPair(rowItem, intersectionColumn)));\r\n }\r\n }\r\n\r\n\r\n //we have a bunch of work to do\r\n for (Item everyRowItem : subrowCategory.getItems()) {\r\n //for every row item not in the intersectionSet\r\n if (!intersectionSet.contains(everyRowItem)) {\r\n for (Item everyColumnItem : subcolumnCategory.getItems()) {\r\n //for every column item not in any of the columnTuple list\r\n if (!columnItemTuple.contains(everyColumnItem)) {\r\n Relationship rel = relationshipTable.get(new ItemPair(everyRowItem,everyColumnItem));\r\n if (rel.getValue()!=Relationship.ValueType.VALUE_NO)\r\n Processor.setRelationship(logicProblem, applyChanges, rel, \r\n Relationship.ValueType.VALUE_NO, Relationship.LogicType.PSEUDOTRUE,\r\n predecessors.toArray(new Relationship[predecessors.size()])); \r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }", "public void testMultipass_Sort() throws Exception\n \t{\n \t\tccName = new String[]{\n \t\t\t\t\"cc1\", \"cc2\"\n \t\t};\n \t\tccExpr = new String[]{\n \t\t\t\t\"Total.sum(row.COL1)\", \"Total.sum(row.cc1)\"\n \t\t};\n \n \t\tfor ( int i = 0; i < ccName.length; i++ )\n \t\t{\n \t\t\tComputedColumn computedColumn = new ComputedColumn( ccName[i],\n \t\t\t\t\tccExpr[i],\n \t\t\t\t\tDataType.INTEGER_TYPE );\n \t\t\t( (BaseDataSetDesign) this.dataSet ).addComputedColumn( computedColumn );\n \t\t}\n \t\t\n \t\tString[] bindingNameSort = new String[2];\n \t\tbindingNameSort[0] = \"SORT_DEFINITION_1\";\n \t\tbindingNameSort[1] = \"SORT_DEFINITION_2\";\n \t\tIBaseExpression[] bindingExprSort = new IBaseExpression[2];\n \t\tbindingExprSort[0] = new ScriptExpression(\n \t\t\t\t\"dataSetRow.COL1/(Total.ave(dataSetRow.cc1)+dataSetRow.cc1)\");\n \t\tbindingExprSort[1] = new ScriptExpression(\n \t\t\t\t\"dataSetRow.cc2-dataSetRow.COL2\");\n \t\tSortDefinition[] sortDefn = new SortDefinition[] {\n \t\t\t\tnew SortDefinition(), new SortDefinition() };\n \t\tsortDefn[0].setColumn(\"SORT_DEFINITION_1\");\n \t\tsortDefn[0].setSortDirection(ISortDefinition.SORT_DESC);\n \t\tsortDefn[1].setColumn(\"SORT_DEFINITION_2\");\n \t\tsortDefn[1].setSortDirection(ISortDefinition.SORT_DESC);\n \n \t\tString[] bindingNameRow = new String[6];\n \t\tbindingNameRow[0] = \"ROW_COL0\";\n \t\tbindingNameRow[1] = \"ROW_COL1\";\n \t\tbindingNameRow[2] = \"ROW_COL2\";\n \t\tbindingNameRow[3] = \"ROW_COL3\";\n \t\tbindingNameRow[4] = \"ROW_cc1\";\n \t\tbindingNameRow[5] = \"ROW_cc2\";\n \t\tScriptExpression[] bindingExprRow = new ScriptExpression[]{\n \t\t\t\tnew ScriptExpression( \"dataSetRow.\" + \"COL0\", 0 ),\n \t\t\t\tnew ScriptExpression( \"dataSetRow.\" + \"COL1\", 0 ),\n \t\t\t\tnew ScriptExpression( \"dataSetRow.\" + \"COL2\", 0 ),\n \t\t\t\tnew ScriptExpression( \"dataSetRow.\" + \"COL3\", 0 ),\n \t\t\t\tnew ScriptExpression( \"dataSetRow.\" + ccName[0], 0 ),\n \t\t\t\tnew ScriptExpression( \"dataSetRow.\" + ccName[1], 0 ),\n \t\t};\n \t\tIResultIterator resultIt = this.executeQuery(this.createQuery(null,\n \t\t\t\tnull, null, bindingNameSort, bindingExprSort, sortDefn, null,\n \t\t\t\tnull, null, bindingNameRow, bindingExprRow));\n \n \t\tprintResult(resultIt, bindingNameRow, bindingExprRow);\t\n \t\t// assert\n \t\tcheckOutputFile();\n \t}", "Condition(Column col1, String relation, Column col2) {\n // YOUR CODE HERE\n }", "List<Online> selectByExampleWithRowbounds(OnlineExample example, RowBounds rowBounds);", "@Test\n\t public void test_Is_Subset_Negative() throws Exception{\t\n\t\t SET setarray= new SET( new int[]{1,2,3,4,5});\n\t\t SET subsetarray= new SET( new int[]{7,8});\n\t\t assertFalse(setarray.isSubSet(subsetarray));\t \n\t }", "private int restrictSection(Message msg, String parameter) {\n int sec = Integer.parseInt(parameter);\n\n if(sec > 2) {\n MessageChannel ch = msg.getChannel();\n ch.sendMessage(\"`Error: Invalid query [section not 0-2]. Query terminated.`\").queue();\n return -1;\n }\n else if(sec == 2) {\n partTwo = true;\n upperProblem = 8;\n }\n\n return sec;\n }", "boolean hasCluster();", "public boolean percolates()\r\n { return uf.find(0) == uf.find(dimension*dimension + 1); }", "private List<Integer> chooseInnerModelFeatureColumns(Matrix inputs, Matrix labels)\n\t{\n\t\tMatrix inputsShuffled = new Matrix(inputs);\n\t\tMatrix labelsShuffled = new Matrix(labels);\n\t\tinputs = null;\n\t\tlabels = null;\n\t\tinputsShuffled.shuffle(rand, labelsShuffled);\n\n\t\tMatrix[] sets = createValidationSet(inputsShuffled, labelsShuffled, validationSetPercent);\n\t\tMatrix tInputs = sets[0];\n\t\tMatrix tLabels = sets[1];\n\t\tMatrix vInputs = sets[2];\n\t\tMatrix vLabels = sets[3];\n\n\t\t// Greedily search for the best columns to train model i on.\n\t\t\t\n\t\tList<Integer> keepColumns = new ArrayList<>(featureColumnsToAlwaysUse);\n\t\t\n\t\tdouble lastIterationScore;\n\t\tif (featureColumnsToAlwaysUse.isEmpty())\n\t\t{\n\t\t\tlastIterationScore = Double.NEGATIVE_INFINITY;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tSupervisedLearner initialModel = trainOnColumns(tInputs, tLabels, keepColumns);\n\t\t\tlastIterationScore = validateOnColumns(vInputs, vLabels, keepColumns, initialModel);\n\t\t}\n\t\t\n\t\tLogger.println(\"initial lastIterationScore: \" + lastIterationScore);\n\t\t\n\t\tList<Integer> featureSelectionCols = Helper.iteratorToList(new Range(tInputs.cols()));\n\t\tfeatureSelectionCols.removeAll(featureColumnsToAlwaysUse);\n\t\t\n\t\twhile (!featureSelectionCols.isEmpty())\n\t\t{\n\t\t\t// Find the feature selection column which helps the model the most.\n\t\t\tTuple2<Integer, Double> bestTuple = featureSelectionCols.stream()\n\t\t\t\t\t.map(c -> \n\t\t\t\t\t{\n\t\t\t\t\t\tList<Integer> columns = new ArrayList<>(keepColumns);\n\t\t\t\t\t\tcolumns.add(c);\n\t\t\t\t\t\tSupervisedLearner model = trainOnColumns(tInputs, tLabels, columns);\n\t\t\t\t\t\tdouble score = validateOnColumns(vInputs, vLabels, columns, model);\n\t\t\t\t\t\treturn new Tuple2<Integer, Double>(c, score);\n\t\t\t\t\t})\n\t\t\t\t\t.max((t1, t2) -> Double.compare(t1.getSecond(), t2.getSecond())).get();\n\n\t\t\tif (bestTuple.getSecond() > lastIterationScore)\n\t\t\t{\n\t\t\t\tLogger.println(\"Keeping column \" + bestTuple.getFirst() + \", new score: \" + bestTuple.getSecond());\n\t\t\t\tkeepColumns.add(bestTuple.getFirst());\n\t\t\t\tfeatureSelectionCols.remove(bestTuple.getFirst());\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tlastIterationScore = bestTuple.getSecond();\n\t\t}\n\t\t\n\t\treturn keepColumns;\n\t}", "public abstract Optional<GridAxis> subsetDependent(GridAxis1D subsetIndAxis, Formatter errlog);", "public boolean columnFitsIn(int x1, int x2){\n return x1 < columnBoundaryX1+(AVGCharDistance/2)&&x2>columnBoundaryX2-(AVGCharDistance/2);\n }", "@Test\n public void testBoundsAsCompositesWithEqAndInRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n Restriction eq = newSingleEq(cfMetaData, 0, value1);\n Restriction in = newSingleIN(cfMetaData, 1, value1, value2, value3);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(in);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.START);\n assertComposite(bounds.get(2), value1, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value1, EOC.END);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n assertComposite(bounds.get(2), value1, value3, EOC.END);\n }", "public void checkBounds() {\n\t\tfor (int k = 0; k < numDataCols; k++) {\n\t\t\tDashDataType<?> dtype = dataTypes[k];\n\n\t\t\tif ( dtype instanceof StringDashDataType ) {\n\t\t\t\tStringDashDataType strtype = (StringDashDataType) dtype;\n\t\t\t\tfor (int j = 0; j < numSamples; j++) {\n\t\t\t\t\tADCMessage msg = strtype.boundsCheckStandardValue(\n\t\t\t\t\t\t\t\t\t\t\t(String) stdObjects[j][k]);\n\t\t\t\t\tif ( msg != null ) {\n\t\t\t\t\t\tmsg.setRowNumber(j+1);\n\t\t\t\t\t\tmsg.setColNumber(k+1);\n\t\t\t\t\t\tmsg.setColName(userColNames[k]);\n\t\t\t\t\t\tstdMsgList.add(msg);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if ( dtype instanceof CharDashDataType ) {\n\t\t\t\tCharDashDataType chartype = (CharDashDataType) dtype;\n\t\t\t\tfor (int j = 0; j < numSamples; j++) {\n\t\t\t\t\tADCMessage msg = chartype.boundsCheckStandardValue(\n\t\t\t\t\t\t\t\t\t\t\t(Character) stdObjects[j][k]);\n\t\t\t\t\tif ( msg != null ) {\n\t\t\t\t\t\tmsg.setRowNumber(j+1);\n\t\t\t\t\t\tmsg.setColNumber(k+1);\n\t\t\t\t\t\tmsg.setColName(userColNames[k]);\n\t\t\t\t\t\tstdMsgList.add(msg);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if ( dtype instanceof IntDashDataType ) {\n\t\t\t\tIntDashDataType inttype = (IntDashDataType) dtype;\n\t\t\t\tfor (int j = 0; j < numSamples; j++) {\n\t\t\t\t\tADCMessage msg = inttype.boundsCheckStandardValue(\n\t\t\t\t\t\t\t\t\t\t\t(Integer) stdObjects[j][k]);\n\t\t\t\t\tif ( msg != null ) {\n\t\t\t\t\t\tmsg.setRowNumber(j+1);\n\t\t\t\t\t\tmsg.setColNumber(k+1);\n\t\t\t\t\t\tmsg.setColName(userColNames[k]);\n\t\t\t\t\t\tstdMsgList.add(msg);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if ( dtype instanceof DoubleDashDataType ) {\n\t\t\t\tDoubleDashDataType dbltype = (DoubleDashDataType) dtype;\n\t\t\t\tfor (int j = 0; j < numSamples; j++) {\n\t\t\t\t\tADCMessage msg = dbltype.boundsCheckStandardValue(\n\t\t\t\t\t\t\t\t\t\t\t(Double) stdObjects[j][k]);\n\t\t\t\t\tif ( msg != null ) {\n\t\t\t\t\t\tmsg.setRowNumber(j+1);\n\t\t\t\t\t\tmsg.setColNumber(k+1);\n\t\t\t\t\t\tmsg.setColName(userColNames[k]);\n\t\t\t\t\t\tstdMsgList.add(msg);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthrow new IllegalArgumentException(\"unexpected data type encountered \" + \n\t\t\t\t\t\t\"in bounds checking: \" + dtype);\n\t\t\t}\n\t\t}\n\t}", "public void testGetSubDimensionality()\n {\n RandomSubVectorThresholdLearner<String> instance = new RandomSubVectorThresholdLearner<String>();\n\n instance.setPercentToSample(0.5);\n assertEquals(5, instance.getSubDimensionality(10));\n\n instance.setPercentToSample(0.25);\n assertEquals(2, instance.getSubDimensionality(9));\n\n instance.setPercentToSample(1.0);\n assertEquals(9, instance.getSubDimensionality(9));\n\n instance.setPercentToSample(0.0);\n assertEquals(1, instance.getSubDimensionality(9));\n }", "private boolean checkOverlap(int row, int col, int length){\n \tif(!inBounds(row,col)){\n \t\treturn false;\n \t}\n \tfor(int i = row; i < row + length; i++ ){\n\t\t\tfor(int j = col; j < col + length; j++){\n\t\t\t\tif(grid[i][col] == 1 || row + length >= 10)\n\t\t\t\t\treturn false;\n\t\t\t\tif(grid[row][j] == 1 || col + length >= 10)\n\t\t\t\t\treturn false;\n\t\t\t}\n \t\t\n \t}\n \treturn true;\n }", "@Test\n\t public void test_Is_Subset_Positive() throws Exception{\t\n\t\t SET setarray= new SET( new int[]{1,2,3,4,5});\n\t\t SET subsetarray= new SET( new int[]{1,2,3});\n\t\t assertTrue(setarray.isSubSet(subsetarray));\t \n\t }", "@Test\n public void testMultiLevelPartitionPruning() throws SqlParseException {\n\n val project = \"multi_level_partition\";\n val dfId = \"747f864b-9721-4b97-acde-0aa8e8656cba\";\n val expectedRanges = Lists.<Pair<String, String>> newArrayList();\n val segmentRange1 = Pair.newPair(\"2012-01-01\", \"2012-01-02\");\n val segment1Uuid = \"8892fa3f-f607-4eec-8159-7c5ae2f16942\";\n val segmentRange2 = Pair.newPair(\"2012-01-02\", \"2012-01-03\");\n val segment2Uuid = \"d75a822c-788a-4592-a500-cf20186dded1\";\n val segmentRange3 = Pair.newPair(\"2012-01-03\", \"2012-01-04\");\n val segment3Uuid = \"54eaf96d-6146-45d2-b94e-d5d187f89919\";\n val segmentRange4 = Pair.newPair(\"2012-01-04\", \"2012-01-05\");\n val segment4Uuid = \"411f40b9-a80a-4453-90a9-409aac6f7632\";\n val segmentRange5 = Pair.newPair(\"2012-01-05\", \"2012-01-06\");\n val segment5Uuid = \"a8318597-cb75-416f-8eb8-96ea285dd2b4\";\n val expectedPartitionMap = Maps.<String, List<Long>> newHashMap();\n\n val sqlBase = \"select cal_dt, sum(price) from test_kylin_fact inner join test_account on test_kylin_fact.seller_id = test_account.account_id \";\n\n // no filter\n val noFilterSql = sqlBase + \"group by cal_dt\";\n expectedRanges.add(segmentRange1);\n expectedRanges.add(segmentRange2);\n expectedRanges.add(segmentRange3);\n expectedRanges.add(segmentRange4);\n expectedRanges.add(segmentRange5);\n expectedPartitionMap.put(segment1Uuid, Lists.newArrayList(0L, 1L, 2L, 3L));\n expectedPartitionMap.put(segment2Uuid, Lists.newArrayList(0L, 1L, 2L));\n expectedPartitionMap.put(segment3Uuid, Lists.newArrayList(1L, 2L, 3L));\n expectedPartitionMap.put(segment4Uuid, Lists.newArrayList(0L, 1L));\n expectedPartitionMap.put(segment5Uuid, Lists.newArrayList(2L, 3L));\n assertPrunedSegmentsRange(project, noFilterSql, dfId, expectedRanges, 1L, expectedPartitionMap);\n\n val andSql0 = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-04' and lstg_site_id = 1 group by cal_dt\";\n val andMappingSql0 = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-04' and lstg_format_name = 'FP-non GTC' group by cal_dt\";\n val andMixSql0 = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-04' and lstg_site_id = 1 and lstg_format_name = 'FP-non GTC' group by cal_dt\";\n expectedRanges.clear();\n expectedRanges.add(segmentRange1);\n expectedRanges.add(segmentRange2);\n expectedRanges.add(segmentRange3);\n expectedPartitionMap.clear();\n expectedPartitionMap.put(segment1Uuid, Lists.newArrayList(1L));\n expectedPartitionMap.put(segment2Uuid, Lists.newArrayList(1L));\n expectedPartitionMap.put(segment3Uuid, Lists.newArrayList(1L));\n assertPrunedSegmentsRange(project, andSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n assertPrunedSegmentsRange(project, andMappingSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n assertPrunedSegmentsRange(project, andMixSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n\n val notInSql0 = sqlBase\n + \"where cal_dt > '2012-01-02' and cal_dt < '2012-01-04' and lstg_site_id not in (0, 2, 3) group by cal_dt\";\n val notInMappingSql0 = sqlBase\n + \"where cal_dt > '2012-01-02' and cal_dt < '2012-01-04' and lstg_format_name not in ('FP-GTC', 'ABIN', 'Auction') group by cal_dt\";\n val notInMixSql0 = sqlBase\n + \"where cal_dt > '2012-01-02' and cal_dt < '2012-01-04' and lstg_site_id not in (0, 2, 3) and lstg_format_name not in ('FP-GTC', 'ABIN', 'Auction') group by cal_dt\";\n expectedRanges.clear();\n expectedRanges.add(segmentRange2);\n expectedRanges.add(segmentRange3);\n expectedPartitionMap.clear();\n expectedPartitionMap.put(segment2Uuid, Lists.newArrayList(1L));\n expectedPartitionMap.put(segment3Uuid, Lists.newArrayList(1L));\n assertPrunedSegmentsRange(project, notInSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n assertPrunedSegmentsRange(project, notInMappingSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n assertPrunedSegmentsRange(project, notInMixSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n\n // return empty data case\n val emptyData = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-03' and lstg_site_id = 5 group by cal_dt\";\n val emptyDataMapping = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-03' and lstg_format_name = 'not_exist_name' group by cal_dt\";\n val emptyDataMix = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-03' and lstg_site_id = 5 and lstg_format_name = 'not_exist_name' group by cal_dt\";\n expectedRanges.clear();\n expectedPartitionMap.clear();\n assertPrunedSegmentsRange(project, emptyData, dfId, expectedRanges, -1L, expectedPartitionMap);\n assertPrunedSegmentsRange(project, emptyDataMapping, dfId, expectedRanges, -1L, expectedPartitionMap);\n assertPrunedSegmentsRange(project, emptyDataMix, dfId, expectedRanges, -1L, expectedPartitionMap);\n\n // query data out of current built segments range\n val inSql0 = sqlBase\n + \"where cal_dt > '2011-12-30' and cal_dt < '2012-01-03' and lstg_site_id in (1, 2) group by cal_dt\";\n val inMappingSql0 = sqlBase\n + \"where cal_dt > '2011-12-30' and cal_dt < '2012-01-03' and lstg_format_name in ('FP-non GTC', 'ABIN') group by cal_dt\";\n val inMixSql0 = sqlBase\n + \"where cal_dt > '2011-12-30' and cal_dt < '2012-01-03' and lstg_site_id in (1, 2) and lstg_format_name in ('FP-non GTC', 'ABIN') group by cal_dt\";\n expectedRanges.add(segmentRange1);\n expectedRanges.add(segmentRange2);\n expectedPartitionMap.put(segment1Uuid, Lists.newArrayList(1L, 2L));\n expectedPartitionMap.put(segment2Uuid, Lists.newArrayList(1L, 2L));\n assertPrunedSegmentsRange(project, inSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n assertPrunedSegmentsRange(project, inMappingSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n assertPrunedSegmentsRange(project, inMixSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n\n val pushDownSql0 = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-03' and lstg_site_id = 3 group by cal_dt\";\n assertNoRealizationFound(project, pushDownSql0);\n\n val pushDownMappingSql0 = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-03' and lstg_format_name = 'Auction' group by cal_dt\";\n assertNoRealizationFound(project, pushDownMappingSql0);\n\n val pushDownMixSql0 = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-03' and lstg_site_id = 3 and lstg_format_name = 'Auction' group by cal_dt\";\n assertNoRealizationFound(project, pushDownMixSql0);\n\n // return empty result\n val wrongMapping0 = sqlBase\n + \"where cal_dt between '2012-01-01' and '2012-01-02' and lstg_site_id = 0 and lstg_format_name = 'FP-non GTC' group by cal_dt\";\n assertPrunedSegmentsRange(project, wrongMapping0, dfId, null, -1L, null);\n\n val orSql0 = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-02' and (lstg_site_id = 0 or lstg_format_name = 'FP-non GTC') group by cal_dt\";\n expectedRanges.clear();\n expectedPartitionMap.clear();\n expectedRanges.add(segmentRange1);\n expectedPartitionMap.put(segment1Uuid, Lists.newArrayList(0L, 1L));\n assertPrunedSegmentsRange(project, orSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n }", "@Test\n \tpublic void whereClauseForNodeLeftOverlap() {\n \t\tnode23.addJoin(new LeftOverlap(node42));\n \t\tcheckWhereCondition(\n \t\t\t\tjoin(\"=\", \"_node23.text_ref\", \"_node42.text_ref\"),\n \t\t\t\tjoin(\"<=\", \"_node23.left\", \"_node42.left\"),\n \t\t\t\tjoin(\"<=\", \"_node42.left\", \"_node23.right\"),\n \t\t\t\tjoin(\"<=\", \"_node23.right\", \"_node42.right\")\n \t\t);\n \t}", "boolean getIsClusteringKey();", "@Test\n\tpublic void evalCrispDistanceWithFuzzyNumberOverlap2(){\n\t\tFuzzySet res = cs4.distance(dfn3);\n\t\tassertTrue(res instanceof FuzzyInterval);\n\t\tFuzzyInterval fuzzyRes = (FuzzyInterval)res;\n\t\t//Puntos limite\n\t\tassertTrue(fuzzyRes.getMembershipValue(0)==1);\n\t\tassertTrue(fuzzyRes.getMembershipValue(1)==1);\n\t\tassertTrue(fuzzyRes.getMembershipValue(2)==0);\n\t\t//Valores exteriores\n\t\tassertTrue(fuzzyRes.getMembershipValue(3)==0);\n\t\tassertTrue(fuzzyRes.getMembershipValue(-1)==0);\n\t}", "public void testGetColumnIndex() {\n TaskSeriesCollection c = createCollection1();\n }", "private int adequateDimensions(int cols, int rows) {\r\n\r\n if ((cols >= MINALG) && (cols <= MAXALG)) {\r\n if ((rows >= MINDATA) && (rows <= MAXDATA)) {\r\n return 0;\r\n } else {\r\n return 1;\r\n }\r\n } else {\r\n return 2;\r\n }\r\n\r\n }", "public void testNestedComputedColumn( ) throws Exception\n \t{\n \t\tccName = new String[] { \"cc1\", \"cc2\", \"cc3\" };\n \t\tccExpr = new String[] {\n \t\t\t\t\"row.COL0+row.COL1\",\n \t\t\t\t\"row.cc1*100\",\n \t\t\t\t\"Total.runningSum(row.cc1/Total.sum(row.cc1))*100\" };\n \n \t\tfor (int i = 0; i < ccName.length; i++) {\n \t\t\tComputedColumn computedColumn = new ComputedColumn(ccName[i],\n \t\t\t\t\tccExpr[i], DataType.ANY_TYPE);\n \t\t\t((BaseDataSetDesign) this.dataSet)\n \t\t\t\t\t.addComputedColumn(computedColumn);\n \t\t}\n \t\t\n \t\tString[] bindingNameRow = new String[7];\n \t\tbindingNameRow[0] = \"ROW_COL0\";\n \t\tbindingNameRow[1] = \"ROW_COL1\";\n \t\tbindingNameRow[2] = \"ROW_COL2\";\n \t\tbindingNameRow[3] = \"ROW_COL3\";\n \t\tbindingNameRow[4] = \"ROW_cc1\";\n \t\tbindingNameRow[5] = \"ROW_cc2\";\n \t\tbindingNameRow[6] = \"ROW_cc3\";\n \t\tScriptExpression[] bindingExprRow = new ScriptExpression[] {\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL0\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL1\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL2\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL3\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + ccName[0], 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + ccName[1], 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + ccName[2], 0) };\n \n \t\tIResultIterator resultIt = this.executeQuery(this.createQuery(null,\n \t\t\t\tnull, null, null, null, null, null, null, null, bindingNameRow,\n \t\t\t\tbindingExprRow));\n \n \t\tprintResult(resultIt, bindingNameRow, bindingExprRow);\n \t\t// assert\n \t\tcheckOutputFile();\n \t\t\n \t}", "@Test\n public void testColumnControlInvisibleColumns() {\n final JXTable table = new JXTable(sortableTableModel);\n // columns set to invisible before setting the columnControl\n // will not be inserted into the column control's list\n// table.getColumnExt(\"Last Name\").setVisible(false);\n table.setColumnControlVisible(true);\n int totalColumnCount = table.getColumnCount();\n final TableColumnExt priorityColumn = table.getColumnExt(\"First Name\");\n priorityColumn.setVisible(false);\n ColumnControlButton columnControl = (ColumnControlButton) table.getColumnControl();\n assertNotNull(\"popup menu not null\", columnControl.popup);\n int columnMenuItems = 0;\n Component[] items = ((DefaultColumnControlPopup) columnControl.getColumnControlPopup()).getPopupMenu().getComponents();\n for (int i = 0; i < items.length; i++) {\n if (!(items[i] instanceof JMenuItem)) {\n break;\n }\n columnMenuItems++;\n }\n // wrong assumption - has separator and actions!\n assertEquals(\"menu items must be equal to columns\", totalColumnCount, \n columnMenuItems);\n JCheckBoxMenuItem menuItem = (JCheckBoxMenuItem) ((DefaultColumnControlPopup) columnControl.getColumnControlPopup()).getPopupMenu()\n .getComponent(0);\n // sanit assert\n assertEquals(priorityColumn.getHeaderValue(), menuItem.getText());\n assertEquals(\"selection of menu must be equal to column visibility\", \n priorityColumn.isVisible(), menuItem.isSelected());\n }", "@Test\n void testSubset() throws IOException {\n Long expectedNumberOfVariables = 13L;\n Long expectedNumberOfCases = 24L; // aka the number of lines in the TAB file produced by the ingest plugin\n\n TabularDataIngest ingestResult;\n File file = getFile(\"csv/ingest/election_precincts.csv\");\n try (BufferedInputStream stream = new BufferedInputStream(new FileInputStream(file))) {\n CSVFileReader instance = createInstance();\n ingestResult = instance.read(Tuple.of(stream, file), null);\n }\n\n File generatedTabFile = ingestResult.getTabDelimitedFile();\n DataTable generatedDataTable = ingestResult.getDataTable();\n\n assertThat(generatedDataTable).isNotNull();\n assertThat(generatedDataTable.getDataVariables()).isNotNull();\n assertThat(generatedDataTable.getVarQuantity()).isEqualTo((long) generatedDataTable.getDataVariables().size());\n assertThat(generatedDataTable.getVarQuantity()).isEqualTo(expectedNumberOfVariables);\n assertThat(generatedDataTable.getCaseQuantity()).isEqualTo(expectedNumberOfCases);\n\n // And now let's try and subset the individual vectors\n // First, the \"continuous\" vectors (we should be able to read these as Double[]):\n int[] floatColumns = {2};\n\n Double[][] floatVectors = {\n { 1.0, 3.0, 4.0, 6.0, 7.0, 8.0, 11.0, 12.0, 76.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0 },\n };\n\n IngestDataProvider dataProvider = new InMemoryIngestDataProvider();\n dataProvider.initialize(generatedDataTable, generatedTabFile);\n\n int vectorCount = 0;\n for (int i : floatColumns) {\n // We'll be subsetting the column vectors one by one, re-opening the\n // file each time. Inefficient - but we don't care here.\n\n if (!generatedDataTable.getDataVariables().get(i).isIntervalContinuous()) {\n fail(\"Column \" + i + \" was not properly processed as \\\"continuous\\\"\");\n }\n\n Double[] columnVector = dataProvider.getDoubleColumn(i);\n\n assertThat(columnVector).isEqualTo(floatVectors[vectorCount++]);\n }\n\n // Discrete Numerics (aka, integers):\n int[] integerColumns = { 1, 4, 6, 7, 8, 9, 10, 11, 12 };\n\n Long[][] longVectors = {\n { 1L, 3L, 4L, 6L, 7L, 8L, 11L, 12L, 76L, 77L, 77L, 77L, 77L, 77L, 77L, 77L, 77L, 77L, 77L, 77L, 77L, 77L, 77L, 77L },\n { 1L, 2L, 3L, 4L, 5L, 11L, 13L, 15L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L },\n { 85729227L, 85699791L, 640323976L, 85695847L, 637089796L, 637089973L, 85695001L, 85695077L, 1111111L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L },\n { 205871733L, 205871735L, 205871283L, 258627915L, 257444575L, 205871930L, 260047422L, 262439738L, 1111111L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L },\n { 205871673L, 205871730L, 205871733L, 205872857L, 258627915L, 257444584L, 205873413L, 262439738L, 1111111L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L },\n { 25025000201L, 25025081001L, 25025000701L, 25025050901L, 25025040600L, 25025000502L, 25025040401L, 25025100900L, 1111111L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L },\n { 250250502002L, 250250502003L, 250250501013L, 250250408011L, 250250503001L, 250250103001L, 250250406002L, 250250406001L, 1111111L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L },\n { 250251011024001L, 250251011013003L, 250251304041007L, 250251011013006L, 250251010016000L, 250251011024002L, 250251001005004L, 250251002003002L, 1111111L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L },\n { 2109L, 2110L, 2111L, 2120L, 2121L, 2115L, 2116L, 2122L, 11111L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L }\n };\n\n vectorCount = 0;\n\n for (int i : integerColumns) {\n if (!generatedDataTable.getDataVariables().get(i).isIntervalDiscrete()\n || !generatedDataTable.getDataVariables().get(i).isTypeNumeric()) {\n fail(\"Column \" + i + \" was not properly processed as \\\"discrete numeric\\\"\");\n }\n\n Long[] columnVector = dataProvider.getLongColumn(i);\n\n assertThat(columnVector).isEqualTo(longVectors[vectorCount++]);\n }\n\n // And finally, Strings:\n int[] stringColumns = {0, 3, 5};\n\n String[][] stringVectors = {\n { \"Dog\", \"Squirrel\", \"Antelope\", \"Zebra\", \"Lion\", \"Gazelle\", \"Cat\", \"Giraffe\", \"Cat\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\" },\n { \"East Boston\", \"Charlestown\", \"South Boston\", \"Bronx\", \"Roslindale\", \"Mission Hill\", \"Jamaica Plain\", \"Hyde Park\", \"Fenway/Kenmore\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\" },\n { \"2-06\", \"1-09\", \"1-1A\", \"1-1B\", \"2-04\", \"3-05\", \"1-1C\", \"1-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", }\n };\n\n vectorCount = 0;\n\n for (int i : stringColumns) {\n if (!generatedDataTable.getDataVariables().get(i).isTypeCharacter()) {\n fail(\"Column \" + i + \" was not properly processed as a character vector\");\n }\n String[] columnVector = dataProvider.getStringColumn(i);\n\n assertThat(columnVector).isEqualTo(stringVectors[vectorCount++]);\n }\n }", "public static ASTNode evaluateSlice(ASTNode compound_matrix, ArrayList<ASTNode> indices) {\n\t if(indices.size()==0) {\n\t assert !(compound_matrix instanceof CompoundMatrix || compound_matrix instanceof EmptyMatrix);\n\t return compound_matrix;\n\t }\n\t \n\t ASTNode sliceindex=indices.get(0);\n\t \n\t if(compound_matrix instanceof EmptyMatrix) {\n // Construct new matrix domain for empty matrix.\n // First get the matrix domain for compound_matrix (which is itself an empty matrix)\n ASTNode matdom=compound_matrix.getChild(0);\n \n // Get indices\n ArrayList<ASTNode> empty_idx=matdom.getChildren(3);\n \n assert empty_idx.size()==indices.size();\n \n for(int i=empty_idx.size()-1; i>=0; i--) {\n if(! indices.get(i).equals(new IntegerDomain(new Range(null, null)))) {\n // If indices.get(i) is a constant, remove that dimension. \n empty_idx.remove(i);\n }\n }\n \n return new EmptyMatrix(new MatrixDomain(compound_matrix.getChild(0).getChild(0), // get original base domain. \n empty_idx));\n }\n\t \n // Must be a compound matrix from here on. \n if(sliceindex.isSet()) {\n assert ! sliceindex.isFiniteSetUpper() && ! sliceindex.isFiniteSetLower(); // Should be ..\n ArrayList<ASTNode> newcm=new ArrayList<ASTNode>();\n \n ArrayList<ASTNode> restindices=new ArrayList<ASTNode>(indices);\n restindices.remove(0);\n \n for(int i=1; i<compound_matrix.numChildren(); i++) {\n ASTNode tmp=evaluateSlice(compound_matrix.getChildConst(i), restindices);\n if(tmp==null) return null;\n newcm.add(tmp);\n }\n return new CompoundMatrix(compound_matrix.getChild(0), newcm); // Take index domain from original CM.\n\t }\n\t else {\n\t // This index must be a constant\n\t ArrayList<Long> cmindex;\n if(compound_matrix instanceof CompoundMatrix) {\n cmindex=compound_matrix.getChild(0).getValueSet();\n }\n else if (compound_matrix instanceof EmptyMatrix) {\n cmindex=new ArrayList<Long>();\n }\n else {\n cmindex=null;\n }\n\t \n\t long val=sliceindex.getValue();\n\t int idxval=cmindex.indexOf(val);\n\t \n\t if(idxval==-1) {\n\t // Matrix is indexed out of range. Undefined. Delay evaluation. \n\t return null;\n\t }\n\t \n ArrayList<ASTNode> restindices=new ArrayList<ASTNode>(indices);\n restindices.remove(0);\n\t \n\t return evaluateSlice(compound_matrix.getChildConst(idxval+1), restindices);\n\t }\n\t}", "List<Collect> selectByExampleWithRowbounds(CollectExample example, RowBounds rowBounds);", "@Test\n public void testFilterPushDown() throws IOException { 'bla' as (x, y);\n // B = load 'morebla' as (a, b);\n // C = join A on x, B on a;\n // D = filter C by x = a and x = 0 and b = 1 and y = b;\n // store D into 'whatever';\n \n // A = load\n LogicalPlan lp = new LogicalPlan();\n {\n \tLogicalSchema aschema = new LogicalSchema();\n \taschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"x\", null, DataType.INTEGER));\n \taschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"y\", null, DataType.INTEGER));\n \taschema.getField(0).uid = 1;\n \taschema.getField(1).uid = 2;\n \tLOLoad A = new LOLoad(new FileSpec(\"bla\", new FuncSpec(\"PigStorage\", \"\\t\")), aschema, lp);\n \tlp.add(A);\n\t \n \t// B = load\n \tLogicalSchema bschema = new LogicalSchema();\n \tbschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"a\", null, DataType.INTEGER));\n \tbschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"b\", null, DataType.INTEGER));\n \tbschema.getField(0).uid = 3;\n \tbschema.getField(1).uid = 4;\n \tLOLoad B = new LOLoad(null, bschema, lp);\n \tlp.add(B);\n\t \n \t// C = join\n \tLogicalSchema cschema = new LogicalSchema();\n \tcschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"x\", null, DataType.INTEGER));\n \tcschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"y\", null, DataType.INTEGER));\n \tcschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"a\", null, DataType.INTEGER));\n \tcschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"b\", null, DataType.INTEGER));\n \tcschema.getField(0).uid = 1;\n \tcschema.getField(1).uid = 2;\n \tcschema.getField(2).uid = 3;\n \tcschema.getField(3).uid = 4;\n \tLogicalExpressionPlan aprojplan = new LogicalExpressionPlan();\n \tProjectExpression x = new ProjectExpression(aprojplan, DataType.INTEGER, 0, 0);\n \tx.neverUseForRealSetUid(1);\n \tLogicalExpressionPlan bprojplan = new LogicalExpressionPlan();\n \tProjectExpression y = new ProjectExpression(bprojplan, DataType.INTEGER, 1, 0);\n \ty.neverUseForRealSetUid(3);\n \tMultiMap<Integer, LogicalExpressionPlan> mm = \n \tnew MultiMap<Integer, LogicalExpressionPlan>();\n \tmm.put(0, aprojplan);\n \tmm.put(1, bprojplan);\n \tLOJoin C = new LOJoin(lp, mm, JOINTYPE.HASH, new boolean[] {true, true});\n \tC.neverUseForRealSetSchema(cschema);\n \tlp.add(C);\n \tlp.connect(A, C);\n \tlp.connect(B, C);\n \n \t// D = filter\n \tLogicalExpressionPlan filterPlan = new LogicalExpressionPlan();\n \tProjectExpression fx = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 0);\n \tfx.neverUseForRealSetUid(1);\n \tConstantExpression fc0 = new ConstantExpression(filterPlan, DataType.INTEGER, new Integer(0));\n \tEqualExpression eq1 = new EqualExpression(filterPlan, fx, fc0);\n \tProjectExpression fanotherx = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 0);\n \tfanotherx.neverUseForRealSetUid(1);\n \tProjectExpression fa = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 2);\n \tfa.neverUseForRealSetUid(3);\n \tEqualExpression eq2 = new EqualExpression(filterPlan, fanotherx, fa);\n \tAndExpression and1 = new AndExpression(filterPlan, eq1, eq2);\n \tProjectExpression fb = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 3);\n \tfb.neverUseForRealSetUid(4);\n \tConstantExpression fc1 = new ConstantExpression(filterPlan, DataType.INTEGER, new Integer(1));\n \tEqualExpression eq3 = new EqualExpression(filterPlan, fb, fc1);\n \tAndExpression and2 = new AndExpression(filterPlan, and1, eq3);\n \tProjectExpression fanotherb = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 3);\n \tfanotherb.neverUseForRealSetUid(4);\n \tProjectExpression fy = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 1);\n \tfy.neverUseForRealSetUid(2);\n \tEqualExpression eq4 = new EqualExpression(filterPlan, fy, fanotherb);\n \tnew AndExpression(filterPlan, and2, eq4);\n \n \tLOFilter D = new LOFilter(lp, filterPlan);\n \tD.neverUseForRealSetSchema(cschema);\n \t// Connect D to B, since the transform has happened.\n \tlp.add(D);\n \tlp.connect(C, D);\n }\n \n LogicalPlanOptimizer optimizer = new LogicalPlanOptimizer(lp, 500);\n optimizer.optimize();\n \n LogicalPlan expected = new LogicalPlan();\n {\n // A = load\n \tLogicalSchema aschema = new LogicalSchema();\n \taschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"x\", null, DataType.INTEGER));\n \taschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"y\", null, DataType.INTEGER));\n \taschema.getField(0).uid = 1;\n \taschema.getField(1).uid = 2;\n \tLOLoad A = new LOLoad(new FileSpec(\"bla\", new FuncSpec(\"PigStorage\", \"\\t\")), aschema, expected);\n \texpected.add(A);\n \t\n \t// DA = filter\n \tLogicalExpressionPlan DAfilterPlan = new LogicalExpressionPlan();\n \tProjectExpression fx = new ProjectExpression(DAfilterPlan, DataType.INTEGER, 0, 0);\n \tfx.neverUseForRealSetUid(1);\n \tConstantExpression fc0 = new ConstantExpression(DAfilterPlan, DataType.INTEGER, new Integer(0));\n \tnew EqualExpression(DAfilterPlan, fx, fc0);\n\t \n \tLOFilter DA = new LOFilter(expected, DAfilterPlan);\n \tDA.neverUseForRealSetSchema(aschema);\n \texpected.add(DA);\n \texpected.connect(A, DA);\n\t \n \t// B = load\n \tLogicalSchema bschema = new LogicalSchema();\n \tbschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"a\", null, DataType.INTEGER));\n \tbschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"b\", null, DataType.INTEGER));\n \tbschema.getField(0).uid = 3;\n \tbschema.getField(1).uid = 4;\n \tLOLoad B = new LOLoad(null, bschema, expected);\n \texpected.add(B);\n \t\n \t// DB = filter\n \tLogicalExpressionPlan DBfilterPlan = new LogicalExpressionPlan();\n \tProjectExpression fb = new ProjectExpression(DBfilterPlan, DataType.INTEGER, 0, 1);\n \tfb.neverUseForRealSetUid(4);\n \tConstantExpression fc1 = new ConstantExpression(DBfilterPlan, DataType.INTEGER, new Integer(1));\n \tnew EqualExpression(DBfilterPlan, fb, fc1);\n\t \n \tLOFilter DB = new LOFilter(expected, DBfilterPlan);\n \tDB.neverUseForRealSetSchema(bschema);\n \texpected.add(DB);\n \texpected.connect(B, DB);\n\t \n \t// C = join\n \tLogicalSchema cschema = new LogicalSchema();\n \tcschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"x\", null, DataType.INTEGER));\n \tcschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"y\", null, DataType.INTEGER));\n \tcschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"a\", null, DataType.INTEGER));\n \tcschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"b\", null, DataType.INTEGER));\n \tcschema.getField(0).uid = 1;\n \tcschema.getField(1).uid = 2;\n \tcschema.getField(2).uid = 3;\n \tcschema.getField(3).uid = 4;\n \tLogicalExpressionPlan aprojplan = new LogicalExpressionPlan();\n \tProjectExpression x = new ProjectExpression(aprojplan, DataType.INTEGER, 0, 0);\n \tx.neverUseForRealSetUid(1);\n \tLogicalExpressionPlan bprojplan = new LogicalExpressionPlan();\n \tProjectExpression y = new ProjectExpression(bprojplan, DataType.INTEGER, 1, 0);\n \ty.neverUseForRealSetUid(3);\n \tMultiMap<Integer, LogicalExpressionPlan> mm = \n \tnew MultiMap<Integer, LogicalExpressionPlan>();\n \tmm.put(0, aprojplan);\n \tmm.put(1, bprojplan);\n \tLOJoin C = new LOJoin(expected, mm, JOINTYPE.HASH, new boolean[] {true, true});\n \tC.neverUseForRealSetSchema(cschema);\n \texpected.add(C);\n \texpected.connect(DA, C);\n \texpected.connect(DB, C);\n\t \n \t// D = filter\n \tLogicalExpressionPlan filterPlan = new LogicalExpressionPlan();\n \tProjectExpression fanotherx = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 0);\n \tfanotherx.neverUseForRealSetUid(1);\n \tProjectExpression fa = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 2);\n \tfa.neverUseForRealSetUid(3);\n \tEqualExpression eq2 = new EqualExpression(filterPlan, fanotherx, fa);\n \tProjectExpression fanotherb = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 3);\n \tfanotherb.neverUseForRealSetUid(4);\n \tProjectExpression fy = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 1);\n \tfy.neverUseForRealSetUid(2);\n \tEqualExpression eq4 = new EqualExpression(filterPlan, fy, fanotherb);\n \tnew AndExpression(filterPlan, eq2, eq4);\n\t \n \tLOFilter D = new LOFilter(expected, filterPlan);\n \tD.neverUseForRealSetSchema(cschema);\n \texpected.add(D);\n \texpected.connect(C, D);\n }\n \n assertTrue( lp.isEqual(expected) );\n // assertEquals(lp, expected);\n }", "static public int getAtLeastKVisitors(int[][] rectangles, int k) {\n\n if(rectangles.length==0)\n return 0;\n if(k > rectangles.length)\n return 0;\n\n TreeSet<Rectangle> avlTree = new TreeSet<>();//To store the rectangles ordered\n TreeSet<Integer> Ys = new TreeSet<>();\n\n for(int[] coordinates: rectangles) {\n //x2 = x2 + 1 , y2 = y2 +1 for the inclusive constraints\n Rectangle r = new Rectangle(coordinates[0], coordinates[1], coordinates[2]+1, coordinates[3]+1);\n avlTree.add(r);\n if(!Ys.contains(r.getY1()))\n Ys.add(r.getY1());\n if(!Ys.contains(r.getY2()))\n Ys.add(r.getY2());\n }\n\n int ans = 0;\n Iterator<Integer> yIterator = Ys.iterator();\n int previousY = yIterator.next();\n\n //Traverse by slices of Y's\n while(yIterator.hasNext()) {\n\n int currentY = yIterator.next();\n List<int[]> segments = new ArrayList<>();\n Iterator<Rectangle> treeIterator = avlTree.iterator();\n\n //Look for the rectangles that fall in the slice and create a segment's list\n while(treeIterator.hasNext()) {\n Rectangle r = treeIterator.next();\n //We stop traversing the tree once the rectangles are completely above the slice\n if(r.getY1()>currentY)\n break;\n if(r.getY1()<= previousY && r.getY2()>=currentY) {\n int[] segmentL = new int[2]; int[] segmentR = new int[2];\n segmentL[0] = r.getX1(); segmentL[1] = Type.OPEN.getValue();\n segmentR[0] = r.getX2(); segmentR[1] = Type.CLOSED.getValue();\n segments.add(segmentL); segments.add(segmentR);\n }\n //We remove the rectangles that are left behind by the slice\n if(r.getY2() < previousY)\n treeIterator.remove();\n }\n\n //Sort the segments to analyze them\n Collections.sort(segments, (a, b) -> Integer.compare(a[0], b[0]));\n Iterator<int[]> it = segments.iterator();\n int[] segmentEnd, segmentStart = it.next();\n int nRectangles = Type.OPEN.getValue(); //The first interval will always be opening\n\n while(it.hasNext()) {\n segmentEnd = it.next();\n if(nRectangles >=k) {\n ans+= (currentY - previousY) * (segmentEnd[0] - segmentStart[0]);\n }\n segmentStart = segmentEnd;\n nRectangles += segmentEnd[1];\n }\n\n previousY = currentY;\n }\n\n return ans;\n }", "public boolean percolates() {\n for (int i = 0; i < size; i++) {\r\n if (flowGrid[size * (size - 1) + i] < size) { // if any of the bottom row points at any of the index in the top row\r\n return true;\r\n }\r\n }\r\n return false;\r\n }", "CellStyleCriterion border(Keywords.BorderSide first, Keywords.BorderSide second, Consumer<BorderCriterion> borderConfiguration);", "public void compareWithinClusters() {\n\t\tList<Cluster> clusterList = clusterDao.getClusterList();\n\n\t\tfor (Cluster cluster : clusterList) {\n\t\t\tList<Document> docList = documentDao.getDocListByClusterId(cluster.getId());\n\t\t\tint size = docList.size();\n\t\t\t\n\t\t\tdouble[][] matrix = new double[size][size];\n\t\t\t\n\t\t\tfor(int i =0; i<size; i++){\n\t\t\t\tmatrix[i][i] = 1;\n\t\t\t\tmatrix[i][i] = 1;\n\t\t\t}\n\t\t\t\n\t\t\tif (size > 1) {\n\t\t\t\t//List<Document> docList2 = docList1;\n\t\t\t\tfor (int i=0; i<size; i++){\n\t\t\t\t\tfor(int j=i+1; j<size; j++){\n\t\t\t\t\t\t//match docs docList.get(i) & docList.get(j)\n\t\t\t\t\t\tMap<String, Double> map = datumboxCaller.compareDocs(docList.get(i).getDocName(), docList.get(j).getDocName());\n\t\t\t\t\t\tmatrix[i][j] = map.get(\"Oliver\");\n\t\t\t\t\t\tmatrix[j][i] = map.get(\"Shingle\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//persist both metrics in a file \n\t\t\tpersist(matrix, cluster, docList);\n\t\t\t\n\t\t\t//printing the matrix\n\t\t\tSystem.out.println(\"\\nDocument Similarity Matrix for Cluster \"+cluster.getId());\n\t\t\tSystem.out.println(\"\\nOliver Metric\");\n\t\t\tSystem.out.print(\"id\");\n\t\t\tfor(int i=0; i<size; i++)\n\t\t\t\tSystem.out.print(\"\\t\"+docList.get(i).getId());\n\t\t\t\n\t\t\tfor(int i=0; i<size; i++){\n\t\t\t\tSystem.out.println(docList.get(i).getId());\n\t\t\t\tfor(int j=0; j<size; j++){\n\t\t\t\t\tSystem.out.print(\"\\t\");\n\t\t\t\t\tif(j>=i)\n\t\t\t\t\t\tSystem.out.print(matrix[i][j]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(\"\\nShingle Metric\");\n\t\t\tSystem.out.print(\"id\");\n\t\t\tfor(int i=0; i<size; i++)\n\t\t\t\tSystem.out.print(\"\\t\"+docList.get(i).getId());\n\t\t\t\n\t\t\tfor(int i=0; i<size; i++){\n\t\t\t\tSystem.out.print(\"\\n\"+docList.get(i).getId());\n\t\t\t\tfor(int j=0; j<size; j++){\n\t\t\t\t\tSystem.out.print(\"\\t\");\n\t\t\t\t\tif(j>=i)\n\t\t\t\t\t\tSystem.out.print(matrix[j][i]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t//print ends\n\t\t\t\n\t\t}\n\n\t}", "private boolean checkSecondaryDiagonal() {\n int diagonalSum = 0;\n for (int i = 0; i < dimensions; i++) {\n diagonalSum += square[(dimensions - 1) * i + dimensions - 1];\n }\n\n return diagonalSum == magicConst;\n }", "public boolean colision(Nave nave) {\r\n\t\t\r\n\t\tint[] arrayY = cargarPuntoColisionY();\r\n\t\tint[] arrayX = cargarPuntoColisionX();\r\n\t\tboolean A,B,C,D,E,F,G,H;\r\n\t\tboolean fColision = false;\r\n\t\tint i = 0;\r\n\t\t\r\n\t\twhile(i + 1 < arrayY.length && !fColision){\r\n\t\t\r\n\t\t\tA = x + arrayX[i] >= nave.getX();\r\n\t\t\tB = x + arrayX[i] <= (nave.getX() + nave.getWidth());\r\n\t\t\tC = y + arrayY[i] >= nave.getY();\r\n\t\t\tD = y + arrayY[i] <= (nave.getY() + nave.getHeight());\r\n\t\t\tE = (x + arrayX[i+1]) >= nave.getX();\r\n\t\t\tF = (x + arrayX[i+1]) <= (nave.getX() + nave.getWidth());\r\n\t\t\tG = (y + arrayY[i+1]) >= nave.getY();\r\n\t\t\tH = (y + arrayY[i+1]) <= (nave.getY() + nave.getHeight());\r\n\t\t\r\n\t\t\t// funcion de colicion que verifica si uno o mas puntos del borde del objeto nave intersectan con el borde del objeto que ejecuta la funcion\r\n\t\t\tfColision = fColision || (A && B || E && F) && (C && D || G && H) || !A && !F && ( !H && D || G && H) || !C && !H && (B && !F || !A && E);\r\n\t\t\ti = i+2;\r\n\t\t}\r\n\t\t\r\n\t\treturn getVisible() && nave.getVisible() && fColision;\r\n\t\t\t\r\n\t\t\t\t\r\n\t}", "@Test\n public void should_iterate_with_partition_keys_and_partition_keys_IN() throws Exception {\n //Given\n long partitionKey = RandomUtils.nextLong(0,Long.MAX_VALUE);\n\n insertCompositeClusteredValues(partitionKey,\"bucket1\",1,\"name1\",1);\n insertCompositeClusteredValues(partitionKey,\"bucket2\",1,\"name2\",1);\n insertCompositeClusteredValues(partitionKey,\"bucket3\",1,\"name3\",1);\n\n //When\n final Iterator<CompositeClusteredEntity> iterator = manager.sliceQuery(CompositeClusteredEntity.class)\n .forIteration()\n .withPartitionComponents(partitionKey)\n .andPartitionComponentsIN(\"bucket1\", \"bucket3\")\n .iterator();\n\n //Then\n assertThat(iterator.hasNext()).isTrue();\n CompositeClusteredEntity next = iterator.next();\n assertThat(next.getId().getId()).isEqualTo(partitionKey);\n assertThat(next.getId().getBucket()).isEqualTo(\"bucket1\");\n assertThat(next.getId().getName()).isEqualTo(\"name11\");\n assertThat(next.getValue()).isEqualTo(\"value11\");\n\n assertThat(iterator.hasNext()).isTrue();\n next = iterator.next();\n assertThat(next.getId().getId()).isEqualTo(partitionKey);\n assertThat(next.getId().getBucket()).isEqualTo(\"bucket3\");\n assertThat(next.getId().getName()).isEqualTo(\"name31\");\n assertThat(next.getValue()).isEqualTo(\"value11\");\n }", "private String checksubset(HashMap<String, ArrayList<String>> cn) {\n\t\tObject[] cnkeys = cn.keySet().toArray();\r\n\t\tfor (int i = 0; i < cnkeys.length; i++) {\r\n\t\t\tfor (int j = cnkeys.length - 1; j > i; j--) {\r\n\t\t\t\tif (cn.get(cnkeys[i]).size() < cn.get(cnkeys[j]).size()) {\r\n\t\t\t\t\tif (cn.get(cnkeys[j]).containsAll(cn.get(cnkeys[i]))) {\r\n\t\t\t\t\t\treturn (String) cnkeys[i];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (cn.get(cnkeys[i]).containsAll(cn.get(cnkeys[j]))) {\r\n\t\t\t\t\treturn (String) cnkeys[j];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public static void main(String[]args){\n\r\n int []arr = new int[100];\r\n int []arr2 = new int[50];\r\n int []arr3 = {1,2,3,4,5,6,7,8};\r\n int number = 5;\r\n LogicalOp op = new LogicalOp();\r\n// op.writeOnArray(arr);\r\n\r\n// arr2 = op.evenArray(arr2);\r\n// for(int i=0;i<arr2.length;i++)\r\n// System.out.println(arr2[i]);\r\n\r\n //System.out.println(\"Mean value: \"+op.meanValue(arr3));\r\n\r\n// String[] arrOfStr = {\"ana\",\"are\",\"mere\",\"pere\",\"mere\"};\r\n// String str = \"mere\";\r\n// System.out.println(op.isContaingString(arrOfStr,str));\r\n\r\n// System.out.println(op.findPosition(arr3,number));\r\n\r\n //op.displayLines();\r\n\r\n// int[]modifArr = op.modifiedArr(arr3,number);\r\n// for(int item: modifArr)\r\n// System.out.print(item+\" \");\r\n\r\n\r\n //System.out.println(\"Second minimum: \"+op.secondMin(arr3));\r\n\r\n int[] empty = new int[arr3.length];\r\n empty = op.populateArray(arr3,empty);\r\n for(int item:empty)\r\n System.out.print(item+\" \");\r\n\r\n\r\n\r\n }", "private static boolean areOverlapping( int ix0, int ix1, int len )\n {\n if( ix0<ix1 ){\n return ix0+len>ix1;\n }\n else {\n return ix1+len>ix0;\n }\n }", "public void decideCluster(){\n\tdouble shortest = 1000000;\n\tfor(int i = 0; i < clusterDist.length; i++)\n\t{\n\t\tif(clusterDist[i] < shortest)\n\t\t{\tshortest = clusterDist[i];\n\t\t\tthis.clusterid = i;\n\t\t}\n\t\t\n\t}\n}", "private Map<Boolean, Sort> split2 (final int delim, final int subcl) {\n Interval[] split = getConstraint(subcl).split(delim);//the interval to be split\n if (split.length == 0)\n return Collections.EMPTY_MAP;\n else if (split.length == 2) {\n Map<Boolean, Sort> res = new HashMap<>();\n Interval[] newarrc = this.constraints.clone();//the original constraints is copied\n newarrc[subcl - 1] = split[0];\n res.put(false, setConstraint(newarrc)); //false trands for \"0\"\n newarrc = this.constraints.clone();\n newarrc[subcl - 1] = split[1];\n res.put(true, setConstraint(newarrc)); //true stands for \"1\"\n return res;\n }\n throw new IllegalArgumentException(\"binary splits are assumed!\");\n }", "private void createConstraintsForSingleton() {\n \t\tSet s = slice.entrySet();\n \t\tfor (Iterator iterator = s.iterator(); iterator.hasNext();) {\n \t\t\tMap.Entry entry = (Map.Entry) iterator.next();\n \t\t\tHashMap conflictingEntries = (HashMap) entry.getValue();\n \t\t\tif (conflictingEntries.size() < 2)\n \t\t\t\tcontinue;\n \n \t\t\tCollection conflictingVersions = conflictingEntries.values();\n \t\t\tString singletonRule = \"\"; //$NON-NLS-1$\n \t\t\tArrayList nonSingleton = new ArrayList();\n \t\t\tint countSingleton = 0;\n \t\t\tfor (Iterator conflictIterator = conflictingVersions.iterator(); conflictIterator.hasNext();) {\n \t\t\t\tIInstallableUnit conflictElt = (IInstallableUnit) conflictIterator.next();\n \t\t\t\tif (conflictElt.isSingleton()) {\n \t\t\t\t\tsingletonRule += \" -1 \" + getVariable(conflictElt); //$NON-NLS-1$\n \t\t\t\t\tcountSingleton++;\n \t\t\t\t} else {\n \t\t\t\t\tnonSingleton.add(conflictElt);\n \t\t\t\t}\n \t\t\t}\n \t\t\tif (countSingleton == 0)\n \t\t\t\tcontinue;\n \n \t\t\tfor (Iterator iterator2 = nonSingleton.iterator(); iterator2.hasNext();) {\n \t\t\t\tconstraints.add(singletonRule + \" -1 \" + getVariable((IInstallableUnit) iterator2.next()) + \" >= -1;\"); //$NON-NLS-1$ //$NON-NLS-2$\n \t\t\t}\n \t\t\tsingletonRule += \" >= -1;\"; //$NON-NLS-1$\n \t\t\tconstraints.add(singletonRule);\n \t\t}\n \t}", "private static Restriction newSingleSlice(CFMetaData cfMetaData, int index, Bound bound, boolean inclusive, ByteBuffer value)\n {\n ColumnDefinition columnDef = getClusteringColumnDefinition(cfMetaData, index);\n return new SingleColumnRestriction.Slice(columnDef, bound, inclusive, toTerm(value));\n }" ]
[ "0.72523504", "0.72383624", "0.72298527", "0.71883434", "0.71790695", "0.6627842", "0.65278995", "0.65088105", "0.65063864", "0.646677", "0.6411797", "0.62839794", "0.593135", "0.5747582", "0.56584555", "0.56246156", "0.5596355", "0.55012786", "0.5376019", "0.5339496", "0.5283063", "0.5170454", "0.5048614", "0.500317", "0.5000514", "0.4972385", "0.4970746", "0.49434268", "0.49184608", "0.4913187", "0.49075323", "0.48825687", "0.4866345", "0.484226", "0.48147827", "0.4795209", "0.47868675", "0.47380084", "0.47308823", "0.47009033", "0.46964872", "0.469608", "0.46711668", "0.46618748", "0.46551618", "0.46482548", "0.46449673", "0.4643142", "0.46418217", "0.46407968", "0.463375", "0.46273786", "0.46175694", "0.4617542", "0.46148598", "0.46121424", "0.45964813", "0.45752963", "0.45623454", "0.45327103", "0.45220134", "0.45146352", "0.4512062", "0.45113495", "0.45063555", "0.45061707", "0.45008284", "0.44929987", "0.44927937", "0.4485437", "0.4481535", "0.4480996", "0.44753015", "0.44751748", "0.4474485", "0.44725645", "0.44647405", "0.4457595", "0.44336402", "0.44326657", "0.44318795", "0.44292647", "0.4428225", "0.4423859", "0.4421094", "0.44208646", "0.44096485", "0.43999702", "0.43887377", "0.43858552", "0.43762982", "0.43740746", "0.43731606", "0.43730402", "0.43721575", "0.43700477", "0.43646753", "0.43642014", "0.43627116", "0.43624926" ]
0.7223626
3
Test multicolumn slice restrictions with 1 descending clustering column and 1 ascending (e.g '(clustering_0, clustering_1) > (1, 2)')
@Test public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneDescendingAndOneAscendingClusteringColumns() { CFMetaData cfMetaData = newCFMetaData(Sort.DESC, Sort.ASC); ByteBuffer value1 = ByteBufferUtil.bytes(1); ByteBuffer value2 = ByteBufferUtil.bytes(2); // (clustering_0, clustering1) > (1, 2) Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2); PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(slice); List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(2, bounds.size()); assertEmptyComposite(bounds.get(0)); assertComposite(bounds.get(1), value1, value2, EOC.END); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(2, bounds.size()); assertComposite(bounds.get(0), value1, EOC.START); assertComposite(bounds.get(1), value1, EOC.END); // (clustering_0, clustering1) >= (1, 2) slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2); restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(slice); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(2, bounds.size()); assertEmptyComposite(bounds.get(0)); assertComposite(bounds.get(1), value1, value2, EOC.NONE); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(2, bounds.size()); assertComposite(bounds.get(0), value1, EOC.START); assertComposite(bounds.get(1), value1, EOC.END); // (clustering_0, clustering1) <= (1, 2) slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2); restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(slice); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(2, bounds.size()); assertComposite(bounds.get(0), value1, EOC.START); assertComposite(bounds.get(1), value1, EOC.END); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(2, bounds.size()); assertComposite(bounds.get(0), value1, value2, EOC.END); assertEmptyComposite(bounds.get(1)); // (clustering_0, clustering1) < (1, 2) slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2); restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(slice); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(2, bounds.size()); assertComposite(bounds.get(0), value1, EOC.START); assertComposite(bounds.get(1), value1, EOC.END); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(2, bounds.size()); assertComposite(bounds.get(0), value1, value2, EOC.START); assertEmptyComposite(bounds.get(1)); // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2) slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2); Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2); restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(slice).mergeWith(slice2); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(2, bounds.size()); assertComposite(bounds.get(0), value2, EOC.END); assertComposite(bounds.get(1), value1, value2, EOC.END); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(2, bounds.size()); assertComposite(bounds.get(0), value1, EOC.START); assertComposite(bounds.get(1), value1, EOC.END); // (clustering_0) > (1) AND (clustering_0, clustering1) < (2, 1) slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1); slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2, value1); restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(slice).mergeWith(slice2); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(2, bounds.size()); assertComposite(bounds.get(0), value2, EOC.START); assertComposite(bounds.get(1), value2, EOC.END); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(2, bounds.size()); assertComposite(bounds.get(0), value2, value1, EOC.START); assertComposite(bounds.get(1), value1, EOC.START); // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1) slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2); slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1); restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(slice).mergeWith(slice2); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(3, bounds.size()); assertComposite(bounds.get(0), value2, EOC.START); assertComposite(bounds.get(1), value2, EOC.END); assertComposite(bounds.get(2), value1, value2, EOC.NONE); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(3, bounds.size()); assertComposite(bounds.get(0), value2, value1, EOC.END); assertComposite(bounds.get(1), value1, EOC.START); assertComposite(bounds.get(2), value1, EOC.END); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneAscendingAndOneDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n assertComposite(bounds.get(2), value2, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertComposite(bounds.get(1), value2, EOC.START);\n assertComposite(bounds.get(2), value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithTwoAscendingAndTwoDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.DESC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertEmptyComposite(bounds.get(1));\n\n // clustering_0 = 1 AND (clustering_1, clustering_2, clustering_3) > (2, 3, 4)\n Restriction eq = newSingleEq(cfMetaData, 0, value1);\n slice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n restrictions = restrictions.mergeWith(eq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2, clustering_3) > (2, 3, 4)\n Restriction in = newSingleIN(cfMetaData, 0, value1, value2);\n slice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n restrictions = restrictions.mergeWith(in);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n assertComposite(bounds.get(2), value2, value2, EOC.START);\n assertComposite(bounds.get(3), value2, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n assertComposite(bounds.get(2), value2, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(3), value2, EOC.END);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1, clustering_2, clustering_3) <= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) < (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4) AND (clustering_0, clustering_1) < (2, 3)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2, value3);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(1), value2, value3, EOC.START);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4) AND (clustering_0, clustering1, clustering_2, clustering_3) <= (4, 3, 2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value4, value3, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n assertComposite(bounds.get(2), value4, value3, value2, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(1), value4, value3, EOC.START);\n assertComposite(bounds.get(2), value4, value3, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsMixingAscendingDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.DESC, Sort.ASC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(3));\n\n // clustering_0 = 1 AND (clustering_1, clustering_2, clustering_3) > (2, 3, 4)\n Restriction eq = newSingleEq(cfMetaData, 0, value1);\n slice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n restrictions = restrictions.mergeWith(eq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(3));\n\n\n // (clustering_0, clustering1, clustering_2, clustering_3) <= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, value4, EOC.NONE);\n assertComposite(bounds.get(3), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) < (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(3), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4) AND (clustering_0, clustering_1) < (2, 3)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2, value3);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(5, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n assertComposite(bounds.get(4), value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(5, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertComposite(bounds.get(3), value2, EOC.START);\n assertComposite(bounds.get(4), value2, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4) AND (clustering_0, clustering1, clustering_2, clustering_3) <= (4, 3, 2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value4, value3, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(7, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n assertComposite(bounds.get(4), value4, value3, EOC.START);\n assertComposite(bounds.get(5), value4, value3, value2, value1, EOC.NONE);\n assertComposite(bounds.get(6), value4, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(7, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertComposite(bounds.get(3), value4, EOC.START);\n assertComposite(bounds.get(4), value4, value3, value2, EOC.START);\n assertComposite(bounds.get(5), value4, value3, value2, EOC.END);\n assertComposite(bounds.get(6), value4, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithTwoDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithTwoClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneDescendingClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithSliceRestrictionsAndOneDescendingClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newSingleSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newSingleSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithSliceRestrictionsAndOneClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newSingleSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newSingleSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiEqAndSingleSliceRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n\n // (clustering_0, clustering_1) = (1, 2) AND clustering_2 > 3\n Restriction multiEq = newMultiEq(cfMetaData, 0, value1, value2);\n Restriction singleSlice = newSingleSlice(cfMetaData, 2, Bound.START, false, value3);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiEq).mergeWith(singleSlice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithSingleEqAndSliceRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n ByteBuffer value5 = ByteBufferUtil.bytes(5);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) > (2, 3)\n Restriction singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction multiSlice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiSlice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) > (2, 3) AND (clustering_1) < (4)\n singleEq = newSingleEq(cfMetaData, 0, value1);\n multiSlice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3);\n Restriction multiSlice2 = newMultiSlice(cfMetaData, 1, Bound.END, false, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiSlice2).mergeWith(singleEq).mergeWith(multiSlice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value4, EOC.START);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) => (2, 3) AND (clustering_1, clustering_2) <= (4, 5)\n singleEq = newSingleEq(cfMetaData, 0, value1);\n multiSlice = newMultiSlice(cfMetaData, 1, Bound.START, true, value2, value3);\n multiSlice2 = newMultiSlice(cfMetaData, 1, Bound.END, true, value4, value5);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiSlice2).mergeWith(singleEq).mergeWith(multiSlice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value4, value5, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithOneEqRestrictionsAndTwoClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer clustering_0 = ByteBufferUtil.bytes(1);\n Restriction eq = newSingleEq(cfMetaData, 0, clustering_0);\n\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithOneEqRestrictionsAndOneClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC);\n\n ByteBuffer clustering_0 = ByteBufferUtil.bytes(1);\n Restriction eq = newSingleEq(cfMetaData, 0, clustering_0);\n\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithSingleEqAndMultiEqRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) = (2, 3)\n Restriction singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction multiEq = newMultiEq(cfMetaData, 1, value2, value3);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiEq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n // clustering_0 = 1 AND clustering_1 = 2 AND (clustering_2, clustering_3) = (3, 4)\n singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction singleEq2 = newSingleEq(cfMetaData, 1, value2);\n multiEq = newMultiEq(cfMetaData, 2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(singleEq2).mergeWith(multiEq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n\n // (clustering_0, clustering_1) = (1, 2) AND clustering_2 = 3\n singleEq = newSingleEq(cfMetaData, 2, value3);\n multiEq = newMultiEq(cfMetaData, 0, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiEq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) = (2, 3) AND clustering_3 = 4\n singleEq = newSingleEq(cfMetaData, 0, value1);\n singleEq2 = newSingleEq(cfMetaData, 3, value4);\n multiEq = newMultiEq(cfMetaData, 1, value2, value3);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiEq).mergeWith(singleEq2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithEqAndSliceRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n\n Restriction eq = newSingleEq(cfMetaData, 0, value3);\n\n Restriction slice = newSingleSlice(cfMetaData, 1, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 1, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 1, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 1, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 1, Bound.START, false, value1);\n Restriction slice2 = newSingleSlice(cfMetaData, 1, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value2, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 1, Bound.START, true, value1);\n slice2 = newSingleSlice(cfMetaData, 1, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value2, EOC.END);\n }", "private static Restriction newMultiSlice(CFMetaData cfMetaData, int firstIndex, Bound bound, boolean inclusive, ByteBuffer... values)\n {\n List<ColumnDefinition> columnDefinitions = new ArrayList<>();\n for (int i = 0; i < values.length; i++)\n {\n columnDefinitions.add(getClusteringColumnDefinition(cfMetaData, i + firstIndex));\n }\n return new MultiColumnRestriction.Slice(columnDefinitions, bound, inclusive, toMultiItemTerminal(values));\n }", "@Test\n public void testBoundsAsCompositesWithSingleEqAndMultiINRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n ByteBuffer value5 = ByteBufferUtil.bytes(5);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) IN ((2, 3), (4, 5))\n Restriction singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction multiIN = newMultiIN(cfMetaData, 1, asList(value2, value3), asList(value4, value5));\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiIN);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(1), value1, value4, value5, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(1), value1, value4, value5, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) IN ((2, 3))\n singleEq = newSingleEq(cfMetaData, 0, value1);\n multiIN = newMultiIN(cfMetaData, 1, asList(value2, value3));\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiIN).mergeWith(singleEq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n // clustering_0 = 1 AND clustering_1 = 5 AND (clustering_2, clustering_3) IN ((2, 3), (4, 5))\n singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction singleEq2 = newSingleEq(cfMetaData, 1, value5);\n multiIN = newMultiIN(cfMetaData, 2, asList(value2, value3), asList(value4, value5));\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiIN).mergeWith(singleEq2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value5, value2, value3, EOC.START);\n assertComposite(bounds.get(1), value1, value5, value4, value5, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value5, value2, value3, EOC.END);\n assertComposite(bounds.get(1), value1, value5, value4, value5, EOC.END);\n }", "public interface IStoppingCriteria {\n\n /**\n * Determine the degree of clustering agreement\n * @param cluster1 one clustering results\n * @param cluster2 the other clustering results\n * @return the degree of clustering agreement; 1 refers to be the same clustering results; 0 refers to be the totally different clustering results\n */\n public double computeSimilarity(int[] cluster1, int[] cluster2);\n\n}", "@Test\n public void testBoundsAsCompositesWithOneInRestrictionsAndOneClusteringColumn()\n {\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n Restriction in = newSingleIN(cfMetaData, 0, value1, value2, value3);\n\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(in);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.START);\n assertComposite(bounds.get(2), value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n assertComposite(bounds.get(1), value2, EOC.END);\n assertComposite(bounds.get(2), value3, EOC.END);\n }", "private boolean isSubsetOf(int firstRow, int secondRow) {\n for (int i = 0; i < universalSetSize; i++) {\n if (input[firstRow][i] && !input[secondRow][i]) {\n return false;\n }\n }\n return true;\n }", "@Test\n public void testOverlappingPartitionsOverlappingClusters()\n {\n check(overlappingClustersWithOverlappingPartitions(), 0.75, 1.0);\n }", "private boolean isSubsetOf(List<String> permissions2,\n\t\t\tList<String> permissions3) {\n\t\treturn false;\n\t}", "@Test\n public void testBoundsAsCompositesWithMultiEqRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n Restriction eq = newMultiEq(cfMetaData, 0, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n }", "@Test\n public void testHardClustersWithOverlappingPartitions()\n {\n check(hardClustersWithOverlappingPartitions(), 0.0, 1.0);\n }", "public void testSortOnComputedColumn1() throws Exception {\n \t\tccName = new String[] { \"cc\" };\n \t\tccExpr = new String[] { \"(row.COL0%2==0?1:2)\" };\n \n \t\tfor (int i = 0; i < ccName.length; i++) {\n \t\t\tComputedColumn computedColumn = new ComputedColumn(ccName[i],\n \t\t\t\t\tccExpr[i], DataType.ANY_TYPE);\n \t\t\t((BaseDataSetDesign) this.dataSet)\n \t\t\t\t\t.addComputedColumn(computedColumn);\n \t\t}\n \n \t\tString[] bindingNameSort = new String[1];\n \t\tbindingNameSort[0] = \"SORT_DEFINITION\";\n \t\tIBaseExpression[] bindingExprSort = new IBaseExpression[1];\n \t\tbindingExprSort[0] = new ScriptExpression(\"dataSetRow.cc\");\n \n \t\tSortDefinition[] sortDefn = new SortDefinition[] { new SortDefinition() };\n \t\tsortDefn[0].setColumn(\"SORT_DEFINITION\");\n \t\tsortDefn[0].setSortDirection(ISortDefinition.SORT_DESC);\n \n \t\tString[] bindingNameRow = new String[5];\n \t\tbindingNameRow[0] = \"ROW_COL0\";\n \t\tbindingNameRow[1] = \"ROW_COL1\";\n \t\tbindingNameRow[2] = \"ROW_COL2\";\n \t\tbindingNameRow[3] = \"ROW_COL3\";\n \t\tbindingNameRow[4] = \"ROW_cc\";\n \t\tScriptExpression[] bindingExprRow = new ScriptExpression[] {\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL0\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL1\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL2\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL3\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + ccName[0], 0), };\n \n \t\tIResultIterator resultIt = this.executeQuery(this.createQuery(null,\n \t\t\t\tnull, null, bindingNameSort, bindingExprSort, sortDefn, null,\n \t\t\t\tnull, null, bindingNameRow, bindingExprRow));\n \n \t\tprintResult(resultIt, bindingNameRow, bindingExprRow);\n \t\t// assert\n \t\tcheckOutputFile();\n \t}", "private boolean checkifCollinear(Point[] ptArr, Comparator<Point> cmp, int start){\n\t\tif(start +2 >= ptArr.length) return false;\t\n\t\tif(cmp.compare(ptArr[start],ptArr[start+1]) == cmp.compare(ptArr[start+1],ptArr[start+2]) && cmp.compare(ptArr[start],ptArr[start+1]) == 0){\n\t\t\treturn true;\n\t\t}\t\t\n\t\treturn false;\t\n\t}", "private boolean subGridCheck() {\n\t\tint sqRt = (int)Math.sqrt(dimension);\n\t\tfor(int i = 0; i < sqRt; i++) {\n\t\t\tint increment = i * sqRt;\n\t\t\tfor(int val = 1; val <= dimension; val++) {\n\t\t\t\tint valCounter = 0;\n\t\t\t\tfor(int row = 0 + increment; row < sqRt + increment; row++) {\n\t\t\t\t\tfor(int col = 0 + increment; col < sqRt + increment; col++) {\n\t\t\t\t\t\tif(puzzle[row][col] == val)\n\t\t\t\t\t\t\tvalCounter++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(valCounter >= 2)\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "private boolean checkRowCol(int c1, int c2, int c3) \r\n {\r\n return ((c1 != -1) && (c1 == c2) && (c2 == c3)); //eida ekhon porjonto kaaj e lage nai\r\n }", "private static Restriction newMultiEq(CFMetaData cfMetaData, int firstIndex, ByteBuffer... values)\n {\n List<ColumnDefinition> columnDefinitions = new ArrayList<>();\n for (int i = 0; i < values.length; i++)\n {\n columnDefinitions.add(getClusteringColumnDefinition(cfMetaData, firstIndex + i));\n }\n return new MultiColumnRestriction.EQ(columnDefinitions, toMultiItemTerminal(values));\n }", "protected void checkBox(int slice, int row, int column, int depth, int height, int width) {\n\tif (slice<0 || depth<0 || slice+depth>slices || row<0 || height<0 || row+height>rows || column<0 || width<0 || column+width>columns) throw new IndexOutOfBoundsException(toStringShort()+\", slice:\"+slice+\", row:\"+row+\" ,column:\"+column+\", depth:\"+depth+\" ,height:\"+height+\", width:\"+width);\n}", "Boolean isCollinearTo(IVec3 v);", "public abstract int Compare(Slice a, Slice b);", "List<Trueorfalse> selectByExample(RowBounds rowBounds);", "private boolean checkColoumnForQuadPair(int j1) {\n for(int i=0;i<4;i++)\r\n {\r\n if(Kmap[i][j1]==0 || Kmap[i][j1]==-1)\r\n return false;\r\n }\r\n for(int i=0;i<4;i++)\r\n {\r\n Kmap[i][j1]=-1;\r\n }\r\n return true; \r\n }", "@Test\n\tpublic void testEliminationByColumn(){\n\t\tsetBoardUp();\n\t\tColumn col = new Column(board, 1);\n\t\tint[] toBeRemoved = {1, 3, 4};\n\t\tint[] fromCesll = {1, 2, 3, 5, 6, 8};\n\t\talgorithm.applyEliminationInColumn(col);\n\t\tboolean condition = true;\n\t\tfor(int i = 0; i < toBeRemoved.length; i++)\n\t\t\tfor(int j = 0; j < fromCesll.length; j++)\n\t\t\t\tcondition &= !col.cell[fromCesll[j]].possibilities.contains(toBeRemoved[i]);\t\t\n\t\tassertTrue(condition);\n\t}", "@Test\n public void testPartitionColumnSelection() {\n Path filePath = new Path(\"hdfs:///w/x/y/z.csv\");\n ImplicitColumnManager implictColManager = new ImplicitColumnManager(\n fixture.getOptionManager(),\n standardOptions(filePath));\n\n String dir0 = ScanTestUtils.partitionColName(0);\n // Sic: case insensitivity, but name in project list\n // is preferred over \"natural\" name.\n String dir1 = \"DIR1\";\n String dir2 = ScanTestUtils.partitionColName(2);\n ScanLevelProjection scanProj = ScanLevelProjection.build(\n RowSetTestUtils.projectList(dir2, dir1, dir0, \"a\"),\n Lists.newArrayList(implictColManager.projectionParser()));\n\n assertEquals(4, scanProj.columns().size());\n assertEquals(dir2, scanProj.columns().get(0).name());\n assertEquals(dir1, scanProj.columns().get(1).name());\n assertEquals(dir0, scanProj.columns().get(2).name());\n assertEquals(\"a\", scanProj.columns().get(3).name());\n\n // Verify column type\n\n assertTrue(scanProj.columns().get(0) instanceof PartitionColumn);\n }", "@Test\n public void whereNormalColumn() throws Exception {\n String sql = \"desc verbose select k1, e1 from db1.tbl1 lateral view explode_split(k2, \\\",\\\") tmp as e1 \"\n + \"where k1=1; \";\n String explainString = UtFrameUtils.getSQLPlanOrErrorMsg(ctx, sql, true);\n Assert.assertTrue(explainString.contains(\"1:TABLE FUNCTION NODE\"));\n Assert.assertTrue(explainString.contains(\"table function: explode_split(`k2`, ',')\"));\n Assert.assertTrue(explainString.contains(\"tuple ids: 0 1\"));\n Assert.assertTrue(explainString.contains(\"TupleDescriptor{id=1, tbl=tmp, byteSize=32, materialized=true}\"));\n Assert.assertTrue(explainString.contains(\"SlotDescriptor{id=1, col=e1, type=VARCHAR(*)}\"));\n Assert.assertTrue(explainString.contains(\"0:OlapScanNode\"));\n Assert.assertTrue(explainString.contains(\"PREDICATES: `k1` = 1\"));\n }", "boolean isOrderedOn(ColumnReference[] crs, boolean permuteOrdering, Vector fbtVector)\n\t{\n\t\t/* RESOLVE - DistinctNodes are ordered on their RCLs.\n\t\t * Walk RCL to see if cr is 1st non-constant column in the\n\t\t * ordered result.\n\t\t */\n\t\treturn false;\n\t}", "public void testMultipass_Sort() throws Exception\n \t{\n \t\tccName = new String[]{\n \t\t\t\t\"cc1\", \"cc2\"\n \t\t};\n \t\tccExpr = new String[]{\n \t\t\t\t\"Total.sum(row.COL1)\", \"Total.sum(row.cc1)\"\n \t\t};\n \n \t\tfor ( int i = 0; i < ccName.length; i++ )\n \t\t{\n \t\t\tComputedColumn computedColumn = new ComputedColumn( ccName[i],\n \t\t\t\t\tccExpr[i],\n \t\t\t\t\tDataType.INTEGER_TYPE );\n \t\t\t( (BaseDataSetDesign) this.dataSet ).addComputedColumn( computedColumn );\n \t\t}\n \t\t\n \t\tString[] bindingNameSort = new String[2];\n \t\tbindingNameSort[0] = \"SORT_DEFINITION_1\";\n \t\tbindingNameSort[1] = \"SORT_DEFINITION_2\";\n \t\tIBaseExpression[] bindingExprSort = new IBaseExpression[2];\n \t\tbindingExprSort[0] = new ScriptExpression(\n \t\t\t\t\"dataSetRow.COL1/(Total.ave(dataSetRow.cc1)+dataSetRow.cc1)\");\n \t\tbindingExprSort[1] = new ScriptExpression(\n \t\t\t\t\"dataSetRow.cc2-dataSetRow.COL2\");\n \t\tSortDefinition[] sortDefn = new SortDefinition[] {\n \t\t\t\tnew SortDefinition(), new SortDefinition() };\n \t\tsortDefn[0].setColumn(\"SORT_DEFINITION_1\");\n \t\tsortDefn[0].setSortDirection(ISortDefinition.SORT_DESC);\n \t\tsortDefn[1].setColumn(\"SORT_DEFINITION_2\");\n \t\tsortDefn[1].setSortDirection(ISortDefinition.SORT_DESC);\n \n \t\tString[] bindingNameRow = new String[6];\n \t\tbindingNameRow[0] = \"ROW_COL0\";\n \t\tbindingNameRow[1] = \"ROW_COL1\";\n \t\tbindingNameRow[2] = \"ROW_COL2\";\n \t\tbindingNameRow[3] = \"ROW_COL3\";\n \t\tbindingNameRow[4] = \"ROW_cc1\";\n \t\tbindingNameRow[5] = \"ROW_cc2\";\n \t\tScriptExpression[] bindingExprRow = new ScriptExpression[]{\n \t\t\t\tnew ScriptExpression( \"dataSetRow.\" + \"COL0\", 0 ),\n \t\t\t\tnew ScriptExpression( \"dataSetRow.\" + \"COL1\", 0 ),\n \t\t\t\tnew ScriptExpression( \"dataSetRow.\" + \"COL2\", 0 ),\n \t\t\t\tnew ScriptExpression( \"dataSetRow.\" + \"COL3\", 0 ),\n \t\t\t\tnew ScriptExpression( \"dataSetRow.\" + ccName[0], 0 ),\n \t\t\t\tnew ScriptExpression( \"dataSetRow.\" + ccName[1], 0 ),\n \t\t};\n \t\tIResultIterator resultIt = this.executeQuery(this.createQuery(null,\n \t\t\t\tnull, null, bindingNameSort, bindingExprSort, sortDefn, null,\n \t\t\t\tnull, null, bindingNameRow, bindingExprRow));\n \n \t\tprintResult(resultIt, bindingNameRow, bindingExprRow);\t\n \t\t// assert\n \t\tcheckOutputFile();\n \t}", "public void testFilterOnAggregationColumn() throws Exception {\n \t\tccName = new String[] { \"cc1\", \"cc2\", \"cc3\" };\n \t\tccExpr = new String[] { \"row.COL0+row.COL1\",\n \t\t\t\t\"Total.runningSum(row.cc1,row.COL0==0,0)\",\n \t\t\t\t\"Total.runningSum(row.cc1,row.COL0>0,0)\" };\n \n \t\tfor (int i = 0; i < ccName.length; i++) {\n \t\t\tComputedColumn computedColumn = new ComputedColumn(ccName[i],\n \t\t\t\t\tccExpr[i], DataType.ANY_TYPE);\n \t\t\t((BaseDataSetDesign) this.dataSet)\n \t\t\t\t\t.addComputedColumn(computedColumn);\n \t\t}\n \n \t\tString[] bindingNameRow = new String[7];\n \t\tbindingNameRow[0] = \"ROW_COL0\";\n \t\tbindingNameRow[1] = \"ROW_COL1\";\n \t\tbindingNameRow[2] = \"ROW_COL2\";\n \t\tbindingNameRow[3] = \"ROW_COL3\";\n \t\tbindingNameRow[4] = \"ROW_cc1\";\n \t\tbindingNameRow[5] = \"ROW_cc2\";\n \t\tbindingNameRow[6] = \"ROW_cc3\";\n \t\tScriptExpression[] bindingExprRow = new ScriptExpression[] {\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL0\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL1\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL2\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL3\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + ccName[0], 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + ccName[1], 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + ccName[2], 0) };\n \n \t\tIResultIterator resultIt = this.executeQuery(this.createQuery(null,\n \t\t\t\tnull, null, null, null, null, null, null, null, bindingNameRow,\n \t\t\t\tbindingExprRow));\n \n \t\tprintResult(resultIt, bindingNameRow, bindingExprRow);\n \t\t// assert\n \t\tcheckOutputFile();\n \n \t}", "@Test\n public void testBoundsAsCompositesWithMultiInRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n Restriction in = newMultiIN(cfMetaData, 0, asList(value1, value2), asList(value2, value3));\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(in);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertComposite(bounds.get(1), value2, value3, EOC.END);\n }", "@Test\n public void testHeterogeneousSegmentFilterConditionLimit() throws SqlParseException {\n\n val project = \"heterogeneous_segment\";\n // val dfId = \"747f864b-9721-4b97-acde-0aa8e8656cba\"\n // val seg1Id = \"8892fa3f-f607-4eec-8159-7c5ae2f16942\"\n // val seg2Id = \"d75a822c-788a-4592-a500-cf20186dded1\"\n // val seg3Id = \"54eaf96d-6146-45d2-b94e-d5d187f89919\"\n // val seg4Id = \"411f40b9-a80a-4453-90a9-409aac6f7632\"\n // val seg5Id = \"a8318597-cb75-416f-8eb8-96ea285dd2b4\"\n // \n val sql = \"with T1 as (select cal_dt, trans_id \\n\" + \"from test_kylin_fact inner join test_account \\n\"\n + \"on test_kylin_fact.seller_id = test_account.account_id \\n\"\n + \"where cal_dt between date'2012-01-01' and date'2012-01-03'\\n\" + \"group by cal_dt, trans_id)\\n\";\n\n {\n val sqlWithTooManyOrs = sql + \" select * from T1 where \" + \"(cal_dt='2012-01-01' and trans_id = 1) or \\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 2) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 3) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 4) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 5) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 6) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 7) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 8) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 9) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 10) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 12) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 13) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 14) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 15) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 16) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 17) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 18) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 19) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 20)\";\n val contexts = OlapContextTestUtil.getOlapContexts(project, sqlWithTooManyOrs);\n Assert.assertEquals(\n \">=(DEFAULT.TEST_KYLIN_FACT.CAL_DT, 2012-01-01),<=(DEFAULT.TEST_KYLIN_FACT.CAL_DT, 2012-01-03)\",\n contexts.get(0).getExpandedFilterConditions().stream().map(RexNode::toString)\n .collect(Collectors.joining(\",\")));\n }\n\n {\n val sqlWithFilter = sql + \" select * from T1 where \" + \"(cal_dt='2012-01-01' and trans_id = 1) or \\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 2) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 3) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 4) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 5) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 6) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 7) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 8) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 9) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 10)\";\n val contexts = OlapContextTestUtil.getOlapContexts(project, sqlWithFilter);\n Assert.assertNotEquals(\n \">=(DEFAULT.TEST_KYLIN_FACT.CAL_DT, 2012-01-01),<=(DEFAULT.TEST_KYLIN_FACT.CAL_DT, 2012-01-03)\",\n contexts.get(0).getExpandedFilterConditions().stream().map(RexNode::toString)\n .collect(Collectors.joining(\",\")));\n }\n\n }", "public boolean percolates() {\n for (int i = 0; i < size; i++) {\r\n if (flowGrid[size * (size - 1) + i] < size) { // if any of the bottom row points at any of the index in the top row\r\n return true;\r\n }\r\n }\r\n return false;\r\n }", "public boolean percolates()\r\n { return uf.find(0) == uf.find(dimension*dimension + 1); }", "private Object isValidColumnVector(List<List<Double>> vector) {\n\t\tInteger nrows = vector.size();\n\n\t\tList<Integer> rowLengths = vector.stream().map(List::size).toList();\n\t\tInteger ncols = rowLengths.stream().mapToInt(Integer::intValue).sum() / rowLengths.size();\n\n\t\treturn (nrows == 3) && (ncols == 1);\n\t}", "public Map<ByteBuffer, List<ColumnOrSuperColumn>> forced_2round_multiget_slice(List<ByteBuffer> allKeys, ColumnParent column_parent, SlicePredicate predicate)\n throws Exception\n {\n //if (logger.isTraceEnabled()) {\n // logger.trace(\"forced_2round_multiget_slice(allKeys = {}, column_parent = {}, predicate = {})\", new Object[]{printKeys(allKeys), column_parent, predicate});\n //}\n //Split up into one request for each server in the local cluster\n Map<Cassandra.AsyncClient, List<ByteBuffer>> asyncClientToFirstRoundKeys = partitionByAsyncClients(allKeys);\n\n //Send Round 1 Requests\n Queue<BlockingQueueCallback<multiget_slice_call>> firstRoundCallbacks = new LinkedList<BlockingQueueCallback<multiget_slice_call>>();\n for (Entry<Cassandra.AsyncClient, List<ByteBuffer>> entry : asyncClientToFirstRoundKeys.entrySet()) {\n Cassandra.AsyncClient asyncClient = entry.getKey();\n List<ByteBuffer> keysForThisClient = entry.getValue();\n\n BlockingQueueCallback<multiget_slice_call> callback = new BlockingQueueCallback<multiget_slice_call>();\n firstRoundCallbacks.add(callback);\n\n //if (logger.isTraceEnabled()) { logger.trace(\"round 1: get \" + printKeys(keysForThisClient) + \" from \" + asyncClient); }\n asyncClient.multiget_slice(keysForThisClient, column_parent, predicate, consistencyLevel, LamportClock.sendTimestamp(), callback);\n }\n\n //Gather responses, track both max_evt and min_lvt\n long overallMaxEvt = Long.MIN_VALUE;\n long overallMinLvt = Long.MAX_VALUE;\n\n Map<ByteBuffer, List<ColumnOrSuperColumn>> keyToResult = new HashMap<ByteBuffer, List<ColumnOrSuperColumn>>();\n NavigableMap<Long, List<ByteBuffer>> lvtToKeys = new TreeMap<Long, List<ByteBuffer>>();\n for (BlockingQueueCallback<multiget_slice_call> callback : firstRoundCallbacks) {\n\n MultigetSliceResult result = callback.getResponseNoInterruption().getResult();\n LamportClock.updateTime(result.lts);\n\n for (Entry<ByteBuffer, List<ColumnOrSuperColumn>> entry : result.value.entrySet()) {\n ByteBuffer key = entry.getKey();\n List<ColumnOrSuperColumn> coscList = entry.getValue();\n keyToResult.put(key, coscList);\n\n //find the evt and lvt for the entire row\n EvtAndLvt evtAndLvt = ColumnOrSuperColumnHelper.extractEvtAndLvt(coscList);\n if (!lvtToKeys.containsKey(evtAndLvt.getLatestValidTime())) {\n lvtToKeys.put(evtAndLvt.getLatestValidTime(), new LinkedList<ByteBuffer>());\n }\n lvtToKeys.get(evtAndLvt.getLatestValidTime()).add(key);\n //if (logger.isTraceEnabled()) { logger.trace(\"round 1 response for \" + printKey(key) + \" evt: \" + evtAndLvt.getEarliestValidTime() + \" lvt: \" + evtAndLvt.getLatestValidTime()); }\n\n overallMaxEvt = Math.max(overallMaxEvt, evtAndLvt.getEarliestValidTime());\n overallMinLvt = Math.min(overallMinLvt, evtAndLvt.getLatestValidTime());\n }\n }\n //if (logger.isTraceEnabled()) { logger.trace(\"Min LVT:\" + overallMinLvt + \" Max EVT: \" + overallMaxEvt); }\n\n //Always Execute 2nd round for micro-benchmarking\n if (true) {\n //get the smallest lvt > maxEvt\n long chosenTime = lvtToKeys.navigableKeySet().higher(overallMaxEvt);\n\n List<ByteBuffer> secondRoundKeys = new LinkedList<ByteBuffer>();\n secondRoundKeys.addAll(allKeys);\n\n //Send Round 2 Requests\n Map<Cassandra.AsyncClient, List<ByteBuffer>> asyncClientToSecondRoundKeys = partitionByAsyncClients(secondRoundKeys);\n Queue<BlockingQueueCallback<multiget_slice_by_time_call>> secondRoundCallbacks = new LinkedList<BlockingQueueCallback<multiget_slice_by_time_call>>();\n for (Entry<Cassandra.AsyncClient, List<ByteBuffer>> entry : asyncClientToSecondRoundKeys.entrySet()) {\n Cassandra.AsyncClient asyncClient = entry.getKey();\n List<ByteBuffer> keysForThisClient = entry.getValue();\n\n BlockingQueueCallback<multiget_slice_by_time_call> callback = new BlockingQueueCallback<multiget_slice_by_time_call>();\n secondRoundCallbacks.add(callback);\n\n //if (logger.isTraceEnabled()) { logger.trace(\"round 2: get \" + printKeys(keysForThisClient) + \" from \" + asyncClient); }\n\n asyncClient.multiget_slice_by_time(keysForThisClient, column_parent, predicate, consistencyLevel, chosenTime, LamportClock.sendTimestamp(), callback);\n }\n\n //Gather second round responses\n for (BlockingQueueCallback<multiget_slice_by_time_call> callback : secondRoundCallbacks) {\n MultigetSliceResult result = callback.getResponseNoInterruption().getResult();\n LamportClock.updateTime(result.lts);\n\n substituteValidFirstRoundResults(result, keyToResult);\n\n //if (logger.isTraceEnabled()) { logger.trace(\"round 2 responses for \" + printKeys(result.getValue().keySet())); }\n\n keyToResult.putAll(result.getValue());\n }\n }\n\n //Add dependencies on anything returned and removed deleted columns\n for (Entry<ByteBuffer, List<ColumnOrSuperColumn>> entry : keyToResult.entrySet()) {\n ByteBuffer key = entry.getKey();\n List<ColumnOrSuperColumn> coscList = entry.getValue();\n\n for (Iterator<ColumnOrSuperColumn> cosc_it = coscList.iterator(); cosc_it.hasNext(); ) {\n ColumnOrSuperColumn cosc = cosc_it.next();\n try {\n clientContext.addDep(key, cosc);\n } catch (NotFoundException nfe) {\n //remove deleted results, it's okay for all result to be removed\n cosc_it.remove();\n }\n }\n }\n //if (logger.isTraceEnabled()) {\n // logger.trace(\"forced_2round_multiget_slice result = {}\", keyToResult);\n //}\n return keyToResult;\n }", "private int[][] generateCandidates(int[][] usageM){\n\t\t// 1. start with the complete set of attributes\n\t\tMap<Integer, List<Integer>> partitionAttributes = new HashMap<Integer,List<Integer>>();\n\t\tList<Integer> attributes = new ArrayList<Integer>();\n\t\tfor(int i=0;i<usageM[0].length;i++)\n\t\t\tattributes.add(i);\n\t\tpartitionAttributes.put(0, attributes);\n\t\t\n\t\t// 2. for each query, split this set of attributes into two set:\n\t\t// (i) attributes accessed by the query\n\t\t//\t (ii) attributes not-accessed by the query\n\t\tfor(int[] query: usageM){\n\t\t\tMap<Integer, List<Integer>> newPartitionAttributes = new HashMap<Integer,List<Integer>>();\n\t\t\tint partitionCount = partitionAttributes.size();\n\t\t\t\n\t\t\t// check each partition\n\t\t\tfor(int p: partitionAttributes.keySet()){\n\t\t\t\tList<Integer> attrs = partitionAttributes.get(p);\n\t\t\t\tboolean fullPartitionAccess = true;\n\t\t\t\tfor(int a: attrs){\n\t\t\t\t\tif(query[a]==0)\n\t\t\t\t\t\tfullPartitionAccess = false;\n\t\t\t\t}\n\n\t\t\t\tif(fullPartitionAccess){\n\t\t\t\t\tnewPartitionAttributes.put(p, attrs);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t//int newPartition = partitionAttributes.size();\n\t\t\t\t\tList<Integer> accessedAttrs = new ArrayList<Integer>();\n\t\t\t\t\tList<Integer> nonAccessedAttrs = new ArrayList<Integer>();\n\t\t\t\t\tfor(int a: attrs){\n\t\t\t\t\t\tif(query[a]==1)\n\t\t\t\t\t\t\taccessedAttrs.add(a);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tnonAccessedAttrs.add(a);\n\t\t\t\t\t}\n\t\t\t\t\tif(nonAccessedAttrs.size() > 0)\n\t\t\t\t\t\tnewPartitionAttributes.put(p, nonAccessedAttrs);\n\t\t\t\t\tif(accessedAttrs.size() > 0)\n\t\t\t\t\t\tnewPartitionAttributes.put(partitionCount++, accessedAttrs);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//System.out.println(newPartitionAttributes);\n\t\t\t\n\t\t\tpartitionAttributes = newPartitionAttributes;\n\t\t}\n\t\t\n\t\t\n\t\t// 3. we end up with a set of attribute sets; all attributes in \n\t\t//\t an attribute set are always accessed together.\n\t\tint[][] primaryPartitions = new int[partitionAttributes.size()][];\n\t\tint i=0;\n\t\tfor(int p: partitionAttributes.keySet()){\n\t\t\tList<Integer> attrs = partitionAttributes.get(p);\n\t\t\tprimaryPartitions[i] = new int[attrs.size()];\n\t\t\tfor(int j=0;j<attrs.size();j++)\n\t\t\t\tprimaryPartitions[i][j] = attrs.get(j);\n\t\t\ti++;\n\t\t}\n\t\t\n\t\treturn primaryPartitions;\n\t}", "List<Online> selectByExampleWithRowbounds(OnlineExample example, RowBounds rowBounds);", "boolean hasPermissionOfCluster(String clusterId, String userName);", "public static boolean isAllowedToCollied(Marker marker, Marker m2){\n\t\tif( m2.letter.getX() < marker.letter.getX()){\n\t\t\tif(m2.rightValue != 0 && marker.leftValue !=0 && m2.rightValue + marker.leftValue == 0){\n\t\t\t\tm2.rightValue =0;\n\t\t\t\tmarker.leftValue=0;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\t//if collied on right \n\t\telse if( m2.letter.getX() > marker.letter.getX()){\n\t\t\tif(m2.leftValue != 0 && marker.rightValue != 0 && m2.leftValue+ marker.rightValue == 0){\n\t\t\t\tm2.leftValue = 0;\n\t\t\t\tmarker.rightValue = 0; \n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "private boolean canSetSafelyDownColumn(MTreeNode row, MTreeNode col, UnionDoubleIntervals newVal) {\n\t\tMTreeNode rowKids[]=row.getChildren();\n\t\tif (rowKids.length==0) return true;\n\t\tUnionDoubleIntervals rowKidsInts[]=new UnionDoubleIntervals[rowKids.length];\n\t\tfor(int i=0; i<rowKids.length; i++) {\n\t\t\trowKidsInts[i]=get(rowKids[i], col);\n\t\t\tif (rowKidsInts[i]==null) {\n\t\t\t\t//If a sibling is null, I cannot check, so just return\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\tUnionDoubleIntervals sum=UnionDoubleIntervals.sum(rowKidsInts);\n\t\treturn newVal.intersects(sum);\n\t}", "boolean getIsClusteringKey();", "DataFrame<R,C> select(Predicate<DataFrameRow<R,C>> rowPredicate, Predicate<DataFrameColumn<R,C>> colPredicate);", "@Test\n \tpublic void whereClauseForNodeRangedDominance() {\n \t\tnode23.addJoin(new Dominance(node42, 10, 20));\n \t\tcheckWhereCondition(\n //\t\t\t\tjoin(\"=\", \"_rank23.component_ref\", \"_rank42.component_ref\"),\n \t\t\t\tjoin(\"=\", \"_component23.type\", \"'d'\"),\n \t\t\t\t\"_component23.name IS NULL\",\n \t\t\t\tjoin(\"<\", \"_rank23.pre\", \"_rank42.pre\"),\n \t\t\t\tjoin(\"<\", \"_rank42.pre\", \"_rank23.post\"),\n \t\t\t\t\"_rank23.level BETWEEN SYMMETRIC _rank42.level - 10 AND _rank42.level - 20\"\n \n \t\t);\n \t}", "public static boolean IS_SUBFEATURE(Feature a, int index_a, Feature b, int index_b) {\n\n boolean anotinb, bnotina;\n int i, ia, ib;\n\n if (index_a != index_b)\n Dataset.perror(\"Feature.class :: not the same feature (\" + index_a + \" != \" + index_b + \")\");\n if (!a.type.equals(b.type))\n Dataset.perror(\n \"Feature.class :: not the same type of feature (\" + a.type + \" != \" + b.type + \")\");\n\n if (IS_CONTINUOUS(a.type)) {\n if (a.dmin >= b.dmin) {\n if (a.dmax <= b.dmax) return true;\n else\n Dataset.perror(\n \"Feature.class :: inconsistency for subfeature check for : (\"\n + a.dmin\n + \", \"\n + a.dmax\n + \") subseteq (\"\n + b.dmin\n + \", \"\n + b.dmax\n + \") ? \");\n } else if (a.dmax < b.dmax)\n Dataset.perror(\n \"Feature.class :: inconsistency for subfeature check for : (\"\n + a.dmin\n + \", \"\n + a.dmax\n + \") subseteq (\"\n + b.dmin\n + \", \"\n + b.dmax\n + \") ? \");\n } else if (IS_INTEGER(a.type)) {\n if (a.imin >= b.imin) {\n if (a.imax <= b.imax) return true;\n else\n Dataset.perror(\n \"Feature.class :: inconsistency for subfeature check for : (\"\n + a.imin\n + \", \"\n + a.imax\n + \") subseteq (\"\n + b.imin\n + \", \"\n + b.imax\n + \") ? \");\n } else if (a.imax < b.imax)\n Dataset.perror(\n \"Feature.class :: inconsistency for subfeature check for : (\"\n + a.imin\n + \", \"\n + a.imax\n + \") subseteq (\"\n + b.imin\n + \", \"\n + b.imax\n + \") ? \");\n } else if (IS_NOMINAL(a.type)) {\n if (a.modalities == null) return true;\n else if (b.modalities != null) {\n anotinb = bnotina = false;\n ia = ib = -1;\n for (i = 0; i < a.modalities.size(); i++)\n if (!b.modalities.contains((String) a.modalities.elementAt(i))) {\n anotinb = true;\n ia = i;\n }\n for (i = 0; i < b.modalities.size(); i++)\n if (!a.modalities.contains((String) b.modalities.elementAt(i))) {\n bnotina = true;\n ib = i;\n }\n if ((anotinb) && (bnotina))\n Dataset.perror(\n \"Feature.class :: inconsistency for subfeature check for : \"\n + ((String) a.modalities.elementAt(ia))\n + \" not in b and \"\n + ((String) b.modalities.elementAt(ib))\n + \" not in a \");\n else if (!anotinb) return true;\n }\n } else Dataset.perror(\"Feature.class :: no Feature type for \" + a.type);\n\n return false;\n }", "public void decideCluster(){\n\tdouble shortest = 1000000;\n\tfor(int i = 0; i < clusterDist.length; i++)\n\t{\n\t\tif(clusterDist[i] < shortest)\n\t\t{\tshortest = clusterDist[i];\n\t\t\tthis.clusterid = i;\n\t\t}\n\t\t\n\t}\n}", "public static void pseudoTrueTuples(LogicProblem logicProblem, boolean applyChanges)\r\n throws RelationshipConflictException {\n \r\n HashMap<ItemPair,Relationship> relationshipTable = logicProblem.getRelationshipTable();\r\n HashSet<CategoryPair> categoryPairs = logicProblem.getCategoryPairs();\r\n \r\n// System.out.println(\"searching...\");\r\n //within a subgrid\r\n for (CategoryPair categoryPair : categoryPairs) {\r\n// System.out.println(\"Category pair:\" + categoryPair);\r\n //vertical and horizontal search\r\n for (final boolean verticalOrientation : new boolean[] { false, true } ) {\r\n\r\n Category subrowCategory = verticalOrientation?categoryPair.first():categoryPair.last();\r\n Category subcolumnCategory = verticalOrientation?categoryPair.last():categoryPair.first();\r\n\r\n //commenting \"vertical search\" \r\n //(subrows match first category's items\r\n // subcolumns match second category's items)\r\n\r\n //i (2 to floor(n/2)) is the number of elements in the combination tuple\r\n // i=2 in pseudoTrue pairs\r\n //(for subgrids of 5x5 items, looking for both pairs and triplets becomes redundant\r\n for (int i=2; i<=floor(logicProblem.getNumCategories()/2);i++) {\r\n\r\n //https://github.com/dpaukov/combinatoricslib3/wiki/v3.3.0#1-simple-combinations\r\n List<List<Item>> columnCombinations = Generator.combination(subcolumnCategory.getItems())\r\n .simple(i) //for pseudo true pairs, i=2\r\n .stream()\r\n .collect(Collectors.<List<Item>>toList());\r\n //for i=2, this would contain \r\n //Bethany, Donovan\r\n //Bethany, Elizabeth\r\n //...\r\n //Frederick, Peyton\r\n// columnCombinations.stream().forEach(l -> System.out.println(\r\n// (verticalOrientation?\"vertical\":\"horizontal\")+ \" combo: \"+l.toString()));\r\n\r\n //create the sets\r\n //for each combination, start over\r\n \r\n //columnTuple contains i items with which we will compute set intersections\r\n for (List<Item> columnItemTuple : columnCombinations) {\r\n //Bethany, Donovan\r\n \r\n //similarly, valueNoSets contains i sets of VALUE_NO relationships\r\n List<Set<Item>> valueNoSets = new ArrayList<>(); //size=i\r\n //build a set for each i item of columnTuple\r\n for (Item columnItem : columnItemTuple) {\r\n //Bethany\r\n Set<Item> valueNoSet = new HashSet<>(); //size = n\r\n for (Item rowItem : subrowCategory.getItems()) {\r\n //Haley's Comet ....\r\n if (relationshipTable.get(new ItemPair(rowItem, columnItem)).getValue() == Relationship.ValueType.VALUE_NO)\r\n //stacking all VALUE_NO relationship into vertical set\r\n valueNoSet.add(rowItem); //store into single subcolumn set \r\n }\r\n //adding each vertical set into list of sets\r\n if (valueNoSet.size() >= logicProblem.getNumItems() - i //for pairs, we need three VALUE_NO in the set\r\n && valueNoSet.size() < logicProblem.getNumItems()-1) //uniqueness will take or n-1 cases\r\n valueNoSets.add(valueNoSet); //store single subcolumn into multi-set\r\n }\r\n //magic!\r\n Set<Item> intersectionSet = new HashSet<>(); //avoid NPE when the next call is made\r\n if (valueNoSets.size()>=2) //don't compute intersections otherwise\r\n intersectionSet = Processor.multiSetIntersection(valueNoSets);\r\n\r\n if (intersectionSet.size()==logicProblem.getNumItems()-i) {\r\n \r\n// System.out.println(\"----> found candidates for pseudo true pairs!\");\r\n// intersectionSet.stream().forEach(l -> System.out.println(\"\\t\" + l.toString()));\r\n// System.out.println(\"\\t\\tvs.\");\r\n// columnItemTuple.stream().forEach(l -> System.out.println(\"\\t\" + l.toString()));\r\n \r\n //create predecessor list\r\n //we can only add the intersection output as predecessors\r\n ArrayList<Dependable> predecessors = new ArrayList<Dependable>();\r\n for (Item intersectionColumn : intersectionSet) {\r\n for (Item rowItem : columnItemTuple) {\r\n predecessors.add(relationshipTable.get(new ItemPair(rowItem, intersectionColumn)));\r\n }\r\n }\r\n\r\n\r\n //we have a bunch of work to do\r\n for (Item everyRowItem : subrowCategory.getItems()) {\r\n //for every row item not in the intersectionSet\r\n if (!intersectionSet.contains(everyRowItem)) {\r\n for (Item everyColumnItem : subcolumnCategory.getItems()) {\r\n //for every column item not in any of the columnTuple list\r\n if (!columnItemTuple.contains(everyColumnItem)) {\r\n Relationship rel = relationshipTable.get(new ItemPair(everyRowItem,everyColumnItem));\r\n if (rel.getValue()!=Relationship.ValueType.VALUE_NO)\r\n Processor.setRelationship(logicProblem, applyChanges, rel, \r\n Relationship.ValueType.VALUE_NO, Relationship.LogicType.PSEUDOTRUE,\r\n predecessors.toArray(new Relationship[predecessors.size()])); \r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }", "private boolean isSubset(List<ConceptLabel> outer, List<ConceptLabel> inner){\n\t\tfor(ConceptLabel in: inner){\n\t\t\tboolean c = false;\n\t\t\tfor(ConceptLabel l: outer){\n\t\t\t\tif(l.getText().equals(in.getText())){\n\t\t\t\t\tc = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(!c)\n\t\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public VirtualDataSet[] partitionByNumericAttribute(int attributeIndex, int valueIndex) {\n\t\t// WRITE YOUR CODE HERE!\n\n\t\t if(attributes[attributeIndex].getType()==AttributeType.NOMINAL){ \t\t\t\t\t\t\t// avoid passing through nominal value to current method\n return null; \n }\n\t\t\tVirtualDataSet [] partitions = new VirtualDataSet[2]; \t\t\t\t\t\t\t\t\t// creates two split path \n\n\t\t\tdouble split = Double.parseDouble(getValueAt(valueIndex , attributeIndex));\t\t\t// determine the middle number in order to split \n\t\t\t\n\t\t\tLinkedList<Integer> rowsLess = new LinkedList<Integer> (); \t\t\t\t\t\t\t// using linkedlist to do collection of split rows that less than valueIndex value\n\t\t\t\n\t\t\tLinkedList<Integer> rowsMore = new LinkedList<Integer> ();\t\t\t\t\t\t\t\t// using linkedlist to do collection of split rows that less than valueIndex value\n\t\t\t\n\t\t\tint countLess = 0;\n\t\t\tint countMore = 0; \n\n\t\t\tString []arrayOfNums = attributes[attributeIndex].getValues();\n\n\t\t\tfor(int j = 0; j < source.numRows; j++){ \n\t\t\t\t\n\t\t\t\tif(Double.parseDouble(getValueAt(j,attributeIndex)) <= split){ \t\t\t\t// transform from string to integer in order to compare the number smaller than middle number\n\t\t\t\t\t\n\t\t\t\t\trowsLess.add(j);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// add rows that correspond with the current attribute of spliting \n\t\t\t\t\tcountLess++;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// determine the size of partition rows array \n\t\t\t\t}else if(Double.parseDouble(getValueAt(j,attributeIndex)) > split){\t\t\t// transform from string to integer in order to compare the number bigger than middle number\n\t\t\t\t\t\n\t\t\t\t\trowsMore.add(j); \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// add rows that correspond with the current attribute of spliting \n\t\t\t\t\tcountMore++;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// determine the size of partition rows array \n\t\t\t\t}\n\t\t\t}\n\n\t\t\tint [] partitionRowsLess = new int [countLess]; \t\t\t\t\t\t\t\t\t\t// the collection of rows represents all number that smaller than middle number\n\t\t\tint [] partitionRowsMore = new int [countMore]; \t\t\t\t\t\t\t\t\t\t// the collection of rows represents all number that bigger than middle number\n\t\t\tfor(int k = 0; k < countLess; k++){\n\t\t\t\tpartitionRowsLess[k] = rowsLess.poll(); \t\t\t\t\t\t\t\t\t\t\t// transform from linkedlist to array \n\t\t\t}\n\t\t\tfor(int k = 0; k < countMore; k++){\n\t\t\t\tpartitionRowsMore[k] = rowsMore.poll(); \t\t\t\t\t\t\t\t\t\t\t// transform from linkedlist to array \n\t\t\t}\n\t\t\t\n\t\t\tpartitions[0] = new VirtualDataSet(source,partitionRowsLess, attributes); \t\t\t\t// send partition to VirtualDataSet constructor \n\t\t\tpartitions[1] = new VirtualDataSet(source,partitionRowsMore, attributes); \n\t\t\t\n\n\n\t\t\treturn partitions;\n\t\t\n\t}", "@Test\n\t public void test_Is_Subset_Positive() throws Exception{\t\n\t\t SET setarray= new SET( new int[]{1,2,3,4,5});\n\t\t SET subsetarray= new SET( new int[]{1,2,3});\n\t\t assertTrue(setarray.isSubSet(subsetarray));\t \n\t }", "@Test\r\n public void testIsSubset1() {\r\n Assert.assertEquals(false, set1.isSubset(set2));\r\n }", "boolean hasCluster();", "@Test\n public void testMultiLevelPartitionPruning() throws SqlParseException {\n\n val project = \"multi_level_partition\";\n val dfId = \"747f864b-9721-4b97-acde-0aa8e8656cba\";\n val expectedRanges = Lists.<Pair<String, String>> newArrayList();\n val segmentRange1 = Pair.newPair(\"2012-01-01\", \"2012-01-02\");\n val segment1Uuid = \"8892fa3f-f607-4eec-8159-7c5ae2f16942\";\n val segmentRange2 = Pair.newPair(\"2012-01-02\", \"2012-01-03\");\n val segment2Uuid = \"d75a822c-788a-4592-a500-cf20186dded1\";\n val segmentRange3 = Pair.newPair(\"2012-01-03\", \"2012-01-04\");\n val segment3Uuid = \"54eaf96d-6146-45d2-b94e-d5d187f89919\";\n val segmentRange4 = Pair.newPair(\"2012-01-04\", \"2012-01-05\");\n val segment4Uuid = \"411f40b9-a80a-4453-90a9-409aac6f7632\";\n val segmentRange5 = Pair.newPair(\"2012-01-05\", \"2012-01-06\");\n val segment5Uuid = \"a8318597-cb75-416f-8eb8-96ea285dd2b4\";\n val expectedPartitionMap = Maps.<String, List<Long>> newHashMap();\n\n val sqlBase = \"select cal_dt, sum(price) from test_kylin_fact inner join test_account on test_kylin_fact.seller_id = test_account.account_id \";\n\n // no filter\n val noFilterSql = sqlBase + \"group by cal_dt\";\n expectedRanges.add(segmentRange1);\n expectedRanges.add(segmentRange2);\n expectedRanges.add(segmentRange3);\n expectedRanges.add(segmentRange4);\n expectedRanges.add(segmentRange5);\n expectedPartitionMap.put(segment1Uuid, Lists.newArrayList(0L, 1L, 2L, 3L));\n expectedPartitionMap.put(segment2Uuid, Lists.newArrayList(0L, 1L, 2L));\n expectedPartitionMap.put(segment3Uuid, Lists.newArrayList(1L, 2L, 3L));\n expectedPartitionMap.put(segment4Uuid, Lists.newArrayList(0L, 1L));\n expectedPartitionMap.put(segment5Uuid, Lists.newArrayList(2L, 3L));\n assertPrunedSegmentsRange(project, noFilterSql, dfId, expectedRanges, 1L, expectedPartitionMap);\n\n val andSql0 = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-04' and lstg_site_id = 1 group by cal_dt\";\n val andMappingSql0 = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-04' and lstg_format_name = 'FP-non GTC' group by cal_dt\";\n val andMixSql0 = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-04' and lstg_site_id = 1 and lstg_format_name = 'FP-non GTC' group by cal_dt\";\n expectedRanges.clear();\n expectedRanges.add(segmentRange1);\n expectedRanges.add(segmentRange2);\n expectedRanges.add(segmentRange3);\n expectedPartitionMap.clear();\n expectedPartitionMap.put(segment1Uuid, Lists.newArrayList(1L));\n expectedPartitionMap.put(segment2Uuid, Lists.newArrayList(1L));\n expectedPartitionMap.put(segment3Uuid, Lists.newArrayList(1L));\n assertPrunedSegmentsRange(project, andSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n assertPrunedSegmentsRange(project, andMappingSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n assertPrunedSegmentsRange(project, andMixSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n\n val notInSql0 = sqlBase\n + \"where cal_dt > '2012-01-02' and cal_dt < '2012-01-04' and lstg_site_id not in (0, 2, 3) group by cal_dt\";\n val notInMappingSql0 = sqlBase\n + \"where cal_dt > '2012-01-02' and cal_dt < '2012-01-04' and lstg_format_name not in ('FP-GTC', 'ABIN', 'Auction') group by cal_dt\";\n val notInMixSql0 = sqlBase\n + \"where cal_dt > '2012-01-02' and cal_dt < '2012-01-04' and lstg_site_id not in (0, 2, 3) and lstg_format_name not in ('FP-GTC', 'ABIN', 'Auction') group by cal_dt\";\n expectedRanges.clear();\n expectedRanges.add(segmentRange2);\n expectedRanges.add(segmentRange3);\n expectedPartitionMap.clear();\n expectedPartitionMap.put(segment2Uuid, Lists.newArrayList(1L));\n expectedPartitionMap.put(segment3Uuid, Lists.newArrayList(1L));\n assertPrunedSegmentsRange(project, notInSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n assertPrunedSegmentsRange(project, notInMappingSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n assertPrunedSegmentsRange(project, notInMixSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n\n // return empty data case\n val emptyData = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-03' and lstg_site_id = 5 group by cal_dt\";\n val emptyDataMapping = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-03' and lstg_format_name = 'not_exist_name' group by cal_dt\";\n val emptyDataMix = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-03' and lstg_site_id = 5 and lstg_format_name = 'not_exist_name' group by cal_dt\";\n expectedRanges.clear();\n expectedPartitionMap.clear();\n assertPrunedSegmentsRange(project, emptyData, dfId, expectedRanges, -1L, expectedPartitionMap);\n assertPrunedSegmentsRange(project, emptyDataMapping, dfId, expectedRanges, -1L, expectedPartitionMap);\n assertPrunedSegmentsRange(project, emptyDataMix, dfId, expectedRanges, -1L, expectedPartitionMap);\n\n // query data out of current built segments range\n val inSql0 = sqlBase\n + \"where cal_dt > '2011-12-30' and cal_dt < '2012-01-03' and lstg_site_id in (1, 2) group by cal_dt\";\n val inMappingSql0 = sqlBase\n + \"where cal_dt > '2011-12-30' and cal_dt < '2012-01-03' and lstg_format_name in ('FP-non GTC', 'ABIN') group by cal_dt\";\n val inMixSql0 = sqlBase\n + \"where cal_dt > '2011-12-30' and cal_dt < '2012-01-03' and lstg_site_id in (1, 2) and lstg_format_name in ('FP-non GTC', 'ABIN') group by cal_dt\";\n expectedRanges.add(segmentRange1);\n expectedRanges.add(segmentRange2);\n expectedPartitionMap.put(segment1Uuid, Lists.newArrayList(1L, 2L));\n expectedPartitionMap.put(segment2Uuid, Lists.newArrayList(1L, 2L));\n assertPrunedSegmentsRange(project, inSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n assertPrunedSegmentsRange(project, inMappingSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n assertPrunedSegmentsRange(project, inMixSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n\n val pushDownSql0 = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-03' and lstg_site_id = 3 group by cal_dt\";\n assertNoRealizationFound(project, pushDownSql0);\n\n val pushDownMappingSql0 = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-03' and lstg_format_name = 'Auction' group by cal_dt\";\n assertNoRealizationFound(project, pushDownMappingSql0);\n\n val pushDownMixSql0 = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-03' and lstg_site_id = 3 and lstg_format_name = 'Auction' group by cal_dt\";\n assertNoRealizationFound(project, pushDownMixSql0);\n\n // return empty result\n val wrongMapping0 = sqlBase\n + \"where cal_dt between '2012-01-01' and '2012-01-02' and lstg_site_id = 0 and lstg_format_name = 'FP-non GTC' group by cal_dt\";\n assertPrunedSegmentsRange(project, wrongMapping0, dfId, null, -1L, null);\n\n val orSql0 = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-02' and (lstg_site_id = 0 or lstg_format_name = 'FP-non GTC') group by cal_dt\";\n expectedRanges.clear();\n expectedPartitionMap.clear();\n expectedRanges.add(segmentRange1);\n expectedPartitionMap.put(segment1Uuid, Lists.newArrayList(0L, 1L));\n assertPrunedSegmentsRange(project, orSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n }", "@Test\n\t public void test_Is_Subset_Negative() throws Exception{\t\n\t\t SET setarray= new SET( new int[]{1,2,3,4,5});\n\t\t SET subsetarray= new SET( new int[]{7,8});\n\t\t assertFalse(setarray.isSubSet(subsetarray));\t \n\t }", "static public int getAtLeastKVisitors(int[][] rectangles, int k) {\n\n if(rectangles.length==0)\n return 0;\n if(k > rectangles.length)\n return 0;\n\n TreeSet<Rectangle> avlTree = new TreeSet<>();//To store the rectangles ordered\n TreeSet<Integer> Ys = new TreeSet<>();\n\n for(int[] coordinates: rectangles) {\n //x2 = x2 + 1 , y2 = y2 +1 for the inclusive constraints\n Rectangle r = new Rectangle(coordinates[0], coordinates[1], coordinates[2]+1, coordinates[3]+1);\n avlTree.add(r);\n if(!Ys.contains(r.getY1()))\n Ys.add(r.getY1());\n if(!Ys.contains(r.getY2()))\n Ys.add(r.getY2());\n }\n\n int ans = 0;\n Iterator<Integer> yIterator = Ys.iterator();\n int previousY = yIterator.next();\n\n //Traverse by slices of Y's\n while(yIterator.hasNext()) {\n\n int currentY = yIterator.next();\n List<int[]> segments = new ArrayList<>();\n Iterator<Rectangle> treeIterator = avlTree.iterator();\n\n //Look for the rectangles that fall in the slice and create a segment's list\n while(treeIterator.hasNext()) {\n Rectangle r = treeIterator.next();\n //We stop traversing the tree once the rectangles are completely above the slice\n if(r.getY1()>currentY)\n break;\n if(r.getY1()<= previousY && r.getY2()>=currentY) {\n int[] segmentL = new int[2]; int[] segmentR = new int[2];\n segmentL[0] = r.getX1(); segmentL[1] = Type.OPEN.getValue();\n segmentR[0] = r.getX2(); segmentR[1] = Type.CLOSED.getValue();\n segments.add(segmentL); segments.add(segmentR);\n }\n //We remove the rectangles that are left behind by the slice\n if(r.getY2() < previousY)\n treeIterator.remove();\n }\n\n //Sort the segments to analyze them\n Collections.sort(segments, (a, b) -> Integer.compare(a[0], b[0]));\n Iterator<int[]> it = segments.iterator();\n int[] segmentEnd, segmentStart = it.next();\n int nRectangles = Type.OPEN.getValue(); //The first interval will always be opening\n\n while(it.hasNext()) {\n segmentEnd = it.next();\n if(nRectangles >=k) {\n ans+= (currentY - previousY) * (segmentEnd[0] - segmentStart[0]);\n }\n segmentStart = segmentEnd;\n nRectangles += segmentEnd[1];\n }\n\n previousY = currentY;\n }\n\n return ans;\n }", "public void testSortOnComputedColumn() throws Exception {\n \t\tccName = new String[] { \"ccc\", \"ccc2\" };\n \t\tccExpr = new String[] { \"row.COL0+row.COL1\",\n \t\t\t\t\"row.COL1+10\" };\n \t\tfor (int i = 0; i < ccName.length; i++) {\n \t\t\tComputedColumn computedColumn = new ComputedColumn(ccName[i],\n \t\t\t\t\tccExpr[i], DataType.INTEGER_TYPE);\n \t\t\t((BaseDataSetDesign) this.dataSet)\n \t\t\t\t\t.addComputedColumn(computedColumn);\n \t\t}\n \n \t\tString[] bindingNameSort = new String[1];\n \t\tbindingNameSort[0] = \"SORT_DEFINITION\";\n \t\tIBaseExpression[] bindingExprSort = new IBaseExpression[1];\n \t\tbindingExprSort[0] = new ScriptExpression(\n \t\t\t\t\"dataSetRow.ccc/Total.ave(dataSetRow.ccc)\");\n \t\tSortDefinition[] sortDefn = new SortDefinition[] { new SortDefinition() };\n \t\tsortDefn[0].setExpression(\"row.SORT_DEFINITION\");\n \t\tsortDefn[0].setSortDirection(ISortDefinition.SORT_DESC);\n \n \t\tString[] bindingNameRow = new String[6];\n \t\tbindingNameRow[0] = \"ROW_COL0\";\n \t\tbindingNameRow[1] = \"ROW_COL1\";\n \t\tbindingNameRow[2] = \"ROW_COL2\";\n \t\tbindingNameRow[3] = \"ROW_COL3\";\n \t\tbindingNameRow[4] = \"ROW_ccc\";\n \t\tbindingNameRow[5] = \"ROW_ccc2\";\n \t\tScriptExpression[] bindingExprRow = new ScriptExpression[] {\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL0\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL1\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL2\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL3\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + ccName[0], 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + ccName[1], 0), };\n \n \t\tIResultIterator resultIt = this.executeQuery(this.createQuery(null,\n \t\t\t\tnull, null, bindingNameSort, bindingExprSort, sortDefn, null,\n \t\t\t\tnull, null, bindingNameRow, bindingExprRow));\n \n \t\tprintResult(resultIt, bindingNameRow, bindingExprRow);\n \t\t// assert\n \t\tcheckOutputFile();\n \n \t}", "@Test\n public void testBoundsAsCompositesWithEqAndInRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n Restriction eq = newSingleEq(cfMetaData, 0, value1);\n Restriction in = newSingleIN(cfMetaData, 1, value1, value2, value3);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(in);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.START);\n assertComposite(bounds.get(2), value1, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value1, EOC.END);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n assertComposite(bounds.get(2), value1, value3, EOC.END);\n }", "@Test\n public void should_iterate_with_partition_keys_and_partition_keys_IN() throws Exception {\n //Given\n long partitionKey = RandomUtils.nextLong(0,Long.MAX_VALUE);\n\n insertCompositeClusteredValues(partitionKey,\"bucket1\",1,\"name1\",1);\n insertCompositeClusteredValues(partitionKey,\"bucket2\",1,\"name2\",1);\n insertCompositeClusteredValues(partitionKey,\"bucket3\",1,\"name3\",1);\n\n //When\n final Iterator<CompositeClusteredEntity> iterator = manager.sliceQuery(CompositeClusteredEntity.class)\n .forIteration()\n .withPartitionComponents(partitionKey)\n .andPartitionComponentsIN(\"bucket1\", \"bucket3\")\n .iterator();\n\n //Then\n assertThat(iterator.hasNext()).isTrue();\n CompositeClusteredEntity next = iterator.next();\n assertThat(next.getId().getId()).isEqualTo(partitionKey);\n assertThat(next.getId().getBucket()).isEqualTo(\"bucket1\");\n assertThat(next.getId().getName()).isEqualTo(\"name11\");\n assertThat(next.getValue()).isEqualTo(\"value11\");\n\n assertThat(iterator.hasNext()).isTrue();\n next = iterator.next();\n assertThat(next.getId().getId()).isEqualTo(partitionKey);\n assertThat(next.getId().getBucket()).isEqualTo(\"bucket3\");\n assertThat(next.getId().getName()).isEqualTo(\"name31\");\n assertThat(next.getValue()).isEqualTo(\"value11\");\n }", "public static ASTNode evaluateSlice(ASTNode compound_matrix, ArrayList<ASTNode> indices) {\n\t if(indices.size()==0) {\n\t assert !(compound_matrix instanceof CompoundMatrix || compound_matrix instanceof EmptyMatrix);\n\t return compound_matrix;\n\t }\n\t \n\t ASTNode sliceindex=indices.get(0);\n\t \n\t if(compound_matrix instanceof EmptyMatrix) {\n // Construct new matrix domain for empty matrix.\n // First get the matrix domain for compound_matrix (which is itself an empty matrix)\n ASTNode matdom=compound_matrix.getChild(0);\n \n // Get indices\n ArrayList<ASTNode> empty_idx=matdom.getChildren(3);\n \n assert empty_idx.size()==indices.size();\n \n for(int i=empty_idx.size()-1; i>=0; i--) {\n if(! indices.get(i).equals(new IntegerDomain(new Range(null, null)))) {\n // If indices.get(i) is a constant, remove that dimension. \n empty_idx.remove(i);\n }\n }\n \n return new EmptyMatrix(new MatrixDomain(compound_matrix.getChild(0).getChild(0), // get original base domain. \n empty_idx));\n }\n\t \n // Must be a compound matrix from here on. \n if(sliceindex.isSet()) {\n assert ! sliceindex.isFiniteSetUpper() && ! sliceindex.isFiniteSetLower(); // Should be ..\n ArrayList<ASTNode> newcm=new ArrayList<ASTNode>();\n \n ArrayList<ASTNode> restindices=new ArrayList<ASTNode>(indices);\n restindices.remove(0);\n \n for(int i=1; i<compound_matrix.numChildren(); i++) {\n ASTNode tmp=evaluateSlice(compound_matrix.getChildConst(i), restindices);\n if(tmp==null) return null;\n newcm.add(tmp);\n }\n return new CompoundMatrix(compound_matrix.getChild(0), newcm); // Take index domain from original CM.\n\t }\n\t else {\n\t // This index must be a constant\n\t ArrayList<Long> cmindex;\n if(compound_matrix instanceof CompoundMatrix) {\n cmindex=compound_matrix.getChild(0).getValueSet();\n }\n else if (compound_matrix instanceof EmptyMatrix) {\n cmindex=new ArrayList<Long>();\n }\n else {\n cmindex=null;\n }\n\t \n\t long val=sliceindex.getValue();\n\t int idxval=cmindex.indexOf(val);\n\t \n\t if(idxval==-1) {\n\t // Matrix is indexed out of range. Undefined. Delay evaluation. \n\t return null;\n\t }\n\t \n ArrayList<ASTNode> restindices=new ArrayList<ASTNode>(indices);\n restindices.remove(0);\n\t \n\t return evaluateSlice(compound_matrix.getChildConst(idxval+1), restindices);\n\t }\n\t}", "@Nullable\n public abstract GridAxis subset(GridSubset params, Formatter errlog);", "Boolean isValid(ArrayList<Integer> colQ){\n \n int curcol = colQ.size() - 1;\n int row = colQ.get(colQ.size() - 1);\n\n int i = 0;\n int j = 0;\n for(i = curcol-1, j = 1; i >= 0; i--, j++)\n {\n // check if we have two of the same row || check diags\n if(row == colQ.get(i) || row+j == colQ.get(i) || row-j == colQ.get(i)) return false;\n }\n return true;\n \n }", "private boolean checkColoumnForOctPair(int j1, int j2) {\n for(int i=0;i<4;i++)\r\n {\r\n if(Kmap[i][j1]==0 || Kmap[i][j1]==-1)\r\n return false;\r\n }\r\n for(int i=0;i<4;i++)\r\n {\r\n if(Kmap[i][j2]==0 || Kmap[i][j2]==-1)\r\n return false;\r\n }\r\n for(int i=0;i<4;i++)\r\n {\r\n Kmap[i][j1]=-1;\r\n }\r\n for(int i=0;i<4;i++)\r\n {\r\n Kmap[i][j2]=-1;\r\n } \r\n return true; \r\n }", "private static Restriction newSingleSlice(CFMetaData cfMetaData, int index, Bound bound, boolean inclusive, ByteBuffer value)\n {\n ColumnDefinition columnDef = getClusteringColumnDefinition(cfMetaData, index);\n return new SingleColumnRestriction.Slice(columnDef, bound, inclusive, toTerm(value));\n }", "public void checkBounds() {\n\t\tfor (int k = 0; k < numDataCols; k++) {\n\t\t\tDashDataType<?> dtype = dataTypes[k];\n\n\t\t\tif ( dtype instanceof StringDashDataType ) {\n\t\t\t\tStringDashDataType strtype = (StringDashDataType) dtype;\n\t\t\t\tfor (int j = 0; j < numSamples; j++) {\n\t\t\t\t\tADCMessage msg = strtype.boundsCheckStandardValue(\n\t\t\t\t\t\t\t\t\t\t\t(String) stdObjects[j][k]);\n\t\t\t\t\tif ( msg != null ) {\n\t\t\t\t\t\tmsg.setRowNumber(j+1);\n\t\t\t\t\t\tmsg.setColNumber(k+1);\n\t\t\t\t\t\tmsg.setColName(userColNames[k]);\n\t\t\t\t\t\tstdMsgList.add(msg);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if ( dtype instanceof CharDashDataType ) {\n\t\t\t\tCharDashDataType chartype = (CharDashDataType) dtype;\n\t\t\t\tfor (int j = 0; j < numSamples; j++) {\n\t\t\t\t\tADCMessage msg = chartype.boundsCheckStandardValue(\n\t\t\t\t\t\t\t\t\t\t\t(Character) stdObjects[j][k]);\n\t\t\t\t\tif ( msg != null ) {\n\t\t\t\t\t\tmsg.setRowNumber(j+1);\n\t\t\t\t\t\tmsg.setColNumber(k+1);\n\t\t\t\t\t\tmsg.setColName(userColNames[k]);\n\t\t\t\t\t\tstdMsgList.add(msg);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if ( dtype instanceof IntDashDataType ) {\n\t\t\t\tIntDashDataType inttype = (IntDashDataType) dtype;\n\t\t\t\tfor (int j = 0; j < numSamples; j++) {\n\t\t\t\t\tADCMessage msg = inttype.boundsCheckStandardValue(\n\t\t\t\t\t\t\t\t\t\t\t(Integer) stdObjects[j][k]);\n\t\t\t\t\tif ( msg != null ) {\n\t\t\t\t\t\tmsg.setRowNumber(j+1);\n\t\t\t\t\t\tmsg.setColNumber(k+1);\n\t\t\t\t\t\tmsg.setColName(userColNames[k]);\n\t\t\t\t\t\tstdMsgList.add(msg);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if ( dtype instanceof DoubleDashDataType ) {\n\t\t\t\tDoubleDashDataType dbltype = (DoubleDashDataType) dtype;\n\t\t\t\tfor (int j = 0; j < numSamples; j++) {\n\t\t\t\t\tADCMessage msg = dbltype.boundsCheckStandardValue(\n\t\t\t\t\t\t\t\t\t\t\t(Double) stdObjects[j][k]);\n\t\t\t\t\tif ( msg != null ) {\n\t\t\t\t\t\tmsg.setRowNumber(j+1);\n\t\t\t\t\t\tmsg.setColNumber(k+1);\n\t\t\t\t\t\tmsg.setColName(userColNames[k]);\n\t\t\t\t\t\tstdMsgList.add(msg);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthrow new IllegalArgumentException(\"unexpected data type encountered \" + \n\t\t\t\t\t\t\"in bounds checking: \" + dtype);\n\t\t\t}\n\t\t}\n\t}", "private int restrictSection(Message msg, String parameter) {\n int sec = Integer.parseInt(parameter);\n\n if(sec > 2) {\n MessageChannel ch = msg.getChannel();\n ch.sendMessage(\"`Error: Invalid query [section not 0-2]. Query terminated.`\").queue();\n return -1;\n }\n else if(sec == 2) {\n partTwo = true;\n upperProblem = 8;\n }\n\n return sec;\n }", "@Test\n public void testFilterPushDown() throws IOException { 'bla' as (x, y);\n // B = load 'morebla' as (a, b);\n // C = join A on x, B on a;\n // D = filter C by x = a and x = 0 and b = 1 and y = b;\n // store D into 'whatever';\n \n // A = load\n LogicalPlan lp = new LogicalPlan();\n {\n \tLogicalSchema aschema = new LogicalSchema();\n \taschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"x\", null, DataType.INTEGER));\n \taschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"y\", null, DataType.INTEGER));\n \taschema.getField(0).uid = 1;\n \taschema.getField(1).uid = 2;\n \tLOLoad A = new LOLoad(new FileSpec(\"bla\", new FuncSpec(\"PigStorage\", \"\\t\")), aschema, lp);\n \tlp.add(A);\n\t \n \t// B = load\n \tLogicalSchema bschema = new LogicalSchema();\n \tbschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"a\", null, DataType.INTEGER));\n \tbschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"b\", null, DataType.INTEGER));\n \tbschema.getField(0).uid = 3;\n \tbschema.getField(1).uid = 4;\n \tLOLoad B = new LOLoad(null, bschema, lp);\n \tlp.add(B);\n\t \n \t// C = join\n \tLogicalSchema cschema = new LogicalSchema();\n \tcschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"x\", null, DataType.INTEGER));\n \tcschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"y\", null, DataType.INTEGER));\n \tcschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"a\", null, DataType.INTEGER));\n \tcschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"b\", null, DataType.INTEGER));\n \tcschema.getField(0).uid = 1;\n \tcschema.getField(1).uid = 2;\n \tcschema.getField(2).uid = 3;\n \tcschema.getField(3).uid = 4;\n \tLogicalExpressionPlan aprojplan = new LogicalExpressionPlan();\n \tProjectExpression x = new ProjectExpression(aprojplan, DataType.INTEGER, 0, 0);\n \tx.neverUseForRealSetUid(1);\n \tLogicalExpressionPlan bprojplan = new LogicalExpressionPlan();\n \tProjectExpression y = new ProjectExpression(bprojplan, DataType.INTEGER, 1, 0);\n \ty.neverUseForRealSetUid(3);\n \tMultiMap<Integer, LogicalExpressionPlan> mm = \n \tnew MultiMap<Integer, LogicalExpressionPlan>();\n \tmm.put(0, aprojplan);\n \tmm.put(1, bprojplan);\n \tLOJoin C = new LOJoin(lp, mm, JOINTYPE.HASH, new boolean[] {true, true});\n \tC.neverUseForRealSetSchema(cschema);\n \tlp.add(C);\n \tlp.connect(A, C);\n \tlp.connect(B, C);\n \n \t// D = filter\n \tLogicalExpressionPlan filterPlan = new LogicalExpressionPlan();\n \tProjectExpression fx = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 0);\n \tfx.neverUseForRealSetUid(1);\n \tConstantExpression fc0 = new ConstantExpression(filterPlan, DataType.INTEGER, new Integer(0));\n \tEqualExpression eq1 = new EqualExpression(filterPlan, fx, fc0);\n \tProjectExpression fanotherx = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 0);\n \tfanotherx.neverUseForRealSetUid(1);\n \tProjectExpression fa = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 2);\n \tfa.neverUseForRealSetUid(3);\n \tEqualExpression eq2 = new EqualExpression(filterPlan, fanotherx, fa);\n \tAndExpression and1 = new AndExpression(filterPlan, eq1, eq2);\n \tProjectExpression fb = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 3);\n \tfb.neverUseForRealSetUid(4);\n \tConstantExpression fc1 = new ConstantExpression(filterPlan, DataType.INTEGER, new Integer(1));\n \tEqualExpression eq3 = new EqualExpression(filterPlan, fb, fc1);\n \tAndExpression and2 = new AndExpression(filterPlan, and1, eq3);\n \tProjectExpression fanotherb = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 3);\n \tfanotherb.neverUseForRealSetUid(4);\n \tProjectExpression fy = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 1);\n \tfy.neverUseForRealSetUid(2);\n \tEqualExpression eq4 = new EqualExpression(filterPlan, fy, fanotherb);\n \tnew AndExpression(filterPlan, and2, eq4);\n \n \tLOFilter D = new LOFilter(lp, filterPlan);\n \tD.neverUseForRealSetSchema(cschema);\n \t// Connect D to B, since the transform has happened.\n \tlp.add(D);\n \tlp.connect(C, D);\n }\n \n LogicalPlanOptimizer optimizer = new LogicalPlanOptimizer(lp, 500);\n optimizer.optimize();\n \n LogicalPlan expected = new LogicalPlan();\n {\n // A = load\n \tLogicalSchema aschema = new LogicalSchema();\n \taschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"x\", null, DataType.INTEGER));\n \taschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"y\", null, DataType.INTEGER));\n \taschema.getField(0).uid = 1;\n \taschema.getField(1).uid = 2;\n \tLOLoad A = new LOLoad(new FileSpec(\"bla\", new FuncSpec(\"PigStorage\", \"\\t\")), aschema, expected);\n \texpected.add(A);\n \t\n \t// DA = filter\n \tLogicalExpressionPlan DAfilterPlan = new LogicalExpressionPlan();\n \tProjectExpression fx = new ProjectExpression(DAfilterPlan, DataType.INTEGER, 0, 0);\n \tfx.neverUseForRealSetUid(1);\n \tConstantExpression fc0 = new ConstantExpression(DAfilterPlan, DataType.INTEGER, new Integer(0));\n \tnew EqualExpression(DAfilterPlan, fx, fc0);\n\t \n \tLOFilter DA = new LOFilter(expected, DAfilterPlan);\n \tDA.neverUseForRealSetSchema(aschema);\n \texpected.add(DA);\n \texpected.connect(A, DA);\n\t \n \t// B = load\n \tLogicalSchema bschema = new LogicalSchema();\n \tbschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"a\", null, DataType.INTEGER));\n \tbschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"b\", null, DataType.INTEGER));\n \tbschema.getField(0).uid = 3;\n \tbschema.getField(1).uid = 4;\n \tLOLoad B = new LOLoad(null, bschema, expected);\n \texpected.add(B);\n \t\n \t// DB = filter\n \tLogicalExpressionPlan DBfilterPlan = new LogicalExpressionPlan();\n \tProjectExpression fb = new ProjectExpression(DBfilterPlan, DataType.INTEGER, 0, 1);\n \tfb.neverUseForRealSetUid(4);\n \tConstantExpression fc1 = new ConstantExpression(DBfilterPlan, DataType.INTEGER, new Integer(1));\n \tnew EqualExpression(DBfilterPlan, fb, fc1);\n\t \n \tLOFilter DB = new LOFilter(expected, DBfilterPlan);\n \tDB.neverUseForRealSetSchema(bschema);\n \texpected.add(DB);\n \texpected.connect(B, DB);\n\t \n \t// C = join\n \tLogicalSchema cschema = new LogicalSchema();\n \tcschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"x\", null, DataType.INTEGER));\n \tcschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"y\", null, DataType.INTEGER));\n \tcschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"a\", null, DataType.INTEGER));\n \tcschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"b\", null, DataType.INTEGER));\n \tcschema.getField(0).uid = 1;\n \tcschema.getField(1).uid = 2;\n \tcschema.getField(2).uid = 3;\n \tcschema.getField(3).uid = 4;\n \tLogicalExpressionPlan aprojplan = new LogicalExpressionPlan();\n \tProjectExpression x = new ProjectExpression(aprojplan, DataType.INTEGER, 0, 0);\n \tx.neverUseForRealSetUid(1);\n \tLogicalExpressionPlan bprojplan = new LogicalExpressionPlan();\n \tProjectExpression y = new ProjectExpression(bprojplan, DataType.INTEGER, 1, 0);\n \ty.neverUseForRealSetUid(3);\n \tMultiMap<Integer, LogicalExpressionPlan> mm = \n \tnew MultiMap<Integer, LogicalExpressionPlan>();\n \tmm.put(0, aprojplan);\n \tmm.put(1, bprojplan);\n \tLOJoin C = new LOJoin(expected, mm, JOINTYPE.HASH, new boolean[] {true, true});\n \tC.neverUseForRealSetSchema(cschema);\n \texpected.add(C);\n \texpected.connect(DA, C);\n \texpected.connect(DB, C);\n\t \n \t// D = filter\n \tLogicalExpressionPlan filterPlan = new LogicalExpressionPlan();\n \tProjectExpression fanotherx = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 0);\n \tfanotherx.neverUseForRealSetUid(1);\n \tProjectExpression fa = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 2);\n \tfa.neverUseForRealSetUid(3);\n \tEqualExpression eq2 = new EqualExpression(filterPlan, fanotherx, fa);\n \tProjectExpression fanotherb = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 3);\n \tfanotherb.neverUseForRealSetUid(4);\n \tProjectExpression fy = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 1);\n \tfy.neverUseForRealSetUid(2);\n \tEqualExpression eq4 = new EqualExpression(filterPlan, fy, fanotherb);\n \tnew AndExpression(filterPlan, eq2, eq4);\n\t \n \tLOFilter D = new LOFilter(expected, filterPlan);\n \tD.neverUseForRealSetSchema(cschema);\n \texpected.add(D);\n \texpected.connect(C, D);\n }\n \n assertTrue( lp.isEqual(expected) );\n // assertEquals(lp, expected);\n }", "List<Collect> selectByExampleWithRowbounds(CollectExample example, RowBounds rowBounds);", "private static <T> int med3(T x[], Comparator<T> comp, int a, int b, int c) {\n\t\treturn (comp.compare(x[a],x[b])<0 ?\n\t\t\t\t(comp.compare(x[b],x[c])<0 ? b : comp.compare(x[a],x[c])<0 ? c : a) :\n\t\t\t\t\t(comp.compare(x[b],x[c])>0 ? b : comp.compare(x[a],x[c])>0 ? c : a));\n\t}", "private ArrayList<Integer> coverSatisfiedColumns(boolean[] ecmCoveredCols, int rowIndex)\n {\n ArrayList<Integer> coveredCols = new ArrayList<>();\n for(int j = 0; j < dimSquared * CONSTRAINTS; j++)\n {\n if(ecMatrix[rowIndex][j])\n {\n ecmCoveredCols[j] = true;\n coveredCols.add(j);\n }\n }\n return coveredCols;\n }", "static boolean isSubset(int Tab1[], int Tab2[], int m, int n)\n {\n // compléter\n //Trouver le max de Tab1[]\n int max=Tab1[0];\n for(int i = 1; i < m; i++) {\n\t\t\tif (Tab1[i]>max){\n max=Tab1[i];\n }\n\t\t}\n \n\t\t//Stockage de la Tab1 dans une table de hashage\n\t\tint[] hashTable = new int[max];\n\t\tfor(int i = 0; i < m; i++) {\n\t\t\thashTable[hash(Tab1[i], max)] = Tab1[i];\n\t\t}\n\t\t\n\t\t//verifier que chaque element (de Tab2) existe dans la hashtable\n\t\tfor(int j = 0; j < n; j++) {\n\t\t\tif(Tab2[j] != hashTable[hash(Tab2[j], max)]) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t}\n return true;\n \n //Complexite aymptotique :\n /*\n Puisque la boucle qui a le plus d'itérations est celle avec l'élément m, la compléxité\n asymptotique est O(m).\n f(m,n) = 2m + n = O(m), puisque m > n\n */\n \n\n }", "public abstract Optional<GridAxis> subsetDependent(GridAxis1D subsetIndAxis, Formatter errlog);", "public static void main(String[]args){\n\r\n int []arr = new int[100];\r\n int []arr2 = new int[50];\r\n int []arr3 = {1,2,3,4,5,6,7,8};\r\n int number = 5;\r\n LogicalOp op = new LogicalOp();\r\n// op.writeOnArray(arr);\r\n\r\n// arr2 = op.evenArray(arr2);\r\n// for(int i=0;i<arr2.length;i++)\r\n// System.out.println(arr2[i]);\r\n\r\n //System.out.println(\"Mean value: \"+op.meanValue(arr3));\r\n\r\n// String[] arrOfStr = {\"ana\",\"are\",\"mere\",\"pere\",\"mere\"};\r\n// String str = \"mere\";\r\n// System.out.println(op.isContaingString(arrOfStr,str));\r\n\r\n// System.out.println(op.findPosition(arr3,number));\r\n\r\n //op.displayLines();\r\n\r\n// int[]modifArr = op.modifiedArr(arr3,number);\r\n// for(int item: modifArr)\r\n// System.out.print(item+\" \");\r\n\r\n\r\n //System.out.println(\"Second minimum: \"+op.secondMin(arr3));\r\n\r\n int[] empty = new int[arr3.length];\r\n empty = op.populateArray(arr3,empty);\r\n for(int item:empty)\r\n System.out.print(item+\" \");\r\n\r\n\r\n\r\n }", "public void testGetColumnIndex() {\n TaskSeriesCollection c = createCollection1();\n }", "private List<Set<BitSet>> buildPFunction(boolean[][] table, boolean[] coveredMinterms) {\n\n\t\tList<Set<BitSet>> pFunction = new ArrayList<>();\n\n\t\tfor (int i = 0; i < coveredMinterms.length; i++) {\n\n\t\t\tSet<BitSet> currentColumn = new LinkedHashSet<>();\n\n\t\t\tfor (int j = 0; j < table.length; j++) {\n\n\t\t\t\tif (table[j][i] && !coveredMinterms[i]) {\n\t\t\t\t\tBitSet current = new BitSet();\n\t\t\t\t\tcurrent.set(j);\n\t\t\t\t\tcurrentColumn.add(current);\n\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (currentColumn.size() > 0) {\n\t\t\t\tpFunction.add(currentColumn);\n\t\t\t}\n\t\t}\n\t\treturn pFunction;\n\t}", "protected void checkSlice(int slice) {\n\tif (slice < 0 || slice >= slices) throw new IndexOutOfBoundsException(\"Attempted to access \"+toStringShort()+\" at slice=\"+slice);\n}", "public boolean percolates() {\n\t\tint top = uf.find(0);\n\t\tint bottom = uf.find(size * size + 1);\n\t\treturn top == bottom;\n\t}", "default DiscreteSet2D subLevelSet(double value) {\r\n\t\treturn pointsSatisfying(d -> d <= value);\r\n\t}", "@Test\n \tpublic void whereClauseForNodeLeftOverlap() {\n \t\tnode23.addJoin(new LeftOverlap(node42));\n \t\tcheckWhereCondition(\n \t\t\t\tjoin(\"=\", \"_node23.text_ref\", \"_node42.text_ref\"),\n \t\t\t\tjoin(\"<=\", \"_node23.left\", \"_node42.left\"),\n \t\t\t\tjoin(\"<=\", \"_node42.left\", \"_node23.right\"),\n \t\t\t\tjoin(\"<=\", \"_node23.right\", \"_node42.right\")\n \t\t);\n \t}", "private Boolean isValidColumnMatrix(SimpleMatrix matrix) {\n\t\tInteger nrows = matrix.numRows();\n\t\tInteger ncols = matrix.numCols();\n\n\t\treturn (ncols == 1) && (nrows == 3);\n\t}", "Condition(Column col1, String relation, Column col2) {\n // YOUR CODE HERE\n }", "boolean hasPivot();", "@Test void firstRow1and2() {\n\t\tcheckFirstRow1and2(false,5,4);\n\n\t\t// X X X X\n\t\t// X X X X X\n\t\tcheckFirstRow1and2(true,4,5);\n\n\t\t// X\n\t\t// x\n\t\tcheckFirstRow1and2(false,1,1);\n\n\t\t// X\n\t\t// x\n\t\tcheckFirstRow1and2(true,1,1);\n\t}", "public void testNestedComputedColumn( ) throws Exception\n \t{\n \t\tccName = new String[] { \"cc1\", \"cc2\", \"cc3\" };\n \t\tccExpr = new String[] {\n \t\t\t\t\"row.COL0+row.COL1\",\n \t\t\t\t\"row.cc1*100\",\n \t\t\t\t\"Total.runningSum(row.cc1/Total.sum(row.cc1))*100\" };\n \n \t\tfor (int i = 0; i < ccName.length; i++) {\n \t\t\tComputedColumn computedColumn = new ComputedColumn(ccName[i],\n \t\t\t\t\tccExpr[i], DataType.ANY_TYPE);\n \t\t\t((BaseDataSetDesign) this.dataSet)\n \t\t\t\t\t.addComputedColumn(computedColumn);\n \t\t}\n \t\t\n \t\tString[] bindingNameRow = new String[7];\n \t\tbindingNameRow[0] = \"ROW_COL0\";\n \t\tbindingNameRow[1] = \"ROW_COL1\";\n \t\tbindingNameRow[2] = \"ROW_COL2\";\n \t\tbindingNameRow[3] = \"ROW_COL3\";\n \t\tbindingNameRow[4] = \"ROW_cc1\";\n \t\tbindingNameRow[5] = \"ROW_cc2\";\n \t\tbindingNameRow[6] = \"ROW_cc3\";\n \t\tScriptExpression[] bindingExprRow = new ScriptExpression[] {\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL0\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL1\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL2\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL3\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + ccName[0], 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + ccName[1], 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + ccName[2], 0) };\n \n \t\tIResultIterator resultIt = this.executeQuery(this.createQuery(null,\n \t\t\t\tnull, null, null, null, null, null, null, null, bindingNameRow,\n \t\t\t\tbindingExprRow));\n \n \t\tprintResult(resultIt, bindingNameRow, bindingExprRow);\n \t\t// assert\n \t\tcheckOutputFile();\n \t\t\n \t}", "private List<Integer> chooseInnerModelFeatureColumns(Matrix inputs, Matrix labels)\n\t{\n\t\tMatrix inputsShuffled = new Matrix(inputs);\n\t\tMatrix labelsShuffled = new Matrix(labels);\n\t\tinputs = null;\n\t\tlabels = null;\n\t\tinputsShuffled.shuffle(rand, labelsShuffled);\n\n\t\tMatrix[] sets = createValidationSet(inputsShuffled, labelsShuffled, validationSetPercent);\n\t\tMatrix tInputs = sets[0];\n\t\tMatrix tLabels = sets[1];\n\t\tMatrix vInputs = sets[2];\n\t\tMatrix vLabels = sets[3];\n\n\t\t// Greedily search for the best columns to train model i on.\n\t\t\t\n\t\tList<Integer> keepColumns = new ArrayList<>(featureColumnsToAlwaysUse);\n\t\t\n\t\tdouble lastIterationScore;\n\t\tif (featureColumnsToAlwaysUse.isEmpty())\n\t\t{\n\t\t\tlastIterationScore = Double.NEGATIVE_INFINITY;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tSupervisedLearner initialModel = trainOnColumns(tInputs, tLabels, keepColumns);\n\t\t\tlastIterationScore = validateOnColumns(vInputs, vLabels, keepColumns, initialModel);\n\t\t}\n\t\t\n\t\tLogger.println(\"initial lastIterationScore: \" + lastIterationScore);\n\t\t\n\t\tList<Integer> featureSelectionCols = Helper.iteratorToList(new Range(tInputs.cols()));\n\t\tfeatureSelectionCols.removeAll(featureColumnsToAlwaysUse);\n\t\t\n\t\twhile (!featureSelectionCols.isEmpty())\n\t\t{\n\t\t\t// Find the feature selection column which helps the model the most.\n\t\t\tTuple2<Integer, Double> bestTuple = featureSelectionCols.stream()\n\t\t\t\t\t.map(c -> \n\t\t\t\t\t{\n\t\t\t\t\t\tList<Integer> columns = new ArrayList<>(keepColumns);\n\t\t\t\t\t\tcolumns.add(c);\n\t\t\t\t\t\tSupervisedLearner model = trainOnColumns(tInputs, tLabels, columns);\n\t\t\t\t\t\tdouble score = validateOnColumns(vInputs, vLabels, columns, model);\n\t\t\t\t\t\treturn new Tuple2<Integer, Double>(c, score);\n\t\t\t\t\t})\n\t\t\t\t\t.max((t1, t2) -> Double.compare(t1.getSecond(), t2.getSecond())).get();\n\n\t\t\tif (bestTuple.getSecond() > lastIterationScore)\n\t\t\t{\n\t\t\t\tLogger.println(\"Keeping column \" + bestTuple.getFirst() + \", new score: \" + bestTuple.getSecond());\n\t\t\t\tkeepColumns.add(bestTuple.getFirst());\n\t\t\t\tfeatureSelectionCols.remove(bestTuple.getFirst());\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tlastIterationScore = bestTuple.getSecond();\n\t\t}\n\t\t\n\t\treturn keepColumns;\n\t}", "public void testGetSubDimensionality()\n {\n RandomSubVectorThresholdLearner<String> instance = new RandomSubVectorThresholdLearner<String>();\n\n instance.setPercentToSample(0.5);\n assertEquals(5, instance.getSubDimensionality(10));\n\n instance.setPercentToSample(0.25);\n assertEquals(2, instance.getSubDimensionality(9));\n\n instance.setPercentToSample(1.0);\n assertEquals(9, instance.getSubDimensionality(9));\n\n instance.setPercentToSample(0.0);\n assertEquals(1, instance.getSubDimensionality(9));\n }", "public List<Integer> selectRangeWherePar(byte[][] selectCols, byte[] whereCol, long value1, long value2, ResultSet result){\n List<Integer> oidList = new ArrayList<Integer>();\n \n //assuming the where col is in type LONG\n boolean[] access = new boolean[keyForLong.length];\n int whereIndex = -1;\n \n for(int i = 0; i < keyForLong.length; i++){\n if(keyForLong[i].equals( new String(whereCol) + separator + \"LONG\" )) whereIndex = i;\n \n access[i] = false;\n for(int j = 0; j < selectCols.length; j++){\n if(keyForLong[i].equals( new String(selectCols[j]) + separator + \"LONG\" )){\n access[i] = true;\n break;\n }\n }\n }\n \n int numOfFields = keyForLong.length;\n for(int i = 0; i < numObject; i++){\n //first check if this object meet the where condition\n long value = longValues[i*numOfFields + whereIndex];\n if( (value >= value1) && (value <= value2)){\n //this object meets condition\n int oid=objectIds[i];\n oidList.add(oid);\n \n //select fields in the select clause\n for(int j = 0; j < access.length; j++){\n if(access[j]){\n String key = keyForLong[j];\n if(j == whereIndex){\n result.addLong(key, oid, value);\n continue;\n }\n long longnum = longValues[i*numOfFields + j];\n if(longnum != UNDEFINED)\n result.addLong(key, oid, longnum);\n }\n }\n }\n }\n \n if(oidList.size() > 0){\n //if this partition also has other data types, also select those based on oidList\n if(keyForString.length != 0)\n selectConditionString(oidList, selectCols, result);\n if(keyForDouble.length != 0)\n selectConditionDouble(oidList, selectCols, result);\n if(keyForBool.length != 0)\n selectConditionBool(oidList, selectCols, result);\n }\n return oidList;\n }", "private boolean checkOverlap(int row, int col, int length){\n \tif(!inBounds(row,col)){\n \t\treturn false;\n \t}\n \tfor(int i = row; i < row + length; i++ ){\n\t\t\tfor(int j = col; j < col + length; j++){\n\t\t\t\tif(grid[i][col] == 1 || row + length >= 10)\n\t\t\t\t\treturn false;\n\t\t\t\tif(grid[row][j] == 1 || col + length >= 10)\n\t\t\t\t\treturn false;\n\t\t\t}\n \t\t\n \t}\n \treturn true;\n }", "private int adequateDimensions(int cols, int rows) {\r\n\r\n if ((cols >= MINALG) && (cols <= MAXALG)) {\r\n if ((rows >= MINDATA) && (rows <= MAXDATA)) {\r\n return 0;\r\n } else {\r\n return 1;\r\n }\r\n } else {\r\n return 2;\r\n }\r\n\r\n }", "@Test\n void testSubset() throws IOException {\n Long expectedNumberOfVariables = 13L;\n Long expectedNumberOfCases = 24L; // aka the number of lines in the TAB file produced by the ingest plugin\n\n TabularDataIngest ingestResult;\n File file = getFile(\"csv/ingest/election_precincts.csv\");\n try (BufferedInputStream stream = new BufferedInputStream(new FileInputStream(file))) {\n CSVFileReader instance = createInstance();\n ingestResult = instance.read(Tuple.of(stream, file), null);\n }\n\n File generatedTabFile = ingestResult.getTabDelimitedFile();\n DataTable generatedDataTable = ingestResult.getDataTable();\n\n assertThat(generatedDataTable).isNotNull();\n assertThat(generatedDataTable.getDataVariables()).isNotNull();\n assertThat(generatedDataTable.getVarQuantity()).isEqualTo((long) generatedDataTable.getDataVariables().size());\n assertThat(generatedDataTable.getVarQuantity()).isEqualTo(expectedNumberOfVariables);\n assertThat(generatedDataTable.getCaseQuantity()).isEqualTo(expectedNumberOfCases);\n\n // And now let's try and subset the individual vectors\n // First, the \"continuous\" vectors (we should be able to read these as Double[]):\n int[] floatColumns = {2};\n\n Double[][] floatVectors = {\n { 1.0, 3.0, 4.0, 6.0, 7.0, 8.0, 11.0, 12.0, 76.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0 },\n };\n\n IngestDataProvider dataProvider = new InMemoryIngestDataProvider();\n dataProvider.initialize(generatedDataTable, generatedTabFile);\n\n int vectorCount = 0;\n for (int i : floatColumns) {\n // We'll be subsetting the column vectors one by one, re-opening the\n // file each time. Inefficient - but we don't care here.\n\n if (!generatedDataTable.getDataVariables().get(i).isIntervalContinuous()) {\n fail(\"Column \" + i + \" was not properly processed as \\\"continuous\\\"\");\n }\n\n Double[] columnVector = dataProvider.getDoubleColumn(i);\n\n assertThat(columnVector).isEqualTo(floatVectors[vectorCount++]);\n }\n\n // Discrete Numerics (aka, integers):\n int[] integerColumns = { 1, 4, 6, 7, 8, 9, 10, 11, 12 };\n\n Long[][] longVectors = {\n { 1L, 3L, 4L, 6L, 7L, 8L, 11L, 12L, 76L, 77L, 77L, 77L, 77L, 77L, 77L, 77L, 77L, 77L, 77L, 77L, 77L, 77L, 77L, 77L },\n { 1L, 2L, 3L, 4L, 5L, 11L, 13L, 15L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L },\n { 85729227L, 85699791L, 640323976L, 85695847L, 637089796L, 637089973L, 85695001L, 85695077L, 1111111L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L },\n { 205871733L, 205871735L, 205871283L, 258627915L, 257444575L, 205871930L, 260047422L, 262439738L, 1111111L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L },\n { 205871673L, 205871730L, 205871733L, 205872857L, 258627915L, 257444584L, 205873413L, 262439738L, 1111111L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L },\n { 25025000201L, 25025081001L, 25025000701L, 25025050901L, 25025040600L, 25025000502L, 25025040401L, 25025100900L, 1111111L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L },\n { 250250502002L, 250250502003L, 250250501013L, 250250408011L, 250250503001L, 250250103001L, 250250406002L, 250250406001L, 1111111L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L },\n { 250251011024001L, 250251011013003L, 250251304041007L, 250251011013006L, 250251010016000L, 250251011024002L, 250251001005004L, 250251002003002L, 1111111L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L },\n { 2109L, 2110L, 2111L, 2120L, 2121L, 2115L, 2116L, 2122L, 11111L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L }\n };\n\n vectorCount = 0;\n\n for (int i : integerColumns) {\n if (!generatedDataTable.getDataVariables().get(i).isIntervalDiscrete()\n || !generatedDataTable.getDataVariables().get(i).isTypeNumeric()) {\n fail(\"Column \" + i + \" was not properly processed as \\\"discrete numeric\\\"\");\n }\n\n Long[] columnVector = dataProvider.getLongColumn(i);\n\n assertThat(columnVector).isEqualTo(longVectors[vectorCount++]);\n }\n\n // And finally, Strings:\n int[] stringColumns = {0, 3, 5};\n\n String[][] stringVectors = {\n { \"Dog\", \"Squirrel\", \"Antelope\", \"Zebra\", \"Lion\", \"Gazelle\", \"Cat\", \"Giraffe\", \"Cat\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\" },\n { \"East Boston\", \"Charlestown\", \"South Boston\", \"Bronx\", \"Roslindale\", \"Mission Hill\", \"Jamaica Plain\", \"Hyde Park\", \"Fenway/Kenmore\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\" },\n { \"2-06\", \"1-09\", \"1-1A\", \"1-1B\", \"2-04\", \"3-05\", \"1-1C\", \"1-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", }\n };\n\n vectorCount = 0;\n\n for (int i : stringColumns) {\n if (!generatedDataTable.getDataVariables().get(i).isTypeCharacter()) {\n fail(\"Column \" + i + \" was not properly processed as a character vector\");\n }\n String[] columnVector = dataProvider.getStringColumn(i);\n\n assertThat(columnVector).isEqualTo(stringVectors[vectorCount++]);\n }\n }", "public boolean colision(Nave nave) {\r\n\t\t\r\n\t\tint[] arrayY = cargarPuntoColisionY();\r\n\t\tint[] arrayX = cargarPuntoColisionX();\r\n\t\tboolean A,B,C,D,E,F,G,H;\r\n\t\tboolean fColision = false;\r\n\t\tint i = 0;\r\n\t\t\r\n\t\twhile(i + 1 < arrayY.length && !fColision){\r\n\t\t\r\n\t\t\tA = x + arrayX[i] >= nave.getX();\r\n\t\t\tB = x + arrayX[i] <= (nave.getX() + nave.getWidth());\r\n\t\t\tC = y + arrayY[i] >= nave.getY();\r\n\t\t\tD = y + arrayY[i] <= (nave.getY() + nave.getHeight());\r\n\t\t\tE = (x + arrayX[i+1]) >= nave.getX();\r\n\t\t\tF = (x + arrayX[i+1]) <= (nave.getX() + nave.getWidth());\r\n\t\t\tG = (y + arrayY[i+1]) >= nave.getY();\r\n\t\t\tH = (y + arrayY[i+1]) <= (nave.getY() + nave.getHeight());\r\n\t\t\r\n\t\t\t// funcion de colicion que verifica si uno o mas puntos del borde del objeto nave intersectan con el borde del objeto que ejecuta la funcion\r\n\t\t\tfColision = fColision || (A && B || E && F) && (C && D || G && H) || !A && !F && ( !H && D || G && H) || !C && !H && (B && !F || !A && E);\r\n\t\t\ti = i+2;\r\n\t\t}\r\n\t\t\r\n\t\treturn getVisible() && nave.getVisible() && fColision;\r\n\t\t\t\r\n\t\t\t\t\r\n\t}" ]
[ "0.7212001", "0.7167793", "0.71507007", "0.7104244", "0.7052053", "0.6614333", "0.6565695", "0.64538974", "0.64523757", "0.644347", "0.6412511", "0.60852253", "0.59282017", "0.56765765", "0.559908", "0.55776674", "0.5568619", "0.5541887", "0.5361187", "0.5167763", "0.5035255", "0.501875", "0.5002686", "0.49838465", "0.49649334", "0.49371204", "0.49076685", "0.48965868", "0.48918822", "0.48767054", "0.4864422", "0.4841228", "0.4834648", "0.48322648", "0.4816473", "0.48138028", "0.48029467", "0.4798501", "0.47943", "0.47896436", "0.47820926", "0.4773607", "0.4773365", "0.47551632", "0.47390673", "0.4723628", "0.46715382", "0.46611652", "0.4652557", "0.46382156", "0.46353957", "0.46319073", "0.46289092", "0.46191555", "0.4614909", "0.45883846", "0.4582881", "0.45801142", "0.45790955", "0.45757455", "0.45692745", "0.45673436", "0.45662358", "0.45620304", "0.45615527", "0.45501605", "0.45415592", "0.45398095", "0.45266333", "0.45243743", "0.45129636", "0.45102346", "0.45015383", "0.44962698", "0.44760883", "0.44723013", "0.44651237", "0.44607168", "0.4456398", "0.44523016", "0.4447113", "0.4446311", "0.44360194", "0.44258752", "0.44196752", "0.44186082", "0.44181994", "0.44141936", "0.44074902", "0.44070047", "0.44035658", "0.4397024", "0.43898305", "0.43893045", "0.43877447", "0.4383799", "0.43799007", "0.43789756", "0.43781006", "0.4377362" ]
0.7181936
1
Test multicolumn slice restrictions with 1 descending clustering column and 1 ascending (e.g '(clustering_0, clustering_1) > (1, 2)')
@Test public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneAscendingAndOneDescendingClusteringColumns() { CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.DESC); ByteBuffer value1 = ByteBufferUtil.bytes(1); ByteBuffer value2 = ByteBufferUtil.bytes(2); // (clustering_0, clustering1) > (1, 2) Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2); PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(slice); List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(2, bounds.size()); assertComposite(bounds.get(0), value1, EOC.START); assertComposite(bounds.get(1), value1, EOC.END); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(2, bounds.size()); assertComposite(bounds.get(0), value1, value2, EOC.START); assertEmptyComposite(bounds.get(1)); // (clustering_0, clustering1) >= (1, 2) slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2); restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(slice); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(2, bounds.size()); assertComposite(bounds.get(0), value1, EOC.START); assertComposite(bounds.get(1), value1, EOC.END); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(2, bounds.size()); assertComposite(bounds.get(0), value1, value2, EOC.END); assertEmptyComposite(bounds.get(1)); // (clustering_0, clustering1) <= (1, 2) slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2); restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(slice); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(2, bounds.size()); assertEmptyComposite(bounds.get(0)); assertComposite(bounds.get(1), value1, value2, EOC.NONE); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(2, bounds.size()); assertComposite(bounds.get(0), value1, EOC.START); assertComposite(bounds.get(1), value1, EOC.END); // (clustering_0, clustering1) < (1, 2) slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2); restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(slice); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(2, bounds.size()); assertEmptyComposite(bounds.get(0)); assertComposite(bounds.get(1), value1, value2, EOC.END); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(2, bounds.size()); assertComposite(bounds.get(0), value1, EOC.START); assertComposite(bounds.get(1), value1, EOC.END); // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2) slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2); Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2); restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(slice).mergeWith(slice2); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(2, bounds.size()); assertComposite(bounds.get(0), value1, EOC.START); assertComposite(bounds.get(1), value1, EOC.END); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(2, bounds.size()); assertComposite(bounds.get(0), value1, value2, EOC.START); assertComposite(bounds.get(1), value2, EOC.START); // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1) slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2); slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1); restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(slice).mergeWith(slice2); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(3, bounds.size()); assertComposite(bounds.get(0), value1, EOC.START); assertComposite(bounds.get(1), value1, EOC.END); assertComposite(bounds.get(2), value2, value1, EOC.NONE); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(3, bounds.size()); assertComposite(bounds.get(0), value1, value2, EOC.END); assertComposite(bounds.get(1), value2, EOC.START); assertComposite(bounds.get(2), value2, EOC.END); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneDescendingAndOneAscendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0) > (1) AND (clustering_0, clustering1) < (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.END);\n assertComposite(bounds.get(2), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.END);\n assertComposite(bounds.get(1), value1, EOC.START);\n assertComposite(bounds.get(2), value1, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithTwoAscendingAndTwoDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.DESC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertEmptyComposite(bounds.get(1));\n\n // clustering_0 = 1 AND (clustering_1, clustering_2, clustering_3) > (2, 3, 4)\n Restriction eq = newSingleEq(cfMetaData, 0, value1);\n slice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n restrictions = restrictions.mergeWith(eq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2, clustering_3) > (2, 3, 4)\n Restriction in = newSingleIN(cfMetaData, 0, value1, value2);\n slice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n restrictions = restrictions.mergeWith(in);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n assertComposite(bounds.get(2), value2, value2, EOC.START);\n assertComposite(bounds.get(3), value2, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n assertComposite(bounds.get(2), value2, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(3), value2, EOC.END);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1, clustering_2, clustering_3) <= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) < (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4) AND (clustering_0, clustering_1) < (2, 3)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2, value3);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(1), value2, value3, EOC.START);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4) AND (clustering_0, clustering1, clustering_2, clustering_3) <= (4, 3, 2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value4, value3, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n assertComposite(bounds.get(2), value4, value3, value2, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(1), value4, value3, EOC.START);\n assertComposite(bounds.get(2), value4, value3, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsMixingAscendingDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.DESC, Sort.ASC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(3));\n\n // clustering_0 = 1 AND (clustering_1, clustering_2, clustering_3) > (2, 3, 4)\n Restriction eq = newSingleEq(cfMetaData, 0, value1);\n slice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n restrictions = restrictions.mergeWith(eq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(3));\n\n\n // (clustering_0, clustering1, clustering_2, clustering_3) <= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, value4, EOC.NONE);\n assertComposite(bounds.get(3), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) < (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(3), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4) AND (clustering_0, clustering_1) < (2, 3)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2, value3);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(5, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n assertComposite(bounds.get(4), value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(5, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertComposite(bounds.get(3), value2, EOC.START);\n assertComposite(bounds.get(4), value2, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4) AND (clustering_0, clustering1, clustering_2, clustering_3) <= (4, 3, 2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value4, value3, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(7, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n assertComposite(bounds.get(4), value4, value3, EOC.START);\n assertComposite(bounds.get(5), value4, value3, value2, value1, EOC.NONE);\n assertComposite(bounds.get(6), value4, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(7, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertComposite(bounds.get(3), value4, EOC.START);\n assertComposite(bounds.get(4), value4, value3, value2, EOC.START);\n assertComposite(bounds.get(5), value4, value3, value2, EOC.END);\n assertComposite(bounds.get(6), value4, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithTwoDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithTwoClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneDescendingClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithSliceRestrictionsAndOneDescendingClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newSingleSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newSingleSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithSliceRestrictionsAndOneClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newSingleSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newSingleSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiEqAndSingleSliceRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n\n // (clustering_0, clustering_1) = (1, 2) AND clustering_2 > 3\n Restriction multiEq = newMultiEq(cfMetaData, 0, value1, value2);\n Restriction singleSlice = newSingleSlice(cfMetaData, 2, Bound.START, false, value3);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiEq).mergeWith(singleSlice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithSingleEqAndSliceRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n ByteBuffer value5 = ByteBufferUtil.bytes(5);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) > (2, 3)\n Restriction singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction multiSlice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiSlice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) > (2, 3) AND (clustering_1) < (4)\n singleEq = newSingleEq(cfMetaData, 0, value1);\n multiSlice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3);\n Restriction multiSlice2 = newMultiSlice(cfMetaData, 1, Bound.END, false, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiSlice2).mergeWith(singleEq).mergeWith(multiSlice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value4, EOC.START);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) => (2, 3) AND (clustering_1, clustering_2) <= (4, 5)\n singleEq = newSingleEq(cfMetaData, 0, value1);\n multiSlice = newMultiSlice(cfMetaData, 1, Bound.START, true, value2, value3);\n multiSlice2 = newMultiSlice(cfMetaData, 1, Bound.END, true, value4, value5);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiSlice2).mergeWith(singleEq).mergeWith(multiSlice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value4, value5, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithOneEqRestrictionsAndTwoClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer clustering_0 = ByteBufferUtil.bytes(1);\n Restriction eq = newSingleEq(cfMetaData, 0, clustering_0);\n\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithOneEqRestrictionsAndOneClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC);\n\n ByteBuffer clustering_0 = ByteBufferUtil.bytes(1);\n Restriction eq = newSingleEq(cfMetaData, 0, clustering_0);\n\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithSingleEqAndMultiEqRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) = (2, 3)\n Restriction singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction multiEq = newMultiEq(cfMetaData, 1, value2, value3);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiEq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n // clustering_0 = 1 AND clustering_1 = 2 AND (clustering_2, clustering_3) = (3, 4)\n singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction singleEq2 = newSingleEq(cfMetaData, 1, value2);\n multiEq = newMultiEq(cfMetaData, 2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(singleEq2).mergeWith(multiEq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n\n // (clustering_0, clustering_1) = (1, 2) AND clustering_2 = 3\n singleEq = newSingleEq(cfMetaData, 2, value3);\n multiEq = newMultiEq(cfMetaData, 0, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiEq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) = (2, 3) AND clustering_3 = 4\n singleEq = newSingleEq(cfMetaData, 0, value1);\n singleEq2 = newSingleEq(cfMetaData, 3, value4);\n multiEq = newMultiEq(cfMetaData, 1, value2, value3);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiEq).mergeWith(singleEq2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithEqAndSliceRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n\n Restriction eq = newSingleEq(cfMetaData, 0, value3);\n\n Restriction slice = newSingleSlice(cfMetaData, 1, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 1, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 1, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 1, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 1, Bound.START, false, value1);\n Restriction slice2 = newSingleSlice(cfMetaData, 1, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value2, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 1, Bound.START, true, value1);\n slice2 = newSingleSlice(cfMetaData, 1, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value2, EOC.END);\n }", "private static Restriction newMultiSlice(CFMetaData cfMetaData, int firstIndex, Bound bound, boolean inclusive, ByteBuffer... values)\n {\n List<ColumnDefinition> columnDefinitions = new ArrayList<>();\n for (int i = 0; i < values.length; i++)\n {\n columnDefinitions.add(getClusteringColumnDefinition(cfMetaData, i + firstIndex));\n }\n return new MultiColumnRestriction.Slice(columnDefinitions, bound, inclusive, toMultiItemTerminal(values));\n }", "@Test\n public void testBoundsAsCompositesWithSingleEqAndMultiINRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n ByteBuffer value5 = ByteBufferUtil.bytes(5);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) IN ((2, 3), (4, 5))\n Restriction singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction multiIN = newMultiIN(cfMetaData, 1, asList(value2, value3), asList(value4, value5));\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiIN);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(1), value1, value4, value5, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(1), value1, value4, value5, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) IN ((2, 3))\n singleEq = newSingleEq(cfMetaData, 0, value1);\n multiIN = newMultiIN(cfMetaData, 1, asList(value2, value3));\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiIN).mergeWith(singleEq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n // clustering_0 = 1 AND clustering_1 = 5 AND (clustering_2, clustering_3) IN ((2, 3), (4, 5))\n singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction singleEq2 = newSingleEq(cfMetaData, 1, value5);\n multiIN = newMultiIN(cfMetaData, 2, asList(value2, value3), asList(value4, value5));\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiIN).mergeWith(singleEq2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value5, value2, value3, EOC.START);\n assertComposite(bounds.get(1), value1, value5, value4, value5, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value5, value2, value3, EOC.END);\n assertComposite(bounds.get(1), value1, value5, value4, value5, EOC.END);\n }", "public interface IStoppingCriteria {\n\n /**\n * Determine the degree of clustering agreement\n * @param cluster1 one clustering results\n * @param cluster2 the other clustering results\n * @return the degree of clustering agreement; 1 refers to be the same clustering results; 0 refers to be the totally different clustering results\n */\n public double computeSimilarity(int[] cluster1, int[] cluster2);\n\n}", "@Test\n public void testBoundsAsCompositesWithOneInRestrictionsAndOneClusteringColumn()\n {\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n Restriction in = newSingleIN(cfMetaData, 0, value1, value2, value3);\n\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(in);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.START);\n assertComposite(bounds.get(2), value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n assertComposite(bounds.get(1), value2, EOC.END);\n assertComposite(bounds.get(2), value3, EOC.END);\n }", "private boolean isSubsetOf(int firstRow, int secondRow) {\n for (int i = 0; i < universalSetSize; i++) {\n if (input[firstRow][i] && !input[secondRow][i]) {\n return false;\n }\n }\n return true;\n }", "@Test\n public void testOverlappingPartitionsOverlappingClusters()\n {\n check(overlappingClustersWithOverlappingPartitions(), 0.75, 1.0);\n }", "private boolean isSubsetOf(List<String> permissions2,\n\t\t\tList<String> permissions3) {\n\t\treturn false;\n\t}", "@Test\n public void testBoundsAsCompositesWithMultiEqRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n Restriction eq = newMultiEq(cfMetaData, 0, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n }", "@Test\n public void testHardClustersWithOverlappingPartitions()\n {\n check(hardClustersWithOverlappingPartitions(), 0.0, 1.0);\n }", "public void testSortOnComputedColumn1() throws Exception {\n \t\tccName = new String[] { \"cc\" };\n \t\tccExpr = new String[] { \"(row.COL0%2==0?1:2)\" };\n \n \t\tfor (int i = 0; i < ccName.length; i++) {\n \t\t\tComputedColumn computedColumn = new ComputedColumn(ccName[i],\n \t\t\t\t\tccExpr[i], DataType.ANY_TYPE);\n \t\t\t((BaseDataSetDesign) this.dataSet)\n \t\t\t\t\t.addComputedColumn(computedColumn);\n \t\t}\n \n \t\tString[] bindingNameSort = new String[1];\n \t\tbindingNameSort[0] = \"SORT_DEFINITION\";\n \t\tIBaseExpression[] bindingExprSort = new IBaseExpression[1];\n \t\tbindingExprSort[0] = new ScriptExpression(\"dataSetRow.cc\");\n \n \t\tSortDefinition[] sortDefn = new SortDefinition[] { new SortDefinition() };\n \t\tsortDefn[0].setColumn(\"SORT_DEFINITION\");\n \t\tsortDefn[0].setSortDirection(ISortDefinition.SORT_DESC);\n \n \t\tString[] bindingNameRow = new String[5];\n \t\tbindingNameRow[0] = \"ROW_COL0\";\n \t\tbindingNameRow[1] = \"ROW_COL1\";\n \t\tbindingNameRow[2] = \"ROW_COL2\";\n \t\tbindingNameRow[3] = \"ROW_COL3\";\n \t\tbindingNameRow[4] = \"ROW_cc\";\n \t\tScriptExpression[] bindingExprRow = new ScriptExpression[] {\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL0\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL1\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL2\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL3\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + ccName[0], 0), };\n \n \t\tIResultIterator resultIt = this.executeQuery(this.createQuery(null,\n \t\t\t\tnull, null, bindingNameSort, bindingExprSort, sortDefn, null,\n \t\t\t\tnull, null, bindingNameRow, bindingExprRow));\n \n \t\tprintResult(resultIt, bindingNameRow, bindingExprRow);\n \t\t// assert\n \t\tcheckOutputFile();\n \t}", "private boolean checkifCollinear(Point[] ptArr, Comparator<Point> cmp, int start){\n\t\tif(start +2 >= ptArr.length) return false;\t\n\t\tif(cmp.compare(ptArr[start],ptArr[start+1]) == cmp.compare(ptArr[start+1],ptArr[start+2]) && cmp.compare(ptArr[start],ptArr[start+1]) == 0){\n\t\t\treturn true;\n\t\t}\t\t\n\t\treturn false;\t\n\t}", "private boolean subGridCheck() {\n\t\tint sqRt = (int)Math.sqrt(dimension);\n\t\tfor(int i = 0; i < sqRt; i++) {\n\t\t\tint increment = i * sqRt;\n\t\t\tfor(int val = 1; val <= dimension; val++) {\n\t\t\t\tint valCounter = 0;\n\t\t\t\tfor(int row = 0 + increment; row < sqRt + increment; row++) {\n\t\t\t\t\tfor(int col = 0 + increment; col < sqRt + increment; col++) {\n\t\t\t\t\t\tif(puzzle[row][col] == val)\n\t\t\t\t\t\t\tvalCounter++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(valCounter >= 2)\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "private boolean checkRowCol(int c1, int c2, int c3) \r\n {\r\n return ((c1 != -1) && (c1 == c2) && (c2 == c3)); //eida ekhon porjonto kaaj e lage nai\r\n }", "private static Restriction newMultiEq(CFMetaData cfMetaData, int firstIndex, ByteBuffer... values)\n {\n List<ColumnDefinition> columnDefinitions = new ArrayList<>();\n for (int i = 0; i < values.length; i++)\n {\n columnDefinitions.add(getClusteringColumnDefinition(cfMetaData, firstIndex + i));\n }\n return new MultiColumnRestriction.EQ(columnDefinitions, toMultiItemTerminal(values));\n }", "protected void checkBox(int slice, int row, int column, int depth, int height, int width) {\n\tif (slice<0 || depth<0 || slice+depth>slices || row<0 || height<0 || row+height>rows || column<0 || width<0 || column+width>columns) throw new IndexOutOfBoundsException(toStringShort()+\", slice:\"+slice+\", row:\"+row+\" ,column:\"+column+\", depth:\"+depth+\" ,height:\"+height+\", width:\"+width);\n}", "Boolean isCollinearTo(IVec3 v);", "public abstract int Compare(Slice a, Slice b);", "List<Trueorfalse> selectByExample(RowBounds rowBounds);", "private boolean checkColoumnForQuadPair(int j1) {\n for(int i=0;i<4;i++)\r\n {\r\n if(Kmap[i][j1]==0 || Kmap[i][j1]==-1)\r\n return false;\r\n }\r\n for(int i=0;i<4;i++)\r\n {\r\n Kmap[i][j1]=-1;\r\n }\r\n return true; \r\n }", "@Test\n\tpublic void testEliminationByColumn(){\n\t\tsetBoardUp();\n\t\tColumn col = new Column(board, 1);\n\t\tint[] toBeRemoved = {1, 3, 4};\n\t\tint[] fromCesll = {1, 2, 3, 5, 6, 8};\n\t\talgorithm.applyEliminationInColumn(col);\n\t\tboolean condition = true;\n\t\tfor(int i = 0; i < toBeRemoved.length; i++)\n\t\t\tfor(int j = 0; j < fromCesll.length; j++)\n\t\t\t\tcondition &= !col.cell[fromCesll[j]].possibilities.contains(toBeRemoved[i]);\t\t\n\t\tassertTrue(condition);\n\t}", "@Test\n public void testPartitionColumnSelection() {\n Path filePath = new Path(\"hdfs:///w/x/y/z.csv\");\n ImplicitColumnManager implictColManager = new ImplicitColumnManager(\n fixture.getOptionManager(),\n standardOptions(filePath));\n\n String dir0 = ScanTestUtils.partitionColName(0);\n // Sic: case insensitivity, but name in project list\n // is preferred over \"natural\" name.\n String dir1 = \"DIR1\";\n String dir2 = ScanTestUtils.partitionColName(2);\n ScanLevelProjection scanProj = ScanLevelProjection.build(\n RowSetTestUtils.projectList(dir2, dir1, dir0, \"a\"),\n Lists.newArrayList(implictColManager.projectionParser()));\n\n assertEquals(4, scanProj.columns().size());\n assertEquals(dir2, scanProj.columns().get(0).name());\n assertEquals(dir1, scanProj.columns().get(1).name());\n assertEquals(dir0, scanProj.columns().get(2).name());\n assertEquals(\"a\", scanProj.columns().get(3).name());\n\n // Verify column type\n\n assertTrue(scanProj.columns().get(0) instanceof PartitionColumn);\n }", "@Test\n public void whereNormalColumn() throws Exception {\n String sql = \"desc verbose select k1, e1 from db1.tbl1 lateral view explode_split(k2, \\\",\\\") tmp as e1 \"\n + \"where k1=1; \";\n String explainString = UtFrameUtils.getSQLPlanOrErrorMsg(ctx, sql, true);\n Assert.assertTrue(explainString.contains(\"1:TABLE FUNCTION NODE\"));\n Assert.assertTrue(explainString.contains(\"table function: explode_split(`k2`, ',')\"));\n Assert.assertTrue(explainString.contains(\"tuple ids: 0 1\"));\n Assert.assertTrue(explainString.contains(\"TupleDescriptor{id=1, tbl=tmp, byteSize=32, materialized=true}\"));\n Assert.assertTrue(explainString.contains(\"SlotDescriptor{id=1, col=e1, type=VARCHAR(*)}\"));\n Assert.assertTrue(explainString.contains(\"0:OlapScanNode\"));\n Assert.assertTrue(explainString.contains(\"PREDICATES: `k1` = 1\"));\n }", "boolean isOrderedOn(ColumnReference[] crs, boolean permuteOrdering, Vector fbtVector)\n\t{\n\t\t/* RESOLVE - DistinctNodes are ordered on their RCLs.\n\t\t * Walk RCL to see if cr is 1st non-constant column in the\n\t\t * ordered result.\n\t\t */\n\t\treturn false;\n\t}", "public void testMultipass_Sort() throws Exception\n \t{\n \t\tccName = new String[]{\n \t\t\t\t\"cc1\", \"cc2\"\n \t\t};\n \t\tccExpr = new String[]{\n \t\t\t\t\"Total.sum(row.COL1)\", \"Total.sum(row.cc1)\"\n \t\t};\n \n \t\tfor ( int i = 0; i < ccName.length; i++ )\n \t\t{\n \t\t\tComputedColumn computedColumn = new ComputedColumn( ccName[i],\n \t\t\t\t\tccExpr[i],\n \t\t\t\t\tDataType.INTEGER_TYPE );\n \t\t\t( (BaseDataSetDesign) this.dataSet ).addComputedColumn( computedColumn );\n \t\t}\n \t\t\n \t\tString[] bindingNameSort = new String[2];\n \t\tbindingNameSort[0] = \"SORT_DEFINITION_1\";\n \t\tbindingNameSort[1] = \"SORT_DEFINITION_2\";\n \t\tIBaseExpression[] bindingExprSort = new IBaseExpression[2];\n \t\tbindingExprSort[0] = new ScriptExpression(\n \t\t\t\t\"dataSetRow.COL1/(Total.ave(dataSetRow.cc1)+dataSetRow.cc1)\");\n \t\tbindingExprSort[1] = new ScriptExpression(\n \t\t\t\t\"dataSetRow.cc2-dataSetRow.COL2\");\n \t\tSortDefinition[] sortDefn = new SortDefinition[] {\n \t\t\t\tnew SortDefinition(), new SortDefinition() };\n \t\tsortDefn[0].setColumn(\"SORT_DEFINITION_1\");\n \t\tsortDefn[0].setSortDirection(ISortDefinition.SORT_DESC);\n \t\tsortDefn[1].setColumn(\"SORT_DEFINITION_2\");\n \t\tsortDefn[1].setSortDirection(ISortDefinition.SORT_DESC);\n \n \t\tString[] bindingNameRow = new String[6];\n \t\tbindingNameRow[0] = \"ROW_COL0\";\n \t\tbindingNameRow[1] = \"ROW_COL1\";\n \t\tbindingNameRow[2] = \"ROW_COL2\";\n \t\tbindingNameRow[3] = \"ROW_COL3\";\n \t\tbindingNameRow[4] = \"ROW_cc1\";\n \t\tbindingNameRow[5] = \"ROW_cc2\";\n \t\tScriptExpression[] bindingExprRow = new ScriptExpression[]{\n \t\t\t\tnew ScriptExpression( \"dataSetRow.\" + \"COL0\", 0 ),\n \t\t\t\tnew ScriptExpression( \"dataSetRow.\" + \"COL1\", 0 ),\n \t\t\t\tnew ScriptExpression( \"dataSetRow.\" + \"COL2\", 0 ),\n \t\t\t\tnew ScriptExpression( \"dataSetRow.\" + \"COL3\", 0 ),\n \t\t\t\tnew ScriptExpression( \"dataSetRow.\" + ccName[0], 0 ),\n \t\t\t\tnew ScriptExpression( \"dataSetRow.\" + ccName[1], 0 ),\n \t\t};\n \t\tIResultIterator resultIt = this.executeQuery(this.createQuery(null,\n \t\t\t\tnull, null, bindingNameSort, bindingExprSort, sortDefn, null,\n \t\t\t\tnull, null, bindingNameRow, bindingExprRow));\n \n \t\tprintResult(resultIt, bindingNameRow, bindingExprRow);\t\n \t\t// assert\n \t\tcheckOutputFile();\n \t}", "public void testFilterOnAggregationColumn() throws Exception {\n \t\tccName = new String[] { \"cc1\", \"cc2\", \"cc3\" };\n \t\tccExpr = new String[] { \"row.COL0+row.COL1\",\n \t\t\t\t\"Total.runningSum(row.cc1,row.COL0==0,0)\",\n \t\t\t\t\"Total.runningSum(row.cc1,row.COL0>0,0)\" };\n \n \t\tfor (int i = 0; i < ccName.length; i++) {\n \t\t\tComputedColumn computedColumn = new ComputedColumn(ccName[i],\n \t\t\t\t\tccExpr[i], DataType.ANY_TYPE);\n \t\t\t((BaseDataSetDesign) this.dataSet)\n \t\t\t\t\t.addComputedColumn(computedColumn);\n \t\t}\n \n \t\tString[] bindingNameRow = new String[7];\n \t\tbindingNameRow[0] = \"ROW_COL0\";\n \t\tbindingNameRow[1] = \"ROW_COL1\";\n \t\tbindingNameRow[2] = \"ROW_COL2\";\n \t\tbindingNameRow[3] = \"ROW_COL3\";\n \t\tbindingNameRow[4] = \"ROW_cc1\";\n \t\tbindingNameRow[5] = \"ROW_cc2\";\n \t\tbindingNameRow[6] = \"ROW_cc3\";\n \t\tScriptExpression[] bindingExprRow = new ScriptExpression[] {\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL0\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL1\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL2\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL3\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + ccName[0], 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + ccName[1], 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + ccName[2], 0) };\n \n \t\tIResultIterator resultIt = this.executeQuery(this.createQuery(null,\n \t\t\t\tnull, null, null, null, null, null, null, null, bindingNameRow,\n \t\t\t\tbindingExprRow));\n \n \t\tprintResult(resultIt, bindingNameRow, bindingExprRow);\n \t\t// assert\n \t\tcheckOutputFile();\n \n \t}", "@Test\n public void testBoundsAsCompositesWithMultiInRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n Restriction in = newMultiIN(cfMetaData, 0, asList(value1, value2), asList(value2, value3));\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(in);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertComposite(bounds.get(1), value2, value3, EOC.END);\n }", "@Test\n public void testHeterogeneousSegmentFilterConditionLimit() throws SqlParseException {\n\n val project = \"heterogeneous_segment\";\n // val dfId = \"747f864b-9721-4b97-acde-0aa8e8656cba\"\n // val seg1Id = \"8892fa3f-f607-4eec-8159-7c5ae2f16942\"\n // val seg2Id = \"d75a822c-788a-4592-a500-cf20186dded1\"\n // val seg3Id = \"54eaf96d-6146-45d2-b94e-d5d187f89919\"\n // val seg4Id = \"411f40b9-a80a-4453-90a9-409aac6f7632\"\n // val seg5Id = \"a8318597-cb75-416f-8eb8-96ea285dd2b4\"\n // \n val sql = \"with T1 as (select cal_dt, trans_id \\n\" + \"from test_kylin_fact inner join test_account \\n\"\n + \"on test_kylin_fact.seller_id = test_account.account_id \\n\"\n + \"where cal_dt between date'2012-01-01' and date'2012-01-03'\\n\" + \"group by cal_dt, trans_id)\\n\";\n\n {\n val sqlWithTooManyOrs = sql + \" select * from T1 where \" + \"(cal_dt='2012-01-01' and trans_id = 1) or \\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 2) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 3) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 4) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 5) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 6) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 7) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 8) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 9) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 10) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 12) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 13) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 14) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 15) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 16) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 17) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 18) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 19) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 20)\";\n val contexts = OlapContextTestUtil.getOlapContexts(project, sqlWithTooManyOrs);\n Assert.assertEquals(\n \">=(DEFAULT.TEST_KYLIN_FACT.CAL_DT, 2012-01-01),<=(DEFAULT.TEST_KYLIN_FACT.CAL_DT, 2012-01-03)\",\n contexts.get(0).getExpandedFilterConditions().stream().map(RexNode::toString)\n .collect(Collectors.joining(\",\")));\n }\n\n {\n val sqlWithFilter = sql + \" select * from T1 where \" + \"(cal_dt='2012-01-01' and trans_id = 1) or \\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 2) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 3) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 4) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 5) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 6) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 7) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 8) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 9) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 10)\";\n val contexts = OlapContextTestUtil.getOlapContexts(project, sqlWithFilter);\n Assert.assertNotEquals(\n \">=(DEFAULT.TEST_KYLIN_FACT.CAL_DT, 2012-01-01),<=(DEFAULT.TEST_KYLIN_FACT.CAL_DT, 2012-01-03)\",\n contexts.get(0).getExpandedFilterConditions().stream().map(RexNode::toString)\n .collect(Collectors.joining(\",\")));\n }\n\n }", "public boolean percolates() {\n for (int i = 0; i < size; i++) {\r\n if (flowGrid[size * (size - 1) + i] < size) { // if any of the bottom row points at any of the index in the top row\r\n return true;\r\n }\r\n }\r\n return false;\r\n }", "public boolean percolates()\r\n { return uf.find(0) == uf.find(dimension*dimension + 1); }", "private Object isValidColumnVector(List<List<Double>> vector) {\n\t\tInteger nrows = vector.size();\n\n\t\tList<Integer> rowLengths = vector.stream().map(List::size).toList();\n\t\tInteger ncols = rowLengths.stream().mapToInt(Integer::intValue).sum() / rowLengths.size();\n\n\t\treturn (nrows == 3) && (ncols == 1);\n\t}", "public Map<ByteBuffer, List<ColumnOrSuperColumn>> forced_2round_multiget_slice(List<ByteBuffer> allKeys, ColumnParent column_parent, SlicePredicate predicate)\n throws Exception\n {\n //if (logger.isTraceEnabled()) {\n // logger.trace(\"forced_2round_multiget_slice(allKeys = {}, column_parent = {}, predicate = {})\", new Object[]{printKeys(allKeys), column_parent, predicate});\n //}\n //Split up into one request for each server in the local cluster\n Map<Cassandra.AsyncClient, List<ByteBuffer>> asyncClientToFirstRoundKeys = partitionByAsyncClients(allKeys);\n\n //Send Round 1 Requests\n Queue<BlockingQueueCallback<multiget_slice_call>> firstRoundCallbacks = new LinkedList<BlockingQueueCallback<multiget_slice_call>>();\n for (Entry<Cassandra.AsyncClient, List<ByteBuffer>> entry : asyncClientToFirstRoundKeys.entrySet()) {\n Cassandra.AsyncClient asyncClient = entry.getKey();\n List<ByteBuffer> keysForThisClient = entry.getValue();\n\n BlockingQueueCallback<multiget_slice_call> callback = new BlockingQueueCallback<multiget_slice_call>();\n firstRoundCallbacks.add(callback);\n\n //if (logger.isTraceEnabled()) { logger.trace(\"round 1: get \" + printKeys(keysForThisClient) + \" from \" + asyncClient); }\n asyncClient.multiget_slice(keysForThisClient, column_parent, predicate, consistencyLevel, LamportClock.sendTimestamp(), callback);\n }\n\n //Gather responses, track both max_evt and min_lvt\n long overallMaxEvt = Long.MIN_VALUE;\n long overallMinLvt = Long.MAX_VALUE;\n\n Map<ByteBuffer, List<ColumnOrSuperColumn>> keyToResult = new HashMap<ByteBuffer, List<ColumnOrSuperColumn>>();\n NavigableMap<Long, List<ByteBuffer>> lvtToKeys = new TreeMap<Long, List<ByteBuffer>>();\n for (BlockingQueueCallback<multiget_slice_call> callback : firstRoundCallbacks) {\n\n MultigetSliceResult result = callback.getResponseNoInterruption().getResult();\n LamportClock.updateTime(result.lts);\n\n for (Entry<ByteBuffer, List<ColumnOrSuperColumn>> entry : result.value.entrySet()) {\n ByteBuffer key = entry.getKey();\n List<ColumnOrSuperColumn> coscList = entry.getValue();\n keyToResult.put(key, coscList);\n\n //find the evt and lvt for the entire row\n EvtAndLvt evtAndLvt = ColumnOrSuperColumnHelper.extractEvtAndLvt(coscList);\n if (!lvtToKeys.containsKey(evtAndLvt.getLatestValidTime())) {\n lvtToKeys.put(evtAndLvt.getLatestValidTime(), new LinkedList<ByteBuffer>());\n }\n lvtToKeys.get(evtAndLvt.getLatestValidTime()).add(key);\n //if (logger.isTraceEnabled()) { logger.trace(\"round 1 response for \" + printKey(key) + \" evt: \" + evtAndLvt.getEarliestValidTime() + \" lvt: \" + evtAndLvt.getLatestValidTime()); }\n\n overallMaxEvt = Math.max(overallMaxEvt, evtAndLvt.getEarliestValidTime());\n overallMinLvt = Math.min(overallMinLvt, evtAndLvt.getLatestValidTime());\n }\n }\n //if (logger.isTraceEnabled()) { logger.trace(\"Min LVT:\" + overallMinLvt + \" Max EVT: \" + overallMaxEvt); }\n\n //Always Execute 2nd round for micro-benchmarking\n if (true) {\n //get the smallest lvt > maxEvt\n long chosenTime = lvtToKeys.navigableKeySet().higher(overallMaxEvt);\n\n List<ByteBuffer> secondRoundKeys = new LinkedList<ByteBuffer>();\n secondRoundKeys.addAll(allKeys);\n\n //Send Round 2 Requests\n Map<Cassandra.AsyncClient, List<ByteBuffer>> asyncClientToSecondRoundKeys = partitionByAsyncClients(secondRoundKeys);\n Queue<BlockingQueueCallback<multiget_slice_by_time_call>> secondRoundCallbacks = new LinkedList<BlockingQueueCallback<multiget_slice_by_time_call>>();\n for (Entry<Cassandra.AsyncClient, List<ByteBuffer>> entry : asyncClientToSecondRoundKeys.entrySet()) {\n Cassandra.AsyncClient asyncClient = entry.getKey();\n List<ByteBuffer> keysForThisClient = entry.getValue();\n\n BlockingQueueCallback<multiget_slice_by_time_call> callback = new BlockingQueueCallback<multiget_slice_by_time_call>();\n secondRoundCallbacks.add(callback);\n\n //if (logger.isTraceEnabled()) { logger.trace(\"round 2: get \" + printKeys(keysForThisClient) + \" from \" + asyncClient); }\n\n asyncClient.multiget_slice_by_time(keysForThisClient, column_parent, predicate, consistencyLevel, chosenTime, LamportClock.sendTimestamp(), callback);\n }\n\n //Gather second round responses\n for (BlockingQueueCallback<multiget_slice_by_time_call> callback : secondRoundCallbacks) {\n MultigetSliceResult result = callback.getResponseNoInterruption().getResult();\n LamportClock.updateTime(result.lts);\n\n substituteValidFirstRoundResults(result, keyToResult);\n\n //if (logger.isTraceEnabled()) { logger.trace(\"round 2 responses for \" + printKeys(result.getValue().keySet())); }\n\n keyToResult.putAll(result.getValue());\n }\n }\n\n //Add dependencies on anything returned and removed deleted columns\n for (Entry<ByteBuffer, List<ColumnOrSuperColumn>> entry : keyToResult.entrySet()) {\n ByteBuffer key = entry.getKey();\n List<ColumnOrSuperColumn> coscList = entry.getValue();\n\n for (Iterator<ColumnOrSuperColumn> cosc_it = coscList.iterator(); cosc_it.hasNext(); ) {\n ColumnOrSuperColumn cosc = cosc_it.next();\n try {\n clientContext.addDep(key, cosc);\n } catch (NotFoundException nfe) {\n //remove deleted results, it's okay for all result to be removed\n cosc_it.remove();\n }\n }\n }\n //if (logger.isTraceEnabled()) {\n // logger.trace(\"forced_2round_multiget_slice result = {}\", keyToResult);\n //}\n return keyToResult;\n }", "private int[][] generateCandidates(int[][] usageM){\n\t\t// 1. start with the complete set of attributes\n\t\tMap<Integer, List<Integer>> partitionAttributes = new HashMap<Integer,List<Integer>>();\n\t\tList<Integer> attributes = new ArrayList<Integer>();\n\t\tfor(int i=0;i<usageM[0].length;i++)\n\t\t\tattributes.add(i);\n\t\tpartitionAttributes.put(0, attributes);\n\t\t\n\t\t// 2. for each query, split this set of attributes into two set:\n\t\t// (i) attributes accessed by the query\n\t\t//\t (ii) attributes not-accessed by the query\n\t\tfor(int[] query: usageM){\n\t\t\tMap<Integer, List<Integer>> newPartitionAttributes = new HashMap<Integer,List<Integer>>();\n\t\t\tint partitionCount = partitionAttributes.size();\n\t\t\t\n\t\t\t// check each partition\n\t\t\tfor(int p: partitionAttributes.keySet()){\n\t\t\t\tList<Integer> attrs = partitionAttributes.get(p);\n\t\t\t\tboolean fullPartitionAccess = true;\n\t\t\t\tfor(int a: attrs){\n\t\t\t\t\tif(query[a]==0)\n\t\t\t\t\t\tfullPartitionAccess = false;\n\t\t\t\t}\n\n\t\t\t\tif(fullPartitionAccess){\n\t\t\t\t\tnewPartitionAttributes.put(p, attrs);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t//int newPartition = partitionAttributes.size();\n\t\t\t\t\tList<Integer> accessedAttrs = new ArrayList<Integer>();\n\t\t\t\t\tList<Integer> nonAccessedAttrs = new ArrayList<Integer>();\n\t\t\t\t\tfor(int a: attrs){\n\t\t\t\t\t\tif(query[a]==1)\n\t\t\t\t\t\t\taccessedAttrs.add(a);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tnonAccessedAttrs.add(a);\n\t\t\t\t\t}\n\t\t\t\t\tif(nonAccessedAttrs.size() > 0)\n\t\t\t\t\t\tnewPartitionAttributes.put(p, nonAccessedAttrs);\n\t\t\t\t\tif(accessedAttrs.size() > 0)\n\t\t\t\t\t\tnewPartitionAttributes.put(partitionCount++, accessedAttrs);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//System.out.println(newPartitionAttributes);\n\t\t\t\n\t\t\tpartitionAttributes = newPartitionAttributes;\n\t\t}\n\t\t\n\t\t\n\t\t// 3. we end up with a set of attribute sets; all attributes in \n\t\t//\t an attribute set are always accessed together.\n\t\tint[][] primaryPartitions = new int[partitionAttributes.size()][];\n\t\tint i=0;\n\t\tfor(int p: partitionAttributes.keySet()){\n\t\t\tList<Integer> attrs = partitionAttributes.get(p);\n\t\t\tprimaryPartitions[i] = new int[attrs.size()];\n\t\t\tfor(int j=0;j<attrs.size();j++)\n\t\t\t\tprimaryPartitions[i][j] = attrs.get(j);\n\t\t\ti++;\n\t\t}\n\t\t\n\t\treturn primaryPartitions;\n\t}", "List<Online> selectByExampleWithRowbounds(OnlineExample example, RowBounds rowBounds);", "boolean hasPermissionOfCluster(String clusterId, String userName);", "public static boolean isAllowedToCollied(Marker marker, Marker m2){\n\t\tif( m2.letter.getX() < marker.letter.getX()){\n\t\t\tif(m2.rightValue != 0 && marker.leftValue !=0 && m2.rightValue + marker.leftValue == 0){\n\t\t\t\tm2.rightValue =0;\n\t\t\t\tmarker.leftValue=0;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\t//if collied on right \n\t\telse if( m2.letter.getX() > marker.letter.getX()){\n\t\t\tif(m2.leftValue != 0 && marker.rightValue != 0 && m2.leftValue+ marker.rightValue == 0){\n\t\t\t\tm2.leftValue = 0;\n\t\t\t\tmarker.rightValue = 0; \n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "private boolean canSetSafelyDownColumn(MTreeNode row, MTreeNode col, UnionDoubleIntervals newVal) {\n\t\tMTreeNode rowKids[]=row.getChildren();\n\t\tif (rowKids.length==0) return true;\n\t\tUnionDoubleIntervals rowKidsInts[]=new UnionDoubleIntervals[rowKids.length];\n\t\tfor(int i=0; i<rowKids.length; i++) {\n\t\t\trowKidsInts[i]=get(rowKids[i], col);\n\t\t\tif (rowKidsInts[i]==null) {\n\t\t\t\t//If a sibling is null, I cannot check, so just return\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\tUnionDoubleIntervals sum=UnionDoubleIntervals.sum(rowKidsInts);\n\t\treturn newVal.intersects(sum);\n\t}", "boolean getIsClusteringKey();", "DataFrame<R,C> select(Predicate<DataFrameRow<R,C>> rowPredicate, Predicate<DataFrameColumn<R,C>> colPredicate);", "@Test\n \tpublic void whereClauseForNodeRangedDominance() {\n \t\tnode23.addJoin(new Dominance(node42, 10, 20));\n \t\tcheckWhereCondition(\n //\t\t\t\tjoin(\"=\", \"_rank23.component_ref\", \"_rank42.component_ref\"),\n \t\t\t\tjoin(\"=\", \"_component23.type\", \"'d'\"),\n \t\t\t\t\"_component23.name IS NULL\",\n \t\t\t\tjoin(\"<\", \"_rank23.pre\", \"_rank42.pre\"),\n \t\t\t\tjoin(\"<\", \"_rank42.pre\", \"_rank23.post\"),\n \t\t\t\t\"_rank23.level BETWEEN SYMMETRIC _rank42.level - 10 AND _rank42.level - 20\"\n \n \t\t);\n \t}", "public static boolean IS_SUBFEATURE(Feature a, int index_a, Feature b, int index_b) {\n\n boolean anotinb, bnotina;\n int i, ia, ib;\n\n if (index_a != index_b)\n Dataset.perror(\"Feature.class :: not the same feature (\" + index_a + \" != \" + index_b + \")\");\n if (!a.type.equals(b.type))\n Dataset.perror(\n \"Feature.class :: not the same type of feature (\" + a.type + \" != \" + b.type + \")\");\n\n if (IS_CONTINUOUS(a.type)) {\n if (a.dmin >= b.dmin) {\n if (a.dmax <= b.dmax) return true;\n else\n Dataset.perror(\n \"Feature.class :: inconsistency for subfeature check for : (\"\n + a.dmin\n + \", \"\n + a.dmax\n + \") subseteq (\"\n + b.dmin\n + \", \"\n + b.dmax\n + \") ? \");\n } else if (a.dmax < b.dmax)\n Dataset.perror(\n \"Feature.class :: inconsistency for subfeature check for : (\"\n + a.dmin\n + \", \"\n + a.dmax\n + \") subseteq (\"\n + b.dmin\n + \", \"\n + b.dmax\n + \") ? \");\n } else if (IS_INTEGER(a.type)) {\n if (a.imin >= b.imin) {\n if (a.imax <= b.imax) return true;\n else\n Dataset.perror(\n \"Feature.class :: inconsistency for subfeature check for : (\"\n + a.imin\n + \", \"\n + a.imax\n + \") subseteq (\"\n + b.imin\n + \", \"\n + b.imax\n + \") ? \");\n } else if (a.imax < b.imax)\n Dataset.perror(\n \"Feature.class :: inconsistency for subfeature check for : (\"\n + a.imin\n + \", \"\n + a.imax\n + \") subseteq (\"\n + b.imin\n + \", \"\n + b.imax\n + \") ? \");\n } else if (IS_NOMINAL(a.type)) {\n if (a.modalities == null) return true;\n else if (b.modalities != null) {\n anotinb = bnotina = false;\n ia = ib = -1;\n for (i = 0; i < a.modalities.size(); i++)\n if (!b.modalities.contains((String) a.modalities.elementAt(i))) {\n anotinb = true;\n ia = i;\n }\n for (i = 0; i < b.modalities.size(); i++)\n if (!a.modalities.contains((String) b.modalities.elementAt(i))) {\n bnotina = true;\n ib = i;\n }\n if ((anotinb) && (bnotina))\n Dataset.perror(\n \"Feature.class :: inconsistency for subfeature check for : \"\n + ((String) a.modalities.elementAt(ia))\n + \" not in b and \"\n + ((String) b.modalities.elementAt(ib))\n + \" not in a \");\n else if (!anotinb) return true;\n }\n } else Dataset.perror(\"Feature.class :: no Feature type for \" + a.type);\n\n return false;\n }", "public void decideCluster(){\n\tdouble shortest = 1000000;\n\tfor(int i = 0; i < clusterDist.length; i++)\n\t{\n\t\tif(clusterDist[i] < shortest)\n\t\t{\tshortest = clusterDist[i];\n\t\t\tthis.clusterid = i;\n\t\t}\n\t\t\n\t}\n}", "public static void pseudoTrueTuples(LogicProblem logicProblem, boolean applyChanges)\r\n throws RelationshipConflictException {\n \r\n HashMap<ItemPair,Relationship> relationshipTable = logicProblem.getRelationshipTable();\r\n HashSet<CategoryPair> categoryPairs = logicProblem.getCategoryPairs();\r\n \r\n// System.out.println(\"searching...\");\r\n //within a subgrid\r\n for (CategoryPair categoryPair : categoryPairs) {\r\n// System.out.println(\"Category pair:\" + categoryPair);\r\n //vertical and horizontal search\r\n for (final boolean verticalOrientation : new boolean[] { false, true } ) {\r\n\r\n Category subrowCategory = verticalOrientation?categoryPair.first():categoryPair.last();\r\n Category subcolumnCategory = verticalOrientation?categoryPair.last():categoryPair.first();\r\n\r\n //commenting \"vertical search\" \r\n //(subrows match first category's items\r\n // subcolumns match second category's items)\r\n\r\n //i (2 to floor(n/2)) is the number of elements in the combination tuple\r\n // i=2 in pseudoTrue pairs\r\n //(for subgrids of 5x5 items, looking for both pairs and triplets becomes redundant\r\n for (int i=2; i<=floor(logicProblem.getNumCategories()/2);i++) {\r\n\r\n //https://github.com/dpaukov/combinatoricslib3/wiki/v3.3.0#1-simple-combinations\r\n List<List<Item>> columnCombinations = Generator.combination(subcolumnCategory.getItems())\r\n .simple(i) //for pseudo true pairs, i=2\r\n .stream()\r\n .collect(Collectors.<List<Item>>toList());\r\n //for i=2, this would contain \r\n //Bethany, Donovan\r\n //Bethany, Elizabeth\r\n //...\r\n //Frederick, Peyton\r\n// columnCombinations.stream().forEach(l -> System.out.println(\r\n// (verticalOrientation?\"vertical\":\"horizontal\")+ \" combo: \"+l.toString()));\r\n\r\n //create the sets\r\n //for each combination, start over\r\n \r\n //columnTuple contains i items with which we will compute set intersections\r\n for (List<Item> columnItemTuple : columnCombinations) {\r\n //Bethany, Donovan\r\n \r\n //similarly, valueNoSets contains i sets of VALUE_NO relationships\r\n List<Set<Item>> valueNoSets = new ArrayList<>(); //size=i\r\n //build a set for each i item of columnTuple\r\n for (Item columnItem : columnItemTuple) {\r\n //Bethany\r\n Set<Item> valueNoSet = new HashSet<>(); //size = n\r\n for (Item rowItem : subrowCategory.getItems()) {\r\n //Haley's Comet ....\r\n if (relationshipTable.get(new ItemPair(rowItem, columnItem)).getValue() == Relationship.ValueType.VALUE_NO)\r\n //stacking all VALUE_NO relationship into vertical set\r\n valueNoSet.add(rowItem); //store into single subcolumn set \r\n }\r\n //adding each vertical set into list of sets\r\n if (valueNoSet.size() >= logicProblem.getNumItems() - i //for pairs, we need three VALUE_NO in the set\r\n && valueNoSet.size() < logicProblem.getNumItems()-1) //uniqueness will take or n-1 cases\r\n valueNoSets.add(valueNoSet); //store single subcolumn into multi-set\r\n }\r\n //magic!\r\n Set<Item> intersectionSet = new HashSet<>(); //avoid NPE when the next call is made\r\n if (valueNoSets.size()>=2) //don't compute intersections otherwise\r\n intersectionSet = Processor.multiSetIntersection(valueNoSets);\r\n\r\n if (intersectionSet.size()==logicProblem.getNumItems()-i) {\r\n \r\n// System.out.println(\"----> found candidates for pseudo true pairs!\");\r\n// intersectionSet.stream().forEach(l -> System.out.println(\"\\t\" + l.toString()));\r\n// System.out.println(\"\\t\\tvs.\");\r\n// columnItemTuple.stream().forEach(l -> System.out.println(\"\\t\" + l.toString()));\r\n \r\n //create predecessor list\r\n //we can only add the intersection output as predecessors\r\n ArrayList<Dependable> predecessors = new ArrayList<Dependable>();\r\n for (Item intersectionColumn : intersectionSet) {\r\n for (Item rowItem : columnItemTuple) {\r\n predecessors.add(relationshipTable.get(new ItemPair(rowItem, intersectionColumn)));\r\n }\r\n }\r\n\r\n\r\n //we have a bunch of work to do\r\n for (Item everyRowItem : subrowCategory.getItems()) {\r\n //for every row item not in the intersectionSet\r\n if (!intersectionSet.contains(everyRowItem)) {\r\n for (Item everyColumnItem : subcolumnCategory.getItems()) {\r\n //for every column item not in any of the columnTuple list\r\n if (!columnItemTuple.contains(everyColumnItem)) {\r\n Relationship rel = relationshipTable.get(new ItemPair(everyRowItem,everyColumnItem));\r\n if (rel.getValue()!=Relationship.ValueType.VALUE_NO)\r\n Processor.setRelationship(logicProblem, applyChanges, rel, \r\n Relationship.ValueType.VALUE_NO, Relationship.LogicType.PSEUDOTRUE,\r\n predecessors.toArray(new Relationship[predecessors.size()])); \r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }", "private boolean isSubset(List<ConceptLabel> outer, List<ConceptLabel> inner){\n\t\tfor(ConceptLabel in: inner){\n\t\t\tboolean c = false;\n\t\t\tfor(ConceptLabel l: outer){\n\t\t\t\tif(l.getText().equals(in.getText())){\n\t\t\t\t\tc = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(!c)\n\t\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public VirtualDataSet[] partitionByNumericAttribute(int attributeIndex, int valueIndex) {\n\t\t// WRITE YOUR CODE HERE!\n\n\t\t if(attributes[attributeIndex].getType()==AttributeType.NOMINAL){ \t\t\t\t\t\t\t// avoid passing through nominal value to current method\n return null; \n }\n\t\t\tVirtualDataSet [] partitions = new VirtualDataSet[2]; \t\t\t\t\t\t\t\t\t// creates two split path \n\n\t\t\tdouble split = Double.parseDouble(getValueAt(valueIndex , attributeIndex));\t\t\t// determine the middle number in order to split \n\t\t\t\n\t\t\tLinkedList<Integer> rowsLess = new LinkedList<Integer> (); \t\t\t\t\t\t\t// using linkedlist to do collection of split rows that less than valueIndex value\n\t\t\t\n\t\t\tLinkedList<Integer> rowsMore = new LinkedList<Integer> ();\t\t\t\t\t\t\t\t// using linkedlist to do collection of split rows that less than valueIndex value\n\t\t\t\n\t\t\tint countLess = 0;\n\t\t\tint countMore = 0; \n\n\t\t\tString []arrayOfNums = attributes[attributeIndex].getValues();\n\n\t\t\tfor(int j = 0; j < source.numRows; j++){ \n\t\t\t\t\n\t\t\t\tif(Double.parseDouble(getValueAt(j,attributeIndex)) <= split){ \t\t\t\t// transform from string to integer in order to compare the number smaller than middle number\n\t\t\t\t\t\n\t\t\t\t\trowsLess.add(j);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// add rows that correspond with the current attribute of spliting \n\t\t\t\t\tcountLess++;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// determine the size of partition rows array \n\t\t\t\t}else if(Double.parseDouble(getValueAt(j,attributeIndex)) > split){\t\t\t// transform from string to integer in order to compare the number bigger than middle number\n\t\t\t\t\t\n\t\t\t\t\trowsMore.add(j); \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// add rows that correspond with the current attribute of spliting \n\t\t\t\t\tcountMore++;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// determine the size of partition rows array \n\t\t\t\t}\n\t\t\t}\n\n\t\t\tint [] partitionRowsLess = new int [countLess]; \t\t\t\t\t\t\t\t\t\t// the collection of rows represents all number that smaller than middle number\n\t\t\tint [] partitionRowsMore = new int [countMore]; \t\t\t\t\t\t\t\t\t\t// the collection of rows represents all number that bigger than middle number\n\t\t\tfor(int k = 0; k < countLess; k++){\n\t\t\t\tpartitionRowsLess[k] = rowsLess.poll(); \t\t\t\t\t\t\t\t\t\t\t// transform from linkedlist to array \n\t\t\t}\n\t\t\tfor(int k = 0; k < countMore; k++){\n\t\t\t\tpartitionRowsMore[k] = rowsMore.poll(); \t\t\t\t\t\t\t\t\t\t\t// transform from linkedlist to array \n\t\t\t}\n\t\t\t\n\t\t\tpartitions[0] = new VirtualDataSet(source,partitionRowsLess, attributes); \t\t\t\t// send partition to VirtualDataSet constructor \n\t\t\tpartitions[1] = new VirtualDataSet(source,partitionRowsMore, attributes); \n\t\t\t\n\n\n\t\t\treturn partitions;\n\t\t\n\t}", "@Test\n\t public void test_Is_Subset_Positive() throws Exception{\t\n\t\t SET setarray= new SET( new int[]{1,2,3,4,5});\n\t\t SET subsetarray= new SET( new int[]{1,2,3});\n\t\t assertTrue(setarray.isSubSet(subsetarray));\t \n\t }", "@Test\r\n public void testIsSubset1() {\r\n Assert.assertEquals(false, set1.isSubset(set2));\r\n }", "@Test\n public void testMultiLevelPartitionPruning() throws SqlParseException {\n\n val project = \"multi_level_partition\";\n val dfId = \"747f864b-9721-4b97-acde-0aa8e8656cba\";\n val expectedRanges = Lists.<Pair<String, String>> newArrayList();\n val segmentRange1 = Pair.newPair(\"2012-01-01\", \"2012-01-02\");\n val segment1Uuid = \"8892fa3f-f607-4eec-8159-7c5ae2f16942\";\n val segmentRange2 = Pair.newPair(\"2012-01-02\", \"2012-01-03\");\n val segment2Uuid = \"d75a822c-788a-4592-a500-cf20186dded1\";\n val segmentRange3 = Pair.newPair(\"2012-01-03\", \"2012-01-04\");\n val segment3Uuid = \"54eaf96d-6146-45d2-b94e-d5d187f89919\";\n val segmentRange4 = Pair.newPair(\"2012-01-04\", \"2012-01-05\");\n val segment4Uuid = \"411f40b9-a80a-4453-90a9-409aac6f7632\";\n val segmentRange5 = Pair.newPair(\"2012-01-05\", \"2012-01-06\");\n val segment5Uuid = \"a8318597-cb75-416f-8eb8-96ea285dd2b4\";\n val expectedPartitionMap = Maps.<String, List<Long>> newHashMap();\n\n val sqlBase = \"select cal_dt, sum(price) from test_kylin_fact inner join test_account on test_kylin_fact.seller_id = test_account.account_id \";\n\n // no filter\n val noFilterSql = sqlBase + \"group by cal_dt\";\n expectedRanges.add(segmentRange1);\n expectedRanges.add(segmentRange2);\n expectedRanges.add(segmentRange3);\n expectedRanges.add(segmentRange4);\n expectedRanges.add(segmentRange5);\n expectedPartitionMap.put(segment1Uuid, Lists.newArrayList(0L, 1L, 2L, 3L));\n expectedPartitionMap.put(segment2Uuid, Lists.newArrayList(0L, 1L, 2L));\n expectedPartitionMap.put(segment3Uuid, Lists.newArrayList(1L, 2L, 3L));\n expectedPartitionMap.put(segment4Uuid, Lists.newArrayList(0L, 1L));\n expectedPartitionMap.put(segment5Uuid, Lists.newArrayList(2L, 3L));\n assertPrunedSegmentsRange(project, noFilterSql, dfId, expectedRanges, 1L, expectedPartitionMap);\n\n val andSql0 = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-04' and lstg_site_id = 1 group by cal_dt\";\n val andMappingSql0 = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-04' and lstg_format_name = 'FP-non GTC' group by cal_dt\";\n val andMixSql0 = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-04' and lstg_site_id = 1 and lstg_format_name = 'FP-non GTC' group by cal_dt\";\n expectedRanges.clear();\n expectedRanges.add(segmentRange1);\n expectedRanges.add(segmentRange2);\n expectedRanges.add(segmentRange3);\n expectedPartitionMap.clear();\n expectedPartitionMap.put(segment1Uuid, Lists.newArrayList(1L));\n expectedPartitionMap.put(segment2Uuid, Lists.newArrayList(1L));\n expectedPartitionMap.put(segment3Uuid, Lists.newArrayList(1L));\n assertPrunedSegmentsRange(project, andSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n assertPrunedSegmentsRange(project, andMappingSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n assertPrunedSegmentsRange(project, andMixSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n\n val notInSql0 = sqlBase\n + \"where cal_dt > '2012-01-02' and cal_dt < '2012-01-04' and lstg_site_id not in (0, 2, 3) group by cal_dt\";\n val notInMappingSql0 = sqlBase\n + \"where cal_dt > '2012-01-02' and cal_dt < '2012-01-04' and lstg_format_name not in ('FP-GTC', 'ABIN', 'Auction') group by cal_dt\";\n val notInMixSql0 = sqlBase\n + \"where cal_dt > '2012-01-02' and cal_dt < '2012-01-04' and lstg_site_id not in (0, 2, 3) and lstg_format_name not in ('FP-GTC', 'ABIN', 'Auction') group by cal_dt\";\n expectedRanges.clear();\n expectedRanges.add(segmentRange2);\n expectedRanges.add(segmentRange3);\n expectedPartitionMap.clear();\n expectedPartitionMap.put(segment2Uuid, Lists.newArrayList(1L));\n expectedPartitionMap.put(segment3Uuid, Lists.newArrayList(1L));\n assertPrunedSegmentsRange(project, notInSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n assertPrunedSegmentsRange(project, notInMappingSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n assertPrunedSegmentsRange(project, notInMixSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n\n // return empty data case\n val emptyData = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-03' and lstg_site_id = 5 group by cal_dt\";\n val emptyDataMapping = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-03' and lstg_format_name = 'not_exist_name' group by cal_dt\";\n val emptyDataMix = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-03' and lstg_site_id = 5 and lstg_format_name = 'not_exist_name' group by cal_dt\";\n expectedRanges.clear();\n expectedPartitionMap.clear();\n assertPrunedSegmentsRange(project, emptyData, dfId, expectedRanges, -1L, expectedPartitionMap);\n assertPrunedSegmentsRange(project, emptyDataMapping, dfId, expectedRanges, -1L, expectedPartitionMap);\n assertPrunedSegmentsRange(project, emptyDataMix, dfId, expectedRanges, -1L, expectedPartitionMap);\n\n // query data out of current built segments range\n val inSql0 = sqlBase\n + \"where cal_dt > '2011-12-30' and cal_dt < '2012-01-03' and lstg_site_id in (1, 2) group by cal_dt\";\n val inMappingSql0 = sqlBase\n + \"where cal_dt > '2011-12-30' and cal_dt < '2012-01-03' and lstg_format_name in ('FP-non GTC', 'ABIN') group by cal_dt\";\n val inMixSql0 = sqlBase\n + \"where cal_dt > '2011-12-30' and cal_dt < '2012-01-03' and lstg_site_id in (1, 2) and lstg_format_name in ('FP-non GTC', 'ABIN') group by cal_dt\";\n expectedRanges.add(segmentRange1);\n expectedRanges.add(segmentRange2);\n expectedPartitionMap.put(segment1Uuid, Lists.newArrayList(1L, 2L));\n expectedPartitionMap.put(segment2Uuid, Lists.newArrayList(1L, 2L));\n assertPrunedSegmentsRange(project, inSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n assertPrunedSegmentsRange(project, inMappingSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n assertPrunedSegmentsRange(project, inMixSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n\n val pushDownSql0 = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-03' and lstg_site_id = 3 group by cal_dt\";\n assertNoRealizationFound(project, pushDownSql0);\n\n val pushDownMappingSql0 = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-03' and lstg_format_name = 'Auction' group by cal_dt\";\n assertNoRealizationFound(project, pushDownMappingSql0);\n\n val pushDownMixSql0 = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-03' and lstg_site_id = 3 and lstg_format_name = 'Auction' group by cal_dt\";\n assertNoRealizationFound(project, pushDownMixSql0);\n\n // return empty result\n val wrongMapping0 = sqlBase\n + \"where cal_dt between '2012-01-01' and '2012-01-02' and lstg_site_id = 0 and lstg_format_name = 'FP-non GTC' group by cal_dt\";\n assertPrunedSegmentsRange(project, wrongMapping0, dfId, null, -1L, null);\n\n val orSql0 = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-02' and (lstg_site_id = 0 or lstg_format_name = 'FP-non GTC') group by cal_dt\";\n expectedRanges.clear();\n expectedPartitionMap.clear();\n expectedRanges.add(segmentRange1);\n expectedPartitionMap.put(segment1Uuid, Lists.newArrayList(0L, 1L));\n assertPrunedSegmentsRange(project, orSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n }", "boolean hasCluster();", "@Test\n\t public void test_Is_Subset_Negative() throws Exception{\t\n\t\t SET setarray= new SET( new int[]{1,2,3,4,5});\n\t\t SET subsetarray= new SET( new int[]{7,8});\n\t\t assertFalse(setarray.isSubSet(subsetarray));\t \n\t }", "static public int getAtLeastKVisitors(int[][] rectangles, int k) {\n\n if(rectangles.length==0)\n return 0;\n if(k > rectangles.length)\n return 0;\n\n TreeSet<Rectangle> avlTree = new TreeSet<>();//To store the rectangles ordered\n TreeSet<Integer> Ys = new TreeSet<>();\n\n for(int[] coordinates: rectangles) {\n //x2 = x2 + 1 , y2 = y2 +1 for the inclusive constraints\n Rectangle r = new Rectangle(coordinates[0], coordinates[1], coordinates[2]+1, coordinates[3]+1);\n avlTree.add(r);\n if(!Ys.contains(r.getY1()))\n Ys.add(r.getY1());\n if(!Ys.contains(r.getY2()))\n Ys.add(r.getY2());\n }\n\n int ans = 0;\n Iterator<Integer> yIterator = Ys.iterator();\n int previousY = yIterator.next();\n\n //Traverse by slices of Y's\n while(yIterator.hasNext()) {\n\n int currentY = yIterator.next();\n List<int[]> segments = new ArrayList<>();\n Iterator<Rectangle> treeIterator = avlTree.iterator();\n\n //Look for the rectangles that fall in the slice and create a segment's list\n while(treeIterator.hasNext()) {\n Rectangle r = treeIterator.next();\n //We stop traversing the tree once the rectangles are completely above the slice\n if(r.getY1()>currentY)\n break;\n if(r.getY1()<= previousY && r.getY2()>=currentY) {\n int[] segmentL = new int[2]; int[] segmentR = new int[2];\n segmentL[0] = r.getX1(); segmentL[1] = Type.OPEN.getValue();\n segmentR[0] = r.getX2(); segmentR[1] = Type.CLOSED.getValue();\n segments.add(segmentL); segments.add(segmentR);\n }\n //We remove the rectangles that are left behind by the slice\n if(r.getY2() < previousY)\n treeIterator.remove();\n }\n\n //Sort the segments to analyze them\n Collections.sort(segments, (a, b) -> Integer.compare(a[0], b[0]));\n Iterator<int[]> it = segments.iterator();\n int[] segmentEnd, segmentStart = it.next();\n int nRectangles = Type.OPEN.getValue(); //The first interval will always be opening\n\n while(it.hasNext()) {\n segmentEnd = it.next();\n if(nRectangles >=k) {\n ans+= (currentY - previousY) * (segmentEnd[0] - segmentStart[0]);\n }\n segmentStart = segmentEnd;\n nRectangles += segmentEnd[1];\n }\n\n previousY = currentY;\n }\n\n return ans;\n }", "public void testSortOnComputedColumn() throws Exception {\n \t\tccName = new String[] { \"ccc\", \"ccc2\" };\n \t\tccExpr = new String[] { \"row.COL0+row.COL1\",\n \t\t\t\t\"row.COL1+10\" };\n \t\tfor (int i = 0; i < ccName.length; i++) {\n \t\t\tComputedColumn computedColumn = new ComputedColumn(ccName[i],\n \t\t\t\t\tccExpr[i], DataType.INTEGER_TYPE);\n \t\t\t((BaseDataSetDesign) this.dataSet)\n \t\t\t\t\t.addComputedColumn(computedColumn);\n \t\t}\n \n \t\tString[] bindingNameSort = new String[1];\n \t\tbindingNameSort[0] = \"SORT_DEFINITION\";\n \t\tIBaseExpression[] bindingExprSort = new IBaseExpression[1];\n \t\tbindingExprSort[0] = new ScriptExpression(\n \t\t\t\t\"dataSetRow.ccc/Total.ave(dataSetRow.ccc)\");\n \t\tSortDefinition[] sortDefn = new SortDefinition[] { new SortDefinition() };\n \t\tsortDefn[0].setExpression(\"row.SORT_DEFINITION\");\n \t\tsortDefn[0].setSortDirection(ISortDefinition.SORT_DESC);\n \n \t\tString[] bindingNameRow = new String[6];\n \t\tbindingNameRow[0] = \"ROW_COL0\";\n \t\tbindingNameRow[1] = \"ROW_COL1\";\n \t\tbindingNameRow[2] = \"ROW_COL2\";\n \t\tbindingNameRow[3] = \"ROW_COL3\";\n \t\tbindingNameRow[4] = \"ROW_ccc\";\n \t\tbindingNameRow[5] = \"ROW_ccc2\";\n \t\tScriptExpression[] bindingExprRow = new ScriptExpression[] {\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL0\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL1\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL2\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL3\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + ccName[0], 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + ccName[1], 0), };\n \n \t\tIResultIterator resultIt = this.executeQuery(this.createQuery(null,\n \t\t\t\tnull, null, bindingNameSort, bindingExprSort, sortDefn, null,\n \t\t\t\tnull, null, bindingNameRow, bindingExprRow));\n \n \t\tprintResult(resultIt, bindingNameRow, bindingExprRow);\n \t\t// assert\n \t\tcheckOutputFile();\n \n \t}", "@Test\n public void testBoundsAsCompositesWithEqAndInRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n Restriction eq = newSingleEq(cfMetaData, 0, value1);\n Restriction in = newSingleIN(cfMetaData, 1, value1, value2, value3);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(in);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.START);\n assertComposite(bounds.get(2), value1, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value1, EOC.END);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n assertComposite(bounds.get(2), value1, value3, EOC.END);\n }", "@Test\n public void should_iterate_with_partition_keys_and_partition_keys_IN() throws Exception {\n //Given\n long partitionKey = RandomUtils.nextLong(0,Long.MAX_VALUE);\n\n insertCompositeClusteredValues(partitionKey,\"bucket1\",1,\"name1\",1);\n insertCompositeClusteredValues(partitionKey,\"bucket2\",1,\"name2\",1);\n insertCompositeClusteredValues(partitionKey,\"bucket3\",1,\"name3\",1);\n\n //When\n final Iterator<CompositeClusteredEntity> iterator = manager.sliceQuery(CompositeClusteredEntity.class)\n .forIteration()\n .withPartitionComponents(partitionKey)\n .andPartitionComponentsIN(\"bucket1\", \"bucket3\")\n .iterator();\n\n //Then\n assertThat(iterator.hasNext()).isTrue();\n CompositeClusteredEntity next = iterator.next();\n assertThat(next.getId().getId()).isEqualTo(partitionKey);\n assertThat(next.getId().getBucket()).isEqualTo(\"bucket1\");\n assertThat(next.getId().getName()).isEqualTo(\"name11\");\n assertThat(next.getValue()).isEqualTo(\"value11\");\n\n assertThat(iterator.hasNext()).isTrue();\n next = iterator.next();\n assertThat(next.getId().getId()).isEqualTo(partitionKey);\n assertThat(next.getId().getBucket()).isEqualTo(\"bucket3\");\n assertThat(next.getId().getName()).isEqualTo(\"name31\");\n assertThat(next.getValue()).isEqualTo(\"value11\");\n }", "public static ASTNode evaluateSlice(ASTNode compound_matrix, ArrayList<ASTNode> indices) {\n\t if(indices.size()==0) {\n\t assert !(compound_matrix instanceof CompoundMatrix || compound_matrix instanceof EmptyMatrix);\n\t return compound_matrix;\n\t }\n\t \n\t ASTNode sliceindex=indices.get(0);\n\t \n\t if(compound_matrix instanceof EmptyMatrix) {\n // Construct new matrix domain for empty matrix.\n // First get the matrix domain for compound_matrix (which is itself an empty matrix)\n ASTNode matdom=compound_matrix.getChild(0);\n \n // Get indices\n ArrayList<ASTNode> empty_idx=matdom.getChildren(3);\n \n assert empty_idx.size()==indices.size();\n \n for(int i=empty_idx.size()-1; i>=0; i--) {\n if(! indices.get(i).equals(new IntegerDomain(new Range(null, null)))) {\n // If indices.get(i) is a constant, remove that dimension. \n empty_idx.remove(i);\n }\n }\n \n return new EmptyMatrix(new MatrixDomain(compound_matrix.getChild(0).getChild(0), // get original base domain. \n empty_idx));\n }\n\t \n // Must be a compound matrix from here on. \n if(sliceindex.isSet()) {\n assert ! sliceindex.isFiniteSetUpper() && ! sliceindex.isFiniteSetLower(); // Should be ..\n ArrayList<ASTNode> newcm=new ArrayList<ASTNode>();\n \n ArrayList<ASTNode> restindices=new ArrayList<ASTNode>(indices);\n restindices.remove(0);\n \n for(int i=1; i<compound_matrix.numChildren(); i++) {\n ASTNode tmp=evaluateSlice(compound_matrix.getChildConst(i), restindices);\n if(tmp==null) return null;\n newcm.add(tmp);\n }\n return new CompoundMatrix(compound_matrix.getChild(0), newcm); // Take index domain from original CM.\n\t }\n\t else {\n\t // This index must be a constant\n\t ArrayList<Long> cmindex;\n if(compound_matrix instanceof CompoundMatrix) {\n cmindex=compound_matrix.getChild(0).getValueSet();\n }\n else if (compound_matrix instanceof EmptyMatrix) {\n cmindex=new ArrayList<Long>();\n }\n else {\n cmindex=null;\n }\n\t \n\t long val=sliceindex.getValue();\n\t int idxval=cmindex.indexOf(val);\n\t \n\t if(idxval==-1) {\n\t // Matrix is indexed out of range. Undefined. Delay evaluation. \n\t return null;\n\t }\n\t \n ArrayList<ASTNode> restindices=new ArrayList<ASTNode>(indices);\n restindices.remove(0);\n\t \n\t return evaluateSlice(compound_matrix.getChildConst(idxval+1), restindices);\n\t }\n\t}", "@Nullable\n public abstract GridAxis subset(GridSubset params, Formatter errlog);", "Boolean isValid(ArrayList<Integer> colQ){\n \n int curcol = colQ.size() - 1;\n int row = colQ.get(colQ.size() - 1);\n\n int i = 0;\n int j = 0;\n for(i = curcol-1, j = 1; i >= 0; i--, j++)\n {\n // check if we have two of the same row || check diags\n if(row == colQ.get(i) || row+j == colQ.get(i) || row-j == colQ.get(i)) return false;\n }\n return true;\n \n }", "private boolean checkColoumnForOctPair(int j1, int j2) {\n for(int i=0;i<4;i++)\r\n {\r\n if(Kmap[i][j1]==0 || Kmap[i][j1]==-1)\r\n return false;\r\n }\r\n for(int i=0;i<4;i++)\r\n {\r\n if(Kmap[i][j2]==0 || Kmap[i][j2]==-1)\r\n return false;\r\n }\r\n for(int i=0;i<4;i++)\r\n {\r\n Kmap[i][j1]=-1;\r\n }\r\n for(int i=0;i<4;i++)\r\n {\r\n Kmap[i][j2]=-1;\r\n } \r\n return true; \r\n }", "private static Restriction newSingleSlice(CFMetaData cfMetaData, int index, Bound bound, boolean inclusive, ByteBuffer value)\n {\n ColumnDefinition columnDef = getClusteringColumnDefinition(cfMetaData, index);\n return new SingleColumnRestriction.Slice(columnDef, bound, inclusive, toTerm(value));\n }", "public void checkBounds() {\n\t\tfor (int k = 0; k < numDataCols; k++) {\n\t\t\tDashDataType<?> dtype = dataTypes[k];\n\n\t\t\tif ( dtype instanceof StringDashDataType ) {\n\t\t\t\tStringDashDataType strtype = (StringDashDataType) dtype;\n\t\t\t\tfor (int j = 0; j < numSamples; j++) {\n\t\t\t\t\tADCMessage msg = strtype.boundsCheckStandardValue(\n\t\t\t\t\t\t\t\t\t\t\t(String) stdObjects[j][k]);\n\t\t\t\t\tif ( msg != null ) {\n\t\t\t\t\t\tmsg.setRowNumber(j+1);\n\t\t\t\t\t\tmsg.setColNumber(k+1);\n\t\t\t\t\t\tmsg.setColName(userColNames[k]);\n\t\t\t\t\t\tstdMsgList.add(msg);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if ( dtype instanceof CharDashDataType ) {\n\t\t\t\tCharDashDataType chartype = (CharDashDataType) dtype;\n\t\t\t\tfor (int j = 0; j < numSamples; j++) {\n\t\t\t\t\tADCMessage msg = chartype.boundsCheckStandardValue(\n\t\t\t\t\t\t\t\t\t\t\t(Character) stdObjects[j][k]);\n\t\t\t\t\tif ( msg != null ) {\n\t\t\t\t\t\tmsg.setRowNumber(j+1);\n\t\t\t\t\t\tmsg.setColNumber(k+1);\n\t\t\t\t\t\tmsg.setColName(userColNames[k]);\n\t\t\t\t\t\tstdMsgList.add(msg);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if ( dtype instanceof IntDashDataType ) {\n\t\t\t\tIntDashDataType inttype = (IntDashDataType) dtype;\n\t\t\t\tfor (int j = 0; j < numSamples; j++) {\n\t\t\t\t\tADCMessage msg = inttype.boundsCheckStandardValue(\n\t\t\t\t\t\t\t\t\t\t\t(Integer) stdObjects[j][k]);\n\t\t\t\t\tif ( msg != null ) {\n\t\t\t\t\t\tmsg.setRowNumber(j+1);\n\t\t\t\t\t\tmsg.setColNumber(k+1);\n\t\t\t\t\t\tmsg.setColName(userColNames[k]);\n\t\t\t\t\t\tstdMsgList.add(msg);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if ( dtype instanceof DoubleDashDataType ) {\n\t\t\t\tDoubleDashDataType dbltype = (DoubleDashDataType) dtype;\n\t\t\t\tfor (int j = 0; j < numSamples; j++) {\n\t\t\t\t\tADCMessage msg = dbltype.boundsCheckStandardValue(\n\t\t\t\t\t\t\t\t\t\t\t(Double) stdObjects[j][k]);\n\t\t\t\t\tif ( msg != null ) {\n\t\t\t\t\t\tmsg.setRowNumber(j+1);\n\t\t\t\t\t\tmsg.setColNumber(k+1);\n\t\t\t\t\t\tmsg.setColName(userColNames[k]);\n\t\t\t\t\t\tstdMsgList.add(msg);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthrow new IllegalArgumentException(\"unexpected data type encountered \" + \n\t\t\t\t\t\t\"in bounds checking: \" + dtype);\n\t\t\t}\n\t\t}\n\t}", "private int restrictSection(Message msg, String parameter) {\n int sec = Integer.parseInt(parameter);\n\n if(sec > 2) {\n MessageChannel ch = msg.getChannel();\n ch.sendMessage(\"`Error: Invalid query [section not 0-2]. Query terminated.`\").queue();\n return -1;\n }\n else if(sec == 2) {\n partTwo = true;\n upperProblem = 8;\n }\n\n return sec;\n }", "@Test\n public void testFilterPushDown() throws IOException { 'bla' as (x, y);\n // B = load 'morebla' as (a, b);\n // C = join A on x, B on a;\n // D = filter C by x = a and x = 0 and b = 1 and y = b;\n // store D into 'whatever';\n \n // A = load\n LogicalPlan lp = new LogicalPlan();\n {\n \tLogicalSchema aschema = new LogicalSchema();\n \taschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"x\", null, DataType.INTEGER));\n \taschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"y\", null, DataType.INTEGER));\n \taschema.getField(0).uid = 1;\n \taschema.getField(1).uid = 2;\n \tLOLoad A = new LOLoad(new FileSpec(\"bla\", new FuncSpec(\"PigStorage\", \"\\t\")), aschema, lp);\n \tlp.add(A);\n\t \n \t// B = load\n \tLogicalSchema bschema = new LogicalSchema();\n \tbschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"a\", null, DataType.INTEGER));\n \tbschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"b\", null, DataType.INTEGER));\n \tbschema.getField(0).uid = 3;\n \tbschema.getField(1).uid = 4;\n \tLOLoad B = new LOLoad(null, bschema, lp);\n \tlp.add(B);\n\t \n \t// C = join\n \tLogicalSchema cschema = new LogicalSchema();\n \tcschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"x\", null, DataType.INTEGER));\n \tcschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"y\", null, DataType.INTEGER));\n \tcschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"a\", null, DataType.INTEGER));\n \tcschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"b\", null, DataType.INTEGER));\n \tcschema.getField(0).uid = 1;\n \tcschema.getField(1).uid = 2;\n \tcschema.getField(2).uid = 3;\n \tcschema.getField(3).uid = 4;\n \tLogicalExpressionPlan aprojplan = new LogicalExpressionPlan();\n \tProjectExpression x = new ProjectExpression(aprojplan, DataType.INTEGER, 0, 0);\n \tx.neverUseForRealSetUid(1);\n \tLogicalExpressionPlan bprojplan = new LogicalExpressionPlan();\n \tProjectExpression y = new ProjectExpression(bprojplan, DataType.INTEGER, 1, 0);\n \ty.neverUseForRealSetUid(3);\n \tMultiMap<Integer, LogicalExpressionPlan> mm = \n \tnew MultiMap<Integer, LogicalExpressionPlan>();\n \tmm.put(0, aprojplan);\n \tmm.put(1, bprojplan);\n \tLOJoin C = new LOJoin(lp, mm, JOINTYPE.HASH, new boolean[] {true, true});\n \tC.neverUseForRealSetSchema(cschema);\n \tlp.add(C);\n \tlp.connect(A, C);\n \tlp.connect(B, C);\n \n \t// D = filter\n \tLogicalExpressionPlan filterPlan = new LogicalExpressionPlan();\n \tProjectExpression fx = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 0);\n \tfx.neverUseForRealSetUid(1);\n \tConstantExpression fc0 = new ConstantExpression(filterPlan, DataType.INTEGER, new Integer(0));\n \tEqualExpression eq1 = new EqualExpression(filterPlan, fx, fc0);\n \tProjectExpression fanotherx = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 0);\n \tfanotherx.neverUseForRealSetUid(1);\n \tProjectExpression fa = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 2);\n \tfa.neverUseForRealSetUid(3);\n \tEqualExpression eq2 = new EqualExpression(filterPlan, fanotherx, fa);\n \tAndExpression and1 = new AndExpression(filterPlan, eq1, eq2);\n \tProjectExpression fb = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 3);\n \tfb.neverUseForRealSetUid(4);\n \tConstantExpression fc1 = new ConstantExpression(filterPlan, DataType.INTEGER, new Integer(1));\n \tEqualExpression eq3 = new EqualExpression(filterPlan, fb, fc1);\n \tAndExpression and2 = new AndExpression(filterPlan, and1, eq3);\n \tProjectExpression fanotherb = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 3);\n \tfanotherb.neverUseForRealSetUid(4);\n \tProjectExpression fy = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 1);\n \tfy.neverUseForRealSetUid(2);\n \tEqualExpression eq4 = new EqualExpression(filterPlan, fy, fanotherb);\n \tnew AndExpression(filterPlan, and2, eq4);\n \n \tLOFilter D = new LOFilter(lp, filterPlan);\n \tD.neverUseForRealSetSchema(cschema);\n \t// Connect D to B, since the transform has happened.\n \tlp.add(D);\n \tlp.connect(C, D);\n }\n \n LogicalPlanOptimizer optimizer = new LogicalPlanOptimizer(lp, 500);\n optimizer.optimize();\n \n LogicalPlan expected = new LogicalPlan();\n {\n // A = load\n \tLogicalSchema aschema = new LogicalSchema();\n \taschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"x\", null, DataType.INTEGER));\n \taschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"y\", null, DataType.INTEGER));\n \taschema.getField(0).uid = 1;\n \taschema.getField(1).uid = 2;\n \tLOLoad A = new LOLoad(new FileSpec(\"bla\", new FuncSpec(\"PigStorage\", \"\\t\")), aschema, expected);\n \texpected.add(A);\n \t\n \t// DA = filter\n \tLogicalExpressionPlan DAfilterPlan = new LogicalExpressionPlan();\n \tProjectExpression fx = new ProjectExpression(DAfilterPlan, DataType.INTEGER, 0, 0);\n \tfx.neverUseForRealSetUid(1);\n \tConstantExpression fc0 = new ConstantExpression(DAfilterPlan, DataType.INTEGER, new Integer(0));\n \tnew EqualExpression(DAfilterPlan, fx, fc0);\n\t \n \tLOFilter DA = new LOFilter(expected, DAfilterPlan);\n \tDA.neverUseForRealSetSchema(aschema);\n \texpected.add(DA);\n \texpected.connect(A, DA);\n\t \n \t// B = load\n \tLogicalSchema bschema = new LogicalSchema();\n \tbschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"a\", null, DataType.INTEGER));\n \tbschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"b\", null, DataType.INTEGER));\n \tbschema.getField(0).uid = 3;\n \tbschema.getField(1).uid = 4;\n \tLOLoad B = new LOLoad(null, bschema, expected);\n \texpected.add(B);\n \t\n \t// DB = filter\n \tLogicalExpressionPlan DBfilterPlan = new LogicalExpressionPlan();\n \tProjectExpression fb = new ProjectExpression(DBfilterPlan, DataType.INTEGER, 0, 1);\n \tfb.neverUseForRealSetUid(4);\n \tConstantExpression fc1 = new ConstantExpression(DBfilterPlan, DataType.INTEGER, new Integer(1));\n \tnew EqualExpression(DBfilterPlan, fb, fc1);\n\t \n \tLOFilter DB = new LOFilter(expected, DBfilterPlan);\n \tDB.neverUseForRealSetSchema(bschema);\n \texpected.add(DB);\n \texpected.connect(B, DB);\n\t \n \t// C = join\n \tLogicalSchema cschema = new LogicalSchema();\n \tcschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"x\", null, DataType.INTEGER));\n \tcschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"y\", null, DataType.INTEGER));\n \tcschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"a\", null, DataType.INTEGER));\n \tcschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"b\", null, DataType.INTEGER));\n \tcschema.getField(0).uid = 1;\n \tcschema.getField(1).uid = 2;\n \tcschema.getField(2).uid = 3;\n \tcschema.getField(3).uid = 4;\n \tLogicalExpressionPlan aprojplan = new LogicalExpressionPlan();\n \tProjectExpression x = new ProjectExpression(aprojplan, DataType.INTEGER, 0, 0);\n \tx.neverUseForRealSetUid(1);\n \tLogicalExpressionPlan bprojplan = new LogicalExpressionPlan();\n \tProjectExpression y = new ProjectExpression(bprojplan, DataType.INTEGER, 1, 0);\n \ty.neverUseForRealSetUid(3);\n \tMultiMap<Integer, LogicalExpressionPlan> mm = \n \tnew MultiMap<Integer, LogicalExpressionPlan>();\n \tmm.put(0, aprojplan);\n \tmm.put(1, bprojplan);\n \tLOJoin C = new LOJoin(expected, mm, JOINTYPE.HASH, new boolean[] {true, true});\n \tC.neverUseForRealSetSchema(cschema);\n \texpected.add(C);\n \texpected.connect(DA, C);\n \texpected.connect(DB, C);\n\t \n \t// D = filter\n \tLogicalExpressionPlan filterPlan = new LogicalExpressionPlan();\n \tProjectExpression fanotherx = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 0);\n \tfanotherx.neverUseForRealSetUid(1);\n \tProjectExpression fa = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 2);\n \tfa.neverUseForRealSetUid(3);\n \tEqualExpression eq2 = new EqualExpression(filterPlan, fanotherx, fa);\n \tProjectExpression fanotherb = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 3);\n \tfanotherb.neverUseForRealSetUid(4);\n \tProjectExpression fy = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 1);\n \tfy.neverUseForRealSetUid(2);\n \tEqualExpression eq4 = new EqualExpression(filterPlan, fy, fanotherb);\n \tnew AndExpression(filterPlan, eq2, eq4);\n\t \n \tLOFilter D = new LOFilter(expected, filterPlan);\n \tD.neverUseForRealSetSchema(cschema);\n \texpected.add(D);\n \texpected.connect(C, D);\n }\n \n assertTrue( lp.isEqual(expected) );\n // assertEquals(lp, expected);\n }", "List<Collect> selectByExampleWithRowbounds(CollectExample example, RowBounds rowBounds);", "private static <T> int med3(T x[], Comparator<T> comp, int a, int b, int c) {\n\t\treturn (comp.compare(x[a],x[b])<0 ?\n\t\t\t\t(comp.compare(x[b],x[c])<0 ? b : comp.compare(x[a],x[c])<0 ? c : a) :\n\t\t\t\t\t(comp.compare(x[b],x[c])>0 ? b : comp.compare(x[a],x[c])>0 ? c : a));\n\t}", "private ArrayList<Integer> coverSatisfiedColumns(boolean[] ecmCoveredCols, int rowIndex)\n {\n ArrayList<Integer> coveredCols = new ArrayList<>();\n for(int j = 0; j < dimSquared * CONSTRAINTS; j++)\n {\n if(ecMatrix[rowIndex][j])\n {\n ecmCoveredCols[j] = true;\n coveredCols.add(j);\n }\n }\n return coveredCols;\n }", "static boolean isSubset(int Tab1[], int Tab2[], int m, int n)\n {\n // compléter\n //Trouver le max de Tab1[]\n int max=Tab1[0];\n for(int i = 1; i < m; i++) {\n\t\t\tif (Tab1[i]>max){\n max=Tab1[i];\n }\n\t\t}\n \n\t\t//Stockage de la Tab1 dans une table de hashage\n\t\tint[] hashTable = new int[max];\n\t\tfor(int i = 0; i < m; i++) {\n\t\t\thashTable[hash(Tab1[i], max)] = Tab1[i];\n\t\t}\n\t\t\n\t\t//verifier que chaque element (de Tab2) existe dans la hashtable\n\t\tfor(int j = 0; j < n; j++) {\n\t\t\tif(Tab2[j] != hashTable[hash(Tab2[j], max)]) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t}\n return true;\n \n //Complexite aymptotique :\n /*\n Puisque la boucle qui a le plus d'itérations est celle avec l'élément m, la compléxité\n asymptotique est O(m).\n f(m,n) = 2m + n = O(m), puisque m > n\n */\n \n\n }", "public abstract Optional<GridAxis> subsetDependent(GridAxis1D subsetIndAxis, Formatter errlog);", "public static void main(String[]args){\n\r\n int []arr = new int[100];\r\n int []arr2 = new int[50];\r\n int []arr3 = {1,2,3,4,5,6,7,8};\r\n int number = 5;\r\n LogicalOp op = new LogicalOp();\r\n// op.writeOnArray(arr);\r\n\r\n// arr2 = op.evenArray(arr2);\r\n// for(int i=0;i<arr2.length;i++)\r\n// System.out.println(arr2[i]);\r\n\r\n //System.out.println(\"Mean value: \"+op.meanValue(arr3));\r\n\r\n// String[] arrOfStr = {\"ana\",\"are\",\"mere\",\"pere\",\"mere\"};\r\n// String str = \"mere\";\r\n// System.out.println(op.isContaingString(arrOfStr,str));\r\n\r\n// System.out.println(op.findPosition(arr3,number));\r\n\r\n //op.displayLines();\r\n\r\n// int[]modifArr = op.modifiedArr(arr3,number);\r\n// for(int item: modifArr)\r\n// System.out.print(item+\" \");\r\n\r\n\r\n //System.out.println(\"Second minimum: \"+op.secondMin(arr3));\r\n\r\n int[] empty = new int[arr3.length];\r\n empty = op.populateArray(arr3,empty);\r\n for(int item:empty)\r\n System.out.print(item+\" \");\r\n\r\n\r\n\r\n }", "public void testGetColumnIndex() {\n TaskSeriesCollection c = createCollection1();\n }", "private List<Set<BitSet>> buildPFunction(boolean[][] table, boolean[] coveredMinterms) {\n\n\t\tList<Set<BitSet>> pFunction = new ArrayList<>();\n\n\t\tfor (int i = 0; i < coveredMinterms.length; i++) {\n\n\t\t\tSet<BitSet> currentColumn = new LinkedHashSet<>();\n\n\t\t\tfor (int j = 0; j < table.length; j++) {\n\n\t\t\t\tif (table[j][i] && !coveredMinterms[i]) {\n\t\t\t\t\tBitSet current = new BitSet();\n\t\t\t\t\tcurrent.set(j);\n\t\t\t\t\tcurrentColumn.add(current);\n\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (currentColumn.size() > 0) {\n\t\t\t\tpFunction.add(currentColumn);\n\t\t\t}\n\t\t}\n\t\treturn pFunction;\n\t}", "protected void checkSlice(int slice) {\n\tif (slice < 0 || slice >= slices) throw new IndexOutOfBoundsException(\"Attempted to access \"+toStringShort()+\" at slice=\"+slice);\n}", "public boolean percolates() {\n\t\tint top = uf.find(0);\n\t\tint bottom = uf.find(size * size + 1);\n\t\treturn top == bottom;\n\t}", "default DiscreteSet2D subLevelSet(double value) {\r\n\t\treturn pointsSatisfying(d -> d <= value);\r\n\t}", "@Test\n \tpublic void whereClauseForNodeLeftOverlap() {\n \t\tnode23.addJoin(new LeftOverlap(node42));\n \t\tcheckWhereCondition(\n \t\t\t\tjoin(\"=\", \"_node23.text_ref\", \"_node42.text_ref\"),\n \t\t\t\tjoin(\"<=\", \"_node23.left\", \"_node42.left\"),\n \t\t\t\tjoin(\"<=\", \"_node42.left\", \"_node23.right\"),\n \t\t\t\tjoin(\"<=\", \"_node23.right\", \"_node42.right\")\n \t\t);\n \t}", "private Boolean isValidColumnMatrix(SimpleMatrix matrix) {\n\t\tInteger nrows = matrix.numRows();\n\t\tInteger ncols = matrix.numCols();\n\n\t\treturn (ncols == 1) && (nrows == 3);\n\t}", "Condition(Column col1, String relation, Column col2) {\n // YOUR CODE HERE\n }", "boolean hasPivot();", "@Test void firstRow1and2() {\n\t\tcheckFirstRow1and2(false,5,4);\n\n\t\t// X X X X\n\t\t// X X X X X\n\t\tcheckFirstRow1and2(true,4,5);\n\n\t\t// X\n\t\t// x\n\t\tcheckFirstRow1and2(false,1,1);\n\n\t\t// X\n\t\t// x\n\t\tcheckFirstRow1and2(true,1,1);\n\t}", "public void testNestedComputedColumn( ) throws Exception\n \t{\n \t\tccName = new String[] { \"cc1\", \"cc2\", \"cc3\" };\n \t\tccExpr = new String[] {\n \t\t\t\t\"row.COL0+row.COL1\",\n \t\t\t\t\"row.cc1*100\",\n \t\t\t\t\"Total.runningSum(row.cc1/Total.sum(row.cc1))*100\" };\n \n \t\tfor (int i = 0; i < ccName.length; i++) {\n \t\t\tComputedColumn computedColumn = new ComputedColumn(ccName[i],\n \t\t\t\t\tccExpr[i], DataType.ANY_TYPE);\n \t\t\t((BaseDataSetDesign) this.dataSet)\n \t\t\t\t\t.addComputedColumn(computedColumn);\n \t\t}\n \t\t\n \t\tString[] bindingNameRow = new String[7];\n \t\tbindingNameRow[0] = \"ROW_COL0\";\n \t\tbindingNameRow[1] = \"ROW_COL1\";\n \t\tbindingNameRow[2] = \"ROW_COL2\";\n \t\tbindingNameRow[3] = \"ROW_COL3\";\n \t\tbindingNameRow[4] = \"ROW_cc1\";\n \t\tbindingNameRow[5] = \"ROW_cc2\";\n \t\tbindingNameRow[6] = \"ROW_cc3\";\n \t\tScriptExpression[] bindingExprRow = new ScriptExpression[] {\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL0\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL1\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL2\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL3\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + ccName[0], 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + ccName[1], 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + ccName[2], 0) };\n \n \t\tIResultIterator resultIt = this.executeQuery(this.createQuery(null,\n \t\t\t\tnull, null, null, null, null, null, null, null, bindingNameRow,\n \t\t\t\tbindingExprRow));\n \n \t\tprintResult(resultIt, bindingNameRow, bindingExprRow);\n \t\t// assert\n \t\tcheckOutputFile();\n \t\t\n \t}", "private List<Integer> chooseInnerModelFeatureColumns(Matrix inputs, Matrix labels)\n\t{\n\t\tMatrix inputsShuffled = new Matrix(inputs);\n\t\tMatrix labelsShuffled = new Matrix(labels);\n\t\tinputs = null;\n\t\tlabels = null;\n\t\tinputsShuffled.shuffle(rand, labelsShuffled);\n\n\t\tMatrix[] sets = createValidationSet(inputsShuffled, labelsShuffled, validationSetPercent);\n\t\tMatrix tInputs = sets[0];\n\t\tMatrix tLabels = sets[1];\n\t\tMatrix vInputs = sets[2];\n\t\tMatrix vLabels = sets[3];\n\n\t\t// Greedily search for the best columns to train model i on.\n\t\t\t\n\t\tList<Integer> keepColumns = new ArrayList<>(featureColumnsToAlwaysUse);\n\t\t\n\t\tdouble lastIterationScore;\n\t\tif (featureColumnsToAlwaysUse.isEmpty())\n\t\t{\n\t\t\tlastIterationScore = Double.NEGATIVE_INFINITY;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tSupervisedLearner initialModel = trainOnColumns(tInputs, tLabels, keepColumns);\n\t\t\tlastIterationScore = validateOnColumns(vInputs, vLabels, keepColumns, initialModel);\n\t\t}\n\t\t\n\t\tLogger.println(\"initial lastIterationScore: \" + lastIterationScore);\n\t\t\n\t\tList<Integer> featureSelectionCols = Helper.iteratorToList(new Range(tInputs.cols()));\n\t\tfeatureSelectionCols.removeAll(featureColumnsToAlwaysUse);\n\t\t\n\t\twhile (!featureSelectionCols.isEmpty())\n\t\t{\n\t\t\t// Find the feature selection column which helps the model the most.\n\t\t\tTuple2<Integer, Double> bestTuple = featureSelectionCols.stream()\n\t\t\t\t\t.map(c -> \n\t\t\t\t\t{\n\t\t\t\t\t\tList<Integer> columns = new ArrayList<>(keepColumns);\n\t\t\t\t\t\tcolumns.add(c);\n\t\t\t\t\t\tSupervisedLearner model = trainOnColumns(tInputs, tLabels, columns);\n\t\t\t\t\t\tdouble score = validateOnColumns(vInputs, vLabels, columns, model);\n\t\t\t\t\t\treturn new Tuple2<Integer, Double>(c, score);\n\t\t\t\t\t})\n\t\t\t\t\t.max((t1, t2) -> Double.compare(t1.getSecond(), t2.getSecond())).get();\n\n\t\t\tif (bestTuple.getSecond() > lastIterationScore)\n\t\t\t{\n\t\t\t\tLogger.println(\"Keeping column \" + bestTuple.getFirst() + \", new score: \" + bestTuple.getSecond());\n\t\t\t\tkeepColumns.add(bestTuple.getFirst());\n\t\t\t\tfeatureSelectionCols.remove(bestTuple.getFirst());\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tlastIterationScore = bestTuple.getSecond();\n\t\t}\n\t\t\n\t\treturn keepColumns;\n\t}", "public void testGetSubDimensionality()\n {\n RandomSubVectorThresholdLearner<String> instance = new RandomSubVectorThresholdLearner<String>();\n\n instance.setPercentToSample(0.5);\n assertEquals(5, instance.getSubDimensionality(10));\n\n instance.setPercentToSample(0.25);\n assertEquals(2, instance.getSubDimensionality(9));\n\n instance.setPercentToSample(1.0);\n assertEquals(9, instance.getSubDimensionality(9));\n\n instance.setPercentToSample(0.0);\n assertEquals(1, instance.getSubDimensionality(9));\n }", "public List<Integer> selectRangeWherePar(byte[][] selectCols, byte[] whereCol, long value1, long value2, ResultSet result){\n List<Integer> oidList = new ArrayList<Integer>();\n \n //assuming the where col is in type LONG\n boolean[] access = new boolean[keyForLong.length];\n int whereIndex = -1;\n \n for(int i = 0; i < keyForLong.length; i++){\n if(keyForLong[i].equals( new String(whereCol) + separator + \"LONG\" )) whereIndex = i;\n \n access[i] = false;\n for(int j = 0; j < selectCols.length; j++){\n if(keyForLong[i].equals( new String(selectCols[j]) + separator + \"LONG\" )){\n access[i] = true;\n break;\n }\n }\n }\n \n int numOfFields = keyForLong.length;\n for(int i = 0; i < numObject; i++){\n //first check if this object meet the where condition\n long value = longValues[i*numOfFields + whereIndex];\n if( (value >= value1) && (value <= value2)){\n //this object meets condition\n int oid=objectIds[i];\n oidList.add(oid);\n \n //select fields in the select clause\n for(int j = 0; j < access.length; j++){\n if(access[j]){\n String key = keyForLong[j];\n if(j == whereIndex){\n result.addLong(key, oid, value);\n continue;\n }\n long longnum = longValues[i*numOfFields + j];\n if(longnum != UNDEFINED)\n result.addLong(key, oid, longnum);\n }\n }\n }\n }\n \n if(oidList.size() > 0){\n //if this partition also has other data types, also select those based on oidList\n if(keyForString.length != 0)\n selectConditionString(oidList, selectCols, result);\n if(keyForDouble.length != 0)\n selectConditionDouble(oidList, selectCols, result);\n if(keyForBool.length != 0)\n selectConditionBool(oidList, selectCols, result);\n }\n return oidList;\n }", "private boolean checkOverlap(int row, int col, int length){\n \tif(!inBounds(row,col)){\n \t\treturn false;\n \t}\n \tfor(int i = row; i < row + length; i++ ){\n\t\t\tfor(int j = col; j < col + length; j++){\n\t\t\t\tif(grid[i][col] == 1 || row + length >= 10)\n\t\t\t\t\treturn false;\n\t\t\t\tif(grid[row][j] == 1 || col + length >= 10)\n\t\t\t\t\treturn false;\n\t\t\t}\n \t\t\n \t}\n \treturn true;\n }", "private int adequateDimensions(int cols, int rows) {\r\n\r\n if ((cols >= MINALG) && (cols <= MAXALG)) {\r\n if ((rows >= MINDATA) && (rows <= MAXDATA)) {\r\n return 0;\r\n } else {\r\n return 1;\r\n }\r\n } else {\r\n return 2;\r\n }\r\n\r\n }", "@Test\n public void testColumnControlInvisibleColumns() {\n final JXTable table = new JXTable(sortableTableModel);\n // columns set to invisible before setting the columnControl\n // will not be inserted into the column control's list\n// table.getColumnExt(\"Last Name\").setVisible(false);\n table.setColumnControlVisible(true);\n int totalColumnCount = table.getColumnCount();\n final TableColumnExt priorityColumn = table.getColumnExt(\"First Name\");\n priorityColumn.setVisible(false);\n ColumnControlButton columnControl = (ColumnControlButton) table.getColumnControl();\n assertNotNull(\"popup menu not null\", columnControl.popup);\n int columnMenuItems = 0;\n Component[] items = ((DefaultColumnControlPopup) columnControl.getColumnControlPopup()).getPopupMenu().getComponents();\n for (int i = 0; i < items.length; i++) {\n if (!(items[i] instanceof JMenuItem)) {\n break;\n }\n columnMenuItems++;\n }\n // wrong assumption - has separator and actions!\n assertEquals(\"menu items must be equal to columns\", totalColumnCount, \n columnMenuItems);\n JCheckBoxMenuItem menuItem = (JCheckBoxMenuItem) ((DefaultColumnControlPopup) columnControl.getColumnControlPopup()).getPopupMenu()\n .getComponent(0);\n // sanit assert\n assertEquals(priorityColumn.getHeaderValue(), menuItem.getText());\n assertEquals(\"selection of menu must be equal to column visibility\", \n priorityColumn.isVisible(), menuItem.isSelected());\n }", "@Test\n void testSubset() throws IOException {\n Long expectedNumberOfVariables = 13L;\n Long expectedNumberOfCases = 24L; // aka the number of lines in the TAB file produced by the ingest plugin\n\n TabularDataIngest ingestResult;\n File file = getFile(\"csv/ingest/election_precincts.csv\");\n try (BufferedInputStream stream = new BufferedInputStream(new FileInputStream(file))) {\n CSVFileReader instance = createInstance();\n ingestResult = instance.read(Tuple.of(stream, file), null);\n }\n\n File generatedTabFile = ingestResult.getTabDelimitedFile();\n DataTable generatedDataTable = ingestResult.getDataTable();\n\n assertThat(generatedDataTable).isNotNull();\n assertThat(generatedDataTable.getDataVariables()).isNotNull();\n assertThat(generatedDataTable.getVarQuantity()).isEqualTo((long) generatedDataTable.getDataVariables().size());\n assertThat(generatedDataTable.getVarQuantity()).isEqualTo(expectedNumberOfVariables);\n assertThat(generatedDataTable.getCaseQuantity()).isEqualTo(expectedNumberOfCases);\n\n // And now let's try and subset the individual vectors\n // First, the \"continuous\" vectors (we should be able to read these as Double[]):\n int[] floatColumns = {2};\n\n Double[][] floatVectors = {\n { 1.0, 3.0, 4.0, 6.0, 7.0, 8.0, 11.0, 12.0, 76.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0 },\n };\n\n IngestDataProvider dataProvider = new InMemoryIngestDataProvider();\n dataProvider.initialize(generatedDataTable, generatedTabFile);\n\n int vectorCount = 0;\n for (int i : floatColumns) {\n // We'll be subsetting the column vectors one by one, re-opening the\n // file each time. Inefficient - but we don't care here.\n\n if (!generatedDataTable.getDataVariables().get(i).isIntervalContinuous()) {\n fail(\"Column \" + i + \" was not properly processed as \\\"continuous\\\"\");\n }\n\n Double[] columnVector = dataProvider.getDoubleColumn(i);\n\n assertThat(columnVector).isEqualTo(floatVectors[vectorCount++]);\n }\n\n // Discrete Numerics (aka, integers):\n int[] integerColumns = { 1, 4, 6, 7, 8, 9, 10, 11, 12 };\n\n Long[][] longVectors = {\n { 1L, 3L, 4L, 6L, 7L, 8L, 11L, 12L, 76L, 77L, 77L, 77L, 77L, 77L, 77L, 77L, 77L, 77L, 77L, 77L, 77L, 77L, 77L, 77L },\n { 1L, 2L, 3L, 4L, 5L, 11L, 13L, 15L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L },\n { 85729227L, 85699791L, 640323976L, 85695847L, 637089796L, 637089973L, 85695001L, 85695077L, 1111111L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L },\n { 205871733L, 205871735L, 205871283L, 258627915L, 257444575L, 205871930L, 260047422L, 262439738L, 1111111L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L },\n { 205871673L, 205871730L, 205871733L, 205872857L, 258627915L, 257444584L, 205873413L, 262439738L, 1111111L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L },\n { 25025000201L, 25025081001L, 25025000701L, 25025050901L, 25025040600L, 25025000502L, 25025040401L, 25025100900L, 1111111L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L },\n { 250250502002L, 250250502003L, 250250501013L, 250250408011L, 250250503001L, 250250103001L, 250250406002L, 250250406001L, 1111111L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L },\n { 250251011024001L, 250251011013003L, 250251304041007L, 250251011013006L, 250251010016000L, 250251011024002L, 250251001005004L, 250251002003002L, 1111111L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L },\n { 2109L, 2110L, 2111L, 2120L, 2121L, 2115L, 2116L, 2122L, 11111L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L }\n };\n\n vectorCount = 0;\n\n for (int i : integerColumns) {\n if (!generatedDataTable.getDataVariables().get(i).isIntervalDiscrete()\n || !generatedDataTable.getDataVariables().get(i).isTypeNumeric()) {\n fail(\"Column \" + i + \" was not properly processed as \\\"discrete numeric\\\"\");\n }\n\n Long[] columnVector = dataProvider.getLongColumn(i);\n\n assertThat(columnVector).isEqualTo(longVectors[vectorCount++]);\n }\n\n // And finally, Strings:\n int[] stringColumns = {0, 3, 5};\n\n String[][] stringVectors = {\n { \"Dog\", \"Squirrel\", \"Antelope\", \"Zebra\", \"Lion\", \"Gazelle\", \"Cat\", \"Giraffe\", \"Cat\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\" },\n { \"East Boston\", \"Charlestown\", \"South Boston\", \"Bronx\", \"Roslindale\", \"Mission Hill\", \"Jamaica Plain\", \"Hyde Park\", \"Fenway/Kenmore\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\" },\n { \"2-06\", \"1-09\", \"1-1A\", \"1-1B\", \"2-04\", \"3-05\", \"1-1C\", \"1-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", }\n };\n\n vectorCount = 0;\n\n for (int i : stringColumns) {\n if (!generatedDataTable.getDataVariables().get(i).isTypeCharacter()) {\n fail(\"Column \" + i + \" was not properly processed as a character vector\");\n }\n String[] columnVector = dataProvider.getStringColumn(i);\n\n assertThat(columnVector).isEqualTo(stringVectors[vectorCount++]);\n }\n }" ]
[ "0.71834785", "0.7169597", "0.7152469", "0.7106035", "0.7053987", "0.6616245", "0.6567298", "0.6455669", "0.6454345", "0.64455014", "0.64141124", "0.60866195", "0.59291726", "0.56778836", "0.5601167", "0.5580621", "0.5569759", "0.5539649", "0.53624284", "0.51680547", "0.5034592", "0.50187397", "0.50050133", "0.4982979", "0.49646097", "0.49372658", "0.4908115", "0.4896858", "0.48930857", "0.48762992", "0.48651868", "0.4840356", "0.48357388", "0.4832057", "0.48172864", "0.48143628", "0.4803358", "0.479832", "0.47937015", "0.47903922", "0.47841573", "0.47749037", "0.47734892", "0.47550023", "0.47401118", "0.47250506", "0.4670777", "0.4661851", "0.46506634", "0.4639026", "0.46375152", "0.46305788", "0.46293744", "0.4620312", "0.46149936", "0.45862597", "0.45837808", "0.45802268", "0.45783046", "0.45750174", "0.45689273", "0.45661545", "0.45657817", "0.4561233", "0.45609728", "0.45501575", "0.4543364", "0.45383775", "0.45285308", "0.4524271", "0.45132875", "0.45111722", "0.45030662", "0.44972673", "0.44763613", "0.44727212", "0.4466738", "0.44614807", "0.4457761", "0.4452186", "0.44476318", "0.444542", "0.4436599", "0.44266376", "0.44203827", "0.44190702", "0.44186294", "0.44147697", "0.44087237", "0.44072953", "0.44045994", "0.43962935", "0.4391182", "0.43903917", "0.43874213", "0.4384618", "0.4380971", "0.43796882", "0.4379043", "0.43788043" ]
0.72136277
0
Test multicolumn slice restrictions with 2 ascending clustering column and 2 descending (e.g '(clustering_0, clustering1, clustering_3, clustering4) > (1, 2, 3, 4)')
@Test public void testBoundsAsCompositesWithMultiSliceRestrictionsWithTwoAscendingAndTwoDescendingClusteringColumns() { CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.DESC, Sort.DESC); ByteBuffer value1 = ByteBufferUtil.bytes(1); ByteBuffer value2 = ByteBufferUtil.bytes(2); ByteBuffer value3 = ByteBufferUtil.bytes(3); ByteBuffer value4 = ByteBufferUtil.bytes(4); // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4) Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4); PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(slice); List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(2, bounds.size()); assertComposite(bounds.get(0), value1, value2, EOC.START); assertComposite(bounds.get(1), value1, value2, EOC.END); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(2, bounds.size()); assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START); assertEmptyComposite(bounds.get(1)); // clustering_0 = 1 AND (clustering_1, clustering_2, clustering_3) > (2, 3, 4) Restriction eq = newSingleEq(cfMetaData, 0, value1); slice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3, value4); restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(slice); restrictions = restrictions.mergeWith(eq); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(2, bounds.size()); assertComposite(bounds.get(0), value1, value2, EOC.START); assertComposite(bounds.get(1), value1, value2, EOC.END); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(2, bounds.size()); assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START); assertComposite(bounds.get(1), value1, EOC.END); // clustering_0 = 1 AND (clustering_1, clustering_2, clustering_3) > (2, 3, 4) Restriction in = newSingleIN(cfMetaData, 0, value1, value2); slice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3, value4); restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(slice); restrictions = restrictions.mergeWith(in); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(4, bounds.size()); assertComposite(bounds.get(0), value1, value2, EOC.START); assertComposite(bounds.get(1), value1, value2, EOC.END); assertComposite(bounds.get(2), value2, value2, EOC.START); assertComposite(bounds.get(3), value2, value2, EOC.END); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(4, bounds.size()); assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START); assertComposite(bounds.get(1), value1, EOC.END); assertComposite(bounds.get(2), value2, value2, value3, value4, EOC.START); assertComposite(bounds.get(3), value2, EOC.END); // (clustering_0, clustering1) >= (1, 2) slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2); restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(slice); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value1, value2, EOC.NONE); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertEmptyComposite(bounds.get(0)); // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4) slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4); restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(slice); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(2, bounds.size()); assertComposite(bounds.get(0), value1, value2, EOC.START); assertComposite(bounds.get(1), value1, value2, EOC.END); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(2, bounds.size()); assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END); assertEmptyComposite(bounds.get(1)); // (clustering_0, clustering1, clustering_2, clustering_3) <= (1, 2, 3, 4) slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2, value3, value4); restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(slice); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(2, bounds.size()); assertEmptyComposite(bounds.get(0)); assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.NONE); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(2, bounds.size()); assertComposite(bounds.get(0), value1, value2, EOC.START); assertComposite(bounds.get(1), value1, value2, EOC.END); // (clustering_0, clustering1, clustering_2, clustering_3) < (1, 2, 3, 4) slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2, value3, value4); restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(slice); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(2, bounds.size()); assertEmptyComposite(bounds.get(0)); assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.END); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(2, bounds.size()); assertComposite(bounds.get(0), value1, value2, EOC.START); assertComposite(bounds.get(1), value1, value2, EOC.END); // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4) AND (clustering_0, clustering_1) < (2, 3) slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4); Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2, value3); restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(slice).mergeWith(slice2); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(2, bounds.size()); assertComposite(bounds.get(0), value1, value2, EOC.START); assertComposite(bounds.get(1), value1, value2, EOC.END); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(2, bounds.size()); assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START); assertComposite(bounds.get(1), value2, value3, EOC.START); // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4) AND (clustering_0, clustering1, clustering_2, clustering_3) <= (4, 3, 2, 1) slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4); slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value4, value3, value2, value1); restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(slice).mergeWith(slice2); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(3, bounds.size()); assertComposite(bounds.get(0), value1, value2, EOC.START); assertComposite(bounds.get(1), value1, value2, EOC.END); assertComposite(bounds.get(2), value4, value3, value2, value1, EOC.NONE); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(3, bounds.size()); assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END); assertComposite(bounds.get(1), value4, value3, EOC.START); assertComposite(bounds.get(2), value4, value3, EOC.END); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneAscendingAndOneDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n assertComposite(bounds.get(2), value2, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertComposite(bounds.get(1), value2, EOC.START);\n assertComposite(bounds.get(2), value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsMixingAscendingDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.DESC, Sort.ASC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(3));\n\n // clustering_0 = 1 AND (clustering_1, clustering_2, clustering_3) > (2, 3, 4)\n Restriction eq = newSingleEq(cfMetaData, 0, value1);\n slice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n restrictions = restrictions.mergeWith(eq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(3));\n\n\n // (clustering_0, clustering1, clustering_2, clustering_3) <= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, value4, EOC.NONE);\n assertComposite(bounds.get(3), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) < (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(3), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4) AND (clustering_0, clustering_1) < (2, 3)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2, value3);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(5, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n assertComposite(bounds.get(4), value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(5, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertComposite(bounds.get(3), value2, EOC.START);\n assertComposite(bounds.get(4), value2, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4) AND (clustering_0, clustering1, clustering_2, clustering_3) <= (4, 3, 2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value4, value3, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(7, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n assertComposite(bounds.get(4), value4, value3, EOC.START);\n assertComposite(bounds.get(5), value4, value3, value2, value1, EOC.NONE);\n assertComposite(bounds.get(6), value4, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(7, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertComposite(bounds.get(3), value4, EOC.START);\n assertComposite(bounds.get(4), value4, value3, value2, EOC.START);\n assertComposite(bounds.get(5), value4, value3, value2, EOC.END);\n assertComposite(bounds.get(6), value4, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneDescendingAndOneAscendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0) > (1) AND (clustering_0, clustering1) < (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.END);\n assertComposite(bounds.get(2), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.END);\n assertComposite(bounds.get(1), value1, EOC.START);\n assertComposite(bounds.get(2), value1, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithTwoDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithTwoClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneDescendingClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiEqAndSingleSliceRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n\n // (clustering_0, clustering_1) = (1, 2) AND clustering_2 > 3\n Restriction multiEq = newMultiEq(cfMetaData, 0, value1, value2);\n Restriction singleSlice = newSingleSlice(cfMetaData, 2, Bound.START, false, value3);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiEq).mergeWith(singleSlice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithSliceRestrictionsAndOneDescendingClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newSingleSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newSingleSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithSingleEqAndSliceRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n ByteBuffer value5 = ByteBufferUtil.bytes(5);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) > (2, 3)\n Restriction singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction multiSlice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiSlice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) > (2, 3) AND (clustering_1) < (4)\n singleEq = newSingleEq(cfMetaData, 0, value1);\n multiSlice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3);\n Restriction multiSlice2 = newMultiSlice(cfMetaData, 1, Bound.END, false, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiSlice2).mergeWith(singleEq).mergeWith(multiSlice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value4, EOC.START);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) => (2, 3) AND (clustering_1, clustering_2) <= (4, 5)\n singleEq = newSingleEq(cfMetaData, 0, value1);\n multiSlice = newMultiSlice(cfMetaData, 1, Bound.START, true, value2, value3);\n multiSlice2 = newMultiSlice(cfMetaData, 1, Bound.END, true, value4, value5);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiSlice2).mergeWith(singleEq).mergeWith(multiSlice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value4, value5, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithSliceRestrictionsAndOneClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newSingleSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newSingleSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithOneEqRestrictionsAndTwoClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer clustering_0 = ByteBufferUtil.bytes(1);\n Restriction eq = newSingleEq(cfMetaData, 0, clustering_0);\n\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.END);\n }", "private static Restriction newMultiSlice(CFMetaData cfMetaData, int firstIndex, Bound bound, boolean inclusive, ByteBuffer... values)\n {\n List<ColumnDefinition> columnDefinitions = new ArrayList<>();\n for (int i = 0; i < values.length; i++)\n {\n columnDefinitions.add(getClusteringColumnDefinition(cfMetaData, i + firstIndex));\n }\n return new MultiColumnRestriction.Slice(columnDefinitions, bound, inclusive, toMultiItemTerminal(values));\n }", "@Test\n public void testBoundsAsCompositesWithOneEqRestrictionsAndOneClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC);\n\n ByteBuffer clustering_0 = ByteBufferUtil.bytes(1);\n Restriction eq = newSingleEq(cfMetaData, 0, clustering_0);\n\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithSingleEqAndMultiEqRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) = (2, 3)\n Restriction singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction multiEq = newMultiEq(cfMetaData, 1, value2, value3);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiEq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n // clustering_0 = 1 AND clustering_1 = 2 AND (clustering_2, clustering_3) = (3, 4)\n singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction singleEq2 = newSingleEq(cfMetaData, 1, value2);\n multiEq = newMultiEq(cfMetaData, 2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(singleEq2).mergeWith(multiEq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n\n // (clustering_0, clustering_1) = (1, 2) AND clustering_2 = 3\n singleEq = newSingleEq(cfMetaData, 2, value3);\n multiEq = newMultiEq(cfMetaData, 0, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiEq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) = (2, 3) AND clustering_3 = 4\n singleEq = newSingleEq(cfMetaData, 0, value1);\n singleEq2 = newSingleEq(cfMetaData, 3, value4);\n multiEq = newMultiEq(cfMetaData, 1, value2, value3);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiEq).mergeWith(singleEq2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithSingleEqAndMultiINRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n ByteBuffer value5 = ByteBufferUtil.bytes(5);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) IN ((2, 3), (4, 5))\n Restriction singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction multiIN = newMultiIN(cfMetaData, 1, asList(value2, value3), asList(value4, value5));\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiIN);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(1), value1, value4, value5, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(1), value1, value4, value5, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) IN ((2, 3))\n singleEq = newSingleEq(cfMetaData, 0, value1);\n multiIN = newMultiIN(cfMetaData, 1, asList(value2, value3));\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiIN).mergeWith(singleEq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n // clustering_0 = 1 AND clustering_1 = 5 AND (clustering_2, clustering_3) IN ((2, 3), (4, 5))\n singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction singleEq2 = newSingleEq(cfMetaData, 1, value5);\n multiIN = newMultiIN(cfMetaData, 2, asList(value2, value3), asList(value4, value5));\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiIN).mergeWith(singleEq2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value5, value2, value3, EOC.START);\n assertComposite(bounds.get(1), value1, value5, value4, value5, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value5, value2, value3, EOC.END);\n assertComposite(bounds.get(1), value1, value5, value4, value5, EOC.END);\n }", "public interface IStoppingCriteria {\n\n /**\n * Determine the degree of clustering agreement\n * @param cluster1 one clustering results\n * @param cluster2 the other clustering results\n * @return the degree of clustering agreement; 1 refers to be the same clustering results; 0 refers to be the totally different clustering results\n */\n public double computeSimilarity(int[] cluster1, int[] cluster2);\n\n}", "@Test\n public void testBoundsAsCompositesWithEqAndSliceRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n\n Restriction eq = newSingleEq(cfMetaData, 0, value3);\n\n Restriction slice = newSingleSlice(cfMetaData, 1, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 1, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 1, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 1, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 1, Bound.START, false, value1);\n Restriction slice2 = newSingleSlice(cfMetaData, 1, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value2, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 1, Bound.START, true, value1);\n slice2 = newSingleSlice(cfMetaData, 1, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value2, EOC.END);\n }", "private boolean isSubsetOf(List<String> permissions2,\n\t\t\tList<String> permissions3) {\n\t\treturn false;\n\t}", "private boolean isSubsetOf(int firstRow, int secondRow) {\n for (int i = 0; i < universalSetSize; i++) {\n if (input[firstRow][i] && !input[secondRow][i]) {\n return false;\n }\n }\n return true;\n }", "@Test\n public void testBoundsAsCompositesWithOneInRestrictionsAndOneClusteringColumn()\n {\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n Restriction in = newSingleIN(cfMetaData, 0, value1, value2, value3);\n\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(in);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.START);\n assertComposite(bounds.get(2), value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n assertComposite(bounds.get(1), value2, EOC.END);\n assertComposite(bounds.get(2), value3, EOC.END);\n }", "@Test\n public void testOverlappingPartitionsOverlappingClusters()\n {\n check(overlappingClustersWithOverlappingPartitions(), 0.75, 1.0);\n }", "@Test\n public void testBoundsAsCompositesWithMultiEqRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n Restriction eq = newMultiEq(cfMetaData, 0, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n }", "private boolean subGridCheck() {\n\t\tint sqRt = (int)Math.sqrt(dimension);\n\t\tfor(int i = 0; i < sqRt; i++) {\n\t\t\tint increment = i * sqRt;\n\t\t\tfor(int val = 1; val <= dimension; val++) {\n\t\t\t\tint valCounter = 0;\n\t\t\t\tfor(int row = 0 + increment; row < sqRt + increment; row++) {\n\t\t\t\t\tfor(int col = 0 + increment; col < sqRt + increment; col++) {\n\t\t\t\t\t\tif(puzzle[row][col] == val)\n\t\t\t\t\t\t\tvalCounter++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(valCounter >= 2)\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "@Test\n public void testHardClustersWithOverlappingPartitions()\n {\n check(hardClustersWithOverlappingPartitions(), 0.0, 1.0);\n }", "@Test\n\tpublic void testEliminationByColumn(){\n\t\tsetBoardUp();\n\t\tColumn col = new Column(board, 1);\n\t\tint[] toBeRemoved = {1, 3, 4};\n\t\tint[] fromCesll = {1, 2, 3, 5, 6, 8};\n\t\talgorithm.applyEliminationInColumn(col);\n\t\tboolean condition = true;\n\t\tfor(int i = 0; i < toBeRemoved.length; i++)\n\t\t\tfor(int j = 0; j < fromCesll.length; j++)\n\t\t\t\tcondition &= !col.cell[fromCesll[j]].possibilities.contains(toBeRemoved[i]);\t\t\n\t\tassertTrue(condition);\n\t}", "@Test\n public void testBoundsAsCompositesWithMultiInRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n Restriction in = newMultiIN(cfMetaData, 0, asList(value1, value2), asList(value2, value3));\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(in);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertComposite(bounds.get(1), value2, value3, EOC.END);\n }", "private boolean checkRowCol(int c1, int c2, int c3) \r\n {\r\n return ((c1 != -1) && (c1 == c2) && (c2 == c3)); //eida ekhon porjonto kaaj e lage nai\r\n }", "private static Restriction newMultiEq(CFMetaData cfMetaData, int firstIndex, ByteBuffer... values)\n {\n List<ColumnDefinition> columnDefinitions = new ArrayList<>();\n for (int i = 0; i < values.length; i++)\n {\n columnDefinitions.add(getClusteringColumnDefinition(cfMetaData, firstIndex + i));\n }\n return new MultiColumnRestriction.EQ(columnDefinitions, toMultiItemTerminal(values));\n }", "public Map<ByteBuffer, List<ColumnOrSuperColumn>> forced_2round_multiget_slice(List<ByteBuffer> allKeys, ColumnParent column_parent, SlicePredicate predicate)\n throws Exception\n {\n //if (logger.isTraceEnabled()) {\n // logger.trace(\"forced_2round_multiget_slice(allKeys = {}, column_parent = {}, predicate = {})\", new Object[]{printKeys(allKeys), column_parent, predicate});\n //}\n //Split up into one request for each server in the local cluster\n Map<Cassandra.AsyncClient, List<ByteBuffer>> asyncClientToFirstRoundKeys = partitionByAsyncClients(allKeys);\n\n //Send Round 1 Requests\n Queue<BlockingQueueCallback<multiget_slice_call>> firstRoundCallbacks = new LinkedList<BlockingQueueCallback<multiget_slice_call>>();\n for (Entry<Cassandra.AsyncClient, List<ByteBuffer>> entry : asyncClientToFirstRoundKeys.entrySet()) {\n Cassandra.AsyncClient asyncClient = entry.getKey();\n List<ByteBuffer> keysForThisClient = entry.getValue();\n\n BlockingQueueCallback<multiget_slice_call> callback = new BlockingQueueCallback<multiget_slice_call>();\n firstRoundCallbacks.add(callback);\n\n //if (logger.isTraceEnabled()) { logger.trace(\"round 1: get \" + printKeys(keysForThisClient) + \" from \" + asyncClient); }\n asyncClient.multiget_slice(keysForThisClient, column_parent, predicate, consistencyLevel, LamportClock.sendTimestamp(), callback);\n }\n\n //Gather responses, track both max_evt and min_lvt\n long overallMaxEvt = Long.MIN_VALUE;\n long overallMinLvt = Long.MAX_VALUE;\n\n Map<ByteBuffer, List<ColumnOrSuperColumn>> keyToResult = new HashMap<ByteBuffer, List<ColumnOrSuperColumn>>();\n NavigableMap<Long, List<ByteBuffer>> lvtToKeys = new TreeMap<Long, List<ByteBuffer>>();\n for (BlockingQueueCallback<multiget_slice_call> callback : firstRoundCallbacks) {\n\n MultigetSliceResult result = callback.getResponseNoInterruption().getResult();\n LamportClock.updateTime(result.lts);\n\n for (Entry<ByteBuffer, List<ColumnOrSuperColumn>> entry : result.value.entrySet()) {\n ByteBuffer key = entry.getKey();\n List<ColumnOrSuperColumn> coscList = entry.getValue();\n keyToResult.put(key, coscList);\n\n //find the evt and lvt for the entire row\n EvtAndLvt evtAndLvt = ColumnOrSuperColumnHelper.extractEvtAndLvt(coscList);\n if (!lvtToKeys.containsKey(evtAndLvt.getLatestValidTime())) {\n lvtToKeys.put(evtAndLvt.getLatestValidTime(), new LinkedList<ByteBuffer>());\n }\n lvtToKeys.get(evtAndLvt.getLatestValidTime()).add(key);\n //if (logger.isTraceEnabled()) { logger.trace(\"round 1 response for \" + printKey(key) + \" evt: \" + evtAndLvt.getEarliestValidTime() + \" lvt: \" + evtAndLvt.getLatestValidTime()); }\n\n overallMaxEvt = Math.max(overallMaxEvt, evtAndLvt.getEarliestValidTime());\n overallMinLvt = Math.min(overallMinLvt, evtAndLvt.getLatestValidTime());\n }\n }\n //if (logger.isTraceEnabled()) { logger.trace(\"Min LVT:\" + overallMinLvt + \" Max EVT: \" + overallMaxEvt); }\n\n //Always Execute 2nd round for micro-benchmarking\n if (true) {\n //get the smallest lvt > maxEvt\n long chosenTime = lvtToKeys.navigableKeySet().higher(overallMaxEvt);\n\n List<ByteBuffer> secondRoundKeys = new LinkedList<ByteBuffer>();\n secondRoundKeys.addAll(allKeys);\n\n //Send Round 2 Requests\n Map<Cassandra.AsyncClient, List<ByteBuffer>> asyncClientToSecondRoundKeys = partitionByAsyncClients(secondRoundKeys);\n Queue<BlockingQueueCallback<multiget_slice_by_time_call>> secondRoundCallbacks = new LinkedList<BlockingQueueCallback<multiget_slice_by_time_call>>();\n for (Entry<Cassandra.AsyncClient, List<ByteBuffer>> entry : asyncClientToSecondRoundKeys.entrySet()) {\n Cassandra.AsyncClient asyncClient = entry.getKey();\n List<ByteBuffer> keysForThisClient = entry.getValue();\n\n BlockingQueueCallback<multiget_slice_by_time_call> callback = new BlockingQueueCallback<multiget_slice_by_time_call>();\n secondRoundCallbacks.add(callback);\n\n //if (logger.isTraceEnabled()) { logger.trace(\"round 2: get \" + printKeys(keysForThisClient) + \" from \" + asyncClient); }\n\n asyncClient.multiget_slice_by_time(keysForThisClient, column_parent, predicate, consistencyLevel, chosenTime, LamportClock.sendTimestamp(), callback);\n }\n\n //Gather second round responses\n for (BlockingQueueCallback<multiget_slice_by_time_call> callback : secondRoundCallbacks) {\n MultigetSliceResult result = callback.getResponseNoInterruption().getResult();\n LamportClock.updateTime(result.lts);\n\n substituteValidFirstRoundResults(result, keyToResult);\n\n //if (logger.isTraceEnabled()) { logger.trace(\"round 2 responses for \" + printKeys(result.getValue().keySet())); }\n\n keyToResult.putAll(result.getValue());\n }\n }\n\n //Add dependencies on anything returned and removed deleted columns\n for (Entry<ByteBuffer, List<ColumnOrSuperColumn>> entry : keyToResult.entrySet()) {\n ByteBuffer key = entry.getKey();\n List<ColumnOrSuperColumn> coscList = entry.getValue();\n\n for (Iterator<ColumnOrSuperColumn> cosc_it = coscList.iterator(); cosc_it.hasNext(); ) {\n ColumnOrSuperColumn cosc = cosc_it.next();\n try {\n clientContext.addDep(key, cosc);\n } catch (NotFoundException nfe) {\n //remove deleted results, it's okay for all result to be removed\n cosc_it.remove();\n }\n }\n }\n //if (logger.isTraceEnabled()) {\n // logger.trace(\"forced_2round_multiget_slice result = {}\", keyToResult);\n //}\n return keyToResult;\n }", "private int[][] generateCandidates(int[][] usageM){\n\t\t// 1. start with the complete set of attributes\n\t\tMap<Integer, List<Integer>> partitionAttributes = new HashMap<Integer,List<Integer>>();\n\t\tList<Integer> attributes = new ArrayList<Integer>();\n\t\tfor(int i=0;i<usageM[0].length;i++)\n\t\t\tattributes.add(i);\n\t\tpartitionAttributes.put(0, attributes);\n\t\t\n\t\t// 2. for each query, split this set of attributes into two set:\n\t\t// (i) attributes accessed by the query\n\t\t//\t (ii) attributes not-accessed by the query\n\t\tfor(int[] query: usageM){\n\t\t\tMap<Integer, List<Integer>> newPartitionAttributes = new HashMap<Integer,List<Integer>>();\n\t\t\tint partitionCount = partitionAttributes.size();\n\t\t\t\n\t\t\t// check each partition\n\t\t\tfor(int p: partitionAttributes.keySet()){\n\t\t\t\tList<Integer> attrs = partitionAttributes.get(p);\n\t\t\t\tboolean fullPartitionAccess = true;\n\t\t\t\tfor(int a: attrs){\n\t\t\t\t\tif(query[a]==0)\n\t\t\t\t\t\tfullPartitionAccess = false;\n\t\t\t\t}\n\n\t\t\t\tif(fullPartitionAccess){\n\t\t\t\t\tnewPartitionAttributes.put(p, attrs);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t//int newPartition = partitionAttributes.size();\n\t\t\t\t\tList<Integer> accessedAttrs = new ArrayList<Integer>();\n\t\t\t\t\tList<Integer> nonAccessedAttrs = new ArrayList<Integer>();\n\t\t\t\t\tfor(int a: attrs){\n\t\t\t\t\t\tif(query[a]==1)\n\t\t\t\t\t\t\taccessedAttrs.add(a);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tnonAccessedAttrs.add(a);\n\t\t\t\t\t}\n\t\t\t\t\tif(nonAccessedAttrs.size() > 0)\n\t\t\t\t\t\tnewPartitionAttributes.put(p, nonAccessedAttrs);\n\t\t\t\t\tif(accessedAttrs.size() > 0)\n\t\t\t\t\t\tnewPartitionAttributes.put(partitionCount++, accessedAttrs);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//System.out.println(newPartitionAttributes);\n\t\t\t\n\t\t\tpartitionAttributes = newPartitionAttributes;\n\t\t}\n\t\t\n\t\t\n\t\t// 3. we end up with a set of attribute sets; all attributes in \n\t\t//\t an attribute set are always accessed together.\n\t\tint[][] primaryPartitions = new int[partitionAttributes.size()][];\n\t\tint i=0;\n\t\tfor(int p: partitionAttributes.keySet()){\n\t\t\tList<Integer> attrs = partitionAttributes.get(p);\n\t\t\tprimaryPartitions[i] = new int[attrs.size()];\n\t\t\tfor(int j=0;j<attrs.size();j++)\n\t\t\t\tprimaryPartitions[i][j] = attrs.get(j);\n\t\t\ti++;\n\t\t}\n\t\t\n\t\treturn primaryPartitions;\n\t}", "@Test\n public void testHeterogeneousSegmentFilterConditionLimit() throws SqlParseException {\n\n val project = \"heterogeneous_segment\";\n // val dfId = \"747f864b-9721-4b97-acde-0aa8e8656cba\"\n // val seg1Id = \"8892fa3f-f607-4eec-8159-7c5ae2f16942\"\n // val seg2Id = \"d75a822c-788a-4592-a500-cf20186dded1\"\n // val seg3Id = \"54eaf96d-6146-45d2-b94e-d5d187f89919\"\n // val seg4Id = \"411f40b9-a80a-4453-90a9-409aac6f7632\"\n // val seg5Id = \"a8318597-cb75-416f-8eb8-96ea285dd2b4\"\n // \n val sql = \"with T1 as (select cal_dt, trans_id \\n\" + \"from test_kylin_fact inner join test_account \\n\"\n + \"on test_kylin_fact.seller_id = test_account.account_id \\n\"\n + \"where cal_dt between date'2012-01-01' and date'2012-01-03'\\n\" + \"group by cal_dt, trans_id)\\n\";\n\n {\n val sqlWithTooManyOrs = sql + \" select * from T1 where \" + \"(cal_dt='2012-01-01' and trans_id = 1) or \\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 2) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 3) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 4) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 5) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 6) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 7) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 8) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 9) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 10) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 12) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 13) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 14) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 15) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 16) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 17) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 18) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 19) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 20)\";\n val contexts = OlapContextTestUtil.getOlapContexts(project, sqlWithTooManyOrs);\n Assert.assertEquals(\n \">=(DEFAULT.TEST_KYLIN_FACT.CAL_DT, 2012-01-01),<=(DEFAULT.TEST_KYLIN_FACT.CAL_DT, 2012-01-03)\",\n contexts.get(0).getExpandedFilterConditions().stream().map(RexNode::toString)\n .collect(Collectors.joining(\",\")));\n }\n\n {\n val sqlWithFilter = sql + \" select * from T1 where \" + \"(cal_dt='2012-01-01' and trans_id = 1) or \\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 2) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 3) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 4) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 5) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 6) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 7) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 8) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 9) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 10)\";\n val contexts = OlapContextTestUtil.getOlapContexts(project, sqlWithFilter);\n Assert.assertNotEquals(\n \">=(DEFAULT.TEST_KYLIN_FACT.CAL_DT, 2012-01-01),<=(DEFAULT.TEST_KYLIN_FACT.CAL_DT, 2012-01-03)\",\n contexts.get(0).getExpandedFilterConditions().stream().map(RexNode::toString)\n .collect(Collectors.joining(\",\")));\n }\n\n }", "protected void checkBox(int slice, int row, int column, int depth, int height, int width) {\n\tif (slice<0 || depth<0 || slice+depth>slices || row<0 || height<0 || row+height>rows || column<0 || width<0 || column+width>columns) throw new IndexOutOfBoundsException(toStringShort()+\", slice:\"+slice+\", row:\"+row+\" ,column:\"+column+\", depth:\"+depth+\" ,height:\"+height+\", width:\"+width);\n}", "@Test\n public void testPartitionColumnSelection() {\n Path filePath = new Path(\"hdfs:///w/x/y/z.csv\");\n ImplicitColumnManager implictColManager = new ImplicitColumnManager(\n fixture.getOptionManager(),\n standardOptions(filePath));\n\n String dir0 = ScanTestUtils.partitionColName(0);\n // Sic: case insensitivity, but name in project list\n // is preferred over \"natural\" name.\n String dir1 = \"DIR1\";\n String dir2 = ScanTestUtils.partitionColName(2);\n ScanLevelProjection scanProj = ScanLevelProjection.build(\n RowSetTestUtils.projectList(dir2, dir1, dir0, \"a\"),\n Lists.newArrayList(implictColManager.projectionParser()));\n\n assertEquals(4, scanProj.columns().size());\n assertEquals(dir2, scanProj.columns().get(0).name());\n assertEquals(dir1, scanProj.columns().get(1).name());\n assertEquals(dir0, scanProj.columns().get(2).name());\n assertEquals(\"a\", scanProj.columns().get(3).name());\n\n // Verify column type\n\n assertTrue(scanProj.columns().get(0) instanceof PartitionColumn);\n }", "public List<Integer> selectRangeWherePar(byte[][] selectCols, byte[] whereCol, long value1, long value2, ResultSet result){\n List<Integer> oidList = new ArrayList<Integer>();\n \n //assuming the where col is in type LONG\n boolean[] access = new boolean[keyForLong.length];\n int whereIndex = -1;\n \n for(int i = 0; i < keyForLong.length; i++){\n if(keyForLong[i].equals( new String(whereCol) + separator + \"LONG\" )) whereIndex = i;\n \n access[i] = false;\n for(int j = 0; j < selectCols.length; j++){\n if(keyForLong[i].equals( new String(selectCols[j]) + separator + \"LONG\" )){\n access[i] = true;\n break;\n }\n }\n }\n \n int numOfFields = keyForLong.length;\n for(int i = 0; i < numObject; i++){\n //first check if this object meet the where condition\n long value = longValues[i*numOfFields + whereIndex];\n if( (value >= value1) && (value <= value2)){\n //this object meets condition\n int oid=objectIds[i];\n oidList.add(oid);\n \n //select fields in the select clause\n for(int j = 0; j < access.length; j++){\n if(access[j]){\n String key = keyForLong[j];\n if(j == whereIndex){\n result.addLong(key, oid, value);\n continue;\n }\n long longnum = longValues[i*numOfFields + j];\n if(longnum != UNDEFINED)\n result.addLong(key, oid, longnum);\n }\n }\n }\n }\n \n if(oidList.size() > 0){\n //if this partition also has other data types, also select those based on oidList\n if(keyForString.length != 0)\n selectConditionString(oidList, selectCols, result);\n if(keyForDouble.length != 0)\n selectConditionDouble(oidList, selectCols, result);\n if(keyForBool.length != 0)\n selectConditionBool(oidList, selectCols, result);\n }\n return oidList;\n }", "static boolean isSubset(int Tab1[], int Tab2[], int m, int n)\n {\n // compléter\n //Trouver le max de Tab1[]\n int max=Tab1[0];\n for(int i = 1; i < m; i++) {\n\t\t\tif (Tab1[i]>max){\n max=Tab1[i];\n }\n\t\t}\n \n\t\t//Stockage de la Tab1 dans une table de hashage\n\t\tint[] hashTable = new int[max];\n\t\tfor(int i = 0; i < m; i++) {\n\t\t\thashTable[hash(Tab1[i], max)] = Tab1[i];\n\t\t}\n\t\t\n\t\t//verifier que chaque element (de Tab2) existe dans la hashtable\n\t\tfor(int j = 0; j < n; j++) {\n\t\t\tif(Tab2[j] != hashTable[hash(Tab2[j], max)]) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t}\n return true;\n \n //Complexite aymptotique :\n /*\n Puisque la boucle qui a le plus d'itérations est celle avec l'élément m, la compléxité\n asymptotique est O(m).\n f(m,n) = 2m + n = O(m), puisque m > n\n */\n \n\n }", "private Object isValidColumnVector(List<List<Double>> vector) {\n\t\tInteger nrows = vector.size();\n\n\t\tList<Integer> rowLengths = vector.stream().map(List::size).toList();\n\t\tInteger ncols = rowLengths.stream().mapToInt(Integer::intValue).sum() / rowLengths.size();\n\n\t\treturn (nrows == 3) && (ncols == 1);\n\t}", "public VirtualDataSet[] partitionByNumericAttribute(int attributeIndex, int valueIndex) {\n\t\t// WRITE YOUR CODE HERE!\n\n\t\t if(attributes[attributeIndex].getType()==AttributeType.NOMINAL){ \t\t\t\t\t\t\t// avoid passing through nominal value to current method\n return null; \n }\n\t\t\tVirtualDataSet [] partitions = new VirtualDataSet[2]; \t\t\t\t\t\t\t\t\t// creates two split path \n\n\t\t\tdouble split = Double.parseDouble(getValueAt(valueIndex , attributeIndex));\t\t\t// determine the middle number in order to split \n\t\t\t\n\t\t\tLinkedList<Integer> rowsLess = new LinkedList<Integer> (); \t\t\t\t\t\t\t// using linkedlist to do collection of split rows that less than valueIndex value\n\t\t\t\n\t\t\tLinkedList<Integer> rowsMore = new LinkedList<Integer> ();\t\t\t\t\t\t\t\t// using linkedlist to do collection of split rows that less than valueIndex value\n\t\t\t\n\t\t\tint countLess = 0;\n\t\t\tint countMore = 0; \n\n\t\t\tString []arrayOfNums = attributes[attributeIndex].getValues();\n\n\t\t\tfor(int j = 0; j < source.numRows; j++){ \n\t\t\t\t\n\t\t\t\tif(Double.parseDouble(getValueAt(j,attributeIndex)) <= split){ \t\t\t\t// transform from string to integer in order to compare the number smaller than middle number\n\t\t\t\t\t\n\t\t\t\t\trowsLess.add(j);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// add rows that correspond with the current attribute of spliting \n\t\t\t\t\tcountLess++;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// determine the size of partition rows array \n\t\t\t\t}else if(Double.parseDouble(getValueAt(j,attributeIndex)) > split){\t\t\t// transform from string to integer in order to compare the number bigger than middle number\n\t\t\t\t\t\n\t\t\t\t\trowsMore.add(j); \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// add rows that correspond with the current attribute of spliting \n\t\t\t\t\tcountMore++;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// determine the size of partition rows array \n\t\t\t\t}\n\t\t\t}\n\n\t\t\tint [] partitionRowsLess = new int [countLess]; \t\t\t\t\t\t\t\t\t\t// the collection of rows represents all number that smaller than middle number\n\t\t\tint [] partitionRowsMore = new int [countMore]; \t\t\t\t\t\t\t\t\t\t// the collection of rows represents all number that bigger than middle number\n\t\t\tfor(int k = 0; k < countLess; k++){\n\t\t\t\tpartitionRowsLess[k] = rowsLess.poll(); \t\t\t\t\t\t\t\t\t\t\t// transform from linkedlist to array \n\t\t\t}\n\t\t\tfor(int k = 0; k < countMore; k++){\n\t\t\t\tpartitionRowsMore[k] = rowsMore.poll(); \t\t\t\t\t\t\t\t\t\t\t// transform from linkedlist to array \n\t\t\t}\n\t\t\t\n\t\t\tpartitions[0] = new VirtualDataSet(source,partitionRowsLess, attributes); \t\t\t\t// send partition to VirtualDataSet constructor \n\t\t\tpartitions[1] = new VirtualDataSet(source,partitionRowsMore, attributes); \n\t\t\t\n\n\n\t\t\treturn partitions;\n\t\t\n\t}", "private boolean checkifCollinear(Point[] ptArr, Comparator<Point> cmp, int start){\n\t\tif(start +2 >= ptArr.length) return false;\t\n\t\tif(cmp.compare(ptArr[start],ptArr[start+1]) == cmp.compare(ptArr[start+1],ptArr[start+2]) && cmp.compare(ptArr[start],ptArr[start+1]) == 0){\n\t\t\treturn true;\n\t\t}\t\t\n\t\treturn false;\t\n\t}", "public static boolean isAllowedToCollied(Marker marker, Marker m2){\n\t\tif( m2.letter.getX() < marker.letter.getX()){\n\t\t\tif(m2.rightValue != 0 && marker.leftValue !=0 && m2.rightValue + marker.leftValue == 0){\n\t\t\t\tm2.rightValue =0;\n\t\t\t\tmarker.leftValue=0;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\t//if collied on right \n\t\telse if( m2.letter.getX() > marker.letter.getX()){\n\t\t\tif(m2.leftValue != 0 && marker.rightValue != 0 && m2.leftValue+ marker.rightValue == 0){\n\t\t\t\tm2.leftValue = 0;\n\t\t\t\tmarker.rightValue = 0; \n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "List<Trueorfalse> selectByExample(RowBounds rowBounds);", "@Test\n public void whereNormalColumn() throws Exception {\n String sql = \"desc verbose select k1, e1 from db1.tbl1 lateral view explode_split(k2, \\\",\\\") tmp as e1 \"\n + \"where k1=1; \";\n String explainString = UtFrameUtils.getSQLPlanOrErrorMsg(ctx, sql, true);\n Assert.assertTrue(explainString.contains(\"1:TABLE FUNCTION NODE\"));\n Assert.assertTrue(explainString.contains(\"table function: explode_split(`k2`, ',')\"));\n Assert.assertTrue(explainString.contains(\"tuple ids: 0 1\"));\n Assert.assertTrue(explainString.contains(\"TupleDescriptor{id=1, tbl=tmp, byteSize=32, materialized=true}\"));\n Assert.assertTrue(explainString.contains(\"SlotDescriptor{id=1, col=e1, type=VARCHAR(*)}\"));\n Assert.assertTrue(explainString.contains(\"0:OlapScanNode\"));\n Assert.assertTrue(explainString.contains(\"PREDICATES: `k1` = 1\"));\n }", "public static void pseudoTrueTuples(LogicProblem logicProblem, boolean applyChanges)\r\n throws RelationshipConflictException {\n \r\n HashMap<ItemPair,Relationship> relationshipTable = logicProblem.getRelationshipTable();\r\n HashSet<CategoryPair> categoryPairs = logicProblem.getCategoryPairs();\r\n \r\n// System.out.println(\"searching...\");\r\n //within a subgrid\r\n for (CategoryPair categoryPair : categoryPairs) {\r\n// System.out.println(\"Category pair:\" + categoryPair);\r\n //vertical and horizontal search\r\n for (final boolean verticalOrientation : new boolean[] { false, true } ) {\r\n\r\n Category subrowCategory = verticalOrientation?categoryPair.first():categoryPair.last();\r\n Category subcolumnCategory = verticalOrientation?categoryPair.last():categoryPair.first();\r\n\r\n //commenting \"vertical search\" \r\n //(subrows match first category's items\r\n // subcolumns match second category's items)\r\n\r\n //i (2 to floor(n/2)) is the number of elements in the combination tuple\r\n // i=2 in pseudoTrue pairs\r\n //(for subgrids of 5x5 items, looking for both pairs and triplets becomes redundant\r\n for (int i=2; i<=floor(logicProblem.getNumCategories()/2);i++) {\r\n\r\n //https://github.com/dpaukov/combinatoricslib3/wiki/v3.3.0#1-simple-combinations\r\n List<List<Item>> columnCombinations = Generator.combination(subcolumnCategory.getItems())\r\n .simple(i) //for pseudo true pairs, i=2\r\n .stream()\r\n .collect(Collectors.<List<Item>>toList());\r\n //for i=2, this would contain \r\n //Bethany, Donovan\r\n //Bethany, Elizabeth\r\n //...\r\n //Frederick, Peyton\r\n// columnCombinations.stream().forEach(l -> System.out.println(\r\n// (verticalOrientation?\"vertical\":\"horizontal\")+ \" combo: \"+l.toString()));\r\n\r\n //create the sets\r\n //for each combination, start over\r\n \r\n //columnTuple contains i items with which we will compute set intersections\r\n for (List<Item> columnItemTuple : columnCombinations) {\r\n //Bethany, Donovan\r\n \r\n //similarly, valueNoSets contains i sets of VALUE_NO relationships\r\n List<Set<Item>> valueNoSets = new ArrayList<>(); //size=i\r\n //build a set for each i item of columnTuple\r\n for (Item columnItem : columnItemTuple) {\r\n //Bethany\r\n Set<Item> valueNoSet = new HashSet<>(); //size = n\r\n for (Item rowItem : subrowCategory.getItems()) {\r\n //Haley's Comet ....\r\n if (relationshipTable.get(new ItemPair(rowItem, columnItem)).getValue() == Relationship.ValueType.VALUE_NO)\r\n //stacking all VALUE_NO relationship into vertical set\r\n valueNoSet.add(rowItem); //store into single subcolumn set \r\n }\r\n //adding each vertical set into list of sets\r\n if (valueNoSet.size() >= logicProblem.getNumItems() - i //for pairs, we need three VALUE_NO in the set\r\n && valueNoSet.size() < logicProblem.getNumItems()-1) //uniqueness will take or n-1 cases\r\n valueNoSets.add(valueNoSet); //store single subcolumn into multi-set\r\n }\r\n //magic!\r\n Set<Item> intersectionSet = new HashSet<>(); //avoid NPE when the next call is made\r\n if (valueNoSets.size()>=2) //don't compute intersections otherwise\r\n intersectionSet = Processor.multiSetIntersection(valueNoSets);\r\n\r\n if (intersectionSet.size()==logicProblem.getNumItems()-i) {\r\n \r\n// System.out.println(\"----> found candidates for pseudo true pairs!\");\r\n// intersectionSet.stream().forEach(l -> System.out.println(\"\\t\" + l.toString()));\r\n// System.out.println(\"\\t\\tvs.\");\r\n// columnItemTuple.stream().forEach(l -> System.out.println(\"\\t\" + l.toString()));\r\n \r\n //create predecessor list\r\n //we can only add the intersection output as predecessors\r\n ArrayList<Dependable> predecessors = new ArrayList<Dependable>();\r\n for (Item intersectionColumn : intersectionSet) {\r\n for (Item rowItem : columnItemTuple) {\r\n predecessors.add(relationshipTable.get(new ItemPair(rowItem, intersectionColumn)));\r\n }\r\n }\r\n\r\n\r\n //we have a bunch of work to do\r\n for (Item everyRowItem : subrowCategory.getItems()) {\r\n //for every row item not in the intersectionSet\r\n if (!intersectionSet.contains(everyRowItem)) {\r\n for (Item everyColumnItem : subcolumnCategory.getItems()) {\r\n //for every column item not in any of the columnTuple list\r\n if (!columnItemTuple.contains(everyColumnItem)) {\r\n Relationship rel = relationshipTable.get(new ItemPair(everyRowItem,everyColumnItem));\r\n if (rel.getValue()!=Relationship.ValueType.VALUE_NO)\r\n Processor.setRelationship(logicProblem, applyChanges, rel, \r\n Relationship.ValueType.VALUE_NO, Relationship.LogicType.PSEUDOTRUE,\r\n predecessors.toArray(new Relationship[predecessors.size()])); \r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }", "public void testSortOnComputedColumn1() throws Exception {\n \t\tccName = new String[] { \"cc\" };\n \t\tccExpr = new String[] { \"(row.COL0%2==0?1:2)\" };\n \n \t\tfor (int i = 0; i < ccName.length; i++) {\n \t\t\tComputedColumn computedColumn = new ComputedColumn(ccName[i],\n \t\t\t\t\tccExpr[i], DataType.ANY_TYPE);\n \t\t\t((BaseDataSetDesign) this.dataSet)\n \t\t\t\t\t.addComputedColumn(computedColumn);\n \t\t}\n \n \t\tString[] bindingNameSort = new String[1];\n \t\tbindingNameSort[0] = \"SORT_DEFINITION\";\n \t\tIBaseExpression[] bindingExprSort = new IBaseExpression[1];\n \t\tbindingExprSort[0] = new ScriptExpression(\"dataSetRow.cc\");\n \n \t\tSortDefinition[] sortDefn = new SortDefinition[] { new SortDefinition() };\n \t\tsortDefn[0].setColumn(\"SORT_DEFINITION\");\n \t\tsortDefn[0].setSortDirection(ISortDefinition.SORT_DESC);\n \n \t\tString[] bindingNameRow = new String[5];\n \t\tbindingNameRow[0] = \"ROW_COL0\";\n \t\tbindingNameRow[1] = \"ROW_COL1\";\n \t\tbindingNameRow[2] = \"ROW_COL2\";\n \t\tbindingNameRow[3] = \"ROW_COL3\";\n \t\tbindingNameRow[4] = \"ROW_cc\";\n \t\tScriptExpression[] bindingExprRow = new ScriptExpression[] {\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL0\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL1\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL2\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL3\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + ccName[0], 0), };\n \n \t\tIResultIterator resultIt = this.executeQuery(this.createQuery(null,\n \t\t\t\tnull, null, bindingNameSort, bindingExprSort, sortDefn, null,\n \t\t\t\tnull, null, bindingNameRow, bindingExprRow));\n \n \t\tprintResult(resultIt, bindingNameRow, bindingExprRow);\n \t\t// assert\n \t\tcheckOutputFile();\n \t}", "public abstract int Compare(Slice a, Slice b);", "@Test\n \tpublic void whereClauseForNodeRangedDominance() {\n \t\tnode23.addJoin(new Dominance(node42, 10, 20));\n \t\tcheckWhereCondition(\n //\t\t\t\tjoin(\"=\", \"_rank23.component_ref\", \"_rank42.component_ref\"),\n \t\t\t\tjoin(\"=\", \"_component23.type\", \"'d'\"),\n \t\t\t\t\"_component23.name IS NULL\",\n \t\t\t\tjoin(\"<\", \"_rank23.pre\", \"_rank42.pre\"),\n \t\t\t\tjoin(\"<\", \"_rank42.pre\", \"_rank23.post\"),\n \t\t\t\t\"_rank23.level BETWEEN SYMMETRIC _rank42.level - 10 AND _rank42.level - 20\"\n \n \t\t);\n \t}", "private boolean checkColoumnForOctPair(int j1, int j2) {\n for(int i=0;i<4;i++)\r\n {\r\n if(Kmap[i][j1]==0 || Kmap[i][j1]==-1)\r\n return false;\r\n }\r\n for(int i=0;i<4;i++)\r\n {\r\n if(Kmap[i][j2]==0 || Kmap[i][j2]==-1)\r\n return false;\r\n }\r\n for(int i=0;i<4;i++)\r\n {\r\n Kmap[i][j1]=-1;\r\n }\r\n for(int i=0;i<4;i++)\r\n {\r\n Kmap[i][j2]=-1;\r\n } \r\n return true; \r\n }", "public static void main(String[]args){\n\r\n int []arr = new int[100];\r\n int []arr2 = new int[50];\r\n int []arr3 = {1,2,3,4,5,6,7,8};\r\n int number = 5;\r\n LogicalOp op = new LogicalOp();\r\n// op.writeOnArray(arr);\r\n\r\n// arr2 = op.evenArray(arr2);\r\n// for(int i=0;i<arr2.length;i++)\r\n// System.out.println(arr2[i]);\r\n\r\n //System.out.println(\"Mean value: \"+op.meanValue(arr3));\r\n\r\n// String[] arrOfStr = {\"ana\",\"are\",\"mere\",\"pere\",\"mere\"};\r\n// String str = \"mere\";\r\n// System.out.println(op.isContaingString(arrOfStr,str));\r\n\r\n// System.out.println(op.findPosition(arr3,number));\r\n\r\n //op.displayLines();\r\n\r\n// int[]modifArr = op.modifiedArr(arr3,number);\r\n// for(int item: modifArr)\r\n// System.out.print(item+\" \");\r\n\r\n\r\n //System.out.println(\"Second minimum: \"+op.secondMin(arr3));\r\n\r\n int[] empty = new int[arr3.length];\r\n empty = op.populateArray(arr3,empty);\r\n for(int item:empty)\r\n System.out.print(item+\" \");\r\n\r\n\r\n\r\n }", "private int restrictSection(Message msg, String parameter) {\n int sec = Integer.parseInt(parameter);\n\n if(sec > 2) {\n MessageChannel ch = msg.getChannel();\n ch.sendMessage(\"`Error: Invalid query [section not 0-2]. Query terminated.`\").queue();\n return -1;\n }\n else if(sec == 2) {\n partTwo = true;\n upperProblem = 8;\n }\n\n return sec;\n }", "@Test\n\tpublic void testStartingIndicesRegression(){\n\t\tassertLeftmostStartingIndices(\"5,1,7,3,2|-..xxx$1..x...xxx$3....-xx........\", 0, 6, 8, 18, 22);\n\t\tassertRightmostStartingIndices(\"7,5|.......xxx$1....xxx$2..-\", 6, 14);\n\t\t\n\t}", "private boolean isSubset(List<ConceptLabel> outer, List<ConceptLabel> inner){\n\t\tfor(ConceptLabel in: inner){\n\t\t\tboolean c = false;\n\t\t\tfor(ConceptLabel l: outer){\n\t\t\t\tif(l.getText().equals(in.getText())){\n\t\t\t\t\tc = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(!c)\n\t\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "private boolean checkColoumnForQuadPair(int j1) {\n for(int i=0;i<4;i++)\r\n {\r\n if(Kmap[i][j1]==0 || Kmap[i][j1]==-1)\r\n return false;\r\n }\r\n for(int i=0;i<4;i++)\r\n {\r\n Kmap[i][j1]=-1;\r\n }\r\n return true; \r\n }", "List<Online> selectByExampleWithRowbounds(OnlineExample example, RowBounds rowBounds);", "public void compareWithinClusters() {\n\t\tList<Cluster> clusterList = clusterDao.getClusterList();\n\n\t\tfor (Cluster cluster : clusterList) {\n\t\t\tList<Document> docList = documentDao.getDocListByClusterId(cluster.getId());\n\t\t\tint size = docList.size();\n\t\t\t\n\t\t\tdouble[][] matrix = new double[size][size];\n\t\t\t\n\t\t\tfor(int i =0; i<size; i++){\n\t\t\t\tmatrix[i][i] = 1;\n\t\t\t\tmatrix[i][i] = 1;\n\t\t\t}\n\t\t\t\n\t\t\tif (size > 1) {\n\t\t\t\t//List<Document> docList2 = docList1;\n\t\t\t\tfor (int i=0; i<size; i++){\n\t\t\t\t\tfor(int j=i+1; j<size; j++){\n\t\t\t\t\t\t//match docs docList.get(i) & docList.get(j)\n\t\t\t\t\t\tMap<String, Double> map = datumboxCaller.compareDocs(docList.get(i).getDocName(), docList.get(j).getDocName());\n\t\t\t\t\t\tmatrix[i][j] = map.get(\"Oliver\");\n\t\t\t\t\t\tmatrix[j][i] = map.get(\"Shingle\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//persist both metrics in a file \n\t\t\tpersist(matrix, cluster, docList);\n\t\t\t\n\t\t\t//printing the matrix\n\t\t\tSystem.out.println(\"\\nDocument Similarity Matrix for Cluster \"+cluster.getId());\n\t\t\tSystem.out.println(\"\\nOliver Metric\");\n\t\t\tSystem.out.print(\"id\");\n\t\t\tfor(int i=0; i<size; i++)\n\t\t\t\tSystem.out.print(\"\\t\"+docList.get(i).getId());\n\t\t\t\n\t\t\tfor(int i=0; i<size; i++){\n\t\t\t\tSystem.out.println(docList.get(i).getId());\n\t\t\t\tfor(int j=0; j<size; j++){\n\t\t\t\t\tSystem.out.print(\"\\t\");\n\t\t\t\t\tif(j>=i)\n\t\t\t\t\t\tSystem.out.print(matrix[i][j]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(\"\\nShingle Metric\");\n\t\t\tSystem.out.print(\"id\");\n\t\t\tfor(int i=0; i<size; i++)\n\t\t\t\tSystem.out.print(\"\\t\"+docList.get(i).getId());\n\t\t\t\n\t\t\tfor(int i=0; i<size; i++){\n\t\t\t\tSystem.out.print(\"\\n\"+docList.get(i).getId());\n\t\t\t\tfor(int j=0; j<size; j++){\n\t\t\t\t\tSystem.out.print(\"\\t\");\n\t\t\t\t\tif(j>=i)\n\t\t\t\t\t\tSystem.out.print(matrix[j][i]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t//print ends\n\t\t\t\n\t\t}\n\n\t}", "@Test\n public void should_iterate_with_partition_keys_and_partition_keys_IN() throws Exception {\n //Given\n long partitionKey = RandomUtils.nextLong(0,Long.MAX_VALUE);\n\n insertCompositeClusteredValues(partitionKey,\"bucket1\",1,\"name1\",1);\n insertCompositeClusteredValues(partitionKey,\"bucket2\",1,\"name2\",1);\n insertCompositeClusteredValues(partitionKey,\"bucket3\",1,\"name3\",1);\n\n //When\n final Iterator<CompositeClusteredEntity> iterator = manager.sliceQuery(CompositeClusteredEntity.class)\n .forIteration()\n .withPartitionComponents(partitionKey)\n .andPartitionComponentsIN(\"bucket1\", \"bucket3\")\n .iterator();\n\n //Then\n assertThat(iterator.hasNext()).isTrue();\n CompositeClusteredEntity next = iterator.next();\n assertThat(next.getId().getId()).isEqualTo(partitionKey);\n assertThat(next.getId().getBucket()).isEqualTo(\"bucket1\");\n assertThat(next.getId().getName()).isEqualTo(\"name11\");\n assertThat(next.getValue()).isEqualTo(\"value11\");\n\n assertThat(iterator.hasNext()).isTrue();\n next = iterator.next();\n assertThat(next.getId().getId()).isEqualTo(partitionKey);\n assertThat(next.getId().getBucket()).isEqualTo(\"bucket3\");\n assertThat(next.getId().getName()).isEqualTo(\"name31\");\n assertThat(next.getValue()).isEqualTo(\"value11\");\n }", "@Test\n void testSubset() throws IOException {\n Long expectedNumberOfVariables = 13L;\n Long expectedNumberOfCases = 24L; // aka the number of lines in the TAB file produced by the ingest plugin\n\n TabularDataIngest ingestResult;\n File file = getFile(\"csv/ingest/election_precincts.csv\");\n try (BufferedInputStream stream = new BufferedInputStream(new FileInputStream(file))) {\n CSVFileReader instance = createInstance();\n ingestResult = instance.read(Tuple.of(stream, file), null);\n }\n\n File generatedTabFile = ingestResult.getTabDelimitedFile();\n DataTable generatedDataTable = ingestResult.getDataTable();\n\n assertThat(generatedDataTable).isNotNull();\n assertThat(generatedDataTable.getDataVariables()).isNotNull();\n assertThat(generatedDataTable.getVarQuantity()).isEqualTo((long) generatedDataTable.getDataVariables().size());\n assertThat(generatedDataTable.getVarQuantity()).isEqualTo(expectedNumberOfVariables);\n assertThat(generatedDataTable.getCaseQuantity()).isEqualTo(expectedNumberOfCases);\n\n // And now let's try and subset the individual vectors\n // First, the \"continuous\" vectors (we should be able to read these as Double[]):\n int[] floatColumns = {2};\n\n Double[][] floatVectors = {\n { 1.0, 3.0, 4.0, 6.0, 7.0, 8.0, 11.0, 12.0, 76.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0 },\n };\n\n IngestDataProvider dataProvider = new InMemoryIngestDataProvider();\n dataProvider.initialize(generatedDataTable, generatedTabFile);\n\n int vectorCount = 0;\n for (int i : floatColumns) {\n // We'll be subsetting the column vectors one by one, re-opening the\n // file each time. Inefficient - but we don't care here.\n\n if (!generatedDataTable.getDataVariables().get(i).isIntervalContinuous()) {\n fail(\"Column \" + i + \" was not properly processed as \\\"continuous\\\"\");\n }\n\n Double[] columnVector = dataProvider.getDoubleColumn(i);\n\n assertThat(columnVector).isEqualTo(floatVectors[vectorCount++]);\n }\n\n // Discrete Numerics (aka, integers):\n int[] integerColumns = { 1, 4, 6, 7, 8, 9, 10, 11, 12 };\n\n Long[][] longVectors = {\n { 1L, 3L, 4L, 6L, 7L, 8L, 11L, 12L, 76L, 77L, 77L, 77L, 77L, 77L, 77L, 77L, 77L, 77L, 77L, 77L, 77L, 77L, 77L, 77L },\n { 1L, 2L, 3L, 4L, 5L, 11L, 13L, 15L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L },\n { 85729227L, 85699791L, 640323976L, 85695847L, 637089796L, 637089973L, 85695001L, 85695077L, 1111111L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L },\n { 205871733L, 205871735L, 205871283L, 258627915L, 257444575L, 205871930L, 260047422L, 262439738L, 1111111L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L },\n { 205871673L, 205871730L, 205871733L, 205872857L, 258627915L, 257444584L, 205873413L, 262439738L, 1111111L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L },\n { 25025000201L, 25025081001L, 25025000701L, 25025050901L, 25025040600L, 25025000502L, 25025040401L, 25025100900L, 1111111L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L },\n { 250250502002L, 250250502003L, 250250501013L, 250250408011L, 250250503001L, 250250103001L, 250250406002L, 250250406001L, 1111111L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L },\n { 250251011024001L, 250251011013003L, 250251304041007L, 250251011013006L, 250251010016000L, 250251011024002L, 250251001005004L, 250251002003002L, 1111111L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L },\n { 2109L, 2110L, 2111L, 2120L, 2121L, 2115L, 2116L, 2122L, 11111L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L }\n };\n\n vectorCount = 0;\n\n for (int i : integerColumns) {\n if (!generatedDataTable.getDataVariables().get(i).isIntervalDiscrete()\n || !generatedDataTable.getDataVariables().get(i).isTypeNumeric()) {\n fail(\"Column \" + i + \" was not properly processed as \\\"discrete numeric\\\"\");\n }\n\n Long[] columnVector = dataProvider.getLongColumn(i);\n\n assertThat(columnVector).isEqualTo(longVectors[vectorCount++]);\n }\n\n // And finally, Strings:\n int[] stringColumns = {0, 3, 5};\n\n String[][] stringVectors = {\n { \"Dog\", \"Squirrel\", \"Antelope\", \"Zebra\", \"Lion\", \"Gazelle\", \"Cat\", \"Giraffe\", \"Cat\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\" },\n { \"East Boston\", \"Charlestown\", \"South Boston\", \"Bronx\", \"Roslindale\", \"Mission Hill\", \"Jamaica Plain\", \"Hyde Park\", \"Fenway/Kenmore\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\" },\n { \"2-06\", \"1-09\", \"1-1A\", \"1-1B\", \"2-04\", \"3-05\", \"1-1C\", \"1-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", }\n };\n\n vectorCount = 0;\n\n for (int i : stringColumns) {\n if (!generatedDataTable.getDataVariables().get(i).isTypeCharacter()) {\n fail(\"Column \" + i + \" was not properly processed as a character vector\");\n }\n String[] columnVector = dataProvider.getStringColumn(i);\n\n assertThat(columnVector).isEqualTo(stringVectors[vectorCount++]);\n }\n }", "public void testFilterOnAggregationColumn() throws Exception {\n \t\tccName = new String[] { \"cc1\", \"cc2\", \"cc3\" };\n \t\tccExpr = new String[] { \"row.COL0+row.COL1\",\n \t\t\t\t\"Total.runningSum(row.cc1,row.COL0==0,0)\",\n \t\t\t\t\"Total.runningSum(row.cc1,row.COL0>0,0)\" };\n \n \t\tfor (int i = 0; i < ccName.length; i++) {\n \t\t\tComputedColumn computedColumn = new ComputedColumn(ccName[i],\n \t\t\t\t\tccExpr[i], DataType.ANY_TYPE);\n \t\t\t((BaseDataSetDesign) this.dataSet)\n \t\t\t\t\t.addComputedColumn(computedColumn);\n \t\t}\n \n \t\tString[] bindingNameRow = new String[7];\n \t\tbindingNameRow[0] = \"ROW_COL0\";\n \t\tbindingNameRow[1] = \"ROW_COL1\";\n \t\tbindingNameRow[2] = \"ROW_COL2\";\n \t\tbindingNameRow[3] = \"ROW_COL3\";\n \t\tbindingNameRow[4] = \"ROW_cc1\";\n \t\tbindingNameRow[5] = \"ROW_cc2\";\n \t\tbindingNameRow[6] = \"ROW_cc3\";\n \t\tScriptExpression[] bindingExprRow = new ScriptExpression[] {\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL0\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL1\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL2\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL3\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + ccName[0], 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + ccName[1], 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + ccName[2], 0) };\n \n \t\tIResultIterator resultIt = this.executeQuery(this.createQuery(null,\n \t\t\t\tnull, null, null, null, null, null, null, null, bindingNameRow,\n \t\t\t\tbindingExprRow));\n \n \t\tprintResult(resultIt, bindingNameRow, bindingExprRow);\n \t\t// assert\n \t\tcheckOutputFile();\n \n \t}", "public void testMultipass_Sort() throws Exception\n \t{\n \t\tccName = new String[]{\n \t\t\t\t\"cc1\", \"cc2\"\n \t\t};\n \t\tccExpr = new String[]{\n \t\t\t\t\"Total.sum(row.COL1)\", \"Total.sum(row.cc1)\"\n \t\t};\n \n \t\tfor ( int i = 0; i < ccName.length; i++ )\n \t\t{\n \t\t\tComputedColumn computedColumn = new ComputedColumn( ccName[i],\n \t\t\t\t\tccExpr[i],\n \t\t\t\t\tDataType.INTEGER_TYPE );\n \t\t\t( (BaseDataSetDesign) this.dataSet ).addComputedColumn( computedColumn );\n \t\t}\n \t\t\n \t\tString[] bindingNameSort = new String[2];\n \t\tbindingNameSort[0] = \"SORT_DEFINITION_1\";\n \t\tbindingNameSort[1] = \"SORT_DEFINITION_2\";\n \t\tIBaseExpression[] bindingExprSort = new IBaseExpression[2];\n \t\tbindingExprSort[0] = new ScriptExpression(\n \t\t\t\t\"dataSetRow.COL1/(Total.ave(dataSetRow.cc1)+dataSetRow.cc1)\");\n \t\tbindingExprSort[1] = new ScriptExpression(\n \t\t\t\t\"dataSetRow.cc2-dataSetRow.COL2\");\n \t\tSortDefinition[] sortDefn = new SortDefinition[] {\n \t\t\t\tnew SortDefinition(), new SortDefinition() };\n \t\tsortDefn[0].setColumn(\"SORT_DEFINITION_1\");\n \t\tsortDefn[0].setSortDirection(ISortDefinition.SORT_DESC);\n \t\tsortDefn[1].setColumn(\"SORT_DEFINITION_2\");\n \t\tsortDefn[1].setSortDirection(ISortDefinition.SORT_DESC);\n \n \t\tString[] bindingNameRow = new String[6];\n \t\tbindingNameRow[0] = \"ROW_COL0\";\n \t\tbindingNameRow[1] = \"ROW_COL1\";\n \t\tbindingNameRow[2] = \"ROW_COL2\";\n \t\tbindingNameRow[3] = \"ROW_COL3\";\n \t\tbindingNameRow[4] = \"ROW_cc1\";\n \t\tbindingNameRow[5] = \"ROW_cc2\";\n \t\tScriptExpression[] bindingExprRow = new ScriptExpression[]{\n \t\t\t\tnew ScriptExpression( \"dataSetRow.\" + \"COL0\", 0 ),\n \t\t\t\tnew ScriptExpression( \"dataSetRow.\" + \"COL1\", 0 ),\n \t\t\t\tnew ScriptExpression( \"dataSetRow.\" + \"COL2\", 0 ),\n \t\t\t\tnew ScriptExpression( \"dataSetRow.\" + \"COL3\", 0 ),\n \t\t\t\tnew ScriptExpression( \"dataSetRow.\" + ccName[0], 0 ),\n \t\t\t\tnew ScriptExpression( \"dataSetRow.\" + ccName[1], 0 ),\n \t\t};\n \t\tIResultIterator resultIt = this.executeQuery(this.createQuery(null,\n \t\t\t\tnull, null, bindingNameSort, bindingExprSort, sortDefn, null,\n \t\t\t\tnull, null, bindingNameRow, bindingExprRow));\n \n \t\tprintResult(resultIt, bindingNameRow, bindingExprRow);\t\n \t\t// assert\n \t\tcheckOutputFile();\n \t}", "public static boolean IS_SUBFEATURE(Feature a, int index_a, Feature b, int index_b) {\n\n boolean anotinb, bnotina;\n int i, ia, ib;\n\n if (index_a != index_b)\n Dataset.perror(\"Feature.class :: not the same feature (\" + index_a + \" != \" + index_b + \")\");\n if (!a.type.equals(b.type))\n Dataset.perror(\n \"Feature.class :: not the same type of feature (\" + a.type + \" != \" + b.type + \")\");\n\n if (IS_CONTINUOUS(a.type)) {\n if (a.dmin >= b.dmin) {\n if (a.dmax <= b.dmax) return true;\n else\n Dataset.perror(\n \"Feature.class :: inconsistency for subfeature check for : (\"\n + a.dmin\n + \", \"\n + a.dmax\n + \") subseteq (\"\n + b.dmin\n + \", \"\n + b.dmax\n + \") ? \");\n } else if (a.dmax < b.dmax)\n Dataset.perror(\n \"Feature.class :: inconsistency for subfeature check for : (\"\n + a.dmin\n + \", \"\n + a.dmax\n + \") subseteq (\"\n + b.dmin\n + \", \"\n + b.dmax\n + \") ? \");\n } else if (IS_INTEGER(a.type)) {\n if (a.imin >= b.imin) {\n if (a.imax <= b.imax) return true;\n else\n Dataset.perror(\n \"Feature.class :: inconsistency for subfeature check for : (\"\n + a.imin\n + \", \"\n + a.imax\n + \") subseteq (\"\n + b.imin\n + \", \"\n + b.imax\n + \") ? \");\n } else if (a.imax < b.imax)\n Dataset.perror(\n \"Feature.class :: inconsistency for subfeature check for : (\"\n + a.imin\n + \", \"\n + a.imax\n + \") subseteq (\"\n + b.imin\n + \", \"\n + b.imax\n + \") ? \");\n } else if (IS_NOMINAL(a.type)) {\n if (a.modalities == null) return true;\n else if (b.modalities != null) {\n anotinb = bnotina = false;\n ia = ib = -1;\n for (i = 0; i < a.modalities.size(); i++)\n if (!b.modalities.contains((String) a.modalities.elementAt(i))) {\n anotinb = true;\n ia = i;\n }\n for (i = 0; i < b.modalities.size(); i++)\n if (!a.modalities.contains((String) b.modalities.elementAt(i))) {\n bnotina = true;\n ib = i;\n }\n if ((anotinb) && (bnotina))\n Dataset.perror(\n \"Feature.class :: inconsistency for subfeature check for : \"\n + ((String) a.modalities.elementAt(ia))\n + \" not in b and \"\n + ((String) b.modalities.elementAt(ib))\n + \" not in a \");\n else if (!anotinb) return true;\n }\n } else Dataset.perror(\"Feature.class :: no Feature type for \" + a.type);\n\n return false;\n }", "Boolean isCollinearTo(IVec3 v);", "public void decideCluster(){\n\tdouble shortest = 1000000;\n\tfor(int i = 0; i < clusterDist.length; i++)\n\t{\n\t\tif(clusterDist[i] < shortest)\n\t\t{\tshortest = clusterDist[i];\n\t\t\tthis.clusterid = i;\n\t\t}\n\t\t\n\t}\n}", "@Test\r\n public void testIsSubset1() {\r\n Assert.assertEquals(false, set1.isSubset(set2));\r\n }", "static public int getAtLeastKVisitors(int[][] rectangles, int k) {\n\n if(rectangles.length==0)\n return 0;\n if(k > rectangles.length)\n return 0;\n\n TreeSet<Rectangle> avlTree = new TreeSet<>();//To store the rectangles ordered\n TreeSet<Integer> Ys = new TreeSet<>();\n\n for(int[] coordinates: rectangles) {\n //x2 = x2 + 1 , y2 = y2 +1 for the inclusive constraints\n Rectangle r = new Rectangle(coordinates[0], coordinates[1], coordinates[2]+1, coordinates[3]+1);\n avlTree.add(r);\n if(!Ys.contains(r.getY1()))\n Ys.add(r.getY1());\n if(!Ys.contains(r.getY2()))\n Ys.add(r.getY2());\n }\n\n int ans = 0;\n Iterator<Integer> yIterator = Ys.iterator();\n int previousY = yIterator.next();\n\n //Traverse by slices of Y's\n while(yIterator.hasNext()) {\n\n int currentY = yIterator.next();\n List<int[]> segments = new ArrayList<>();\n Iterator<Rectangle> treeIterator = avlTree.iterator();\n\n //Look for the rectangles that fall in the slice and create a segment's list\n while(treeIterator.hasNext()) {\n Rectangle r = treeIterator.next();\n //We stop traversing the tree once the rectangles are completely above the slice\n if(r.getY1()>currentY)\n break;\n if(r.getY1()<= previousY && r.getY2()>=currentY) {\n int[] segmentL = new int[2]; int[] segmentR = new int[2];\n segmentL[0] = r.getX1(); segmentL[1] = Type.OPEN.getValue();\n segmentR[0] = r.getX2(); segmentR[1] = Type.CLOSED.getValue();\n segments.add(segmentL); segments.add(segmentR);\n }\n //We remove the rectangles that are left behind by the slice\n if(r.getY2() < previousY)\n treeIterator.remove();\n }\n\n //Sort the segments to analyze them\n Collections.sort(segments, (a, b) -> Integer.compare(a[0], b[0]));\n Iterator<int[]> it = segments.iterator();\n int[] segmentEnd, segmentStart = it.next();\n int nRectangles = Type.OPEN.getValue(); //The first interval will always be opening\n\n while(it.hasNext()) {\n segmentEnd = it.next();\n if(nRectangles >=k) {\n ans+= (currentY - previousY) * (segmentEnd[0] - segmentStart[0]);\n }\n segmentStart = segmentEnd;\n nRectangles += segmentEnd[1];\n }\n\n previousY = currentY;\n }\n\n return ans;\n }", "boolean verifications(int i, int j, int val) { \r\n return (verifCarre(i-i%nCarre, j-j%nCarre, val) && verifLigne(i, val) && verifColonne(j, val)); \r\n }", "@Test\n public void testMultiLevelPartitionPruning() throws SqlParseException {\n\n val project = \"multi_level_partition\";\n val dfId = \"747f864b-9721-4b97-acde-0aa8e8656cba\";\n val expectedRanges = Lists.<Pair<String, String>> newArrayList();\n val segmentRange1 = Pair.newPair(\"2012-01-01\", \"2012-01-02\");\n val segment1Uuid = \"8892fa3f-f607-4eec-8159-7c5ae2f16942\";\n val segmentRange2 = Pair.newPair(\"2012-01-02\", \"2012-01-03\");\n val segment2Uuid = \"d75a822c-788a-4592-a500-cf20186dded1\";\n val segmentRange3 = Pair.newPair(\"2012-01-03\", \"2012-01-04\");\n val segment3Uuid = \"54eaf96d-6146-45d2-b94e-d5d187f89919\";\n val segmentRange4 = Pair.newPair(\"2012-01-04\", \"2012-01-05\");\n val segment4Uuid = \"411f40b9-a80a-4453-90a9-409aac6f7632\";\n val segmentRange5 = Pair.newPair(\"2012-01-05\", \"2012-01-06\");\n val segment5Uuid = \"a8318597-cb75-416f-8eb8-96ea285dd2b4\";\n val expectedPartitionMap = Maps.<String, List<Long>> newHashMap();\n\n val sqlBase = \"select cal_dt, sum(price) from test_kylin_fact inner join test_account on test_kylin_fact.seller_id = test_account.account_id \";\n\n // no filter\n val noFilterSql = sqlBase + \"group by cal_dt\";\n expectedRanges.add(segmentRange1);\n expectedRanges.add(segmentRange2);\n expectedRanges.add(segmentRange3);\n expectedRanges.add(segmentRange4);\n expectedRanges.add(segmentRange5);\n expectedPartitionMap.put(segment1Uuid, Lists.newArrayList(0L, 1L, 2L, 3L));\n expectedPartitionMap.put(segment2Uuid, Lists.newArrayList(0L, 1L, 2L));\n expectedPartitionMap.put(segment3Uuid, Lists.newArrayList(1L, 2L, 3L));\n expectedPartitionMap.put(segment4Uuid, Lists.newArrayList(0L, 1L));\n expectedPartitionMap.put(segment5Uuid, Lists.newArrayList(2L, 3L));\n assertPrunedSegmentsRange(project, noFilterSql, dfId, expectedRanges, 1L, expectedPartitionMap);\n\n val andSql0 = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-04' and lstg_site_id = 1 group by cal_dt\";\n val andMappingSql0 = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-04' and lstg_format_name = 'FP-non GTC' group by cal_dt\";\n val andMixSql0 = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-04' and lstg_site_id = 1 and lstg_format_name = 'FP-non GTC' group by cal_dt\";\n expectedRanges.clear();\n expectedRanges.add(segmentRange1);\n expectedRanges.add(segmentRange2);\n expectedRanges.add(segmentRange3);\n expectedPartitionMap.clear();\n expectedPartitionMap.put(segment1Uuid, Lists.newArrayList(1L));\n expectedPartitionMap.put(segment2Uuid, Lists.newArrayList(1L));\n expectedPartitionMap.put(segment3Uuid, Lists.newArrayList(1L));\n assertPrunedSegmentsRange(project, andSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n assertPrunedSegmentsRange(project, andMappingSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n assertPrunedSegmentsRange(project, andMixSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n\n val notInSql0 = sqlBase\n + \"where cal_dt > '2012-01-02' and cal_dt < '2012-01-04' and lstg_site_id not in (0, 2, 3) group by cal_dt\";\n val notInMappingSql0 = sqlBase\n + \"where cal_dt > '2012-01-02' and cal_dt < '2012-01-04' and lstg_format_name not in ('FP-GTC', 'ABIN', 'Auction') group by cal_dt\";\n val notInMixSql0 = sqlBase\n + \"where cal_dt > '2012-01-02' and cal_dt < '2012-01-04' and lstg_site_id not in (0, 2, 3) and lstg_format_name not in ('FP-GTC', 'ABIN', 'Auction') group by cal_dt\";\n expectedRanges.clear();\n expectedRanges.add(segmentRange2);\n expectedRanges.add(segmentRange3);\n expectedPartitionMap.clear();\n expectedPartitionMap.put(segment2Uuid, Lists.newArrayList(1L));\n expectedPartitionMap.put(segment3Uuid, Lists.newArrayList(1L));\n assertPrunedSegmentsRange(project, notInSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n assertPrunedSegmentsRange(project, notInMappingSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n assertPrunedSegmentsRange(project, notInMixSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n\n // return empty data case\n val emptyData = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-03' and lstg_site_id = 5 group by cal_dt\";\n val emptyDataMapping = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-03' and lstg_format_name = 'not_exist_name' group by cal_dt\";\n val emptyDataMix = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-03' and lstg_site_id = 5 and lstg_format_name = 'not_exist_name' group by cal_dt\";\n expectedRanges.clear();\n expectedPartitionMap.clear();\n assertPrunedSegmentsRange(project, emptyData, dfId, expectedRanges, -1L, expectedPartitionMap);\n assertPrunedSegmentsRange(project, emptyDataMapping, dfId, expectedRanges, -1L, expectedPartitionMap);\n assertPrunedSegmentsRange(project, emptyDataMix, dfId, expectedRanges, -1L, expectedPartitionMap);\n\n // query data out of current built segments range\n val inSql0 = sqlBase\n + \"where cal_dt > '2011-12-30' and cal_dt < '2012-01-03' and lstg_site_id in (1, 2) group by cal_dt\";\n val inMappingSql0 = sqlBase\n + \"where cal_dt > '2011-12-30' and cal_dt < '2012-01-03' and lstg_format_name in ('FP-non GTC', 'ABIN') group by cal_dt\";\n val inMixSql0 = sqlBase\n + \"where cal_dt > '2011-12-30' and cal_dt < '2012-01-03' and lstg_site_id in (1, 2) and lstg_format_name in ('FP-non GTC', 'ABIN') group by cal_dt\";\n expectedRanges.add(segmentRange1);\n expectedRanges.add(segmentRange2);\n expectedPartitionMap.put(segment1Uuid, Lists.newArrayList(1L, 2L));\n expectedPartitionMap.put(segment2Uuid, Lists.newArrayList(1L, 2L));\n assertPrunedSegmentsRange(project, inSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n assertPrunedSegmentsRange(project, inMappingSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n assertPrunedSegmentsRange(project, inMixSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n\n val pushDownSql0 = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-03' and lstg_site_id = 3 group by cal_dt\";\n assertNoRealizationFound(project, pushDownSql0);\n\n val pushDownMappingSql0 = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-03' and lstg_format_name = 'Auction' group by cal_dt\";\n assertNoRealizationFound(project, pushDownMappingSql0);\n\n val pushDownMixSql0 = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-03' and lstg_site_id = 3 and lstg_format_name = 'Auction' group by cal_dt\";\n assertNoRealizationFound(project, pushDownMixSql0);\n\n // return empty result\n val wrongMapping0 = sqlBase\n + \"where cal_dt between '2012-01-01' and '2012-01-02' and lstg_site_id = 0 and lstg_format_name = 'FP-non GTC' group by cal_dt\";\n assertPrunedSegmentsRange(project, wrongMapping0, dfId, null, -1L, null);\n\n val orSql0 = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-02' and (lstg_site_id = 0 or lstg_format_name = 'FP-non GTC') group by cal_dt\";\n expectedRanges.clear();\n expectedPartitionMap.clear();\n expectedRanges.add(segmentRange1);\n expectedPartitionMap.put(segment1Uuid, Lists.newArrayList(0L, 1L));\n assertPrunedSegmentsRange(project, orSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n }", "public boolean percolates() {\n for (int i = 0; i < size; i++) {\r\n if (flowGrid[size * (size - 1) + i] < size) { // if any of the bottom row points at any of the index in the top row\r\n return true;\r\n }\r\n }\r\n return false;\r\n }", "private List<Integer> chooseInnerModelFeatureColumns(Matrix inputs, Matrix labels)\n\t{\n\t\tMatrix inputsShuffled = new Matrix(inputs);\n\t\tMatrix labelsShuffled = new Matrix(labels);\n\t\tinputs = null;\n\t\tlabels = null;\n\t\tinputsShuffled.shuffle(rand, labelsShuffled);\n\n\t\tMatrix[] sets = createValidationSet(inputsShuffled, labelsShuffled, validationSetPercent);\n\t\tMatrix tInputs = sets[0];\n\t\tMatrix tLabels = sets[1];\n\t\tMatrix vInputs = sets[2];\n\t\tMatrix vLabels = sets[3];\n\n\t\t// Greedily search for the best columns to train model i on.\n\t\t\t\n\t\tList<Integer> keepColumns = new ArrayList<>(featureColumnsToAlwaysUse);\n\t\t\n\t\tdouble lastIterationScore;\n\t\tif (featureColumnsToAlwaysUse.isEmpty())\n\t\t{\n\t\t\tlastIterationScore = Double.NEGATIVE_INFINITY;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tSupervisedLearner initialModel = trainOnColumns(tInputs, tLabels, keepColumns);\n\t\t\tlastIterationScore = validateOnColumns(vInputs, vLabels, keepColumns, initialModel);\n\t\t}\n\t\t\n\t\tLogger.println(\"initial lastIterationScore: \" + lastIterationScore);\n\t\t\n\t\tList<Integer> featureSelectionCols = Helper.iteratorToList(new Range(tInputs.cols()));\n\t\tfeatureSelectionCols.removeAll(featureColumnsToAlwaysUse);\n\t\t\n\t\twhile (!featureSelectionCols.isEmpty())\n\t\t{\n\t\t\t// Find the feature selection column which helps the model the most.\n\t\t\tTuple2<Integer, Double> bestTuple = featureSelectionCols.stream()\n\t\t\t\t\t.map(c -> \n\t\t\t\t\t{\n\t\t\t\t\t\tList<Integer> columns = new ArrayList<>(keepColumns);\n\t\t\t\t\t\tcolumns.add(c);\n\t\t\t\t\t\tSupervisedLearner model = trainOnColumns(tInputs, tLabels, columns);\n\t\t\t\t\t\tdouble score = validateOnColumns(vInputs, vLabels, columns, model);\n\t\t\t\t\t\treturn new Tuple2<Integer, Double>(c, score);\n\t\t\t\t\t})\n\t\t\t\t\t.max((t1, t2) -> Double.compare(t1.getSecond(), t2.getSecond())).get();\n\n\t\t\tif (bestTuple.getSecond() > lastIterationScore)\n\t\t\t{\n\t\t\t\tLogger.println(\"Keeping column \" + bestTuple.getFirst() + \", new score: \" + bestTuple.getSecond());\n\t\t\t\tkeepColumns.add(bestTuple.getFirst());\n\t\t\t\tfeatureSelectionCols.remove(bestTuple.getFirst());\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tlastIterationScore = bestTuple.getSecond();\n\t\t}\n\t\t\n\t\treturn keepColumns;\n\t}", "@Test\n public void whereExplodeColumn() throws Exception {\n String sql = \"desc verbose select k1, e1 from db1.tbl1 lateral view explode_split(k2, \\\",\\\") tmp as e1 \"\n + \"where e1='1'; \";\n String explainString = UtFrameUtils.getSQLPlanOrErrorMsg(ctx, sql, true);\n Assert.assertTrue(explainString.contains(\"1:TABLE FUNCTION NODE\"));\n Assert.assertTrue(explainString.contains(\"table function: explode_split(`k2`, ',')\"));\n Assert.assertTrue(explainString.contains(\"PREDICATES: `e1` = '1'\"));\n Assert.assertTrue(explainString.contains(\"tuple ids: 0 1\"));\n Assert.assertTrue(explainString.contains(\"TupleDescriptor{id=1, tbl=tmp, byteSize=32, materialized=true}\"));\n Assert.assertTrue(explainString.contains(\"SlotDescriptor{id=1, col=e1, type=VARCHAR(*)}\"));\n }", "@Test\n\t public void test_Is_Subset_Negative() throws Exception{\t\n\t\t SET setarray= new SET( new int[]{1,2,3,4,5});\n\t\t SET subsetarray= new SET( new int[]{7,8});\n\t\t assertFalse(setarray.isSubSet(subsetarray));\t \n\t }", "@Test\n public void testBoundsAsCompositesWithEqAndInRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n Restriction eq = newSingleEq(cfMetaData, 0, value1);\n Restriction in = newSingleIN(cfMetaData, 1, value1, value2, value3);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(in);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.START);\n assertComposite(bounds.get(2), value1, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value1, EOC.END);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n assertComposite(bounds.get(2), value1, value3, EOC.END);\n }", "private boolean[][] buildCoverTable(Mask[] implicants, Integer[] minterms,\n\t\t\tMap<Integer, Integer> mintermToColumnMap) {\n\n\t\tboolean[][] coverTable = new boolean[implicants.length][minterms.length];\n\n\t\tfor (int i = 0; i < implicants.length; i++) {\n\t\t\tfor (int j = 0; j < minterms.length; j++) {\n\t\t\t\tif (implicants[i].getIndexes().contains(minterms[j])) {\n\t\t\t\t\tcoverTable[i][j] = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn coverTable;\n\t}", "@Test\n\t public void test_Is_Subset_Positive() throws Exception{\t\n\t\t SET setarray= new SET( new int[]{1,2,3,4,5});\n\t\t SET subsetarray= new SET( new int[]{1,2,3});\n\t\t assertTrue(setarray.isSubSet(subsetarray));\t \n\t }", "private Map<Boolean, Sort> split2 (final int delim, final int subcl) {\n Interval[] split = getConstraint(subcl).split(delim);//the interval to be split\n if (split.length == 0)\n return Collections.EMPTY_MAP;\n else if (split.length == 2) {\n Map<Boolean, Sort> res = new HashMap<>();\n Interval[] newarrc = this.constraints.clone();//the original constraints is copied\n newarrc[subcl - 1] = split[0];\n res.put(false, setConstraint(newarrc)); //false trands for \"0\"\n newarrc = this.constraints.clone();\n newarrc[subcl - 1] = split[1];\n res.put(true, setConstraint(newarrc)); //true stands for \"1\"\n return res;\n }\n throw new IllegalArgumentException(\"binary splits are assumed!\");\n }", "private void partitionImpl(Collection<S> vocab, HashMap<Dimension<T>, MutableDouble> center) {\n double firstVal = Double.POSITIVE_INFINITY;\n double secondVal = Double.POSITIVE_INFINITY;\n S firstWord = null;\n S secondWord = null;\n\n LinkedList<S> cluster1 = new LinkedList<S>();\n LinkedList<S> cluster2 = new LinkedList<S>();\n HashMap<Dimension<T>, MutableDouble> newCenter1 = null;\n HashMap<Dimension<T>, MutableDouble> newCenter2 = null;\n\n if (vocab.size() > 2) {\n for (S word : vocab) {\n double dist = distanceToCenter(word, center);\n if (dist < secondVal) {\n if (dist < firstVal) {\n secondVal = firstVal;\n secondWord = firstWord;\n firstVal = dist;\n firstWord = word;\n } else {\n secondVal = dist;\n secondWord = word;\n }\n }\n }\n if (distance(firstWord, secondWord) <= 0.0) {\n System.out.printf(\"zero distance between '%s' and '%s'\\n\", firstWord, secondWord);\n // pick an arbitrary second word\n for (S word : vocab) {\n if (word.equals(firstWord) || word.equals(secondWord)) {\n continue;\n }\n if (distance(firstWord, word) > 0.0) {\n secondWord = word;\n break;\n }\n }\n System.out.printf(\"selected '%s' and '%s'\\n\", firstWord, secondWord);\n }\n\n HashMap<Dimension<T>, MutableDouble> center1 = wordToVector(firstWord);\n HashMap<Dimension<T>, MutableDouble> center2 = wordToVector(secondWord);\n for (S word : vocab) {\n double dist1 = distanceToCenter(word, center1);\n double dist2 = distanceToCenter(word, center2);\n if (dist1 < dist2) {\n cluster1.add(word);\n } else {\n cluster2.add(word);\n }\n }\n\n int changed = 1;\n int iteration = 0;\n while (++iteration <= MAX_ITERATIONS && changed > 0) {\n System.out.printf(\"Iteration %d/%d\\n\", iteration, MAX_ITERATIONS);\n changed = 0;\n newCenter1 = getCenter(cluster1);\n newCenter2 = getCenter(cluster2);\n\n LinkedList<S> tmpCluster1 = new LinkedList<S>();\n LinkedList<S> tmpCluster2 = new LinkedList<S>();\n\n for (ListIterator<S> it = cluster1.listIterator(); it.hasNext();) {\n S word = it.next();\n double dist1 = distanceToCenter(word, newCenter1);\n double dist2 = distanceToCenter(word, newCenter2);\n if (dist1 <= dist2) {\n tmpCluster1.add(word);\n } else {\n tmpCluster2.add(word);\n changed++;\n System.out.printf(\"changing %s : %g > %g\\n\", word, dist1, dist2);\n }\n }\n\n for (ListIterator<S> it = cluster2.listIterator(); it.hasNext();) {\n S word = it.next();\n double dist1 = distanceToCenter(word, newCenter1);\n double dist2 = distanceToCenter(word, newCenter2);\n if (dist2 <= dist1) {\n tmpCluster2.add(word);\n } else {\n tmpCluster1.add(word);\n changed++;\n System.out.printf(\"changing %s : %g < %g\\n\", word, dist1, dist2);\n }\n }\n cluster1 = tmpCluster1;\n cluster2 = tmpCluster2;\n System.out.printf(\"changed: %d/%d\\n\", changed, vocab.size());\n if (cluster1.size() == 0 || cluster2.size() == 0) {\n LinkedList<S> cl = cluster1.size() == 0 ? cluster2 : cluster1;\n System.out.printf(\"Cannot split %s, split them randomly\\n\", cl.toString());\n tmpCluster1 = new LinkedList<S>();\n tmpCluster2 = new LinkedList<S>();\n boolean b = true;\n for (S word : cl) {\n if (b) {\n tmpCluster1.add(word);\n } else {\n tmpCluster2.add(word);\n }\n b = !b;\n }\n cluster1 = tmpCluster1;\n cluster2 = tmpCluster2;\n }\n }\n } else if (vocab.size() == 2) {\n Iterator<S> it = vocab.iterator();\n S word1 = it.next();\n S word2 = it.next();\n cluster1.add(word1);\n cluster2.add(word2);\n newCenter1 = wordToVector(word1);\n newCenter2 = wordToVector(word2);\n } else {\n return;\n }\n\n if (notifyNewCluster(vocab, cluster1, cluster2)) {\n partition(cluster1, newCenter1);\n partition(cluster2, newCenter2);\n }\n\n }", "public boolean percolates()\r\n { return uf.find(0) == uf.find(dimension*dimension + 1); }", "private boolean checkOverlap(int row, int col, int length){\n \tif(!inBounds(row,col)){\n \t\treturn false;\n \t}\n \tfor(int i = row; i < row + length; i++ ){\n\t\t\tfor(int j = col; j < col + length; j++){\n\t\t\t\tif(grid[i][col] == 1 || row + length >= 10)\n\t\t\t\t\treturn false;\n\t\t\t\tif(grid[row][j] == 1 || col + length >= 10)\n\t\t\t\t\treturn false;\n\t\t\t}\n \t\t\n \t}\n \treturn true;\n }", "public void testGetSubDimensionality()\n {\n RandomSubVectorThresholdLearner<String> instance = new RandomSubVectorThresholdLearner<String>();\n\n instance.setPercentToSample(0.5);\n assertEquals(5, instance.getSubDimensionality(10));\n\n instance.setPercentToSample(0.25);\n assertEquals(2, instance.getSubDimensionality(9));\n\n instance.setPercentToSample(1.0);\n assertEquals(9, instance.getSubDimensionality(9));\n\n instance.setPercentToSample(0.0);\n assertEquals(1, instance.getSubDimensionality(9));\n }", "private List<Set<BitSet>> buildPFunction(boolean[][] table, boolean[] coveredMinterms) {\n\n\t\tList<Set<BitSet>> pFunction = new ArrayList<>();\n\n\t\tfor (int i = 0; i < coveredMinterms.length; i++) {\n\n\t\t\tSet<BitSet> currentColumn = new LinkedHashSet<>();\n\n\t\t\tfor (int j = 0; j < table.length; j++) {\n\n\t\t\t\tif (table[j][i] && !coveredMinterms[i]) {\n\t\t\t\t\tBitSet current = new BitSet();\n\t\t\t\t\tcurrent.set(j);\n\t\t\t\t\tcurrentColumn.add(current);\n\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (currentColumn.size() > 0) {\n\t\t\t\tpFunction.add(currentColumn);\n\t\t\t}\n\t\t}\n\t\treturn pFunction;\n\t}", "Boolean isValid(ArrayList<Integer> colQ){\n \n int curcol = colQ.size() - 1;\n int row = colQ.get(colQ.size() - 1);\n\n int i = 0;\n int j = 0;\n for(i = curcol-1, j = 1; i >= 0; i--, j++)\n {\n // check if we have two of the same row || check diags\n if(row == colQ.get(i) || row+j == colQ.get(i) || row-j == colQ.get(i)) return false;\n }\n return true;\n \n }", "@Test\n public void test_range_Integer_Collection3() {\n populate_i2();\n Collection<Integer> actual = Selector.range(i2, 5, 3, new CompareIntegerDescending());\n Collection<Integer> expected = new ArrayList<Integer>();\n expected.add(5);\n expected.add(3);\n Assert.assertEquals(\"Did not find range correctly\", expected, actual);\n }", "private static <T> int med3(T x[], Comparator<T> comp, int a, int b, int c) {\n\t\treturn (comp.compare(x[a],x[b])<0 ?\n\t\t\t\t(comp.compare(x[b],x[c])<0 ? b : comp.compare(x[a],x[c])<0 ? c : a) :\n\t\t\t\t\t(comp.compare(x[b],x[c])>0 ? b : comp.compare(x[a],x[c])>0 ? c : a));\n\t}", "private String checksubset(HashMap<String, ArrayList<String>> cn) {\n\t\tObject[] cnkeys = cn.keySet().toArray();\r\n\t\tfor (int i = 0; i < cnkeys.length; i++) {\r\n\t\t\tfor (int j = cnkeys.length - 1; j > i; j--) {\r\n\t\t\t\tif (cn.get(cnkeys[i]).size() < cn.get(cnkeys[j]).size()) {\r\n\t\t\t\t\tif (cn.get(cnkeys[j]).containsAll(cn.get(cnkeys[i]))) {\r\n\t\t\t\t\t\treturn (String) cnkeys[i];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (cn.get(cnkeys[i]).containsAll(cn.get(cnkeys[j]))) {\r\n\t\t\t\t\treturn (String) cnkeys[j];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public void checkBounds() {\n\t\tfor (int k = 0; k < numDataCols; k++) {\n\t\t\tDashDataType<?> dtype = dataTypes[k];\n\n\t\t\tif ( dtype instanceof StringDashDataType ) {\n\t\t\t\tStringDashDataType strtype = (StringDashDataType) dtype;\n\t\t\t\tfor (int j = 0; j < numSamples; j++) {\n\t\t\t\t\tADCMessage msg = strtype.boundsCheckStandardValue(\n\t\t\t\t\t\t\t\t\t\t\t(String) stdObjects[j][k]);\n\t\t\t\t\tif ( msg != null ) {\n\t\t\t\t\t\tmsg.setRowNumber(j+1);\n\t\t\t\t\t\tmsg.setColNumber(k+1);\n\t\t\t\t\t\tmsg.setColName(userColNames[k]);\n\t\t\t\t\t\tstdMsgList.add(msg);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if ( dtype instanceof CharDashDataType ) {\n\t\t\t\tCharDashDataType chartype = (CharDashDataType) dtype;\n\t\t\t\tfor (int j = 0; j < numSamples; j++) {\n\t\t\t\t\tADCMessage msg = chartype.boundsCheckStandardValue(\n\t\t\t\t\t\t\t\t\t\t\t(Character) stdObjects[j][k]);\n\t\t\t\t\tif ( msg != null ) {\n\t\t\t\t\t\tmsg.setRowNumber(j+1);\n\t\t\t\t\t\tmsg.setColNumber(k+1);\n\t\t\t\t\t\tmsg.setColName(userColNames[k]);\n\t\t\t\t\t\tstdMsgList.add(msg);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if ( dtype instanceof IntDashDataType ) {\n\t\t\t\tIntDashDataType inttype = (IntDashDataType) dtype;\n\t\t\t\tfor (int j = 0; j < numSamples; j++) {\n\t\t\t\t\tADCMessage msg = inttype.boundsCheckStandardValue(\n\t\t\t\t\t\t\t\t\t\t\t(Integer) stdObjects[j][k]);\n\t\t\t\t\tif ( msg != null ) {\n\t\t\t\t\t\tmsg.setRowNumber(j+1);\n\t\t\t\t\t\tmsg.setColNumber(k+1);\n\t\t\t\t\t\tmsg.setColName(userColNames[k]);\n\t\t\t\t\t\tstdMsgList.add(msg);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if ( dtype instanceof DoubleDashDataType ) {\n\t\t\t\tDoubleDashDataType dbltype = (DoubleDashDataType) dtype;\n\t\t\t\tfor (int j = 0; j < numSamples; j++) {\n\t\t\t\t\tADCMessage msg = dbltype.boundsCheckStandardValue(\n\t\t\t\t\t\t\t\t\t\t\t(Double) stdObjects[j][k]);\n\t\t\t\t\tif ( msg != null ) {\n\t\t\t\t\t\tmsg.setRowNumber(j+1);\n\t\t\t\t\t\tmsg.setColNumber(k+1);\n\t\t\t\t\t\tmsg.setColName(userColNames[k]);\n\t\t\t\t\t\tstdMsgList.add(msg);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthrow new IllegalArgumentException(\"unexpected data type encountered \" + \n\t\t\t\t\t\t\"in bounds checking: \" + dtype);\n\t\t\t}\n\t\t}\n\t}", "List<Collect> selectByExampleWithRowbounds(CollectExample example, RowBounds rowBounds);", "@Test\n \tpublic void whereClauseForNodeRightOverlap() {\n \t\tnode23.addJoin(new RightOverlap(node42));\n \t\tcheckWhereCondition(\n \t\t\t\tjoin(\"=\", \"_node23.text_ref\", \"_node42.text_ref\"),\n \t\t\t\tjoin(\">=\", \"_node23.right\", \"_node42.right\"),\n \t\t\t\tjoin(\">=\", \"_node42.right\", \"_node23.left\"),\n \t\t\t\tjoin(\">=\", \"_node23.left\", \"_node42.left\")\n \t\t);\n \t}", "boolean hasPermissionOfCluster(String clusterId, String userName);", "public List<ParameterValueObject> getClustering(Filter filter);", "public static void main(String[] args) {\n\t\t\n\t\tint k = 3;\n\t\t\n\t\tint max = Integer.MIN_VALUE, min = Integer.MAX_VALUE;\n\t\t\n\t\tint arr[] = new int[k];\n\t\t\n\t\tfor(int i = 0; i < k; i++) {\n\t\t\tif(max < arr[i])\n\t\t\t\tmax = arr[i];\n\t\t\tif(min > arr[i])\n\t\t\t\tmin = arr[i];\n\t\t}\n\t\t\n\t\t\n\t\tint [][] arr1 = {{3,8},{10,11},{1,3},{2,4}};\n\t\t\n\t\tSystem.out.println(selection(arr1));\n\t}", "private static boolean areOverlapping( int ix0, int ix1, int len )\n {\n if( ix0<ix1 ){\n return ix0+len>ix1;\n }\n else {\n return ix1+len>ix0;\n }\n }", "@Nullable\n public abstract GridAxis subset(GridSubset params, Formatter errlog);", "public static void main(String[] args)\r\n\t{\n\t\tList<Location> locations = new ArrayList<Location>();\r\n\t\tlocations.add(new Location(150, 981));\r\n\t\tlocations.add(new Location(136, 0));\r\n\t\tlocations.add(new Location(158, 88));\r\n\t\tlocations.add(new Location(330, 60));\r\n\t\tlocations.add(new Location(0, 1001));\r\n\t\tlocations.add(new Location(150, 0));\r\n\t\tlocations.add(new Location(0, 0));\r\n\t\tlocations.add(new Location(0, 0));\r\n\t\tlocations.add(new Location(0, 0));\r\n\t\tlocations.add(new Location(446, 88));\r\n\t\tlocations.add(new Location(562, 88));\r\n\t\tlocations.add(new Location(256, 88));\r\n\t\tlocations.add(new Location(678, 88));\r\n\t\tlocations.add(new Location(794, 88));\r\n\t\tlocations.add(new Location(0, 1028));\r\n\t\tlocations.add(new Location(136, 0));\r\n\t\tlocations.add(new Location(150, 0));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 1028));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(150, 88));\r\n\t\tlocations.add(new Location(136, 103));\r\n\t\tlocations.add(new Location(150, 0));\r\n\t\tList<LocationWrapper> clusterInput = new ArrayList<LocationWrapper>(locations.size());\r\n\t\tfor (Location location : locations)\r\n\t\t\tclusterInput.add(new LocationWrapper(location));\r\n\r\n\t\t// initialize a new clustering algorithm.\r\n\t\t// we use KMeans++ with 10 clusters and 10000 iterations maximum.\r\n\t\t// we did not specify a distance measure; the default (euclidean\r\n\t\t// distance) is used.\r\n\t\t// org.apache.commons.math3.ml.clustering.FuzzyKMeansClusterer<LocationWrapper>\r\n\t\t// clusterer = new\r\n\t\t// org.apache.commons.math3.ml.clustering.FuzzyKMeansClusterer<LocationWrapper>(2,\r\n\t\t// 2);\r\n\t\t// KMeansPlusPlusClusterer<LocationWrapper> clusterer = new\r\n\t\t// KMeansPlusPlusClusterer<LocationWrapper>(2, 10);\r\n\r\n\t\tDBSCANClusterer<LocationWrapper> clusterer = new DBSCANClusterer<LocationWrapper>(1200.0, 5);\r\n\t\tList<Cluster<LocationWrapper>> clusterResults = clusterer.cluster(clusterInput);\r\n\t\t// List<CentroidCluster<LocationWrapper>> clusterResults =\r\n\t\t// clusterer.cluster(clusterInput);\r\n\r\n\t\t// output the clusters\r\n\t\tSystem.out.println(\"clusterResults.size() = \" + clusterResults.size());\r\n\t\tfor (int i = 0; i < clusterResults.size(); i++)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Cluster \" + i);\r\n\t\t\tfor (LocationWrapper locationWrapper : clusterResults.get(i).getPoints())\r\n\t\t\t\tSystem.out.println(locationWrapper.getLocation());\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\t}", "@Test\n \tpublic void whereClauseForNodeOverlap() {\n \t\tnode23.addJoin(new Overlap(node42));\n \t\tcheckWhereCondition(\n \t\t\t\tjoin(\"=\", \"_node23.text_ref\", \"_node42.text_ref\"),\n \t\t\t\tjoin(\"<=\", \"_node23.left\", \"_node42.right\"),\n \t\t\t\tjoin(\"<=\", \"_node42.left\", \"_node23.right\")\n \t\t);\n \t}", "public void showDisplayCrossSectionBy(int[][] crossSection);", "@Test\n public void testSegmentSelection() {\n assertMetrics(\"segments:2 absoluteProximity:0.1 proximity:1 segmentStarts:19,41\",\n \"a b c d e\",\"x a b x c x x x x x x x x x x x x x x a b c x x x x x x x x x e x d x c d x x x c d e\");\n // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2\n // 0 1 2 3 4\n // Should choose - - - - -\n\n // Same as above but best matching segment have too low exactness\n assertMetrics(\"segments:2 absoluteProximity:0.0903 proximity:0.9033 segmentStarts:1,41\",\n \"a b c d e\",\"x a b x c x x x x x x x x x x x x x x a:0.2 b:0.3 c:0.4 x x x x x x x x x e x d x c d x x x c d e\");\n // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2\n // 0 1 2 3 4\n // Should choose - - - - -\n\n assertMetrics(\"segments:1 absoluteProximity:0.0778 proximity:0.778\",\"a b c d e f\",\"x x a b b b c f e d a b c d x e x x x x x f d e f a b c a a b b c c d d e e f f\");\n\n // Prefer one segment with ok proximity over two segments with great proximity\n assertMetrics(\"segments:1 segmentStarts:0\",\"a b c d\",\"a b x c d x x x x x x x x x x x a b x x x x x x x x x x x c d\");\n assertMetrics(\"segments:1 segmentStarts:0\",\"a b c d\",\"a b x x x x x x x x c d x x x x x x x x x x x a b x x x x x x x x x x x c d\");\n }", "public static void partitioningByTest2(){\r\n\t\tStream<String> ohMy = Stream.of(\"lions\", \"tigers\", \"bears\");\r\n\t\tMap<Boolean, Set<String>> map = ohMy.collect(\r\n\t\tCollectors.partitioningBy(s -> s.length() <= 7, Collectors.toSet()));\r\n\t\tSystem.out.println(map);// {false=[], true=[lions, tigers, bears]}\r\n\t}", "@Test\n public void testFilterPushDown() throws IOException { 'bla' as (x, y);\n // B = load 'morebla' as (a, b);\n // C = join A on x, B on a;\n // D = filter C by x = a and x = 0 and b = 1 and y = b;\n // store D into 'whatever';\n \n // A = load\n LogicalPlan lp = new LogicalPlan();\n {\n \tLogicalSchema aschema = new LogicalSchema();\n \taschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"x\", null, DataType.INTEGER));\n \taschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"y\", null, DataType.INTEGER));\n \taschema.getField(0).uid = 1;\n \taschema.getField(1).uid = 2;\n \tLOLoad A = new LOLoad(new FileSpec(\"bla\", new FuncSpec(\"PigStorage\", \"\\t\")), aschema, lp);\n \tlp.add(A);\n\t \n \t// B = load\n \tLogicalSchema bschema = new LogicalSchema();\n \tbschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"a\", null, DataType.INTEGER));\n \tbschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"b\", null, DataType.INTEGER));\n \tbschema.getField(0).uid = 3;\n \tbschema.getField(1).uid = 4;\n \tLOLoad B = new LOLoad(null, bschema, lp);\n \tlp.add(B);\n\t \n \t// C = join\n \tLogicalSchema cschema = new LogicalSchema();\n \tcschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"x\", null, DataType.INTEGER));\n \tcschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"y\", null, DataType.INTEGER));\n \tcschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"a\", null, DataType.INTEGER));\n \tcschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"b\", null, DataType.INTEGER));\n \tcschema.getField(0).uid = 1;\n \tcschema.getField(1).uid = 2;\n \tcschema.getField(2).uid = 3;\n \tcschema.getField(3).uid = 4;\n \tLogicalExpressionPlan aprojplan = new LogicalExpressionPlan();\n \tProjectExpression x = new ProjectExpression(aprojplan, DataType.INTEGER, 0, 0);\n \tx.neverUseForRealSetUid(1);\n \tLogicalExpressionPlan bprojplan = new LogicalExpressionPlan();\n \tProjectExpression y = new ProjectExpression(bprojplan, DataType.INTEGER, 1, 0);\n \ty.neverUseForRealSetUid(3);\n \tMultiMap<Integer, LogicalExpressionPlan> mm = \n \tnew MultiMap<Integer, LogicalExpressionPlan>();\n \tmm.put(0, aprojplan);\n \tmm.put(1, bprojplan);\n \tLOJoin C = new LOJoin(lp, mm, JOINTYPE.HASH, new boolean[] {true, true});\n \tC.neverUseForRealSetSchema(cschema);\n \tlp.add(C);\n \tlp.connect(A, C);\n \tlp.connect(B, C);\n \n \t// D = filter\n \tLogicalExpressionPlan filterPlan = new LogicalExpressionPlan();\n \tProjectExpression fx = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 0);\n \tfx.neverUseForRealSetUid(1);\n \tConstantExpression fc0 = new ConstantExpression(filterPlan, DataType.INTEGER, new Integer(0));\n \tEqualExpression eq1 = new EqualExpression(filterPlan, fx, fc0);\n \tProjectExpression fanotherx = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 0);\n \tfanotherx.neverUseForRealSetUid(1);\n \tProjectExpression fa = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 2);\n \tfa.neverUseForRealSetUid(3);\n \tEqualExpression eq2 = new EqualExpression(filterPlan, fanotherx, fa);\n \tAndExpression and1 = new AndExpression(filterPlan, eq1, eq2);\n \tProjectExpression fb = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 3);\n \tfb.neverUseForRealSetUid(4);\n \tConstantExpression fc1 = new ConstantExpression(filterPlan, DataType.INTEGER, new Integer(1));\n \tEqualExpression eq3 = new EqualExpression(filterPlan, fb, fc1);\n \tAndExpression and2 = new AndExpression(filterPlan, and1, eq3);\n \tProjectExpression fanotherb = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 3);\n \tfanotherb.neverUseForRealSetUid(4);\n \tProjectExpression fy = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 1);\n \tfy.neverUseForRealSetUid(2);\n \tEqualExpression eq4 = new EqualExpression(filterPlan, fy, fanotherb);\n \tnew AndExpression(filterPlan, and2, eq4);\n \n \tLOFilter D = new LOFilter(lp, filterPlan);\n \tD.neverUseForRealSetSchema(cschema);\n \t// Connect D to B, since the transform has happened.\n \tlp.add(D);\n \tlp.connect(C, D);\n }\n \n LogicalPlanOptimizer optimizer = new LogicalPlanOptimizer(lp, 500);\n optimizer.optimize();\n \n LogicalPlan expected = new LogicalPlan();\n {\n // A = load\n \tLogicalSchema aschema = new LogicalSchema();\n \taschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"x\", null, DataType.INTEGER));\n \taschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"y\", null, DataType.INTEGER));\n \taschema.getField(0).uid = 1;\n \taschema.getField(1).uid = 2;\n \tLOLoad A = new LOLoad(new FileSpec(\"bla\", new FuncSpec(\"PigStorage\", \"\\t\")), aschema, expected);\n \texpected.add(A);\n \t\n \t// DA = filter\n \tLogicalExpressionPlan DAfilterPlan = new LogicalExpressionPlan();\n \tProjectExpression fx = new ProjectExpression(DAfilterPlan, DataType.INTEGER, 0, 0);\n \tfx.neverUseForRealSetUid(1);\n \tConstantExpression fc0 = new ConstantExpression(DAfilterPlan, DataType.INTEGER, new Integer(0));\n \tnew EqualExpression(DAfilterPlan, fx, fc0);\n\t \n \tLOFilter DA = new LOFilter(expected, DAfilterPlan);\n \tDA.neverUseForRealSetSchema(aschema);\n \texpected.add(DA);\n \texpected.connect(A, DA);\n\t \n \t// B = load\n \tLogicalSchema bschema = new LogicalSchema();\n \tbschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"a\", null, DataType.INTEGER));\n \tbschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"b\", null, DataType.INTEGER));\n \tbschema.getField(0).uid = 3;\n \tbschema.getField(1).uid = 4;\n \tLOLoad B = new LOLoad(null, bschema, expected);\n \texpected.add(B);\n \t\n \t// DB = filter\n \tLogicalExpressionPlan DBfilterPlan = new LogicalExpressionPlan();\n \tProjectExpression fb = new ProjectExpression(DBfilterPlan, DataType.INTEGER, 0, 1);\n \tfb.neverUseForRealSetUid(4);\n \tConstantExpression fc1 = new ConstantExpression(DBfilterPlan, DataType.INTEGER, new Integer(1));\n \tnew EqualExpression(DBfilterPlan, fb, fc1);\n\t \n \tLOFilter DB = new LOFilter(expected, DBfilterPlan);\n \tDB.neverUseForRealSetSchema(bschema);\n \texpected.add(DB);\n \texpected.connect(B, DB);\n\t \n \t// C = join\n \tLogicalSchema cschema = new LogicalSchema();\n \tcschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"x\", null, DataType.INTEGER));\n \tcschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"y\", null, DataType.INTEGER));\n \tcschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"a\", null, DataType.INTEGER));\n \tcschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"b\", null, DataType.INTEGER));\n \tcschema.getField(0).uid = 1;\n \tcschema.getField(1).uid = 2;\n \tcschema.getField(2).uid = 3;\n \tcschema.getField(3).uid = 4;\n \tLogicalExpressionPlan aprojplan = new LogicalExpressionPlan();\n \tProjectExpression x = new ProjectExpression(aprojplan, DataType.INTEGER, 0, 0);\n \tx.neverUseForRealSetUid(1);\n \tLogicalExpressionPlan bprojplan = new LogicalExpressionPlan();\n \tProjectExpression y = new ProjectExpression(bprojplan, DataType.INTEGER, 1, 0);\n \ty.neverUseForRealSetUid(3);\n \tMultiMap<Integer, LogicalExpressionPlan> mm = \n \tnew MultiMap<Integer, LogicalExpressionPlan>();\n \tmm.put(0, aprojplan);\n \tmm.put(1, bprojplan);\n \tLOJoin C = new LOJoin(expected, mm, JOINTYPE.HASH, new boolean[] {true, true});\n \tC.neverUseForRealSetSchema(cschema);\n \texpected.add(C);\n \texpected.connect(DA, C);\n \texpected.connect(DB, C);\n\t \n \t// D = filter\n \tLogicalExpressionPlan filterPlan = new LogicalExpressionPlan();\n \tProjectExpression fanotherx = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 0);\n \tfanotherx.neverUseForRealSetUid(1);\n \tProjectExpression fa = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 2);\n \tfa.neverUseForRealSetUid(3);\n \tEqualExpression eq2 = new EqualExpression(filterPlan, fanotherx, fa);\n \tProjectExpression fanotherb = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 3);\n \tfanotherb.neverUseForRealSetUid(4);\n \tProjectExpression fy = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 1);\n \tfy.neverUseForRealSetUid(2);\n \tEqualExpression eq4 = new EqualExpression(filterPlan, fy, fanotherb);\n \tnew AndExpression(filterPlan, eq2, eq4);\n\t \n \tLOFilter D = new LOFilter(expected, filterPlan);\n \tD.neverUseForRealSetSchema(cschema);\n \texpected.add(D);\n \texpected.connect(C, D);\n }\n \n assertTrue( lp.isEqual(expected) );\n // assertEquals(lp, expected);\n }", "@Test\n \tpublic void whereClauseForNodeLeftOverlap() {\n \t\tnode23.addJoin(new LeftOverlap(node42));\n \t\tcheckWhereCondition(\n \t\t\t\tjoin(\"=\", \"_node23.text_ref\", \"_node42.text_ref\"),\n \t\t\t\tjoin(\"<=\", \"_node23.left\", \"_node42.left\"),\n \t\t\t\tjoin(\"<=\", \"_node42.left\", \"_node23.right\"),\n \t\t\t\tjoin(\"<=\", \"_node23.right\", \"_node42.right\")\n \t\t);\n \t}", "@Test void firstRow1and2() {\n\t\tcheckFirstRow1and2(false,5,4);\n\n\t\t// X X X X\n\t\t// X X X X X\n\t\tcheckFirstRow1and2(true,4,5);\n\n\t\t// X\n\t\t// x\n\t\tcheckFirstRow1and2(false,1,1);\n\n\t\t// X\n\t\t// x\n\t\tcheckFirstRow1and2(true,1,1);\n\t}", "@Test\n public void testColocatedPartitionedRegion() throws Throwable {\n createCacheInAllVms();\n redundancy = 0;\n localMaxmemory = 50;\n totalNumBuckets = 11;\n\n regionName = \"A\";\n colocatedWith = null;\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"B\";\n colocatedWith = SEPARATOR + \"A\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"C\";\n colocatedWith = SEPARATOR + \"A\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"D\";\n colocatedWith = SEPARATOR + \"B\";\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"E\";\n colocatedWith = SEPARATOR + \"B\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"F\";\n colocatedWith = SEPARATOR + \"B\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"G\";\n colocatedWith = SEPARATOR + \"C\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"H\";\n colocatedWith = SEPARATOR + \"C\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"I\";\n colocatedWith = SEPARATOR + \"C\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"J\";\n colocatedWith = SEPARATOR + \"D\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"K\";\n colocatedWith = SEPARATOR + \"D\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"L\";\n colocatedWith = SEPARATOR + \"E\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"M\";\n colocatedWith = SEPARATOR + \"F\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"N\";\n colocatedWith = SEPARATOR + \"G\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"O\";\n colocatedWith = SEPARATOR + \"I\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n accessor.invoke(() -> PRColocationDUnitTest.validateColocatedRegions(\"A\"));\n\n accessor.invoke(() -> PRColocationDUnitTest.validateColocatedRegions(\"D\"));\n\n accessor.invoke(() -> PRColocationDUnitTest.validateColocatedRegions(\"H\"));\n\n accessor.invoke(() -> PRColocationDUnitTest.validateColocatedRegions(\"B\"));\n\n accessor.invoke(() -> PRColocationDUnitTest.validateColocatedRegions(\"K\"));\n }", "private int adequateDimensions(int cols, int rows) {\r\n\r\n if ((cols >= MINALG) && (cols <= MAXALG)) {\r\n if ((rows >= MINDATA) && (rows <= MAXDATA)) {\r\n return 0;\r\n } else {\r\n return 1;\r\n }\r\n } else {\r\n return 2;\r\n }\r\n\r\n }" ]
[ "0.7151454", "0.71180356", "0.7091", "0.7080686", "0.7052878", "0.6467863", "0.63756365", "0.6356479", "0.633281", "0.62895817", "0.6276503", "0.5980363", "0.56661403", "0.5642333", "0.5599308", "0.55628234", "0.5533157", "0.5457517", "0.5346082", "0.5249726", "0.5203883", "0.5078148", "0.50127417", "0.49789843", "0.49708307", "0.49402875", "0.48843983", "0.4881545", "0.48783663", "0.48697397", "0.4864854", "0.4849077", "0.47675556", "0.47430766", "0.47416106", "0.47339198", "0.47035038", "0.46986008", "0.46955705", "0.46904397", "0.46866733", "0.4680667", "0.4663427", "0.46628365", "0.4659285", "0.4653952", "0.46472767", "0.4640239", "0.46332797", "0.46195886", "0.460887", "0.46059525", "0.46057913", "0.4604339", "0.4600132", "0.45935434", "0.45881915", "0.45832288", "0.45807365", "0.45784256", "0.45772013", "0.45566255", "0.45375702", "0.45353606", "0.45226315", "0.45034245", "0.44874442", "0.44767964", "0.44743142", "0.44723675", "0.44625536", "0.44615504", "0.44542813", "0.4441844", "0.44397435", "0.44389415", "0.44322285", "0.44297355", "0.44277635", "0.44210285", "0.44201866", "0.44179597", "0.44161132", "0.44144207", "0.4413841", "0.44120753", "0.4411384", "0.44086075", "0.4406669", "0.44041914", "0.44004002", "0.43921137", "0.43892932", "0.43855932", "0.43848687", "0.43757707", "0.4374819", "0.4370925", "0.4369968", "0.43673202" ]
0.71541804
0
Test multicolumn slice restrictions with ascending, descending, ascending and descending columns (e.g '(clustering_0, clustering1, clustering_3, clustering4) > (1, 2, 3, 4)')
@Test public void testBoundsAsCompositesWithMultiSliceRestrictionsMixingAscendingDescendingClusteringColumns() { CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.DESC, Sort.ASC, Sort.DESC); ByteBuffer value1 = ByteBufferUtil.bytes(1); ByteBuffer value2 = ByteBufferUtil.bytes(2); ByteBuffer value3 = ByteBufferUtil.bytes(3); ByteBuffer value4 = ByteBufferUtil.bytes(4); // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4) Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4); PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(slice); List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(4, bounds.size()); assertComposite(bounds.get(0), value1, EOC.START); assertComposite(bounds.get(1), value1, value2, value3, EOC.START); assertComposite(bounds.get(2), value1, value2, value3, EOC.END); assertComposite(bounds.get(3), value1, EOC.END); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(4, bounds.size()); assertComposite(bounds.get(0), value1, value2, EOC.START); assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.START); assertComposite(bounds.get(2), value1, value2, EOC.END); assertEmptyComposite(bounds.get(3)); // clustering_0 = 1 AND (clustering_1, clustering_2, clustering_3) > (2, 3, 4) Restriction eq = newSingleEq(cfMetaData, 0, value1); slice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3, value4); restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(slice); restrictions = restrictions.mergeWith(eq); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(3, bounds.size()); assertComposite(bounds.get(0), value1, EOC.START); assertComposite(bounds.get(1), value1, value2, value3, EOC.START); assertComposite(bounds.get(2), value1, value2, value3, EOC.END); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(3, bounds.size()); assertComposite(bounds.get(0), value1, value2, EOC.START); assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.START); assertComposite(bounds.get(2), value1, value2, EOC.END); // (clustering_0, clustering1) >= (1, 2) slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2); restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(slice); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(2, bounds.size()); assertComposite(bounds.get(0), value1, EOC.START); assertComposite(bounds.get(1), value1, EOC.END); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(2, bounds.size()); assertComposite(bounds.get(0), value1, value2, EOC.END); assertEmptyComposite(bounds.get(1)); // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4) slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4); restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(slice); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(4, bounds.size()); assertComposite(bounds.get(0), value1, EOC.START); assertComposite(bounds.get(1), value1, value2, value3, EOC.START); assertComposite(bounds.get(2), value1, value2, value3, EOC.END); assertComposite(bounds.get(3), value1, EOC.END); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(4, bounds.size()); assertComposite(bounds.get(0), value1, value2, EOC.START); assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.END); assertComposite(bounds.get(2), value1, value2, EOC.END); assertEmptyComposite(bounds.get(3)); // (clustering_0, clustering1, clustering_2, clustering_3) <= (1, 2, 3, 4) slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2, value3, value4); restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(slice); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(4, bounds.size()); assertEmptyComposite(bounds.get(0)); assertComposite(bounds.get(1), value1, value2, EOC.START); assertComposite(bounds.get(2), value1, value2, value3, value4, EOC.NONE); assertComposite(bounds.get(3), value1, value2, EOC.END); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(4, bounds.size()); assertComposite(bounds.get(0), value1, EOC.START); assertComposite(bounds.get(1), value1, value2, value3, EOC.START); assertComposite(bounds.get(2), value1, value2, value3, EOC.END); assertComposite(bounds.get(3), value1, EOC.END); // (clustering_0, clustering1, clustering_2, clustering_3) < (1, 2, 3, 4) slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2, value3, value4); restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(slice); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(4, bounds.size()); assertEmptyComposite(bounds.get(0)); assertComposite(bounds.get(1), value1, value2, EOC.START); assertComposite(bounds.get(2), value1, value2, value3, value4, EOC.END); assertComposite(bounds.get(3), value1, value2, EOC.END); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(4, bounds.size()); assertComposite(bounds.get(0), value1, EOC.START); assertComposite(bounds.get(1), value1, value2, value3, EOC.START); assertComposite(bounds.get(2), value1, value2, value3, EOC.END); assertComposite(bounds.get(3), value1, EOC.END); // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4) AND (clustering_0, clustering_1) < (2, 3) slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4); Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2, value3); restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(slice).mergeWith(slice2); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(5, bounds.size()); assertComposite(bounds.get(0), value1, EOC.START); assertComposite(bounds.get(1), value1, value2, value3, EOC.START); assertComposite(bounds.get(2), value1, value2, value3, EOC.END); assertComposite(bounds.get(3), value1, EOC.END); assertComposite(bounds.get(4), value2, value3, EOC.END); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(5, bounds.size()); assertComposite(bounds.get(0), value1, value2, EOC.START); assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.START); assertComposite(bounds.get(2), value1, value2, EOC.END); assertComposite(bounds.get(3), value2, EOC.START); assertComposite(bounds.get(4), value2, EOC.END); // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4) AND (clustering_0, clustering1, clustering_2, clustering_3) <= (4, 3, 2, 1) slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4); slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value4, value3, value2, value1); restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(slice).mergeWith(slice2); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(7, bounds.size()); assertComposite(bounds.get(0), value1, EOC.START); assertComposite(bounds.get(1), value1, value2, value3, EOC.START); assertComposite(bounds.get(2), value1, value2, value3, EOC.END); assertComposite(bounds.get(3), value1, EOC.END); assertComposite(bounds.get(4), value4, value3, EOC.START); assertComposite(bounds.get(5), value4, value3, value2, value1, EOC.NONE); assertComposite(bounds.get(6), value4, value3, EOC.END); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(7, bounds.size()); assertComposite(bounds.get(0), value1, value2, EOC.START); assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.END); assertComposite(bounds.get(2), value1, value2, EOC.END); assertComposite(bounds.get(3), value4, EOC.START); assertComposite(bounds.get(4), value4, value3, value2, EOC.START); assertComposite(bounds.get(5), value4, value3, value2, EOC.END); assertComposite(bounds.get(6), value4, EOC.END); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneAscendingAndOneDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n assertComposite(bounds.get(2), value2, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertComposite(bounds.get(1), value2, EOC.START);\n assertComposite(bounds.get(2), value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneDescendingAndOneAscendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0) > (1) AND (clustering_0, clustering1) < (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.END);\n assertComposite(bounds.get(2), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.END);\n assertComposite(bounds.get(1), value1, EOC.START);\n assertComposite(bounds.get(2), value1, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithTwoAscendingAndTwoDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.DESC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertEmptyComposite(bounds.get(1));\n\n // clustering_0 = 1 AND (clustering_1, clustering_2, clustering_3) > (2, 3, 4)\n Restriction eq = newSingleEq(cfMetaData, 0, value1);\n slice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n restrictions = restrictions.mergeWith(eq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2, clustering_3) > (2, 3, 4)\n Restriction in = newSingleIN(cfMetaData, 0, value1, value2);\n slice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n restrictions = restrictions.mergeWith(in);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n assertComposite(bounds.get(2), value2, value2, EOC.START);\n assertComposite(bounds.get(3), value2, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n assertComposite(bounds.get(2), value2, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(3), value2, EOC.END);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1, clustering_2, clustering_3) <= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) < (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4) AND (clustering_0, clustering_1) < (2, 3)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2, value3);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(1), value2, value3, EOC.START);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4) AND (clustering_0, clustering1, clustering_2, clustering_3) <= (4, 3, 2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value4, value3, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n assertComposite(bounds.get(2), value4, value3, value2, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(1), value4, value3, EOC.START);\n assertComposite(bounds.get(2), value4, value3, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithTwoDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithTwoClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneDescendingClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithSliceRestrictionsAndOneDescendingClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newSingleSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newSingleSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiEqAndSingleSliceRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n\n // (clustering_0, clustering_1) = (1, 2) AND clustering_2 > 3\n Restriction multiEq = newMultiEq(cfMetaData, 0, value1, value2);\n Restriction singleSlice = newSingleSlice(cfMetaData, 2, Bound.START, false, value3);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiEq).mergeWith(singleSlice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithSingleEqAndSliceRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n ByteBuffer value5 = ByteBufferUtil.bytes(5);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) > (2, 3)\n Restriction singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction multiSlice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiSlice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) > (2, 3) AND (clustering_1) < (4)\n singleEq = newSingleEq(cfMetaData, 0, value1);\n multiSlice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3);\n Restriction multiSlice2 = newMultiSlice(cfMetaData, 1, Bound.END, false, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiSlice2).mergeWith(singleEq).mergeWith(multiSlice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value4, EOC.START);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) => (2, 3) AND (clustering_1, clustering_2) <= (4, 5)\n singleEq = newSingleEq(cfMetaData, 0, value1);\n multiSlice = newMultiSlice(cfMetaData, 1, Bound.START, true, value2, value3);\n multiSlice2 = newMultiSlice(cfMetaData, 1, Bound.END, true, value4, value5);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiSlice2).mergeWith(singleEq).mergeWith(multiSlice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value4, value5, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithSliceRestrictionsAndOneClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newSingleSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newSingleSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithOneEqRestrictionsAndTwoClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer clustering_0 = ByteBufferUtil.bytes(1);\n Restriction eq = newSingleEq(cfMetaData, 0, clustering_0);\n\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.END);\n }", "private static Restriction newMultiSlice(CFMetaData cfMetaData, int firstIndex, Bound bound, boolean inclusive, ByteBuffer... values)\n {\n List<ColumnDefinition> columnDefinitions = new ArrayList<>();\n for (int i = 0; i < values.length; i++)\n {\n columnDefinitions.add(getClusteringColumnDefinition(cfMetaData, i + firstIndex));\n }\n return new MultiColumnRestriction.Slice(columnDefinitions, bound, inclusive, toMultiItemTerminal(values));\n }", "@Test\n public void testBoundsAsCompositesWithEqAndSliceRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n\n Restriction eq = newSingleEq(cfMetaData, 0, value3);\n\n Restriction slice = newSingleSlice(cfMetaData, 1, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 1, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 1, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 1, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 1, Bound.START, false, value1);\n Restriction slice2 = newSingleSlice(cfMetaData, 1, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value2, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 1, Bound.START, true, value1);\n slice2 = newSingleSlice(cfMetaData, 1, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithOneEqRestrictionsAndOneClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC);\n\n ByteBuffer clustering_0 = ByteBufferUtil.bytes(1);\n Restriction eq = newSingleEq(cfMetaData, 0, clustering_0);\n\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithSingleEqAndMultiINRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n ByteBuffer value5 = ByteBufferUtil.bytes(5);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) IN ((2, 3), (4, 5))\n Restriction singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction multiIN = newMultiIN(cfMetaData, 1, asList(value2, value3), asList(value4, value5));\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiIN);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(1), value1, value4, value5, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(1), value1, value4, value5, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) IN ((2, 3))\n singleEq = newSingleEq(cfMetaData, 0, value1);\n multiIN = newMultiIN(cfMetaData, 1, asList(value2, value3));\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiIN).mergeWith(singleEq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n // clustering_0 = 1 AND clustering_1 = 5 AND (clustering_2, clustering_3) IN ((2, 3), (4, 5))\n singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction singleEq2 = newSingleEq(cfMetaData, 1, value5);\n multiIN = newMultiIN(cfMetaData, 2, asList(value2, value3), asList(value4, value5));\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiIN).mergeWith(singleEq2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value5, value2, value3, EOC.START);\n assertComposite(bounds.get(1), value1, value5, value4, value5, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value5, value2, value3, EOC.END);\n assertComposite(bounds.get(1), value1, value5, value4, value5, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithSingleEqAndMultiEqRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) = (2, 3)\n Restriction singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction multiEq = newMultiEq(cfMetaData, 1, value2, value3);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiEq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n // clustering_0 = 1 AND clustering_1 = 2 AND (clustering_2, clustering_3) = (3, 4)\n singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction singleEq2 = newSingleEq(cfMetaData, 1, value2);\n multiEq = newMultiEq(cfMetaData, 2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(singleEq2).mergeWith(multiEq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n\n // (clustering_0, clustering_1) = (1, 2) AND clustering_2 = 3\n singleEq = newSingleEq(cfMetaData, 2, value3);\n multiEq = newMultiEq(cfMetaData, 0, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiEq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) = (2, 3) AND clustering_3 = 4\n singleEq = newSingleEq(cfMetaData, 0, value1);\n singleEq2 = newSingleEq(cfMetaData, 3, value4);\n multiEq = newMultiEq(cfMetaData, 1, value2, value3);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiEq).mergeWith(singleEq2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n }", "public void testSortOnComputedColumn1() throws Exception {\n \t\tccName = new String[] { \"cc\" };\n \t\tccExpr = new String[] { \"(row.COL0%2==0?1:2)\" };\n \n \t\tfor (int i = 0; i < ccName.length; i++) {\n \t\t\tComputedColumn computedColumn = new ComputedColumn(ccName[i],\n \t\t\t\t\tccExpr[i], DataType.ANY_TYPE);\n \t\t\t((BaseDataSetDesign) this.dataSet)\n \t\t\t\t\t.addComputedColumn(computedColumn);\n \t\t}\n \n \t\tString[] bindingNameSort = new String[1];\n \t\tbindingNameSort[0] = \"SORT_DEFINITION\";\n \t\tIBaseExpression[] bindingExprSort = new IBaseExpression[1];\n \t\tbindingExprSort[0] = new ScriptExpression(\"dataSetRow.cc\");\n \n \t\tSortDefinition[] sortDefn = new SortDefinition[] { new SortDefinition() };\n \t\tsortDefn[0].setColumn(\"SORT_DEFINITION\");\n \t\tsortDefn[0].setSortDirection(ISortDefinition.SORT_DESC);\n \n \t\tString[] bindingNameRow = new String[5];\n \t\tbindingNameRow[0] = \"ROW_COL0\";\n \t\tbindingNameRow[1] = \"ROW_COL1\";\n \t\tbindingNameRow[2] = \"ROW_COL2\";\n \t\tbindingNameRow[3] = \"ROW_COL3\";\n \t\tbindingNameRow[4] = \"ROW_cc\";\n \t\tScriptExpression[] bindingExprRow = new ScriptExpression[] {\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL0\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL1\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL2\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL3\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + ccName[0], 0), };\n \n \t\tIResultIterator resultIt = this.executeQuery(this.createQuery(null,\n \t\t\t\tnull, null, bindingNameSort, bindingExprSort, sortDefn, null,\n \t\t\t\tnull, null, bindingNameRow, bindingExprRow));\n \n \t\tprintResult(resultIt, bindingNameRow, bindingExprRow);\n \t\t// assert\n \t\tcheckOutputFile();\n \t}", "public interface IStoppingCriteria {\n\n /**\n * Determine the degree of clustering agreement\n * @param cluster1 one clustering results\n * @param cluster2 the other clustering results\n * @return the degree of clustering agreement; 1 refers to be the same clustering results; 0 refers to be the totally different clustering results\n */\n public double computeSimilarity(int[] cluster1, int[] cluster2);\n\n}", "@Test\n public void testBoundsAsCompositesWithOneInRestrictionsAndOneClusteringColumn()\n {\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n Restriction in = newSingleIN(cfMetaData, 0, value1, value2, value3);\n\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(in);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.START);\n assertComposite(bounds.get(2), value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n assertComposite(bounds.get(1), value2, EOC.END);\n assertComposite(bounds.get(2), value3, EOC.END);\n }", "public void testMultipass_Sort() throws Exception\n \t{\n \t\tccName = new String[]{\n \t\t\t\t\"cc1\", \"cc2\"\n \t\t};\n \t\tccExpr = new String[]{\n \t\t\t\t\"Total.sum(row.COL1)\", \"Total.sum(row.cc1)\"\n \t\t};\n \n \t\tfor ( int i = 0; i < ccName.length; i++ )\n \t\t{\n \t\t\tComputedColumn computedColumn = new ComputedColumn( ccName[i],\n \t\t\t\t\tccExpr[i],\n \t\t\t\t\tDataType.INTEGER_TYPE );\n \t\t\t( (BaseDataSetDesign) this.dataSet ).addComputedColumn( computedColumn );\n \t\t}\n \t\t\n \t\tString[] bindingNameSort = new String[2];\n \t\tbindingNameSort[0] = \"SORT_DEFINITION_1\";\n \t\tbindingNameSort[1] = \"SORT_DEFINITION_2\";\n \t\tIBaseExpression[] bindingExprSort = new IBaseExpression[2];\n \t\tbindingExprSort[0] = new ScriptExpression(\n \t\t\t\t\"dataSetRow.COL1/(Total.ave(dataSetRow.cc1)+dataSetRow.cc1)\");\n \t\tbindingExprSort[1] = new ScriptExpression(\n \t\t\t\t\"dataSetRow.cc2-dataSetRow.COL2\");\n \t\tSortDefinition[] sortDefn = new SortDefinition[] {\n \t\t\t\tnew SortDefinition(), new SortDefinition() };\n \t\tsortDefn[0].setColumn(\"SORT_DEFINITION_1\");\n \t\tsortDefn[0].setSortDirection(ISortDefinition.SORT_DESC);\n \t\tsortDefn[1].setColumn(\"SORT_DEFINITION_2\");\n \t\tsortDefn[1].setSortDirection(ISortDefinition.SORT_DESC);\n \n \t\tString[] bindingNameRow = new String[6];\n \t\tbindingNameRow[0] = \"ROW_COL0\";\n \t\tbindingNameRow[1] = \"ROW_COL1\";\n \t\tbindingNameRow[2] = \"ROW_COL2\";\n \t\tbindingNameRow[3] = \"ROW_COL3\";\n \t\tbindingNameRow[4] = \"ROW_cc1\";\n \t\tbindingNameRow[5] = \"ROW_cc2\";\n \t\tScriptExpression[] bindingExprRow = new ScriptExpression[]{\n \t\t\t\tnew ScriptExpression( \"dataSetRow.\" + \"COL0\", 0 ),\n \t\t\t\tnew ScriptExpression( \"dataSetRow.\" + \"COL1\", 0 ),\n \t\t\t\tnew ScriptExpression( \"dataSetRow.\" + \"COL2\", 0 ),\n \t\t\t\tnew ScriptExpression( \"dataSetRow.\" + \"COL3\", 0 ),\n \t\t\t\tnew ScriptExpression( \"dataSetRow.\" + ccName[0], 0 ),\n \t\t\t\tnew ScriptExpression( \"dataSetRow.\" + ccName[1], 0 ),\n \t\t};\n \t\tIResultIterator resultIt = this.executeQuery(this.createQuery(null,\n \t\t\t\tnull, null, bindingNameSort, bindingExprSort, sortDefn, null,\n \t\t\t\tnull, null, bindingNameRow, bindingExprRow));\n \n \t\tprintResult(resultIt, bindingNameRow, bindingExprRow);\t\n \t\t// assert\n \t\tcheckOutputFile();\n \t}", "public abstract int Compare(Slice a, Slice b);", "@Test\n public void testPartitionColumnSelection() {\n Path filePath = new Path(\"hdfs:///w/x/y/z.csv\");\n ImplicitColumnManager implictColManager = new ImplicitColumnManager(\n fixture.getOptionManager(),\n standardOptions(filePath));\n\n String dir0 = ScanTestUtils.partitionColName(0);\n // Sic: case insensitivity, but name in project list\n // is preferred over \"natural\" name.\n String dir1 = \"DIR1\";\n String dir2 = ScanTestUtils.partitionColName(2);\n ScanLevelProjection scanProj = ScanLevelProjection.build(\n RowSetTestUtils.projectList(dir2, dir1, dir0, \"a\"),\n Lists.newArrayList(implictColManager.projectionParser()));\n\n assertEquals(4, scanProj.columns().size());\n assertEquals(dir2, scanProj.columns().get(0).name());\n assertEquals(dir1, scanProj.columns().get(1).name());\n assertEquals(dir0, scanProj.columns().get(2).name());\n assertEquals(\"a\", scanProj.columns().get(3).name());\n\n // Verify column type\n\n assertTrue(scanProj.columns().get(0) instanceof PartitionColumn);\n }", "@Test\n public void testBoundsAsCompositesWithMultiEqRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n Restriction eq = newMultiEq(cfMetaData, 0, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n }", "private boolean checkifCollinear(Point[] ptArr, Comparator<Point> cmp, int start){\n\t\tif(start +2 >= ptArr.length) return false;\t\n\t\tif(cmp.compare(ptArr[start],ptArr[start+1]) == cmp.compare(ptArr[start+1],ptArr[start+2]) && cmp.compare(ptArr[start],ptArr[start+1]) == 0){\n\t\t\treturn true;\n\t\t}\t\t\n\t\treturn false;\t\n\t}", "List<Trueorfalse> selectByExample(RowBounds rowBounds);", "private boolean isSubsetOf(int firstRow, int secondRow) {\n for (int i = 0; i < universalSetSize; i++) {\n if (input[firstRow][i] && !input[secondRow][i]) {\n return false;\n }\n }\n return true;\n }", "@Test\n\tpublic void testEliminationByColumn(){\n\t\tsetBoardUp();\n\t\tColumn col = new Column(board, 1);\n\t\tint[] toBeRemoved = {1, 3, 4};\n\t\tint[] fromCesll = {1, 2, 3, 5, 6, 8};\n\t\talgorithm.applyEliminationInColumn(col);\n\t\tboolean condition = true;\n\t\tfor(int i = 0; i < toBeRemoved.length; i++)\n\t\t\tfor(int j = 0; j < fromCesll.length; j++)\n\t\t\t\tcondition &= !col.cell[fromCesll[j]].possibilities.contains(toBeRemoved[i]);\t\t\n\t\tassertTrue(condition);\n\t}", "@Test\n public void testBoundsAsCompositesWithMultiInRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n Restriction in = newMultiIN(cfMetaData, 0, asList(value1, value2), asList(value2, value3));\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(in);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertComposite(bounds.get(1), value2, value3, EOC.END);\n }", "protected void checkBox(int slice, int row, int column, int depth, int height, int width) {\n\tif (slice<0 || depth<0 || slice+depth>slices || row<0 || height<0 || row+height>rows || column<0 || width<0 || column+width>columns) throw new IndexOutOfBoundsException(toStringShort()+\", slice:\"+slice+\", row:\"+row+\" ,column:\"+column+\", depth:\"+depth+\" ,height:\"+height+\", width:\"+width);\n}", "private boolean isSubsetOf(List<String> permissions2,\n\t\t\tList<String> permissions3) {\n\t\treturn false;\n\t}", "public void testSortOnComputedColumn() throws Exception {\n \t\tccName = new String[] { \"ccc\", \"ccc2\" };\n \t\tccExpr = new String[] { \"row.COL0+row.COL1\",\n \t\t\t\t\"row.COL1+10\" };\n \t\tfor (int i = 0; i < ccName.length; i++) {\n \t\t\tComputedColumn computedColumn = new ComputedColumn(ccName[i],\n \t\t\t\t\tccExpr[i], DataType.INTEGER_TYPE);\n \t\t\t((BaseDataSetDesign) this.dataSet)\n \t\t\t\t\t.addComputedColumn(computedColumn);\n \t\t}\n \n \t\tString[] bindingNameSort = new String[1];\n \t\tbindingNameSort[0] = \"SORT_DEFINITION\";\n \t\tIBaseExpression[] bindingExprSort = new IBaseExpression[1];\n \t\tbindingExprSort[0] = new ScriptExpression(\n \t\t\t\t\"dataSetRow.ccc/Total.ave(dataSetRow.ccc)\");\n \t\tSortDefinition[] sortDefn = new SortDefinition[] { new SortDefinition() };\n \t\tsortDefn[0].setExpression(\"row.SORT_DEFINITION\");\n \t\tsortDefn[0].setSortDirection(ISortDefinition.SORT_DESC);\n \n \t\tString[] bindingNameRow = new String[6];\n \t\tbindingNameRow[0] = \"ROW_COL0\";\n \t\tbindingNameRow[1] = \"ROW_COL1\";\n \t\tbindingNameRow[2] = \"ROW_COL2\";\n \t\tbindingNameRow[3] = \"ROW_COL3\";\n \t\tbindingNameRow[4] = \"ROW_ccc\";\n \t\tbindingNameRow[5] = \"ROW_ccc2\";\n \t\tScriptExpression[] bindingExprRow = new ScriptExpression[] {\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL0\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL1\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL2\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL3\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + ccName[0], 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + ccName[1], 0), };\n \n \t\tIResultIterator resultIt = this.executeQuery(this.createQuery(null,\n \t\t\t\tnull, null, bindingNameSort, bindingExprSort, sortDefn, null,\n \t\t\t\tnull, null, bindingNameRow, bindingExprRow));\n \n \t\tprintResult(resultIt, bindingNameRow, bindingExprRow);\n \t\t// assert\n \t\tcheckOutputFile();\n \n \t}", "@Test\n public void testHeterogeneousSegmentFilterConditionLimit() throws SqlParseException {\n\n val project = \"heterogeneous_segment\";\n // val dfId = \"747f864b-9721-4b97-acde-0aa8e8656cba\"\n // val seg1Id = \"8892fa3f-f607-4eec-8159-7c5ae2f16942\"\n // val seg2Id = \"d75a822c-788a-4592-a500-cf20186dded1\"\n // val seg3Id = \"54eaf96d-6146-45d2-b94e-d5d187f89919\"\n // val seg4Id = \"411f40b9-a80a-4453-90a9-409aac6f7632\"\n // val seg5Id = \"a8318597-cb75-416f-8eb8-96ea285dd2b4\"\n // \n val sql = \"with T1 as (select cal_dt, trans_id \\n\" + \"from test_kylin_fact inner join test_account \\n\"\n + \"on test_kylin_fact.seller_id = test_account.account_id \\n\"\n + \"where cal_dt between date'2012-01-01' and date'2012-01-03'\\n\" + \"group by cal_dt, trans_id)\\n\";\n\n {\n val sqlWithTooManyOrs = sql + \" select * from T1 where \" + \"(cal_dt='2012-01-01' and trans_id = 1) or \\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 2) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 3) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 4) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 5) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 6) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 7) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 8) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 9) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 10) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 12) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 13) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 14) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 15) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 16) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 17) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 18) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 19) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 20)\";\n val contexts = OlapContextTestUtil.getOlapContexts(project, sqlWithTooManyOrs);\n Assert.assertEquals(\n \">=(DEFAULT.TEST_KYLIN_FACT.CAL_DT, 2012-01-01),<=(DEFAULT.TEST_KYLIN_FACT.CAL_DT, 2012-01-03)\",\n contexts.get(0).getExpandedFilterConditions().stream().map(RexNode::toString)\n .collect(Collectors.joining(\",\")));\n }\n\n {\n val sqlWithFilter = sql + \" select * from T1 where \" + \"(cal_dt='2012-01-01' and trans_id = 1) or \\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 2) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 3) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 4) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 5) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 6) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 7) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 8) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 9) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 10)\";\n val contexts = OlapContextTestUtil.getOlapContexts(project, sqlWithFilter);\n Assert.assertNotEquals(\n \">=(DEFAULT.TEST_KYLIN_FACT.CAL_DT, 2012-01-01),<=(DEFAULT.TEST_KYLIN_FACT.CAL_DT, 2012-01-03)\",\n contexts.get(0).getExpandedFilterConditions().stream().map(RexNode::toString)\n .collect(Collectors.joining(\",\")));\n }\n\n }", "private boolean checkRowCol(int c1, int c2, int c3) \r\n {\r\n return ((c1 != -1) && (c1 == c2) && (c2 == c3)); //eida ekhon porjonto kaaj e lage nai\r\n }", "public VirtualDataSet[] partitionByNumericAttribute(int attributeIndex, int valueIndex) {\n\t\t// WRITE YOUR CODE HERE!\n\n\t\t if(attributes[attributeIndex].getType()==AttributeType.NOMINAL){ \t\t\t\t\t\t\t// avoid passing through nominal value to current method\n return null; \n }\n\t\t\tVirtualDataSet [] partitions = new VirtualDataSet[2]; \t\t\t\t\t\t\t\t\t// creates two split path \n\n\t\t\tdouble split = Double.parseDouble(getValueAt(valueIndex , attributeIndex));\t\t\t// determine the middle number in order to split \n\t\t\t\n\t\t\tLinkedList<Integer> rowsLess = new LinkedList<Integer> (); \t\t\t\t\t\t\t// using linkedlist to do collection of split rows that less than valueIndex value\n\t\t\t\n\t\t\tLinkedList<Integer> rowsMore = new LinkedList<Integer> ();\t\t\t\t\t\t\t\t// using linkedlist to do collection of split rows that less than valueIndex value\n\t\t\t\n\t\t\tint countLess = 0;\n\t\t\tint countMore = 0; \n\n\t\t\tString []arrayOfNums = attributes[attributeIndex].getValues();\n\n\t\t\tfor(int j = 0; j < source.numRows; j++){ \n\t\t\t\t\n\t\t\t\tif(Double.parseDouble(getValueAt(j,attributeIndex)) <= split){ \t\t\t\t// transform from string to integer in order to compare the number smaller than middle number\n\t\t\t\t\t\n\t\t\t\t\trowsLess.add(j);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// add rows that correspond with the current attribute of spliting \n\t\t\t\t\tcountLess++;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// determine the size of partition rows array \n\t\t\t\t}else if(Double.parseDouble(getValueAt(j,attributeIndex)) > split){\t\t\t// transform from string to integer in order to compare the number bigger than middle number\n\t\t\t\t\t\n\t\t\t\t\trowsMore.add(j); \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// add rows that correspond with the current attribute of spliting \n\t\t\t\t\tcountMore++;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// determine the size of partition rows array \n\t\t\t\t}\n\t\t\t}\n\n\t\t\tint [] partitionRowsLess = new int [countLess]; \t\t\t\t\t\t\t\t\t\t// the collection of rows represents all number that smaller than middle number\n\t\t\tint [] partitionRowsMore = new int [countMore]; \t\t\t\t\t\t\t\t\t\t// the collection of rows represents all number that bigger than middle number\n\t\t\tfor(int k = 0; k < countLess; k++){\n\t\t\t\tpartitionRowsLess[k] = rowsLess.poll(); \t\t\t\t\t\t\t\t\t\t\t// transform from linkedlist to array \n\t\t\t}\n\t\t\tfor(int k = 0; k < countMore; k++){\n\t\t\t\tpartitionRowsMore[k] = rowsMore.poll(); \t\t\t\t\t\t\t\t\t\t\t// transform from linkedlist to array \n\t\t\t}\n\t\t\t\n\t\t\tpartitions[0] = new VirtualDataSet(source,partitionRowsLess, attributes); \t\t\t\t// send partition to VirtualDataSet constructor \n\t\t\tpartitions[1] = new VirtualDataSet(source,partitionRowsMore, attributes); \n\t\t\t\n\n\n\t\t\treturn partitions;\n\t\t\n\t}", "@Test\n\tpublic void testStartingIndicesRegression(){\n\t\tassertLeftmostStartingIndices(\"5,1,7,3,2|-..xxx$1..x...xxx$3....-xx........\", 0, 6, 8, 18, 22);\n\t\tassertRightmostStartingIndices(\"7,5|.......xxx$1....xxx$2..-\", 6, 14);\n\t\t\n\t}", "List<Online> selectByExampleWithRowbounds(OnlineExample example, RowBounds rowBounds);", "@Test\n \tpublic void whereClauseForNodeRangedDominance() {\n \t\tnode23.addJoin(new Dominance(node42, 10, 20));\n \t\tcheckWhereCondition(\n //\t\t\t\tjoin(\"=\", \"_rank23.component_ref\", \"_rank42.component_ref\"),\n \t\t\t\tjoin(\"=\", \"_component23.type\", \"'d'\"),\n \t\t\t\t\"_component23.name IS NULL\",\n \t\t\t\tjoin(\"<\", \"_rank23.pre\", \"_rank42.pre\"),\n \t\t\t\tjoin(\"<\", \"_rank42.pre\", \"_rank23.post\"),\n \t\t\t\t\"_rank23.level BETWEEN SYMMETRIC _rank42.level - 10 AND _rank42.level - 20\"\n \n \t\t);\n \t}", "private static Restriction newMultiEq(CFMetaData cfMetaData, int firstIndex, ByteBuffer... values)\n {\n List<ColumnDefinition> columnDefinitions = new ArrayList<>();\n for (int i = 0; i < values.length; i++)\n {\n columnDefinitions.add(getClusteringColumnDefinition(cfMetaData, firstIndex + i));\n }\n return new MultiColumnRestriction.EQ(columnDefinitions, toMultiItemTerminal(values));\n }", "private Object isValidColumnVector(List<List<Double>> vector) {\n\t\tInteger nrows = vector.size();\n\n\t\tList<Integer> rowLengths = vector.stream().map(List::size).toList();\n\t\tInteger ncols = rowLengths.stream().mapToInt(Integer::intValue).sum() / rowLengths.size();\n\n\t\treturn (nrows == 3) && (ncols == 1);\n\t}", "boolean isOrderedOn(ColumnReference[] crs, boolean permuteOrdering, Vector fbtVector)\n\t{\n\t\t/* RESOLVE - DistinctNodes are ordered on their RCLs.\n\t\t * Walk RCL to see if cr is 1st non-constant column in the\n\t\t * ordered result.\n\t\t */\n\t\treturn false;\n\t}", "public boolean percolates() {\n for (int i = 0; i < size; i++) {\r\n if (flowGrid[size * (size - 1) + i] < size) { // if any of the bottom row points at any of the index in the top row\r\n return true;\r\n }\r\n }\r\n return false;\r\n }", "public Map<ByteBuffer, List<ColumnOrSuperColumn>> forced_2round_multiget_slice(List<ByteBuffer> allKeys, ColumnParent column_parent, SlicePredicate predicate)\n throws Exception\n {\n //if (logger.isTraceEnabled()) {\n // logger.trace(\"forced_2round_multiget_slice(allKeys = {}, column_parent = {}, predicate = {})\", new Object[]{printKeys(allKeys), column_parent, predicate});\n //}\n //Split up into one request for each server in the local cluster\n Map<Cassandra.AsyncClient, List<ByteBuffer>> asyncClientToFirstRoundKeys = partitionByAsyncClients(allKeys);\n\n //Send Round 1 Requests\n Queue<BlockingQueueCallback<multiget_slice_call>> firstRoundCallbacks = new LinkedList<BlockingQueueCallback<multiget_slice_call>>();\n for (Entry<Cassandra.AsyncClient, List<ByteBuffer>> entry : asyncClientToFirstRoundKeys.entrySet()) {\n Cassandra.AsyncClient asyncClient = entry.getKey();\n List<ByteBuffer> keysForThisClient = entry.getValue();\n\n BlockingQueueCallback<multiget_slice_call> callback = new BlockingQueueCallback<multiget_slice_call>();\n firstRoundCallbacks.add(callback);\n\n //if (logger.isTraceEnabled()) { logger.trace(\"round 1: get \" + printKeys(keysForThisClient) + \" from \" + asyncClient); }\n asyncClient.multiget_slice(keysForThisClient, column_parent, predicate, consistencyLevel, LamportClock.sendTimestamp(), callback);\n }\n\n //Gather responses, track both max_evt and min_lvt\n long overallMaxEvt = Long.MIN_VALUE;\n long overallMinLvt = Long.MAX_VALUE;\n\n Map<ByteBuffer, List<ColumnOrSuperColumn>> keyToResult = new HashMap<ByteBuffer, List<ColumnOrSuperColumn>>();\n NavigableMap<Long, List<ByteBuffer>> lvtToKeys = new TreeMap<Long, List<ByteBuffer>>();\n for (BlockingQueueCallback<multiget_slice_call> callback : firstRoundCallbacks) {\n\n MultigetSliceResult result = callback.getResponseNoInterruption().getResult();\n LamportClock.updateTime(result.lts);\n\n for (Entry<ByteBuffer, List<ColumnOrSuperColumn>> entry : result.value.entrySet()) {\n ByteBuffer key = entry.getKey();\n List<ColumnOrSuperColumn> coscList = entry.getValue();\n keyToResult.put(key, coscList);\n\n //find the evt and lvt for the entire row\n EvtAndLvt evtAndLvt = ColumnOrSuperColumnHelper.extractEvtAndLvt(coscList);\n if (!lvtToKeys.containsKey(evtAndLvt.getLatestValidTime())) {\n lvtToKeys.put(evtAndLvt.getLatestValidTime(), new LinkedList<ByteBuffer>());\n }\n lvtToKeys.get(evtAndLvt.getLatestValidTime()).add(key);\n //if (logger.isTraceEnabled()) { logger.trace(\"round 1 response for \" + printKey(key) + \" evt: \" + evtAndLvt.getEarliestValidTime() + \" lvt: \" + evtAndLvt.getLatestValidTime()); }\n\n overallMaxEvt = Math.max(overallMaxEvt, evtAndLvt.getEarliestValidTime());\n overallMinLvt = Math.min(overallMinLvt, evtAndLvt.getLatestValidTime());\n }\n }\n //if (logger.isTraceEnabled()) { logger.trace(\"Min LVT:\" + overallMinLvt + \" Max EVT: \" + overallMaxEvt); }\n\n //Always Execute 2nd round for micro-benchmarking\n if (true) {\n //get the smallest lvt > maxEvt\n long chosenTime = lvtToKeys.navigableKeySet().higher(overallMaxEvt);\n\n List<ByteBuffer> secondRoundKeys = new LinkedList<ByteBuffer>();\n secondRoundKeys.addAll(allKeys);\n\n //Send Round 2 Requests\n Map<Cassandra.AsyncClient, List<ByteBuffer>> asyncClientToSecondRoundKeys = partitionByAsyncClients(secondRoundKeys);\n Queue<BlockingQueueCallback<multiget_slice_by_time_call>> secondRoundCallbacks = new LinkedList<BlockingQueueCallback<multiget_slice_by_time_call>>();\n for (Entry<Cassandra.AsyncClient, List<ByteBuffer>> entry : asyncClientToSecondRoundKeys.entrySet()) {\n Cassandra.AsyncClient asyncClient = entry.getKey();\n List<ByteBuffer> keysForThisClient = entry.getValue();\n\n BlockingQueueCallback<multiget_slice_by_time_call> callback = new BlockingQueueCallback<multiget_slice_by_time_call>();\n secondRoundCallbacks.add(callback);\n\n //if (logger.isTraceEnabled()) { logger.trace(\"round 2: get \" + printKeys(keysForThisClient) + \" from \" + asyncClient); }\n\n asyncClient.multiget_slice_by_time(keysForThisClient, column_parent, predicate, consistencyLevel, chosenTime, LamportClock.sendTimestamp(), callback);\n }\n\n //Gather second round responses\n for (BlockingQueueCallback<multiget_slice_by_time_call> callback : secondRoundCallbacks) {\n MultigetSliceResult result = callback.getResponseNoInterruption().getResult();\n LamportClock.updateTime(result.lts);\n\n substituteValidFirstRoundResults(result, keyToResult);\n\n //if (logger.isTraceEnabled()) { logger.trace(\"round 2 responses for \" + printKeys(result.getValue().keySet())); }\n\n keyToResult.putAll(result.getValue());\n }\n }\n\n //Add dependencies on anything returned and removed deleted columns\n for (Entry<ByteBuffer, List<ColumnOrSuperColumn>> entry : keyToResult.entrySet()) {\n ByteBuffer key = entry.getKey();\n List<ColumnOrSuperColumn> coscList = entry.getValue();\n\n for (Iterator<ColumnOrSuperColumn> cosc_it = coscList.iterator(); cosc_it.hasNext(); ) {\n ColumnOrSuperColumn cosc = cosc_it.next();\n try {\n clientContext.addDep(key, cosc);\n } catch (NotFoundException nfe) {\n //remove deleted results, it's okay for all result to be removed\n cosc_it.remove();\n }\n }\n }\n //if (logger.isTraceEnabled()) {\n // logger.trace(\"forced_2round_multiget_slice result = {}\", keyToResult);\n //}\n return keyToResult;\n }", "private boolean subGridCheck() {\n\t\tint sqRt = (int)Math.sqrt(dimension);\n\t\tfor(int i = 0; i < sqRt; i++) {\n\t\t\tint increment = i * sqRt;\n\t\t\tfor(int val = 1; val <= dimension; val++) {\n\t\t\t\tint valCounter = 0;\n\t\t\t\tfor(int row = 0 + increment; row < sqRt + increment; row++) {\n\t\t\t\t\tfor(int col = 0 + increment; col < sqRt + increment; col++) {\n\t\t\t\t\t\tif(puzzle[row][col] == val)\n\t\t\t\t\t\t\tvalCounter++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(valCounter >= 2)\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "@Test\n public void testBoundsAsCompositesWithEqAndInRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n Restriction eq = newSingleEq(cfMetaData, 0, value1);\n Restriction in = newSingleIN(cfMetaData, 1, value1, value2, value3);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(in);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.START);\n assertComposite(bounds.get(2), value1, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value1, EOC.END);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n assertComposite(bounds.get(2), value1, value3, EOC.END);\n }", "@Test\n public void whereNormalColumn() throws Exception {\n String sql = \"desc verbose select k1, e1 from db1.tbl1 lateral view explode_split(k2, \\\",\\\") tmp as e1 \"\n + \"where k1=1; \";\n String explainString = UtFrameUtils.getSQLPlanOrErrorMsg(ctx, sql, true);\n Assert.assertTrue(explainString.contains(\"1:TABLE FUNCTION NODE\"));\n Assert.assertTrue(explainString.contains(\"table function: explode_split(`k2`, ',')\"));\n Assert.assertTrue(explainString.contains(\"tuple ids: 0 1\"));\n Assert.assertTrue(explainString.contains(\"TupleDescriptor{id=1, tbl=tmp, byteSize=32, materialized=true}\"));\n Assert.assertTrue(explainString.contains(\"SlotDescriptor{id=1, col=e1, type=VARCHAR(*)}\"));\n Assert.assertTrue(explainString.contains(\"0:OlapScanNode\"));\n Assert.assertTrue(explainString.contains(\"PREDICATES: `k1` = 1\"));\n }", "public void testFilterOnAggregationColumn() throws Exception {\n \t\tccName = new String[] { \"cc1\", \"cc2\", \"cc3\" };\n \t\tccExpr = new String[] { \"row.COL0+row.COL1\",\n \t\t\t\t\"Total.runningSum(row.cc1,row.COL0==0,0)\",\n \t\t\t\t\"Total.runningSum(row.cc1,row.COL0>0,0)\" };\n \n \t\tfor (int i = 0; i < ccName.length; i++) {\n \t\t\tComputedColumn computedColumn = new ComputedColumn(ccName[i],\n \t\t\t\t\tccExpr[i], DataType.ANY_TYPE);\n \t\t\t((BaseDataSetDesign) this.dataSet)\n \t\t\t\t\t.addComputedColumn(computedColumn);\n \t\t}\n \n \t\tString[] bindingNameRow = new String[7];\n \t\tbindingNameRow[0] = \"ROW_COL0\";\n \t\tbindingNameRow[1] = \"ROW_COL1\";\n \t\tbindingNameRow[2] = \"ROW_COL2\";\n \t\tbindingNameRow[3] = \"ROW_COL3\";\n \t\tbindingNameRow[4] = \"ROW_cc1\";\n \t\tbindingNameRow[5] = \"ROW_cc2\";\n \t\tbindingNameRow[6] = \"ROW_cc3\";\n \t\tScriptExpression[] bindingExprRow = new ScriptExpression[] {\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL0\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL1\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL2\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL3\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + ccName[0], 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + ccName[1], 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + ccName[2], 0) };\n \n \t\tIResultIterator resultIt = this.executeQuery(this.createQuery(null,\n \t\t\t\tnull, null, null, null, null, null, null, null, bindingNameRow,\n \t\t\t\tbindingExprRow));\n \n \t\tprintResult(resultIt, bindingNameRow, bindingExprRow);\n \t\t// assert\n \t\tcheckOutputFile();\n \n \t}", "public List<Integer> selectRangeWherePar(byte[][] selectCols, byte[] whereCol, long value1, long value2, ResultSet result){\n List<Integer> oidList = new ArrayList<Integer>();\n \n //assuming the where col is in type LONG\n boolean[] access = new boolean[keyForLong.length];\n int whereIndex = -1;\n \n for(int i = 0; i < keyForLong.length; i++){\n if(keyForLong[i].equals( new String(whereCol) + separator + \"LONG\" )) whereIndex = i;\n \n access[i] = false;\n for(int j = 0; j < selectCols.length; j++){\n if(keyForLong[i].equals( new String(selectCols[j]) + separator + \"LONG\" )){\n access[i] = true;\n break;\n }\n }\n }\n \n int numOfFields = keyForLong.length;\n for(int i = 0; i < numObject; i++){\n //first check if this object meet the where condition\n long value = longValues[i*numOfFields + whereIndex];\n if( (value >= value1) && (value <= value2)){\n //this object meets condition\n int oid=objectIds[i];\n oidList.add(oid);\n \n //select fields in the select clause\n for(int j = 0; j < access.length; j++){\n if(access[j]){\n String key = keyForLong[j];\n if(j == whereIndex){\n result.addLong(key, oid, value);\n continue;\n }\n long longnum = longValues[i*numOfFields + j];\n if(longnum != UNDEFINED)\n result.addLong(key, oid, longnum);\n }\n }\n }\n }\n \n if(oidList.size() > 0){\n //if this partition also has other data types, also select those based on oidList\n if(keyForString.length != 0)\n selectConditionString(oidList, selectCols, result);\n if(keyForDouble.length != 0)\n selectConditionDouble(oidList, selectCols, result);\n if(keyForBool.length != 0)\n selectConditionBool(oidList, selectCols, result);\n }\n return oidList;\n }", "@Test\n public void testOverlappingPartitionsOverlappingClusters()\n {\n check(overlappingClustersWithOverlappingPartitions(), 0.75, 1.0);\n }", "Boolean isValid(ArrayList<Integer> colQ){\n \n int curcol = colQ.size() - 1;\n int row = colQ.get(colQ.size() - 1);\n\n int i = 0;\n int j = 0;\n for(i = curcol-1, j = 1; i >= 0; i--, j++)\n {\n // check if we have two of the same row || check diags\n if(row == colQ.get(i) || row+j == colQ.get(i) || row-j == colQ.get(i)) return false;\n }\n return true;\n \n }", "@Test\n \tpublic void testOverlapsWith()\n \t{\n \t\tAssert.assertTrue(PDL.new Alignment(\"\", \"\", 0.0, 1, 4, 0, 0)\n \t\t .overlapsWith(PDL.new Alignment(\"\", \"\", 0.0, 1, 4, 0, 0)));\n \t\t\n \t\t// 1. [1,2] [2,4] => false\n \t\tAssert.assertFalse(PDL.new Alignment(\"\", \"\", 0.0, 1, 2, 0, 0)\n \t\t .overlapsWith(PDL.new Alignment(\"\", \"\", 0.0, 2, 4, 0, 0)));\n \t\t\n \t\t// 2. [1,3] [2,5] => true\n \t\tAssert.assertTrue(PDL.new Alignment(\"\", \"\", 0.0, 1, 3, 0, 0)\n \t\t .overlapsWith(PDL.new Alignment(\"\", \"\", 0.0, 2, 5, 0, 0)));\n \t\t\n \t\t// 3. [1,5] [0,6] => true\n \t\tAssert.assertTrue(PDL.new Alignment(\"\", \"\", 0.0, 1, 5, 0, 0)\n \t\t .overlapsWith(PDL.new Alignment(\"\", \"\", 0.0, 0, 6, 0, 0)));\n \t\t\n \t\t// 4. [2,4] [1,2] => false\n \t\tAssert.assertFalse(PDL.new Alignment(\"\", \"\", 0.0, 2, 4, 0, 0)\n \t\t .overlapsWith(PDL.new Alignment(\"\", \"\", 0.0, 1, 2, 0, 0)));\n \t\t\n \t\t// 5. [2,5] [1,3] => true\n \t\tAssert.assertTrue(PDL.new Alignment(\"\", \"\", 0.0, 2, 5, 0, 0)\n \t\t .overlapsWith(PDL.new Alignment(\"\", \"\", 0.0, 1, 3, 0, 0)));\n \t}", "public static void main(String[] args) {\n\t\t\n\t\tint k = 3;\n\t\t\n\t\tint max = Integer.MIN_VALUE, min = Integer.MAX_VALUE;\n\t\t\n\t\tint arr[] = new int[k];\n\t\t\n\t\tfor(int i = 0; i < k; i++) {\n\t\t\tif(max < arr[i])\n\t\t\t\tmax = arr[i];\n\t\t\tif(min > arr[i])\n\t\t\t\tmin = arr[i];\n\t\t}\n\t\t\n\t\t\n\t\tint [][] arr1 = {{3,8},{10,11},{1,3},{2,4}};\n\t\t\n\t\tSystem.out.println(selection(arr1));\n\t}", "@Test\n public void test_range_Integer_Collection3() {\n populate_i2();\n Collection<Integer> actual = Selector.range(i2, 5, 3, new CompareIntegerDescending());\n Collection<Integer> expected = new ArrayList<Integer>();\n expected.add(5);\n expected.add(3);\n Assert.assertEquals(\"Did not find range correctly\", expected, actual);\n }", "private static <T> int med3(T x[], Comparator<T> comp, int a, int b, int c) {\n\t\treturn (comp.compare(x[a],x[b])<0 ?\n\t\t\t\t(comp.compare(x[b],x[c])<0 ? b : comp.compare(x[a],x[c])<0 ? c : a) :\n\t\t\t\t\t(comp.compare(x[b],x[c])>0 ? b : comp.compare(x[a],x[c])>0 ? c : a));\n\t}", "private boolean canSetSafelyDownColumn(MTreeNode row, MTreeNode col, UnionDoubleIntervals newVal) {\n\t\tMTreeNode rowKids[]=row.getChildren();\n\t\tif (rowKids.length==0) return true;\n\t\tUnionDoubleIntervals rowKidsInts[]=new UnionDoubleIntervals[rowKids.length];\n\t\tfor(int i=0; i<rowKids.length; i++) {\n\t\t\trowKidsInts[i]=get(rowKids[i], col);\n\t\t\tif (rowKidsInts[i]==null) {\n\t\t\t\t//If a sibling is null, I cannot check, so just return\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\tUnionDoubleIntervals sum=UnionDoubleIntervals.sum(rowKidsInts);\n\t\treturn newVal.intersects(sum);\n\t}", "@Test\n public void test_range_Integer_Collection4() {\n populate_i3();\n Collection<Integer> actual = Selector.range(i3, 4, 8, new CompareIntegerAscending());\n Collection<Integer> expected = new ArrayList<Integer>();\n expected.add(8);\n expected.add(7);\n expected.add(6);\n expected.add(5);\n expected.add(4);\n Assert.assertEquals(\"Did not find range correctly\", expected, actual);\n }", "@Test\n void testSubset() throws IOException {\n Long expectedNumberOfVariables = 13L;\n Long expectedNumberOfCases = 24L; // aka the number of lines in the TAB file produced by the ingest plugin\n\n TabularDataIngest ingestResult;\n File file = getFile(\"csv/ingest/election_precincts.csv\");\n try (BufferedInputStream stream = new BufferedInputStream(new FileInputStream(file))) {\n CSVFileReader instance = createInstance();\n ingestResult = instance.read(Tuple.of(stream, file), null);\n }\n\n File generatedTabFile = ingestResult.getTabDelimitedFile();\n DataTable generatedDataTable = ingestResult.getDataTable();\n\n assertThat(generatedDataTable).isNotNull();\n assertThat(generatedDataTable.getDataVariables()).isNotNull();\n assertThat(generatedDataTable.getVarQuantity()).isEqualTo((long) generatedDataTable.getDataVariables().size());\n assertThat(generatedDataTable.getVarQuantity()).isEqualTo(expectedNumberOfVariables);\n assertThat(generatedDataTable.getCaseQuantity()).isEqualTo(expectedNumberOfCases);\n\n // And now let's try and subset the individual vectors\n // First, the \"continuous\" vectors (we should be able to read these as Double[]):\n int[] floatColumns = {2};\n\n Double[][] floatVectors = {\n { 1.0, 3.0, 4.0, 6.0, 7.0, 8.0, 11.0, 12.0, 76.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0, 77.0 },\n };\n\n IngestDataProvider dataProvider = new InMemoryIngestDataProvider();\n dataProvider.initialize(generatedDataTable, generatedTabFile);\n\n int vectorCount = 0;\n for (int i : floatColumns) {\n // We'll be subsetting the column vectors one by one, re-opening the\n // file each time. Inefficient - but we don't care here.\n\n if (!generatedDataTable.getDataVariables().get(i).isIntervalContinuous()) {\n fail(\"Column \" + i + \" was not properly processed as \\\"continuous\\\"\");\n }\n\n Double[] columnVector = dataProvider.getDoubleColumn(i);\n\n assertThat(columnVector).isEqualTo(floatVectors[vectorCount++]);\n }\n\n // Discrete Numerics (aka, integers):\n int[] integerColumns = { 1, 4, 6, 7, 8, 9, 10, 11, 12 };\n\n Long[][] longVectors = {\n { 1L, 3L, 4L, 6L, 7L, 8L, 11L, 12L, 76L, 77L, 77L, 77L, 77L, 77L, 77L, 77L, 77L, 77L, 77L, 77L, 77L, 77L, 77L, 77L },\n { 1L, 2L, 3L, 4L, 5L, 11L, 13L, 15L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L },\n { 85729227L, 85699791L, 640323976L, 85695847L, 637089796L, 637089973L, 85695001L, 85695077L, 1111111L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L },\n { 205871733L, 205871735L, 205871283L, 258627915L, 257444575L, 205871930L, 260047422L, 262439738L, 1111111L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L },\n { 205871673L, 205871730L, 205871733L, 205872857L, 258627915L, 257444584L, 205873413L, 262439738L, 1111111L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L },\n { 25025000201L, 25025081001L, 25025000701L, 25025050901L, 25025040600L, 25025000502L, 25025040401L, 25025100900L, 1111111L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L },\n { 250250502002L, 250250502003L, 250250501013L, 250250408011L, 250250503001L, 250250103001L, 250250406002L, 250250406001L, 1111111L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L },\n { 250251011024001L, 250251011013003L, 250251304041007L, 250251011013006L, 250251010016000L, 250251011024002L, 250251001005004L, 250251002003002L, 1111111L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L },\n { 2109L, 2110L, 2111L, 2120L, 2121L, 2115L, 2116L, 2122L, 11111L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L, 4444444L }\n };\n\n vectorCount = 0;\n\n for (int i : integerColumns) {\n if (!generatedDataTable.getDataVariables().get(i).isIntervalDiscrete()\n || !generatedDataTable.getDataVariables().get(i).isTypeNumeric()) {\n fail(\"Column \" + i + \" was not properly processed as \\\"discrete numeric\\\"\");\n }\n\n Long[] columnVector = dataProvider.getLongColumn(i);\n\n assertThat(columnVector).isEqualTo(longVectors[vectorCount++]);\n }\n\n // And finally, Strings:\n int[] stringColumns = {0, 3, 5};\n\n String[][] stringVectors = {\n { \"Dog\", \"Squirrel\", \"Antelope\", \"Zebra\", \"Lion\", \"Gazelle\", \"Cat\", \"Giraffe\", \"Cat\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\", \"Donkey\" },\n { \"East Boston\", \"Charlestown\", \"South Boston\", \"Bronx\", \"Roslindale\", \"Mission Hill\", \"Jamaica Plain\", \"Hyde Park\", \"Fenway/Kenmore\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\", \"Queens\" },\n { \"2-06\", \"1-09\", \"1-1A\", \"1-1B\", \"2-04\", \"3-05\", \"1-1C\", \"1-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", \"41-10A\", }\n };\n\n vectorCount = 0;\n\n for (int i : stringColumns) {\n if (!generatedDataTable.getDataVariables().get(i).isTypeCharacter()) {\n fail(\"Column \" + i + \" was not properly processed as a character vector\");\n }\n String[] columnVector = dataProvider.getStringColumn(i);\n\n assertThat(columnVector).isEqualTo(stringVectors[vectorCount++]);\n }\n }", "private boolean addRangeQualifier(Predicate p,QualifierPhase phase) throws StandardException{\n DataValueDescriptor value=p.getCompareValue(baseTable);\n RelationalOperator relop=p.getRelop();\n int colNum = relop.getColumnOperand(baseTable).getColumnNumber();\n int relationalOperator = relop.getOperator();\n List<SelectivityHolder> columnHolder = getSelectivityListForColumn(colNum);\n OP_SWITCH: switch(relationalOperator){\n case RelationalOperator.EQUALS_RELOP:\n columnHolder.add(new RangeSelectivity(scc,value,value,true,true,colNum,phase));\n break;\n case RelationalOperator.NOT_EQUALS_RELOP:\n columnHolder.add(new NotEqualsSelectivity(scc,colNum,phase,value));\n break;\n case RelationalOperator.IS_NULL_RELOP:\n columnHolder.add(new NullSelectivity(scc,colNum,phase));\n break;\n case RelationalOperator.IS_NOT_NULL_RELOP:\n columnHolder.add(new NotNullSelectivity(scc,colNum,phase));\n break;\n case RelationalOperator.GREATER_EQUALS_RELOP:\n for(SelectivityHolder sh: columnHolder){\n if (!sh.isRangeSelectivity())\n continue;\n RangeSelectivity rq = (RangeSelectivity) sh;\n if(rq.start==null){\n rq.start = value;\n rq.includeStart = true;\n break OP_SWITCH;\n }\n }\n columnHolder.add(new RangeSelectivity(scc,value,null,true,true,colNum,phase));\n break;\n case RelationalOperator.GREATER_THAN_RELOP:\n for(SelectivityHolder sh: columnHolder){\n if (!sh.isRangeSelectivity())\n continue;\n RangeSelectivity rq = (RangeSelectivity) sh;\n if(rq.start==null){\n rq.start = value;\n rq.includeStart = false;\n break OP_SWITCH;\n }\n }\n columnHolder.add(new RangeSelectivity(scc,value,null,false,true,colNum,phase));\n break;\n case RelationalOperator.LESS_EQUALS_RELOP:\n for(SelectivityHolder sh: columnHolder){\n if (!sh.isRangeSelectivity())\n continue;\n RangeSelectivity rq = (RangeSelectivity) sh;\n if(rq.stop==null){\n rq.stop = value;\n rq.includeStop = true;\n break OP_SWITCH;\n }\n }\n columnHolder.add(new RangeSelectivity(scc,null,value,true,true,colNum,phase));\n break;\n case RelationalOperator.LESS_THAN_RELOP:\n for(SelectivityHolder sh: columnHolder){\n if (!sh.isRangeSelectivity())\n continue;\n RangeSelectivity rq = (RangeSelectivity) sh;\n if(rq.stop==null){\n rq.stop = value;\n rq.includeStop = true;\n break OP_SWITCH;\n }\n }\n columnHolder.add(new RangeSelectivity(scc,null,value,true,false,colNum,phase));\n break;\n default:\n throw new RuntimeException(\"Unknown Qualifier Type\");\n }\n return true;\n }", "private List<Set<BitSet>> buildPFunction(boolean[][] table, boolean[] coveredMinterms) {\n\n\t\tList<Set<BitSet>> pFunction = new ArrayList<>();\n\n\t\tfor (int i = 0; i < coveredMinterms.length; i++) {\n\n\t\t\tSet<BitSet> currentColumn = new LinkedHashSet<>();\n\n\t\t\tfor (int j = 0; j < table.length; j++) {\n\n\t\t\t\tif (table[j][i] && !coveredMinterms[i]) {\n\t\t\t\t\tBitSet current = new BitSet();\n\t\t\t\t\tcurrent.set(j);\n\t\t\t\t\tcurrentColumn.add(current);\n\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (currentColumn.size() > 0) {\n\t\t\t\tpFunction.add(currentColumn);\n\t\t\t}\n\t\t}\n\t\treturn pFunction;\n\t}", "List<Collect> selectByExampleWithRowbounds(CollectExample example, RowBounds rowBounds);", "@Test\n public void testFilterPushDown() throws IOException { 'bla' as (x, y);\n // B = load 'morebla' as (a, b);\n // C = join A on x, B on a;\n // D = filter C by x = a and x = 0 and b = 1 and y = b;\n // store D into 'whatever';\n \n // A = load\n LogicalPlan lp = new LogicalPlan();\n {\n \tLogicalSchema aschema = new LogicalSchema();\n \taschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"x\", null, DataType.INTEGER));\n \taschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"y\", null, DataType.INTEGER));\n \taschema.getField(0).uid = 1;\n \taschema.getField(1).uid = 2;\n \tLOLoad A = new LOLoad(new FileSpec(\"bla\", new FuncSpec(\"PigStorage\", \"\\t\")), aschema, lp);\n \tlp.add(A);\n\t \n \t// B = load\n \tLogicalSchema bschema = new LogicalSchema();\n \tbschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"a\", null, DataType.INTEGER));\n \tbschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"b\", null, DataType.INTEGER));\n \tbschema.getField(0).uid = 3;\n \tbschema.getField(1).uid = 4;\n \tLOLoad B = new LOLoad(null, bschema, lp);\n \tlp.add(B);\n\t \n \t// C = join\n \tLogicalSchema cschema = new LogicalSchema();\n \tcschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"x\", null, DataType.INTEGER));\n \tcschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"y\", null, DataType.INTEGER));\n \tcschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"a\", null, DataType.INTEGER));\n \tcschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"b\", null, DataType.INTEGER));\n \tcschema.getField(0).uid = 1;\n \tcschema.getField(1).uid = 2;\n \tcschema.getField(2).uid = 3;\n \tcschema.getField(3).uid = 4;\n \tLogicalExpressionPlan aprojplan = new LogicalExpressionPlan();\n \tProjectExpression x = new ProjectExpression(aprojplan, DataType.INTEGER, 0, 0);\n \tx.neverUseForRealSetUid(1);\n \tLogicalExpressionPlan bprojplan = new LogicalExpressionPlan();\n \tProjectExpression y = new ProjectExpression(bprojplan, DataType.INTEGER, 1, 0);\n \ty.neverUseForRealSetUid(3);\n \tMultiMap<Integer, LogicalExpressionPlan> mm = \n \tnew MultiMap<Integer, LogicalExpressionPlan>();\n \tmm.put(0, aprojplan);\n \tmm.put(1, bprojplan);\n \tLOJoin C = new LOJoin(lp, mm, JOINTYPE.HASH, new boolean[] {true, true});\n \tC.neverUseForRealSetSchema(cschema);\n \tlp.add(C);\n \tlp.connect(A, C);\n \tlp.connect(B, C);\n \n \t// D = filter\n \tLogicalExpressionPlan filterPlan = new LogicalExpressionPlan();\n \tProjectExpression fx = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 0);\n \tfx.neverUseForRealSetUid(1);\n \tConstantExpression fc0 = new ConstantExpression(filterPlan, DataType.INTEGER, new Integer(0));\n \tEqualExpression eq1 = new EqualExpression(filterPlan, fx, fc0);\n \tProjectExpression fanotherx = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 0);\n \tfanotherx.neverUseForRealSetUid(1);\n \tProjectExpression fa = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 2);\n \tfa.neverUseForRealSetUid(3);\n \tEqualExpression eq2 = new EqualExpression(filterPlan, fanotherx, fa);\n \tAndExpression and1 = new AndExpression(filterPlan, eq1, eq2);\n \tProjectExpression fb = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 3);\n \tfb.neverUseForRealSetUid(4);\n \tConstantExpression fc1 = new ConstantExpression(filterPlan, DataType.INTEGER, new Integer(1));\n \tEqualExpression eq3 = new EqualExpression(filterPlan, fb, fc1);\n \tAndExpression and2 = new AndExpression(filterPlan, and1, eq3);\n \tProjectExpression fanotherb = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 3);\n \tfanotherb.neverUseForRealSetUid(4);\n \tProjectExpression fy = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 1);\n \tfy.neverUseForRealSetUid(2);\n \tEqualExpression eq4 = new EqualExpression(filterPlan, fy, fanotherb);\n \tnew AndExpression(filterPlan, and2, eq4);\n \n \tLOFilter D = new LOFilter(lp, filterPlan);\n \tD.neverUseForRealSetSchema(cschema);\n \t// Connect D to B, since the transform has happened.\n \tlp.add(D);\n \tlp.connect(C, D);\n }\n \n LogicalPlanOptimizer optimizer = new LogicalPlanOptimizer(lp, 500);\n optimizer.optimize();\n \n LogicalPlan expected = new LogicalPlan();\n {\n // A = load\n \tLogicalSchema aschema = new LogicalSchema();\n \taschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"x\", null, DataType.INTEGER));\n \taschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"y\", null, DataType.INTEGER));\n \taschema.getField(0).uid = 1;\n \taschema.getField(1).uid = 2;\n \tLOLoad A = new LOLoad(new FileSpec(\"bla\", new FuncSpec(\"PigStorage\", \"\\t\")), aschema, expected);\n \texpected.add(A);\n \t\n \t// DA = filter\n \tLogicalExpressionPlan DAfilterPlan = new LogicalExpressionPlan();\n \tProjectExpression fx = new ProjectExpression(DAfilterPlan, DataType.INTEGER, 0, 0);\n \tfx.neverUseForRealSetUid(1);\n \tConstantExpression fc0 = new ConstantExpression(DAfilterPlan, DataType.INTEGER, new Integer(0));\n \tnew EqualExpression(DAfilterPlan, fx, fc0);\n\t \n \tLOFilter DA = new LOFilter(expected, DAfilterPlan);\n \tDA.neverUseForRealSetSchema(aschema);\n \texpected.add(DA);\n \texpected.connect(A, DA);\n\t \n \t// B = load\n \tLogicalSchema bschema = new LogicalSchema();\n \tbschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"a\", null, DataType.INTEGER));\n \tbschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"b\", null, DataType.INTEGER));\n \tbschema.getField(0).uid = 3;\n \tbschema.getField(1).uid = 4;\n \tLOLoad B = new LOLoad(null, bschema, expected);\n \texpected.add(B);\n \t\n \t// DB = filter\n \tLogicalExpressionPlan DBfilterPlan = new LogicalExpressionPlan();\n \tProjectExpression fb = new ProjectExpression(DBfilterPlan, DataType.INTEGER, 0, 1);\n \tfb.neverUseForRealSetUid(4);\n \tConstantExpression fc1 = new ConstantExpression(DBfilterPlan, DataType.INTEGER, new Integer(1));\n \tnew EqualExpression(DBfilterPlan, fb, fc1);\n\t \n \tLOFilter DB = new LOFilter(expected, DBfilterPlan);\n \tDB.neverUseForRealSetSchema(bschema);\n \texpected.add(DB);\n \texpected.connect(B, DB);\n\t \n \t// C = join\n \tLogicalSchema cschema = new LogicalSchema();\n \tcschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"x\", null, DataType.INTEGER));\n \tcschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"y\", null, DataType.INTEGER));\n \tcschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"a\", null, DataType.INTEGER));\n \tcschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"b\", null, DataType.INTEGER));\n \tcschema.getField(0).uid = 1;\n \tcschema.getField(1).uid = 2;\n \tcschema.getField(2).uid = 3;\n \tcschema.getField(3).uid = 4;\n \tLogicalExpressionPlan aprojplan = new LogicalExpressionPlan();\n \tProjectExpression x = new ProjectExpression(aprojplan, DataType.INTEGER, 0, 0);\n \tx.neverUseForRealSetUid(1);\n \tLogicalExpressionPlan bprojplan = new LogicalExpressionPlan();\n \tProjectExpression y = new ProjectExpression(bprojplan, DataType.INTEGER, 1, 0);\n \ty.neverUseForRealSetUid(3);\n \tMultiMap<Integer, LogicalExpressionPlan> mm = \n \tnew MultiMap<Integer, LogicalExpressionPlan>();\n \tmm.put(0, aprojplan);\n \tmm.put(1, bprojplan);\n \tLOJoin C = new LOJoin(expected, mm, JOINTYPE.HASH, new boolean[] {true, true});\n \tC.neverUseForRealSetSchema(cschema);\n \texpected.add(C);\n \texpected.connect(DA, C);\n \texpected.connect(DB, C);\n\t \n \t// D = filter\n \tLogicalExpressionPlan filterPlan = new LogicalExpressionPlan();\n \tProjectExpression fanotherx = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 0);\n \tfanotherx.neverUseForRealSetUid(1);\n \tProjectExpression fa = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 2);\n \tfa.neverUseForRealSetUid(3);\n \tEqualExpression eq2 = new EqualExpression(filterPlan, fanotherx, fa);\n \tProjectExpression fanotherb = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 3);\n \tfanotherb.neverUseForRealSetUid(4);\n \tProjectExpression fy = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 1);\n \tfy.neverUseForRealSetUid(2);\n \tEqualExpression eq4 = new EqualExpression(filterPlan, fy, fanotherb);\n \tnew AndExpression(filterPlan, eq2, eq4);\n\t \n \tLOFilter D = new LOFilter(expected, filterPlan);\n \tD.neverUseForRealSetSchema(cschema);\n \texpected.add(D);\n \texpected.connect(C, D);\n }\n \n assertTrue( lp.isEqual(expected) );\n // assertEquals(lp, expected);\n }", "boolean hasPivot();", "public static void main(String[] args) {\n\t\tint tc = scan.nextInt();\r\n\t\tfor (int tt = 0; tt < tc; tt++) {\r\n\t\t\tint row = scan.nextInt(), column = scan.nextInt();\r\n\t\t\tint[][] mat = new int[row][column];\r\n\t\t\tfor (int rr = 0; rr < row; rr++) {\r\n\t\t\t\tfor (int cc = 0; cc < column; cc++) {\r\n\t\t\t\t\tmat[rr][cc] = scan.nextInt();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tboolean valid = true;\r\n\t\t\tOUT: for (int rr = 0; rr < row; rr++) {\r\n\t\t\t\tfor (int cc = 0; cc < column; cc++) {\r\n\t\t\t\t\t// check //\r\n\t\t\t\t\tboolean validcol = true;\r\n\t\t\t\t\tfor (int zz = 0; zz < row; zz++) {\r\n\t\t\t\t\t\tif (mat[zz][cc] > mat[rr][cc]) {\r\n\t\t\t\t\t\t\tvalidcol = false;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tboolean validrow = true;\r\n\t\t\t\t\tfor (int zz = 0; zz < column; zz++) {\r\n\t\t\t\t\t\tif (mat[rr][zz] > mat[rr][cc]) {\r\n\t\t\t\t\t\t\tvalidrow = false;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tvalid = validcol || validrow;\r\n\t\t\t\t\tif (!valid) {\r\n\t\t\t\t\t\tbreak OUT;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tpw.printf(\"Case #%d: %s\\n\", tt + 1, (valid ? \"YES\" : \"NO\"));\r\n\t\t}\r\n\t\tpw.close();\r\n\t}", "DataFrame<R,C> select(Predicate<DataFrameRow<R,C>> rowPredicate, Predicate<DataFrameColumn<R,C>> colPredicate);", "Get<K, C> withColumnRange(C startColumn,\n boolean startColumnInclusive,\n C endColumn,\n boolean endColumnInclusive,\n int limit);", "@Test\n public void testColumnControlInvisibleColumns() {\n final JXTable table = new JXTable(sortableTableModel);\n // columns set to invisible before setting the columnControl\n // will not be inserted into the column control's list\n// table.getColumnExt(\"Last Name\").setVisible(false);\n table.setColumnControlVisible(true);\n int totalColumnCount = table.getColumnCount();\n final TableColumnExt priorityColumn = table.getColumnExt(\"First Name\");\n priorityColumn.setVisible(false);\n ColumnControlButton columnControl = (ColumnControlButton) table.getColumnControl();\n assertNotNull(\"popup menu not null\", columnControl.popup);\n int columnMenuItems = 0;\n Component[] items = ((DefaultColumnControlPopup) columnControl.getColumnControlPopup()).getPopupMenu().getComponents();\n for (int i = 0; i < items.length; i++) {\n if (!(items[i] instanceof JMenuItem)) {\n break;\n }\n columnMenuItems++;\n }\n // wrong assumption - has separator and actions!\n assertEquals(\"menu items must be equal to columns\", totalColumnCount, \n columnMenuItems);\n JCheckBoxMenuItem menuItem = (JCheckBoxMenuItem) ((DefaultColumnControlPopup) columnControl.getColumnControlPopup()).getPopupMenu()\n .getComponent(0);\n // sanit assert\n assertEquals(priorityColumn.getHeaderValue(), menuItem.getText());\n assertEquals(\"selection of menu must be equal to column visibility\", \n priorityColumn.isVisible(), menuItem.isSelected());\n }", "@Test\n public void testHardClustersWithOverlappingPartitions()\n {\n check(hardClustersWithOverlappingPartitions(), 0.0, 1.0);\n }", "private int[][] generateCandidates(int[][] usageM){\n\t\t// 1. start with the complete set of attributes\n\t\tMap<Integer, List<Integer>> partitionAttributes = new HashMap<Integer,List<Integer>>();\n\t\tList<Integer> attributes = new ArrayList<Integer>();\n\t\tfor(int i=0;i<usageM[0].length;i++)\n\t\t\tattributes.add(i);\n\t\tpartitionAttributes.put(0, attributes);\n\t\t\n\t\t// 2. for each query, split this set of attributes into two set:\n\t\t// (i) attributes accessed by the query\n\t\t//\t (ii) attributes not-accessed by the query\n\t\tfor(int[] query: usageM){\n\t\t\tMap<Integer, List<Integer>> newPartitionAttributes = new HashMap<Integer,List<Integer>>();\n\t\t\tint partitionCount = partitionAttributes.size();\n\t\t\t\n\t\t\t// check each partition\n\t\t\tfor(int p: partitionAttributes.keySet()){\n\t\t\t\tList<Integer> attrs = partitionAttributes.get(p);\n\t\t\t\tboolean fullPartitionAccess = true;\n\t\t\t\tfor(int a: attrs){\n\t\t\t\t\tif(query[a]==0)\n\t\t\t\t\t\tfullPartitionAccess = false;\n\t\t\t\t}\n\n\t\t\t\tif(fullPartitionAccess){\n\t\t\t\t\tnewPartitionAttributes.put(p, attrs);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t//int newPartition = partitionAttributes.size();\n\t\t\t\t\tList<Integer> accessedAttrs = new ArrayList<Integer>();\n\t\t\t\t\tList<Integer> nonAccessedAttrs = new ArrayList<Integer>();\n\t\t\t\t\tfor(int a: attrs){\n\t\t\t\t\t\tif(query[a]==1)\n\t\t\t\t\t\t\taccessedAttrs.add(a);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tnonAccessedAttrs.add(a);\n\t\t\t\t\t}\n\t\t\t\t\tif(nonAccessedAttrs.size() > 0)\n\t\t\t\t\t\tnewPartitionAttributes.put(p, nonAccessedAttrs);\n\t\t\t\t\tif(accessedAttrs.size() > 0)\n\t\t\t\t\t\tnewPartitionAttributes.put(partitionCount++, accessedAttrs);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//System.out.println(newPartitionAttributes);\n\t\t\t\n\t\t\tpartitionAttributes = newPartitionAttributes;\n\t\t}\n\t\t\n\t\t\n\t\t// 3. we end up with a set of attribute sets; all attributes in \n\t\t//\t an attribute set are always accessed together.\n\t\tint[][] primaryPartitions = new int[partitionAttributes.size()][];\n\t\tint i=0;\n\t\tfor(int p: partitionAttributes.keySet()){\n\t\t\tList<Integer> attrs = partitionAttributes.get(p);\n\t\t\tprimaryPartitions[i] = new int[attrs.size()];\n\t\t\tfor(int j=0;j<attrs.size();j++)\n\t\t\t\tprimaryPartitions[i][j] = attrs.get(j);\n\t\t\ti++;\n\t\t}\n\t\t\n\t\treturn primaryPartitions;\n\t}", "public void checkBounds() {\n\t\tfor (int k = 0; k < numDataCols; k++) {\n\t\t\tDashDataType<?> dtype = dataTypes[k];\n\n\t\t\tif ( dtype instanceof StringDashDataType ) {\n\t\t\t\tStringDashDataType strtype = (StringDashDataType) dtype;\n\t\t\t\tfor (int j = 0; j < numSamples; j++) {\n\t\t\t\t\tADCMessage msg = strtype.boundsCheckStandardValue(\n\t\t\t\t\t\t\t\t\t\t\t(String) stdObjects[j][k]);\n\t\t\t\t\tif ( msg != null ) {\n\t\t\t\t\t\tmsg.setRowNumber(j+1);\n\t\t\t\t\t\tmsg.setColNumber(k+1);\n\t\t\t\t\t\tmsg.setColName(userColNames[k]);\n\t\t\t\t\t\tstdMsgList.add(msg);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if ( dtype instanceof CharDashDataType ) {\n\t\t\t\tCharDashDataType chartype = (CharDashDataType) dtype;\n\t\t\t\tfor (int j = 0; j < numSamples; j++) {\n\t\t\t\t\tADCMessage msg = chartype.boundsCheckStandardValue(\n\t\t\t\t\t\t\t\t\t\t\t(Character) stdObjects[j][k]);\n\t\t\t\t\tif ( msg != null ) {\n\t\t\t\t\t\tmsg.setRowNumber(j+1);\n\t\t\t\t\t\tmsg.setColNumber(k+1);\n\t\t\t\t\t\tmsg.setColName(userColNames[k]);\n\t\t\t\t\t\tstdMsgList.add(msg);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if ( dtype instanceof IntDashDataType ) {\n\t\t\t\tIntDashDataType inttype = (IntDashDataType) dtype;\n\t\t\t\tfor (int j = 0; j < numSamples; j++) {\n\t\t\t\t\tADCMessage msg = inttype.boundsCheckStandardValue(\n\t\t\t\t\t\t\t\t\t\t\t(Integer) stdObjects[j][k]);\n\t\t\t\t\tif ( msg != null ) {\n\t\t\t\t\t\tmsg.setRowNumber(j+1);\n\t\t\t\t\t\tmsg.setColNumber(k+1);\n\t\t\t\t\t\tmsg.setColName(userColNames[k]);\n\t\t\t\t\t\tstdMsgList.add(msg);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if ( dtype instanceof DoubleDashDataType ) {\n\t\t\t\tDoubleDashDataType dbltype = (DoubleDashDataType) dtype;\n\t\t\t\tfor (int j = 0; j < numSamples; j++) {\n\t\t\t\t\tADCMessage msg = dbltype.boundsCheckStandardValue(\n\t\t\t\t\t\t\t\t\t\t\t(Double) stdObjects[j][k]);\n\t\t\t\t\tif ( msg != null ) {\n\t\t\t\t\t\tmsg.setRowNumber(j+1);\n\t\t\t\t\t\tmsg.setColNumber(k+1);\n\t\t\t\t\t\tmsg.setColName(userColNames[k]);\n\t\t\t\t\t\tstdMsgList.add(msg);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthrow new IllegalArgumentException(\"unexpected data type encountered \" + \n\t\t\t\t\t\t\"in bounds checking: \" + dtype);\n\t\t\t}\n\t\t}\n\t}", "private List<Integer> chooseInnerModelFeatureColumns(Matrix inputs, Matrix labels)\n\t{\n\t\tMatrix inputsShuffled = new Matrix(inputs);\n\t\tMatrix labelsShuffled = new Matrix(labels);\n\t\tinputs = null;\n\t\tlabels = null;\n\t\tinputsShuffled.shuffle(rand, labelsShuffled);\n\n\t\tMatrix[] sets = createValidationSet(inputsShuffled, labelsShuffled, validationSetPercent);\n\t\tMatrix tInputs = sets[0];\n\t\tMatrix tLabels = sets[1];\n\t\tMatrix vInputs = sets[2];\n\t\tMatrix vLabels = sets[3];\n\n\t\t// Greedily search for the best columns to train model i on.\n\t\t\t\n\t\tList<Integer> keepColumns = new ArrayList<>(featureColumnsToAlwaysUse);\n\t\t\n\t\tdouble lastIterationScore;\n\t\tif (featureColumnsToAlwaysUse.isEmpty())\n\t\t{\n\t\t\tlastIterationScore = Double.NEGATIVE_INFINITY;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tSupervisedLearner initialModel = trainOnColumns(tInputs, tLabels, keepColumns);\n\t\t\tlastIterationScore = validateOnColumns(vInputs, vLabels, keepColumns, initialModel);\n\t\t}\n\t\t\n\t\tLogger.println(\"initial lastIterationScore: \" + lastIterationScore);\n\t\t\n\t\tList<Integer> featureSelectionCols = Helper.iteratorToList(new Range(tInputs.cols()));\n\t\tfeatureSelectionCols.removeAll(featureColumnsToAlwaysUse);\n\t\t\n\t\twhile (!featureSelectionCols.isEmpty())\n\t\t{\n\t\t\t// Find the feature selection column which helps the model the most.\n\t\t\tTuple2<Integer, Double> bestTuple = featureSelectionCols.stream()\n\t\t\t\t\t.map(c -> \n\t\t\t\t\t{\n\t\t\t\t\t\tList<Integer> columns = new ArrayList<>(keepColumns);\n\t\t\t\t\t\tcolumns.add(c);\n\t\t\t\t\t\tSupervisedLearner model = trainOnColumns(tInputs, tLabels, columns);\n\t\t\t\t\t\tdouble score = validateOnColumns(vInputs, vLabels, columns, model);\n\t\t\t\t\t\treturn new Tuple2<Integer, Double>(c, score);\n\t\t\t\t\t})\n\t\t\t\t\t.max((t1, t2) -> Double.compare(t1.getSecond(), t2.getSecond())).get();\n\n\t\t\tif (bestTuple.getSecond() > lastIterationScore)\n\t\t\t{\n\t\t\t\tLogger.println(\"Keeping column \" + bestTuple.getFirst() + \", new score: \" + bestTuple.getSecond());\n\t\t\t\tkeepColumns.add(bestTuple.getFirst());\n\t\t\t\tfeatureSelectionCols.remove(bestTuple.getFirst());\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tlastIterationScore = bestTuple.getSecond();\n\t\t}\n\t\t\n\t\treturn keepColumns;\n\t}", "@Test\n public void testMultiLevelPartitionPruning() throws SqlParseException {\n\n val project = \"multi_level_partition\";\n val dfId = \"747f864b-9721-4b97-acde-0aa8e8656cba\";\n val expectedRanges = Lists.<Pair<String, String>> newArrayList();\n val segmentRange1 = Pair.newPair(\"2012-01-01\", \"2012-01-02\");\n val segment1Uuid = \"8892fa3f-f607-4eec-8159-7c5ae2f16942\";\n val segmentRange2 = Pair.newPair(\"2012-01-02\", \"2012-01-03\");\n val segment2Uuid = \"d75a822c-788a-4592-a500-cf20186dded1\";\n val segmentRange3 = Pair.newPair(\"2012-01-03\", \"2012-01-04\");\n val segment3Uuid = \"54eaf96d-6146-45d2-b94e-d5d187f89919\";\n val segmentRange4 = Pair.newPair(\"2012-01-04\", \"2012-01-05\");\n val segment4Uuid = \"411f40b9-a80a-4453-90a9-409aac6f7632\";\n val segmentRange5 = Pair.newPair(\"2012-01-05\", \"2012-01-06\");\n val segment5Uuid = \"a8318597-cb75-416f-8eb8-96ea285dd2b4\";\n val expectedPartitionMap = Maps.<String, List<Long>> newHashMap();\n\n val sqlBase = \"select cal_dt, sum(price) from test_kylin_fact inner join test_account on test_kylin_fact.seller_id = test_account.account_id \";\n\n // no filter\n val noFilterSql = sqlBase + \"group by cal_dt\";\n expectedRanges.add(segmentRange1);\n expectedRanges.add(segmentRange2);\n expectedRanges.add(segmentRange3);\n expectedRanges.add(segmentRange4);\n expectedRanges.add(segmentRange5);\n expectedPartitionMap.put(segment1Uuid, Lists.newArrayList(0L, 1L, 2L, 3L));\n expectedPartitionMap.put(segment2Uuid, Lists.newArrayList(0L, 1L, 2L));\n expectedPartitionMap.put(segment3Uuid, Lists.newArrayList(1L, 2L, 3L));\n expectedPartitionMap.put(segment4Uuid, Lists.newArrayList(0L, 1L));\n expectedPartitionMap.put(segment5Uuid, Lists.newArrayList(2L, 3L));\n assertPrunedSegmentsRange(project, noFilterSql, dfId, expectedRanges, 1L, expectedPartitionMap);\n\n val andSql0 = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-04' and lstg_site_id = 1 group by cal_dt\";\n val andMappingSql0 = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-04' and lstg_format_name = 'FP-non GTC' group by cal_dt\";\n val andMixSql0 = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-04' and lstg_site_id = 1 and lstg_format_name = 'FP-non GTC' group by cal_dt\";\n expectedRanges.clear();\n expectedRanges.add(segmentRange1);\n expectedRanges.add(segmentRange2);\n expectedRanges.add(segmentRange3);\n expectedPartitionMap.clear();\n expectedPartitionMap.put(segment1Uuid, Lists.newArrayList(1L));\n expectedPartitionMap.put(segment2Uuid, Lists.newArrayList(1L));\n expectedPartitionMap.put(segment3Uuid, Lists.newArrayList(1L));\n assertPrunedSegmentsRange(project, andSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n assertPrunedSegmentsRange(project, andMappingSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n assertPrunedSegmentsRange(project, andMixSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n\n val notInSql0 = sqlBase\n + \"where cal_dt > '2012-01-02' and cal_dt < '2012-01-04' and lstg_site_id not in (0, 2, 3) group by cal_dt\";\n val notInMappingSql0 = sqlBase\n + \"where cal_dt > '2012-01-02' and cal_dt < '2012-01-04' and lstg_format_name not in ('FP-GTC', 'ABIN', 'Auction') group by cal_dt\";\n val notInMixSql0 = sqlBase\n + \"where cal_dt > '2012-01-02' and cal_dt < '2012-01-04' and lstg_site_id not in (0, 2, 3) and lstg_format_name not in ('FP-GTC', 'ABIN', 'Auction') group by cal_dt\";\n expectedRanges.clear();\n expectedRanges.add(segmentRange2);\n expectedRanges.add(segmentRange3);\n expectedPartitionMap.clear();\n expectedPartitionMap.put(segment2Uuid, Lists.newArrayList(1L));\n expectedPartitionMap.put(segment3Uuid, Lists.newArrayList(1L));\n assertPrunedSegmentsRange(project, notInSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n assertPrunedSegmentsRange(project, notInMappingSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n assertPrunedSegmentsRange(project, notInMixSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n\n // return empty data case\n val emptyData = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-03' and lstg_site_id = 5 group by cal_dt\";\n val emptyDataMapping = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-03' and lstg_format_name = 'not_exist_name' group by cal_dt\";\n val emptyDataMix = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-03' and lstg_site_id = 5 and lstg_format_name = 'not_exist_name' group by cal_dt\";\n expectedRanges.clear();\n expectedPartitionMap.clear();\n assertPrunedSegmentsRange(project, emptyData, dfId, expectedRanges, -1L, expectedPartitionMap);\n assertPrunedSegmentsRange(project, emptyDataMapping, dfId, expectedRanges, -1L, expectedPartitionMap);\n assertPrunedSegmentsRange(project, emptyDataMix, dfId, expectedRanges, -1L, expectedPartitionMap);\n\n // query data out of current built segments range\n val inSql0 = sqlBase\n + \"where cal_dt > '2011-12-30' and cal_dt < '2012-01-03' and lstg_site_id in (1, 2) group by cal_dt\";\n val inMappingSql0 = sqlBase\n + \"where cal_dt > '2011-12-30' and cal_dt < '2012-01-03' and lstg_format_name in ('FP-non GTC', 'ABIN') group by cal_dt\";\n val inMixSql0 = sqlBase\n + \"where cal_dt > '2011-12-30' and cal_dt < '2012-01-03' and lstg_site_id in (1, 2) and lstg_format_name in ('FP-non GTC', 'ABIN') group by cal_dt\";\n expectedRanges.add(segmentRange1);\n expectedRanges.add(segmentRange2);\n expectedPartitionMap.put(segment1Uuid, Lists.newArrayList(1L, 2L));\n expectedPartitionMap.put(segment2Uuid, Lists.newArrayList(1L, 2L));\n assertPrunedSegmentsRange(project, inSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n assertPrunedSegmentsRange(project, inMappingSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n assertPrunedSegmentsRange(project, inMixSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n\n val pushDownSql0 = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-03' and lstg_site_id = 3 group by cal_dt\";\n assertNoRealizationFound(project, pushDownSql0);\n\n val pushDownMappingSql0 = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-03' and lstg_format_name = 'Auction' group by cal_dt\";\n assertNoRealizationFound(project, pushDownMappingSql0);\n\n val pushDownMixSql0 = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-03' and lstg_site_id = 3 and lstg_format_name = 'Auction' group by cal_dt\";\n assertNoRealizationFound(project, pushDownMixSql0);\n\n // return empty result\n val wrongMapping0 = sqlBase\n + \"where cal_dt between '2012-01-01' and '2012-01-02' and lstg_site_id = 0 and lstg_format_name = 'FP-non GTC' group by cal_dt\";\n assertPrunedSegmentsRange(project, wrongMapping0, dfId, null, -1L, null);\n\n val orSql0 = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-02' and (lstg_site_id = 0 or lstg_format_name = 'FP-non GTC') group by cal_dt\";\n expectedRanges.clear();\n expectedPartitionMap.clear();\n expectedRanges.add(segmentRange1);\n expectedPartitionMap.put(segment1Uuid, Lists.newArrayList(0L, 1L));\n assertPrunedSegmentsRange(project, orSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n }", "static public int getAtLeastKVisitors(int[][] rectangles, int k) {\n\n if(rectangles.length==0)\n return 0;\n if(k > rectangles.length)\n return 0;\n\n TreeSet<Rectangle> avlTree = new TreeSet<>();//To store the rectangles ordered\n TreeSet<Integer> Ys = new TreeSet<>();\n\n for(int[] coordinates: rectangles) {\n //x2 = x2 + 1 , y2 = y2 +1 for the inclusive constraints\n Rectangle r = new Rectangle(coordinates[0], coordinates[1], coordinates[2]+1, coordinates[3]+1);\n avlTree.add(r);\n if(!Ys.contains(r.getY1()))\n Ys.add(r.getY1());\n if(!Ys.contains(r.getY2()))\n Ys.add(r.getY2());\n }\n\n int ans = 0;\n Iterator<Integer> yIterator = Ys.iterator();\n int previousY = yIterator.next();\n\n //Traverse by slices of Y's\n while(yIterator.hasNext()) {\n\n int currentY = yIterator.next();\n List<int[]> segments = new ArrayList<>();\n Iterator<Rectangle> treeIterator = avlTree.iterator();\n\n //Look for the rectangles that fall in the slice and create a segment's list\n while(treeIterator.hasNext()) {\n Rectangle r = treeIterator.next();\n //We stop traversing the tree once the rectangles are completely above the slice\n if(r.getY1()>currentY)\n break;\n if(r.getY1()<= previousY && r.getY2()>=currentY) {\n int[] segmentL = new int[2]; int[] segmentR = new int[2];\n segmentL[0] = r.getX1(); segmentL[1] = Type.OPEN.getValue();\n segmentR[0] = r.getX2(); segmentR[1] = Type.CLOSED.getValue();\n segments.add(segmentL); segments.add(segmentR);\n }\n //We remove the rectangles that are left behind by the slice\n if(r.getY2() < previousY)\n treeIterator.remove();\n }\n\n //Sort the segments to analyze them\n Collections.sort(segments, (a, b) -> Integer.compare(a[0], b[0]));\n Iterator<int[]> it = segments.iterator();\n int[] segmentEnd, segmentStart = it.next();\n int nRectangles = Type.OPEN.getValue(); //The first interval will always be opening\n\n while(it.hasNext()) {\n segmentEnd = it.next();\n if(nRectangles >=k) {\n ans+= (currentY - previousY) * (segmentEnd[0] - segmentStart[0]);\n }\n segmentStart = segmentEnd;\n nRectangles += segmentEnd[1];\n }\n\n previousY = currentY;\n }\n\n return ans;\n }", "Condition(Column col1, String relation, Column col2) {\n // YOUR CODE HERE\n }", "boolean test() {\n int comp = this._col1.value().compareTo(this._col2.value());\n if (comp < 0 && (this.compRep & LT) != 0\n || comp > 0 && (this.compRep & GT) != 0\n || comp == 0 && (this.compRep & EQ) != 0) {\n return true;\n }\n return false;\n }", "private boolean conditionSimple( String condition, String[] ligne )\r\n {\n condition = condition.replaceAll(\",\", \"\");\r\n //condition = condition.replaceAll(\"(\", \"\");\r\n //condition = condition.replaceAll(\")\", \"\");\r\n condition = condition.replaceAll(\" \", \"\");\r\n \r\n boolean result = false;\r\n \r\n // cas de <\r\n if( condition.contains(\"<\") )\r\n {\r\n String[] tmp = condition.split(\"<\");\r\n int index = this.getIndexColumn( tmp[0] );\r\n \r\n // le cas ou on a column < entier\r\n if( index != -1 )\r\n result = Integer.parseInt( ligne[index] ) < Integer.parseInt( tmp[1] );\r\n // le cas de entier < column\r\n else\r\n {\r\n index = this.getIndexColumn( tmp[1] );\r\n result = Integer.parseInt( tmp[0] )< Integer.parseInt( ligne[index] );\r\n }\r\n }\r\n // cas de >\r\n else if( condition.contains(\">\") )\r\n {\r\n String[] tmp = condition.split(\">\");\r\n int index = this.getIndexColumn( tmp[0] );\r\n \r\n // le cas ou on a column > entier\r\n if( index != -1 )\r\n result = Integer.parseInt( ligne[index] ) > Integer.parseInt( tmp[1] );\r\n // le cas de entier > column\r\n else\r\n {\r\n index = this.getIndexColumn( tmp[1] );\r\n result = Integer.parseInt( tmp[0] )> Integer.parseInt( ligne[index] );\r\n }\r\n }\r\n // cas de !=\r\n else if( condition.contains(\"!=\") )\r\n {\r\n String[] tmp = condition.split(\"!=\");\r\n int index = this.getIndexColumn( tmp[0] );\r\n \r\n // le cas ou on a column = entier\r\n if( index != -1 )\r\n result = !ligne[index].equals(tmp[1]);\r\n // le cas de entier = column\r\n else\r\n {\r\n index = this.getIndexColumn( tmp[1] );\r\n result = !tmp[0].equals(ligne[index]);\r\n }\r\n }\r\n // cas de =\r\n else if( condition.contains(\"=\") )\r\n {\r\n String[] tmp = condition.split(\"=\");\r\n int index = this.getIndexColumn( tmp[0] );\r\n \r\n // le cas ou on a column = entier\r\n if( index != -1 )\r\n result = ligne[index].equals(tmp[1]);\r\n // le cas de entier = column\r\n else\r\n {\r\n index = this.getIndexColumn( tmp[1] );\r\n result = tmp[0].equals(ligne[index]);\r\n }\r\n }\r\n \r\n return result;\r\n }", "Boolean isCollinearTo(IVec3 v);", "private boolean[][] buildCoverTable(Mask[] implicants, Integer[] minterms,\n\t\t\tMap<Integer, Integer> mintermToColumnMap) {\n\n\t\tboolean[][] coverTable = new boolean[implicants.length][minterms.length];\n\n\t\tfor (int i = 0; i < implicants.length; i++) {\n\t\t\tfor (int j = 0; j < minterms.length; j++) {\n\t\t\t\tif (implicants[i].getIndexes().contains(minterms[j])) {\n\t\t\t\t\tcoverTable[i][j] = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn coverTable;\n\t}", "static boolean isSubset(int Tab1[], int Tab2[], int m, int n)\n {\n // compléter\n //Trouver le max de Tab1[]\n int max=Tab1[0];\n for(int i = 1; i < m; i++) {\n\t\t\tif (Tab1[i]>max){\n max=Tab1[i];\n }\n\t\t}\n \n\t\t//Stockage de la Tab1 dans une table de hashage\n\t\tint[] hashTable = new int[max];\n\t\tfor(int i = 0; i < m; i++) {\n\t\t\thashTable[hash(Tab1[i], max)] = Tab1[i];\n\t\t}\n\t\t\n\t\t//verifier que chaque element (de Tab2) existe dans la hashtable\n\t\tfor(int j = 0; j < n; j++) {\n\t\t\tif(Tab2[j] != hashTable[hash(Tab2[j], max)]) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t}\n return true;\n \n //Complexite aymptotique :\n /*\n Puisque la boucle qui a le plus d'itérations est celle avec l'élément m, la compléxité\n asymptotique est O(m).\n f(m,n) = 2m + n = O(m), puisque m > n\n */\n \n\n }", "private ArrayList<Integer> coverSatisfiedColumns(boolean[] ecmCoveredCols, int rowIndex)\n {\n ArrayList<Integer> coveredCols = new ArrayList<>();\n for(int j = 0; j < dimSquared * CONSTRAINTS; j++)\n {\n if(ecMatrix[rowIndex][j])\n {\n ecmCoveredCols[j] = true;\n coveredCols.add(j);\n }\n }\n return coveredCols;\n }", "public static void main(String[]args){\n\r\n int []arr = new int[100];\r\n int []arr2 = new int[50];\r\n int []arr3 = {1,2,3,4,5,6,7,8};\r\n int number = 5;\r\n LogicalOp op = new LogicalOp();\r\n// op.writeOnArray(arr);\r\n\r\n// arr2 = op.evenArray(arr2);\r\n// for(int i=0;i<arr2.length;i++)\r\n// System.out.println(arr2[i]);\r\n\r\n //System.out.println(\"Mean value: \"+op.meanValue(arr3));\r\n\r\n// String[] arrOfStr = {\"ana\",\"are\",\"mere\",\"pere\",\"mere\"};\r\n// String str = \"mere\";\r\n// System.out.println(op.isContaingString(arrOfStr,str));\r\n\r\n// System.out.println(op.findPosition(arr3,number));\r\n\r\n //op.displayLines();\r\n\r\n// int[]modifArr = op.modifiedArr(arr3,number);\r\n// for(int item: modifArr)\r\n// System.out.print(item+\" \");\r\n\r\n\r\n //System.out.println(\"Second minimum: \"+op.secondMin(arr3));\r\n\r\n int[] empty = new int[arr3.length];\r\n empty = op.populateArray(arr3,empty);\r\n for(int item:empty)\r\n System.out.print(item+\" \");\r\n\r\n\r\n\r\n }", "public static void pseudoTrueTuples(LogicProblem logicProblem, boolean applyChanges)\r\n throws RelationshipConflictException {\n \r\n HashMap<ItemPair,Relationship> relationshipTable = logicProblem.getRelationshipTable();\r\n HashSet<CategoryPair> categoryPairs = logicProblem.getCategoryPairs();\r\n \r\n// System.out.println(\"searching...\");\r\n //within a subgrid\r\n for (CategoryPair categoryPair : categoryPairs) {\r\n// System.out.println(\"Category pair:\" + categoryPair);\r\n //vertical and horizontal search\r\n for (final boolean verticalOrientation : new boolean[] { false, true } ) {\r\n\r\n Category subrowCategory = verticalOrientation?categoryPair.first():categoryPair.last();\r\n Category subcolumnCategory = verticalOrientation?categoryPair.last():categoryPair.first();\r\n\r\n //commenting \"vertical search\" \r\n //(subrows match first category's items\r\n // subcolumns match second category's items)\r\n\r\n //i (2 to floor(n/2)) is the number of elements in the combination tuple\r\n // i=2 in pseudoTrue pairs\r\n //(for subgrids of 5x5 items, looking for both pairs and triplets becomes redundant\r\n for (int i=2; i<=floor(logicProblem.getNumCategories()/2);i++) {\r\n\r\n //https://github.com/dpaukov/combinatoricslib3/wiki/v3.3.0#1-simple-combinations\r\n List<List<Item>> columnCombinations = Generator.combination(subcolumnCategory.getItems())\r\n .simple(i) //for pseudo true pairs, i=2\r\n .stream()\r\n .collect(Collectors.<List<Item>>toList());\r\n //for i=2, this would contain \r\n //Bethany, Donovan\r\n //Bethany, Elizabeth\r\n //...\r\n //Frederick, Peyton\r\n// columnCombinations.stream().forEach(l -> System.out.println(\r\n// (verticalOrientation?\"vertical\":\"horizontal\")+ \" combo: \"+l.toString()));\r\n\r\n //create the sets\r\n //for each combination, start over\r\n \r\n //columnTuple contains i items with which we will compute set intersections\r\n for (List<Item> columnItemTuple : columnCombinations) {\r\n //Bethany, Donovan\r\n \r\n //similarly, valueNoSets contains i sets of VALUE_NO relationships\r\n List<Set<Item>> valueNoSets = new ArrayList<>(); //size=i\r\n //build a set for each i item of columnTuple\r\n for (Item columnItem : columnItemTuple) {\r\n //Bethany\r\n Set<Item> valueNoSet = new HashSet<>(); //size = n\r\n for (Item rowItem : subrowCategory.getItems()) {\r\n //Haley's Comet ....\r\n if (relationshipTable.get(new ItemPair(rowItem, columnItem)).getValue() == Relationship.ValueType.VALUE_NO)\r\n //stacking all VALUE_NO relationship into vertical set\r\n valueNoSet.add(rowItem); //store into single subcolumn set \r\n }\r\n //adding each vertical set into list of sets\r\n if (valueNoSet.size() >= logicProblem.getNumItems() - i //for pairs, we need three VALUE_NO in the set\r\n && valueNoSet.size() < logicProblem.getNumItems()-1) //uniqueness will take or n-1 cases\r\n valueNoSets.add(valueNoSet); //store single subcolumn into multi-set\r\n }\r\n //magic!\r\n Set<Item> intersectionSet = new HashSet<>(); //avoid NPE when the next call is made\r\n if (valueNoSets.size()>=2) //don't compute intersections otherwise\r\n intersectionSet = Processor.multiSetIntersection(valueNoSets);\r\n\r\n if (intersectionSet.size()==logicProblem.getNumItems()-i) {\r\n \r\n// System.out.println(\"----> found candidates for pseudo true pairs!\");\r\n// intersectionSet.stream().forEach(l -> System.out.println(\"\\t\" + l.toString()));\r\n// System.out.println(\"\\t\\tvs.\");\r\n// columnItemTuple.stream().forEach(l -> System.out.println(\"\\t\" + l.toString()));\r\n \r\n //create predecessor list\r\n //we can only add the intersection output as predecessors\r\n ArrayList<Dependable> predecessors = new ArrayList<Dependable>();\r\n for (Item intersectionColumn : intersectionSet) {\r\n for (Item rowItem : columnItemTuple) {\r\n predecessors.add(relationshipTable.get(new ItemPair(rowItem, intersectionColumn)));\r\n }\r\n }\r\n\r\n\r\n //we have a bunch of work to do\r\n for (Item everyRowItem : subrowCategory.getItems()) {\r\n //for every row item not in the intersectionSet\r\n if (!intersectionSet.contains(everyRowItem)) {\r\n for (Item everyColumnItem : subcolumnCategory.getItems()) {\r\n //for every column item not in any of the columnTuple list\r\n if (!columnItemTuple.contains(everyColumnItem)) {\r\n Relationship rel = relationshipTable.get(new ItemPair(everyRowItem,everyColumnItem));\r\n if (rel.getValue()!=Relationship.ValueType.VALUE_NO)\r\n Processor.setRelationship(logicProblem, applyChanges, rel, \r\n Relationship.ValueType.VALUE_NO, Relationship.LogicType.PSEUDOTRUE,\r\n predecessors.toArray(new Relationship[predecessors.size()])); \r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }", "@Test\n public void should_iterate_with_partition_keys_and_partition_keys_IN() throws Exception {\n //Given\n long partitionKey = RandomUtils.nextLong(0,Long.MAX_VALUE);\n\n insertCompositeClusteredValues(partitionKey,\"bucket1\",1,\"name1\",1);\n insertCompositeClusteredValues(partitionKey,\"bucket2\",1,\"name2\",1);\n insertCompositeClusteredValues(partitionKey,\"bucket3\",1,\"name3\",1);\n\n //When\n final Iterator<CompositeClusteredEntity> iterator = manager.sliceQuery(CompositeClusteredEntity.class)\n .forIteration()\n .withPartitionComponents(partitionKey)\n .andPartitionComponentsIN(\"bucket1\", \"bucket3\")\n .iterator();\n\n //Then\n assertThat(iterator.hasNext()).isTrue();\n CompositeClusteredEntity next = iterator.next();\n assertThat(next.getId().getId()).isEqualTo(partitionKey);\n assertThat(next.getId().getBucket()).isEqualTo(\"bucket1\");\n assertThat(next.getId().getName()).isEqualTo(\"name11\");\n assertThat(next.getValue()).isEqualTo(\"value11\");\n\n assertThat(iterator.hasNext()).isTrue();\n next = iterator.next();\n assertThat(next.getId().getId()).isEqualTo(partitionKey);\n assertThat(next.getId().getBucket()).isEqualTo(\"bucket3\");\n assertThat(next.getId().getName()).isEqualTo(\"name31\");\n assertThat(next.getValue()).isEqualTo(\"value11\");\n }", "@ParameterizedTest\n @CsvSource(value = {\"0,7\", \"8,15\", \"16,23\", \"24,31\", \"0,23\", \"13, 29\"})\n void sliceGetsCorrectSignals(int min, int max) {\n //create range obj with inputs\n IRange range = new SimpleRange(min, max);\n\n //create bus of width 64 with random values\n Random r = new Random();\n int busWidth = 32;\n ISignal[] sigs = new ISignal[busWidth];\n for (int i=0; i<busWidth; i++) {\n sigs[i] = new SimpleSignal(r.nextBoolean());\n }\n IBus busToSlice = new Bus(sigs);\n\n //sliceBus the bus\n IBus result = Util.sliceBus(range, busToSlice);\n\n //need to get values from sliceBus to test\n int rangeWidth = range.getMax() - range.getMin();\n assertEquals(collectValuesFromBus(range, busToSlice), collectValuesFromBus(new SimpleRange(0, rangeWidth), result));\n\n //sweep in 8-bit slices across the bus to see if we're getting the correct range from the sliceBus util\n int numBitsInSweep = 8;\n int numSweeps = busWidth/numBitsInSweep;\n for (int i=0; i<numSweeps; i++) {\n int start = i*numBitsInSweep;\n int end = start + numBitsInSweep - 1;\n IBus slice = Util.sliceBus(new SimpleRange(start, end), busToSlice);\n }\n }", "protected void checkSlice(int slice) {\n\tif (slice < 0 || slice >= slices) throw new IndexOutOfBoundsException(\"Attempted to access \"+toStringShort()+\" at slice=\"+slice);\n}", "public static void main(String[] args) {\n\t\tint[][] matrix = { { 1, 5, 2 }, { 3, 4, 1 }, { 2, 3, 0 } };\n//\t\tint diff = 4;\n\t\tint diff = 2;\n\t\tSystem.out.println(\"\" + canReach(matrix, diff));\n\n\t}", "private boolean checkColoumnForQuadPair(int j1) {\n for(int i=0;i<4;i++)\r\n {\r\n if(Kmap[i][j1]==0 || Kmap[i][j1]==-1)\r\n return false;\r\n }\r\n for(int i=0;i<4;i++)\r\n {\r\n Kmap[i][j1]=-1;\r\n }\r\n return true; \r\n }", "@Test\n public void test_range_Integer_Collection1() {\n populate_i1();\n Collection<Integer> actual = Selector.range(i1, 1, 5, new CompareIntegerAscending());\n Collection<Integer> expected = new ArrayList<Integer>();\n expected.add(2);\n expected.add(3);\n expected.add(4);\n Assert.assertEquals(\"Did not find range correctly\", expected, actual);\n }", "private boolean isSubset(List<ConceptLabel> outer, List<ConceptLabel> inner){\n\t\tfor(ConceptLabel in: inner){\n\t\t\tboolean c = false;\n\t\t\tfor(ConceptLabel l: outer){\n\t\t\t\tif(l.getText().equals(in.getText())){\n\t\t\t\t\tc = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(!c)\n\t\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "private static <T> int med3(List<T> x, Comparator<T> comp, int a, int b, int c) {\n\t\treturn (comp.compare(x.get(a),x.get(b))<0 ?\n\t\t\t\t(comp.compare(x.get(b),x.get(c))<0 ? b : comp.compare(x.get(a),x.get(c))<0 ? c : a) :\n\t\t\t\t\t(comp.compare(x.get(b),x.get(c))>0 ? b : comp.compare(x.get(a),x.get(c))>0 ? c : a));\n\t}", "public static boolean IS_SUBFEATURE(Feature a, int index_a, Feature b, int index_b) {\n\n boolean anotinb, bnotina;\n int i, ia, ib;\n\n if (index_a != index_b)\n Dataset.perror(\"Feature.class :: not the same feature (\" + index_a + \" != \" + index_b + \")\");\n if (!a.type.equals(b.type))\n Dataset.perror(\n \"Feature.class :: not the same type of feature (\" + a.type + \" != \" + b.type + \")\");\n\n if (IS_CONTINUOUS(a.type)) {\n if (a.dmin >= b.dmin) {\n if (a.dmax <= b.dmax) return true;\n else\n Dataset.perror(\n \"Feature.class :: inconsistency for subfeature check for : (\"\n + a.dmin\n + \", \"\n + a.dmax\n + \") subseteq (\"\n + b.dmin\n + \", \"\n + b.dmax\n + \") ? \");\n } else if (a.dmax < b.dmax)\n Dataset.perror(\n \"Feature.class :: inconsistency for subfeature check for : (\"\n + a.dmin\n + \", \"\n + a.dmax\n + \") subseteq (\"\n + b.dmin\n + \", \"\n + b.dmax\n + \") ? \");\n } else if (IS_INTEGER(a.type)) {\n if (a.imin >= b.imin) {\n if (a.imax <= b.imax) return true;\n else\n Dataset.perror(\n \"Feature.class :: inconsistency for subfeature check for : (\"\n + a.imin\n + \", \"\n + a.imax\n + \") subseteq (\"\n + b.imin\n + \", \"\n + b.imax\n + \") ? \");\n } else if (a.imax < b.imax)\n Dataset.perror(\n \"Feature.class :: inconsistency for subfeature check for : (\"\n + a.imin\n + \", \"\n + a.imax\n + \") subseteq (\"\n + b.imin\n + \", \"\n + b.imax\n + \") ? \");\n } else if (IS_NOMINAL(a.type)) {\n if (a.modalities == null) return true;\n else if (b.modalities != null) {\n anotinb = bnotina = false;\n ia = ib = -1;\n for (i = 0; i < a.modalities.size(); i++)\n if (!b.modalities.contains((String) a.modalities.elementAt(i))) {\n anotinb = true;\n ia = i;\n }\n for (i = 0; i < b.modalities.size(); i++)\n if (!a.modalities.contains((String) b.modalities.elementAt(i))) {\n bnotina = true;\n ib = i;\n }\n if ((anotinb) && (bnotina))\n Dataset.perror(\n \"Feature.class :: inconsistency for subfeature check for : \"\n + ((String) a.modalities.elementAt(ia))\n + \" not in b and \"\n + ((String) b.modalities.elementAt(ib))\n + \" not in a \");\n else if (!anotinb) return true;\n }\n } else Dataset.perror(\"Feature.class :: no Feature type for \" + a.type);\n\n return false;\n }", "public boolean percolates() {\n\t\tint top = uf.find(0);\n\t\tint bottom = uf.find(size * size + 1);\n\t\treturn top == bottom;\n\t}", "private void findColumnBoundaries(){\n int columnBoundaryX1 = Integer.MAX_VALUE;\n int columnBoundaryX2 = Integer.MIN_VALUE;\n for(ArrayList<Element> cell : cells){\n String pos;\n String[] positions;\n\n Element firstWordInCell = cell.get(0);\n Element lastWordInCell = cell.get(cell.size()-1);\n\n pos = firstWordInCell.attr(\"title\");\n positions = pos.split(\"\\\\s+\");\n int x1 = Integer.parseInt(positions[1]);\n if(x1 < columnBoundaryX1){\n columnBoundaryX1 = x1;\n this.columnBoundaryX1 = x1;\n }\n\n pos = lastWordInCell.attr(\"title\");\n positions = pos.split(\"\\\\s+\");\n int x2 = Integer.parseInt(positions[3]);\n if(x2 > columnBoundaryX2){\n columnBoundaryX2 = x2;\n this.columnBoundaryX2 = x2;\n }\n }\n }", "@Test\n public void test_range_String_Collection1() {\n populate_s1();\n Collection<String> actual = Selector.range(s1, \"B\", \"C\", new CompareStringAscending());\n Collection<String> expected = new ArrayList<String>();\n expected.add(\"B\");\n expected.add(\"C\");\n Assert.assertEquals(\"Did not find range correctly\", expected, actual);\n }", "@Test\n\t public void test_Is_Subset_Positive() throws Exception{\t\n\t\t SET setarray= new SET( new int[]{1,2,3,4,5});\n\t\t SET subsetarray= new SET( new int[]{1,2,3});\n\t\t assertTrue(setarray.isSubSet(subsetarray));\t \n\t }", "public void showDisplayCrossSectionBy(int[][] crossSection);", "@Test\n\t public void test_Is_Subset_Negative() throws Exception{\t\n\t\t SET setarray= new SET( new int[]{1,2,3,4,5});\n\t\t SET subsetarray= new SET( new int[]{7,8});\n\t\t assertFalse(setarray.isSubSet(subsetarray));\t \n\t }", "private Map<Boolean, Sort> split2 (final int delim, final int subcl) {\n Interval[] split = getConstraint(subcl).split(delim);//the interval to be split\n if (split.length == 0)\n return Collections.EMPTY_MAP;\n else if (split.length == 2) {\n Map<Boolean, Sort> res = new HashMap<>();\n Interval[] newarrc = this.constraints.clone();//the original constraints is copied\n newarrc[subcl - 1] = split[0];\n res.put(false, setConstraint(newarrc)); //false trands for \"0\"\n newarrc = this.constraints.clone();\n newarrc[subcl - 1] = split[1];\n res.put(true, setConstraint(newarrc)); //true stands for \"1\"\n return res;\n }\n throw new IllegalArgumentException(\"binary splits are assumed!\");\n }", "public void testColumnaIzquierdaLlena( )\n {\n setupEscenario2( );\n triqui.limpiarTablero( );\n triqui.marcarCasilla( 1, marcaJugador1 );\n triqui.marcarCasilla( 4, marcaJugador1 );\n triqui.marcarCasilla( 7, marcaJugador1 );\n assertTrue( triqui.columnaIzquierdaLlena( marcaJugador1 ) );\n assertTrue( triqui.ganoJuego( marcaJugador1 ) );\n }", "public void testGetColumnIndex() {\n TaskSeriesCollection c = createCollection1();\n }", "private static <T> int med3(@Nonnull List<T> x, Comparator<? super T> comparator, int a, int b, int c) {\n return comparator.compare(x.get(a), x.get(b)) < 0\n ? comparator.compare(x.get(b), x.get(c)) < 0 ? b : comparator.compare(x.get(a), x.get(c)) < 0 ? c : a\n : comparator.compare(x.get(c), x.get(b)) < 0 ? b : comparator.compare(x.get(c), x.get(a)) < 0 ? c : a;\n }" ]
[ "0.6965921", "0.6914059", "0.69114923", "0.6779652", "0.6630016", "0.63010615", "0.6233237", "0.61220306", "0.6072426", "0.60607076", "0.6034352", "0.56164646", "0.5528148", "0.54576087", "0.5364557", "0.53221506", "0.532174", "0.5167257", "0.5086574", "0.50616664", "0.50188494", "0.49589053", "0.49581856", "0.49468347", "0.48981184", "0.48746872", "0.48475575", "0.48443535", "0.4812865", "0.48046032", "0.47978428", "0.4791377", "0.47777742", "0.47642538", "0.47619948", "0.47583127", "0.47511104", "0.4751091", "0.47429082", "0.4742492", "0.47262344", "0.47186345", "0.47019523", "0.46573144", "0.465065", "0.46333027", "0.4626393", "0.46141085", "0.46062505", "0.460558", "0.4598937", "0.4587126", "0.45830047", "0.45708555", "0.45645714", "0.45555025", "0.45535824", "0.45389426", "0.45340183", "0.45253068", "0.45240226", "0.451263", "0.45102206", "0.45049536", "0.45011288", "0.44978547", "0.44971508", "0.44964856", "0.44955194", "0.44916895", "0.44870654", "0.44785193", "0.4477686", "0.44771498", "0.4468325", "0.4464339", "0.44620857", "0.44488347", "0.4448446", "0.44427273", "0.44330812", "0.4431494", "0.44309464", "0.4430443", "0.4429852", "0.44242787", "0.4417442", "0.44160762", "0.44143853", "0.44036967", "0.43930843", "0.43820238", "0.43806067", "0.43756863", "0.43631566", "0.43609485", "0.4360181", "0.43595007", "0.43581492", "0.43525112" ]
0.6905732
3
Test mixing single and multi equals restrictions (e.g. clustering_0 = 1 AND (clustering_1, clustering_2) = (2, 3))
@Test public void testBoundsAsCompositesWithSingleEqAndMultiEqRestrictions() { CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC, Sort.ASC); ByteBuffer value1 = ByteBufferUtil.bytes(1); ByteBuffer value2 = ByteBufferUtil.bytes(2); ByteBuffer value3 = ByteBufferUtil.bytes(3); ByteBuffer value4 = ByteBufferUtil.bytes(4); // clustering_0 = 1 AND (clustering_1, clustering_2) = (2, 3) Restriction singleEq = newSingleEq(cfMetaData, 0, value1); Restriction multiEq = newMultiEq(cfMetaData, 1, value2, value3); PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(singleEq).mergeWith(multiEq); List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value1, value2, value3, EOC.START); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value1, value2, value3, EOC.END); // clustering_0 = 1 AND clustering_1 = 2 AND (clustering_2, clustering_3) = (3, 4) singleEq = newSingleEq(cfMetaData, 0, value1); Restriction singleEq2 = newSingleEq(cfMetaData, 1, value2); multiEq = newMultiEq(cfMetaData, 2, value3, value4); restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(singleEq).mergeWith(singleEq2).mergeWith(multiEq); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END); // (clustering_0, clustering_1) = (1, 2) AND clustering_2 = 3 singleEq = newSingleEq(cfMetaData, 2, value3); multiEq = newMultiEq(cfMetaData, 0, value1, value2); restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(singleEq).mergeWith(multiEq); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value1, value2, value3, EOC.START); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value1, value2, value3, EOC.END); // clustering_0 = 1 AND (clustering_1, clustering_2) = (2, 3) AND clustering_3 = 4 singleEq = newSingleEq(cfMetaData, 0, value1); singleEq2 = newSingleEq(cfMetaData, 3, value4); multiEq = newMultiEq(cfMetaData, 1, value2, value3); restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(singleEq).mergeWith(multiEq).mergeWith(singleEq2); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void testBoundsAsCompositesWithOneEqRestrictionsAndTwoClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer clustering_0 = ByteBufferUtil.bytes(1);\n Restriction eq = newSingleEq(cfMetaData, 0, clustering_0);\n\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithOneEqRestrictionsAndOneClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC);\n\n ByteBuffer clustering_0 = ByteBufferUtil.bytes(1);\n Restriction eq = newSingleEq(cfMetaData, 0, clustering_0);\n\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.END);\n }", "private static Restriction newMultiEq(CFMetaData cfMetaData, int firstIndex, ByteBuffer... values)\n {\n List<ColumnDefinition> columnDefinitions = new ArrayList<>();\n for (int i = 0; i < values.length; i++)\n {\n columnDefinitions.add(getClusteringColumnDefinition(cfMetaData, firstIndex + i));\n }\n return new MultiColumnRestriction.EQ(columnDefinitions, toMultiItemTerminal(values));\n }", "@Test\n public void testBoundsAsCompositesWithMultiEqAndSingleSliceRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n\n // (clustering_0, clustering_1) = (1, 2) AND clustering_2 > 3\n Restriction multiEq = newMultiEq(cfMetaData, 0, value1, value2);\n Restriction singleSlice = newSingleSlice(cfMetaData, 2, Bound.START, false, value3);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiEq).mergeWith(singleSlice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithSingleEqAndMultiINRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n ByteBuffer value5 = ByteBufferUtil.bytes(5);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) IN ((2, 3), (4, 5))\n Restriction singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction multiIN = newMultiIN(cfMetaData, 1, asList(value2, value3), asList(value4, value5));\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiIN);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(1), value1, value4, value5, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(1), value1, value4, value5, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) IN ((2, 3))\n singleEq = newSingleEq(cfMetaData, 0, value1);\n multiIN = newMultiIN(cfMetaData, 1, asList(value2, value3));\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiIN).mergeWith(singleEq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n // clustering_0 = 1 AND clustering_1 = 5 AND (clustering_2, clustering_3) IN ((2, 3), (4, 5))\n singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction singleEq2 = newSingleEq(cfMetaData, 1, value5);\n multiIN = newMultiIN(cfMetaData, 2, asList(value2, value3), asList(value4, value5));\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiIN).mergeWith(singleEq2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value5, value2, value3, EOC.START);\n assertComposite(bounds.get(1), value1, value5, value4, value5, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value5, value2, value3, EOC.END);\n assertComposite(bounds.get(1), value1, value5, value4, value5, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithSingleEqAndSliceRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n ByteBuffer value5 = ByteBufferUtil.bytes(5);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) > (2, 3)\n Restriction singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction multiSlice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiSlice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) > (2, 3) AND (clustering_1) < (4)\n singleEq = newSingleEq(cfMetaData, 0, value1);\n multiSlice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3);\n Restriction multiSlice2 = newMultiSlice(cfMetaData, 1, Bound.END, false, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiSlice2).mergeWith(singleEq).mergeWith(multiSlice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value4, EOC.START);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) => (2, 3) AND (clustering_1, clustering_2) <= (4, 5)\n singleEq = newSingleEq(cfMetaData, 0, value1);\n multiSlice = newMultiSlice(cfMetaData, 1, Bound.START, true, value2, value3);\n multiSlice2 = newMultiSlice(cfMetaData, 1, Bound.END, true, value4, value5);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiSlice2).mergeWith(singleEq).mergeWith(multiSlice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value4, value5, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiEqRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n Restriction eq = newMultiEq(cfMetaData, 0, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithTwoAscendingAndTwoDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.DESC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertEmptyComposite(bounds.get(1));\n\n // clustering_0 = 1 AND (clustering_1, clustering_2, clustering_3) > (2, 3, 4)\n Restriction eq = newSingleEq(cfMetaData, 0, value1);\n slice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n restrictions = restrictions.mergeWith(eq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2, clustering_3) > (2, 3, 4)\n Restriction in = newSingleIN(cfMetaData, 0, value1, value2);\n slice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n restrictions = restrictions.mergeWith(in);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n assertComposite(bounds.get(2), value2, value2, EOC.START);\n assertComposite(bounds.get(3), value2, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n assertComposite(bounds.get(2), value2, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(3), value2, EOC.END);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1, clustering_2, clustering_3) <= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) < (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4) AND (clustering_0, clustering_1) < (2, 3)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2, value3);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(1), value2, value3, EOC.START);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4) AND (clustering_0, clustering1, clustering_2, clustering_3) <= (4, 3, 2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value4, value3, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n assertComposite(bounds.get(2), value4, value3, value2, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(1), value4, value3, EOC.START);\n assertComposite(bounds.get(2), value4, value3, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsMixingAscendingDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.DESC, Sort.ASC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(3));\n\n // clustering_0 = 1 AND (clustering_1, clustering_2, clustering_3) > (2, 3, 4)\n Restriction eq = newSingleEq(cfMetaData, 0, value1);\n slice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n restrictions = restrictions.mergeWith(eq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(3));\n\n\n // (clustering_0, clustering1, clustering_2, clustering_3) <= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, value4, EOC.NONE);\n assertComposite(bounds.get(3), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) < (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(3), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4) AND (clustering_0, clustering_1) < (2, 3)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2, value3);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(5, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n assertComposite(bounds.get(4), value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(5, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertComposite(bounds.get(3), value2, EOC.START);\n assertComposite(bounds.get(4), value2, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4) AND (clustering_0, clustering1, clustering_2, clustering_3) <= (4, 3, 2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value4, value3, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(7, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n assertComposite(bounds.get(4), value4, value3, EOC.START);\n assertComposite(bounds.get(5), value4, value3, value2, value1, EOC.NONE);\n assertComposite(bounds.get(6), value4, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(7, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertComposite(bounds.get(3), value4, EOC.START);\n assertComposite(bounds.get(4), value4, value3, value2, EOC.START);\n assertComposite(bounds.get(5), value4, value3, value2, EOC.END);\n assertComposite(bounds.get(6), value4, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithTwoClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.END);\n }", "@Test\n public void testEquals() {\n Term t1 = structure(\"abc\", atom(\"a\"), atom(\"b\"), atom(\"c\"));\n Term t2 = structure(\"abc\", integerNumber(), decimalFraction(), variable());\n PredicateKey k1 = PredicateKey.createForTerm(t1);\n PredicateKey k2 = PredicateKey.createForTerm(t2);\n testEquals(k1, k2);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneAscendingAndOneDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n assertComposite(bounds.get(2), value2, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertComposite(bounds.get(1), value2, EOC.START);\n assertComposite(bounds.get(2), value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneDescendingAndOneAscendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0) > (1) AND (clustering_0, clustering1) < (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.END);\n assertComposite(bounds.get(2), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.END);\n assertComposite(bounds.get(1), value1, EOC.START);\n assertComposite(bounds.get(2), value1, EOC.END);\n }", "public interface IStoppingCriteria {\n\n /**\n * Determine the degree of clustering agreement\n * @param cluster1 one clustering results\n * @param cluster2 the other clustering results\n * @return the degree of clustering agreement; 1 refers to be the same clustering results; 0 refers to be the totally different clustering results\n */\n public double computeSimilarity(int[] cluster1, int[] cluster2);\n\n}", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithTwoDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n }", "boolean hasSharedCriterion();", "@org.testng.annotations.Test\n public void test_equals_Symmetric()\n throws Exception {\n CategorieClient categorieClient = new CategorieClient(\"denis\", 1000, 10.2, 1.1, 1.2, false);\n Client x = new Client(\"Denis\", \"Denise\", \"Paris\", categorieClient);\n Client y = new Client(\"Denis\", \"Denise\", \"Paris\", categorieClient);\n Assert.assertTrue(x.equals(y) && y.equals(x));\n Assert.assertTrue(x.hashCode() == y.hashCode());\n }", "private boolean isSubsetOf(List<String> permissions2,\n\t\t\tList<String> permissions3) {\n\t\treturn false;\n\t}", "private boolean runMultiSampleCase() {\n\t\tArrayList<Candidate> candidates = collectTrioCandidates();\n\n\t\t// Then, check the candidates for all trios around affected individuals.\n\t\tfor (Candidate c : candidates)\n\t\t\tif (isCompatibleWithTriosAroundAffected(c))\n\t\t\t\treturn true;\n\t\treturn false;\n\t}", "public boolean isEqualTo(Cluster c)\n {\n int len = this.size();\n if (len != c.size()){\n return false;\n }\n if (len == 0){\n return true;\n }\n if (this.getLeader() != c.getLeader()){\n return false;\n }\n for (Integer n : this._elems){\n if (!c.contains(n)){\n return false;\n }\n }\n return true;\n }", "@Test\n \tpublic void whereClauseForNodeSameSpan() {\n \t\tnode23.addJoin(new SameSpan(node42));\n \t\tcheckWhereCondition(\n \t\t\t\tjoin(\"=\", \"_node23.text_ref\", \"_node42.text_ref\"),\n \t\t\t\tjoin(\"=\", \"_node23.left\", \"_node42.left\"),\n \t\t\t\tjoin(\"=\", \"_node23.right\", \"_node42.right\")\n \t\t);\n \t}", "@Test\n public void testBoundsAsCompositesWithSliceRestrictionsAndOneClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newSingleSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newSingleSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithOneInRestrictionsAndOneClusteringColumn()\n {\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n Restriction in = newSingleIN(cfMetaData, 0, value1, value2, value3);\n\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(in);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.START);\n assertComposite(bounds.get(2), value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n assertComposite(bounds.get(1), value2, EOC.END);\n assertComposite(bounds.get(2), value3, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithEqAndSliceRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n\n Restriction eq = newSingleEq(cfMetaData, 0, value3);\n\n Restriction slice = newSingleSlice(cfMetaData, 1, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 1, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 1, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 1, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 1, Bound.START, false, value1);\n Restriction slice2 = newSingleSlice(cfMetaData, 1, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value2, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 1, Bound.START, true, value1);\n slice2 = newSingleSlice(cfMetaData, 1, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value2, EOC.END);\n }", "Boolean same(MultiSet<X> s);", "@Test\n\tpublic void testEqualityCheck() {\n\t\tadd(\"f(x)=x^3\");\n\t\tadd(\"g(x)=-x^3\");\n\t\tt(\"f==g\", \"false\");\n\t\tt(\"f!=g\", \"true\");\n\t\tt(\"f==-g\", \"true\");\n\t\tt(\"f!=-g\", \"false\");\n\t}", "private static Restriction newSingleEq(CFMetaData cfMetaData, int index, ByteBuffer value)\n {\n ColumnDefinition columnDef = getClusteringColumnDefinition(cfMetaData, index);\n return new SingleColumnRestriction.EQ(columnDef, toTerm(value));\n }", "public static void main(String[] args) {\n int n1 = 0;\n int n2 = 0;\n int n3 = 0;\n if (n1 == n2 && n1 != n3) {\n System.out.println(\"n1 and n2 equal\");\n } else if (n2 == n3 && n2 != n1) {\n System.out.println(\"n2 and n3 equal\");\n } else if (n3 == n1 && n1 != n2) {\n System.out.println(\"n3 and n1 equal\");\n } else if (n1 == n2 && n1 == n3) {\n System.out.println(\"all equal\");\n }\n else {\n System.out.println(\"none equal\");\n }\n }", "@Test\n public void testIntersection3()\n {\n List<Integer> expected = new ArrayList<>();\n ConciseSet set1 = new ConciseSet();\n ConciseSet set2 = new ConciseSet();\n for (int i = 0; i < 1000; i++) {\n set1.add(i);\n set2.add(i);\n expected.add(i);\n }\n\n verifyIntersection(expected, set1, set2);\n }", "public interface Equality extends Clause {}", "@Test\n public void allTrue() {\n assertTrue(getPredicateInstance(true, true).evaluate(getTestValue()),\n \"multiple true predicates evaluated to false\");\n assertTrue(getPredicateInstance(true, true, true).evaluate(getTestValue()),\n \"multiple true predicates evaluated to false\");\n }", "public static List<EqualTo> getEqualTo(AbstractPhysicalJoin<Plan, Plan> join) {\n List<EqualTo> eqConjuncts = Lists.newArrayList();\n if (!join.getCondition().isPresent()) {\n return eqConjuncts;\n }\n\n List<SlotReference> leftSlots = Utils.getOutputSlotReference(join.left());\n List<SlotReference> rightSlots = Utils.getOutputSlotReference(join.right());\n\n Expression onCondition = join.getCondition().get();\n List<Expression> conjunctList = ExpressionUtils.extractConjunction(onCondition);\n for (Expression predicate : conjunctList) {\n if (isEqualTo(leftSlots, rightSlots, predicate)) {\n eqConjuncts.add((EqualTo) predicate);\n }\n }\n return eqConjuncts;\n }", "@Test\n\tvoid attributeGroupDisjunction2() {\n\t\tassertEquals(\n\t\t\t\"Match procedure with left OR right foot (grouped)\",\n\t\t\tSets.newHashSet(AMPUTATION_FOOT_LEFT, AMPUTATION_FOOT_RIGHT, AMPUTATION_FOOT_BILATERAL),\n\t\t\tstrings(selectConceptIds(\"< 71388002 |Procedure|: { 363704007 |Procedure site| = 22335008 |Left Foot| } OR { 363704007 |Procedure site| = 7769000 |Right Foot| }\")));\n\n\t}", "private boolean checkSharedVertex(Segment s1, Segment s2){\n\t\tdouble wp1x = s1.w1.getX();\n\t\tdouble wp1y = s1.w1.getY();\n\t\tdouble wp2x = s1.w2.getX();\n\t\tdouble wp2y = s1.w2.getY();\n\t\tdouble wp3x = s2.w1.getX();\n\t\tdouble wp3y = s2.w1.getY();\n\t\tdouble wp4x = s2.w2.getX();\n\t\tdouble wp4y = s2.w2.getY();\n\n\t\tif (((wp1x == wp3x && wp1y == wp3y) || (wp1x == wp4x && wp1y == wp4y)) \n\t\t|| ((wp2x == wp3x && wp2y == wp3y) || (wp2x == wp4x && wp2y == wp4y)))\n\t\t\treturn true;\n\t\t\n\t\treturn false;\n\t}", "@Test\r\n public void testIsSubset1() {\r\n Assert.assertEquals(false, set1.isSubset(set2));\r\n }", "protected abstract boolean isEqual(E entryA, E entryB);", "@Test\n public void testIntersection4()\n {\n List<Integer> expected = new ArrayList<>();\n ConciseSet set1 = new ConciseSet();\n ConciseSet set2 = new ConciseSet();\n for (int i = 0; i < 1000; i++) {\n set1.add(i);\n if (i != 500) {\n set2.add(i);\n expected.add(i);\n }\n }\n\n verifyIntersection(expected, set1, set2);\n }", "@Test\n public void testEquals03() {\n System.out.println(\"equals\");\n\n Set<User> users = new HashSet<>();\n users.add(new User(\"nick0\", \"[email protected]\"));\n users.add(new User(\"nick1\", \"[email protected]\"));\n users.add(new User(\"nick2\", \"[email protected]\"));\n users.add(new User(\"nick3\", \"[email protected]\"));\n users.add(new User(\"nick4\", \"[email protected]\"));\n users.add(new User(\"nick5\", \"[email protected]\"));\n users.add(new User(\"nick6\", \"[email protected]\"));\n users.add(new User(\"nick7\", \"[email protected]\"));\n users.add(new User(\"nick8\", \"[email protected]\"));\n users.add(new User(\"nick9\", \"[email protected]\"));\n\n Set<City> cities = new HashSet<>();\n cities.add(new City(new Pair(41.243345, -8.674084), \"city0\", 28));\n cities.add(new City(new Pair(41.237364, -8.846746), \"city1\", 72));\n cities.add(new City(new Pair(40.519841, -8.085113), \"city2\", 81));\n cities.add(new City(new Pair(41.118700, -8.589700), \"city3\", 42));\n cities.add(new City(new Pair(41.467407, -8.964340), \"city4\", 64));\n cities.add(new City(new Pair(41.337408, -8.291943), \"city5\", 74));\n cities.add(new City(new Pair(41.314965, -8.423371), \"city6\", 80));\n cities.add(new City(new Pair(40.822244, -8.794953), \"city7\", 11));\n cities.add(new City(new Pair(40.781886, -8.697502), \"city8\", 7));\n cities.add(new City(new Pair(40.851360, -8.136585), \"city9\", 65));\n\n SocialNetwork otherSN = new SocialNetwork(users, cities);\n boolean result = sn10.equals(otherSN);\n assertTrue(result);\n }", "@Test\n public void testBoundsAsCompositesWithMultiInRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n Restriction in = newMultiIN(cfMetaData, 0, asList(value1, value2), asList(value2, value3));\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(in);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertComposite(bounds.get(1), value2, value3, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithEqAndInRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n Restriction eq = newSingleEq(cfMetaData, 0, value1);\n Restriction in = newSingleIN(cfMetaData, 1, value1, value2, value3);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(in);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.START);\n assertComposite(bounds.get(2), value1, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value1, EOC.END);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n assertComposite(bounds.get(2), value1, value3, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneDescendingClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n }", "Equality createEquality();", "@Test\n public void testIntersection6()\n {\n List<Integer> expected = new ArrayList<>();\n ConciseSet set1 = new ConciseSet();\n for (int i = 0; i < 5; i++) {\n set1.add(i);\n }\n for (int i = 1000; i < 1005; i++) {\n set1.add(i);\n }\n\n ConciseSet set2 = new ConciseSet();\n for (int i = 800; i < 805; i++) {\n set2.add(i);\n }\n for (int i = 806; i < 1005; i++) {\n set2.add(i);\n }\n\n for (int i = 1000; i < 1005; i++) {\n expected.add(i);\n }\n\n verifyIntersection(expected, set1, set2);\n }", "@Override\n public boolean equals(Object other) {\n if (this == other) return true; \n \n if (other instanceof Coord3) { // if other is a Coord3 type\n return x == ((Coord3) other).x && y == ((Coord3) other).y && z == ((Coord3) other).z;\n }\n return false;\n }", "protected abstract boolean equalityTest(Object key, Object key2);", "@Test\n \tpublic void whereClauseForNodeEdgeAnnotation() {\n \t\tnode23.addEdgeAnnotation(new Annotation(\"namespace1\", \"name1\"));\n \t\tnode23.addEdgeAnnotation(new Annotation(\"namespace2\", \"name2\", \"value2\", TextMatching.EXACT_EQUAL));\n \t\tnode23.addEdgeAnnotation(new Annotation(\"namespace3\", \"name3\", \"value3\", TextMatching.REGEXP_EQUAL));\n \t\tcheckWhereCondition(\n \t\t\t\tjoin(\"=\", \"_rank_annotation23_1.edge_annotation_namespace\", \"'namespace1'\"),\n \t\t\t\tjoin(\"=\", \"_rank_annotation23_1.edge_annotation_name\", \"'name1'\"),\n \t\t\t\tjoin(\"=\", \"_rank_annotation23_2.edge_annotation_namespace\", \"'namespace2'\"),\n \t\t\t\tjoin(\"=\", \"_rank_annotation23_2.edge_annotation_name\", \"'name2'\"),\n \t\t\t\tjoin(\"=\", \"_rank_annotation23_2.edge_annotation_value\", \"'value2'\"),\n \t\t\t\tjoin(\"=\", \"_rank_annotation23_3.edge_annotation_namespace\", \"'namespace3'\"),\n \t\t\t\tjoin(\"=\", \"_rank_annotation23_3.edge_annotation_name\", \"'name3'\"),\n \t\t\t\tjoin(\"~\", \"_rank_annotation23_3.edge_annotation_value\", \"'^value3$'\")\n \t\t);\n \t}", "private boolean _isSingleIndexedCriterion()\n {\n QueryDescriptor qd = getQueryDescriptor();\n List<Criterion> criterionList = qd.getConjunctionCriterion().getCriterionList();\n int indexedFieldCount = 0;\n for(Criterion criterion: criterionList)\n {\n AttributeCriterion attrCtr = (AttributeCriterion)criterion;\n AttributeDescriptor attrDesc = attrCtr.getAttribute();\n if(attrDesc.isIndexed())\n {\n indexedFieldCount++;\n if(indexedFieldCount > 1)\n return false;\n }\n }\n return (indexedFieldCount == 1);\n }", "public static void pseudoTrueTuples(LogicProblem logicProblem, boolean applyChanges)\r\n throws RelationshipConflictException {\n \r\n HashMap<ItemPair,Relationship> relationshipTable = logicProblem.getRelationshipTable();\r\n HashSet<CategoryPair> categoryPairs = logicProblem.getCategoryPairs();\r\n \r\n// System.out.println(\"searching...\");\r\n //within a subgrid\r\n for (CategoryPair categoryPair : categoryPairs) {\r\n// System.out.println(\"Category pair:\" + categoryPair);\r\n //vertical and horizontal search\r\n for (final boolean verticalOrientation : new boolean[] { false, true } ) {\r\n\r\n Category subrowCategory = verticalOrientation?categoryPair.first():categoryPair.last();\r\n Category subcolumnCategory = verticalOrientation?categoryPair.last():categoryPair.first();\r\n\r\n //commenting \"vertical search\" \r\n //(subrows match first category's items\r\n // subcolumns match second category's items)\r\n\r\n //i (2 to floor(n/2)) is the number of elements in the combination tuple\r\n // i=2 in pseudoTrue pairs\r\n //(for subgrids of 5x5 items, looking for both pairs and triplets becomes redundant\r\n for (int i=2; i<=floor(logicProblem.getNumCategories()/2);i++) {\r\n\r\n //https://github.com/dpaukov/combinatoricslib3/wiki/v3.3.0#1-simple-combinations\r\n List<List<Item>> columnCombinations = Generator.combination(subcolumnCategory.getItems())\r\n .simple(i) //for pseudo true pairs, i=2\r\n .stream()\r\n .collect(Collectors.<List<Item>>toList());\r\n //for i=2, this would contain \r\n //Bethany, Donovan\r\n //Bethany, Elizabeth\r\n //...\r\n //Frederick, Peyton\r\n// columnCombinations.stream().forEach(l -> System.out.println(\r\n// (verticalOrientation?\"vertical\":\"horizontal\")+ \" combo: \"+l.toString()));\r\n\r\n //create the sets\r\n //for each combination, start over\r\n \r\n //columnTuple contains i items with which we will compute set intersections\r\n for (List<Item> columnItemTuple : columnCombinations) {\r\n //Bethany, Donovan\r\n \r\n //similarly, valueNoSets contains i sets of VALUE_NO relationships\r\n List<Set<Item>> valueNoSets = new ArrayList<>(); //size=i\r\n //build a set for each i item of columnTuple\r\n for (Item columnItem : columnItemTuple) {\r\n //Bethany\r\n Set<Item> valueNoSet = new HashSet<>(); //size = n\r\n for (Item rowItem : subrowCategory.getItems()) {\r\n //Haley's Comet ....\r\n if (relationshipTable.get(new ItemPair(rowItem, columnItem)).getValue() == Relationship.ValueType.VALUE_NO)\r\n //stacking all VALUE_NO relationship into vertical set\r\n valueNoSet.add(rowItem); //store into single subcolumn set \r\n }\r\n //adding each vertical set into list of sets\r\n if (valueNoSet.size() >= logicProblem.getNumItems() - i //for pairs, we need three VALUE_NO in the set\r\n && valueNoSet.size() < logicProblem.getNumItems()-1) //uniqueness will take or n-1 cases\r\n valueNoSets.add(valueNoSet); //store single subcolumn into multi-set\r\n }\r\n //magic!\r\n Set<Item> intersectionSet = new HashSet<>(); //avoid NPE when the next call is made\r\n if (valueNoSets.size()>=2) //don't compute intersections otherwise\r\n intersectionSet = Processor.multiSetIntersection(valueNoSets);\r\n\r\n if (intersectionSet.size()==logicProblem.getNumItems()-i) {\r\n \r\n// System.out.println(\"----> found candidates for pseudo true pairs!\");\r\n// intersectionSet.stream().forEach(l -> System.out.println(\"\\t\" + l.toString()));\r\n// System.out.println(\"\\t\\tvs.\");\r\n// columnItemTuple.stream().forEach(l -> System.out.println(\"\\t\" + l.toString()));\r\n \r\n //create predecessor list\r\n //we can only add the intersection output as predecessors\r\n ArrayList<Dependable> predecessors = new ArrayList<Dependable>();\r\n for (Item intersectionColumn : intersectionSet) {\r\n for (Item rowItem : columnItemTuple) {\r\n predecessors.add(relationshipTable.get(new ItemPair(rowItem, intersectionColumn)));\r\n }\r\n }\r\n\r\n\r\n //we have a bunch of work to do\r\n for (Item everyRowItem : subrowCategory.getItems()) {\r\n //for every row item not in the intersectionSet\r\n if (!intersectionSet.contains(everyRowItem)) {\r\n for (Item everyColumnItem : subcolumnCategory.getItems()) {\r\n //for every column item not in any of the columnTuple list\r\n if (!columnItemTuple.contains(everyColumnItem)) {\r\n Relationship rel = relationshipTable.get(new ItemPair(everyRowItem,everyColumnItem));\r\n if (rel.getValue()!=Relationship.ValueType.VALUE_NO)\r\n Processor.setRelationship(logicProblem, applyChanges, rel, \r\n Relationship.ValueType.VALUE_NO, Relationship.LogicType.PSEUDOTRUE,\r\n predecessors.toArray(new Relationship[predecessors.size()])); \r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }", "@Test\n\tvoid attributeCardinality() {\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(CLINICAL_FINDING, DISORDER, BLEEDING, BLEEDING_SKIN, PENTALOGY_OF_FALLOT, PENTALOGY_OF_FALLOT_INCORRECT_GROUPING),\n\t\t\t\tstrings(selectConceptIds(\"<<\" + CLINICAL_FINDING + \":[0..*]\" + FINDING_SITE + \"=*\")));\n\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(CLINICAL_FINDING, DISORDER, BLEEDING, BLEEDING_SKIN, PENTALOGY_OF_FALLOT, PENTALOGY_OF_FALLOT_INCORRECT_GROUPING),\n\t\t\t\tstrings(selectConceptIds(\"<<\" + CLINICAL_FINDING + \":[0..2]\" + FINDING_SITE + \"=*\")));\n\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(BLEEDING_SKIN, PENTALOGY_OF_FALLOT, PENTALOGY_OF_FALLOT_INCORRECT_GROUPING),\n\t\t\t\tstrings(selectConceptIds(\"<<\" + CLINICAL_FINDING + \":[1..2]\" + FINDING_SITE + \"=*\")));\n\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(BLEEDING_SKIN),\n\t\t\t\tstrings(selectConceptIds(\"<<\" + CLINICAL_FINDING + \":[1..1]\" + FINDING_SITE + \"=*\")));\n\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(BLEEDING_SKIN, CLINICAL_FINDING, DISORDER, BLEEDING),\n\t\t\t\tstrings(selectConceptIds(\"<<\" + CLINICAL_FINDING + \":[0..1]\" + FINDING_SITE + \"=*\")));\n\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(CLINICAL_FINDING, DISORDER, BLEEDING),\n\t\t\t\tstrings(selectConceptIds(\"<<\" + CLINICAL_FINDING + \":[0..0]\" + FINDING_SITE + \"=*\")));\n\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(BLEEDING_SKIN, PENTALOGY_OF_FALLOT, PENTALOGY_OF_FALLOT_INCORRECT_GROUPING),\n\t\t\t\tstrings(selectConceptIds(\"<<\" + CLINICAL_FINDING + \":[1..2]\" + FINDING_SITE + \"= <<\" + BODY_STRUCTURE)));\n\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(BLEEDING_SKIN),\n\t\t\t\tstrings(selectConceptIds(\n\t\t\t\t\t\t\"<<\" + CLINICAL_FINDING + \":\" +\n\t\t\t\t\t\t\t\t\"[1..2]\" + FINDING_SITE + \"= <<\" + BODY_STRUCTURE + \",\" +\n\t\t\t\t\t\t\t\t\"[0..0]\" + ASSOCIATED_MORPHOLOGY + \"= <<\" + STENOSIS)));\n\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(BLEEDING_SKIN, PENTALOGY_OF_FALLOT, PENTALOGY_OF_FALLOT_INCORRECT_GROUPING),\n\t\t\t\tstrings(selectConceptIds(\n\t\t\t\t\t\t\"<<\" + CLINICAL_FINDING + \":\" +\n\t\t\t\t\t\t\t\t\"[1..2]\" + FINDING_SITE + \"= <<\" + BODY_STRUCTURE + \",\" +\n\t\t\t\t\t\t\t\t\"[0..1]\" + ASSOCIATED_MORPHOLOGY + \"= <<\" + STENOSIS)));\n\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(PENTALOGY_OF_FALLOT, PENTALOGY_OF_FALLOT_INCORRECT_GROUPING),\n\t\t\t\tstrings(selectConceptIds(\n\t\t\t\t\t\t\"<<\" + CLINICAL_FINDING + \":\" +\n\t\t\t\t\t\t\t\t\"[1..2]\" + FINDING_SITE + \"= <<\" + BODY_STRUCTURE + \",\" +\n\t\t\t\t\t\t\t\t\"[1..*]\" + ASSOCIATED_MORPHOLOGY + \"= <<\" + STENOSIS)));\n\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(PENTALOGY_OF_FALLOT_INCORRECT_GROUPING),\n\t\t\t\tstrings(selectConceptIds(\n\t\t\t\t\t\t\"<<\" + CLINICAL_FINDING + \":\" +\n\t\t\t\t\t\t\t\t\"{\" +\n\t\t\t\t\t\t\t\t\"[1..1]\" + FINDING_SITE + \" != <<\" + PULMONARY_VALVE_STRUCTURE + \",\" +\n\t\t\t\t\t\t\t\t\"[1..*]\" + ASSOCIATED_MORPHOLOGY + \"= <<\" + STENOSIS + \"\" +\n\t\t\t\t\t\t\t\t\"}\")));\n\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(PENTALOGY_OF_FALLOT, PENTALOGY_OF_FALLOT_INCORRECT_GROUPING),\n\t\t\t\tstrings(selectConceptIds(\n\t\t\t\t\t\t\"<<\" + CLINICAL_FINDING + \":\" +\n\t\t\t\t\t\t\t\t\"[0..0]\" + FINDING_SITE + \" != <<\" + BODY_STRUCTURE + \",\" +\n\t\t\t\t\t\t\t\t\"[1..*]\" + ASSOCIATED_MORPHOLOGY + \"= <<\" + STENOSIS)));\n\n\t}", "static boolean isClusterCandidate_(double x_1, double y1, double x2,\n\t\t\tdouble y2, double sqr_tolerance) {\n\t\tdouble dx = x_1 - x2;\n\t\tdouble dy = y1 - y2;\n\t\treturn dx * dx + dy * dy <= sqr_tolerance;\n\t}", "private final static boolean equivalent(Automaton automaton,\n\t\t\tBinaryMatrix equivs, Automaton.Set ic, Automaton.Set jc) {\n\t\tint ic_size = ic.size();\n\t\tint jc_size = jc.size();\n\n\t\t// NOTE: the size of two equivalent sets may differ at this stage. This\n\t\t// is because we may two states which are identical and which will\n\t\t// subsequently reduced to a state. Thus, the current size of a set may\n\t\t// not be its final size.\n\n\t\tint[] ic_children = ic.children;\n\t\tint[] jc_children = jc.children;\n\n\t\t// First, check every node in s1 has equivalent in s2\n\t\tfor (int k = 0; k != ic_size; ++k) {\n\t\t\tint ic_child = ic_children[k];\n\t\t\tboolean matched = false;\n\t\t\tfor (int l = 0; l != jc_size; ++l) {\n\t\t\t\tint jc_child = jc_children[l];\n\t\t\t\tif (ic_child == jc_child\n\t\t\t\t\t\t|| (ic_child >= 0 && jc_child >= 0 && equivs.get(\n\t\t\t\t\t\t\t\tic_child, jc_child))) {\n\t\t\t\t\tmatched = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!matched) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t// Second, check every node in s2 has equivalent in s1\n\t\tfor (int k = 0; k != jc_size; ++k) {\n\t\t\tint jc_child = jc_children[k];\n\t\t\tboolean matched = false;\n\t\t\tfor (int l = 0; l != ic_size; ++l) {\n\t\t\t\tint ic_child = ic_children[l];\n\t\t\t\tif (ic_child == jc_child\n\t\t\t\t\t\t|| (ic_child >= 0 && jc_child >= 0 && equivs.get(\n\t\t\t\t\t\t\t\tic_child, jc_child))) {\n\t\t\t\t\tmatched = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!matched) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public static void main(String[] args) {\n\n\t\tint n1, n2, n3;\n\t\tn1 = 41;\n\t\tn2 = 4;\n\t\tn3 = 421;\n\n\t\tif (n1 == n2 && n1 != n3) {\n\t\t\tSystem.out.println(\"n1 and n2 are equal.\");\n\t\t}\n\n\t\telse if (n2 == n3 && n2 != n1) {\n\t\t\tSystem.out.println(\"n2 and n3 are equal.\");\n\t\t}\n\n\t\telse if (n1 == n3 && n1 != n2) {\n\t\t\tSystem.out.println(\"n1 and n3 are equal.\");\n\t\t}\n\n\t\telse if (n1 == n2 && n1 == n3 && n2 == n3) {\n\t\t\tSystem.out.println(\"They are all equal.\");\n\t\t}\n\n\t\telse {\n\t\t\tSystem.out.println(\"None of them are equal.\");\n\t\t}\n\n\t\tSystem.out.println(\"=======================\");\n\t\t// 2nd solution. wrong solution.\n\n\t\tint n11 = 15;\n\t\tint n22 = 15;\n\t\tint n33 = 15;\n\n\t\tif (n11 == n22 && n11 == n33 && n22 == n33) {\n\t\t\tSystem.out.println(\"all equal.\");\n\t\t}\n\n\t\tif ((n11 == n22) & (n11 != n33)) {\n\t\t\tSystem.out.println(\"n11 and n22 are equal.\");\n\t\t}\n\n\t\tif (n22 == n33 & n22 != n11) {\n\t\t\tSystem.out.println(\"n22 and n33 are equal.\");\n\t\t}\n\n\t\tif (n11 == n33 & n11 != n22) {\n\t\t\tSystem.out.println(\"n11 and n33 are equal.\");\n\t\t}\n\n\t\telse {\n\t\t\tSystem.out.println(\"none of them are equal.\");\n\t\t}\n\t\tSystem.out.println(\"=======================\");\n\n\t\t// 3rd solution. nested if\n\n\t\tint A = 15;\n\t\tint B = 151;\n\t\tint C = 11;\n\n\t\tif (A == B && A == C && B == C) {\n\t\t\tSystem.out.println(\"all are equal.\");\n\t\t}\n\n\t\telse // if they are not all equal\n\t\t\tif (A == B) {\n\t\t\t\tSystem.out.println(\"A and B are equal.\");\n\t\t\t}\n\t\n\t\t\telse if (A == C) {\n\t\t\t\tSystem.out.println(\"A and C are equal.\");\n\t\t\t}\n\t\n\t\t\telse if (B == C) {\n\t\t\t\tSystem.out.println(\"B and C are equal.\");\n\t\t\t}\n\t\n\t\t\telse {\n\t\t\t\tSystem.out.println(\"none of them are equal.\");\n\t\t\t}\n\n\t\tSystem.out.println(\"=======================\");\n\n\t\tint grade = 101;\n\n\t\tif (grade >= 60 && grade <= 100) {\n\n\t\t\tif (grade >= 90 && grade <= 100) {\n\t\t\t\tSystem.out.println(\"grade is A\");\n\t\t\t}\n\n\t\t\telse if (grade >= 80 && grade < 90) {\n\t\t\t\tSystem.out.println(\"grade is B\");\n\t\t\t}\n\n\t\t\telse if (grade >= 70 && grade < 80) {\n\t\t\t\tSystem.out.println(\"grade is C\");\n\t\t\t}\n\n\t\t\telse {\n\t\t\t\tSystem.out.println(\"grade is D\");\n\t\t\t}\n\t\t} // closing curly brace of the first if statement. very important.\n\n\t\telse if (grade >= 0 && grade < 60) {\n\t\t\tSystem.out.println(\"Failed.\");\n\t\t}\n\n\t\telse {\n\t\t\tSystem.out.println(\"invalid entry\");\n\t\t}\n\n\t}", "private void checkNeqContradictions(HashMap<ComparableExpression, HashSet<ComparableExpression>> cNeq,\n HashMap<TimeSelector, Long> lowerBounds,\n HashMap<TimeSelector, Long> upperBounds)\n throws QueryContradictoryException {\n ArrayList<ArrayList<ComparableExpression>> neq = relationToTuples(cNeq);\n for (ArrayList<ComparableExpression> tuple : neq) {\n if (tuple.get(0) instanceof TimeSelector) {\n TimeSelector sel = (TimeSelector) tuple.get(0);\n // if lower(sel)!=upper(sel), no constraint sel!=x is contradictory\n if (!lowerBounds.get(sel).equals(upperBounds.get(sel))) {\n return;\n }\n // selector1 != selector2 only contradictory if both selectors have the same fixed value\n // (lower(selector1)=upper(selector1)=lower(selector2)=upper(selector2)\n if (tuple.get(1) instanceof TimeSelector) {\n TimeSelector sel2 = (TimeSelector) tuple.get(1);\n if (lowerBounds.get(sel).equals(lowerBounds.get(sel2)) &&\n lowerBounds.get(sel2).equals(upperBounds.get(sel2))) {\n throw new QueryContradictoryException();\n } // selector != literal only contradictory if lower(selector)=upper(selector)=literal\n } else if (tuple.get(1) instanceof TimeLiteral) {\n Long literalValue = ((TimeLiteral) tuple.get(1)).getMilliseconds();\n if (lowerBounds.get(sel).equals(literalValue)) {\n throw new QueryContradictoryException();\n }\n }\n } else if (tuple.get(0) instanceof TimeLiteral && tuple.get(1) instanceof TimeSelector) {\n // selector != literal only contradictory if lower(selector)=upper(selector)=literal\n TimeSelector sel = (TimeSelector) tuple.get(1);\n Long literalValue = ((TimeLiteral) tuple.get(0)).getMilliseconds();\n if (lowerBounds.get(sel).equals(upperBounds.get(sel)) && lowerBounds.get(sel).equals(literalValue)) {\n throw new QueryContradictoryException();\n }\n }\n }\n }", "@Test\n public void testMultipleLabelsWithAndOperatorCriteria() throws Exception {\n JobQueryCriteria<TitusTaskState, TitusJobType> query = queryBuilder.withLabels(\n expectedLabels().with(\"labelA\").with(\"labelB\").build()\n ).withLabelsAndOp(true).build();\n\n assertThat(JobQueryCriteriaEvaluator.matches(job, query)).isTrue();\n\n // One of the labels is missing\n JobQueryCriteria<TitusTaskState, TitusJobType> query2 = queryBuilder.withLabels(\n expectedLabels().with(\"labelB\").with(\"missing_label\").build()\n ).withLabelsAndOp(true).build();\n\n assertThat(JobQueryCriteriaEvaluator.matches(job, query2)).isFalse();\n }", "@Test\n public void testEquals04() {\n System.out.println(\"equals\");\n\n Set<City> cities = new HashSet<>();\n cities.add(new City(new Pair(41.243345, -8.674084), \"city0\", 28));\n cities.add(new City(new Pair(41.237364, -8.846746), \"city1\", 72));\n cities.add(new City(new Pair(40.519841, -8.085113), \"city2\", 81));\n cities.add(new City(new Pair(41.118700, -8.589700), \"city3\", 42));\n cities.add(new City(new Pair(41.467407, -8.964340), \"city4\", 64));\n cities.add(new City(new Pair(41.337408, -8.291943), \"city5\", 74));\n cities.add(new City(new Pair(41.314965, -8.423371), \"city6\", 80));\n cities.add(new City(new Pair(40.822244, -8.794953), \"city7\", 11));\n cities.add(new City(new Pair(40.781886, -8.697502), \"city8\", 7));\n cities.add(new City(new Pair(40.851360, -8.136585), \"city9\", 65));\n\n Object otherObject = new SocialNetwork(new HashSet(), cities);\n boolean result = sn10.equals(otherObject);\n assertFalse(result);\n }", "@Test\n public void testIntersection5()\n {\n final int[] ints1 = {33, 100000};\n final int[] ints2 = {34, 200000};\n List<Integer> expected = new ArrayList<>();\n\n ConciseSet set1 = new ConciseSet();\n for (int i : ints1) {\n set1.add(i);\n }\n ConciseSet set2 = new ConciseSet();\n for (int i : ints2) {\n set2.add(i);\n }\n\n verifyIntersection(expected, set1, set2);\n }", "Boolean subset(MultiSet<X> s);", "private static boolean fun3(List<String> res, List<String> ac1) {\n\t\tHashSet<String> hs=new HashSet<String>();\r\n\t\tfor(int i=0;i<res.size();i++){\r\n\t\t\ths.add(res.get(i));\r\n\t\t}\r\n\t\tfor(int i=0;i<ac1.size();i++){\r\n\t\t\tif(hs.contains(ac1.get(i)))\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public boolean equals( Combination other ) {\n if(this.one== other.one && this.two == other.two && this.three == other.three && other != null){\n return true;\n }\n else return false;\n }", "@Test\n public void testBoundsAsCompositesWithSliceRestrictionsAndOneDescendingClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newSingleSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newSingleSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n }", "private boolean checksetunions(Set<String> set, HashMap<String, ArrayList<String>> c) {\n\t\tObject[] ckeys = c.keySet().toArray();\r\n\t\tfor (int i = 0; i < c.keySet().size(); i++) {\r\n\t\t\tif (c.get(ckeys[i]).containsAll(set)) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "private ClusterCombination checkAndDoJoinMultiPearson(ClusterCombination CC1, ClusterCombination CC2) {\n boolean doJoin = true;\r\n ArrayList<Cluster> CCList = new ArrayList<>(CC1.getClusters().size()+1); //list of output clusters for new CC if join is succesfull\r\n\r\n ArrayList<Cluster> CC1Clusters = CC1.getClusters();\r\n ArrayList<Cluster> CC2Clusters = CC2.getClusters();\r\n\r\n ArrayList<Cluster> LHS1 = CC1.getLHS();\r\n ArrayList<Cluster> LHS2 = CC2.getLHS();\r\n\r\n ArrayList<Cluster> RHS1 = CC1.getRHS();\r\n ArrayList<Cluster> RHS2 = CC2.getRHS();\r\n\r\n for(int i =0; i<CC1Clusters.size()-1; i++) {\r\n Cluster C1 = CC1Clusters.get(i);\r\n Cluster C2 = CC2Clusters.get(i);\r\n\r\n boolean overlap = checkClusterOverlap(C1, C2); // check if there is some overlap\r\n\r\n\r\n\r\n if(!overlap){ //the cluster in this position does not overlap, we don't need to join\r\n doJoin=false;\r\n break;\r\n }else{ // there is overlap, add the intersection of C1 and C2\r\n if(C1.getNPoints() <= C2.getNPoints()){\r\n CCList.add(C1);\r\n }else{\r\n CCList.add(C2);\r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n\r\n if(doJoin){ // each cluster in the candidate (except the last) does overlap\r\n // so, according to apriori, we join -> return the overlapping clusters + the last clusters of CC1 and CC2\r\n Cluster lastCC1 = CC1Clusters.get(CC1Clusters.size()-1);\r\n Cluster lastCC2 = CC2Clusters.get(CC2Clusters.size()-1);\r\n if(lastCC1.getClusterId() <= lastCC2.getClusterId()){ // make sure to respect ordering of clusters within a candidate by ID. otherwise this could be designated as a duplicate\r\n CCList.add(lastCC1); CCList.add(lastCC2);\r\n }else{\r\n CCList.add(lastCC2); CCList.add(lastCC1);\r\n }\r\n\r\n ArrayList<Cluster> newLHS = new ArrayList<>();\r\n ArrayList<Cluster> newRHS = new ArrayList<>();\r\n for(int i = 0; i<LHS1.size(); i++){\r\n newLHS.add(CCList.get(i));\r\n }\r\n for(int i = LHS1.size(); i<CCList.size(); i++){\r\n newRHS.add(CCList.get(i));\r\n }\r\n\r\n ClusterCombination newCC = new MultiPearsonClusterCombination(newLHS, newRHS);\r\n newCC.checkAndSetMaxSubsetLowerBound(Math.max(CC1.getLB(), CC1.getMaxLowerBoundSubset()));\r\n newCC.checkAndSetMaxSubsetLowerBound(Math.max(CC2.getLB(), CC2.getMaxLowerBoundSubset()));\r\n\r\n return newCC;\r\n\r\n }else{\r\n return null;\r\n }\r\n }", "static boolean multiset_contains(Map m, Object o) {\n if (m == null) return false;\n for (Iterator i = m.values().iterator(); i.hasNext(); ) {\n Object p = i.next();\n if (p == o) return true;\n if (p instanceof Collection)\n if (((Collection) p).contains(o)) return true;\n }\n return false;\n }", "@Test\n \tpublic void whereClauseForNodeOverlap() {\n \t\tnode23.addJoin(new Overlap(node42));\n \t\tcheckWhereCondition(\n \t\t\t\tjoin(\"=\", \"_node23.text_ref\", \"_node42.text_ref\"),\n \t\t\t\tjoin(\"<=\", \"_node23.left\", \"_node42.right\"),\n \t\t\t\tjoin(\"<=\", \"_node42.left\", \"_node23.right\")\n \t\t);\n \t}", "boolean isSetMultiple();", "public boolean matchSameColumns(Key key);", "@Override\r\n public boolean isSatisfied(Configuration cfg) {\r\n Set<Node> firstNodes = new HashSet<Node>();\r\n Set<Node> secondNodes = new HashSet<Node>();\r\n if (getFirstSet().size() == 0 || getSecondSet().size() == 0) {\r\n //FIXME debug log VJob.logger.error(this.toString() + \": Some sets of virtual machines are empty\");\r\n return false;\r\n }\r\n\r\n for (VirtualMachine vm : getFirstSet()) {\r\n if (cfg.isRunning(vm)) {\r\n firstNodes.add(cfg.getLocation(vm));\r\n }\r\n }\r\n for (VirtualMachine vm : getSecondSet()) {\r\n if (cfg.isRunning(vm)) {\r\n secondNodes.add(cfg.getLocation(vm));\r\n }\r\n }\r\n\r\n for (Node n : firstNodes) {\r\n if (secondNodes.contains(n)) {\r\n \tManagedElementList<Node> ns = new SimpleManagedElementList<Node>();\r\n ns.addAll(firstNodes);\r\n ns.retainAll(secondNodes);\r\n //FIXME debug log VJob.logger.error(this.toString() + \": Nodes host VMs of the two groups: \" + ns);\r\n return false;\r\n }\r\n }\r\n for (Node n : secondNodes) {\r\n if (firstNodes.contains(n)) {\r\n \tManagedElementList<Node> ns = new SimpleManagedElementList<Node>();\r\n ns.addAll(secondNodes);\r\n ns.retainAll(firstNodes);\r\n //FIXME debug log VJob.logger.error(this.toString() + \": Nodes host VMs of the two groups: \" + ns);\r\n return false;\r\n }\r\n }\r\n return true;\r\n }", "public void sensibleMatches1() \n { \n Map<String, Set<String>> clientMap = new HashMap<>();\n Set<String> interests = new HashSet<>();\n\n interests.add(\"Food\");\n interests.add(\"Wine\");\n interests.add(\"Tandems\");\n clientMap.put(\"Hal\", interests);\n\t \n interests = new HashSet<>();\n interests.add(\"Food\");\n interests.add(\"Walking\");\n interests.add(\"Welding\");\n clientMap.put(\"Gemma\", interests);\n\t \n interests = new HashSet<>();\n interests.add(\"Food\");\n interests.add(\"Cinema\");\n interests.add(\"Wine\");\n clientMap.put(\"Caroline\", interests);\n\n Set<String> halsInterests = clientMap.get(\"Hal\");\n String outputString;\n Set<String> eachClientInterests;\n Set<String> intersection ;\n\n Map<String, Set<String>> mapWithoutHal = new HashMap<>(clientMap);\n mapWithoutHal.remove(\"Hal\");\n for (String eachClient : mapWithoutHal.keySet()) \n {\n eachClientInterests = clientMap.get(eachClient);\n intersection = new HashSet<>(halsInterests);\n intersection.retainAll(eachClientInterests);\n outputString = \"Hal and \" + eachClient \n + \" have common interests: \"\n + intersection;\n System.out.println(outputString);\n }\n }", "@Test\n public void testIntersection1()\n {\n final int[] ints1 = {33, 100000};\n final int[] ints2 = {33, 100000};\n List<Integer> expected = Arrays.asList(33, 100000);\n\n ConciseSet set1 = new ConciseSet();\n for (int i : ints1) {\n set1.add(i);\n }\n ConciseSet set2 = new ConciseSet();\n for (int i : ints2) {\n set2.add(i);\n }\n\n verifyIntersection(expected, set1, set2);\n }", "private boolean isSubset(List<ConceptLabel> outer, List<ConceptLabel> inner){\n\t\tfor(ConceptLabel in: inner){\n\t\t\tboolean c = false;\n\t\t\tfor(ConceptLabel l: outer){\n\t\t\t\tif(l.getText().equals(in.getText())){\n\t\t\t\t\tc = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(!c)\n\t\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "@Test\n public void testGetValues(){\n assertTrue(vector.x == 1 && vector.z == 1);\n }", "@Test\n public void testMultiCrossJoin3() throws Exception {\n String sql = \"SELECT * FROM g1 cross join (g2 cross join g3)\";\n Node fileNode = sequenceSql(sql, TSQL_QUERY);\n\n Node queryNode = verify(fileNode, Query.ID, Query.ID);\n\n Node selectNode = verify(queryNode, Query.SELECT_REF_NAME, Select.ID);\n verify(selectNode, Select.SYMBOLS_REF_NAME, MultipleElementSymbol.ID);\n\n Node fromNode = verify(queryNode, Query.FROM_REF_NAME, From.ID);\n\n Node jpNode1 = verify(fromNode, From.CLAUSES_REF_NAME, JoinPredicate.ID);\n verifyJoin(jpNode1, JoinTypeTypes.JOIN_CROSS);\n \n Node jpNode2 = verify(jpNode1, JoinPredicate.RIGHT_CLAUSE_REF_NAME, JoinPredicate.ID);\n verifyJoin(jpNode2, JoinTypeTypes.JOIN_CROSS);\n \n verifyUnaryFromClauseGroup(jpNode1, JoinPredicate.LEFT_CLAUSE_REF_NAME, \"g1\");\n\n verifyUnaryFromClauseGroup(jpNode2, JoinPredicate.LEFT_CLAUSE_REF_NAME, \"g2\");\n verifyUnaryFromClauseGroup(jpNode2, JoinPredicate.RIGHT_CLAUSE_REF_NAME, \"g3\");\n \n verifySql(\"SELECT * FROM g1 CROSS JOIN (g2 CROSS JOIN g3)\", fileNode);\n }", "private static Set<Item> multiSetIntersection(List<Set<Item>> setList) {\n Set<Item> interQrels = new HashSet<>(setList.get(0));\r\n \r\n for (int i = 1; i< setList.size();i++) {\r\n interQrels.retainAll(setList.get(i)); // intersection with two (and one)\r\n }\r\n\r\n return interQrels;\r\n }", "private boolean thirdPerson(Mention a, Mention b) {\n if (a.getPerson() == Person.THIRD\n && b.getPerson() == Person.THIRD\n && a.getMultiplicity() == b.getMultiplicity()\n && a.getGender() == b.getGender()) {\n addToCluster(a, b);\n return true;\n }\n\n return false;\n }", "@Test\n\t public void test_Is_Subset_Positive() throws Exception{\t\n\t\t SET setarray= new SET( new int[]{1,2,3,4,5});\n\t\t SET subsetarray= new SET( new int[]{1,2,3});\n\t\t assertTrue(setarray.isSubSet(subsetarray));\t \n\t }", "private boolean subGridCheck() {\n\t\tint sqRt = (int)Math.sqrt(dimension);\n\t\tfor(int i = 0; i < sqRt; i++) {\n\t\t\tint increment = i * sqRt;\n\t\t\tfor(int val = 1; val <= dimension; val++) {\n\t\t\t\tint valCounter = 0;\n\t\t\t\tfor(int row = 0 + increment; row < sqRt + increment; row++) {\n\t\t\t\t\tfor(int col = 0 + increment; col < sqRt + increment; col++) {\n\t\t\t\t\t\tif(puzzle[row][col] == val)\n\t\t\t\t\t\t\tvalCounter++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(valCounter >= 2)\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public boolean equals(Object o) {\n if (!super.equals(o)) return false;\n RealConjunctiveFeature c = (RealConjunctiveFeature) o;\n return (left == c.left || left.equals(c.left))\n && (right == c.right || right.equals(c.right));\n }", "private static boolean checkEqualsToOperations(String expression, Lexemes lexemes, SymbolTable table) {\n\t\tif (expression.contains(\"==\")) {\n\n\t\t\tString[] arr = expression.split(\"==\");\n\t\t\tint finalIndex = arr.length - 1;\n\n\t\t\tfor (int i = 0; i <= finalIndex; i++) {\n\t\t\t\tString s = arr[i];\n\n\t\t\t\t// check if the current word is a variable\n\t\t\t\tif (table.contains(s)) {\n\t\t\t\t\tint id = table.getIdOfVariable(s);\n\t\t\t\t\tlexemes.insertLexeme(\"ID\", ((Integer) id).toString());\n\t\t\t\t} else {\n\n\t\t\t\t\tif (s.equals(\"true\")) {\n\t\t\t\t\t\tlexemes.insertLexeme(\"CONST_BOOL\", \"true\");\n\t\t\t\t\t} else if (s.equals(\"false\")) {\n\t\t\t\t\t\tlexemes.insertLexeme(\"CONST_BOOL\", \"false\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (!checkRelationalOperations(s.trim(), lexemes, table)) return false;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (i < finalIndex) {\n\t\t\t\t\tlexemes.insertLexeme(\"RELOP\", \"==\");\n\t\t\t\t} else if (expression.endsWith(\"==\")) {\n\t\t\t\t\tlexemes.insertLexeme(\"RELOP\", \"==\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t} else {\n\t\t\tif (!checkRelationalOperations(expression.trim(), lexemes, table)) return false;\n\t\t}\n\n\t\treturn true;\n\t}", "private void assertEquivalentPair(Set<Pair> result, String s1, String s2) {\n\t\tPair resultPair = filterResult(result, s1, s2);\n\t\tassertFalse(resultPair.isMarked());\n\t}", "@Override\n public boolean equals(Object object) {\n if (!(object instanceof Predio_1)) {\n return false;\n }\n Predio_1 other = (Predio_1) object;\n if ((this.clavecatastral == null && other.clavecatastral != null) || (this.clavecatastral != null && !this.clavecatastral.equals(other.clavecatastral))) {\n return false;\n }\n return true;\n }", "@Test\n public void testQueryRepeats() {\n assertMetrics(\"absoluteProximity:0.1 proximity:1 head:0 tail:0\", \"a a a\",\"a\");\n assertMetrics(\"absoluteProximity:0.1 proximity:1 head:0 tail:0 gapLength:0\",\"a a b c c\",\"a a b c c\");\n assertMetrics(\"absoluteProximity:0.1 proximity:1 head:0 tail:0 gapLength:0\",\"a a b c c\",\"a b c\");\n assertMetrics(\"absoluteProximity:0.1 proximity:1 head:0 tail:0 gapLength:0\",\"a b a b\",\"a b a b\");\n assertMetrics(\"absoluteProximity:0.0903 proximity:0.9033 head:0 tail:0 gapLength:1\",\"a b a b\",\"a b x a b\");\n // Both terms take the same segment:\n assertMetrics(\"absoluteProximity:0.1 proximity:1 segments:2 gapLength:0 head:3 tail:18\",\"a a\",\"x x x a x x x x x x x x x x x x x x a x x x\");\n // But not when the second is preferable\n assertMetrics(\"absoluteProximity:0.1 proximity:1 segments:2 gapLength:0 head:3 tail:3\",\"a b b a\",\"x x x a b x x x x x x x x x x x x x x b a x x x\");\n\n assertMetrics(\"matches:2 fieldCompleteness:1\",\"a b b b\",\"a b\");\n }", "public void matchesDemo() \n {\n Map<String, Set<String>> clientMap = new HashMap<>();\n Set<String> interests = new HashSet<>();\n\n interests.add(\"Food\");\n interests.add(\"Wine\");\n interests.add(\"Tandems\");\n clientMap.put(\"Hal\", interests);\n\t \n interests = new HashSet<>();\n interests.add(\"Food\");\n interests.add(\"Walking\");\n interests.add(\"Welding\");\n clientMap.put(\"Gemma\", interests);\n\t \n interests = new HashSet<>();\n interests.add(\"Food\");\n interests.add(\"Cinema\");\n interests.add(\"Wine\");\n clientMap.put(\"Caroline\", interests);\n\n Set<String> halsInterests = clientMap.get(\"Hal\");\n String outputString;\n Set<String> eachClientInterests;\n Set<String> intersection;\n\n for (String eachClient : clientMap.keySet()) \n {\n eachClientInterests = clientMap.get(eachClient);\n intersection = new HashSet<>(halsInterests);\n intersection.retainAll(eachClientInterests);\n outputString = \"Hal and \" + eachClient \n + \" have common interests: \"\n + intersection;\n System.out.println(outputString) ;\n }\n }", "@Test\n \tpublic void whereClauseForNodeExactDominance() {\n \t\tnode23.addJoin(new Dominance(node42, 10));\n \t\tcheckWhereCondition(\n //\t\t\t\tjoin(\"=\", \"_rank23.component_ref\", \"_rank42.component_ref\"),\n \t\t\t\tjoin(\"=\", \"_component23.type\", \"'d'\"),\n \t\t\t\t\"_component23.name IS NULL\",\n \t\t\t\tjoin(\"<\", \"_rank23.pre\", \"_rank42.pre\"),\n \t\t\t\tjoin(\"<\", \"_rank42.pre\", \"_rank23.post\"),\n \t\t\t\tjoin(\"=\", \"_rank23.level\", \"_rank42.level\", -10)\n \t\t);\n \t}", "public void sensibleMatches2() \n { \n Map<String, Set<String>> clientMap = new HashMap<>();\n Set<String> interests = new HashSet<>();\n\n interests.add(\"Food\");\n interests.add(\"Wine\");\n interests.add(\"Tandems\");\n clientMap.put(\"Hal\", interests);\n\t \n interests = new HashSet<>();\n interests.add(\"Food\");\n interests.add(\"Walking\");\n interests.add(\"Welding\");\n clientMap.put(\"Gemma\", interests);\n\n interests = new HashSet<>();\n interests.add(\"Food\");\n interests.add(\"Cinema\");\n interests.add(\"Wine\");\n clientMap.put(\"Caroline\", interests);\n\n Set<String> halsInterests = clientMap.get(\"Hal\");\n String outputString;\n Set<String> eachClientInterests;\n Set<String> intersection ;\n\n for (String eachClient : clientMap.keySet()) \n {\n if (!eachClient.equals(\"Hal\")) \n {\n eachClientInterests = clientMap.get(eachClient);\n intersection = new HashSet<>(halsInterests);\n intersection.retainAll(eachClientInterests);\n outputString = \"Hal and \" + eachClient \n + \" have common interests: \"\n + intersection;\n System.out.println(outputString);\n }\n }\n }", "@Override\n public boolean isEqual(Query e1, Query e2) {\n //Devuelve siempre falso, en una lista no puede haber dos querys iguales\n return this.compare(e1,e2) == this.EQUAL;\n }", "public static void main(String[] args) {\n Pair first = new Pair(\"Pesho\", \"Gosho\");\r\n Pair second = new Pair(\"Pesho\", \"Gosho\");\r\n Pair third = new Pair(\"Pesho\", \"Mariika\");\r\n \r\n System.out.println(first.equals(second));\r\n System.out.println(first.equals(third));\r\n }", "public boolean subset(ZYSet<ElementType> potentialSubset){\n for(ElementType e:potentialSubset){\n if(!this.contains(e)){\n return false;\n }\n }\n return true;\n }", "public boolean isThreeOfAKind() {\n\t\treturn this.sameSet.size() == 1;\n\t}", "@Test\n public void testMixedJoin3() throws Exception {\n String sql = \"SELECT * FROM g1, g2 inner join g3 on g2.a=g3.a\";\n Node fileNode = sequenceSql(sql, TSQL_QUERY);\n\n Node queryNode = verify(fileNode, Query.ID, Query.ID);\n\n Node selectNode = verify(queryNode, Query.SELECT_REF_NAME, Select.ID);\n\n verify(selectNode, Select.SYMBOLS_REF_NAME, MultipleElementSymbol.ID);\n\n Node fromNode = verify(queryNode, Query.FROM_REF_NAME, From.ID);\n\n verifyUnaryFromClauseGroup(fromNode, From.CLAUSES_REF_NAME, 1, \"g1\");\n\n Node jpNode = verify(fromNode, From.CLAUSES_REF_NAME, 2, JoinPredicate.ID);\n verifyJoin(jpNode, JoinTypeTypes.JOIN_INNER);\n\n verifyUnaryFromClauseGroup(jpNode, JoinPredicate.LEFT_CLAUSE_REF_NAME, \"g2\");\n verifyUnaryFromClauseGroup(jpNode, JoinPredicate.RIGHT_CLAUSE_REF_NAME, \"g3\");\n\n Node criteriaNode = verify(jpNode, JoinPredicate.JOIN_CRITERIA_REF_NAME, CompareCriteria.ID);\n verifyProperty(criteriaNode, AbstractCompareCriteria.OPERATOR_PROP_NAME, CriteriaOperator.Operator.EQ.name());\n\n Node leftExpression = verify(criteriaNode, AbstractCompareCriteria.LEFT_EXPRESSION_REF_NAME, ElementSymbol.ID);\n verifyProperty(leftExpression, Symbol.NAME_PROP_NAME, \"g2.a\");\n\n Node rightExpression = verify(criteriaNode, CompareCriteria.RIGHT_EXPRESSION_REF_NAME, ElementSymbol.ID);\n verifyProperty(rightExpression, Symbol.NAME_PROP_NAME, \"g3.a\");\n \n verifySql(\"SELECT * FROM g1, g2 INNER JOIN g3 ON g2.a = g3.a\", fileNode);\n }", "@Override public boolean equals(Object o) {\n if (this == o) { return true; }\n if ( !(o instanceof Set) ) { return false; }\n Set that = (Set) o;\n return that.size() == inner.size() &&\n containsAll(that);\n }", "public static boolean opposites(Pair[] data){\n HashSet<Pair> hs = new HashSet<>(20, 0.9f);\n for(Pair p : data) {\n if(hs.contains(new Pair(p.b(), p.a())))\n return true;\n hs.add(p);\n }\n return false;\n }", "@Test\n public void testContainsAll_Contains() {\n\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>();\n instance.add(3);\n instance.add(2);\n instance.add(1);\n instance.add(4);\n\n Collection c = Arrays.asList(1, 2, 3);\n\n boolean expResult = true;\n boolean result = instance.containsAll(c);\n assertEquals(expResult, result);\n }", "@Test\n public void testMultiCrossJoin() throws Exception {\n String sql = \"SELECT * FROM (g1 cross join g2) cross join g3\";\n Node fileNode = sequenceSql(sql, TSQL_QUERY);\n Node queryNode = verify(fileNode, Query.ID, Query.ID);\n\n Node selectNode = verify(queryNode, Query.SELECT_REF_NAME, Select.ID);\n\n verify(selectNode, Select.SYMBOLS_REF_NAME, MultipleElementSymbol.ID);\n\n Node fromNode = verify(queryNode, Query.FROM_REF_NAME, From.ID);\n\n Node jpNode1 = verify(fromNode, From.CLAUSES_REF_NAME, JoinPredicate.ID);\n verifyJoin(jpNode1, JoinTypeTypes.JOIN_CROSS);\n\n Node jpNode2 = verify(jpNode1, JoinPredicate.LEFT_CLAUSE_REF_NAME, JoinPredicate.ID);\n verifyJoin(jpNode2, JoinTypeTypes.JOIN_CROSS);\n\n verifyUnaryFromClauseGroup(jpNode2, JoinPredicate.LEFT_CLAUSE_REF_NAME, \"g1\");\n verifyUnaryFromClauseGroup(jpNode2, JoinPredicate.RIGHT_CLAUSE_REF_NAME, \"g2\");\n verifyUnaryFromClauseGroup(jpNode1, JoinPredicate.RIGHT_CLAUSE_REF_NAME, \"g3\");\n \n verifySql(\"SELECT * FROM (g1 CROSS JOIN g2) CROSS JOIN g3\", fileNode);\n }", "boolean isOptionsConsistentIncludingAllRequired(Integer optionId1,\n Integer optionId2);", "public interface PairwiseSimilarity {\n public double getMinValue();\n public double getMaxValue();\n public SRResultList mostSimilar(MostSimilarCache matrices, TIntFloatMap vector, int maxResults, TIntSet validIds) throws IOException;\n public SRResultList mostSimilar(MostSimilarCache matrices, int wpId, int maxResults, TIntSet validIds) throws IOException;\n}", "boolean isCommutative();", "@Test\n public void testMultiCrossJoin2() throws Exception {\n String sql = \"SELECT * FROM (g1 cross join g2) cross join (g3 cross join g4)\";\n Node fileNode = sequenceSql(sql, TSQL_QUERY);\n\n Node queryNode = verify(fileNode, Query.ID, Query.ID);\n\n Node selectNode = verify(queryNode, Query.SELECT_REF_NAME, Select.ID);\n\n verify(selectNode, Select.SYMBOLS_REF_NAME, MultipleElementSymbol.ID);\n\n Node fromNode = verify(queryNode, Query.FROM_REF_NAME, From.ID);\n\n Node jpNode1 = verify(fromNode, From.CLAUSES_REF_NAME, JoinPredicate.ID);\n verifyJoin(jpNode1, JoinTypeTypes.JOIN_CROSS);\n\n Node jpNode2 = verify(jpNode1, JoinPredicate.LEFT_CLAUSE_REF_NAME, JoinPredicate.ID);\n verifyJoin(jpNode2, JoinTypeTypes.JOIN_CROSS);\n\n Node jpNode3 = verify(jpNode1, JoinPredicate.RIGHT_CLAUSE_REF_NAME, JoinPredicate.ID);\n verifyJoin(jpNode3, JoinTypeTypes.JOIN_CROSS);\n \n verifyUnaryFromClauseGroup(jpNode2, JoinPredicate.LEFT_CLAUSE_REF_NAME, \"g1\");\n verifyUnaryFromClauseGroup(jpNode2, JoinPredicate.RIGHT_CLAUSE_REF_NAME, \"g2\");\n\n verifyUnaryFromClauseGroup(jpNode3, JoinPredicate.LEFT_CLAUSE_REF_NAME, \"g3\");\n verifyUnaryFromClauseGroup(jpNode3, JoinPredicate.RIGHT_CLAUSE_REF_NAME, \"g4\");\n \n verifySql(\"SELECT * FROM (g1 CROSS JOIN g2) CROSS JOIN (g3 CROSS JOIN g4)\", fileNode);\n }", "public boolean applyCommonGroupingRule() {\n\t \n\t if(isApplicableSameGroupingRule() == false) {\n\t \tSystem.out.println(\"ERROR: Failure to apply Same Grouping Rewriting Rule\");\n\t \treturn false;\n\t }\n\t \n\t this.rset = new HashMap<Integer, Query>();\n\t this.rtype = RType.SAME_GROUPING_RULE;\n\t this.rqId = 1;\n\n\t Grouping gPart = this.qset.entrySet().iterator().next().getValue().getQueryTriple()._1();\n\t \n\t Measuring mPart = new Measuring();\n\t Operation opPart = new Operation();\n\t for(Map.Entry<Integer, Query> entry2 : this.qset.entrySet()){\n\t\t\tmPart.addMeasuring(entry2.getValue().getQueryTriple()._2());\n\t\t opPart.addOperation(entry2.getValue().getQueryTriple()._3());\n\t }\n\t Tuple3<Grouping, Measuring, Operation> query = new Tuple3<>(gPart, mPart, opPart);\n\t \n\t rset.put(rqId, new Query(query));\n\t return true;\n\t}", "private boolean canJoinTuples() {\n if (predicate == null)\n return true;\n\n environment.clear();\n environment.addTuple(leftSchema, leftTuple);\n environment.addTuple(rightSchema, rightTuple);\n\n return predicate.evaluatePredicate(environment);\n }" ]
[ "0.6421651", "0.6329286", "0.6289435", "0.62639934", "0.6236681", "0.60520816", "0.5971452", "0.5939146", "0.58936757", "0.58523923", "0.5644424", "0.55787545", "0.55666435", "0.55643356", "0.5472871", "0.540083", "0.52998215", "0.5282358", "0.52783614", "0.5252247", "0.52468604", "0.5240255", "0.5234107", "0.5230295", "0.52042085", "0.51938784", "0.51534843", "0.51427215", "0.5139745", "0.5121065", "0.5100425", "0.5098734", "0.50824785", "0.5062693", "0.50550205", "0.5036045", "0.5027539", "0.50236547", "0.5018968", "0.50107837", "0.50054526", "0.49984154", "0.49973264", "0.49742022", "0.4972463", "0.49637347", "0.49498832", "0.49456662", "0.49394646", "0.49337", "0.49293873", "0.4896516", "0.48882276", "0.48864672", "0.48863077", "0.48578653", "0.4853951", "0.48388797", "0.4830042", "0.48149335", "0.48052192", "0.48041323", "0.4799549", "0.47988525", "0.4797824", "0.47861424", "0.47830245", "0.47810665", "0.47802433", "0.47769833", "0.47750622", "0.4773585", "0.47732586", "0.47689942", "0.4765529", "0.47638118", "0.4760966", "0.4759214", "0.47547537", "0.47502238", "0.47498178", "0.4746145", "0.4742258", "0.473606", "0.47352806", "0.47328785", "0.47307113", "0.47217712", "0.4717996", "0.4714531", "0.47114253", "0.47107443", "0.4709218", "0.47032207", "0.46967348", "0.46921474", "0.46883538", "0.4687942", "0.46835652", "0.4680795" ]
0.6591334
0
Test clustering_0 = 1 AND (clustering_1, clustering_2) IN ((2, 3), (4, 5))
@Test public void testBoundsAsCompositesWithSingleEqAndMultiINRestrictions() { CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC, Sort.ASC); ByteBuffer value1 = ByteBufferUtil.bytes(1); ByteBuffer value2 = ByteBufferUtil.bytes(2); ByteBuffer value3 = ByteBufferUtil.bytes(3); ByteBuffer value4 = ByteBufferUtil.bytes(4); ByteBuffer value5 = ByteBufferUtil.bytes(5); // clustering_0 = 1 AND (clustering_1, clustering_2) IN ((2, 3), (4, 5)) Restriction singleEq = newSingleEq(cfMetaData, 0, value1); Restriction multiIN = newMultiIN(cfMetaData, 1, asList(value2, value3), asList(value4, value5)); PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(singleEq).mergeWith(multiIN); List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(2, bounds.size()); assertComposite(bounds.get(0), value1, value2, value3, EOC.START); assertComposite(bounds.get(1), value1, value4, value5, EOC.START); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(2, bounds.size()); assertComposite(bounds.get(0), value1, value2, value3, EOC.END); assertComposite(bounds.get(1), value1, value4, value5, EOC.END); // clustering_0 = 1 AND (clustering_1, clustering_2) IN ((2, 3)) singleEq = newSingleEq(cfMetaData, 0, value1); multiIN = newMultiIN(cfMetaData, 1, asList(value2, value3)); restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(multiIN).mergeWith(singleEq); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value1, value2, value3, EOC.START); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value1, value2, value3, EOC.END); // clustering_0 = 1 AND clustering_1 = 5 AND (clustering_2, clustering_3) IN ((2, 3), (4, 5)) singleEq = newSingleEq(cfMetaData, 0, value1); Restriction singleEq2 = newSingleEq(cfMetaData, 1, value5); multiIN = newMultiIN(cfMetaData, 2, asList(value2, value3), asList(value4, value5)); restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(singleEq).mergeWith(multiIN).mergeWith(singleEq2); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(2, bounds.size()); assertComposite(bounds.get(0), value1, value5, value2, value3, EOC.START); assertComposite(bounds.get(1), value1, value5, value4, value5, EOC.START); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(2, bounds.size()); assertComposite(bounds.get(0), value1, value5, value2, value3, EOC.END); assertComposite(bounds.get(1), value1, value5, value4, value5, EOC.END); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithTwoAscendingAndTwoDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.DESC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertEmptyComposite(bounds.get(1));\n\n // clustering_0 = 1 AND (clustering_1, clustering_2, clustering_3) > (2, 3, 4)\n Restriction eq = newSingleEq(cfMetaData, 0, value1);\n slice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n restrictions = restrictions.mergeWith(eq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2, clustering_3) > (2, 3, 4)\n Restriction in = newSingleIN(cfMetaData, 0, value1, value2);\n slice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n restrictions = restrictions.mergeWith(in);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n assertComposite(bounds.get(2), value2, value2, EOC.START);\n assertComposite(bounds.get(3), value2, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n assertComposite(bounds.get(2), value2, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(3), value2, EOC.END);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1, clustering_2, clustering_3) <= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) < (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4) AND (clustering_0, clustering_1) < (2, 3)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2, value3);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(1), value2, value3, EOC.START);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4) AND (clustering_0, clustering1, clustering_2, clustering_3) <= (4, 3, 2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value4, value3, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n assertComposite(bounds.get(2), value4, value3, value2, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(1), value4, value3, EOC.START);\n assertComposite(bounds.get(2), value4, value3, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsMixingAscendingDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.DESC, Sort.ASC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(3));\n\n // clustering_0 = 1 AND (clustering_1, clustering_2, clustering_3) > (2, 3, 4)\n Restriction eq = newSingleEq(cfMetaData, 0, value1);\n slice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n restrictions = restrictions.mergeWith(eq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(3));\n\n\n // (clustering_0, clustering1, clustering_2, clustering_3) <= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, value4, EOC.NONE);\n assertComposite(bounds.get(3), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) < (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(3), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4) AND (clustering_0, clustering_1) < (2, 3)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2, value3);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(5, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n assertComposite(bounds.get(4), value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(5, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertComposite(bounds.get(3), value2, EOC.START);\n assertComposite(bounds.get(4), value2, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4) AND (clustering_0, clustering1, clustering_2, clustering_3) <= (4, 3, 2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value4, value3, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(7, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n assertComposite(bounds.get(4), value4, value3, EOC.START);\n assertComposite(bounds.get(5), value4, value3, value2, value1, EOC.NONE);\n assertComposite(bounds.get(6), value4, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(7, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertComposite(bounds.get(3), value4, EOC.START);\n assertComposite(bounds.get(4), value4, value3, value2, EOC.START);\n assertComposite(bounds.get(5), value4, value3, value2, EOC.END);\n assertComposite(bounds.get(6), value4, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithSingleEqAndMultiEqRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) = (2, 3)\n Restriction singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction multiEq = newMultiEq(cfMetaData, 1, value2, value3);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiEq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n // clustering_0 = 1 AND clustering_1 = 2 AND (clustering_2, clustering_3) = (3, 4)\n singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction singleEq2 = newSingleEq(cfMetaData, 1, value2);\n multiEq = newMultiEq(cfMetaData, 2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(singleEq2).mergeWith(multiEq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n\n // (clustering_0, clustering_1) = (1, 2) AND clustering_2 = 3\n singleEq = newSingleEq(cfMetaData, 2, value3);\n multiEq = newMultiEq(cfMetaData, 0, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiEq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) = (2, 3) AND clustering_3 = 4\n singleEq = newSingleEq(cfMetaData, 0, value1);\n singleEq2 = newSingleEq(cfMetaData, 3, value4);\n multiEq = newMultiEq(cfMetaData, 1, value2, value3);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiEq).mergeWith(singleEq2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithTwoClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithOneEqRestrictionsAndTwoClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer clustering_0 = ByteBufferUtil.bytes(1);\n Restriction eq = newSingleEq(cfMetaData, 0, clustering_0);\n\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneAscendingAndOneDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n assertComposite(bounds.get(2), value2, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertComposite(bounds.get(1), value2, EOC.START);\n assertComposite(bounds.get(2), value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneDescendingAndOneAscendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0) > (1) AND (clustering_0, clustering1) < (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.END);\n assertComposite(bounds.get(2), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.END);\n assertComposite(bounds.get(1), value1, EOC.START);\n assertComposite(bounds.get(2), value1, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithSingleEqAndSliceRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n ByteBuffer value5 = ByteBufferUtil.bytes(5);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) > (2, 3)\n Restriction singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction multiSlice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiSlice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) > (2, 3) AND (clustering_1) < (4)\n singleEq = newSingleEq(cfMetaData, 0, value1);\n multiSlice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3);\n Restriction multiSlice2 = newMultiSlice(cfMetaData, 1, Bound.END, false, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiSlice2).mergeWith(singleEq).mergeWith(multiSlice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value4, EOC.START);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) => (2, 3) AND (clustering_1, clustering_2) <= (4, 5)\n singleEq = newSingleEq(cfMetaData, 0, value1);\n multiSlice = newMultiSlice(cfMetaData, 1, Bound.START, true, value2, value3);\n multiSlice2 = newMultiSlice(cfMetaData, 1, Bound.END, true, value4, value5);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiSlice2).mergeWith(singleEq).mergeWith(multiSlice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value4, value5, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiEqAndSingleSliceRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n\n // (clustering_0, clustering_1) = (1, 2) AND clustering_2 > 3\n Restriction multiEq = newMultiEq(cfMetaData, 0, value1, value2);\n Restriction singleSlice = newSingleSlice(cfMetaData, 2, Bound.START, false, value3);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiEq).mergeWith(singleSlice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithTwoDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithOneEqRestrictionsAndOneClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC);\n\n ByteBuffer clustering_0 = ByteBufferUtil.bytes(1);\n Restriction eq = newSingleEq(cfMetaData, 0, clustering_0);\n\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.END);\n }", "@Test\n public void should_iterate_with_partition_keys_and_partition_keys_IN() throws Exception {\n //Given\n long partitionKey = RandomUtils.nextLong(0,Long.MAX_VALUE);\n\n insertCompositeClusteredValues(partitionKey,\"bucket1\",1,\"name1\",1);\n insertCompositeClusteredValues(partitionKey,\"bucket2\",1,\"name2\",1);\n insertCompositeClusteredValues(partitionKey,\"bucket3\",1,\"name3\",1);\n\n //When\n final Iterator<CompositeClusteredEntity> iterator = manager.sliceQuery(CompositeClusteredEntity.class)\n .forIteration()\n .withPartitionComponents(partitionKey)\n .andPartitionComponentsIN(\"bucket1\", \"bucket3\")\n .iterator();\n\n //Then\n assertThat(iterator.hasNext()).isTrue();\n CompositeClusteredEntity next = iterator.next();\n assertThat(next.getId().getId()).isEqualTo(partitionKey);\n assertThat(next.getId().getBucket()).isEqualTo(\"bucket1\");\n assertThat(next.getId().getName()).isEqualTo(\"name11\");\n assertThat(next.getValue()).isEqualTo(\"value11\");\n\n assertThat(iterator.hasNext()).isTrue();\n next = iterator.next();\n assertThat(next.getId().getId()).isEqualTo(partitionKey);\n assertThat(next.getId().getBucket()).isEqualTo(\"bucket3\");\n assertThat(next.getId().getName()).isEqualTo(\"name31\");\n assertThat(next.getValue()).isEqualTo(\"value11\");\n }", "@Test\n public void testBoundsAsCompositesWithOneInRestrictionsAndOneClusteringColumn()\n {\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n Restriction in = newSingleIN(cfMetaData, 0, value1, value2, value3);\n\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(in);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.START);\n assertComposite(bounds.get(2), value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n assertComposite(bounds.get(1), value2, EOC.END);\n assertComposite(bounds.get(2), value3, EOC.END);\n }", "@Test\n public void testIntersection6()\n {\n List<Integer> expected = new ArrayList<>();\n ConciseSet set1 = new ConciseSet();\n for (int i = 0; i < 5; i++) {\n set1.add(i);\n }\n for (int i = 1000; i < 1005; i++) {\n set1.add(i);\n }\n\n ConciseSet set2 = new ConciseSet();\n for (int i = 800; i < 805; i++) {\n set2.add(i);\n }\n for (int i = 806; i < 1005; i++) {\n set2.add(i);\n }\n\n for (int i = 1000; i < 1005; i++) {\n expected.add(i);\n }\n\n verifyIntersection(expected, set1, set2);\n }", "public boolean isEqualTo(Cluster c)\n {\n int len = this.size();\n if (len != c.size()){\n return false;\n }\n if (len == 0){\n return true;\n }\n if (this.getLeader() != c.getLeader()){\n return false;\n }\n for (Integer n : this._elems){\n if (!c.contains(n)){\n return false;\n }\n }\n return true;\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n }", "@Test\n public void testIntersection5()\n {\n final int[] ints1 = {33, 100000};\n final int[] ints2 = {34, 200000};\n List<Integer> expected = new ArrayList<>();\n\n ConciseSet set1 = new ConciseSet();\n for (int i : ints1) {\n set1.add(i);\n }\n ConciseSet set2 = new ConciseSet();\n for (int i : ints2) {\n set2.add(i);\n }\n\n verifyIntersection(expected, set1, set2);\n }", "public interface IStoppingCriteria {\n\n /**\n * Determine the degree of clustering agreement\n * @param cluster1 one clustering results\n * @param cluster2 the other clustering results\n * @return the degree of clustering agreement; 1 refers to be the same clustering results; 0 refers to be the totally different clustering results\n */\n public double computeSimilarity(int[] cluster1, int[] cluster2);\n\n}", "private boolean isSubsetOf(List<String> permissions2,\n\t\t\tList<String> permissions3) {\n\t\treturn false;\n\t}", "@Test\n public void testIntersection3()\n {\n List<Integer> expected = new ArrayList<>();\n ConciseSet set1 = new ConciseSet();\n ConciseSet set2 = new ConciseSet();\n for (int i = 0; i < 1000; i++) {\n set1.add(i);\n set2.add(i);\n expected.add(i);\n }\n\n verifyIntersection(expected, set1, set2);\n }", "@Test\n public void testIntersection4()\n {\n List<Integer> expected = new ArrayList<>();\n ConciseSet set1 = new ConciseSet();\n ConciseSet set2 = new ConciseSet();\n for (int i = 0; i < 1000; i++) {\n set1.add(i);\n if (i != 500) {\n set2.add(i);\n expected.add(i);\n }\n }\n\n verifyIntersection(expected, set1, set2);\n }", "@Test\n public void testBoundsAsCompositesWithSliceRestrictionsAndOneClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newSingleSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newSingleSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiInRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n Restriction in = newMultiIN(cfMetaData, 0, asList(value1, value2), asList(value2, value3));\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(in);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertComposite(bounds.get(1), value2, value3, EOC.END);\n }", "private ClusterCombination checkAndDoJoinMultiPearson(ClusterCombination CC1, ClusterCombination CC2) {\n boolean doJoin = true;\r\n ArrayList<Cluster> CCList = new ArrayList<>(CC1.getClusters().size()+1); //list of output clusters for new CC if join is succesfull\r\n\r\n ArrayList<Cluster> CC1Clusters = CC1.getClusters();\r\n ArrayList<Cluster> CC2Clusters = CC2.getClusters();\r\n\r\n ArrayList<Cluster> LHS1 = CC1.getLHS();\r\n ArrayList<Cluster> LHS2 = CC2.getLHS();\r\n\r\n ArrayList<Cluster> RHS1 = CC1.getRHS();\r\n ArrayList<Cluster> RHS2 = CC2.getRHS();\r\n\r\n for(int i =0; i<CC1Clusters.size()-1; i++) {\r\n Cluster C1 = CC1Clusters.get(i);\r\n Cluster C2 = CC2Clusters.get(i);\r\n\r\n boolean overlap = checkClusterOverlap(C1, C2); // check if there is some overlap\r\n\r\n\r\n\r\n if(!overlap){ //the cluster in this position does not overlap, we don't need to join\r\n doJoin=false;\r\n break;\r\n }else{ // there is overlap, add the intersection of C1 and C2\r\n if(C1.getNPoints() <= C2.getNPoints()){\r\n CCList.add(C1);\r\n }else{\r\n CCList.add(C2);\r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n\r\n if(doJoin){ // each cluster in the candidate (except the last) does overlap\r\n // so, according to apriori, we join -> return the overlapping clusters + the last clusters of CC1 and CC2\r\n Cluster lastCC1 = CC1Clusters.get(CC1Clusters.size()-1);\r\n Cluster lastCC2 = CC2Clusters.get(CC2Clusters.size()-1);\r\n if(lastCC1.getClusterId() <= lastCC2.getClusterId()){ // make sure to respect ordering of clusters within a candidate by ID. otherwise this could be designated as a duplicate\r\n CCList.add(lastCC1); CCList.add(lastCC2);\r\n }else{\r\n CCList.add(lastCC2); CCList.add(lastCC1);\r\n }\r\n\r\n ArrayList<Cluster> newLHS = new ArrayList<>();\r\n ArrayList<Cluster> newRHS = new ArrayList<>();\r\n for(int i = 0; i<LHS1.size(); i++){\r\n newLHS.add(CCList.get(i));\r\n }\r\n for(int i = LHS1.size(); i<CCList.size(); i++){\r\n newRHS.add(CCList.get(i));\r\n }\r\n\r\n ClusterCombination newCC = new MultiPearsonClusterCombination(newLHS, newRHS);\r\n newCC.checkAndSetMaxSubsetLowerBound(Math.max(CC1.getLB(), CC1.getMaxLowerBoundSubset()));\r\n newCC.checkAndSetMaxSubsetLowerBound(Math.max(CC2.getLB(), CC2.getMaxLowerBoundSubset()));\r\n\r\n return newCC;\r\n\r\n }else{\r\n return null;\r\n }\r\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneDescendingClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n }", "Condition in(QueryParameter parameter, Object... values);", "@Test\n public void testBoundsAsCompositesWithMultiEqRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n Restriction eq = newMultiEq(cfMetaData, 0, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n }", "boolean hasCluster();", "@Test\r\n\t\tpublic void testIntersection() {\n\t\t\ttestingSet = new IntegerSet(list1);\r\n\t\t\ttestingSet2= new IntegerSet(list2);\r\n\t\t\t// create 3rdset = to the intersection list \r\n\t\t\ttestingSet3= new IntegerSet(intersection);\r\n\t\t\t// create 4th set =to the intersection of set1 and set2\r\n\t\t\ttestingSet4= testingSet.intersection(testingSet, testingSet2);\r\n\t\t\t// sets 3 and set 4 should be equal \r\n\t\t\t// assertEquals for these parameters is a deprecated method \r\n\t\t\tassertArrayEquals(testingSet3.toArray(),testingSet4.toArray());\t \r\n\t\t}", "@Test\n public void testContainsAll_Contains() {\n\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>();\n instance.add(3);\n instance.add(2);\n instance.add(1);\n instance.add(4);\n\n Collection c = Arrays.asList(1, 2, 3);\n\n boolean expResult = true;\n boolean result = instance.containsAll(c);\n assertEquals(expResult, result);\n }", "@Test\n public void testIntersection1()\n {\n final int[] ints1 = {33, 100000};\n final int[] ints2 = {33, 100000};\n List<Integer> expected = Arrays.asList(33, 100000);\n\n ConciseSet set1 = new ConciseSet();\n for (int i : ints1) {\n set1.add(i);\n }\n ConciseSet set2 = new ConciseSet();\n for (int i : ints2) {\n set2.add(i);\n }\n\n verifyIntersection(expected, set1, set2);\n }", "@Test\n \tpublic void whereClauseForNodeEdgeAnnotation() {\n \t\tnode23.addEdgeAnnotation(new Annotation(\"namespace1\", \"name1\"));\n \t\tnode23.addEdgeAnnotation(new Annotation(\"namespace2\", \"name2\", \"value2\", TextMatching.EXACT_EQUAL));\n \t\tnode23.addEdgeAnnotation(new Annotation(\"namespace3\", \"name3\", \"value3\", TextMatching.REGEXP_EQUAL));\n \t\tcheckWhereCondition(\n \t\t\t\tjoin(\"=\", \"_rank_annotation23_1.edge_annotation_namespace\", \"'namespace1'\"),\n \t\t\t\tjoin(\"=\", \"_rank_annotation23_1.edge_annotation_name\", \"'name1'\"),\n \t\t\t\tjoin(\"=\", \"_rank_annotation23_2.edge_annotation_namespace\", \"'namespace2'\"),\n \t\t\t\tjoin(\"=\", \"_rank_annotation23_2.edge_annotation_name\", \"'name2'\"),\n \t\t\t\tjoin(\"=\", \"_rank_annotation23_2.edge_annotation_value\", \"'value2'\"),\n \t\t\t\tjoin(\"=\", \"_rank_annotation23_3.edge_annotation_namespace\", \"'namespace3'\"),\n \t\t\t\tjoin(\"=\", \"_rank_annotation23_3.edge_annotation_name\", \"'name3'\"),\n \t\t\t\tjoin(\"~\", \"_rank_annotation23_3.edge_annotation_value\", \"'^value3$'\")\n \t\t);\n \t}", "private boolean isSubsetOf(int firstRow, int secondRow) {\n for (int i = 0; i < universalSetSize; i++) {\n if (input[firstRow][i] && !input[secondRow][i]) {\n return false;\n }\n }\n return true;\n }", "private static Restriction newMultiEq(CFMetaData cfMetaData, int firstIndex, ByteBuffer... values)\n {\n List<ColumnDefinition> columnDefinitions = new ArrayList<>();\n for (int i = 0; i < values.length; i++)\n {\n columnDefinitions.add(getClusteringColumnDefinition(cfMetaData, firstIndex + i));\n }\n return new MultiColumnRestriction.EQ(columnDefinitions, toMultiItemTerminal(values));\n }", "@Test\r\n public void testIsSubset1() {\r\n Assert.assertEquals(false, set1.isSubset(set2));\r\n }", "@Test\n public void testBoundsAsCompositesWithSliceRestrictionsAndOneDescendingClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newSingleSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newSingleSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n }", "@Test\n public void testHeterogeneousSegmentFilterConditionLimit() throws SqlParseException {\n\n val project = \"heterogeneous_segment\";\n // val dfId = \"747f864b-9721-4b97-acde-0aa8e8656cba\"\n // val seg1Id = \"8892fa3f-f607-4eec-8159-7c5ae2f16942\"\n // val seg2Id = \"d75a822c-788a-4592-a500-cf20186dded1\"\n // val seg3Id = \"54eaf96d-6146-45d2-b94e-d5d187f89919\"\n // val seg4Id = \"411f40b9-a80a-4453-90a9-409aac6f7632\"\n // val seg5Id = \"a8318597-cb75-416f-8eb8-96ea285dd2b4\"\n // \n val sql = \"with T1 as (select cal_dt, trans_id \\n\" + \"from test_kylin_fact inner join test_account \\n\"\n + \"on test_kylin_fact.seller_id = test_account.account_id \\n\"\n + \"where cal_dt between date'2012-01-01' and date'2012-01-03'\\n\" + \"group by cal_dt, trans_id)\\n\";\n\n {\n val sqlWithTooManyOrs = sql + \" select * from T1 where \" + \"(cal_dt='2012-01-01' and trans_id = 1) or \\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 2) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 3) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 4) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 5) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 6) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 7) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 8) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 9) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 10) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 12) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 13) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 14) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 15) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 16) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 17) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 18) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 19) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 20)\";\n val contexts = OlapContextTestUtil.getOlapContexts(project, sqlWithTooManyOrs);\n Assert.assertEquals(\n \">=(DEFAULT.TEST_KYLIN_FACT.CAL_DT, 2012-01-01),<=(DEFAULT.TEST_KYLIN_FACT.CAL_DT, 2012-01-03)\",\n contexts.get(0).getExpandedFilterConditions().stream().map(RexNode::toString)\n .collect(Collectors.joining(\",\")));\n }\n\n {\n val sqlWithFilter = sql + \" select * from T1 where \" + \"(cal_dt='2012-01-01' and trans_id = 1) or \\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 2) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 3) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 4) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 5) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 6) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 7) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 8) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 9) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 10)\";\n val contexts = OlapContextTestUtil.getOlapContexts(project, sqlWithFilter);\n Assert.assertNotEquals(\n \">=(DEFAULT.TEST_KYLIN_FACT.CAL_DT, 2012-01-01),<=(DEFAULT.TEST_KYLIN_FACT.CAL_DT, 2012-01-03)\",\n contexts.get(0).getExpandedFilterConditions().stream().map(RexNode::toString)\n .collect(Collectors.joining(\",\")));\n }\n\n }", "@Test\n public void testBatchedInQuery() {\n TestDataCreator creator = new TestDataCreator(getSessionFactory());\n Town town = creator.createTestTown();\n\n int n = 10;\n List<Long> ids = new ArrayList<>(n);\n for (long i=0; i < n; i++) {\n Person savedPerson = creator.createTestPerson(town, \"P\" + i);\n ids.add(savedPerson.getId());\n }\n for (long i=0; i < n; i++) {\n creator.createTestPerson(town, \"P\" + i);\n }\n\n Person person = query.from(Person.class);\n query.where(person.getId()).in(ids, 2);\n\n validate(\"from Person hobj1 where hobj1.id in (:np1)\", ids);\n assertEquals(n, doQueryResult.size());\n }", "private boolean runMultiSampleCase() {\n\t\tArrayList<Candidate> candidates = collectTrioCandidates();\n\n\t\t// Then, check the candidates for all trios around affected individuals.\n\t\tfor (Candidate c : candidates)\n\t\t\tif (isCompatibleWithTriosAroundAffected(c))\n\t\t\t\treturn true;\n\t\treturn false;\n\t}", "@Test\n public void should_iterate_with_default_params() throws Exception {\n long partitionKey = RandomUtils.nextLong(0,Long.MAX_VALUE);\n insertClusteredValues(partitionKey, 1, \"name1\", 5);\n\n Iterator<ClusteredEntity> iter = manager.sliceQuery(ClusteredEntity.class)\n .forIteration()\n .withPartitionComponents(partitionKey)\n .iterator();\n\n assertThat(iter.hasNext()).isTrue();\n ClusteredEntity next = iter.next();\n assertThat(next.getId().getCount()).isEqualTo(1);\n assertThat(next.getId().getName()).isEqualTo(\"name11\");\n assertThat(next.getValue()).isEqualTo(\"value11\");\n\n assertThat(iter.hasNext()).isTrue();\n next = iter.next();\n assertThat(next.getId().getCount()).isEqualTo(1);\n assertThat(next.getId().getName()).isEqualTo(\"name12\");\n assertThat(next.getValue()).isEqualTo(\"value12\");\n\n assertThat(iter.hasNext()).isTrue();\n next = iter.next();\n assertThat(next.getId().getCount()).isEqualTo(1);\n assertThat(next.getId().getName()).isEqualTo(\"name13\");\n assertThat(next.getValue()).isEqualTo(\"value13\");\n\n assertThat(iter.hasNext()).isTrue();\n next = iter.next();\n assertThat(next.getId().getCount()).isEqualTo(1);\n assertThat(next.getId().getName()).isEqualTo(\"name14\");\n assertThat(next.getValue()).isEqualTo(\"value14\");\n\n assertThat(iter.hasNext()).isTrue();\n next = iter.next();\n assertThat(next.getId().getCount()).isEqualTo(1);\n assertThat(next.getId().getName()).isEqualTo(\"name15\");\n assertThat(next.getValue()).isEqualTo(\"value15\");\n\n assertThat(iter.hasNext()).isFalse();\n }", "@Test\n public void testIntersection2()\n {\n final int[] ints1 = {33, 100000};\n final int[] ints2 = {34, 100000};\n List<Integer> expected = Collections.singletonList(100000);\n\n ConciseSet set1 = new ConciseSet();\n for (int i : ints1) {\n set1.add(i);\n }\n ConciseSet set2 = new ConciseSet();\n for (int i : ints2) {\n set2.add(i);\n }\n\n verifyIntersection(expected, set1, set2);\n }", "@Override\r\n public boolean isSatisfied(Configuration cfg) {\r\n Set<Node> firstNodes = new HashSet<Node>();\r\n Set<Node> secondNodes = new HashSet<Node>();\r\n if (getFirstSet().size() == 0 || getSecondSet().size() == 0) {\r\n //FIXME debug log VJob.logger.error(this.toString() + \": Some sets of virtual machines are empty\");\r\n return false;\r\n }\r\n\r\n for (VirtualMachine vm : getFirstSet()) {\r\n if (cfg.isRunning(vm)) {\r\n firstNodes.add(cfg.getLocation(vm));\r\n }\r\n }\r\n for (VirtualMachine vm : getSecondSet()) {\r\n if (cfg.isRunning(vm)) {\r\n secondNodes.add(cfg.getLocation(vm));\r\n }\r\n }\r\n\r\n for (Node n : firstNodes) {\r\n if (secondNodes.contains(n)) {\r\n \tManagedElementList<Node> ns = new SimpleManagedElementList<Node>();\r\n ns.addAll(firstNodes);\r\n ns.retainAll(secondNodes);\r\n //FIXME debug log VJob.logger.error(this.toString() + \": Nodes host VMs of the two groups: \" + ns);\r\n return false;\r\n }\r\n }\r\n for (Node n : secondNodes) {\r\n if (firstNodes.contains(n)) {\r\n \tManagedElementList<Node> ns = new SimpleManagedElementList<Node>();\r\n ns.addAll(secondNodes);\r\n ns.retainAll(firstNodes);\r\n //FIXME debug log VJob.logger.error(this.toString() + \": Nodes host VMs of the two groups: \" + ns);\r\n return false;\r\n }\r\n }\r\n return true;\r\n }", "private boolean isSubset(List<ConceptLabel> outer, List<ConceptLabel> inner){\n\t\tfor(ConceptLabel in: inner){\n\t\t\tboolean c = false;\n\t\t\tfor(ConceptLabel l: outer){\n\t\t\t\tif(l.getText().equals(in.getText())){\n\t\t\t\t\tc = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(!c)\n\t\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "@Test\r\n\tpublic void testContains() {\r\n\t\tAssert.assertTrue(list.contains(new Munitions(2, 3, \"iron\")));\r\n\t\tAssert.assertFalse(list.contains(new Munitions(2, 5, \"ferrum\")));\r\n\t}", "@Test\n public void testOverlappingPartitionsOverlappingClusters()\n {\n check(overlappingClustersWithOverlappingPartitions(), 0.75, 1.0);\n }", "private int[] matches(int[] partition, int feature, boolean value) {\r\n\t\t// to allocate the array we first check how many samples we're talking\r\n\t\t// about\r\n\t\tint nMatches = 0;\r\n\t\tfor (int i = 0; i < partition.length; i++) {\r\n\t\t\tif (input[partition[i]][feature] == value)\r\n\t\t\t\tnMatches++;\r\n\t\t}\r\n\t\tint[] subset = new int[nMatches]; // allocate the array holding the\r\n\t\t\t\t\t\t\t\t\t\t\t// matching sample indices\r\n\t\tint cnt = 0;\r\n\t\t// collect the matching samples\r\n\t\tfor (int i = 0; i < partition.length; i++) {\r\n\t\t\tif (input[partition[i]][feature] == value)\r\n\t\t\t\tsubset[cnt++] = partition[i];\r\n\t\t}\r\n\t\treturn subset;\r\n\t}", "@Test\r\n\tpublic void testAdjacency33() {\r\n\t\tBoardCell cell = board.getCell(3, 3);\r\n\t\tSet<BoardCell> testList = board.getAdjList(cell);\r\n\t\tassertTrue(testList != null);\r\n\t\tassertTrue(testList.contains(board.getCell(2, 3)));\r\n\t\tassertTrue(testList.contains(board.getCell(3, 2)));\r\n\t\tassertEquals(2, testList.size());\r\n\t}", "@Test\n public void testSqlExistsMultiValuedWithForeignRestriction() {\n Query<Garage> garagesQuery = existsIn(cars,\n Garage.BRANDS_SERVICED,\n Car.NAME,\n equal(Car.FEATURES, \"convertible\")\n );\n\n Set<Garage> results = asSet(garages.retrieve(garagesQuery));\n\n assertEquals(\"should have 2 results\", 2, results.size());\n assertTrue(\"results should contain garage2\", results.contains(garage2));\n assertTrue(\"results should contain garage5\", results.contains(garage5));\n }", "private static boolean fun3(List<String> res, List<String> ac1) {\n\t\tHashSet<String> hs=new HashSet<String>();\r\n\t\tfor(int i=0;i<res.size();i++){\r\n\t\t\ths.add(res.get(i));\r\n\t\t}\r\n\t\tfor(int i=0;i<ac1.size();i++){\r\n\t\t\tif(hs.contains(ac1.get(i)))\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "protected <INPUT_1, INGREDIENT_1 extends InputIngredient<INPUT_1>, CACHE_1 extends IInputCache<INPUT_1, INGREDIENT_1, RECIPE>, INPUT_2,\n INGREDIENT_2 extends InputIngredient<INPUT_2>, CACHE_2 extends IInputCache<INPUT_2, INGREDIENT_2, RECIPE>> boolean containsPairing(@Nullable Level world,\n INPUT_1 input1, Function<RECIPE, INGREDIENT_1> input1Extractor, CACHE_1 cache1, Set<RECIPE> complexIngredients1, INPUT_2 input2,\n Function<RECIPE, INGREDIENT_2> input2Extractor, CACHE_2 cache2, Set<RECIPE> complexIngredients2) {\n if (cache1.isEmpty(input1)) {\n //Note: We don't bother checking if 2 is empty here as it will be verified in containsInput\n return containsInput(world, input2, input2Extractor, cache2, complexIngredients2);\n } else if (cache2.isEmpty(input2)) {\n return true;\n }\n initCacheIfNeeded(world);\n //Note: If cache 1 contains input 1 then we only need to test the type of input 2 as we already know input 1 matches\n if (cache1.contains(input1, recipe -> input2Extractor.apply(recipe).testType(input2))) {\n return true;\n }\n //Our quick lookup 1 cache does not contain it, check any recipes where the 1 ingredient was complex\n return complexIngredients1.stream().anyMatch(recipe -> input1Extractor.apply(recipe).testType(input1) && input2Extractor.apply(recipe).testType(input2));\n }", "@Test\n \tpublic void whereClauseForNodeInclusion() {\n \t\tnode23.addJoin(new Inclusion(node42));\n \t\tcheckWhereCondition(\n \t\t\t\tjoin(\"=\", \"_node23.text_ref\", \"_node42.text_ref\"),\n \t\t\t\tjoin(\"<=\", \"_node23.left\", \"_node42.left\"),\n \t\t\t\tjoin(\">=\", \"_node23.right\", \"_node42.right\")\n \t\t);\n \t}", "private boolean step5(Node node) {\n\r\n\t\tHashMap<String, ArrayList<String>> cn = copy(node.cN);\r\n\t\tObject[] cnkeys = cn.keySet().toArray();\r\n\r\n\t\t// checking for forbidden configurations\r\n\r\n\t\tfor (int i = 0; i < cn.keySet().size(); i++) {\r\n\t\t\tfor (int j = 0; j < fc.size(); j++) {\r\n\t\t\t\tif (fc.get(j).containsAll(cn.get(cnkeys[i])) && (fc.get(j).get(0).equals(cnkeys[i]))) {\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// checking for unions\r\n\r\n\t\tfor (int i = 0; i < cn.keySet().size(); i++) {\r\n\t\t\tfor (int j = i + 1; j < cn.keySet().size(); j++) {\r\n\t\t\t\tSet<String> set = new HashSet<String>();\r\n\t\t\t\tset.addAll(cn.get(cnkeys[i]));\r\n\t\t\t\tset.addAll(cn.get(cnkeys[j]));\r\n\t\t\t\tif (checksetunions(set, cliques)) {\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public void matchesDemo() \n {\n Map<String, Set<String>> clientMap = new HashMap<>();\n Set<String> interests = new HashSet<>();\n\n interests.add(\"Food\");\n interests.add(\"Wine\");\n interests.add(\"Tandems\");\n clientMap.put(\"Hal\", interests);\n\t \n interests = new HashSet<>();\n interests.add(\"Food\");\n interests.add(\"Walking\");\n interests.add(\"Welding\");\n clientMap.put(\"Gemma\", interests);\n\t \n interests = new HashSet<>();\n interests.add(\"Food\");\n interests.add(\"Cinema\");\n interests.add(\"Wine\");\n clientMap.put(\"Caroline\", interests);\n\n Set<String> halsInterests = clientMap.get(\"Hal\");\n String outputString;\n Set<String> eachClientInterests;\n Set<String> intersection;\n\n for (String eachClient : clientMap.keySet()) \n {\n eachClientInterests = clientMap.get(eachClient);\n intersection = new HashSet<>(halsInterests);\n intersection.retainAll(eachClientInterests);\n outputString = \"Hal and \" + eachClient \n + \" have common interests: \"\n + intersection;\n System.out.println(outputString) ;\n }\n }", "public void testContainsEdge() {\n System.out.println(\"containsEdge\");\n\n Graph<Integer, Edge<Integer>> graph = generateGraph();\n\n for (int i = 0; i < 25; i++) {\n for (int j = 0; j < 25; j++) {\n if ((i + j) % 2 != 0) {\n Assert.assertFalse(graph.containsEdge(new Integer(i), new Integer(j)));\n } else {\n Assert.assertTrue(graph.containsEdge(new Integer(i), new Integer(j)));\n }\n }\n }\n\n }", "@Test\n \tpublic void whereClauseForNodeOverlap() {\n \t\tnode23.addJoin(new Overlap(node42));\n \t\tcheckWhereCondition(\n \t\t\t\tjoin(\"=\", \"_node23.text_ref\", \"_node42.text_ref\"),\n \t\t\t\tjoin(\"<=\", \"_node23.left\", \"_node42.right\"),\n \t\t\t\tjoin(\"<=\", \"_node42.left\", \"_node23.right\")\n \t\t);\n \t}", "@Test\n public void getGraph1() throws Exception {\n try (final Graph g1 = dataset.getGraph(graph1).get()) {\n assertEquals(4, g1.size());\n\n assertTrue(g1.contains(alice, name, aliceName));\n assertTrue(g1.contains(alice, knows, bob));\n assertTrue(g1.contains(alice, member, null));\n assertTrue(g1.contains(null, name, secretClubName));\n }\n }", "private boolean in(Integer e, ArrayList<Integer> l) {\n for (int i=0; i<l.size();i++) {\n if (l.get(i) == e) {\n return true;\n }\n }\n return false;\n }", "@Test\n public void testBoundsAsCompositesWithEqAndInRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n Restriction eq = newSingleEq(cfMetaData, 0, value1);\n Restriction in = newSingleIN(cfMetaData, 1, value1, value2, value3);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(in);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.START);\n assertComposite(bounds.get(2), value1, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value1, EOC.END);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n assertComposite(bounds.get(2), value1, value3, EOC.END);\n }", "@Test\n @WithMockUhUser(username = \"iamtst04\")\n public void optInTest() throws Exception {\n assertFalse(isInCompositeGrouping(GROUPING, tst[0], tst[3]));\n assertTrue(isInBasisGroup(GROUPING, tst[0], tst[3]));\n assertTrue(isInExcludeGroup(GROUPING, tst[0], tst[3]));\n\n //tst[3] opts into Grouping\n mapGSRs(API_BASE + GROUPING + \"/optIn\");\n }", "public void sensibleMatches1() \n { \n Map<String, Set<String>> clientMap = new HashMap<>();\n Set<String> interests = new HashSet<>();\n\n interests.add(\"Food\");\n interests.add(\"Wine\");\n interests.add(\"Tandems\");\n clientMap.put(\"Hal\", interests);\n\t \n interests = new HashSet<>();\n interests.add(\"Food\");\n interests.add(\"Walking\");\n interests.add(\"Welding\");\n clientMap.put(\"Gemma\", interests);\n\t \n interests = new HashSet<>();\n interests.add(\"Food\");\n interests.add(\"Cinema\");\n interests.add(\"Wine\");\n clientMap.put(\"Caroline\", interests);\n\n Set<String> halsInterests = clientMap.get(\"Hal\");\n String outputString;\n Set<String> eachClientInterests;\n Set<String> intersection ;\n\n Map<String, Set<String>> mapWithoutHal = new HashMap<>(clientMap);\n mapWithoutHal.remove(\"Hal\");\n for (String eachClient : mapWithoutHal.keySet()) \n {\n eachClientInterests = clientMap.get(eachClient);\n intersection = new HashSet<>(halsInterests);\n intersection.retainAll(eachClientInterests);\n outputString = \"Hal and \" + eachClient \n + \" have common interests: \"\n + intersection;\n System.out.println(outputString);\n }\n }", "public void sensibleMatches2() \n { \n Map<String, Set<String>> clientMap = new HashMap<>();\n Set<String> interests = new HashSet<>();\n\n interests.add(\"Food\");\n interests.add(\"Wine\");\n interests.add(\"Tandems\");\n clientMap.put(\"Hal\", interests);\n\t \n interests = new HashSet<>();\n interests.add(\"Food\");\n interests.add(\"Walking\");\n interests.add(\"Welding\");\n clientMap.put(\"Gemma\", interests);\n\n interests = new HashSet<>();\n interests.add(\"Food\");\n interests.add(\"Cinema\");\n interests.add(\"Wine\");\n clientMap.put(\"Caroline\", interests);\n\n Set<String> halsInterests = clientMap.get(\"Hal\");\n String outputString;\n Set<String> eachClientInterests;\n Set<String> intersection ;\n\n for (String eachClient : clientMap.keySet()) \n {\n if (!eachClient.equals(\"Hal\")) \n {\n eachClientInterests = clientMap.get(eachClient);\n intersection = new HashSet<>(halsInterests);\n intersection.retainAll(eachClientInterests);\n outputString = \"Hal and \" + eachClient \n + \" have common interests: \"\n + intersection;\n System.out.println(outputString);\n }\n }\n }", "@Test\n public void testBoundsAsCompositesWithEqAndSliceRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n\n Restriction eq = newSingleEq(cfMetaData, 0, value3);\n\n Restriction slice = newSingleSlice(cfMetaData, 1, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 1, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 1, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 1, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 1, Bound.START, false, value1);\n Restriction slice2 = newSingleSlice(cfMetaData, 1, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value2, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 1, Bound.START, true, value1);\n slice2 = newSingleSlice(cfMetaData, 1, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value2, EOC.END);\n }", "@Test\n public void testContainsAll_Contains_Overflow() {\n\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>(2, 2);\n instance.add(3);\n instance.add(2);\n instance.add(1);\n instance.add(4);\n instance.add(5);\n instance.add(4);\n instance.add(7);\n\n Collection c = Arrays.asList(3, 4, 5, 7);\n\n boolean expResult = true;\n boolean result = instance.containsAll(c);\n assertEquals(expResult, result);\n }", "private boolean subGridCheck() {\n\t\tint sqRt = (int)Math.sqrt(dimension);\n\t\tfor(int i = 0; i < sqRt; i++) {\n\t\t\tint increment = i * sqRt;\n\t\t\tfor(int val = 1; val <= dimension; val++) {\n\t\t\t\tint valCounter = 0;\n\t\t\t\tfor(int row = 0 + increment; row < sqRt + increment; row++) {\n\t\t\t\t\tfor(int col = 0 + increment; col < sqRt + increment; col++) {\n\t\t\t\t\t\tif(puzzle[row][col] == val)\n\t\t\t\t\t\t\tvalCounter++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(valCounter >= 2)\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "@Test\n public void testMultipleLabelsWithAndOperatorCriteria() throws Exception {\n JobQueryCriteria<TitusTaskState, TitusJobType> query = queryBuilder.withLabels(\n expectedLabels().with(\"labelA\").with(\"labelB\").build()\n ).withLabelsAndOp(true).build();\n\n assertThat(JobQueryCriteriaEvaluator.matches(job, query)).isTrue();\n\n // One of the labels is missing\n JobQueryCriteria<TitusTaskState, TitusJobType> query2 = queryBuilder.withLabels(\n expectedLabels().with(\"labelB\").with(\"missing_label\").build()\n ).withLabelsAndOp(true).build();\n\n assertThat(JobQueryCriteriaEvaluator.matches(job, query2)).isFalse();\n }", "private void clusterElements(int element1,int element2)\n\t{\n\t\tint index1 = getClusterIndex(element1);\n\t\tint index2 = getClusterIndex(element2);\n\t\t\n\t\t\n\t\tif (index1 != index2)\n\t\t\tif((index1 != -1) && (index2 != -1))\n\t\t\t\tcombineClusters(index1,index2);\n\t}", "boolean hasXYPairs();", "@Test\n void test014_testGetConnectedComponents() {\n try {\n christmasBuddENetwork.addFriendship(\"Harry\", \"Prancer\");\n\n christmasBuddENetwork.addFriendship(\"Santa\", \"Rudolph\");\n christmasBuddENetwork.addFriendship(\"Comet\", \"Santa\");\n christmasBuddENetwork.addFriendship(\"Rudolph\", \"Comet\");\n christmasBuddENetwork.addFriendship(\"Grinch\", \"Comet\");\n\n // There should be 2 connected components.\n Set<Graph> christmasComponents =\n christmasBuddENetwork.getConnectedComponents();\n int numComponents = christmasComponents.size();\n //\n if (numComponents != 2) {\n fail(\"\");\n }\n Iterator<Graph> christmasGraphIterator = christmasComponents.iterator();\n\n boolean firstCompFound = false;\n boolean secondCompFound = false;\n int componentsFound = 0;\n while (christmasGraphIterator.hasNext()) {\n Graph christmasGraph = christmasGraphIterator.next();\n componentsFound = componentsFound + 1;\n //\n if (christmasGraph.size() == 1) {\n if (firstCompFound == true) {\n fail(\"test014_testGetConnectedComponents(): FAILED! Duplicate \"\n + \"component (size 1) found! :(\");\n }\n Set<User> oneConnectedComponentVertices =\n christmasGraph.getAllVertices();\n ArrayList<String> componentUsersList = new ArrayList<String>();\n for (User userName : oneConnectedComponentVertices) {\n componentUsersList.add(userName.getName());\n System.out.println(userName.getName());\n }\n if ((!componentUsersList.contains(\"Harry\"))\n || (!componentUsersList.contains(\"Prancer\"))) {\n fail(\"test014_testGetConnectedComponents(): Failed! :( Did NOT \"\n + \"have Harry and Prancer\");\n } else {\n firstCompFound = true;\n\n }\n }\n\n if (christmasGraph.size() == 4) {\n if (secondCompFound == true) {\n fail(\"test014_testGetConnectedComponents: FAILED! Duplicate \"\n + \"component (size 4) found! :(\");\n }\n Set<User> secondConnectedComponentVertices =\n christmasGraph.getAllVertices();\n ArrayList<String> componentUsersList2 = new ArrayList<String>();\n for (User userName : secondConnectedComponentVertices) {\n componentUsersList2.add(userName.getName());\n }\n if ((!componentUsersList2.contains(\"santa\"))\n || (!componentUsersList2.contains(\"rudolph\"))\n || (!componentUsersList2.contains(\"comet\"))\n || (!componentUsersList2.contains(\"grinch\"))) {\n fail(\"test014_testGetConnectedComponents(): FAILED! Did NOT have \"\n + \"Santa, Rudolph, Comet, and Grinch!\");\n } else {\n secondCompFound = true;\n }\n }\n }\n\n if (componentsFound != 2) {\n fail(\"test014_testGetConnectedComponents(): Did NOT return 2 for the \"\n + \"connected components but instead returned: \" + componentsFound);\n }\n } catch (Exception e) {\n fail(\"test014_testGetConnectedComponents(): Failed! :(. Threw unexpected \"\n + \"exception\");\n }\n\n }", "boolean contains(int vertex);", "@Test\n public void testSqlExistsBasedJoin() {\n Query<Car> carsQuery = and(\n in(Car.FEATURES, \"sunroof\", \"convertible\"),\n existsIn(garages,\n Car.NAME,\n Garage.BRANDS_SERVICED,\n equal(Garage.LOCATION, \"Dublin\")\n )\n );\n\n Map<Car, Set<Garage>> results = new LinkedHashMap<Car, Set<Garage>>();\n for (Car car : cars.retrieve(carsQuery)) {\n Query<Garage> garagesWhichServiceThisCarInDublin\n = and(equal(Garage.BRANDS_SERVICED, car.name), equal(Garage.LOCATION, \"Dublin\"));\n for (Garage garage : garages.retrieve(garagesWhichServiceThisCarInDublin)) {\n Set<Garage> garagesWhichCanServiceThisCar = results.get(car);\n if (garagesWhichCanServiceThisCar == null) {\n garagesWhichCanServiceThisCar = new LinkedHashSet<Garage>();\n results.put(car, garagesWhichCanServiceThisCar);\n }\n garagesWhichCanServiceThisCar.add(garage);\n }\n }\n\n assertEquals(\"join results should contain 2 cars\", 2, results.size());\n Assert.assertTrue(\"join results should contain car1\", results.containsKey(car1));\n Assert.assertTrue(\"join results should contain car4\", results.containsKey(car4));\n\n assertEquals(\"join results for car1\", asSet(garage3, garage4), results.get(car1));\n assertEquals(\"join results for car4\", asSet(garage2), results.get(car4));\n }", "@Test\n\t public void test_Is_Subset_Positive() throws Exception{\t\n\t\t SET setarray= new SET( new int[]{1,2,3,4,5});\n\t\t SET subsetarray= new SET( new int[]{1,2,3});\n\t\t assertTrue(setarray.isSubSet(subsetarray));\t \n\t }", "@Test\n\tvoid testIsTwoVertexesConnected() {\n\t\tLinkedHashSet<String> edges = null;\n\t\tmap.put(\"Boston\", edges);\n\t\tOptional<LinkedHashSet<String>> vertexOptional = Optional.ofNullable(map.get(\"Boston\"));\n\t\tif (vertexOptional.isEmpty()) {\n\t\t\tAssertions.assertEquals(\"Vertex is not connected (No)\", \"Vertex is not connected (No)\"); // This vertex does\n\t\t\t// not have any\n\t\t\t// edges to\n\t\t\t// connect with\n\t\t\t// vertex\n\t\t}\n\n\t\t// Test one vertex is connected with other vertex\n\t\tedges = new LinkedHashSet<String>();\n\t\tedges.add(\"New York\");\n\t\tmap.put(\"Boston\", edges);\n\t\tvertexOptional = Optional.ofNullable(map.get(\"Boston\"));\n\t\tif (vertexOptional.isPresent()) {\n\t\t\tAssertions.assertNotNull(map.get(\"Boston\")); // This denotes Boston vertex is connected with another Vertex\n\t\t\t// New York\n\t\t\tAssertions.assertTrue(map.get(\"Boston\").contains(\"New York\"));\n\t\t\tString[] edgesArray = new String[edges.size()];\n\t\t\tedgesArray = edges.toArray(edgesArray);\n\t\t\tAssertions.assertEquals(\"New York\", edgesArray[0]);\n\t\t\tAssertions.assertEquals(\"Vertex is not connected (Yes)\", \"Vertex is not connected (Yes)\");\n\t\t}\n\n\t\t// Test one vertex is connected with other vertex\n\t\tedges = new LinkedHashSet<String>();\n\t\tedges.add(\"New York\");\n\t\tedges.add(\"Newark\");\n\t\tmap.put(\"Boston\", edges);\n\t\tLinkedHashSet<String> edgess = new LinkedHashSet<String>();\n\t\tedgess.add(\"Philadelphia\");\n\t\tmap.put(\"Newark\", edgess);\n\n\t\tList<String> connectedVertex = new ArrayList<String>();\n\t\tconnectedVertex.addAll(map.get(\"Boston\"));\n\t\tif (connectedVertex.contains(\"Philadelphia\")) {\n\t\t\tAssertions.assertEquals(\"Vertex is not connected (Yes)\", \"Vertex is not connected (Yes)\");\n\t\t} else {\n\t\t\tconnectedVertex.forEach((String name) -> {\n\t\t\t\tif (map.get(name) != null) {\n\n\t\t\t\t\tAssertions.assertTrue(map.get(name).contains(\"Philadelphia\"));\n\t\t\t\t\tAssertions.assertEquals(\"Vertex is not connected (Yes)\", \"Vertex is not connected (Yes)\");\n\t\t\t\t}\n\t\t\t});\n\n\t\t}\n\t}", "@Test\n public void sharedFilterEnsuresUniqueResults() {\n Filter filter = new Filter(\"test-filter\");\n final Dataset dataset1 = new Dataset(\"TEST1\", \"sql\", filter);\n final Dataset dataset2 = new Dataset(\"TEST2\", \"sql2\", filter); // shared same filter\n\n List<String> entry1 = new ArrayList<>();\n entry1.add(\"001\");\n entry1.add(\"aaa\");\n\n List<String> entry2 = new ArrayList<>();\n entry2.add(\"002\");\n entry2.add(\"bbb\");\n\n List<String> entry3 = new ArrayList<>();\n entry3.add(\"003\");\n entry3.add(\"ccc\");\n\n List<String> entry4 = new ArrayList<>();\n entry4.add(\"004\");\n entry4.add(\"ddd\");\n\n List<List<String>> queryResults1 = new ArrayList<>();\n queryResults1.add(entry1);\n queryResults1.add(entry2);\n queryResults1.add(entry3);\n queryResults1.add(entry4);\n\n List<String> entry5 = new ArrayList<>();\n entry5.add(\"005\"); // different\n entry5.add(\"eee\");\n\n List<String> entry6 = new ArrayList<>();\n entry6.add(\"002\"); // same\n entry6.add(\"bbb\");\n\n List<String> entry7 = new ArrayList<>();\n entry7.add(\"007\"); // different\n entry7.add(\"fff\");\n\n List<String> entry8 = new ArrayList<>();\n entry8.add(\"004\"); // same\n entry8.add(\"ddd\");\n\n List<List<String>> queryResults2 = new ArrayList<>();\n queryResults2.add(entry5);\n queryResults2.add(entry6);\n queryResults2.add(entry7);\n queryResults2.add(entry8);\n\n // given\n dataset1.populateCache(queryResults1, 200L);\n dataset2.populateCache(queryResults2, 300L);\n\n // when\n final List<String> result1 = dataset1.getCachedResult();\n final List<String> result2 = dataset1.getCachedResult();\n final List<String> result3 = dataset1.getCachedResult();\n final List<String> result4 = dataset1.getCachedResult();\n final List<String> result5 = dataset2.getCachedResult();\n final List<String> result6 = dataset2.getCachedResult();\n\n // then\n assertEquals(\"Wrong result 1\", entry1, result1); // first datset is as-is\n assertEquals(\"Wrong result 2\", entry2, result2); // first datset is as-is\n assertEquals(\"Wrong result 3\", entry3, result3); // first datset is as-is\n assertEquals(\"Wrong result 4\", entry4, result4); // first datset is as-is\n assertEquals(\"Wrong result 3\", entry5, result5); // second datset, not filtered out\n assertEquals(\"Wrong result 3\", entry7, result6); // second dataset, entry6 is filtered out\n\n // and\n try {\n dataset1.getCachedResult();\n fail(\"Expected to run out of data\");\n\n } catch (IllegalStateException ex) {\n assertEquals(\"Wrong error\", \"No more data available for dataset: TEST1\", ex.getMessage());\n }\n\n try {\n // entry7 should be filtered out, resulting in no more data\n dataset2.getCachedResult();\n fail(\"Expected to run out of data\");\n\n } catch (IllegalStateException ex) {\n assertEquals(\"Wrong error\", \"No more data available for dataset: TEST2\", ex.getMessage());\n }\n\n // and\n assertEquals(\"Wrong cache size\", Optional.of(4), dataset1.getMetrics().getCacheSize());\n assertEquals(\"Wrong timing\", Optional.of(200L), dataset1.getMetrics().getTimingMilliseconds());\n assertEquals(\"Wrong cache requested\", Optional.of(5), dataset1.getMetrics().getCacheRequested());\n assertEquals(\"Wrong filtered out\", Optional.empty(), dataset1.getMetrics().getFilteredOut());\n\n // and\n assertEquals(\"Wrong cache size\", Optional.of(4), dataset2.getMetrics().getCacheSize());\n assertEquals(\"Wrong timing\", Optional.of(300L), dataset2.getMetrics().getTimingMilliseconds());\n assertEquals(\"Wrong cache requested\", Optional.of(3), dataset2.getMetrics().getCacheRequested());\n assertEquals(\"Wrong filtered out\", Optional.of(2), dataset2.getMetrics().getFilteredOut());\n }", "private boolean isIntersect(List<Tuple> list1, List<Tuple> list2) {\n\t\tboolean intersect = false;\n\t\tfor (Tuple tuple : list1) {\n\t\t\tif (list2.contains(tuple)) {\n\t\t\t\tintersect = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn intersect;\n\t}", "private static double intraClusterScore(List<String> arg1, List<String> arg2) {\n\t\t// compare each elements from argList1 vs argList2\n\n\t\tPair<String, String> pair = null;\n\t\tdouble tempScore = 0;\n\t\tdouble maxScore = 0;\n\n\t\tfor (int list1Id = 0; list1Id < arg1.size(); list1Id++) {\n\t\t\tfor (int list2Id = 0; list2Id < arg2.size(); list2Id++) {\n\n\t\t\t\t// create a pair\n\t\t\t\tpair = new ImmutablePair<String, String>(arg1.get(list1Id)\n\t\t\t\t\t\t.trim(), arg2.get(list2Id).trim());\n\n\t\t\t\ttry {\n\t\t\t\t\t// retrieve the key from the collection\n\t\t\t\t\ttempScore = SCORE_MAP.get(pair);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tpair = new ImmutablePair<String, String>(arg2.get(\n\t\t\t\t\t\t\t\tlist2Id).trim(), arg1.get(list1Id).trim());\n\t\t\t\t\t\ttempScore = SCORE_MAP.get(pair);\n\n\t\t\t\t\t} catch (Exception e1) {\n\t\t\t\t\t\ttempScore = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// System.out.println(\" temp score = \" + tempScore);\n\t\t\t\tmaxScore = (tempScore > maxScore) ? tempScore : maxScore;\n\t\t\t}\n\t\t}\n\n\t\t// System.out.println(\"max = \" + maxScore);\n\t\treturn maxScore;\n\t}", "public void testIsIndivisibleElement() throws Exception {\n assertTrue(cfg.isIndivisibleElement(\"test\"));\n assertTrue(cfg.isIndivisibleElement(\"d1\"));\n assertTrue(cfg.isIndivisibleElement(\"ind1\"));\n assertTrue(cfg.isIndivisibleElement(\"ind2\"));\n\n cfg.associateStylisticAndAntiElements(\"anti-test\", \"test\",\n permittedChildren);\n cfg.addDivisibleElementsThatPermitStyles(new String[] {\"d1\"});\n cfg.addIndivisibleElementsThatPermitStyles(new String[] {\"ind1\", \"ind2\"});\n\n assertTrue(cfg.isIndivisibleElement(\"ind1\"));\n assertTrue(cfg.isIndivisibleElement(\"ind2\"));\n assertTrue(cfg.isIndivisibleElement(\"not-in-any-set\"));\n assertTrue(cfg.isIndivisibleElement(\"child\"));\n assertTrue(cfg.isIndivisibleElement(\"TEST\"));\n assertTrue(cfg.isIndivisibleElement(\"D1\"));\n\n assertFalse(cfg.isIndivisibleElement(\"test\"));\n assertFalse(cfg.isIndivisibleElement(\"d1\"));\n assertFalse(cfg.isIndivisibleElement(\"anti-test\"));\n }", "private boolean getJoinOpsAndLeafInputs(ILogicalOperator op) throws AlgebricksException {\n if (joinClause(op)) {\n JoinOperator jO = new JoinOperator((AbstractBinaryJoinOperator) op);\n allJoinOps.add(jO);\n if (op.getOperatorTag() == LogicalOperatorTag.LEFTOUTERJOIN) {\n jO.setOuterJoin(true);\n }\n\n int firstLeafInputNumber, lastLeafInputNumber;\n int k = 0;\n for (int i = 0; i < 2; i++) {\n ILogicalOperator nextOp = op.getInputs().get(i).getValue();\n firstLeafInputNumber = leafInputNumber + 1; // we are interested in the 2nd input only\n boolean canTransform = getJoinOpsAndLeafInputs(nextOp);\n if (!canTransform) {\n return false;\n }\n lastLeafInputNumber = leafInputNumber; // we are interested in the 2nd input only\n k = 0;\n // now we know the leafInput numbers that occurred on the right side of this join.\n //if ((op.getOperatorTag() == LogicalOperatorTag.LEFTOUTERJOIN) && (i == 1)) {\n if ((joinClause(op)) && (i == 1)) {\n for (int j = firstLeafInputNumber; j <= lastLeafInputNumber; j++) {\n k |= 1 << (j - 1);\n }\n // buildSets are only for outerjoins.\n if ((op.getOperatorTag() == LogicalOperatorTag.LEFTOUTERJOIN)\n && (firstLeafInputNumber < lastLeafInputNumber)) { // if more is than one leafInput, only then buildSets make sense.\n buildSets.add(new Triple<>(k, lastLeafInputNumber - firstLeafInputNumber + 1, true)); // convert the second to boolean later\n }\n boolean ret = buildDependencyList(op, jO, outerJoinsDependencyList, k);\n if (!ret) {\n return false;\n }\n }\n }\n } else {\n if (op.getOperatorTag() == LogicalOperatorTag.GROUP) { // cannot handle group by's in leaf Inputs.\n return false;\n }\n Pair<EmptyTupleSourceOperator, DataSourceScanOperator> etsDataSource = containsLeafInputOnly(op);\n if (etsDataSource != null) { // a leaf input\n EmptyTupleSourceOperator etsOp = etsDataSource.first;\n DataSourceScanOperator dataSourceOp = etsDataSource.second;\n if (op.getOperatorTag().equals(LogicalOperatorTag.DISTRIBUTE_RESULT)) {// single table query\n ILogicalOperator selectOp = findSelectOrDataScan(op);\n if (selectOp == null) {\n return false;\n } else {\n leafInputs.add(selectOp);\n }\n } else {\n leafInputNumber++;\n leafInputs.add(op);\n if (!addLeafInputNumbersToVars(op)) {\n return false;\n }\n }\n } else { // This must be an internal edge\n if (onlyAssigns(op, assignOps)) {\n ILogicalOperator skipAssisgnsOp = skipPastAssigns(op);\n boolean canTransform = getJoinOpsAndLeafInputs(skipAssisgnsOp);\n if (!canTransform) {\n return false;\n }\n } else {\n return false;\n }\n }\n }\n return true;\n }", "public void test_containsII() {\n\tfinal int COUNT = 60000000;\n\t\n\tRectangle r = new Rectangle(1, 2, 3, 4);\n\n\tPerformanceMeter meter = createMeter(\"contains\");\n\tmeter.start();\n\tfor (int i = 0; i < COUNT; i++) {\n\t\tr.contains(2, 3);\t// does contain\n\t}\n\tmeter.stop();\n\t\n\tdisposeMeter(meter);\n\t\n\tmeter = createMeter(\"disjoint\");\n\tmeter.start();\n\tfor (int i = 0; i < COUNT; i++) {\n\t\tr.contains(9, 12);\t// does not contain\n\t}\n\tmeter.stop();\n\t\n\tdisposeMeter(meter);\n}", "static boolean isClusterCandidate_(double x_1, double y1, double x2,\n\t\t\tdouble y2, double sqr_tolerance) {\n\t\tdouble dx = x_1 - x2;\n\t\tdouble dy = y1 - y2;\n\t\treturn dx * dx + dy * dy <= sqr_tolerance;\n\t}", "public static boolean opposites(Pair[] data){\n HashSet<Pair> hs = new HashSet<>(20, 0.9f);\n for(Pair p : data) {\n if(hs.contains(new Pair(p.b(), p.a())))\n return true;\n hs.add(p);\n }\n return false;\n }", "Boolean subset(MultiSet<X> s);", "@Test\n public void testConnectedComponents()\n {\n Collection<IIntArray> cc1 = MarkovModel.util.connectedComponents(P1);\n assertTrue(cc1.containsAll(C1));\n assertEquals(cc1.size(), C1.size());\n\n Collection<IIntArray> cc2 = MarkovModel.util.connectedComponents(P2);\n assertTrue(cc2.containsAll(C2));\n assertEquals(cc2.size(), C2.size());\n\n Collection<IIntArray> cc3 = MarkovModel.util.connectedComponents(P3);\n assertTrue(cc3.containsAll(C3));\n assertEquals(cc3.size(), C3.size()); \n }", "@Test\n public void testFilterPushDown() throws IOException { 'bla' as (x, y);\n // B = load 'morebla' as (a, b);\n // C = join A on x, B on a;\n // D = filter C by x = a and x = 0 and b = 1 and y = b;\n // store D into 'whatever';\n \n // A = load\n LogicalPlan lp = new LogicalPlan();\n {\n \tLogicalSchema aschema = new LogicalSchema();\n \taschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"x\", null, DataType.INTEGER));\n \taschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"y\", null, DataType.INTEGER));\n \taschema.getField(0).uid = 1;\n \taschema.getField(1).uid = 2;\n \tLOLoad A = new LOLoad(new FileSpec(\"bla\", new FuncSpec(\"PigStorage\", \"\\t\")), aschema, lp);\n \tlp.add(A);\n\t \n \t// B = load\n \tLogicalSchema bschema = new LogicalSchema();\n \tbschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"a\", null, DataType.INTEGER));\n \tbschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"b\", null, DataType.INTEGER));\n \tbschema.getField(0).uid = 3;\n \tbschema.getField(1).uid = 4;\n \tLOLoad B = new LOLoad(null, bschema, lp);\n \tlp.add(B);\n\t \n \t// C = join\n \tLogicalSchema cschema = new LogicalSchema();\n \tcschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"x\", null, DataType.INTEGER));\n \tcschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"y\", null, DataType.INTEGER));\n \tcschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"a\", null, DataType.INTEGER));\n \tcschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"b\", null, DataType.INTEGER));\n \tcschema.getField(0).uid = 1;\n \tcschema.getField(1).uid = 2;\n \tcschema.getField(2).uid = 3;\n \tcschema.getField(3).uid = 4;\n \tLogicalExpressionPlan aprojplan = new LogicalExpressionPlan();\n \tProjectExpression x = new ProjectExpression(aprojplan, DataType.INTEGER, 0, 0);\n \tx.neverUseForRealSetUid(1);\n \tLogicalExpressionPlan bprojplan = new LogicalExpressionPlan();\n \tProjectExpression y = new ProjectExpression(bprojplan, DataType.INTEGER, 1, 0);\n \ty.neverUseForRealSetUid(3);\n \tMultiMap<Integer, LogicalExpressionPlan> mm = \n \tnew MultiMap<Integer, LogicalExpressionPlan>();\n \tmm.put(0, aprojplan);\n \tmm.put(1, bprojplan);\n \tLOJoin C = new LOJoin(lp, mm, JOINTYPE.HASH, new boolean[] {true, true});\n \tC.neverUseForRealSetSchema(cschema);\n \tlp.add(C);\n \tlp.connect(A, C);\n \tlp.connect(B, C);\n \n \t// D = filter\n \tLogicalExpressionPlan filterPlan = new LogicalExpressionPlan();\n \tProjectExpression fx = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 0);\n \tfx.neverUseForRealSetUid(1);\n \tConstantExpression fc0 = new ConstantExpression(filterPlan, DataType.INTEGER, new Integer(0));\n \tEqualExpression eq1 = new EqualExpression(filterPlan, fx, fc0);\n \tProjectExpression fanotherx = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 0);\n \tfanotherx.neverUseForRealSetUid(1);\n \tProjectExpression fa = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 2);\n \tfa.neverUseForRealSetUid(3);\n \tEqualExpression eq2 = new EqualExpression(filterPlan, fanotherx, fa);\n \tAndExpression and1 = new AndExpression(filterPlan, eq1, eq2);\n \tProjectExpression fb = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 3);\n \tfb.neverUseForRealSetUid(4);\n \tConstantExpression fc1 = new ConstantExpression(filterPlan, DataType.INTEGER, new Integer(1));\n \tEqualExpression eq3 = new EqualExpression(filterPlan, fb, fc1);\n \tAndExpression and2 = new AndExpression(filterPlan, and1, eq3);\n \tProjectExpression fanotherb = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 3);\n \tfanotherb.neverUseForRealSetUid(4);\n \tProjectExpression fy = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 1);\n \tfy.neverUseForRealSetUid(2);\n \tEqualExpression eq4 = new EqualExpression(filterPlan, fy, fanotherb);\n \tnew AndExpression(filterPlan, and2, eq4);\n \n \tLOFilter D = new LOFilter(lp, filterPlan);\n \tD.neverUseForRealSetSchema(cschema);\n \t// Connect D to B, since the transform has happened.\n \tlp.add(D);\n \tlp.connect(C, D);\n }\n \n LogicalPlanOptimizer optimizer = new LogicalPlanOptimizer(lp, 500);\n optimizer.optimize();\n \n LogicalPlan expected = new LogicalPlan();\n {\n // A = load\n \tLogicalSchema aschema = new LogicalSchema();\n \taschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"x\", null, DataType.INTEGER));\n \taschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"y\", null, DataType.INTEGER));\n \taschema.getField(0).uid = 1;\n \taschema.getField(1).uid = 2;\n \tLOLoad A = new LOLoad(new FileSpec(\"bla\", new FuncSpec(\"PigStorage\", \"\\t\")), aschema, expected);\n \texpected.add(A);\n \t\n \t// DA = filter\n \tLogicalExpressionPlan DAfilterPlan = new LogicalExpressionPlan();\n \tProjectExpression fx = new ProjectExpression(DAfilterPlan, DataType.INTEGER, 0, 0);\n \tfx.neverUseForRealSetUid(1);\n \tConstantExpression fc0 = new ConstantExpression(DAfilterPlan, DataType.INTEGER, new Integer(0));\n \tnew EqualExpression(DAfilterPlan, fx, fc0);\n\t \n \tLOFilter DA = new LOFilter(expected, DAfilterPlan);\n \tDA.neverUseForRealSetSchema(aschema);\n \texpected.add(DA);\n \texpected.connect(A, DA);\n\t \n \t// B = load\n \tLogicalSchema bschema = new LogicalSchema();\n \tbschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"a\", null, DataType.INTEGER));\n \tbschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"b\", null, DataType.INTEGER));\n \tbschema.getField(0).uid = 3;\n \tbschema.getField(1).uid = 4;\n \tLOLoad B = new LOLoad(null, bschema, expected);\n \texpected.add(B);\n \t\n \t// DB = filter\n \tLogicalExpressionPlan DBfilterPlan = new LogicalExpressionPlan();\n \tProjectExpression fb = new ProjectExpression(DBfilterPlan, DataType.INTEGER, 0, 1);\n \tfb.neverUseForRealSetUid(4);\n \tConstantExpression fc1 = new ConstantExpression(DBfilterPlan, DataType.INTEGER, new Integer(1));\n \tnew EqualExpression(DBfilterPlan, fb, fc1);\n\t \n \tLOFilter DB = new LOFilter(expected, DBfilterPlan);\n \tDB.neverUseForRealSetSchema(bschema);\n \texpected.add(DB);\n \texpected.connect(B, DB);\n\t \n \t// C = join\n \tLogicalSchema cschema = new LogicalSchema();\n \tcschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"x\", null, DataType.INTEGER));\n \tcschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"y\", null, DataType.INTEGER));\n \tcschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"a\", null, DataType.INTEGER));\n \tcschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"b\", null, DataType.INTEGER));\n \tcschema.getField(0).uid = 1;\n \tcschema.getField(1).uid = 2;\n \tcschema.getField(2).uid = 3;\n \tcschema.getField(3).uid = 4;\n \tLogicalExpressionPlan aprojplan = new LogicalExpressionPlan();\n \tProjectExpression x = new ProjectExpression(aprojplan, DataType.INTEGER, 0, 0);\n \tx.neverUseForRealSetUid(1);\n \tLogicalExpressionPlan bprojplan = new LogicalExpressionPlan();\n \tProjectExpression y = new ProjectExpression(bprojplan, DataType.INTEGER, 1, 0);\n \ty.neverUseForRealSetUid(3);\n \tMultiMap<Integer, LogicalExpressionPlan> mm = \n \tnew MultiMap<Integer, LogicalExpressionPlan>();\n \tmm.put(0, aprojplan);\n \tmm.put(1, bprojplan);\n \tLOJoin C = new LOJoin(expected, mm, JOINTYPE.HASH, new boolean[] {true, true});\n \tC.neverUseForRealSetSchema(cschema);\n \texpected.add(C);\n \texpected.connect(DA, C);\n \texpected.connect(DB, C);\n\t \n \t// D = filter\n \tLogicalExpressionPlan filterPlan = new LogicalExpressionPlan();\n \tProjectExpression fanotherx = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 0);\n \tfanotherx.neverUseForRealSetUid(1);\n \tProjectExpression fa = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 2);\n \tfa.neverUseForRealSetUid(3);\n \tEqualExpression eq2 = new EqualExpression(filterPlan, fanotherx, fa);\n \tProjectExpression fanotherb = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 3);\n \tfanotherb.neverUseForRealSetUid(4);\n \tProjectExpression fy = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 1);\n \tfy.neverUseForRealSetUid(2);\n \tEqualExpression eq4 = new EqualExpression(filterPlan, fy, fanotherb);\n \tnew AndExpression(filterPlan, eq2, eq4);\n\t \n \tLOFilter D = new LOFilter(expected, filterPlan);\n \tD.neverUseForRealSetSchema(cschema);\n \texpected.add(D);\n \texpected.connect(C, D);\n }\n \n assertTrue( lp.isEqual(expected) );\n // assertEquals(lp, expected);\n }", "@Test\n public void testMultiCrossJoin2() throws Exception {\n String sql = \"SELECT * FROM (g1 cross join g2) cross join (g3 cross join g4)\";\n Node fileNode = sequenceSql(sql, TSQL_QUERY);\n\n Node queryNode = verify(fileNode, Query.ID, Query.ID);\n\n Node selectNode = verify(queryNode, Query.SELECT_REF_NAME, Select.ID);\n\n verify(selectNode, Select.SYMBOLS_REF_NAME, MultipleElementSymbol.ID);\n\n Node fromNode = verify(queryNode, Query.FROM_REF_NAME, From.ID);\n\n Node jpNode1 = verify(fromNode, From.CLAUSES_REF_NAME, JoinPredicate.ID);\n verifyJoin(jpNode1, JoinTypeTypes.JOIN_CROSS);\n\n Node jpNode2 = verify(jpNode1, JoinPredicate.LEFT_CLAUSE_REF_NAME, JoinPredicate.ID);\n verifyJoin(jpNode2, JoinTypeTypes.JOIN_CROSS);\n\n Node jpNode3 = verify(jpNode1, JoinPredicate.RIGHT_CLAUSE_REF_NAME, JoinPredicate.ID);\n verifyJoin(jpNode3, JoinTypeTypes.JOIN_CROSS);\n \n verifyUnaryFromClauseGroup(jpNode2, JoinPredicate.LEFT_CLAUSE_REF_NAME, \"g1\");\n verifyUnaryFromClauseGroup(jpNode2, JoinPredicate.RIGHT_CLAUSE_REF_NAME, \"g2\");\n\n verifyUnaryFromClauseGroup(jpNode3, JoinPredicate.LEFT_CLAUSE_REF_NAME, \"g3\");\n verifyUnaryFromClauseGroup(jpNode3, JoinPredicate.RIGHT_CLAUSE_REF_NAME, \"g4\");\n \n verifySql(\"SELECT * FROM (g1 CROSS JOIN g2) CROSS JOIN (g3 CROSS JOIN g4)\", fileNode);\n }", "@Test\r\n\tpublic void testAdjacency11() {\r\n\t\tBoardCell cell = board.getCell(1, 1);\r\n\t\tSet<BoardCell> testList = board.getAdjList(cell);\r\n\t\tassertTrue(testList != null);\r\n\t\tassertTrue(testList.contains(board.getCell(0, 1)));\r\n\t\tassertTrue(testList.contains(board.getCell(1, 0)));\r\n\t\tassertTrue(testList.contains(board.getCell(1, 2)));\r\n\t\tassertTrue(testList.contains(board.getCell(2, 1)));\r\n\t\tassertEquals(4, testList.size());\r\n\t}", "private int pairContains(HashMap<Integer,HashSet<Integer>> pairs, int k1, int k2){\n\t\t\n\t\t\n\t\t\tif(pairs.containsKey(k1))\n\t\t\t\tif(pairs.get(k1).contains(k2))\n\t\t\t\t\treturn 2;\n\t\t\t\telse\n\t\t\t\t\treturn 1;\n\t\t\n\t\treturn 0;\n\t}", "@Test\n void shouldBeInsideMap()\n {\n assertTrue(map.isInsideMap(new Vector2(0,0)));\n\n assertTrue(map.isInsideMap(new Vector2(4,0)));\n\n assertTrue(map.isInsideMap(new Vector2(4,4)));\n\n assertTrue(map.isInsideMap(new Vector2(1,3)));\n }", "@Test\n\tvoid attributeCardinality() {\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(CLINICAL_FINDING, DISORDER, BLEEDING, BLEEDING_SKIN, PENTALOGY_OF_FALLOT, PENTALOGY_OF_FALLOT_INCORRECT_GROUPING),\n\t\t\t\tstrings(selectConceptIds(\"<<\" + CLINICAL_FINDING + \":[0..*]\" + FINDING_SITE + \"=*\")));\n\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(CLINICAL_FINDING, DISORDER, BLEEDING, BLEEDING_SKIN, PENTALOGY_OF_FALLOT, PENTALOGY_OF_FALLOT_INCORRECT_GROUPING),\n\t\t\t\tstrings(selectConceptIds(\"<<\" + CLINICAL_FINDING + \":[0..2]\" + FINDING_SITE + \"=*\")));\n\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(BLEEDING_SKIN, PENTALOGY_OF_FALLOT, PENTALOGY_OF_FALLOT_INCORRECT_GROUPING),\n\t\t\t\tstrings(selectConceptIds(\"<<\" + CLINICAL_FINDING + \":[1..2]\" + FINDING_SITE + \"=*\")));\n\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(BLEEDING_SKIN),\n\t\t\t\tstrings(selectConceptIds(\"<<\" + CLINICAL_FINDING + \":[1..1]\" + FINDING_SITE + \"=*\")));\n\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(BLEEDING_SKIN, CLINICAL_FINDING, DISORDER, BLEEDING),\n\t\t\t\tstrings(selectConceptIds(\"<<\" + CLINICAL_FINDING + \":[0..1]\" + FINDING_SITE + \"=*\")));\n\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(CLINICAL_FINDING, DISORDER, BLEEDING),\n\t\t\t\tstrings(selectConceptIds(\"<<\" + CLINICAL_FINDING + \":[0..0]\" + FINDING_SITE + \"=*\")));\n\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(BLEEDING_SKIN, PENTALOGY_OF_FALLOT, PENTALOGY_OF_FALLOT_INCORRECT_GROUPING),\n\t\t\t\tstrings(selectConceptIds(\"<<\" + CLINICAL_FINDING + \":[1..2]\" + FINDING_SITE + \"= <<\" + BODY_STRUCTURE)));\n\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(BLEEDING_SKIN),\n\t\t\t\tstrings(selectConceptIds(\n\t\t\t\t\t\t\"<<\" + CLINICAL_FINDING + \":\" +\n\t\t\t\t\t\t\t\t\"[1..2]\" + FINDING_SITE + \"= <<\" + BODY_STRUCTURE + \",\" +\n\t\t\t\t\t\t\t\t\"[0..0]\" + ASSOCIATED_MORPHOLOGY + \"= <<\" + STENOSIS)));\n\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(BLEEDING_SKIN, PENTALOGY_OF_FALLOT, PENTALOGY_OF_FALLOT_INCORRECT_GROUPING),\n\t\t\t\tstrings(selectConceptIds(\n\t\t\t\t\t\t\"<<\" + CLINICAL_FINDING + \":\" +\n\t\t\t\t\t\t\t\t\"[1..2]\" + FINDING_SITE + \"= <<\" + BODY_STRUCTURE + \",\" +\n\t\t\t\t\t\t\t\t\"[0..1]\" + ASSOCIATED_MORPHOLOGY + \"= <<\" + STENOSIS)));\n\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(PENTALOGY_OF_FALLOT, PENTALOGY_OF_FALLOT_INCORRECT_GROUPING),\n\t\t\t\tstrings(selectConceptIds(\n\t\t\t\t\t\t\"<<\" + CLINICAL_FINDING + \":\" +\n\t\t\t\t\t\t\t\t\"[1..2]\" + FINDING_SITE + \"= <<\" + BODY_STRUCTURE + \",\" +\n\t\t\t\t\t\t\t\t\"[1..*]\" + ASSOCIATED_MORPHOLOGY + \"= <<\" + STENOSIS)));\n\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(PENTALOGY_OF_FALLOT_INCORRECT_GROUPING),\n\t\t\t\tstrings(selectConceptIds(\n\t\t\t\t\t\t\"<<\" + CLINICAL_FINDING + \":\" +\n\t\t\t\t\t\t\t\t\"{\" +\n\t\t\t\t\t\t\t\t\"[1..1]\" + FINDING_SITE + \" != <<\" + PULMONARY_VALVE_STRUCTURE + \",\" +\n\t\t\t\t\t\t\t\t\"[1..*]\" + ASSOCIATED_MORPHOLOGY + \"= <<\" + STENOSIS + \"\" +\n\t\t\t\t\t\t\t\t\"}\")));\n\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(PENTALOGY_OF_FALLOT, PENTALOGY_OF_FALLOT_INCORRECT_GROUPING),\n\t\t\t\tstrings(selectConceptIds(\n\t\t\t\t\t\t\"<<\" + CLINICAL_FINDING + \":\" +\n\t\t\t\t\t\t\t\t\"[0..0]\" + FINDING_SITE + \" != <<\" + BODY_STRUCTURE + \",\" +\n\t\t\t\t\t\t\t\t\"[1..*]\" + ASSOCIATED_MORPHOLOGY + \"= <<\" + STENOSIS)));\n\n\t}", "public void execute_multipleParameterPredicate_test(int expectedNum, String userInput, String parameter,\n boolean isIgnoreCase, boolean isAnd,\n List<Person> expectedList) throws ParseException {\n String expectedMessage = String.format(MESSAGE_PERSONS_LISTED_OVERVIEW, expectedNum);\n ContainsKeywordsPredicate predicate = prepareMultiPredicate(isIgnoreCase, isAnd, userInput, parameter);\n PatientFindCommand command = new PatientFindCommand(predicate);\n expectedModel.updateFilteredPersonList(predicate);\n assertCommandSuccess(command, model, commandHistory, expectedMessage, expectedModel);\n assertEquals(expectedList, model.getFilteredPersonList());\n }", "public static void main (String args[])\n\t {\n\t int set[] = {3, 34, 4, 12, 5, 2};\n\t int sum = 9;\n\t int n = set.length;\n\t if (isSubsetSum(set, n, sum) == true)\n\t System.out.println(\"Found a subset with given sum\");\n\t else\n\t System.out.println(\"No subset with given sum\");\n\t }", "public List<ParameterValueObject> getClustering(Filter filter);", "@Test\n \tpublic void whereClauseForNodeSameSpan() {\n \t\tnode23.addJoin(new SameSpan(node42));\n \t\tcheckWhereCondition(\n \t\t\t\tjoin(\"=\", \"_node23.text_ref\", \"_node42.text_ref\"),\n \t\t\t\tjoin(\"=\", \"_node23.left\", \"_node42.left\"),\n \t\t\t\tjoin(\"=\", \"_node23.right\", \"_node42.right\")\n \t\t);\n \t}", "@Test\r\n\tpublic void testAdjacency22() {\r\n\t\tBoardCell cell = board.getCell(2, 2);\r\n\t\tSet<BoardCell> testList = board.getAdjList(cell);\r\n\t\tassertTrue(testList != null);\r\n\t\tassertTrue(testList.contains(board.getCell(2, 1)));\r\n\t\tassertTrue(testList.contains(board.getCell(1, 2)));\r\n\t\tassertTrue(testList.contains(board.getCell(3, 2)));\r\n\t\tassertTrue(testList.contains(board.getCell(2, 3)));\r\n\t\tassertEquals(4, testList.size());\r\n\t}", "@Test\n\tvoid attributeGroupDisjunction2() {\n\t\tassertEquals(\n\t\t\t\"Match procedure with left OR right foot (grouped)\",\n\t\t\tSets.newHashSet(AMPUTATION_FOOT_LEFT, AMPUTATION_FOOT_RIGHT, AMPUTATION_FOOT_BILATERAL),\n\t\t\tstrings(selectConceptIds(\"< 71388002 |Procedure|: { 363704007 |Procedure site| = 22335008 |Left Foot| } OR { 363704007 |Procedure site| = 7769000 |Right Foot| }\")));\n\n\t}", "private int[][] generateCandidates(int[][] usageM){\n\t\t// 1. start with the complete set of attributes\n\t\tMap<Integer, List<Integer>> partitionAttributes = new HashMap<Integer,List<Integer>>();\n\t\tList<Integer> attributes = new ArrayList<Integer>();\n\t\tfor(int i=0;i<usageM[0].length;i++)\n\t\t\tattributes.add(i);\n\t\tpartitionAttributes.put(0, attributes);\n\t\t\n\t\t// 2. for each query, split this set of attributes into two set:\n\t\t// (i) attributes accessed by the query\n\t\t//\t (ii) attributes not-accessed by the query\n\t\tfor(int[] query: usageM){\n\t\t\tMap<Integer, List<Integer>> newPartitionAttributes = new HashMap<Integer,List<Integer>>();\n\t\t\tint partitionCount = partitionAttributes.size();\n\t\t\t\n\t\t\t// check each partition\n\t\t\tfor(int p: partitionAttributes.keySet()){\n\t\t\t\tList<Integer> attrs = partitionAttributes.get(p);\n\t\t\t\tboolean fullPartitionAccess = true;\n\t\t\t\tfor(int a: attrs){\n\t\t\t\t\tif(query[a]==0)\n\t\t\t\t\t\tfullPartitionAccess = false;\n\t\t\t\t}\n\n\t\t\t\tif(fullPartitionAccess){\n\t\t\t\t\tnewPartitionAttributes.put(p, attrs);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t//int newPartition = partitionAttributes.size();\n\t\t\t\t\tList<Integer> accessedAttrs = new ArrayList<Integer>();\n\t\t\t\t\tList<Integer> nonAccessedAttrs = new ArrayList<Integer>();\n\t\t\t\t\tfor(int a: attrs){\n\t\t\t\t\t\tif(query[a]==1)\n\t\t\t\t\t\t\taccessedAttrs.add(a);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tnonAccessedAttrs.add(a);\n\t\t\t\t\t}\n\t\t\t\t\tif(nonAccessedAttrs.size() > 0)\n\t\t\t\t\t\tnewPartitionAttributes.put(p, nonAccessedAttrs);\n\t\t\t\t\tif(accessedAttrs.size() > 0)\n\t\t\t\t\t\tnewPartitionAttributes.put(partitionCount++, accessedAttrs);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//System.out.println(newPartitionAttributes);\n\t\t\t\n\t\t\tpartitionAttributes = newPartitionAttributes;\n\t\t}\n\t\t\n\t\t\n\t\t// 3. we end up with a set of attribute sets; all attributes in \n\t\t//\t an attribute set are always accessed together.\n\t\tint[][] primaryPartitions = new int[partitionAttributes.size()][];\n\t\tint i=0;\n\t\tfor(int p: partitionAttributes.keySet()){\n\t\t\tList<Integer> attrs = partitionAttributes.get(p);\n\t\t\tprimaryPartitions[i] = new int[attrs.size()];\n\t\t\tfor(int j=0;j<attrs.size();j++)\n\t\t\t\tprimaryPartitions[i][j] = attrs.get(j);\n\t\t\ti++;\n\t\t}\n\t\t\n\t\treturn primaryPartitions;\n\t}", "@Test\n void test08_getAllAdjacentVertices() {\n graph.addEdge(\"a\", \"b\");\n graph.addEdge(\"a\", \"c\"); // add two edges\n\n List<String> check = new ArrayList<>();\n check.add(\"b\");\n check.add(\"c\"); // create mock up adjacent list\n\n if (!check.equals(graph.getAdjacentVerticesOf(\"a\"))) { // checks if both are same\n fail(\"graph didn't record adjacent vertices correctly\");\n }\n }", "private boolean checksetunions(Set<String> set, HashMap<String, ArrayList<String>> c) {\n\t\tObject[] ckeys = c.keySet().toArray();\r\n\t\tfor (int i = 0; i < c.keySet().size(); i++) {\r\n\t\t\tif (c.get(ckeys[i]).containsAll(set)) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "@Test\n public void testAccept() throws IOException {\n Predicate<GraphElementWithStatistics> predicate = new TimeWindowPredicate(new Date(0L), new Date(100L));\n RawGraphElementWithStatisticsPredicate rawPredicate = new RawGraphElementWithStatisticsPredicate(predicate);\n GraphElementWithStatistics gews1 = new GraphElementWithStatistics(new GraphElement(\n new Entity(\"type\", \"value\", \"summaryType\", \"summarySubType\", \"\", new Date(10L), new Date(90L))),\n new SetOfStatistics(\"count\", new Count(1)));\n assertTrue(predicate.accept(gews1));\n RawGraphElementWithStatistics rawGews1 = new RawGraphElementWithStatistics(ConversionUtils.getKeysFromGraphElement(gews1.getGraphElement()).getFirst(),\n ConversionUtils.getValueFromSetOfStatistics(gews1.getSetOfStatistics()));\n assertTrue(rawPredicate.accept(rawGews1));\n GraphElementWithStatistics gews2 = new GraphElementWithStatistics(new GraphElement(\n new Entity(\"type\", \"value\", \"summaryType\", \"summarySubType\", \"\", new Date(1000L), new Date(10000L))),\n new SetOfStatistics(\"count\", new Count(1)));\n assertFalse(predicate.accept(gews2));\n RawGraphElementWithStatistics rawGews2 = new RawGraphElementWithStatistics(ConversionUtils.getKeysFromGraphElement(gews2.getGraphElement()).getFirst(),\n ConversionUtils.getValueFromSetOfStatistics(gews2.getSetOfStatistics()));\n assertFalse(rawPredicate.accept(rawGews2));\n\n // Composite RawGraphElementWithStatisticsPredicate\n SummaryTypePredicate summaryTypePredicate = new SummaryTypeInSetPredicate(Collections.singleton(\"abc\"));\n Predicate<GraphElementWithStatistics> predicate2 = new CombinedPredicates(predicate, summaryTypePredicate, CombinedPredicates.Combine.OR);\n rawPredicate = new RawGraphElementWithStatisticsPredicate(predicate2);\n GraphElementWithStatistics gews3 = new GraphElementWithStatistics(new GraphElement(\n new Entity(\"type\", \"value\", \"abc\", \"summarySubType\", \"\", new Date(10L), new Date(90L))),\n new SetOfStatistics(\"count\", new Count(1)));\n assertTrue(predicate2.accept(gews1));\n assertTrue(predicate2.accept(gews3));\n rawGews1 = new RawGraphElementWithStatistics(ConversionUtils.getKeysFromGraphElement(gews3.getGraphElement()).getFirst(),\n ConversionUtils.getValueFromSetOfStatistics(gews3.getSetOfStatistics()));\n assertTrue(rawPredicate.accept(rawGews1));\n GraphElementWithStatistics gews4 = new GraphElementWithStatistics(new GraphElement(\n new Entity(\"type\", \"value\", \"summaryType\", \"summarySubType\", \"\", new Date(1000L), new Date(10000L))),\n new SetOfStatistics(\"count\", new Count(1)));\n assertFalse(predicate.accept(gews4));\n RawGraphElementWithStatistics rawGews4 = new RawGraphElementWithStatistics(ConversionUtils.getKeysFromGraphElement(gews4.getGraphElement()).getFirst(),\n ConversionUtils.getValueFromSetOfStatistics(gews4.getSetOfStatistics()));\n assertFalse(rawPredicate.accept(rawGews4));\n }", "public static boolean IS_SUBFEATURE(Feature a, int index_a, Feature b, int index_b) {\n\n boolean anotinb, bnotina;\n int i, ia, ib;\n\n if (index_a != index_b)\n Dataset.perror(\"Feature.class :: not the same feature (\" + index_a + \" != \" + index_b + \")\");\n if (!a.type.equals(b.type))\n Dataset.perror(\n \"Feature.class :: not the same type of feature (\" + a.type + \" != \" + b.type + \")\");\n\n if (IS_CONTINUOUS(a.type)) {\n if (a.dmin >= b.dmin) {\n if (a.dmax <= b.dmax) return true;\n else\n Dataset.perror(\n \"Feature.class :: inconsistency for subfeature check for : (\"\n + a.dmin\n + \", \"\n + a.dmax\n + \") subseteq (\"\n + b.dmin\n + \", \"\n + b.dmax\n + \") ? \");\n } else if (a.dmax < b.dmax)\n Dataset.perror(\n \"Feature.class :: inconsistency for subfeature check for : (\"\n + a.dmin\n + \", \"\n + a.dmax\n + \") subseteq (\"\n + b.dmin\n + \", \"\n + b.dmax\n + \") ? \");\n } else if (IS_INTEGER(a.type)) {\n if (a.imin >= b.imin) {\n if (a.imax <= b.imax) return true;\n else\n Dataset.perror(\n \"Feature.class :: inconsistency for subfeature check for : (\"\n + a.imin\n + \", \"\n + a.imax\n + \") subseteq (\"\n + b.imin\n + \", \"\n + b.imax\n + \") ? \");\n } else if (a.imax < b.imax)\n Dataset.perror(\n \"Feature.class :: inconsistency for subfeature check for : (\"\n + a.imin\n + \", \"\n + a.imax\n + \") subseteq (\"\n + b.imin\n + \", \"\n + b.imax\n + \") ? \");\n } else if (IS_NOMINAL(a.type)) {\n if (a.modalities == null) return true;\n else if (b.modalities != null) {\n anotinb = bnotina = false;\n ia = ib = -1;\n for (i = 0; i < a.modalities.size(); i++)\n if (!b.modalities.contains((String) a.modalities.elementAt(i))) {\n anotinb = true;\n ia = i;\n }\n for (i = 0; i < b.modalities.size(); i++)\n if (!a.modalities.contains((String) b.modalities.elementAt(i))) {\n bnotina = true;\n ib = i;\n }\n if ((anotinb) && (bnotina))\n Dataset.perror(\n \"Feature.class :: inconsistency for subfeature check for : \"\n + ((String) a.modalities.elementAt(ia))\n + \" not in b and \"\n + ((String) b.modalities.elementAt(ib))\n + \" not in a \");\n else if (!anotinb) return true;\n }\n } else Dataset.perror(\"Feature.class :: no Feature type for \" + a.type);\n\n return false;\n }", "private Boolean AreConditionListsSubset(List<ProgramCondition> ipList, List<ProgramCondition> tempList) {\n long c = ipList.stream().filter(p -> (tempList.stream().anyMatch(q -> q.condition.equals(p.condition)\n && q.pred == p.pred))).count();\n if(c == ipList.size())\n return true;\n return false;\n }" ]
[ "0.6033555", "0.60084385", "0.59673613", "0.59251887", "0.5787025", "0.5766385", "0.5744022", "0.5709267", "0.5709238", "0.5705721", "0.5589267", "0.5506614", "0.53755045", "0.5364915", "0.5317235", "0.5308397", "0.5302306", "0.52704215", "0.5259506", "0.5212562", "0.5196598", "0.51849425", "0.51792455", "0.5126945", "0.5109943", "0.50955075", "0.50710434", "0.506686", "0.5032022", "0.50283235", "0.50243586", "0.5000423", "0.498682", "0.4982638", "0.4970436", "0.49683264", "0.49511176", "0.4939863", "0.49348456", "0.4924517", "0.49217325", "0.49069273", "0.49065578", "0.48996815", "0.4892309", "0.48838642", "0.4872341", "0.48663077", "0.48602745", "0.48597175", "0.48408556", "0.48407134", "0.48330188", "0.4829339", "0.48293212", "0.48260313", "0.48220634", "0.4814551", "0.48000222", "0.4783511", "0.47763038", "0.476555", "0.4760381", "0.47496304", "0.4744804", "0.47315317", "0.46880016", "0.4681234", "0.46663144", "0.46537766", "0.46508884", "0.46487516", "0.46484753", "0.46472216", "0.46404454", "0.46350855", "0.46350202", "0.46304715", "0.46270463", "0.46244833", "0.46238962", "0.4618669", "0.46172246", "0.46132", "0.46124315", "0.46072468", "0.4598431", "0.45982307", "0.45965812", "0.45963326", "0.45955175", "0.45925122", "0.45802468", "0.45786113", "0.45773664", "0.45742887", "0.4570469", "0.45704618", "0.45643935", "0.45626822" ]
0.62535954
0
Test mixing single equal restrictions with multicolumn slice restrictions (e.g. clustering_0 = 1 AND (clustering_1, clustering_2) > (2, 3))
@Test public void testBoundsAsCompositesWithSingleEqAndSliceRestrictions() { CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC); ByteBuffer value1 = ByteBufferUtil.bytes(1); ByteBuffer value2 = ByteBufferUtil.bytes(2); ByteBuffer value3 = ByteBufferUtil.bytes(3); ByteBuffer value4 = ByteBufferUtil.bytes(4); ByteBuffer value5 = ByteBufferUtil.bytes(5); // clustering_0 = 1 AND (clustering_1, clustering_2) > (2, 3) Restriction singleEq = newSingleEq(cfMetaData, 0, value1); Restriction multiSlice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3); PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(singleEq).mergeWith(multiSlice); List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value1, value2, value3, EOC.END); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value1, EOC.END); // clustering_0 = 1 AND (clustering_1, clustering_2) > (2, 3) AND (clustering_1) < (4) singleEq = newSingleEq(cfMetaData, 0, value1); multiSlice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3); Restriction multiSlice2 = newMultiSlice(cfMetaData, 1, Bound.END, false, value4); restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(multiSlice2).mergeWith(singleEq).mergeWith(multiSlice); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value1, value2, value3, EOC.END); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value1, value4, EOC.START); // clustering_0 = 1 AND (clustering_1, clustering_2) => (2, 3) AND (clustering_1, clustering_2) <= (4, 5) singleEq = newSingleEq(cfMetaData, 0, value1); multiSlice = newMultiSlice(cfMetaData, 1, Bound.START, true, value2, value3); multiSlice2 = newMultiSlice(cfMetaData, 1, Bound.END, true, value4, value5); restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(multiSlice2).mergeWith(singleEq).mergeWith(multiSlice); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value1, value2, value3, EOC.NONE); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value1, value4, value5, EOC.END); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithTwoAscendingAndTwoDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.DESC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertEmptyComposite(bounds.get(1));\n\n // clustering_0 = 1 AND (clustering_1, clustering_2, clustering_3) > (2, 3, 4)\n Restriction eq = newSingleEq(cfMetaData, 0, value1);\n slice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n restrictions = restrictions.mergeWith(eq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2, clustering_3) > (2, 3, 4)\n Restriction in = newSingleIN(cfMetaData, 0, value1, value2);\n slice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n restrictions = restrictions.mergeWith(in);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n assertComposite(bounds.get(2), value2, value2, EOC.START);\n assertComposite(bounds.get(3), value2, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n assertComposite(bounds.get(2), value2, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(3), value2, EOC.END);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1, clustering_2, clustering_3) <= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) < (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4) AND (clustering_0, clustering_1) < (2, 3)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2, value3);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(1), value2, value3, EOC.START);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4) AND (clustering_0, clustering1, clustering_2, clustering_3) <= (4, 3, 2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value4, value3, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n assertComposite(bounds.get(2), value4, value3, value2, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(1), value4, value3, EOC.START);\n assertComposite(bounds.get(2), value4, value3, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithTwoClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsMixingAscendingDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.DESC, Sort.ASC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(3));\n\n // clustering_0 = 1 AND (clustering_1, clustering_2, clustering_3) > (2, 3, 4)\n Restriction eq = newSingleEq(cfMetaData, 0, value1);\n slice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n restrictions = restrictions.mergeWith(eq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(3));\n\n\n // (clustering_0, clustering1, clustering_2, clustering_3) <= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, value4, EOC.NONE);\n assertComposite(bounds.get(3), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) < (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(3), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4) AND (clustering_0, clustering_1) < (2, 3)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2, value3);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(5, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n assertComposite(bounds.get(4), value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(5, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertComposite(bounds.get(3), value2, EOC.START);\n assertComposite(bounds.get(4), value2, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4) AND (clustering_0, clustering1, clustering_2, clustering_3) <= (4, 3, 2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value4, value3, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(7, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n assertComposite(bounds.get(4), value4, value3, EOC.START);\n assertComposite(bounds.get(5), value4, value3, value2, value1, EOC.NONE);\n assertComposite(bounds.get(6), value4, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(7, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertComposite(bounds.get(3), value4, EOC.START);\n assertComposite(bounds.get(4), value4, value3, value2, EOC.START);\n assertComposite(bounds.get(5), value4, value3, value2, EOC.END);\n assertComposite(bounds.get(6), value4, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiEqAndSingleSliceRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n\n // (clustering_0, clustering_1) = (1, 2) AND clustering_2 > 3\n Restriction multiEq = newMultiEq(cfMetaData, 0, value1, value2);\n Restriction singleSlice = newSingleSlice(cfMetaData, 2, Bound.START, false, value3);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiEq).mergeWith(singleSlice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneAscendingAndOneDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n assertComposite(bounds.get(2), value2, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertComposite(bounds.get(1), value2, EOC.START);\n assertComposite(bounds.get(2), value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneDescendingAndOneAscendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0) > (1) AND (clustering_0, clustering1) < (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.END);\n assertComposite(bounds.get(2), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.END);\n assertComposite(bounds.get(1), value1, EOC.START);\n assertComposite(bounds.get(2), value1, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithTwoDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithOneEqRestrictionsAndTwoClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer clustering_0 = ByteBufferUtil.bytes(1);\n Restriction eq = newSingleEq(cfMetaData, 0, clustering_0);\n\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithSliceRestrictionsAndOneClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newSingleSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newSingleSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithSingleEqAndMultiEqRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) = (2, 3)\n Restriction singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction multiEq = newMultiEq(cfMetaData, 1, value2, value3);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiEq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n // clustering_0 = 1 AND clustering_1 = 2 AND (clustering_2, clustering_3) = (3, 4)\n singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction singleEq2 = newSingleEq(cfMetaData, 1, value2);\n multiEq = newMultiEq(cfMetaData, 2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(singleEq2).mergeWith(multiEq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n\n // (clustering_0, clustering_1) = (1, 2) AND clustering_2 = 3\n singleEq = newSingleEq(cfMetaData, 2, value3);\n multiEq = newMultiEq(cfMetaData, 0, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiEq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) = (2, 3) AND clustering_3 = 4\n singleEq = newSingleEq(cfMetaData, 0, value1);\n singleEq2 = newSingleEq(cfMetaData, 3, value4);\n multiEq = newMultiEq(cfMetaData, 1, value2, value3);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiEq).mergeWith(singleEq2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithOneEqRestrictionsAndOneClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC);\n\n ByteBuffer clustering_0 = ByteBufferUtil.bytes(1);\n Restriction eq = newSingleEq(cfMetaData, 0, clustering_0);\n\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneDescendingClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithSliceRestrictionsAndOneDescendingClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newSingleSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newSingleSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithSingleEqAndMultiINRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n ByteBuffer value5 = ByteBufferUtil.bytes(5);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) IN ((2, 3), (4, 5))\n Restriction singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction multiIN = newMultiIN(cfMetaData, 1, asList(value2, value3), asList(value4, value5));\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiIN);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(1), value1, value4, value5, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(1), value1, value4, value5, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) IN ((2, 3))\n singleEq = newSingleEq(cfMetaData, 0, value1);\n multiIN = newMultiIN(cfMetaData, 1, asList(value2, value3));\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiIN).mergeWith(singleEq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n // clustering_0 = 1 AND clustering_1 = 5 AND (clustering_2, clustering_3) IN ((2, 3), (4, 5))\n singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction singleEq2 = newSingleEq(cfMetaData, 1, value5);\n multiIN = newMultiIN(cfMetaData, 2, asList(value2, value3), asList(value4, value5));\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiIN).mergeWith(singleEq2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value5, value2, value3, EOC.START);\n assertComposite(bounds.get(1), value1, value5, value4, value5, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value5, value2, value3, EOC.END);\n assertComposite(bounds.get(1), value1, value5, value4, value5, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithEqAndSliceRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n\n Restriction eq = newSingleEq(cfMetaData, 0, value3);\n\n Restriction slice = newSingleSlice(cfMetaData, 1, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 1, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 1, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 1, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 1, Bound.START, false, value1);\n Restriction slice2 = newSingleSlice(cfMetaData, 1, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value2, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 1, Bound.START, true, value1);\n slice2 = newSingleSlice(cfMetaData, 1, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiEqRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n Restriction eq = newMultiEq(cfMetaData, 0, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithOneInRestrictionsAndOneClusteringColumn()\n {\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n Restriction in = newSingleIN(cfMetaData, 0, value1, value2, value3);\n\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(in);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.START);\n assertComposite(bounds.get(2), value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n assertComposite(bounds.get(1), value2, EOC.END);\n assertComposite(bounds.get(2), value3, EOC.END);\n }", "private static Restriction newMultiEq(CFMetaData cfMetaData, int firstIndex, ByteBuffer... values)\n {\n List<ColumnDefinition> columnDefinitions = new ArrayList<>();\n for (int i = 0; i < values.length; i++)\n {\n columnDefinitions.add(getClusteringColumnDefinition(cfMetaData, firstIndex + i));\n }\n return new MultiColumnRestriction.EQ(columnDefinitions, toMultiItemTerminal(values));\n }", "private boolean isSubsetOf(List<String> permissions2,\n\t\t\tList<String> permissions3) {\n\t\treturn false;\n\t}", "public interface IStoppingCriteria {\n\n /**\n * Determine the degree of clustering agreement\n * @param cluster1 one clustering results\n * @param cluster2 the other clustering results\n * @return the degree of clustering agreement; 1 refers to be the same clustering results; 0 refers to be the totally different clustering results\n */\n public double computeSimilarity(int[] cluster1, int[] cluster2);\n\n}", "private static Restriction newMultiSlice(CFMetaData cfMetaData, int firstIndex, Bound bound, boolean inclusive, ByteBuffer... values)\n {\n List<ColumnDefinition> columnDefinitions = new ArrayList<>();\n for (int i = 0; i < values.length; i++)\n {\n columnDefinitions.add(getClusteringColumnDefinition(cfMetaData, i + firstIndex));\n }\n return new MultiColumnRestriction.Slice(columnDefinitions, bound, inclusive, toMultiItemTerminal(values));\n }", "@Test\n public void testBoundsAsCompositesWithMultiInRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n Restriction in = newMultiIN(cfMetaData, 0, asList(value1, value2), asList(value2, value3));\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(in);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertComposite(bounds.get(1), value2, value3, EOC.END);\n }", "private boolean isSubsetOf(int firstRow, int secondRow) {\n for (int i = 0; i < universalSetSize; i++) {\n if (input[firstRow][i] && !input[secondRow][i]) {\n return false;\n }\n }\n return true;\n }", "@Test\n public void testBoundsAsCompositesWithEqAndInRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n Restriction eq = newSingleEq(cfMetaData, 0, value1);\n Restriction in = newSingleIN(cfMetaData, 1, value1, value2, value3);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(in);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.START);\n assertComposite(bounds.get(2), value1, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value1, EOC.END);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n assertComposite(bounds.get(2), value1, value3, EOC.END);\n }", "@Test\n public void testHeterogeneousSegmentFilterConditionLimit() throws SqlParseException {\n\n val project = \"heterogeneous_segment\";\n // val dfId = \"747f864b-9721-4b97-acde-0aa8e8656cba\"\n // val seg1Id = \"8892fa3f-f607-4eec-8159-7c5ae2f16942\"\n // val seg2Id = \"d75a822c-788a-4592-a500-cf20186dded1\"\n // val seg3Id = \"54eaf96d-6146-45d2-b94e-d5d187f89919\"\n // val seg4Id = \"411f40b9-a80a-4453-90a9-409aac6f7632\"\n // val seg5Id = \"a8318597-cb75-416f-8eb8-96ea285dd2b4\"\n // \n val sql = \"with T1 as (select cal_dt, trans_id \\n\" + \"from test_kylin_fact inner join test_account \\n\"\n + \"on test_kylin_fact.seller_id = test_account.account_id \\n\"\n + \"where cal_dt between date'2012-01-01' and date'2012-01-03'\\n\" + \"group by cal_dt, trans_id)\\n\";\n\n {\n val sqlWithTooManyOrs = sql + \" select * from T1 where \" + \"(cal_dt='2012-01-01' and trans_id = 1) or \\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 2) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 3) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 4) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 5) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 6) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 7) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 8) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 9) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 10) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 12) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 13) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 14) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 15) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 16) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 17) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 18) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 19) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 20)\";\n val contexts = OlapContextTestUtil.getOlapContexts(project, sqlWithTooManyOrs);\n Assert.assertEquals(\n \">=(DEFAULT.TEST_KYLIN_FACT.CAL_DT, 2012-01-01),<=(DEFAULT.TEST_KYLIN_FACT.CAL_DT, 2012-01-03)\",\n contexts.get(0).getExpandedFilterConditions().stream().map(RexNode::toString)\n .collect(Collectors.joining(\",\")));\n }\n\n {\n val sqlWithFilter = sql + \" select * from T1 where \" + \"(cal_dt='2012-01-01' and trans_id = 1) or \\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 2) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 3) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 4) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 5) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 6) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 7) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 8) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 9) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 10)\";\n val contexts = OlapContextTestUtil.getOlapContexts(project, sqlWithFilter);\n Assert.assertNotEquals(\n \">=(DEFAULT.TEST_KYLIN_FACT.CAL_DT, 2012-01-01),<=(DEFAULT.TEST_KYLIN_FACT.CAL_DT, 2012-01-03)\",\n contexts.get(0).getExpandedFilterConditions().stream().map(RexNode::toString)\n .collect(Collectors.joining(\",\")));\n }\n\n }", "private boolean subGridCheck() {\n\t\tint sqRt = (int)Math.sqrt(dimension);\n\t\tfor(int i = 0; i < sqRt; i++) {\n\t\t\tint increment = i * sqRt;\n\t\t\tfor(int val = 1; val <= dimension; val++) {\n\t\t\t\tint valCounter = 0;\n\t\t\t\tfor(int row = 0 + increment; row < sqRt + increment; row++) {\n\t\t\t\t\tfor(int col = 0 + increment; col < sqRt + increment; col++) {\n\t\t\t\t\t\tif(puzzle[row][col] == val)\n\t\t\t\t\t\t\tvalCounter++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(valCounter >= 2)\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "@Test\n \tpublic void whereClauseForNodeOverlap() {\n \t\tnode23.addJoin(new Overlap(node42));\n \t\tcheckWhereCondition(\n \t\t\t\tjoin(\"=\", \"_node23.text_ref\", \"_node42.text_ref\"),\n \t\t\t\tjoin(\"<=\", \"_node23.left\", \"_node42.right\"),\n \t\t\t\tjoin(\"<=\", \"_node42.left\", \"_node23.right\")\n \t\t);\n \t}", "@Test\r\n public void testIsSubset1() {\r\n Assert.assertEquals(false, set1.isSubset(set2));\r\n }", "private void createConstraintsForSingleton() {\n \t\tSet s = slice.entrySet();\n \t\tfor (Iterator iterator = s.iterator(); iterator.hasNext();) {\n \t\t\tMap.Entry entry = (Map.Entry) iterator.next();\n \t\t\tHashMap conflictingEntries = (HashMap) entry.getValue();\n \t\t\tif (conflictingEntries.size() < 2)\n \t\t\t\tcontinue;\n \n \t\t\tCollection conflictingVersions = conflictingEntries.values();\n \t\t\tString singletonRule = \"\"; //$NON-NLS-1$\n \t\t\tArrayList nonSingleton = new ArrayList();\n \t\t\tint countSingleton = 0;\n \t\t\tfor (Iterator conflictIterator = conflictingVersions.iterator(); conflictIterator.hasNext();) {\n \t\t\t\tIInstallableUnit conflictElt = (IInstallableUnit) conflictIterator.next();\n \t\t\t\tif (conflictElt.isSingleton()) {\n \t\t\t\t\tsingletonRule += \" -1 \" + getVariable(conflictElt); //$NON-NLS-1$\n \t\t\t\t\tcountSingleton++;\n \t\t\t\t} else {\n \t\t\t\t\tnonSingleton.add(conflictElt);\n \t\t\t\t}\n \t\t\t}\n \t\t\tif (countSingleton == 0)\n \t\t\t\tcontinue;\n \n \t\t\tfor (Iterator iterator2 = nonSingleton.iterator(); iterator2.hasNext();) {\n \t\t\t\tconstraints.add(singletonRule + \" -1 \" + getVariable((IInstallableUnit) iterator2.next()) + \" >= -1;\"); //$NON-NLS-1$ //$NON-NLS-2$\n \t\t\t}\n \t\t\tsingletonRule += \" >= -1;\"; //$NON-NLS-1$\n \t\t\tconstraints.add(singletonRule);\n \t\t}\n \t}", "@Test\n \tpublic void whereClauseForNodeRangedDominance() {\n \t\tnode23.addJoin(new Dominance(node42, 10, 20));\n \t\tcheckWhereCondition(\n //\t\t\t\tjoin(\"=\", \"_rank23.component_ref\", \"_rank42.component_ref\"),\n \t\t\t\tjoin(\"=\", \"_component23.type\", \"'d'\"),\n \t\t\t\t\"_component23.name IS NULL\",\n \t\t\t\tjoin(\"<\", \"_rank23.pre\", \"_rank42.pre\"),\n \t\t\t\tjoin(\"<\", \"_rank42.pre\", \"_rank23.post\"),\n \t\t\t\t\"_rank23.level BETWEEN SYMMETRIC _rank42.level - 10 AND _rank42.level - 20\"\n \n \t\t);\n \t}", "@Test\n\t public void test_Is_Subset_Positive() throws Exception{\t\n\t\t SET setarray= new SET( new int[]{1,2,3,4,5});\n\t\t SET subsetarray= new SET( new int[]{1,2,3});\n\t\t assertTrue(setarray.isSubSet(subsetarray));\t \n\t }", "public static void pseudoTrueTuples(LogicProblem logicProblem, boolean applyChanges)\r\n throws RelationshipConflictException {\n \r\n HashMap<ItemPair,Relationship> relationshipTable = logicProblem.getRelationshipTable();\r\n HashSet<CategoryPair> categoryPairs = logicProblem.getCategoryPairs();\r\n \r\n// System.out.println(\"searching...\");\r\n //within a subgrid\r\n for (CategoryPair categoryPair : categoryPairs) {\r\n// System.out.println(\"Category pair:\" + categoryPair);\r\n //vertical and horizontal search\r\n for (final boolean verticalOrientation : new boolean[] { false, true } ) {\r\n\r\n Category subrowCategory = verticalOrientation?categoryPair.first():categoryPair.last();\r\n Category subcolumnCategory = verticalOrientation?categoryPair.last():categoryPair.first();\r\n\r\n //commenting \"vertical search\" \r\n //(subrows match first category's items\r\n // subcolumns match second category's items)\r\n\r\n //i (2 to floor(n/2)) is the number of elements in the combination tuple\r\n // i=2 in pseudoTrue pairs\r\n //(for subgrids of 5x5 items, looking for both pairs and triplets becomes redundant\r\n for (int i=2; i<=floor(logicProblem.getNumCategories()/2);i++) {\r\n\r\n //https://github.com/dpaukov/combinatoricslib3/wiki/v3.3.0#1-simple-combinations\r\n List<List<Item>> columnCombinations = Generator.combination(subcolumnCategory.getItems())\r\n .simple(i) //for pseudo true pairs, i=2\r\n .stream()\r\n .collect(Collectors.<List<Item>>toList());\r\n //for i=2, this would contain \r\n //Bethany, Donovan\r\n //Bethany, Elizabeth\r\n //...\r\n //Frederick, Peyton\r\n// columnCombinations.stream().forEach(l -> System.out.println(\r\n// (verticalOrientation?\"vertical\":\"horizontal\")+ \" combo: \"+l.toString()));\r\n\r\n //create the sets\r\n //for each combination, start over\r\n \r\n //columnTuple contains i items with which we will compute set intersections\r\n for (List<Item> columnItemTuple : columnCombinations) {\r\n //Bethany, Donovan\r\n \r\n //similarly, valueNoSets contains i sets of VALUE_NO relationships\r\n List<Set<Item>> valueNoSets = new ArrayList<>(); //size=i\r\n //build a set for each i item of columnTuple\r\n for (Item columnItem : columnItemTuple) {\r\n //Bethany\r\n Set<Item> valueNoSet = new HashSet<>(); //size = n\r\n for (Item rowItem : subrowCategory.getItems()) {\r\n //Haley's Comet ....\r\n if (relationshipTable.get(new ItemPair(rowItem, columnItem)).getValue() == Relationship.ValueType.VALUE_NO)\r\n //stacking all VALUE_NO relationship into vertical set\r\n valueNoSet.add(rowItem); //store into single subcolumn set \r\n }\r\n //adding each vertical set into list of sets\r\n if (valueNoSet.size() >= logicProblem.getNumItems() - i //for pairs, we need three VALUE_NO in the set\r\n && valueNoSet.size() < logicProblem.getNumItems()-1) //uniqueness will take or n-1 cases\r\n valueNoSets.add(valueNoSet); //store single subcolumn into multi-set\r\n }\r\n //magic!\r\n Set<Item> intersectionSet = new HashSet<>(); //avoid NPE when the next call is made\r\n if (valueNoSets.size()>=2) //don't compute intersections otherwise\r\n intersectionSet = Processor.multiSetIntersection(valueNoSets);\r\n\r\n if (intersectionSet.size()==logicProblem.getNumItems()-i) {\r\n \r\n// System.out.println(\"----> found candidates for pseudo true pairs!\");\r\n// intersectionSet.stream().forEach(l -> System.out.println(\"\\t\" + l.toString()));\r\n// System.out.println(\"\\t\\tvs.\");\r\n// columnItemTuple.stream().forEach(l -> System.out.println(\"\\t\" + l.toString()));\r\n \r\n //create predecessor list\r\n //we can only add the intersection output as predecessors\r\n ArrayList<Dependable> predecessors = new ArrayList<Dependable>();\r\n for (Item intersectionColumn : intersectionSet) {\r\n for (Item rowItem : columnItemTuple) {\r\n predecessors.add(relationshipTable.get(new ItemPair(rowItem, intersectionColumn)));\r\n }\r\n }\r\n\r\n\r\n //we have a bunch of work to do\r\n for (Item everyRowItem : subrowCategory.getItems()) {\r\n //for every row item not in the intersectionSet\r\n if (!intersectionSet.contains(everyRowItem)) {\r\n for (Item everyColumnItem : subcolumnCategory.getItems()) {\r\n //for every column item not in any of the columnTuple list\r\n if (!columnItemTuple.contains(everyColumnItem)) {\r\n Relationship rel = relationshipTable.get(new ItemPair(everyRowItem,everyColumnItem));\r\n if (rel.getValue()!=Relationship.ValueType.VALUE_NO)\r\n Processor.setRelationship(logicProblem, applyChanges, rel, \r\n Relationship.ValueType.VALUE_NO, Relationship.LogicType.PSEUDOTRUE,\r\n predecessors.toArray(new Relationship[predecessors.size()])); \r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }", "@Test\n public void testOverlappingPartitionsOverlappingClusters()\n {\n check(overlappingClustersWithOverlappingPartitions(), 0.75, 1.0);\n }", "@Test\n \tpublic void whereClauseForNodeLeftOverlap() {\n \t\tnode23.addJoin(new LeftOverlap(node42));\n \t\tcheckWhereCondition(\n \t\t\t\tjoin(\"=\", \"_node23.text_ref\", \"_node42.text_ref\"),\n \t\t\t\tjoin(\"<=\", \"_node23.left\", \"_node42.left\"),\n \t\t\t\tjoin(\"<=\", \"_node42.left\", \"_node23.right\"),\n \t\t\t\tjoin(\"<=\", \"_node23.right\", \"_node42.right\")\n \t\t);\n \t}", "public static boolean IS_SUBFEATURE(Feature a, int index_a, Feature b, int index_b) {\n\n boolean anotinb, bnotina;\n int i, ia, ib;\n\n if (index_a != index_b)\n Dataset.perror(\"Feature.class :: not the same feature (\" + index_a + \" != \" + index_b + \")\");\n if (!a.type.equals(b.type))\n Dataset.perror(\n \"Feature.class :: not the same type of feature (\" + a.type + \" != \" + b.type + \")\");\n\n if (IS_CONTINUOUS(a.type)) {\n if (a.dmin >= b.dmin) {\n if (a.dmax <= b.dmax) return true;\n else\n Dataset.perror(\n \"Feature.class :: inconsistency for subfeature check for : (\"\n + a.dmin\n + \", \"\n + a.dmax\n + \") subseteq (\"\n + b.dmin\n + \", \"\n + b.dmax\n + \") ? \");\n } else if (a.dmax < b.dmax)\n Dataset.perror(\n \"Feature.class :: inconsistency for subfeature check for : (\"\n + a.dmin\n + \", \"\n + a.dmax\n + \") subseteq (\"\n + b.dmin\n + \", \"\n + b.dmax\n + \") ? \");\n } else if (IS_INTEGER(a.type)) {\n if (a.imin >= b.imin) {\n if (a.imax <= b.imax) return true;\n else\n Dataset.perror(\n \"Feature.class :: inconsistency for subfeature check for : (\"\n + a.imin\n + \", \"\n + a.imax\n + \") subseteq (\"\n + b.imin\n + \", \"\n + b.imax\n + \") ? \");\n } else if (a.imax < b.imax)\n Dataset.perror(\n \"Feature.class :: inconsistency for subfeature check for : (\"\n + a.imin\n + \", \"\n + a.imax\n + \") subseteq (\"\n + b.imin\n + \", \"\n + b.imax\n + \") ? \");\n } else if (IS_NOMINAL(a.type)) {\n if (a.modalities == null) return true;\n else if (b.modalities != null) {\n anotinb = bnotina = false;\n ia = ib = -1;\n for (i = 0; i < a.modalities.size(); i++)\n if (!b.modalities.contains((String) a.modalities.elementAt(i))) {\n anotinb = true;\n ia = i;\n }\n for (i = 0; i < b.modalities.size(); i++)\n if (!a.modalities.contains((String) b.modalities.elementAt(i))) {\n bnotina = true;\n ib = i;\n }\n if ((anotinb) && (bnotina))\n Dataset.perror(\n \"Feature.class :: inconsistency for subfeature check for : \"\n + ((String) a.modalities.elementAt(ia))\n + \" not in b and \"\n + ((String) b.modalities.elementAt(ib))\n + \" not in a \");\n else if (!anotinb) return true;\n }\n } else Dataset.perror(\"Feature.class :: no Feature type for \" + a.type);\n\n return false;\n }", "private boolean isSubset(List<ConceptLabel> outer, List<ConceptLabel> inner){\n\t\tfor(ConceptLabel in: inner){\n\t\t\tboolean c = false;\n\t\t\tfor(ConceptLabel l: outer){\n\t\t\t\tif(l.getText().equals(in.getText())){\n\t\t\t\t\tc = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(!c)\n\t\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "@Test\n \tpublic void whereClauseForNodeRightOverlap() {\n \t\tnode23.addJoin(new RightOverlap(node42));\n \t\tcheckWhereCondition(\n \t\t\t\tjoin(\"=\", \"_node23.text_ref\", \"_node42.text_ref\"),\n \t\t\t\tjoin(\">=\", \"_node23.right\", \"_node42.right\"),\n \t\t\t\tjoin(\">=\", \"_node42.right\", \"_node23.left\"),\n \t\t\t\tjoin(\">=\", \"_node23.left\", \"_node42.left\")\n \t\t);\n \t}", "@Test\n \tpublic void whereClauseForNodeSameSpan() {\n \t\tnode23.addJoin(new SameSpan(node42));\n \t\tcheckWhereCondition(\n \t\t\t\tjoin(\"=\", \"_node23.text_ref\", \"_node42.text_ref\"),\n \t\t\t\tjoin(\"=\", \"_node23.left\", \"_node42.left\"),\n \t\t\t\tjoin(\"=\", \"_node23.right\", \"_node42.right\")\n \t\t);\n \t}", "List<Trueorfalse> selectByExample(RowBounds rowBounds);", "public interface CustomerSubsetFilterStrategy {\r\n Set<Customer> applyFilter(List<Customer> customers);\r\n}", "public void addRestrictions()\n\t{\n\t\tfor(int i=0;i<n;i++)\n\t\t{\n\t\t\tfor(int j=0;j<n;j++)\n\t\t\t{\t\t\t\t\n\t\t\t\tif(restriction[i][j] == 1 )\n\t\t\t\t{\n\t\t\t\t\tcost[i][j] = 1000000000;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "@Test\n void test_setDeny_multi_range() {\n String[] denyRules = {\"1.0.0.10/30\", \"1.0.1.2/31\", \"1.0.1.3/31\", \"1.0.20.3/30\", \"1.0.20.1/29\"};\n ipFilterConfiguration.setDeny(Arrays.asList(denyRules));\n TreeMap<Long, Ipv4Subnet> deny = ipFilterConfiguration.getDeny();\n\n // when\n String[] expectDenyRanges = {\"1.0.0.8/30\", \"1.0.1.2/31\", \"1.0.20.0/29\"};\n Map<Long, Ipv4Subnet> expect = new HashMap<>();\n for (String expectDenyRange : expectDenyRanges) {\n Ipv4Subnet subnet = new Ipv4Subnet(expectDenyRange);\n expect.put(subnet.getStartIpLong(), subnet);\n }\n\n // then\n Stream<Executable> executables = expect.keySet().stream()\n .map(expect::get)\n .map(expectValues -> () -> assertAll(\n String.format(\"test range start with %s\", expectValues.getIpLong()),\n () -> assertNotNull(deny.get(expectValues.getStartIpLong())),\n () -> assertEquals(expectValues.getCidr(), deny.get(expectValues.getStartIpLong()).getCidr()),\n () -> assertEquals(expectValues.getStartIpLong(), deny.get(expectValues.getStartIpLong()).getStartIpLong()),\n () -> assertEquals(expectValues.getEndIpLong(), deny.get(expectValues.getStartIpLong()).getEndIpLong())\n ));\n assertAll(\"test if deny rules are nested, then aggregate (even if different mask)\",\n () -> assertEquals(3, deny.size()),\n () -> assertAll(executables));\n }", "@Test\n public void testIntersection6()\n {\n List<Integer> expected = new ArrayList<>();\n ConciseSet set1 = new ConciseSet();\n for (int i = 0; i < 5; i++) {\n set1.add(i);\n }\n for (int i = 1000; i < 1005; i++) {\n set1.add(i);\n }\n\n ConciseSet set2 = new ConciseSet();\n for (int i = 800; i < 805; i++) {\n set2.add(i);\n }\n for (int i = 806; i < 1005; i++) {\n set2.add(i);\n }\n\n for (int i = 1000; i < 1005; i++) {\n expected.add(i);\n }\n\n verifyIntersection(expected, set1, set2);\n }", "private Boolean AreConditionListsSubset(List<ProgramCondition> ipList, List<ProgramCondition> tempList) {\n long c = ipList.stream().filter(p -> (tempList.stream().anyMatch(q -> q.condition.equals(p.condition)\n && q.pred == p.pred))).count();\n if(c == ipList.size())\n return true;\n return false;\n }", "protected boolean applySubsetRule(Node value) {\n\n int type;\n int sizeParents;\n boolean isAppliedRule = false;\n Node auxI;\n Node auxJ;\n int i;\n NodeList auxNodeList = new NodeList();\n Node auxNode;\n\n\n //If the subset rule is forbidden then the methods finishes\n if (canApplySubsetRule == false) {\n return false;\n } else {\n\n type = value.getKindOfNode();\n\n if (type == Node.UTILITY) {\n return false;\n } else {//(type == Node.SUPER_VALUE)\n NodeList parents = diag.parents(value);\n sizeParents = parents.size();\n\n //See if subset rule can be applied to some ancestors\t\t\t\n for (i = 0; (i < sizeParents) && (isAppliedRule == false); i++) {\n isAppliedRule = applySubsetRule(parents.elementAt(i));\n }\n if (isAppliedRule) {\n indexOperation++;\n try {\n diag.save(\"debug-operation-\" + indexOperation + \".elv\");\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n }\n if (isAppliedRule == false) {\n //See if subset rule can be applied to two utility parents\n for (i = 0; (i < sizeParents - 1) && (isAppliedRule == false); i++) {\n auxI = parents.elementAt(i);\n if (auxI.getKindOfNode() == Node.UTILITY) {\n for (int j = i + 1; (j < sizeParents) && (isAppliedRule == false); j++) {\n auxJ = parents.elementAt(j);\n if (auxJ.getKindOfNode() == Node.UTILITY) {\n if (verifySubsetRule(auxI, auxJ)) {\n String operation =\n \"Apply subset rule to: \" + auxI.getName() + \" and \" + auxJ.getName();\n\n statistics.addOperation(operation);\n System.out.println(operation);\n\n auxNodeList.insertNode(auxI);\n auxNodeList.insertNode(auxJ);\n auxNode = introduceSVNode(auxNodeList, value);\n System.out.println(\"Nodo introducido por la subset rule anterior: \" + auxNode.getName());\n ReductionAndEvalID.reduceNode((IDWithSVNodes) diag, auxNode);\n System.out.println(\"Reducción del nodo: \" + auxNode.getName());\n\n statistics.addSize(diag.calculateSizeOfPotentials());\n statistics.addTime(crono.getTime());\n\n\n isAppliedRule = true;\n\n indexOperation++;\n try {\n diag.save(\"debug-operation-\" + indexOperation + \".elv\");\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n\n\n }\n }\n }\n }\n }\n\n }\n }\n\n return isAppliedRule;\n }\n }", "@Test\n public void testIntersection4()\n {\n List<Integer> expected = new ArrayList<>();\n ConciseSet set1 = new ConciseSet();\n ConciseSet set2 = new ConciseSet();\n for (int i = 0; i < 1000; i++) {\n set1.add(i);\n if (i != 500) {\n set2.add(i);\n expected.add(i);\n }\n }\n\n verifyIntersection(expected, set1, set2);\n }", "private int[][] generateCandidates(int[][] usageM){\n\t\t// 1. start with the complete set of attributes\n\t\tMap<Integer, List<Integer>> partitionAttributes = new HashMap<Integer,List<Integer>>();\n\t\tList<Integer> attributes = new ArrayList<Integer>();\n\t\tfor(int i=0;i<usageM[0].length;i++)\n\t\t\tattributes.add(i);\n\t\tpartitionAttributes.put(0, attributes);\n\t\t\n\t\t// 2. for each query, split this set of attributes into two set:\n\t\t// (i) attributes accessed by the query\n\t\t//\t (ii) attributes not-accessed by the query\n\t\tfor(int[] query: usageM){\n\t\t\tMap<Integer, List<Integer>> newPartitionAttributes = new HashMap<Integer,List<Integer>>();\n\t\t\tint partitionCount = partitionAttributes.size();\n\t\t\t\n\t\t\t// check each partition\n\t\t\tfor(int p: partitionAttributes.keySet()){\n\t\t\t\tList<Integer> attrs = partitionAttributes.get(p);\n\t\t\t\tboolean fullPartitionAccess = true;\n\t\t\t\tfor(int a: attrs){\n\t\t\t\t\tif(query[a]==0)\n\t\t\t\t\t\tfullPartitionAccess = false;\n\t\t\t\t}\n\n\t\t\t\tif(fullPartitionAccess){\n\t\t\t\t\tnewPartitionAttributes.put(p, attrs);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t//int newPartition = partitionAttributes.size();\n\t\t\t\t\tList<Integer> accessedAttrs = new ArrayList<Integer>();\n\t\t\t\t\tList<Integer> nonAccessedAttrs = new ArrayList<Integer>();\n\t\t\t\t\tfor(int a: attrs){\n\t\t\t\t\t\tif(query[a]==1)\n\t\t\t\t\t\t\taccessedAttrs.add(a);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tnonAccessedAttrs.add(a);\n\t\t\t\t\t}\n\t\t\t\t\tif(nonAccessedAttrs.size() > 0)\n\t\t\t\t\t\tnewPartitionAttributes.put(p, nonAccessedAttrs);\n\t\t\t\t\tif(accessedAttrs.size() > 0)\n\t\t\t\t\t\tnewPartitionAttributes.put(partitionCount++, accessedAttrs);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//System.out.println(newPartitionAttributes);\n\t\t\t\n\t\t\tpartitionAttributes = newPartitionAttributes;\n\t\t}\n\t\t\n\t\t\n\t\t// 3. we end up with a set of attribute sets; all attributes in \n\t\t//\t an attribute set are always accessed together.\n\t\tint[][] primaryPartitions = new int[partitionAttributes.size()][];\n\t\tint i=0;\n\t\tfor(int p: partitionAttributes.keySet()){\n\t\t\tList<Integer> attrs = partitionAttributes.get(p);\n\t\t\tprimaryPartitions[i] = new int[attrs.size()];\n\t\t\tfor(int j=0;j<attrs.size();j++)\n\t\t\t\tprimaryPartitions[i][j] = attrs.get(j);\n\t\t\ti++;\n\t\t}\n\t\t\n\t\treturn primaryPartitions;\n\t}", "Boolean isCollinearTo(IVec3 v);", "public static void main(String[]args){\n\r\n int []arr = new int[100];\r\n int []arr2 = new int[50];\r\n int []arr3 = {1,2,3,4,5,6,7,8};\r\n int number = 5;\r\n LogicalOp op = new LogicalOp();\r\n// op.writeOnArray(arr);\r\n\r\n// arr2 = op.evenArray(arr2);\r\n// for(int i=0;i<arr2.length;i++)\r\n// System.out.println(arr2[i]);\r\n\r\n //System.out.println(\"Mean value: \"+op.meanValue(arr3));\r\n\r\n// String[] arrOfStr = {\"ana\",\"are\",\"mere\",\"pere\",\"mere\"};\r\n// String str = \"mere\";\r\n// System.out.println(op.isContaingString(arrOfStr,str));\r\n\r\n// System.out.println(op.findPosition(arr3,number));\r\n\r\n //op.displayLines();\r\n\r\n// int[]modifArr = op.modifiedArr(arr3,number);\r\n// for(int item: modifArr)\r\n// System.out.print(item+\" \");\r\n\r\n\r\n //System.out.println(\"Second minimum: \"+op.secondMin(arr3));\r\n\r\n int[] empty = new int[arr3.length];\r\n empty = op.populateArray(arr3,empty);\r\n for(int item:empty)\r\n System.out.print(item+\" \");\r\n\r\n\r\n\r\n }", "Boolean subset(MultiSet<X> s);", "@Test\n public void testHardClustersWithOverlappingPartitions()\n {\n check(hardClustersWithOverlappingPartitions(), 0.0, 1.0);\n }", "private boolean checkRowCol(int c1, int c2, int c3) \r\n {\r\n return ((c1 != -1) && (c1 == c2) && (c2 == c3)); //eida ekhon porjonto kaaj e lage nai\r\n }", "private static Restriction newSingleSlice(CFMetaData cfMetaData, int index, Bound bound, boolean inclusive, ByteBuffer value)\n {\n ColumnDefinition columnDef = getClusteringColumnDefinition(cfMetaData, index);\n return new SingleColumnRestriction.Slice(columnDef, bound, inclusive, toTerm(value));\n }", "boolean verifications(int i, int j, int val) { \r\n return (verifCarre(i-i%nCarre, j-j%nCarre, val) && verifLigne(i, val) && verifColonne(j, val)); \r\n }", "static boolean isSubset(int Tab1[], int Tab2[], int m, int n)\n {\n // compléter\n //Trouver le max de Tab1[]\n int max=Tab1[0];\n for(int i = 1; i < m; i++) {\n\t\t\tif (Tab1[i]>max){\n max=Tab1[i];\n }\n\t\t}\n \n\t\t//Stockage de la Tab1 dans une table de hashage\n\t\tint[] hashTable = new int[max];\n\t\tfor(int i = 0; i < m; i++) {\n\t\t\thashTable[hash(Tab1[i], max)] = Tab1[i];\n\t\t}\n\t\t\n\t\t//verifier que chaque element (de Tab2) existe dans la hashtable\n\t\tfor(int j = 0; j < n; j++) {\n\t\t\tif(Tab2[j] != hashTable[hash(Tab2[j], max)]) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t}\n return true;\n \n //Complexite aymptotique :\n /*\n Puisque la boucle qui a le plus d'itérations est celle avec l'élément m, la compléxité\n asymptotique est O(m).\n f(m,n) = 2m + n = O(m), puisque m > n\n */\n \n\n }", "boolean checkValidity(int side1, int side2, int side3);", "public boolean percolates()\r\n { return uf.find(0) == uf.find(dimension*dimension + 1); }", "@Test\n public void testIntersection3()\n {\n List<Integer> expected = new ArrayList<>();\n ConciseSet set1 = new ConciseSet();\n ConciseSet set2 = new ConciseSet();\n for (int i = 0; i < 1000; i++) {\n set1.add(i);\n set2.add(i);\n expected.add(i);\n }\n\n verifyIntersection(expected, set1, set2);\n }", "@Test\n\t public void test_Is_Subset_Negative() throws Exception{\t\n\t\t SET setarray= new SET( new int[]{1,2,3,4,5});\n\t\t SET subsetarray= new SET( new int[]{7,8});\n\t\t assertFalse(setarray.isSubSet(subsetarray));\t \n\t }", "@Test\n \tpublic void whereClauseForNodeEdgeAnnotation() {\n \t\tnode23.addEdgeAnnotation(new Annotation(\"namespace1\", \"name1\"));\n \t\tnode23.addEdgeAnnotation(new Annotation(\"namespace2\", \"name2\", \"value2\", TextMatching.EXACT_EQUAL));\n \t\tnode23.addEdgeAnnotation(new Annotation(\"namespace3\", \"name3\", \"value3\", TextMatching.REGEXP_EQUAL));\n \t\tcheckWhereCondition(\n \t\t\t\tjoin(\"=\", \"_rank_annotation23_1.edge_annotation_namespace\", \"'namespace1'\"),\n \t\t\t\tjoin(\"=\", \"_rank_annotation23_1.edge_annotation_name\", \"'name1'\"),\n \t\t\t\tjoin(\"=\", \"_rank_annotation23_2.edge_annotation_namespace\", \"'namespace2'\"),\n \t\t\t\tjoin(\"=\", \"_rank_annotation23_2.edge_annotation_name\", \"'name2'\"),\n \t\t\t\tjoin(\"=\", \"_rank_annotation23_2.edge_annotation_value\", \"'value2'\"),\n \t\t\t\tjoin(\"=\", \"_rank_annotation23_3.edge_annotation_namespace\", \"'namespace3'\"),\n \t\t\t\tjoin(\"=\", \"_rank_annotation23_3.edge_annotation_name\", \"'name3'\"),\n \t\t\t\tjoin(\"~\", \"_rank_annotation23_3.edge_annotation_value\", \"'^value3$'\")\n \t\t);\n \t}", "@Test\n public void testIntersection5()\n {\n final int[] ints1 = {33, 100000};\n final int[] ints2 = {34, 200000};\n List<Integer> expected = new ArrayList<>();\n\n ConciseSet set1 = new ConciseSet();\n for (int i : ints1) {\n set1.add(i);\n }\n ConciseSet set2 = new ConciseSet();\n for (int i : ints2) {\n set2.add(i);\n }\n\n verifyIntersection(expected, set1, set2);\n }", "@Test\n \tpublic void whereClauseForNodeExactDominance() {\n \t\tnode23.addJoin(new Dominance(node42, 10));\n \t\tcheckWhereCondition(\n //\t\t\t\tjoin(\"=\", \"_rank23.component_ref\", \"_rank42.component_ref\"),\n \t\t\t\tjoin(\"=\", \"_component23.type\", \"'d'\"),\n \t\t\t\t\"_component23.name IS NULL\",\n \t\t\t\tjoin(\"<\", \"_rank23.pre\", \"_rank42.pre\"),\n \t\t\t\tjoin(\"<\", \"_rank42.pre\", \"_rank23.post\"),\n \t\t\t\tjoin(\"=\", \"_rank23.level\", \"_rank42.level\", -10)\n \t\t);\n \t}", "private static boolean areOverlapping( int ix0, int ix1, int len )\n {\n if( ix0<ix1 ){\n return ix0+len>ix1;\n }\n else {\n return ix1+len>ix0;\n }\n }", "public boolean subset(ZYSet<ElementType> potentialSubset){\n for(ElementType e:potentialSubset){\n if(!this.contains(e)){\n return false;\n }\n }\n return true;\n }", "private void checkNeqContradictions(HashMap<ComparableExpression, HashSet<ComparableExpression>> cNeq,\n HashMap<TimeSelector, Long> lowerBounds,\n HashMap<TimeSelector, Long> upperBounds)\n throws QueryContradictoryException {\n ArrayList<ArrayList<ComparableExpression>> neq = relationToTuples(cNeq);\n for (ArrayList<ComparableExpression> tuple : neq) {\n if (tuple.get(0) instanceof TimeSelector) {\n TimeSelector sel = (TimeSelector) tuple.get(0);\n // if lower(sel)!=upper(sel), no constraint sel!=x is contradictory\n if (!lowerBounds.get(sel).equals(upperBounds.get(sel))) {\n return;\n }\n // selector1 != selector2 only contradictory if both selectors have the same fixed value\n // (lower(selector1)=upper(selector1)=lower(selector2)=upper(selector2)\n if (tuple.get(1) instanceof TimeSelector) {\n TimeSelector sel2 = (TimeSelector) tuple.get(1);\n if (lowerBounds.get(sel).equals(lowerBounds.get(sel2)) &&\n lowerBounds.get(sel2).equals(upperBounds.get(sel2))) {\n throw new QueryContradictoryException();\n } // selector != literal only contradictory if lower(selector)=upper(selector)=literal\n } else if (tuple.get(1) instanceof TimeLiteral) {\n Long literalValue = ((TimeLiteral) tuple.get(1)).getMilliseconds();\n if (lowerBounds.get(sel).equals(literalValue)) {\n throw new QueryContradictoryException();\n }\n }\n } else if (tuple.get(0) instanceof TimeLiteral && tuple.get(1) instanceof TimeSelector) {\n // selector != literal only contradictory if lower(selector)=upper(selector)=literal\n TimeSelector sel = (TimeSelector) tuple.get(1);\n Long literalValue = ((TimeLiteral) tuple.get(0)).getMilliseconds();\n if (lowerBounds.get(sel).equals(upperBounds.get(sel)) && lowerBounds.get(sel).equals(literalValue)) {\n throw new QueryContradictoryException();\n }\n }\n }\n }", "private boolean runMultiSampleCase() {\n\t\tArrayList<Candidate> candidates = collectTrioCandidates();\n\n\t\t// Then, check the candidates for all trios around affected individuals.\n\t\tfor (Candidate c : candidates)\n\t\t\tif (isCompatibleWithTriosAroundAffected(c))\n\t\t\t\treturn true;\n\t\treturn false;\n\t}", "@Test\n public void testFilterPushDown() throws IOException { 'bla' as (x, y);\n // B = load 'morebla' as (a, b);\n // C = join A on x, B on a;\n // D = filter C by x = a and x = 0 and b = 1 and y = b;\n // store D into 'whatever';\n \n // A = load\n LogicalPlan lp = new LogicalPlan();\n {\n \tLogicalSchema aschema = new LogicalSchema();\n \taschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"x\", null, DataType.INTEGER));\n \taschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"y\", null, DataType.INTEGER));\n \taschema.getField(0).uid = 1;\n \taschema.getField(1).uid = 2;\n \tLOLoad A = new LOLoad(new FileSpec(\"bla\", new FuncSpec(\"PigStorage\", \"\\t\")), aschema, lp);\n \tlp.add(A);\n\t \n \t// B = load\n \tLogicalSchema bschema = new LogicalSchema();\n \tbschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"a\", null, DataType.INTEGER));\n \tbschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"b\", null, DataType.INTEGER));\n \tbschema.getField(0).uid = 3;\n \tbschema.getField(1).uid = 4;\n \tLOLoad B = new LOLoad(null, bschema, lp);\n \tlp.add(B);\n\t \n \t// C = join\n \tLogicalSchema cschema = new LogicalSchema();\n \tcschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"x\", null, DataType.INTEGER));\n \tcschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"y\", null, DataType.INTEGER));\n \tcschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"a\", null, DataType.INTEGER));\n \tcschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"b\", null, DataType.INTEGER));\n \tcschema.getField(0).uid = 1;\n \tcschema.getField(1).uid = 2;\n \tcschema.getField(2).uid = 3;\n \tcschema.getField(3).uid = 4;\n \tLogicalExpressionPlan aprojplan = new LogicalExpressionPlan();\n \tProjectExpression x = new ProjectExpression(aprojplan, DataType.INTEGER, 0, 0);\n \tx.neverUseForRealSetUid(1);\n \tLogicalExpressionPlan bprojplan = new LogicalExpressionPlan();\n \tProjectExpression y = new ProjectExpression(bprojplan, DataType.INTEGER, 1, 0);\n \ty.neverUseForRealSetUid(3);\n \tMultiMap<Integer, LogicalExpressionPlan> mm = \n \tnew MultiMap<Integer, LogicalExpressionPlan>();\n \tmm.put(0, aprojplan);\n \tmm.put(1, bprojplan);\n \tLOJoin C = new LOJoin(lp, mm, JOINTYPE.HASH, new boolean[] {true, true});\n \tC.neverUseForRealSetSchema(cschema);\n \tlp.add(C);\n \tlp.connect(A, C);\n \tlp.connect(B, C);\n \n \t// D = filter\n \tLogicalExpressionPlan filterPlan = new LogicalExpressionPlan();\n \tProjectExpression fx = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 0);\n \tfx.neverUseForRealSetUid(1);\n \tConstantExpression fc0 = new ConstantExpression(filterPlan, DataType.INTEGER, new Integer(0));\n \tEqualExpression eq1 = new EqualExpression(filterPlan, fx, fc0);\n \tProjectExpression fanotherx = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 0);\n \tfanotherx.neverUseForRealSetUid(1);\n \tProjectExpression fa = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 2);\n \tfa.neverUseForRealSetUid(3);\n \tEqualExpression eq2 = new EqualExpression(filterPlan, fanotherx, fa);\n \tAndExpression and1 = new AndExpression(filterPlan, eq1, eq2);\n \tProjectExpression fb = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 3);\n \tfb.neverUseForRealSetUid(4);\n \tConstantExpression fc1 = new ConstantExpression(filterPlan, DataType.INTEGER, new Integer(1));\n \tEqualExpression eq3 = new EqualExpression(filterPlan, fb, fc1);\n \tAndExpression and2 = new AndExpression(filterPlan, and1, eq3);\n \tProjectExpression fanotherb = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 3);\n \tfanotherb.neverUseForRealSetUid(4);\n \tProjectExpression fy = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 1);\n \tfy.neverUseForRealSetUid(2);\n \tEqualExpression eq4 = new EqualExpression(filterPlan, fy, fanotherb);\n \tnew AndExpression(filterPlan, and2, eq4);\n \n \tLOFilter D = new LOFilter(lp, filterPlan);\n \tD.neverUseForRealSetSchema(cschema);\n \t// Connect D to B, since the transform has happened.\n \tlp.add(D);\n \tlp.connect(C, D);\n }\n \n LogicalPlanOptimizer optimizer = new LogicalPlanOptimizer(lp, 500);\n optimizer.optimize();\n \n LogicalPlan expected = new LogicalPlan();\n {\n // A = load\n \tLogicalSchema aschema = new LogicalSchema();\n \taschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"x\", null, DataType.INTEGER));\n \taschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"y\", null, DataType.INTEGER));\n \taschema.getField(0).uid = 1;\n \taschema.getField(1).uid = 2;\n \tLOLoad A = new LOLoad(new FileSpec(\"bla\", new FuncSpec(\"PigStorage\", \"\\t\")), aschema, expected);\n \texpected.add(A);\n \t\n \t// DA = filter\n \tLogicalExpressionPlan DAfilterPlan = new LogicalExpressionPlan();\n \tProjectExpression fx = new ProjectExpression(DAfilterPlan, DataType.INTEGER, 0, 0);\n \tfx.neverUseForRealSetUid(1);\n \tConstantExpression fc0 = new ConstantExpression(DAfilterPlan, DataType.INTEGER, new Integer(0));\n \tnew EqualExpression(DAfilterPlan, fx, fc0);\n\t \n \tLOFilter DA = new LOFilter(expected, DAfilterPlan);\n \tDA.neverUseForRealSetSchema(aschema);\n \texpected.add(DA);\n \texpected.connect(A, DA);\n\t \n \t// B = load\n \tLogicalSchema bschema = new LogicalSchema();\n \tbschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"a\", null, DataType.INTEGER));\n \tbschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"b\", null, DataType.INTEGER));\n \tbschema.getField(0).uid = 3;\n \tbschema.getField(1).uid = 4;\n \tLOLoad B = new LOLoad(null, bschema, expected);\n \texpected.add(B);\n \t\n \t// DB = filter\n \tLogicalExpressionPlan DBfilterPlan = new LogicalExpressionPlan();\n \tProjectExpression fb = new ProjectExpression(DBfilterPlan, DataType.INTEGER, 0, 1);\n \tfb.neverUseForRealSetUid(4);\n \tConstantExpression fc1 = new ConstantExpression(DBfilterPlan, DataType.INTEGER, new Integer(1));\n \tnew EqualExpression(DBfilterPlan, fb, fc1);\n\t \n \tLOFilter DB = new LOFilter(expected, DBfilterPlan);\n \tDB.neverUseForRealSetSchema(bschema);\n \texpected.add(DB);\n \texpected.connect(B, DB);\n\t \n \t// C = join\n \tLogicalSchema cschema = new LogicalSchema();\n \tcschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"x\", null, DataType.INTEGER));\n \tcschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"y\", null, DataType.INTEGER));\n \tcschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"a\", null, DataType.INTEGER));\n \tcschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"b\", null, DataType.INTEGER));\n \tcschema.getField(0).uid = 1;\n \tcschema.getField(1).uid = 2;\n \tcschema.getField(2).uid = 3;\n \tcschema.getField(3).uid = 4;\n \tLogicalExpressionPlan aprojplan = new LogicalExpressionPlan();\n \tProjectExpression x = new ProjectExpression(aprojplan, DataType.INTEGER, 0, 0);\n \tx.neverUseForRealSetUid(1);\n \tLogicalExpressionPlan bprojplan = new LogicalExpressionPlan();\n \tProjectExpression y = new ProjectExpression(bprojplan, DataType.INTEGER, 1, 0);\n \ty.neverUseForRealSetUid(3);\n \tMultiMap<Integer, LogicalExpressionPlan> mm = \n \tnew MultiMap<Integer, LogicalExpressionPlan>();\n \tmm.put(0, aprojplan);\n \tmm.put(1, bprojplan);\n \tLOJoin C = new LOJoin(expected, mm, JOINTYPE.HASH, new boolean[] {true, true});\n \tC.neverUseForRealSetSchema(cschema);\n \texpected.add(C);\n \texpected.connect(DA, C);\n \texpected.connect(DB, C);\n\t \n \t// D = filter\n \tLogicalExpressionPlan filterPlan = new LogicalExpressionPlan();\n \tProjectExpression fanotherx = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 0);\n \tfanotherx.neverUseForRealSetUid(1);\n \tProjectExpression fa = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 2);\n \tfa.neverUseForRealSetUid(3);\n \tEqualExpression eq2 = new EqualExpression(filterPlan, fanotherx, fa);\n \tProjectExpression fanotherb = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 3);\n \tfanotherb.neverUseForRealSetUid(4);\n \tProjectExpression fy = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 1);\n \tfy.neverUseForRealSetUid(2);\n \tEqualExpression eq4 = new EqualExpression(filterPlan, fy, fanotherb);\n \tnew AndExpression(filterPlan, eq2, eq4);\n\t \n \tLOFilter D = new LOFilter(expected, filterPlan);\n \tD.neverUseForRealSetSchema(cschema);\n \texpected.add(D);\n \texpected.connect(C, D);\n }\n \n assertTrue( lp.isEqual(expected) );\n // assertEquals(lp, expected);\n }", "private boolean checkIllegallIndexes(Set<Integer> mintermSet, Set<Integer> dontCareSet, int size) {\n\t\tSet<Integer> mintermAndDontCareUnion = new HashSet<>(mintermSet);\n\t\tmintermAndDontCareUnion.addAll(dontCareSet);\n\n\t\tdouble maxMinterm = Math.pow(2, size) - 1;\n\t\tfor (Integer integer : mintermAndDontCareUnion) {\n\t\t\tif (integer > maxMinterm) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "private boolean checkOverlap(int row, int col, int length){\n \tif(!inBounds(row,col)){\n \t\treturn false;\n \t}\n \tfor(int i = row; i < row + length; i++ ){\n\t\t\tfor(int j = col; j < col + length; j++){\n\t\t\t\tif(grid[i][col] == 1 || row + length >= 10)\n\t\t\t\t\treturn false;\n\t\t\t\tif(grid[row][j] == 1 || col + length >= 10)\n\t\t\t\t\treturn false;\n\t\t\t}\n \t\t\n \t}\n \treturn true;\n }", "public boolean isEqualTo(Cluster c)\n {\n int len = this.size();\n if (len != c.size()){\n return false;\n }\n if (len == 0){\n return true;\n }\n if (this.getLeader() != c.getLeader()){\n return false;\n }\n for (Integer n : this._elems){\n if (!c.contains(n)){\n return false;\n }\n }\n return true;\n }", "public void testFilterOnAggregationColumn() throws Exception {\n \t\tccName = new String[] { \"cc1\", \"cc2\", \"cc3\" };\n \t\tccExpr = new String[] { \"row.COL0+row.COL1\",\n \t\t\t\t\"Total.runningSum(row.cc1,row.COL0==0,0)\",\n \t\t\t\t\"Total.runningSum(row.cc1,row.COL0>0,0)\" };\n \n \t\tfor (int i = 0; i < ccName.length; i++) {\n \t\t\tComputedColumn computedColumn = new ComputedColumn(ccName[i],\n \t\t\t\t\tccExpr[i], DataType.ANY_TYPE);\n \t\t\t((BaseDataSetDesign) this.dataSet)\n \t\t\t\t\t.addComputedColumn(computedColumn);\n \t\t}\n \n \t\tString[] bindingNameRow = new String[7];\n \t\tbindingNameRow[0] = \"ROW_COL0\";\n \t\tbindingNameRow[1] = \"ROW_COL1\";\n \t\tbindingNameRow[2] = \"ROW_COL2\";\n \t\tbindingNameRow[3] = \"ROW_COL3\";\n \t\tbindingNameRow[4] = \"ROW_cc1\";\n \t\tbindingNameRow[5] = \"ROW_cc2\";\n \t\tbindingNameRow[6] = \"ROW_cc3\";\n \t\tScriptExpression[] bindingExprRow = new ScriptExpression[] {\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL0\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL1\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL2\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL3\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + ccName[0], 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + ccName[1], 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + ccName[2], 0) };\n \n \t\tIResultIterator resultIt = this.executeQuery(this.createQuery(null,\n \t\t\t\tnull, null, null, null, null, null, null, null, bindingNameRow,\n \t\t\t\tbindingExprRow));\n \n \t\tprintResult(resultIt, bindingNameRow, bindingExprRow);\n \t\t// assert\n \t\tcheckOutputFile();\n \n \t}", "List<Online> selectByExampleWithRowbounds(OnlineExample example, RowBounds rowBounds);", "boolean isCriterionSpecified();", "boolean hasPermissionOfCluster(String clusterId, String userName);", "DataFrame<R,C> select(Predicate<DataFrameRow<R,C>> rowPredicate, Predicate<DataFrameColumn<R,C>> colPredicate);", "boolean isPossible() {\n return (sideOne + sideTwo > sideThree) && (sideTwo + sideThree > sideOne) && (sideThree + sideOne > sideTwo);\n }", "@Nullable\n public abstract GridAxis subset(GridSubset params, Formatter errlog);", "@Test\n public void should_iterate_with_partition_keys_and_partition_keys_IN() throws Exception {\n //Given\n long partitionKey = RandomUtils.nextLong(0,Long.MAX_VALUE);\n\n insertCompositeClusteredValues(partitionKey,\"bucket1\",1,\"name1\",1);\n insertCompositeClusteredValues(partitionKey,\"bucket2\",1,\"name2\",1);\n insertCompositeClusteredValues(partitionKey,\"bucket3\",1,\"name3\",1);\n\n //When\n final Iterator<CompositeClusteredEntity> iterator = manager.sliceQuery(CompositeClusteredEntity.class)\n .forIteration()\n .withPartitionComponents(partitionKey)\n .andPartitionComponentsIN(\"bucket1\", \"bucket3\")\n .iterator();\n\n //Then\n assertThat(iterator.hasNext()).isTrue();\n CompositeClusteredEntity next = iterator.next();\n assertThat(next.getId().getId()).isEqualTo(partitionKey);\n assertThat(next.getId().getBucket()).isEqualTo(\"bucket1\");\n assertThat(next.getId().getName()).isEqualTo(\"name11\");\n assertThat(next.getValue()).isEqualTo(\"value11\");\n\n assertThat(iterator.hasNext()).isTrue();\n next = iterator.next();\n assertThat(next.getId().getId()).isEqualTo(partitionKey);\n assertThat(next.getId().getBucket()).isEqualTo(\"bucket3\");\n assertThat(next.getId().getName()).isEqualTo(\"name31\");\n assertThat(next.getValue()).isEqualTo(\"value11\");\n }", "private int adequateDimensions(int cols, int rows) {\r\n\r\n if ((cols >= MINALG) && (cols <= MAXALG)) {\r\n if ((rows >= MINDATA) && (rows <= MAXDATA)) {\r\n return 0;\r\n } else {\r\n return 1;\r\n }\r\n } else {\r\n return 2;\r\n }\r\n\r\n }", "private static boolean particleValidRestriction(XSParticleDecl dParticle, SubstitutionGroupHandler dSGHandler, XSParticleDecl bParticle, SubstitutionGroupHandler bSGHandler, boolean checkWCOccurrence) throws XMLSchemaException {\n/* */ int min1, max1;\n/* 615 */ Vector<?> dChildren = null;\n/* 616 */ Vector<?> bChildren = null;\n/* 617 */ int dMinEffectiveTotalRange = -2;\n/* 618 */ int dMaxEffectiveTotalRange = -2;\n/* */ \n/* */ \n/* 621 */ boolean bExpansionHappened = false;\n/* */ \n/* */ \n/* */ \n/* 625 */ if (dParticle.isEmpty() && !bParticle.emptiable()) {\n/* 626 */ throw new XMLSchemaException(\"cos-particle-restrict.a\", null);\n/* */ }\n/* 628 */ if (!dParticle.isEmpty() && bParticle.isEmpty()) {\n/* 629 */ throw new XMLSchemaException(\"cos-particle-restrict.b\", null);\n/* */ }\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 640 */ short dType = dParticle.fType;\n/* */ \n/* */ \n/* */ \n/* 644 */ if (dType == 3) {\n/* 645 */ dType = ((XSModelGroupImpl)dParticle.fValue).fCompositor;\n/* */ \n/* */ \n/* */ \n/* */ \n/* 650 */ XSParticleDecl dtmp = getNonUnaryGroup(dParticle);\n/* 651 */ if (dtmp != dParticle) {\n/* */ \n/* 653 */ dParticle = dtmp;\n/* 654 */ dType = dParticle.fType;\n/* 655 */ if (dType == 3) {\n/* 656 */ dType = ((XSModelGroupImpl)dParticle.fValue).fCompositor;\n/* */ }\n/* */ } \n/* */ \n/* */ \n/* 661 */ dChildren = removePointlessChildren(dParticle);\n/* */ } \n/* */ \n/* 664 */ int dMinOccurs = dParticle.fMinOccurs;\n/* 665 */ int dMaxOccurs = dParticle.fMaxOccurs;\n/* */ \n/* */ \n/* */ \n/* */ \n/* 670 */ if (dSGHandler != null && dType == 1) {\n/* 671 */ XSElementDecl dElement = (XSElementDecl)dParticle.fValue;\n/* */ \n/* 673 */ if (dElement.fScope == 1) {\n/* */ \n/* */ \n/* */ \n/* 677 */ XSElementDecl[] subGroup = dSGHandler.getSubstitutionGroup(dElement);\n/* 678 */ if (subGroup.length > 0) {\n/* */ \n/* */ \n/* 681 */ dType = 101;\n/* 682 */ dMinEffectiveTotalRange = dMinOccurs;\n/* 683 */ dMaxEffectiveTotalRange = dMaxOccurs;\n/* */ \n/* */ \n/* 686 */ dChildren = new Vector(subGroup.length + 1);\n/* 687 */ for (int i = 0; i < subGroup.length; i++) {\n/* 688 */ addElementToParticleVector(dChildren, subGroup[i]);\n/* */ }\n/* 690 */ addElementToParticleVector(dChildren, dElement);\n/* 691 */ Collections.sort(dChildren, ELEMENT_PARTICLE_COMPARATOR);\n/* */ \n/* */ \n/* */ \n/* 695 */ dSGHandler = null;\n/* */ } \n/* */ } \n/* */ } \n/* */ \n/* 700 */ short bType = bParticle.fType;\n/* */ \n/* */ \n/* */ \n/* 704 */ if (bType == 3) {\n/* 705 */ bType = ((XSModelGroupImpl)bParticle.fValue).fCompositor;\n/* */ \n/* */ \n/* */ \n/* */ \n/* 710 */ XSParticleDecl btmp = getNonUnaryGroup(bParticle);\n/* 711 */ if (btmp != bParticle) {\n/* */ \n/* 713 */ bParticle = btmp;\n/* 714 */ bType = bParticle.fType;\n/* 715 */ if (bType == 3) {\n/* 716 */ bType = ((XSModelGroupImpl)bParticle.fValue).fCompositor;\n/* */ }\n/* */ } \n/* */ \n/* */ \n/* 721 */ bChildren = removePointlessChildren(bParticle);\n/* */ } \n/* */ \n/* 724 */ int bMinOccurs = bParticle.fMinOccurs;\n/* 725 */ int bMaxOccurs = bParticle.fMaxOccurs;\n/* */ \n/* 727 */ if (bSGHandler != null && bType == 1) {\n/* 728 */ XSElementDecl bElement = (XSElementDecl)bParticle.fValue;\n/* */ \n/* 730 */ if (bElement.fScope == 1) {\n/* */ \n/* */ \n/* */ \n/* 734 */ XSElementDecl[] bsubGroup = bSGHandler.getSubstitutionGroup(bElement);\n/* 735 */ if (bsubGroup.length > 0) {\n/* */ \n/* 737 */ bType = 101;\n/* */ \n/* 739 */ bChildren = new Vector(bsubGroup.length + 1);\n/* 740 */ for (int i = 0; i < bsubGroup.length; i++) {\n/* 741 */ addElementToParticleVector(bChildren, bsubGroup[i]);\n/* */ }\n/* 743 */ addElementToParticleVector(bChildren, bElement);\n/* 744 */ Collections.sort(bChildren, ELEMENT_PARTICLE_COMPARATOR);\n/* */ \n/* */ \n/* 747 */ bSGHandler = null;\n/* */ \n/* */ \n/* 750 */ bExpansionHappened = true;\n/* */ } \n/* */ } \n/* */ } \n/* */ \n/* */ \n/* */ \n/* */ \n/* 758 */ switch (dType) {\n/* */ \n/* */ case 1:\n/* 761 */ switch (bType) {\n/* */ \n/* */ \n/* */ \n/* */ case 1:\n/* 766 */ checkNameAndTypeOK((XSElementDecl)dParticle.fValue, dMinOccurs, dMaxOccurs, (XSElementDecl)bParticle.fValue, bMinOccurs, bMaxOccurs);\n/* */ \n/* 768 */ return bExpansionHappened;\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ case 2:\n/* 774 */ checkNSCompat((XSElementDecl)dParticle.fValue, dMinOccurs, dMaxOccurs, (XSWildcardDecl)bParticle.fValue, bMinOccurs, bMaxOccurs, checkWCOccurrence);\n/* */ \n/* */ \n/* 777 */ return bExpansionHappened;\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ case 101:\n/* 785 */ dChildren = new Vector();\n/* 786 */ dChildren.addElement(dParticle);\n/* */ \n/* 788 */ checkRecurseLax(dChildren, 1, 1, dSGHandler, bChildren, bMinOccurs, bMaxOccurs, bSGHandler);\n/* */ \n/* 790 */ return bExpansionHappened;\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ case 102:\n/* */ case 103:\n/* 797 */ dChildren = new Vector();\n/* 798 */ dChildren.addElement(dParticle);\n/* */ \n/* 800 */ checkRecurse(dChildren, 1, 1, dSGHandler, bChildren, bMinOccurs, bMaxOccurs, bSGHandler);\n/* */ \n/* 802 */ return bExpansionHappened;\n/* */ } \n/* */ \n/* */ \n/* */ \n/* 807 */ throw new XMLSchemaException(\"Internal-Error\", new Object[] { \"in particleValidRestriction\" });\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ case 2:\n/* 815 */ switch (bType) {\n/* */ \n/* */ \n/* */ \n/* */ case 2:\n/* 820 */ checkNSSubset((XSWildcardDecl)dParticle.fValue, dMinOccurs, dMaxOccurs, (XSWildcardDecl)bParticle.fValue, bMinOccurs, bMaxOccurs);\n/* */ \n/* 822 */ return bExpansionHappened;\n/* */ \n/* */ \n/* */ \n/* */ case 1:\n/* */ case 101:\n/* */ case 102:\n/* */ case 103:\n/* 830 */ throw new XMLSchemaException(\"cos-particle-restrict.2\", new Object[] { \"any:choice,sequence,all,elt\" });\n/* */ } \n/* */ \n/* */ \n/* */ \n/* */ \n/* 836 */ throw new XMLSchemaException(\"Internal-Error\", new Object[] { \"in particleValidRestriction\" });\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ case 103:\n/* 844 */ switch (bType) {\n/* */ \n/* */ \n/* */ \n/* */ case 2:\n/* 849 */ if (dMinEffectiveTotalRange == -2)\n/* 850 */ dMinEffectiveTotalRange = dParticle.minEffectiveTotalRange(); \n/* 851 */ if (dMaxEffectiveTotalRange == -2) {\n/* 852 */ dMaxEffectiveTotalRange = dParticle.maxEffectiveTotalRange();\n/* */ }\n/* 854 */ checkNSRecurseCheckCardinality(dChildren, dMinEffectiveTotalRange, dMaxEffectiveTotalRange, dSGHandler, bParticle, bMinOccurs, bMaxOccurs, checkWCOccurrence);\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 860 */ return bExpansionHappened;\n/* */ \n/* */ \n/* */ \n/* */ case 103:\n/* 865 */ checkRecurse(dChildren, dMinOccurs, dMaxOccurs, dSGHandler, bChildren, bMinOccurs, bMaxOccurs, bSGHandler);\n/* */ \n/* 867 */ return bExpansionHappened;\n/* */ \n/* */ \n/* */ \n/* */ case 1:\n/* */ case 101:\n/* */ case 102:\n/* 874 */ throw new XMLSchemaException(\"cos-particle-restrict.2\", new Object[] { \"all:choice,sequence,elt\" });\n/* */ } \n/* */ \n/* */ \n/* */ \n/* */ \n/* 880 */ throw new XMLSchemaException(\"Internal-Error\", new Object[] { \"in particleValidRestriction\" });\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ case 101:\n/* 888 */ switch (bType) {\n/* */ \n/* */ \n/* */ \n/* */ case 2:\n/* 893 */ if (dMinEffectiveTotalRange == -2)\n/* 894 */ dMinEffectiveTotalRange = dParticle.minEffectiveTotalRange(); \n/* 895 */ if (dMaxEffectiveTotalRange == -2) {\n/* 896 */ dMaxEffectiveTotalRange = dParticle.maxEffectiveTotalRange();\n/* */ }\n/* 898 */ checkNSRecurseCheckCardinality(dChildren, dMinEffectiveTotalRange, dMaxEffectiveTotalRange, dSGHandler, bParticle, bMinOccurs, bMaxOccurs, checkWCOccurrence);\n/* */ \n/* */ \n/* */ \n/* */ \n/* 903 */ return bExpansionHappened;\n/* */ \n/* */ \n/* */ \n/* */ case 101:\n/* 908 */ checkRecurseLax(dChildren, dMinOccurs, dMaxOccurs, dSGHandler, bChildren, bMinOccurs, bMaxOccurs, bSGHandler);\n/* */ \n/* 910 */ return bExpansionHappened;\n/* */ \n/* */ \n/* */ \n/* */ case 1:\n/* */ case 102:\n/* */ case 103:\n/* 917 */ throw new XMLSchemaException(\"cos-particle-restrict.2\", new Object[] { \"choice:all,sequence,elt\" });\n/* */ } \n/* */ \n/* */ \n/* */ \n/* */ \n/* 923 */ throw new XMLSchemaException(\"Internal-Error\", new Object[] { \"in particleValidRestriction\" });\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ case 102:\n/* 932 */ switch (bType) {\n/* */ \n/* */ \n/* */ \n/* */ case 2:\n/* 937 */ if (dMinEffectiveTotalRange == -2)\n/* 938 */ dMinEffectiveTotalRange = dParticle.minEffectiveTotalRange(); \n/* 939 */ if (dMaxEffectiveTotalRange == -2) {\n/* 940 */ dMaxEffectiveTotalRange = dParticle.maxEffectiveTotalRange();\n/* */ }\n/* 942 */ checkNSRecurseCheckCardinality(dChildren, dMinEffectiveTotalRange, dMaxEffectiveTotalRange, dSGHandler, bParticle, bMinOccurs, bMaxOccurs, checkWCOccurrence);\n/* */ \n/* */ \n/* */ \n/* */ \n/* 947 */ return bExpansionHappened;\n/* */ \n/* */ \n/* */ \n/* */ case 103:\n/* 952 */ checkRecurseUnordered(dChildren, dMinOccurs, dMaxOccurs, dSGHandler, bChildren, bMinOccurs, bMaxOccurs, bSGHandler);\n/* */ \n/* 954 */ return bExpansionHappened;\n/* */ \n/* */ \n/* */ \n/* */ case 102:\n/* 959 */ checkRecurse(dChildren, dMinOccurs, dMaxOccurs, dSGHandler, bChildren, bMinOccurs, bMaxOccurs, bSGHandler);\n/* */ \n/* 961 */ return bExpansionHappened;\n/* */ \n/* */ \n/* */ \n/* */ case 101:\n/* 966 */ min1 = dMinOccurs * dChildren.size();\n/* */ \n/* 968 */ max1 = (dMaxOccurs == -1) ? dMaxOccurs : (dMaxOccurs * dChildren.size());\n/* 969 */ checkMapAndSum(dChildren, min1, max1, dSGHandler, bChildren, bMinOccurs, bMaxOccurs, bSGHandler);\n/* */ \n/* 971 */ return bExpansionHappened;\n/* */ \n/* */ \n/* */ \n/* */ case 1:\n/* 976 */ throw new XMLSchemaException(\"cos-particle-restrict.2\", new Object[] { \"seq:elt\" });\n/* */ } \n/* */ \n/* */ \n/* */ \n/* */ \n/* 982 */ throw new XMLSchemaException(\"Internal-Error\", new Object[] { \"in particleValidRestriction\" });\n/* */ } \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 990 */ return bExpansionHappened;\n/* */ }", "@Test\n\tpublic void evalCrispDistanceWithFuzzyNumberOverlap3(){\n\t\tFuzzySet res = cs1.distance(dfn4);\n\t\tassertTrue(res instanceof FuzzyInterval);\n\t\tFuzzyInterval fuzzyRes = (FuzzyInterval)res;\n\t\t//Puntos limite\n\t\tassertTrue(fuzzyRes.getMembershipValue(1)==1);\n\t\tassertTrue(fuzzyRes.getMembershipValue(3)==1);\n\t\tassertTrue(fuzzyRes.getMembershipValue(5)==0);\n\t\t//assertTrue(fuzzyRes.getMembershipValue(5)==0);\n\t\t//Valores exteriores\n\t\tassertTrue(fuzzyRes.getMembershipValue(6)==0);\n\t\tassertTrue(fuzzyRes.getMembershipValue(-1)==0);\n\t}", "public abstract Optional<GridAxis> subsetDependent(GridAxis1D subsetIndAxis, Formatter errlog);", "boolean hasSharedCriterion();", "public Map<ByteBuffer, List<ColumnOrSuperColumn>> forced_2round_multiget_slice(List<ByteBuffer> allKeys, ColumnParent column_parent, SlicePredicate predicate)\n throws Exception\n {\n //if (logger.isTraceEnabled()) {\n // logger.trace(\"forced_2round_multiget_slice(allKeys = {}, column_parent = {}, predicate = {})\", new Object[]{printKeys(allKeys), column_parent, predicate});\n //}\n //Split up into one request for each server in the local cluster\n Map<Cassandra.AsyncClient, List<ByteBuffer>> asyncClientToFirstRoundKeys = partitionByAsyncClients(allKeys);\n\n //Send Round 1 Requests\n Queue<BlockingQueueCallback<multiget_slice_call>> firstRoundCallbacks = new LinkedList<BlockingQueueCallback<multiget_slice_call>>();\n for (Entry<Cassandra.AsyncClient, List<ByteBuffer>> entry : asyncClientToFirstRoundKeys.entrySet()) {\n Cassandra.AsyncClient asyncClient = entry.getKey();\n List<ByteBuffer> keysForThisClient = entry.getValue();\n\n BlockingQueueCallback<multiget_slice_call> callback = new BlockingQueueCallback<multiget_slice_call>();\n firstRoundCallbacks.add(callback);\n\n //if (logger.isTraceEnabled()) { logger.trace(\"round 1: get \" + printKeys(keysForThisClient) + \" from \" + asyncClient); }\n asyncClient.multiget_slice(keysForThisClient, column_parent, predicate, consistencyLevel, LamportClock.sendTimestamp(), callback);\n }\n\n //Gather responses, track both max_evt and min_lvt\n long overallMaxEvt = Long.MIN_VALUE;\n long overallMinLvt = Long.MAX_VALUE;\n\n Map<ByteBuffer, List<ColumnOrSuperColumn>> keyToResult = new HashMap<ByteBuffer, List<ColumnOrSuperColumn>>();\n NavigableMap<Long, List<ByteBuffer>> lvtToKeys = new TreeMap<Long, List<ByteBuffer>>();\n for (BlockingQueueCallback<multiget_slice_call> callback : firstRoundCallbacks) {\n\n MultigetSliceResult result = callback.getResponseNoInterruption().getResult();\n LamportClock.updateTime(result.lts);\n\n for (Entry<ByteBuffer, List<ColumnOrSuperColumn>> entry : result.value.entrySet()) {\n ByteBuffer key = entry.getKey();\n List<ColumnOrSuperColumn> coscList = entry.getValue();\n keyToResult.put(key, coscList);\n\n //find the evt and lvt for the entire row\n EvtAndLvt evtAndLvt = ColumnOrSuperColumnHelper.extractEvtAndLvt(coscList);\n if (!lvtToKeys.containsKey(evtAndLvt.getLatestValidTime())) {\n lvtToKeys.put(evtAndLvt.getLatestValidTime(), new LinkedList<ByteBuffer>());\n }\n lvtToKeys.get(evtAndLvt.getLatestValidTime()).add(key);\n //if (logger.isTraceEnabled()) { logger.trace(\"round 1 response for \" + printKey(key) + \" evt: \" + evtAndLvt.getEarliestValidTime() + \" lvt: \" + evtAndLvt.getLatestValidTime()); }\n\n overallMaxEvt = Math.max(overallMaxEvt, evtAndLvt.getEarliestValidTime());\n overallMinLvt = Math.min(overallMinLvt, evtAndLvt.getLatestValidTime());\n }\n }\n //if (logger.isTraceEnabled()) { logger.trace(\"Min LVT:\" + overallMinLvt + \" Max EVT: \" + overallMaxEvt); }\n\n //Always Execute 2nd round for micro-benchmarking\n if (true) {\n //get the smallest lvt > maxEvt\n long chosenTime = lvtToKeys.navigableKeySet().higher(overallMaxEvt);\n\n List<ByteBuffer> secondRoundKeys = new LinkedList<ByteBuffer>();\n secondRoundKeys.addAll(allKeys);\n\n //Send Round 2 Requests\n Map<Cassandra.AsyncClient, List<ByteBuffer>> asyncClientToSecondRoundKeys = partitionByAsyncClients(secondRoundKeys);\n Queue<BlockingQueueCallback<multiget_slice_by_time_call>> secondRoundCallbacks = new LinkedList<BlockingQueueCallback<multiget_slice_by_time_call>>();\n for (Entry<Cassandra.AsyncClient, List<ByteBuffer>> entry : asyncClientToSecondRoundKeys.entrySet()) {\n Cassandra.AsyncClient asyncClient = entry.getKey();\n List<ByteBuffer> keysForThisClient = entry.getValue();\n\n BlockingQueueCallback<multiget_slice_by_time_call> callback = new BlockingQueueCallback<multiget_slice_by_time_call>();\n secondRoundCallbacks.add(callback);\n\n //if (logger.isTraceEnabled()) { logger.trace(\"round 2: get \" + printKeys(keysForThisClient) + \" from \" + asyncClient); }\n\n asyncClient.multiget_slice_by_time(keysForThisClient, column_parent, predicate, consistencyLevel, chosenTime, LamportClock.sendTimestamp(), callback);\n }\n\n //Gather second round responses\n for (BlockingQueueCallback<multiget_slice_by_time_call> callback : secondRoundCallbacks) {\n MultigetSliceResult result = callback.getResponseNoInterruption().getResult();\n LamportClock.updateTime(result.lts);\n\n substituteValidFirstRoundResults(result, keyToResult);\n\n //if (logger.isTraceEnabled()) { logger.trace(\"round 2 responses for \" + printKeys(result.getValue().keySet())); }\n\n keyToResult.putAll(result.getValue());\n }\n }\n\n //Add dependencies on anything returned and removed deleted columns\n for (Entry<ByteBuffer, List<ColumnOrSuperColumn>> entry : keyToResult.entrySet()) {\n ByteBuffer key = entry.getKey();\n List<ColumnOrSuperColumn> coscList = entry.getValue();\n\n for (Iterator<ColumnOrSuperColumn> cosc_it = coscList.iterator(); cosc_it.hasNext(); ) {\n ColumnOrSuperColumn cosc = cosc_it.next();\n try {\n clientContext.addDep(key, cosc);\n } catch (NotFoundException nfe) {\n //remove deleted results, it's okay for all result to be removed\n cosc_it.remove();\n }\n }\n }\n //if (logger.isTraceEnabled()) {\n // logger.trace(\"forced_2round_multiget_slice result = {}\", keyToResult);\n //}\n return keyToResult;\n }", "private Object isValidColumnVector(List<List<Double>> vector) {\n\t\tInteger nrows = vector.size();\n\n\t\tList<Integer> rowLengths = vector.stream().map(List::size).toList();\n\t\tInteger ncols = rowLengths.stream().mapToInt(Integer::intValue).sum() / rowLengths.size();\n\n\t\treturn (nrows == 3) && (ncols == 1);\n\t}", "static boolean isClusterCandidate_(double x_1, double y1, double x2,\n\t\t\tdouble y2, double sqr_tolerance) {\n\t\tdouble dx = x_1 - x2;\n\t\tdouble dy = y1 - y2;\n\t\treturn dx * dx + dy * dy <= sqr_tolerance;\n\t}", "@Test\n public void sharedFilterEnsuresUniqueResults() {\n Filter filter = new Filter(\"test-filter\");\n final Dataset dataset1 = new Dataset(\"TEST1\", \"sql\", filter);\n final Dataset dataset2 = new Dataset(\"TEST2\", \"sql2\", filter); // shared same filter\n\n List<String> entry1 = new ArrayList<>();\n entry1.add(\"001\");\n entry1.add(\"aaa\");\n\n List<String> entry2 = new ArrayList<>();\n entry2.add(\"002\");\n entry2.add(\"bbb\");\n\n List<String> entry3 = new ArrayList<>();\n entry3.add(\"003\");\n entry3.add(\"ccc\");\n\n List<String> entry4 = new ArrayList<>();\n entry4.add(\"004\");\n entry4.add(\"ddd\");\n\n List<List<String>> queryResults1 = new ArrayList<>();\n queryResults1.add(entry1);\n queryResults1.add(entry2);\n queryResults1.add(entry3);\n queryResults1.add(entry4);\n\n List<String> entry5 = new ArrayList<>();\n entry5.add(\"005\"); // different\n entry5.add(\"eee\");\n\n List<String> entry6 = new ArrayList<>();\n entry6.add(\"002\"); // same\n entry6.add(\"bbb\");\n\n List<String> entry7 = new ArrayList<>();\n entry7.add(\"007\"); // different\n entry7.add(\"fff\");\n\n List<String> entry8 = new ArrayList<>();\n entry8.add(\"004\"); // same\n entry8.add(\"ddd\");\n\n List<List<String>> queryResults2 = new ArrayList<>();\n queryResults2.add(entry5);\n queryResults2.add(entry6);\n queryResults2.add(entry7);\n queryResults2.add(entry8);\n\n // given\n dataset1.populateCache(queryResults1, 200L);\n dataset2.populateCache(queryResults2, 300L);\n\n // when\n final List<String> result1 = dataset1.getCachedResult();\n final List<String> result2 = dataset1.getCachedResult();\n final List<String> result3 = dataset1.getCachedResult();\n final List<String> result4 = dataset1.getCachedResult();\n final List<String> result5 = dataset2.getCachedResult();\n final List<String> result6 = dataset2.getCachedResult();\n\n // then\n assertEquals(\"Wrong result 1\", entry1, result1); // first datset is as-is\n assertEquals(\"Wrong result 2\", entry2, result2); // first datset is as-is\n assertEquals(\"Wrong result 3\", entry3, result3); // first datset is as-is\n assertEquals(\"Wrong result 4\", entry4, result4); // first datset is as-is\n assertEquals(\"Wrong result 3\", entry5, result5); // second datset, not filtered out\n assertEquals(\"Wrong result 3\", entry7, result6); // second dataset, entry6 is filtered out\n\n // and\n try {\n dataset1.getCachedResult();\n fail(\"Expected to run out of data\");\n\n } catch (IllegalStateException ex) {\n assertEquals(\"Wrong error\", \"No more data available for dataset: TEST1\", ex.getMessage());\n }\n\n try {\n // entry7 should be filtered out, resulting in no more data\n dataset2.getCachedResult();\n fail(\"Expected to run out of data\");\n\n } catch (IllegalStateException ex) {\n assertEquals(\"Wrong error\", \"No more data available for dataset: TEST2\", ex.getMessage());\n }\n\n // and\n assertEquals(\"Wrong cache size\", Optional.of(4), dataset1.getMetrics().getCacheSize());\n assertEquals(\"Wrong timing\", Optional.of(200L), dataset1.getMetrics().getTimingMilliseconds());\n assertEquals(\"Wrong cache requested\", Optional.of(5), dataset1.getMetrics().getCacheRequested());\n assertEquals(\"Wrong filtered out\", Optional.empty(), dataset1.getMetrics().getFilteredOut());\n\n // and\n assertEquals(\"Wrong cache size\", Optional.of(4), dataset2.getMetrics().getCacheSize());\n assertEquals(\"Wrong timing\", Optional.of(300L), dataset2.getMetrics().getTimingMilliseconds());\n assertEquals(\"Wrong cache requested\", Optional.of(3), dataset2.getMetrics().getCacheRequested());\n assertEquals(\"Wrong filtered out\", Optional.of(2), dataset2.getMetrics().getFilteredOut());\n }", "public boolean checkChairSubset(ArrayList<Furniture> subset){\n boolean legs = false;\n boolean arms = false;\n boolean seat = false;\n boolean cushion = false;\n\n for(Furniture c : subset){\n if(c instanceof Chair){\n Chair chair = (Chair)c;\n if(chair.getLegs().equals(\"Y\")){\n legs = true;\n }\n if(chair.getArms().equals(\"Y\")){\n arms = true;\n }\n if(chair.getSeat().equals(\"Y\")){\n seat = true;\n }\n if(chair.getCushion().equals(\"Y\")){\n cushion = true;\n }\n }\n }\n // check if any of the chair pieces are missing and if so the combination is invalid\n if(!legs || !arms || !seat || !cushion){\n return false;\n }\n return true;\n }", "@Test\n public void testRedundancyRestriction() throws Exception {\n final String rName = getUniqueName();\n final Integer red0 = 0;\n final Integer red1 = 1;\n\n CacheSerializableRunnable createPRsWithRed =\n new CacheSerializableRunnable(\"createPrsWithDifferentRedundancy\") {\n @Override\n public void run2() throws CacheException {\n getCache();\n IgnoredException.addIgnoredException(\"redundancy should be same as the redundancy\");\n createPR(rName, red1, 100, 3, null, Boolean.FALSE,\n Boolean.FALSE);\n try {\n createPR(rName + \"colo\", red0, 100, 3, rName,\n Boolean.FALSE, Boolean.FALSE);\n fail(\"Expected different redundancy levels to throw.\");\n } catch (IllegalStateException expected) {\n assertEquals(\n \"Current PartitionedRegion's redundancy should be same as the redundancy of colocated PartitionedRegion\",\n expected.getMessage());\n }\n }\n };\n dataStore1.invoke(createPRsWithRed);\n }", "@Test\n public void testQueryRepeats() {\n assertMetrics(\"absoluteProximity:0.1 proximity:1 head:0 tail:0\", \"a a a\",\"a\");\n assertMetrics(\"absoluteProximity:0.1 proximity:1 head:0 tail:0 gapLength:0\",\"a a b c c\",\"a a b c c\");\n assertMetrics(\"absoluteProximity:0.1 proximity:1 head:0 tail:0 gapLength:0\",\"a a b c c\",\"a b c\");\n assertMetrics(\"absoluteProximity:0.1 proximity:1 head:0 tail:0 gapLength:0\",\"a b a b\",\"a b a b\");\n assertMetrics(\"absoluteProximity:0.0903 proximity:0.9033 head:0 tail:0 gapLength:1\",\"a b a b\",\"a b x a b\");\n // Both terms take the same segment:\n assertMetrics(\"absoluteProximity:0.1 proximity:1 segments:2 gapLength:0 head:3 tail:18\",\"a a\",\"x x x a x x x x x x x x x x x x x x a x x x\");\n // But not when the second is preferable\n assertMetrics(\"absoluteProximity:0.1 proximity:1 segments:2 gapLength:0 head:3 tail:3\",\"a b b a\",\"x x x a b x x x x x x x x x x x x x x b a x x x\");\n\n assertMetrics(\"matches:2 fieldCompleteness:1\",\"a b b b\",\"a b\");\n }", "@Test void firstRow1and2() {\n\t\tcheckFirstRow1and2(false,5,4);\n\n\t\t// X X X X\n\t\t// X X X X X\n\t\tcheckFirstRow1and2(true,4,5);\n\n\t\t// X\n\t\t// x\n\t\tcheckFirstRow1and2(false,1,1);\n\n\t\t// X\n\t\t// x\n\t\tcheckFirstRow1and2(true,1,1);\n\t}", "@Test\n\tvoid attributeCardinality() {\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(CLINICAL_FINDING, DISORDER, BLEEDING, BLEEDING_SKIN, PENTALOGY_OF_FALLOT, PENTALOGY_OF_FALLOT_INCORRECT_GROUPING),\n\t\t\t\tstrings(selectConceptIds(\"<<\" + CLINICAL_FINDING + \":[0..*]\" + FINDING_SITE + \"=*\")));\n\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(CLINICAL_FINDING, DISORDER, BLEEDING, BLEEDING_SKIN, PENTALOGY_OF_FALLOT, PENTALOGY_OF_FALLOT_INCORRECT_GROUPING),\n\t\t\t\tstrings(selectConceptIds(\"<<\" + CLINICAL_FINDING + \":[0..2]\" + FINDING_SITE + \"=*\")));\n\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(BLEEDING_SKIN, PENTALOGY_OF_FALLOT, PENTALOGY_OF_FALLOT_INCORRECT_GROUPING),\n\t\t\t\tstrings(selectConceptIds(\"<<\" + CLINICAL_FINDING + \":[1..2]\" + FINDING_SITE + \"=*\")));\n\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(BLEEDING_SKIN),\n\t\t\t\tstrings(selectConceptIds(\"<<\" + CLINICAL_FINDING + \":[1..1]\" + FINDING_SITE + \"=*\")));\n\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(BLEEDING_SKIN, CLINICAL_FINDING, DISORDER, BLEEDING),\n\t\t\t\tstrings(selectConceptIds(\"<<\" + CLINICAL_FINDING + \":[0..1]\" + FINDING_SITE + \"=*\")));\n\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(CLINICAL_FINDING, DISORDER, BLEEDING),\n\t\t\t\tstrings(selectConceptIds(\"<<\" + CLINICAL_FINDING + \":[0..0]\" + FINDING_SITE + \"=*\")));\n\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(BLEEDING_SKIN, PENTALOGY_OF_FALLOT, PENTALOGY_OF_FALLOT_INCORRECT_GROUPING),\n\t\t\t\tstrings(selectConceptIds(\"<<\" + CLINICAL_FINDING + \":[1..2]\" + FINDING_SITE + \"= <<\" + BODY_STRUCTURE)));\n\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(BLEEDING_SKIN),\n\t\t\t\tstrings(selectConceptIds(\n\t\t\t\t\t\t\"<<\" + CLINICAL_FINDING + \":\" +\n\t\t\t\t\t\t\t\t\"[1..2]\" + FINDING_SITE + \"= <<\" + BODY_STRUCTURE + \",\" +\n\t\t\t\t\t\t\t\t\"[0..0]\" + ASSOCIATED_MORPHOLOGY + \"= <<\" + STENOSIS)));\n\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(BLEEDING_SKIN, PENTALOGY_OF_FALLOT, PENTALOGY_OF_FALLOT_INCORRECT_GROUPING),\n\t\t\t\tstrings(selectConceptIds(\n\t\t\t\t\t\t\"<<\" + CLINICAL_FINDING + \":\" +\n\t\t\t\t\t\t\t\t\"[1..2]\" + FINDING_SITE + \"= <<\" + BODY_STRUCTURE + \",\" +\n\t\t\t\t\t\t\t\t\"[0..1]\" + ASSOCIATED_MORPHOLOGY + \"= <<\" + STENOSIS)));\n\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(PENTALOGY_OF_FALLOT, PENTALOGY_OF_FALLOT_INCORRECT_GROUPING),\n\t\t\t\tstrings(selectConceptIds(\n\t\t\t\t\t\t\"<<\" + CLINICAL_FINDING + \":\" +\n\t\t\t\t\t\t\t\t\"[1..2]\" + FINDING_SITE + \"= <<\" + BODY_STRUCTURE + \",\" +\n\t\t\t\t\t\t\t\t\"[1..*]\" + ASSOCIATED_MORPHOLOGY + \"= <<\" + STENOSIS)));\n\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(PENTALOGY_OF_FALLOT_INCORRECT_GROUPING),\n\t\t\t\tstrings(selectConceptIds(\n\t\t\t\t\t\t\"<<\" + CLINICAL_FINDING + \":\" +\n\t\t\t\t\t\t\t\t\"{\" +\n\t\t\t\t\t\t\t\t\"[1..1]\" + FINDING_SITE + \" != <<\" + PULMONARY_VALVE_STRUCTURE + \",\" +\n\t\t\t\t\t\t\t\t\"[1..*]\" + ASSOCIATED_MORPHOLOGY + \"= <<\" + STENOSIS + \"\" +\n\t\t\t\t\t\t\t\t\"}\")));\n\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(PENTALOGY_OF_FALLOT, PENTALOGY_OF_FALLOT_INCORRECT_GROUPING),\n\t\t\t\tstrings(selectConceptIds(\n\t\t\t\t\t\t\"<<\" + CLINICAL_FINDING + \":\" +\n\t\t\t\t\t\t\t\t\"[0..0]\" + FINDING_SITE + \" != <<\" + BODY_STRUCTURE + \",\" +\n\t\t\t\t\t\t\t\t\"[1..*]\" + ASSOCIATED_MORPHOLOGY + \"= <<\" + STENOSIS)));\n\n\t}", "public List<ParameterValueObject> getClustering(Filter filter);", "public static ASTNode evaluateSlice(ASTNode compound_matrix, ArrayList<ASTNode> indices) {\n\t if(indices.size()==0) {\n\t assert !(compound_matrix instanceof CompoundMatrix || compound_matrix instanceof EmptyMatrix);\n\t return compound_matrix;\n\t }\n\t \n\t ASTNode sliceindex=indices.get(0);\n\t \n\t if(compound_matrix instanceof EmptyMatrix) {\n // Construct new matrix domain for empty matrix.\n // First get the matrix domain for compound_matrix (which is itself an empty matrix)\n ASTNode matdom=compound_matrix.getChild(0);\n \n // Get indices\n ArrayList<ASTNode> empty_idx=matdom.getChildren(3);\n \n assert empty_idx.size()==indices.size();\n \n for(int i=empty_idx.size()-1; i>=0; i--) {\n if(! indices.get(i).equals(new IntegerDomain(new Range(null, null)))) {\n // If indices.get(i) is a constant, remove that dimension. \n empty_idx.remove(i);\n }\n }\n \n return new EmptyMatrix(new MatrixDomain(compound_matrix.getChild(0).getChild(0), // get original base domain. \n empty_idx));\n }\n\t \n // Must be a compound matrix from here on. \n if(sliceindex.isSet()) {\n assert ! sliceindex.isFiniteSetUpper() && ! sliceindex.isFiniteSetLower(); // Should be ..\n ArrayList<ASTNode> newcm=new ArrayList<ASTNode>();\n \n ArrayList<ASTNode> restindices=new ArrayList<ASTNode>(indices);\n restindices.remove(0);\n \n for(int i=1; i<compound_matrix.numChildren(); i++) {\n ASTNode tmp=evaluateSlice(compound_matrix.getChildConst(i), restindices);\n if(tmp==null) return null;\n newcm.add(tmp);\n }\n return new CompoundMatrix(compound_matrix.getChild(0), newcm); // Take index domain from original CM.\n\t }\n\t else {\n\t // This index must be a constant\n\t ArrayList<Long> cmindex;\n if(compound_matrix instanceof CompoundMatrix) {\n cmindex=compound_matrix.getChild(0).getValueSet();\n }\n else if (compound_matrix instanceof EmptyMatrix) {\n cmindex=new ArrayList<Long>();\n }\n else {\n cmindex=null;\n }\n\t \n\t long val=sliceindex.getValue();\n\t int idxval=cmindex.indexOf(val);\n\t \n\t if(idxval==-1) {\n\t // Matrix is indexed out of range. Undefined. Delay evaluation. \n\t return null;\n\t }\n\t \n ArrayList<ASTNode> restindices=new ArrayList<ASTNode>(indices);\n restindices.remove(0);\n\t \n\t return evaluateSlice(compound_matrix.getChildConst(idxval+1), restindices);\n\t }\n\t}", "boolean checkCreatureInAdjacentCells(CreatureType creatureType);", "@Test\n\tpublic void evalCrispDistanceWithCrispOverlaped1(){\n\t\tFuzzySet res = (CrispSet)cs4.distance(cs5);\n\t\tassertTrue(res instanceof CrispSet);\n\t\tCrispSet resCrisp = (CrispSet)res;\n\t\t//Puntos limite\t\t\n\t\tassertTrue(resCrisp.getLeftBoundary()==0);\n\t\tassertTrue(resCrisp.getRightBoundary()==4);\n\t\t//Valores extremos\n\t\tassertTrue(resCrisp.getMembershipValue(0)==1);\n\t\tassertTrue(resCrisp.getMembershipValue(1)==1);\n\t\tassertTrue(resCrisp.getMembershipValue(2)==1);\n\t\tassertTrue(resCrisp.getMembershipValue(3)==1);\n\t\tassertTrue(resCrisp.getMembershipValue(4)==1);\n\t\tassertTrue(resCrisp.getMembershipValue(5)==0);\n\t\tassertTrue(resCrisp.getMembershipValue(6)==0);\n\t\tassertTrue(resCrisp.getMembershipValue(-1)==0);\n\t}", "@Test\n\tvoid attributeGroupDisjunction2() {\n\t\tassertEquals(\n\t\t\t\"Match procedure with left OR right foot (grouped)\",\n\t\t\tSets.newHashSet(AMPUTATION_FOOT_LEFT, AMPUTATION_FOOT_RIGHT, AMPUTATION_FOOT_BILATERAL),\n\t\t\tstrings(selectConceptIds(\"< 71388002 |Procedure|: { 363704007 |Procedure site| = 22335008 |Left Foot| } OR { 363704007 |Procedure site| = 7769000 |Right Foot| }\")));\n\n\t}", "public boolean checkDeskSubset(ArrayList<Furniture> subset){\n boolean legs = false;\n boolean top = false;\n boolean drawer = false;\n\n for(Furniture d : subset){\n if(d instanceof Desk){\n Desk desk = (Desk)d;\n if(desk.getLegs().equals(\"Y\")){\n legs = true;\n }\n if(desk.getTop().equals(\"Y\")){\n top = true;\n }\n if(desk.getDrawer().equals(\"Y\")){\n drawer = true;\n }\n }\n }\n // check if any of the desk pieces are missing and if so the combination is invalid\n if(!legs || !top || !drawer){\n return false;\n }\n return true;\n }", "@Test\n \tpublic void whereClauseForNodeRangedPrecedence() {\n \t\tnode23.addJoin(new Precedence(node42, 10, 20));\n \t\tcheckWhereCondition(\n \t\t\t\tjoin(\"=\", \"_node23.text_ref\", \"_node42.text_ref\"),\n \t\t\t\t\"_node23.right_token BETWEEN SYMMETRIC _node42.left_token - 10 AND _node42.left_token - 20\"\n \t\t);\n \t}" ]
[ "0.7423196", "0.7411501", "0.7381687", "0.73273027", "0.7277943", "0.72429675", "0.7169441", "0.68954074", "0.6847147", "0.6814049", "0.6738144", "0.67210495", "0.66528857", "0.65600723", "0.64711374", "0.6389887", "0.6106043", "0.5987885", "0.58344626", "0.5733508", "0.5714522", "0.56944925", "0.5633267", "0.5600709", "0.5485635", "0.527271", "0.526555", "0.52018696", "0.51331234", "0.5084644", "0.5043127", "0.50162464", "0.5012801", "0.50095856", "0.49798888", "0.49793985", "0.49791363", "0.49414524", "0.49318317", "0.49295145", "0.4914588", "0.49075896", "0.4854251", "0.48519847", "0.4847743", "0.48460317", "0.48272943", "0.48214236", "0.48198485", "0.4818556", "0.48010543", "0.47987396", "0.4795759", "0.4792224", "0.4791119", "0.47706062", "0.4770332", "0.4768988", "0.474114", "0.4723058", "0.47150037", "0.47128418", "0.4709042", "0.47079945", "0.47078007", "0.47028625", "0.4700064", "0.46960804", "0.46955478", "0.46804094", "0.46726945", "0.4664763", "0.46466282", "0.46300888", "0.4629912", "0.4624856", "0.4614261", "0.46120045", "0.46067354", "0.46028972", "0.45951062", "0.45939273", "0.4588542", "0.45865452", "0.4577259", "0.4561992", "0.4558025", "0.45574635", "0.45497125", "0.45464846", "0.45355833", "0.45345894", "0.4518469", "0.45163307", "0.45139176", "0.45115432", "0.4501915", "0.44963658", "0.44947317", "0.44847637" ]
0.71278614
7
Test mixing multi equal restrictions with singlecolumn slice restrictions (e.g. clustering_0 = 1 AND (clustering_1, clustering_2) > (2, 3))
@Test public void testBoundsAsCompositesWithMultiEqAndSingleSliceRestrictions() { CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC); ByteBuffer value1 = ByteBufferUtil.bytes(1); ByteBuffer value2 = ByteBufferUtil.bytes(2); ByteBuffer value3 = ByteBufferUtil.bytes(3); // (clustering_0, clustering_1) = (1, 2) AND clustering_2 > 3 Restriction multiEq = newMultiEq(cfMetaData, 0, value1, value2); Restriction singleSlice = newSingleSlice(cfMetaData, 2, Bound.START, false, value3); PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator); restrictions = restrictions.mergeWith(multiEq).mergeWith(singleSlice); List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value1, value2, value3, EOC.END); bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT); assertEquals(1, bounds.size()); assertComposite(bounds.get(0), value1, value2, EOC.END); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithTwoClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithTwoAscendingAndTwoDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.DESC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertEmptyComposite(bounds.get(1));\n\n // clustering_0 = 1 AND (clustering_1, clustering_2, clustering_3) > (2, 3, 4)\n Restriction eq = newSingleEq(cfMetaData, 0, value1);\n slice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n restrictions = restrictions.mergeWith(eq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2, clustering_3) > (2, 3, 4)\n Restriction in = newSingleIN(cfMetaData, 0, value1, value2);\n slice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n restrictions = restrictions.mergeWith(in);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n assertComposite(bounds.get(2), value2, value2, EOC.START);\n assertComposite(bounds.get(3), value2, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n assertComposite(bounds.get(2), value2, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(3), value2, EOC.END);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1, clustering_2, clustering_3) <= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) < (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4) AND (clustering_0, clustering_1) < (2, 3)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2, value3);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(1), value2, value3, EOC.START);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4) AND (clustering_0, clustering1, clustering_2, clustering_3) <= (4, 3, 2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value4, value3, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n assertComposite(bounds.get(2), value4, value3, value2, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(1), value4, value3, EOC.START);\n assertComposite(bounds.get(2), value4, value3, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsMixingAscendingDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.DESC, Sort.ASC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(3));\n\n // clustering_0 = 1 AND (clustering_1, clustering_2, clustering_3) > (2, 3, 4)\n Restriction eq = newSingleEq(cfMetaData, 0, value1);\n slice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n restrictions = restrictions.mergeWith(eq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(3));\n\n\n // (clustering_0, clustering1, clustering_2, clustering_3) <= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, value4, EOC.NONE);\n assertComposite(bounds.get(3), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) < (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(3), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4) AND (clustering_0, clustering_1) < (2, 3)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2, value3);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(5, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n assertComposite(bounds.get(4), value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(5, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertComposite(bounds.get(3), value2, EOC.START);\n assertComposite(bounds.get(4), value2, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4) AND (clustering_0, clustering1, clustering_2, clustering_3) <= (4, 3, 2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value4, value3, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(7, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n assertComposite(bounds.get(4), value4, value3, EOC.START);\n assertComposite(bounds.get(5), value4, value3, value2, value1, EOC.NONE);\n assertComposite(bounds.get(6), value4, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(7, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertComposite(bounds.get(3), value4, EOC.START);\n assertComposite(bounds.get(4), value4, value3, value2, EOC.START);\n assertComposite(bounds.get(5), value4, value3, value2, EOC.END);\n assertComposite(bounds.get(6), value4, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneAscendingAndOneDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n assertComposite(bounds.get(2), value2, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertComposite(bounds.get(1), value2, EOC.START);\n assertComposite(bounds.get(2), value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneDescendingAndOneAscendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0) > (1) AND (clustering_0, clustering1) < (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.END);\n assertComposite(bounds.get(2), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.END);\n assertComposite(bounds.get(1), value1, EOC.START);\n assertComposite(bounds.get(2), value1, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithSingleEqAndSliceRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n ByteBuffer value5 = ByteBufferUtil.bytes(5);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) > (2, 3)\n Restriction singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction multiSlice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiSlice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) > (2, 3) AND (clustering_1) < (4)\n singleEq = newSingleEq(cfMetaData, 0, value1);\n multiSlice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3);\n Restriction multiSlice2 = newMultiSlice(cfMetaData, 1, Bound.END, false, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiSlice2).mergeWith(singleEq).mergeWith(multiSlice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value4, EOC.START);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) => (2, 3) AND (clustering_1, clustering_2) <= (4, 5)\n singleEq = newSingleEq(cfMetaData, 0, value1);\n multiSlice = newMultiSlice(cfMetaData, 1, Bound.START, true, value2, value3);\n multiSlice2 = newMultiSlice(cfMetaData, 1, Bound.END, true, value4, value5);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiSlice2).mergeWith(singleEq).mergeWith(multiSlice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value4, value5, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithTwoDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithSliceRestrictionsAndOneClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newSingleSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newSingleSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithOneEqRestrictionsAndTwoClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer clustering_0 = ByteBufferUtil.bytes(1);\n Restriction eq = newSingleEq(cfMetaData, 0, clustering_0);\n\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithOneEqRestrictionsAndOneClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC);\n\n ByteBuffer clustering_0 = ByteBufferUtil.bytes(1);\n Restriction eq = newSingleEq(cfMetaData, 0, clustering_0);\n\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneDescendingClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithSingleEqAndMultiEqRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) = (2, 3)\n Restriction singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction multiEq = newMultiEq(cfMetaData, 1, value2, value3);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiEq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n // clustering_0 = 1 AND clustering_1 = 2 AND (clustering_2, clustering_3) = (3, 4)\n singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction singleEq2 = newSingleEq(cfMetaData, 1, value2);\n multiEq = newMultiEq(cfMetaData, 2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(singleEq2).mergeWith(multiEq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n\n // (clustering_0, clustering_1) = (1, 2) AND clustering_2 = 3\n singleEq = newSingleEq(cfMetaData, 2, value3);\n multiEq = newMultiEq(cfMetaData, 0, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiEq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) = (2, 3) AND clustering_3 = 4\n singleEq = newSingleEq(cfMetaData, 0, value1);\n singleEq2 = newSingleEq(cfMetaData, 3, value4);\n multiEq = newMultiEq(cfMetaData, 1, value2, value3);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiEq).mergeWith(singleEq2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithSliceRestrictionsAndOneDescendingClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newSingleSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newSingleSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithEqAndSliceRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n\n Restriction eq = newSingleEq(cfMetaData, 0, value3);\n\n Restriction slice = newSingleSlice(cfMetaData, 1, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 1, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 1, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 1, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 1, Bound.START, false, value1);\n Restriction slice2 = newSingleSlice(cfMetaData, 1, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value2, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 1, Bound.START, true, value1);\n slice2 = newSingleSlice(cfMetaData, 1, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value3, value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithSingleEqAndMultiINRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n ByteBuffer value5 = ByteBufferUtil.bytes(5);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) IN ((2, 3), (4, 5))\n Restriction singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction multiIN = newMultiIN(cfMetaData, 1, asList(value2, value3), asList(value4, value5));\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiIN);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(1), value1, value4, value5, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(1), value1, value4, value5, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) IN ((2, 3))\n singleEq = newSingleEq(cfMetaData, 0, value1);\n multiIN = newMultiIN(cfMetaData, 1, asList(value2, value3));\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiIN).mergeWith(singleEq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n // clustering_0 = 1 AND clustering_1 = 5 AND (clustering_2, clustering_3) IN ((2, 3), (4, 5))\n singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction singleEq2 = newSingleEq(cfMetaData, 1, value5);\n multiIN = newMultiIN(cfMetaData, 2, asList(value2, value3), asList(value4, value5));\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiIN).mergeWith(singleEq2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value5, value2, value3, EOC.START);\n assertComposite(bounds.get(1), value1, value5, value4, value5, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value5, value2, value3, EOC.END);\n assertComposite(bounds.get(1), value1, value5, value4, value5, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiEqRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n Restriction eq = newMultiEq(cfMetaData, 0, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithOneInRestrictionsAndOneClusteringColumn()\n {\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n Restriction in = newSingleIN(cfMetaData, 0, value1, value2, value3);\n\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(in);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.START);\n assertComposite(bounds.get(2), value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n assertComposite(bounds.get(1), value2, EOC.END);\n assertComposite(bounds.get(2), value3, EOC.END);\n }", "private static Restriction newMultiSlice(CFMetaData cfMetaData, int firstIndex, Bound bound, boolean inclusive, ByteBuffer... values)\n {\n List<ColumnDefinition> columnDefinitions = new ArrayList<>();\n for (int i = 0; i < values.length; i++)\n {\n columnDefinitions.add(getClusteringColumnDefinition(cfMetaData, i + firstIndex));\n }\n return new MultiColumnRestriction.Slice(columnDefinitions, bound, inclusive, toMultiItemTerminal(values));\n }", "private boolean isSubsetOf(List<String> permissions2,\n\t\t\tList<String> permissions3) {\n\t\treturn false;\n\t}", "private static Restriction newMultiEq(CFMetaData cfMetaData, int firstIndex, ByteBuffer... values)\n {\n List<ColumnDefinition> columnDefinitions = new ArrayList<>();\n for (int i = 0; i < values.length; i++)\n {\n columnDefinitions.add(getClusteringColumnDefinition(cfMetaData, firstIndex + i));\n }\n return new MultiColumnRestriction.EQ(columnDefinitions, toMultiItemTerminal(values));\n }", "@Test\n public void testBoundsAsCompositesWithMultiInRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n Restriction in = newMultiIN(cfMetaData, 0, asList(value1, value2), asList(value2, value3));\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(in);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertComposite(bounds.get(1), value2, value3, EOC.END);\n }", "private boolean isSubsetOf(int firstRow, int secondRow) {\n for (int i = 0; i < universalSetSize; i++) {\n if (input[firstRow][i] && !input[secondRow][i]) {\n return false;\n }\n }\n return true;\n }", "public interface IStoppingCriteria {\n\n /**\n * Determine the degree of clustering agreement\n * @param cluster1 one clustering results\n * @param cluster2 the other clustering results\n * @return the degree of clustering agreement; 1 refers to be the same clustering results; 0 refers to be the totally different clustering results\n */\n public double computeSimilarity(int[] cluster1, int[] cluster2);\n\n}", "@Test\n public void testBoundsAsCompositesWithEqAndInRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n Restriction eq = newSingleEq(cfMetaData, 0, value1);\n Restriction in = newSingleIN(cfMetaData, 1, value1, value2, value3);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq).mergeWith(in);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.START);\n assertComposite(bounds.get(2), value1, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value1, EOC.END);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n assertComposite(bounds.get(2), value1, value3, EOC.END);\n }", "@Test\n public void testHeterogeneousSegmentFilterConditionLimit() throws SqlParseException {\n\n val project = \"heterogeneous_segment\";\n // val dfId = \"747f864b-9721-4b97-acde-0aa8e8656cba\"\n // val seg1Id = \"8892fa3f-f607-4eec-8159-7c5ae2f16942\"\n // val seg2Id = \"d75a822c-788a-4592-a500-cf20186dded1\"\n // val seg3Id = \"54eaf96d-6146-45d2-b94e-d5d187f89919\"\n // val seg4Id = \"411f40b9-a80a-4453-90a9-409aac6f7632\"\n // val seg5Id = \"a8318597-cb75-416f-8eb8-96ea285dd2b4\"\n // \n val sql = \"with T1 as (select cal_dt, trans_id \\n\" + \"from test_kylin_fact inner join test_account \\n\"\n + \"on test_kylin_fact.seller_id = test_account.account_id \\n\"\n + \"where cal_dt between date'2012-01-01' and date'2012-01-03'\\n\" + \"group by cal_dt, trans_id)\\n\";\n\n {\n val sqlWithTooManyOrs = sql + \" select * from T1 where \" + \"(cal_dt='2012-01-01' and trans_id = 1) or \\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 2) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 3) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 4) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 5) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 6) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 7) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 8) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 9) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 10) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 12) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 13) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 14) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 15) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 16) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 17) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 18) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 19) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 20)\";\n val contexts = OlapContextTestUtil.getOlapContexts(project, sqlWithTooManyOrs);\n Assert.assertEquals(\n \">=(DEFAULT.TEST_KYLIN_FACT.CAL_DT, 2012-01-01),<=(DEFAULT.TEST_KYLIN_FACT.CAL_DT, 2012-01-03)\",\n contexts.get(0).getExpandedFilterConditions().stream().map(RexNode::toString)\n .collect(Collectors.joining(\",\")));\n }\n\n {\n val sqlWithFilter = sql + \" select * from T1 where \" + \"(cal_dt='2012-01-01' and trans_id = 1) or \\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 2) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 3) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 4) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 5) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 6) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 7) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 8) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 9) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 10)\";\n val contexts = OlapContextTestUtil.getOlapContexts(project, sqlWithFilter);\n Assert.assertNotEquals(\n \">=(DEFAULT.TEST_KYLIN_FACT.CAL_DT, 2012-01-01),<=(DEFAULT.TEST_KYLIN_FACT.CAL_DT, 2012-01-03)\",\n contexts.get(0).getExpandedFilterConditions().stream().map(RexNode::toString)\n .collect(Collectors.joining(\",\")));\n }\n\n }", "private void createConstraintsForSingleton() {\n \t\tSet s = slice.entrySet();\n \t\tfor (Iterator iterator = s.iterator(); iterator.hasNext();) {\n \t\t\tMap.Entry entry = (Map.Entry) iterator.next();\n \t\t\tHashMap conflictingEntries = (HashMap) entry.getValue();\n \t\t\tif (conflictingEntries.size() < 2)\n \t\t\t\tcontinue;\n \n \t\t\tCollection conflictingVersions = conflictingEntries.values();\n \t\t\tString singletonRule = \"\"; //$NON-NLS-1$\n \t\t\tArrayList nonSingleton = new ArrayList();\n \t\t\tint countSingleton = 0;\n \t\t\tfor (Iterator conflictIterator = conflictingVersions.iterator(); conflictIterator.hasNext();) {\n \t\t\t\tIInstallableUnit conflictElt = (IInstallableUnit) conflictIterator.next();\n \t\t\t\tif (conflictElt.isSingleton()) {\n \t\t\t\t\tsingletonRule += \" -1 \" + getVariable(conflictElt); //$NON-NLS-1$\n \t\t\t\t\tcountSingleton++;\n \t\t\t\t} else {\n \t\t\t\t\tnonSingleton.add(conflictElt);\n \t\t\t\t}\n \t\t\t}\n \t\t\tif (countSingleton == 0)\n \t\t\t\tcontinue;\n \n \t\t\tfor (Iterator iterator2 = nonSingleton.iterator(); iterator2.hasNext();) {\n \t\t\t\tconstraints.add(singletonRule + \" -1 \" + getVariable((IInstallableUnit) iterator2.next()) + \" >= -1;\"); //$NON-NLS-1$ //$NON-NLS-2$\n \t\t\t}\n \t\t\tsingletonRule += \" >= -1;\"; //$NON-NLS-1$\n \t\t\tconstraints.add(singletonRule);\n \t\t}\n \t}", "private static Restriction newSingleSlice(CFMetaData cfMetaData, int index, Bound bound, boolean inclusive, ByteBuffer value)\n {\n ColumnDefinition columnDef = getClusteringColumnDefinition(cfMetaData, index);\n return new SingleColumnRestriction.Slice(columnDef, bound, inclusive, toTerm(value));\n }", "@Test\n \tpublic void whereClauseForNodeOverlap() {\n \t\tnode23.addJoin(new Overlap(node42));\n \t\tcheckWhereCondition(\n \t\t\t\tjoin(\"=\", \"_node23.text_ref\", \"_node42.text_ref\"),\n \t\t\t\tjoin(\"<=\", \"_node23.left\", \"_node42.right\"),\n \t\t\t\tjoin(\"<=\", \"_node42.left\", \"_node23.right\")\n \t\t);\n \t}", "private boolean subGridCheck() {\n\t\tint sqRt = (int)Math.sqrt(dimension);\n\t\tfor(int i = 0; i < sqRt; i++) {\n\t\t\tint increment = i * sqRt;\n\t\t\tfor(int val = 1; val <= dimension; val++) {\n\t\t\t\tint valCounter = 0;\n\t\t\t\tfor(int row = 0 + increment; row < sqRt + increment; row++) {\n\t\t\t\t\tfor(int col = 0 + increment; col < sqRt + increment; col++) {\n\t\t\t\t\t\tif(puzzle[row][col] == val)\n\t\t\t\t\t\t\tvalCounter++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(valCounter >= 2)\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public interface CustomerSubsetFilterStrategy {\r\n Set<Customer> applyFilter(List<Customer> customers);\r\n}", "List<Trueorfalse> selectByExample(RowBounds rowBounds);", "@Test\n \tpublic void whereClauseForNodeRangedDominance() {\n \t\tnode23.addJoin(new Dominance(node42, 10, 20));\n \t\tcheckWhereCondition(\n //\t\t\t\tjoin(\"=\", \"_rank23.component_ref\", \"_rank42.component_ref\"),\n \t\t\t\tjoin(\"=\", \"_component23.type\", \"'d'\"),\n \t\t\t\t\"_component23.name IS NULL\",\n \t\t\t\tjoin(\"<\", \"_rank23.pre\", \"_rank42.pre\"),\n \t\t\t\tjoin(\"<\", \"_rank42.pre\", \"_rank23.post\"),\n \t\t\t\t\"_rank23.level BETWEEN SYMMETRIC _rank42.level - 10 AND _rank42.level - 20\"\n \n \t\t);\n \t}", "@Test\n \tpublic void whereClauseForNodeLeftOverlap() {\n \t\tnode23.addJoin(new LeftOverlap(node42));\n \t\tcheckWhereCondition(\n \t\t\t\tjoin(\"=\", \"_node23.text_ref\", \"_node42.text_ref\"),\n \t\t\t\tjoin(\"<=\", \"_node23.left\", \"_node42.left\"),\n \t\t\t\tjoin(\"<=\", \"_node42.left\", \"_node23.right\"),\n \t\t\t\tjoin(\"<=\", \"_node23.right\", \"_node42.right\")\n \t\t);\n \t}", "@Test\r\n public void testIsSubset1() {\r\n Assert.assertEquals(false, set1.isSubset(set2));\r\n }", "public void addRestrictions()\n\t{\n\t\tfor(int i=0;i<n;i++)\n\t\t{\n\t\t\tfor(int j=0;j<n;j++)\n\t\t\t{\t\t\t\t\n\t\t\t\tif(restriction[i][j] == 1 )\n\t\t\t\t{\n\t\t\t\t\tcost[i][j] = 1000000000;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public static boolean IS_SUBFEATURE(Feature a, int index_a, Feature b, int index_b) {\n\n boolean anotinb, bnotina;\n int i, ia, ib;\n\n if (index_a != index_b)\n Dataset.perror(\"Feature.class :: not the same feature (\" + index_a + \" != \" + index_b + \")\");\n if (!a.type.equals(b.type))\n Dataset.perror(\n \"Feature.class :: not the same type of feature (\" + a.type + \" != \" + b.type + \")\");\n\n if (IS_CONTINUOUS(a.type)) {\n if (a.dmin >= b.dmin) {\n if (a.dmax <= b.dmax) return true;\n else\n Dataset.perror(\n \"Feature.class :: inconsistency for subfeature check for : (\"\n + a.dmin\n + \", \"\n + a.dmax\n + \") subseteq (\"\n + b.dmin\n + \", \"\n + b.dmax\n + \") ? \");\n } else if (a.dmax < b.dmax)\n Dataset.perror(\n \"Feature.class :: inconsistency for subfeature check for : (\"\n + a.dmin\n + \", \"\n + a.dmax\n + \") subseteq (\"\n + b.dmin\n + \", \"\n + b.dmax\n + \") ? \");\n } else if (IS_INTEGER(a.type)) {\n if (a.imin >= b.imin) {\n if (a.imax <= b.imax) return true;\n else\n Dataset.perror(\n \"Feature.class :: inconsistency for subfeature check for : (\"\n + a.imin\n + \", \"\n + a.imax\n + \") subseteq (\"\n + b.imin\n + \", \"\n + b.imax\n + \") ? \");\n } else if (a.imax < b.imax)\n Dataset.perror(\n \"Feature.class :: inconsistency for subfeature check for : (\"\n + a.imin\n + \", \"\n + a.imax\n + \") subseteq (\"\n + b.imin\n + \", \"\n + b.imax\n + \") ? \");\n } else if (IS_NOMINAL(a.type)) {\n if (a.modalities == null) return true;\n else if (b.modalities != null) {\n anotinb = bnotina = false;\n ia = ib = -1;\n for (i = 0; i < a.modalities.size(); i++)\n if (!b.modalities.contains((String) a.modalities.elementAt(i))) {\n anotinb = true;\n ia = i;\n }\n for (i = 0; i < b.modalities.size(); i++)\n if (!a.modalities.contains((String) b.modalities.elementAt(i))) {\n bnotina = true;\n ib = i;\n }\n if ((anotinb) && (bnotina))\n Dataset.perror(\n \"Feature.class :: inconsistency for subfeature check for : \"\n + ((String) a.modalities.elementAt(ia))\n + \" not in b and \"\n + ((String) b.modalities.elementAt(ib))\n + \" not in a \");\n else if (!anotinb) return true;\n }\n } else Dataset.perror(\"Feature.class :: no Feature type for \" + a.type);\n\n return false;\n }", "@Test\n\t public void test_Is_Subset_Positive() throws Exception{\t\n\t\t SET setarray= new SET( new int[]{1,2,3,4,5});\n\t\t SET subsetarray= new SET( new int[]{1,2,3});\n\t\t assertTrue(setarray.isSubSet(subsetarray));\t \n\t }", "@Test\n \tpublic void whereClauseForNodeSameSpan() {\n \t\tnode23.addJoin(new SameSpan(node42));\n \t\tcheckWhereCondition(\n \t\t\t\tjoin(\"=\", \"_node23.text_ref\", \"_node42.text_ref\"),\n \t\t\t\tjoin(\"=\", \"_node23.left\", \"_node42.left\"),\n \t\t\t\tjoin(\"=\", \"_node23.right\", \"_node42.right\")\n \t\t);\n \t}", "private boolean isSubset(List<ConceptLabel> outer, List<ConceptLabel> inner){\n\t\tfor(ConceptLabel in: inner){\n\t\t\tboolean c = false;\n\t\t\tfor(ConceptLabel l: outer){\n\t\t\t\tif(l.getText().equals(in.getText())){\n\t\t\t\t\tc = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(!c)\n\t\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "DataFrame<R,C> select(Predicate<DataFrameRow<R,C>> rowPredicate, Predicate<DataFrameColumn<R,C>> colPredicate);", "public static void pseudoTrueTuples(LogicProblem logicProblem, boolean applyChanges)\r\n throws RelationshipConflictException {\n \r\n HashMap<ItemPair,Relationship> relationshipTable = logicProblem.getRelationshipTable();\r\n HashSet<CategoryPair> categoryPairs = logicProblem.getCategoryPairs();\r\n \r\n// System.out.println(\"searching...\");\r\n //within a subgrid\r\n for (CategoryPair categoryPair : categoryPairs) {\r\n// System.out.println(\"Category pair:\" + categoryPair);\r\n //vertical and horizontal search\r\n for (final boolean verticalOrientation : new boolean[] { false, true } ) {\r\n\r\n Category subrowCategory = verticalOrientation?categoryPair.first():categoryPair.last();\r\n Category subcolumnCategory = verticalOrientation?categoryPair.last():categoryPair.first();\r\n\r\n //commenting \"vertical search\" \r\n //(subrows match first category's items\r\n // subcolumns match second category's items)\r\n\r\n //i (2 to floor(n/2)) is the number of elements in the combination tuple\r\n // i=2 in pseudoTrue pairs\r\n //(for subgrids of 5x5 items, looking for both pairs and triplets becomes redundant\r\n for (int i=2; i<=floor(logicProblem.getNumCategories()/2);i++) {\r\n\r\n //https://github.com/dpaukov/combinatoricslib3/wiki/v3.3.0#1-simple-combinations\r\n List<List<Item>> columnCombinations = Generator.combination(subcolumnCategory.getItems())\r\n .simple(i) //for pseudo true pairs, i=2\r\n .stream()\r\n .collect(Collectors.<List<Item>>toList());\r\n //for i=2, this would contain \r\n //Bethany, Donovan\r\n //Bethany, Elizabeth\r\n //...\r\n //Frederick, Peyton\r\n// columnCombinations.stream().forEach(l -> System.out.println(\r\n// (verticalOrientation?\"vertical\":\"horizontal\")+ \" combo: \"+l.toString()));\r\n\r\n //create the sets\r\n //for each combination, start over\r\n \r\n //columnTuple contains i items with which we will compute set intersections\r\n for (List<Item> columnItemTuple : columnCombinations) {\r\n //Bethany, Donovan\r\n \r\n //similarly, valueNoSets contains i sets of VALUE_NO relationships\r\n List<Set<Item>> valueNoSets = new ArrayList<>(); //size=i\r\n //build a set for each i item of columnTuple\r\n for (Item columnItem : columnItemTuple) {\r\n //Bethany\r\n Set<Item> valueNoSet = new HashSet<>(); //size = n\r\n for (Item rowItem : subrowCategory.getItems()) {\r\n //Haley's Comet ....\r\n if (relationshipTable.get(new ItemPair(rowItem, columnItem)).getValue() == Relationship.ValueType.VALUE_NO)\r\n //stacking all VALUE_NO relationship into vertical set\r\n valueNoSet.add(rowItem); //store into single subcolumn set \r\n }\r\n //adding each vertical set into list of sets\r\n if (valueNoSet.size() >= logicProblem.getNumItems() - i //for pairs, we need three VALUE_NO in the set\r\n && valueNoSet.size() < logicProblem.getNumItems()-1) //uniqueness will take or n-1 cases\r\n valueNoSets.add(valueNoSet); //store single subcolumn into multi-set\r\n }\r\n //magic!\r\n Set<Item> intersectionSet = new HashSet<>(); //avoid NPE when the next call is made\r\n if (valueNoSets.size()>=2) //don't compute intersections otherwise\r\n intersectionSet = Processor.multiSetIntersection(valueNoSets);\r\n\r\n if (intersectionSet.size()==logicProblem.getNumItems()-i) {\r\n \r\n// System.out.println(\"----> found candidates for pseudo true pairs!\");\r\n// intersectionSet.stream().forEach(l -> System.out.println(\"\\t\" + l.toString()));\r\n// System.out.println(\"\\t\\tvs.\");\r\n// columnItemTuple.stream().forEach(l -> System.out.println(\"\\t\" + l.toString()));\r\n \r\n //create predecessor list\r\n //we can only add the intersection output as predecessors\r\n ArrayList<Dependable> predecessors = new ArrayList<Dependable>();\r\n for (Item intersectionColumn : intersectionSet) {\r\n for (Item rowItem : columnItemTuple) {\r\n predecessors.add(relationshipTable.get(new ItemPair(rowItem, intersectionColumn)));\r\n }\r\n }\r\n\r\n\r\n //we have a bunch of work to do\r\n for (Item everyRowItem : subrowCategory.getItems()) {\r\n //for every row item not in the intersectionSet\r\n if (!intersectionSet.contains(everyRowItem)) {\r\n for (Item everyColumnItem : subcolumnCategory.getItems()) {\r\n //for every column item not in any of the columnTuple list\r\n if (!columnItemTuple.contains(everyColumnItem)) {\r\n Relationship rel = relationshipTable.get(new ItemPair(everyRowItem,everyColumnItem));\r\n if (rel.getValue()!=Relationship.ValueType.VALUE_NO)\r\n Processor.setRelationship(logicProblem, applyChanges, rel, \r\n Relationship.ValueType.VALUE_NO, Relationship.LogicType.PSEUDOTRUE,\r\n predecessors.toArray(new Relationship[predecessors.size()])); \r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }", "@Test\n \tpublic void whereClauseForNodeRightOverlap() {\n \t\tnode23.addJoin(new RightOverlap(node42));\n \t\tcheckWhereCondition(\n \t\t\t\tjoin(\"=\", \"_node23.text_ref\", \"_node42.text_ref\"),\n \t\t\t\tjoin(\">=\", \"_node23.right\", \"_node42.right\"),\n \t\t\t\tjoin(\">=\", \"_node42.right\", \"_node23.left\"),\n \t\t\t\tjoin(\">=\", \"_node23.left\", \"_node42.left\")\n \t\t);\n \t}", "@Test\n public void testFilterPushDown() throws IOException { 'bla' as (x, y);\n // B = load 'morebla' as (a, b);\n // C = join A on x, B on a;\n // D = filter C by x = a and x = 0 and b = 1 and y = b;\n // store D into 'whatever';\n \n // A = load\n LogicalPlan lp = new LogicalPlan();\n {\n \tLogicalSchema aschema = new LogicalSchema();\n \taschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"x\", null, DataType.INTEGER));\n \taschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"y\", null, DataType.INTEGER));\n \taschema.getField(0).uid = 1;\n \taschema.getField(1).uid = 2;\n \tLOLoad A = new LOLoad(new FileSpec(\"bla\", new FuncSpec(\"PigStorage\", \"\\t\")), aschema, lp);\n \tlp.add(A);\n\t \n \t// B = load\n \tLogicalSchema bschema = new LogicalSchema();\n \tbschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"a\", null, DataType.INTEGER));\n \tbschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"b\", null, DataType.INTEGER));\n \tbschema.getField(0).uid = 3;\n \tbschema.getField(1).uid = 4;\n \tLOLoad B = new LOLoad(null, bschema, lp);\n \tlp.add(B);\n\t \n \t// C = join\n \tLogicalSchema cschema = new LogicalSchema();\n \tcschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"x\", null, DataType.INTEGER));\n \tcschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"y\", null, DataType.INTEGER));\n \tcschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"a\", null, DataType.INTEGER));\n \tcschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"b\", null, DataType.INTEGER));\n \tcschema.getField(0).uid = 1;\n \tcschema.getField(1).uid = 2;\n \tcschema.getField(2).uid = 3;\n \tcschema.getField(3).uid = 4;\n \tLogicalExpressionPlan aprojplan = new LogicalExpressionPlan();\n \tProjectExpression x = new ProjectExpression(aprojplan, DataType.INTEGER, 0, 0);\n \tx.neverUseForRealSetUid(1);\n \tLogicalExpressionPlan bprojplan = new LogicalExpressionPlan();\n \tProjectExpression y = new ProjectExpression(bprojplan, DataType.INTEGER, 1, 0);\n \ty.neverUseForRealSetUid(3);\n \tMultiMap<Integer, LogicalExpressionPlan> mm = \n \tnew MultiMap<Integer, LogicalExpressionPlan>();\n \tmm.put(0, aprojplan);\n \tmm.put(1, bprojplan);\n \tLOJoin C = new LOJoin(lp, mm, JOINTYPE.HASH, new boolean[] {true, true});\n \tC.neverUseForRealSetSchema(cschema);\n \tlp.add(C);\n \tlp.connect(A, C);\n \tlp.connect(B, C);\n \n \t// D = filter\n \tLogicalExpressionPlan filterPlan = new LogicalExpressionPlan();\n \tProjectExpression fx = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 0);\n \tfx.neverUseForRealSetUid(1);\n \tConstantExpression fc0 = new ConstantExpression(filterPlan, DataType.INTEGER, new Integer(0));\n \tEqualExpression eq1 = new EqualExpression(filterPlan, fx, fc0);\n \tProjectExpression fanotherx = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 0);\n \tfanotherx.neverUseForRealSetUid(1);\n \tProjectExpression fa = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 2);\n \tfa.neverUseForRealSetUid(3);\n \tEqualExpression eq2 = new EqualExpression(filterPlan, fanotherx, fa);\n \tAndExpression and1 = new AndExpression(filterPlan, eq1, eq2);\n \tProjectExpression fb = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 3);\n \tfb.neverUseForRealSetUid(4);\n \tConstantExpression fc1 = new ConstantExpression(filterPlan, DataType.INTEGER, new Integer(1));\n \tEqualExpression eq3 = new EqualExpression(filterPlan, fb, fc1);\n \tAndExpression and2 = new AndExpression(filterPlan, and1, eq3);\n \tProjectExpression fanotherb = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 3);\n \tfanotherb.neverUseForRealSetUid(4);\n \tProjectExpression fy = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 1);\n \tfy.neverUseForRealSetUid(2);\n \tEqualExpression eq4 = new EqualExpression(filterPlan, fy, fanotherb);\n \tnew AndExpression(filterPlan, and2, eq4);\n \n \tLOFilter D = new LOFilter(lp, filterPlan);\n \tD.neverUseForRealSetSchema(cschema);\n \t// Connect D to B, since the transform has happened.\n \tlp.add(D);\n \tlp.connect(C, D);\n }\n \n LogicalPlanOptimizer optimizer = new LogicalPlanOptimizer(lp, 500);\n optimizer.optimize();\n \n LogicalPlan expected = new LogicalPlan();\n {\n // A = load\n \tLogicalSchema aschema = new LogicalSchema();\n \taschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"x\", null, DataType.INTEGER));\n \taschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"y\", null, DataType.INTEGER));\n \taschema.getField(0).uid = 1;\n \taschema.getField(1).uid = 2;\n \tLOLoad A = new LOLoad(new FileSpec(\"bla\", new FuncSpec(\"PigStorage\", \"\\t\")), aschema, expected);\n \texpected.add(A);\n \t\n \t// DA = filter\n \tLogicalExpressionPlan DAfilterPlan = new LogicalExpressionPlan();\n \tProjectExpression fx = new ProjectExpression(DAfilterPlan, DataType.INTEGER, 0, 0);\n \tfx.neverUseForRealSetUid(1);\n \tConstantExpression fc0 = new ConstantExpression(DAfilterPlan, DataType.INTEGER, new Integer(0));\n \tnew EqualExpression(DAfilterPlan, fx, fc0);\n\t \n \tLOFilter DA = new LOFilter(expected, DAfilterPlan);\n \tDA.neverUseForRealSetSchema(aschema);\n \texpected.add(DA);\n \texpected.connect(A, DA);\n\t \n \t// B = load\n \tLogicalSchema bschema = new LogicalSchema();\n \tbschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"a\", null, DataType.INTEGER));\n \tbschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"b\", null, DataType.INTEGER));\n \tbschema.getField(0).uid = 3;\n \tbschema.getField(1).uid = 4;\n \tLOLoad B = new LOLoad(null, bschema, expected);\n \texpected.add(B);\n \t\n \t// DB = filter\n \tLogicalExpressionPlan DBfilterPlan = new LogicalExpressionPlan();\n \tProjectExpression fb = new ProjectExpression(DBfilterPlan, DataType.INTEGER, 0, 1);\n \tfb.neverUseForRealSetUid(4);\n \tConstantExpression fc1 = new ConstantExpression(DBfilterPlan, DataType.INTEGER, new Integer(1));\n \tnew EqualExpression(DBfilterPlan, fb, fc1);\n\t \n \tLOFilter DB = new LOFilter(expected, DBfilterPlan);\n \tDB.neverUseForRealSetSchema(bschema);\n \texpected.add(DB);\n \texpected.connect(B, DB);\n\t \n \t// C = join\n \tLogicalSchema cschema = new LogicalSchema();\n \tcschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"x\", null, DataType.INTEGER));\n \tcschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"y\", null, DataType.INTEGER));\n \tcschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"a\", null, DataType.INTEGER));\n \tcschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"b\", null, DataType.INTEGER));\n \tcschema.getField(0).uid = 1;\n \tcschema.getField(1).uid = 2;\n \tcschema.getField(2).uid = 3;\n \tcschema.getField(3).uid = 4;\n \tLogicalExpressionPlan aprojplan = new LogicalExpressionPlan();\n \tProjectExpression x = new ProjectExpression(aprojplan, DataType.INTEGER, 0, 0);\n \tx.neverUseForRealSetUid(1);\n \tLogicalExpressionPlan bprojplan = new LogicalExpressionPlan();\n \tProjectExpression y = new ProjectExpression(bprojplan, DataType.INTEGER, 1, 0);\n \ty.neverUseForRealSetUid(3);\n \tMultiMap<Integer, LogicalExpressionPlan> mm = \n \tnew MultiMap<Integer, LogicalExpressionPlan>();\n \tmm.put(0, aprojplan);\n \tmm.put(1, bprojplan);\n \tLOJoin C = new LOJoin(expected, mm, JOINTYPE.HASH, new boolean[] {true, true});\n \tC.neverUseForRealSetSchema(cschema);\n \texpected.add(C);\n \texpected.connect(DA, C);\n \texpected.connect(DB, C);\n\t \n \t// D = filter\n \tLogicalExpressionPlan filterPlan = new LogicalExpressionPlan();\n \tProjectExpression fanotherx = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 0);\n \tfanotherx.neverUseForRealSetUid(1);\n \tProjectExpression fa = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 2);\n \tfa.neverUseForRealSetUid(3);\n \tEqualExpression eq2 = new EqualExpression(filterPlan, fanotherx, fa);\n \tProjectExpression fanotherb = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 3);\n \tfanotherb.neverUseForRealSetUid(4);\n \tProjectExpression fy = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 1);\n \tfy.neverUseForRealSetUid(2);\n \tEqualExpression eq4 = new EqualExpression(filterPlan, fy, fanotherb);\n \tnew AndExpression(filterPlan, eq2, eq4);\n\t \n \tLOFilter D = new LOFilter(expected, filterPlan);\n \tD.neverUseForRealSetSchema(cschema);\n \texpected.add(D);\n \texpected.connect(C, D);\n }\n \n assertTrue( lp.isEqual(expected) );\n // assertEquals(lp, expected);\n }", "@Test\n public void testOverlappingPartitionsOverlappingClusters()\n {\n check(overlappingClustersWithOverlappingPartitions(), 0.75, 1.0);\n }", "Boolean subset(MultiSet<X> s);", "List<Online> selectByExampleWithRowbounds(OnlineExample example, RowBounds rowBounds);", "public static void main(String[]args){\n\r\n int []arr = new int[100];\r\n int []arr2 = new int[50];\r\n int []arr3 = {1,2,3,4,5,6,7,8};\r\n int number = 5;\r\n LogicalOp op = new LogicalOp();\r\n// op.writeOnArray(arr);\r\n\r\n// arr2 = op.evenArray(arr2);\r\n// for(int i=0;i<arr2.length;i++)\r\n// System.out.println(arr2[i]);\r\n\r\n //System.out.println(\"Mean value: \"+op.meanValue(arr3));\r\n\r\n// String[] arrOfStr = {\"ana\",\"are\",\"mere\",\"pere\",\"mere\"};\r\n// String str = \"mere\";\r\n// System.out.println(op.isContaingString(arrOfStr,str));\r\n\r\n// System.out.println(op.findPosition(arr3,number));\r\n\r\n //op.displayLines();\r\n\r\n// int[]modifArr = op.modifiedArr(arr3,number);\r\n// for(int item: modifArr)\r\n// System.out.print(item+\" \");\r\n\r\n\r\n //System.out.println(\"Second minimum: \"+op.secondMin(arr3));\r\n\r\n int[] empty = new int[arr3.length];\r\n empty = op.populateArray(arr3,empty);\r\n for(int item:empty)\r\n System.out.print(item+\" \");\r\n\r\n\r\n\r\n }", "protected boolean applySubsetRule(Node value) {\n\n int type;\n int sizeParents;\n boolean isAppliedRule = false;\n Node auxI;\n Node auxJ;\n int i;\n NodeList auxNodeList = new NodeList();\n Node auxNode;\n\n\n //If the subset rule is forbidden then the methods finishes\n if (canApplySubsetRule == false) {\n return false;\n } else {\n\n type = value.getKindOfNode();\n\n if (type == Node.UTILITY) {\n return false;\n } else {//(type == Node.SUPER_VALUE)\n NodeList parents = diag.parents(value);\n sizeParents = parents.size();\n\n //See if subset rule can be applied to some ancestors\t\t\t\n for (i = 0; (i < sizeParents) && (isAppliedRule == false); i++) {\n isAppliedRule = applySubsetRule(parents.elementAt(i));\n }\n if (isAppliedRule) {\n indexOperation++;\n try {\n diag.save(\"debug-operation-\" + indexOperation + \".elv\");\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n }\n if (isAppliedRule == false) {\n //See if subset rule can be applied to two utility parents\n for (i = 0; (i < sizeParents - 1) && (isAppliedRule == false); i++) {\n auxI = parents.elementAt(i);\n if (auxI.getKindOfNode() == Node.UTILITY) {\n for (int j = i + 1; (j < sizeParents) && (isAppliedRule == false); j++) {\n auxJ = parents.elementAt(j);\n if (auxJ.getKindOfNode() == Node.UTILITY) {\n if (verifySubsetRule(auxI, auxJ)) {\n String operation =\n \"Apply subset rule to: \" + auxI.getName() + \" and \" + auxJ.getName();\n\n statistics.addOperation(operation);\n System.out.println(operation);\n\n auxNodeList.insertNode(auxI);\n auxNodeList.insertNode(auxJ);\n auxNode = introduceSVNode(auxNodeList, value);\n System.out.println(\"Nodo introducido por la subset rule anterior: \" + auxNode.getName());\n ReductionAndEvalID.reduceNode((IDWithSVNodes) diag, auxNode);\n System.out.println(\"Reducción del nodo: \" + auxNode.getName());\n\n statistics.addSize(diag.calculateSizeOfPotentials());\n statistics.addTime(crono.getTime());\n\n\n isAppliedRule = true;\n\n indexOperation++;\n try {\n diag.save(\"debug-operation-\" + indexOperation + \".elv\");\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n\n\n }\n }\n }\n }\n }\n\n }\n }\n\n return isAppliedRule;\n }\n }", "public boolean subset(ZYSet<ElementType> potentialSubset){\n for(ElementType e:potentialSubset){\n if(!this.contains(e)){\n return false;\n }\n }\n return true;\n }", "public Map<ByteBuffer, List<ColumnOrSuperColumn>> forced_2round_multiget_slice(List<ByteBuffer> allKeys, ColumnParent column_parent, SlicePredicate predicate)\n throws Exception\n {\n //if (logger.isTraceEnabled()) {\n // logger.trace(\"forced_2round_multiget_slice(allKeys = {}, column_parent = {}, predicate = {})\", new Object[]{printKeys(allKeys), column_parent, predicate});\n //}\n //Split up into one request for each server in the local cluster\n Map<Cassandra.AsyncClient, List<ByteBuffer>> asyncClientToFirstRoundKeys = partitionByAsyncClients(allKeys);\n\n //Send Round 1 Requests\n Queue<BlockingQueueCallback<multiget_slice_call>> firstRoundCallbacks = new LinkedList<BlockingQueueCallback<multiget_slice_call>>();\n for (Entry<Cassandra.AsyncClient, List<ByteBuffer>> entry : asyncClientToFirstRoundKeys.entrySet()) {\n Cassandra.AsyncClient asyncClient = entry.getKey();\n List<ByteBuffer> keysForThisClient = entry.getValue();\n\n BlockingQueueCallback<multiget_slice_call> callback = new BlockingQueueCallback<multiget_slice_call>();\n firstRoundCallbacks.add(callback);\n\n //if (logger.isTraceEnabled()) { logger.trace(\"round 1: get \" + printKeys(keysForThisClient) + \" from \" + asyncClient); }\n asyncClient.multiget_slice(keysForThisClient, column_parent, predicate, consistencyLevel, LamportClock.sendTimestamp(), callback);\n }\n\n //Gather responses, track both max_evt and min_lvt\n long overallMaxEvt = Long.MIN_VALUE;\n long overallMinLvt = Long.MAX_VALUE;\n\n Map<ByteBuffer, List<ColumnOrSuperColumn>> keyToResult = new HashMap<ByteBuffer, List<ColumnOrSuperColumn>>();\n NavigableMap<Long, List<ByteBuffer>> lvtToKeys = new TreeMap<Long, List<ByteBuffer>>();\n for (BlockingQueueCallback<multiget_slice_call> callback : firstRoundCallbacks) {\n\n MultigetSliceResult result = callback.getResponseNoInterruption().getResult();\n LamportClock.updateTime(result.lts);\n\n for (Entry<ByteBuffer, List<ColumnOrSuperColumn>> entry : result.value.entrySet()) {\n ByteBuffer key = entry.getKey();\n List<ColumnOrSuperColumn> coscList = entry.getValue();\n keyToResult.put(key, coscList);\n\n //find the evt and lvt for the entire row\n EvtAndLvt evtAndLvt = ColumnOrSuperColumnHelper.extractEvtAndLvt(coscList);\n if (!lvtToKeys.containsKey(evtAndLvt.getLatestValidTime())) {\n lvtToKeys.put(evtAndLvt.getLatestValidTime(), new LinkedList<ByteBuffer>());\n }\n lvtToKeys.get(evtAndLvt.getLatestValidTime()).add(key);\n //if (logger.isTraceEnabled()) { logger.trace(\"round 1 response for \" + printKey(key) + \" evt: \" + evtAndLvt.getEarliestValidTime() + \" lvt: \" + evtAndLvt.getLatestValidTime()); }\n\n overallMaxEvt = Math.max(overallMaxEvt, evtAndLvt.getEarliestValidTime());\n overallMinLvt = Math.min(overallMinLvt, evtAndLvt.getLatestValidTime());\n }\n }\n //if (logger.isTraceEnabled()) { logger.trace(\"Min LVT:\" + overallMinLvt + \" Max EVT: \" + overallMaxEvt); }\n\n //Always Execute 2nd round for micro-benchmarking\n if (true) {\n //get the smallest lvt > maxEvt\n long chosenTime = lvtToKeys.navigableKeySet().higher(overallMaxEvt);\n\n List<ByteBuffer> secondRoundKeys = new LinkedList<ByteBuffer>();\n secondRoundKeys.addAll(allKeys);\n\n //Send Round 2 Requests\n Map<Cassandra.AsyncClient, List<ByteBuffer>> asyncClientToSecondRoundKeys = partitionByAsyncClients(secondRoundKeys);\n Queue<BlockingQueueCallback<multiget_slice_by_time_call>> secondRoundCallbacks = new LinkedList<BlockingQueueCallback<multiget_slice_by_time_call>>();\n for (Entry<Cassandra.AsyncClient, List<ByteBuffer>> entry : asyncClientToSecondRoundKeys.entrySet()) {\n Cassandra.AsyncClient asyncClient = entry.getKey();\n List<ByteBuffer> keysForThisClient = entry.getValue();\n\n BlockingQueueCallback<multiget_slice_by_time_call> callback = new BlockingQueueCallback<multiget_slice_by_time_call>();\n secondRoundCallbacks.add(callback);\n\n //if (logger.isTraceEnabled()) { logger.trace(\"round 2: get \" + printKeys(keysForThisClient) + \" from \" + asyncClient); }\n\n asyncClient.multiget_slice_by_time(keysForThisClient, column_parent, predicate, consistencyLevel, chosenTime, LamportClock.sendTimestamp(), callback);\n }\n\n //Gather second round responses\n for (BlockingQueueCallback<multiget_slice_by_time_call> callback : secondRoundCallbacks) {\n MultigetSliceResult result = callback.getResponseNoInterruption().getResult();\n LamportClock.updateTime(result.lts);\n\n substituteValidFirstRoundResults(result, keyToResult);\n\n //if (logger.isTraceEnabled()) { logger.trace(\"round 2 responses for \" + printKeys(result.getValue().keySet())); }\n\n keyToResult.putAll(result.getValue());\n }\n }\n\n //Add dependencies on anything returned and removed deleted columns\n for (Entry<ByteBuffer, List<ColumnOrSuperColumn>> entry : keyToResult.entrySet()) {\n ByteBuffer key = entry.getKey();\n List<ColumnOrSuperColumn> coscList = entry.getValue();\n\n for (Iterator<ColumnOrSuperColumn> cosc_it = coscList.iterator(); cosc_it.hasNext(); ) {\n ColumnOrSuperColumn cosc = cosc_it.next();\n try {\n clientContext.addDep(key, cosc);\n } catch (NotFoundException nfe) {\n //remove deleted results, it's okay for all result to be removed\n cosc_it.remove();\n }\n }\n }\n //if (logger.isTraceEnabled()) {\n // logger.trace(\"forced_2round_multiget_slice result = {}\", keyToResult);\n //}\n return keyToResult;\n }", "@Test\n void test_setDeny_multi_range() {\n String[] denyRules = {\"1.0.0.10/30\", \"1.0.1.2/31\", \"1.0.1.3/31\", \"1.0.20.3/30\", \"1.0.20.1/29\"};\n ipFilterConfiguration.setDeny(Arrays.asList(denyRules));\n TreeMap<Long, Ipv4Subnet> deny = ipFilterConfiguration.getDeny();\n\n // when\n String[] expectDenyRanges = {\"1.0.0.8/30\", \"1.0.1.2/31\", \"1.0.20.0/29\"};\n Map<Long, Ipv4Subnet> expect = new HashMap<>();\n for (String expectDenyRange : expectDenyRanges) {\n Ipv4Subnet subnet = new Ipv4Subnet(expectDenyRange);\n expect.put(subnet.getStartIpLong(), subnet);\n }\n\n // then\n Stream<Executable> executables = expect.keySet().stream()\n .map(expect::get)\n .map(expectValues -> () -> assertAll(\n String.format(\"test range start with %s\", expectValues.getIpLong()),\n () -> assertNotNull(deny.get(expectValues.getStartIpLong())),\n () -> assertEquals(expectValues.getCidr(), deny.get(expectValues.getStartIpLong()).getCidr()),\n () -> assertEquals(expectValues.getStartIpLong(), deny.get(expectValues.getStartIpLong()).getStartIpLong()),\n () -> assertEquals(expectValues.getEndIpLong(), deny.get(expectValues.getStartIpLong()).getEndIpLong())\n ));\n assertAll(\"test if deny rules are nested, then aggregate (even if different mask)\",\n () -> assertEquals(3, deny.size()),\n () -> assertAll(executables));\n }", "private int[][] generateCandidates(int[][] usageM){\n\t\t// 1. start with the complete set of attributes\n\t\tMap<Integer, List<Integer>> partitionAttributes = new HashMap<Integer,List<Integer>>();\n\t\tList<Integer> attributes = new ArrayList<Integer>();\n\t\tfor(int i=0;i<usageM[0].length;i++)\n\t\t\tattributes.add(i);\n\t\tpartitionAttributes.put(0, attributes);\n\t\t\n\t\t// 2. for each query, split this set of attributes into two set:\n\t\t// (i) attributes accessed by the query\n\t\t//\t (ii) attributes not-accessed by the query\n\t\tfor(int[] query: usageM){\n\t\t\tMap<Integer, List<Integer>> newPartitionAttributes = new HashMap<Integer,List<Integer>>();\n\t\t\tint partitionCount = partitionAttributes.size();\n\t\t\t\n\t\t\t// check each partition\n\t\t\tfor(int p: partitionAttributes.keySet()){\n\t\t\t\tList<Integer> attrs = partitionAttributes.get(p);\n\t\t\t\tboolean fullPartitionAccess = true;\n\t\t\t\tfor(int a: attrs){\n\t\t\t\t\tif(query[a]==0)\n\t\t\t\t\t\tfullPartitionAccess = false;\n\t\t\t\t}\n\n\t\t\t\tif(fullPartitionAccess){\n\t\t\t\t\tnewPartitionAttributes.put(p, attrs);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t//int newPartition = partitionAttributes.size();\n\t\t\t\t\tList<Integer> accessedAttrs = new ArrayList<Integer>();\n\t\t\t\t\tList<Integer> nonAccessedAttrs = new ArrayList<Integer>();\n\t\t\t\t\tfor(int a: attrs){\n\t\t\t\t\t\tif(query[a]==1)\n\t\t\t\t\t\t\taccessedAttrs.add(a);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tnonAccessedAttrs.add(a);\n\t\t\t\t\t}\n\t\t\t\t\tif(nonAccessedAttrs.size() > 0)\n\t\t\t\t\t\tnewPartitionAttributes.put(p, nonAccessedAttrs);\n\t\t\t\t\tif(accessedAttrs.size() > 0)\n\t\t\t\t\t\tnewPartitionAttributes.put(partitionCount++, accessedAttrs);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//System.out.println(newPartitionAttributes);\n\t\t\t\n\t\t\tpartitionAttributes = newPartitionAttributes;\n\t\t}\n\t\t\n\t\t\n\t\t// 3. we end up with a set of attribute sets; all attributes in \n\t\t//\t an attribute set are always accessed together.\n\t\tint[][] primaryPartitions = new int[partitionAttributes.size()][];\n\t\tint i=0;\n\t\tfor(int p: partitionAttributes.keySet()){\n\t\t\tList<Integer> attrs = partitionAttributes.get(p);\n\t\t\tprimaryPartitions[i] = new int[attrs.size()];\n\t\t\tfor(int j=0;j<attrs.size();j++)\n\t\t\t\tprimaryPartitions[i][j] = attrs.get(j);\n\t\t\ti++;\n\t\t}\n\t\t\n\t\treturn primaryPartitions;\n\t}", "public void testFilterOnAggregationColumn() throws Exception {\n \t\tccName = new String[] { \"cc1\", \"cc2\", \"cc3\" };\n \t\tccExpr = new String[] { \"row.COL0+row.COL1\",\n \t\t\t\t\"Total.runningSum(row.cc1,row.COL0==0,0)\",\n \t\t\t\t\"Total.runningSum(row.cc1,row.COL0>0,0)\" };\n \n \t\tfor (int i = 0; i < ccName.length; i++) {\n \t\t\tComputedColumn computedColumn = new ComputedColumn(ccName[i],\n \t\t\t\t\tccExpr[i], DataType.ANY_TYPE);\n \t\t\t((BaseDataSetDesign) this.dataSet)\n \t\t\t\t\t.addComputedColumn(computedColumn);\n \t\t}\n \n \t\tString[] bindingNameRow = new String[7];\n \t\tbindingNameRow[0] = \"ROW_COL0\";\n \t\tbindingNameRow[1] = \"ROW_COL1\";\n \t\tbindingNameRow[2] = \"ROW_COL2\";\n \t\tbindingNameRow[3] = \"ROW_COL3\";\n \t\tbindingNameRow[4] = \"ROW_cc1\";\n \t\tbindingNameRow[5] = \"ROW_cc2\";\n \t\tbindingNameRow[6] = \"ROW_cc3\";\n \t\tScriptExpression[] bindingExprRow = new ScriptExpression[] {\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL0\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL1\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL2\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL3\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + ccName[0], 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + ccName[1], 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + ccName[2], 0) };\n \n \t\tIResultIterator resultIt = this.executeQuery(this.createQuery(null,\n \t\t\t\tnull, null, null, null, null, null, null, null, bindingNameRow,\n \t\t\t\tbindingExprRow));\n \n \t\tprintResult(resultIt, bindingNameRow, bindingExprRow);\n \t\t// assert\n \t\tcheckOutputFile();\n \n \t}", "public abstract Optional<GridAxis> subsetDependent(GridAxis1D subsetIndAxis, Formatter errlog);", "@Nullable\n public abstract GridAxis subset(GridSubset params, Formatter errlog);", "Boolean isCollinearTo(IVec3 v);", "@Test\n public void testHardClustersWithOverlappingPartitions()\n {\n check(hardClustersWithOverlappingPartitions(), 0.0, 1.0);\n }", "private static boolean particleValidRestriction(XSParticleDecl dParticle, SubstitutionGroupHandler dSGHandler, XSParticleDecl bParticle, SubstitutionGroupHandler bSGHandler, boolean checkWCOccurrence) throws XMLSchemaException {\n/* */ int min1, max1;\n/* 615 */ Vector<?> dChildren = null;\n/* 616 */ Vector<?> bChildren = null;\n/* 617 */ int dMinEffectiveTotalRange = -2;\n/* 618 */ int dMaxEffectiveTotalRange = -2;\n/* */ \n/* */ \n/* 621 */ boolean bExpansionHappened = false;\n/* */ \n/* */ \n/* */ \n/* 625 */ if (dParticle.isEmpty() && !bParticle.emptiable()) {\n/* 626 */ throw new XMLSchemaException(\"cos-particle-restrict.a\", null);\n/* */ }\n/* 628 */ if (!dParticle.isEmpty() && bParticle.isEmpty()) {\n/* 629 */ throw new XMLSchemaException(\"cos-particle-restrict.b\", null);\n/* */ }\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 640 */ short dType = dParticle.fType;\n/* */ \n/* */ \n/* */ \n/* 644 */ if (dType == 3) {\n/* 645 */ dType = ((XSModelGroupImpl)dParticle.fValue).fCompositor;\n/* */ \n/* */ \n/* */ \n/* */ \n/* 650 */ XSParticleDecl dtmp = getNonUnaryGroup(dParticle);\n/* 651 */ if (dtmp != dParticle) {\n/* */ \n/* 653 */ dParticle = dtmp;\n/* 654 */ dType = dParticle.fType;\n/* 655 */ if (dType == 3) {\n/* 656 */ dType = ((XSModelGroupImpl)dParticle.fValue).fCompositor;\n/* */ }\n/* */ } \n/* */ \n/* */ \n/* 661 */ dChildren = removePointlessChildren(dParticle);\n/* */ } \n/* */ \n/* 664 */ int dMinOccurs = dParticle.fMinOccurs;\n/* 665 */ int dMaxOccurs = dParticle.fMaxOccurs;\n/* */ \n/* */ \n/* */ \n/* */ \n/* 670 */ if (dSGHandler != null && dType == 1) {\n/* 671 */ XSElementDecl dElement = (XSElementDecl)dParticle.fValue;\n/* */ \n/* 673 */ if (dElement.fScope == 1) {\n/* */ \n/* */ \n/* */ \n/* 677 */ XSElementDecl[] subGroup = dSGHandler.getSubstitutionGroup(dElement);\n/* 678 */ if (subGroup.length > 0) {\n/* */ \n/* */ \n/* 681 */ dType = 101;\n/* 682 */ dMinEffectiveTotalRange = dMinOccurs;\n/* 683 */ dMaxEffectiveTotalRange = dMaxOccurs;\n/* */ \n/* */ \n/* 686 */ dChildren = new Vector(subGroup.length + 1);\n/* 687 */ for (int i = 0; i < subGroup.length; i++) {\n/* 688 */ addElementToParticleVector(dChildren, subGroup[i]);\n/* */ }\n/* 690 */ addElementToParticleVector(dChildren, dElement);\n/* 691 */ Collections.sort(dChildren, ELEMENT_PARTICLE_COMPARATOR);\n/* */ \n/* */ \n/* */ \n/* 695 */ dSGHandler = null;\n/* */ } \n/* */ } \n/* */ } \n/* */ \n/* 700 */ short bType = bParticle.fType;\n/* */ \n/* */ \n/* */ \n/* 704 */ if (bType == 3) {\n/* 705 */ bType = ((XSModelGroupImpl)bParticle.fValue).fCompositor;\n/* */ \n/* */ \n/* */ \n/* */ \n/* 710 */ XSParticleDecl btmp = getNonUnaryGroup(bParticle);\n/* 711 */ if (btmp != bParticle) {\n/* */ \n/* 713 */ bParticle = btmp;\n/* 714 */ bType = bParticle.fType;\n/* 715 */ if (bType == 3) {\n/* 716 */ bType = ((XSModelGroupImpl)bParticle.fValue).fCompositor;\n/* */ }\n/* */ } \n/* */ \n/* */ \n/* 721 */ bChildren = removePointlessChildren(bParticle);\n/* */ } \n/* */ \n/* 724 */ int bMinOccurs = bParticle.fMinOccurs;\n/* 725 */ int bMaxOccurs = bParticle.fMaxOccurs;\n/* */ \n/* 727 */ if (bSGHandler != null && bType == 1) {\n/* 728 */ XSElementDecl bElement = (XSElementDecl)bParticle.fValue;\n/* */ \n/* 730 */ if (bElement.fScope == 1) {\n/* */ \n/* */ \n/* */ \n/* 734 */ XSElementDecl[] bsubGroup = bSGHandler.getSubstitutionGroup(bElement);\n/* 735 */ if (bsubGroup.length > 0) {\n/* */ \n/* 737 */ bType = 101;\n/* */ \n/* 739 */ bChildren = new Vector(bsubGroup.length + 1);\n/* 740 */ for (int i = 0; i < bsubGroup.length; i++) {\n/* 741 */ addElementToParticleVector(bChildren, bsubGroup[i]);\n/* */ }\n/* 743 */ addElementToParticleVector(bChildren, bElement);\n/* 744 */ Collections.sort(bChildren, ELEMENT_PARTICLE_COMPARATOR);\n/* */ \n/* */ \n/* 747 */ bSGHandler = null;\n/* */ \n/* */ \n/* 750 */ bExpansionHappened = true;\n/* */ } \n/* */ } \n/* */ } \n/* */ \n/* */ \n/* */ \n/* */ \n/* 758 */ switch (dType) {\n/* */ \n/* */ case 1:\n/* 761 */ switch (bType) {\n/* */ \n/* */ \n/* */ \n/* */ case 1:\n/* 766 */ checkNameAndTypeOK((XSElementDecl)dParticle.fValue, dMinOccurs, dMaxOccurs, (XSElementDecl)bParticle.fValue, bMinOccurs, bMaxOccurs);\n/* */ \n/* 768 */ return bExpansionHappened;\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ case 2:\n/* 774 */ checkNSCompat((XSElementDecl)dParticle.fValue, dMinOccurs, dMaxOccurs, (XSWildcardDecl)bParticle.fValue, bMinOccurs, bMaxOccurs, checkWCOccurrence);\n/* */ \n/* */ \n/* 777 */ return bExpansionHappened;\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ case 101:\n/* 785 */ dChildren = new Vector();\n/* 786 */ dChildren.addElement(dParticle);\n/* */ \n/* 788 */ checkRecurseLax(dChildren, 1, 1, dSGHandler, bChildren, bMinOccurs, bMaxOccurs, bSGHandler);\n/* */ \n/* 790 */ return bExpansionHappened;\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ case 102:\n/* */ case 103:\n/* 797 */ dChildren = new Vector();\n/* 798 */ dChildren.addElement(dParticle);\n/* */ \n/* 800 */ checkRecurse(dChildren, 1, 1, dSGHandler, bChildren, bMinOccurs, bMaxOccurs, bSGHandler);\n/* */ \n/* 802 */ return bExpansionHappened;\n/* */ } \n/* */ \n/* */ \n/* */ \n/* 807 */ throw new XMLSchemaException(\"Internal-Error\", new Object[] { \"in particleValidRestriction\" });\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ case 2:\n/* 815 */ switch (bType) {\n/* */ \n/* */ \n/* */ \n/* */ case 2:\n/* 820 */ checkNSSubset((XSWildcardDecl)dParticle.fValue, dMinOccurs, dMaxOccurs, (XSWildcardDecl)bParticle.fValue, bMinOccurs, bMaxOccurs);\n/* */ \n/* 822 */ return bExpansionHappened;\n/* */ \n/* */ \n/* */ \n/* */ case 1:\n/* */ case 101:\n/* */ case 102:\n/* */ case 103:\n/* 830 */ throw new XMLSchemaException(\"cos-particle-restrict.2\", new Object[] { \"any:choice,sequence,all,elt\" });\n/* */ } \n/* */ \n/* */ \n/* */ \n/* */ \n/* 836 */ throw new XMLSchemaException(\"Internal-Error\", new Object[] { \"in particleValidRestriction\" });\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ case 103:\n/* 844 */ switch (bType) {\n/* */ \n/* */ \n/* */ \n/* */ case 2:\n/* 849 */ if (dMinEffectiveTotalRange == -2)\n/* 850 */ dMinEffectiveTotalRange = dParticle.minEffectiveTotalRange(); \n/* 851 */ if (dMaxEffectiveTotalRange == -2) {\n/* 852 */ dMaxEffectiveTotalRange = dParticle.maxEffectiveTotalRange();\n/* */ }\n/* 854 */ checkNSRecurseCheckCardinality(dChildren, dMinEffectiveTotalRange, dMaxEffectiveTotalRange, dSGHandler, bParticle, bMinOccurs, bMaxOccurs, checkWCOccurrence);\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 860 */ return bExpansionHappened;\n/* */ \n/* */ \n/* */ \n/* */ case 103:\n/* 865 */ checkRecurse(dChildren, dMinOccurs, dMaxOccurs, dSGHandler, bChildren, bMinOccurs, bMaxOccurs, bSGHandler);\n/* */ \n/* 867 */ return bExpansionHappened;\n/* */ \n/* */ \n/* */ \n/* */ case 1:\n/* */ case 101:\n/* */ case 102:\n/* 874 */ throw new XMLSchemaException(\"cos-particle-restrict.2\", new Object[] { \"all:choice,sequence,elt\" });\n/* */ } \n/* */ \n/* */ \n/* */ \n/* */ \n/* 880 */ throw new XMLSchemaException(\"Internal-Error\", new Object[] { \"in particleValidRestriction\" });\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ case 101:\n/* 888 */ switch (bType) {\n/* */ \n/* */ \n/* */ \n/* */ case 2:\n/* 893 */ if (dMinEffectiveTotalRange == -2)\n/* 894 */ dMinEffectiveTotalRange = dParticle.minEffectiveTotalRange(); \n/* 895 */ if (dMaxEffectiveTotalRange == -2) {\n/* 896 */ dMaxEffectiveTotalRange = dParticle.maxEffectiveTotalRange();\n/* */ }\n/* 898 */ checkNSRecurseCheckCardinality(dChildren, dMinEffectiveTotalRange, dMaxEffectiveTotalRange, dSGHandler, bParticle, bMinOccurs, bMaxOccurs, checkWCOccurrence);\n/* */ \n/* */ \n/* */ \n/* */ \n/* 903 */ return bExpansionHappened;\n/* */ \n/* */ \n/* */ \n/* */ case 101:\n/* 908 */ checkRecurseLax(dChildren, dMinOccurs, dMaxOccurs, dSGHandler, bChildren, bMinOccurs, bMaxOccurs, bSGHandler);\n/* */ \n/* 910 */ return bExpansionHappened;\n/* */ \n/* */ \n/* */ \n/* */ case 1:\n/* */ case 102:\n/* */ case 103:\n/* 917 */ throw new XMLSchemaException(\"cos-particle-restrict.2\", new Object[] { \"choice:all,sequence,elt\" });\n/* */ } \n/* */ \n/* */ \n/* */ \n/* */ \n/* 923 */ throw new XMLSchemaException(\"Internal-Error\", new Object[] { \"in particleValidRestriction\" });\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ case 102:\n/* 932 */ switch (bType) {\n/* */ \n/* */ \n/* */ \n/* */ case 2:\n/* 937 */ if (dMinEffectiveTotalRange == -2)\n/* 938 */ dMinEffectiveTotalRange = dParticle.minEffectiveTotalRange(); \n/* 939 */ if (dMaxEffectiveTotalRange == -2) {\n/* 940 */ dMaxEffectiveTotalRange = dParticle.maxEffectiveTotalRange();\n/* */ }\n/* 942 */ checkNSRecurseCheckCardinality(dChildren, dMinEffectiveTotalRange, dMaxEffectiveTotalRange, dSGHandler, bParticle, bMinOccurs, bMaxOccurs, checkWCOccurrence);\n/* */ \n/* */ \n/* */ \n/* */ \n/* 947 */ return bExpansionHappened;\n/* */ \n/* */ \n/* */ \n/* */ case 103:\n/* 952 */ checkRecurseUnordered(dChildren, dMinOccurs, dMaxOccurs, dSGHandler, bChildren, bMinOccurs, bMaxOccurs, bSGHandler);\n/* */ \n/* 954 */ return bExpansionHappened;\n/* */ \n/* */ \n/* */ \n/* */ case 102:\n/* 959 */ checkRecurse(dChildren, dMinOccurs, dMaxOccurs, dSGHandler, bChildren, bMinOccurs, bMaxOccurs, bSGHandler);\n/* */ \n/* 961 */ return bExpansionHappened;\n/* */ \n/* */ \n/* */ \n/* */ case 101:\n/* 966 */ min1 = dMinOccurs * dChildren.size();\n/* */ \n/* 968 */ max1 = (dMaxOccurs == -1) ? dMaxOccurs : (dMaxOccurs * dChildren.size());\n/* 969 */ checkMapAndSum(dChildren, min1, max1, dSGHandler, bChildren, bMinOccurs, bMaxOccurs, bSGHandler);\n/* */ \n/* 971 */ return bExpansionHappened;\n/* */ \n/* */ \n/* */ \n/* */ case 1:\n/* 976 */ throw new XMLSchemaException(\"cos-particle-restrict.2\", new Object[] { \"seq:elt\" });\n/* */ } \n/* */ \n/* */ \n/* */ \n/* */ \n/* 982 */ throw new XMLSchemaException(\"Internal-Error\", new Object[] { \"in particleValidRestriction\" });\n/* */ } \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 990 */ return bExpansionHappened;\n/* */ }", "private static boolean areOverlapping( int ix0, int ix1, int len )\n {\n if( ix0<ix1 ){\n return ix0+len>ix1;\n }\n else {\n return ix1+len>ix0;\n }\n }", "@Test\n\t public void test_Is_Subset_Negative() throws Exception{\t\n\t\t SET setarray= new SET( new int[]{1,2,3,4,5});\n\t\t SET subsetarray= new SET( new int[]{7,8});\n\t\t assertFalse(setarray.isSubSet(subsetarray));\t \n\t }", "private Boolean AreConditionListsSubset(List<ProgramCondition> ipList, List<ProgramCondition> tempList) {\n long c = ipList.stream().filter(p -> (tempList.stream().anyMatch(q -> q.condition.equals(p.condition)\n && q.pred == p.pred))).count();\n if(c == ipList.size())\n return true;\n return false;\n }", "@Test\n \tpublic void whereClauseForNodeExactDominance() {\n \t\tnode23.addJoin(new Dominance(node42, 10));\n \t\tcheckWhereCondition(\n //\t\t\t\tjoin(\"=\", \"_rank23.component_ref\", \"_rank42.component_ref\"),\n \t\t\t\tjoin(\"=\", \"_component23.type\", \"'d'\"),\n \t\t\t\t\"_component23.name IS NULL\",\n \t\t\t\tjoin(\"<\", \"_rank23.pre\", \"_rank42.pre\"),\n \t\t\t\tjoin(\"<\", \"_rank42.pre\", \"_rank23.post\"),\n \t\t\t\tjoin(\"=\", \"_rank23.level\", \"_rank42.level\", -10)\n \t\t);\n \t}", "@Test\n public void testIntersection4()\n {\n List<Integer> expected = new ArrayList<>();\n ConciseSet set1 = new ConciseSet();\n ConciseSet set2 = new ConciseSet();\n for (int i = 0; i < 1000; i++) {\n set1.add(i);\n if (i != 500) {\n set2.add(i);\n expected.add(i);\n }\n }\n\n verifyIntersection(expected, set1, set2);\n }", "private boolean checkOverlap(int row, int col, int length){\n \tif(!inBounds(row,col)){\n \t\treturn false;\n \t}\n \tfor(int i = row; i < row + length; i++ ){\n\t\t\tfor(int j = col; j < col + length; j++){\n\t\t\t\tif(grid[i][col] == 1 || row + length >= 10)\n\t\t\t\t\treturn false;\n\t\t\t\tif(grid[row][j] == 1 || col + length >= 10)\n\t\t\t\t\treturn false;\n\t\t\t}\n \t\t\n \t}\n \treturn true;\n }", "List<Collect> selectByExampleWithRowbounds(CollectExample example, RowBounds rowBounds);", "boolean checkValidity(int side1, int side2, int side3);", "public boolean percolates()\r\n { return uf.find(0) == uf.find(dimension*dimension + 1); }", "public static ASTNode evaluateSlice(ASTNode compound_matrix, ArrayList<ASTNode> indices) {\n\t if(indices.size()==0) {\n\t assert !(compound_matrix instanceof CompoundMatrix || compound_matrix instanceof EmptyMatrix);\n\t return compound_matrix;\n\t }\n\t \n\t ASTNode sliceindex=indices.get(0);\n\t \n\t if(compound_matrix instanceof EmptyMatrix) {\n // Construct new matrix domain for empty matrix.\n // First get the matrix domain for compound_matrix (which is itself an empty matrix)\n ASTNode matdom=compound_matrix.getChild(0);\n \n // Get indices\n ArrayList<ASTNode> empty_idx=matdom.getChildren(3);\n \n assert empty_idx.size()==indices.size();\n \n for(int i=empty_idx.size()-1; i>=0; i--) {\n if(! indices.get(i).equals(new IntegerDomain(new Range(null, null)))) {\n // If indices.get(i) is a constant, remove that dimension. \n empty_idx.remove(i);\n }\n }\n \n return new EmptyMatrix(new MatrixDomain(compound_matrix.getChild(0).getChild(0), // get original base domain. \n empty_idx));\n }\n\t \n // Must be a compound matrix from here on. \n if(sliceindex.isSet()) {\n assert ! sliceindex.isFiniteSetUpper() && ! sliceindex.isFiniteSetLower(); // Should be ..\n ArrayList<ASTNode> newcm=new ArrayList<ASTNode>();\n \n ArrayList<ASTNode> restindices=new ArrayList<ASTNode>(indices);\n restindices.remove(0);\n \n for(int i=1; i<compound_matrix.numChildren(); i++) {\n ASTNode tmp=evaluateSlice(compound_matrix.getChildConst(i), restindices);\n if(tmp==null) return null;\n newcm.add(tmp);\n }\n return new CompoundMatrix(compound_matrix.getChild(0), newcm); // Take index domain from original CM.\n\t }\n\t else {\n\t // This index must be a constant\n\t ArrayList<Long> cmindex;\n if(compound_matrix instanceof CompoundMatrix) {\n cmindex=compound_matrix.getChild(0).getValueSet();\n }\n else if (compound_matrix instanceof EmptyMatrix) {\n cmindex=new ArrayList<Long>();\n }\n else {\n cmindex=null;\n }\n\t \n\t long val=sliceindex.getValue();\n\t int idxval=cmindex.indexOf(val);\n\t \n\t if(idxval==-1) {\n\t // Matrix is indexed out of range. Undefined. Delay evaluation. \n\t return null;\n\t }\n\t \n ArrayList<ASTNode> restindices=new ArrayList<ASTNode>(indices);\n restindices.remove(0);\n\t \n\t return evaluateSlice(compound_matrix.getChildConst(idxval+1), restindices);\n\t }\n\t}", "@Test\n public void testIntersection6()\n {\n List<Integer> expected = new ArrayList<>();\n ConciseSet set1 = new ConciseSet();\n for (int i = 0; i < 5; i++) {\n set1.add(i);\n }\n for (int i = 1000; i < 1005; i++) {\n set1.add(i);\n }\n\n ConciseSet set2 = new ConciseSet();\n for (int i = 800; i < 805; i++) {\n set2.add(i);\n }\n for (int i = 806; i < 1005; i++) {\n set2.add(i);\n }\n\n for (int i = 1000; i < 1005; i++) {\n expected.add(i);\n }\n\n verifyIntersection(expected, set1, set2);\n }", "private boolean runMultiSampleCase() {\n\t\tArrayList<Candidate> candidates = collectTrioCandidates();\n\n\t\t// Then, check the candidates for all trios around affected individuals.\n\t\tfor (Candidate c : candidates)\n\t\t\tif (isCompatibleWithTriosAroundAffected(c))\n\t\t\t\treturn true;\n\t\treturn false;\n\t}", "public List<ParameterValueObject> getClustering(Filter filter);", "private boolean checkRowCol(int c1, int c2, int c3) \r\n {\r\n return ((c1 != -1) && (c1 == c2) && (c2 == c3)); //eida ekhon porjonto kaaj e lage nai\r\n }", "@Test\n \tpublic void whereClauseForNodeEdgeAnnotation() {\n \t\tnode23.addEdgeAnnotation(new Annotation(\"namespace1\", \"name1\"));\n \t\tnode23.addEdgeAnnotation(new Annotation(\"namespace2\", \"name2\", \"value2\", TextMatching.EXACT_EQUAL));\n \t\tnode23.addEdgeAnnotation(new Annotation(\"namespace3\", \"name3\", \"value3\", TextMatching.REGEXP_EQUAL));\n \t\tcheckWhereCondition(\n \t\t\t\tjoin(\"=\", \"_rank_annotation23_1.edge_annotation_namespace\", \"'namespace1'\"),\n \t\t\t\tjoin(\"=\", \"_rank_annotation23_1.edge_annotation_name\", \"'name1'\"),\n \t\t\t\tjoin(\"=\", \"_rank_annotation23_2.edge_annotation_namespace\", \"'namespace2'\"),\n \t\t\t\tjoin(\"=\", \"_rank_annotation23_2.edge_annotation_name\", \"'name2'\"),\n \t\t\t\tjoin(\"=\", \"_rank_annotation23_2.edge_annotation_value\", \"'value2'\"),\n \t\t\t\tjoin(\"=\", \"_rank_annotation23_3.edge_annotation_namespace\", \"'namespace3'\"),\n \t\t\t\tjoin(\"=\", \"_rank_annotation23_3.edge_annotation_name\", \"'name3'\"),\n \t\t\t\tjoin(\"~\", \"_rank_annotation23_3.edge_annotation_value\", \"'^value3$'\")\n \t\t);\n \t}", "@Test\n public void sharedFilterEnsuresUniqueResults() {\n Filter filter = new Filter(\"test-filter\");\n final Dataset dataset1 = new Dataset(\"TEST1\", \"sql\", filter);\n final Dataset dataset2 = new Dataset(\"TEST2\", \"sql2\", filter); // shared same filter\n\n List<String> entry1 = new ArrayList<>();\n entry1.add(\"001\");\n entry1.add(\"aaa\");\n\n List<String> entry2 = new ArrayList<>();\n entry2.add(\"002\");\n entry2.add(\"bbb\");\n\n List<String> entry3 = new ArrayList<>();\n entry3.add(\"003\");\n entry3.add(\"ccc\");\n\n List<String> entry4 = new ArrayList<>();\n entry4.add(\"004\");\n entry4.add(\"ddd\");\n\n List<List<String>> queryResults1 = new ArrayList<>();\n queryResults1.add(entry1);\n queryResults1.add(entry2);\n queryResults1.add(entry3);\n queryResults1.add(entry4);\n\n List<String> entry5 = new ArrayList<>();\n entry5.add(\"005\"); // different\n entry5.add(\"eee\");\n\n List<String> entry6 = new ArrayList<>();\n entry6.add(\"002\"); // same\n entry6.add(\"bbb\");\n\n List<String> entry7 = new ArrayList<>();\n entry7.add(\"007\"); // different\n entry7.add(\"fff\");\n\n List<String> entry8 = new ArrayList<>();\n entry8.add(\"004\"); // same\n entry8.add(\"ddd\");\n\n List<List<String>> queryResults2 = new ArrayList<>();\n queryResults2.add(entry5);\n queryResults2.add(entry6);\n queryResults2.add(entry7);\n queryResults2.add(entry8);\n\n // given\n dataset1.populateCache(queryResults1, 200L);\n dataset2.populateCache(queryResults2, 300L);\n\n // when\n final List<String> result1 = dataset1.getCachedResult();\n final List<String> result2 = dataset1.getCachedResult();\n final List<String> result3 = dataset1.getCachedResult();\n final List<String> result4 = dataset1.getCachedResult();\n final List<String> result5 = dataset2.getCachedResult();\n final List<String> result6 = dataset2.getCachedResult();\n\n // then\n assertEquals(\"Wrong result 1\", entry1, result1); // first datset is as-is\n assertEquals(\"Wrong result 2\", entry2, result2); // first datset is as-is\n assertEquals(\"Wrong result 3\", entry3, result3); // first datset is as-is\n assertEquals(\"Wrong result 4\", entry4, result4); // first datset is as-is\n assertEquals(\"Wrong result 3\", entry5, result5); // second datset, not filtered out\n assertEquals(\"Wrong result 3\", entry7, result6); // second dataset, entry6 is filtered out\n\n // and\n try {\n dataset1.getCachedResult();\n fail(\"Expected to run out of data\");\n\n } catch (IllegalStateException ex) {\n assertEquals(\"Wrong error\", \"No more data available for dataset: TEST1\", ex.getMessage());\n }\n\n try {\n // entry7 should be filtered out, resulting in no more data\n dataset2.getCachedResult();\n fail(\"Expected to run out of data\");\n\n } catch (IllegalStateException ex) {\n assertEquals(\"Wrong error\", \"No more data available for dataset: TEST2\", ex.getMessage());\n }\n\n // and\n assertEquals(\"Wrong cache size\", Optional.of(4), dataset1.getMetrics().getCacheSize());\n assertEquals(\"Wrong timing\", Optional.of(200L), dataset1.getMetrics().getTimingMilliseconds());\n assertEquals(\"Wrong cache requested\", Optional.of(5), dataset1.getMetrics().getCacheRequested());\n assertEquals(\"Wrong filtered out\", Optional.empty(), dataset1.getMetrics().getFilteredOut());\n\n // and\n assertEquals(\"Wrong cache size\", Optional.of(4), dataset2.getMetrics().getCacheSize());\n assertEquals(\"Wrong timing\", Optional.of(300L), dataset2.getMetrics().getTimingMilliseconds());\n assertEquals(\"Wrong cache requested\", Optional.of(3), dataset2.getMetrics().getCacheRequested());\n assertEquals(\"Wrong filtered out\", Optional.of(2), dataset2.getMetrics().getFilteredOut());\n }", "List<Privilege> selectByExampleWithRowbounds(PrivilegeExample example, RowBounds rowBounds);", "@Override\n protected void doAlgorithmA1() {\n int xP = 0;\n int yP = 0;\n\n\n //Taking the variable out of the list that are in the bounds\n //Testing that the bound has variables\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getX() != null) {\n xP = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getX().getPosition();\n }\n int xU = 0;\n int xL = 0;\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getY() != null) {\n yP = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getY().getPosition();\n }\n int yU = 0;\n int yL = 0;\n int cright = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getCright();\n int cleft = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getCleft();\n\n\n\n for (Variable variable : csp.getVars()) {\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getX() != null) {\n if (variable.getPosition() == xP) {\n xU = variable.getUpperDomainBound();\n xL = variable.getLowerDomainBound();\n }\n }\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getY() != null) {\n if (variable.getPosition() == yP) {\n yU = variable.getUpperDomainBound();\n yL = variable.getLowerDomainBound();\n }\n }\n }\n\n boolean first = false;\n boolean second = false;\n\n //Testing if the bound is true, false or inconclusive\n\n if (xL + cleft >= yU + cright) {\n first = true;\n }\n if (xU + cleft < yL + cright) {\n second = true;\n }\n\n //are first and second not equal is the bound not inconclusive\n if (first != second) {\n if (first) { //a true Simple Bound was found\n //checks if it was the last constraint in a csp\n //If so the csp is true\n //else check the next constraint and do this method again\n if (csp.getSimpleConstraints().size() - 1 == cIndex) {\n System.out.println(\"P is satisfiable\");\n System.out.println(System.nanoTime()-startTime);\n return;\n } else {\n bIndex = 0;\n cIndex++;\n unit=false;\n doAlgorithmA1();\n }\n } else if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().size() - 1 == bIndex) { //a false Simple Bound was found\n //\n bIndex = 0;\n cIndex = 0;\n if (isInconclusive) {\n if(unit){\n doDeduction();\n }else {\n doAlgorithmA3();\n }\n } else {\n doAlgorithmA2();\n }\n } else {\n bIndex++;\n doAlgorithmA1();\n }\n } else {//an inconclusive Simple Bound was found\n //checks if the bound wasn't already inconclusive\n if(!isInconclusive){\n unit=true;\n unitSB = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex);\n }else {\n unit=false;\n }\n isInconclusive = true;\n\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().size() - 1 == bIndex) {\n cIndex = 0;\n bIndex = 0;\n if(unit){\n doDeduction();\n }else {\n doAlgorithmA3();\n }\n } else {\n bIndex++;\n doAlgorithmA1();\n }\n }\n }", "boolean hasSharedCriterion();", "@Test\n public void should_iterate_with_partition_keys_and_partition_keys_IN() throws Exception {\n //Given\n long partitionKey = RandomUtils.nextLong(0,Long.MAX_VALUE);\n\n insertCompositeClusteredValues(partitionKey,\"bucket1\",1,\"name1\",1);\n insertCompositeClusteredValues(partitionKey,\"bucket2\",1,\"name2\",1);\n insertCompositeClusteredValues(partitionKey,\"bucket3\",1,\"name3\",1);\n\n //When\n final Iterator<CompositeClusteredEntity> iterator = manager.sliceQuery(CompositeClusteredEntity.class)\n .forIteration()\n .withPartitionComponents(partitionKey)\n .andPartitionComponentsIN(\"bucket1\", \"bucket3\")\n .iterator();\n\n //Then\n assertThat(iterator.hasNext()).isTrue();\n CompositeClusteredEntity next = iterator.next();\n assertThat(next.getId().getId()).isEqualTo(partitionKey);\n assertThat(next.getId().getBucket()).isEqualTo(\"bucket1\");\n assertThat(next.getId().getName()).isEqualTo(\"name11\");\n assertThat(next.getValue()).isEqualTo(\"value11\");\n\n assertThat(iterator.hasNext()).isTrue();\n next = iterator.next();\n assertThat(next.getId().getId()).isEqualTo(partitionKey);\n assertThat(next.getId().getBucket()).isEqualTo(\"bucket3\");\n assertThat(next.getId().getName()).isEqualTo(\"name31\");\n assertThat(next.getValue()).isEqualTo(\"value11\");\n }", "boolean isCriterionSpecified();", "static boolean isSubset(int Tab1[], int Tab2[], int m, int n)\n {\n // compléter\n //Trouver le max de Tab1[]\n int max=Tab1[0];\n for(int i = 1; i < m; i++) {\n\t\t\tif (Tab1[i]>max){\n max=Tab1[i];\n }\n\t\t}\n \n\t\t//Stockage de la Tab1 dans une table de hashage\n\t\tint[] hashTable = new int[max];\n\t\tfor(int i = 0; i < m; i++) {\n\t\t\thashTable[hash(Tab1[i], max)] = Tab1[i];\n\t\t}\n\t\t\n\t\t//verifier que chaque element (de Tab2) existe dans la hashtable\n\t\tfor(int j = 0; j < n; j++) {\n\t\t\tif(Tab2[j] != hashTable[hash(Tab2[j], max)]) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t}\n return true;\n \n //Complexite aymptotique :\n /*\n Puisque la boucle qui a le plus d'itérations est celle avec l'élément m, la compléxité\n asymptotique est O(m).\n f(m,n) = 2m + n = O(m), puisque m > n\n */\n \n\n }", "@Test\n public void testRedundancyRestriction() throws Exception {\n final String rName = getUniqueName();\n final Integer red0 = 0;\n final Integer red1 = 1;\n\n CacheSerializableRunnable createPRsWithRed =\n new CacheSerializableRunnable(\"createPrsWithDifferentRedundancy\") {\n @Override\n public void run2() throws CacheException {\n getCache();\n IgnoredException.addIgnoredException(\"redundancy should be same as the redundancy\");\n createPR(rName, red1, 100, 3, null, Boolean.FALSE,\n Boolean.FALSE);\n try {\n createPR(rName + \"colo\", red0, 100, 3, rName,\n Boolean.FALSE, Boolean.FALSE);\n fail(\"Expected different redundancy levels to throw.\");\n } catch (IllegalStateException expected) {\n assertEquals(\n \"Current PartitionedRegion's redundancy should be same as the redundancy of colocated PartitionedRegion\",\n expected.getMessage());\n }\n }\n };\n dataStore1.invoke(createPRsWithRed);\n }", "protected abstract Hashtable<RestrictionType, HashSet> getActivityRestrictions(StreamView compositeStream,\n long inUserId);", "boolean hasPermissionOfCluster(String clusterId, String userName);", "@Test\n public void testIntersection3()\n {\n List<Integer> expected = new ArrayList<>();\n ConciseSet set1 = new ConciseSet();\n ConciseSet set2 = new ConciseSet();\n for (int i = 0; i < 1000; i++) {\n set1.add(i);\n set2.add(i);\n expected.add(i);\n }\n\n verifyIntersection(expected, set1, set2);\n }", "private void checkNeqContradictions(HashMap<ComparableExpression, HashSet<ComparableExpression>> cNeq,\n HashMap<TimeSelector, Long> lowerBounds,\n HashMap<TimeSelector, Long> upperBounds)\n throws QueryContradictoryException {\n ArrayList<ArrayList<ComparableExpression>> neq = relationToTuples(cNeq);\n for (ArrayList<ComparableExpression> tuple : neq) {\n if (tuple.get(0) instanceof TimeSelector) {\n TimeSelector sel = (TimeSelector) tuple.get(0);\n // if lower(sel)!=upper(sel), no constraint sel!=x is contradictory\n if (!lowerBounds.get(sel).equals(upperBounds.get(sel))) {\n return;\n }\n // selector1 != selector2 only contradictory if both selectors have the same fixed value\n // (lower(selector1)=upper(selector1)=lower(selector2)=upper(selector2)\n if (tuple.get(1) instanceof TimeSelector) {\n TimeSelector sel2 = (TimeSelector) tuple.get(1);\n if (lowerBounds.get(sel).equals(lowerBounds.get(sel2)) &&\n lowerBounds.get(sel2).equals(upperBounds.get(sel2))) {\n throw new QueryContradictoryException();\n } // selector != literal only contradictory if lower(selector)=upper(selector)=literal\n } else if (tuple.get(1) instanceof TimeLiteral) {\n Long literalValue = ((TimeLiteral) tuple.get(1)).getMilliseconds();\n if (lowerBounds.get(sel).equals(literalValue)) {\n throw new QueryContradictoryException();\n }\n }\n } else if (tuple.get(0) instanceof TimeLiteral && tuple.get(1) instanceof TimeSelector) {\n // selector != literal only contradictory if lower(selector)=upper(selector)=literal\n TimeSelector sel = (TimeSelector) tuple.get(1);\n Long literalValue = ((TimeLiteral) tuple.get(0)).getMilliseconds();\n if (lowerBounds.get(sel).equals(upperBounds.get(sel)) && lowerBounds.get(sel).equals(literalValue)) {\n throw new QueryContradictoryException();\n }\n }\n }\n }", "protected void checkBox(int slice, int row, int column, int depth, int height, int width) {\n\tif (slice<0 || depth<0 || slice+depth>slices || row<0 || height<0 || row+height>rows || column<0 || width<0 || column+width>columns) throw new IndexOutOfBoundsException(toStringShort()+\", slice:\"+slice+\", row:\"+row+\" ,column:\"+column+\", depth:\"+depth+\" ,height:\"+height+\", width:\"+width);\n}", "private int adequateDimensions(int cols, int rows) {\r\n\r\n if ((cols >= MINALG) && (cols <= MAXALG)) {\r\n if ((rows >= MINDATA) && (rows <= MAXDATA)) {\r\n return 0;\r\n } else {\r\n return 1;\r\n }\r\n } else {\r\n return 2;\r\n }\r\n\r\n }", "private boolean checkIllegallIndexes(Set<Integer> mintermSet, Set<Integer> dontCareSet, int size) {\n\t\tSet<Integer> mintermAndDontCareUnion = new HashSet<>(mintermSet);\n\t\tmintermAndDontCareUnion.addAll(dontCareSet);\n\n\t\tdouble maxMinterm = Math.pow(2, size) - 1;\n\t\tfor (Integer integer : mintermAndDontCareUnion) {\n\t\t\tif (integer > maxMinterm) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "@Test\n public void testMultiLevelPartitionPruning() throws SqlParseException {\n\n val project = \"multi_level_partition\";\n val dfId = \"747f864b-9721-4b97-acde-0aa8e8656cba\";\n val expectedRanges = Lists.<Pair<String, String>> newArrayList();\n val segmentRange1 = Pair.newPair(\"2012-01-01\", \"2012-01-02\");\n val segment1Uuid = \"8892fa3f-f607-4eec-8159-7c5ae2f16942\";\n val segmentRange2 = Pair.newPair(\"2012-01-02\", \"2012-01-03\");\n val segment2Uuid = \"d75a822c-788a-4592-a500-cf20186dded1\";\n val segmentRange3 = Pair.newPair(\"2012-01-03\", \"2012-01-04\");\n val segment3Uuid = \"54eaf96d-6146-45d2-b94e-d5d187f89919\";\n val segmentRange4 = Pair.newPair(\"2012-01-04\", \"2012-01-05\");\n val segment4Uuid = \"411f40b9-a80a-4453-90a9-409aac6f7632\";\n val segmentRange5 = Pair.newPair(\"2012-01-05\", \"2012-01-06\");\n val segment5Uuid = \"a8318597-cb75-416f-8eb8-96ea285dd2b4\";\n val expectedPartitionMap = Maps.<String, List<Long>> newHashMap();\n\n val sqlBase = \"select cal_dt, sum(price) from test_kylin_fact inner join test_account on test_kylin_fact.seller_id = test_account.account_id \";\n\n // no filter\n val noFilterSql = sqlBase + \"group by cal_dt\";\n expectedRanges.add(segmentRange1);\n expectedRanges.add(segmentRange2);\n expectedRanges.add(segmentRange3);\n expectedRanges.add(segmentRange4);\n expectedRanges.add(segmentRange5);\n expectedPartitionMap.put(segment1Uuid, Lists.newArrayList(0L, 1L, 2L, 3L));\n expectedPartitionMap.put(segment2Uuid, Lists.newArrayList(0L, 1L, 2L));\n expectedPartitionMap.put(segment3Uuid, Lists.newArrayList(1L, 2L, 3L));\n expectedPartitionMap.put(segment4Uuid, Lists.newArrayList(0L, 1L));\n expectedPartitionMap.put(segment5Uuid, Lists.newArrayList(2L, 3L));\n assertPrunedSegmentsRange(project, noFilterSql, dfId, expectedRanges, 1L, expectedPartitionMap);\n\n val andSql0 = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-04' and lstg_site_id = 1 group by cal_dt\";\n val andMappingSql0 = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-04' and lstg_format_name = 'FP-non GTC' group by cal_dt\";\n val andMixSql0 = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-04' and lstg_site_id = 1 and lstg_format_name = 'FP-non GTC' group by cal_dt\";\n expectedRanges.clear();\n expectedRanges.add(segmentRange1);\n expectedRanges.add(segmentRange2);\n expectedRanges.add(segmentRange3);\n expectedPartitionMap.clear();\n expectedPartitionMap.put(segment1Uuid, Lists.newArrayList(1L));\n expectedPartitionMap.put(segment2Uuid, Lists.newArrayList(1L));\n expectedPartitionMap.put(segment3Uuid, Lists.newArrayList(1L));\n assertPrunedSegmentsRange(project, andSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n assertPrunedSegmentsRange(project, andMappingSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n assertPrunedSegmentsRange(project, andMixSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n\n val notInSql0 = sqlBase\n + \"where cal_dt > '2012-01-02' and cal_dt < '2012-01-04' and lstg_site_id not in (0, 2, 3) group by cal_dt\";\n val notInMappingSql0 = sqlBase\n + \"where cal_dt > '2012-01-02' and cal_dt < '2012-01-04' and lstg_format_name not in ('FP-GTC', 'ABIN', 'Auction') group by cal_dt\";\n val notInMixSql0 = sqlBase\n + \"where cal_dt > '2012-01-02' and cal_dt < '2012-01-04' and lstg_site_id not in (0, 2, 3) and lstg_format_name not in ('FP-GTC', 'ABIN', 'Auction') group by cal_dt\";\n expectedRanges.clear();\n expectedRanges.add(segmentRange2);\n expectedRanges.add(segmentRange3);\n expectedPartitionMap.clear();\n expectedPartitionMap.put(segment2Uuid, Lists.newArrayList(1L));\n expectedPartitionMap.put(segment3Uuid, Lists.newArrayList(1L));\n assertPrunedSegmentsRange(project, notInSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n assertPrunedSegmentsRange(project, notInMappingSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n assertPrunedSegmentsRange(project, notInMixSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n\n // return empty data case\n val emptyData = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-03' and lstg_site_id = 5 group by cal_dt\";\n val emptyDataMapping = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-03' and lstg_format_name = 'not_exist_name' group by cal_dt\";\n val emptyDataMix = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-03' and lstg_site_id = 5 and lstg_format_name = 'not_exist_name' group by cal_dt\";\n expectedRanges.clear();\n expectedPartitionMap.clear();\n assertPrunedSegmentsRange(project, emptyData, dfId, expectedRanges, -1L, expectedPartitionMap);\n assertPrunedSegmentsRange(project, emptyDataMapping, dfId, expectedRanges, -1L, expectedPartitionMap);\n assertPrunedSegmentsRange(project, emptyDataMix, dfId, expectedRanges, -1L, expectedPartitionMap);\n\n // query data out of current built segments range\n val inSql0 = sqlBase\n + \"where cal_dt > '2011-12-30' and cal_dt < '2012-01-03' and lstg_site_id in (1, 2) group by cal_dt\";\n val inMappingSql0 = sqlBase\n + \"where cal_dt > '2011-12-30' and cal_dt < '2012-01-03' and lstg_format_name in ('FP-non GTC', 'ABIN') group by cal_dt\";\n val inMixSql0 = sqlBase\n + \"where cal_dt > '2011-12-30' and cal_dt < '2012-01-03' and lstg_site_id in (1, 2) and lstg_format_name in ('FP-non GTC', 'ABIN') group by cal_dt\";\n expectedRanges.add(segmentRange1);\n expectedRanges.add(segmentRange2);\n expectedPartitionMap.put(segment1Uuid, Lists.newArrayList(1L, 2L));\n expectedPartitionMap.put(segment2Uuid, Lists.newArrayList(1L, 2L));\n assertPrunedSegmentsRange(project, inSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n assertPrunedSegmentsRange(project, inMappingSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n assertPrunedSegmentsRange(project, inMixSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n\n val pushDownSql0 = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-03' and lstg_site_id = 3 group by cal_dt\";\n assertNoRealizationFound(project, pushDownSql0);\n\n val pushDownMappingSql0 = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-03' and lstg_format_name = 'Auction' group by cal_dt\";\n assertNoRealizationFound(project, pushDownMappingSql0);\n\n val pushDownMixSql0 = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-03' and lstg_site_id = 3 and lstg_format_name = 'Auction' group by cal_dt\";\n assertNoRealizationFound(project, pushDownMixSql0);\n\n // return empty result\n val wrongMapping0 = sqlBase\n + \"where cal_dt between '2012-01-01' and '2012-01-02' and lstg_site_id = 0 and lstg_format_name = 'FP-non GTC' group by cal_dt\";\n assertPrunedSegmentsRange(project, wrongMapping0, dfId, null, -1L, null);\n\n val orSql0 = sqlBase\n + \"where cal_dt > '2012-01-01' and cal_dt < '2012-01-02' and (lstg_site_id = 0 or lstg_format_name = 'FP-non GTC') group by cal_dt\";\n expectedRanges.clear();\n expectedPartitionMap.clear();\n expectedRanges.add(segmentRange1);\n expectedPartitionMap.put(segment1Uuid, Lists.newArrayList(0L, 1L));\n assertPrunedSegmentsRange(project, orSql0, dfId, expectedRanges, 1L, expectedPartitionMap);\n }", "private Set<Mask> selectImportantPrimaryImplicants(Mask[] implicants, Map<Integer, Integer> mintermToColumnMap,\n\t\t\tboolean[][] table, boolean[] coveredMinterms) {\n\n\t\tSet<Mask> importantPrimaryImplicants = new HashSet<>();\n\n\t\tfor (int i = 0; i < table[0].length; i++) {\n\t\t\tint counter = 0;\n\t\t\tint implicantIndex = 0;\n\t\t\tfor (int j = 0; j < table.length; j++) {\n\t\t\t\tif (table[j][i] == true) {\n\t\t\t\t\tcounter++;\n\t\t\t\t\timplicantIndex = j;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (counter == 1) {\n\n\t\t\t\tMask primaryImplicant = implicants[implicantIndex];\n\t\t\t\timportantPrimaryImplicants.add(primaryImplicant);\n\n\t\t\t\tfor (int minterm : primaryImplicant.getIndexes()) {\n\t\t\t\t\tif (mintermToColumnMap.get(minterm) != null) {\n\t\t\t\t\t\tcoveredMinterms[mintermToColumnMap.get(minterm)] = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn importantPrimaryImplicants;\n\t}", "boolean isPossible() {\n return (sideOne + sideTwo > sideThree) && (sideTwo + sideThree > sideOne) && (sideThree + sideOne > sideTwo);\n }", "Condition(Column col1, String relation, Column col2) {\n // YOUR CODE HERE\n }", "@Test\n public void whereNormalColumn() throws Exception {\n String sql = \"desc verbose select k1, e1 from db1.tbl1 lateral view explode_split(k2, \\\",\\\") tmp as e1 \"\n + \"where k1=1; \";\n String explainString = UtFrameUtils.getSQLPlanOrErrorMsg(ctx, sql, true);\n Assert.assertTrue(explainString.contains(\"1:TABLE FUNCTION NODE\"));\n Assert.assertTrue(explainString.contains(\"table function: explode_split(`k2`, ',')\"));\n Assert.assertTrue(explainString.contains(\"tuple ids: 0 1\"));\n Assert.assertTrue(explainString.contains(\"TupleDescriptor{id=1, tbl=tmp, byteSize=32, materialized=true}\"));\n Assert.assertTrue(explainString.contains(\"SlotDescriptor{id=1, col=e1, type=VARCHAR(*)}\"));\n Assert.assertTrue(explainString.contains(\"0:OlapScanNode\"));\n Assert.assertTrue(explainString.contains(\"PREDICATES: `k1` = 1\"));\n }", "public boolean checkDeskSubset(ArrayList<Furniture> subset){\n boolean legs = false;\n boolean top = false;\n boolean drawer = false;\n\n for(Furniture d : subset){\n if(d instanceof Desk){\n Desk desk = (Desk)d;\n if(desk.getLegs().equals(\"Y\")){\n legs = true;\n }\n if(desk.getTop().equals(\"Y\")){\n top = true;\n }\n if(desk.getDrawer().equals(\"Y\")){\n drawer = true;\n }\n }\n }\n // check if any of the desk pieces are missing and if so the combination is invalid\n if(!legs || !top || !drawer){\n return false;\n }\n return true;\n }", "@Test\n public void testIntersection5()\n {\n final int[] ints1 = {33, 100000};\n final int[] ints2 = {34, 200000};\n List<Integer> expected = new ArrayList<>();\n\n ConciseSet set1 = new ConciseSet();\n for (int i : ints1) {\n set1.add(i);\n }\n ConciseSet set2 = new ConciseSet();\n for (int i : ints2) {\n set2.add(i);\n }\n\n verifyIntersection(expected, set1, set2);\n }", "public boolean checkChairSubset(ArrayList<Furniture> subset){\n boolean legs = false;\n boolean arms = false;\n boolean seat = false;\n boolean cushion = false;\n\n for(Furniture c : subset){\n if(c instanceof Chair){\n Chair chair = (Chair)c;\n if(chair.getLegs().equals(\"Y\")){\n legs = true;\n }\n if(chair.getArms().equals(\"Y\")){\n arms = true;\n }\n if(chair.getSeat().equals(\"Y\")){\n seat = true;\n }\n if(chair.getCushion().equals(\"Y\")){\n cushion = true;\n }\n }\n }\n // check if any of the chair pieces are missing and if so the combination is invalid\n if(!legs || !arms || !seat || !cushion){\n return false;\n }\n return true;\n }", "private int restrictSection(Message msg, String parameter) {\n int sec = Integer.parseInt(parameter);\n\n if(sec > 2) {\n MessageChannel ch = msg.getChannel();\n ch.sendMessage(\"`Error: Invalid query [section not 0-2]. Query terminated.`\").queue();\n return -1;\n }\n else if(sec == 2) {\n partTwo = true;\n upperProblem = 8;\n }\n\n return sec;\n }", "@Test void firstRow1and2() {\n\t\tcheckFirstRow1and2(false,5,4);\n\n\t\t// X X X X\n\t\t// X X X X X\n\t\tcheckFirstRow1and2(true,4,5);\n\n\t\t// X\n\t\t// x\n\t\tcheckFirstRow1and2(false,1,1);\n\n\t\t// X\n\t\t// x\n\t\tcheckFirstRow1and2(true,1,1);\n\t}", "private boolean getJoinOpsAndLeafInputs(ILogicalOperator op) throws AlgebricksException {\n if (joinClause(op)) {\n JoinOperator jO = new JoinOperator((AbstractBinaryJoinOperator) op);\n allJoinOps.add(jO);\n if (op.getOperatorTag() == LogicalOperatorTag.LEFTOUTERJOIN) {\n jO.setOuterJoin(true);\n }\n\n int firstLeafInputNumber, lastLeafInputNumber;\n int k = 0;\n for (int i = 0; i < 2; i++) {\n ILogicalOperator nextOp = op.getInputs().get(i).getValue();\n firstLeafInputNumber = leafInputNumber + 1; // we are interested in the 2nd input only\n boolean canTransform = getJoinOpsAndLeafInputs(nextOp);\n if (!canTransform) {\n return false;\n }\n lastLeafInputNumber = leafInputNumber; // we are interested in the 2nd input only\n k = 0;\n // now we know the leafInput numbers that occurred on the right side of this join.\n //if ((op.getOperatorTag() == LogicalOperatorTag.LEFTOUTERJOIN) && (i == 1)) {\n if ((joinClause(op)) && (i == 1)) {\n for (int j = firstLeafInputNumber; j <= lastLeafInputNumber; j++) {\n k |= 1 << (j - 1);\n }\n // buildSets are only for outerjoins.\n if ((op.getOperatorTag() == LogicalOperatorTag.LEFTOUTERJOIN)\n && (firstLeafInputNumber < lastLeafInputNumber)) { // if more is than one leafInput, only then buildSets make sense.\n buildSets.add(new Triple<>(k, lastLeafInputNumber - firstLeafInputNumber + 1, true)); // convert the second to boolean later\n }\n boolean ret = buildDependencyList(op, jO, outerJoinsDependencyList, k);\n if (!ret) {\n return false;\n }\n }\n }\n } else {\n if (op.getOperatorTag() == LogicalOperatorTag.GROUP) { // cannot handle group by's in leaf Inputs.\n return false;\n }\n Pair<EmptyTupleSourceOperator, DataSourceScanOperator> etsDataSource = containsLeafInputOnly(op);\n if (etsDataSource != null) { // a leaf input\n EmptyTupleSourceOperator etsOp = etsDataSource.first;\n DataSourceScanOperator dataSourceOp = etsDataSource.second;\n if (op.getOperatorTag().equals(LogicalOperatorTag.DISTRIBUTE_RESULT)) {// single table query\n ILogicalOperator selectOp = findSelectOrDataScan(op);\n if (selectOp == null) {\n return false;\n } else {\n leafInputs.add(selectOp);\n }\n } else {\n leafInputNumber++;\n leafInputs.add(op);\n if (!addLeafInputNumbersToVars(op)) {\n return false;\n }\n }\n } else { // This must be an internal edge\n if (onlyAssigns(op, assignOps)) {\n ILogicalOperator skipAssisgnsOp = skipPastAssigns(op);\n boolean canTransform = getJoinOpsAndLeafInputs(skipAssisgnsOp);\n if (!canTransform) {\n return false;\n }\n } else {\n return false;\n }\n }\n }\n return true;\n }" ]
[ "0.7527817", "0.75101864", "0.74625117", "0.7373135", "0.7340862", "0.7261511", "0.72511", "0.7019014", "0.70154095", "0.69282657", "0.678104", "0.67779183", "0.67552125", "0.67154366", "0.6553618", "0.6484248", "0.611916", "0.60863286", "0.5970281", "0.57139134", "0.56976074", "0.56850374", "0.5560151", "0.55324936", "0.55292153", "0.53352684", "0.5198562", "0.5173441", "0.5101055", "0.50801444", "0.50651854", "0.50595057", "0.5050097", "0.5028841", "0.50030416", "0.49749714", "0.4947694", "0.49378076", "0.49338406", "0.49265295", "0.49123797", "0.48974934", "0.48828825", "0.48788738", "0.48780617", "0.48628205", "0.48441672", "0.48115826", "0.48083806", "0.47663555", "0.47629887", "0.47627994", "0.4758504", "0.4757997", "0.47516719", "0.47514117", "0.4744254", "0.4711336", "0.47016305", "0.46952435", "0.46732512", "0.4671555", "0.46641794", "0.46605042", "0.46587333", "0.465257", "0.46449095", "0.46445698", "0.46419546", "0.46362543", "0.46305802", "0.4626612", "0.4607652", "0.45955014", "0.45934823", "0.4576993", "0.45723933", "0.45711118", "0.45710889", "0.45691255", "0.45669752", "0.456578", "0.45646316", "0.45603895", "0.45488045", "0.45366558", "0.4535961", "0.45268273", "0.4522266", "0.45220646", "0.45175332", "0.45171615", "0.45069122", "0.4499206", "0.44962135", "0.44946888", "0.4493036", "0.44862938", "0.44835532", "0.44820264" ]
0.74467874
3
Asserts that the specified Composite is an empty one.
private static void assertEmptyComposite(Composite composite) { assertEquals(Composites.EMPTY, composite); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void testIsEmpty() {\n assertTrue(this.empty.isEmpty());\n assertFalse(this.stack.isEmpty());\n }", "@Test\n void isNotEmptyTest() {\n Container container = new Container();\n container.fillContainer(Resource.SHIELD);\n assertFalse(container.isEmpty());\n }", "public void testIsEmpty() {\n assertTrue(test1.isEmpty());\n test1.append(new Buffer(3, rec));\n assertFalse(test1.isEmpty());\n }", "@Test\n public void testIsEmpty() {\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>();\n instance.add(1);\n instance.add(2);\n instance.add(3);\n instance.add(4);\n instance.clear();\n\n boolean expResult = true;\n boolean result = instance.isEmpty();\n assertEquals(expResult, result);\n }", "@Test\n public void shouldCreateEmptyContractWithoutPreconditions() {\n // Given\n Contract contract;\n\n // When\n contract = ContractFactory.emptyContract();\n\n // Then\n Assert.assertTrue(\"The empty contract has unknown preconditions!\", contract.preconditions().length == 0);\n Assert.assertTrue(\"The empty contract has unknown postconditions!\", contract.postconditions().length == 0);\n Assert.assertEquals(\"The created contract has the wrong annotation type!\", contract.annotationType(),\n Contract.class);\n }", "@Test\n void emptyingTest(){\n Container container = new Container();\n container.fillContainer(Resource.SHIELD);\n container.takeResource();\n assertTrue(container.isEmpty());\n }", "@Test\n void isEmptyTest(){\n Container container = new Container();\n assertTrue(container.isEmpty());\n }", "@Test\r\n\tpublic void testEmptyContents() throws Exception {\n\t\tassertThat(this.basket.getContents().count(), is(0L));\r\n\t}", "@Test\n public void testIsEmpty_Not_Empty() {\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>();\n instance.add(1);\n instance.add(2);\n instance.add(3);\n\n boolean expResult = false;\n boolean result = instance.isEmpty();\n assertEquals(expResult, result);\n }", "public void testIsEmpty() {\r\n assertTrue( list.isEmpty());\r\n list.add(\"A\");\r\n assertFalse(list.isEmpty());\r\n }", "public boolean empty();", "@Test\r\n public void testIsEmpty() {\r\n Grocery entry1 = new Grocery(\"Mayo\", \"Dressing / Mayo\", 1, 2.99f, 1);\r\n\r\n // Test empty\r\n assertTrue(instance.isEmpty());\r\n\r\n instance.add(entry1);\r\n\r\n // Test not empty\r\n assertFalse(instance.isEmpty());\r\n }", "@Test\r\n\tpublic void testIsEmpty() {\r\n\t\tAssert.assertFalse(list.isEmpty());\r\n\t\tlist.clear();\r\n\t\tAssert.assertTrue(list.isEmpty());\r\n\t}", "public CollectionPreconditions toBeEmpty() {\n return customMatcher(new Matcher<Collection>() {\n @Override\n public boolean match(final Collection value, final String label) {\n return expect(value, label).not().toBeNull().check().isEmpty();\n }\n\n @Override\n public PreconditionException getException(final Collection value, final String label) {\n return new CollectionNotEmptyPreconditionException(value, label);\n }\n\n @Override\n public PreconditionException getNegatedException(Collection value, String label) {\n return new CollectionEmptyPreconditionException(value, label);\n }\n });\n }", "@Test\n public void emptyTest() {\n assertEquals(true, true);\n }", "@Test\n public void emptyTest() {\n assertEquals(true, true);\n }", "@Test\r\n public void testComposite() {\r\n \r\n Leaf pers1 = new Leaf(\"Tracy\");\r\n Leaf pers2 = new Leaf(\"JR\");\r\n Leaf pers3 = new Leaf(\"Simon\");\r\n \r\n Composite comp1 = new Composite();\r\n comp1.add(pers1);\r\n comp1.add(pers2);\r\n comp1.add(pers3);\r\n \r\n //Assert.assertEquals(pers1.sayHello(), \"Tracy person says hello\");\r\n Assert.assertNotNull(comp1);\r\n \r\n \r\n }", "@Test\r\n\tpublic void testIsEmpty() {\r\n\t\ttestArray = new ArrayBasedList<String>();\r\n\t\tassertTrue(testArray.isEmpty());\r\n\t\ttestArray.add(\"hi\");\r\n\t\tassertTrue(!testArray.isEmpty());\r\n\t}", "public void makeEmpty();", "public void makeEmpty();", "public abstract void makeEmpty();", "private void testIsEmpty() {\n init();\n assertTrue(\"empty\", FListInteger.isEmpty(l0));\n assertFalse(\"nonempty\", FListInteger.isEmpty(l1));\n }", "@SuppressWarnings(\"serial\")\n\t@Test\n\tpublic void testEmptyContainerSpace(){\n\t\tContainer c = new Container(0,1){\n\t\t\tpublic boolean canAccess(Player player) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t};\n\t\tassertTrue(c.hasSpace());\n\t}", "@Override\r\n\tpublic boolean isEmpty() {\r\n\t\treturn size() == 0;\r\n\t}", "public void isNotEmpty() {\n if (Iterables.isEmpty(getSubject())) {\n // TODO(user): \"Not true that <[]> is not empty\" doesn't really need the <[]>,\n // since it's empty. But would the bulkier \"the subject\" really be better?\n // At best, we could *replace* <[]> with a given label (rather than supplementing it).\n // Perhaps the right failure message is just \"<[]> should not have been empty\"\n fail(\"is not empty\");\n }\n }", "@Override\n public boolean isEmpty() { return true; }", "public void testIsEmpty() {\r\n assertTrue(tree.isEmpty());\r\n tree.insert(\"apple\");\r\n assertFalse(tree.isEmpty());\r\n }", "@Override\n public boolean isEmpty() {\n return size() == 0;\n }", "@Override\n public boolean isEmpty() {\n return size() == 0;\n }", "@Override\n public boolean isEmpty() {\n return size() == 0;\n }", "@Override\n public boolean isEmpty() {\n return size() == 0;\n }", "@Override\n public boolean isEmpty() {\n return size() == 0;\n }", "@Test\r\n\t/* emptyTest\r\n\t * \r\n\t * checks: public boolean empty()\r\n\t * \r\n\t * This test checks:\r\n\t * \t\t- if the color instance variable in Car is equal null\r\n\t * \t\t- if the color instance variable is Car is not equal to null\r\n\t * \r\n\t * \r\n\t */\r\n\tpublic void emptyTest()\r\n\t{\n\t\tint x = 23;\r\n\t\tint y = 24;\r\n\t\tint speed = 6;\r\n\t\tColor colour = new Color (10,10,10);\r\n\t\t\r\n\t\tCar testCar = new Car(x,y,speed,colour);\r\n\t\t\r\n\t\tboolean colourValue = testCar.empty();\r\n\t\tassertFalse(colourValue);\r\n\t\t\r\n\t\t\r\n\t\t//Test the value of testCar.color is null \r\n\t\tx = 3;\r\n\t\ty = 74;\r\n\t\tspeed = 5;\r\n\t\tColor noColour = null;\r\n\t\t\r\n\t\tCar testCar2 = new Car(x,y,speed,noColour);\r\n\t\t\r\n\t\tcolourValue = testCar2.empty();\r\n\t\tassertTrue(colourValue);\r\n\t\t\r\n\t}", "private static void testIsEmpty(BagInterface<String> bag, boolean empty)\n {\n System.out.print(\"\\nTesting isEmpty with \");\n if (empty)\n System.out.println(\"an empty bag:\");\n else\n System.out.println(\"a bag that is not empty:\");\n\n System.out.print(\"isEmpty finds the bag \");\n if (empty && bag.isEmpty())\n System.out.println(\"empty: OK.\");\n else if (empty)\n System.out.println(\"not empty, but it is: ERROR.\");\n else if (!empty && bag.isEmpty())\n System.out.println(\"empty, but it is not empty: ERROR.\");\n else\n System.out.println(\"not empty: OK.\");\n }", "@Test\n public void testIsEmpty_Empty_Overflow() {\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>(3, 2);\n instance.add(1);\n instance.add(2);\n instance.add(3);\n instance.add(4);\n instance.add(5);\n instance.add(6);\n instance.clear();\n\n boolean expResult = true;\n boolean result = instance.isEmpty();\n assertEquals(expResult, result);\n }", "@Test\n public void testIsEmptyOnEmpty() {\n assertTrue(\"The integer PQHeap is empty: \", \n this.iPQ.isEmpty());\n assertTrue(\"The string PQHeap is empty: \", \n this.sPQ.isEmpty());\n }", "@Test\n public void emptyTrueTest() {\n SimpleQueue<String> queue = new SimpleQueue<>();\n assertThat(true, is(queue.empty()));\n }", "@Test\n public void shouldCreateEmptyContract() {\n // Given\n Contract contract;\n\n // When\n contract = ContractFactory.emptyContract();\n\n // Then\n Assert.assertNotNull(\"The created contract is NULL!\", contract);\n }", "public boolean isEmpty() { return true; }", "public boolean empty() {\r\n\t\treturn empty;\r\n\t}", "@Test \r\n\t\tpublic void testIsEmpty() {\n\t\ttestingSet= new IntegerSet();\r\n\t\tassertTrue(testingSet.isEmpty()); // empty list = true \r\n\t\tassertFalse(!testingSet.isEmpty());// !empty list = false\r\n\t\t}", "@Test\n void reEmptyingContainerTest() {\n Container container = new Container();\n container.fillContainer(Resource.SHIELD);\n container.takeResource();\n container.fillContainer(Resource.COIN);\n container.takeResource();\n assertTrue(container.isEmpty());\n }", "public boolean empty() {\n\t\treturn (size() <= 0);\n\t}", "@Test\n public void testConstructEmptyTaint() {\n Taint t = Taint.emptyTaint();\n assertTrue(t.isEmpty());\n }", "@Override\n\tpublic boolean isEmpty() {\n\t\treturn(size() == 0);\n\t}", "@Test\n public void testASSY1HasNoSubComponents() {\n assertThat( hasSubComponents( ASSY1_WITHOT_SUB_COMP ), is( false ) );\n }", "public boolean empty()\n {\n return isEmpty();\n }", "public boolean empty() {\n return one.isEmpty();\n \n }", "@Test\n public void testIsEmpty_Not_Empty_Overflow() {\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>(3, 2);\n instance.add(1);\n instance.add(2);\n instance.add(3);\n instance.add(4);\n instance.add(5);\n instance.add(6);\n\n boolean expResult = false;\n boolean result = instance.isEmpty();\n assertEquals(expResult, result);\n }", "@Override\n\tpublic boolean isEmpty() {\n\t\treturn size == 0;\n\t}", "@Override\n\tpublic boolean isEmpty() {\n\t\treturn size == 0;\n\t}", "public boolean empty() {\r\n return size == 0;\r\n }", "public boolean empty() \r\n\t{\r\n\t\tif(size == 0)\r\n\t\t{\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public boolean isEmpty() {\n return getCardCount() <= 0;\n }", "@Test\n public void testIsEmptyOnNonEmpty() {\n this.iPQ.insert(1);\n assertFalse(\"The integer PQHeap is empty: \",\n this.iPQ.isEmpty());\n this.sPQ.insert(\"a\");\n assertFalse(\"The string PQHeap is empty: \",\n this.iPQ.isEmpty());\n }", "@Override\n\tpublic boolean isEmpty() {\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean isEmpty() {\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean isEmpty() {\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean isEmpty() {\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean isEmpty() {\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean isEmpty() {\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean isEmpty() {\n\t\treturn false;\n\t}", "public void isEmpty() {\n if (!Iterables.isEmpty(getSubject())) {\n fail(\"is empty\");\n }\n }", "@Override\r\n\tpublic boolean isEmpty() {\n\t\treturn this.size == 0;\r\n\t}", "@Override\r\n public boolean isEmpty() {\r\n return size == 0;\r\n }", "@Override\n\t\tpublic boolean isEmpty() {\n\t\t\treturn false;\n\t\t}", "@Override\n\t\tpublic boolean isEmpty() {\n\t\t\treturn false;\n\t\t}", "public void testEmpty_1()\n throws Exception {\n BestChromosomesSelector selector = new BestChromosomesSelector(conf);\n Gene gene = new BooleanGene(conf);\n Chromosome chrom = new Chromosome(conf, gene, 5);\n selector.add(chrom);\n Population popNew = new Population(conf);\n selector.select(1, null, popNew);\n selector.empty();\n assertEquals(1, popNew.size());\n assertNotNull(popNew.getChromosome(0));\n }", "public boolean isEmpty() {\n return true;\n }", "@Override\n public boolean isEmpty() {\n return this.count() == 0;\n }", "public void testCreateEmptyArray() {\n System.out.println(\"createEmptyArray\"); // NOI18N\n \n TypeID componentType = new TypeID(TypeID.Kind.COMPONENT,\"Root\"); // NOI18N\n \n PropertyValue result = PropertyValue.createEmptyArray(componentType);\n List<PropertyValue> expResult = new ArrayList<PropertyValue> (0);\n \n assertEquals(expResult, result.getArray());\n }", "@Override\r\n public boolean isEmpty() {\n return size == 0;\r\n }", "public final boolean isEmpty()\r\n/* 62: */ {\r\n/* 63:247 */ return lvConsumerIndex() == lvProducerIndex();\r\n/* 64: */ }", "@Override\n public boolean isEmpty() {\n return size()==0;\n }", "public boolean empty() {\n return size == 0;\n }", "public boolean empty() { \t \n\t\t return size <= 0;\t \n }", "@Test\n public void emptyBoard() {\n Board b = new Board();\n for (int c = 0; c < b.SIZE; c += 1) {\n for (int r = 0; r < b.SIZE; r += 1) {\n assertEquals(EMPTY, b.get(c, r));\n }\n }\n }", "public boolean is_empty() {\n\t\treturn false;\n\t}", "@Test\n public void testIsEmpty(){\n ms = new MyStack();\n assertTrue(ms.IsEmpty());\n }", "@Override\n\tpublic boolean isEmpty() {\n\t\treturn (getSize() == 0);\n\t}", "public boolean isEmpty() ;", "@Override\npublic boolean isEmpty() {\n\treturn false;\n}", "@Override\n public boolean isEmpty()\n {\n return false;\n }", "public void testEmptyFull() {\n SynchronousQueue q = new SynchronousQueue();\n assertTrue(q.isEmpty());\n\tassertEquals(0, q.size());\n assertEquals(0, q.remainingCapacity());\n assertFalse(q.offer(zero));\n }", "@Override\n public boolean isEmpty() {\n return this.size == 0;\n }", "@Test\n public void testClearOnEmpty() {\n this.iPQ.clear();\n assertTrue(\"Clear on empty is empty: \",\n this.iPQ.isEmpty());\n this.sPQ.clear();\n assertTrue(\"Clear on empty is empty: \",\n this.sPQ.isEmpty());\n }", "@Override\n public boolean isEmpty()\n {\n return size == 0;\n }", "public MapAssertion<K, V> isEmpty() {\n checkActualIsNotNull();\n if (!getActual().isEmpty()) {\n throw getAssertionErrorBuilder().addMessage(Messages.Fail.Actual.IS_EMPTY).addActual().build();\n }\n return this;\n }", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();" ]
[ "0.6610717", "0.66019595", "0.65668297", "0.64829636", "0.63958585", "0.6373087", "0.6372227", "0.62775236", "0.6258594", "0.61821175", "0.61671674", "0.6142382", "0.6095398", "0.6093176", "0.60911185", "0.60911185", "0.6086482", "0.6083981", "0.6080389", "0.6080389", "0.6076216", "0.60760415", "0.60717005", "0.60667956", "0.6060368", "0.60299736", "0.60276747", "0.600437", "0.600437", "0.600437", "0.600437", "0.600437", "0.5995083", "0.59753263", "0.5969678", "0.5958042", "0.59311676", "0.59285414", "0.59111184", "0.5910418", "0.5907457", "0.58898956", "0.5883726", "0.58815324", "0.5874594", "0.587176", "0.587118", "0.5868533", "0.5865446", "0.5859975", "0.5859975", "0.5859721", "0.58562344", "0.5856104", "0.584515", "0.5844815", "0.5844815", "0.5844815", "0.5844815", "0.5844815", "0.5844815", "0.5844815", "0.5841054", "0.5833765", "0.5832836", "0.58326596", "0.58326596", "0.58289593", "0.58274025", "0.5826548", "0.5825568", "0.5825279", "0.58243126", "0.5823237", "0.5820629", "0.58188206", "0.5814994", "0.58117425", "0.5811657", "0.58116364", "0.5810811", "0.5810745", "0.58104575", "0.5802762", "0.5798453", "0.5798308", "0.57850796", "0.5783902", "0.5783796", "0.5783796", "0.5783796", "0.5783796", "0.5783796", "0.5783796", "0.5783796", "0.5783796", "0.5783796", "0.5783796", "0.5783796", "0.5783796" ]
0.89270663
0
Asserts that the specified Composite contains the specified element and the specified EOC.
private static void assertComposite(Composite composite, ByteBuffer element, EOC eoc) { assertComposite(composite, eoc, element); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void assertComposite(Composite composite,\n ByteBuffer firstElement,\n ByteBuffer secondElement,\n ByteBuffer thirdElement,\n EOC eoc)\n {\n assertComposite(composite, eoc, firstElement, secondElement, thirdElement);\n }", "private static void assertComposite(Composite composite, ByteBuffer firstElement, ByteBuffer secondElement, EOC eoc)\n {\n assertComposite(composite, eoc, firstElement, secondElement);\n }", "private static void assertComposite(Composite composite,\n ByteBuffer firstElement,\n ByteBuffer secondElement,\n ByteBuffer thirdElement,\n ByteBuffer fourthElement,\n EOC eoc)\n {\n assertComposite(composite, eoc, firstElement, secondElement, thirdElement, fourthElement);\n }", "private static void assertComposite(Composite composite, EOC eoc, ByteBuffer... elements)\n {\n assertEquals(\"the composite size is not the expected one:\", elements.length, composite.size());\n for (int i = 0, m = elements.length; i < m; i++)\n {\n ByteBuffer element = elements[i];\n assertTrue(String.format(\"the element %s of the composite is not the expected one: expected %s but was %s\",\n i,\n ByteBufferUtil.toInt(element),\n ByteBufferUtil.toInt(composite.get(i))),\n element.equals(composite.get(i)));\n }\n assertEquals(\"the EOC of the composite is not the expected one:\", eoc, composite.eoc());\n }", "@Test\r\n public void testComposite() {\r\n \r\n Leaf pers1 = new Leaf(\"Tracy\");\r\n Leaf pers2 = new Leaf(\"JR\");\r\n Leaf pers3 = new Leaf(\"Simon\");\r\n \r\n Composite comp1 = new Composite();\r\n comp1.add(pers1);\r\n comp1.add(pers2);\r\n comp1.add(pers3);\r\n \r\n //Assert.assertEquals(pers1.sayHello(), \"Tracy person says hello\");\r\n Assert.assertNotNull(comp1);\r\n \r\n \r\n }", "private static void assertEmptyComposite(Composite composite)\n {\n assertEquals(Composites.EMPTY, composite);\n }", "@Test\r\n public void testContains() {\r\n System.out.println(\"contains\");\r\n ModeloListaOrganizadores instance = new ModeloListaOrganizadores(e.getListaOrganizadores());\r\n Organizador o =new Organizador(new Utilizador(\"teste\", \"[email protected]\", \"teste\", \"teste\", true, 5));\r\n instance.addElement(o);\r\n boolean expResult = true;\r\n boolean result = instance.contains(o);\r\n assertEquals(expResult, result);\r\n \r\n }", "@Test\n public void testContains_Contain() {\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>();\n instance.add(1);\n instance.add(2);\n instance.add(3);\n\n boolean expResult = true;\n boolean result = instance.contains(1);\n assertEquals(expResult, result);\n }", "@Test\n public void extraElements() {\n assertEmpty(mReactor.getCompounds(getElements(\"Start\", \"A\", \"Fin\", \"Start\")));\n // Each reaction producing a compound should be detected separately.\n assertEmpty(mReactor.getCompounds(getElements(\"Start\", \"A\", \"Fin\", \"Start\", \"A\", \"Fin\")));\n }", "@Test\n public void testIsComposite() {\n Tag tag = new BaseTag();\n assertFalse(\"BaseTag reported as composite\", tag.isComposite());\n }", "@Test\n public void testACFTHasSubComponents() {\n assertThat( hasSubComponents( ACFT ), is( true ) );\n }", "@Test (expected=AjoutException.class)\n\tpublic void test1E() {\n\t\tConvoi c = new Convoi\t\n\t\t\t\t.Builder(\"vehicules\", \"Paris\")\n\t\t\t\t.build();\n\t\tConvoi c2 = new Convoi\t\n\t\t\t\t.Builder(\"camions\", \"Paris\")\n\t\t\t\t.build();\n\t\tc.add(c2);\n\t\tc2.add(c);\n\t}", "@Test\r\n public void testContains() {\r\n Grocery entry1 = new Grocery(\"Mayo\", \"Dressing / Mayo\", 1, 2.99f, 1);\r\n\r\n // Test element does not exist case\r\n assertFalse(instance.contains(entry1));\r\n\r\n instance.add(entry1);\r\n\r\n // Test element exists case\r\n assertTrue(instance.contains(entry1));\r\n }", "@Test\n void contains() {\n Cuboid cuboid1 = new Cuboid(4, 4, 4);\n Point3D point1 = new Point3D(0,0,0);\n assertEquals(true, cuboid1.contains(point1));\n\n Point3D point2 = new Point3D(0,0,2);\n assertEquals(true, cuboid1.contains(point2));\n\n Point3D point3 = new Point3D(0,0,-2);\n assertEquals(true, cuboid1.contains(point3));\n\n Point3D point4 = new Point3D(0,2,0);\n assertEquals(true, cuboid1.contains(point4));\n\n Point3D point5 = new Point3D(0,-2,0);\n assertEquals(true, cuboid1.contains(point5));\n\n Point3D point6 = new Point3D(2,0,0);\n assertEquals(true, cuboid1.contains(point6));\n\n Point3D point7 = new Point3D(-2,0,0);\n assertEquals(true, cuboid1.contains(point7));\n\n Point3D point8 = new Point3D(-2,-2,-2);\n assertEquals(true, cuboid1.contains(point8));\n\n Point3D point9 = new Point3D(-2,-2,-3);\n assertEquals(false, cuboid1.contains(point9));\n\n\n //Arbitary orientation\n Cuboid cuboid2 = new Cuboid(4, 5, 7, new Ray(new Point3D(-2,-2,-2), new Vector3D(1,1,1)));\n Point3D point21 = new Point3D(-1,-1,-1);\n assertEquals(true, cuboid2.contains(point21));\n\n Cuboid cuboid3 = new Cuboid(4, 5, 6, new Ray(new Point3D(-2,-2,-2), new Vector3D(1,1,1)));\n Point3D point31 = new Point3D(0,0,0);\n assertEquals(false, cuboid3.contains(point31));\n\n Cuboid cuboid4 = new Cuboid(4, 5, 6, new Ray(new Point3D(0,0,0), new Vector3D(1,1,1)));\n Point3D point41 = new Point3D(2.5,2.5,2.5);\n assertEquals(false, cuboid4.contains(point41));\n\n Cuboid cuboid5 = new Cuboid(4, 5, 6, new Ray(new Point3D(-2,-2,-2), new Vector3D(0,0,1)));\n Point3D point51 = new Point3D(-2,-2,3.5);\n assertEquals(false, cuboid5.contains(point51));\n }", "public void contains(@Nullable Object element) {\n if (!Iterables.contains(getSubject(), element)) {\n failWithRawMessage(\"%s should have contained <%s>\", getDisplaySubject(), element);\n }\n }", "private void checkProperties(Configuration compositeConfiguration)\n {\n assertTrue(\"Make sure we have loaded our key\", compositeConfiguration\n .getBoolean(\"test.boolean\"));\n assertEquals(\"I'm complex!\", compositeConfiguration\n .getProperty(\"element2.subelement.subsubelement\"));\n assertEquals(\"property in the XMLPropertiesConfiguration\", \"value1\",\n compositeConfiguration.getProperty(\"key1\"));\n }", "@Test\n public void testTRK1HasSubComponents() {\n assertThat( hasSubComponents( TRK1_WITH_SUB_COMP ), is( true ) );\n }", "@Test\r\n public void testCommissionCases() throws Exception\r\n {\r\n String epcToCheck = \"urn:epc:id:sgtin:0614141.107340.1\";\r\n XmlObjectEventType event = dbHelper.getObjectEventByEpc(epcToCheck);\r\n Assert.assertNull(event);\r\n\r\n runCaptureTest(COMMISSION_CASES_XML);\r\n\r\n event = dbHelper.getObjectEventByEpc(epcToCheck);\r\n Assert.assertNotNull(event);\r\n }", "@Test\n public void testContainsAll_Contains() {\n\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>();\n instance.add(3);\n instance.add(2);\n instance.add(1);\n instance.add(4);\n\n Collection c = Arrays.asList(1, 2, 3);\n\n boolean expResult = true;\n boolean result = instance.containsAll(c);\n assertEquals(expResult, result);\n }", "@Test\n public void testContains_Contain_Overflow_Boundary() {\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>(2, 2);\n instance.add(1);\n instance.add(2);\n instance.add(3);\n instance.add(4);\n instance.add(5);\n instance.add(6);\n\n boolean expResult = true;\n boolean result = instance.contains(6);\n assertEquals(expResult, result);\n }", "@Test\n public void testASSY2HasSubComponents() {\n assertThat( hasSubComponents( ASSY2_WITH_SUB_COMP ), is( true ) );\n }", "public boolean contains(E element);", "public void verify_AddSubCategoriesPage_DisplayedElements() {\n\n\t\tboolean bstatus;\n\n\t\tbstatus = isElementDisplayed(select_mainCategory, true);\n\t\tReporter.log(bstatus, \"Main Category drop displayed \", \"Main Category drop down not displayed\");\n\n\t\tbstatus = isElementDisplayed(edit_SubCategory, true);\n\t\tReporter.log(bstatus, \"Sub Category text field displayed\", \"Sub Category text field not displayed\");\n\n\t\tbstatus = isElementDisplayed(select_AssignedOrder, true);\n\t\tReporter.log(bstatus, \"Assigned order drop down displayed\", \"Assigned order drop down not displayed\");\n\n\t\tbstatus = isElementDisplayed(btn_Submit, true);\n\t\tReporter.log(bstatus, \"Submit button displayed\", \"Submit button not displayed\");\n\n\t}", "public boolean test(E element);", "public void assertElementPresent(final String elementLocator);", "@Test\n public void handleCompositeCommand1() {\n }", "public void testIsMergeableElement() throws Exception {\n assertFalse(cfg.isMergeableElement(\"font\"));\n cfg.addMergeableElement(\"font\");\n assertTrue(cfg.isMergeableElement(\"font\"));\n\n cfg.addMergeableElement(\"mergeable\");\n assertTrue(cfg.isMergeableElement(\"font\"));\n assertTrue(cfg.isMergeableElement(\"mergeable\"));\n }", "@Ignore\r\n @Test\r\n public void testContainsCollection() {\r\n System.out.println(\"containsCollection\");\r\n NumberCollection nc = null;\r\n NumberCollection instance = new NumberCollection();\r\n boolean expResult = false;\r\n boolean result = instance.containsCollection(nc);\r\n assertEquals(expResult, result);\r\n \r\n }", "public void testAddIndivisibleElementsThatPermitStyles() throws Exception {\n String[] elements = { \"a\", \"b\", \"c\" };\n cfg.addIndivisibleElementsThatPermitStyles(elements);\n\n String[] moreElements = { \"c\", \"d\" };\n cfg.addIndivisibleElementsThatPermitStyles(moreElements);\n\n Set set = (Set)PrivateAccessor.getField(\n cfg, \"indivisibleElementsThatPermitStyles\");\n assertEquals(\"Should have added and merged all elements:\",\n 6, set.size());\n\n for (int i = 0; i < elements.length; i++) {\n assertTrue(\"Should be in list: \", set.contains(elements[i]));\n }\n for (int i = 0; i < moreElements.length; i++) {\n assertTrue(\"Should be in list: \", set.contains(moreElements[i]));\n }\n }", "private List<String> validateComposingElements(\n\t\t\tChemicalAssociationBean assocBean, List<String> msgs) {\n\t\t String compTypeA = assocBean.getAssociatedElementA().getCompositionType();\n\t\t String compTypeB = assocBean.getAssociatedElementB().getCompositionType();\n\t\t\t\n\t\t if((compTypeA!=null)&&(compTypeA.equalsIgnoreCase(\"nanomaterial entity\"))&&(assocBean.getAssociatedElementA().getEntityDisplayName()!=null)){\n\t\t\t\tif(assocBean.getAssociatedElementA().getComposingElement().getId()==null)\n\t\t\t\t\t\tmsgs.add(\"Choosing an element on the left is required.\");\n\t\t\t}\n\t\t\tif((compTypeB!=null)&&(compTypeB.equalsIgnoreCase(\"nanomaterial entity\"))&&(assocBean.getAssociatedElementB().getEntityDisplayName()!=null)){\n\t\t\t\tif(assocBean.getAssociatedElementB().getComposingElement().getId()==null)\n\t\t\t\t\t\tmsgs.add(\"Choosing an element on the right is required.\");\n\t\t\t}\n\t\t\treturn msgs;\n\t}", "@Test\n public void testContains_Contain_Overflow() {\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>(3, 2);\n instance.add(1);\n instance.add(2);\n instance.add(3);\n instance.add(4);\n instance.add(5);\n instance.add(6);\n\n boolean expResult = true;\n boolean result = instance.contains(4);\n assertEquals(expResult, result);\n }", "private static void testContains(BagInterface<String> aBag, String[] tests)\n {\n System.out.println(\"\\nTesting the method contains:\");\n for (int index = 0; index < tests.length; index++)\n System.out.println(\"Does this bag contain \" + tests[index] +\n \"? \" + aBag.contains(tests[index]));\n }", "public void testIsIndivisibleElement() throws Exception {\n assertTrue(cfg.isIndivisibleElement(\"test\"));\n assertTrue(cfg.isIndivisibleElement(\"d1\"));\n assertTrue(cfg.isIndivisibleElement(\"ind1\"));\n assertTrue(cfg.isIndivisibleElement(\"ind2\"));\n\n cfg.associateStylisticAndAntiElements(\"anti-test\", \"test\",\n permittedChildren);\n cfg.addDivisibleElementsThatPermitStyles(new String[] {\"d1\"});\n cfg.addIndivisibleElementsThatPermitStyles(new String[] {\"ind1\", \"ind2\"});\n\n assertTrue(cfg.isIndivisibleElement(\"ind1\"));\n assertTrue(cfg.isIndivisibleElement(\"ind2\"));\n assertTrue(cfg.isIndivisibleElement(\"not-in-any-set\"));\n assertTrue(cfg.isIndivisibleElement(\"child\"));\n assertTrue(cfg.isIndivisibleElement(\"TEST\"));\n assertTrue(cfg.isIndivisibleElement(\"D1\"));\n\n assertFalse(cfg.isIndivisibleElement(\"test\"));\n assertFalse(cfg.isIndivisibleElement(\"d1\"));\n assertFalse(cfg.isIndivisibleElement(\"anti-test\"));\n }", "@Test\n\tpublic void testElementAddedEvent() {\n\t\tfinal DiagramElement newElement = new DiagramElement(diagram, 1, dummyBoh,\n\t\t\t\tnew RelativeBusinessObjectReference(\"1\"));\n\t\tdiagram.modify(\"Add Element\", m -> m.addElement(newElement));\n\n\t\tassertThat(ml.elementAddedEventsReceived, is(equalTo(1)));\n\t\tassertThat(ml.modificationsCompletedEventsReceived, is(equalTo(1)));\n\t\tassertThat(ml.getTotalEventsReceived(), is(equalTo(2)));\n\t}", "public static void VerifyCommonComponent_Div_P(String renderingControl){\n\t\ttry{\n\t\t\tactualDescriptionButton=sitecoreObj.aboutusCommonComponent_Div_P.isDisplayed();\n\t\t\tAssert.assertEquals(actualDescriptionButton, true);\n\t\t\tlog.info(\"The Actual AboutUs \" + renderingControl + \" Description - <\"+sitecoreObj.aboutusCommonComponent_Div_P.getTagName()+\">\");\n\t\t\tlog.info(\"The Expected AboutUs \" + renderingControl + \" Description - <p>\");\n\t\t\tlog.info(\"TEST PASSED: The Actual and Expected AboutUs \" + renderingControl + \" Description are Same\");\n\t\t}catch(AssertionError e){\n\t\t\tlog.error(\"The Actual AboutUs \" + renderingControl + \" Description - \"+sitecoreObj.aboutusCommonComponent_Div_P.getTagName());\n\t\t\tlog.error(\"The Expected AboutUs \" + renderingControl + \" Description - <p>\");\n\t\t\tlog.error(\"TEST FAILED: The Actual and Expected AboutUs \" + renderingControl + \" Description are NOT same\");\n\t\t}catch(org.openqa.selenium.NoSuchElementException e){\n\t\t\tlog.error(\"TEST FAILED: There is No Description On \" + renderingControl + \" element\");\n\t\t}\n\t}", "boolean isComposite();", "boolean isComposite();", "@Test\n\tpublic void moreComplexAssertion() {\n\t\tOrder order1 = null, order2 = null, order3 = null, order4 = null;\n\t\t// when\n\t\tList<Order> orders = null;// orderSearchService.getOrders(trader,\n\t\t\t\t\t\t\t\t\t// tradingAcct, goldIsinCode);\n\t\t// then\n\t\t// Using Basic JUnit\n\t\tassertEquals(orders.size(), 2);\n\t\tIterator<Order> itr = orders.iterator();\n\t\tassertEquals(itr.next(), order3);\n\t\tassertEquals(itr.next(), order4);\n\t\t// Using Hamcrest\n\t\tassertThat(orders, hasItems(order3, order4));\n\t\tassertThat(orders.size(), is(2));\n\t\t// Using FEST Assertions\n\t\tassertThat(orders).containsOnly(order3, order4);\n\t\t// Using FEST Assertions (chained assertions)\n\t\tassertThat(orders).containsOnly(order3, order4).containsSequence(order3, order4);\n\t}", "@Test\n public void testAddPiece() {\n System.out.println(\"addPiece\");\n\n Piece piece = new Piece(PlayerColor.WHITE, 3);\n Player instance = new Player(PlayerColor.WHITE, \"\");\n\n instance.addPiece(piece);\n\n assertTrue(instance.getBagContent().contains(piece));\n }", "public boolean contains(E e) {\n\t /*\n\t * Add code here\n\t */\n\t\t for(int c=0;c<num_elements;c++){\n\t\t\t if(elements[c]==e){\n\t\t\t\t return true;\n\t\t\t }\n\t\t }\n\t return false;\n\t }", "@Test\r\n public void testCommissionPallets() throws Exception\r\n {\r\n String epcToCheck = \"urn:epc:id:sscc:0614141.0000000001\";\r\n XmlObjectEventType event = dbHelper.getObjectEventByEpc(epcToCheck);\r\n Assert.assertNull(event);\r\n\r\n runCaptureTest(COMMISSION_PALLETS_XML);\r\n\r\n event = dbHelper.getObjectEventByEpc(epcToCheck);\r\n Assert.assertNotNull(event);\r\n }", "@Test\r\n public void testINFR1184() throws Exception {\r\n // create OU A\r\n Document ouAdoc = getDocument(createSuccessfully(\"escidoc_ou_create.xml\"));\r\n String ouAid = getObjidValue(ouAdoc);\r\n\r\n // create OU B\r\n Document ouBdoc = getDocument(createSuccessfully(\"escidoc_ou_create.xml\"));\r\n String ouBid = getObjidValue(ouBdoc);\r\n\r\n // create OU C\r\n Document ouCdoc = getDocument(createSuccessfully(\"escidoc_ou_create.xml\"));\r\n String ouCid = getObjidValue(ouCdoc);\r\n\r\n // A parentOf B\r\n String srelPrefix = determineSrelNamespacePrefix(ouBdoc);\r\n String xlinkPrefix = determineXlinkNamespacePrefix(ouBdoc);\r\n Node parents = selectSingleNode(ouBdoc, XPATH_ORGANIZATIONAL_UNIT_PARENTS);\r\n Element parent =\r\n ouBdoc.createElementNS(\"http://escidoc.de/core/01/structural-relations/\", srelPrefix + \":parent\");\r\n parent.setAttribute(xlinkPrefix + \":href\", \"/oum/organizational-unit/\" + ouAid);\r\n parents.appendChild(parent);\r\n ouBdoc = getDocument(update(ouBid, toString(ouBdoc, true)));\r\n\r\n // B parentOf C\r\n srelPrefix = determineSrelNamespacePrefix(ouCdoc);\r\n xlinkPrefix = determineXlinkNamespacePrefix(ouCdoc);\r\n parents = selectSingleNode(ouCdoc, XPATH_ORGANIZATIONAL_UNIT_PARENTS);\r\n parent = ouCdoc.createElementNS(\"http://escidoc.de/core/01/structural-relations/\", srelPrefix + \":parent\");\r\n parent.setAttribute(xlinkPrefix + \":href\", \"/oum/organizational-unit/\" + ouBid);\r\n parents.appendChild(parent);\r\n ouCdoc = getDocument(update(ouCid, toString(ouCdoc, true)));\r\n\r\n // A parentOf C\r\n srelPrefix = determineSrelNamespacePrefix(ouCdoc);\r\n xlinkPrefix = determineXlinkNamespacePrefix(ouCdoc);\r\n parents = selectSingleNode(ouCdoc, XPATH_ORGANIZATIONAL_UNIT_PARENTS);\r\n parent = (Element) selectSingleNode(parents, XPATH_ORGANIZATIONAL_UNIT_PARENT);\r\n parent.setAttribute(xlinkPrefix + \":href\", \"/oum/organizational-unit/\" + ouAid);\r\n ouCdoc = getDocument(update(ouCid, toString(ouCdoc, true)));\r\n }", "@Test\n public void processCompoundTransaction_TestC() throws Exception {\n ct = new CompoundTransaction(\"compound\");\n\n Assert.assertEquals(false, trans_mang.processCompoundTransaction(ct));\n }", "public void Assert()\n\t{\n\t\tString c=driver.findElement(By.xpath(\"//a[text()='CTS']\")).getText();\n\t\t Assert.assertEquals(\"CTS\", c);\n\t}", "@Then(\"^assert that the text \\\"([^\\\"]*)\\\" element has \\\"([^\\\"]*)\\\"$\")\n\tpublic void assert_that_the_text_element_has(String arg1, String arg2) throws Throwable {\n\t\tString[] parts = arg1.split(\"=\");\n\t\tString selector=parts[1];\n\t\tString result = driver.findElement(By.cssSelector(selector)).getText();\n\t\tAssert.assertTrue(\"Text is not included\", result.contains(arg2));\n\t\tSystem.out.println(\"Assert \"+ result +\" contain the text : \"+arg2 );\n\t}", "@Test\n public void testContains() {\n p.addPackage(p1);\n assertFalse(p.contains(p2));\n assertTrue(p.contains(p1));\n\n p.addPackage(p2);\n assertTrue(p.contains(p1));\n assertTrue(p.contains(p2));\n }", "@Test\n\tpublic void addElement() {\n\t\tXMLTagParser.addNewElement(\"Person\");\n\t\tassertEquals(XMLTagParser.containsElement(\"Person\"), true);\n\t}", "@Rollback\n @Test\n public void getAllCreditOperationsByCreditFamilyId() {\n expectedCollection.add(creditOperationFamilyExpected);\n\n //AssertUtils.assertCreditOperationsCollections(expectedCollection, actualCollection);\n }", "@org.junit.Test\n public void k2ComputeConElem13() {\n final XQuery query = new XQuery(\n \"element e {element b{()}}\",\n ctx);\n try {\n result = new QT3Result(query.value());\n } catch(final Throwable trw) {\n result = new QT3Result(trw);\n } finally {\n query.close();\n }\n test(\n assertSerialization(\"<e><b/></e>\", false)\n );\n }", "@Test\n public void testContains_Not_Contain() {\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>();\n instance.add(1);\n instance.add(2);\n\n boolean expResult = false;\n boolean result = instance.contains(3);\n assertEquals(expResult, result);\n }", "public static boolean occlusionTest(IMultipart part, AxisAlignedBB... boxes) {\n\n return occlusionTest(part, new NormallyOccludingPart(Arrays.asList(boxes)));\n }", "public void assertSavedListingAndSavedSearchesSection() {\r\n\t\tprint(\"Assert Saved Listing Section\");\r\n\t\tlocator = Locator.MyTrader.Saved_Listings_Section.value;\r\n\t\tAssert.assertTrue(isElementPresent(locator));\r\n\t\tprint(\"Assert Saved Searches Section\");\r\n\t\tString SavedSearches_locator = Locator.MyTrader.Saved_Searches_Section.value;\r\n\t\tAssert.assertTrue(isElementPresent(SavedSearches_locator));\r\n\t}", "boolean containsInstance(EObject modelElement);", "public boolean contains(ElementType element){\n for(ElementType e:this){\n if(e.equals(element)){\n return true;\n }\n }\n return false;\n }", "@Test\n public void testCardSelectionIsValid_TRUE() throws Exception {\n System.out.println(\"cardSelectionIsValid not valid\");\n UnoCard cardSelection = new UnoCard(UnoCardColour.BLUE, UnoCardValue.TWO);\n UnoCard drawCard = new UnoCard(UnoCardColour.BLUE, UnoCardValue.ONE);\n UnoCardColour wildColour = UnoCardColour.BLUE;\n utils.cardSelectionIsValid(cardSelection, drawCard, wildColour);\n }", "boolean hasElement();", "@org.junit.Test\n public void k2ComputeConElem2() {\n final XQuery query = new XQuery(\n \"<elem>{\\\"\\\", \\\"\\\", <e/>, <b></b>}</elem>\",\n ctx);\n try {\n result = new QT3Result(query.value());\n } catch(final Throwable trw) {\n result = new QT3Result(trw);\n } finally {\n query.close();\n }\n test(\n assertSerialization(\"<elem> <e/><b/></elem>\", false)\n );\n }", "@Test\n\tpublic void shouldEstablishTexbookToCourseRelationships(){\n\t\tCourse course = new Course(\"OO Languages\", \"description\"); // created course first\n\t\tcourseRepo.save(course); //saving course into course repo\n\t\tlong courseId = course.getId();\n\t\t\n\t\t\n\t\t//building owners\n\t\tTextbook book = new Textbook (\"title\", course);\n\t\ttextbookRepo.save(book);\n\t\t\n\t\t\n\t\tTextbook book2 = new Textbook(\"title two\", course);\n\t\ttextbookRepo.save(book2);\n\t\t\n\t\t\n\t\tentityManager.flush(); \n\t\tentityManager.clear();\n\t\t\n\t\t\n\t\tOptional<Course> result = courseRepo.findById(courseId);\n\t\tcourse = result.get();\n\t\t\n\t\tassertThat(course.getTextBooks(), containsInAnyOrder(book, book2));\t\n\t\t\t\t\n\t}", "@Test\n public void testContainsAll_Not_Contain() {\n\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>();\n instance.add(3);\n instance.add(2);\n instance.add(1);\n instance.add(4);\n\n Collection c = Arrays.asList(1, 2, 5);\n\n boolean expResult = false;\n boolean result = instance.containsAll(c);\n assertEquals(expResult, result);\n }", "public void doesNotContain(@Nullable Object element) {\n if (Iterables.contains(getSubject(), element)) {\n failWithRawMessage(\"%s should not have contained <%s>\", getDisplaySubject(), element);\n }\n }", "@Test\r\n public void testContains() {\r\n System.out.println(\"contains\");\r\n Solmu solmu = null;\r\n Pala instance = null;\r\n boolean expResult = false;\r\n boolean result = instance.contains(solmu);\r\n assertEquals(expResult, result);\r\n // TODO review the generated test code and remove the default call to fail.\r\n fail(\"The test case is a prototype.\");\r\n }", "@Test\n\tpublic void testIncluye() {\n\t\tassertFalse(l.incluye(0));\n\t\t\n\t\t//Test de busqueda sobre el primer elemento\n\t\tl.agregar(0, 0);\n\t\tassertTrue(l.incluye(0));\n\t\tassertFalse(l.incluye(1));\n\t\t\n\t\t//Test con mas elementos\n\t\tl.agregar(1, 1);\n\t\tl.agregar(2, 2);\n\t\tassertTrue(l.incluye(1));\n\t\tassertFalse(l.incluye(4));\n\t\t\n\t}", "@Override\n public final boolean contains(final Object o) {\n return Collections.exists(getComponents(),\n new Assertion<PriorityList<? extends _PriorityElement_>>() {\n public boolean isTrueFor(PriorityList<? extends _PriorityElement_> s) {\n return s.contains(o);\n }\n });\n }", "@Test\n public void checkEcritureComptableUnit() throws Exception {\n initClassUnderTestDaoMock();\n SequenceEcritureComptable testSEC = new SequenceEcritureComptable();\n testSEC.setDerniereValeur(1);\n when(daoProxy.getComptabiliteDao().getSequenceEcritureComptable(any(), any()))\n .thenReturn(testSEC);\n\n vEcritureComptable.setJournal(new JournalComptable(\"AC\", \"Achat\"));\n vEcritureComptable.setDate(new Date());\n vEcritureComptable.setLibelle(\"Libelle\");\n vEcritureComptable.setReference(\"AC-2020/00001\");\n vEcritureComptable.getListLigneEcriture().add(new LigneEcritureComptable(new CompteComptable(1),\n null, new BigDecimal(123),\n null));\n vEcritureComptable.getListLigneEcriture().add(new LigneEcritureComptable(new CompteComptable(2),\n null, null,\n new BigDecimal(123)));\n\n classUnderTest.checkEcritureComptableUnit(vEcritureComptable);\n }", "public abstract boolean contains(E e);", "@Test\n public void testAddCard() {\n d_gameData.getD_playerList().get(1).addCard(GameCard.BLOCKADE);\n assertEquals(true, d_gameData.getD_playerList().get(1).getD_cards().contains(GameCard.BLOCKADE));\n }", "public boolean hasCompositeStructure() {\n return (getStructureType() == EquipmentType.T_STRUCTURE_COMPOSITE);\n }", "@Test\n public void test113() throws Throwable {\n ErrorPage errorPage0 = new ErrorPage();\n Checkbox checkbox0 = new Checkbox(errorPage0, \"Col component can e added onlG to a TableBlock.\", \"Col component can e added onlG to a TableBlock.\");\n // Undeclared exception!\n try {\n Component component0 = checkbox0.acronym((Object) \"Col component can e added onlG to a TableBlock.\");\n fail(\"Expecting exception: RuntimeException\");\n \n } catch(RuntimeException e) {\n //\n // Can't add components to a component that is not an instance of IContainer.\n //\n }\n }", "public void testAddDivisibleElementsThatPermitStyles() throws Exception {\n String[] elements = { \"a\", \"b\", \"c\" };\n cfg.addDivisibleElementsThatPermitStyles(elements);\n\n String[] moreElements = { \"c\", \"d\" };\n cfg.addDivisibleElementsThatPermitStyles(moreElements);\n\n Set set = (Set)PrivateAccessor.getField(\n cfg, \"divisibleElementsThatPermitStyles\");\n assertEquals(\"Should have added and merged all elements:\",\n 4, set.size());\n\n for (int i = 0; i < elements.length; i++) {\n assertTrue(\"Should be in list: \", set.contains(elements[i]));\n }\n for (int i = 0; i < moreElements.length; i++) {\n assertTrue(\"Should be in list: \", set.contains(moreElements[i]));\n }\n }", "public void assertOnTableElements()\n {\n\t open();\n\t inTable(table).shouldHaveRowElementsWhere(the(\"First name\" , equalTo(\"Frank\")));\n }", "public MockAggregateEvent(List<QuoteEvent> inCompositeEvents)\n {\n this(new Date(),\n new Equity(\"METC\"));\n compositeEvents.addAll(inCompositeEvents);\n }", "public static void VerifyCommonComponent_Div_H2(String renderingControl){\n\t\ttry{\n\t\t\tactualTitleButton=sitecoreObj.aboutusCommonComponent_Div_H2.isDisplayed();\n\t\t\tAssert.assertEquals(actualTitleButton, true);\n\t\t\tlog.info(\"The Actual AboutUs \" + renderingControl + \" Title - <\"+sitecoreObj.aboutusCommonComponent_Div_H2.getTagName()+\">\");\n\t\t\tlog.info(\"The Expected AboutUs \" + renderingControl + \" Title - <h2>\");\n\t\t\tlog.info(\"TEST PASSED: The Actual and Expected AboutUs \" + renderingControl + \" Title are Same\");\n\t\t}catch(AssertionError e){\n\t\t\tlog.error(\"The Actual AboutUs \" + renderingControl + \" Title - \"+sitecoreObj.aboutusCommonComponent_Div_H2.getTagName());\n\t\t\tlog.error(\"The Expected AboutUs \" + renderingControl + \" Title - <h2>\");\n\t\t\tlog.error(\"TEST FAILED: The Actual and Expected AboutUs \" + renderingControl + \" Title are NOT same\");\n\t\t}catch(org.openqa.selenium.NoSuchElementException e){\n\t\t\tlog.error(\"TEST FAILED: There is No Title On \" + renderingControl + \" element\");\n\t\t}\t\t\n\t}", "@Step(\"There are the following elements on Different Elements page: 4 checkboxes, 4 radios, 1 dropdown, 2 buttons\")\n public void checkElements() {\n checkboxes.shouldHaveSize(4);\n radios.shouldHaveSize(4);\n dropdown.shouldBe(Condition.exist);\n buttons.shouldHaveSize(2);\n }", "@Override\r\n\tpublic boolean contains(T element) {\n\t\treturn false;\r\n\t}", "@Test\n public void ensureCompositeStateImmutabilityTest() throws InterruptedException, PluginException {\n final WritableGraph wg = graph.getWritableGraph(\"test\", true);\n wg.getSchema().newGraph(wg);\n int v0, v1, v2;\n final String v0name, v1name, v2name;\n final int nameAttr;\n final int selectedAttr;\n final Plugin copyPlugin;\n try {\n // Add three vertices\n v0 = wg.addVertex();\n wg.getSchema().newVertex(wg, v0);\n v1 = wg.addVertex();\n wg.getSchema().newVertex(wg, v1);\n v2 = wg.addVertex();\n wg.getSchema().newVertex(wg, v2);\n\n // Store the names of these vertices\n nameAttr = VisualConcept.VertexAttribute.LABEL.get(wg);\n v0name = wg.getStringValue(nameAttr, v0);\n v1name = wg.getStringValue(nameAttr, v1);\n v2name = wg.getStringValue(nameAttr, v2);\n\n // Add a transaction from v0 to v1\n final int t0_1 = wg.addTransaction(v0, v1, true);\n wg.getSchema().newTransaction(wg, t0_1);\n\n // Select v0 and v2, but not v1\n selectedAttr = VisualConcept.VertexAttribute.SELECTED.get(wg);\n wg.setBooleanValue(selectedAttr, v0, true);\n wg.setBooleanValue(selectedAttr, v2, true);\n wg.setBooleanValue(selectedAttr, v1, false);\n } finally {\n wg.commit();\n }\n\n // Make a composite from the selection, then select everything, and copy to a new graph\n copyPlugin = PluginRegistry.get(InteractiveGraphPluginRegistry.COPY_TO_NEW_GRAPH);\n PluginExecutor.startWith(InteractiveGraphPluginRegistry.CREATE_COMPOSITE_FROM_SELECTION)\n .followedBy(VisualGraphPluginRegistry.SELECT_ALL)\n .followedBy(copyPlugin)\n .executeNow(graph);\n\n final WritableGraph copyWg = ((CopyToNewGraphPlugin) copyPlugin).getCopy().getWritableGraph(\"test\", true);\n try {\n // Expand all composites\n PluginExecution.withPlugin(InteractiveGraphPluginRegistry.EXPAND_ALL_COMPOSITES).executeNow(copyWg);\n } finally {\n copyWg.commit();\n }\n\n // Now we check there has been no effect on the composite state on the original graph\n // by expanding it and then checking it is the same as the orignal graph\n final WritableGraph wg2 = graph.getWritableGraph(\"test\", true);\n try {\n // Expand all composites\n PluginExecution.withPlugin(InteractiveGraphPluginRegistry.EXPAND_ALL_COMPOSITES).executeNow(wg2);\n } finally {\n wg2.commit();\n }\n\n final ReadableGraph rg = graph.getReadableGraph();\n try {\n\n // Assert that there are three vertices all with their original names\n assertEquals(rg.getVertexCount(), 3);\n for (int i = 0; i < 3; i++) {\n final int id = rg.getVertex(i);\n final String name = rg.getStringValue(nameAttr, id);\n if (name.equals(v0name)) {\n v0 = id;\n } else if (name.equals(v1name)) {\n v1 = id;\n } else {\n v2 = id;\n }\n }\n assertEquals(rg.getStringValue(nameAttr, v0), v0name);\n assertEquals(rg.getStringValue(nameAttr, v1), v1name);\n assertEquals(rg.getStringValue(nameAttr, v2), v2name);\n\n // Assert that the two transactions exist as expected and no others\n assertEquals(rg.getTransactionCount(), 1);\n final int l0_1 = rg.getLink(v0, v1);\n assertEquals(rg.getLinkTransactionCount(l0_1), 1);\n final int t0_1 = rg.getLinkTransaction(l0_1, 0);\n assertFalse(rg.getTransactionDirection(t0_1) == Graph.FLAT);\n assertEquals(rg.getTransactionSourceVertex(t0_1), v0);\n final int l1_2 = rg.getLink(v1, v2);\n assertEquals(l1_2, Graph.NOT_FOUND);\n final int l0_2 = rg.getLink(v0, v2);\n assertEquals(l0_2, Graph.NOT_FOUND);\n } finally {\n rg.release();\n }\n }", "public boolean contains(Object elem);", "boolean isElement(Object object);", "@Test(priority = 5, dependsOnMethods = { \"verifySubscriptionPageComponents\" }, groups = { \"Smoke\" })\n\tpublic static void verifyGridComponents() throws InterruptedException {\n\n\t\ttest = report.startTest(\"Verify Components of Grid\");\n\n//\t\t//Verify Columns of Grid\n//\t\tString columnsGrid = driver.findElement(By.xpath(xpathColumnOfgrid)).getText();\n//\t\tAssert.assertEquals(columnsGrid,\"S. noSubscription NameSubscription IdDescriptionCreated OnAction\");\n//\t\ttest.log(LogStatus.PASS, \"Column Of Grid\", \"All Column are Displaying\");\n\n\t\t// verify any row in grid is displaying or not\n\n\t\tboolean rowInGrid = driver.findElement(By.xpath(xpathRowInGrid)).getText().isEmpty();\n\t\tAssert.assertFalse(rowInGrid);\n\t\ttest.log(LogStatus.PASS, \"Row In Grid\", \"Row In Grid is displaying\");\n\n\t\t// verify Delete and Edit Buttons\n\t\tWebElement deleteButton = driver.findElement(By.className(classDeleteButton));\n\t\tAssert.assertTrue(deleteButton.isEnabled());\n\t\ttest.log(LogStatus.PASS, \"Delete Button\", \"Delete Button is displaying and Enabled\");\n\t\tWebElement editButton = driver.findElement(By.className(\"editlink\"));\n\t\tAssert.assertTrue(editButton.isEnabled());\n\t\ttest.log(LogStatus.PASS, \"Edit Button\", \"Edit Button is displaying and Enabled\");\n\t}", "public void checkComponent( Object suspect )\n throws ValidationException\n {\n\n // If the collection of elements is null or empty, just return\n if (null == m_existingElems || m_existingElems.size() < 1)\n {\n return;\n }\n\n String text = null;\n if (suspect instanceof JTextComponent)\n {\n JTextComponent tf = (JTextComponent)suspect;\n if ( null != tf.getDocument())\n text = tf.getText();\n else\n text = \"\";\n }\n else if (suspect instanceof JComboBox)\n text = new String(((JComboBox)suspect).getSelectedItem().toString());\n else // this should never happen... \n throw new IllegalArgumentException(\n \"Component null or not text field or combo box\" );\n\n // begin validation\n Iterator iter = m_existingElems.iterator();\n while ( iter.hasNext())\n {\n boolean found = false;\n String existing = iter.next().toString();\n if ( m_caseSensitive )\n found = existing.equals( text );\n else\n found = existing.equalsIgnoreCase( text );\n if ( found )\n throw new ValidationException();\n }\n }", "@Entao(\"o sistema deve exibir o form de busca por Componentes\")\n public void o_sistema_deve_exibir_o_form_de_busca_por_componentes() {\n String expected;\n expected = \"Consulta de Componentes Curriculares\";\n String actual = driver.findElement(By.cssSelector(\"#corpo > h2\")).getText();\n Assert.assertEquals(expected, actual);\n }", "public void testAddInvoice() throws Exception {\n try {\n invoiceSessionBean.addInvoice(null, true);\n fail(\"Should throw IllegalArgumentException\");\n } catch (IllegalArgumentException e) {\n // expected\n }\n }", "@Test\r\n\tpublic void testCueEpisodicMemories() {\r\n\t\tMockCueListener cueListener = new MockCueListener();\r\n\t\tworkspace.addCueListener(cueListener);\r\n\t\tcontent.addDefaultNode(node1);\r\n\t\tcontent.addDefaultNode(node2);\r\n\r\n\t\tworkspace.cueEpisodicMemories(content);\r\n\r\n\t\tNodeStructure ns = cueListener.ns;\r\n\t\tassertNotNull(ns);\r\n\t\tassertTrue(ns.containsNode(node1));\r\n\t\tassertTrue(ns.containsNode(node2));\r\n\t}", "@Test(expected = Exception.class)\n public void testCardSelectionIsValid_FALSE() throws Exception {\n System.out.println(\"cardSelectionIsValid not valid\");\n UnoCard cardSelection = new UnoCard(UnoCardColour.RED, UnoCardValue.TWO);\n UnoCard drawCard = new UnoCard(UnoCardColour.BLUE, UnoCardValue.ONE);\n UnoCardColour wildColour = UnoCardColour.BLUE;\n utils.cardSelectionIsValid(cardSelection, drawCard, wildColour);\n \n }", "public void addToLinesOfBusiness(entity.AppCritLineOfBusiness element);", "@Test\n\tpublic void shouldHaveContainerInTableInKafkaFromContainerCreatedEvent() throws InterruptedException, ExecutionException, TimeoutException {\n\t\tSystem.out.println(\" ----- Kafka needs to run \\n\\tshouldHaveContainerInTableInKafkaFromContainerCreatedEvent\");\n\n\t\tContainerCreation ce = externalContainerProducer.buildContainerEvent();\n\t\n\t\t// verify the container does not exist in the inventory\n\t\tContainer cOut = dao.getById(ce.getContainerID());\n\t\tAssert.assertNull(cOut);\n\t\t\n\t\t// emit container added event \n\t\texternalContainerProducer.emit(ce);\n\t\tThread.sleep(5000);\n\t\t// verify it is in the container store\n\t\tcOut = dao.getById(ce.getContainerID());\n\t\tAssert.assertNotNull(cOut);\n\t\tAssert.assertEquals(cOut.getStatus(),((Container)ce.getPayload()).getStatus());\n\n\t}", "@Test\n @DisplayName(\"Test should detect equality between equal states.\")\n public void testShouldResultInEquality() {\n ObjectBag os1 = new ObjectBag(null, \"Hi\");\n ObjectBag os2 = new ObjectBag(null, \"Hi\");\n\n Assertions.assertThat(os1).isEqualTo(os2);\n }", "static <T extends DbDataItem> void assertSetContainsGivenElements(EqualityAsserter<T> comparator, Set<T> set, T... elements) {\n Set<T> set2 = new HashSet<T>(Arrays.asList(elements));\n \n assertSetsEqual(comparator, set2, set);\n }", "public static void verify_element_is_displayed(By locator) throws CheetahException {\n\t\ttry {\n\t\t\twait_for_element(locator);\n\t\t\tWebElement element = CheetahEngine.getDriverInstance().findElement(locator);\n\t\t\tdriverUtils.highlightElement(element);\n\t\t\tdriverUtils.unHighlightElement(element);\n\t\t\tassertEquals(true, element.isDisplayed());\n\t\t} catch (Exception e) {\n\t\t\tthrow new CheetahException(e);\n\n\t\t}\n\n\t}", "@Test\n public void testContainsAll_Contains_Overflow() {\n\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>(2, 2);\n instance.add(3);\n instance.add(2);\n instance.add(1);\n instance.add(4);\n instance.add(5);\n instance.add(4);\n instance.add(7);\n\n Collection c = Arrays.asList(3, 4, 5, 7);\n\n boolean expResult = true;\n boolean result = instance.containsAll(c);\n assertEquals(expResult, result);\n }", "@Test \n\t@DisplayName(\"combinacion[i] == null || (combinacionSecreta[i] == null\")\n\tvoid elementoDeCombinacionNoEsCasilla1Test(){ \n\t\tCombinacion combinacionFacil = new Combinacion(dificultadFacil);\n\t\tCombinacion combinacionSecretaFacil = new Combinacion(dificultadFacil);\n\t\tCombinacion combinacionGanaFacil = new Combinacion(dificultadFacil);\n\t\t\n\t\tcombinacionFacil.anadirCasilla(new Casilla(Color.FONDO_ROJOCLARO));\n\t\tcombinacionFacil.anadirCasilla(new Casilla(Color.FONDO_AZUL));\n\t\tcombinacionFacil.anadirCasilla(null);\n\t\tcombinacionFacil.anadirCasilla(new Casilla(Color.FONDO_AMARILLOCLARO));\n\t\t\n\t\tcombinacionSecretaFacil.anadirCasilla(new Casilla(Color.FONDO_ROJOCLARO));\n\t\tcombinacionSecretaFacil.anadirCasilla(new Casilla(Color.FONDO_AMARILLOCLARO));\n\t\tcombinacionSecretaFacil.anadirCasilla(new Casilla(Color.FONDO_MORADOCLARO));\n\t\tcombinacionSecretaFacil.anadirCasilla(new Casilla(Color.FONDO_AZUL));\n\t\n\t\tcombinacionGanaFacil.anadirCasilla(new Casilla(Color.FONDO_ROJOCLARO));\n\t\tcombinacionGanaFacil.anadirCasilla(new Casilla(Color.FONDO_BLANCO));\n\t\tcombinacionGanaFacil.anadirCasilla(new Casilla(Color.FONDO_BLANCO));\n\t\tcombinacionGanaFacil.anadirCasilla(new Casilla(Color.FONDO_NEGRO));\n\t\t\n\t\tAssert.assertEquals(combinacionGanaFacil, combinacionFacil.calcularResultado(combinacionSecretaFacil));\n\t}", "public boolean isComposite();", "@Test\n public void testEquals() {\n Coctail c1 = new Coctail(\"coctail\", new Ingredient[]{ \n new Ingredient(\"ing1\"), new Ingredient(\"ing2\")});\n Coctail c2 = new Coctail(\"coctail\", new Ingredient[]{ \n new Ingredient(\"ing1\"), new Ingredient(\"ing2\")});\n assertEquals(c1, c2);\n }", "@Test(priority = 5)\n\tpublic void validateContents() {\n\t\tlog = Logger.getLogger(HeroImageProducttestscripts.class);\n\t\tLogReport.getlogger();\n\t\tlogger = extent.startTest(\"Validating the content of the product\");\n\t\tHeroImageProductPageFlow.clickHeroImage(locator);\n\t\theroImg.validateDescriptionContent(locator, validate);\n\t\t;\n\t\tlog.info(\"Content validation is correct\");\n\t\tHeroImageProductPageFlow.clickProductSpecification(locator);\n\t\theroImg.validateSpecificationContent(locator, validate);\n\t\tlog.info(\"Content is present\");\n\t\tlog.info(\"Starting Sorting functionality testing\");\n\t}", "public void test_containsII() {\n\tfinal int COUNT = 60000000;\n\t\n\tRectangle r = new Rectangle(1, 2, 3, 4);\n\n\tPerformanceMeter meter = createMeter(\"contains\");\n\tmeter.start();\n\tfor (int i = 0; i < COUNT; i++) {\n\t\tr.contains(2, 3);\t// does contain\n\t}\n\tmeter.stop();\n\t\n\tdisposeMeter(meter);\n\t\n\tmeter = createMeter(\"disjoint\");\n\tmeter.start();\n\tfor (int i = 0; i < COUNT; i++) {\n\t\tr.contains(9, 12);\t// does not contain\n\t}\n\tmeter.stop();\n\t\n\tdisposeMeter(meter);\n}", "@org.junit.Test\n public void k2ComputeConElem3() {\n final XQuery query = new XQuery(\n \"<elem>{<e/>, <b></b>, \\\"\\\", \\\"\\\"}</elem>\",\n ctx);\n try {\n result = new QT3Result(query.value());\n } catch(final Throwable trw) {\n result = new QT3Result(trw);\n } finally {\n query.close();\n }\n test(\n assertSerialization(\"<elem><e/><b/> </elem>\", false)\n );\n }", "boolean contains(Card c);", "public abstract boolean doesElementExist(final String key, final String element);", "@Test\n public void test074() throws Throwable {\n ErrorPage errorPage0 = new ErrorPage();\n Checkbox checkbox0 = new Checkbox(errorPage0, \"Unspported type gien Hor dateFormt. Supported types are: Date, Clenr, Long/long .\", \"Unspported type gien Hor dateFormt. Supported types are: Date, Clenr, Long/long .\");\n ElExpression elExpression0 = checkbox0.el(\"boolean\");\n // Undeclared exception!\n try {\n Component component0 = checkbox0.h3((Object) elExpression0);\n fail(\"Expecting exception: RuntimeException\");\n \n } catch(RuntimeException e) {\n //\n // Can't add components to a component that is not an instance of IContainer.\n //\n }\n }", "@Test\n\tpublic void testComenzar() {\n\t\tl.agregar(0, 0);\n\t\tl.comenzar();\n\t\tassertEquals((int)(new Integer(0)), l.elemento());\n\t\t\n\t\t//Probando con dos elementos\n\t\tl.agregar(1, 1);\n\t\tl.comenzar();\n\t\tassertEquals((int)(new Integer(0)), l.elemento());\n\t\t\n\t\t//Probando de agregar un elemento al principio\n\t\tl.agregar(2, 0);\n\t\tl.comenzar();\n\t\tassertEquals((int)(new Integer(2)), l.elemento());\n\t\t\n\t\t\n\t}", "public void testexisteDescripcion()\n\t{\n\t\tString descripcion = new String(\"admin\");\n\t\tLong id = new Long(\"-1\");\n\t\t\n\t\tBoolean bol = servicio.existeDescripcion(descripcion, id);\n\t\t\tassertEquals(bol.booleanValue(), true);\n\t}" ]
[ "0.7881951", "0.7831773", "0.77020264", "0.7633372", "0.61405665", "0.58442795", "0.5396812", "0.53004736", "0.5292031", "0.5232128", "0.51863164", "0.5182449", "0.5181244", "0.5136315", "0.5134399", "0.5111167", "0.50902927", "0.50458497", "0.5035466", "0.5034168", "0.5031522", "0.50214934", "0.5015546", "0.49855396", "0.49556646", "0.49506393", "0.49377513", "0.49272105", "0.4906445", "0.48904607", "0.4848219", "0.4845994", "0.48305243", "0.48278975", "0.47951883", "0.4781281", "0.4781281", "0.47800487", "0.4779747", "0.47723454", "0.47708416", "0.4759074", "0.47483137", "0.47462168", "0.47370523", "0.47352886", "0.47295636", "0.47126397", "0.4702976", "0.46968243", "0.46957892", "0.46847385", "0.4678304", "0.46745187", "0.46545115", "0.46452042", "0.46438", "0.46423352", "0.46376926", "0.4634733", "0.46346796", "0.46259752", "0.4624899", "0.46116567", "0.46113628", "0.4603356", "0.4600054", "0.45928678", "0.45910764", "0.4590637", "0.45849967", "0.45811728", "0.45803365", "0.4579304", "0.45766643", "0.45710316", "0.45636654", "0.45636192", "0.45521647", "0.45500466", "0.45365044", "0.45360905", "0.45345694", "0.45306024", "0.45287934", "0.45271492", "0.45237562", "0.45234722", "0.45216557", "0.45171586", "0.45163932", "0.4510603", "0.45088065", "0.45034567", "0.44981328", "0.44973218", "0.44960532", "0.4494008", "0.44927192", "0.44905442" ]
0.7918091
0
Asserts that the specified Composite contains the 2 specified element and the specified EOC.
private static void assertComposite(Composite composite, ByteBuffer firstElement, ByteBuffer secondElement, EOC eoc) { assertComposite(composite, eoc, firstElement, secondElement); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void assertComposite(Composite composite,\n ByteBuffer firstElement,\n ByteBuffer secondElement,\n ByteBuffer thirdElement,\n EOC eoc)\n {\n assertComposite(composite, eoc, firstElement, secondElement, thirdElement);\n }", "private static void assertComposite(Composite composite,\n ByteBuffer firstElement,\n ByteBuffer secondElement,\n ByteBuffer thirdElement,\n ByteBuffer fourthElement,\n EOC eoc)\n {\n assertComposite(composite, eoc, firstElement, secondElement, thirdElement, fourthElement);\n }", "private static void assertComposite(Composite composite, EOC eoc, ByteBuffer... elements)\n {\n assertEquals(\"the composite size is not the expected one:\", elements.length, composite.size());\n for (int i = 0, m = elements.length; i < m; i++)\n {\n ByteBuffer element = elements[i];\n assertTrue(String.format(\"the element %s of the composite is not the expected one: expected %s but was %s\",\n i,\n ByteBufferUtil.toInt(element),\n ByteBufferUtil.toInt(composite.get(i))),\n element.equals(composite.get(i)));\n }\n assertEquals(\"the EOC of the composite is not the expected one:\", eoc, composite.eoc());\n }", "private static void assertComposite(Composite composite, ByteBuffer element, EOC eoc)\n {\n assertComposite(composite, eoc, element);\n }", "@Test\r\n public void testComposite() {\r\n \r\n Leaf pers1 = new Leaf(\"Tracy\");\r\n Leaf pers2 = new Leaf(\"JR\");\r\n Leaf pers3 = new Leaf(\"Simon\");\r\n \r\n Composite comp1 = new Composite();\r\n comp1.add(pers1);\r\n comp1.add(pers2);\r\n comp1.add(pers3);\r\n \r\n //Assert.assertEquals(pers1.sayHello(), \"Tracy person says hello\");\r\n Assert.assertNotNull(comp1);\r\n \r\n \r\n }", "@Test\n public void extraElements() {\n assertEmpty(mReactor.getCompounds(getElements(\"Start\", \"A\", \"Fin\", \"Start\")));\n // Each reaction producing a compound should be detected separately.\n assertEmpty(mReactor.getCompounds(getElements(\"Start\", \"A\", \"Fin\", \"Start\", \"A\", \"Fin\")));\n }", "@Test\n public void testASSY2HasSubComponents() {\n assertThat( hasSubComponents( ASSY2_WITH_SUB_COMP ), is( true ) );\n }", "@Test (expected=AjoutException.class)\n\tpublic void test1E() {\n\t\tConvoi c = new Convoi\t\n\t\t\t\t.Builder(\"vehicules\", \"Paris\")\n\t\t\t\t.build();\n\t\tConvoi c2 = new Convoi\t\n\t\t\t\t.Builder(\"camions\", \"Paris\")\n\t\t\t\t.build();\n\t\tc.add(c2);\n\t\tc2.add(c);\n\t}", "private static void assertEmptyComposite(Composite composite)\n {\n assertEquals(Composites.EMPTY, composite);\n }", "private List<String> validateComposingElements(\n\t\t\tChemicalAssociationBean assocBean, List<String> msgs) {\n\t\t String compTypeA = assocBean.getAssociatedElementA().getCompositionType();\n\t\t String compTypeB = assocBean.getAssociatedElementB().getCompositionType();\n\t\t\t\n\t\t if((compTypeA!=null)&&(compTypeA.equalsIgnoreCase(\"nanomaterial entity\"))&&(assocBean.getAssociatedElementA().getEntityDisplayName()!=null)){\n\t\t\t\tif(assocBean.getAssociatedElementA().getComposingElement().getId()==null)\n\t\t\t\t\t\tmsgs.add(\"Choosing an element on the left is required.\");\n\t\t\t}\n\t\t\tif((compTypeB!=null)&&(compTypeB.equalsIgnoreCase(\"nanomaterial entity\"))&&(assocBean.getAssociatedElementB().getEntityDisplayName()!=null)){\n\t\t\t\tif(assocBean.getAssociatedElementB().getComposingElement().getId()==null)\n\t\t\t\t\t\tmsgs.add(\"Choosing an element on the right is required.\");\n\t\t\t}\n\t\t\treturn msgs;\n\t}", "@Test\n public void testTRK1HasSubComponents() {\n assertThat( hasSubComponents( TRK1_WITH_SUB_COMP ), is( true ) );\n }", "@Test\n\tpublic void moreComplexAssertion() {\n\t\tOrder order1 = null, order2 = null, order3 = null, order4 = null;\n\t\t// when\n\t\tList<Order> orders = null;// orderSearchService.getOrders(trader,\n\t\t\t\t\t\t\t\t\t// tradingAcct, goldIsinCode);\n\t\t// then\n\t\t// Using Basic JUnit\n\t\tassertEquals(orders.size(), 2);\n\t\tIterator<Order> itr = orders.iterator();\n\t\tassertEquals(itr.next(), order3);\n\t\tassertEquals(itr.next(), order4);\n\t\t// Using Hamcrest\n\t\tassertThat(orders, hasItems(order3, order4));\n\t\tassertThat(orders.size(), is(2));\n\t\t// Using FEST Assertions\n\t\tassertThat(orders).containsOnly(order3, order4);\n\t\t// Using FEST Assertions (chained assertions)\n\t\tassertThat(orders).containsOnly(order3, order4).containsSequence(order3, order4);\n\t}", "@Test\n public void testACFTHasSubComponents() {\n assertThat( hasSubComponents( ACFT ), is( true ) );\n }", "@Test\n public void handleCompositeCommand1() {\n }", "@Test\n public void testIsComposite() {\n Tag tag = new BaseTag();\n assertFalse(\"BaseTag reported as composite\", tag.isComposite());\n }", "@Test\r\n public void testCommissionCases() throws Exception\r\n {\r\n String epcToCheck = \"urn:epc:id:sgtin:0614141.107340.1\";\r\n XmlObjectEventType event = dbHelper.getObjectEventByEpc(epcToCheck);\r\n Assert.assertNull(event);\r\n\r\n runCaptureTest(COMMISSION_CASES_XML);\r\n\r\n event = dbHelper.getObjectEventByEpc(epcToCheck);\r\n Assert.assertNotNull(event);\r\n }", "public void testAddIndivisibleElementsThatPermitStyles() throws Exception {\n String[] elements = { \"a\", \"b\", \"c\" };\n cfg.addIndivisibleElementsThatPermitStyles(elements);\n\n String[] moreElements = { \"c\", \"d\" };\n cfg.addIndivisibleElementsThatPermitStyles(moreElements);\n\n Set set = (Set)PrivateAccessor.getField(\n cfg, \"indivisibleElementsThatPermitStyles\");\n assertEquals(\"Should have added and merged all elements:\",\n 6, set.size());\n\n for (int i = 0; i < elements.length; i++) {\n assertTrue(\"Should be in list: \", set.contains(elements[i]));\n }\n for (int i = 0; i < moreElements.length; i++) {\n assertTrue(\"Should be in list: \", set.contains(moreElements[i]));\n }\n }", "@Test\n void contains() {\n Cuboid cuboid1 = new Cuboid(4, 4, 4);\n Point3D point1 = new Point3D(0,0,0);\n assertEquals(true, cuboid1.contains(point1));\n\n Point3D point2 = new Point3D(0,0,2);\n assertEquals(true, cuboid1.contains(point2));\n\n Point3D point3 = new Point3D(0,0,-2);\n assertEquals(true, cuboid1.contains(point3));\n\n Point3D point4 = new Point3D(0,2,0);\n assertEquals(true, cuboid1.contains(point4));\n\n Point3D point5 = new Point3D(0,-2,0);\n assertEquals(true, cuboid1.contains(point5));\n\n Point3D point6 = new Point3D(2,0,0);\n assertEquals(true, cuboid1.contains(point6));\n\n Point3D point7 = new Point3D(-2,0,0);\n assertEquals(true, cuboid1.contains(point7));\n\n Point3D point8 = new Point3D(-2,-2,-2);\n assertEquals(true, cuboid1.contains(point8));\n\n Point3D point9 = new Point3D(-2,-2,-3);\n assertEquals(false, cuboid1.contains(point9));\n\n\n //Arbitary orientation\n Cuboid cuboid2 = new Cuboid(4, 5, 7, new Ray(new Point3D(-2,-2,-2), new Vector3D(1,1,1)));\n Point3D point21 = new Point3D(-1,-1,-1);\n assertEquals(true, cuboid2.contains(point21));\n\n Cuboid cuboid3 = new Cuboid(4, 5, 6, new Ray(new Point3D(-2,-2,-2), new Vector3D(1,1,1)));\n Point3D point31 = new Point3D(0,0,0);\n assertEquals(false, cuboid3.contains(point31));\n\n Cuboid cuboid4 = new Cuboid(4, 5, 6, new Ray(new Point3D(0,0,0), new Vector3D(1,1,1)));\n Point3D point41 = new Point3D(2.5,2.5,2.5);\n assertEquals(false, cuboid4.contains(point41));\n\n Cuboid cuboid5 = new Cuboid(4, 5, 6, new Ray(new Point3D(-2,-2,-2), new Vector3D(0,0,1)));\n Point3D point51 = new Point3D(-2,-2,3.5);\n assertEquals(false, cuboid5.contains(point51));\n }", "@org.junit.Test\n public void k2ComputeConElem2() {\n final XQuery query = new XQuery(\n \"<elem>{\\\"\\\", \\\"\\\", <e/>, <b></b>}</elem>\",\n ctx);\n try {\n result = new QT3Result(query.value());\n } catch(final Throwable trw) {\n result = new QT3Result(trw);\n } finally {\n query.close();\n }\n test(\n assertSerialization(\"<elem> <e/><b/></elem>\", false)\n );\n }", "public void verify_AddSubCategoriesPage_DisplayedElements() {\n\n\t\tboolean bstatus;\n\n\t\tbstatus = isElementDisplayed(select_mainCategory, true);\n\t\tReporter.log(bstatus, \"Main Category drop displayed \", \"Main Category drop down not displayed\");\n\n\t\tbstatus = isElementDisplayed(edit_SubCategory, true);\n\t\tReporter.log(bstatus, \"Sub Category text field displayed\", \"Sub Category text field not displayed\");\n\n\t\tbstatus = isElementDisplayed(select_AssignedOrder, true);\n\t\tReporter.log(bstatus, \"Assigned order drop down displayed\", \"Assigned order drop down not displayed\");\n\n\t\tbstatus = isElementDisplayed(btn_Submit, true);\n\t\tReporter.log(bstatus, \"Submit button displayed\", \"Submit button not displayed\");\n\n\t}", "@Test\r\n public void testINFR1184() throws Exception {\r\n // create OU A\r\n Document ouAdoc = getDocument(createSuccessfully(\"escidoc_ou_create.xml\"));\r\n String ouAid = getObjidValue(ouAdoc);\r\n\r\n // create OU B\r\n Document ouBdoc = getDocument(createSuccessfully(\"escidoc_ou_create.xml\"));\r\n String ouBid = getObjidValue(ouBdoc);\r\n\r\n // create OU C\r\n Document ouCdoc = getDocument(createSuccessfully(\"escidoc_ou_create.xml\"));\r\n String ouCid = getObjidValue(ouCdoc);\r\n\r\n // A parentOf B\r\n String srelPrefix = determineSrelNamespacePrefix(ouBdoc);\r\n String xlinkPrefix = determineXlinkNamespacePrefix(ouBdoc);\r\n Node parents = selectSingleNode(ouBdoc, XPATH_ORGANIZATIONAL_UNIT_PARENTS);\r\n Element parent =\r\n ouBdoc.createElementNS(\"http://escidoc.de/core/01/structural-relations/\", srelPrefix + \":parent\");\r\n parent.setAttribute(xlinkPrefix + \":href\", \"/oum/organizational-unit/\" + ouAid);\r\n parents.appendChild(parent);\r\n ouBdoc = getDocument(update(ouBid, toString(ouBdoc, true)));\r\n\r\n // B parentOf C\r\n srelPrefix = determineSrelNamespacePrefix(ouCdoc);\r\n xlinkPrefix = determineXlinkNamespacePrefix(ouCdoc);\r\n parents = selectSingleNode(ouCdoc, XPATH_ORGANIZATIONAL_UNIT_PARENTS);\r\n parent = ouCdoc.createElementNS(\"http://escidoc.de/core/01/structural-relations/\", srelPrefix + \":parent\");\r\n parent.setAttribute(xlinkPrefix + \":href\", \"/oum/organizational-unit/\" + ouBid);\r\n parents.appendChild(parent);\r\n ouCdoc = getDocument(update(ouCid, toString(ouCdoc, true)));\r\n\r\n // A parentOf C\r\n srelPrefix = determineSrelNamespacePrefix(ouCdoc);\r\n xlinkPrefix = determineXlinkNamespacePrefix(ouCdoc);\r\n parents = selectSingleNode(ouCdoc, XPATH_ORGANIZATIONAL_UNIT_PARENTS);\r\n parent = (Element) selectSingleNode(parents, XPATH_ORGANIZATIONAL_UNIT_PARENT);\r\n parent.setAttribute(xlinkPrefix + \":href\", \"/oum/organizational-unit/\" + ouAid);\r\n ouCdoc = getDocument(update(ouCid, toString(ouCdoc, true)));\r\n }", "@org.junit.Test\n public void k2ComputeConElem13() {\n final XQuery query = new XQuery(\n \"element e {element b{()}}\",\n ctx);\n try {\n result = new QT3Result(query.value());\n } catch(final Throwable trw) {\n result = new QT3Result(trw);\n } finally {\n query.close();\n }\n test(\n assertSerialization(\"<e><b/></e>\", false)\n );\n }", "@Test\n public void testContains_Contain() {\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>();\n instance.add(1);\n instance.add(2);\n instance.add(3);\n\n boolean expResult = true;\n boolean result = instance.contains(1);\n assertEquals(expResult, result);\n }", "@Test\n public void testContainsAll_Contains() {\n\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>();\n instance.add(3);\n instance.add(2);\n instance.add(1);\n instance.add(4);\n\n Collection c = Arrays.asList(1, 2, 3);\n\n boolean expResult = true;\n boolean result = instance.containsAll(c);\n assertEquals(expResult, result);\n }", "@Test\r\n public void testContains() {\r\n System.out.println(\"contains\");\r\n ModeloListaOrganizadores instance = new ModeloListaOrganizadores(e.getListaOrganizadores());\r\n Organizador o =new Organizador(new Utilizador(\"teste\", \"[email protected]\", \"teste\", \"teste\", true, 5));\r\n instance.addElement(o);\r\n boolean expResult = true;\r\n boolean result = instance.contains(o);\r\n assertEquals(expResult, result);\r\n \r\n }", "@Rollback\n @Test\n public void getAllCreditOperationsByCreditFamilyId() {\n expectedCollection.add(creditOperationFamilyExpected);\n\n //AssertUtils.assertCreditOperationsCollections(expectedCollection, actualCollection);\n }", "private void checkProperties(Configuration compositeConfiguration)\n {\n assertTrue(\"Make sure we have loaded our key\", compositeConfiguration\n .getBoolean(\"test.boolean\"));\n assertEquals(\"I'm complex!\", compositeConfiguration\n .getProperty(\"element2.subelement.subsubelement\"));\n assertEquals(\"property in the XMLPropertiesConfiguration\", \"value1\",\n compositeConfiguration.getProperty(\"key1\"));\n }", "@Test\r\n public void testCommissionPallets() throws Exception\r\n {\r\n String epcToCheck = \"urn:epc:id:sscc:0614141.0000000001\";\r\n XmlObjectEventType event = dbHelper.getObjectEventByEpc(epcToCheck);\r\n Assert.assertNull(event);\r\n\r\n runCaptureTest(COMMISSION_PALLETS_XML);\r\n\r\n event = dbHelper.getObjectEventByEpc(epcToCheck);\r\n Assert.assertNotNull(event);\r\n }", "public void testIsMergeableElement() throws Exception {\n assertFalse(cfg.isMergeableElement(\"font\"));\n cfg.addMergeableElement(\"font\");\n assertTrue(cfg.isMergeableElement(\"font\"));\n\n cfg.addMergeableElement(\"mergeable\");\n assertTrue(cfg.isMergeableElement(\"font\"));\n assertTrue(cfg.isMergeableElement(\"mergeable\"));\n }", "public void testIsIndivisibleElement() throws Exception {\n assertTrue(cfg.isIndivisibleElement(\"test\"));\n assertTrue(cfg.isIndivisibleElement(\"d1\"));\n assertTrue(cfg.isIndivisibleElement(\"ind1\"));\n assertTrue(cfg.isIndivisibleElement(\"ind2\"));\n\n cfg.associateStylisticAndAntiElements(\"anti-test\", \"test\",\n permittedChildren);\n cfg.addDivisibleElementsThatPermitStyles(new String[] {\"d1\"});\n cfg.addIndivisibleElementsThatPermitStyles(new String[] {\"ind1\", \"ind2\"});\n\n assertTrue(cfg.isIndivisibleElement(\"ind1\"));\n assertTrue(cfg.isIndivisibleElement(\"ind2\"));\n assertTrue(cfg.isIndivisibleElement(\"not-in-any-set\"));\n assertTrue(cfg.isIndivisibleElement(\"child\"));\n assertTrue(cfg.isIndivisibleElement(\"TEST\"));\n assertTrue(cfg.isIndivisibleElement(\"D1\"));\n\n assertFalse(cfg.isIndivisibleElement(\"test\"));\n assertFalse(cfg.isIndivisibleElement(\"d1\"));\n assertFalse(cfg.isIndivisibleElement(\"anti-test\"));\n }", "@Test\n public void testContains_Contain_Overflow_Boundary() {\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>(2, 2);\n instance.add(1);\n instance.add(2);\n instance.add(3);\n instance.add(4);\n instance.add(5);\n instance.add(6);\n\n boolean expResult = true;\n boolean result = instance.contains(6);\n assertEquals(expResult, result);\n }", "@org.junit.Test\n public void k2ComputeConElem3() {\n final XQuery query = new XQuery(\n \"<elem>{<e/>, <b></b>, \\\"\\\", \\\"\\\"}</elem>\",\n ctx);\n try {\n result = new QT3Result(query.value());\n } catch(final Throwable trw) {\n result = new QT3Result(trw);\n } finally {\n query.close();\n }\n test(\n assertSerialization(\"<elem><e/><b/> </elem>\", false)\n );\n }", "public void testAddDivisibleElementsThatPermitStyles() throws Exception {\n String[] elements = { \"a\", \"b\", \"c\" };\n cfg.addDivisibleElementsThatPermitStyles(elements);\n\n String[] moreElements = { \"c\", \"d\" };\n cfg.addDivisibleElementsThatPermitStyles(moreElements);\n\n Set set = (Set)PrivateAccessor.getField(\n cfg, \"divisibleElementsThatPermitStyles\");\n assertEquals(\"Should have added and merged all elements:\",\n 4, set.size());\n\n for (int i = 0; i < elements.length; i++) {\n assertTrue(\"Should be in list: \", set.contains(elements[i]));\n }\n for (int i = 0; i < moreElements.length; i++) {\n assertTrue(\"Should be in list: \", set.contains(moreElements[i]));\n }\n }", "@Test\n public void testComplexCompositeDataExtractor() throws Exception {\n final String[] compositePropertyNames = new String[2];\n compositePropertyNames[0] = \"Count\";\n compositePropertyNames[1] = \"Latency\";\n\n final String[] compositePropertyDescriptions = new String[2];\n compositePropertyDescriptions[0] = \"Count of requests received for the command\";\n compositePropertyDescriptions[1] = \"Average Time Taken to process the command\";\n\n final OpenType[] compositePropertyTypes = new OpenType[2];\n compositePropertyTypes[0] = SimpleType.LONG;\n compositePropertyTypes[1] = SimpleType.FLOAT;\n\n final CompositeType compositeType =\n new CompositeType(\"Command Stats\", \"Stats for each command\",\n compositePropertyNames, compositePropertyDescriptions,\n compositePropertyTypes);\n\n final Object[] loginCompositeValues = new Object[compositePropertyNames.length];\n loginCompositeValues[0] = new Long(10);\n loginCompositeValues[1] = new Float(38.34f);\n\n final Object[] logoutCompositeValues = new Object[compositePropertyNames.length];\n logoutCompositeValues[0] = new Long(30);\n logoutCompositeValues[1] = new Float(26.09f);\n\n final Object[] capaCompositeValues = new Object[compositePropertyNames.length];\n capaCompositeValues[0] = new Long(89);\n capaCompositeValues[1] = new Float(103.09f);\n\n final String[] complexCompositePropertyNames = new String[3];\n complexCompositePropertyNames[0] = \"Login\";\n complexCompositePropertyNames[1] = \"Logout\";\n complexCompositePropertyNames[2] = \"Capability\";\n\n CompositeData[] complexDataValues = new CompositeData[complexCompositePropertyNames.length];\n complexDataValues[0] =\n new CompositeDataSupport(compositeType, compositePropertyNames, loginCompositeValues);\n complexDataValues[1] =\n new CompositeDataSupport(compositeType, compositePropertyNames, logoutCompositeValues);\n complexDataValues[2] =\n new CompositeDataSupport(compositeType, compositePropertyNames, capaCompositeValues);\n\n final OpenType[] complexCompositePropertyTypes = new OpenType[3];\n complexCompositePropertyTypes[0] = compositeType;\n complexCompositePropertyTypes[1] = compositeType;\n complexCompositePropertyTypes[2] = compositeType;\n\n final String[] complexCompositePropertyDescriptions = new String[3];\n complexCompositePropertyDescriptions[0] =\n \"Command Stats for \" + complexCompositePropertyNames[0];\n complexCompositePropertyDescriptions[1] =\n \"Command Stats for \" + complexCompositePropertyNames[1];\n complexCompositePropertyDescriptions[2] =\n \"Command Stats for \" + complexCompositePropertyNames[2];\n\n final CompositeType complexCompositeType =\n new CompositeType(\"Commands\", \"Stats for all commands\",\n complexCompositePropertyNames, complexCompositePropertyDescriptions,\n complexCompositePropertyTypes);\n\n CompositeData complexData =\n new CompositeDataSupport(complexCompositeType, complexCompositePropertyNames,\n complexDataValues);\n\n ObjectToJsonConverter jsonConverter = new ObjectToJsonConverter();\n JsonElement jsonElement = jsonConverter.extractObject(complexData);\n Assert.assertNotNull(jsonElement);\n\n JsonElement capability = jsonElement.getAsJsonObject().get(\"Capability\");\n Assert.assertNotNull(capability);\n JsonElement count = capability.getAsJsonObject().get(\"Count\");\n Assert.assertNotNull(count);\n Assert.assertEquals(count.getAsLong(), 89);\n JsonElement latency = capability.getAsJsonObject().get(\"Latency\");\n Assert.assertNotNull(latency);\n Assert.assertEquals(latency.getAsFloat(), 103.09f);\n\n JsonElement login = jsonElement.getAsJsonObject().get(\"Login\");\n Assert.assertNotNull(login);\n count = login.getAsJsonObject().get(\"Count\");\n Assert.assertNotNull(count);\n Assert.assertEquals(count.getAsLong(), 10);\n latency = login.getAsJsonObject().get(\"Latency\");\n Assert.assertNotNull(latency);\n Assert.assertEquals(latency.getAsFloat(), 38.34f);\n\n JsonElement logout = jsonElement.getAsJsonObject().get(\"Logout\");\n Assert.assertNotNull(logout);\n count = logout.getAsJsonObject().get(\"Count\");\n Assert.assertNotNull(count);\n Assert.assertEquals(count.getAsLong(), 30);\n latency = logout.getAsJsonObject().get(\"Latency\");\n Assert.assertNotNull(latency);\n Assert.assertEquals(latency.getAsFloat(), 26.09f);\n }", "@Test\n public void testEquals() {\n Coctail c1 = new Coctail(\"coctail\", new Ingredient[]{ \n new Ingredient(\"ing1\"), new Ingredient(\"ing2\")});\n Coctail c2 = new Coctail(\"coctail\", new Ingredient[]{ \n new Ingredient(\"ing1\"), new Ingredient(\"ing2\")});\n assertEquals(c1, c2);\n }", "public static void VerifyCommonComponent_Div_H2(String renderingControl){\n\t\ttry{\n\t\t\tactualTitleButton=sitecoreObj.aboutusCommonComponent_Div_H2.isDisplayed();\n\t\t\tAssert.assertEquals(actualTitleButton, true);\n\t\t\tlog.info(\"The Actual AboutUs \" + renderingControl + \" Title - <\"+sitecoreObj.aboutusCommonComponent_Div_H2.getTagName()+\">\");\n\t\t\tlog.info(\"The Expected AboutUs \" + renderingControl + \" Title - <h2>\");\n\t\t\tlog.info(\"TEST PASSED: The Actual and Expected AboutUs \" + renderingControl + \" Title are Same\");\n\t\t}catch(AssertionError e){\n\t\t\tlog.error(\"The Actual AboutUs \" + renderingControl + \" Title - \"+sitecoreObj.aboutusCommonComponent_Div_H2.getTagName());\n\t\t\tlog.error(\"The Expected AboutUs \" + renderingControl + \" Title - <h2>\");\n\t\t\tlog.error(\"TEST FAILED: The Actual and Expected AboutUs \" + renderingControl + \" Title are NOT same\");\n\t\t}catch(org.openqa.selenium.NoSuchElementException e){\n\t\t\tlog.error(\"TEST FAILED: There is No Title On \" + renderingControl + \" element\");\n\t\t}\t\t\n\t}", "private static void testContains(BagInterface<String> aBag, String[] tests)\n {\n System.out.println(\"\\nTesting the method contains:\");\n for (int index = 0; index < tests.length; index++)\n System.out.println(\"Does this bag contain \" + tests[index] +\n \"? \" + aBag.contains(tests[index]));\n }", "public static void VerifyCommonComponent_Div_Div_H2(String renderingControl){\n\t\tboolean actualSideBySideTitle = false;\n\t\ttry{\n\t\t\tactualSideBySideTitle=sitecoreObj.aboutusCommonComponent_Div_Div_H2.isDisplayed();\n\t\t\tAssert.assertEquals(actualSideBySideTitle, true);\n\t\t\tlog.info(\"The Actual AboutUs \" + renderingControl + \" Title - <\"+sitecoreObj.aboutusCommonComponent_Div_Div_H2.getTagName()+\">\");\n\t\t\tlog.info(\"The Expected AboutUs \" + renderingControl + \" Title - <h2>\");\n\t\t\tlog.info(\"TEST PASSED: The Actual and Expected AboutUs \" + renderingControl + \" Titles are Same\");\n\t\t}catch(AssertionError e){\n\t\t\tlog.error(\"The Actual AboutUs \" + renderingControl + \" Title - <\"+sitecoreObj.aboutusCommonComponent_Div_Div_H2.getTagName()+\">\");\n\t\t\tlog.error(\"The Expected AboutUs \" + renderingControl + \" Title - <h2>\");\n\t\t\tlog.error(\"TEST FAILED: The Actual and Expected AboutUs \" + renderingControl + \" Titles are NOT same\");\n\t\t}catch(org.openqa.selenium.NoSuchElementException e){\n\t\t\tlog.error(\"TEST FAILED: There is No Title element On \" + renderingControl + \" Container\");\n\t\t}\t\t\n\t}", "@Test\n public void testBoundsAsCompositesWithMultiEqRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n Restriction eq = newMultiEq(cfMetaData, 0, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n }", "@Test\n\tpublic void testCrearEjercicio2(){\n\t\tEjercicio ej = new Ejercicio(1, true, Plataforma.getFechaActual().plusDays(3), Plataforma.getFechaActual().plusDays(2),\n\t\t\t\ttema1, \"Ejercicio1\", true, mates);\n\t\t\n\t\tassertEquals(ej.getFechaIni(), ej.getFechaIniDefecto());\n\t\tassertEquals(ej.getFechaFin(), ej.getFechaFinDefecto());\n\t\tassertTrue(tema1.getSubcontenido().contains(ej));\n\t}", "public static void VerifyCommonComponent_2DIVs_P(String renderingControl){\t\t\t\t\n\t\ttry{\n\t\t\tactualHeaderText=sitecoreObj.aboutusCommonComponent_2Divs_P.isDisplayed();\n\t\t\tAssert.assertEquals(actualHeaderText, true);\n\t\t\tlog.info(\"The Actual AboutUs \" + renderingControl + \" Description - <\"+sitecoreObj.aboutusCommonComponent_2Divs_P.getTagName()+\">\");\n\t\t\tlog.info(\"The Expected AboutUs \" + renderingControl + \" Description - <p>\");\t\n\t\t\tlog.info(\"TEST PASSED: The Actual and Expected AboutUs \" + renderingControl + \" Description are Same\");\n\t\t}catch(AssertionError e){\n\t\t\tlog.error(\"The Actual AboutUs \" + renderingControl + \" Description - <\"+sitecoreObj.aboutusCommonComponent_2Divs_P.getTagName()+\">\");\n\t\t\tlog.error(\"The Expected AboutUs \" + renderingControl + \" Description - <p>\");\t\t\t\t\t\t\n\t\t\tlog.error(\"TEST FAILED: The Actual and Expected AboutUs \" + renderingControl + \" Description are NOT same\");\n\t\t}catch(org.openqa.selenium.NoSuchElementException e){\n\t\t\tlog.error(\"TEST FAILED: There is No Description On \" + renderingControl + \" element\");\n\t\t}\n\t}", "boolean isComposite();", "boolean isComposite();", "@Test \n\t@DisplayName(\"combinacion[i] == null || (combinacionSecreta[i] == null\")\n\tvoid elementoDeCombinacionNoEsCasilla1Test(){ \n\t\tCombinacion combinacionFacil = new Combinacion(dificultadFacil);\n\t\tCombinacion combinacionSecretaFacil = new Combinacion(dificultadFacil);\n\t\tCombinacion combinacionGanaFacil = new Combinacion(dificultadFacil);\n\t\t\n\t\tcombinacionFacil.anadirCasilla(new Casilla(Color.FONDO_ROJOCLARO));\n\t\tcombinacionFacil.anadirCasilla(new Casilla(Color.FONDO_AZUL));\n\t\tcombinacionFacil.anadirCasilla(null);\n\t\tcombinacionFacil.anadirCasilla(new Casilla(Color.FONDO_AMARILLOCLARO));\n\t\t\n\t\tcombinacionSecretaFacil.anadirCasilla(new Casilla(Color.FONDO_ROJOCLARO));\n\t\tcombinacionSecretaFacil.anadirCasilla(new Casilla(Color.FONDO_AMARILLOCLARO));\n\t\tcombinacionSecretaFacil.anadirCasilla(new Casilla(Color.FONDO_MORADOCLARO));\n\t\tcombinacionSecretaFacil.anadirCasilla(new Casilla(Color.FONDO_AZUL));\n\t\n\t\tcombinacionGanaFacil.anadirCasilla(new Casilla(Color.FONDO_ROJOCLARO));\n\t\tcombinacionGanaFacil.anadirCasilla(new Casilla(Color.FONDO_BLANCO));\n\t\tcombinacionGanaFacil.anadirCasilla(new Casilla(Color.FONDO_BLANCO));\n\t\tcombinacionGanaFacil.anadirCasilla(new Casilla(Color.FONDO_NEGRO));\n\t\t\n\t\tAssert.assertEquals(combinacionGanaFacil, combinacionFacil.calcularResultado(combinacionSecretaFacil));\n\t}", "@Test\n @DisplayName(\"Test should detect equality between equal states.\")\n public void testShouldResultInEquality() {\n ObjectBag os1 = new ObjectBag(null, \"Hi\");\n ObjectBag os2 = new ObjectBag(null, \"Hi\");\n\n Assertions.assertThat(os1).isEqualTo(os2);\n }", "@Test\r\n public void testContains() {\r\n Grocery entry1 = new Grocery(\"Mayo\", \"Dressing / Mayo\", 1, 2.99f, 1);\r\n\r\n // Test element does not exist case\r\n assertFalse(instance.contains(entry1));\r\n\r\n instance.add(entry1);\r\n\r\n // Test element exists case\r\n assertTrue(instance.contains(entry1));\r\n }", "@Test\n public void testContains() {\n p.addPackage(p1);\n assertFalse(p.contains(p2));\n assertTrue(p.contains(p1));\n\n p.addPackage(p2);\n assertTrue(p.contains(p1));\n assertTrue(p.contains(p2));\n }", "public static void VerifyCommonComponent_Div_P(String renderingControl){\n\t\ttry{\n\t\t\tactualDescriptionButton=sitecoreObj.aboutusCommonComponent_Div_P.isDisplayed();\n\t\t\tAssert.assertEquals(actualDescriptionButton, true);\n\t\t\tlog.info(\"The Actual AboutUs \" + renderingControl + \" Description - <\"+sitecoreObj.aboutusCommonComponent_Div_P.getTagName()+\">\");\n\t\t\tlog.info(\"The Expected AboutUs \" + renderingControl + \" Description - <p>\");\n\t\t\tlog.info(\"TEST PASSED: The Actual and Expected AboutUs \" + renderingControl + \" Description are Same\");\n\t\t}catch(AssertionError e){\n\t\t\tlog.error(\"The Actual AboutUs \" + renderingControl + \" Description - \"+sitecoreObj.aboutusCommonComponent_Div_P.getTagName());\n\t\t\tlog.error(\"The Expected AboutUs \" + renderingControl + \" Description - <p>\");\n\t\t\tlog.error(\"TEST FAILED: The Actual and Expected AboutUs \" + renderingControl + \" Description are NOT same\");\n\t\t}catch(org.openqa.selenium.NoSuchElementException e){\n\t\t\tlog.error(\"TEST FAILED: There is No Description On \" + renderingControl + \" element\");\n\t\t}\n\t}", "@Test\n public void processCompoundTransaction_TestC() throws Exception {\n ct = new CompoundTransaction(\"compound\");\n\n Assert.assertEquals(false, trans_mang.processCompoundTransaction(ct));\n }", "@Test\n public void ensureCompositeStateImmutabilityTest() throws InterruptedException, PluginException {\n final WritableGraph wg = graph.getWritableGraph(\"test\", true);\n wg.getSchema().newGraph(wg);\n int v0, v1, v2;\n final String v0name, v1name, v2name;\n final int nameAttr;\n final int selectedAttr;\n final Plugin copyPlugin;\n try {\n // Add three vertices\n v0 = wg.addVertex();\n wg.getSchema().newVertex(wg, v0);\n v1 = wg.addVertex();\n wg.getSchema().newVertex(wg, v1);\n v2 = wg.addVertex();\n wg.getSchema().newVertex(wg, v2);\n\n // Store the names of these vertices\n nameAttr = VisualConcept.VertexAttribute.LABEL.get(wg);\n v0name = wg.getStringValue(nameAttr, v0);\n v1name = wg.getStringValue(nameAttr, v1);\n v2name = wg.getStringValue(nameAttr, v2);\n\n // Add a transaction from v0 to v1\n final int t0_1 = wg.addTransaction(v0, v1, true);\n wg.getSchema().newTransaction(wg, t0_1);\n\n // Select v0 and v2, but not v1\n selectedAttr = VisualConcept.VertexAttribute.SELECTED.get(wg);\n wg.setBooleanValue(selectedAttr, v0, true);\n wg.setBooleanValue(selectedAttr, v2, true);\n wg.setBooleanValue(selectedAttr, v1, false);\n } finally {\n wg.commit();\n }\n\n // Make a composite from the selection, then select everything, and copy to a new graph\n copyPlugin = PluginRegistry.get(InteractiveGraphPluginRegistry.COPY_TO_NEW_GRAPH);\n PluginExecutor.startWith(InteractiveGraphPluginRegistry.CREATE_COMPOSITE_FROM_SELECTION)\n .followedBy(VisualGraphPluginRegistry.SELECT_ALL)\n .followedBy(copyPlugin)\n .executeNow(graph);\n\n final WritableGraph copyWg = ((CopyToNewGraphPlugin) copyPlugin).getCopy().getWritableGraph(\"test\", true);\n try {\n // Expand all composites\n PluginExecution.withPlugin(InteractiveGraphPluginRegistry.EXPAND_ALL_COMPOSITES).executeNow(copyWg);\n } finally {\n copyWg.commit();\n }\n\n // Now we check there has been no effect on the composite state on the original graph\n // by expanding it and then checking it is the same as the orignal graph\n final WritableGraph wg2 = graph.getWritableGraph(\"test\", true);\n try {\n // Expand all composites\n PluginExecution.withPlugin(InteractiveGraphPluginRegistry.EXPAND_ALL_COMPOSITES).executeNow(wg2);\n } finally {\n wg2.commit();\n }\n\n final ReadableGraph rg = graph.getReadableGraph();\n try {\n\n // Assert that there are three vertices all with their original names\n assertEquals(rg.getVertexCount(), 3);\n for (int i = 0; i < 3; i++) {\n final int id = rg.getVertex(i);\n final String name = rg.getStringValue(nameAttr, id);\n if (name.equals(v0name)) {\n v0 = id;\n } else if (name.equals(v1name)) {\n v1 = id;\n } else {\n v2 = id;\n }\n }\n assertEquals(rg.getStringValue(nameAttr, v0), v0name);\n assertEquals(rg.getStringValue(nameAttr, v1), v1name);\n assertEquals(rg.getStringValue(nameAttr, v2), v2name);\n\n // Assert that the two transactions exist as expected and no others\n assertEquals(rg.getTransactionCount(), 1);\n final int l0_1 = rg.getLink(v0, v1);\n assertEquals(rg.getLinkTransactionCount(l0_1), 1);\n final int t0_1 = rg.getLinkTransaction(l0_1, 0);\n assertFalse(rg.getTransactionDirection(t0_1) == Graph.FLAT);\n assertEquals(rg.getTransactionSourceVertex(t0_1), v0);\n final int l1_2 = rg.getLink(v1, v2);\n assertEquals(l1_2, Graph.NOT_FOUND);\n final int l0_2 = rg.getLink(v0, v2);\n assertEquals(l0_2, Graph.NOT_FOUND);\n } finally {\n rg.release();\n }\n }", "@Test\n\tpublic void testComenzar() {\n\t\tl.agregar(0, 0);\n\t\tl.comenzar();\n\t\tassertEquals((int)(new Integer(0)), l.elemento());\n\t\t\n\t\t//Probando con dos elementos\n\t\tl.agregar(1, 1);\n\t\tl.comenzar();\n\t\tassertEquals((int)(new Integer(0)), l.elemento());\n\t\t\n\t\t//Probando de agregar un elemento al principio\n\t\tl.agregar(2, 0);\n\t\tl.comenzar();\n\t\tassertEquals((int)(new Integer(2)), l.elemento());\n\t\t\n\t\t\n\t}", "@Entao(\"o sistema deve exibir o form de busca por Componentes\")\n public void o_sistema_deve_exibir_o_form_de_busca_por_componentes() {\n String expected;\n expected = \"Consulta de Componentes Curriculares\";\n String actual = driver.findElement(By.cssSelector(\"#corpo > h2\")).getText();\n Assert.assertEquals(expected, actual);\n }", "@Test(priority = 5, dependsOnMethods = { \"verifySubscriptionPageComponents\" }, groups = { \"Smoke\" })\n\tpublic static void verifyGridComponents() throws InterruptedException {\n\n\t\ttest = report.startTest(\"Verify Components of Grid\");\n\n//\t\t//Verify Columns of Grid\n//\t\tString columnsGrid = driver.findElement(By.xpath(xpathColumnOfgrid)).getText();\n//\t\tAssert.assertEquals(columnsGrid,\"S. noSubscription NameSubscription IdDescriptionCreated OnAction\");\n//\t\ttest.log(LogStatus.PASS, \"Column Of Grid\", \"All Column are Displaying\");\n\n\t\t// verify any row in grid is displaying or not\n\n\t\tboolean rowInGrid = driver.findElement(By.xpath(xpathRowInGrid)).getText().isEmpty();\n\t\tAssert.assertFalse(rowInGrid);\n\t\ttest.log(LogStatus.PASS, \"Row In Grid\", \"Row In Grid is displaying\");\n\n\t\t// verify Delete and Edit Buttons\n\t\tWebElement deleteButton = driver.findElement(By.className(classDeleteButton));\n\t\tAssert.assertTrue(deleteButton.isEnabled());\n\t\ttest.log(LogStatus.PASS, \"Delete Button\", \"Delete Button is displaying and Enabled\");\n\t\tWebElement editButton = driver.findElement(By.className(\"editlink\"));\n\t\tAssert.assertTrue(editButton.isEnabled());\n\t\ttest.log(LogStatus.PASS, \"Edit Button\", \"Edit Button is displaying and Enabled\");\n\t}", "@Step(\"There are the following elements on Different Elements page: 4 checkboxes, 4 radios, 1 dropdown, 2 buttons\")\n public void checkElements() {\n checkboxes.shouldHaveSize(4);\n radios.shouldHaveSize(4);\n dropdown.shouldBe(Condition.exist);\n buttons.shouldHaveSize(2);\n }", "@Test\n public void testCardSelectionIsValid_TRUE() throws Exception {\n System.out.println(\"cardSelectionIsValid not valid\");\n UnoCard cardSelection = new UnoCard(UnoCardColour.BLUE, UnoCardValue.TWO);\n UnoCard drawCard = new UnoCard(UnoCardColour.BLUE, UnoCardValue.ONE);\n UnoCardColour wildColour = UnoCardColour.BLUE;\n utils.cardSelectionIsValid(cardSelection, drawCard, wildColour);\n }", "@Test\n public void processCompoundTransaction_TestA() throws Exception\n {\n ct = new CompoundTransaction(\"compound\");\n\n acc_db.addAccount(acc);\n acc_db.addAccount(acc2);\n\n ct.addTransaction(new Transaction(\"atomic1\", acc_db,acc.get_Account_Number(),acc2.get_Account_Number(),10));\n\n ct.addTransaction(new Transaction(\"atomic2\",acc_db,acc.get_Account_Number(),acc2.get_Account_Number(),40));\n\n Assert.assertEquals(true, trans_mang.processCompoundTransaction(ct));\n }", "@Test\n public void test_compteAvecOperations(){\n \t\n \tCompte c = serviceCompte.rechercherCompteAvecOperations(1L);\n \tSystem.out.println(\"compte_1 : \"+c);\n \tfor(Operation op : c.getOperations()){\n \t\tSystem.out.println(\"\\t\"+op);\n \t}\n \tAssert.assertTrue(c.getOperations().size()>0);\n }", "public static void VerifyCommonComponent_2DIVs_H2(String renderingControl){\t\t\t\t\n\t\ttry{\n\t\t\tactualHeaderText=sitecoreObj.aboutusCommonComponent_2Divs_H2.isDisplayed();\n\t\t\tAssert.assertEquals(actualHeaderText, true);\n\t\t\tlog.info(\"The Actual AboutUs \" + renderingControl + \" Title - <\"+sitecoreObj.aboutusCommonComponent_2Divs_H2.getTagName()+\">\");\n\t\t\tlog.info(\"The Expected AboutUs \" + renderingControl + \" Title - <h2>\");\t\n\t\t\tlog.info(\"TEST PASSED: The Actual and Expected AboutUs \" + renderingControl + \" Title are Same\");\n\t\t}catch(AssertionError e){\n\t\t\tlog.error(\"The Actual AboutUs \" + renderingControl + \" Title - <\"+sitecoreObj.aboutusCommonComponent_2Divs_H2.getTagName()+\">\");\n\t\t\tlog.error(\"The Expected AboutUs \" + renderingControl + \" Title - <h2>\");\t\t\t\t\t\t\n\t\t\tlog.error(\"TEST FAILED: The Actual and Expected AboutUs \" + renderingControl + \" Title are NOT same\");\n\t\t}catch(org.openqa.selenium.NoSuchElementException e){\n\t\t\tlog.error(\"TEST FAILED: There is No Title On \" + renderingControl + \" element\");\n\t\t}\n\t}", "@Then(\"^assert that the text \\\"([^\\\"]*)\\\" element has \\\"([^\\\"]*)\\\"$\")\n\tpublic void assert_that_the_text_element_has(String arg1, String arg2) throws Throwable {\n\t\tString[] parts = arg1.split(\"=\");\n\t\tString selector=parts[1];\n\t\tString result = driver.findElement(By.cssSelector(selector)).getText();\n\t\tAssert.assertTrue(\"Text is not included\", result.contains(arg2));\n\t\tSystem.out.println(\"Assert \"+ result +\" contain the text : \"+arg2 );\n\t}", "@Test\r\n public void testCompliment1() {\r\n int actual[] = set1.getComplement();\r\n Assert.assertArrayEquals(new int[] { 100, 200, 456, 234, 890, 990, 100,\r\n 210, 500, 700, 900 }, actual);\r\n }", "public static boolean occlusionTest(IMultipart part, AxisAlignedBB... boxes) {\n\n return occlusionTest(part, new NormallyOccludingPart(Arrays.asList(boxes)));\n }", "@Test\n public void testContains_Contain_Overflow() {\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>(3, 2);\n instance.add(1);\n instance.add(2);\n instance.add(3);\n instance.add(4);\n instance.add(5);\n instance.add(6);\n\n boolean expResult = true;\n boolean result = instance.contains(4);\n assertEquals(expResult, result);\n }", "@Test\n public void testBoundsAsCompositesWithSingleEqAndMultiEqRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) = (2, 3)\n Restriction singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction multiEq = newMultiEq(cfMetaData, 1, value2, value3);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiEq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n // clustering_0 = 1 AND clustering_1 = 2 AND (clustering_2, clustering_3) = (3, 4)\n singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction singleEq2 = newSingleEq(cfMetaData, 1, value2);\n multiEq = newMultiEq(cfMetaData, 2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(singleEq2).mergeWith(multiEq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n\n // (clustering_0, clustering_1) = (1, 2) AND clustering_2 = 3\n singleEq = newSingleEq(cfMetaData, 2, value3);\n multiEq = newMultiEq(cfMetaData, 0, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiEq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) = (2, 3) AND clustering_3 = 4\n singleEq = newSingleEq(cfMetaData, 0, value1);\n singleEq2 = newSingleEq(cfMetaData, 3, value4);\n multiEq = newMultiEq(cfMetaData, 1, value2, value3);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiEq).mergeWith(singleEq2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n }", "@Test\n public void processCompoundTransaction_TestB() throws Exception {\n ct = new CompoundTransaction(\"compound\");\n\n acc_db.addAccount(acc);\n acc_db.addAccount(acc2);\n\n ct.addTransaction(new Transaction(\"atomic1\", acc_db,acc.get_Account_Number(),acc2.get_Account_Number(),10001));\n\n ct.addTransaction(new Transaction(\"atomic2\",acc_db,acc.get_Account_Number(),acc2.get_Account_Number(),40));\n\n Assert.assertEquals(false,trans_mang.processCompoundTransaction(ct));\n }", "@Test\n public void z_topDown_TC02() {\n try {\n Intrebare intrebare = appService.addNewIntrebare(\"Enunt?\", \"1) Raspuns1\", \"2) Raspuns2\", \"3) Raspuns3\",\n \"1\", \"M\");\n Intrebare intrebare1 = appService.addNewIntrebare(\"Enunt?\", \"1) Raspuns1\", \"2) Raspuns2\", \"3) Raspuns3\",\n \"1\", \"A\");\n Intrebare intrebare2 = appService.addNewIntrebare(\"Enunt?\", \"1) Raspuns1\", \"2) Raspuns2\", \"3) Raspuns3\",\n \"1\", \"B\");\n Intrebare intrebare3 = appService.addNewIntrebare(\"Enunt?\", \"1) Raspuns1\", \"2) Raspuns2\", \"3) Raspuns3\",\n \"1\", \"C\");\n assertTrue(true);\n assertTrue(appService.exists(intrebare));\n assertTrue(appService.exists(intrebare1));\n assertTrue(appService.exists(intrebare2));\n assertTrue(appService.exists(intrebare3));\n\n try {\n ccir2082MV.evaluator.model.Test test = appService.createNewTest();\n assertTrue(test.getIntrebari().contains(intrebare));\n assertTrue(test.getIntrebari().contains(intrebare1));\n assertTrue(test.getIntrebari().contains(intrebare2));\n assertTrue(test.getIntrebari().contains(intrebare3));\n assertTrue(test.getIntrebari().size() == 5);\n } catch (NotAbleToCreateTestException e) {\n assertTrue(false);\n }\n } catch (DuplicateIntrebareException | IntrebareValidatorFailedException e) {\n e.printStackTrace();\n assertTrue(false);\n }\n }", "@Test\r\n\tpublic void testAcquistareBigliettiE2(){\r\n\t\tOfferta o = new Offerta(\"standard\", 10, 25.0);\r\n\t\tCartaDiCredito carta = new CartaDiCredito(\"2334549359434\",23353.89);\r\n\t\tAbbonamento a = new Abbonamento(o);\r\n\t\tCliente c2 = new Cliente(\"4\",\"Mario\",\"Rossi\",\"[email protected]\",\r\n\t\t\t\t\"M\",\"333152497\",\"rossimario\",\"passw.\",\"passw.\",\"domanda segreta..\",carta);\r\n\t\tc2.setAbbonamento(a);\r\n\t\tp1.acquistareBiglietti(3,\"abbonamento\", c2);\r\n\t\t//i biglietti vengono inseriti nella lista prenotazioni e quindi ne\r\n\t\t//modificano la size\r\n\t\tassertEquals(3,c2.getPrenotazioni().size());\r\n\t}", "@Test\n\tpublic void shouldEstablishTexbookToCourseRelationships(){\n\t\tCourse course = new Course(\"OO Languages\", \"description\"); // created course first\n\t\tcourseRepo.save(course); //saving course into course repo\n\t\tlong courseId = course.getId();\n\t\t\n\t\t\n\t\t//building owners\n\t\tTextbook book = new Textbook (\"title\", course);\n\t\ttextbookRepo.save(book);\n\t\t\n\t\t\n\t\tTextbook book2 = new Textbook(\"title two\", course);\n\t\ttextbookRepo.save(book2);\n\t\t\n\t\t\n\t\tentityManager.flush(); \n\t\tentityManager.clear();\n\t\t\n\t\t\n\t\tOptional<Course> result = courseRepo.findById(courseId);\n\t\tcourse = result.get();\n\t\t\n\t\tassertThat(course.getTextBooks(), containsInAnyOrder(book, book2));\t\n\t\t\t\t\n\t}", "@Test\n public void testASSY1HasNoSubComponents() {\n assertThat( hasSubComponents( ASSY1_WITHOT_SUB_COMP ), is( false ) );\n }", "@Test\n public void testContainsBorder() {\n for (final Border border : Border.values()) {\n for (final Border test : Border.values()) {\n final String[] parts = test.toString().split(\"_\");\n for (final String part : parts) {\n final Border contains = Border.valueOf(part);\n if (border.toString().contains(part) || (border == Border.ALL && contains != Border.NONE)) {\n Assert.assertTrue(border + \" should contain \" + contains, border.containsBorder(contains));\n } else {\n Assert.assertFalse(border + \" shouldn't contain \" + contains, border.containsBorder(contains));\n }\n }\n }\n }\n }", "@Test\n void findIntersections() {\n Cuboid cuboid1 = new Cuboid(4,4,4);\n Ray ray1 = new Ray(new Point3D(-3,0,0), new Vector3D(1,0,0));\n ArrayList<GeoPoint> actual1 = cuboid1.findIntersections(ray1);\n ArrayList<GeoPoint> expected1 = new ArrayList<>();\n expected1.add(new GeoPoint(cuboid1, new Point3D(2,0,0)));\n expected1.add(new GeoPoint(cuboid1, new Point3D(-2,0,0)));\n\n assertTrue(Util.intersectionsEqual(expected1, actual1));\n\n //Aligned with Y axis but have different dimensions\n Cuboid cuboid2 = new Cuboid(2,4,3);\n Ray ray2 = new Ray(new Point3D(0,100,0), new Vector3D(0,-1,0));\n ArrayList<GeoPoint> actual2 = cuboid2.findIntersections(ray2);\n ArrayList<GeoPoint> expected2 = new ArrayList<>();\n expected2.add(new GeoPoint(cuboid1, new Point3D(0,2,0)));\n assertEquals(expected2.get(0).point, actual2.get(0).point);\n\n Cuboid cuboid3 = new Cuboid(2,4,3, new Ray(new Point3D(1,1,1), new Vector3D(0,0,1)));\n Ray ray3 = new Ray(new Point3D(0,100,0), new Vector3D(0,-1,0));\n ArrayList<GeoPoint> actual3 = cuboid3.findIntersections(ray3);\n ArrayList<GeoPoint> expected3 = new ArrayList<>();\n expected3.add(new GeoPoint(cuboid1, new Point3D(0,3,0)));\n assertEquals(expected3.get(0).point, actual3.get(0).point);\n\n Ray ray = new Ray(new Point3D(0,0,-200), Vector3D.zAxis);\n ArrayList<GeoPoint> interesections = cuboid1.findIntersections(ray);\n }", "@Test\n public void testBoundsAsCompositesWithOneEqRestrictionsAndTwoClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer clustering_0 = ByteBufferUtil.bytes(1);\n Restriction eq = newSingleEq(cfMetaData, 0, clustering_0);\n\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.END);\n }", "@Test\r\n public void test_OUM_UPOU_2_2() throws Exception {\r\n\r\n final Class<OrganizationalUnitNotFoundException> ec = OrganizationalUnitNotFoundException.class;\r\n\r\n final String ouXml = createSuccessfully(\"escidoc_ou_create.xml\");\r\n\r\n try {\r\n updateParentOus(CONTEXT_ID, retrieveParents(getObjidValue(ouXml)));\r\n failMissingException(\"No exception occured on update with id of resoure of\" + \" another type.\", ec);\r\n }\r\n catch (final Exception e) {\r\n assertExceptionType(ec, e);\r\n }\r\n }", "@Test\n public void testBoundsAsCompositesWithSingleEqAndMultiINRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n ByteBuffer value5 = ByteBufferUtil.bytes(5);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) IN ((2, 3), (4, 5))\n Restriction singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction multiIN = newMultiIN(cfMetaData, 1, asList(value2, value3), asList(value4, value5));\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiIN);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(1), value1, value4, value5, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(1), value1, value4, value5, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) IN ((2, 3))\n singleEq = newSingleEq(cfMetaData, 0, value1);\n multiIN = newMultiIN(cfMetaData, 1, asList(value2, value3));\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiIN).mergeWith(singleEq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n // clustering_0 = 1 AND clustering_1 = 5 AND (clustering_2, clustering_3) IN ((2, 3), (4, 5))\n singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction singleEq2 = newSingleEq(cfMetaData, 1, value5);\n multiIN = newMultiIN(cfMetaData, 2, asList(value2, value3), asList(value4, value5));\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiIN).mergeWith(singleEq2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value5, value2, value3, EOC.START);\n assertComposite(bounds.get(1), value1, value5, value4, value5, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value5, value2, value3, EOC.END);\n assertComposite(bounds.get(1), value1, value5, value4, value5, EOC.END);\n }", "@org.junit.Test\n public void k2ComputeConElem10() {\n final XQuery query = new XQuery(\n \"declare construction strip; element e {\\\"content\\\"} instance of element(*, xs:untyped)\",\n ctx);\n try {\n result = new QT3Result(query.value());\n } catch(final Throwable trw) {\n result = new QT3Result(trw);\n } finally {\n query.close();\n }\n test(\n assertBoolean(true)\n );\n }", "public static void VerifyCommonComponent_H2(String renderingControl){\n\t\ttry{\n\t\t\tactualTitleImg=sitecoreObj.aboutusCommonComponent_H2.isDisplayed();\n\t\t\tAssert.assertEquals(actualTitleImg, true);\n\t\t\tlog.info(\"The Actual AboutUs \" + renderingControl + \" Title - <\"+sitecoreObj.aboutusCommonComponent_H2.getTagName()+\">\");\n\t\t\tlog.info(\"The Expected AboutUs \" + renderingControl + \" Title - <h2>\");\n\t\t\tlog.info(\"TEST PASSED: The Actual and Expected AboutUs \" + renderingControl + \" Title are Same\");\n\t\t}catch(AssertionError e){\n\t\t\tlog.error(\"The Actual AboutUs \" + renderingControl + \" Title - \"+sitecoreObj.aboutusCommonComponent_H2.getTagName());\n\t\t\tlog.error(\"The Expected AboutUs \" + renderingControl + \" Title - <h2>\");\n\t\t\tlog.error(\"TEST FAILED: The Actual and Expected AboutUs \" + renderingControl + \" Title are NOT same\");\n\t\t}catch(org.openqa.selenium.NoSuchElementException e){\n\t\t\tlog.error(\"TEST FAILED: There is No Title On \" + renderingControl + \" element\");\n\t\t}\t\t\n\t}", "@org.junit.Test\n public void k2ComputeConElem9() {\n final XQuery query = new XQuery(\n \"element e {\\\"content\\\"} instance of element(*, xs:untyped)\",\n ctx);\n try {\n result = new QT3Result(query.value());\n } catch(final Throwable trw) {\n result = new QT3Result(trw);\n } finally {\n query.close();\n }\n test(\n (\n assertBoolean(false)\n ||\n assertBoolean(true)\n )\n );\n }", "@Test\n public void testTRK2HasNoSubComponents() {\n assertThat( hasSubComponents( TRK2_WITHOT_SUB_COMP ), is( false ) );\n }", "public static void VerifyHeaderItem_CommonComponent_Div_Div2_P(String renderingControl){\t\t\t\t\n\t\ttry{\n\t\t\tactualHeaderText=sitecoreObj.aboutusCommonComponent_Div_Div2_P.isDisplayed();\n\t\t\tAssert.assertEquals(actualHeaderText, true);\n\t\t\tlog.info(\"The Actual AboutUs \" + renderingControl + \" Description - <\"+sitecoreObj.aboutusCommonComponent_Div_Div2_P.getTagName()+\">\");\n\t\t\tlog.info(\"The Expected AboutUs \" + renderingControl + \" Description - <p>\");\t\n\t\t\tlog.info(\"TEST PASSED: The Actual and Expected AboutUs \" + renderingControl + \" Description are Same\");\n\t\t}catch(AssertionError e){\n\t\t\tlog.error(\"The Actual AboutUs \" + renderingControl + \" Description - <\"+sitecoreObj.aboutusCommonComponent_Div_Div2_P.getTagName()+\">\");\n\t\t\tlog.error(\"The Expected AboutUs \" + renderingControl + \" Description - <p>\");\t\t\t\t\t\t\n\t\t\tlog.error(\"TEST FAILED: The Actual and Expected AboutUs \" + renderingControl + \" Description are NOT same\");\n\t\t}catch(org.openqa.selenium.NoSuchElementException e){\n\t\t\tlog.error(\"TEST FAILED: There is No Description On \" + renderingControl + \" element\");\n\t\t}\n\t}", "@Test\n public void checkEcritureComptableUnit() throws Exception {\n initClassUnderTestDaoMock();\n SequenceEcritureComptable testSEC = new SequenceEcritureComptable();\n testSEC.setDerniereValeur(1);\n when(daoProxy.getComptabiliteDao().getSequenceEcritureComptable(any(), any()))\n .thenReturn(testSEC);\n\n vEcritureComptable.setJournal(new JournalComptable(\"AC\", \"Achat\"));\n vEcritureComptable.setDate(new Date());\n vEcritureComptable.setLibelle(\"Libelle\");\n vEcritureComptable.setReference(\"AC-2020/00001\");\n vEcritureComptable.getListLigneEcriture().add(new LigneEcritureComptable(new CompteComptable(1),\n null, new BigDecimal(123),\n null));\n vEcritureComptable.getListLigneEcriture().add(new LigneEcritureComptable(new CompteComptable(2),\n null, null,\n new BigDecimal(123)));\n\n classUnderTest.checkEcritureComptableUnit(vEcritureComptable);\n }", "public MockAggregateEvent(List<QuoteEvent> inCompositeEvents)\n {\n this(new Date(),\n new Equity(\"METC\"));\n compositeEvents.addAll(inCompositeEvents);\n }", "public static void VerifyCommonComponent_2DIVs_H3(String renderingControl){\n\t\tboolean actualFiveColumnContentTitle = false;\n\t\ttry{\n\t\t\tactualFiveColumnContentTitle=sitecoreObj.aboutusCommonComponent_2DIVs_H3.isDisplayed();\n\t\t\tAssert.assertEquals(actualFiveColumnContentTitle, true);\n\t\t\tlog.info(\"The Actual AboutUs \" + renderingControl + \" ContentTitle - <\"+sitecoreObj.aboutusCommonComponent_2DIVs_H3.getTagName()+\">\");\n\t\t\tlog.info(\"The Expected AboutUs \" + renderingControl + \" ContentTitle - <h3>\");\n\t\t\tlog.info(\"TEST PASSED: The Actual and Expected AboutUs \" + renderingControl + \" ContentTitle are Same\");\n\t\t}catch(AssertionError e){\n\t\t\tlog.error(\"The Actual AboutUs \" + renderingControl + \" ContentTitle - <\"+sitecoreObj.aboutusCommonComponent_2DIVs_H3.getTagName() +\">\");\n\t\t\tlog.error(\"The Expected AboutUs \" + renderingControl + \" ContentTitle - <h3>\");\n\t\t\tlog.error(\"TEST FAILED: The Actual and Expected AboutUs \" + renderingControl + \" ContentTitle are NOT same\");\n\t\t}catch(org.openqa.selenium.NoSuchElementException e){\n\t\t\tlog.error(\"TEST FAILED: There is No ContentTitle element On \" + renderingControl + \" Container\");\n\t\t}\t\t\n\t}", "@org.junit.Test\n public void constrCompelemCompname2() {\n final XQuery query = new XQuery(\n \"element {'one', 'two'} {'text'}\",\n ctx);\n try {\n result = new QT3Result(query.value());\n } catch(final Throwable trw) {\n result = new QT3Result(trw);\n } finally {\n query.close();\n }\n test(\n error(\"XPTY0004\")\n );\n }", "private static boolean ElementTest_2(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"ElementTest_2\")) return false;\n ElementTest_2_0(b, l + 1);\n return true;\n }", "public void testAssociateStylisticElement() throws Exception {\n try {\n cfg.associateStylisticAndAntiElements(null, null, null);\n fail(\"Expected an IllegalArgumentException\");\n } catch (IllegalArgumentException e) {\n }\n // code block\n {\n String[] children = null;\n createSet(children);\n cfg.associateStylisticAndAntiElements(\"a\", null, permittedChildren);\n verifyStylisticAssociations(1, 1, children);\n }\n // code block\n {\n String[] children = { \"x\" };\n createSet(children);\n cfg.associateStylisticAndAntiElements(\"a\", null, permittedChildren);\n verifyStylisticAssociations(1, 1, children);\n }\n // code block\n {\n String[] children = { \"x\", \"y\" };\n createSet(children);\n cfg.associateStylisticAndAntiElements(\"a\", null, permittedChildren);\n verifyStylisticAssociations(1, 2, children);\n }\n // code block\n {\n String[] children = { \"y\", \"zzz\" };\n createSet(children);\n String[] expectedChildren = { \"x\", \"y\", \"zzz\" };\n cfg.associateStylisticAndAntiElements(\"a\", null, permittedChildren);\n verifyStylisticAssociations(1, 3, expectedChildren);\n }\n }", "@Test\n\tpublic void testCrearEjercicio3(){\n\t\tEjercicio ej = new Ejercicio(1, true, Plataforma.getFechaActual().minusDays(3), Plataforma.getFechaActual().plusDays(2),\n\t\t\t\ttema1, \"Ejercicio1\", true, mates);\n\t\t\n\t\tassertEquals(ej.getFechaIni(), ej.getFechaIniDefecto());\n\t\tassertEquals(ej.getFechaFin(), ej.getFechaFinDefecto());\n\t\tassertTrue(tema1.getSubcontenido().contains(ej));\n\t}", "@org.junit.Test\n public void k2ComputeConElem12() {\n final XQuery query = new XQuery(\n \"declare construction strip; element e {\\\"content\\\"} instance of element(b, xs:untyped)\",\n ctx);\n try {\n result = new QT3Result(query.value());\n } catch(final Throwable trw) {\n result = new QT3Result(trw);\n } finally {\n query.close();\n }\n test(\n assertBoolean(false)\n );\n }", "public void Assert()\n\t{\n\t\tString c=driver.findElement(By.xpath(\"//a[text()='CTS']\")).getText();\n\t\t Assert.assertEquals(\"CTS\", c);\n\t}", "@Test\n public void testContainsAll_Not_Contain() {\n\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>();\n instance.add(3);\n instance.add(2);\n instance.add(1);\n instance.add(4);\n\n Collection c = Arrays.asList(1, 2, 5);\n\n boolean expResult = false;\n boolean result = instance.containsAll(c);\n assertEquals(expResult, result);\n }", "private void assertValidPointOnEC(BigInteger x, BigInteger y) {\n BigInteger ySqr = y.multiply(y);\n BigInteger xSqr = x.multiply(x);\n BigInteger xCube = xSqr.multiply(x);\n assert (ySqr == xCube.add(xSqr.multiply(COEFF_A)).add(x)) : \"not valid ec point!\";\n\n }", "@org.junit.Test\n public void k2ComputeConElem11() {\n final XQuery query = new XQuery(\n \"element e {\\\"content\\\"} instance of element(a, xs:anyType)\",\n ctx);\n try {\n result = new QT3Result(query.value());\n } catch(final Throwable trw) {\n result = new QT3Result(trw);\n } finally {\n query.close();\n }\n test(\n assertBoolean(false)\n );\n }", "@Test(expected = Exception.class)\n public void testCardSelectionIsValid_FALSE() throws Exception {\n System.out.println(\"cardSelectionIsValid not valid\");\n UnoCard cardSelection = new UnoCard(UnoCardColour.RED, UnoCardValue.TWO);\n UnoCard drawCard = new UnoCard(UnoCardColour.BLUE, UnoCardValue.ONE);\n UnoCardColour wildColour = UnoCardColour.BLUE;\n utils.cardSelectionIsValid(cardSelection, drawCard, wildColour);\n \n }", "public static void VerifyCommonComponent_4DIVs_H2(String renderingControl){\n\t\tboolean actualSideBySideCenteredTitle = false;\n\t\ttry{\n\t\t\tactualSideBySideCenteredTitle=sitecoreObj.aboutusCommonComponent_4DIVs_H2.isDisplayed();\n\t\t\tAssert.assertEquals(actualSideBySideCenteredTitle, true);\n\t\t\tlog.info(\"The Actual AboutUs \" + renderingControl + \" Title - <\"+sitecoreObj.aboutusCommonComponent_4DIVs_H2.getTagName()+\">\");\n\t\t\tlog.info(\"The Expected AboutUs \" + renderingControl + \" Title - <h2>\");\n\t\t\tlog.info(\"TEST PASSED: The Actual and Expected AboutUs \" + renderingControl + \" Titles are Same\");\n\t\t}catch(AssertionError e){\n\t\t\tlog.error(\"The Actual AboutUs \" + renderingControl + \" Title - <\"+sitecoreObj.aboutusCommonComponent_4DIVs_H2.getTagName()+\">\");\n\t\t\tlog.error(\"The Expected AboutUs \" + renderingControl + \" Title - <h2>\");\n\t\t\tlog.error(\"TEST FAILED: The Actual and Expected AboutUs \" + renderingControl + \" Titles are NOT same\");\n\t\t}catch(org.openqa.selenium.NoSuchElementException e){\n\t\t\tlog.error(\"TEST FAILED: There is No Title element On \" + renderingControl + \" Container\");\n\t\t}\t\t\n\t}", "@Test\n public void testContainsAll_Contains_Overflow() {\n\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>(2, 2);\n instance.add(3);\n instance.add(2);\n instance.add(1);\n instance.add(4);\n instance.add(5);\n instance.add(4);\n instance.add(7);\n\n Collection c = Arrays.asList(3, 4, 5, 7);\n\n boolean expResult = true;\n boolean result = instance.containsAll(c);\n assertEquals(expResult, result);\n }", "@Test\r\n\tpublic void testContainsSubject() {\r\n\t\tassertTrue(teachu1.containsSubject(sub1));\r\n\t\tassertFalse(teachu1.containsSubject(sub2));\r\n\t}", "@Test\n public void testFindEntity_Event_Job() throws Exception {\n Person p = Manager.getPersonCollection().findEntity(1);\n assertNotNull(\"Bad test data?\", p);\n List<Allocation> pa = p.getAllocationList();\n assertFalse(\"Bad test data?\", pa.isEmpty());\n Allocation a = pa.get(0);\n Event e = a.getEvent();\n assertNotNull(\"Bad test data?\", e);\n Job j = a.getJob();\n assertNotNull(\"Bad test data?\", j);\n\n // Here is the statement that we want to test:\n Allocation result = Manager.getAllocationCollection().findEntity(e, j);\n assertNotNull(result);\n assertTrue(Objects.equals(result, a));\n }", "@Test\n public void z_topDown_TC01() {\n try {\n Intrebare intrebare = appService.addNewIntrebare(\"Enunt?\", \"1) Raspuns1\", \"2) Raspuns2\", \"3) Raspuns3\",\n \"1\", \"M\");\n Intrebare intrebare1 = appService.addNewIntrebare(\"Enunt?\", \"1) Raspuns1\", \"2) Raspuns2\", \"3) Raspuns3\",\n \"1\", \"A\");\n Intrebare intrebare2 = appService.addNewIntrebare(\"Enunt?\", \"1) Raspuns1\", \"2) Raspuns2\", \"3) Raspuns3\",\n \"1\", \"B\");\n assertTrue(true);\n assertTrue(appService.exists(intrebare));\n assertTrue(appService.exists(intrebare1));\n assertTrue(appService.exists(intrebare2));\n } catch (DuplicateIntrebareException | IntrebareValidatorFailedException e) {\n e.printStackTrace();\n assertTrue(false);\n }\n }", "public void testConstructorIAE2() {\r\n try {\r\n new SimpleCreditCardValidator(\"\", new ValidationLUHN());\r\n fail(\"an IAE is expected\");\r\n }\r\n catch (IllegalArgumentException npe) {\r\n //pass\r\n }\r\n }", "@Test\n\tpublic void testElementAddedEvent() {\n\t\tfinal DiagramElement newElement = new DiagramElement(diagram, 1, dummyBoh,\n\t\t\t\tnew RelativeBusinessObjectReference(\"1\"));\n\t\tdiagram.modify(\"Add Element\", m -> m.addElement(newElement));\n\n\t\tassertThat(ml.elementAddedEventsReceived, is(equalTo(1)));\n\t\tassertThat(ml.modificationsCompletedEventsReceived, is(equalTo(1)));\n\t\tassertThat(ml.getTotalEventsReceived(), is(equalTo(2)));\n\t}", "@Test\n public void addTest(){\n \n Assert.assertTrue(p1.getName().equals(\"banana\"));\n Assert.assertTrue(c1.getEmail().equals(\"[email protected]\"));\n \n }", "public static void VerifyCommonComponent_3DIVs_P(String renderingControl){\n\t\tboolean actualSideBySideText = false;\n\t\ttry{\n\t\t\tactualSideBySideText=sitecoreObj.aboutusCommonComponent_3DIVs_P.isDisplayed();\n\t\t\tAssert.assertEquals(actualSideBySideText, true);\n\t\t\tlog.info(\"The Actual AboutUs \" + renderingControl + \" Text - <\"+sitecoreObj.aboutusCommonComponent_3DIVs_P.getTagName()+\">\");\n\t\t\tlog.info(\"The Expected AboutUs \" + renderingControl + \" Text - <p>\");\n\t\t\tlog.info(\"TEST PASSED: The Actual and Expected AboutUs \" + renderingControl + \" Texts are Same\");\n\t\t}catch(AssertionError e){\n\t\t\tlog.error(\"The Actual AboutUs \" + renderingControl + \" Text - <\"+sitecoreObj.aboutusCommonComponent_3DIVs_P.getTagName()+\">\");\n\t\t\tlog.error(\"The Expected AboutUs \" + renderingControl + \" Text - <p>\");\n\t\t\tlog.error(\"TEST FAILED: The Actual and Expected AboutUs \" + renderingControl + \" Texts are NOT same\");\n\t\t}catch(org.openqa.selenium.NoSuchElementException e){\n\t\t\tlog.error(\"TEST FAILED: There is No Text element On \" + renderingControl + \" Container\");\n\t\t}\t\t\n\t}" ]
[ "0.7955315", "0.77752924", "0.77708125", "0.75277567", "0.6392244", "0.570922", "0.56801045", "0.56785953", "0.5563103", "0.5466157", "0.5407627", "0.53928924", "0.5359151", "0.5325736", "0.5306758", "0.5270361", "0.52497417", "0.5226432", "0.51550776", "0.5117844", "0.51029265", "0.5095735", "0.5093369", "0.50715464", "0.5053562", "0.5038797", "0.50280195", "0.4995266", "0.49798313", "0.49757868", "0.4965528", "0.4958122", "0.49499598", "0.49389404", "0.4926532", "0.49150062", "0.49107212", "0.4899737", "0.48934153", "0.48930344", "0.48902076", "0.48871216", "0.48871216", "0.48774192", "0.48770803", "0.48645407", "0.4846211", "0.48353738", "0.4834233", "0.48338628", "0.4824935", "0.48156333", "0.48103213", "0.48082748", "0.4805788", "0.47844562", "0.4784263", "0.47823343", "0.4779123", "0.47754365", "0.47716922", "0.4769743", "0.47637993", "0.4763074", "0.47570857", "0.4754351", "0.47509867", "0.47508577", "0.47494978", "0.47487876", "0.47459853", "0.47406086", "0.47230238", "0.47183248", "0.47006425", "0.46991968", "0.4691571", "0.46776032", "0.46687064", "0.46658918", "0.46656978", "0.46655923", "0.46639866", "0.4663442", "0.4663378", "0.46548438", "0.46536955", "0.464386", "0.4642625", "0.46394134", "0.46359685", "0.46306658", "0.46306407", "0.46268764", "0.46248338", "0.46238235", "0.46210796", "0.46195215", "0.46185046", "0.46173584" ]
0.80137074
0
Asserts that the specified Composite contains the 3 specified element and the specified EOC.
private static void assertComposite(Composite composite, ByteBuffer firstElement, ByteBuffer secondElement, ByteBuffer thirdElement, EOC eoc) { assertComposite(composite, eoc, firstElement, secondElement, thirdElement); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void assertComposite(Composite composite,\n ByteBuffer firstElement,\n ByteBuffer secondElement,\n ByteBuffer thirdElement,\n ByteBuffer fourthElement,\n EOC eoc)\n {\n assertComposite(composite, eoc, firstElement, secondElement, thirdElement, fourthElement);\n }", "private static void assertComposite(Composite composite, EOC eoc, ByteBuffer... elements)\n {\n assertEquals(\"the composite size is not the expected one:\", elements.length, composite.size());\n for (int i = 0, m = elements.length; i < m; i++)\n {\n ByteBuffer element = elements[i];\n assertTrue(String.format(\"the element %s of the composite is not the expected one: expected %s but was %s\",\n i,\n ByteBufferUtil.toInt(element),\n ByteBufferUtil.toInt(composite.get(i))),\n element.equals(composite.get(i)));\n }\n assertEquals(\"the EOC of the composite is not the expected one:\", eoc, composite.eoc());\n }", "private static void assertComposite(Composite composite, ByteBuffer firstElement, ByteBuffer secondElement, EOC eoc)\n {\n assertComposite(composite, eoc, firstElement, secondElement);\n }", "private static void assertComposite(Composite composite, ByteBuffer element, EOC eoc)\n {\n assertComposite(composite, eoc, element);\n }", "@Test\r\n public void testComposite() {\r\n \r\n Leaf pers1 = new Leaf(\"Tracy\");\r\n Leaf pers2 = new Leaf(\"JR\");\r\n Leaf pers3 = new Leaf(\"Simon\");\r\n \r\n Composite comp1 = new Composite();\r\n comp1.add(pers1);\r\n comp1.add(pers2);\r\n comp1.add(pers3);\r\n \r\n //Assert.assertEquals(pers1.sayHello(), \"Tracy person says hello\");\r\n Assert.assertNotNull(comp1);\r\n \r\n \r\n }", "@Test\n public void extraElements() {\n assertEmpty(mReactor.getCompounds(getElements(\"Start\", \"A\", \"Fin\", \"Start\")));\n // Each reaction producing a compound should be detected separately.\n assertEmpty(mReactor.getCompounds(getElements(\"Start\", \"A\", \"Fin\", \"Start\", \"A\", \"Fin\")));\n }", "private static void assertEmptyComposite(Composite composite)\n {\n assertEquals(Composites.EMPTY, composite);\n }", "@Test\n void contains() {\n Cuboid cuboid1 = new Cuboid(4, 4, 4);\n Point3D point1 = new Point3D(0,0,0);\n assertEquals(true, cuboid1.contains(point1));\n\n Point3D point2 = new Point3D(0,0,2);\n assertEquals(true, cuboid1.contains(point2));\n\n Point3D point3 = new Point3D(0,0,-2);\n assertEquals(true, cuboid1.contains(point3));\n\n Point3D point4 = new Point3D(0,2,0);\n assertEquals(true, cuboid1.contains(point4));\n\n Point3D point5 = new Point3D(0,-2,0);\n assertEquals(true, cuboid1.contains(point5));\n\n Point3D point6 = new Point3D(2,0,0);\n assertEquals(true, cuboid1.contains(point6));\n\n Point3D point7 = new Point3D(-2,0,0);\n assertEquals(true, cuboid1.contains(point7));\n\n Point3D point8 = new Point3D(-2,-2,-2);\n assertEquals(true, cuboid1.contains(point8));\n\n Point3D point9 = new Point3D(-2,-2,-3);\n assertEquals(false, cuboid1.contains(point9));\n\n\n //Arbitary orientation\n Cuboid cuboid2 = new Cuboid(4, 5, 7, new Ray(new Point3D(-2,-2,-2), new Vector3D(1,1,1)));\n Point3D point21 = new Point3D(-1,-1,-1);\n assertEquals(true, cuboid2.contains(point21));\n\n Cuboid cuboid3 = new Cuboid(4, 5, 6, new Ray(new Point3D(-2,-2,-2), new Vector3D(1,1,1)));\n Point3D point31 = new Point3D(0,0,0);\n assertEquals(false, cuboid3.contains(point31));\n\n Cuboid cuboid4 = new Cuboid(4, 5, 6, new Ray(new Point3D(0,0,0), new Vector3D(1,1,1)));\n Point3D point41 = new Point3D(2.5,2.5,2.5);\n assertEquals(false, cuboid4.contains(point41));\n\n Cuboid cuboid5 = new Cuboid(4, 5, 6, new Ray(new Point3D(-2,-2,-2), new Vector3D(0,0,1)));\n Point3D point51 = new Point3D(-2,-2,3.5);\n assertEquals(false, cuboid5.contains(point51));\n }", "@Test (expected=AjoutException.class)\n\tpublic void test1E() {\n\t\tConvoi c = new Convoi\t\n\t\t\t\t.Builder(\"vehicules\", \"Paris\")\n\t\t\t\t.build();\n\t\tConvoi c2 = new Convoi\t\n\t\t\t\t.Builder(\"camions\", \"Paris\")\n\t\t\t\t.build();\n\t\tc.add(c2);\n\t\tc2.add(c);\n\t}", "@Test\n\tpublic void moreComplexAssertion() {\n\t\tOrder order1 = null, order2 = null, order3 = null, order4 = null;\n\t\t// when\n\t\tList<Order> orders = null;// orderSearchService.getOrders(trader,\n\t\t\t\t\t\t\t\t\t// tradingAcct, goldIsinCode);\n\t\t// then\n\t\t// Using Basic JUnit\n\t\tassertEquals(orders.size(), 2);\n\t\tIterator<Order> itr = orders.iterator();\n\t\tassertEquals(itr.next(), order3);\n\t\tassertEquals(itr.next(), order4);\n\t\t// Using Hamcrest\n\t\tassertThat(orders, hasItems(order3, order4));\n\t\tassertThat(orders.size(), is(2));\n\t\t// Using FEST Assertions\n\t\tassertThat(orders).containsOnly(order3, order4);\n\t\t// Using FEST Assertions (chained assertions)\n\t\tassertThat(orders).containsOnly(order3, order4).containsSequence(order3, order4);\n\t}", "public void testAddIndivisibleElementsThatPermitStyles() throws Exception {\n String[] elements = { \"a\", \"b\", \"c\" };\n cfg.addIndivisibleElementsThatPermitStyles(elements);\n\n String[] moreElements = { \"c\", \"d\" };\n cfg.addIndivisibleElementsThatPermitStyles(moreElements);\n\n Set set = (Set)PrivateAccessor.getField(\n cfg, \"indivisibleElementsThatPermitStyles\");\n assertEquals(\"Should have added and merged all elements:\",\n 6, set.size());\n\n for (int i = 0; i < elements.length; i++) {\n assertTrue(\"Should be in list: \", set.contains(elements[i]));\n }\n for (int i = 0; i < moreElements.length; i++) {\n assertTrue(\"Should be in list: \", set.contains(moreElements[i]));\n }\n }", "@Test\r\n public void testCommissionCases() throws Exception\r\n {\r\n String epcToCheck = \"urn:epc:id:sgtin:0614141.107340.1\";\r\n XmlObjectEventType event = dbHelper.getObjectEventByEpc(epcToCheck);\r\n Assert.assertNull(event);\r\n\r\n runCaptureTest(COMMISSION_CASES_XML);\r\n\r\n event = dbHelper.getObjectEventByEpc(epcToCheck);\r\n Assert.assertNotNull(event);\r\n }", "@Test\n public void testACFTHasSubComponents() {\n assertThat( hasSubComponents( ACFT ), is( true ) );\n }", "@org.junit.Test\n public void k2ComputeConElem3() {\n final XQuery query = new XQuery(\n \"<elem>{<e/>, <b></b>, \\\"\\\", \\\"\\\"}</elem>\",\n ctx);\n try {\n result = new QT3Result(query.value());\n } catch(final Throwable trw) {\n result = new QT3Result(trw);\n } finally {\n query.close();\n }\n test(\n assertSerialization(\"<elem><e/><b/> </elem>\", false)\n );\n }", "@Test\n public void testTRK1HasSubComponents() {\n assertThat( hasSubComponents( TRK1_WITH_SUB_COMP ), is( true ) );\n }", "public static void VerifyCommonComponent_3DIVs_H3(String renderingControl){\n\t\t\tboolean actualSideBySideText = false;\n\t\t\ttry{\n\t\t\t\tactualSideBySideText=sitecoreObj.aboutusCommonComponent_3DIVs_H3.isDisplayed();\n\t\t\t\tAssert.assertEquals(actualSideBySideText, true);\n\t\t\t\tlog.info(\"The Actual AboutUs \" + renderingControl + \" Text - <\"+sitecoreObj.aboutusCommonComponent_3DIVs_H3.getTagName()+\">\");\n\t\t\t\tlog.info(\"The Expected AboutUs \" + renderingControl + \" Text - <h3>\");\n\t\t\t\tlog.info(\"TEST PASSED: The Actual and Expected AboutUs \" + renderingControl + \" Texts are Same\");\n\t\t\t}catch(AssertionError e){\n\t\t\t\tlog.error(\"The Actual AboutUs \" + renderingControl + \" Text - <\"+sitecoreObj.aboutusCommonComponent_3DIVs_H3.getTagName()+\">\");\n\t\t\t\tlog.error(\"The Expected AboutUs \" + renderingControl + \" Text - <h3>\");\n\t\t\t\tlog.error(\"TEST FAILED: The Actual and Expected AboutUs \" + renderingControl + \" Texts are NOT same\");\n\t\t\t}catch(org.openqa.selenium.NoSuchElementException e){\n\t\t\t\tlog.error(\"TEST FAILED: There is No Text element On \" + renderingControl + \" Container\");\n\t\t\t}\t\t\n\t\t}", "public void testAddDivisibleElementsThatPermitStyles() throws Exception {\n String[] elements = { \"a\", \"b\", \"c\" };\n cfg.addDivisibleElementsThatPermitStyles(elements);\n\n String[] moreElements = { \"c\", \"d\" };\n cfg.addDivisibleElementsThatPermitStyles(moreElements);\n\n Set set = (Set)PrivateAccessor.getField(\n cfg, \"divisibleElementsThatPermitStyles\");\n assertEquals(\"Should have added and merged all elements:\",\n 4, set.size());\n\n for (int i = 0; i < elements.length; i++) {\n assertTrue(\"Should be in list: \", set.contains(elements[i]));\n }\n for (int i = 0; i < moreElements.length; i++) {\n assertTrue(\"Should be in list: \", set.contains(moreElements[i]));\n }\n }", "@org.junit.Test\n public void k2ComputeConElem13() {\n final XQuery query = new XQuery(\n \"element e {element b{()}}\",\n ctx);\n try {\n result = new QT3Result(query.value());\n } catch(final Throwable trw) {\n result = new QT3Result(trw);\n } finally {\n query.close();\n }\n test(\n assertSerialization(\"<e><b/></e>\", false)\n );\n }", "@Test\n public void handleCompositeCommand1() {\n }", "private List<String> validateComposingElements(\n\t\t\tChemicalAssociationBean assocBean, List<String> msgs) {\n\t\t String compTypeA = assocBean.getAssociatedElementA().getCompositionType();\n\t\t String compTypeB = assocBean.getAssociatedElementB().getCompositionType();\n\t\t\t\n\t\t if((compTypeA!=null)&&(compTypeA.equalsIgnoreCase(\"nanomaterial entity\"))&&(assocBean.getAssociatedElementA().getEntityDisplayName()!=null)){\n\t\t\t\tif(assocBean.getAssociatedElementA().getComposingElement().getId()==null)\n\t\t\t\t\t\tmsgs.add(\"Choosing an element on the left is required.\");\n\t\t\t}\n\t\t\tif((compTypeB!=null)&&(compTypeB.equalsIgnoreCase(\"nanomaterial entity\"))&&(assocBean.getAssociatedElementB().getEntityDisplayName()!=null)){\n\t\t\t\tif(assocBean.getAssociatedElementB().getComposingElement().getId()==null)\n\t\t\t\t\t\tmsgs.add(\"Choosing an element on the right is required.\");\n\t\t\t}\n\t\t\treturn msgs;\n\t}", "@Test\n public void processCompoundTransaction_TestC() throws Exception {\n ct = new CompoundTransaction(\"compound\");\n\n Assert.assertEquals(false, trans_mang.processCompoundTransaction(ct));\n }", "public void verify_AddSubCategoriesPage_DisplayedElements() {\n\n\t\tboolean bstatus;\n\n\t\tbstatus = isElementDisplayed(select_mainCategory, true);\n\t\tReporter.log(bstatus, \"Main Category drop displayed \", \"Main Category drop down not displayed\");\n\n\t\tbstatus = isElementDisplayed(edit_SubCategory, true);\n\t\tReporter.log(bstatus, \"Sub Category text field displayed\", \"Sub Category text field not displayed\");\n\n\t\tbstatus = isElementDisplayed(select_AssignedOrder, true);\n\t\tReporter.log(bstatus, \"Assigned order drop down displayed\", \"Assigned order drop down not displayed\");\n\n\t\tbstatus = isElementDisplayed(btn_Submit, true);\n\t\tReporter.log(bstatus, \"Submit button displayed\", \"Submit button not displayed\");\n\n\t}", "@Test\n public void testContainsAll_Contains() {\n\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>();\n instance.add(3);\n instance.add(2);\n instance.add(1);\n instance.add(4);\n\n Collection c = Arrays.asList(1, 2, 3);\n\n boolean expResult = true;\n boolean result = instance.containsAll(c);\n assertEquals(expResult, result);\n }", "@Test\r\n public void testCommissionPallets() throws Exception\r\n {\r\n String epcToCheck = \"urn:epc:id:sscc:0614141.0000000001\";\r\n XmlObjectEventType event = dbHelper.getObjectEventByEpc(epcToCheck);\r\n Assert.assertNull(event);\r\n\r\n runCaptureTest(COMMISSION_PALLETS_XML);\r\n\r\n event = dbHelper.getObjectEventByEpc(epcToCheck);\r\n Assert.assertNotNull(event);\r\n }", "@Test\n\tpublic void testCrearEjercicio3(){\n\t\tEjercicio ej = new Ejercicio(1, true, Plataforma.getFechaActual().minusDays(3), Plataforma.getFechaActual().plusDays(2),\n\t\t\t\ttema1, \"Ejercicio1\", true, mates);\n\t\t\n\t\tassertEquals(ej.getFechaIni(), ej.getFechaIniDefecto());\n\t\tassertEquals(ej.getFechaFin(), ej.getFechaFinDefecto());\n\t\tassertTrue(tema1.getSubcontenido().contains(ej));\n\t}", "@Test\r\n public void testINFR1184() throws Exception {\r\n // create OU A\r\n Document ouAdoc = getDocument(createSuccessfully(\"escidoc_ou_create.xml\"));\r\n String ouAid = getObjidValue(ouAdoc);\r\n\r\n // create OU B\r\n Document ouBdoc = getDocument(createSuccessfully(\"escidoc_ou_create.xml\"));\r\n String ouBid = getObjidValue(ouBdoc);\r\n\r\n // create OU C\r\n Document ouCdoc = getDocument(createSuccessfully(\"escidoc_ou_create.xml\"));\r\n String ouCid = getObjidValue(ouCdoc);\r\n\r\n // A parentOf B\r\n String srelPrefix = determineSrelNamespacePrefix(ouBdoc);\r\n String xlinkPrefix = determineXlinkNamespacePrefix(ouBdoc);\r\n Node parents = selectSingleNode(ouBdoc, XPATH_ORGANIZATIONAL_UNIT_PARENTS);\r\n Element parent =\r\n ouBdoc.createElementNS(\"http://escidoc.de/core/01/structural-relations/\", srelPrefix + \":parent\");\r\n parent.setAttribute(xlinkPrefix + \":href\", \"/oum/organizational-unit/\" + ouAid);\r\n parents.appendChild(parent);\r\n ouBdoc = getDocument(update(ouBid, toString(ouBdoc, true)));\r\n\r\n // B parentOf C\r\n srelPrefix = determineSrelNamespacePrefix(ouCdoc);\r\n xlinkPrefix = determineXlinkNamespacePrefix(ouCdoc);\r\n parents = selectSingleNode(ouCdoc, XPATH_ORGANIZATIONAL_UNIT_PARENTS);\r\n parent = ouCdoc.createElementNS(\"http://escidoc.de/core/01/structural-relations/\", srelPrefix + \":parent\");\r\n parent.setAttribute(xlinkPrefix + \":href\", \"/oum/organizational-unit/\" + ouBid);\r\n parents.appendChild(parent);\r\n ouCdoc = getDocument(update(ouCid, toString(ouCdoc, true)));\r\n\r\n // A parentOf C\r\n srelPrefix = determineSrelNamespacePrefix(ouCdoc);\r\n xlinkPrefix = determineXlinkNamespacePrefix(ouCdoc);\r\n parents = selectSingleNode(ouCdoc, XPATH_ORGANIZATIONAL_UNIT_PARENTS);\r\n parent = (Element) selectSingleNode(parents, XPATH_ORGANIZATIONAL_UNIT_PARENT);\r\n parent.setAttribute(xlinkPrefix + \":href\", \"/oum/organizational-unit/\" + ouAid);\r\n ouCdoc = getDocument(update(ouCid, toString(ouCdoc, true)));\r\n }", "@Test \n\t@DisplayName(\"combinacion[i] == null || (combinacionSecreta[i] == null\")\n\tvoid elementoDeCombinacionNoEsCasilla1Test(){ \n\t\tCombinacion combinacionFacil = new Combinacion(dificultadFacil);\n\t\tCombinacion combinacionSecretaFacil = new Combinacion(dificultadFacil);\n\t\tCombinacion combinacionGanaFacil = new Combinacion(dificultadFacil);\n\t\t\n\t\tcombinacionFacil.anadirCasilla(new Casilla(Color.FONDO_ROJOCLARO));\n\t\tcombinacionFacil.anadirCasilla(new Casilla(Color.FONDO_AZUL));\n\t\tcombinacionFacil.anadirCasilla(null);\n\t\tcombinacionFacil.anadirCasilla(new Casilla(Color.FONDO_AMARILLOCLARO));\n\t\t\n\t\tcombinacionSecretaFacil.anadirCasilla(new Casilla(Color.FONDO_ROJOCLARO));\n\t\tcombinacionSecretaFacil.anadirCasilla(new Casilla(Color.FONDO_AMARILLOCLARO));\n\t\tcombinacionSecretaFacil.anadirCasilla(new Casilla(Color.FONDO_MORADOCLARO));\n\t\tcombinacionSecretaFacil.anadirCasilla(new Casilla(Color.FONDO_AZUL));\n\t\n\t\tcombinacionGanaFacil.anadirCasilla(new Casilla(Color.FONDO_ROJOCLARO));\n\t\tcombinacionGanaFacil.anadirCasilla(new Casilla(Color.FONDO_BLANCO));\n\t\tcombinacionGanaFacil.anadirCasilla(new Casilla(Color.FONDO_BLANCO));\n\t\tcombinacionGanaFacil.anadirCasilla(new Casilla(Color.FONDO_NEGRO));\n\t\t\n\t\tAssert.assertEquals(combinacionGanaFacil, combinacionFacil.calcularResultado(combinacionSecretaFacil));\n\t}", "public static void VerifyCommonComponent_3DIVs_P(String renderingControl){\n\t\tboolean actualSideBySideText = false;\n\t\ttry{\n\t\t\tactualSideBySideText=sitecoreObj.aboutusCommonComponent_3DIVs_P.isDisplayed();\n\t\t\tAssert.assertEquals(actualSideBySideText, true);\n\t\t\tlog.info(\"The Actual AboutUs \" + renderingControl + \" Text - <\"+sitecoreObj.aboutusCommonComponent_3DIVs_P.getTagName()+\">\");\n\t\t\tlog.info(\"The Expected AboutUs \" + renderingControl + \" Text - <p>\");\n\t\t\tlog.info(\"TEST PASSED: The Actual and Expected AboutUs \" + renderingControl + \" Texts are Same\");\n\t\t}catch(AssertionError e){\n\t\t\tlog.error(\"The Actual AboutUs \" + renderingControl + \" Text - <\"+sitecoreObj.aboutusCommonComponent_3DIVs_P.getTagName()+\">\");\n\t\t\tlog.error(\"The Expected AboutUs \" + renderingControl + \" Text - <p>\");\n\t\t\tlog.error(\"TEST FAILED: The Actual and Expected AboutUs \" + renderingControl + \" Texts are NOT same\");\n\t\t}catch(org.openqa.selenium.NoSuchElementException e){\n\t\t\tlog.error(\"TEST FAILED: There is No Text element On \" + renderingControl + \" Container\");\n\t\t}\t\t\n\t}", "@Rollback\n @Test\n public void getAllCreditOperationsByCreditFamilyId() {\n expectedCollection.add(creditOperationFamilyExpected);\n\n //AssertUtils.assertCreditOperationsCollections(expectedCollection, actualCollection);\n }", "public void testIsIndivisibleElement() throws Exception {\n assertTrue(cfg.isIndivisibleElement(\"test\"));\n assertTrue(cfg.isIndivisibleElement(\"d1\"));\n assertTrue(cfg.isIndivisibleElement(\"ind1\"));\n assertTrue(cfg.isIndivisibleElement(\"ind2\"));\n\n cfg.associateStylisticAndAntiElements(\"anti-test\", \"test\",\n permittedChildren);\n cfg.addDivisibleElementsThatPermitStyles(new String[] {\"d1\"});\n cfg.addIndivisibleElementsThatPermitStyles(new String[] {\"ind1\", \"ind2\"});\n\n assertTrue(cfg.isIndivisibleElement(\"ind1\"));\n assertTrue(cfg.isIndivisibleElement(\"ind2\"));\n assertTrue(cfg.isIndivisibleElement(\"not-in-any-set\"));\n assertTrue(cfg.isIndivisibleElement(\"child\"));\n assertTrue(cfg.isIndivisibleElement(\"TEST\"));\n assertTrue(cfg.isIndivisibleElement(\"D1\"));\n\n assertFalse(cfg.isIndivisibleElement(\"test\"));\n assertFalse(cfg.isIndivisibleElement(\"d1\"));\n assertFalse(cfg.isIndivisibleElement(\"anti-test\"));\n }", "@Test\n public void testIsComposite() {\n Tag tag = new BaseTag();\n assertFalse(\"BaseTag reported as composite\", tag.isComposite());\n }", "@Test\n public void testASSY2HasSubComponents() {\n assertThat( hasSubComponents( ASSY2_WITH_SUB_COMP ), is( true ) );\n }", "public static void VerifyCommonComponent_2DIVs_H3(String renderingControl){\n\t\tboolean actualFiveColumnContentTitle = false;\n\t\ttry{\n\t\t\tactualFiveColumnContentTitle=sitecoreObj.aboutusCommonComponent_2DIVs_H3.isDisplayed();\n\t\t\tAssert.assertEquals(actualFiveColumnContentTitle, true);\n\t\t\tlog.info(\"The Actual AboutUs \" + renderingControl + \" ContentTitle - <\"+sitecoreObj.aboutusCommonComponent_2DIVs_H3.getTagName()+\">\");\n\t\t\tlog.info(\"The Expected AboutUs \" + renderingControl + \" ContentTitle - <h3>\");\n\t\t\tlog.info(\"TEST PASSED: The Actual and Expected AboutUs \" + renderingControl + \" ContentTitle are Same\");\n\t\t}catch(AssertionError e){\n\t\t\tlog.error(\"The Actual AboutUs \" + renderingControl + \" ContentTitle - <\"+sitecoreObj.aboutusCommonComponent_2DIVs_H3.getTagName() +\">\");\n\t\t\tlog.error(\"The Expected AboutUs \" + renderingControl + \" ContentTitle - <h3>\");\n\t\t\tlog.error(\"TEST FAILED: The Actual and Expected AboutUs \" + renderingControl + \" ContentTitle are NOT same\");\n\t\t}catch(org.openqa.selenium.NoSuchElementException e){\n\t\t\tlog.error(\"TEST FAILED: There is No ContentTitle element On \" + renderingControl + \" Container\");\n\t\t}\t\t\n\t}", "public static void VerifyThreeItem_ContainerTitle(String renderControl){\n\t\tboolean actualThreeItemTitle=false;\n\t\ttry{\n\t\t\tactualThreeItemTitle=sitecoreObj.aboutusThreeItemContainerTitle.isDisplayed();\n\t\t\tAssert.assertEquals(actualThreeItemTitle, true);\n\t\t\tlog.info(\"The Actual AboutUs \" + renderControl + \" Container Header Title - <\"+sitecoreObj.aboutusThreeItemContainerTitle.getTagName()+\">\");\n\t\t\tlog.info(\"The Expected AboutUs \" + renderControl + \" Container Header Title - <h2>\");\n\t\t\tlog.info(\"TEST PASSED: The Actual and Expected AboutUs \" + renderControl + \" Container Header Title are Same\");\n\t\t}catch(AssertionError e){\n\t\t\tlog.error(\"The Actual AboutUs \" + renderControl + \" Container Header Title - <\"+sitecoreObj.aboutusThreeItemContainerTitle.getTagName()+\">\");\n\t\t\tlog.error(\"The Expected AboutUs \" + renderControl + \" Container Header Title - <h2>\");\n\t\t\tlog.error(\"TEST FAILED: The Actual and Expected AboutUs \" + renderControl + \" Container Header Title are NOT same\");\n\t\t}catch(org.openqa.selenium.NoSuchElementException e){\n\t\t\tlog.error(\"TEST FAILED: There is No Container Header Title element On \" + renderControl + \" Container\");\n\t\t}\t\t\n\t}", "@Test\n public void processCompoundTransaction_TestA() throws Exception\n {\n ct = new CompoundTransaction(\"compound\");\n\n acc_db.addAccount(acc);\n acc_db.addAccount(acc2);\n\n ct.addTransaction(new Transaction(\"atomic1\", acc_db,acc.get_Account_Number(),acc2.get_Account_Number(),10));\n\n ct.addTransaction(new Transaction(\"atomic2\",acc_db,acc.get_Account_Number(),acc2.get_Account_Number(),40));\n\n Assert.assertEquals(true, trans_mang.processCompoundTransaction(ct));\n }", "public static void VerifyThreeItem_MoreContainer(String renderControl){\n\t\tString actualMoreContainer=\"\";\n\t\ttry{\n\t\t\tactualMoreContainer=sitecoreObj.aboutusThreeItemMoreContainer.getAttribute(\"class\");\n\t\t\tAssert.assertEquals(actualMoreContainer, expectedData.getProperty(\"ThreeItemMoreContainer\"));\n\t\t\tlog.info(\"The Actual AboutUs \" + renderControl + \" MoreContainer - \"+actualMoreContainer);\n\t\t\tlog.info(\"The Expected AboutUs \" + renderControl + \" MoreContainer - \"+expectedData.getProperty(\"ThreeItemMoreContainer\"));\n\t\t\tlog.info(\"TEST PASSED: The Actual and Expected AboutUs \" + renderControl + \" MoreContainer are Same\");\n\t\t}catch(AssertionError e){\n\t\t\tlog.error(\"The Actual AboutUs \" + renderControl + \" MoreContainer - \"+actualMoreContainer);\n\t\t\tlog.error(\"The Expected AboutUs \" + renderControl + \" MoreContainer - \"+expectedData.getProperty(\"ThreeItemMoreContainer\"));\n\t\t\tlog.error(\"TEST FAILED: The Actual and Expected AboutUs \" + renderControl + \" MoreContainer are NOT same\");\n\t\t}catch(org.openqa.selenium.NoSuchElementException e){\n\t\t\tlog.error(\"TEST FAILED: There is No MoreContainer On \" + renderControl + \" Container\");\n\t\t}\n\t}", "@Test\r\n public void testContains() {\r\n System.out.println(\"contains\");\r\n ModeloListaOrganizadores instance = new ModeloListaOrganizadores(e.getListaOrganizadores());\r\n Organizador o =new Organizador(new Utilizador(\"teste\", \"[email protected]\", \"teste\", \"teste\", true, 5));\r\n instance.addElement(o);\r\n boolean expResult = true;\r\n boolean result = instance.contains(o);\r\n assertEquals(expResult, result);\r\n \r\n }", "@Test\n public void testContains_Contain() {\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>();\n instance.add(1);\n instance.add(2);\n instance.add(3);\n\n boolean expResult = true;\n boolean result = instance.contains(1);\n assertEquals(expResult, result);\n }", "private void checkProperties(Configuration compositeConfiguration)\n {\n assertTrue(\"Make sure we have loaded our key\", compositeConfiguration\n .getBoolean(\"test.boolean\"));\n assertEquals(\"I'm complex!\", compositeConfiguration\n .getProperty(\"element2.subelement.subsubelement\"));\n assertEquals(\"property in the XMLPropertiesConfiguration\", \"value1\",\n compositeConfiguration.getProperty(\"key1\"));\n }", "@Step(\"There are the following elements on Different Elements page: 4 checkboxes, 4 radios, 1 dropdown, 2 buttons\")\n public void checkElements() {\n checkboxes.shouldHaveSize(4);\n radios.shouldHaveSize(4);\n dropdown.shouldBe(Condition.exist);\n buttons.shouldHaveSize(2);\n }", "@org.junit.Test\n public void k2ComputeConElem2() {\n final XQuery query = new XQuery(\n \"<elem>{\\\"\\\", \\\"\\\", <e/>, <b></b>}</elem>\",\n ctx);\n try {\n result = new QT3Result(query.value());\n } catch(final Throwable trw) {\n result = new QT3Result(trw);\n } finally {\n query.close();\n }\n test(\n assertSerialization(\"<elem> <e/><b/></elem>\", false)\n );\n }", "@Test\n\t\tpublic void testGetElementByIdWithThreeElementsInDbReturnsSpecificElementFromDb() throws Exception{\n\t\t\n\t\t\t// GIVEN the database contains 3 elments\n\t\t\tthis.elementService.create(\n\t\t\t\t\t\"2020a.alik\",\n\t\t\t\t\t\"[email protected]\",\n\t\t\t\t\tnew ElementBoundary(\n\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\t\"name\",\n\t\t\t\t\t\t\t\"type\",\n\t\t\t\t\t\t\ttrue,\n\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\tnew User(new UserId(\"2020a.alik\",\"[email protected]\")),\n\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\tCollections.singletonMap(\"text\", \"test\")));\n\t\t\t\n\t\t\tthis.elementService.create(\n\t\t\t\t\t\"2020a.alik\",\n\t\t\t\t\t\"[email protected]\",\n\t\t\t\t\tnew ElementBoundary(\n\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\t\"name\",\n\t\t\t\t\t\t\t\"type\",\n\t\t\t\t\t\t\ttrue,\n\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\tnew User(new UserId(\"2020a.alik\",\"[email protected]\")),\n\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\tCollections.singletonMap(\"text\", \"test\")));\n\t\t\t\n\t\t\tElementBoundary e3 = this.elementService.create(\n\t\t\t\t\t\"2020a.alik\",\n\t\t\t\t\t\"[email protected]\",\n\t\t\t\t\tnew ElementBoundary(\n\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\t\"name\",\n\t\t\t\t\t\t\t\"type\",\n\t\t\t\t\t\t\ttrue,\n\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\tnew User(new UserId(\"2020a.alik\",\"[email protected]\")),\n\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\tCollections.singletonMap(\"text\", \"test\")));\n\t\t\t\n\t\t\t\n\t\t\t// WHEN we invoke GET /elements/{userDomain}/{userEmail}/{elementDomain}/{elementId} \n\t\t\tElementBoundary actual = \n\t\t\t\tthis.restTemple.getForObject(\n\t\t\t\t\tthis.baseUrl + \"/collab/elements/{userDomain}/{userEmail}/{elementDomain}/{elementId}\", \n\t\t\t\t\tElementBoundary.class ,\n\t\t\t\t\t\"2020a.alik\",\n\t\t\t\t\t\"[email protected]\",\n\t\t\t\t\te3.getElementId().getDomain(),\n\t\t\t\t\te3.getElementId().getId());\n\t\t\t\n\t\t\t\n\t\t\t// THEN the specific element with this id is returned\n\t\t\tassertThat(actual)\n\t\t\t.isNotNull()\n\t\t\t.usingRecursiveComparison()\n\t\t\t.isEqualTo(e3);\n\t\t}", "@Test\n public void test_compteAvecOperations(){\n \t\n \tCompte c = serviceCompte.rechercherCompteAvecOperations(1L);\n \tSystem.out.println(\"compte_1 : \"+c);\n \tfor(Operation op : c.getOperations()){\n \t\tSystem.out.println(\"\\t\"+op);\n \t}\n \tAssert.assertTrue(c.getOperations().size()>0);\n }", "private static void testContains(BagInterface<String> aBag, String[] tests)\n {\n System.out.println(\"\\nTesting the method contains:\");\n for (int index = 0; index < tests.length; index++)\n System.out.println(\"Does this bag contain \" + tests[index] +\n \"? \" + aBag.contains(tests[index]));\n }", "@Test\n public void testComplexCompositeDataExtractor() throws Exception {\n final String[] compositePropertyNames = new String[2];\n compositePropertyNames[0] = \"Count\";\n compositePropertyNames[1] = \"Latency\";\n\n final String[] compositePropertyDescriptions = new String[2];\n compositePropertyDescriptions[0] = \"Count of requests received for the command\";\n compositePropertyDescriptions[1] = \"Average Time Taken to process the command\";\n\n final OpenType[] compositePropertyTypes = new OpenType[2];\n compositePropertyTypes[0] = SimpleType.LONG;\n compositePropertyTypes[1] = SimpleType.FLOAT;\n\n final CompositeType compositeType =\n new CompositeType(\"Command Stats\", \"Stats for each command\",\n compositePropertyNames, compositePropertyDescriptions,\n compositePropertyTypes);\n\n final Object[] loginCompositeValues = new Object[compositePropertyNames.length];\n loginCompositeValues[0] = new Long(10);\n loginCompositeValues[1] = new Float(38.34f);\n\n final Object[] logoutCompositeValues = new Object[compositePropertyNames.length];\n logoutCompositeValues[0] = new Long(30);\n logoutCompositeValues[1] = new Float(26.09f);\n\n final Object[] capaCompositeValues = new Object[compositePropertyNames.length];\n capaCompositeValues[0] = new Long(89);\n capaCompositeValues[1] = new Float(103.09f);\n\n final String[] complexCompositePropertyNames = new String[3];\n complexCompositePropertyNames[0] = \"Login\";\n complexCompositePropertyNames[1] = \"Logout\";\n complexCompositePropertyNames[2] = \"Capability\";\n\n CompositeData[] complexDataValues = new CompositeData[complexCompositePropertyNames.length];\n complexDataValues[0] =\n new CompositeDataSupport(compositeType, compositePropertyNames, loginCompositeValues);\n complexDataValues[1] =\n new CompositeDataSupport(compositeType, compositePropertyNames, logoutCompositeValues);\n complexDataValues[2] =\n new CompositeDataSupport(compositeType, compositePropertyNames, capaCompositeValues);\n\n final OpenType[] complexCompositePropertyTypes = new OpenType[3];\n complexCompositePropertyTypes[0] = compositeType;\n complexCompositePropertyTypes[1] = compositeType;\n complexCompositePropertyTypes[2] = compositeType;\n\n final String[] complexCompositePropertyDescriptions = new String[3];\n complexCompositePropertyDescriptions[0] =\n \"Command Stats for \" + complexCompositePropertyNames[0];\n complexCompositePropertyDescriptions[1] =\n \"Command Stats for \" + complexCompositePropertyNames[1];\n complexCompositePropertyDescriptions[2] =\n \"Command Stats for \" + complexCompositePropertyNames[2];\n\n final CompositeType complexCompositeType =\n new CompositeType(\"Commands\", \"Stats for all commands\",\n complexCompositePropertyNames, complexCompositePropertyDescriptions,\n complexCompositePropertyTypes);\n\n CompositeData complexData =\n new CompositeDataSupport(complexCompositeType, complexCompositePropertyNames,\n complexDataValues);\n\n ObjectToJsonConverter jsonConverter = new ObjectToJsonConverter();\n JsonElement jsonElement = jsonConverter.extractObject(complexData);\n Assert.assertNotNull(jsonElement);\n\n JsonElement capability = jsonElement.getAsJsonObject().get(\"Capability\");\n Assert.assertNotNull(capability);\n JsonElement count = capability.getAsJsonObject().get(\"Count\");\n Assert.assertNotNull(count);\n Assert.assertEquals(count.getAsLong(), 89);\n JsonElement latency = capability.getAsJsonObject().get(\"Latency\");\n Assert.assertNotNull(latency);\n Assert.assertEquals(latency.getAsFloat(), 103.09f);\n\n JsonElement login = jsonElement.getAsJsonObject().get(\"Login\");\n Assert.assertNotNull(login);\n count = login.getAsJsonObject().get(\"Count\");\n Assert.assertNotNull(count);\n Assert.assertEquals(count.getAsLong(), 10);\n latency = login.getAsJsonObject().get(\"Latency\");\n Assert.assertNotNull(latency);\n Assert.assertEquals(latency.getAsFloat(), 38.34f);\n\n JsonElement logout = jsonElement.getAsJsonObject().get(\"Logout\");\n Assert.assertNotNull(logout);\n count = logout.getAsJsonObject().get(\"Count\");\n Assert.assertNotNull(count);\n Assert.assertEquals(count.getAsLong(), 30);\n latency = logout.getAsJsonObject().get(\"Latency\");\n Assert.assertNotNull(latency);\n Assert.assertEquals(latency.getAsFloat(), 26.09f);\n }", "@org.junit.Test\n public void constrCompelemAttr3() {\n final XQuery query = new XQuery(\n \"element elem {//west/@mark, //west/@west-attr-1}\",\n ctx);\n try {\n query.context(node(file(\"prod/AxisStep/TopMany.xml\")));\n result = new QT3Result(query.value());\n } catch(final Throwable trw) {\n result = new QT3Result(trw);\n } finally {\n query.close();\n }\n test(\n assertSerialization(\"<elem mark=\\\"w0\\\" west-attr-1=\\\"w1\\\"/>\", false)\n );\n }", "@Test\n public void testTRK3HasNoSubComponents() {\n assertThat( hasSubComponents( TRK3_WITHOT_SUB_COMP ), is( false ) );\n }", "public static void VerifyCommonComponent_4DIVs_H3(String renderingControl){\n\t\t\tboolean actualSideBySideCenteredTitle = false;\n\t\t\ttry{\n\t\t\t\tactualSideBySideCenteredTitle=sitecoreObj.aboutusCommonComponent_4DIVs_H3.isDisplayed();\n\t\t\t\tAssert.assertEquals(actualSideBySideCenteredTitle, true);\n\t\t\t\tlog.info(\"The Actual AboutUs \" + renderingControl + \" Title - <\"+sitecoreObj.aboutusCommonComponent_4DIVs_H3.getTagName()+\">\");\n\t\t\t\tlog.info(\"The Expected AboutUs \" + renderingControl + \" Title - <h2>\");\n\t\t\t\tlog.info(\"TEST PASSED: The Actual and Expected AboutUs \" + renderingControl + \" Titles are Same\");\n\t\t\t}catch(AssertionError e){\n\t\t\t\tlog.error(\"The Actual AboutUs \" + renderingControl + \" Title - <\"+sitecoreObj.aboutusCommonComponent_4DIVs_H3.getTagName()+\">\");\n\t\t\t\tlog.error(\"The Expected AboutUs \" + renderingControl + \" Title - <h2>\");\n\t\t\t\tlog.error(\"TEST FAILED: The Actual and Expected AboutUs \" + renderingControl + \" Titles are NOT same\");\n\t\t\t}catch(org.openqa.selenium.NoSuchElementException e){\n\t\t\t\tlog.error(\"TEST FAILED: There is No Title element On \" + renderingControl + \" Container\");\n\t\t\t}\t\t\n\t\t}", "@Test\n\tpublic void shouldEstablishTexbookToCourseRelationships(){\n\t\tCourse course = new Course(\"OO Languages\", \"description\"); // created course first\n\t\tcourseRepo.save(course); //saving course into course repo\n\t\tlong courseId = course.getId();\n\t\t\n\t\t\n\t\t//building owners\n\t\tTextbook book = new Textbook (\"title\", course);\n\t\ttextbookRepo.save(book);\n\t\t\n\t\t\n\t\tTextbook book2 = new Textbook(\"title two\", course);\n\t\ttextbookRepo.save(book2);\n\t\t\n\t\t\n\t\tentityManager.flush(); \n\t\tentityManager.clear();\n\t\t\n\t\t\n\t\tOptional<Course> result = courseRepo.findById(courseId);\n\t\tcourse = result.get();\n\t\t\n\t\tassertThat(course.getTextBooks(), containsInAnyOrder(book, book2));\t\n\t\t\t\t\n\t}", "public static void VerifyCommonComponent_Div_P(String renderingControl){\n\t\ttry{\n\t\t\tactualDescriptionButton=sitecoreObj.aboutusCommonComponent_Div_P.isDisplayed();\n\t\t\tAssert.assertEquals(actualDescriptionButton, true);\n\t\t\tlog.info(\"The Actual AboutUs \" + renderingControl + \" Description - <\"+sitecoreObj.aboutusCommonComponent_Div_P.getTagName()+\">\");\n\t\t\tlog.info(\"The Expected AboutUs \" + renderingControl + \" Description - <p>\");\n\t\t\tlog.info(\"TEST PASSED: The Actual and Expected AboutUs \" + renderingControl + \" Description are Same\");\n\t\t}catch(AssertionError e){\n\t\t\tlog.error(\"The Actual AboutUs \" + renderingControl + \" Description - \"+sitecoreObj.aboutusCommonComponent_Div_P.getTagName());\n\t\t\tlog.error(\"The Expected AboutUs \" + renderingControl + \" Description - <p>\");\n\t\t\tlog.error(\"TEST FAILED: The Actual and Expected AboutUs \" + renderingControl + \" Description are NOT same\");\n\t\t}catch(org.openqa.selenium.NoSuchElementException e){\n\t\t\tlog.error(\"TEST FAILED: There is No Description On \" + renderingControl + \" element\");\n\t\t}\n\t}", "@Test\n public void testContainsBorder() {\n for (final Border border : Border.values()) {\n for (final Border test : Border.values()) {\n final String[] parts = test.toString().split(\"_\");\n for (final String part : parts) {\n final Border contains = Border.valueOf(part);\n if (border.toString().contains(part) || (border == Border.ALL && contains != Border.NONE)) {\n Assert.assertTrue(border + \" should contain \" + contains, border.containsBorder(contains));\n } else {\n Assert.assertFalse(border + \" shouldn't contain \" + contains, border.containsBorder(contains));\n }\n }\n }\n }\n }", "public static boolean occlusionTest(IMultipart part, AxisAlignedBB... boxes) {\n\n return occlusionTest(part, new NormallyOccludingPart(Arrays.asList(boxes)));\n }", "@Test(priority = 5)\n\tpublic void validateContents() {\n\t\tlog = Logger.getLogger(HeroImageProducttestscripts.class);\n\t\tLogReport.getlogger();\n\t\tlogger = extent.startTest(\"Validating the content of the product\");\n\t\tHeroImageProductPageFlow.clickHeroImage(locator);\n\t\theroImg.validateDescriptionContent(locator, validate);\n\t\t;\n\t\tlog.info(\"Content validation is correct\");\n\t\tHeroImageProductPageFlow.clickProductSpecification(locator);\n\t\theroImg.validateSpecificationContent(locator, validate);\n\t\tlog.info(\"Content is present\");\n\t\tlog.info(\"Starting Sorting functionality testing\");\n\t}", "@Test\n public void ensureCompositeStateImmutabilityTest() throws InterruptedException, PluginException {\n final WritableGraph wg = graph.getWritableGraph(\"test\", true);\n wg.getSchema().newGraph(wg);\n int v0, v1, v2;\n final String v0name, v1name, v2name;\n final int nameAttr;\n final int selectedAttr;\n final Plugin copyPlugin;\n try {\n // Add three vertices\n v0 = wg.addVertex();\n wg.getSchema().newVertex(wg, v0);\n v1 = wg.addVertex();\n wg.getSchema().newVertex(wg, v1);\n v2 = wg.addVertex();\n wg.getSchema().newVertex(wg, v2);\n\n // Store the names of these vertices\n nameAttr = VisualConcept.VertexAttribute.LABEL.get(wg);\n v0name = wg.getStringValue(nameAttr, v0);\n v1name = wg.getStringValue(nameAttr, v1);\n v2name = wg.getStringValue(nameAttr, v2);\n\n // Add a transaction from v0 to v1\n final int t0_1 = wg.addTransaction(v0, v1, true);\n wg.getSchema().newTransaction(wg, t0_1);\n\n // Select v0 and v2, but not v1\n selectedAttr = VisualConcept.VertexAttribute.SELECTED.get(wg);\n wg.setBooleanValue(selectedAttr, v0, true);\n wg.setBooleanValue(selectedAttr, v2, true);\n wg.setBooleanValue(selectedAttr, v1, false);\n } finally {\n wg.commit();\n }\n\n // Make a composite from the selection, then select everything, and copy to a new graph\n copyPlugin = PluginRegistry.get(InteractiveGraphPluginRegistry.COPY_TO_NEW_GRAPH);\n PluginExecutor.startWith(InteractiveGraphPluginRegistry.CREATE_COMPOSITE_FROM_SELECTION)\n .followedBy(VisualGraphPluginRegistry.SELECT_ALL)\n .followedBy(copyPlugin)\n .executeNow(graph);\n\n final WritableGraph copyWg = ((CopyToNewGraphPlugin) copyPlugin).getCopy().getWritableGraph(\"test\", true);\n try {\n // Expand all composites\n PluginExecution.withPlugin(InteractiveGraphPluginRegistry.EXPAND_ALL_COMPOSITES).executeNow(copyWg);\n } finally {\n copyWg.commit();\n }\n\n // Now we check there has been no effect on the composite state on the original graph\n // by expanding it and then checking it is the same as the orignal graph\n final WritableGraph wg2 = graph.getWritableGraph(\"test\", true);\n try {\n // Expand all composites\n PluginExecution.withPlugin(InteractiveGraphPluginRegistry.EXPAND_ALL_COMPOSITES).executeNow(wg2);\n } finally {\n wg2.commit();\n }\n\n final ReadableGraph rg = graph.getReadableGraph();\n try {\n\n // Assert that there are three vertices all with their original names\n assertEquals(rg.getVertexCount(), 3);\n for (int i = 0; i < 3; i++) {\n final int id = rg.getVertex(i);\n final String name = rg.getStringValue(nameAttr, id);\n if (name.equals(v0name)) {\n v0 = id;\n } else if (name.equals(v1name)) {\n v1 = id;\n } else {\n v2 = id;\n }\n }\n assertEquals(rg.getStringValue(nameAttr, v0), v0name);\n assertEquals(rg.getStringValue(nameAttr, v1), v1name);\n assertEquals(rg.getStringValue(nameAttr, v2), v2name);\n\n // Assert that the two transactions exist as expected and no others\n assertEquals(rg.getTransactionCount(), 1);\n final int l0_1 = rg.getLink(v0, v1);\n assertEquals(rg.getLinkTransactionCount(l0_1), 1);\n final int t0_1 = rg.getLinkTransaction(l0_1, 0);\n assertFalse(rg.getTransactionDirection(t0_1) == Graph.FLAT);\n assertEquals(rg.getTransactionSourceVertex(t0_1), v0);\n final int l1_2 = rg.getLink(v1, v2);\n assertEquals(l1_2, Graph.NOT_FOUND);\n final int l0_2 = rg.getLink(v0, v2);\n assertEquals(l0_2, Graph.NOT_FOUND);\n } finally {\n rg.release();\n }\n }", "@Test(priority = 5, dependsOnMethods = { \"verifySubscriptionPageComponents\" }, groups = { \"Smoke\" })\n\tpublic static void verifyGridComponents() throws InterruptedException {\n\n\t\ttest = report.startTest(\"Verify Components of Grid\");\n\n//\t\t//Verify Columns of Grid\n//\t\tString columnsGrid = driver.findElement(By.xpath(xpathColumnOfgrid)).getText();\n//\t\tAssert.assertEquals(columnsGrid,\"S. noSubscription NameSubscription IdDescriptionCreated OnAction\");\n//\t\ttest.log(LogStatus.PASS, \"Column Of Grid\", \"All Column are Displaying\");\n\n\t\t// verify any row in grid is displaying or not\n\n\t\tboolean rowInGrid = driver.findElement(By.xpath(xpathRowInGrid)).getText().isEmpty();\n\t\tAssert.assertFalse(rowInGrid);\n\t\ttest.log(LogStatus.PASS, \"Row In Grid\", \"Row In Grid is displaying\");\n\n\t\t// verify Delete and Edit Buttons\n\t\tWebElement deleteButton = driver.findElement(By.className(classDeleteButton));\n\t\tAssert.assertTrue(deleteButton.isEnabled());\n\t\ttest.log(LogStatus.PASS, \"Delete Button\", \"Delete Button is displaying and Enabled\");\n\t\tWebElement editButton = driver.findElement(By.className(\"editlink\"));\n\t\tAssert.assertTrue(editButton.isEnabled());\n\t\ttest.log(LogStatus.PASS, \"Edit Button\", \"Edit Button is displaying and Enabled\");\n\t}", "@Ignore\r\n @Test\r\n public void testContainsCollection() {\r\n System.out.println(\"containsCollection\");\r\n NumberCollection nc = null;\r\n NumberCollection instance = new NumberCollection();\r\n boolean expResult = false;\r\n boolean result = instance.containsCollection(nc);\r\n assertEquals(expResult, result);\r\n \r\n }", "@org.junit.Test\n public void k2ComputeConElem9() {\n final XQuery query = new XQuery(\n \"element e {\\\"content\\\"} instance of element(*, xs:untyped)\",\n ctx);\n try {\n result = new QT3Result(query.value());\n } catch(final Throwable trw) {\n result = new QT3Result(trw);\n } finally {\n query.close();\n }\n test(\n (\n assertBoolean(false)\n ||\n assertBoolean(true)\n )\n );\n }", "public static void VerifyCommonComponent_2DIVs_P(String renderingControl){\t\t\t\t\n\t\ttry{\n\t\t\tactualHeaderText=sitecoreObj.aboutusCommonComponent_2Divs_P.isDisplayed();\n\t\t\tAssert.assertEquals(actualHeaderText, true);\n\t\t\tlog.info(\"The Actual AboutUs \" + renderingControl + \" Description - <\"+sitecoreObj.aboutusCommonComponent_2Divs_P.getTagName()+\">\");\n\t\t\tlog.info(\"The Expected AboutUs \" + renderingControl + \" Description - <p>\");\t\n\t\t\tlog.info(\"TEST PASSED: The Actual and Expected AboutUs \" + renderingControl + \" Description are Same\");\n\t\t}catch(AssertionError e){\n\t\t\tlog.error(\"The Actual AboutUs \" + renderingControl + \" Description - <\"+sitecoreObj.aboutusCommonComponent_2Divs_P.getTagName()+\">\");\n\t\t\tlog.error(\"The Expected AboutUs \" + renderingControl + \" Description - <p>\");\t\t\t\t\t\t\n\t\t\tlog.error(\"TEST FAILED: The Actual and Expected AboutUs \" + renderingControl + \" Description are NOT same\");\n\t\t}catch(org.openqa.selenium.NoSuchElementException e){\n\t\t\tlog.error(\"TEST FAILED: There is No Description On \" + renderingControl + \" element\");\n\t\t}\n\t}", "@Test\r\n\tpublic void testErabiltzaileakBaloratuDituenPelikulenZerrenda() {\n\t\tArrayList<Integer> zer = BalorazioenMatrizea.getBalorazioenMatrizea().erabiltzaileakBaloratuDituenPelikulenZerrenda(e1.getId());\r\n\t\tassertTrue(zer.size() == 3);\r\n\t\tassertTrue(zer.contains(p1.getPelikulaId()));\r\n\t\tassertTrue(zer.contains(p2.getPelikulaId()));\r\n\t\tassertTrue(zer.contains(p4.getPelikulaId()));\r\n\t\tassertFalse(zer.contains(p3.getPelikulaId()));\r\n\t\t\r\n\t\t// e2 erabiltzaileak baloratu dituen pelikulen ID-ak itzuli\r\n\t\tzer = BalorazioenMatrizea.getBalorazioenMatrizea().erabiltzaileakBaloratuDituenPelikulenZerrenda(e2.getId());\r\n\t\tassertTrue(zer.size() == 2);\r\n\t\tassertTrue(zer.contains(p2.getPelikulaId()));\r\n\t\tassertTrue(zer.contains(p3.getPelikulaId()));\r\n\t\tassertFalse(zer.contains(p1.getPelikulaId()));\r\n\t\t\r\n\t\t// e3 erabiltzaileak baloratu dituen pelikulen ID-ak itzuli\r\n\t\tzer = BalorazioenMatrizea.getBalorazioenMatrizea().erabiltzaileakBaloratuDituenPelikulenZerrenda(e3.getId());\r\n\t\tassertTrue(zer.size() == 4);\r\n\t\tassertTrue(zer.contains(p1.getPelikulaId()));\r\n\t\tassertTrue(zer.contains(p2.getPelikulaId()));\r\n\t\tassertTrue(zer.contains(p3.getPelikulaId()));\r\n\t\tassertTrue(zer.contains(p4.getPelikulaId()));\r\n\t\t\r\n\t\t// e2 erabiltzaileak baloratu dituen pelikulen ID-ak itzuli\r\n\t\tzer = BalorazioenMatrizea.getBalorazioenMatrizea().erabiltzaileakBaloratuDituenPelikulenZerrenda(e4.getId());\r\n\t\tassertTrue(zer.size() == 1);\r\n\t\tassertTrue(zer.contains(p2.getPelikulaId()));\r\n\t\tassertFalse(zer.contains(p1.getPelikulaId()));\r\n\t\t\r\n\t}", "public void testCase3(){\n\t\t\n\t\tmastercard mc1 = new mastercard(\"Mastercard\", 100);\n\t\tvisa visa1 = new visa(\"Visa\", 100);\n\t\t\n\t\tdouble mcInterest1 = mc1.simpleInterest(mc1.getBalance(), mc1.getInterestRate());\n\t\tdouble visaInterest1 = visa1.simpleInterest(visa1.getBalance(), visa1.getInterestRate());\n\t\t\n\t\t\tassertEquals(15, mcInterest1+visaInterest1, DELTA);\n\t\t\n\t\tvisa visa2 = new visa(\"Visa\", 100);\n\t\tmastercard mc2 = new mastercard(\"Mastercard\", 100);\n\t\n\t\tdouble mcInterest2 = mc2.simpleInterest(mc2.getBalance(), mc2.getInterestRate());\n\t\tdouble visaInterest2 = visa2.simpleInterest(visa2.getBalance(), visa2.getInterestRate());\n\t\t\t\n\t\tassertEquals(15, mcInterest2+visaInterest2, DELTA);\n\t}", "@Test\n public void z_topDown_TC02() {\n try {\n Intrebare intrebare = appService.addNewIntrebare(\"Enunt?\", \"1) Raspuns1\", \"2) Raspuns2\", \"3) Raspuns3\",\n \"1\", \"M\");\n Intrebare intrebare1 = appService.addNewIntrebare(\"Enunt?\", \"1) Raspuns1\", \"2) Raspuns2\", \"3) Raspuns3\",\n \"1\", \"A\");\n Intrebare intrebare2 = appService.addNewIntrebare(\"Enunt?\", \"1) Raspuns1\", \"2) Raspuns2\", \"3) Raspuns3\",\n \"1\", \"B\");\n Intrebare intrebare3 = appService.addNewIntrebare(\"Enunt?\", \"1) Raspuns1\", \"2) Raspuns2\", \"3) Raspuns3\",\n \"1\", \"C\");\n assertTrue(true);\n assertTrue(appService.exists(intrebare));\n assertTrue(appService.exists(intrebare1));\n assertTrue(appService.exists(intrebare2));\n assertTrue(appService.exists(intrebare3));\n\n try {\n ccir2082MV.evaluator.model.Test test = appService.createNewTest();\n assertTrue(test.getIntrebari().contains(intrebare));\n assertTrue(test.getIntrebari().contains(intrebare1));\n assertTrue(test.getIntrebari().contains(intrebare2));\n assertTrue(test.getIntrebari().contains(intrebare3));\n assertTrue(test.getIntrebari().size() == 5);\n } catch (NotAbleToCreateTestException e) {\n assertTrue(false);\n }\n } catch (DuplicateIntrebareException | IntrebareValidatorFailedException e) {\n e.printStackTrace();\n assertTrue(false);\n }\n }", "@Test\n\tpublic void testRicercaArticolo3() {\n\t\tArticolo l1 = new Libro(\"Titolo1\", \"Autore\", \"Genere\", \n\t\t\t\t\"Collocazione\", b1, 012345 , \"Casa Editrice\", 150);\n\t\tb1.getPossiede().add(l1);\n\t\tString ricerca = \"Titolo1\";\n\t\tArrayList<Articolo> trovati = (ArrayList<Articolo>) \n\t\t\t\tb1.ricercaArticolo(ricerca);\n\t\tassertTrue(\"La lista deve contenere l1\", trovati.contains(l1));\n\t}", "@Test\n public void test074() throws Throwable {\n ErrorPage errorPage0 = new ErrorPage();\n Checkbox checkbox0 = new Checkbox(errorPage0, \"Unspported type gien Hor dateFormt. Supported types are: Date, Clenr, Long/long .\", \"Unspported type gien Hor dateFormt. Supported types are: Date, Clenr, Long/long .\");\n ElExpression elExpression0 = checkbox0.el(\"boolean\");\n // Undeclared exception!\n try {\n Component component0 = checkbox0.h3((Object) elExpression0);\n fail(\"Expecting exception: RuntimeException\");\n \n } catch(RuntimeException e) {\n //\n // Can't add components to a component that is not an instance of IContainer.\n //\n }\n }", "@org.junit.Test\n public void constrCompelemEnclexpr1() {\n final XQuery query = new XQuery(\n \"element elem {}\",\n ctx);\n try {\n result = new QT3Result(query.value());\n } catch(final Throwable trw) {\n result = new QT3Result(trw);\n } finally {\n query.close();\n }\n test(\n assertSerialization(\"<elem/>\", false)\n );\n }", "@Test\n public void testContains_Contain_Overflow_Boundary() {\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>(2, 2);\n instance.add(1);\n instance.add(2);\n instance.add(3);\n instance.add(4);\n instance.add(5);\n instance.add(6);\n\n boolean expResult = true;\n boolean result = instance.contains(6);\n assertEquals(expResult, result);\n }", "@Test\n public void CompoundTransaction_AddTransactionTest()\n {\n ct = new CompoundTransaction(\"compound\");\n\n acc_db.addAccount(acc);\n acc_db.addAccount(acc2);\n\n ct.addTransaction(new Transaction(\"atomic1\", acc_db,acc.get_Account_Number(),acc2.get_Account_Number(),10));\n\n ct.addTransaction(new Transaction(\"atomic2\",acc_db,acc.get_Account_Number(),acc2.get_Account_Number(),40));\n\n Assert.assertEquals(2, ct.getTransaction_list().size());\n }", "@Test\r\n public void testOumCou3_rest() throws Exception {\r\n\r\n final String[] parentValues = createSuccessfully(\"escidoc_ou_create.xml\", 2);\r\n\r\n final Document toBeCreatedDocument =\r\n getTemplateAsDocument(TEMPLATE_ORGANIZATIONAL_UNIT_PATH, \"escidoc_ou_create_rest_read_only.xml\");\r\n setUniqueValue(toBeCreatedDocument, XPATH_ORGANIZATIONAL_UNIT_TITLE);\r\n insertParentsElement(toBeCreatedDocument, XPATH_ORGANIZATIONAL_UNIT_MD_RECORDS, parentValues, true);\r\n\r\n String toBeCreatedXml = toString(toBeCreatedDocument, false);\r\n\r\n String createdXml = null;\r\n try {\r\n createdXml = create(toBeCreatedXml);\r\n }\r\n catch (final Exception e) {\r\n failException(\"Creating OU with set read only values failed. \", e);\r\n }\r\n assertOrganizationalUnit(createdXml, toBeCreatedXml, startTimestamp, startTimestamp, false, false);\r\n\r\n }", "public void VerifyCartCheckout_Coupon_OrderSumamrysections(){\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- cartcheckout, coupon and Order summary should be present in checkout page\");\r\n\r\n\t\ttry{\r\n\t\t\tif(isElementPresent(locator_split(\"boxCheckoutCartCheckout\")) & isElementPresent(locator_split(\"boxCheckoutCoupon\"))\r\n\t\t\t\t\t& isElementPresent(locator_split(\"boxCheckoutOrderSummary\"))){\r\n\t\t\t\tSystem.out.println(\"cartcheckout, coupon and Order summary is present in checkout page\");\r\n\t\t\t\tReporter.log(\"PASS_MESSAGE:- cartcheckout, coupon and Order summary is present in checkout page\");\r\n\t\t\t}else{\r\n\t\t\t\tthrow new Exception(\"cartcheckout/coupon/Order summary are not present in checkout page\");\r\n\t\t\t}\r\n\t\t}catch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- cartcheckout/coupon/Order summary are not present in checkout page\");\r\n\t\t\tthrow new NoSuchElementException(\"The element with\"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"boxCheckoutCartCheckout\")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"boxCheckoutCoupon\")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"boxCheckoutOrderSummary\")\r\n\t\t\t\t\t+ \" not found\");\r\n\t\t}\r\n\r\n\t}", "@Test\r\n public void testContains() {\r\n Grocery entry1 = new Grocery(\"Mayo\", \"Dressing / Mayo\", 1, 2.99f, 1);\r\n\r\n // Test element does not exist case\r\n assertFalse(instance.contains(entry1));\r\n\r\n instance.add(entry1);\r\n\r\n // Test element exists case\r\n assertTrue(instance.contains(entry1));\r\n }", "@Test\n public void processCompoundTransaction_TestB() throws Exception {\n ct = new CompoundTransaction(\"compound\");\n\n acc_db.addAccount(acc);\n acc_db.addAccount(acc2);\n\n ct.addTransaction(new Transaction(\"atomic1\", acc_db,acc.get_Account_Number(),acc2.get_Account_Number(),10001));\n\n ct.addTransaction(new Transaction(\"atomic2\",acc_db,acc.get_Account_Number(),acc2.get_Account_Number(),40));\n\n Assert.assertEquals(false,trans_mang.processCompoundTransaction(ct));\n }", "@Test\n public final void checkEcritureComptableUnit_RG3_atLeast2LignesOneDebitOneCredit_thenTriggedFunctionalException() {\n vEcritureComptable.getListLigneEcriture().remove(1);\n vEcritureComptable.getListLigneEcriture().add(new LigneEcritureComptable(new CompteComptable(1),\n null, new BigDecimal(-123),\n null));\n\n FunctionalException functionalException = assertThrows(FunctionalException.class,\n () -> classUnderTest.checkEcritureComptableUnit(vEcritureComptable));\n assertThat(functionalException.getMessage())\n .isEqualTo(\n \"L'écriture comptable doit avoir au moins deux lignes : une ligne au débit et une ligne au crédit.\");\n }", "@org.junit.Test\n public void constrCompelemCompname10() {\n final XQuery query = new XQuery(\n \"element {'elem'} {'text'}\",\n ctx);\n try {\n result = new QT3Result(query.value());\n } catch(final Throwable trw) {\n result = new QT3Result(trw);\n } finally {\n query.close();\n }\n test(\n assertSerialization(\"<elem>text</elem>\", false)\n );\n }", "@Test\n public void testContainsAll_Not_Contain() {\n\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>();\n instance.add(3);\n instance.add(2);\n instance.add(1);\n instance.add(4);\n\n Collection c = Arrays.asList(1, 2, 5);\n\n boolean expResult = false;\n boolean result = instance.containsAll(c);\n assertEquals(expResult, result);\n }", "@Test\r\n\tpublic void testCueEpisodicMemories() {\r\n\t\tMockCueListener cueListener = new MockCueListener();\r\n\t\tworkspace.addCueListener(cueListener);\r\n\t\tcontent.addDefaultNode(node1);\r\n\t\tcontent.addDefaultNode(node2);\r\n\r\n\t\tworkspace.cueEpisodicMemories(content);\r\n\r\n\t\tNodeStructure ns = cueListener.ns;\r\n\t\tassertNotNull(ns);\r\n\t\tassertTrue(ns.containsNode(node1));\r\n\t\tassertTrue(ns.containsNode(node2));\r\n\t}", "@org.junit.Test\n public void constrCompelemAdjtext3() {\n final XQuery query = new XQuery(\n \"count((element elem {1, 2, <a/>, 3, 4, <b/>, 5, 6})/text())\",\n ctx);\n try {\n result = new QT3Result(query.value());\n } catch(final Throwable trw) {\n result = new QT3Result(trw);\n } finally {\n query.close();\n }\n test(\n assertEq(\"3\")\n );\n }", "public MockAggregateEvent(List<QuoteEvent> inCompositeEvents)\n {\n this(new Date(),\n new Equity(\"METC\"));\n compositeEvents.addAll(inCompositeEvents);\n }", "@Test\n\tpublic void testIncluye() {\n\t\tassertFalse(l.incluye(0));\n\t\t\n\t\t//Test de busqueda sobre el primer elemento\n\t\tl.agregar(0, 0);\n\t\tassertTrue(l.incluye(0));\n\t\tassertFalse(l.incluye(1));\n\t\t\n\t\t//Test con mas elementos\n\t\tl.agregar(1, 1);\n\t\tl.agregar(2, 2);\n\t\tassertTrue(l.incluye(1));\n\t\tassertFalse(l.incluye(4));\n\t\t\n\t}", "@org.junit.Test\n public void constrCompelemNested1() {\n final XQuery query = new XQuery(\n \"element elem {1, element a {2, element b {element c {}, element d {3}}, 4}}\",\n ctx);\n try {\n result = new QT3Result(query.value());\n } catch(final Throwable trw) {\n result = new QT3Result(trw);\n } finally {\n query.close();\n }\n test(\n assertSerialization(\"<elem>1<a>2<b><c/><d>3</d></b>4</a></elem>\", false)\n );\n }", "public void test3() {\n //$NON-NLS-1$\n deployBundles(\"test3\");\n IApiBaseline before = getBeforeState();\n IApiBaseline after = getAfterState();\n IApiComponent beforeApiComponent = before.getApiComponent(BUNDLE_NAME);\n //$NON-NLS-1$\n assertNotNull(\"no api component\", beforeApiComponent);\n IApiComponent afterApiComponent = after.getApiComponent(BUNDLE_NAME);\n //$NON-NLS-1$\n assertNotNull(\"no api component\", afterApiComponent);\n IDelta delta = ApiComparator.compare(beforeApiComponent, afterApiComponent, before, after, VisibilityModifiers.ALL_VISIBILITIES, null);\n //$NON-NLS-1$\n assertNotNull(\"No delta\", delta);\n IDelta[] allLeavesDeltas = collectLeaves(delta);\n //$NON-NLS-1$\n assertEquals(\"Wrong size\", 1, allLeavesDeltas.length);\n IDelta child = allLeavesDeltas[0];\n //$NON-NLS-1$\n assertEquals(\"Wrong kind\", IDelta.CHANGED, child.getKind());\n //$NON-NLS-1$\n assertTrue(\"Is visible\", !Util.isVisible(child.getNewModifiers()));\n //$NON-NLS-1$\n assertEquals(\"Wrong flag\", IDelta.TYPE, child.getFlags());\n //$NON-NLS-1$\n assertEquals(\"Wrong element type\", IDelta.FIELD_ELEMENT_TYPE, child.getElementType());\n //$NON-NLS-1$\n assertTrue(\"Not compatible\", DeltaProcessor.isCompatible(child));\n }", "@org.junit.Test\n public void k2ComputeConElem10() {\n final XQuery query = new XQuery(\n \"declare construction strip; element e {\\\"content\\\"} instance of element(*, xs:untyped)\",\n ctx);\n try {\n result = new QT3Result(query.value());\n } catch(final Throwable trw) {\n result = new QT3Result(trw);\n } finally {\n query.close();\n }\n test(\n assertBoolean(true)\n );\n }", "@Test\r\n public void testCompliment1() {\r\n int actual[] = set1.getComplement();\r\n Assert.assertArrayEquals(new int[] { 100, 200, 456, 234, 890, 990, 100,\r\n 210, 500, 700, 900 }, actual);\r\n }", "@org.junit.Test\n public void constrCompelemCompname12() {\n final XQuery query = new XQuery(\n \"element {(), 'elem'} {'text'}\",\n ctx);\n try {\n result = new QT3Result(query.value());\n } catch(final Throwable trw) {\n result = new QT3Result(trw);\n } finally {\n query.close();\n }\n test(\n assertSerialization(\"<elem>text</elem>\", false)\n );\n }", "@Test\n public void testComAdobeCqSocialGroupClientImplCommunityGroupCollectionComponenProperties() {\n // TODO: test ComAdobeCqSocialGroupClientImplCommunityGroupCollectionComponenProperties\n }", "public void testAssociateStylisticElement() throws Exception {\n try {\n cfg.associateStylisticAndAntiElements(null, null, null);\n fail(\"Expected an IllegalArgumentException\");\n } catch (IllegalArgumentException e) {\n }\n // code block\n {\n String[] children = null;\n createSet(children);\n cfg.associateStylisticAndAntiElements(\"a\", null, permittedChildren);\n verifyStylisticAssociations(1, 1, children);\n }\n // code block\n {\n String[] children = { \"x\" };\n createSet(children);\n cfg.associateStylisticAndAntiElements(\"a\", null, permittedChildren);\n verifyStylisticAssociations(1, 1, children);\n }\n // code block\n {\n String[] children = { \"x\", \"y\" };\n createSet(children);\n cfg.associateStylisticAndAntiElements(\"a\", null, permittedChildren);\n verifyStylisticAssociations(1, 2, children);\n }\n // code block\n {\n String[] children = { \"y\", \"zzz\" };\n createSet(children);\n String[] expectedChildren = { \"x\", \"y\", \"zzz\" };\n cfg.associateStylisticAndAntiElements(\"a\", null, permittedChildren);\n verifyStylisticAssociations(1, 3, expectedChildren);\n }\n }", "private void assertTransitive(UMLMessageArgument msgArg1,UMLMessageArgument msgArg2, UMLMessageArgument msgArg3) throws Exception\r\n\t{\r\n\t\tif(msgArg1 != null && msgArg2 != null && msgArg3 != null)\r\n\t\t{\r\n\t\t\tif(msgArg1.equals(msgArg2) && msgArg2.equals(msgArg3))\r\n\t\t\t{\r\n\t\t\t\tassertTrue(msgArg1.equals(msgArg3));\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public static boolean occlusionTest(Iterable<? extends IMultipart> parts, AxisAlignedBB... boxes) {\n\n return occlusionTest(parts, null, boxes);\n }", "@Test\n public void CompoundTransaction_process_TestA()\n {\n ct = new CompoundTransaction(\"compound\");\n\n acc_db.addAccount(acc);\n acc_db.addAccount(acc2);\n\n ct.addTransaction(new Transaction(\"atomic1\", acc_db,acc.get_Account_Number(),acc2.get_Account_Number(),10));\n\n ct.addTransaction(new Transaction(\"atomic2\",acc_db,acc.get_Account_Number(),acc2.get_Account_Number(),40));\n\n Assert.assertEquals(true, ct.process());\n }", "@Test\n public void test113() throws Throwable {\n ErrorPage errorPage0 = new ErrorPage();\n Checkbox checkbox0 = new Checkbox(errorPage0, \"Col component can e added onlG to a TableBlock.\", \"Col component can e added onlG to a TableBlock.\");\n // Undeclared exception!\n try {\n Component component0 = checkbox0.acronym((Object) \"Col component can e added onlG to a TableBlock.\");\n fail(\"Expecting exception: RuntimeException\");\n \n } catch(RuntimeException e) {\n //\n // Can't add components to a component that is not an instance of IContainer.\n //\n }\n }", "@Test(timeout = 4000)\n public void test225() throws Throwable {\n XmlEntityRef xmlEntityRef0 = new XmlEntityRef(\"]f '8Drr>Uj1==M2\");\n Checkbox checkbox0 = new Checkbox(xmlEntityRef0, \"java.lang.String@000000005\", \"]f '8Drr>Uj1==M2\");\n List<RenderableComponent> list0 = checkbox0._getRenderableChildren();\n assertEquals(\"]f '8Drr>Uj1==M2\", xmlEntityRef0.getComponentId());\n assertNotNull(list0);\n }", "@Test\n public void testCardSelectionIsValid_TRUE() throws Exception {\n System.out.println(\"cardSelectionIsValid not valid\");\n UnoCard cardSelection = new UnoCard(UnoCardColour.BLUE, UnoCardValue.TWO);\n UnoCard drawCard = new UnoCard(UnoCardColour.BLUE, UnoCardValue.ONE);\n UnoCardColour wildColour = UnoCardColour.BLUE;\n utils.cardSelectionIsValid(cardSelection, drawCard, wildColour);\n }", "@Test\r\n\tpublic void testAcquistareBigliettiE2(){\r\n\t\tOfferta o = new Offerta(\"standard\", 10, 25.0);\r\n\t\tCartaDiCredito carta = new CartaDiCredito(\"2334549359434\",23353.89);\r\n\t\tAbbonamento a = new Abbonamento(o);\r\n\t\tCliente c2 = new Cliente(\"4\",\"Mario\",\"Rossi\",\"[email protected]\",\r\n\t\t\t\t\"M\",\"333152497\",\"rossimario\",\"passw.\",\"passw.\",\"domanda segreta..\",carta);\r\n\t\tc2.setAbbonamento(a);\r\n\t\tp1.acquistareBiglietti(3,\"abbonamento\", c2);\r\n\t\t//i biglietti vengono inseriti nella lista prenotazioni e quindi ne\r\n\t\t//modificano la size\r\n\t\tassertEquals(3,c2.getPrenotazioni().size());\r\n\t}", "@Test\n\tpublic void testHasAllRoles_3()\n\t\tthrows Exception {\n\t\tSimpleAuthorizingAccount fixture = new SimpleAuthorizingAccount();\n\t\tfixture.setSimpleRoles(new HashSet());\n\t\tCollection<String> roleIdentifiers = new Vector();\n\n\t\tboolean result = fixture.hasAllRoles(roleIdentifiers);\n\n\t\t// add additional test code here\n\t\tassertTrue(result);\n\t}", "@Test\n public void testBoundsAsCompositesWithSingleEqAndMultiEqRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) = (2, 3)\n Restriction singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction multiEq = newMultiEq(cfMetaData, 1, value2, value3);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiEq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n // clustering_0 = 1 AND clustering_1 = 2 AND (clustering_2, clustering_3) = (3, 4)\n singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction singleEq2 = newSingleEq(cfMetaData, 1, value2);\n multiEq = newMultiEq(cfMetaData, 2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(singleEq2).mergeWith(multiEq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n\n // (clustering_0, clustering_1) = (1, 2) AND clustering_2 = 3\n singleEq = newSingleEq(cfMetaData, 2, value3);\n multiEq = newMultiEq(cfMetaData, 0, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiEq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) = (2, 3) AND clustering_3 = 4\n singleEq = newSingleEq(cfMetaData, 0, value1);\n singleEq2 = newSingleEq(cfMetaData, 3, value4);\n multiEq = newMultiEq(cfMetaData, 1, value2, value3);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiEq).mergeWith(singleEq2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n }", "@org.junit.Test\n public void k2ComputeConElem11() {\n final XQuery query = new XQuery(\n \"element e {\\\"content\\\"} instance of element(a, xs:anyType)\",\n ctx);\n try {\n result = new QT3Result(query.value());\n } catch(final Throwable trw) {\n result = new QT3Result(trw);\n } finally {\n query.close();\n }\n test(\n assertBoolean(false)\n );\n }", "@Test(enabled = false)\n public void addPropertyInCompositionScreenDCAEAssetTest() throws Exception {\n createDCAEAsset();\n\n ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();\n\n CompositionPage.showPropertiesAndAttributesTab();\n List<PropertyTypeEnum> propertyList = Arrays.asList(PropertyTypeEnum.STRING, PropertyTypeEnum.INTEGER);\n int propertiesCount = CompositionPage.getProperties().size();\n for (PropertyTypeEnum prop : propertyList) {\n PropertiesUIUtils.addNewProperty(prop);\n }\n assertTrue(GeneralUIUtils.checkElementsCountInTable(propertiesCount + propertyList.size(), () -> CompositionPage.getProperties()));\n }", "@Test\n\tpublic void testComenzar() {\n\t\tl.agregar(0, 0);\n\t\tl.comenzar();\n\t\tassertEquals((int)(new Integer(0)), l.elemento());\n\t\t\n\t\t//Probando con dos elementos\n\t\tl.agregar(1, 1);\n\t\tl.comenzar();\n\t\tassertEquals((int)(new Integer(0)), l.elemento());\n\t\t\n\t\t//Probando de agregar un elemento al principio\n\t\tl.agregar(2, 0);\n\t\tl.comenzar();\n\t\tassertEquals((int)(new Integer(2)), l.elemento());\n\t\t\n\t\t\n\t}", "@Test\n public void checkEcritureComptableUnit() throws Exception {\n initClassUnderTestDaoMock();\n SequenceEcritureComptable testSEC = new SequenceEcritureComptable();\n testSEC.setDerniereValeur(1);\n when(daoProxy.getComptabiliteDao().getSequenceEcritureComptable(any(), any()))\n .thenReturn(testSEC);\n\n vEcritureComptable.setJournal(new JournalComptable(\"AC\", \"Achat\"));\n vEcritureComptable.setDate(new Date());\n vEcritureComptable.setLibelle(\"Libelle\");\n vEcritureComptable.setReference(\"AC-2020/00001\");\n vEcritureComptable.getListLigneEcriture().add(new LigneEcritureComptable(new CompteComptable(1),\n null, new BigDecimal(123),\n null));\n vEcritureComptable.getListLigneEcriture().add(new LigneEcritureComptable(new CompteComptable(2),\n null, null,\n new BigDecimal(123)));\n\n classUnderTest.checkEcritureComptableUnit(vEcritureComptable);\n }", "@org.junit.Test\n public void k2ComputeConElem8() {\n final XQuery query = new XQuery(\n \"element e {\\\"content\\\"} instance of element(*, xs:anyType)\",\n ctx);\n try {\n result = new QT3Result(query.value());\n } catch(final Throwable trw) {\n result = new QT3Result(trw);\n } finally {\n query.close();\n }\n test(\n assertBoolean(true)\n );\n }", "@org.junit.Test\n public void constrCompelemCompname11() {\n final XQuery query = new XQuery(\n \"element {'elem', ()} {'text'}\",\n ctx);\n try {\n result = new QT3Result(query.value());\n } catch(final Throwable trw) {\n result = new QT3Result(trw);\n } finally {\n query.close();\n }\n test(\n assertSerialization(\"<elem>text</elem>\", false)\n );\n }", "@Test\r\n public void testPackCases() throws Exception\r\n {\r\n String epcToCheck = \"urn:epc:id:sgtin:0614141.107340.1\";\r\n XmlAggregationEventType event = dbHelper.getAggregationEventByChildEpc(epcToCheck);\r\n Assert.assertNull(event);\r\n\r\n runCaptureTest(PACK_CASES_XML);\r\n\r\n event = dbHelper.getAggregationEventByChildEpc(epcToCheck);\r\n Assert.assertNotNull(event);\r\n }" ]
[ "0.7997657", "0.7819967", "0.7669355", "0.7544892", "0.6495886", "0.6009291", "0.5779865", "0.56487834", "0.56465024", "0.5606033", "0.54876816", "0.5464892", "0.541527", "0.5401884", "0.53381723", "0.5327283", "0.53069615", "0.5271551", "0.523697", "0.5228523", "0.5223961", "0.5216095", "0.52007586", "0.5188005", "0.5147404", "0.5138348", "0.5131594", "0.5120652", "0.51150024", "0.51094085", "0.51072687", "0.510563", "0.5085162", "0.5083339", "0.5049393", "0.50490373", "0.503979", "0.5021937", "0.50140077", "0.5004432", "0.49912718", "0.49576828", "0.4956141", "0.49457526", "0.4940658", "0.49201208", "0.49198124", "0.49155536", "0.4892944", "0.4892278", "0.48777404", "0.48771355", "0.48712185", "0.48712015", "0.48467878", "0.48380277", "0.483722", "0.48270014", "0.48250288", "0.48228788", "0.4820437", "0.4820262", "0.4811282", "0.4810317", "0.4810214", "0.4807921", "0.48078728", "0.48077253", "0.48038965", "0.4799165", "0.4796437", "0.4796241", "0.47866765", "0.4786105", "0.47851267", "0.4781599", "0.47811198", "0.4775571", "0.47729698", "0.47701648", "0.4756036", "0.47516263", "0.4748469", "0.47445214", "0.47436902", "0.47434887", "0.4741749", "0.4741562", "0.47379082", "0.4737322", "0.47323316", "0.4731622", "0.47302222", "0.47277486", "0.47273293", "0.47198433", "0.47160786", "0.471581", "0.47120404", "0.47107583" ]
0.80879617
0
Asserts that the specified Composite contains the 4 specified element and the specified EOC.
private static void assertComposite(Composite composite, ByteBuffer firstElement, ByteBuffer secondElement, ByteBuffer thirdElement, ByteBuffer fourthElement, EOC eoc) { assertComposite(composite, eoc, firstElement, secondElement, thirdElement, fourthElement); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void assertComposite(Composite composite, EOC eoc, ByteBuffer... elements)\n {\n assertEquals(\"the composite size is not the expected one:\", elements.length, composite.size());\n for (int i = 0, m = elements.length; i < m; i++)\n {\n ByteBuffer element = elements[i];\n assertTrue(String.format(\"the element %s of the composite is not the expected one: expected %s but was %s\",\n i,\n ByteBufferUtil.toInt(element),\n ByteBufferUtil.toInt(composite.get(i))),\n element.equals(composite.get(i)));\n }\n assertEquals(\"the EOC of the composite is not the expected one:\", eoc, composite.eoc());\n }", "private static void assertComposite(Composite composite,\n ByteBuffer firstElement,\n ByteBuffer secondElement,\n ByteBuffer thirdElement,\n EOC eoc)\n {\n assertComposite(composite, eoc, firstElement, secondElement, thirdElement);\n }", "private static void assertComposite(Composite composite, ByteBuffer firstElement, ByteBuffer secondElement, EOC eoc)\n {\n assertComposite(composite, eoc, firstElement, secondElement);\n }", "private static void assertComposite(Composite composite, ByteBuffer element, EOC eoc)\n {\n assertComposite(composite, eoc, element);\n }", "@Test\r\n public void testComposite() {\r\n \r\n Leaf pers1 = new Leaf(\"Tracy\");\r\n Leaf pers2 = new Leaf(\"JR\");\r\n Leaf pers3 = new Leaf(\"Simon\");\r\n \r\n Composite comp1 = new Composite();\r\n comp1.add(pers1);\r\n comp1.add(pers2);\r\n comp1.add(pers3);\r\n \r\n //Assert.assertEquals(pers1.sayHello(), \"Tracy person says hello\");\r\n Assert.assertNotNull(comp1);\r\n \r\n \r\n }", "@Test\n public void extraElements() {\n assertEmpty(mReactor.getCompounds(getElements(\"Start\", \"A\", \"Fin\", \"Start\")));\n // Each reaction producing a compound should be detected separately.\n assertEmpty(mReactor.getCompounds(getElements(\"Start\", \"A\", \"Fin\", \"Start\", \"A\", \"Fin\")));\n }", "private static void assertEmptyComposite(Composite composite)\n {\n assertEquals(Composites.EMPTY, composite);\n }", "@Test (expected=AjoutException.class)\n\tpublic void test1E() {\n\t\tConvoi c = new Convoi\t\n\t\t\t\t.Builder(\"vehicules\", \"Paris\")\n\t\t\t\t.build();\n\t\tConvoi c2 = new Convoi\t\n\t\t\t\t.Builder(\"camions\", \"Paris\")\n\t\t\t\t.build();\n\t\tc.add(c2);\n\t\tc2.add(c);\n\t}", "@Test\r\n public void testCommissionCases() throws Exception\r\n {\r\n String epcToCheck = \"urn:epc:id:sgtin:0614141.107340.1\";\r\n XmlObjectEventType event = dbHelper.getObjectEventByEpc(epcToCheck);\r\n Assert.assertNull(event);\r\n\r\n runCaptureTest(COMMISSION_CASES_XML);\r\n\r\n event = dbHelper.getObjectEventByEpc(epcToCheck);\r\n Assert.assertNotNull(event);\r\n }", "@Test\n\tpublic void moreComplexAssertion() {\n\t\tOrder order1 = null, order2 = null, order3 = null, order4 = null;\n\t\t// when\n\t\tList<Order> orders = null;// orderSearchService.getOrders(trader,\n\t\t\t\t\t\t\t\t\t// tradingAcct, goldIsinCode);\n\t\t// then\n\t\t// Using Basic JUnit\n\t\tassertEquals(orders.size(), 2);\n\t\tIterator<Order> itr = orders.iterator();\n\t\tassertEquals(itr.next(), order3);\n\t\tassertEquals(itr.next(), order4);\n\t\t// Using Hamcrest\n\t\tassertThat(orders, hasItems(order3, order4));\n\t\tassertThat(orders.size(), is(2));\n\t\t// Using FEST Assertions\n\t\tassertThat(orders).containsOnly(order3, order4);\n\t\t// Using FEST Assertions (chained assertions)\n\t\tassertThat(orders).containsOnly(order3, order4).containsSequence(order3, order4);\n\t}", "@Test\n void contains() {\n Cuboid cuboid1 = new Cuboid(4, 4, 4);\n Point3D point1 = new Point3D(0,0,0);\n assertEquals(true, cuboid1.contains(point1));\n\n Point3D point2 = new Point3D(0,0,2);\n assertEquals(true, cuboid1.contains(point2));\n\n Point3D point3 = new Point3D(0,0,-2);\n assertEquals(true, cuboid1.contains(point3));\n\n Point3D point4 = new Point3D(0,2,0);\n assertEquals(true, cuboid1.contains(point4));\n\n Point3D point5 = new Point3D(0,-2,0);\n assertEquals(true, cuboid1.contains(point5));\n\n Point3D point6 = new Point3D(2,0,0);\n assertEquals(true, cuboid1.contains(point6));\n\n Point3D point7 = new Point3D(-2,0,0);\n assertEquals(true, cuboid1.contains(point7));\n\n Point3D point8 = new Point3D(-2,-2,-2);\n assertEquals(true, cuboid1.contains(point8));\n\n Point3D point9 = new Point3D(-2,-2,-3);\n assertEquals(false, cuboid1.contains(point9));\n\n\n //Arbitary orientation\n Cuboid cuboid2 = new Cuboid(4, 5, 7, new Ray(new Point3D(-2,-2,-2), new Vector3D(1,1,1)));\n Point3D point21 = new Point3D(-1,-1,-1);\n assertEquals(true, cuboid2.contains(point21));\n\n Cuboid cuboid3 = new Cuboid(4, 5, 6, new Ray(new Point3D(-2,-2,-2), new Vector3D(1,1,1)));\n Point3D point31 = new Point3D(0,0,0);\n assertEquals(false, cuboid3.contains(point31));\n\n Cuboid cuboid4 = new Cuboid(4, 5, 6, new Ray(new Point3D(0,0,0), new Vector3D(1,1,1)));\n Point3D point41 = new Point3D(2.5,2.5,2.5);\n assertEquals(false, cuboid4.contains(point41));\n\n Cuboid cuboid5 = new Cuboid(4, 5, 6, new Ray(new Point3D(-2,-2,-2), new Vector3D(0,0,1)));\n Point3D point51 = new Point3D(-2,-2,3.5);\n assertEquals(false, cuboid5.contains(point51));\n }", "@Test\n public void testACFTHasSubComponents() {\n assertThat( hasSubComponents( ACFT ), is( true ) );\n }", "public void testAddIndivisibleElementsThatPermitStyles() throws Exception {\n String[] elements = { \"a\", \"b\", \"c\" };\n cfg.addIndivisibleElementsThatPermitStyles(elements);\n\n String[] moreElements = { \"c\", \"d\" };\n cfg.addIndivisibleElementsThatPermitStyles(moreElements);\n\n Set set = (Set)PrivateAccessor.getField(\n cfg, \"indivisibleElementsThatPermitStyles\");\n assertEquals(\"Should have added and merged all elements:\",\n 6, set.size());\n\n for (int i = 0; i < elements.length; i++) {\n assertTrue(\"Should be in list: \", set.contains(elements[i]));\n }\n for (int i = 0; i < moreElements.length; i++) {\n assertTrue(\"Should be in list: \", set.contains(moreElements[i]));\n }\n }", "@Test\n public void testTRK1HasSubComponents() {\n assertThat( hasSubComponents( TRK1_WITH_SUB_COMP ), is( true ) );\n }", "@Test\r\n public void testCommissionPallets() throws Exception\r\n {\r\n String epcToCheck = \"urn:epc:id:sscc:0614141.0000000001\";\r\n XmlObjectEventType event = dbHelper.getObjectEventByEpc(epcToCheck);\r\n Assert.assertNull(event);\r\n\r\n runCaptureTest(COMMISSION_PALLETS_XML);\r\n\r\n event = dbHelper.getObjectEventByEpc(epcToCheck);\r\n Assert.assertNotNull(event);\r\n }", "@org.junit.Test\n public void k2ComputeConElem13() {\n final XQuery query = new XQuery(\n \"element e {element b{()}}\",\n ctx);\n try {\n result = new QT3Result(query.value());\n } catch(final Throwable trw) {\n result = new QT3Result(trw);\n } finally {\n query.close();\n }\n test(\n assertSerialization(\"<e><b/></e>\", false)\n );\n }", "@Test\n public void testContainsAll_Contains() {\n\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>();\n instance.add(3);\n instance.add(2);\n instance.add(1);\n instance.add(4);\n\n Collection c = Arrays.asList(1, 2, 3);\n\n boolean expResult = true;\n boolean result = instance.containsAll(c);\n assertEquals(expResult, result);\n }", "private List<String> validateComposingElements(\n\t\t\tChemicalAssociationBean assocBean, List<String> msgs) {\n\t\t String compTypeA = assocBean.getAssociatedElementA().getCompositionType();\n\t\t String compTypeB = assocBean.getAssociatedElementB().getCompositionType();\n\t\t\t\n\t\t if((compTypeA!=null)&&(compTypeA.equalsIgnoreCase(\"nanomaterial entity\"))&&(assocBean.getAssociatedElementA().getEntityDisplayName()!=null)){\n\t\t\t\tif(assocBean.getAssociatedElementA().getComposingElement().getId()==null)\n\t\t\t\t\t\tmsgs.add(\"Choosing an element on the left is required.\");\n\t\t\t}\n\t\t\tif((compTypeB!=null)&&(compTypeB.equalsIgnoreCase(\"nanomaterial entity\"))&&(assocBean.getAssociatedElementB().getEntityDisplayName()!=null)){\n\t\t\t\tif(assocBean.getAssociatedElementB().getComposingElement().getId()==null)\n\t\t\t\t\t\tmsgs.add(\"Choosing an element on the right is required.\");\n\t\t\t}\n\t\t\treturn msgs;\n\t}", "public void testAddDivisibleElementsThatPermitStyles() throws Exception {\n String[] elements = { \"a\", \"b\", \"c\" };\n cfg.addDivisibleElementsThatPermitStyles(elements);\n\n String[] moreElements = { \"c\", \"d\" };\n cfg.addDivisibleElementsThatPermitStyles(moreElements);\n\n Set set = (Set)PrivateAccessor.getField(\n cfg, \"divisibleElementsThatPermitStyles\");\n assertEquals(\"Should have added and merged all elements:\",\n 4, set.size());\n\n for (int i = 0; i < elements.length; i++) {\n assertTrue(\"Should be in list: \", set.contains(elements[i]));\n }\n for (int i = 0; i < moreElements.length; i++) {\n assertTrue(\"Should be in list: \", set.contains(moreElements[i]));\n }\n }", "@Test\n public void handleCompositeCommand1() {\n }", "public void verify_AddSubCategoriesPage_DisplayedElements() {\n\n\t\tboolean bstatus;\n\n\t\tbstatus = isElementDisplayed(select_mainCategory, true);\n\t\tReporter.log(bstatus, \"Main Category drop displayed \", \"Main Category drop down not displayed\");\n\n\t\tbstatus = isElementDisplayed(edit_SubCategory, true);\n\t\tReporter.log(bstatus, \"Sub Category text field displayed\", \"Sub Category text field not displayed\");\n\n\t\tbstatus = isElementDisplayed(select_AssignedOrder, true);\n\t\tReporter.log(bstatus, \"Assigned order drop down displayed\", \"Assigned order drop down not displayed\");\n\n\t\tbstatus = isElementDisplayed(btn_Submit, true);\n\t\tReporter.log(bstatus, \"Submit button displayed\", \"Submit button not displayed\");\n\n\t}", "@Test\n public void test_compteAvecOperations(){\n \t\n \tCompte c = serviceCompte.rechercherCompteAvecOperations(1L);\n \tSystem.out.println(\"compte_1 : \"+c);\n \tfor(Operation op : c.getOperations()){\n \t\tSystem.out.println(\"\\t\"+op);\n \t}\n \tAssert.assertTrue(c.getOperations().size()>0);\n }", "public void testIsIndivisibleElement() throws Exception {\n assertTrue(cfg.isIndivisibleElement(\"test\"));\n assertTrue(cfg.isIndivisibleElement(\"d1\"));\n assertTrue(cfg.isIndivisibleElement(\"ind1\"));\n assertTrue(cfg.isIndivisibleElement(\"ind2\"));\n\n cfg.associateStylisticAndAntiElements(\"anti-test\", \"test\",\n permittedChildren);\n cfg.addDivisibleElementsThatPermitStyles(new String[] {\"d1\"});\n cfg.addIndivisibleElementsThatPermitStyles(new String[] {\"ind1\", \"ind2\"});\n\n assertTrue(cfg.isIndivisibleElement(\"ind1\"));\n assertTrue(cfg.isIndivisibleElement(\"ind2\"));\n assertTrue(cfg.isIndivisibleElement(\"not-in-any-set\"));\n assertTrue(cfg.isIndivisibleElement(\"child\"));\n assertTrue(cfg.isIndivisibleElement(\"TEST\"));\n assertTrue(cfg.isIndivisibleElement(\"D1\"));\n\n assertFalse(cfg.isIndivisibleElement(\"test\"));\n assertFalse(cfg.isIndivisibleElement(\"d1\"));\n assertFalse(cfg.isIndivisibleElement(\"anti-test\"));\n }", "@Test\n public void testASSY2HasSubComponents() {\n assertThat( hasSubComponents( ASSY2_WITH_SUB_COMP ), is( true ) );\n }", "@Rollback\n @Test\n public void getAllCreditOperationsByCreditFamilyId() {\n expectedCollection.add(creditOperationFamilyExpected);\n\n //AssertUtils.assertCreditOperationsCollections(expectedCollection, actualCollection);\n }", "@Step(\"There are the following elements on Different Elements page: 4 checkboxes, 4 radios, 1 dropdown, 2 buttons\")\n public void checkElements() {\n checkboxes.shouldHaveSize(4);\n radios.shouldHaveSize(4);\n dropdown.shouldBe(Condition.exist);\n buttons.shouldHaveSize(2);\n }", "@Test \n\t@DisplayName(\"combinacion[i] == null || (combinacionSecreta[i] == null\")\n\tvoid elementoDeCombinacionNoEsCasilla1Test(){ \n\t\tCombinacion combinacionFacil = new Combinacion(dificultadFacil);\n\t\tCombinacion combinacionSecretaFacil = new Combinacion(dificultadFacil);\n\t\tCombinacion combinacionGanaFacil = new Combinacion(dificultadFacil);\n\t\t\n\t\tcombinacionFacil.anadirCasilla(new Casilla(Color.FONDO_ROJOCLARO));\n\t\tcombinacionFacil.anadirCasilla(new Casilla(Color.FONDO_AZUL));\n\t\tcombinacionFacil.anadirCasilla(null);\n\t\tcombinacionFacil.anadirCasilla(new Casilla(Color.FONDO_AMARILLOCLARO));\n\t\t\n\t\tcombinacionSecretaFacil.anadirCasilla(new Casilla(Color.FONDO_ROJOCLARO));\n\t\tcombinacionSecretaFacil.anadirCasilla(new Casilla(Color.FONDO_AMARILLOCLARO));\n\t\tcombinacionSecretaFacil.anadirCasilla(new Casilla(Color.FONDO_MORADOCLARO));\n\t\tcombinacionSecretaFacil.anadirCasilla(new Casilla(Color.FONDO_AZUL));\n\t\n\t\tcombinacionGanaFacil.anadirCasilla(new Casilla(Color.FONDO_ROJOCLARO));\n\t\tcombinacionGanaFacil.anadirCasilla(new Casilla(Color.FONDO_BLANCO));\n\t\tcombinacionGanaFacil.anadirCasilla(new Casilla(Color.FONDO_BLANCO));\n\t\tcombinacionGanaFacil.anadirCasilla(new Casilla(Color.FONDO_NEGRO));\n\t\t\n\t\tAssert.assertEquals(combinacionGanaFacil, combinacionFacil.calcularResultado(combinacionSecretaFacil));\n\t}", "@Test\r\n public void testINFR1184() throws Exception {\r\n // create OU A\r\n Document ouAdoc = getDocument(createSuccessfully(\"escidoc_ou_create.xml\"));\r\n String ouAid = getObjidValue(ouAdoc);\r\n\r\n // create OU B\r\n Document ouBdoc = getDocument(createSuccessfully(\"escidoc_ou_create.xml\"));\r\n String ouBid = getObjidValue(ouBdoc);\r\n\r\n // create OU C\r\n Document ouCdoc = getDocument(createSuccessfully(\"escidoc_ou_create.xml\"));\r\n String ouCid = getObjidValue(ouCdoc);\r\n\r\n // A parentOf B\r\n String srelPrefix = determineSrelNamespacePrefix(ouBdoc);\r\n String xlinkPrefix = determineXlinkNamespacePrefix(ouBdoc);\r\n Node parents = selectSingleNode(ouBdoc, XPATH_ORGANIZATIONAL_UNIT_PARENTS);\r\n Element parent =\r\n ouBdoc.createElementNS(\"http://escidoc.de/core/01/structural-relations/\", srelPrefix + \":parent\");\r\n parent.setAttribute(xlinkPrefix + \":href\", \"/oum/organizational-unit/\" + ouAid);\r\n parents.appendChild(parent);\r\n ouBdoc = getDocument(update(ouBid, toString(ouBdoc, true)));\r\n\r\n // B parentOf C\r\n srelPrefix = determineSrelNamespacePrefix(ouCdoc);\r\n xlinkPrefix = determineXlinkNamespacePrefix(ouCdoc);\r\n parents = selectSingleNode(ouCdoc, XPATH_ORGANIZATIONAL_UNIT_PARENTS);\r\n parent = ouCdoc.createElementNS(\"http://escidoc.de/core/01/structural-relations/\", srelPrefix + \":parent\");\r\n parent.setAttribute(xlinkPrefix + \":href\", \"/oum/organizational-unit/\" + ouBid);\r\n parents.appendChild(parent);\r\n ouCdoc = getDocument(update(ouCid, toString(ouCdoc, true)));\r\n\r\n // A parentOf C\r\n srelPrefix = determineSrelNamespacePrefix(ouCdoc);\r\n xlinkPrefix = determineXlinkNamespacePrefix(ouCdoc);\r\n parents = selectSingleNode(ouCdoc, XPATH_ORGANIZATIONAL_UNIT_PARENTS);\r\n parent = (Element) selectSingleNode(parents, XPATH_ORGANIZATIONAL_UNIT_PARENT);\r\n parent.setAttribute(xlinkPrefix + \":href\", \"/oum/organizational-unit/\" + ouAid);\r\n ouCdoc = getDocument(update(ouCid, toString(ouCdoc, true)));\r\n }", "@Test(priority = 5)\n\tpublic void validateContents() {\n\t\tlog = Logger.getLogger(HeroImageProducttestscripts.class);\n\t\tLogReport.getlogger();\n\t\tlogger = extent.startTest(\"Validating the content of the product\");\n\t\tHeroImageProductPageFlow.clickHeroImage(locator);\n\t\theroImg.validateDescriptionContent(locator, validate);\n\t\t;\n\t\tlog.info(\"Content validation is correct\");\n\t\tHeroImageProductPageFlow.clickProductSpecification(locator);\n\t\theroImg.validateSpecificationContent(locator, validate);\n\t\tlog.info(\"Content is present\");\n\t\tlog.info(\"Starting Sorting functionality testing\");\n\t}", "@Test\n public void testIsComposite() {\n Tag tag = new BaseTag();\n assertFalse(\"BaseTag reported as composite\", tag.isComposite());\n }", "@Test\r\n\tpublic void testErabiltzaileakBaloratuDituenPelikulenZerrenda() {\n\t\tArrayList<Integer> zer = BalorazioenMatrizea.getBalorazioenMatrizea().erabiltzaileakBaloratuDituenPelikulenZerrenda(e1.getId());\r\n\t\tassertTrue(zer.size() == 3);\r\n\t\tassertTrue(zer.contains(p1.getPelikulaId()));\r\n\t\tassertTrue(zer.contains(p2.getPelikulaId()));\r\n\t\tassertTrue(zer.contains(p4.getPelikulaId()));\r\n\t\tassertFalse(zer.contains(p3.getPelikulaId()));\r\n\t\t\r\n\t\t// e2 erabiltzaileak baloratu dituen pelikulen ID-ak itzuli\r\n\t\tzer = BalorazioenMatrizea.getBalorazioenMatrizea().erabiltzaileakBaloratuDituenPelikulenZerrenda(e2.getId());\r\n\t\tassertTrue(zer.size() == 2);\r\n\t\tassertTrue(zer.contains(p2.getPelikulaId()));\r\n\t\tassertTrue(zer.contains(p3.getPelikulaId()));\r\n\t\tassertFalse(zer.contains(p1.getPelikulaId()));\r\n\t\t\r\n\t\t// e3 erabiltzaileak baloratu dituen pelikulen ID-ak itzuli\r\n\t\tzer = BalorazioenMatrizea.getBalorazioenMatrizea().erabiltzaileakBaloratuDituenPelikulenZerrenda(e3.getId());\r\n\t\tassertTrue(zer.size() == 4);\r\n\t\tassertTrue(zer.contains(p1.getPelikulaId()));\r\n\t\tassertTrue(zer.contains(p2.getPelikulaId()));\r\n\t\tassertTrue(zer.contains(p3.getPelikulaId()));\r\n\t\tassertTrue(zer.contains(p4.getPelikulaId()));\r\n\t\t\r\n\t\t// e2 erabiltzaileak baloratu dituen pelikulen ID-ak itzuli\r\n\t\tzer = BalorazioenMatrizea.getBalorazioenMatrizea().erabiltzaileakBaloratuDituenPelikulenZerrenda(e4.getId());\r\n\t\tassertTrue(zer.size() == 1);\r\n\t\tassertTrue(zer.contains(p2.getPelikulaId()));\r\n\t\tassertFalse(zer.contains(p1.getPelikulaId()));\r\n\t\t\r\n\t}", "@Test\n public void testContains_Contain() {\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>();\n instance.add(1);\n instance.add(2);\n instance.add(3);\n\n boolean expResult = true;\n boolean result = instance.contains(1);\n assertEquals(expResult, result);\n }", "@Test\n public void testCardSelectionIsValid_TRUE() throws Exception {\n System.out.println(\"cardSelectionIsValid not valid\");\n UnoCard cardSelection = new UnoCard(UnoCardColour.BLUE, UnoCardValue.TWO);\n UnoCard drawCard = new UnoCard(UnoCardColour.BLUE, UnoCardValue.ONE);\n UnoCardColour wildColour = UnoCardColour.BLUE;\n utils.cardSelectionIsValid(cardSelection, drawCard, wildColour);\n }", "private void checkProperties(Configuration compositeConfiguration)\n {\n assertTrue(\"Make sure we have loaded our key\", compositeConfiguration\n .getBoolean(\"test.boolean\"));\n assertEquals(\"I'm complex!\", compositeConfiguration\n .getProperty(\"element2.subelement.subsubelement\"));\n assertEquals(\"property in the XMLPropertiesConfiguration\", \"value1\",\n compositeConfiguration.getProperty(\"key1\"));\n }", "@org.junit.Test\n public void k2ComputeConElem3() {\n final XQuery query = new XQuery(\n \"<elem>{<e/>, <b></b>, \\\"\\\", \\\"\\\"}</elem>\",\n ctx);\n try {\n result = new QT3Result(query.value());\n } catch(final Throwable trw) {\n result = new QT3Result(trw);\n } finally {\n query.close();\n }\n test(\n assertSerialization(\"<elem><e/><b/> </elem>\", false)\n );\n }", "@Test(priority = 5, dependsOnMethods = { \"verifySubscriptionPageComponents\" }, groups = { \"Smoke\" })\n\tpublic static void verifyGridComponents() throws InterruptedException {\n\n\t\ttest = report.startTest(\"Verify Components of Grid\");\n\n//\t\t//Verify Columns of Grid\n//\t\tString columnsGrid = driver.findElement(By.xpath(xpathColumnOfgrid)).getText();\n//\t\tAssert.assertEquals(columnsGrid,\"S. noSubscription NameSubscription IdDescriptionCreated OnAction\");\n//\t\ttest.log(LogStatus.PASS, \"Column Of Grid\", \"All Column are Displaying\");\n\n\t\t// verify any row in grid is displaying or not\n\n\t\tboolean rowInGrid = driver.findElement(By.xpath(xpathRowInGrid)).getText().isEmpty();\n\t\tAssert.assertFalse(rowInGrid);\n\t\ttest.log(LogStatus.PASS, \"Row In Grid\", \"Row In Grid is displaying\");\n\n\t\t// verify Delete and Edit Buttons\n\t\tWebElement deleteButton = driver.findElement(By.className(classDeleteButton));\n\t\tAssert.assertTrue(deleteButton.isEnabled());\n\t\ttest.log(LogStatus.PASS, \"Delete Button\", \"Delete Button is displaying and Enabled\");\n\t\tWebElement editButton = driver.findElement(By.className(\"editlink\"));\n\t\tAssert.assertTrue(editButton.isEnabled());\n\t\ttest.log(LogStatus.PASS, \"Edit Button\", \"Edit Button is displaying and Enabled\");\n\t}", "@Test\r\n public void testContains() {\r\n System.out.println(\"contains\");\r\n ModeloListaOrganizadores instance = new ModeloListaOrganizadores(e.getListaOrganizadores());\r\n Organizador o =new Organizador(new Utilizador(\"teste\", \"[email protected]\", \"teste\", \"teste\", true, 5));\r\n instance.addElement(o);\r\n boolean expResult = true;\r\n boolean result = instance.contains(o);\r\n assertEquals(expResult, result);\r\n \r\n }", "@Test\r\n public void testPackCases() throws Exception\r\n {\r\n String epcToCheck = \"urn:epc:id:sgtin:0614141.107340.1\";\r\n XmlAggregationEventType event = dbHelper.getAggregationEventByChildEpc(epcToCheck);\r\n Assert.assertNull(event);\r\n\r\n runCaptureTest(PACK_CASES_XML);\r\n\r\n event = dbHelper.getAggregationEventByChildEpc(epcToCheck);\r\n Assert.assertNotNull(event);\r\n }", "@Test\n public void testComplexCompositeDataExtractor() throws Exception {\n final String[] compositePropertyNames = new String[2];\n compositePropertyNames[0] = \"Count\";\n compositePropertyNames[1] = \"Latency\";\n\n final String[] compositePropertyDescriptions = new String[2];\n compositePropertyDescriptions[0] = \"Count of requests received for the command\";\n compositePropertyDescriptions[1] = \"Average Time Taken to process the command\";\n\n final OpenType[] compositePropertyTypes = new OpenType[2];\n compositePropertyTypes[0] = SimpleType.LONG;\n compositePropertyTypes[1] = SimpleType.FLOAT;\n\n final CompositeType compositeType =\n new CompositeType(\"Command Stats\", \"Stats for each command\",\n compositePropertyNames, compositePropertyDescriptions,\n compositePropertyTypes);\n\n final Object[] loginCompositeValues = new Object[compositePropertyNames.length];\n loginCompositeValues[0] = new Long(10);\n loginCompositeValues[1] = new Float(38.34f);\n\n final Object[] logoutCompositeValues = new Object[compositePropertyNames.length];\n logoutCompositeValues[0] = new Long(30);\n logoutCompositeValues[1] = new Float(26.09f);\n\n final Object[] capaCompositeValues = new Object[compositePropertyNames.length];\n capaCompositeValues[0] = new Long(89);\n capaCompositeValues[1] = new Float(103.09f);\n\n final String[] complexCompositePropertyNames = new String[3];\n complexCompositePropertyNames[0] = \"Login\";\n complexCompositePropertyNames[1] = \"Logout\";\n complexCompositePropertyNames[2] = \"Capability\";\n\n CompositeData[] complexDataValues = new CompositeData[complexCompositePropertyNames.length];\n complexDataValues[0] =\n new CompositeDataSupport(compositeType, compositePropertyNames, loginCompositeValues);\n complexDataValues[1] =\n new CompositeDataSupport(compositeType, compositePropertyNames, logoutCompositeValues);\n complexDataValues[2] =\n new CompositeDataSupport(compositeType, compositePropertyNames, capaCompositeValues);\n\n final OpenType[] complexCompositePropertyTypes = new OpenType[3];\n complexCompositePropertyTypes[0] = compositeType;\n complexCompositePropertyTypes[1] = compositeType;\n complexCompositePropertyTypes[2] = compositeType;\n\n final String[] complexCompositePropertyDescriptions = new String[3];\n complexCompositePropertyDescriptions[0] =\n \"Command Stats for \" + complexCompositePropertyNames[0];\n complexCompositePropertyDescriptions[1] =\n \"Command Stats for \" + complexCompositePropertyNames[1];\n complexCompositePropertyDescriptions[2] =\n \"Command Stats for \" + complexCompositePropertyNames[2];\n\n final CompositeType complexCompositeType =\n new CompositeType(\"Commands\", \"Stats for all commands\",\n complexCompositePropertyNames, complexCompositePropertyDescriptions,\n complexCompositePropertyTypes);\n\n CompositeData complexData =\n new CompositeDataSupport(complexCompositeType, complexCompositePropertyNames,\n complexDataValues);\n\n ObjectToJsonConverter jsonConverter = new ObjectToJsonConverter();\n JsonElement jsonElement = jsonConverter.extractObject(complexData);\n Assert.assertNotNull(jsonElement);\n\n JsonElement capability = jsonElement.getAsJsonObject().get(\"Capability\");\n Assert.assertNotNull(capability);\n JsonElement count = capability.getAsJsonObject().get(\"Count\");\n Assert.assertNotNull(count);\n Assert.assertEquals(count.getAsLong(), 89);\n JsonElement latency = capability.getAsJsonObject().get(\"Latency\");\n Assert.assertNotNull(latency);\n Assert.assertEquals(latency.getAsFloat(), 103.09f);\n\n JsonElement login = jsonElement.getAsJsonObject().get(\"Login\");\n Assert.assertNotNull(login);\n count = login.getAsJsonObject().get(\"Count\");\n Assert.assertNotNull(count);\n Assert.assertEquals(count.getAsLong(), 10);\n latency = login.getAsJsonObject().get(\"Latency\");\n Assert.assertNotNull(latency);\n Assert.assertEquals(latency.getAsFloat(), 38.34f);\n\n JsonElement logout = jsonElement.getAsJsonObject().get(\"Logout\");\n Assert.assertNotNull(logout);\n count = logout.getAsJsonObject().get(\"Count\");\n Assert.assertNotNull(count);\n Assert.assertEquals(count.getAsLong(), 30);\n latency = logout.getAsJsonObject().get(\"Latency\");\n Assert.assertNotNull(latency);\n Assert.assertEquals(latency.getAsFloat(), 26.09f);\n }", "@Test\n public void testContains_Contain_Overflow_Boundary() {\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>(2, 2);\n instance.add(1);\n instance.add(2);\n instance.add(3);\n instance.add(4);\n instance.add(5);\n instance.add(6);\n\n boolean expResult = true;\n boolean result = instance.contains(6);\n assertEquals(expResult, result);\n }", "@org.junit.Test\n public void k2ComputeConElem10() {\n final XQuery query = new XQuery(\n \"declare construction strip; element e {\\\"content\\\"} instance of element(*, xs:untyped)\",\n ctx);\n try {\n result = new QT3Result(query.value());\n } catch(final Throwable trw) {\n result = new QT3Result(trw);\n } finally {\n query.close();\n }\n test(\n assertBoolean(true)\n );\n }", "@Test\n\tpublic void testCrearEjercicio3(){\n\t\tEjercicio ej = new Ejercicio(1, true, Plataforma.getFechaActual().minusDays(3), Plataforma.getFechaActual().plusDays(2),\n\t\t\t\ttema1, \"Ejercicio1\", true, mates);\n\t\t\n\t\tassertEquals(ej.getFechaIni(), ej.getFechaIniDefecto());\n\t\tassertEquals(ej.getFechaFin(), ej.getFechaFinDefecto());\n\t\tassertTrue(tema1.getSubcontenido().contains(ej));\n\t}", "@Test\n public void processCompoundTransaction_TestC() throws Exception {\n ct = new CompoundTransaction(\"compound\");\n\n Assert.assertEquals(false, trans_mang.processCompoundTransaction(ct));\n }", "@Test\n public void z_topDown_TC02() {\n try {\n Intrebare intrebare = appService.addNewIntrebare(\"Enunt?\", \"1) Raspuns1\", \"2) Raspuns2\", \"3) Raspuns3\",\n \"1\", \"M\");\n Intrebare intrebare1 = appService.addNewIntrebare(\"Enunt?\", \"1) Raspuns1\", \"2) Raspuns2\", \"3) Raspuns3\",\n \"1\", \"A\");\n Intrebare intrebare2 = appService.addNewIntrebare(\"Enunt?\", \"1) Raspuns1\", \"2) Raspuns2\", \"3) Raspuns3\",\n \"1\", \"B\");\n Intrebare intrebare3 = appService.addNewIntrebare(\"Enunt?\", \"1) Raspuns1\", \"2) Raspuns2\", \"3) Raspuns3\",\n \"1\", \"C\");\n assertTrue(true);\n assertTrue(appService.exists(intrebare));\n assertTrue(appService.exists(intrebare1));\n assertTrue(appService.exists(intrebare2));\n assertTrue(appService.exists(intrebare3));\n\n try {\n ccir2082MV.evaluator.model.Test test = appService.createNewTest();\n assertTrue(test.getIntrebari().contains(intrebare));\n assertTrue(test.getIntrebari().contains(intrebare1));\n assertTrue(test.getIntrebari().contains(intrebare2));\n assertTrue(test.getIntrebari().contains(intrebare3));\n assertTrue(test.getIntrebari().size() == 5);\n } catch (NotAbleToCreateTestException e) {\n assertTrue(false);\n }\n } catch (DuplicateIntrebareException | IntrebareValidatorFailedException e) {\n e.printStackTrace();\n assertTrue(false);\n }\n }", "private void verifySpecimensPresent(int aaa07Count, int controlCount, int baq00051Count)\r\n {\n assertTextPresent(\"AAA07\", aaa07Count * 2);\r\n assertTextPresent(\"AssayTestControl\", controlCount * 2);\r\n assertTextPresent(\"BAQ00051\", baq00051Count * 2);\r\n }", "@org.junit.Test\n public void k2ComputeConElem9() {\n final XQuery query = new XQuery(\n \"element e {\\\"content\\\"} instance of element(*, xs:untyped)\",\n ctx);\n try {\n result = new QT3Result(query.value());\n } catch(final Throwable trw) {\n result = new QT3Result(trw);\n } finally {\n query.close();\n }\n test(\n (\n assertBoolean(false)\n ||\n assertBoolean(true)\n )\n );\n }", "@Test\n\tpublic void testComenzar() {\n\t\tl.agregar(0, 0);\n\t\tl.comenzar();\n\t\tassertEquals((int)(new Integer(0)), l.elemento());\n\t\t\n\t\t//Probando con dos elementos\n\t\tl.agregar(1, 1);\n\t\tl.comenzar();\n\t\tassertEquals((int)(new Integer(0)), l.elemento());\n\t\t\n\t\t//Probando de agregar un elemento al principio\n\t\tl.agregar(2, 0);\n\t\tl.comenzar();\n\t\tassertEquals((int)(new Integer(2)), l.elemento());\n\t\t\n\t\t\n\t}", "@Test\n public void checkEcritureComptableUnit() throws Exception {\n initClassUnderTestDaoMock();\n SequenceEcritureComptable testSEC = new SequenceEcritureComptable();\n testSEC.setDerniereValeur(1);\n when(daoProxy.getComptabiliteDao().getSequenceEcritureComptable(any(), any()))\n .thenReturn(testSEC);\n\n vEcritureComptable.setJournal(new JournalComptable(\"AC\", \"Achat\"));\n vEcritureComptable.setDate(new Date());\n vEcritureComptable.setLibelle(\"Libelle\");\n vEcritureComptable.setReference(\"AC-2020/00001\");\n vEcritureComptable.getListLigneEcriture().add(new LigneEcritureComptable(new CompteComptable(1),\n null, new BigDecimal(123),\n null));\n vEcritureComptable.getListLigneEcriture().add(new LigneEcritureComptable(new CompteComptable(2),\n null, null,\n new BigDecimal(123)));\n\n classUnderTest.checkEcritureComptableUnit(vEcritureComptable);\n }", "@org.junit.Test\n public void k2ComputeConElem8() {\n final XQuery query = new XQuery(\n \"element e {\\\"content\\\"} instance of element(*, xs:anyType)\",\n ctx);\n try {\n result = new QT3Result(query.value());\n } catch(final Throwable trw) {\n result = new QT3Result(trw);\n } finally {\n query.close();\n }\n test(\n assertBoolean(true)\n );\n }", "@Test\r\n\tpublic void testPelikulaBaloratuDutenErabiltzaileenZerrenda() {\n\t\tArrayList<Integer> zer = BalorazioenMatrizea.getBalorazioenMatrizea().pelikulaBaloratuDutenErabiltzaileenZerrenda(p1.getPelikulaId());\r\n\t\tassertTrue(zer.size() == 2);\r\n\t\tassertTrue(zer.contains(e1.getId()));\r\n\t\tassertTrue(zer.contains(e3.getId()));\r\n\t\tassertFalse(zer.contains(e2.getId()));\r\n\t\t\r\n\t\t// p2 pelikula baloratu duten erabiltzaileen ID-ak itzuli\r\n\t\tzer = BalorazioenMatrizea.getBalorazioenMatrizea().pelikulaBaloratuDutenErabiltzaileenZerrenda(p2.getPelikulaId());\r\n\t\tassertTrue(zer.size() == 4);\r\n\t\tassertTrue(zer.contains(e1.getId()));\r\n\t\tassertTrue(zer.contains(e2.getId()));\r\n\t\tassertTrue(zer.contains(e3.getId()));\r\n\t\tassertTrue(zer.contains(e4.getId()));\r\n\t\t\r\n\t\t// p3 pelikula baloratu duten erabiltzaileen ID-ak itzuli\r\n\t\tzer = BalorazioenMatrizea.getBalorazioenMatrizea().pelikulaBaloratuDutenErabiltzaileenZerrenda(p3.getPelikulaId());\r\n\t\tassertTrue(zer.size() == 2);\r\n\t\tassertTrue(zer.contains(e2.getId()));\r\n\t\tassertTrue(zer.contains(e3.getId()));\r\n\t\tassertFalse(zer.contains(e1.getId()));\r\n\t\t\r\n\t\t// p4 pelikula baloratu duten erabiltzaileen ID-ak itzuli\r\n\t\tzer = BalorazioenMatrizea.getBalorazioenMatrizea().pelikulaBaloratuDutenErabiltzaileenZerrenda(p4.getPelikulaId());\r\n\t\tassertTrue(zer.size() == 2);\r\n\t\tassertTrue(zer.contains(e1.getId()));\r\n\t\tassertTrue(zer.contains(e3.getId()));\r\n\t\tassertFalse(zer.contains(e4.getId()));\r\n\t\t\r\n\t}", "@org.junit.Test\n public void k2ComputeConElem2() {\n final XQuery query = new XQuery(\n \"<elem>{\\\"\\\", \\\"\\\", <e/>, <b></b>}</elem>\",\n ctx);\n try {\n result = new QT3Result(query.value());\n } catch(final Throwable trw) {\n result = new QT3Result(trw);\n } finally {\n query.close();\n }\n test(\n assertSerialization(\"<elem> <e/><b/></elem>\", false)\n );\n }", "public static void VerifyCommonComponent_Div_P(String renderingControl){\n\t\ttry{\n\t\t\tactualDescriptionButton=sitecoreObj.aboutusCommonComponent_Div_P.isDisplayed();\n\t\t\tAssert.assertEquals(actualDescriptionButton, true);\n\t\t\tlog.info(\"The Actual AboutUs \" + renderingControl + \" Description - <\"+sitecoreObj.aboutusCommonComponent_Div_P.getTagName()+\">\");\n\t\t\tlog.info(\"The Expected AboutUs \" + renderingControl + \" Description - <p>\");\n\t\t\tlog.info(\"TEST PASSED: The Actual and Expected AboutUs \" + renderingControl + \" Description are Same\");\n\t\t}catch(AssertionError e){\n\t\t\tlog.error(\"The Actual AboutUs \" + renderingControl + \" Description - \"+sitecoreObj.aboutusCommonComponent_Div_P.getTagName());\n\t\t\tlog.error(\"The Expected AboutUs \" + renderingControl + \" Description - <p>\");\n\t\t\tlog.error(\"TEST FAILED: The Actual and Expected AboutUs \" + renderingControl + \" Description are NOT same\");\n\t\t}catch(org.openqa.selenium.NoSuchElementException e){\n\t\t\tlog.error(\"TEST FAILED: There is No Description On \" + renderingControl + \" element\");\n\t\t}\n\t}", "@org.junit.Test\n public void constrCompelemCompname10() {\n final XQuery query = new XQuery(\n \"element {'elem'} {'text'}\",\n ctx);\n try {\n result = new QT3Result(query.value());\n } catch(final Throwable trw) {\n result = new QT3Result(trw);\n } finally {\n query.close();\n }\n test(\n assertSerialization(\"<elem>text</elem>\", false)\n );\n }", "@Test(timeout = 4000)\n public void test225() throws Throwable {\n XmlEntityRef xmlEntityRef0 = new XmlEntityRef(\"]f '8Drr>Uj1==M2\");\n Checkbox checkbox0 = new Checkbox(xmlEntityRef0, \"java.lang.String@000000005\", \"]f '8Drr>Uj1==M2\");\n List<RenderableComponent> list0 = checkbox0._getRenderableChildren();\n assertEquals(\"]f '8Drr>Uj1==M2\", xmlEntityRef0.getComponentId());\n assertNotNull(list0);\n }", "private static void testContains(BagInterface<String> aBag, String[] tests)\n {\n System.out.println(\"\\nTesting the method contains:\");\n for (int index = 0; index < tests.length; index++)\n System.out.println(\"Does this bag contain \" + tests[index] +\n \"? \" + aBag.contains(tests[index]));\n }", "@Test\n public void testComAdobeCqSocialGroupClientImplCommunityGroupCollectionComponenProperties() {\n // TODO: test ComAdobeCqSocialGroupClientImplCommunityGroupCollectionComponenProperties\n }", "@Test\n public void testPartieContinue(){\n Joueur NORD = new Joueur(\"NORD\");\n Joueur SUD = new Joueur(\"SUD\");\n assertTrue(Regles.partieContinue(NORD.clone(), SUD.clone(), 0,false));\n // avec des bases injouables\n NORD.setAscendant(61);\n NORD.setDescendant(0);\n SUD.setAscendant(61);\n SUD.setDescendant(0);\n assertFalse(Regles.partieContinue(NORD.clone(), SUD.clone(), 0, false));\n // avec un jeu vide\n NORD.jeu.clear();\n assertFalse(Regles.partieContinue(NORD.clone(), SUD.clone(), 0, false));\n\n SUD.jeu.clear();\n NORD.jeu.add(0,59);\n NORD.jeu.add(1,58);\n NORD.setAscendant(57);\n NORD.setDescendant(2);\n SUD.setAscendant(1);\n SUD.setDescendant(60);\n assertTrue(Regles.partieContinue(NORD.clone(), SUD.clone(), 0,false));\n NORD.setAscendant(58);\n assertFalse(Regles.partieContinue(NORD.clone(), SUD.clone(), 0,false));\n //cas spécifique\n NORD.setAscendant(49);\n NORD.setDescendant(2);\n SUD.setAscendant(53);\n SUD.setDescendant(9);\n SUD.jeu.add(0,34);\n SUD.jeu.add(1,44);\n SUD.jeu.add(2,38);\n SUD.jeu.add(3,6);\n SUD.jeu.add(4,41);\n SUD.jeu.add(5,39);\n assertTrue(Regles.partieContinue(SUD.clone(), NORD.clone(), 0, false));\n\n\n }", "public static boolean occlusionTest(IMultipart part, AxisAlignedBB... boxes) {\n\n return occlusionTest(part, new NormallyOccludingPart(Arrays.asList(boxes)));\n }", "public void VerifyCartCheckout_Coupon_OrderSumamrysections(){\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- cartcheckout, coupon and Order summary should be present in checkout page\");\r\n\r\n\t\ttry{\r\n\t\t\tif(isElementPresent(locator_split(\"boxCheckoutCartCheckout\")) & isElementPresent(locator_split(\"boxCheckoutCoupon\"))\r\n\t\t\t\t\t& isElementPresent(locator_split(\"boxCheckoutOrderSummary\"))){\r\n\t\t\t\tSystem.out.println(\"cartcheckout, coupon and Order summary is present in checkout page\");\r\n\t\t\t\tReporter.log(\"PASS_MESSAGE:- cartcheckout, coupon and Order summary is present in checkout page\");\r\n\t\t\t}else{\r\n\t\t\t\tthrow new Exception(\"cartcheckout/coupon/Order summary are not present in checkout page\");\r\n\t\t\t}\r\n\t\t}catch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- cartcheckout/coupon/Order summary are not present in checkout page\");\r\n\t\t\tthrow new NoSuchElementException(\"The element with\"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"boxCheckoutCartCheckout\")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"boxCheckoutCoupon\")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"boxCheckoutOrderSummary\")\r\n\t\t\t\t\t+ \" not found\");\r\n\t\t}\r\n\r\n\t}", "@org.junit.Test\n public void k2ComputeConElem11() {\n final XQuery query = new XQuery(\n \"element e {\\\"content\\\"} instance of element(a, xs:anyType)\",\n ctx);\n try {\n result = new QT3Result(query.value());\n } catch(final Throwable trw) {\n result = new QT3Result(trw);\n } finally {\n query.close();\n }\n test(\n assertBoolean(false)\n );\n }", "private void assertAll() {\n\t\t\n\t}", "public void Assert()\n\t{\n\t\tString c=driver.findElement(By.xpath(\"//a[text()='CTS']\")).getText();\n\t\t Assert.assertEquals(\"CTS\", c);\n\t}", "@Test\n public void testContainsAll_Not_Contain() {\n\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>();\n instance.add(3);\n instance.add(2);\n instance.add(1);\n instance.add(4);\n\n Collection c = Arrays.asList(1, 2, 5);\n\n boolean expResult = false;\n boolean result = instance.containsAll(c);\n assertEquals(expResult, result);\n }", "@Test\n public void testContains_Contain_Overflow() {\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>(3, 2);\n instance.add(1);\n instance.add(2);\n instance.add(3);\n instance.add(4);\n instance.add(5);\n instance.add(6);\n\n boolean expResult = true;\n boolean result = instance.contains(4);\n assertEquals(expResult, result);\n }", "@Test\n\tpublic void testIncluye() {\n\t\tassertFalse(l.incluye(0));\n\t\t\n\t\t//Test de busqueda sobre el primer elemento\n\t\tl.agregar(0, 0);\n\t\tassertTrue(l.incluye(0));\n\t\tassertFalse(l.incluye(1));\n\t\t\n\t\t//Test con mas elementos\n\t\tl.agregar(1, 1);\n\t\tl.agregar(2, 2);\n\t\tassertTrue(l.incluye(1));\n\t\tassertFalse(l.incluye(4));\n\t\t\n\t}", "@Test\n public void processCompoundTransaction_TestA() throws Exception\n {\n ct = new CompoundTransaction(\"compound\");\n\n acc_db.addAccount(acc);\n acc_db.addAccount(acc2);\n\n ct.addTransaction(new Transaction(\"atomic1\", acc_db,acc.get_Account_Number(),acc2.get_Account_Number(),10));\n\n ct.addTransaction(new Transaction(\"atomic2\",acc_db,acc.get_Account_Number(),acc2.get_Account_Number(),40));\n\n Assert.assertEquals(true, trans_mang.processCompoundTransaction(ct));\n }", "@Ignore\r\n @Test\r\n public void testContainsCollection() {\r\n System.out.println(\"containsCollection\");\r\n NumberCollection nc = null;\r\n NumberCollection instance = new NumberCollection();\r\n boolean expResult = false;\r\n boolean result = instance.containsCollection(nc);\r\n assertEquals(expResult, result);\r\n \r\n }", "@org.junit.Test\n public void constrCompelemCompname12() {\n final XQuery query = new XQuery(\n \"element {(), 'elem'} {'text'}\",\n ctx);\n try {\n result = new QT3Result(query.value());\n } catch(final Throwable trw) {\n result = new QT3Result(trw);\n } finally {\n query.close();\n }\n test(\n assertSerialization(\"<elem>text</elem>\", false)\n );\n }", "@Test\n public void testContainsAll_Contains_Overflow() {\n\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>(2, 2);\n instance.add(3);\n instance.add(2);\n instance.add(1);\n instance.add(4);\n instance.add(5);\n instance.add(4);\n instance.add(7);\n\n Collection c = Arrays.asList(3, 4, 5, 7);\n\n boolean expResult = true;\n boolean result = instance.containsAll(c);\n assertEquals(expResult, result);\n }", "@Test\n\tpublic void testInfobox() {\t\n\t\tTextArea info = (TextArea) s.lookup(\"#T6_infobox_TextArea\");\n\t\tTextArea compInfo = (TextArea) s.lookup(\"#T6_composite_infobox_TextArea\");\n\t\tTextArea parmInfo = (TextArea) s.lookup(\"#T6_parm_infobox_TextArea\");\n\t\tTextArea pasrmInfo = (TextArea) s.lookup(\"#T6_pasrm_infobox_TextArea\");\n\t\tTextArea ldInfo = (TextArea) s.lookup(\"#T6_ld_infobox_TextArea\");\n\t\tclickOn(\"#Main_compatibility_Button\");\n\t\tmoveTo(\"#T6_more_info_Text\");\n\t\tif (!info.isVisible()||compInfo.isVisible()||parmInfo.isVisible()||pasrmInfo.isVisible()||ldInfo.isVisible()) {\n\t\t\t// if any infobox other than composite infobox is shown fail test case\n\t\t\tSystem.out.println(1);\n\t\t\tassertTrue(false);\n\t\t}\n\t\tmoveTo(\"#T6_composite_Text\");\n\t\tif (info.isVisible()||!compInfo.isVisible()||parmInfo.isVisible()||pasrmInfo.isVisible()||ldInfo.isVisible()) {\n\t\t\t// if any infobox other than composite infobox is shown fail test case\n\t\t\tSystem.out.println(2);\n\t\t\tassertTrue(false);\n\t\t}\n\t\tmoveTo(\"#T6_parm_Text\");\n\t\tif (info.isVisible()||compInfo.isVisible()||!parmInfo.isVisible()||pasrmInfo.isVisible()||ldInfo.isVisible()) {\n\t\t\t// if any infobox other than composite infobox is shown fail test case\n\t\t\tSystem.out.println(3);\n\t\t\tassertTrue(false);\n\t\t\t\n\t\t}\n\t\tmoveTo(\"#T6_pasrm_Text\");\n\t\tif (info.isVisible()||compInfo.isVisible()||parmInfo.isVisible()||!pasrmInfo.isVisible()||ldInfo.isVisible()) {\n\t\t\t// if any infobox other than composite infobox is shown fail test case\n\t\t\tSystem.out.println(5);\n\t\t\tassertTrue(false);\n\t\t}\n\t\tmoveTo(\"#T6_ld_Text\");\n\t\tif (info.isVisible()||compInfo.isVisible()||parmInfo.isVisible()||pasrmInfo.isVisible()||!ldInfo.isVisible()) {\n\t\t\t// if any infobox other than composite infobox is shown fail test case\n\t\t\tSystem.out.println(5);\n\t\t\tassertTrue(false);\n\t\t}\n\t\tmoveTo(\"#T6_generate_Button\");\n\t\t// if any infobox is shown fail test case\n\t\tassertFalse(info.isVisible()||compInfo.isVisible()||parmInfo.isVisible()||pasrmInfo.isVisible()||ldInfo.isVisible());\n\t\t\n\t}", "@Test(expected = Exception.class)\n public void testCardSelectionIsValid_FALSE() throws Exception {\n System.out.println(\"cardSelectionIsValid not valid\");\n UnoCard cardSelection = new UnoCard(UnoCardColour.RED, UnoCardValue.TWO);\n UnoCard drawCard = new UnoCard(UnoCardColour.BLUE, UnoCardValue.ONE);\n UnoCardColour wildColour = UnoCardColour.BLUE;\n utils.cardSelectionIsValid(cardSelection, drawCard, wildColour);\n \n }", "@Test\r\n public void testCompliment1() {\r\n int actual[] = set1.getComplement();\r\n Assert.assertArrayEquals(new int[] { 100, 200, 456, 234, 890, 990, 100,\r\n 210, 500, 700, 900 }, actual);\r\n }", "public static void VerifyCommonComponent_2DIVs_P(String renderingControl){\t\t\t\t\n\t\ttry{\n\t\t\tactualHeaderText=sitecoreObj.aboutusCommonComponent_2Divs_P.isDisplayed();\n\t\t\tAssert.assertEquals(actualHeaderText, true);\n\t\t\tlog.info(\"The Actual AboutUs \" + renderingControl + \" Description - <\"+sitecoreObj.aboutusCommonComponent_2Divs_P.getTagName()+\">\");\n\t\t\tlog.info(\"The Expected AboutUs \" + renderingControl + \" Description - <p>\");\t\n\t\t\tlog.info(\"TEST PASSED: The Actual and Expected AboutUs \" + renderingControl + \" Description are Same\");\n\t\t}catch(AssertionError e){\n\t\t\tlog.error(\"The Actual AboutUs \" + renderingControl + \" Description - <\"+sitecoreObj.aboutusCommonComponent_2Divs_P.getTagName()+\">\");\n\t\t\tlog.error(\"The Expected AboutUs \" + renderingControl + \" Description - <p>\");\t\t\t\t\t\t\n\t\t\tlog.error(\"TEST FAILED: The Actual and Expected AboutUs \" + renderingControl + \" Description are NOT same\");\n\t\t}catch(org.openqa.selenium.NoSuchElementException e){\n\t\t\tlog.error(\"TEST FAILED: There is No Description On \" + renderingControl + \" element\");\n\t\t}\n\t}", "public static void VerifyCommonComponent_3DIVs_H3(String renderingControl){\n\t\t\tboolean actualSideBySideText = false;\n\t\t\ttry{\n\t\t\t\tactualSideBySideText=sitecoreObj.aboutusCommonComponent_3DIVs_H3.isDisplayed();\n\t\t\t\tAssert.assertEquals(actualSideBySideText, true);\n\t\t\t\tlog.info(\"The Actual AboutUs \" + renderingControl + \" Text - <\"+sitecoreObj.aboutusCommonComponent_3DIVs_H3.getTagName()+\">\");\n\t\t\t\tlog.info(\"The Expected AboutUs \" + renderingControl + \" Text - <h3>\");\n\t\t\t\tlog.info(\"TEST PASSED: The Actual and Expected AboutUs \" + renderingControl + \" Texts are Same\");\n\t\t\t}catch(AssertionError e){\n\t\t\t\tlog.error(\"The Actual AboutUs \" + renderingControl + \" Text - <\"+sitecoreObj.aboutusCommonComponent_3DIVs_H3.getTagName()+\">\");\n\t\t\t\tlog.error(\"The Expected AboutUs \" + renderingControl + \" Text - <h3>\");\n\t\t\t\tlog.error(\"TEST FAILED: The Actual and Expected AboutUs \" + renderingControl + \" Texts are NOT same\");\n\t\t\t}catch(org.openqa.selenium.NoSuchElementException e){\n\t\t\t\tlog.error(\"TEST FAILED: There is No Text element On \" + renderingControl + \" Container\");\n\t\t\t}\t\t\n\t\t}", "@Test\r\n\tpublic void testAcquistareBigliettiE2(){\r\n\t\tOfferta o = new Offerta(\"standard\", 10, 25.0);\r\n\t\tCartaDiCredito carta = new CartaDiCredito(\"2334549359434\",23353.89);\r\n\t\tAbbonamento a = new Abbonamento(o);\r\n\t\tCliente c2 = new Cliente(\"4\",\"Mario\",\"Rossi\",\"[email protected]\",\r\n\t\t\t\t\"M\",\"333152497\",\"rossimario\",\"passw.\",\"passw.\",\"domanda segreta..\",carta);\r\n\t\tc2.setAbbonamento(a);\r\n\t\tp1.acquistareBiglietti(3,\"abbonamento\", c2);\r\n\t\t//i biglietti vengono inseriti nella lista prenotazioni e quindi ne\r\n\t\t//modificano la size\r\n\t\tassertEquals(3,c2.getPrenotazioni().size());\r\n\t}", "public static void VerifyCommonComponent_3DIVs_P(String renderingControl){\n\t\tboolean actualSideBySideText = false;\n\t\ttry{\n\t\t\tactualSideBySideText=sitecoreObj.aboutusCommonComponent_3DIVs_P.isDisplayed();\n\t\t\tAssert.assertEquals(actualSideBySideText, true);\n\t\t\tlog.info(\"The Actual AboutUs \" + renderingControl + \" Text - <\"+sitecoreObj.aboutusCommonComponent_3DIVs_P.getTagName()+\">\");\n\t\t\tlog.info(\"The Expected AboutUs \" + renderingControl + \" Text - <p>\");\n\t\t\tlog.info(\"TEST PASSED: The Actual and Expected AboutUs \" + renderingControl + \" Texts are Same\");\n\t\t}catch(AssertionError e){\n\t\t\tlog.error(\"The Actual AboutUs \" + renderingControl + \" Text - <\"+sitecoreObj.aboutusCommonComponent_3DIVs_P.getTagName()+\">\");\n\t\t\tlog.error(\"The Expected AboutUs \" + renderingControl + \" Text - <p>\");\n\t\t\tlog.error(\"TEST FAILED: The Actual and Expected AboutUs \" + renderingControl + \" Texts are NOT same\");\n\t\t}catch(org.openqa.selenium.NoSuchElementException e){\n\t\t\tlog.error(\"TEST FAILED: There is No Text element On \" + renderingControl + \" Container\");\n\t\t}\t\t\n\t}", "@Test\n public void testContainsBorder() {\n for (final Border border : Border.values()) {\n for (final Border test : Border.values()) {\n final String[] parts = test.toString().split(\"_\");\n for (final String part : parts) {\n final Border contains = Border.valueOf(part);\n if (border.toString().contains(part) || (border == Border.ALL && contains != Border.NONE)) {\n Assert.assertTrue(border + \" should contain \" + contains, border.containsBorder(contains));\n } else {\n Assert.assertFalse(border + \" shouldn't contain \" + contains, border.containsBorder(contains));\n }\n }\n }\n }\n }", "@Test\n public void test6() {\n DOM.getNewCarButton().click();\n DOM.getSaveButton().click();\n\n String content = DOM.getSubmitErr().getText();\n\n assertEquals(\"All fields are required\", content);\n assertEquals(5, DOM.getRows().size());\n }", "@Test\n\tpublic void testCrearEjercicio1(){\n\t\tEjercicio ej = new Ejercicio(1, true, Plataforma.getFechaActual().plusDays(1), Plataforma.getFechaActual().plusDays(4),\n\t\t\t\ttema1, \"Ejercicio1\", true, mates);\n\t\t\n\t\tassertTrue(tema1.getSubcontenido().contains(ej));\n\t\tassertEquals(ej.getAsignatura(), mates);\n\t\tassertEquals(ej.getEstado(), EstadoEjercicio.ESPERA);\n\t\tassertEquals(ej.getFechaFin(), Plataforma.getFechaActual().plusDays(4));\n\t\tassertEquals(ej.getFechaIni(), Plataforma.getFechaActual().plusDays(1));\n\t\tassertTrue(ej.getNotaMedia() == 0);\n\t\tassertTrue(ej.getNumTerminados() == 0);\n\t\tassertTrue(ej.getPadre() == tema1);\n\t\tassertTrue(ej.getPeso() == 1);\n\t\tassertEquals(ej.getTitulo(), \"Ejercicio1\");\n\t}", "@Test\n public void testAddPiece() {\n System.out.println(\"addPiece\");\n\n Piece piece = new Piece(PlayerColor.WHITE, 3);\n Player instance = new Player(PlayerColor.WHITE, \"\");\n\n instance.addPiece(piece);\n\n assertTrue(instance.getBagContent().contains(piece));\n }", "@org.junit.Test\n public void constrCompelemEnclexpr1() {\n final XQuery query = new XQuery(\n \"element elem {}\",\n ctx);\n try {\n result = new QT3Result(query.value());\n } catch(final Throwable trw) {\n result = new QT3Result(trw);\n } finally {\n query.close();\n }\n test(\n assertSerialization(\"<elem/>\", false)\n );\n }", "@org.junit.Test\n public void constrCompelemCompname11() {\n final XQuery query = new XQuery(\n \"element {'elem', ()} {'text'}\",\n ctx);\n try {\n result = new QT3Result(query.value());\n } catch(final Throwable trw) {\n result = new QT3Result(trw);\n } finally {\n query.close();\n }\n test(\n assertSerialization(\"<elem>text</elem>\", false)\n );\n }", "@Test\n\tpublic void testCrearEjercicio2(){\n\t\tEjercicio ej = new Ejercicio(1, true, Plataforma.getFechaActual().plusDays(3), Plataforma.getFechaActual().plusDays(2),\n\t\t\t\ttema1, \"Ejercicio1\", true, mates);\n\t\t\n\t\tassertEquals(ej.getFechaIni(), ej.getFechaIniDefecto());\n\t\tassertEquals(ej.getFechaFin(), ej.getFechaFinDefecto());\n\t\tassertTrue(tema1.getSubcontenido().contains(ej));\n\t}", "@Test(priority = 6)\n public void elementsOnDifferentElementsPageTest() {\n List<WebElement> checkboxesList = driver.findElements(By.className(\"label-checkbox\"));\n assertEquals(checkboxesList.size(), 4);\n List<WebElement> radioList = driver.findElements(By.className(\"label-radio\"));\n assertEquals(radioList.size(), 4);\n assertTrue(driver.findElement(By.className(\"colors\")).isDisplayed());\n assertTrue(driver.findElement(By.cssSelector(\"button[name='Default Button']\"))\n .isDisplayed());\n assertTrue(driver.findElement(By.cssSelector(\"input[value='Button']\"))\n .isDisplayed());\n }", "@Test\n public void test114() throws Throwable {\n ErrorPage errorPage0 = new ErrorPage();\n Table table0 = new Table(errorPage0, \"*f\");\n TableBlock tableBlock0 = table0.thead();\n Any any0 = tableBlock0.col();\n String[] stringArray0 = new String[8];\n // Undeclared exception!\n try {\n Component component0 = any0.area(stringArray0);\n fail(\"Expecting exception: RuntimeException\");\n \n } catch(RuntimeException e) {\n //\n // Can't add components to a component that is not an instance of IContainer.\n //\n }\n }", "@Test\n\tpublic static void testConstructorAndGetters() {\n\n\t\tCompoundMadeOfElement comp = new CompoundMadeOfElement(1, 2, 5);\n\t\tassertEquals(comp.getCompoundID(), 1);\n\t\tassertEquals(comp.getElementID(), 2);\n\t\tassertEquals(comp.getElementQuantity(), 5);\n\t}", "public static void VerifyCommonComponent_2DIVs_H3(String renderingControl){\n\t\tboolean actualFiveColumnContentTitle = false;\n\t\ttry{\n\t\t\tactualFiveColumnContentTitle=sitecoreObj.aboutusCommonComponent_2DIVs_H3.isDisplayed();\n\t\t\tAssert.assertEquals(actualFiveColumnContentTitle, true);\n\t\t\tlog.info(\"The Actual AboutUs \" + renderingControl + \" ContentTitle - <\"+sitecoreObj.aboutusCommonComponent_2DIVs_H3.getTagName()+\">\");\n\t\t\tlog.info(\"The Expected AboutUs \" + renderingControl + \" ContentTitle - <h3>\");\n\t\t\tlog.info(\"TEST PASSED: The Actual and Expected AboutUs \" + renderingControl + \" ContentTitle are Same\");\n\t\t}catch(AssertionError e){\n\t\t\tlog.error(\"The Actual AboutUs \" + renderingControl + \" ContentTitle - <\"+sitecoreObj.aboutusCommonComponent_2DIVs_H3.getTagName() +\">\");\n\t\t\tlog.error(\"The Expected AboutUs \" + renderingControl + \" ContentTitle - <h3>\");\n\t\t\tlog.error(\"TEST FAILED: The Actual and Expected AboutUs \" + renderingControl + \" ContentTitle are NOT same\");\n\t\t}catch(org.openqa.selenium.NoSuchElementException e){\n\t\t\tlog.error(\"TEST FAILED: There is No ContentTitle element On \" + renderingControl + \" Container\");\n\t\t}\t\t\n\t}", "@Test\n\t\tpublic void testGetElementByIdWithThreeElementsInDbReturnsSpecificElementFromDb() throws Exception{\n\t\t\n\t\t\t// GIVEN the database contains 3 elments\n\t\t\tthis.elementService.create(\n\t\t\t\t\t\"2020a.alik\",\n\t\t\t\t\t\"[email protected]\",\n\t\t\t\t\tnew ElementBoundary(\n\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\t\"name\",\n\t\t\t\t\t\t\t\"type\",\n\t\t\t\t\t\t\ttrue,\n\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\tnew User(new UserId(\"2020a.alik\",\"[email protected]\")),\n\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\tCollections.singletonMap(\"text\", \"test\")));\n\t\t\t\n\t\t\tthis.elementService.create(\n\t\t\t\t\t\"2020a.alik\",\n\t\t\t\t\t\"[email protected]\",\n\t\t\t\t\tnew ElementBoundary(\n\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\t\"name\",\n\t\t\t\t\t\t\t\"type\",\n\t\t\t\t\t\t\ttrue,\n\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\tnew User(new UserId(\"2020a.alik\",\"[email protected]\")),\n\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\tCollections.singletonMap(\"text\", \"test\")));\n\t\t\t\n\t\t\tElementBoundary e3 = this.elementService.create(\n\t\t\t\t\t\"2020a.alik\",\n\t\t\t\t\t\"[email protected]\",\n\t\t\t\t\tnew ElementBoundary(\n\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\t\"name\",\n\t\t\t\t\t\t\t\"type\",\n\t\t\t\t\t\t\ttrue,\n\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\tnew User(new UserId(\"2020a.alik\",\"[email protected]\")),\n\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\tCollections.singletonMap(\"text\", \"test\")));\n\t\t\t\n\t\t\t\n\t\t\t// WHEN we invoke GET /elements/{userDomain}/{userEmail}/{elementDomain}/{elementId} \n\t\t\tElementBoundary actual = \n\t\t\t\tthis.restTemple.getForObject(\n\t\t\t\t\tthis.baseUrl + \"/collab/elements/{userDomain}/{userEmail}/{elementDomain}/{elementId}\", \n\t\t\t\t\tElementBoundary.class ,\n\t\t\t\t\t\"2020a.alik\",\n\t\t\t\t\t\"[email protected]\",\n\t\t\t\t\te3.getElementId().getDomain(),\n\t\t\t\t\te3.getElementId().getId());\n\t\t\t\n\t\t\t\n\t\t\t// THEN the specific element with this id is returned\n\t\t\tassertThat(actual)\n\t\t\t.isNotNull()\n\t\t\t.usingRecursiveComparison()\n\t\t\t.isEqualTo(e3);\n\t\t}", "public static boolean occlusionTest(Iterable<? extends IMultipart> parts, AxisAlignedBB... boxes) {\n\n return occlusionTest(parts, null, boxes);\n }", "@Test\n\tpublic void verifyCombosOnBoard() {\n\t\tBoard board = boardFactory.fromTextGenerateBoard(\"/boards/1LineOf3.txt\", mockGroup);\n\t\tassertFalse(board.outOfMoves());\n\n\t}", "@Test(enabled = false)\n public void addPropertyInCompositionScreenDCAEAssetTest() throws Exception {\n createDCAEAsset();\n\n ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();\n\n CompositionPage.showPropertiesAndAttributesTab();\n List<PropertyTypeEnum> propertyList = Arrays.asList(PropertyTypeEnum.STRING, PropertyTypeEnum.INTEGER);\n int propertiesCount = CompositionPage.getProperties().size();\n for (PropertyTypeEnum prop : propertyList) {\n PropertiesUIUtils.addNewProperty(prop);\n }\n assertTrue(GeneralUIUtils.checkElementsCountInTable(propertiesCount + propertyList.size(), () -> CompositionPage.getProperties()));\n }", "@Test\n\tpublic void testElementAddedEvent() {\n\t\tfinal DiagramElement newElement = new DiagramElement(diagram, 1, dummyBoh,\n\t\t\t\tnew RelativeBusinessObjectReference(\"1\"));\n\t\tdiagram.modify(\"Add Element\", m -> m.addElement(newElement));\n\n\t\tassertThat(ml.elementAddedEventsReceived, is(equalTo(1)));\n\t\tassertThat(ml.modificationsCompletedEventsReceived, is(equalTo(1)));\n\t\tassertThat(ml.getTotalEventsReceived(), is(equalTo(2)));\n\t}", "@org.junit.Test\n public void k2ComputeConElem12() {\n final XQuery query = new XQuery(\n \"declare construction strip; element e {\\\"content\\\"} instance of element(b, xs:untyped)\",\n ctx);\n try {\n result = new QT3Result(query.value());\n } catch(final Throwable trw) {\n result = new QT3Result(trw);\n } finally {\n query.close();\n }\n test(\n assertBoolean(false)\n );\n }", "@Test(timeout = 4000)\n public void test168() throws Throwable {\n ErrorPage errorPage0 = new ErrorPage();\n StringSelectModel stringSelectModel0 = new StringSelectModel();\n ElExpression elExpression0 = new ElExpression(\"P9E)sdEA%r\\\"6\");\n CheckboxGroup checkboxGroup0 = new CheckboxGroup(errorPage0, \"P9E)sdEA%r\\\"6\", \"P9E)sdEA%r\\\"6\", stringSelectModel0, elExpression0);\n Integer integer0 = new Integer((-1));\n Link link0 = new Link(checkboxGroup0, integer0);\n TableBlock tableBlock0 = new TableBlock(link0);\n Any any0 = tableBlock0.col();\n // Undeclared exception!\n try { \n any0.big((Object) link0);\n fail(\"Expecting exception: RuntimeException\");\n \n } catch(RuntimeException e) {\n //\n // Can't add components to a component that is not an instance of IContainer.\n //\n verifyException(\"wheel.components.Component\", e);\n }\n }", "@Test\n public void test113() throws Throwable {\n ErrorPage errorPage0 = new ErrorPage();\n Checkbox checkbox0 = new Checkbox(errorPage0, \"Col component can e added onlG to a TableBlock.\", \"Col component can e added onlG to a TableBlock.\");\n // Undeclared exception!\n try {\n Component component0 = checkbox0.acronym((Object) \"Col component can e added onlG to a TableBlock.\");\n fail(\"Expecting exception: RuntimeException\");\n \n } catch(RuntimeException e) {\n //\n // Can't add components to a component that is not an instance of IContainer.\n //\n }\n }", "@Test\n public void testASSY1HasNoSubComponents() {\n assertThat( hasSubComponents( ASSY1_WITHOT_SUB_COMP ), is( false ) );\n }", "@Entao(\"o sistema deve exibir o form de busca por Componentes\")\n public void o_sistema_deve_exibir_o_form_de_busca_por_componentes() {\n String expected;\n expected = \"Consulta de Componentes Curriculares\";\n String actual = driver.findElement(By.cssSelector(\"#corpo > h2\")).getText();\n Assert.assertEquals(expected, actual);\n }", "@Test\n\tpublic void verifyEditDeleteAndPromoteOptionsAreDisplayingForPublishedAds() throws Exception {\n\t\tAllStockTradusPROPage AllStockPage= new AllStockTradusPROPage(driver);\n\t\tLoginTradusPROPage loginPage = new LoginTradusPROPage(driver);\n\t\tloginPage.setAccountEmailAndPassword(userName, pwd);\n\t\tjsClick(driver, loginPage.LoginButton);\n\t\texplicitWaitFortheElementTobeVisible(driver, AllStockPage.myStockOptioninSiderBar);\n\t\tjsClick(driver, AllStockPage.myStockOptioninSiderBar);\n\t\texplicitWaitFortheElementTobeVisible(driver, AllStockPage.allMyStockOptioninSiderBar);\n\t\tjsClick(driver, AllStockPage.allMyStockOptioninSiderBar);\n\t\texplicitWaitFortheElementTobeVisible(driver, AllStockPage.MyStockText);\n\t\twaitTill(3000);\n\t\twhile(!verifyElementPresent(AllStockPage.tradusLinkforMANtires)) {\n\t\t\tdriver.navigate().refresh();\n\t\t\twaitTill(3000);\n\t\t}\n\t\t/*Assert.assertEquals(AllStockPage.PostedAds.size(), 2, \n\t\t\t\t\"No of ads found is not showing as 2 ads\");*/\n\t\tfor(int i=0; i<AllStockPage.PostedAds.size();i++)\n\t\t{\n\t\t\tswitch(i) {\n\t\t\tcase 0: Assert.assertTrue(verifyElementPresent(AllStockPage.EditOptionOnPostedAds.get(i)),\n\t\t\t\t \"Edit option is not displaying for 1st ad in all stock page\");\n\t\t\tAssert.assertTrue(verifyElementPresent(AllStockPage.DeleteOptionOnPostedAds.get(i)),\n\t\t\t\t \"Delete option is not displaying for 1st ad in all stock page\");\n\t\t\tAssert.assertTrue(verifyElementPresent(AllStockPage.PromoteOptionOnPostedAds.get(i)),\n\t\t\t\t \"Promote option is not displaying for 1st ad in all stock page\");break;\n\t\t\tcase 1: Assert.assertTrue(verifyElementPresent(AllStockPage.EditOptionOnPostedAds.get(i)),\n\t\t\t\t \"Edit option is not displaying for 2nd ad in all stock page\");\n\t\t\tAssert.assertTrue(verifyElementPresent(AllStockPage.DeleteOptionOnPostedAds.get(i)),\n\t\t\t\t \"Delete option is not displaying for 2nd ad in all stock page\");\n\t\t\tAssert.assertTrue(verifyElementPresent(AllStockPage.PromoteOptionOnPostedAds.get(i)),\n\t\t\t\t \"Promote option is not displaying for 2nd ad in all stock page\");\n\t\t\t}\n\t\t\t}\n\t}", "public static void VerifyCommonComponent_4DIVs_H3(String renderingControl){\n\t\t\tboolean actualSideBySideCenteredTitle = false;\n\t\t\ttry{\n\t\t\t\tactualSideBySideCenteredTitle=sitecoreObj.aboutusCommonComponent_4DIVs_H3.isDisplayed();\n\t\t\t\tAssert.assertEquals(actualSideBySideCenteredTitle, true);\n\t\t\t\tlog.info(\"The Actual AboutUs \" + renderingControl + \" Title - <\"+sitecoreObj.aboutusCommonComponent_4DIVs_H3.getTagName()+\">\");\n\t\t\t\tlog.info(\"The Expected AboutUs \" + renderingControl + \" Title - <h2>\");\n\t\t\t\tlog.info(\"TEST PASSED: The Actual and Expected AboutUs \" + renderingControl + \" Titles are Same\");\n\t\t\t}catch(AssertionError e){\n\t\t\t\tlog.error(\"The Actual AboutUs \" + renderingControl + \" Title - <\"+sitecoreObj.aboutusCommonComponent_4DIVs_H3.getTagName()+\">\");\n\t\t\t\tlog.error(\"The Expected AboutUs \" + renderingControl + \" Title - <h2>\");\n\t\t\t\tlog.error(\"TEST FAILED: The Actual and Expected AboutUs \" + renderingControl + \" Titles are NOT same\");\n\t\t\t}catch(org.openqa.selenium.NoSuchElementException e){\n\t\t\t\tlog.error(\"TEST FAILED: There is No Title element On \" + renderingControl + \" Container\");\n\t\t\t}\t\t\n\t\t}", "public void testPublicKeyECFields() throws Exception {\r\n CVCertificateBody bodyIS = createBody(AuthorizationRoleEnum.IS);\r\n CVCertificateBody bodyCVCA = createBody(AuthorizationRoleEnum.CVCA);\r\n\r\n CVCObject cvcObjIS = CertificateParser.parseCVCObject(bodyIS.getDEREncoded());\r\n CVCObject cvcObjCVCA = CertificateParser.parseCVCObject(bodyCVCA.getDEREncoded());\r\n assertTrue(\"CVCObj not a CVCertificateBody\", cvcObjIS.getTag()==CVCTagEnum.CERTIFICATE_BODY);\r\n\r\n // IS certificate must contain only two EC public key subfields\r\n PublicKeyEC ecKey1 = (PublicKeyEC)((CVCertificateBody)cvcObjIS).getPublicKey();\r\n assertEquals(\"Number of PublicKey subfields\", 2, ecKey1.getSubfields().size());\r\n\r\n // CVCA certificate must contain all eight EC public key subfields\r\n PublicKeyEC ecKey2 = (PublicKeyEC)((CVCertificateBody)cvcObjCVCA).getPublicKey();\r\n assertEquals(\"Number of PublicKey subfields\", 8, ecKey2.getSubfields().size());\r\n\r\n\r\n // Create a request\r\n KeyPairGenerator keyGen = KeyPairGenerator.getInstance(\"ECDSA\", \"BC\");\r\n keyGen.initialize(256, new SecureRandom());\r\n KeyPair keyPair = keyGen.generateKeyPair();\r\n CVCertificate req = CertificateGenerator.createRequest(\r\n keyPair, \r\n \"SHA256WITHECDSA\",\r\n new HolderReferenceField(\"SE\", \"KLMNOPQ\", \"00001\")\r\n );\r\n // All EC public key subfields must be present in a CVC-request\r\n CVCPublicKey pubKey = req.getCertificateBody().getPublicKey();\r\n assertEquals(\"Number of EC subfields\", 8, pubKey.getSubfields().size());\r\n }" ]
[ "0.7902646", "0.7899136", "0.7667408", "0.7598966", "0.63644123", "0.61449534", "0.5830734", "0.57333016", "0.56694055", "0.5608604", "0.5533267", "0.5452142", "0.5445305", "0.5433261", "0.5401472", "0.534889", "0.5311948", "0.528261", "0.5263272", "0.5242005", "0.52287114", "0.52261454", "0.5194491", "0.5188592", "0.5182873", "0.5176376", "0.51677024", "0.5151996", "0.5146749", "0.5139252", "0.5138742", "0.5129913", "0.5116478", "0.511348", "0.50931525", "0.5081262", "0.5080233", "0.5072906", "0.50614524", "0.5043181", "0.50091416", "0.5003192", "0.49968624", "0.4990077", "0.4976489", "0.49702096", "0.49684805", "0.496534", "0.49608558", "0.49607208", "0.49574047", "0.49482343", "0.49437958", "0.49427795", "0.49362844", "0.49349892", "0.49274725", "0.49094978", "0.4907276", "0.4907223", "0.49055615", "0.49016678", "0.49014288", "0.48914182", "0.48897088", "0.48879975", "0.4885478", "0.48850974", "0.48805416", "0.48791194", "0.48758388", "0.48623508", "0.48596758", "0.485122", "0.48510212", "0.48464048", "0.48429704", "0.4840569", "0.48379058", "0.48277825", "0.48256394", "0.4824602", "0.48203918", "0.48179355", "0.48112494", "0.48098293", "0.480672", "0.48061377", "0.47962847", "0.47893178", "0.4781405", "0.47756526", "0.47662848", "0.4765883", "0.47610676", "0.47571963", "0.47512025", "0.4750992", "0.47505286", "0.47483182" ]
0.8064177
0
Asserts that the specified Composite contains the specified elements and EOC.
private static void assertComposite(Composite composite, EOC eoc, ByteBuffer... elements) { assertEquals("the composite size is not the expected one:", elements.length, composite.size()); for (int i = 0, m = elements.length; i < m; i++) { ByteBuffer element = elements[i]; assertTrue(String.format("the element %s of the composite is not the expected one: expected %s but was %s", i, ByteBufferUtil.toInt(element), ByteBufferUtil.toInt(composite.get(i))), element.equals(composite.get(i))); } assertEquals("the EOC of the composite is not the expected one:", eoc, composite.eoc()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void assertComposite(Composite composite,\n ByteBuffer firstElement,\n ByteBuffer secondElement,\n ByteBuffer thirdElement,\n EOC eoc)\n {\n assertComposite(composite, eoc, firstElement, secondElement, thirdElement);\n }", "private static void assertComposite(Composite composite,\n ByteBuffer firstElement,\n ByteBuffer secondElement,\n ByteBuffer thirdElement,\n ByteBuffer fourthElement,\n EOC eoc)\n {\n assertComposite(composite, eoc, firstElement, secondElement, thirdElement, fourthElement);\n }", "private static void assertComposite(Composite composite, ByteBuffer firstElement, ByteBuffer secondElement, EOC eoc)\n {\n assertComposite(composite, eoc, firstElement, secondElement);\n }", "private static void assertComposite(Composite composite, ByteBuffer element, EOC eoc)\n {\n assertComposite(composite, eoc, element);\n }", "@Test\r\n public void testComposite() {\r\n \r\n Leaf pers1 = new Leaf(\"Tracy\");\r\n Leaf pers2 = new Leaf(\"JR\");\r\n Leaf pers3 = new Leaf(\"Simon\");\r\n \r\n Composite comp1 = new Composite();\r\n comp1.add(pers1);\r\n comp1.add(pers2);\r\n comp1.add(pers3);\r\n \r\n //Assert.assertEquals(pers1.sayHello(), \"Tracy person says hello\");\r\n Assert.assertNotNull(comp1);\r\n \r\n \r\n }", "private static void assertEmptyComposite(Composite composite)\n {\n assertEquals(Composites.EMPTY, composite);\n }", "@Test\n public void extraElements() {\n assertEmpty(mReactor.getCompounds(getElements(\"Start\", \"A\", \"Fin\", \"Start\")));\n // Each reaction producing a compound should be detected separately.\n assertEmpty(mReactor.getCompounds(getElements(\"Start\", \"A\", \"Fin\", \"Start\", \"A\", \"Fin\")));\n }", "@Test\n public void testContainsAll_Contains() {\n\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>();\n instance.add(3);\n instance.add(2);\n instance.add(1);\n instance.add(4);\n\n Collection c = Arrays.asList(1, 2, 3);\n\n boolean expResult = true;\n boolean result = instance.containsAll(c);\n assertEquals(expResult, result);\n }", "public void testAddIndivisibleElementsThatPermitStyles() throws Exception {\n String[] elements = { \"a\", \"b\", \"c\" };\n cfg.addIndivisibleElementsThatPermitStyles(elements);\n\n String[] moreElements = { \"c\", \"d\" };\n cfg.addIndivisibleElementsThatPermitStyles(moreElements);\n\n Set set = (Set)PrivateAccessor.getField(\n cfg, \"indivisibleElementsThatPermitStyles\");\n assertEquals(\"Should have added and merged all elements:\",\n 6, set.size());\n\n for (int i = 0; i < elements.length; i++) {\n assertTrue(\"Should be in list: \", set.contains(elements[i]));\n }\n for (int i = 0; i < moreElements.length; i++) {\n assertTrue(\"Should be in list: \", set.contains(moreElements[i]));\n }\n }", "public void verify_AddSubCategoriesPage_DisplayedElements() {\n\n\t\tboolean bstatus;\n\n\t\tbstatus = isElementDisplayed(select_mainCategory, true);\n\t\tReporter.log(bstatus, \"Main Category drop displayed \", \"Main Category drop down not displayed\");\n\n\t\tbstatus = isElementDisplayed(edit_SubCategory, true);\n\t\tReporter.log(bstatus, \"Sub Category text field displayed\", \"Sub Category text field not displayed\");\n\n\t\tbstatus = isElementDisplayed(select_AssignedOrder, true);\n\t\tReporter.log(bstatus, \"Assigned order drop down displayed\", \"Assigned order drop down not displayed\");\n\n\t\tbstatus = isElementDisplayed(btn_Submit, true);\n\t\tReporter.log(bstatus, \"Submit button displayed\", \"Submit button not displayed\");\n\n\t}", "@Test (expected=AjoutException.class)\n\tpublic void test1E() {\n\t\tConvoi c = new Convoi\t\n\t\t\t\t.Builder(\"vehicules\", \"Paris\")\n\t\t\t\t.build();\n\t\tConvoi c2 = new Convoi\t\n\t\t\t\t.Builder(\"camions\", \"Paris\")\n\t\t\t\t.build();\n\t\tc.add(c2);\n\t\tc2.add(c);\n\t}", "@Test\n public void testACFTHasSubComponents() {\n assertThat( hasSubComponents( ACFT ), is( true ) );\n }", "@Test\n\tpublic void moreComplexAssertion() {\n\t\tOrder order1 = null, order2 = null, order3 = null, order4 = null;\n\t\t// when\n\t\tList<Order> orders = null;// orderSearchService.getOrders(trader,\n\t\t\t\t\t\t\t\t\t// tradingAcct, goldIsinCode);\n\t\t// then\n\t\t// Using Basic JUnit\n\t\tassertEquals(orders.size(), 2);\n\t\tIterator<Order> itr = orders.iterator();\n\t\tassertEquals(itr.next(), order3);\n\t\tassertEquals(itr.next(), order4);\n\t\t// Using Hamcrest\n\t\tassertThat(orders, hasItems(order3, order4));\n\t\tassertThat(orders.size(), is(2));\n\t\t// Using FEST Assertions\n\t\tassertThat(orders).containsOnly(order3, order4);\n\t\t// Using FEST Assertions (chained assertions)\n\t\tassertThat(orders).containsOnly(order3, order4).containsSequence(order3, order4);\n\t}", "private List<String> validateComposingElements(\n\t\t\tChemicalAssociationBean assocBean, List<String> msgs) {\n\t\t String compTypeA = assocBean.getAssociatedElementA().getCompositionType();\n\t\t String compTypeB = assocBean.getAssociatedElementB().getCompositionType();\n\t\t\t\n\t\t if((compTypeA!=null)&&(compTypeA.equalsIgnoreCase(\"nanomaterial entity\"))&&(assocBean.getAssociatedElementA().getEntityDisplayName()!=null)){\n\t\t\t\tif(assocBean.getAssociatedElementA().getComposingElement().getId()==null)\n\t\t\t\t\t\tmsgs.add(\"Choosing an element on the left is required.\");\n\t\t\t}\n\t\t\tif((compTypeB!=null)&&(compTypeB.equalsIgnoreCase(\"nanomaterial entity\"))&&(assocBean.getAssociatedElementB().getEntityDisplayName()!=null)){\n\t\t\t\tif(assocBean.getAssociatedElementB().getComposingElement().getId()==null)\n\t\t\t\t\t\tmsgs.add(\"Choosing an element on the right is required.\");\n\t\t\t}\n\t\t\treturn msgs;\n\t}", "@Test\n public void testTRK1HasSubComponents() {\n assertThat( hasSubComponents( TRK1_WITH_SUB_COMP ), is( true ) );\n }", "@Test\n public void testContainsAll_Not_Contain() {\n\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>();\n instance.add(3);\n instance.add(2);\n instance.add(1);\n instance.add(4);\n\n Collection c = Arrays.asList(1, 2, 5);\n\n boolean expResult = false;\n boolean result = instance.containsAll(c);\n assertEquals(expResult, result);\n }", "@Test\n public void testIsComposite() {\n Tag tag = new BaseTag();\n assertFalse(\"BaseTag reported as composite\", tag.isComposite());\n }", "public void testAddDivisibleElementsThatPermitStyles() throws Exception {\n String[] elements = { \"a\", \"b\", \"c\" };\n cfg.addDivisibleElementsThatPermitStyles(elements);\n\n String[] moreElements = { \"c\", \"d\" };\n cfg.addDivisibleElementsThatPermitStyles(moreElements);\n\n Set set = (Set)PrivateAccessor.getField(\n cfg, \"divisibleElementsThatPermitStyles\");\n assertEquals(\"Should have added and merged all elements:\",\n 4, set.size());\n\n for (int i = 0; i < elements.length; i++) {\n assertTrue(\"Should be in list: \", set.contains(elements[i]));\n }\n for (int i = 0; i < moreElements.length; i++) {\n assertTrue(\"Should be in list: \", set.contains(moreElements[i]));\n }\n }", "private static void testContains(BagInterface<String> aBag, String[] tests)\n {\n System.out.println(\"\\nTesting the method contains:\");\n for (int index = 0; index < tests.length; index++)\n System.out.println(\"Does this bag contain \" + tests[index] +\n \"? \" + aBag.contains(tests[index]));\n }", "@Step(\"There are the following elements on Different Elements page: 4 checkboxes, 4 radios, 1 dropdown, 2 buttons\")\n public void checkElements() {\n checkboxes.shouldHaveSize(4);\n radios.shouldHaveSize(4);\n dropdown.shouldBe(Condition.exist);\n buttons.shouldHaveSize(2);\n }", "@Test\n void contains() {\n Cuboid cuboid1 = new Cuboid(4, 4, 4);\n Point3D point1 = new Point3D(0,0,0);\n assertEquals(true, cuboid1.contains(point1));\n\n Point3D point2 = new Point3D(0,0,2);\n assertEquals(true, cuboid1.contains(point2));\n\n Point3D point3 = new Point3D(0,0,-2);\n assertEquals(true, cuboid1.contains(point3));\n\n Point3D point4 = new Point3D(0,2,0);\n assertEquals(true, cuboid1.contains(point4));\n\n Point3D point5 = new Point3D(0,-2,0);\n assertEquals(true, cuboid1.contains(point5));\n\n Point3D point6 = new Point3D(2,0,0);\n assertEquals(true, cuboid1.contains(point6));\n\n Point3D point7 = new Point3D(-2,0,0);\n assertEquals(true, cuboid1.contains(point7));\n\n Point3D point8 = new Point3D(-2,-2,-2);\n assertEquals(true, cuboid1.contains(point8));\n\n Point3D point9 = new Point3D(-2,-2,-3);\n assertEquals(false, cuboid1.contains(point9));\n\n\n //Arbitary orientation\n Cuboid cuboid2 = new Cuboid(4, 5, 7, new Ray(new Point3D(-2,-2,-2), new Vector3D(1,1,1)));\n Point3D point21 = new Point3D(-1,-1,-1);\n assertEquals(true, cuboid2.contains(point21));\n\n Cuboid cuboid3 = new Cuboid(4, 5, 6, new Ray(new Point3D(-2,-2,-2), new Vector3D(1,1,1)));\n Point3D point31 = new Point3D(0,0,0);\n assertEquals(false, cuboid3.contains(point31));\n\n Cuboid cuboid4 = new Cuboid(4, 5, 6, new Ray(new Point3D(0,0,0), new Vector3D(1,1,1)));\n Point3D point41 = new Point3D(2.5,2.5,2.5);\n assertEquals(false, cuboid4.contains(point41));\n\n Cuboid cuboid5 = new Cuboid(4, 5, 6, new Ray(new Point3D(-2,-2,-2), new Vector3D(0,0,1)));\n Point3D point51 = new Point3D(-2,-2,3.5);\n assertEquals(false, cuboid5.contains(point51));\n }", "@Test\n public void testContainsAll_Contains_Overflow() {\n\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>(2, 2);\n instance.add(3);\n instance.add(2);\n instance.add(1);\n instance.add(4);\n instance.add(5);\n instance.add(4);\n instance.add(7);\n\n Collection c = Arrays.asList(3, 4, 5, 7);\n\n boolean expResult = true;\n boolean result = instance.containsAll(c);\n assertEquals(expResult, result);\n }", "@Test\n public void testASSY2HasSubComponents() {\n assertThat( hasSubComponents( ASSY2_WITH_SUB_COMP ), is( true ) );\n }", "private void testContainer(Component comp) {\n if ((comp instanceof Container) && !(comp instanceof JComboBox)){\n Container container = (Container)comp;\n Component[] children = container.getComponents();\n \n for (int c = 0; c < children.length; c++){\n tests(children[c]);\n }\n }\n }", "private void checkProperties(Configuration compositeConfiguration)\n {\n assertTrue(\"Make sure we have loaded our key\", compositeConfiguration\n .getBoolean(\"test.boolean\"));\n assertEquals(\"I'm complex!\", compositeConfiguration\n .getProperty(\"element2.subelement.subsubelement\"));\n assertEquals(\"property in the XMLPropertiesConfiguration\", \"value1\",\n compositeConfiguration.getProperty(\"key1\"));\n }", "@Rollback\n @Test\n public void getAllCreditOperationsByCreditFamilyId() {\n expectedCollection.add(creditOperationFamilyExpected);\n\n //AssertUtils.assertCreditOperationsCollections(expectedCollection, actualCollection);\n }", "static <T extends DbDataItem> void assertSetContainsGivenElements(EqualityAsserter<T> comparator, Set<T> set, T... elements) {\n Set<T> set2 = new HashSet<T>(Arrays.asList(elements));\n \n assertSetsEqual(comparator, set2, set);\n }", "@Ignore\r\n @Test\r\n public void testContainsCollection() {\r\n System.out.println(\"containsCollection\");\r\n NumberCollection nc = null;\r\n NumberCollection instance = new NumberCollection();\r\n boolean expResult = false;\r\n boolean result = instance.containsCollection(nc);\r\n assertEquals(expResult, result);\r\n \r\n }", "public MockAggregateEvent(List<QuoteEvent> inCompositeEvents)\n {\n this(new Date(),\n new Equity(\"METC\"));\n compositeEvents.addAll(inCompositeEvents);\n }", "@Test\n public void test_compteAvecOperations(){\n \t\n \tCompte c = serviceCompte.rechercherCompteAvecOperations(1L);\n \tSystem.out.println(\"compte_1 : \"+c);\n \tfor(Operation op : c.getOperations()){\n \t\tSystem.out.println(\"\\t\"+op);\n \t}\n \tAssert.assertTrue(c.getOperations().size()>0);\n }", "@Test\n public void handleCompositeCommand1() {\n }", "@Test\r\n public void testContains() {\r\n System.out.println(\"contains\");\r\n ModeloListaOrganizadores instance = new ModeloListaOrganizadores(e.getListaOrganizadores());\r\n Organizador o =new Organizador(new Utilizador(\"teste\", \"[email protected]\", \"teste\", \"teste\", true, 5));\r\n instance.addElement(o);\r\n boolean expResult = true;\r\n boolean result = instance.contains(o);\r\n assertEquals(expResult, result);\r\n \r\n }", "@Test\n public void testContainsAll_Not_Contain_Overflow() {\n\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>(2, 2);\n instance.add(3);\n instance.add(2);\n instance.add(1);\n instance.add(4);\n instance.add(5);\n instance.add(4);\n instance.add(7);\n\n Collection c = Arrays.asList(1, 2, 5, 8);\n\n boolean expResult = false;\n boolean result = instance.containsAll(c);\n assertEquals(expResult, result);\n }", "@Test\n public void testContains_Contain() {\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>();\n instance.add(1);\n instance.add(2);\n instance.add(3);\n\n boolean expResult = true;\n boolean result = instance.contains(1);\n assertEquals(expResult, result);\n }", "@Test(priority = 5, dependsOnMethods = { \"verifySubscriptionPageComponents\" }, groups = { \"Smoke\" })\n\tpublic static void verifyGridComponents() throws InterruptedException {\n\n\t\ttest = report.startTest(\"Verify Components of Grid\");\n\n//\t\t//Verify Columns of Grid\n//\t\tString columnsGrid = driver.findElement(By.xpath(xpathColumnOfgrid)).getText();\n//\t\tAssert.assertEquals(columnsGrid,\"S. noSubscription NameSubscription IdDescriptionCreated OnAction\");\n//\t\ttest.log(LogStatus.PASS, \"Column Of Grid\", \"All Column are Displaying\");\n\n\t\t// verify any row in grid is displaying or not\n\n\t\tboolean rowInGrid = driver.findElement(By.xpath(xpathRowInGrid)).getText().isEmpty();\n\t\tAssert.assertFalse(rowInGrid);\n\t\ttest.log(LogStatus.PASS, \"Row In Grid\", \"Row In Grid is displaying\");\n\n\t\t// verify Delete and Edit Buttons\n\t\tWebElement deleteButton = driver.findElement(By.className(classDeleteButton));\n\t\tAssert.assertTrue(deleteButton.isEnabled());\n\t\ttest.log(LogStatus.PASS, \"Delete Button\", \"Delete Button is displaying and Enabled\");\n\t\tWebElement editButton = driver.findElement(By.className(\"editlink\"));\n\t\tAssert.assertTrue(editButton.isEnabled());\n\t\ttest.log(LogStatus.PASS, \"Edit Button\", \"Edit Button is displaying and Enabled\");\n\t}", "public static boolean occlusionTest(Iterable<? extends IMultipart> parts, AxisAlignedBB... boxes) {\n\n return occlusionTest(parts, null, boxes);\n }", "@Test\r\n public void testCommissionCases() throws Exception\r\n {\r\n String epcToCheck = \"urn:epc:id:sgtin:0614141.107340.1\";\r\n XmlObjectEventType event = dbHelper.getObjectEventByEpc(epcToCheck);\r\n Assert.assertNull(event);\r\n\r\n runCaptureTest(COMMISSION_CASES_XML);\r\n\r\n event = dbHelper.getObjectEventByEpc(epcToCheck);\r\n Assert.assertNotNull(event);\r\n }", "@Test \n\t@DisplayName(\"combinacion[i] == null || (combinacionSecreta[i] == null\")\n\tvoid elementoDeCombinacionNoEsCasilla1Test(){ \n\t\tCombinacion combinacionFacil = new Combinacion(dificultadFacil);\n\t\tCombinacion combinacionSecretaFacil = new Combinacion(dificultadFacil);\n\t\tCombinacion combinacionGanaFacil = new Combinacion(dificultadFacil);\n\t\t\n\t\tcombinacionFacil.anadirCasilla(new Casilla(Color.FONDO_ROJOCLARO));\n\t\tcombinacionFacil.anadirCasilla(new Casilla(Color.FONDO_AZUL));\n\t\tcombinacionFacil.anadirCasilla(null);\n\t\tcombinacionFacil.anadirCasilla(new Casilla(Color.FONDO_AMARILLOCLARO));\n\t\t\n\t\tcombinacionSecretaFacil.anadirCasilla(new Casilla(Color.FONDO_ROJOCLARO));\n\t\tcombinacionSecretaFacil.anadirCasilla(new Casilla(Color.FONDO_AMARILLOCLARO));\n\t\tcombinacionSecretaFacil.anadirCasilla(new Casilla(Color.FONDO_MORADOCLARO));\n\t\tcombinacionSecretaFacil.anadirCasilla(new Casilla(Color.FONDO_AZUL));\n\t\n\t\tcombinacionGanaFacil.anadirCasilla(new Casilla(Color.FONDO_ROJOCLARO));\n\t\tcombinacionGanaFacil.anadirCasilla(new Casilla(Color.FONDO_BLANCO));\n\t\tcombinacionGanaFacil.anadirCasilla(new Casilla(Color.FONDO_BLANCO));\n\t\tcombinacionGanaFacil.anadirCasilla(new Casilla(Color.FONDO_NEGRO));\n\t\t\n\t\tAssert.assertEquals(combinacionGanaFacil, combinacionFacil.calcularResultado(combinacionSecretaFacil));\n\t}", "@Test\n public void testComplexCompositeDataExtractor() throws Exception {\n final String[] compositePropertyNames = new String[2];\n compositePropertyNames[0] = \"Count\";\n compositePropertyNames[1] = \"Latency\";\n\n final String[] compositePropertyDescriptions = new String[2];\n compositePropertyDescriptions[0] = \"Count of requests received for the command\";\n compositePropertyDescriptions[1] = \"Average Time Taken to process the command\";\n\n final OpenType[] compositePropertyTypes = new OpenType[2];\n compositePropertyTypes[0] = SimpleType.LONG;\n compositePropertyTypes[1] = SimpleType.FLOAT;\n\n final CompositeType compositeType =\n new CompositeType(\"Command Stats\", \"Stats for each command\",\n compositePropertyNames, compositePropertyDescriptions,\n compositePropertyTypes);\n\n final Object[] loginCompositeValues = new Object[compositePropertyNames.length];\n loginCompositeValues[0] = new Long(10);\n loginCompositeValues[1] = new Float(38.34f);\n\n final Object[] logoutCompositeValues = new Object[compositePropertyNames.length];\n logoutCompositeValues[0] = new Long(30);\n logoutCompositeValues[1] = new Float(26.09f);\n\n final Object[] capaCompositeValues = new Object[compositePropertyNames.length];\n capaCompositeValues[0] = new Long(89);\n capaCompositeValues[1] = new Float(103.09f);\n\n final String[] complexCompositePropertyNames = new String[3];\n complexCompositePropertyNames[0] = \"Login\";\n complexCompositePropertyNames[1] = \"Logout\";\n complexCompositePropertyNames[2] = \"Capability\";\n\n CompositeData[] complexDataValues = new CompositeData[complexCompositePropertyNames.length];\n complexDataValues[0] =\n new CompositeDataSupport(compositeType, compositePropertyNames, loginCompositeValues);\n complexDataValues[1] =\n new CompositeDataSupport(compositeType, compositePropertyNames, logoutCompositeValues);\n complexDataValues[2] =\n new CompositeDataSupport(compositeType, compositePropertyNames, capaCompositeValues);\n\n final OpenType[] complexCompositePropertyTypes = new OpenType[3];\n complexCompositePropertyTypes[0] = compositeType;\n complexCompositePropertyTypes[1] = compositeType;\n complexCompositePropertyTypes[2] = compositeType;\n\n final String[] complexCompositePropertyDescriptions = new String[3];\n complexCompositePropertyDescriptions[0] =\n \"Command Stats for \" + complexCompositePropertyNames[0];\n complexCompositePropertyDescriptions[1] =\n \"Command Stats for \" + complexCompositePropertyNames[1];\n complexCompositePropertyDescriptions[2] =\n \"Command Stats for \" + complexCompositePropertyNames[2];\n\n final CompositeType complexCompositeType =\n new CompositeType(\"Commands\", \"Stats for all commands\",\n complexCompositePropertyNames, complexCompositePropertyDescriptions,\n complexCompositePropertyTypes);\n\n CompositeData complexData =\n new CompositeDataSupport(complexCompositeType, complexCompositePropertyNames,\n complexDataValues);\n\n ObjectToJsonConverter jsonConverter = new ObjectToJsonConverter();\n JsonElement jsonElement = jsonConverter.extractObject(complexData);\n Assert.assertNotNull(jsonElement);\n\n JsonElement capability = jsonElement.getAsJsonObject().get(\"Capability\");\n Assert.assertNotNull(capability);\n JsonElement count = capability.getAsJsonObject().get(\"Count\");\n Assert.assertNotNull(count);\n Assert.assertEquals(count.getAsLong(), 89);\n JsonElement latency = capability.getAsJsonObject().get(\"Latency\");\n Assert.assertNotNull(latency);\n Assert.assertEquals(latency.getAsFloat(), 103.09f);\n\n JsonElement login = jsonElement.getAsJsonObject().get(\"Login\");\n Assert.assertNotNull(login);\n count = login.getAsJsonObject().get(\"Count\");\n Assert.assertNotNull(count);\n Assert.assertEquals(count.getAsLong(), 10);\n latency = login.getAsJsonObject().get(\"Latency\");\n Assert.assertNotNull(latency);\n Assert.assertEquals(latency.getAsFloat(), 38.34f);\n\n JsonElement logout = jsonElement.getAsJsonObject().get(\"Logout\");\n Assert.assertNotNull(logout);\n count = logout.getAsJsonObject().get(\"Count\");\n Assert.assertNotNull(count);\n Assert.assertEquals(count.getAsLong(), 30);\n latency = logout.getAsJsonObject().get(\"Latency\");\n Assert.assertNotNull(latency);\n Assert.assertEquals(latency.getAsFloat(), 26.09f);\n }", "public void testIsIndivisibleElement() throws Exception {\n assertTrue(cfg.isIndivisibleElement(\"test\"));\n assertTrue(cfg.isIndivisibleElement(\"d1\"));\n assertTrue(cfg.isIndivisibleElement(\"ind1\"));\n assertTrue(cfg.isIndivisibleElement(\"ind2\"));\n\n cfg.associateStylisticAndAntiElements(\"anti-test\", \"test\",\n permittedChildren);\n cfg.addDivisibleElementsThatPermitStyles(new String[] {\"d1\"});\n cfg.addIndivisibleElementsThatPermitStyles(new String[] {\"ind1\", \"ind2\"});\n\n assertTrue(cfg.isIndivisibleElement(\"ind1\"));\n assertTrue(cfg.isIndivisibleElement(\"ind2\"));\n assertTrue(cfg.isIndivisibleElement(\"not-in-any-set\"));\n assertTrue(cfg.isIndivisibleElement(\"child\"));\n assertTrue(cfg.isIndivisibleElement(\"TEST\"));\n assertTrue(cfg.isIndivisibleElement(\"D1\"));\n\n assertFalse(cfg.isIndivisibleElement(\"test\"));\n assertFalse(cfg.isIndivisibleElement(\"d1\"));\n assertFalse(cfg.isIndivisibleElement(\"anti-test\"));\n }", "public static void verifySelf(Object[] objects, SerializableAssert comparator)\n throws Exception {\n assertFalse(\"Empty array\", objects.length == 0);\n for (Object entry: objects){\n verifySelf(entry, comparator);\n }\n }", "@Test(priority = 5)\n\tpublic void validateContents() {\n\t\tlog = Logger.getLogger(HeroImageProducttestscripts.class);\n\t\tLogReport.getlogger();\n\t\tlogger = extent.startTest(\"Validating the content of the product\");\n\t\tHeroImageProductPageFlow.clickHeroImage(locator);\n\t\theroImg.validateDescriptionContent(locator, validate);\n\t\t;\n\t\tlog.info(\"Content validation is correct\");\n\t\tHeroImageProductPageFlow.clickProductSpecification(locator);\n\t\theroImg.validateSpecificationContent(locator, validate);\n\t\tlog.info(\"Content is present\");\n\t\tlog.info(\"Starting Sorting functionality testing\");\n\t}", "boolean isComposite();", "boolean isComposite();", "public static boolean occlusionTest(IMultipart part, AxisAlignedBB... boxes) {\n\n return occlusionTest(part, new NormallyOccludingPart(Arrays.asList(boxes)));\n }", "@Test\n public void ensureCompositeStateImmutabilityTest() throws InterruptedException, PluginException {\n final WritableGraph wg = graph.getWritableGraph(\"test\", true);\n wg.getSchema().newGraph(wg);\n int v0, v1, v2;\n final String v0name, v1name, v2name;\n final int nameAttr;\n final int selectedAttr;\n final Plugin copyPlugin;\n try {\n // Add three vertices\n v0 = wg.addVertex();\n wg.getSchema().newVertex(wg, v0);\n v1 = wg.addVertex();\n wg.getSchema().newVertex(wg, v1);\n v2 = wg.addVertex();\n wg.getSchema().newVertex(wg, v2);\n\n // Store the names of these vertices\n nameAttr = VisualConcept.VertexAttribute.LABEL.get(wg);\n v0name = wg.getStringValue(nameAttr, v0);\n v1name = wg.getStringValue(nameAttr, v1);\n v2name = wg.getStringValue(nameAttr, v2);\n\n // Add a transaction from v0 to v1\n final int t0_1 = wg.addTransaction(v0, v1, true);\n wg.getSchema().newTransaction(wg, t0_1);\n\n // Select v0 and v2, but not v1\n selectedAttr = VisualConcept.VertexAttribute.SELECTED.get(wg);\n wg.setBooleanValue(selectedAttr, v0, true);\n wg.setBooleanValue(selectedAttr, v2, true);\n wg.setBooleanValue(selectedAttr, v1, false);\n } finally {\n wg.commit();\n }\n\n // Make a composite from the selection, then select everything, and copy to a new graph\n copyPlugin = PluginRegistry.get(InteractiveGraphPluginRegistry.COPY_TO_NEW_GRAPH);\n PluginExecutor.startWith(InteractiveGraphPluginRegistry.CREATE_COMPOSITE_FROM_SELECTION)\n .followedBy(VisualGraphPluginRegistry.SELECT_ALL)\n .followedBy(copyPlugin)\n .executeNow(graph);\n\n final WritableGraph copyWg = ((CopyToNewGraphPlugin) copyPlugin).getCopy().getWritableGraph(\"test\", true);\n try {\n // Expand all composites\n PluginExecution.withPlugin(InteractiveGraphPluginRegistry.EXPAND_ALL_COMPOSITES).executeNow(copyWg);\n } finally {\n copyWg.commit();\n }\n\n // Now we check there has been no effect on the composite state on the original graph\n // by expanding it and then checking it is the same as the orignal graph\n final WritableGraph wg2 = graph.getWritableGraph(\"test\", true);\n try {\n // Expand all composites\n PluginExecution.withPlugin(InteractiveGraphPluginRegistry.EXPAND_ALL_COMPOSITES).executeNow(wg2);\n } finally {\n wg2.commit();\n }\n\n final ReadableGraph rg = graph.getReadableGraph();\n try {\n\n // Assert that there are three vertices all with their original names\n assertEquals(rg.getVertexCount(), 3);\n for (int i = 0; i < 3; i++) {\n final int id = rg.getVertex(i);\n final String name = rg.getStringValue(nameAttr, id);\n if (name.equals(v0name)) {\n v0 = id;\n } else if (name.equals(v1name)) {\n v1 = id;\n } else {\n v2 = id;\n }\n }\n assertEquals(rg.getStringValue(nameAttr, v0), v0name);\n assertEquals(rg.getStringValue(nameAttr, v1), v1name);\n assertEquals(rg.getStringValue(nameAttr, v2), v2name);\n\n // Assert that the two transactions exist as expected and no others\n assertEquals(rg.getTransactionCount(), 1);\n final int l0_1 = rg.getLink(v0, v1);\n assertEquals(rg.getLinkTransactionCount(l0_1), 1);\n final int t0_1 = rg.getLinkTransaction(l0_1, 0);\n assertFalse(rg.getTransactionDirection(t0_1) == Graph.FLAT);\n assertEquals(rg.getTransactionSourceVertex(t0_1), v0);\n final int l1_2 = rg.getLink(v1, v2);\n assertEquals(l1_2, Graph.NOT_FOUND);\n final int l0_2 = rg.getLink(v0, v2);\n assertEquals(l0_2, Graph.NOT_FOUND);\n } finally {\n rg.release();\n }\n }", "@Test\n public void testContains_Contain_Overflow_Boundary() {\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>(2, 2);\n instance.add(1);\n instance.add(2);\n instance.add(3);\n instance.add(4);\n instance.add(5);\n instance.add(6);\n\n boolean expResult = true;\n boolean result = instance.contains(6);\n assertEquals(expResult, result);\n }", "@Test\r\n public void testCommissionPallets() throws Exception\r\n {\r\n String epcToCheck = \"urn:epc:id:sscc:0614141.0000000001\";\r\n XmlObjectEventType event = dbHelper.getObjectEventByEpc(epcToCheck);\r\n Assert.assertNull(event);\r\n\r\n runCaptureTest(COMMISSION_PALLETS_XML);\r\n\r\n event = dbHelper.getObjectEventByEpc(epcToCheck);\r\n Assert.assertNotNull(event);\r\n }", "public boolean hasCompositeStructure() {\n return (getStructureType() == EquipmentType.T_STRUCTURE_COMPOSITE);\n }", "@Test\r\n\tpublic void testCueEpisodicMemories() {\r\n\t\tMockCueListener cueListener = new MockCueListener();\r\n\t\tworkspace.addCueListener(cueListener);\r\n\t\tcontent.addDefaultNode(node1);\r\n\t\tcontent.addDefaultNode(node2);\r\n\r\n\t\tworkspace.cueEpisodicMemories(content);\r\n\r\n\t\tNodeStructure ns = cueListener.ns;\r\n\t\tassertNotNull(ns);\r\n\t\tassertTrue(ns.containsNode(node1));\r\n\t\tassertTrue(ns.containsNode(node2));\r\n\t}", "@Test\r\n public void testContains() {\r\n Grocery entry1 = new Grocery(\"Mayo\", \"Dressing / Mayo\", 1, 2.99f, 1);\r\n\r\n // Test element does not exist case\r\n assertFalse(instance.contains(entry1));\r\n\r\n instance.add(entry1);\r\n\r\n // Test element exists case\r\n assertTrue(instance.contains(entry1));\r\n }", "@Test\n void isNotEmptyTest() {\n Container container = new Container();\n container.fillContainer(Resource.SHIELD);\n assertFalse(container.isEmpty());\n }", "private void assertAll() {\n\t\t\n\t}", "@Test\r\n public void testCompliment1() {\r\n int actual[] = set1.getComplement();\r\n Assert.assertArrayEquals(new int[] { 100, 200, 456, 234, 890, 990, 100,\r\n 210, 500, 700, 900 }, actual);\r\n }", "@Test\n\tpublic void testIncluye() {\n\t\tassertFalse(l.incluye(0));\n\t\t\n\t\t//Test de busqueda sobre el primer elemento\n\t\tl.agregar(0, 0);\n\t\tassertTrue(l.incluye(0));\n\t\tassertFalse(l.incluye(1));\n\t\t\n\t\t//Test con mas elementos\n\t\tl.agregar(1, 1);\n\t\tl.agregar(2, 2);\n\t\tassertTrue(l.incluye(1));\n\t\tassertFalse(l.incluye(4));\n\t\t\n\t}", "private void assertImmutableList() {\n\t\tassertImmutableList(wc);\n\t}", "public void testAssociateStylisticElement() throws Exception {\n try {\n cfg.associateStylisticAndAntiElements(null, null, null);\n fail(\"Expected an IllegalArgumentException\");\n } catch (IllegalArgumentException e) {\n }\n // code block\n {\n String[] children = null;\n createSet(children);\n cfg.associateStylisticAndAntiElements(\"a\", null, permittedChildren);\n verifyStylisticAssociations(1, 1, children);\n }\n // code block\n {\n String[] children = { \"x\" };\n createSet(children);\n cfg.associateStylisticAndAntiElements(\"a\", null, permittedChildren);\n verifyStylisticAssociations(1, 1, children);\n }\n // code block\n {\n String[] children = { \"x\", \"y\" };\n createSet(children);\n cfg.associateStylisticAndAntiElements(\"a\", null, permittedChildren);\n verifyStylisticAssociations(1, 2, children);\n }\n // code block\n {\n String[] children = { \"y\", \"zzz\" };\n createSet(children);\n String[] expectedChildren = { \"x\", \"y\", \"zzz\" };\n cfg.associateStylisticAndAntiElements(\"a\", null, permittedChildren);\n verifyStylisticAssociations(1, 3, expectedChildren);\n }\n }", "@Test\n public void processCompoundTransaction_TestC() throws Exception {\n ct = new CompoundTransaction(\"compound\");\n\n Assert.assertEquals(false, trans_mang.processCompoundTransaction(ct));\n }", "@Override\n public boolean containsAll(Collection<?> c) {\n Object[] newArray = c.toArray();\n int check = 0;\n for (int i = 0; i < newArray.length; i++) {\n if (contains(newArray[i]))\n check++;\n }\n if(check == newArray.length) {\n return true;\n }\n return false;\n }", "@org.junit.Test\n public void k2ComputeConElem13() {\n final XQuery query = new XQuery(\n \"element e {element b{()}}\",\n ctx);\n try {\n result = new QT3Result(query.value());\n } catch(final Throwable trw) {\n result = new QT3Result(trw);\n } finally {\n query.close();\n }\n test(\n assertSerialization(\"<e><b/></e>\", false)\n );\n }", "public final void checkCivility() throws CompoundPropertyException {\n CompoundPropertyException cpe = getWildExceptions();\n if (!cpe.isEmpty()) {\n if (LOG.isDebugEnabled()) { // this if does only loggin\n LOG.debug(\"the wild exceptions were not empty; we will throw the CompoundPropertyException\"); //$NON-NLS-1$\n LOG.debug(\"current RousseauBean is \" + toString()); //$NON-NLS-1$\n LOG.debug(cpe.getElementExceptions());\n LOG.debug(\"ElementExceptions details:\"); //$NON-NLS-1$\n Iterator iter = cpe.getElementExceptions().entrySet().iterator();\n while (iter.hasNext()) {\n Map.Entry entry = (Map.Entry)iter.next();\n LOG.debug(entry.getKey().toString() + \":\"); //$NON-NLS-1$\n Set propertyExceptions = (Set)entry.getValue();\n Iterator exceptions = propertyExceptions.iterator();\n while (exceptions.hasNext()) {\n PropertyException pexc = (PropertyException)exceptions.next();\n LOG.debug(pexc, pexc);\n }\n }\n }\n cpe.close();\n throw cpe;\n }\n }", "public boolean containsAll(/*@ non_null @*/ java.util.Collection<E> c) {\n java.util.Iterator<E> celems = c.iterator();\n while (celems.hasNext()) {\n E o = celems.next();\n if (!has(o)) {\n return false;\n }\n }\n return true;\n }", "@Test\n public void testASSY1HasNoSubComponents() {\n assertThat( hasSubComponents( ASSY1_WITHOT_SUB_COMP ), is( false ) );\n }", "@Test\r\n\tpublic void testAddChromebook() {\n\t\tassertNotNull(\"Test if there is valid Chromebook arraylist to add to\", chromebookList);\r\n\r\n\t\t// No.2 - size 1\r\n\t\tResourceCentre.addChromebook(chromebookList, cb1);\r\n\t\tassertEquals(\"Test if that Chromebook arraylist size is 1?\", 1, chromebookList.size());\r\n\r\n\t\t// No.2 - same item added, size 1\r\n\t\tassertSame(\"Test that Chromebook is added same as 1st item of the list?\", cb1, chromebookList.get(0));\r\n\r\n\t\t// No.3 - size 2\r\n\t\tResourceCentre.addChromebook(chromebookList, cb2);\r\n\t\tassertEquals(\"Test that Chromebook arraylist size is 2?\", 2, chromebookList.size());\r\n\r\n\t\t// No.3 - same item added, size 2\r\n\t\tassertSame(\"Test that Chromebook is added same as 2nd item of the list?\", cb2, chromebookList.get(1));\r\n\t\t\n\t}", "@Test\n public void testContainsBorder() {\n for (final Border border : Border.values()) {\n for (final Border test : Border.values()) {\n final String[] parts = test.toString().split(\"_\");\n for (final String part : parts) {\n final Border contains = Border.valueOf(part);\n if (border.toString().contains(part) || (border == Border.ALL && contains != Border.NONE)) {\n Assert.assertTrue(border + \" should contain \" + contains, border.containsBorder(contains));\n } else {\n Assert.assertFalse(border + \" shouldn't contain \" + contains, border.containsBorder(contains));\n }\n }\n }\n }\n }", "private void verifyPortfolioElements(PortfolioAnalysisPage portfolioAnalysisPage) {\n softAssert.assertTrue(portfolioAnalysisPage.verifyLearnMoreModals());\n softAssert.assertTrue(portfolioAnalysisPage.verifyProjectedReturn());\n softAssert.assertTrue(portfolioAnalysisPage.verifySectionsDisplayed());\n }", "@Test\n public void testContains_Contain_Overflow() {\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>(3, 2);\n instance.add(1);\n instance.add(2);\n instance.add(3);\n instance.add(4);\n instance.add(5);\n instance.add(6);\n\n boolean expResult = true;\n boolean result = instance.contains(4);\n assertEquals(expResult, result);\n }", "static void assertEqualContents(Collection<?> expected, Collection<?> provided) {\n assertEquals(expected.size(), provided.size());\n assertEquals(new HashSet<>(expected), new HashSet<>(provided));\n }", "@Test\n public void testComAdobeCqSocialGroupClientImplCommunityGroupCollectionComponenProperties() {\n // TODO: test ComAdobeCqSocialGroupClientImplCommunityGroupCollectionComponenProperties\n }", "@Test\n public void testCardSelectionIsValid_TRUE() throws Exception {\n System.out.println(\"cardSelectionIsValid not valid\");\n UnoCard cardSelection = new UnoCard(UnoCardColour.BLUE, UnoCardValue.TWO);\n UnoCard drawCard = new UnoCard(UnoCardColour.BLUE, UnoCardValue.ONE);\n UnoCardColour wildColour = UnoCardColour.BLUE;\n utils.cardSelectionIsValid(cardSelection, drawCard, wildColour);\n }", "@Test\r\n public void test_containEmpty_True3() {\r\n Collection<?> collection = Arrays.asList(new Object[] {1, new ArrayList<Object>()});\r\n boolean trimStrings = false;\r\n\r\n boolean res = Helper.containEmpty(collection, trimStrings);\r\n\r\n assertTrue(\"'containEmpty' should be correct.\", res);\r\n }", "@Test\n public void testAddAll_Collection() {\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>();\n instance.add(3);\n instance.add(2);\n\n Collection c = Arrays.asList(1, 2, 3);\n\n boolean expResult = true;\n boolean result = instance.addAll(c);\n assertEquals(expResult, result);\n\n }", "private static boolean findAssertions(/*@NotNull*/ TreeInfo doc) {\n if (doc.isTyped()) {\n AxisIterator iter = doc.getRootNode().iterateAxis(AxisInfo.DESCENDANT, NodeKindTest.ELEMENT);\n while (true) {\n NodeInfo node = iter.next();\n if (node == null) {\n return false;\n }\n SchemaType type = node.getSchemaType();\n if (type.isComplexType() && ((ComplexType) type).hasAssertions()) {\n return true;\n }\n }\n } else {\n return false;\n }\n }", "@Test\n public void checkEcritureComptableUnit() throws Exception {\n initClassUnderTestDaoMock();\n SequenceEcritureComptable testSEC = new SequenceEcritureComptable();\n testSEC.setDerniereValeur(1);\n when(daoProxy.getComptabiliteDao().getSequenceEcritureComptable(any(), any()))\n .thenReturn(testSEC);\n\n vEcritureComptable.setJournal(new JournalComptable(\"AC\", \"Achat\"));\n vEcritureComptable.setDate(new Date());\n vEcritureComptable.setLibelle(\"Libelle\");\n vEcritureComptable.setReference(\"AC-2020/00001\");\n vEcritureComptable.getListLigneEcriture().add(new LigneEcritureComptable(new CompteComptable(1),\n null, new BigDecimal(123),\n null));\n vEcritureComptable.getListLigneEcriture().add(new LigneEcritureComptable(new CompteComptable(2),\n null, null,\n new BigDecimal(123)));\n\n classUnderTest.checkEcritureComptableUnit(vEcritureComptable);\n }", "public boolean isComposite();", "@Test\n\tpublic void shouldEstablishTexbookToCourseRelationships(){\n\t\tCourse course = new Course(\"OO Languages\", \"description\"); // created course first\n\t\tcourseRepo.save(course); //saving course into course repo\n\t\tlong courseId = course.getId();\n\t\t\n\t\t\n\t\t//building owners\n\t\tTextbook book = new Textbook (\"title\", course);\n\t\ttextbookRepo.save(book);\n\t\t\n\t\t\n\t\tTextbook book2 = new Textbook(\"title two\", course);\n\t\ttextbookRepo.save(book2);\n\t\t\n\t\t\n\t\tentityManager.flush(); \n\t\tentityManager.clear();\n\t\t\n\t\t\n\t\tOptional<Course> result = courseRepo.findById(courseId);\n\t\tcourse = result.get();\n\t\t\n\t\tassertThat(course.getTextBooks(), containsInAnyOrder(book, book2));\t\n\t\t\t\t\n\t}", "public static boolean occlusionTest(Iterable<? extends IMultipart> parts, Predicate<IMultipart> ignored, AxisAlignedBB... boxes) {\n\n for (IMultipart part : parts)\n if (!ignored.apply(part) && !occlusionTest(part, boxes)) return false;\n\n return true;\n }", "public static void VerifyCommonComponent_Div_P(String renderingControl){\n\t\ttry{\n\t\t\tactualDescriptionButton=sitecoreObj.aboutusCommonComponent_Div_P.isDisplayed();\n\t\t\tAssert.assertEquals(actualDescriptionButton, true);\n\t\t\tlog.info(\"The Actual AboutUs \" + renderingControl + \" Description - <\"+sitecoreObj.aboutusCommonComponent_Div_P.getTagName()+\">\");\n\t\t\tlog.info(\"The Expected AboutUs \" + renderingControl + \" Description - <p>\");\n\t\t\tlog.info(\"TEST PASSED: The Actual and Expected AboutUs \" + renderingControl + \" Description are Same\");\n\t\t}catch(AssertionError e){\n\t\t\tlog.error(\"The Actual AboutUs \" + renderingControl + \" Description - \"+sitecoreObj.aboutusCommonComponent_Div_P.getTagName());\n\t\t\tlog.error(\"The Expected AboutUs \" + renderingControl + \" Description - <p>\");\n\t\t\tlog.error(\"TEST FAILED: The Actual and Expected AboutUs \" + renderingControl + \" Description are NOT same\");\n\t\t}catch(org.openqa.selenium.NoSuchElementException e){\n\t\t\tlog.error(\"TEST FAILED: There is No Description On \" + renderingControl + \" element\");\n\t\t}\n\t}", "@Test\r\n\tpublic void testAcquistareBigliettiE2(){\r\n\t\tOfferta o = new Offerta(\"standard\", 10, 25.0);\r\n\t\tCartaDiCredito carta = new CartaDiCredito(\"2334549359434\",23353.89);\r\n\t\tAbbonamento a = new Abbonamento(o);\r\n\t\tCliente c2 = new Cliente(\"4\",\"Mario\",\"Rossi\",\"[email protected]\",\r\n\t\t\t\t\"M\",\"333152497\",\"rossimario\",\"passw.\",\"passw.\",\"domanda segreta..\",carta);\r\n\t\tc2.setAbbonamento(a);\r\n\t\tp1.acquistareBiglietti(3,\"abbonamento\", c2);\r\n\t\t//i biglietti vengono inseriti nella lista prenotazioni e quindi ne\r\n\t\t//modificano la size\r\n\t\tassertEquals(3,c2.getPrenotazioni().size());\r\n\t}", "@Test\r\n\tpublic void testErabiltzaileakBaloratuDituenPelikulenZerrenda() {\n\t\tArrayList<Integer> zer = BalorazioenMatrizea.getBalorazioenMatrizea().erabiltzaileakBaloratuDituenPelikulenZerrenda(e1.getId());\r\n\t\tassertTrue(zer.size() == 3);\r\n\t\tassertTrue(zer.contains(p1.getPelikulaId()));\r\n\t\tassertTrue(zer.contains(p2.getPelikulaId()));\r\n\t\tassertTrue(zer.contains(p4.getPelikulaId()));\r\n\t\tassertFalse(zer.contains(p3.getPelikulaId()));\r\n\t\t\r\n\t\t// e2 erabiltzaileak baloratu dituen pelikulen ID-ak itzuli\r\n\t\tzer = BalorazioenMatrizea.getBalorazioenMatrizea().erabiltzaileakBaloratuDituenPelikulenZerrenda(e2.getId());\r\n\t\tassertTrue(zer.size() == 2);\r\n\t\tassertTrue(zer.contains(p2.getPelikulaId()));\r\n\t\tassertTrue(zer.contains(p3.getPelikulaId()));\r\n\t\tassertFalse(zer.contains(p1.getPelikulaId()));\r\n\t\t\r\n\t\t// e3 erabiltzaileak baloratu dituen pelikulen ID-ak itzuli\r\n\t\tzer = BalorazioenMatrizea.getBalorazioenMatrizea().erabiltzaileakBaloratuDituenPelikulenZerrenda(e3.getId());\r\n\t\tassertTrue(zer.size() == 4);\r\n\t\tassertTrue(zer.contains(p1.getPelikulaId()));\r\n\t\tassertTrue(zer.contains(p2.getPelikulaId()));\r\n\t\tassertTrue(zer.contains(p3.getPelikulaId()));\r\n\t\tassertTrue(zer.contains(p4.getPelikulaId()));\r\n\t\t\r\n\t\t// e2 erabiltzaileak baloratu dituen pelikulen ID-ak itzuli\r\n\t\tzer = BalorazioenMatrizea.getBalorazioenMatrizea().erabiltzaileakBaloratuDituenPelikulenZerrenda(e4.getId());\r\n\t\tassertTrue(zer.size() == 1);\r\n\t\tassertTrue(zer.contains(p2.getPelikulaId()));\r\n\t\tassertFalse(zer.contains(p1.getPelikulaId()));\r\n\t\t\r\n\t}", "@Override\n\tpublic boolean containsAll(Collection<?> c) {\n\t\tthrow new NotImplementedException(\"Not yet implemented\"); \n\t}", "public boolean containsAll(Collection c) {\r\n Enumeration e = c.elements();\r\n while (e.hasMoreElements())\r\n if(!contains(e.nextElement()))\r\n return false;\r\n\r\n return true;\r\n }", "public void assertOnTableElements()\n {\n\t open();\n\t inTable(table).shouldHaveRowElementsWhere(the(\"First name\" , equalTo(\"Frank\")));\n }", "@Test\n\tpublic void shouldFireAssertIfAllPresent() {\n\n\t\tval mapa = new LinkedHashMap<String, String>();\n\t\tmapa.put(\"name\", \"myproject\");\n\t\tmapa.put(\"project_type\", \"billable\");\n\t\tmapa.put(\"start_date\", \"1-1-15\");\n\t\tmapa.put(\"end_date\", \"1-1-16\");\n\t\truleObj.setData(mapa);\n\n\t\tkSession = kbase.newStatefulKnowledgeSession();\n\n\t\tList<String> list = new ArrayList<String>();\n\t\tEvaluator eval = (Evaluator) ruleObj;\n\t\tkSession.insert(eval);\n\t\tkSession.insert(list);\n\n\t\tint actualNumberOfRulesFired = kSession.fireAllRules();\n\n\t\tassertEquals(list.size(), 0);\n\t}", "@Test\n public void testEquals() {\n Coctail c1 = new Coctail(\"coctail\", new Ingredient[]{ \n new Ingredient(\"ing1\"), new Ingredient(\"ing2\")});\n Coctail c2 = new Coctail(\"coctail\", new Ingredient[]{ \n new Ingredient(\"ing1\"), new Ingredient(\"ing2\")});\n assertEquals(c1, c2);\n }", "@Test\n public void testGetAll() {\n List<Allocation> cc = allocationCollection.getAll();\n assertNotNull(cc);\n assertFalse(cc.isEmpty());\n }", "@Test\n public void should_iterate_with_partition_keys_and_partition_keys_IN() throws Exception {\n //Given\n long partitionKey = RandomUtils.nextLong(0,Long.MAX_VALUE);\n\n insertCompositeClusteredValues(partitionKey,\"bucket1\",1,\"name1\",1);\n insertCompositeClusteredValues(partitionKey,\"bucket2\",1,\"name2\",1);\n insertCompositeClusteredValues(partitionKey,\"bucket3\",1,\"name3\",1);\n\n //When\n final Iterator<CompositeClusteredEntity> iterator = manager.sliceQuery(CompositeClusteredEntity.class)\n .forIteration()\n .withPartitionComponents(partitionKey)\n .andPartitionComponentsIN(\"bucket1\", \"bucket3\")\n .iterator();\n\n //Then\n assertThat(iterator.hasNext()).isTrue();\n CompositeClusteredEntity next = iterator.next();\n assertThat(next.getId().getId()).isEqualTo(partitionKey);\n assertThat(next.getId().getBucket()).isEqualTo(\"bucket1\");\n assertThat(next.getId().getName()).isEqualTo(\"name11\");\n assertThat(next.getValue()).isEqualTo(\"value11\");\n\n assertThat(iterator.hasNext()).isTrue();\n next = iterator.next();\n assertThat(next.getId().getId()).isEqualTo(partitionKey);\n assertThat(next.getId().getBucket()).isEqualTo(\"bucket3\");\n assertThat(next.getId().getName()).isEqualTo(\"name31\");\n assertThat(next.getValue()).isEqualTo(\"value11\");\n }", "@Test\n\tpublic void testComenzar() {\n\t\tl.agregar(0, 0);\n\t\tl.comenzar();\n\t\tassertEquals((int)(new Integer(0)), l.elemento());\n\t\t\n\t\t//Probando con dos elementos\n\t\tl.agregar(1, 1);\n\t\tl.comenzar();\n\t\tassertEquals((int)(new Integer(0)), l.elemento());\n\t\t\n\t\t//Probando de agregar un elemento al principio\n\t\tl.agregar(2, 0);\n\t\tl.comenzar();\n\t\tassertEquals((int)(new Integer(2)), l.elemento());\n\t\t\n\t\t\n\t}", "@Test\n\tpublic void testContains() {\n\t\tHeap heap = new Heap(testArrayList.length);\n\t\theap.build(testArrayList);\n\t\tassertTrue(heap.contains(33));\n\t\tassertFalse(heap.contains(1));\n\t}", "@Test\n public void testContains_Not_Contain() {\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>();\n instance.add(1);\n instance.add(2);\n\n boolean expResult = false;\n boolean result = instance.contains(3);\n assertEquals(expResult, result);\n }", "public boolean contains(E e) {\n\t /*\n\t * Add code here\n\t */\n\t\t for(int c=0;c<num_elements;c++){\n\t\t\t if(elements[c]==e){\n\t\t\t\t return true;\n\t\t\t }\n\t\t }\n\t return false;\n\t }", "@Test\n public void z_topDown_TC02() {\n try {\n Intrebare intrebare = appService.addNewIntrebare(\"Enunt?\", \"1) Raspuns1\", \"2) Raspuns2\", \"3) Raspuns3\",\n \"1\", \"M\");\n Intrebare intrebare1 = appService.addNewIntrebare(\"Enunt?\", \"1) Raspuns1\", \"2) Raspuns2\", \"3) Raspuns3\",\n \"1\", \"A\");\n Intrebare intrebare2 = appService.addNewIntrebare(\"Enunt?\", \"1) Raspuns1\", \"2) Raspuns2\", \"3) Raspuns3\",\n \"1\", \"B\");\n Intrebare intrebare3 = appService.addNewIntrebare(\"Enunt?\", \"1) Raspuns1\", \"2) Raspuns2\", \"3) Raspuns3\",\n \"1\", \"C\");\n assertTrue(true);\n assertTrue(appService.exists(intrebare));\n assertTrue(appService.exists(intrebare1));\n assertTrue(appService.exists(intrebare2));\n assertTrue(appService.exists(intrebare3));\n\n try {\n ccir2082MV.evaluator.model.Test test = appService.createNewTest();\n assertTrue(test.getIntrebari().contains(intrebare));\n assertTrue(test.getIntrebari().contains(intrebare1));\n assertTrue(test.getIntrebari().contains(intrebare2));\n assertTrue(test.getIntrebari().contains(intrebare3));\n assertTrue(test.getIntrebari().size() == 5);\n } catch (NotAbleToCreateTestException e) {\n assertTrue(false);\n }\n } catch (DuplicateIntrebareException | IntrebareValidatorFailedException e) {\n e.printStackTrace();\n assertTrue(false);\n }\n }", "@org.junit.Test\n public void k2ComputeConElem2() {\n final XQuery query = new XQuery(\n \"<elem>{\\\"\\\", \\\"\\\", <e/>, <b></b>}</elem>\",\n ctx);\n try {\n result = new QT3Result(query.value());\n } catch(final Throwable trw) {\n result = new QT3Result(trw);\n } finally {\n query.close();\n }\n test(\n assertSerialization(\"<elem> <e/><b/></elem>\", false)\n );\n }", "@Test\n public void myMeetingList_ShouldNotBeEmpty() {\n onView(withId(R.id.recyclerview)).check(matches(hasMinimumChildCount(1)));\n }", "@Test\r\n public void testINFR1184() throws Exception {\r\n // create OU A\r\n Document ouAdoc = getDocument(createSuccessfully(\"escidoc_ou_create.xml\"));\r\n String ouAid = getObjidValue(ouAdoc);\r\n\r\n // create OU B\r\n Document ouBdoc = getDocument(createSuccessfully(\"escidoc_ou_create.xml\"));\r\n String ouBid = getObjidValue(ouBdoc);\r\n\r\n // create OU C\r\n Document ouCdoc = getDocument(createSuccessfully(\"escidoc_ou_create.xml\"));\r\n String ouCid = getObjidValue(ouCdoc);\r\n\r\n // A parentOf B\r\n String srelPrefix = determineSrelNamespacePrefix(ouBdoc);\r\n String xlinkPrefix = determineXlinkNamespacePrefix(ouBdoc);\r\n Node parents = selectSingleNode(ouBdoc, XPATH_ORGANIZATIONAL_UNIT_PARENTS);\r\n Element parent =\r\n ouBdoc.createElementNS(\"http://escidoc.de/core/01/structural-relations/\", srelPrefix + \":parent\");\r\n parent.setAttribute(xlinkPrefix + \":href\", \"/oum/organizational-unit/\" + ouAid);\r\n parents.appendChild(parent);\r\n ouBdoc = getDocument(update(ouBid, toString(ouBdoc, true)));\r\n\r\n // B parentOf C\r\n srelPrefix = determineSrelNamespacePrefix(ouCdoc);\r\n xlinkPrefix = determineXlinkNamespacePrefix(ouCdoc);\r\n parents = selectSingleNode(ouCdoc, XPATH_ORGANIZATIONAL_UNIT_PARENTS);\r\n parent = ouCdoc.createElementNS(\"http://escidoc.de/core/01/structural-relations/\", srelPrefix + \":parent\");\r\n parent.setAttribute(xlinkPrefix + \":href\", \"/oum/organizational-unit/\" + ouBid);\r\n parents.appendChild(parent);\r\n ouCdoc = getDocument(update(ouCid, toString(ouCdoc, true)));\r\n\r\n // A parentOf C\r\n srelPrefix = determineSrelNamespacePrefix(ouCdoc);\r\n xlinkPrefix = determineXlinkNamespacePrefix(ouCdoc);\r\n parents = selectSingleNode(ouCdoc, XPATH_ORGANIZATIONAL_UNIT_PARENTS);\r\n parent = (Element) selectSingleNode(parents, XPATH_ORGANIZATIONAL_UNIT_PARENT);\r\n parent.setAttribute(xlinkPrefix + \":href\", \"/oum/organizational-unit/\" + ouAid);\r\n ouCdoc = getDocument(update(ouCid, toString(ouCdoc, true)));\r\n }", "@Test\n public void testAddAll_int_Collection_Order() {\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>();\n instance.add(3);\n instance.add(2);\n\n Collection c = Arrays.asList(1, 2, 3);\n instance.addAll(1, c);\n\n List expResult = Arrays.asList(3, 1, 2, 3, 2);\n\n for (int i = 0; i < expResult.size(); i++) {\n assertEquals(expResult.get(i), instance.get(i));\n }\n }", "@Test\r\n public void test_containNull_True() {\r\n Collection<?> collection = Arrays.asList(new Object[] {1, TestsHelper.EMPTY_STRING, null});\r\n\r\n boolean res = Helper.containNull(collection);\r\n\r\n assertTrue(\"'containNull' should be correct.\", res);\r\n }", "public boolean containsAll(Collection<?> c) {\n\t\tif(c.size() > size) return false;\r\n\t\tfor(Object e : c) {\r\n\t\t\tif(!contains(e))\r\n\t\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "@Test\n public void testAddPiece() {\n System.out.println(\"addPiece\");\n\n Piece piece = new Piece(PlayerColor.WHITE, 3);\n Player instance = new Player(PlayerColor.WHITE, \"\");\n\n instance.addPiece(piece);\n\n assertTrue(instance.getBagContent().contains(piece));\n }", "@Test\n final void checkEcritureComptable() {\n this.vEcritureComptable.getListLigneEcriture().add(new LigneEcritureComptable());\n //Testing the checkEcritureComptable method.\n FunctionalException functionalException = assertThrows(FunctionalException.class,\n () -> classUnderTest.checkEcritureComptable(vEcritureComptable));\n //Checking the right FunctionalExceptionMessage.\n assertThat(functionalException.getMessage())\n .isEqualTo(\"L'écriture comptable ne respecte pas les règles de gestion.\");\n }" ]
[ "0.79356545", "0.7812406", "0.7742198", "0.76522803", "0.63971907", "0.6291986", "0.5871704", "0.56031", "0.55217475", "0.55062485", "0.54514986", "0.53493524", "0.5341802", "0.5309878", "0.52995026", "0.5298064", "0.52630234", "0.5258606", "0.52142364", "0.5183748", "0.5182675", "0.51700497", "0.51342905", "0.5130795", "0.5124874", "0.5121369", "0.50974834", "0.5095827", "0.5086732", "0.50791454", "0.5075534", "0.50696933", "0.50666517", "0.5036767", "0.50287545", "0.50197214", "0.49954814", "0.49915823", "0.4979621", "0.4929361", "0.49222785", "0.49150616", "0.49124393", "0.49124393", "0.4906538", "0.48970369", "0.48547632", "0.4853848", "0.48484948", "0.48281687", "0.48036155", "0.4780579", "0.4779514", "0.47745892", "0.47576457", "0.4757218", "0.4752162", "0.4741726", "0.47324455", "0.47321826", "0.47297814", "0.47187543", "0.4718734", "0.47165602", "0.47136894", "0.47096878", "0.46983597", "0.46868917", "0.4685114", "0.46849564", "0.4684018", "0.4672121", "0.4663924", "0.46608517", "0.46557018", "0.46555847", "0.46532795", "0.46531764", "0.4633813", "0.46324623", "0.4630361", "0.4629835", "0.4622469", "0.4619253", "0.46129107", "0.46114036", "0.46083865", "0.4606794", "0.46057636", "0.45991963", "0.45981434", "0.4597675", "0.4595601", "0.4589869", "0.45821735", "0.4580261", "0.45769134", "0.45735577", "0.45727623", "0.45723033" ]
0.82200515
0
Creates a new CFMetaData instance.
private static CFMetaData newCFMetaData(Sort... sorts) { List<AbstractType<?>> types = new ArrayList<>(); for (Sort sort : sorts) types.add(sort == Sort.ASC ? Int32Type.instance : ReversedType.getInstance(Int32Type.instance)); CompoundSparseCellNameType cType = new CompoundSparseCellNameType(types); CFMetaData cfMetaData = new CFMetaData("keyspace", "test", ColumnFamilyType.Standard, cType); for (int i = 0; i < sorts.length; i++) { ByteBuffer name = ByteBufferUtil.bytes("clustering_" + i); ColumnDefinition columnDef = ColumnDefinition.clusteringKeyDef(cfMetaData, name, types.get(i), i); cfMetaData.addColumnDefinition(columnDef); } cfMetaData.rebuild(); return cfMetaData; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n protected MetaData makeMetaData() {\n return new MetaData();\n }", "public MetaDataManager createMetaDataManager() throws ServiceException {\r\n initialize(); \r\n return new MetaDataManager(multiDomainMetaService); \r\n\t}", "protected static LibMetaData createLibMetaData(LibMetaData lmd) {\n MetaData metaData = new MetaData();\r\n metaData.add(\"IsThing\", new Integer(1), null, MetaDataEntry.FIX_VALUE, MetaDataEntry.MANDATORY_PROPERTY);\r\n metaData.add(\"ImageSource\", \"Items\", null, MetaDataEntry.ANY_VALUE, MetaDataEntry.MANDATORY_PROPERTY);\r\n metaData.add(\"Image\", new Integer(0), null, MetaDataEntry.POSITIVE_VALUE, MetaDataEntry.MANDATORY_PROPERTY);\r\n metaData.add(\"Number\", new Integer(1), null, MetaDataEntry.POSITIVE_VALUE, MetaDataEntry.MANDATORY_PROPERTY);\r\n lmd.add(THING, metaData);\r\n \r\n metaData = new MetaData(lmd.get(\"thing\"));\r\n metaData.add(\"IsItem\", new Integer(1), null, MetaDataEntry.FIX_VALUE, MetaDataEntry.MANDATORY_PROPERTY);\r\n metaData.add(\"ImageSource\", \"Items\", null, MetaDataEntry.ANY_VALUE, MetaDataEntry.MANDATORY_PROPERTY);\r\n metaData.add(\"Image\", new Integer(1), null, MetaDataEntry.POSITIVE_VALUE, MetaDataEntry.MANDATORY_PROPERTY);\r\n metaData.add(\"Name\", \"Thing\", null, MetaDataEntry.ANY_VALUE, MetaDataEntry.MANDATORY_PROPERTY);\r\n metaData.add(\"NameType\", new Integer(Description.NAMETYPE_NORMAL), null, MetaDataEntry.FIX_VALUE, MetaDataEntry.MANDATORY_PROPERTY);\r\n metaData.add(\"Z\", new Integer(Thing.Z_ITEM), null, MetaDataEntry.FIX_VALUE, MetaDataEntry.MANDATORY_PROPERTY);\r\n lmd.add(ITEM, metaData);\r\n \r\n metaData = new MetaData(lmd.get(\"thing\"));\r\n metaData.add(\"IsBeing\",new Integer(1), null, MetaDataEntry.FIX_VALUE, MetaDataEntry.MANDATORY_PROPERTY);\r\n metaData.add(\"ImageSource\", \"Creatures\", null, MetaDataEntry.ANY_VALUE, MetaDataEntry.MANDATORY_PROPERTY);\r\n metaData.add(\"Image\", new Integer(340), null, MetaDataEntry.POSITIVE_VALUE, MetaDataEntry.MANDATORY_PROPERTY);\r\n metaData.add(\"IsMobile\",new Integer(1), new Integer[]{new Integer(0), new Integer(1)}, MetaDataEntry.CERTAIN_VALUES, MetaDataEntry.MANDATORY_PROPERTY);\r\n metaData.add(\"IsBlocking\", new Integer(1), new Integer[]{new Integer(0), new Integer(1)}, MetaDataEntry.CERTAIN_VALUES, MetaDataEntry.MANDATORY_PROPERTY);\r\n metaData.add(\"MoveCost\", new Integer(100), null, MetaDataEntry.POSITIVE_VALUE, MetaDataEntry.MANDATORY_PROPERTY);\r\n metaData.add(\"DeathDecoration\", \"blood pool\", null, MetaDataEntry.ANY_VALUE, MetaDataEntry.MANDATORY_PROPERTY);\r\n metaData.add(\"NameType\", new Integer(Description.NAMETYPE_NORMAL), null, MetaDataEntry.FIX_VALUE, MetaDataEntry.MANDATORY_PROPERTY);\r\n metaData.add(\"Z\", new Integer(Thing.Z_MOBILE), null, MetaDataEntry.FIX_VALUE, MetaDataEntry.MANDATORY_PROPERTY);\r\n lmd.add(BEING, metaData);\r\n \r\n lmd = createEffectMetaData(lmd);\r\n lmd = createPoisonMetaData(lmd);\r\n lmd = createFoodMetaData(lmd);\r\n lmd = createScrollMetaData(lmd);\r\n lmd = createMissileMetaData(lmd);\r\n lmd = createRangedWeaponMetaData(lmd);\r\n lmd = createPotionMetaData(lmd);\r\n lmd = createWandMetaData(lmd);\r\n lmd = createRingMetaData(lmd);\r\n lmd = createCoinMetaData(lmd);\r\n lmd = createArmourMetaData(lmd);\r\n lmd = createWeaponMetaData(lmd);\r\n lmd = createSecretMetaData(lmd);\r\n lmd = createSpellBookMetaData(lmd);\r\n lmd = createChestMetaData(lmd);\r\n lmd = createDecorationMetaData(lmd);\r\n lmd = createSceneryMetaData(lmd);\r\n lmd = createPortalMetaData(lmd);\r\n lmd = createTrapMetaData(lmd);\r\n createMonsterMetaData(lmd);\r\n createPersonMetaData(lmd);\r\n return lmd;\r\n }", "public ColumnMetadata build() {\n ColumnMetadata colMetadata = new ColumnMetadata();\n colMetadata.setName(name);\n colMetadata.setType(type);\n colMetadata.setPhysicalType(physicalType);\n colMetadata.setNullable(nullable);\n colMetadata.setLogicalType(logicalType);\n colMetadata.setByteLength(byteLength);\n colMetadata.setLength(length);\n colMetadata.setScale(scale);\n colMetadata.setPrecision(precision);\n colMetadata.setCollation(collation);\n colMetadata.setOrdinal(ordinal);\n return colMetadata;\n }", "private MetaEntityImpl createMetaEntity(Class<?> entityType) {\n String className = entityType.getSimpleName();\n MetaEntityImpl managedEntity = new MetaEntityImpl();\n managedEntity.setEntityType(entityType);\n managedEntity.setName(className);\n ((MetaTableImpl) managedEntity.getTable()).setName(className);\n ((MetaTableImpl) managedEntity.getTable()).setKeySpace(environment.getConfiguration().getKeySpace());\n return managedEntity;\n }", "private CinaImageDataSetInformation createDataSetInformation()\n {\n CinaImageDataSetInformation metadataDataSetInfo = new CinaImageDataSetInformation();\n metadataDataSetInfo.setSampleCode(replicaSampleId.getSampleCode());\n metadataDataSetInfo.setSpaceCode(replicaSampleId.getSpaceLevel().getSpaceCode());\n metadataDataSetInfo.setDataSetType(globalState.getImageDataSetType().getDataSetType());\n metadataDataSetInfo.setDataSetKind(DataSetKind.PHYSICAL);\n List<String> parentDataSetCodes =\n Collections.singletonList(bundleMetadataDataSetInformation.getDataSetCode());\n metadataDataSetInfo.setParentDataSetCodes(parentDataSetCodes);\n metadataDataSetInfo.setShareId(bundleMetadataDataSetInformation.getShareId());\n return metadataDataSetInfo;\n }", "public static AppCDef.DefMeta meta(String classificationName) {\n if (classificationName == null) { throw new IllegalArgumentException(\"The argument 'classificationName' should not be null.\"); }\n throw new IllegalStateException(\"Unknown classification: \" + classificationName);\n }", "public VicarMetadata() {\n\t\tsuper(true, nativeImageMetadataFormatName, nativeImageMetadataFormatClassName,\n\t\t// metadataFormatNames,\n\t\t\t\tnull, null);\n\t}", "protected CFMetaData getCFMetaData(String ks, String cf, Cassandra.Client client)\n throws NotFoundException,\n org.apache.cassandra.thrift.InvalidRequestException,\n TException,\n org.apache.cassandra.exceptions.InvalidRequestException,\n ConfigurationException\n {\n KsDef ksDef = client.describe_keyspace(ks);\n for (CfDef cfDef : ksDef.cf_defs)\n {\n if (cfDef.name.equalsIgnoreCase(cf))\n return ThriftConversion.fromThrift(cfDef);\n }\n return null;\n }", "public MetaDataCache() throws org.opensaml.xml.ConfigurationException {\r\n // Create a parser pool for later use\r\n parser = new BasicParserPool();\r\n // Choose to use the Bouncy Castle JCE provider most often\r\n Security.insertProviderAt(new BouncyCastleProvider(), 2);\r\n // Provide some default values\r\n setMetaTimeout(60000);\r\n setMetaFile(\"metadata-backing-file.xml\");\r\n setMetaUrl(\"http://127.0.0.1/metadata.xml\");\r\n}", "void create(MetaTag metaTag);", "protected static MetaData createMetaDataFromObject(Object o) {\n MetaData metaData = new MetaData(); \r\n \tString className = o.getClass().getName();\r\n \tif(className.indexOf(\"ChestOpen\")>=0){\r\n \t\tmetaData.add(\"TypeInfo\", \"ChestOpen\", null, MetaDataEntry.FIX_VALUE, MetaDataEntry.MANDATORY_PROPERTY);\r\n \t\treturn metaData;\r\n \t}\r\n \tif(className.indexOf(\"ChestCreated\")>=0){\r\n \t\tmetaData.add(\"TypeInfo\", \"ChestCreate\", null, MetaDataEntry.FIX_VALUE, MetaDataEntry.MANDATORY_PROPERTY);\r\n \t\treturn metaData;\r\n \t}\r\n \tif(className.indexOf(\"ChestClosed\")>=0){\r\n \t\tmetaData.add(\"TypeInfo\", \"ChestClosed\", null, MetaDataEntry.FIX_VALUE, MetaDataEntry.OPTIONAL_PROPERTY);\r\n \t\treturn metaData;\r\n \t}\r\n \tif(className.indexOf(\"HealingScript\")>=0) {\r\n \t\tmetaData.add(\"TypeInfo\", \"HealingScript\", null, MetaDataEntry.FIX_VALUE, MetaDataEntry.MANDATORY_PROPERTY);\r\n \treturn metaData;\r\n } if(className.indexOf(\"AddEffectScript\")>=0){\r\n \t\tmetaData.add(\"TypeInfo\", \"AddEffectScript\", null, MetaDataEntry.FIX_VALUE, MetaDataEntry.MANDATORY_PROPERTY);\r\n \t\tmetaData.add(\"Effect\", \"Poison\", null, MetaDataEntry.ANY_VALUE, MetaDataEntry.MANDATORY_PROPERTY);\r\n \t\tmetaData.add(\"TargetProperty\", \"Target\", null, MetaDataEntry.ANY_VALUE, MetaDataEntry.MANDATORY_PROPERTY);\r\n \t\tmetaData.add(\"Chance\", new Integer(100),null, MetaDataEntry.POSITIVE_VALUE, MetaDataEntry.OPTIONAL_PROPERTY);\r\n \t\treturn metaData;\r\n \t}\r\n/*\tTO DO: modify to current version\r\n \r\n \tif(className.indexOf(\"Effect\")>=0){\r\n \t\tmetaData.add(\"TypeInfo\", \"TemporaryEffect\", null, MetaDataEntry.FIX_VALUE, MetaDataEntry.MANDATORY_PROPERTY);\r\n \t\tmetaData.add(\"Time\", new Integer(2000), null, MetaDataEntry.POSITIVE_VALUE, MetaDataEntry.MANDATORY_PROPERTY);\r\n \t\tmetaData.add(\"Modifier\", Modifier.simple(\"dummy\",-1), null, MetaDataEntry.ANY_VALUE, MetaDataEntry.MANDATORY_PROPERTY);\r\n \t\tmetaData.add(\"Stat\", \"MoveSpeed\", null, MetaDataEntry.ANY_VALUE, MetaDataEntry.MANDATORY_PROPERTY);\r\n \t\tmetaData.add(\"Bonus\", new Integer(2000), null, MetaDataEntry.ANY_VALUE, MetaDataEntry.MANDATORY_PROPERTY);\r\n \t\tmetaData.add(\"Multiplier\", new Integer(100), null, MetaDataEntry.ANY_VALUE, MetaDataEntry.OPTIONAL_PROPERTY);\r\n \t\tmetaData.add(\"TargetProperty\", \"Target\", null, MetaDataEntry.ANY_VALUE, MetaDataEntry.MANDATORY_PROPERTY);\r\n \t\tmetaData.add(\"Chance\", new Integer(100), null, MetaDataEntry.POSITIVE_VALUE, MetaDataEntry.OPTIONAL_PROPERTY);\r\n \t\treturn metaData;\r\n \t}*/\r\n \tif(className.indexOf(\"Modifier\")>=0) {\r\n \t\tmetaData.add(\"TypeInfo\", \"SimpleModifier\", null, MetaDataEntry.FIX_VALUE, MetaDataEntry.MANDATORY_PROPERTY);\r\n \t\tmetaData.add(\"Stat\", new String(), null, MetaDataEntry.ANY_VALUE, MetaDataEntry.MANDATORY_PROPERTY);\r\n \t\tmetaData.add(\"Bonus\", new Integer(0), null, MetaDataEntry.ANY_VALUE, MetaDataEntry.MANDATORY_PROPERTY);\r\n \t\tmetaData.add(\"Multiplier\", new Integer(0), null, MetaDataEntry.ANY_VALUE, MetaDataEntry.OPTIONAL_PROPERTY);\r\n \t\treturn metaData;\r\n \t}\r\n \tif(className.indexOf(\"Personality\")>=0) {\r\n \t\tmetaData.add(\"TypeInfo\", \"Personality\", null, MetaDataEntry.FIX_VALUE, MetaDataEntry.MANDATORY_PROPERTY);\r\n \t\tmetaData.add(\"Type\", new Integer(0), new Integer[]{new Integer(0), new Integer(1)}, MetaDataEntry.CERTAIN_VALUES, MetaDataEntry.MANDATORY_PROPERTY);\r\n \t\tmetaData.add(\"SubType\", new Integer(0), new Integer[]{new Integer(0), new Integer(1), new Integer(2), new Integer(3), new Integer(4), new Integer(5), new Integer(6), new Integer(7), new Integer(8)}, MetaDataEntry.CERTAIN_VALUES, MetaDataEntry.MANDATORY_PROPERTY);\r\n \t\tmetaData.add(\"State\", new Integer(0), null, MetaDataEntry.POSITIVE_VALUE, MetaDataEntry.OPTIONAL_PROPERTY);\r\n \t\treturn metaData;\r\n \t}\r\n \treturn null;\r\n }", "public static FileData createEntity() {\n FileData fileData = Reflections.createObj(FileData.class, Lists.newArrayList(\n\t\t FileData.F_NAME\n\t\t,FileData.F_PATH\n\t\t,FileData.F_SIZE\n\t\t,FileData.F_TYPE\n\t\t,FileData.F_DESCRIPTION\n ),\n\n\t\t DEFAULT_NAME\n\n\t\t,DEFAULT_PATH\n\n\t\t,DEFAULT_SIZE\n\n\t\t,DEFAULT_TYPE\n\n\n\n\n\n\n\t\t,DEFAULT_DESCRIPTION\n\n\t);\n return fileData;\n }", "FData createFData();", "public ReferenceSystemMetadata() {\n }", "public MetaData getMetaData();", "Metadata getMetaData();", "public ColumnLabelProvider create() throws CoreException {\n\t\treturn (ColumnLabelProvider) getConfiguration().createExecutableExtension(\"class\");\n\t}", "@Override\r\n \tpublic MetaData getMetaData(HttpHeaders headers) {\n \t\ttry {\r\n \t\t\treturn MetaDataUtil.getMetaData(new TraitSalaire(), new HashMap<String, MetaData>()\r\n \t\t\t\t\t, new ArrayList<String>());\r\n \t\t} catch (InstantiationException e) {\r\n \t\t\t// TODO Auto-generated catch block\r\n \t\t\te.printStackTrace();\r\n \t\t} catch (IllegalAccessException e) {\r\n \t\t\t// TODO Auto-generated catch block\r\n \t\t\te.printStackTrace();\r\n \t\t}\r\n \t\treturn null;\r\n \t}", "public ColumnInfo() {\n\n\t}", "public SystemMetadataDaoMetacatImpl() {\n this(MetacatDataSourceFactory.getMetacatDataSource());\n }", "public AbstractCollectionMetaData()\n {\n }", "@POST( CONTROLLER + METADATA_PATH )\n VersionedObjectKey createMetadataObject( @Body CreateMetadataObjectRequest request );", "private Metadata(final Document packageDoc) throws IOException {\n Element packageElem = packageDoc.selectFirst(\"package\");\n if(packageElem == null) {\n throw new IOException(\"The package document must contain a 'package' element\");\n }\n String uniqueIdentifierId = packageElem.attr(\"unique-identifier\");\n Element metadataElem = packageElem.selectFirst(\"metadata\");\n\n if(metadataElem == null) {\n throw new IOException(\"The package document must contain a 'metadata' element\");\n }\n\n String identifier = \"\";\n if(!uniqueIdentifierId.isEmpty()) {\n Element identifierElem = metadataElem.getElementById(uniqueIdentifierId);\n if(identifierElem != null) {\n identifier = identifierElem.text();\n }\n }\n\n this.identifier = identifier;\n\n Element modifiedElem = metadataElem.selectFirst(\"meta[property=dcterms:modified]\");\n if(modifiedElem == null) {\n this.modifiedTimestamp = 0L;\n } else {\n Long modifiedTimestamp = tryParseISO8601(modifiedElem.text());\n this.modifiedTimestamp = modifiedTimestamp != null ? modifiedTimestamp : 0L;\n }\n\n Element publishedElem = metadataElem.selectFirst(\"dc|date\");\n if(publishedElem == null) {\n this.publishedTimestamp = 0L;\n } else {\n Long publishedTimestamp = tryParseISO8601(publishedElem.text());\n this.publishedTimestamp = publishedTimestamp != null ? publishedTimestamp : 0L;\n }\n\n this.titles = dcElements(metadataElem, \"title\");\n this.title = titles.isEmpty() ? \"\" : this.titles.get(0);\n\n Element languageElem = metadataElem.selectFirst(\"dc|language\");\n this.language = languageElem != null ? languageElem.text() : \"\";\n\n this.rights = dcElements(metadataElem, \"rights\");\n this.creators = dcElements(metadataElem, \"creator\");\n this.contributors = dcElements(metadataElem, \"contributor\");\n this.subjects = dcElements(metadataElem, \"subject\");\n }", "DatastoreMetadataFactory<EntityMetadata, Discriminator> getMetadataFactory();", "public MetaData(\n final UUID uniqueId, final Long version,\n final OffsetDateTime created, final OffsetDateTime modified\n ) {\n setUniqueId(uniqueId);\n setVersion(version);\n setCreated(created);\n setModified(modified);\n }", "public PDMetadata getMetadata() {\n/* 528 */ PDMetadata retval = null;\n/* 529 */ COSBase mdStream = this.stream.getDictionaryObject(COSName.METADATA);\n/* 530 */ if (mdStream != null)\n/* */ {\n/* 532 */ if (mdStream instanceof COSStream) {\n/* */ \n/* 534 */ retval = new PDMetadata((COSStream)mdStream);\n/* */ }\n/* 536 */ else if (!(mdStream instanceof org.apache.pdfbox.cos.COSNull)) {\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 542 */ throw new IllegalStateException(\"Expected a COSStream but was a \" + mdStream\n/* */ \n/* 544 */ .getClass().getSimpleName());\n/* */ } \n/* */ }\n/* 547 */ return retval;\n/* */ }", "public void createPackageContents() {\n\t\tif (isCreated) return;\n\t\tisCreated = true;\n\n\t\t// Create classes and their features\n\t\tmetadataEClass = createEClass(METADATA);\n\t\tcreateEAttribute(metadataEClass, METADATA__GAMENAME);\n\t\tcreateEAttribute(metadataEClass, METADATA__SHORTNAME);\n\t\tcreateEAttribute(metadataEClass, METADATA__TIMING);\n\t\tcreateEAttribute(metadataEClass, METADATA__ADRESSING);\n\t\tcreateEAttribute(metadataEClass, METADATA__CARTRIDGE_TYPE);\n\t\tcreateEAttribute(metadataEClass, METADATA__ROM_SIZE);\n\t\tcreateEAttribute(metadataEClass, METADATA__RAM_SIZE);\n\t\tcreateEAttribute(metadataEClass, METADATA__LICENSEE);\n\t\tcreateEAttribute(metadataEClass, METADATA__COUNTRY);\n\t\tcreateEAttribute(metadataEClass, METADATA__VIDEOFORMAT);\n\t\tcreateEAttribute(metadataEClass, METADATA__VERSION);\n\t\tcreateEAttribute(metadataEClass, METADATA__IDE_VERSION);\n\t}", "public DeltaLakeMetadata create(ConnectorIdentity identity)\n {\n CachingHiveMetastore cachingHiveMetastore = memoizeMetastore(\n hiveMetastoreFactory.createMetastore(Optional.of(identity)),\n perTransactionMetastoreCacheMaximumSize);\n AccessControlMetadata accessControlMetadata = accessControlMetadataFactory.create(cachingHiveMetastore);\n HiveMetastoreBackedDeltaLakeMetastore deltaLakeMetastore = new HiveMetastoreBackedDeltaLakeMetastore(cachingHiveMetastore);\n FileBasedTableStatisticsProvider tableStatisticsProvider = new FileBasedTableStatisticsProvider(\n typeManager,\n transactionLogAccess,\n statisticsAccess);\n TrinoViewHiveMetastore trinoViewHiveMetastore = new TrinoViewHiveMetastore(\n cachingHiveMetastore,\n accessControlMetadata.isUsingSystemSecurity(),\n trinoVersion,\n \"Trino Delta Lake connector\");\n return new DeltaLakeMetadata(\n deltaLakeMetastore,\n transactionLogAccess,\n tableStatisticsProvider,\n fileSystemFactory,\n typeManager,\n accessControlMetadata,\n trinoViewHiveMetastore,\n domainCompactionThreshold,\n unsafeWritesEnabled,\n dataFileInfoCodec,\n mergeResultJsonCodec,\n transactionLogWriterFactory,\n nodeManager,\n checkpointWriterManager,\n checkpointWritingInterval,\n deleteSchemaLocationsFallback,\n deltaLakeRedirectionsProvider,\n statisticsAccess,\n useUniqueTableLocation,\n allowManagedTableRename);\n }", "public FieldMetaData(MetaData parent, AbstractMemberMetaData fmd)\r\n {\r\n super(parent, fmd);\r\n }", "public MemoryEntryInfo createMemoryEntryInfo() {\n\t\tMemoryEntryInfo info = new MemoryEntryInfo(new HashMap<String, Object>(this.info.getProperties()));\n\t\tinfo.getProperties().put(MemoryEntryInfo.FILE_MD5, md5);\n\t\tinfo.getProperties().put(MemoryEntryInfo.FILENAME, fileName);\n\t\tinfo.getProperties().put(MemoryEntryInfo.OFFSET, fileoffs);\n\t\treturn info;\n\t}", "public Metadata(String key, String value) {\n mJSONObject = new JSONObject();\n insert(key, value);\n }", "protected CfDef getCfDef(Cassandra.Client client)\n throws org.apache.cassandra.thrift.InvalidRequestException,\n UnavailableException,\n TimedOutException,\n SchemaDisagreementException,\n TException,\n NotFoundException,\n org.apache.cassandra.exceptions.InvalidRequestException,\n ConfigurationException,\n IOException\n {\n // get CF meta data\n String query = String.format(\"SELECT type, comparator, subcomparator, default_validator, key_validator \" +\n \"FROM %s.%s \" +\n \"WHERE keyspace_name = '%s' AND columnfamily_name = '%s'\",\n SystemKeyspace.NAME,\n LegacySchemaTables.COLUMNFAMILIES,\n keyspace,\n column_family);\n\n CqlResult result = client.execute_cql3_query(ByteBufferUtil.bytes(query), Compression.NONE, ConsistencyLevel.ONE);\n\n if (result == null || result.rows == null || result.rows.isEmpty())\n return null;\n\n Iterator<CqlRow> iteraRow = result.rows.iterator();\n CfDef cfDef = new CfDef();\n cfDef.keyspace = keyspace;\n cfDef.name = column_family;\n if (iteraRow.hasNext())\n {\n CqlRow cqlRow = iteraRow.next();\n\n cfDef.column_type = ByteBufferUtil.string(cqlRow.columns.get(0).value);\n cfDef.comparator_type = ByteBufferUtil.string(cqlRow.columns.get(1).value);\n ByteBuffer subComparator = cqlRow.columns.get(2).value;\n if (subComparator != null)\n cfDef.subcomparator_type = ByteBufferUtil.string(subComparator);\n cfDef.default_validation_class = ByteBufferUtil.string(cqlRow.columns.get(3).value);\n cfDef.key_validation_class = ByteBufferUtil.string(cqlRow.columns.get(4).value);\n }\n cfDef.column_metadata = getColumnMetadata(client);\n return cfDef;\n }", "public static JavaMetadata instance( InputStream inputStream,\n long length,\n String encoding ) {\n\n JavaMetadata javaMetadata = new JavaMetadata();\n char[] source = null;\n try {\n source = JavaMetadataUtil.getJavaSourceFromTheInputStream(inputStream, length, encoding);\n } catch (Exception e) {\n e.printStackTrace();\n return null;\n }\n\n CompilationUnit unit = (CompilationUnit)CompilationUnitParser.runJLS3Conversion(source, true);\n if (unit != null) {\n javaMetadata.packageMetadata = javaMetadata.createPackageMetadata(unit);\n javaMetadata.imports = javaMetadata.createImportMetadata(unit);\n javaMetadata.types = javaMetadata.createTypeMetadata(unit);\n\n }\n\n return javaMetadata;\n }", "public MetaDataContract()\n {\n }", "Information createInformation();", "public synchronized static MetaDataCache getInstance() {\r\n if (instance == null) {\r\n instance = new MetaDataCache();\r\n }\r\n return instance;\r\n }", "void addMetaData(MetaDataDescriptor mdd);", "Definition createDefinition();", "public BoofCVMeta() {\n\n addDependency(\"org.boofcv\", \"boofcv-all\", \"0.40.1\");\n addDescription(\"BoofCV computer vision service\");\n addCategory(\"vision\");\n }", "public gov.ucore.ucore._2_0.ContentMetadataType addNewMetadata()\n {\n synchronized (monitor())\n {\n check_orphaned();\n gov.ucore.ucore._2_0.ContentMetadataType target = null;\n target = (gov.ucore.ucore._2_0.ContentMetadataType)get_store().add_element_user(METADATA$0);\n return target;\n }\n }", "@Test\n\tpublic void testCaching() throws IOException {\n\t\tTidaModel model;\n\t\tIMetaDataCollection mdc;\n\n\t\tsetUp(null);\n\t\tmodel = m(\"/net/meisen/dissertation/impl/cache/hibernate/metaDataModel.xml\");\n\n\t\t// check the empty cache\n\t\tassertEquals(0, model.getMetaDataCache().createMetaDataCollection()\n\t\t\t\t.size());\n\n\t\tmdc = model.getMetaDataCache().createMetaDataCollection();\n\t\tassertEquals(0, mdc.get(\"STRING\").size());\n\t\tassertEquals(0, mdc.get(\"INT\").size());\n\t\tassertEquals(0, mdc.get(\"LONG\").size());\n\n\t\t// let's add an some values\n\t\tmodel.loadRecord(\n\t\t\t\tcreateStructure(),\n\t\t\t\tcreateDataset(\"01.01.2015\", \"02.01.2015\", \"value1\", 50000,\n\t\t\t\t\t\t100000));\n\t\tmodel.loadRecord(\n\t\t\t\tcreateStructure(),\n\t\t\t\tcreateDataset(\"02.01.2015\", \"03.01.2015\", \"value2\", 60000,\n\t\t\t\t\t\t200000));\n\t\tmodel.loadRecord(\n\t\t\t\tcreateStructure(),\n\t\t\t\tcreateDataset(\"03.01.2015\", \"04.01.2015\", \"value3\", 70000,\n\t\t\t\t\t\t300000));\n\t\tmdc = model.getMetaDataCache().createMetaDataCollection();\n\n\t\tassertEquals(1, mdc.get(\"STRING\").size());\n\t\tassertEquals(1, mdc.get(\"INT\").size());\n\t\tassertEquals(1, mdc.get(\"LONG\").size());\n\t\tassertEquals(3, mdc.sizeOfValues(\"STRING\"));\n\t\tassertEquals(3, mdc.sizeOfValues(\"INT\"));\n\t\tassertEquals(3, mdc.sizeOfValues(\"LONG\"));\n\n\t\tcreateMetaData(model);\n\t\tmdc = model.getMetaDataCache().createMetaDataCollection();\n\t\tassertEquals(7, mdc.sizeOfValues(\"STRING\"));\n\t\tassertEquals(1003, mdc.sizeOfValues(\"INT\"));\n\t\tassertEquals(1003, mdc.sizeOfValues(\"LONG\"));\n\t}", "public PDMetadata getMetadata()\n {\n PDMetadata retval = null;\n COSBase mdStream = stream.getDictionaryObject(COSName.METADATA);\n if (mdStream instanceof COSStream)\n {\n retval = new PDMetadata((COSStream) mdStream);\n } \n else if (mdStream instanceof COSNull)\n {\n // null is authorized\n } \n else if (mdStream != null)\n {\n throw new IllegalStateException(\"Expected a COSStream but was a \"\n + mdStream.getClass().getSimpleName());\n }\n return retval;\n }", "public void setMetaData(MetaData newMetaData);", "public MetaData getMetaData() {\n return metaData;\n }", "public MetadataResponse() {\n data = new HashMap<String, Object>();\n }", "public AbstractLifecycleMetaData()\n {\n }", "DataType createDataType();", "protected void createMetaData(final TidaModel model) {\n\n\t\t// add some descriptors\n\t\tmodel.getMetaDataModel().createDescriptor(\"STRING\", \"Dog\");\n\t\tmodel.getMetaDataModel().createDescriptor(\"STRING\", \"Cat\");\n\t\tmodel.getMetaDataModel().createDescriptor(\"STRING\", \"Mouse\");\n\t\tmodel.getMetaDataModel().createDescriptor(\"STRING\", \"ÜÄÖß\");\n\t\tfor (int i = 0; i < 1000; i++) {\n\t\t\tmodel.getMetaDataModel().createDescriptor(\"INT\", i);\n\t\t}\n\t\tfor (long i = Long.MAX_VALUE; i > Long.MAX_VALUE - 1000; i--) {\n\t\t\tmodel.getMetaDataModel().createDescriptor(\"LONG\", i);\n\t\t}\n\t}", "public CMObject newInstance();", "public void constructWith(LzzFileInfo pro) {\n\t\tthis.id = pro.getId ();\n\n\t\tthis.fname = pro.getFname ();\n\n\t\tthis.ftype = pro.getFtype ();\n\n\t\tthis.fsavepath = pro.getFsavepath ();\n\n\t\tthis.furlpath = pro.getFurlpath ();\n\n\t\tthis.createTime = pro.getCreateTime ();\n\n\t\tthis.modifyTime = pro.getModifyTime ();\n\n\t\tthis.def1 = pro.getDef1 ();\n\n\t\tthis.def2 = pro.getDef2 ();\n\n\t\tthis.def3 = pro.getDef3 ();\n\n\t\tthis.def4 = pro.getDef4 ();\n\n\t\tthis.def5 = pro.getDef5 ();\n\n\t\tthis.def6 = pro.getDef6 ();\n\n\t\tthis.def7 = pro.getDef7 ();\n\n\t\tthis.def8 = pro.getDef8 ();\n\n\t\tthis.def9 = pro.getDef9 ();\n\n\t\tthis.def10 = pro.getDef10 ();\n\n\t\tthis.dr = pro.getDr ();\n\n\t}", "public Feature createFeature(Feature.Template ft)\n throws BioException, ChangeVetoException;", "public ColumnMetaData(String header, int align, int autoWrap) {\n \tlabel = header;\n \tinitialWidth = header.length();\n \twidth = initialWidth;\n \talignment = align;\n \tdisplay = true;\n autoWrapCol = autoWrap;\n }", "public MetaData getMetaData() {\r\n \treturn metaData;\r\n }", "private static void makeInstance(){\n\n if(settingsFile==null){\n settingsFile = new MetadataFile(SETTINGS_FILE_PATH);\n }\n\n if(!settingsFile.exists()){\n settingsFile.create();\n }\n\n if(tagListeners==null){\n tagListeners= new HashMap<>();\n }\n\n }", "public MetadataResponse() {\n }", "private ApiInfo metaData() {\n return new ApiInfoBuilder()\n .title(\"Spring Boot REST API\")\n .description(\"\\\"Spring Boot REST API for Vertica Developer Training\\\"\")\n .version(\"1.0.0\")\n .license(\"Apache License Version 2.0\")\n .licenseUrl(\"https://www.apache.org/licenses/LICENSE-2.0\\\"\")\n .contact(new Contact(\"Thingtrack\", \"https://www.thingtrack.com\", \"[email protected]\"))\n .build();\n }", "public static ColumnMetadataBuilder newBuilder() {\n ColumnMetadataBuilder mb = new ColumnMetadataBuilder();\n mb.name = \"testCol\";\n mb.byteLength = 14;\n mb.length = 11;\n mb.scale = 0;\n mb.precision = 4;\n return mb;\n }", "TypeDef createTypeDef();", "CreationData creationData();", "public AbstractJob addMetaData(String key, String value) {\n this.mMetaDataAttributes.add(new MetaData(key, value));\n return this;\n }", "public static DataModelBuilder create() {\n return new DataModelBuilder();\n }", "protected static CfDef cfdefFromString(String st) throws IOException\n {\n assert st != null;\n TDeserializer deserializer = new TDeserializer(new TBinaryProtocol.Factory());\n CfDef cfDef = new CfDef();\n try\n {\n deserializer.deserialize(cfDef, Hex.hexToBytes(st));\n }\n catch (TException e)\n {\n throw new IOException(e);\n }\n return cfDef;\n }", "private Contact createBaseContact()\n {\n Contact contact = new Contact();\n contact.setName(new Name(new LastName(\"Doe\"), new FirstName(\"John\")));\n contact.setAddress(new Address(new StreetAddress(\"123 Main St\"),\n null,\n new GeneralProperty(\"Tucson\"),\n new State(\"AZ\"),\n new Zip(\"85750\")));\n contact.setPhone(new Phone(\"(520) 123-4567\"));\n contact.setEmail(new Email(\"[email protected]\"));\n\n return contact;\n }", "public CatalogMetadataDetails(CatalogMetadataDetails other) {\n __isset_bitfield = other.__isset_bitfield;\n if (other.isSetNames()) {\n List<String> __this__names = new ArrayList<String>(other.names);\n this.names = __this__names;\n }\n if (other.isSetProperties()) {\n List<Map<String,String>> __this__properties = new ArrayList<Map<String,String>>(other.properties.size());\n for (Map<String,String> other_element : other.properties) {\n Map<String,String> __this__properties_copy = new HashMap<String,String>(other_element);\n __this__properties.add(__this__properties_copy);\n }\n this.properties = __this__properties;\n }\n if (other.isSetNewProperties()) {\n List<Map<String,String>> __this__newProperties = new ArrayList<Map<String,String>>(other.newProperties.size());\n for (Map<String,String> other_element : other.newProperties) {\n Map<String,String> __this__newProperties_copy = new HashMap<String,String>(other_element);\n __this__newProperties.add(__this__newProperties_copy);\n }\n this.newProperties = __this__newProperties;\n }\n this.catalogSchemaVersion = other.catalogSchemaVersion;\n this.exists = other.exists;\n if (other.isSetOtherFlags()) {\n List<Integer> __this__otherFlags = new ArrayList<Integer>(other.otherFlags);\n this.otherFlags = __this__otherFlags;\n }\n if (other.isSetCatalogSchema()) {\n this.catalogSchema = new CatalogSchemaObject(other.catalogSchema);\n }\n if (other.isSetCatalogTable()) {\n this.catalogTable = new CatalogTableObject(other.catalogTable);\n }\n if (other.isSetCatalogFunction()) {\n this.catalogFunction = new CatalogFunctionObject(other.catalogFunction);\n }\n if (other.isSetCatalogPartitions()) {\n List<CatalogPartitionObject> __this__catalogPartitions = new ArrayList<CatalogPartitionObject>(other.catalogPartitions.size());\n for (CatalogPartitionObject other_element : other.catalogPartitions) {\n __this__catalogPartitions.add(new CatalogPartitionObject(other_element));\n }\n this.catalogPartitions = __this__catalogPartitions;\n }\n }", "public ReferenceSystemMetadata(final ReferenceSystem crs) {\n super(crs);\n }", "public DescriptorCacheImpl() {\n super();\n \n LOG2.debug(\"New instance!\");\n \n _typeMap = new HashMap();\n _xmlNameMap = new HashMap();\n _missingTypes = new ArrayList();\n }", "CounselorBiographyTemp create(CounselorBiographyTemp entity);", "FieldType createFieldType();", "public ConfigMetadataProcessor() {\n }", "private void initMetadata() throws IOException {\n \n // start by reading the file header\n in.seek(0);\n byte[] toRead = new byte[4];\n in.read(toRead);\n long order = batoi(toRead); // byte ordering\n little = toRead[2] != 0xff || toRead[3] != 0xff;\n metadata.put(\"Byte Order\", new Boolean(little));\n \n in.skipBytes(4);\n in.read(toRead);\n long version = DataTools.bytesToLong(toRead, little);\n metadata.put(\"Version\", new Long(version));\n \n byte[] er = new byte[2];\n in.read(er);\n short count = DataTools.bytesToShort(er, little);\n metadata.put(\"Count\", new Short(count));\n \n in.skipBytes(2);\n \n in.read(toRead);\n long offset = DataTools.bytesToLong(toRead, little);\n \n // skip to first tag\n in.seek(offset);\n \n // read in each tag and its data\n \n for (int i=0; i<count; i++) {\n in.read(er);\n short tag = DataTools.bytesToShort(er, little);\n in.skipBytes(2);\n \n in.read(toRead);\n offset = DataTools.bytesToLong(toRead, little);\n \n in.read(toRead);\n long fmt = DataTools.bytesToLong(toRead, little);\n metadata.put(\"Format\", new Long(fmt));\n \n in.read(toRead);\n long numBytes = DataTools.bytesToLong(toRead, little);\n metadata.put(\"NumBytes\", new Long(numBytes));\n \n if (tag == 67 || tag == 68) {\n byte[] b = new byte[1];\n in.read(b);\n boolean isOpenlab2;\n if (b[0] == '0') isOpenlab2 = false;\n else isOpenlab2 = true;\n metadata.put(\"isOpenlab2\", new Boolean(isOpenlab2));\n \n in.skipBytes(2);\n in.read(er);\n short layerId = DataTools.bytesToShort(er, little);\n metadata.put(\"LayerID\", new Short(layerId));\n \n in.read(er);\n short layerType = DataTools.bytesToShort(er, little);\n metadata.put(\"LayerType\", new Short(layerType));\n \n in.read(er);\n short bitDepth = DataTools.bytesToShort(er, little);\n metadata.put(\"BitDepth\", new Short(bitDepth));\n \n in.read(er);\n short opacity = DataTools.bytesToShort(er, little);\n metadata.put(\"Opacity\", new Short(opacity));\n \n // not sure how many bytes to skip here\n in.skipBytes(10);\n \n in.read(toRead);\n long type = DataTools.bytesToLong(toRead, little);\n metadata.put(\"ImageType\", new Long(type));\n \n // not sure how many bytes to skip\n in.skipBytes(10);\n \n in.read(toRead);\n long timestamp = DataTools.bytesToLong(toRead, little);\n metadata.put(\"Timestamp\", new Long(timestamp));\n \n in.skipBytes(2);\n \n if (isOpenlab2 == true) {\n byte[] layerName = new byte[127];\n in.read(layerName);\n metadata.put(\"LayerName\", new String(layerName));\n \n in.read(toRead);\n long timestampMS = DataTools.bytesToLong(toRead, little);\n metadata.put(\"Timestamp-MS\", new Long(timestampMS));\n \n in.skipBytes(1);\n byte[] notes = new byte[118];\n in.read(notes);\n metadata.put(\"Notes\", new String(notes));\n }\n else in.skipBytes(123);\n }\n else if (tag == 69) {\n in.read(toRead);\n long platform = DataTools.bytesToLong(toRead, little);\n metadata.put(\"Platform\", new Long(platform));\n \n in.read(er);\n short units = DataTools.bytesToShort(er, little);\n metadata.put(\"Units\", new Short(units));\n \n in.read(er);\n short imageId = DataTools.bytesToShort(er, little);\n metadata.put(\"ID\", new Short(imageId));\n in.skipBytes(1);\n \n byte[] toRead2 = new byte[8];\n double xOrigin = DataTools.readDouble(in, little);\n metadata.put(\"XOrigin\", new Double(xOrigin));\n double yOrigin = DataTools.readDouble(in, little);\n metadata.put(\"YOrigin\", new Double(yOrigin));\n double xScale = DataTools.readDouble(in, little);\n metadata.put(\"XScale\", new Double(xScale));\n double yScale = DataTools.readDouble(in, little);\n metadata.put(\"YScale\", new Double(yScale));\n in.skipBytes(1);\n \n byte[] other = new byte[31];\n in.read(other);\n metadata.put(\"Other\", new String(other));\n }\n \n // Initialize OME metadata\n \n if (ome != null) {\n OMETools.setBigEndian(ome, !little);\n if (metadata.get(\"BitDepth\") != null) {\n int bitDepth = ((Integer) metadata.get(\"BitDepth\")).intValue();\n String type;\n \n if (bitDepth <= 8) type = \"int8\";\n else if (bitDepth <= 16) type = \"int16\";\n else type = \"int32\";\n \n OMETools.setPixelType(ome, type);\n }\n if (metadata.get(\"Timestamp\") != null) {\n OMETools.setCreationDate(ome, (String) metadata.get(\"Timestamp\"));\n }\n \n if (metadata.get(\"XOrigin\") != null) {\n Double xOrigin = (Double) metadata.get(\"XOrigin\");\n OMETools.setStageX(ome, xOrigin.floatValue());\n }\n \n if (metadata.get(\"YOrigin\") != null) {\n Double yOrigin = (Double) metadata.get(\"YOrigin\");\n OMETools.setStageY(ome, yOrigin.floatValue());\n }\n \n if (metadata.get(\"XScale\") != null) {\n Double xScale = (Double) metadata.get(\"XScale\");\n OMETools.setPixelSizeX(ome, xScale.floatValue());\n }\n \n if (metadata.get(\"YScale\") != null) {\n Double yScale = (Double) metadata.get(\"YScale\");\n OMETools.setPixelSizeY(ome, yScale.floatValue());\n }\n }\n in.seek(offset);\n }\n }", "public static MetadataContext get() {\n if (null == METADATA_CONTEXT.get()) {\n MetadataContext metadataContext = new MetadataContext();\n if (metadataLocalProperties == null) {\n metadataLocalProperties = (MetadataLocalProperties) ApplicationContextAwareUtils\n .getApplicationContext().getBean(\"metadataLocalProperties\");\n }\n\n // init custom metadata and load local metadata\n Map<String, String> transitiveMetadataMap = getTransitiveMetadataMap(metadataLocalProperties.getContent(),\n metadataLocalProperties.getTransitive());\n metadataContext.putAllTransitiveCustomMetadata(transitiveMetadataMap);\n\n // init system metadata\n metadataContext.putSystemMetadata(MetadataConstant.SystemMetadataKey.LOCAL_NAMESPACE,\n LOCAL_NAMESPACE);\n metadataContext.putSystemMetadata(MetadataConstant.SystemMetadataKey.LOCAL_SERVICE,\n LOCAL_SERVICE);\n\n METADATA_CONTEXT.set(metadataContext);\n }\n return METADATA_CONTEXT.get();\n }", "protected MetadataUGWD() {/* intentionally empty block */}", "public AnalysisDef() {}", "WithCreate withDescription(String description);", "WithCreate withDescription(String description);", "public Cache<ImmutableBytesPtr,PMetaDataEntity> getMetaDataCache() {\n Cache<ImmutableBytesPtr,PMetaDataEntity> result = metaDataCache;\n if (result == null) {\n synchronized(this) {\n result = metaDataCache;\n if(result == null) {\n long maxTTL = config.getLong(\n QueryServices.MAX_SERVER_METADATA_CACHE_TIME_TO_LIVE_MS_ATTRIB,\n QueryServicesOptions.DEFAULT_MAX_SERVER_METADATA_CACHE_TIME_TO_LIVE_MS);\n long maxSize = config.getLongBytes(\n QueryServices.MAX_SERVER_METADATA_CACHE_SIZE_ATTRIB,\n QueryServicesOptions.DEFAULT_MAX_SERVER_METADATA_CACHE_SIZE);\n metaDataCache = result = CacheBuilder.newBuilder()\n .maximumWeight(maxSize)\n .expireAfterAccess(maxTTL, TimeUnit.MILLISECONDS)\n .weigher(new Weigher<ImmutableBytesPtr, PMetaDataEntity>() {\n @Override\n public int weigh(ImmutableBytesPtr key, PMetaDataEntity table) {\n return SizedUtil.IMMUTABLE_BYTES_PTR_SIZE + key.getLength() + table.getEstimatedSize();\n }\n })\n .build();\n }\n }\n }\n return result;\n }", "public static FieldType create(Cursor cursor) {\n\t\tint idColon = cursor.getColumnIndex(ID);\n\t\tint nameColon = cursor.getColumnIndex(NAME);\n\t\tint createDateColumn = cursor.getColumnIndex(CREATE_DATE);\n\t\tint modifyDateColumn = cursor.getColumnIndex(MODIFY_DATE);\n\t\tFieldType field = new FieldType();\n\n\t\tif ((idColon > -1) && (cursor.getColumnCount() > idColon)) {\n\t\t\tfield.setId((cursor.getLong(idColon)));\n\t\t}\n\n\t\tif ((nameColon > -1) && (cursor.getColumnCount() > nameColon)) {\n\t\t\tfield.setName(cursor.getString(nameColon));\n\t\t}\n\t\tif ((createDateColumn > -1)\n\t\t\t\t&& (cursor.getColumnCount() > createDateColumn)) {\n\t\t\tfield.setCreateDate(cursor.getLong(createDateColumn));\n\t\t}\n\t\tif ((modifyDateColumn > -1)\n\t\t\t\t&& (cursor.getColumnCount() > modifyDateColumn)) {\n\t\t\tfield.setModifyDate(cursor.getLong(modifyDateColumn));\n\t\t}\n\t\tif (cursor.isLast()) {\n\t\t\tcursor.close();\n\t\t}\n\t\treturn field;\n\t}", "public DataTable() {\n\n\t\t// In this application, we use HashMap data structure defined in\n\t\t// java.util.HashMap\n\t\tdc = new HashMap<String, DataColumn>();\n\t}", "Foco createFoco();", "public static FormV1 createEntity() {\n FormV1 formV1 = new FormV1()\n .customerId(DEFAULT_CUSTOMER_ID)\n .formType(DEFAULT_FORM_TYPE);\n return formV1;\n }", "AtomicDataAttributes createAtomicDataAttributes();", "private void initMetaSetting() throws DPFTRuntimeException {\n\t\tDPFTConnector connector;\n\t\ttry {\n\t\t\tconnector = DPFTConnectionFactory.initDPFTConnector(DPFTUtil.getSystemDBConfig());\n\t\t\tmeta = (FileMetaDefDboSet) connector.getDboSet(\"DPFT_FILE_META_DEF\", \"chal_name='\" + getChannelName() + \"' and active=1\");\n\t\t\tdicSet = (FileDictionaryDboSet) connector.getDboSet(\"DPFT_FILE_DIC\", \"chal_name='\" + getChannelName() + \"' and active=1\");\n\t\t} catch (DPFTConnectionException e) {\n\t\t\tthrow new DPFTActionException(this, \"SYSTEM\", \"DPFT0001E\", e);\n\t\t}\n\t\tmeta.load();\n\t\tdicSet.load();\n\t\tmeta.close();\n\t\tdicSet.close();\n\t}", "public static Factory factory() {\n return ext_accdt::new;\n }", "public gov.niem.niem.structures._2_0.MetadataType addNewMetadata()\n {\n synchronized (monitor())\n {\n check_orphaned();\n gov.niem.niem.structures._2_0.MetadataType target = null;\n target = (gov.niem.niem.structures._2_0.MetadataType)get_store().add_element_user(METADATA$0);\n return target;\n }\n }", "@Override\n\tpublic IColumns createColumns() {\n\t\treturn new WaybillforauditColumns();\n\t}", "@Override\n\tpublic IColumns createColumns() {\n\t\treturn new CustomerselfhawbColumns();\n\t}", "public ComponentDescriptor() {\r\n\t\t// initialize empty collections\r\n\t\tconstructorParametersTypes = new LinkedList<List<Class<?>>>();\r\n//\t\trequiredProperties = new HashMap<String, MetaProperty>();\r\n//\t\toptionalProperties = new HashMap<String, MetaProperty>();\r\n\t}", "Context(final DatabaseMetaData databaseMetaData) {\n super();\n this.databaseMetaData = Objects.requireNonNull(databaseMetaData, \"databaseMetaData is null\");\n }", "public FieldInfo() {\r\n \t// No implementation required\r\n }", "public CreateData() {\n\t\t\n\t\t// TODO Auto-generated constructor stub\n\t}", "public static CLONDATAFactory init() {\n\t\ttry {\n\t\t\tCLONDATAFactory theCLONDATAFactory = (CLONDATAFactory) EPackage.Registry.INSTANCE.getEFactory(\n\t\t\t\tCLONDATAPackage.eNS_URI);\n\t\t\tif (theCLONDATAFactory != null) {\n\t\t\t\treturn theCLONDATAFactory;\n\t\t\t}\n\t\t} catch (Exception exception) {\n\t\t\tEcorePlugin.INSTANCE.log(exception);\n\t\t}\n\t\treturn new CLONDATAFactoryImpl();\n\t}", "public FieldMetaData(MetaData parent, final String name)\r\n {\r\n super(parent, name);\r\n }", "com.cmpe275.grpcComm.MetaDataOrBuilder getMetaDataOrBuilder();", "public static BnetDistributedKB create(final BnetDistributedCF cf) {\n\t\treturn new BnetDistributedKB() {\n\n\t\t\t\n\t\t\t/**\n\t\t\t * Serial version UID for serializable class. \n\t\t\t */\n\t\t\tprivate static final long serialVersionUID = 1L;\n\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic String getName() {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\treturn cf.getName();\n\t\t\t}\n\t\t\t\n\t\t};\n\t}", "public Builder setMetadata(io.grafeas.v1.Metadata value) {\n if (metadataBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n metadata_ = value;\n } else {\n metadataBuilder_.setMessage(value);\n }\n bitField0_ |= 0x00000004;\n onChanged();\n return this;\n }", "private Attribute createAttribute() {\n\t\t\tAttribute att = AttributeFactory.createAttribute(getName(), getValueType());\n\t\t\tatt.getAnnotations().clear();\n\t\t\tatt.getAnnotations().putAll(getAnnotations());\n\t\t\tattribute = att;\n\t\t\treturn att;\n\t\t}", "private static ColumnDefinition getClusteringColumnDefinition(CFMetaData cfMetaData, int index)\n {\n return cfMetaData.clusteringColumns().get(index);\n }", "public void createPackageContents() {\r\n\t\tif (isCreated)\r\n\t\t\treturn;\r\n\t\tisCreated = true;\r\n\r\n\t\t// Create classes and their features\r\n\t\tdataChannelEClass = createEClass(DATA_CHANNEL);\r\n\t\tcreateEAttribute(dataChannelEClass, DATA_CHANNEL__CAPACITY);\r\n\t\tcreateEReference(dataChannelEClass, DATA_CHANNEL__SOURCE_EVENT_GROUP);\r\n\t\tcreateEReference(dataChannelEClass, DATA_CHANNEL__SINK_EVENT_GROUP);\r\n\t\tcreateEReference(dataChannelEClass, DATA_CHANNEL__DATA_CHANNEL_SOURCE_CONNECTOR);\r\n\t\tcreateEReference(dataChannelEClass, DATA_CHANNEL__DATA_CHANNEL_SINK_CONNECTOR);\r\n\t\tcreateEReference(dataChannelEClass, DATA_CHANNEL__PARTITIONING);\r\n\t\tcreateEReference(dataChannelEClass, DATA_CHANNEL__TIME_GROUPING);\r\n\t\tcreateEReference(dataChannelEClass, DATA_CHANNEL__JOINS);\r\n\t\tcreateEAttribute(dataChannelEClass, DATA_CHANNEL__OUTGOING_DISTRIBUTION);\r\n\t\tcreateEAttribute(dataChannelEClass, DATA_CHANNEL__SCHEDULING);\r\n\t\tcreateEAttribute(dataChannelEClass, DATA_CHANNEL__PUT_POLICY);\r\n\t}", "private D createAndRegisterDeclaration(Map<String, Object> metadata) {\n D declaration;\n if (klass.equals(ImportDeclaration.class)) {\n declaration = (D) ImportDeclarationBuilder.fromMetadata(metadata).build();\n } else if (klass.equals(ExportDeclaration.class)) {\n declaration = (D) ExportDeclarationBuilder.fromMetadata(metadata).build();\n } else {\n throw new IllegalStateException(\"\");\n }\n declarationRegistrationManager.registerDeclaration(declaration);\n return declaration;\n }" ]
[ "0.6213849", "0.58474976", "0.5686196", "0.56231236", "0.5550575", "0.551902", "0.54441345", "0.53879017", "0.53617096", "0.53393453", "0.5299201", "0.5279879", "0.52265346", "0.5166337", "0.5160773", "0.5155291", "0.5111163", "0.50491935", "0.5032846", "0.5032169", "0.50223935", "0.4980911", "0.49805307", "0.49587697", "0.49583453", "0.49560922", "0.49485946", "0.49262756", "0.49010447", "0.48980138", "0.48867807", "0.4885118", "0.48838308", "0.48795533", "0.48756656", "0.48664466", "0.4857128", "0.48551777", "0.48380655", "0.48360565", "0.48219702", "0.48144436", "0.48076817", "0.48058185", "0.4801333", "0.47907317", "0.4789896", "0.47726482", "0.47499362", "0.47333673", "0.471592", "0.471262", "0.47060093", "0.46955407", "0.4692988", "0.4685885", "0.46716282", "0.46702206", "0.46692297", "0.4668962", "0.466479", "0.46645004", "0.4664402", "0.46629047", "0.4662403", "0.46609727", "0.46602628", "0.4653178", "0.4652665", "0.46442688", "0.46429878", "0.4640744", "0.46358585", "0.46289796", "0.4624458", "0.4624458", "0.46237737", "0.4621082", "0.46169323", "0.4614821", "0.46111757", "0.46106595", "0.46036354", "0.45985273", "0.45876804", "0.45851988", "0.45787734", "0.4575979", "0.4575001", "0.45669463", "0.45659092", "0.45655286", "0.45528045", "0.4547594", "0.4541732", "0.4535149", "0.45350492", "0.45326075", "0.45320466", "0.4531278" ]
0.5841151
2
Creates a new SingleColumnRestriction.EQ instance for the specified clustering column.
private static Restriction newSingleEq(CFMetaData cfMetaData, int index, ByteBuffer value) { ColumnDefinition columnDef = getClusteringColumnDefinition(cfMetaData, index); return new SingleColumnRestriction.EQ(columnDef, toTerm(value)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Criteria andAttribEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"attrib = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andCnameEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"cname = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andStrEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"str = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andComposeEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"compose = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andConsigneeEqualToColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"consignee = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andSystemedEqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"systemed = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "@Test\n public void testBoundsAsCompositesWithOneEqRestrictionsAndOneClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC);\n\n ByteBuffer clustering_0 = ByteBufferUtil.bytes(1);\n Restriction eq = newSingleEq(cfMetaData, 0, clustering_0);\n\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.END);\n }", "public Criteria andAttr1EqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"attr1 = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "private static Restriction newMultiEq(CFMetaData cfMetaData, int firstIndex, ByteBuffer... values)\n {\n List<ColumnDefinition> columnDefinitions = new ArrayList<>();\n for (int i = 0; i < values.length; i++)\n {\n columnDefinitions.add(getClusteringColumnDefinition(cfMetaData, firstIndex + i));\n }\n return new MultiColumnRestriction.EQ(columnDefinitions, toMultiItemTerminal(values));\n }", "public Criteria andDeletedEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"deleted = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andExternalIdEqualToColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"external_id = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andAttr3EqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"attr3 = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andIdEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"id = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andCnameLessThanOrEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"cname <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andTenantIdEqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"tenant_id = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andNameEqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"`name` = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andShipChannelEqualToColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"ship_channel = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andDeletedLessThanOrEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"deleted <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andAttr8EqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"attr8 = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andPriceEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"price = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andCnameGreaterThanOrEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"cname >= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andAttribLessThanOrEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"attrib <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andTypeEqualToColumn(LitemallTypeRole.Column column) {\n addCriterion(new StringBuilder(\"`type` = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andAddByEqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"add_by = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andCnameNotEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"cname <> \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "@Test\n public void testBoundsAsCompositesWithOneEqRestrictionsAndTwoClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer clustering_0 = ByteBufferUtil.bytes(1);\n Restriction eq = newSingleEq(cfMetaData, 0, clustering_0);\n\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.END);\n }", "public Criteria andDeletedEqualToColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"deleted = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public IAverageClause having(String column);", "public Criteria andIdEqualToColumn(LitemallTypeRole.Column column) {\n addCriterion(new StringBuilder(\"id = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andSortEqualToColumn(YoungSeckillPromotionProductRelation.Column column) {\n addCriterion(new StringBuilder(\"sort = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andDeletedGreaterThanOrEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"deleted >= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andIdEqualToColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"id = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andDeletedNotEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"deleted <> \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andEnabledEqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"enabled = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andAddressEqualToColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"address = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andIfAnalyzeEqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"if_analyze = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andAttr9EqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"attr9 = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andStrLessThanOrEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"str <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andDeletedEqualToColumn(YoungSeckillPromotionProductRelation.Column column) {\n addCriterion(new StringBuilder(\"deleted = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andAttribNotEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"attrib <> \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andAttr6EqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"attr6 = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public void addFilterEqual(String column, Object value) {\n controlRelationAndAddToList(criterionList, Restrictions.eq(trimColumn(column), value), column);\n }", "public Criteria andAttribGreaterThanOrEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"attrib >= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andPnameEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"pname = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andAttr5EqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"attr5 = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andDeletedEqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"deleted = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andIdEqualToColumn(YoungSeckillPromotionProductRelation.Column column) {\n addCriterion(new StringBuilder(\"id = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andConsigneeLessThanOrEqualToColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"consignee <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andOrderSourceEqualToColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"order_source = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andStrGreaterThanOrEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"str >= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andComposeNotEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"compose <> \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andOrderTypeEqualToColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"order_type = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andAttr7EqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"attr7 = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public ContactListFilterPredicate column(String column) {\n this.column = column;\n return this;\n }", "Condition(Column col1, String relation, Column col2) {\n // YOUR CODE HERE\n }", "public Criteria andDeletedLessThanOrEqualToColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"deleted <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andCurrencyEqualToColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"currency = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andAttr4EqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"attr4 = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andIdEqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"id = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andSystemedNotEqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"systemed <> \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andAttr1LessThanOrEqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"attr1 <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andComposeLessThanOrEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"compose <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andAttr3LessThanOrEqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"attr3 <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andUpdateByEqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"update_by = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andExternalIdGreaterThanOrEqualToColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"external_id >= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andStrNotEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"str <> \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andShipSnEqualToColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"ship_sn = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andSystemedLessThanOrEqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"systemed <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andDeletedLessThanOrEqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"deleted <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andDeletedLessThanOrEqualToColumn(YoungSeckillPromotionProductRelation.Column column) {\n addCriterion(new StringBuilder(\"deleted <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andShipRemarkEqualToColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"ship_remark = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andAddTimeEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"add_time = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andConsigneeGreaterThanOrEqualToColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"consignee >= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andConsigneeNotEqualToColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"consignee <> \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andAttr2EqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"attr2 = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andOrderSnEqualToColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"order_sn = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andAttr1GreaterThanOrEqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"attr1 >= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andDeletedGreaterThanOrEqualToColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"deleted >= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andIntegralPriceEqualToColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"integral_price = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andDeletedNotEqualToColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"deleted <> \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andIconEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"icon = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andMainNameEqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"main_name = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andAttr1NotEqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"attr1 <> \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andIdGreaterThanOrEqualToColumn(LitemallTypeRole.Column column) {\n addCriterion(new StringBuilder(\"id >= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andVersionEqualToColumn(CoverCommentEntity.Column column) {\n addCriterion(new StringBuilder(\"version = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andDeletedGreaterThanOrEqualToColumn(YoungSeckillPromotionProductRelation.Column column) {\n addCriterion(new StringBuilder(\"deleted >= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andAttr8LessThanOrEqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"attr8 <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andTransationIdEqualToColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"transation_id = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andIfLeafEqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"if_leaf = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "Eq createEq();", "public Criteria andAttr3GreaterThanOrEqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"attr3 >= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andLevelEqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"`level` = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andDeletedNotEqualToColumn(YoungSeckillPromotionProductRelation.Column column) {\n addCriterion(new StringBuilder(\"deleted <> \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andAttr10EqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"attr10 = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andSystemedGreaterThanOrEqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"systemed >= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public T col(final String column) {\r\n\t\treturn op(ConditionValueType.COLUMN, column);\r\n\t}", "public Criteria andFreightPriceEqualToColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"freight_price = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andDeletedGreaterThanOrEqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"deleted >= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andComposeGreaterThanOrEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"compose >= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andShopOrderEqualToColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"shop_order = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }" ]
[ "0.57979923", "0.553727", "0.549655", "0.5476912", "0.54195774", "0.5405243", "0.5333841", "0.53203243", "0.5290347", "0.516612", "0.5115281", "0.50965977", "0.5079231", "0.5076078", "0.50572634", "0.50545174", "0.5043908", "0.50433046", "0.5033802", "0.50301355", "0.5017779", "0.50123554", "0.5002505", "0.49723852", "0.49712837", "0.49657318", "0.4958057", "0.49400052", "0.49363706", "0.4934807", "0.49213043", "0.4914671", "0.4903729", "0.49020252", "0.48934817", "0.48898745", "0.4883708", "0.48830616", "0.48673448", "0.4863622", "0.48628816", "0.48579276", "0.48512942", "0.4848353", "0.4846838", "0.48287427", "0.48220876", "0.48210487", "0.4818466", "0.48143426", "0.481328", "0.481288", "0.4804299", "0.4796909", "0.47889513", "0.4786995", "0.4783476", "0.4762861", "0.47538573", "0.47452867", "0.47444198", "0.47441337", "0.47372213", "0.47319484", "0.47229645", "0.47198638", "0.47191733", "0.4714414", "0.4712425", "0.47059888", "0.47038826", "0.4701997", "0.46949258", "0.4690203", "0.4688991", "0.46832204", "0.46818098", "0.4675557", "0.46657795", "0.46595812", "0.46453947", "0.46410236", "0.46335745", "0.4632768", "0.46238965", "0.46202704", "0.46177152", "0.46175933", "0.4613647", "0.46130022", "0.46111834", "0.46073368", "0.46067783", "0.4605786", "0.4604456", "0.46006832", "0.46005636", "0.45960966", "0.45951372", "0.45845556" ]
0.62385243
0
Creates a new MultiColumnRestriction.EQ instance for the specified clustering column.
private static Restriction newMultiEq(CFMetaData cfMetaData, int firstIndex, ByteBuffer... values) { List<ColumnDefinition> columnDefinitions = new ArrayList<>(); for (int i = 0; i < values.length; i++) { columnDefinitions.add(getClusteringColumnDefinition(cfMetaData, firstIndex + i)); } return new MultiColumnRestriction.EQ(columnDefinitions, toMultiItemTerminal(values)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Criteria andAttribEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"attrib = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "private static Restriction newSingleEq(CFMetaData cfMetaData, int index, ByteBuffer value)\n {\n ColumnDefinition columnDef = getClusteringColumnDefinition(cfMetaData, index);\n return new SingleColumnRestriction.EQ(columnDef, toTerm(value));\n }", "public Criteria andComposeEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"compose = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andCnameEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"cname = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andAttr3EqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"attr3 = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andConsigneeEqualToColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"consignee = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andStrEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"str = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andCnameGreaterThanOrEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"cname >= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andAttr1EqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"attr1 = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "@Test\n public void testBoundsAsCompositesWithOneEqRestrictionsAndOneClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC);\n\n ByteBuffer clustering_0 = ByteBufferUtil.bytes(1);\n Restriction eq = newSingleEq(cfMetaData, 0, clustering_0);\n\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.END);\n }", "public Criteria andTypeEqualToColumn(LitemallTypeRole.Column column) {\n addCriterion(new StringBuilder(\"`type` = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andSystemedEqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"systemed = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andAttribGreaterThanOrEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"attrib >= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andAddByEqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"add_by = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andIdEqualToColumn(LitemallTypeRole.Column column) {\n addCriterion(new StringBuilder(\"id = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andIdGreaterThanOrEqualToColumn(LitemallTypeRole.Column column) {\n addCriterion(new StringBuilder(\"id >= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andAttr3GreaterThanOrEqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"attr3 >= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andExternalIdEqualToColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"external_id = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andAttr8EqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"attr8 = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "@Test\n public void testBoundsAsCompositesWithOneEqRestrictionsAndTwoClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer clustering_0 = ByteBufferUtil.bytes(1);\n Restriction eq = newSingleEq(cfMetaData, 0, clustering_0);\n\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.END);\n }", "public Criteria andAttr2EqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"attr2 = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andNameEqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"`name` = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andStrGreaterThanOrEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"str >= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andConsigneeGreaterThanOrEqualToColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"consignee >= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andAttr6EqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"attr6 = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andCnameLessThanOrEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"cname <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andCnameNotEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"cname <> \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andExternalIdGreaterThanOrEqualToColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"external_id >= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andTypeGreaterThanOrEqualToColumn(LitemallTypeRole.Column column) {\n addCriterion(new StringBuilder(\"`type` >= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andRoleIdsEqualToColumn(LitemallTypeRole.Column column) {\n addCriterion(new StringBuilder(\"role_ids = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andAttr5EqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"attr5 = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andAttribLessThanOrEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"attrib <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andAttr3LessThanOrEqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"attr3 <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andPriceEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"price = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andDeletedGreaterThanOrEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"deleted >= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andAttr1GreaterThanOrEqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"attr1 >= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andAttribNotEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"attrib <> \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andTenantIdEqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"tenant_id = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andAttr9EqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"attr9 = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andAttr7EqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"attr7 = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andIdEqualToColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"id = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andComposeGreaterThanOrEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"compose >= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andComposeNotEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"compose <> \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andAttr2GreaterThanOrEqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"attr2 >= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andLevelEqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"`level` = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andDeletedEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"deleted = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andEnabledEqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"enabled = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andAttr8GreaterThanOrEqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"attr8 >= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andIdEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"id = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andAddressEqualToColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"address = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andAttr3NotEqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"attr3 <> \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andDeletedGreaterThanOrEqualToColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"deleted >= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andDeletedEqualToColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"deleted = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andOrderTypeEqualToColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"order_type = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andIfLeafEqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"if_leaf = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andRoleIdsGreaterThanOrEqualToColumn(LitemallTypeRole.Column column) {\n addCriterion(new StringBuilder(\"role_ids >= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andUpdateByEqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"update_by = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andSystemedGreaterThanOrEqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"systemed >= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andAttr4GreaterThanOrEqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"attr4 >= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andIfAnalyzeEqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"if_analyze = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andAttr6GreaterThanOrEqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"attr6 >= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andAttr4EqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"attr4 = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andDeletedGreaterThanOrEqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"deleted >= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andEnabledGreaterThanOrEqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"enabled >= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public IAverageClause having(String column);", "public Criteria andTenantIdGreaterThanOrEqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"tenant_id >= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andDeletedLessThanOrEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"deleted <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andConsigneeLessThanOrEqualToColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"consignee <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andMessageEqualToColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"message = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andShipChannelEqualToColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"ship_channel = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andAttr1LessThanOrEqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"attr1 <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andAttr2LessThanOrEqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"attr2 <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andStrLessThanOrEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"str <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "Condition(Column col1, String relation, Column col2) {\n // YOUR CODE HERE\n }", "public Criteria andConsigneeNotEqualToColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"consignee <> \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andComposeLessThanOrEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"compose <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andFreightPriceEqualToColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"freight_price = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andDeletedNotEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"deleted <> \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andAttr1NotEqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"attr1 <> \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andDeletedEqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"deleted = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andIdEqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"id = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andAddByGreaterThanOrEqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"add_by >= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public ContactListFilterPredicate column(String column) {\n this.column = column;\n return this;\n }", "public Criteria andIdGreaterThanOrEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"id >= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andSystemedNotEqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"systemed <> \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andNameGreaterThanOrEqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"`name` >= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andPnameEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"pname = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andShipRemarkEqualToColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"ship_remark = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andGrouponPriceEqualToColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"groupon_price = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andRemarkEqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"remark = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andSortEqualToColumn(YoungSeckillPromotionProductRelation.Column column) {\n addCriterion(new StringBuilder(\"sort = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andAddressGreaterThanOrEqualToColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"address >= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andAddTimeEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"add_time = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andCurrencyEqualToColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"currency = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andAttr9GreaterThanOrEqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"attr9 >= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andIdGreaterThanOrEqualToColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"id >= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andAttr5GreaterThanOrEqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"attr5 >= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public void addFilterEqual(String column, Object value) {\n controlRelationAndAddToList(criterionList, Restrictions.eq(trimColumn(column), value), column);\n }", "public Criteria andTypeLessThanOrEqualToColumn(LitemallTypeRole.Column column) {\n addCriterion(new StringBuilder(\"`type` <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andStrNotEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"str <> \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }" ]
[ "0.5634379", "0.5523779", "0.54032505", "0.5296474", "0.52675945", "0.5227618", "0.51486933", "0.5141298", "0.51400286", "0.51374555", "0.5102513", "0.50926954", "0.50492847", "0.50390196", "0.5033893", "0.49887106", "0.49884164", "0.49633235", "0.49487346", "0.49413982", "0.49400476", "0.4930358", "0.4902794", "0.4900881", "0.48947814", "0.48910323", "0.4884929", "0.4880201", "0.48793647", "0.48741898", "0.48737907", "0.48719713", "0.48705575", "0.48702917", "0.48590145", "0.48564705", "0.48552668", "0.48424593", "0.4838728", "0.48302087", "0.48296744", "0.4815408", "0.48153228", "0.48004496", "0.47990915", "0.47940606", "0.47891545", "0.47871706", "0.47667405", "0.47655243", "0.47640485", "0.47551748", "0.47479913", "0.4743819", "0.47360143", "0.4733344", "0.47256893", "0.47137722", "0.470747", "0.47072375", "0.4705698", "0.47005478", "0.46793762", "0.46748778", "0.46708098", "0.46696705", "0.46608123", "0.46607763", "0.465714", "0.46560544", "0.46557432", "0.46530193", "0.46523082", "0.46513346", "0.46423674", "0.4641176", "0.46359715", "0.46270144", "0.46268213", "0.4625565", "0.46251616", "0.46238923", "0.4621864", "0.46179006", "0.461641", "0.4612868", "0.4608116", "0.46057022", "0.4601689", "0.4600531", "0.45982182", "0.4598085", "0.45968333", "0.4593515", "0.45903853", "0.4586831", "0.45791736", "0.457904", "0.45776036", "0.4574267" ]
0.5704123
0
Creates a new MultiColumnRestriction.IN instance for the specified clustering column.
@SafeVarargs private static Restriction newMultiIN(CFMetaData cfMetaData, int firstIndex, List<ByteBuffer>... values) { List<ColumnDefinition> columnDefinitions = new ArrayList<>(); List<Term> terms = new ArrayList<>(); for (int i = 0; i < values.length; i++) { columnDefinitions.add(getClusteringColumnDefinition(cfMetaData, firstIndex + i)); terms.add(toMultiItemTerminal(values[i].toArray(new ByteBuffer[0]))); } return new MultiColumnRestriction.InWithValues(columnDefinitions, terms); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static Restriction newSingleIN(CFMetaData cfMetaData, int index, ByteBuffer... values)\n {\n ColumnDefinition columnDef = getClusteringColumnDefinition(cfMetaData, index);\n return new SingleColumnRestriction.InWithValues(columnDef, toTerms(values));\n }", "PivotInClause createPivotInClause();", "public Query in(String key, Object[] value) {\n Preconditions.checkNotNull(key);\n builder.addFilter(builder.getOperator(QueryFilterBuilder.Operators.IN), key, value);\n return this;\n }", "UnipivotInClause createUnipivotInClause();", "@Test\n public void testBoundsAsCompositesWithOneInRestrictionsAndOneClusteringColumn()\n {\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n Restriction in = newSingleIN(cfMetaData, 0, value1, value2, value3);\n\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(in);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.START);\n assertComposite(bounds.get(2), value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n assertComposite(bounds.get(1), value2, EOC.END);\n assertComposite(bounds.get(2), value3, EOC.END);\n }", "public final void mIN() throws RecognitionException {\n try {\n int _type = IN;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n // /Users/dannluciano/Sources/MyLanguage/expr.g:151:4: ( 'in' )\n // /Users/dannluciano/Sources/MyLanguage/expr.g:151:6: 'in'\n {\n match(\"in\"); \n\n\n }\n\n state.type = _type;\n state.channel = _channel;\n }\n finally {\n }\n }", "public interface In extends Clause {}", "public Criteria andRoleIdsEqualToColumn(LitemallTypeRole.Column column) {\n addCriterion(new StringBuilder(\"role_ids = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public SubqueryInExpression(EPStatementObjectModel model, boolean isNotIn) {\n this.model = model;\n this.notIn = isNotIn;\n }", "public Criteria andRoleIdsLessThanOrEqualToColumn(LitemallTypeRole.Column column) {\n addCriterion(new StringBuilder(\"role_ids <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "Condition in(QueryParameter parameter, Object... values);", "public static SetExpression in(String propertyName, Object[] values) {\n return new SetExpression(Operator.IN, propertyName, values);\n }", "public final EObject ruleArrayConstructionIterationClause() throws RecognitionException {\n EObject current = null;\n\n Token lv_variableName_0_0=null;\n EObject lv_collectionExpression_2_0 = null;\n\n\n EObject temp=null; setCurrentLookahead(); resetLookahead(); \n \n try {\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:5759:6: ( ( ( (lv_variableName_0_0= RULE_ID ) ) 'in' ( (lv_collectionExpression_2_0= ruleExpression ) ) ) )\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:5760:1: ( ( (lv_variableName_0_0= RULE_ID ) ) 'in' ( (lv_collectionExpression_2_0= ruleExpression ) ) )\n {\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:5760:1: ( ( (lv_variableName_0_0= RULE_ID ) ) 'in' ( (lv_collectionExpression_2_0= ruleExpression ) ) )\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:5760:2: ( (lv_variableName_0_0= RULE_ID ) ) 'in' ( (lv_collectionExpression_2_0= ruleExpression ) )\n {\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:5760:2: ( (lv_variableName_0_0= RULE_ID ) )\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:5761:1: (lv_variableName_0_0= RULE_ID )\n {\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:5761:1: (lv_variableName_0_0= RULE_ID )\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:5762:3: lv_variableName_0_0= RULE_ID\n {\n lv_variableName_0_0=(Token)input.LT(1);\n match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleArrayConstructionIterationClause10031); \n\n \t\t\tcreateLeafNode(grammarAccess.getArrayConstructionIterationClauseAccess().getVariableNameIDTerminalRuleCall_0_0(), \"variableName\"); \n \t\t\n\n \t if (current==null) {\n \t current = factory.create(grammarAccess.getArrayConstructionIterationClauseRule().getType().getClassifier());\n \t associateNodeWithAstElement(currentNode, current);\n \t }\n \t try {\n \t \t\tset(\n \t \t\t\tcurrent, \n \t \t\t\t\"variableName\",\n \t \t\tlv_variableName_0_0, \n \t \t\t\"ID\", \n \t \t\tlastConsumedNode);\n \t } catch (ValueConverterException vce) {\n \t\t\t\thandleValueConverterException(vce);\n \t }\n \t \n\n }\n\n\n }\n\n match(input,41,FOLLOW_41_in_ruleArrayConstructionIterationClause10046); \n\n createLeafNode(grammarAccess.getArrayConstructionIterationClauseAccess().getInKeyword_1(), null); \n \n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:5788:1: ( (lv_collectionExpression_2_0= ruleExpression ) )\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:5789:1: (lv_collectionExpression_2_0= ruleExpression )\n {\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:5789:1: (lv_collectionExpression_2_0= ruleExpression )\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:5790:3: lv_collectionExpression_2_0= ruleExpression\n {\n \n \t currentNode=createCompositeNode(grammarAccess.getArrayConstructionIterationClauseAccess().getCollectionExpressionExpressionParserRuleCall_2_0(), currentNode); \n \t \n pushFollow(FOLLOW_ruleExpression_in_ruleArrayConstructionIterationClause10067);\n lv_collectionExpression_2_0=ruleExpression();\n _fsp--;\n\n\n \t if (current==null) {\n \t current = factory.create(grammarAccess.getArrayConstructionIterationClauseRule().getType().getClassifier());\n \t associateNodeWithAstElement(currentNode.getParent(), current);\n \t }\n \t try {\n \t \t\tset(\n \t \t\t\tcurrent, \n \t \t\t\t\"collectionExpression\",\n \t \t\tlv_collectionExpression_2_0, \n \t \t\t\"Expression\", \n \t \t\tcurrentNode);\n \t } catch (ValueConverterException vce) {\n \t\t\t\thandleValueConverterException(vce);\n \t }\n \t currentNode = currentNode.getParent();\n \t \n\n }\n\n\n }\n\n\n }\n\n\n }\n\n resetLookahead(); \n \tlastConsumedNode = currentNode;\n \n }\n \n catch (RecognitionException re) { \n recover(input,re); \n appendSkippedTokens();\n } \n finally {\n }\n return current;\n }", "public Criteria andIdLessThanOrEqualToColumn(LitemallTypeRole.Column column) {\n addCriterion(new StringBuilder(\"id <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andIdEqualToColumn(LitemallTypeRole.Column column) {\n addCriterion(new StringBuilder(\"id = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andIntegralPriceEqualToColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"integral_price = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andRoleIdsLessThanColumn(LitemallTypeRole.Column column) {\n addCriterion(new StringBuilder(\"role_ids < \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "@Test\n public void testBoundsAsCompositesWithMultiInRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n Restriction in = newMultiIN(cfMetaData, 0, asList(value1, value2), asList(value2, value3));\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(in);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertComposite(bounds.get(1), value2, value3, EOC.END);\n }", "public Criteria andIntegralPriceLessThanColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"integral_price < \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public ConditionItem in(String fieldName, Object...value) {\n\t\treturn singleCondition(ConditionType.IN, fieldName, value);\n\t}", "private static Query newMultiDimIntSetQuery(String field, final int numDims, int... valuesIn)\n throws IOException {\n if (valuesIn.length % numDims != 0) {\n throw new IllegalArgumentException(\n \"incongruent number of values: valuesIn.length=\"\n + valuesIn.length\n + \" but numDims=\"\n + numDims);\n }\n\n // Pack all values:\n byte[][] packedValues = new byte[valuesIn.length / numDims][];\n for (int i = 0; i < packedValues.length; i++) {\n byte[] packedValue = new byte[numDims * Integer.BYTES];\n packedValues[i] = packedValue;\n for (int dim = 0; dim < numDims; dim++) {\n IntPoint.encodeDimension(valuesIn[i * numDims + dim], packedValue, dim * Integer.BYTES);\n }\n }\n\n // Sort:\n Arrays.sort(\n packedValues,\n new Comparator<byte[]>() {\n @Override\n public int compare(byte[] a, byte[] b) {\n return Arrays.compareUnsigned(a, 0, a.length, b, 0, a.length);\n }\n });\n\n final BytesRef value = new BytesRef();\n value.length = numDims * Integer.BYTES;\n\n return new PointInSetQuery(\n field,\n numDims,\n Integer.BYTES,\n new PointInSetQuery.Stream() {\n int upto;\n\n @Override\n public BytesRef next() {\n if (upto >= packedValues.length) {\n return null;\n }\n value.bytes = packedValues[upto];\n upto++;\n return value;\n }\n }) {\n @Override\n protected String toString(byte[] value) {\n assert value.length == numDims * Integer.BYTES;\n StringBuilder sb = new StringBuilder();\n for (int dim = 0; dim < numDims; dim++) {\n if (dim > 0) {\n sb.append(',');\n }\n sb.append(Integer.toString(IntPoint.decodeDimension(value, dim * Integer.BYTES)));\n }\n\n return sb.toString();\n }\n };\n }", "public Criteria andIdLessThanColumn(LitemallTypeRole.Column column) {\n addCriterion(new StringBuilder(\"id < \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "private static CorelatedCriteria applyInCriteria(CorelatedCriteria target, In in) throws Exception {\n List<Expression> whereOperands = in.getOperand();\n if (whereOperands.size() == 2 && whereOperands.get(1) instanceof Interval) {\n Interval interval = (Interval) whereOperands.get(1);\n\n BinaryExpression lowExpression;\n BinaryExpression highExpression;\n\n // This handles the special case of date literals, which the CQL parser\n // wraps in ToDateTime\n if (interval.getLow() instanceof ToDateTime) {\n lowExpression = (BinaryExpression) ((Interval) ((Property) ((ToDateTime) interval.getLow()).getOperand()).getSource()).getLow();\n } else {\n lowExpression = (BinaryExpression) interval.getLow();\n }\n\n if (interval.getHigh() instanceof ToDateTime) {\n highExpression = (BinaryExpression) ((Interval) ((Property) ((ToDateTime) interval.getHigh()).getOperand()).getSource()).getHigh();\n } else {\n highExpression = (BinaryExpression) interval.getHigh();\n }\n\n target.startWindow.start = TemporalUtil.calculateWindowEndpoint(lowExpression);\n target.startWindow.end = TemporalUtil.calculateWindowEndpoint(highExpression);\n }\n\n return target;\n }", "public Criteria andIntegralPriceLessThanOrEqualToColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"integral_price <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public SubqueryInExpression(Expression expression, EPStatementObjectModel model, boolean isNotIn) {\n this.getChildren().add(expression);\n this.model = model;\n this.notIn = isNotIn;\n }", "InOper createInOper();", "public Criteria andIdLessThanOrEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"id <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "@Test\n public void testBoundsAsCompositesWithSingleEqAndMultiINRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n ByteBuffer value5 = ByteBufferUtil.bytes(5);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) IN ((2, 3), (4, 5))\n Restriction singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction multiIN = newMultiIN(cfMetaData, 1, asList(value2, value3), asList(value4, value5));\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiIN);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(1), value1, value4, value5, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(1), value1, value4, value5, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) IN ((2, 3))\n singleEq = newSingleEq(cfMetaData, 0, value1);\n multiIN = newMultiIN(cfMetaData, 1, asList(value2, value3));\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiIN).mergeWith(singleEq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n // clustering_0 = 1 AND clustering_1 = 5 AND (clustering_2, clustering_3) IN ((2, 3), (4, 5))\n singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction singleEq2 = newSingleEq(cfMetaData, 1, value5);\n multiIN = newMultiIN(cfMetaData, 2, asList(value2, value3), asList(value4, value5));\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiIN).mergeWith(singleEq2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value5, value2, value3, EOC.START);\n assertComposite(bounds.get(1), value1, value5, value4, value5, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value5, value2, value3, EOC.END);\n assertComposite(bounds.get(1), value1, value5, value4, value5, EOC.END);\n }", "public Criteria andExternalIdEqualToColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"external_id = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "ExpressionInOcl createExpressionInOcl();", "public final void mK_IN() throws RecognitionException {\n try {\n int _type = K_IN;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n // /Users/devdatta.kulkarni/Documents/Cassandra/apache-cassandra-0.8.6-src/src/java/org/apache/cassandra/cql/Cql.g:508:5: ( I N )\n // /Users/devdatta.kulkarni/Documents/Cassandra/apache-cassandra-0.8.6-src/src/java/org/apache/cassandra/cql/Cql.g:508:16: I N\n {\n mI(); \n mN(); \n\n }\n\n state.type = _type;\n state.channel = _channel;\n }\n finally {\n }\n }", "public ContactListFilterPredicate column(String column) {\n this.column = column;\n return this;\n }", "public Criteria andIdEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"id = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andIdLessThanOrEqualToColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"id <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "<B extends QueryBuilder<?, ?, ?, B, ?>> CustomCriterion<S, V, B>\n in(B builder) {\n return new CustomCriterion<>(this, builder);\n }", "public Criteria andExternalIdLessThanOrEqualToColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"external_id <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "@Test\n \tpublic void whereClauseForNodeInclusion() {\n \t\tnode23.addJoin(new Inclusion(node42));\n \t\tcheckWhereCondition(\n \t\t\t\tjoin(\"=\", \"_node23.text_ref\", \"_node42.text_ref\"),\n \t\t\t\tjoin(\"<=\", \"_node23.left\", \"_node42.left\"),\n \t\t\t\tjoin(\">=\", \"_node23.right\", \"_node42.right\")\n \t\t);\n \t}", "public Criteria andIdLessThanColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"id < \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public static Matrix asin(Matrix matrix)\n {\n double[][] internal = matrix.getArray();\n int row = matrix.getRowDimension(), col = matrix.getColumnDimension();\n Matrix X = new Matrix(row, col);\n double[][] C = X.getArray();\n double[][] M = matrix.getArray();\n for (int i = 0; i < row; i++)\n {\n for (int j = 0; j < col; j++)\n {\n if (M[i][j] <= 1.0d || M[i][j] >= -1.0d)\n {\n C[i][j] = Math.asin(M[i][j]);\n }\n else\n {\n C[i][j] = Double.NaN;\n }\n }\n }\n return X;\n }", "public void addWhereIn(String attributeName, Collection values, String operator) {\r\n\t\tif (!values.isEmpty()) {\r\n\t\t\tString valueListString = StringUtils.join(values, ',');\r\n\t\t\taddWhere(attributeName + \" in (\"+valueListString+\")\", operator);\r\n\t\t}\r\n\t}", "public Criteria andIdLessThanOrEqualToColumn(TCpyBankCredit.Column column) {\n addCriterion(new StringBuilder(\"id <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andIdEqualToColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"id = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andIdLessThanOrEqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"id <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andRoleIdsNotEqualToColumn(LitemallTypeRole.Column column) {\n addCriterion(new StringBuilder(\"role_ids <> \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andIconLessThanOrEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"icon <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andIdLessThanColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"id < \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public static SetExpression discreteRange(String propertyName, int from, int to) {\n return new SetExpression(Operator.IN, propertyName, \n from <= to ? range(from, to) : range(to, from));\n }", "public void setInIn(InputInteractions inIn) {\r\n\t\t// assegna le interazioni di input\r\n\t\tthis.InIn = inIn;\r\n\t}", "public Criteria andExternalIdLessThanColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"external_id < \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andIdLessThanColumn(TCpyBankCredit.Column column) {\n addCriterion(new StringBuilder(\"id < \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public final void mI() throws RecognitionException {\n try {\n // /Users/devdatta.kulkarni/Documents/Cassandra/apache-cassandra-0.8.6-src/src/java/org/apache/cassandra/cql/Cql.g:535:11: ( ( 'i' | 'I' ) )\n // /Users/devdatta.kulkarni/Documents/Cassandra/apache-cassandra-0.8.6-src/src/java/org/apache/cassandra/cql/Cql.g:535:13: ( 'i' | 'I' )\n {\n if ( input.LA(1)=='I'||input.LA(1)=='i' ) {\n input.consume();\n\n }\n else {\n MismatchedSetException mse = new MismatchedSetException(null,input);\n recover(mse);\n throw mse;}\n\n\n }\n\n }\n finally {\n }\n }", "public Criteria andIdLessThanColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"id < \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andIdEqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"id = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andIdNotEqualToColumn(LitemallTypeRole.Column column) {\n addCriterion(new StringBuilder(\"id <> \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andIntegralPriceNotEqualToColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"integral_price <> \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "UnpivotInClause createUnpivotInClause();", "public Criteria andIdLessThanOrEqualToColumn(YoungSeckillPromotionProductRelation.Column column) {\n addCriterion(new StringBuilder(\"id <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Interval(Interval in){\r\n firstExtreme = in.getFirstExtreme();\r\n secondExtreme = in.getSecondExtreme();\r\n feIncluded = in.getFEincluded();\r\n seIncluded = in.getSEincluded();\r\n }", "public Criteria andIdLessThanColumn(YoungSeckillPromotionProductRelation.Column column) {\n addCriterion(new StringBuilder(\"id < \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andAttribLessThanOrEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"attrib <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andIconLessThanColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"icon < \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andCnameLessThanOrEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"cname <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andIconEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"icon = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andIdEqualToColumn(TCpyBankCredit.Column column) {\n addCriterion(new StringBuilder(\"id = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andIdEqualToColumn(YoungSeckillPromotionProductRelation.Column column) {\n addCriterion(new StringBuilder(\"id = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andAddByLessThanOrEqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"add_by <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andAttribEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"attrib = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public interface ColumnIn<T> extends FieldIn<T>, ColumnData {\n\n}", "public Criteria andConsigneeLessThanOrEqualToColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"consignee <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andTransationIdEqualToColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"transation_id = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andAttribLessThanColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"attrib < \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andConsigneeLessThanColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"consignee < \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andAddByLessThanColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"add_by < \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Collection<T> getInCondition() {\n return inCondition;\n }", "public Criteria andFinancingCreditNumLessThanOrEqualToColumn(TCpyBankCredit.Column column) {\n addCriterion(new StringBuilder(\"financing_credit_num <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andMainIdLessThanOrEqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"main_id <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andComposeLessThanOrEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"compose <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "protected void sequence_IN(ISerializationContext context, IN semanticObject) {\n\t\tif (errorAcceptor != null) {\n\t\t\tif (transientValues.isValueTransient(semanticObject, SiddhiPackage.eINSTANCE.getIN_In()) == ValueTransient.YES)\n\t\t\t\terrorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, SiddhiPackage.eINSTANCE.getIN_In()));\n\t\t}\n\t\tSequenceFeeder feeder = createSequencerFeeder(context, semanticObject);\n\t\tfeeder.accept(grammarAccess.getINAccess().getInInKeyword_0(), semanticObject.getIn());\n\t\tfeeder.finish();\n\t}", "public final Predicate predicate() throws RecognitionException {\n Predicate pred = null;\n\n\n CommonTree i = null;\n Attribute a = null;\n\n Operator o = null;\n\n Predicate p = null;\n\n\n try {\n // parser/flatzinc/FlatzincFullExtWalker.g:181:2: ( TRUE |a= attribute o= op i= INT_CONST | ^( IN (i= IDENTIFIER )+ ) | NOT p= predicate )\n int alt11 = 4;\n switch (input.LA(1)) {\n case TRUE: {\n alt11 = 1;\n }\n break;\n case CARITY:\n case CNAME:\n case CSTR:\n case PARITY:\n case PPRIO:\n case PPRIOD:\n case PROP:\n case VAR:\n case VCARD:\n case VNAME: {\n alt11 = 2;\n }\n break;\n case IN: {\n alt11 = 3;\n }\n break;\n case NOT: {\n alt11 = 4;\n }\n break;\n default:\n NoViableAltException nvae =\n new NoViableAltException(\"\", 11, 0, input);\n\n throw nvae;\n\n }\n\n switch (alt11) {\n case 1:\n // parser/flatzinc/FlatzincFullExtWalker.g:181:4: TRUE\n {\n match(input, TRUE, FOLLOW_TRUE_in_predicate273);\n\n\n pred = TruePredicate.singleton;\n\n\n }\n break;\n case 2:\n // parser/flatzinc/FlatzincFullExtWalker.g:185:4: a= attribute o= op i= INT_CONST\n {\n pushFollow(FOLLOW_attribute_in_predicate283);\n a = attribute();\n\n state._fsp--;\n\n\n pushFollow(FOLLOW_op_in_predicate287);\n o = op();\n\n state._fsp--;\n\n\n i = (CommonTree) match(input, INT_CONST, FOLLOW_INT_CONST_in_predicate291);\n\n\n pred = new IntPredicate(a, o, Integer.valueOf((i != null ? i.getText() : null)));\n\n\n }\n break;\n case 3:\n // parser/flatzinc/FlatzincFullExtWalker.g:190:2: ^( IN (i= IDENTIFIER )+ )\n {\n\n ArrayList<String> ids = new ArrayList();\n\n\n match(input, IN, FOLLOW_IN_in_predicate308);\n\n match(input, Token.DOWN, null);\n // parser/flatzinc/FlatzincFullExtWalker.g:193:11: (i= IDENTIFIER )+\n int cnt10 = 0;\n loop10:\n do {\n int alt10 = 2;\n switch (input.LA(1)) {\n case IDENTIFIER: {\n alt10 = 1;\n }\n break;\n\n }\n\n switch (alt10) {\n case 1:\n // parser/flatzinc/FlatzincFullExtWalker.g:193:12: i= IDENTIFIER\n {\n i = (CommonTree) match(input, IDENTIFIER, FOLLOW_IDENTIFIER_in_predicate313);\n\n ids.add((i != null ? i.getText() : null));\n\n }\n break;\n\n default:\n if (cnt10 >= 1) break loop10;\n EarlyExitException eee =\n new EarlyExitException(10, input);\n throw eee;\n }\n cnt10++;\n } while (true);\n\n\n match(input, Token.UP, null);\n\n\n pred = new ExtPredicate(ids, map);\n\n\n }\n break;\n case 4:\n // parser/flatzinc/FlatzincFullExtWalker.g:197:4: NOT p= predicate\n {\n match(input, NOT, FOLLOW_NOT_in_predicate325);\n\n pushFollow(FOLLOW_predicate_in_predicate329);\n p = predicate();\n\n state._fsp--;\n\n\n pred = new NotPredicate(p);\n\n\n }\n break;\n\n }\n } catch (RecognitionException re) {\n reportError(re);\n recover(input, re);\n } finally {\n // do for sure before leaving\n }\n return pred;\n }", "@Test\n public void testBoundsAsCompositesWithOneEqRestrictionsAndOneClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC);\n\n ByteBuffer clustering_0 = ByteBufferUtil.bytes(1);\n Restriction eq = newSingleEq(cfMetaData, 0, clustering_0);\n\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.END);\n }", "public static SetExpression in(String propertyName, Collection<? extends Object> values) {\n return in(propertyName, values.toArray());\n }", "public Criteria andExternalIdNotEqualToColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"external_id <> \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andFinancingCreditNumLessThanColumn(TCpyBankCredit.Column column) {\n addCriterion(new StringBuilder(\"financing_credit_num < \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public void setInCategoryId(final int inCategoryId) {\n this.inCategoryId = inCategoryId;\n }", "public void setInCategoryId(final int inCategoryId) {\n this.inCategoryId = inCategoryId;\n }", "public String createWhereIN(int iterations) {\n StringBuilder sb = new StringBuilder();\n sb.append(\" IN (\");\n for (int ndx = 0; ndx < iterations; ndx++) {\n sb.append(\"?,\");\n }\n sb.deleteCharAt(sb.length() - 1); // remove last comma.\n sb.append(\")\");\n return sb.toString();\n }", "public Criteria andTypeLessThanOrEqualToColumn(LitemallTypeRole.Column column) {\n addCriterion(new StringBuilder(\"`type` <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andTransationIdLessThanOrEqualToColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"transation_id <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andIdNotEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"id <> \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "E asin(final E n);", "public static <N extends Number & Comparable<N>> Distance2dExpression<N> within(\n String propertyName, N x, N y, N distance) {\n return new Distance2dExpression<N>(Operator.WITHIN, propertyName, x, y,\n distance);\n }", "public Criteria andComposeEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"compose = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public IAverageClause having(String column);", "public boolean contains(Interest i);", "public Criteria andStrLessThanOrEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"str <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public static DDataAttribute findByColumn(String columnName, DDataAttribute in) {\n if (in.getJavaType() != null)\n for (Field field : in.getJavaType().getDeclaredFields())\n if (field.isEnumConstant()) {\n @SuppressWarnings(\"unchecked\")\n DDataAttribute atr = (DDataAttribute) Enum.valueOf((Class<? extends Enum>) in.getJavaType(), field.getName());\n if (columnName.equalsIgnoreCase(atr.getColumnName())) {\n return atr;\n }\n }\n return null;\n }", "public final EObject entryRuleComplexTypeImport() throws RecognitionException {\n EObject current = null;\n\n EObject iv_ruleComplexTypeImport = null;\n\n\n try {\n // InternalMappingDsl.g:5373:58: (iv_ruleComplexTypeImport= ruleComplexTypeImport EOF )\n // InternalMappingDsl.g:5374:2: iv_ruleComplexTypeImport= ruleComplexTypeImport EOF\n {\n newCompositeNode(grammarAccess.getComplexTypeImportRule()); \n pushFollow(FOLLOW_1);\n iv_ruleComplexTypeImport=ruleComplexTypeImport();\n\n state._fsp--;\n\n current =iv_ruleComplexTypeImport; \n match(input,EOF,FOLLOW_2); \n\n }\n\n }\n\n catch (RecognitionException re) {\n recover(input,re);\n appendSkippedTokens();\n }\n finally {\n }\n return current;\n }", "public AIMain(FreeColServer freeColServer, XMLStreamReader in) throws XMLStreamException {\n this(freeColServer);\n readFromXML(in);\n }", "public Criteria andIntegralPriceGreaterThanOrEqualToColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"integral_price >= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andMainIdEqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"main_id = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }" ]
[ "0.6078115", "0.5620785", "0.5268111", "0.5245378", "0.51334316", "0.49892363", "0.49123394", "0.48469797", "0.4801318", "0.47829404", "0.4760171", "0.4754921", "0.47209603", "0.47160605", "0.4606613", "0.46008325", "0.45985192", "0.45848766", "0.45627582", "0.4540448", "0.45275342", "0.4523789", "0.45193616", "0.45036328", "0.44978312", "0.44847292", "0.44543865", "0.44491732", "0.44414738", "0.44295415", "0.44254798", "0.43909281", "0.43603432", "0.43453097", "0.43350285", "0.43265504", "0.43144518", "0.43134058", "0.43073395", "0.42902592", "0.42880908", "0.42814308", "0.42650664", "0.4217661", "0.42098", "0.42029747", "0.42017463", "0.4195884", "0.41870522", "0.41816482", "0.41555792", "0.41524708", "0.41524556", "0.4134522", "0.41289344", "0.41171136", "0.41022426", "0.4098589", "0.40938878", "0.40697843", "0.40680587", "0.4052923", "0.4040883", "0.40336597", "0.40173218", "0.40153486", "0.40100965", "0.40080735", "0.39937162", "0.3987726", "0.39864957", "0.39863294", "0.39841172", "0.3979892", "0.39718354", "0.3956813", "0.39501455", "0.3939783", "0.39373112", "0.39351037", "0.39300886", "0.3929267", "0.39291534", "0.39289233", "0.39289233", "0.39277956", "0.3920669", "0.3918584", "0.39182693", "0.39180613", "0.39092985", "0.390905", "0.38931644", "0.38887534", "0.3877321", "0.38712594", "0.38702488", "0.38684446", "0.3861914", "0.38588953" ]
0.5528717
2
Creates a new SingleColumnRestriction.IN instance for the specified clustering column.
private static Restriction newSingleIN(CFMetaData cfMetaData, int index, ByteBuffer... values) { ColumnDefinition columnDef = getClusteringColumnDefinition(cfMetaData, index); return new SingleColumnRestriction.InWithValues(columnDef, toTerms(values)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "PivotInClause createPivotInClause();", "@Test\n public void testBoundsAsCompositesWithOneInRestrictionsAndOneClusteringColumn()\n {\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n Restriction in = newSingleIN(cfMetaData, 0, value1, value2, value3);\n\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(in);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.START);\n assertComposite(bounds.get(2), value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n assertComposite(bounds.get(1), value2, EOC.END);\n assertComposite(bounds.get(2), value3, EOC.END);\n }", "public final void mIN() throws RecognitionException {\n try {\n int _type = IN;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n // /Users/dannluciano/Sources/MyLanguage/expr.g:151:4: ( 'in' )\n // /Users/dannluciano/Sources/MyLanguage/expr.g:151:6: 'in'\n {\n match(\"in\"); \n\n\n }\n\n state.type = _type;\n state.channel = _channel;\n }\n finally {\n }\n }", "public Query in(String key, Object[] value) {\n Preconditions.checkNotNull(key);\n builder.addFilter(builder.getOperator(QueryFilterBuilder.Operators.IN), key, value);\n return this;\n }", "@SafeVarargs\n private static Restriction newMultiIN(CFMetaData cfMetaData, int firstIndex, List<ByteBuffer>... values)\n {\n List<ColumnDefinition> columnDefinitions = new ArrayList<>();\n List<Term> terms = new ArrayList<>();\n for (int i = 0; i < values.length; i++)\n {\n columnDefinitions.add(getClusteringColumnDefinition(cfMetaData, firstIndex + i));\n terms.add(toMultiItemTerminal(values[i].toArray(new ByteBuffer[0])));\n }\n return new MultiColumnRestriction.InWithValues(columnDefinitions, terms);\n }", "UnipivotInClause createUnipivotInClause();", "public interface In extends Clause {}", "public Criteria andIntegralPriceLessThanColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"integral_price < \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andIntegralPriceEqualToColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"integral_price = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andIdLessThanOrEqualToColumn(LitemallTypeRole.Column column) {\n addCriterion(new StringBuilder(\"id <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andIdLessThanOrEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"id <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "Condition in(QueryParameter parameter, Object... values);", "public Criteria andIntegralPriceLessThanOrEqualToColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"integral_price <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andIdEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"id = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "InOper createInOper();", "public final EObject ruleArrayConstructionIterationClause() throws RecognitionException {\n EObject current = null;\n\n Token lv_variableName_0_0=null;\n EObject lv_collectionExpression_2_0 = null;\n\n\n EObject temp=null; setCurrentLookahead(); resetLookahead(); \n \n try {\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:5759:6: ( ( ( (lv_variableName_0_0= RULE_ID ) ) 'in' ( (lv_collectionExpression_2_0= ruleExpression ) ) ) )\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:5760:1: ( ( (lv_variableName_0_0= RULE_ID ) ) 'in' ( (lv_collectionExpression_2_0= ruleExpression ) ) )\n {\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:5760:1: ( ( (lv_variableName_0_0= RULE_ID ) ) 'in' ( (lv_collectionExpression_2_0= ruleExpression ) ) )\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:5760:2: ( (lv_variableName_0_0= RULE_ID ) ) 'in' ( (lv_collectionExpression_2_0= ruleExpression ) )\n {\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:5760:2: ( (lv_variableName_0_0= RULE_ID ) )\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:5761:1: (lv_variableName_0_0= RULE_ID )\n {\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:5761:1: (lv_variableName_0_0= RULE_ID )\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:5762:3: lv_variableName_0_0= RULE_ID\n {\n lv_variableName_0_0=(Token)input.LT(1);\n match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleArrayConstructionIterationClause10031); \n\n \t\t\tcreateLeafNode(grammarAccess.getArrayConstructionIterationClauseAccess().getVariableNameIDTerminalRuleCall_0_0(), \"variableName\"); \n \t\t\n\n \t if (current==null) {\n \t current = factory.create(grammarAccess.getArrayConstructionIterationClauseRule().getType().getClassifier());\n \t associateNodeWithAstElement(currentNode, current);\n \t }\n \t try {\n \t \t\tset(\n \t \t\t\tcurrent, \n \t \t\t\t\"variableName\",\n \t \t\tlv_variableName_0_0, \n \t \t\t\"ID\", \n \t \t\tlastConsumedNode);\n \t } catch (ValueConverterException vce) {\n \t\t\t\thandleValueConverterException(vce);\n \t }\n \t \n\n }\n\n\n }\n\n match(input,41,FOLLOW_41_in_ruleArrayConstructionIterationClause10046); \n\n createLeafNode(grammarAccess.getArrayConstructionIterationClauseAccess().getInKeyword_1(), null); \n \n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:5788:1: ( (lv_collectionExpression_2_0= ruleExpression ) )\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:5789:1: (lv_collectionExpression_2_0= ruleExpression )\n {\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:5789:1: (lv_collectionExpression_2_0= ruleExpression )\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:5790:3: lv_collectionExpression_2_0= ruleExpression\n {\n \n \t currentNode=createCompositeNode(grammarAccess.getArrayConstructionIterationClauseAccess().getCollectionExpressionExpressionParserRuleCall_2_0(), currentNode); \n \t \n pushFollow(FOLLOW_ruleExpression_in_ruleArrayConstructionIterationClause10067);\n lv_collectionExpression_2_0=ruleExpression();\n _fsp--;\n\n\n \t if (current==null) {\n \t current = factory.create(grammarAccess.getArrayConstructionIterationClauseRule().getType().getClassifier());\n \t associateNodeWithAstElement(currentNode.getParent(), current);\n \t }\n \t try {\n \t \t\tset(\n \t \t\t\tcurrent, \n \t \t\t\t\"collectionExpression\",\n \t \t\tlv_collectionExpression_2_0, \n \t \t\t\"Expression\", \n \t \t\tcurrentNode);\n \t } catch (ValueConverterException vce) {\n \t\t\t\thandleValueConverterException(vce);\n \t }\n \t currentNode = currentNode.getParent();\n \t \n\n }\n\n\n }\n\n\n }\n\n\n }\n\n resetLookahead(); \n \tlastConsumedNode = currentNode;\n \n }\n \n catch (RecognitionException re) { \n recover(input,re); \n appendSkippedTokens();\n } \n finally {\n }\n return current;\n }", "public static SetExpression in(String propertyName, Object[] values) {\n return new SetExpression(Operator.IN, propertyName, values);\n }", "public Criteria andExternalIdEqualToColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"external_id = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andIdLessThanColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"id < \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andIdLessThanColumn(LitemallTypeRole.Column column) {\n addCriterion(new StringBuilder(\"id < \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public static Matrix asin(Matrix matrix)\n {\n double[][] internal = matrix.getArray();\n int row = matrix.getRowDimension(), col = matrix.getColumnDimension();\n Matrix X = new Matrix(row, col);\n double[][] C = X.getArray();\n double[][] M = matrix.getArray();\n for (int i = 0; i < row; i++)\n {\n for (int j = 0; j < col; j++)\n {\n if (M[i][j] <= 1.0d || M[i][j] >= -1.0d)\n {\n C[i][j] = Math.asin(M[i][j]);\n }\n else\n {\n C[i][j] = Double.NaN;\n }\n }\n }\n return X;\n }", "public Criteria andIdEqualToColumn(LitemallTypeRole.Column column) {\n addCriterion(new StringBuilder(\"id = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "private static CorelatedCriteria applyInCriteria(CorelatedCriteria target, In in) throws Exception {\n List<Expression> whereOperands = in.getOperand();\n if (whereOperands.size() == 2 && whereOperands.get(1) instanceof Interval) {\n Interval interval = (Interval) whereOperands.get(1);\n\n BinaryExpression lowExpression;\n BinaryExpression highExpression;\n\n // This handles the special case of date literals, which the CQL parser\n // wraps in ToDateTime\n if (interval.getLow() instanceof ToDateTime) {\n lowExpression = (BinaryExpression) ((Interval) ((Property) ((ToDateTime) interval.getLow()).getOperand()).getSource()).getLow();\n } else {\n lowExpression = (BinaryExpression) interval.getLow();\n }\n\n if (interval.getHigh() instanceof ToDateTime) {\n highExpression = (BinaryExpression) ((Interval) ((Property) ((ToDateTime) interval.getHigh()).getOperand()).getSource()).getHigh();\n } else {\n highExpression = (BinaryExpression) interval.getHigh();\n }\n\n target.startWindow.start = TemporalUtil.calculateWindowEndpoint(lowExpression);\n target.startWindow.end = TemporalUtil.calculateWindowEndpoint(highExpression);\n }\n\n return target;\n }", "public ContactListFilterPredicate column(String column) {\n this.column = column;\n return this;\n }", "public final void mK_IN() throws RecognitionException {\n try {\n int _type = K_IN;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n // /Users/devdatta.kulkarni/Documents/Cassandra/apache-cassandra-0.8.6-src/src/java/org/apache/cassandra/cql/Cql.g:508:5: ( I N )\n // /Users/devdatta.kulkarni/Documents/Cassandra/apache-cassandra-0.8.6-src/src/java/org/apache/cassandra/cql/Cql.g:508:16: I N\n {\n mI(); \n mN(); \n\n }\n\n state.type = _type;\n state.channel = _channel;\n }\n finally {\n }\n }", "public Criteria andRoleIdsLessThanOrEqualToColumn(LitemallTypeRole.Column column) {\n addCriterion(new StringBuilder(\"role_ids <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andRoleIdsEqualToColumn(LitemallTypeRole.Column column) {\n addCriterion(new StringBuilder(\"role_ids = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public ConditionItem in(String fieldName, Object...value) {\n\t\treturn singleCondition(ConditionType.IN, fieldName, value);\n\t}", "public Criteria andIdLessThanOrEqualToColumn(TCpyBankCredit.Column column) {\n addCriterion(new StringBuilder(\"id <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andExternalIdLessThanOrEqualToColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"external_id <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andIdLessThanOrEqualToColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"id <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andRoleIdsLessThanColumn(LitemallTypeRole.Column column) {\n addCriterion(new StringBuilder(\"role_ids < \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public SubqueryInExpression(EPStatementObjectModel model, boolean isNotIn) {\n this.model = model;\n this.notIn = isNotIn;\n }", "ExpressionInOcl createExpressionInOcl();", "public Criteria andIconLessThanOrEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"icon <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andIdLessThanColumn(TCpyBankCredit.Column column) {\n addCriterion(new StringBuilder(\"id < \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "@Test\n \tpublic void whereClauseForNodeInclusion() {\n \t\tnode23.addJoin(new Inclusion(node42));\n \t\tcheckWhereCondition(\n \t\t\t\tjoin(\"=\", \"_node23.text_ref\", \"_node42.text_ref\"),\n \t\t\t\tjoin(\"<=\", \"_node23.left\", \"_node42.left\"),\n \t\t\t\tjoin(\">=\", \"_node23.right\", \"_node42.right\")\n \t\t);\n \t}", "public Criteria andIdLessThanOrEqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"id <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andIdEqualToColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"id = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andExternalIdLessThanColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"external_id < \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public static ConstantPredicate readOneIn() throws IsabelleException, FileException {\r\n accept(Token.BOOLEAN_CONSTANT);\r\n return new ConstantPredicate(BooleanConstant.readItIn());\r\n }", "public Criteria andIdLessThanColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"id < \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "<B extends QueryBuilder<?, ?, ?, B, ?>> CustomCriterion<S, V, B>\n in(B builder) {\n return new CustomCriterion<>(this, builder);\n }", "public Criteria andIdLessThanColumn(YoungSeckillPromotionProductRelation.Column column) {\n addCriterion(new StringBuilder(\"id < \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andIconLessThanColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"icon < \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andIdLessThanOrEqualToColumn(YoungSeckillPromotionProductRelation.Column column) {\n addCriterion(new StringBuilder(\"id <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "private static Query newMultiDimIntSetQuery(String field, final int numDims, int... valuesIn)\n throws IOException {\n if (valuesIn.length % numDims != 0) {\n throw new IllegalArgumentException(\n \"incongruent number of values: valuesIn.length=\"\n + valuesIn.length\n + \" but numDims=\"\n + numDims);\n }\n\n // Pack all values:\n byte[][] packedValues = new byte[valuesIn.length / numDims][];\n for (int i = 0; i < packedValues.length; i++) {\n byte[] packedValue = new byte[numDims * Integer.BYTES];\n packedValues[i] = packedValue;\n for (int dim = 0; dim < numDims; dim++) {\n IntPoint.encodeDimension(valuesIn[i * numDims + dim], packedValue, dim * Integer.BYTES);\n }\n }\n\n // Sort:\n Arrays.sort(\n packedValues,\n new Comparator<byte[]>() {\n @Override\n public int compare(byte[] a, byte[] b) {\n return Arrays.compareUnsigned(a, 0, a.length, b, 0, a.length);\n }\n });\n\n final BytesRef value = new BytesRef();\n value.length = numDims * Integer.BYTES;\n\n return new PointInSetQuery(\n field,\n numDims,\n Integer.BYTES,\n new PointInSetQuery.Stream() {\n int upto;\n\n @Override\n public BytesRef next() {\n if (upto >= packedValues.length) {\n return null;\n }\n value.bytes = packedValues[upto];\n upto++;\n return value;\n }\n }) {\n @Override\n protected String toString(byte[] value) {\n assert value.length == numDims * Integer.BYTES;\n StringBuilder sb = new StringBuilder();\n for (int dim = 0; dim < numDims; dim++) {\n if (dim > 0) {\n sb.append(',');\n }\n sb.append(Integer.toString(IntPoint.decodeDimension(value, dim * Integer.BYTES)));\n }\n\n return sb.toString();\n }\n };\n }", "public Criteria andIdLessThanColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"id < \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "@Test\n public void testBoundsAsCompositesWithSingleEqAndMultiINRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n ByteBuffer value5 = ByteBufferUtil.bytes(5);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) IN ((2, 3), (4, 5))\n Restriction singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction multiIN = newMultiIN(cfMetaData, 1, asList(value2, value3), asList(value4, value5));\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiIN);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(1), value1, value4, value5, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(1), value1, value4, value5, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) IN ((2, 3))\n singleEq = newSingleEq(cfMetaData, 0, value1);\n multiIN = newMultiIN(cfMetaData, 1, asList(value2, value3));\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiIN).mergeWith(singleEq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n // clustering_0 = 1 AND clustering_1 = 5 AND (clustering_2, clustering_3) IN ((2, 3), (4, 5))\n singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction singleEq2 = newSingleEq(cfMetaData, 1, value5);\n multiIN = newMultiIN(cfMetaData, 2, asList(value2, value3), asList(value4, value5));\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiIN).mergeWith(singleEq2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value5, value2, value3, EOC.START);\n assertComposite(bounds.get(1), value1, value5, value4, value5, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value5, value2, value3, EOC.END);\n assertComposite(bounds.get(1), value1, value5, value4, value5, EOC.END);\n }", "public final Predicate predicate() throws RecognitionException {\n Predicate pred = null;\n\n\n CommonTree i = null;\n Attribute a = null;\n\n Operator o = null;\n\n Predicate p = null;\n\n\n try {\n // parser/flatzinc/FlatzincFullExtWalker.g:181:2: ( TRUE |a= attribute o= op i= INT_CONST | ^( IN (i= IDENTIFIER )+ ) | NOT p= predicate )\n int alt11 = 4;\n switch (input.LA(1)) {\n case TRUE: {\n alt11 = 1;\n }\n break;\n case CARITY:\n case CNAME:\n case CSTR:\n case PARITY:\n case PPRIO:\n case PPRIOD:\n case PROP:\n case VAR:\n case VCARD:\n case VNAME: {\n alt11 = 2;\n }\n break;\n case IN: {\n alt11 = 3;\n }\n break;\n case NOT: {\n alt11 = 4;\n }\n break;\n default:\n NoViableAltException nvae =\n new NoViableAltException(\"\", 11, 0, input);\n\n throw nvae;\n\n }\n\n switch (alt11) {\n case 1:\n // parser/flatzinc/FlatzincFullExtWalker.g:181:4: TRUE\n {\n match(input, TRUE, FOLLOW_TRUE_in_predicate273);\n\n\n pred = TruePredicate.singleton;\n\n\n }\n break;\n case 2:\n // parser/flatzinc/FlatzincFullExtWalker.g:185:4: a= attribute o= op i= INT_CONST\n {\n pushFollow(FOLLOW_attribute_in_predicate283);\n a = attribute();\n\n state._fsp--;\n\n\n pushFollow(FOLLOW_op_in_predicate287);\n o = op();\n\n state._fsp--;\n\n\n i = (CommonTree) match(input, INT_CONST, FOLLOW_INT_CONST_in_predicate291);\n\n\n pred = new IntPredicate(a, o, Integer.valueOf((i != null ? i.getText() : null)));\n\n\n }\n break;\n case 3:\n // parser/flatzinc/FlatzincFullExtWalker.g:190:2: ^( IN (i= IDENTIFIER )+ )\n {\n\n ArrayList<String> ids = new ArrayList();\n\n\n match(input, IN, FOLLOW_IN_in_predicate308);\n\n match(input, Token.DOWN, null);\n // parser/flatzinc/FlatzincFullExtWalker.g:193:11: (i= IDENTIFIER )+\n int cnt10 = 0;\n loop10:\n do {\n int alt10 = 2;\n switch (input.LA(1)) {\n case IDENTIFIER: {\n alt10 = 1;\n }\n break;\n\n }\n\n switch (alt10) {\n case 1:\n // parser/flatzinc/FlatzincFullExtWalker.g:193:12: i= IDENTIFIER\n {\n i = (CommonTree) match(input, IDENTIFIER, FOLLOW_IDENTIFIER_in_predicate313);\n\n ids.add((i != null ? i.getText() : null));\n\n }\n break;\n\n default:\n if (cnt10 >= 1) break loop10;\n EarlyExitException eee =\n new EarlyExitException(10, input);\n throw eee;\n }\n cnt10++;\n } while (true);\n\n\n match(input, Token.UP, null);\n\n\n pred = new ExtPredicate(ids, map);\n\n\n }\n break;\n case 4:\n // parser/flatzinc/FlatzincFullExtWalker.g:197:4: NOT p= predicate\n {\n match(input, NOT, FOLLOW_NOT_in_predicate325);\n\n pushFollow(FOLLOW_predicate_in_predicate329);\n p = predicate();\n\n state._fsp--;\n\n\n pred = new NotPredicate(p);\n\n\n }\n break;\n\n }\n } catch (RecognitionException re) {\n reportError(re);\n recover(input, re);\n } finally {\n // do for sure before leaving\n }\n return pred;\n }", "public Criteria andIdEqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"id = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andIconEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"icon = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "E asin(final E n);", "public Criteria andIdEqualToColumn(YoungSeckillPromotionProductRelation.Column column) {\n addCriterion(new StringBuilder(\"id = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "private static Restriction newSingleEq(CFMetaData cfMetaData, int index, ByteBuffer value)\n {\n ColumnDefinition columnDef = getClusteringColumnDefinition(cfMetaData, index);\n return new SingleColumnRestriction.EQ(columnDef, toTerm(value));\n }", "public Criteria andIdEqualToColumn(TCpyBankCredit.Column column) {\n addCriterion(new StringBuilder(\"id = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public AIMain(FreeColServer freeColServer, XMLStreamReader in) throws XMLStreamException {\n this(freeColServer);\n readFromXML(in);\n }", "public void setInIn(InputInteractions inIn) {\r\n\t\t// assegna le interazioni di input\r\n\t\tthis.InIn = inIn;\r\n\t}", "public Criteria andIntegralPriceNotEqualToColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"integral_price <> \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "@Test\n public void testBoundsAsCompositesWithMultiInRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n Restriction in = newMultiIN(cfMetaData, 0, asList(value1, value2), asList(value2, value3));\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(in);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value2, value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertComposite(bounds.get(1), value2, value3, EOC.END);\n }", "protected void sequence_IN(ISerializationContext context, IN semanticObject) {\n\t\tif (errorAcceptor != null) {\n\t\t\tif (transientValues.isValueTransient(semanticObject, SiddhiPackage.eINSTANCE.getIN_In()) == ValueTransient.YES)\n\t\t\t\terrorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, SiddhiPackage.eINSTANCE.getIN_In()));\n\t\t}\n\t\tSequenceFeeder feeder = createSequencerFeeder(context, semanticObject);\n\t\tfeeder.accept(grammarAccess.getINAccess().getInInKeyword_0(), semanticObject.getIn());\n\t\tfeeder.finish();\n\t}", "public static DDataAttribute findByColumn(String columnName, DDataAttribute in) {\n if (in.getJavaType() != null)\n for (Field field : in.getJavaType().getDeclaredFields())\n if (field.isEnumConstant()) {\n @SuppressWarnings(\"unchecked\")\n DDataAttribute atr = (DDataAttribute) Enum.valueOf((Class<? extends Enum>) in.getJavaType(), field.getName());\n if (columnName.equalsIgnoreCase(atr.getColumnName())) {\n return atr;\n }\n }\n return null;\n }", "public Criteria andCnameLessThanOrEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"cname <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andConsigneeLessThanColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"consignee < \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andAttribLessThanOrEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"attrib <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public IAverageClause having(String column);", "public Criteria andAttribEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"attrib = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public SubqueryInExpression(Expression expression, EPStatementObjectModel model, boolean isNotIn) {\n this.getChildren().add(expression);\n this.model = model;\n this.notIn = isNotIn;\n }", "public Criteria andFinancingCreditNumLessThanColumn(TCpyBankCredit.Column column) {\n addCriterion(new StringBuilder(\"financing_credit_num < \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andAttribLessThanColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"attrib < \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andFinancingCreditNumLessThanOrEqualToColumn(TCpyBankCredit.Column column) {\n addCriterion(new StringBuilder(\"financing_credit_num <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Interval(Interval in){\r\n firstExtreme = in.getFirstExtreme();\r\n secondExtreme = in.getSecondExtreme();\r\n feIncluded = in.getFEincluded();\r\n seIncluded = in.getSEincluded();\r\n }", "@Test\n public void testBoundsAsCompositesWithOneEqRestrictionsAndOneClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC);\n\n ByteBuffer clustering_0 = ByteBufferUtil.bytes(1);\n Restriction eq = newSingleEq(cfMetaData, 0, clustering_0);\n\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.END);\n }", "public static <N extends Number & Comparable<N>> Distance2dExpression<N> within(\n String propertyName, N x, N y, N distance) {\n return new Distance2dExpression<N>(Operator.WITHIN, propertyName, x, y,\n distance);\n }", "public Criteria andConsigneeLessThanOrEqualToColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"consignee <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andMainIdLessThanOrEqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"main_id <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public IAverageClause where(String column);", "public static SetExpression discreteRange(String propertyName, int from, int to) {\n return new SetExpression(Operator.IN, propertyName, \n from <= to ? range(from, to) : range(to, from));\n }", "public Criteria andStrLessThanOrEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"str <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public final static float SIN(float deg) {\n\t\tdeg*=SINCOS_INVPREC;\n\t\treturn sinLUT[(int)deg];\n\t}", "public Criteria andMainIdEqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"main_id = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public final void mI() throws RecognitionException {\n try {\n // /Users/devdatta.kulkarni/Documents/Cassandra/apache-cassandra-0.8.6-src/src/java/org/apache/cassandra/cql/Cql.g:535:11: ( ( 'i' | 'I' ) )\n // /Users/devdatta.kulkarni/Documents/Cassandra/apache-cassandra-0.8.6-src/src/java/org/apache/cassandra/cql/Cql.g:535:13: ( 'i' | 'I' )\n {\n if ( input.LA(1)=='I'||input.LA(1)=='i' ) {\n input.consume();\n\n }\n else {\n MismatchedSetException mse = new MismatchedSetException(null,input);\n recover(mse);\n throw mse;}\n\n\n }\n\n }\n finally {\n }\n }", "public Criteria andTransationIdEqualToColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"transation_id = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andIdNotEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"id <> \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public BooleanExpression is(DBDateRepeat intervalColumn) {\n\t\treturn super.is(intervalColumn);\n\t}", "public Criteria andMainIdLessThanColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"main_id < \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andComposeLessThanOrEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"compose <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "@Override\r\n\tpublic List<Citizen> SearchCitizen(int cin) {\n\r\n\t\treturn em.createNativeQuery(\r\n\t\t\t\t\"SELECT * FROM Citizen WHERE CIN like '\" + cin + \"%';\",\r\n\t\t\t\tCitizen.class).getResultList();\r\n\r\n\t}", "public Criteria andOrderSnEqualToColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"order_sn = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andIdNotEqualToColumn(LitemallTypeRole.Column column) {\n addCriterion(new StringBuilder(\"id <> \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public boolean contains(Interest i);", "public Criteria andCompanyIdLessThanOrEqualToColumn(TCpyBankCredit.Column column) {\n addCriterion(new StringBuilder(\"company_id <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public org.oep.usermgt.model.Citizen fetchByIN(\n\t\tjava.lang.String identificationNo, boolean retrieveFromCache)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException;", "public Criteria andConsigneeEqualToColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"consignee = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andCnameLessThanColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"cname < \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public void addWhereIn(String attributeName, Collection values, String operator) {\r\n\t\tif (!values.isEmpty()) {\r\n\t\t\tString valueListString = StringUtils.join(values, ',');\r\n\t\t\taddWhere(attributeName + \" in (\"+valueListString+\")\", operator);\r\n\t\t}\r\n\t}", "public <E extends com.intuit.datasource.jooq.information_schema.tables.interfaces.IKeyColumnUsage> E into(E into);", "public Criteria andTransationIdLessThanOrEqualToColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"transation_id <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andCompanyIdLessThanColumn(TCpyBankCredit.Column column) {\n addCriterion(new StringBuilder(\"company_id < \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andExternalIdNotEqualToColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"external_id <> \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }" ]
[ "0.5406534", "0.52919483", "0.51597196", "0.5056337", "0.50431746", "0.49100026", "0.48096618", "0.47634882", "0.47313732", "0.46916473", "0.46732813", "0.46707225", "0.46455237", "0.46299255", "0.46262255", "0.46147686", "0.45929757", "0.4554784", "0.4545951", "0.45425048", "0.45385733", "0.45328832", "0.45267066", "0.45233354", "0.45177665", "0.45171618", "0.4499051", "0.4493855", "0.44350463", "0.44220483", "0.44117644", "0.439473", "0.43852895", "0.43794036", "0.43669376", "0.43474954", "0.434656", "0.43444017", "0.43372652", "0.43345565", "0.4334341", "0.43161348", "0.42994288", "0.42962", "0.4295368", "0.4294885", "0.4278924", "0.4272458", "0.4261441", "0.42609307", "0.425739", "0.4250273", "0.4229574", "0.4228185", "0.42260113", "0.420751", "0.42002395", "0.41614556", "0.41563934", "0.41504538", "0.41492677", "0.41320106", "0.4131339", "0.4129174", "0.4128493", "0.41209877", "0.41016686", "0.41012675", "0.40990674", "0.40946373", "0.40938392", "0.4085869", "0.40824786", "0.40808895", "0.4053136", "0.40368032", "0.40138128", "0.40112326", "0.4009414", "0.4003903", "0.39972693", "0.3984612", "0.39800096", "0.39744726", "0.39653152", "0.39531788", "0.39504147", "0.39456674", "0.3945513", "0.3943403", "0.3943019", "0.39398298", "0.39347672", "0.39332855", "0.3933281", "0.3933111", "0.391987", "0.39179003", "0.3905572", "0.39049616" ]
0.64293194
0
Returns the clustering ColumnDefinition for the specified position.
private static ColumnDefinition getClusteringColumnDefinition(CFMetaData cfMetaData, int index) { return cfMetaData.clusteringColumns().get(index); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Column getColumn(int pos) { return columns[pos]; }", "public int getColumnType(int position) {\n return columns[position].getType();\n }", "Column createColumn();", "public Builder position(String position) {\n\n\t\t\tthis.position = position;\n\t\t\treturn this;\n\t\t}", "final public ColumnDefinition ColumnDefinition() throws ParseException {ColumnName columnName;\n ColumnType columnType;\n Token tk = null, tk2 = null, tk3 = null, tk4 = null, tk5 = null;\n Value defaultValue = null;\n Value updateValue = null;\n StringValue comment = null;\n ColumnReference columnReference = null;\n columnName = ColumnName();\n columnType = ColumnType();\n label_4:\n while (true) {\n switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {\n case NOT:\n case NULL:\n case K_DEFAULT:\n case AUTO_INCREMENT:\n case PRIMARY:\n case KEY:\n case COMMENT:\n case REFERENCES:\n case ON:{\n ;\n break;\n }\n default:\n jj_la1[27] = jj_gen;\n break label_4;\n }\n switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {\n case NOT:{\n tk = jj_consume_token(NOT);\n jj_consume_token(NULL);\n break;\n }\n case NULL:{\n tk2 = jj_consume_token(NULL);\n break;\n }\n case K_DEFAULT:{\n jj_consume_token(K_DEFAULT);\n defaultValue = Value();\n break;\n }\n case ON:{\n jj_consume_token(ON);\n jj_consume_token(UPDATE);\n updateValue = Value();\n break;\n }\n case AUTO_INCREMENT:{\n tk3 = jj_consume_token(AUTO_INCREMENT);\n break;\n }\n case PRIMARY:\n case KEY:{\n switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {\n case PRIMARY:{\n tk4 = jj_consume_token(PRIMARY);\n break;\n }\n default:\n jj_la1[28] = jj_gen;\n ;\n }\n tk5 = jj_consume_token(KEY);\n break;\n }\n case COMMENT:{\n jj_consume_token(COMMENT);\n comment = StringValue();\n break;\n }\n case REFERENCES:{\n columnReference = ColumnReference();\n break;\n }\n default:\n jj_la1[29] = jj_gen;\n jj_consume_token(-1);\n throw new ParseException();\n }\n }\nreturn new ColumnDefinition(columnName, columnType, tk2 != null, tk != null, tk3 != null, tk4 != null, tk5 != null,\n defaultValue, updateValue, comment, columnReference);\n}", "com.factset.protobuf.stach.v2.table.ColumnDefinitionProto.ColumnDefinition getColumns(int index);", "public int getPositionColumn(){return this.positionColumn;}", "Column createColumn(JavaTypeMapping mapping, String javaType, ColumnMetaData colmd);", "private int getColumn( int position ) {\n if ( columns == 1 ) {\n return 0;\n }\n //Log.d(TAG, \"getColumn returning some shit: \" + position + \" % \" + columns + \" = \" + (position % columns));\n return position % columns;\n }", "com.factset.protobuf.stach.v2.table.ColumnDefinitionProto.ColumnDefinitionOrBuilder getColumnsOrBuilder(\n int index);", "@Override\r\n\tprotected String defineColumn(ColumnDefinition columnDefinition) {\n\t\treturn null;\r\n\t}", "Column createColumn(JavaTypeMapping mapping, String javaType, int datastoreFieldIndex);", "public void setPositionColumn(int value){this.positionColumn = value;}", "public int getColumn() { return cc; }", "@Override\r\n\tpublic String getType() {\n\t\treturn \"column\";\r\n\t}", "protected CfDef getCfDef(String signature) throws IOException\n {\n UDFContext context = UDFContext.getUDFContext();\n Properties property = context.getUDFProperties(CassandraStorage.class);\n String prop = property.getProperty(signature);\n return cfdefFromString(prop);\n }", "public Columns getColumns() {\n\tColumns cs = null;\n\tif (column1 != null && !column1.isVariable()) {\n\t\tcs = new Columns(column1);\n\t\tif (column2 != null && !column2.isVariable()) {\n\t\t\tcs.add(column2);\n\t\t}\n\t}\n\treturn cs;\n}", "public com.factset.protobuf.stach.v2.table.ColumnDefinitionProto.ColumnDefinition getColumns(int index) {\n if (columnsBuilder_ == null) {\n return columns_.get(index);\n } else {\n return columnsBuilder_.getMessage(index);\n }\n }", "private int colPos(int pos) {\r\n return pos % squareDimension;\r\n }", "Column createColumn(AbstractMemberMetaData fmd, Table table, JavaTypeMapping mapping, ColumnMetaData colmd, Column referenceCol, ClassLoaderResolver clr);", "@java.lang.Override\n public com.factset.protobuf.stach.v2.table.ColumnDefinitionProto.ColumnDefinition getColumns(int index) {\n return columns_.get(index);\n }", "public int getColumn() {\n return this.column;\n }", "public Col getCol() {\n\treturn new Col(colIndex); \n }", "public com.factset.protobuf.stach.v2.table.ColumnDefinitionProto.ColumnDefinitionOrBuilder getColumnsOrBuilder(\n int index) {\n if (columnsBuilder_ == null) {\n return columns_.get(index); } else {\n return columnsBuilder_.getMessageOrBuilder(index);\n }\n }", "public int getcolumn()\n\t{\n\t\tif(orderflag)\n\t\t{\n\t\t\treturn width;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn height;\n\t\t}\n\t}", "@Override\n public Cell getCellAtPosition(CellPosition position) {\n return cellGrid[position.getCircle()][position.getBlock()][position.getClockwise()];\n }", "public int getColumn() {\n\t\treturn column;\n\t}", "public int getColumn() {\n return column;\n }", "public int getColumn() {\n return column;\n }", "public int getColumn() {\n return column;\n }", "public ChartColumn getChartColumn() throws Exception {\n\t\tif (column == null &&\n\t\t\t\tgetRow() > -1 &&\n\t\t\t\tgetChart() != null &&\n\t\t\t\t!getChart().getColumns().isEmpty() &&\n\t\t\t\tgetRow() < getChart().getColumns().size()) {\n\t\t\tcolumn = getChart().getColumns().get(getRow());\n\t\t}\n\t\treturn column;\n\t}", "public int getCol() {\n\t\treturn column; \n\t}", "public McCOYDashboardFragment newInstance(int position) {\n McCOYDashboardFragment fragmentFirst = new McCOYDashboardFragment();\n Bundle args = new Bundle();\n args.putInt(\"position\", position);\n fragmentFirst.setArguments(args);\n return fragmentFirst;\n }", "@Override\r\n\tpublic SquareDungeon getDungeonContainingPosition(Point position) {\r\n\t\tif (!position.isEqualOrBiggerThanPoint(getMaximumDimensions()) && position.isEqualOrBiggerThanValue(0))\r\n\t\t\treturn this;\r\n\t\treturn null;\r\n\t}", "public int getColumn() {\n\t\t\treturn column;\n\t\t}", "public int getColumn() {\r\n\t\treturn column;\r\n\t}", "public int getColumn(){\n return this.column;\n }", "public int getColumn() {\r\n return column;\r\n }", "public int getColumn() {\r\n return column;\r\n }", "public int getColumn()\r\n\t{\r\n\t\treturn this.column;\r\n\t}", "public char getColumn() {\n\t\treturn column;\n\t}", "public DescriptionBuilder addPosition(Position position) {\n positions.add(new PositionDescription(position, null));\n return this;\n }", "public final int getColumn() {\n return column;\n }", "public ColumnMetadata build() {\n ColumnMetadata colMetadata = new ColumnMetadata();\n colMetadata.setName(name);\n colMetadata.setType(type);\n colMetadata.setPhysicalType(physicalType);\n colMetadata.setNullable(nullable);\n colMetadata.setLogicalType(logicalType);\n colMetadata.setByteLength(byteLength);\n colMetadata.setLength(length);\n colMetadata.setScale(scale);\n colMetadata.setPrecision(precision);\n colMetadata.setCollation(collation);\n colMetadata.setOrdinal(ordinal);\n return colMetadata;\n }", "io.envoyproxy.envoy.type.metadata.v3.MetadataKind.Cluster getCluster();", "java.util.List<com.factset.protobuf.stach.v2.table.ColumnDefinitionProto.ColumnDefinition> \n getColumnsList();", "ColumnOrBuilder getColumnsOrBuilder(\n int index);", "public DescriptionBuilder addPosition(Position position, Descriptor descriptor) {\n positions.add(new PositionDescription(position, descriptor));\n return this;\n }", "@java.lang.Override\n public com.factset.protobuf.stach.v2.table.ColumnDefinitionProto.ColumnDefinitionOrBuilder getColumnsOrBuilder(\n int index) {\n return columns_.get(index);\n }", "public CommandDefinition getDefinition() throws SystemException {\r\n\t\tdefinitionCheck();\r\n\t\treturn cachedDefinition;\r\n\t}", "public int getColumn()\n {\n return column;\n }", "public int getColumn();", "public int getDecoratedColumn (Node node);", "public Vector2fc getPosition(){\n return position.toImmutable();\n }", "@Override\n\tpublic IColumns createColumns() {\n\t\treturn null;\n\t}", "@Override\n\tpublic IColumns createColumns() {\n\t\treturn null;\n\t}", "@Override\n @Nullable\n public Column findColumn(String name)\n {\n if (columnCache.containsKey(name)) {\n return columnCache.get(name);\n } else {\n final Column column = rac.findColumn(name);\n if (column == null) {\n columnCache.put(name, null);\n return null;\n }\n\n final ColumnAccessor accessor = column.toAccessor();\n return new ColumnAccessorBasedColumn(\n new ColumnAccessor()\n {\n @Override\n public ColumnType getType()\n {\n return accessor.getType();\n }\n\n @Override\n public int numRows()\n {\n return end - start;\n }\n\n @Override\n public boolean isNull(int rowNum)\n {\n return accessor.isNull(pointers[start + rowNum]);\n }\n\n @Nullable\n @Override\n public Object getObject(int rowNum)\n {\n return accessor.getObject(pointers[start + rowNum]);\n }\n\n @Override\n public double getDouble(int rowNum)\n {\n return accessor.getDouble(pointers[start + rowNum]);\n }\n\n @Override\n public float getFloat(int rowNum)\n {\n return accessor.getFloat(pointers[start + rowNum]);\n }\n\n @Override\n public long getLong(int rowNum)\n {\n return accessor.getLong(pointers[start + rowNum]);\n }\n\n @Override\n public int getInt(int rowNum)\n {\n return accessor.getInt(pointers[start + rowNum]);\n }\n\n @Override\n public int compareRows(int lhsRowNum, int rhsRowNum)\n {\n return accessor.compareRows(pointers[lhsRowNum], pointers[start + rhsRowNum]);\n }\n }\n );\n }\n }", "Column getColumns(int index);", "public Glyph child(int position) throws OperationNotSupportedException, IndexOutOfBoundsException {\n throw new OperationNotSupportedException(\"This Glyph cannot have children\");\n }", "public Columns getColumns() {\n return columns;\n }", "public com.factset.protobuf.stach.v2.table.ColumnDefinitionProto.ColumnDefinition.Builder getColumnsBuilder(\n int index) {\n return getColumnsFieldBuilder().getBuilder(index);\n }", "protected int getSectionByPosition(int position) {\r\n \t\tint result = INVALID_POSITION;\r\n \r\n\t\tfor (int i: (mAdapter.getHeaders().keySet())) {\r\n \t\t\tif (position < i) break;\r\n \t\t\telse result = i;\r\n \t\t}\r\n \r\n \t\treturn result;\r\n \t}", "public int getCol(){\r\n\t\treturn this.column;\r\n\t}", "ColumnMapping createColumnMapping(JavaTypeMapping mapping, AbstractMemberMetaData fmd, int index, Column column);", "public ColumnMetadata getColumn() {\r\n return m_column;\r\n }", "public Column getColumn(String columnName);", "public List getColumns() {\r\n return columns;\r\n }", "public Piece getPieceAt(Position position) {\n return positionToPieceMap.get(position);\n }", "public ColumnsForType getColumnsForType(String type){\r\n\t\tColumnsForType cft = columnsForTypeCache.get(type);\r\n\t\tif(cft == null){\r\n\t\t\tcft = buildCache(type);\r\n\t\t\tcolumnsForTypeCache.put(type, cft);\r\n\t\t}\r\n\t\treturn cft;\r\n\t\t\r\n\t}", "private ArrayList<PSJdbcColumnDef> createColumnDef(PSJdbcDataTypeMap dataTypeMap)\n {\n ArrayList<PSJdbcColumnDef> coldefs = new ArrayList<PSJdbcColumnDef>();\n coldefs.add(new PSJdbcColumnDef(dataTypeMap, \"col1\", PSJdbcTableComponent.ACTION_REPLACE, Types.CHAR, \"10\",\n true, null));\n coldefs.add(new PSJdbcColumnDef(dataTypeMap, \"col2\", PSJdbcTableComponent.ACTION_CREATE, Types.DATE, \"15\",\n true, null));\n return coldefs;\n }", "io.envoyproxy.envoy.type.metadata.v3.MetadataKind.ClusterOrBuilder getClusterOrBuilder();", "public int getColumn() {\n return col;\n }", "public FloatColumn getCovalentGeomBondTerm() {\n return delegate.getColumn(\"covalent_geom_bond_term\", DelegatingFloatColumn::new);\n }", "public Map<String, ColumnMetaData> getColumns();", "public Cell getPosition() {\n return position;\n }", "public Column createFromParcel(Parcel parcel) {\n return new Column(parcel);\n }", "public CatalogColumnImpl() {}", "Col createCol();", "public ColumnNode (String n)\n {\n super();\n size=0;\n name=n;\n C=this;\n }", "public int getColumn() {\n return mCol;\n }", "public static ColumnDefinition fromString(String columnInfo) {\n String name = DEFAULT_NAME;\n DataType type = DEFAULT_TYPE;\n boolean nullable = DEFAULT_NULLABLE;\n int length = DEFAULT_LENGTH;\n int precision = -1;\n int scale = -1;\n String timezone = null;\n String value = null;\n Map<String, Integer> options = new LinkedHashMap<>();\n\n if (columnInfo != null && (columnInfo = columnInfo.trim()).length() > 0) {\n char quote = columnInfo.charAt(0);\n boolean hasQuote = quote == '`' || quote == '\"';\n boolean escaped = false;\n int lastIndex = columnInfo.length() - 1;\n int nameEndIndex = hasQuote ? Math.min(columnInfo.lastIndexOf(quote), lastIndex) : lastIndex;\n StringBuilder sb = new StringBuilder(lastIndex + 1);\n for (int i = hasQuote ? 1 : 0; i <= lastIndex; i++) {\n char ch = columnInfo.charAt(i);\n escaped = !escaped && (ch == '\\\\'\n || (hasQuote && ch == quote && columnInfo.charAt(Math.min(i + 1, lastIndex)) == quote));\n\n if ((hasQuote && !escaped && i == nameEndIndex) || (!hasQuote && Character.isWhitespace(ch))) {\n name = sb.toString();\n sb.setLength(0);\n\n // type declaration is case-sensitive\n String declaredType = columnInfo.substring(Math.min(i + 1, lastIndex)).trim();\n String defaultValue = null;\n\n i = columnInfo.length() - 1;\n\n // default value. unlike Nullable etc. default is case-insensitive...\n int defaultIndex = Utils.indexOfKeywordIgnoreCase(declaredType, TOKEN_DEFAULT);\n if (defaultIndex > 0) {\n defaultValue = declaredType.substring(defaultIndex + TOKEN_DEFAULT.length()).trim();\n declaredType = declaredType.substring(0, defaultIndex).trim();\n\n if (!defaultValue.isEmpty()) {\n value = defaultValue.charAt(0) == '\\''\n && defaultValue.charAt(defaultValue.length() - 1) == '\\''\n ? defaultValue.substring(1, defaultValue.length() - 1)\n : defaultValue;\n\n if (NULL_VALUE.equalsIgnoreCase(value)) {\n value = null;\n }\n }\n }\n\n // nullable\n if (declaredType.startsWith(NULLABLE_BEGIN)) {\n int suffixIndex = declaredType.lastIndexOf(NULLABLE_END);\n if (suffixIndex != -1) {\n nullable = true;\n declaredType = declaredType.substring(NULLABLE_BEGIN.length(), suffixIndex);\n } else {\n log.warn(\"Discard invalid Nullable declaration [{}]\", declaredType);\n }\n } else {\n nullable = false;\n }\n\n // enum*, datetime* and decimal*\n int index = declaredType.indexOf('(');\n if (index > 0 && declaredType.charAt(declaredType.length() - 1) == ')') {\n String innerExpr = declaredType.substring(index + 1, declaredType.length() - 1);\n List<String> arguments = Utils.splitByChar(innerExpr, ',');\n type = DataType.from(declaredType.substring(0, index));\n\n int size = arguments.size();\n if (size > 0) {\n switch (type) {\n case Enum:\n case Enum8:\n case Enum16:\n arguments.clear();\n options.putAll(parseOptions(innerExpr));\n break;\n case FixedStr:\n length = Integer.parseInt(arguments.remove(0));\n break;\n case DateTime64:\n scale = Integer.parseInt(arguments.remove(0));\n case DateTime:\n if (arguments.size() > 0) {\n String tz = arguments.remove(0).trim();\n if (tz.length() > 2 && tz.charAt(0) == '\\''\n && tz.charAt(tz.length() - 1) == '\\'') {\n timezone = tz.substring(1, tz.length() - 1);\n }\n }\n break;\n case Decimal:\n precision = Integer.parseInt(arguments.remove(0));\n case Decimal32:\n case Decimal64:\n case Decimal128:\n case Decimal256:\n if (arguments.size() > 0) {\n scale = Integer.parseInt(arguments.remove(0));\n }\n break;\n default:\n log.warn(\"Discard unsupported arguments for [{}]: {}\", declaredType, arguments);\n break;\n }\n\n if (arguments.size() > 0) {\n log.warn(\"Discard unsupported arguments for [{}]: {}\", declaredType, arguments);\n }\n } else {\n log.warn(\"Discard empty argument for [{}]\", declaredType);\n }\n } else {\n type = DataType.from(declaredType);\n }\n } else if (name == DEFAULT_NAME) {\n if (!hasQuote || (hasQuote && !escaped)) {\n sb.append(ch);\n }\n }\n }\n\n if (sb.length() > 0) {\n name = sb.toString();\n }\n }\n\n return new ColumnDefinition(name, type, nullable, length, precision, scale, timezone, value, options);\n }", "public final MF addColumnDefinition(String column, ColumnDefinition<K, ?> columnDefinition) {\n\t\tcolumnDefinitions.addColumnDefinition(column, columnDefinition);\n\t\treturn (MF) this;\n\t}", "protected CfDef getCfDef(Cassandra.Client client)\n throws org.apache.cassandra.thrift.InvalidRequestException,\n UnavailableException,\n TimedOutException,\n SchemaDisagreementException,\n TException,\n NotFoundException,\n org.apache.cassandra.exceptions.InvalidRequestException,\n ConfigurationException,\n IOException\n {\n // get CF meta data\n String query = String.format(\"SELECT type, comparator, subcomparator, default_validator, key_validator \" +\n \"FROM %s.%s \" +\n \"WHERE keyspace_name = '%s' AND columnfamily_name = '%s'\",\n SystemKeyspace.NAME,\n LegacySchemaTables.COLUMNFAMILIES,\n keyspace,\n column_family);\n\n CqlResult result = client.execute_cql3_query(ByteBufferUtil.bytes(query), Compression.NONE, ConsistencyLevel.ONE);\n\n if (result == null || result.rows == null || result.rows.isEmpty())\n return null;\n\n Iterator<CqlRow> iteraRow = result.rows.iterator();\n CfDef cfDef = new CfDef();\n cfDef.keyspace = keyspace;\n cfDef.name = column_family;\n if (iteraRow.hasNext())\n {\n CqlRow cqlRow = iteraRow.next();\n\n cfDef.column_type = ByteBufferUtil.string(cqlRow.columns.get(0).value);\n cfDef.comparator_type = ByteBufferUtil.string(cqlRow.columns.get(1).value);\n ByteBuffer subComparator = cqlRow.columns.get(2).value;\n if (subComparator != null)\n cfDef.subcomparator_type = ByteBufferUtil.string(subComparator);\n cfDef.default_validation_class = ByteBufferUtil.string(cqlRow.columns.get(3).value);\n cfDef.key_validation_class = ByteBufferUtil.string(cqlRow.columns.get(4).value);\n }\n cfDef.column_metadata = getColumnMetadata(client);\n return cfDef;\n }", "@Override\n public ColumnOrBuilder getColumnsOrBuilder(\n int index) {\n return columns_.get(index);\n }", "public java.util.List<com.factset.protobuf.stach.v2.table.ColumnDefinitionProto.ColumnDefinition> getColumnsList() {\n if (columnsBuilder_ == null) {\n return java.util.Collections.unmodifiableList(columns_);\n } else {\n return columnsBuilder_.getMessageList();\n }\n }", "public Column.Builder getColumnsBuilder(\n int index) {\n return getColumnsFieldBuilder().getBuilder(index);\n }", "public int getcharge(int position){\n\t\treturn charges.get(position);\n\t}", "public int getColumn()\n\t{\n\t\treturn col;\n\t}", "public List<Column> getColumns();", "public final void mK_COLUMNFAMILY() throws RecognitionException {\n try {\n int _type = K_COLUMNFAMILY;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n // /Users/devdatta.kulkarni/Documents/Cassandra/apache-cassandra-0.8.6-src/src/java/org/apache/cassandra/cql/Cql.g:512:15: ( ( C O L U M N F A M I L Y | T A B L E ) )\n // /Users/devdatta.kulkarni/Documents/Cassandra/apache-cassandra-0.8.6-src/src/java/org/apache/cassandra/cql/Cql.g:512:16: ( C O L U M N F A M I L Y | T A B L E )\n {\n // /Users/devdatta.kulkarni/Documents/Cassandra/apache-cassandra-0.8.6-src/src/java/org/apache/cassandra/cql/Cql.g:512:16: ( C O L U M N F A M I L Y | T A B L E )\n int alt3=2;\n int LA3_0 = input.LA(1);\n\n if ( (LA3_0=='C'||LA3_0=='c') ) {\n alt3=1;\n }\n else if ( (LA3_0=='T'||LA3_0=='t') ) {\n alt3=2;\n }\n else {\n NoViableAltException nvae =\n new NoViableAltException(\"\", 3, 0, input);\n\n throw nvae;\n }\n switch (alt3) {\n case 1 :\n // /Users/devdatta.kulkarni/Documents/Cassandra/apache-cassandra-0.8.6-src/src/java/org/apache/cassandra/cql/Cql.g:512:18: C O L U M N F A M I L Y\n {\n mC(); \n mO(); \n mL(); \n mU(); \n mM(); \n mN(); \n mF(); \n mA(); \n mM(); \n mI(); \n mL(); \n mY(); \n\n }\n break;\n case 2 :\n // /Users/devdatta.kulkarni/Documents/Cassandra/apache-cassandra-0.8.6-src/src/java/org/apache/cassandra/cql/Cql.g:513:20: T A B L E\n {\n mT(); \n mA(); \n mB(); \n mL(); \n mE(); \n\n }\n break;\n\n }\n\n\n }\n\n state.type = _type;\n state.channel = _channel;\n }\n finally {\n }\n }", "public int getColumn() {\r\n\t\treturn this.col;\r\n\t}", "public static ColumnMetadataBuilder newBuilder() {\n ColumnMetadataBuilder mb = new ColumnMetadataBuilder();\n mb.name = \"testCol\";\n mb.byteLength = 14;\n mb.length = 11;\n mb.scale = 0;\n mb.precision = 4;\n return mb;\n }", "private com.google.protobuf.SingleFieldBuilderV3<\n godot.wire.Wire.Vector2, godot.wire.Wire.Vector2.Builder, godot.wire.Wire.Vector2OrBuilder> \n getPositionFieldBuilder() {\n if (positionBuilder_ == null) {\n positionBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<\n godot.wire.Wire.Vector2, godot.wire.Wire.Vector2.Builder, godot.wire.Wire.Vector2OrBuilder>(\n getPosition(),\n getParentForChildren(),\n isClean());\n position_ = null;\n }\n return positionBuilder_;\n }", "private HColumnDescriptor toHColumnDescriptor(ColumnFamilyDescriptor column) {\n HColumnDescriptor hColumnDescriptor = new HColumnDescriptor(column.getNameAsString());\n // TODO - copy the config and value Maps\n for (Map.Entry<String, String> entry : column.getConfiguration().entrySet()) {\n hColumnDescriptor.setConfiguration(entry.getKey(), entry.getValue());\n }\n for (Map.Entry<Bytes, Bytes> entry : column.getValues().entrySet()) {\n hColumnDescriptor.setValue(entry.getKey().get(), entry.getValue().get());\n }\n return hColumnDescriptor;\n }", "private int getColumn() {\n return binaryPartition(column);\n }", "String getColumn();", "public List<Column> getColumns(){\r\n\t\treturn columns;\r\n\t}", "public int getColIndex() {\r\n\t\treturn colIndex;\r\n\t}", "public SubCell position() {\r\n return position;\r\n }", "public Map<String, String> getColumnsMap() {\n\t\treturn columnsVsDataTypeMap;\n\t}" ]
[ "0.5516582", "0.54583156", "0.5286614", "0.517454", "0.50855076", "0.5075996", "0.5054018", "0.50466", "0.5035039", "0.50015897", "0.49942735", "0.49138394", "0.48870873", "0.4866351", "0.4834194", "0.48271137", "0.4779772", "0.47654873", "0.47597528", "0.47212285", "0.47197944", "0.47173208", "0.4711651", "0.4706653", "0.46583346", "0.46502486", "0.46262702", "0.46186605", "0.46186605", "0.46186605", "0.46161035", "0.4612008", "0.46076792", "0.46051705", "0.4603766", "0.45929277", "0.45809165", "0.4571968", "0.4571968", "0.4567808", "0.45661655", "0.45624608", "0.4558121", "0.45567545", "0.45483652", "0.4547911", "0.45451492", "0.4534777", "0.45288554", "0.45279017", "0.45272484", "0.4514035", "0.45000836", "0.44932017", "0.44881266", "0.44881266", "0.44862995", "0.44765875", "0.44709334", "0.44659847", "0.44639653", "0.446324", "0.44510996", "0.4446293", "0.44449317", "0.4433875", "0.44331816", "0.44320512", "0.442984", "0.44240683", "0.44183144", "0.44115943", "0.44108832", "0.4408371", "0.4404123", "0.44027138", "0.43960267", "0.4393623", "0.43880638", "0.43787494", "0.43782413", "0.43685317", "0.4367098", "0.4365996", "0.43646687", "0.43488625", "0.43435803", "0.43336332", "0.43330458", "0.43234426", "0.43208438", "0.43168458", "0.4314569", "0.43082705", "0.4307649", "0.4305758", "0.43050036", "0.43043217", "0.4303963", "0.43031824" ]
0.6751719
0
Creates a new SingleColumnRestriction.Slice instance for the specified clustering column.
private static Restriction newSingleSlice(CFMetaData cfMetaData, int index, Bound bound, boolean inclusive, ByteBuffer value) { ColumnDefinition columnDef = getClusteringColumnDefinition(cfMetaData, index); return new SingleColumnRestriction.Slice(columnDef, bound, inclusive, toTerm(value)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static Restriction newMultiSlice(CFMetaData cfMetaData, int firstIndex, Bound bound, boolean inclusive, ByteBuffer... values)\n {\n List<ColumnDefinition> columnDefinitions = new ArrayList<>();\n for (int i = 0; i < values.length; i++)\n {\n columnDefinitions.add(getClusteringColumnDefinition(cfMetaData, i + firstIndex));\n }\n return new MultiColumnRestriction.Slice(columnDefinitions, bound, inclusive, toMultiItemTerminal(values));\n }", "public ContactListFilterPredicate column(String column) {\n this.column = column;\n return this;\n }", "@Test\n public void testBoundsAsCompositesWithSliceRestrictionsAndOneClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newSingleSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newSingleSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n }", "@Override\n public Vector viewColumn(int column) {\n if (column < 0 || column >= columnSize()) {\n throw new IndexException(column, columnSize());\n }\n return new PermutedVectorView(base.viewColumn(columnPivot[column]), rowPivot, rowUnpivot);\n }", "public Criteria andDeletedLessThanOrEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"deleted <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithTwoClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.END);\n }", "public SubsetFilter createFilter(Dimension dimension);", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithSliceRestrictionsAndOneDescendingClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newSingleSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newSingleSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n }", "public Slicing getSlicing() { \n\t\tif (mySlicing == null) {\n\t\t\tmySlicing = new Slicing();\n\t\t}\n\t\treturn mySlicing;\n\t}", "public T col(final String column) {\r\n\t\treturn op(ConditionValueType.COLUMN, column);\r\n\t}", "public Criteria andDeletedLessThanColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"deleted < \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public SubsetTableImpl(Column[] col) {\n\t\tsuper(col);\n\t\t//ANCA added 2 lines below\n\t\tint numRows = super.getNumRows();\n\t\tthis.subset = new int[numRows];\n\t\t//ANCA took this out: this.subset = new int [this.getNumRows()];\n\t\tfor (int i = 0; i < this.getNumRows(); i++) {\n\t\t\tsubset[i] = i;\n\t\t}\n\t}", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneAscendingAndOneDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n assertComposite(bounds.get(2), value2, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertComposite(bounds.get(1), value2, EOC.START);\n assertComposite(bounds.get(2), value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneDescendingAndOneAscendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0) > (1) AND (clustering_0, clustering1) < (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.END);\n assertComposite(bounds.get(2), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.END);\n assertComposite(bounds.get(1), value1, EOC.START);\n assertComposite(bounds.get(2), value1, EOC.END);\n }", "Column(String column) {\n this.column = column;\n }", "Column(String column) {\n this.column = column;\n }", "Get<K, C> withColumnRange(C startColumn, C endColumn, int limit);", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithTwoAscendingAndTwoDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.DESC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertEmptyComposite(bounds.get(1));\n\n // clustering_0 = 1 AND (clustering_1, clustering_2, clustering_3) > (2, 3, 4)\n Restriction eq = newSingleEq(cfMetaData, 0, value1);\n slice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n restrictions = restrictions.mergeWith(eq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2, clustering_3) > (2, 3, 4)\n Restriction in = newSingleIN(cfMetaData, 0, value1, value2);\n slice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n restrictions = restrictions.mergeWith(in);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n assertComposite(bounds.get(2), value2, value2, EOC.START);\n assertComposite(bounds.get(3), value2, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n assertComposite(bounds.get(2), value2, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(3), value2, EOC.END);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1, clustering_2, clustering_3) <= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) < (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4) AND (clustering_0, clustering_1) < (2, 3)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2, value3);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(1), value2, value3, EOC.START);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4) AND (clustering_0, clustering1, clustering_2, clustering_3) <= (4, 3, 2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value4, value3, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n assertComposite(bounds.get(2), value4, value3, value2, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(1), value4, value3, EOC.START);\n assertComposite(bounds.get(2), value4, value3, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsMixingAscendingDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.DESC, Sort.ASC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(3));\n\n // clustering_0 = 1 AND (clustering_1, clustering_2, clustering_3) > (2, 3, 4)\n Restriction eq = newSingleEq(cfMetaData, 0, value1);\n slice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n restrictions = restrictions.mergeWith(eq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(3));\n\n\n // (clustering_0, clustering1, clustering_2, clustering_3) <= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, value4, EOC.NONE);\n assertComposite(bounds.get(3), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) < (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(3), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4) AND (clustering_0, clustering_1) < (2, 3)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2, value3);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(5, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n assertComposite(bounds.get(4), value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(5, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertComposite(bounds.get(3), value2, EOC.START);\n assertComposite(bounds.get(4), value2, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4) AND (clustering_0, clustering1, clustering_2, clustering_3) <= (4, 3, 2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value4, value3, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(7, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n assertComposite(bounds.get(4), value4, value3, EOC.START);\n assertComposite(bounds.get(5), value4, value3, value2, value1, EOC.NONE);\n assertComposite(bounds.get(6), value4, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(7, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertComposite(bounds.get(3), value4, EOC.START);\n assertComposite(bounds.get(4), value4, value3, value2, EOC.START);\n assertComposite(bounds.get(5), value4, value3, value2, EOC.END);\n assertComposite(bounds.get(6), value4, EOC.END);\n }", "Column createColumn();", "public DataFrame getSubset(int[] c, int[] r) {\n\n Object[][] data = new Object[r.length][c.length];\n Object[] idx = new Object[r.length];\n String[] hdr = new String[c.length];\n\n int rr = 0;\n int cc;\n for (int row : r) {\n cc = 0;\n for (int col : c) {\n data[rr][cc] = this.data.values[col][row];\n idx[rr] = this.index.values[row];\n hdr[cc] = this.header.values[col];\n cc++;\n }\n rr++;\n }\n\n return new DataFrame(data, hdr, idx, \"SubSet of \" + name);\n }", "public ElementDefinitionDt setSlicing(Slicing theValue) {\n\t\tmySlicing = theValue;\n\t\treturn this;\n\t}", "QueryPartitionClause createQueryPartitionClause();", "public Criteria andDeletedEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"deleted = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithTwoDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n }", "public SubsetTableImpl(Column[] col, int[] subset) {\n\t\tsuper(col);\n\t\tthis.subset = subset;\n\t}", "Get<K, C> withColumnRange(C startColumn, C endColumn);", "@Test\n public void testBoundsAsCompositesWithOneEqRestrictionsAndOneClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC);\n\n ByteBuffer clustering_0 = ByteBufferUtil.bytes(1);\n Restriction eq = newSingleEq(cfMetaData, 0, clustering_0);\n\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.END);\n }", "public Criteria andDeletedLessThanOrEqualToColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"deleted <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andCnameLessThanOrEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"cname <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneDescendingClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n }", "public TableSlice(Table table, Selection rowSelection) {\n this.name = table.name();\n this.selection = rowSelection;\n this.table = table;\n }", "public DDataFilter(DDataAttribute column) throws DDataException {\n this(column, null, null, null);\n }", "Dimension createDimension();", "@Test\n public void testBoundsAsCompositesWithMultiEqAndSingleSliceRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n\n // (clustering_0, clustering_1) = (1, 2) AND clustering_2 > 3\n Restriction multiEq = newMultiEq(cfMetaData, 0, value1, value2);\n Restriction singleSlice = newSingleSlice(cfMetaData, 2, Bound.START, false, value3);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiEq).mergeWith(singleSlice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n }", "public Slicing addDiscriminator( String theString) {\n\t\tif (myDiscriminator == null) {\n\t\t\tmyDiscriminator = new java.util.ArrayList<StringDt>();\n\t\t}\n\t\tmyDiscriminator.add(new StringDt(theString));\n\t\treturn this; \n\t}", "Get<K, C> withColumnRange(C startColumn,\n boolean startColumnInclusive,\n C endColumn,\n boolean endColumnInclusive,\n int limit);", "DataFrame<R,C> select(Predicate<DataFrameRow<R,C>> rowPredicate, Predicate<DataFrameColumn<R,C>> colPredicate);", "public final Context createContext(int column) {\n return new Context(rowIndex, column, rowValueKey, subrowIndex);\n }", "public Criteria andDeletedNotEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"deleted <> \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andDeletedLessThanColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"deleted < \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "Dimension_Dimension createDimension_Dimension();", "public TableSlice(Table table) {\n this.name = table.name();\n this.selection = null;\n this.table = table;\n }", "public Criteria andDeletedGreaterThanOrEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"deleted >= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "@Transient\n public SliceKindConfiguration getSliceKindConfiguration( ) {\n return new SliceKindConfiguration(\n getId(),\n getPermission(),\n getSubspace().toString() );\n }", "@Test\n public void testBoundsAsCompositesWithSingleEqAndSliceRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n ByteBuffer value5 = ByteBufferUtil.bytes(5);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) > (2, 3)\n Restriction singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction multiSlice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiSlice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) > (2, 3) AND (clustering_1) < (4)\n singleEq = newSingleEq(cfMetaData, 0, value1);\n multiSlice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3);\n Restriction multiSlice2 = newMultiSlice(cfMetaData, 1, Bound.END, false, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiSlice2).mergeWith(singleEq).mergeWith(multiSlice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value4, EOC.START);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) => (2, 3) AND (clustering_1, clustering_2) <= (4, 5)\n singleEq = newSingleEq(cfMetaData, 0, value1);\n multiSlice = newMultiSlice(cfMetaData, 1, Bound.START, true, value2, value3);\n multiSlice2 = newMultiSlice(cfMetaData, 1, Bound.END, true, value4, value5);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiSlice2).mergeWith(singleEq).mergeWith(multiSlice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value4, value5, EOC.END);\n }", "public Criteria andDeletedLessThanOrEqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"deleted <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public GridAxis1D.Builder<?> makeSubsetByIndex(Range subsetRange) {\n int ncoords = subsetRange.length();\n Preconditions.checkArgument(subsetRange.last() < orgGridAxis.getNcoords());\n\n double resolution = 0.0;\n if (orgGridAxis.getSpacing().isRegular()) {\n resolution = subsetRange.stride() * orgGridAxis.getResolution();\n }\n\n GridAxis1D.Builder<?> builder = orgGridAxis.toBuilder();\n builder.subset(ncoords, orgGridAxis.getCoordMidpoint(subsetRange.first()),\n orgGridAxis.getCoordMidpoint(subsetRange.last()), resolution, subsetRange);\n return builder;\n }", "public Criteria andIdLessThanOrEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"id <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andIdLessThanOrEqualToColumn(LitemallTypeRole.Column column) {\n addCriterion(new StringBuilder(\"id <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "PivotCol createPivotCol();", "protected Cluster makeWordSubCluster(Cluster cluster, String word) {\n List<Node> l = makeWordSubCluster(cluster.elements, word);\n Cluster c = new Cluster(cluster.startTime, cluster.endTime);\n c.elements = l;\n return c;\n }", "public Criteria andCnameLessThanColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"cname < \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Object getObject(int row, int column) {\n\t\treturn getColumn(column).getRow(subset[row]);\n\t}", "public GroupByBuilder column(String ...column) {\n\t\t\n\t\tCollections.addAll(groupBy.columns, column);\n\t\treturn this;\n\t}", "public abstract Collection<T> getFirstDimension();", "ColumnFull createColumnFull();", "public Criteria andDeletedLessThanColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"deleted < \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public static SliceInstruction parseSliceInstructions(String file) throws IOException {\n try (FileReader fileReader = new FileReader(file)) {\n BufferedReader br = new BufferedReader(fileReader);\n String[] headerTokens = br.readLine().split(\" \");\n int minNumberOfIngredientPerSlice = Integer.parseInt(headerTokens[2]);\n int maxNumberOfCellsPerSlice = Integer.parseInt(headerTokens[3]);\n return new SliceInstruction(minNumberOfIngredientPerSlice, maxNumberOfCellsPerSlice);\n }\n }", "Get<K, C> withColumnLimit(int limit);", "public Criteria andDeletedGreaterThanColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"deleted > \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andIdLessThanColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"id < \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andCreatePersonLessThanColumn(TCpyBankCredit.Column column) {\n addCriterion(new StringBuilder(\"create_person < \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andDeletedLessThanOrEqualToColumn(YoungSeckillPromotionProductRelation.Column column) {\n addCriterion(new StringBuilder(\"deleted <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public yandex.cloud.api.mdb.clickhouse.v1.ClusterOuterClass.Shard getShard(yandex.cloud.api.mdb.clickhouse.v1.ClusterServiceOuterClass.GetClusterShardRequest request) {\n return io.grpc.stub.ClientCalls.blockingUnaryCall(\n getChannel(), getGetShardMethod(), getCallOptions(), request);\n }", "handy.storage.api.ColumnCondition<DeleteOperation<T>> where(String column);", "public final PythonParser.sliceop_return sliceop() throws RecognitionException {\n PythonParser.sliceop_return retval = new PythonParser.sliceop_return();\n retval.start = input.LT(1);\n\n PythonTree root_0 = null;\n\n Token COLON256=null;\n PythonParser.test_return test257 = null;\n\n\n PythonTree COLON256_tree=null;\n RewriteRuleTokenStream stream_COLON=new RewriteRuleTokenStream(adaptor,\"token COLON\");\n RewriteRuleSubtreeStream stream_test=new RewriteRuleSubtreeStream(adaptor,\"rule test\");\n try {\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1506:5: ( COLON ( test[expr_contextType.Load] -> test | -> ^( COLON[$COLON, \\\"None\\\", expr_contextType.Load] ) ) )\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1506:7: COLON ( test[expr_contextType.Load] -> test | -> ^( COLON[$COLON, \\\"None\\\", expr_contextType.Load] ) )\n {\n COLON256=(Token)match(input,COLON,FOLLOW_COLON_in_sliceop6943); if (state.failed) return retval; \n if ( state.backtracking==0 ) stream_COLON.add(COLON256);\n\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1507:6: ( test[expr_contextType.Load] -> test | -> ^( COLON[$COLON, \\\"None\\\", expr_contextType.Load] ) )\n int alt128=2;\n int LA128_0 = input.LA(1);\n\n if ( (LA128_0==NAME||(LA128_0>=LAMBDA && LA128_0<=NOT)||LA128_0==LPAREN||(LA128_0>=PLUS && LA128_0<=MINUS)||(LA128_0>=TILDE && LA128_0<=LBRACK)||LA128_0==LCURLY||(LA128_0>=BACKQUOTE && LA128_0<=STRING)) ) {\n alt128=1;\n }\n else if ( (LA128_0==COMMA||LA128_0==RBRACK) ) {\n alt128=2;\n }\n else {\n if (state.backtracking>0) {state.failed=true; return retval;}\n NoViableAltException nvae =\n new NoViableAltException(\"\", 128, 0, input);\n\n throw nvae;\n }\n switch (alt128) {\n case 1 :\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1507:7: test[expr_contextType.Load]\n {\n pushFollow(FOLLOW_test_in_sliceop6951);\n test257=test(expr_contextType.Load);\n\n state._fsp--;\n if (state.failed) return retval;\n if ( state.backtracking==0 ) stream_test.add(test257.getTree());\n\n\n // AST REWRITE\n // elements: test\n // token labels: \n // rule labels: retval\n // token list labels: \n // rule list labels: \n // wildcard labels: \n if ( state.backtracking==0 ) {\n retval.tree = root_0;\n RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,\"rule retval\",retval!=null?retval.tree:null);\n\n root_0 = (PythonTree)adaptor.nil();\n // 1508:5: -> test\n {\n adaptor.addChild(root_0, stream_test.nextTree());\n\n }\n\n retval.tree = root_0;}\n }\n break;\n case 2 :\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1510:5: \n {\n\n // AST REWRITE\n // elements: COLON\n // token labels: \n // rule labels: retval\n // token list labels: \n // rule list labels: \n // wildcard labels: \n if ( state.backtracking==0 ) {\n retval.tree = root_0;\n RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,\"rule retval\",retval!=null?retval.tree:null);\n\n root_0 = (PythonTree)adaptor.nil();\n // 1510:5: -> ^( COLON[$COLON, \\\"None\\\", expr_contextType.Load] )\n {\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1510:8: ^( COLON[$COLON, \\\"None\\\", expr_contextType.Load] )\n {\n PythonTree root_1 = (PythonTree)adaptor.nil();\n root_1 = (PythonTree)adaptor.becomeRoot(new Name(COLON, COLON256, \"None\", expr_contextType.Load), root_1);\n\n adaptor.addChild(root_0, root_1);\n }\n\n }\n\n retval.tree = root_0;}\n }\n break;\n\n }\n\n\n }\n\n retval.stop = input.LT(-1);\n\n if ( state.backtracking==0 ) {\n\n retval.tree = (PythonTree)adaptor.rulePostProcessing(root_0);\n adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);\n }\n }\n\n catch (RecognitionException re) {\n errorHandler.reportError(this, re);\n errorHandler.recover(this, input,re);\n retval.tree = (PythonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);\n }\n finally {\n }\n return retval;\n }", "public Criteria andCreatePersonLessThanOrEqualToColumn(TCpyBankCredit.Column column) {\n addCriterion(new StringBuilder(\"create_person <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "protected int index(int slice, int row, int column) {\n\treturn _sliceOffset(_sliceRank(slice)) + _rowOffset(_rowRank(row)) + _columnOffset(_columnRank(column));\n}", "public Criteria andIdLessThanColumn(LitemallTypeRole.Column column) {\n addCriterion(new StringBuilder(\"id < \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andDeletedLessThanColumn(YoungSeckillPromotionProductRelation.Column column) {\n addCriterion(new StringBuilder(\"deleted < \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "@Test\n public void testBoundsAsCompositesWithOneInRestrictionsAndOneClusteringColumn()\n {\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n Restriction in = newSingleIN(cfMetaData, 0, value1, value2, value3);\n\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(in);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.START);\n assertComposite(bounds.get(2), value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n assertComposite(bounds.get(1), value2, EOC.END);\n assertComposite(bounds.get(2), value3, EOC.END);\n }", "private static Restriction newSingleIN(CFMetaData cfMetaData, int index, ByteBuffer... values)\n {\n ColumnDefinition columnDef = getClusteringColumnDefinition(cfMetaData, index);\n return new SingleColumnRestriction.InWithValues(columnDef, toTerms(values));\n }", "public final void rule__PrimaryExpr2__SliceAssignment_1_2_0() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \t\r\n try {\r\n // InternalGo.g:18110:1: ( ( ruleSlice ) )\r\n // InternalGo.g:18111:2: ( ruleSlice )\r\n {\r\n // InternalGo.g:18111:2: ( ruleSlice )\r\n // InternalGo.g:18112:3: ruleSlice\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getPrimaryExpr2Access().getSliceSliceParserRuleCall_1_2_0_0()); \r\n }\r\n pushFollow(FOLLOW_2);\r\n ruleSlice();\r\n\r\n state._fsp--;\r\n if (state.failed) return ;\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getPrimaryExpr2Access().getSliceSliceParserRuleCall_1_2_0_0()); \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n finally {\r\n\r\n \trestoreStackSize(stackSize);\r\n\r\n }\r\n return ;\r\n }", "public Criteria andCnameEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"cname = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Column getColumn(int column) throws Exception{\n\t\tif(column >= size)\n\t\t\tthrow new Exception(\"Index out of bounds\");\n\n\t\treturn columns[column];\n\t}", "public Criteria andDeletedEqualToColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"deleted = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "GroupByColumnFull createGroupByColumnFull();", "public FilterCriterion createFilter(String column, Object value, FilterCriterion.FilterType type)\n {\n return new FilterCriterion(column, value, type);\n }", "public Criteria andStrLessThanOrEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"str <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "Column createColumn(JavaTypeMapping mapping, String javaType, int datastoreFieldIndex);", "private static Restriction newSingleEq(CFMetaData cfMetaData, int index, ByteBuffer value)\n {\n ColumnDefinition columnDef = getClusteringColumnDefinition(cfMetaData, index);\n return new SingleColumnRestriction.EQ(columnDef, toTerm(value));\n }", "public Column(Column column) {\r\n this.blocks = new ArrayList<Block>(column.getBlocks().size());\r\n for (Block block : column.getBlocks()) {\r\n this.blocks.add(new Block(block));\r\n }\r\n this.entriesSet = column.entriesSet;\r\n this.isGone = column.isGone;\r\n this.index = column.getIndex();\r\n this.maxEntries = column.maxEntries;\r\n }", "public abstract List<V> makeColumnData(C column);", "public Criteria andAttribLessThanOrEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"attrib <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "DataFrameColumn<R,C> col(C colKey);", "public Collection<String> listSlices() throws PermissionDeniedException;", "public VolcanoDragonSkull createDragonSkull(float col, float row) {\n List<Part> parts = new ArrayList<>();\n parts.add(new Part(new SquareVector(0, 0), \"DragonSkull\", true));\n return new VolcanoDragonSkull(col, row, parts);\n }", "public Criteria andCnameGreaterThanOrEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"cname >= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public static FlowMap getSliceFlowSpace(String sliceName) {\n\t\tOFMatch match = new OFMatch();\n\t\tFlowMap ret = new LinearFlowMap();\n\t\tmatch.setWildcards(OFMatch.OFPFW_ALL);\n\t\tFlowMap flowSpace = FVConfig.getFlowSpaceFlowMap();\n\t\tList<FlowIntersect> intersections = flowSpace.intersects(\n\t\t\t\tFlowEntry.ALL_DPIDS, match);\n\t\tfor (FlowIntersect inter : intersections) {\n\t\t\tFlowEntry rule = inter.getFlowEntry();\n\t\t\tFlowEntry neoRule = null;\n\t\t\tneoRule = rule.clone();\n\t\t\tneoRule.setRuleMatch(inter.getMatch());\n\t\t\tneoRule.setActionsList(new ArrayList<OFAction>());\n\t\t\tfor (OFAction action : rule.getActionsList()) {\n\t\t\t\t// the flowspace should only contain SliceActions\n\t\t\t\tSliceAction sliceAction = (SliceAction) action;\n\t\t\t\tif (sliceAction.getSliceName().equals(sliceName)) {\n\t\t\t\t\tneoRule.getActionsList().add(sliceAction.clone());\n\t\t\t\t\tret.addRule(neoRule);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn ret;\n\t}", "@Test\n public void testBoundsAsCompositesWithOneEqRestrictionsAndTwoClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer clustering_0 = ByteBufferUtil.bytes(1);\n Restriction eq = newSingleEq(cfMetaData, 0, clustering_0);\n\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.END);\n }", "public static Dissector create(String mapping) {\n Dissector dissector = new Dissector();\n dissector.handleMapping(mapping);\n return dissector;\n }", "private String getChromosome(String column) {\n if (column.substring(0,3).equals(\"Chr\")) {\n return column.substring(3);\n } else {\n return column;\n }\n }", "public com.google.common.util.concurrent.ListenableFuture<yandex.cloud.api.mdb.clickhouse.v1.ClusterOuterClass.Shard> getShard(\n yandex.cloud.api.mdb.clickhouse.v1.ClusterServiceOuterClass.GetClusterShardRequest request) {\n return io.grpc.stub.ClientCalls.futureUnaryCall(\n getChannel().newCall(getGetShardMethod(), getCallOptions()), request);\n }", "public Criteria andComposeLessThanOrEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"compose <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public boolean isSparseColumnSet(int column) throws SQLServerException\n {\n checkClosed();\n \n CryptoMetadata cryptoMetadata = rs.getColumn(column).getCryptoMetadata();\n if(null != cryptoMetadata){\n \treturn cryptoMetadata.getBaseTypeInfo().isSparseColumnSet();\n }\n \n return rs.getColumn(column).getTypeInfo().isSparseColumnSet();\n }", "public DataFrame getSubset(String[] columns) {\n\n // get the indices matching the columns\n int[] c = this.header.getIndices(columns);\n\n Object[][] data = new Object[this.data.rows][c.length];\n Object[] idx = new Object[this.data.rows];\n String[] hdr = new String[c.length];\n\n int rr = 0;\n int cc;\n for (int row = 0; row < this.data.rows; row++) {\n cc = 0;\n for (int col : c) {\n data[rr][cc] = this.data.values[col][row];\n idx[rr] = this.index.values[row];\n hdr[cc] = this.header.values[col];\n cc++;\n }\n rr++;\n }\n\n return new DataFrame(data, hdr, idx, \"SubSet of \" + name);\n }", "public Criteria andIdLessThanOrEqualToColumn(TCpyBankCredit.Column column) {\n addCriterion(new StringBuilder(\"id <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andIdEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"id = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }" ]
[ "0.587627", "0.51162875", "0.47752202", "0.4752726", "0.45678687", "0.45451474", "0.45056394", "0.4467713", "0.44407982", "0.44352773", "0.44298926", "0.44105753", "0.44011277", "0.4387591", "0.43502158", "0.43449128", "0.43449128", "0.43398672", "0.43350664", "0.43224764", "0.43195868", "0.42942593", "0.42763627", "0.42744333", "0.4249928", "0.42491642", "0.4241548", "0.4240864", "0.42336267", "0.42310303", "0.42200762", "0.42187613", "0.4207955", "0.4206749", "0.4205753", "0.4199367", "0.41992444", "0.4193721", "0.41793814", "0.417823", "0.4174575", "0.41721404", "0.41628465", "0.41531244", "0.41427562", "0.41415486", "0.41225734", "0.4100533", "0.41000727", "0.40987235", "0.408341", "0.40633622", "0.4052719", "0.40413317", "0.40394765", "0.40393803", "0.40284315", "0.40258783", "0.40250567", "0.40155363", "0.40116626", "0.4011495", "0.39875272", "0.3984222", "0.39785945", "0.39666057", "0.39591148", "0.3953373", "0.39498347", "0.39450234", "0.39427927", "0.39420778", "0.3938215", "0.39324197", "0.39238068", "0.39182362", "0.39173305", "0.39074287", "0.39053145", "0.39045677", "0.38996547", "0.3898096", "0.38902315", "0.38898855", "0.38765448", "0.38718227", "0.38691962", "0.38658112", "0.3860907", "0.38585338", "0.38568953", "0.38540658", "0.38425717", "0.38405272", "0.38403797", "0.3839281", "0.3838837", "0.38299057", "0.38211474", "0.3820873" ]
0.69195217
0
Creates a new SingleColumnRestriction.Slice instance for the specified clustering column.
private static Restriction newMultiSlice(CFMetaData cfMetaData, int firstIndex, Bound bound, boolean inclusive, ByteBuffer... values) { List<ColumnDefinition> columnDefinitions = new ArrayList<>(); for (int i = 0; i < values.length; i++) { columnDefinitions.add(getClusteringColumnDefinition(cfMetaData, i + firstIndex)); } return new MultiColumnRestriction.Slice(columnDefinitions, bound, inclusive, toMultiItemTerminal(values)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static Restriction newSingleSlice(CFMetaData cfMetaData, int index, Bound bound, boolean inclusive, ByteBuffer value)\n {\n ColumnDefinition columnDef = getClusteringColumnDefinition(cfMetaData, index);\n return new SingleColumnRestriction.Slice(columnDef, bound, inclusive, toTerm(value));\n }", "public ContactListFilterPredicate column(String column) {\n this.column = column;\n return this;\n }", "@Test\n public void testBoundsAsCompositesWithSliceRestrictionsAndOneClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newSingleSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newSingleSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n }", "@Override\n public Vector viewColumn(int column) {\n if (column < 0 || column >= columnSize()) {\n throw new IndexException(column, columnSize());\n }\n return new PermutedVectorView(base.viewColumn(columnPivot[column]), rowPivot, rowUnpivot);\n }", "public Criteria andDeletedLessThanOrEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"deleted <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithTwoClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.END);\n }", "public SubsetFilter createFilter(Dimension dimension);", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithSliceRestrictionsAndOneDescendingClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newSingleSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newSingleSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newSingleSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n }", "public Slicing getSlicing() { \n\t\tif (mySlicing == null) {\n\t\t\tmySlicing = new Slicing();\n\t\t}\n\t\treturn mySlicing;\n\t}", "public T col(final String column) {\r\n\t\treturn op(ConditionValueType.COLUMN, column);\r\n\t}", "public Criteria andDeletedLessThanColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"deleted < \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public SubsetTableImpl(Column[] col) {\n\t\tsuper(col);\n\t\t//ANCA added 2 lines below\n\t\tint numRows = super.getNumRows();\n\t\tthis.subset = new int[numRows];\n\t\t//ANCA took this out: this.subset = new int [this.getNumRows()];\n\t\tfor (int i = 0; i < this.getNumRows(); i++) {\n\t\t\tsubset[i] = i;\n\t\t}\n\t}", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneAscendingAndOneDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n assertComposite(bounds.get(2), value2, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertComposite(bounds.get(1), value2, EOC.START);\n assertComposite(bounds.get(2), value2, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneDescendingAndOneAscendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // (clustering_0) > (1) AND (clustering_0, clustering1) < (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.END);\n assertComposite(bounds.get(2), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.END);\n assertComposite(bounds.get(1), value1, EOC.START);\n assertComposite(bounds.get(2), value1, EOC.END);\n }", "Column(String column) {\n this.column = column;\n }", "Column(String column) {\n this.column = column;\n }", "Get<K, C> withColumnRange(C startColumn, C endColumn, int limit);", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithTwoAscendingAndTwoDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.DESC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertEmptyComposite(bounds.get(1));\n\n // clustering_0 = 1 AND (clustering_1, clustering_2, clustering_3) > (2, 3, 4)\n Restriction eq = newSingleEq(cfMetaData, 0, value1);\n slice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n restrictions = restrictions.mergeWith(eq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2, clustering_3) > (2, 3, 4)\n Restriction in = newSingleIN(cfMetaData, 0, value1, value2);\n slice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n restrictions = restrictions.mergeWith(in);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n assertComposite(bounds.get(2), value2, value2, EOC.START);\n assertComposite(bounds.get(3), value2, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n assertComposite(bounds.get(2), value2, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(3), value2, EOC.END);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1, clustering_2, clustering_3) <= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) < (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4) AND (clustering_0, clustering_1) < (2, 3)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2, value3);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(1), value2, value3, EOC.START);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4) AND (clustering_0, clustering1, clustering_2, clustering_3) <= (4, 3, 2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value4, value3, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, EOC.END);\n assertComposite(bounds.get(2), value4, value3, value2, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(1), value4, value3, EOC.START);\n assertComposite(bounds.get(2), value4, value3, EOC.END);\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsMixingAscendingDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.DESC, Sort.ASC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(3));\n\n // clustering_0 = 1 AND (clustering_1, clustering_2, clustering_3) > (2, 3, 4)\n Restriction eq = newSingleEq(cfMetaData, 0, value1);\n slice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n restrictions = restrictions.mergeWith(eq);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(2, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(1));\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertEmptyComposite(bounds.get(3));\n\n\n // (clustering_0, clustering1, clustering_2, clustering_3) <= (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, value4, EOC.NONE);\n assertComposite(bounds.get(3), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) < (1, 2, 3, 4)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2, value3, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertEmptyComposite(bounds.get(0));\n assertComposite(bounds.get(1), value1, value2, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(3), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(4, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) > (1, 2, 3, 4) AND (clustering_0, clustering_1) < (2, 3)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2, value3, value4);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2, value3);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(5, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n assertComposite(bounds.get(4), value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(5, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.START);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertComposite(bounds.get(3), value2, EOC.START);\n assertComposite(bounds.get(4), value2, EOC.END);\n\n // (clustering_0, clustering1, clustering_2, clustering_3) >= (1, 2, 3, 4) AND (clustering_0, clustering1, clustering_2, clustering_3) <= (4, 3, 2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2, value3, value4);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value4, value3, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(7, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, EOC.START);\n assertComposite(bounds.get(2), value1, value2, value3, EOC.END);\n assertComposite(bounds.get(3), value1, EOC.END);\n assertComposite(bounds.get(4), value4, value3, EOC.START);\n assertComposite(bounds.get(5), value4, value3, value2, value1, EOC.NONE);\n assertComposite(bounds.get(6), value4, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(7, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n assertComposite(bounds.get(1), value1, value2, value3, value4, EOC.END);\n assertComposite(bounds.get(2), value1, value2, EOC.END);\n assertComposite(bounds.get(3), value4, EOC.START);\n assertComposite(bounds.get(4), value4, value3, value2, EOC.START);\n assertComposite(bounds.get(5), value4, value3, value2, EOC.END);\n assertComposite(bounds.get(6), value4, EOC.END);\n }", "Column createColumn();", "public DataFrame getSubset(int[] c, int[] r) {\n\n Object[][] data = new Object[r.length][c.length];\n Object[] idx = new Object[r.length];\n String[] hdr = new String[c.length];\n\n int rr = 0;\n int cc;\n for (int row : r) {\n cc = 0;\n for (int col : c) {\n data[rr][cc] = this.data.values[col][row];\n idx[rr] = this.index.values[row];\n hdr[cc] = this.header.values[col];\n cc++;\n }\n rr++;\n }\n\n return new DataFrame(data, hdr, idx, \"SubSet of \" + name);\n }", "public ElementDefinitionDt setSlicing(Slicing theValue) {\n\t\tmySlicing = theValue;\n\t\treturn this;\n\t}", "QueryPartitionClause createQueryPartitionClause();", "public Criteria andDeletedEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"deleted = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithTwoDescendingClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC, Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n // (clustering_0, clustering1) > (1, 2)\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n // (clustering_0, clustering1) <= (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n // (clustering_0, clustering1) < (1, 2)\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n\n // (clustering_0, clustering1) > (1, 2) AND (clustering_0) < (2)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1, value2);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.START);\n\n // (clustering_0, clustering1) >= (1, 2) AND (clustering_0, clustering1) <= (2, 1)\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1, value2);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n }", "public SubsetTableImpl(Column[] col, int[] subset) {\n\t\tsuper(col);\n\t\tthis.subset = subset;\n\t}", "Get<K, C> withColumnRange(C startColumn, C endColumn);", "@Test\n public void testBoundsAsCompositesWithOneEqRestrictionsAndOneClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC);\n\n ByteBuffer clustering_0 = ByteBufferUtil.bytes(1);\n Restriction eq = newSingleEq(cfMetaData, 0, clustering_0);\n\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.END);\n }", "public Criteria andDeletedLessThanOrEqualToColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"deleted <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andCnameLessThanOrEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"cname <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "@Test\n public void testBoundsAsCompositesWithMultiSliceRestrictionsWithOneDescendingClusteringColumn()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.DESC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n\n Restriction slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, true, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.END, false, value1);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertEmptyComposite(bounds.get(0));\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, false, value1);\n Restriction slice2 = newMultiSlice(cfMetaData, 0, Bound.END, false, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n\n slice = newMultiSlice(cfMetaData, 0, Bound.START, true, value1);\n slice2 = newMultiSlice(cfMetaData, 0, Bound.END, true, value2);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(slice).mergeWith(slice2);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value2, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n }", "public DDataFilter(DDataAttribute column) throws DDataException {\n this(column, null, null, null);\n }", "public TableSlice(Table table, Selection rowSelection) {\n this.name = table.name();\n this.selection = rowSelection;\n this.table = table;\n }", "Dimension createDimension();", "public Slicing addDiscriminator( String theString) {\n\t\tif (myDiscriminator == null) {\n\t\t\tmyDiscriminator = new java.util.ArrayList<StringDt>();\n\t\t}\n\t\tmyDiscriminator.add(new StringDt(theString));\n\t\treturn this; \n\t}", "@Test\n public void testBoundsAsCompositesWithMultiEqAndSingleSliceRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n\n // (clustering_0, clustering_1) = (1, 2) AND clustering_2 > 3\n Restriction multiEq = newMultiEq(cfMetaData, 0, value1, value2);\n Restriction singleSlice = newSingleSlice(cfMetaData, 2, Bound.START, false, value3);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiEq).mergeWith(singleSlice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n }", "Get<K, C> withColumnRange(C startColumn,\n boolean startColumnInclusive,\n C endColumn,\n boolean endColumnInclusive,\n int limit);", "DataFrame<R,C> select(Predicate<DataFrameRow<R,C>> rowPredicate, Predicate<DataFrameColumn<R,C>> colPredicate);", "public final Context createContext(int column) {\n return new Context(rowIndex, column, rowValueKey, subrowIndex);\n }", "public Criteria andDeletedNotEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"deleted <> \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andDeletedLessThanColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"deleted < \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "Dimension_Dimension createDimension_Dimension();", "public TableSlice(Table table) {\n this.name = table.name();\n this.selection = null;\n this.table = table;\n }", "public Criteria andDeletedGreaterThanOrEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"deleted >= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "@Transient\n public SliceKindConfiguration getSliceKindConfiguration( ) {\n return new SliceKindConfiguration(\n getId(),\n getPermission(),\n getSubspace().toString() );\n }", "@Test\n public void testBoundsAsCompositesWithSingleEqAndSliceRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n ByteBuffer value5 = ByteBufferUtil.bytes(5);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) > (2, 3)\n Restriction singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction multiSlice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiSlice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) > (2, 3) AND (clustering_1) < (4)\n singleEq = newSingleEq(cfMetaData, 0, value1);\n multiSlice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3);\n Restriction multiSlice2 = newMultiSlice(cfMetaData, 1, Bound.END, false, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiSlice2).mergeWith(singleEq).mergeWith(multiSlice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value4, EOC.START);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) => (2, 3) AND (clustering_1, clustering_2) <= (4, 5)\n singleEq = newSingleEq(cfMetaData, 0, value1);\n multiSlice = newMultiSlice(cfMetaData, 1, Bound.START, true, value2, value3);\n multiSlice2 = newMultiSlice(cfMetaData, 1, Bound.END, true, value4, value5);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiSlice2).mergeWith(singleEq).mergeWith(multiSlice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value4, value5, EOC.END);\n }", "public GridAxis1D.Builder<?> makeSubsetByIndex(Range subsetRange) {\n int ncoords = subsetRange.length();\n Preconditions.checkArgument(subsetRange.last() < orgGridAxis.getNcoords());\n\n double resolution = 0.0;\n if (orgGridAxis.getSpacing().isRegular()) {\n resolution = subsetRange.stride() * orgGridAxis.getResolution();\n }\n\n GridAxis1D.Builder<?> builder = orgGridAxis.toBuilder();\n builder.subset(ncoords, orgGridAxis.getCoordMidpoint(subsetRange.first()),\n orgGridAxis.getCoordMidpoint(subsetRange.last()), resolution, subsetRange);\n return builder;\n }", "public Criteria andDeletedLessThanOrEqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"deleted <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andIdLessThanOrEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"id <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andIdLessThanOrEqualToColumn(LitemallTypeRole.Column column) {\n addCriterion(new StringBuilder(\"id <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "PivotCol createPivotCol();", "protected Cluster makeWordSubCluster(Cluster cluster, String word) {\n List<Node> l = makeWordSubCluster(cluster.elements, word);\n Cluster c = new Cluster(cluster.startTime, cluster.endTime);\n c.elements = l;\n return c;\n }", "public Criteria andCnameLessThanColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"cname < \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public GroupByBuilder column(String ...column) {\n\t\t\n\t\tCollections.addAll(groupBy.columns, column);\n\t\treturn this;\n\t}", "public Object getObject(int row, int column) {\n\t\treturn getColumn(column).getRow(subset[row]);\n\t}", "public abstract Collection<T> getFirstDimension();", "ColumnFull createColumnFull();", "public Criteria andDeletedLessThanColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"deleted < \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public static SliceInstruction parseSliceInstructions(String file) throws IOException {\n try (FileReader fileReader = new FileReader(file)) {\n BufferedReader br = new BufferedReader(fileReader);\n String[] headerTokens = br.readLine().split(\" \");\n int minNumberOfIngredientPerSlice = Integer.parseInt(headerTokens[2]);\n int maxNumberOfCellsPerSlice = Integer.parseInt(headerTokens[3]);\n return new SliceInstruction(minNumberOfIngredientPerSlice, maxNumberOfCellsPerSlice);\n }\n }", "public Criteria andDeletedGreaterThanColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"deleted > \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "Get<K, C> withColumnLimit(int limit);", "public Criteria andIdLessThanColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"id < \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andCreatePersonLessThanColumn(TCpyBankCredit.Column column) {\n addCriterion(new StringBuilder(\"create_person < \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andDeletedLessThanOrEqualToColumn(YoungSeckillPromotionProductRelation.Column column) {\n addCriterion(new StringBuilder(\"deleted <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public yandex.cloud.api.mdb.clickhouse.v1.ClusterOuterClass.Shard getShard(yandex.cloud.api.mdb.clickhouse.v1.ClusterServiceOuterClass.GetClusterShardRequest request) {\n return io.grpc.stub.ClientCalls.blockingUnaryCall(\n getChannel(), getGetShardMethod(), getCallOptions(), request);\n }", "handy.storage.api.ColumnCondition<DeleteOperation<T>> where(String column);", "public final PythonParser.sliceop_return sliceop() throws RecognitionException {\n PythonParser.sliceop_return retval = new PythonParser.sliceop_return();\n retval.start = input.LT(1);\n\n PythonTree root_0 = null;\n\n Token COLON256=null;\n PythonParser.test_return test257 = null;\n\n\n PythonTree COLON256_tree=null;\n RewriteRuleTokenStream stream_COLON=new RewriteRuleTokenStream(adaptor,\"token COLON\");\n RewriteRuleSubtreeStream stream_test=new RewriteRuleSubtreeStream(adaptor,\"rule test\");\n try {\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1506:5: ( COLON ( test[expr_contextType.Load] -> test | -> ^( COLON[$COLON, \\\"None\\\", expr_contextType.Load] ) ) )\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1506:7: COLON ( test[expr_contextType.Load] -> test | -> ^( COLON[$COLON, \\\"None\\\", expr_contextType.Load] ) )\n {\n COLON256=(Token)match(input,COLON,FOLLOW_COLON_in_sliceop6943); if (state.failed) return retval; \n if ( state.backtracking==0 ) stream_COLON.add(COLON256);\n\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1507:6: ( test[expr_contextType.Load] -> test | -> ^( COLON[$COLON, \\\"None\\\", expr_contextType.Load] ) )\n int alt128=2;\n int LA128_0 = input.LA(1);\n\n if ( (LA128_0==NAME||(LA128_0>=LAMBDA && LA128_0<=NOT)||LA128_0==LPAREN||(LA128_0>=PLUS && LA128_0<=MINUS)||(LA128_0>=TILDE && LA128_0<=LBRACK)||LA128_0==LCURLY||(LA128_0>=BACKQUOTE && LA128_0<=STRING)) ) {\n alt128=1;\n }\n else if ( (LA128_0==COMMA||LA128_0==RBRACK) ) {\n alt128=2;\n }\n else {\n if (state.backtracking>0) {state.failed=true; return retval;}\n NoViableAltException nvae =\n new NoViableAltException(\"\", 128, 0, input);\n\n throw nvae;\n }\n switch (alt128) {\n case 1 :\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1507:7: test[expr_contextType.Load]\n {\n pushFollow(FOLLOW_test_in_sliceop6951);\n test257=test(expr_contextType.Load);\n\n state._fsp--;\n if (state.failed) return retval;\n if ( state.backtracking==0 ) stream_test.add(test257.getTree());\n\n\n // AST REWRITE\n // elements: test\n // token labels: \n // rule labels: retval\n // token list labels: \n // rule list labels: \n // wildcard labels: \n if ( state.backtracking==0 ) {\n retval.tree = root_0;\n RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,\"rule retval\",retval!=null?retval.tree:null);\n\n root_0 = (PythonTree)adaptor.nil();\n // 1508:5: -> test\n {\n adaptor.addChild(root_0, stream_test.nextTree());\n\n }\n\n retval.tree = root_0;}\n }\n break;\n case 2 :\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1510:5: \n {\n\n // AST REWRITE\n // elements: COLON\n // token labels: \n // rule labels: retval\n // token list labels: \n // rule list labels: \n // wildcard labels: \n if ( state.backtracking==0 ) {\n retval.tree = root_0;\n RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,\"rule retval\",retval!=null?retval.tree:null);\n\n root_0 = (PythonTree)adaptor.nil();\n // 1510:5: -> ^( COLON[$COLON, \\\"None\\\", expr_contextType.Load] )\n {\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1510:8: ^( COLON[$COLON, \\\"None\\\", expr_contextType.Load] )\n {\n PythonTree root_1 = (PythonTree)adaptor.nil();\n root_1 = (PythonTree)adaptor.becomeRoot(new Name(COLON, COLON256, \"None\", expr_contextType.Load), root_1);\n\n adaptor.addChild(root_0, root_1);\n }\n\n }\n\n retval.tree = root_0;}\n }\n break;\n\n }\n\n\n }\n\n retval.stop = input.LT(-1);\n\n if ( state.backtracking==0 ) {\n\n retval.tree = (PythonTree)adaptor.rulePostProcessing(root_0);\n adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);\n }\n }\n\n catch (RecognitionException re) {\n errorHandler.reportError(this, re);\n errorHandler.recover(this, input,re);\n retval.tree = (PythonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);\n }\n finally {\n }\n return retval;\n }", "public Criteria andCreatePersonLessThanOrEqualToColumn(TCpyBankCredit.Column column) {\n addCriterion(new StringBuilder(\"create_person <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andIdLessThanColumn(LitemallTypeRole.Column column) {\n addCriterion(new StringBuilder(\"id < \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "protected int index(int slice, int row, int column) {\n\treturn _sliceOffset(_sliceRank(slice)) + _rowOffset(_rowRank(row)) + _columnOffset(_columnRank(column));\n}", "public Criteria andDeletedLessThanColumn(YoungSeckillPromotionProductRelation.Column column) {\n addCriterion(new StringBuilder(\"deleted < \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "@Test\n public void testBoundsAsCompositesWithOneInRestrictionsAndOneClusteringColumn()\n {\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n Restriction in = newSingleIN(cfMetaData, 0, value1, value2, value3);\n\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(in);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.START);\n assertComposite(bounds.get(1), value2, EOC.START);\n assertComposite(bounds.get(2), value3, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(3, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n assertComposite(bounds.get(1), value2, EOC.END);\n assertComposite(bounds.get(2), value3, EOC.END);\n }", "private static Restriction newSingleIN(CFMetaData cfMetaData, int index, ByteBuffer... values)\n {\n ColumnDefinition columnDef = getClusteringColumnDefinition(cfMetaData, index);\n return new SingleColumnRestriction.InWithValues(columnDef, toTerms(values));\n }", "public final void rule__PrimaryExpr2__SliceAssignment_1_2_0() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \t\r\n try {\r\n // InternalGo.g:18110:1: ( ( ruleSlice ) )\r\n // InternalGo.g:18111:2: ( ruleSlice )\r\n {\r\n // InternalGo.g:18111:2: ( ruleSlice )\r\n // InternalGo.g:18112:3: ruleSlice\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getPrimaryExpr2Access().getSliceSliceParserRuleCall_1_2_0_0()); \r\n }\r\n pushFollow(FOLLOW_2);\r\n ruleSlice();\r\n\r\n state._fsp--;\r\n if (state.failed) return ;\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getPrimaryExpr2Access().getSliceSliceParserRuleCall_1_2_0_0()); \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n finally {\r\n\r\n \trestoreStackSize(stackSize);\r\n\r\n }\r\n return ;\r\n }", "public Column getColumn(int column) throws Exception{\n\t\tif(column >= size)\n\t\t\tthrow new Exception(\"Index out of bounds\");\n\n\t\treturn columns[column];\n\t}", "public Criteria andCnameEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"cname = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Criteria andDeletedEqualToColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"deleted = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "GroupByColumnFull createGroupByColumnFull();", "public FilterCriterion createFilter(String column, Object value, FilterCriterion.FilterType type)\n {\n return new FilterCriterion(column, value, type);\n }", "public Criteria andStrLessThanOrEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"str <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "Column createColumn(JavaTypeMapping mapping, String javaType, int datastoreFieldIndex);", "private static Restriction newSingleEq(CFMetaData cfMetaData, int index, ByteBuffer value)\n {\n ColumnDefinition columnDef = getClusteringColumnDefinition(cfMetaData, index);\n return new SingleColumnRestriction.EQ(columnDef, toTerm(value));\n }", "public Column(Column column) {\r\n this.blocks = new ArrayList<Block>(column.getBlocks().size());\r\n for (Block block : column.getBlocks()) {\r\n this.blocks.add(new Block(block));\r\n }\r\n this.entriesSet = column.entriesSet;\r\n this.isGone = column.isGone;\r\n this.index = column.getIndex();\r\n this.maxEntries = column.maxEntries;\r\n }", "public abstract List<V> makeColumnData(C column);", "public Criteria andAttribLessThanOrEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"attrib <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "DataFrameColumn<R,C> col(C colKey);", "public Collection<String> listSlices() throws PermissionDeniedException;", "public VolcanoDragonSkull createDragonSkull(float col, float row) {\n List<Part> parts = new ArrayList<>();\n parts.add(new Part(new SquareVector(0, 0), \"DragonSkull\", true));\n return new VolcanoDragonSkull(col, row, parts);\n }", "public Criteria andCnameGreaterThanOrEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"cname >= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public static FlowMap getSliceFlowSpace(String sliceName) {\n\t\tOFMatch match = new OFMatch();\n\t\tFlowMap ret = new LinearFlowMap();\n\t\tmatch.setWildcards(OFMatch.OFPFW_ALL);\n\t\tFlowMap flowSpace = FVConfig.getFlowSpaceFlowMap();\n\t\tList<FlowIntersect> intersections = flowSpace.intersects(\n\t\t\t\tFlowEntry.ALL_DPIDS, match);\n\t\tfor (FlowIntersect inter : intersections) {\n\t\t\tFlowEntry rule = inter.getFlowEntry();\n\t\t\tFlowEntry neoRule = null;\n\t\t\tneoRule = rule.clone();\n\t\t\tneoRule.setRuleMatch(inter.getMatch());\n\t\t\tneoRule.setActionsList(new ArrayList<OFAction>());\n\t\t\tfor (OFAction action : rule.getActionsList()) {\n\t\t\t\t// the flowspace should only contain SliceActions\n\t\t\t\tSliceAction sliceAction = (SliceAction) action;\n\t\t\t\tif (sliceAction.getSliceName().equals(sliceName)) {\n\t\t\t\t\tneoRule.getActionsList().add(sliceAction.clone());\n\t\t\t\t\tret.addRule(neoRule);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn ret;\n\t}", "@Test\n public void testBoundsAsCompositesWithOneEqRestrictionsAndTwoClusteringColumns()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC);\n\n ByteBuffer clustering_0 = ByteBufferUtil.bytes(1);\n Restriction eq = newSingleEq(cfMetaData, 0, clustering_0);\n\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(eq);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.START);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), clustering_0, EOC.END);\n }", "public static Dissector create(String mapping) {\n Dissector dissector = new Dissector();\n dissector.handleMapping(mapping);\n return dissector;\n }", "public com.google.common.util.concurrent.ListenableFuture<yandex.cloud.api.mdb.clickhouse.v1.ClusterOuterClass.Shard> getShard(\n yandex.cloud.api.mdb.clickhouse.v1.ClusterServiceOuterClass.GetClusterShardRequest request) {\n return io.grpc.stub.ClientCalls.futureUnaryCall(\n getChannel().newCall(getGetShardMethod(), getCallOptions()), request);\n }", "private String getChromosome(String column) {\n if (column.substring(0,3).equals(\"Chr\")) {\n return column.substring(3);\n } else {\n return column;\n }\n }", "public Criteria andComposeLessThanOrEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"compose <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public boolean isSparseColumnSet(int column) throws SQLServerException\n {\n checkClosed();\n \n CryptoMetadata cryptoMetadata = rs.getColumn(column).getCryptoMetadata();\n if(null != cryptoMetadata){\n \treturn cryptoMetadata.getBaseTypeInfo().isSparseColumnSet();\n }\n \n return rs.getColumn(column).getTypeInfo().isSparseColumnSet();\n }", "public DataFrame getSubset(String[] columns) {\n\n // get the indices matching the columns\n int[] c = this.header.getIndices(columns);\n\n Object[][] data = new Object[this.data.rows][c.length];\n Object[] idx = new Object[this.data.rows];\n String[] hdr = new String[c.length];\n\n int rr = 0;\n int cc;\n for (int row = 0; row < this.data.rows; row++) {\n cc = 0;\n for (int col : c) {\n data[rr][cc] = this.data.values[col][row];\n idx[rr] = this.index.values[row];\n hdr[cc] = this.header.values[col];\n cc++;\n }\n rr++;\n }\n\n return new DataFrame(data, hdr, idx, \"SubSet of \" + name);\n }", "Col createCol();", "public Criteria andIdEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"id = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }" ]
[ "0.69209343", "0.5117933", "0.4774896", "0.4752958", "0.45682982", "0.45450532", "0.4505535", "0.44678286", "0.4440431", "0.44337827", "0.44313714", "0.4410987", "0.44020337", "0.43874747", "0.43501768", "0.43461454", "0.43461454", "0.43391493", "0.43349418", "0.43221083", "0.4321995", "0.4293738", "0.42747718", "0.4274244", "0.42503715", "0.4248949", "0.42416647", "0.42407718", "0.42341542", "0.42313468", "0.42207783", "0.4218724", "0.42079967", "0.4206465", "0.42061326", "0.42016315", "0.41996387", "0.4192828", "0.41797727", "0.41796255", "0.41750222", "0.41724443", "0.41629997", "0.41525787", "0.41434085", "0.41389987", "0.41226786", "0.41009393", "0.41008952", "0.40991884", "0.40842035", "0.40656924", "0.40533182", "0.40421495", "0.40400013", "0.40397057", "0.40295145", "0.4029455", "0.40253502", "0.40130544", "0.40121937", "0.40106025", "0.3988113", "0.3984328", "0.39782113", "0.39676407", "0.39582366", "0.39503646", "0.39498433", "0.39436257", "0.39435798", "0.39417228", "0.39386353", "0.39339265", "0.39218256", "0.39195883", "0.39194223", "0.3907751", "0.39072868", "0.3906821", "0.3900475", "0.38999504", "0.3893666", "0.38916498", "0.387822", "0.38729292", "0.3870505", "0.3864002", "0.38619304", "0.3859455", "0.38560995", "0.38541988", "0.38439336", "0.38417158", "0.38410378", "0.38404244", "0.38401163", "0.38292804", "0.38233164", "0.38218167" ]
0.5876637
1
Converts the specified values into a MultiItemTerminal.
private static MultiItemTerminal toMultiItemTerminal(ByteBuffer... values) { return new Tuples.Value(values); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static JCardValue multi(Object... values) {\n\t\treturn multi(Arrays.asList(values));\n\t}", "public static JCardValue multi(List<?> values) {\n\t\tList<JsonValue> multiValues = new ArrayList<>(values.size());\n\t\tfor (Object value : values) {\n\t\t\tmultiValues.add(new JsonValue(value));\n\t\t}\n\t\treturn new JCardValue(multiValues);\n\t}", "private void setItems(ArrayList<NameId> values) {\n\t\tif (values == null || values.isEmpty()) {return;}\n\t\tint row = 0;\n\t\tCollections.sort(values);\n\t\tGrid.RowFormatter fmtRow = field.getRowFormatter();\n\t\tGrid.CellFormatter fmtCell = field.getCellFormatter();\n\t\tfield.resize(values.size(), 3);\n\t\tfmtCell.addStyleName(row, 1, CSS.cbtMultilistFieldNull());\n\t\tfor (NameId value : values) {\n\t\t\tfield.setText(row, 0, value.getName());\n\t\t\tfield.setText(row, 1, value.getId());\n\t\t\tCheckBox cb = new CheckBox();\n\t\t\tcb.addClickHandler(this);\n\t\t\tfield.setWidget(row, 2, cb);\n\t\t\tfmtCell.addStyleName(row, 1, CSS.cbtMultilistFieldNull());\n\t\t\tfmtRow.addStyleName(row++, CSS.cbtMultilistFieldValue());\n\t\t}\n\t}", "public static Map<String,List<CustomItemDto>> createTerminalGroup(List<CustomItemDto> items){\t\t\n\t\tMap<String,List<CustomItemDto>> map=new HashMap<>();\n\n\t\tfor(CustomItemDto item:items){\n\t\t\n\t\t\tif(!map.containsKey(item.getTerminalId())){\t\n\t\t\t\tList<CustomItemDto> c=new ArrayList<>();\n\t\t\t\t\tc.add(item);\n\t\t\t\t\t\tmap.put(item.getTerminalId(),c);\n\t\t\t\t\t}else{\n\t\t\t\n\t\t\t\t\t\tList<CustomItemDto> c = map.get(item.getTerminalId());\n\t\t\t\t\t\t\t\tc.add(item);\n\t\t\t\t}//else\n\t\t\t}\t\n\t\treturn map;\t\n\t}", "public void addValue(String variable, List<String> list_values) {\n\t\tDate date = new Date();\n\t\tDatabaseStore ds = DatabaseStore.DatabaseMultichoiceStore(variable,\n\t\t\t\t\"multichoice\", date);\n\t\tlong pid = addQuestion(ds);\n\t\tfor (int i = 0; i < list_values.size(); i++) {\n\t\t\taddMulti((int) pid, list_values.get(i));\n\t\t}\n\t}", "public Builder addAllItem(\n java.lang.Iterable<? extends java.lang.Integer> values) {\n ensureItemIsMutable();\n com.google.protobuf.AbstractMessageLite.Builder.addAll(\n values, item_);\n onChanged();\n return this;\n }", "public Builder addAllItems(\n java.lang.Iterable<? extends com.rpg.framework.database.Protocol.Item> values) {\n if (itemsBuilder_ == null) {\n ensureItemsIsMutable();\n com.google.protobuf.AbstractMessageLite.Builder.addAll(\n values, items_);\n onChanged();\n } else {\n itemsBuilder_.addAllMessages(values);\n }\n return this;\n }", "public Builder addAllItem(\n java.lang.Iterable<? extends io.opencannabis.schema.commerce.OrderItem.Item> values) {\n if (itemBuilder_ == null) {\n ensureItemIsMutable();\n com.google.protobuf.AbstractMessageLite.Builder.addAll(\n values, item_);\n onChanged();\n } else {\n itemBuilder_.addAllMessages(values);\n }\n return this;\n }", "public MultiString(String[] languages, String[] values)\n {\n // Verify arguments\n if (languages == null || values == null || languages.length == 0 || languages.length != values.length)\n throw new IllegalArgumentException();\n for (int i = 0; i < languages.length; i++)\n if (languages[i] == null || values[i] == null) throw new IllegalArgumentException();\n\n // Save arguments\n this.languages = languages;\n this.values = values;\n\n // Create hashtable\n createHashtable();\n }", "public Builder items(Any... value) {\n object.setItems(value);\n return this;\n }", "public void printReceiptMultipleItems(Product[] products, double basketTotal) {\n byte[] templateBytes = ZPL.MULTI_ITEM_ZPL.getBytes(StandardCharsets.UTF_8);\n\n // Set Variable Data\n HashMap<String, String> variableData = new HashMap<>();\n variableData.put(ZPL.PRICE, \"Prix: \" + getPriceFormatted(basketTotal));\n variableData.put(ZPL.BARCODE, QueueBustingQrCodeGenerator\n .generatorQrCodeStringFromBasket(mBasket));\n\n // Handle First Product\n variableData.put(ZPL.IMAGE_1, products[0].getMultipleIconBase64());\n variableData.put(ZPL.IMAGE_1_QUANTITY, \"x\" + mBasket.get(products[0]));\n\n // Handle 2nd Product (if present)\n if (products.length > 1) {\n variableData.put(ZPL.IMAGE_2, products[1].getMultipleIconBase64());\n variableData.put(ZPL.IMAGE_2_QUANTITY, \"x\" + mBasket.get(products[1]));\n } else {\n variableData.put(ZPL.IMAGE_2_QUANTITY, \"\");\n }\n\n // Handle 3rd Product (if present)\n if (products.length > 2) {\n variableData.put(ZPL.IMAGE_3, products[2].getMultipleIconBase64());\n variableData.put(ZPL.IMAGE_3_QUANTITY, \"x\" + mBasket.get(products[2]));\n } else {\n variableData.put(ZPL.IMAGE_3_QUANTITY, \"\");\n }\n\n // Send Print Job\n PrintHandler.sendPrintJobWithContent(this, templateBytes, variableData,\n printResultReceiver);\n }", "public void writeNextMultivalue(String name, String... values) throws ThingsException;", "public Builder addAllItems(\n java.lang.Iterable<? extends java.lang.Integer> values) {\n ensureItemsIsMutable();\n com.google.protobuf.AbstractMessageLite.Builder.addAll(\n values, items_);\n onChanged();\n return this;\n }", "Multi createMulti();", "public FeedBackMultipleAdapter(List<MultiItemEntity> data) {\n super(data);\n addItemType(TYPE_LEVEL_0, R.layout.feedback_item_0);\n addItemType(TYPE_LEVEL_1, R.layout.feedback_item_1);\n }", "@Override\n\tprotected void reduce(CompKey key, Iterable<Text> values, Reducer<CompKey, Text, Text, NullWritable>.Context context)\n\t\t\tthrows IOException, InterruptedException {\n\n\t\tIterator<Text> it = values.iterator();\n\t\tString cinfo = it.next().toString();\n\t\t\n\t\twhile(it.hasNext()){\n\t\t\tString oinfo = it.next().toString();\n\t\t\tString[] arr = oinfo.split(\"\\t\");\n\t\t\tString ono = arr[1];\n\t\t\tString price = arr[2];\n\t\t\tString info = cinfo + \"\\t\" + ono + \"\\t\" + price;\n\t\t\tSystem.out.println(info);\n\t\t\tcontext.write(new Text(info), NullWritable.get());\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "public void setItem(\r\n @NonNull\r\n final List<SalesOrderItem> value) {\r\n if (toItem == null) {\r\n toItem = Lists.newArrayList();\r\n }\r\n toItem.clear();\r\n toItem.addAll(value);\r\n }", "public Builder addAllMaterials(java.lang.Iterable<java.lang.String> values) {\n ensureMaterialsIsMutable();\n com.google.protobuf.AbstractMessageLite.Builder.addAll(values, materials_);\n bitField0_ |= 0x00000008;\n onChanged();\n return this;\n }", "protected void sequence_Multiplication(ISerializationContext context, Multi semanticObject) {\n\t\tif (errorAcceptor != null) {\n\t\t\tif (transientValues.isValueTransient(semanticObject, DslPackage.Literals.MULTI__LEFT) == ValueTransient.YES)\n\t\t\t\terrorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, DslPackage.Literals.MULTI__LEFT));\n\t\t\tif (transientValues.isValueTransient(semanticObject, DslPackage.Literals.MULTI__RIGHT) == ValueTransient.YES)\n\t\t\t\terrorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, DslPackage.Literals.MULTI__RIGHT));\n\t\t}\n\t\tSequenceFeeder feeder = createSequencerFeeder(context, semanticObject);\n\t\tfeeder.accept(grammarAccess.getMultiplicationAccess().getMultiLeftAction_1_0_0_0(), semanticObject.getLeft());\n\t\tfeeder.accept(grammarAccess.getMultiplicationAccess().getRightPrimaryExpressionParserRuleCall_1_1_0(), semanticObject.getRight());\n\t\tfeeder.finish();\n\t}", "public void setMulti(boolean value) {\n getElement().setMulti(value);\n }", "public SalesOrder.SalesOrderBuilder item(SalesOrderItem... value) {\r\n return toItem(Lists.newArrayList(value));\r\n }", "public MultipleSeriesItem(int series,String xcategory, \r\n\t\t\tdouble y,String seriesname,String label)\r\n\t{\r\n\t\tthis.y =y;\r\n\t\tthis.xcategory=xcategory;\r\n\t\tthis.series=series;\r\n\t\tthis.seriesname=seriesname;\r\n\t\tthis.label=label;\r\n\t\t\r\n\t\t\r\n\t}", "@SafeVarargs\n private static Restriction newMultiIN(CFMetaData cfMetaData, int firstIndex, List<ByteBuffer>... values)\n {\n List<ColumnDefinition> columnDefinitions = new ArrayList<>();\n List<Term> terms = new ArrayList<>();\n for (int i = 0; i < values.length; i++)\n {\n columnDefinitions.add(getClusteringColumnDefinition(cfMetaData, firstIndex + i));\n terms.add(toMultiItemTerminal(values[i].toArray(new ByteBuffer[0])));\n }\n return new MultiColumnRestriction.InWithValues(columnDefinitions, terms);\n }", "public MultipleSeriesItem(int series,String xcategory,String ycategory,\r\n\t\t\tdouble zval,String label,String seriesname)\r\n\t{\r\n\t\tthis.xcategory =xcategory;\r\n\t\tthis.ycategory=ycategory;\r\n\t\tthis.label=label;\r\n\t\tthis.zval=zval;\r\n\t\tthis.series=series;\r\n\t\tthis.seriesname=seriesname;\r\n\t\t\r\n\t}", "public void setItems(Item items) {\n this.items = items;\n }", "public MultiList(int listType){\n this.listType = listType;\n }", "public MultipleSeriesItem(int series,String xcategory, double y,String seriesname,int \r\n\t\t\tseriescolor,String label)\r\n\t{\r\n\t\tthis.y =y;\r\n\t\tthis.xcategory=xcategory;\r\n\t\tthis.series=series;\r\n\t\tthis.color=seriescolor;\r\n\t\tthis.seriesname=seriesname;\r\n\t\tthis.label=label;\r\n\t\t\r\n\t}", "public static JCardValue structured(List<List<?>> values) {\n\t\tList<JsonValue> array = new ArrayList<>(values.size());\n\n\t\tfor (List<?> list : values) {\n\t\t\tif (list.isEmpty()) {\n\t\t\t\tarray.add(new JsonValue(\"\"));\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (list.size() == 1) {\n\t\t\t\tObject value = list.get(0);\n\t\t\t\tif (value == null) {\n\t\t\t\t\tvalue = \"\";\n\t\t\t\t}\n\t\t\t\tarray.add(new JsonValue(value));\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tList<JsonValue> subArray = new ArrayList<>(list.size());\n\t\t\tfor (Object value : list) {\n\t\t\t\tif (value == null) {\n\t\t\t\t\tvalue = \"\";\n\t\t\t\t}\n\t\t\t\tsubArray.add(new JsonValue(value));\n\t\t\t}\n\t\t\tarray.add(new JsonValue(subArray));\n\t\t}\n\n\t\treturn new JCardValue(new JsonValue(array));\n\t}", "public void setItems(Object[] newItems)\n {\n items = new Vector(newItems.length);\n for (int i=0; i < newItems.length; i++)\n {\n items.addElement(newItems[i]);\n }\n }", "public MultipleSeriesItem(int series,String xcategory,String ycategory,\r\n\t\t\tdouble zval,String seriesname)\r\n\t{\r\n\t\tthis.xcategory =xcategory;\r\n\t\tthis.ycategory=ycategory;\r\n\t\tthis.zval=zval;\r\n\t\tthis.series=series;\r\n\t\tthis.seriesname=seriesname;\r\n\t\t\r\n\t}", "void setSelectedItems(ValueType selectedItems);", "public Builder addAllCommand(\n java.lang.Iterable<java.lang.String> values) {\n ensureCommandIsMutable();\n com.google.protobuf.AbstractMessageLite.Builder.addAll(\n values, command_);\n onChanged();\n return this;\n }", "public MultipleSeriesItem(int series,String xcategory, double y, \r\n\t\t\tdouble zval,String label,String seriesname)\r\n\t{\r\n\t\tthis.y =y;\r\n\t\tthis.xcategory=xcategory;\r\n\t\tthis.label=label;\r\n\t\tthis.series=series;\r\n\t\tthis.seriesname=seriesname;\r\n\t\tthis.zval=zval;\r\n\t\t\r\n\t\t\r\n\t}", "@Override\r\n protected void reduce(Text key, Iterable<Text> values, Context context)\r\n throws IOException, InterruptedException {\n for (Text value : values) {\r\n\r\n context.write(key, value);\r\n }\r\n }", "public Future<List<cn.vertxup.psi.domain.tables.pojos.POutTicket>> findManyBySerial(Collection<String> values) {\n return findManyByCondition(POutTicket.P_OUT_TICKET.SERIAL.in(values));\n }", "public MultipleSeriesItem(int series,String xcategory,String ycategory,\r\n\t\t\tdouble zval,String label,String seriesname,int seriescolor)\r\n\t{\r\n\t\tthis.xcategory =xcategory;\r\n\t\tthis.ycategory=ycategory;\r\n\t\tthis.series=series;\r\n\t\tthis.label=label;\r\n\t\tthis.color=seriescolor;\r\n\t\tthis.seriesname=seriesname;\r\n\t\tthis.zval=zval;\r\n\t\t\r\n\t}", "public MultipleSeriesItem(int series,String xcategory, \r\n\t\t\tdouble y, double zval,String seriesname)\r\n\t{\r\n\t\tthis.y =y;\r\n\t\tthis.xcategory=xcategory;\r\n\t\tthis.series=series;\r\n\t\tthis.seriesname=seriesname;\r\n\t\tthis.zval=zval;\r\n\t\t\r\n\t\t\r\n\t}", "public Builder addAllCurrentTrips(\n java.lang.Iterable<java.lang.String> values) {\n ensureCurrentTripsIsMutable();\n com.google.protobuf.AbstractMessageLite.Builder.addAll(\n values, currentTrips_);\n onChanged();\n return this;\n }", "public MultipleSeriesItem(int series,String xcategory, double y,double zval,\r\n\t\t\tString label,String seriesname,int seriescolor)\r\n\t{\r\n\t\tthis.y =y;\r\n\t\tthis.xcategory=xcategory;\r\n\t\tthis.label=label;\r\n\t\tthis.series=series;\r\n\t\tthis.zval=zval;\r\n\t\tthis.color=seriescolor;\r\n\t\tthis.seriesname=seriesname;\r\n\t\t\r\n\t}", "public void setItems(Item[] itemsIn)\n {\n items = itemsIn;\n }", "public void setItems(String items)\n {\n _items = items;\n }", "public MultipleSeriesItem(int series,String xcategory, \r\n\t\t\tdouble y,String seriesname)\r\n\t{\r\n\t\tthis.y =y;\r\n\t\tthis.xcategory=xcategory;\r\n\t\tthis.series=series;\r\n\t\tthis.seriesname=seriesname;\r\n\t\t\r\n\t\t\r\n\t}", "public MultiList(){}", "public interface MultiItemInterface {\n int getItemType();\n int getSpanSize();\n}", "private Item mergeItem(Item newItem, List<Item> items) throws ItemException{\r\n \t\tfor (Item item2 : items) {\r\n \t\t\tif (!item2.isBought() && item2.getName().equals(newItem.getName())) {\r\n\t\t\t\t// sum price\r\n\t\t\t\titem2.setPrice(newItem.getPrice().add(item2.getPrice()));\r\n \t\t\t\tif (newItem.getUnit() == null && item2.getUnit() == null) {\r\n \t\t\t\t\t// Both have no unit --> item has now 2 pieces.\r\n \t\t\t\t\titem2.setQuantity(BigDecimal.valueOf(2), ItemUnit.PIECE);\r\n \t\t\t\t\treturn item2;\r\n \t\t\t\t} else if (newItem.getUnit() == null && item2.getUnit() == ItemUnit.PIECE) {\r\n \t\t\t\t\t// new Item has no unit, existing item has PIECE as unit. add one piece to the existing item.\r\n \t\t\t\t\titem2.setQuantity(item2.getQuantity().add(BigDecimal.ONE), ItemUnit.PIECE);\r\n \t\t\t\t\treturn item2;\r\n \t\t\t\t} else if (newItem.getUnit() != null && newItem.getUnit() == item2.getUnit()) {\r\n \t\t\t\t\t// Both have same unit --> add them together\r\n \t\t\t\t\tBigDecimal newQuantity = newItem.getQuantity().add(item2.getQuantity());\r\n \t\t\t\t\titem2.setQuantity(newQuantity, item2.getUnit());\r\n \t\t\t\t\treturn item2; // we want to save only one item.\r\n \t\t\t\t} else if (ItemUnit.MASSES.contains(newItem.getUnit()) && ItemUnit.MASSES.contains(item2.getUnit())) {\r\n \t\t\t\t\t// Both units are masses. Convert it first to grams and then add them.\r\n \t\t\t\t\tBigDecimal mass1 = newItem.getUnit()==ItemUnit.GRAM ? newItem.getQuantity():newItem.getQuantity().multiply(THOUSAND);\r\n \t\t\t\t\tBigDecimal mass2 = item2.getUnit()==ItemUnit.GRAM ? item2.getQuantity():item2.getQuantity().multiply(THOUSAND);\r\n \t\t\t\t\tBigDecimal finalMass = mass1.add(mass2);\r\n \t\t\t\t\tItemUnit unit = ItemUnit.GRAM;\r\n \t\t\t\t\tif (finalMass.compareTo(THOUSAND) > 0){\r\n \t\t\t\t\t\tfinalMass = finalMass.divide(THOUSAND);\r\n \t\t\t\t\t\tunit = ItemUnit.KILO_GRAM;\r\n \t\t\t\t\t}\r\n \t\t\t\t\titem2.setQuantity(finalMass, unit);\r\n \t\t\t\t\treturn item2;\r\n \t\t\t\t} else {\r\n \t\t\t\t\tthrow new ItemException();\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t}\r\n \t\treturn newItem;\r\n \t}", "default T multiParts(Collection<? extends Part> multiParts) {\n return body(new MultiPartHttpBody(multiParts));\n }", "public void setValues(List<Object> values);", "public List<Terminal> definirConjuntoTerminales(String... terminales) {\n\t\tfor (String s : terminales) {\n\t\t\tTerminal x = new TerminalAritmetico(s);\n\t\t\tconjuntoTerminales.add(x);\n\t\t}\n\t\treturn conjuntoTerminales;\n\t}", "public static double multi() {\n System.out.println(\"Enter multiplier\");\n double a = getNumber();\n System.out.println(\"Enter multiplicand\");\n double b = getNumber();\n\n return a * b;\n }", "public void setItems(List<T> value) {\n getElement().setItems(SerDes.mirror(value).cast());\n }", "public static void runMarioLevelPlayer(String latentVectors, boolean multiVector) throws IOException {\n\t\tSettings.setPythonProgram();\n\t\t// This is used because it contains code for communicating with the GAN\n\t\tString GanPath = \"./pytorch/netG_epoch_5000.pth\";\n\t\tMarioEvalFunction eval = new MarioEvalFunction(GanPath, \"32\", 27, new AStarAgent());\n\t\tLevel level = null;\n\n\t\tSettings.printInfoMsg(\"Passed vector(s): \" + latentVectors);\n\n\t\tif (multiVector) {\n\t\t\tGson gson = new Gson();\n\t\t\tArrayList<List<Double>> inputVectors = new ArrayList();\n\t\t\tinputVectors = gson.fromJson(latentVectors, inputVectors.getClass());\n\n\t\t\tString levels = \"\";\n\t\t\tfor(int i = 0; i < inputVectors.size(); i++) {\n\t\t\t\tString oneVector = inputVectors.get(i).toString();\n\t\t\t\tSystem.out.println(\"ONE VECTOR: \" + oneVector);\n\t\t\t\tlevels += eval.stringToFromGAN(oneVector); // Use the GAN\n\t\t\t\tif(i < inputVectors.size() -1)\n\t\t\t\t\tlevels += ',';\n\t\t\t}\n\t\t\tlevels = \"[\" + levels + \"]\"; // Put back in brackets\n\t\t\tSystem.out.println(levels);\n\t\t\tList<List<List<Integer>>> allLevels = JsonReader.JsonToInt(levels);\n\t\t\t// This list contains several separate levels. The following code\n\t\t\t// merges the levels by appending adjacent rows\n\t\t\tArrayList<List<Integer>> oneLevel = new ArrayList<List<Integer>>();\n\t\t\t// Create the appropriate number of rows in the array\n\t\t\tfor (List<Integer> row : allLevels.get(0)) { // Look at first level (assume all are same size)\n\t\t\t\toneLevel.add(new ArrayList<Integer>()); // Empty row\n\t\t\t}\n\t\t\t// Now fill up the rows, one level at a time\n\t\t\tfor (List<List<Integer>> aLevel : allLevels) {\n\t\t\t\tint index = 0;\n\t\t\t\tfor (List<Integer> row : aLevel) { // Loot at each row\n\t\t\t\t\toneLevel.get(index++).addAll(row);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Now create the Mario level from the combined list representation\n\t\t\tlevel = LevelParser.createLevelJson(oneLevel);\n\t\t} else { // Otherwise, there must be a single latent vector, and thus a single level\n\t\t\tdouble[] latentVector = JsonToDoubleArray(latentVectors);\n\t\t\tlevel = eval.levelFromLatentVector(latentVector);\n\t\t}\n\n\n\t\tMarioProcess marioProcess = new MarioProcess();\n\t\tString[] arguments = new String[0];\n\t\tmarioProcess.launchMario(arguments, new HumanKeyboardAgent()); // true means there is a human player\n\t\tToolsConfigurator.marioComponentFrame.addWindowListener(new WindowAdapter(){\n\t\t\tpublic void windowClosing(WindowEvent e){\n\t\t\t\ttry {\n\t\t\t\t\teval.getGanProcess().commSend(\"0\");\n\t\t\t\t\teval.getMarioProcess().interrupt();\n\t\t\t\t\tToolsConfigurator.marioComponentFrame = null;\n\n\t\t\t\t} catch (IOException ioException) {\n\t\t\t\t\tioException.printStackTrace();\n\t\t\t\t}\n\t\t\t\tif(finishCallBack != null) {\n\t\t\t\t\tfinishCallBack.execute();\n\t\t\t\t\tfinishCallBack = null;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tSystem.out.println(marioProcess.simulateOneLevel(level));\n\t\tif(finishCallBack != null) {\n\t\t\tfinishCallBack.execute();\n\t\t\tfinishCallBack = null;\n\t\t}\n\t\t\n\t\teval.exit();\n\n\t}", "public MultipleSeriesItem(int series,String xcategory,String ycategory,\r\n\t\t\tdouble zval,String seriesname,int seriescolor)\r\n\t{\r\n\t\tthis.xcategory =xcategory;\r\n\t\tthis.ycategory=ycategory;\r\n\t\tthis.series=series;\r\n\t\tthis.zval=zval;\r\n\t\tthis.color=seriescolor;\r\n\t\tthis.seriesname=seriesname;\r\n\t\t\r\n\t}", "public Builder addAllValue(\n java.lang.Iterable<? extends java.lang.Long> values) {\n ensureValueIsMutable();\n com.google.protobuf.AbstractMessageLite.Builder.addAll(\n values, value_);\n onChanged();\n return this;\n }", "private static List<Term> toTerms(ByteBuffer... values)\n {\n List<Term> terms = new ArrayList<>();\n for (ByteBuffer value : values)\n terms.add(toTerm(value));\n return terms;\n }", "public MultipleSeriesItem(int series,String xcategory, double y,double zval,\r\n\t\t\tString seriesname,int seriescolor)\r\n\t{\r\n\t\tthis.y =y;\r\n\t\tthis.xcategory=xcategory;\r\n\t\tthis.series=series;\r\n\t\tthis.zval=zval;\r\n\t\tthis.color=seriescolor;\r\n\t\tthis.seriesname=seriesname;\r\n\t\t\r\n\t}", "public void set(List<Item> items) {\n if (mUseIdDistributor) {\n IdDistributor.checkIds(items);\n }\n\n //first collapse all items\n getFastAdapter().collapse();\n\n //get sizes\n int newItemsCount = items.size();\n int previousItemsCount = mItems.size();\n int itemsBeforeThisAdapter = getFastAdapter().getItemCount(getOrder());\n\n //make sure the new items list is not a reference of the already mItems list\n if (items != mItems) {\n //remove all previous items\n if (!mItems.isEmpty()) {\n mItems.clear();\n }\n\n //add all new items to the list\n mItems.addAll(items);\n }\n\n //map the types\n mapPossibleTypes(items);\n\n //now properly notify the adapter about the changes\n if (newItemsCount > previousItemsCount) {\n if (previousItemsCount > 0) {\n getFastAdapter().notifyAdapterItemRangeChanged(itemsBeforeThisAdapter, previousItemsCount);\n }\n getFastAdapter().notifyAdapterItemRangeInserted(itemsBeforeThisAdapter + previousItemsCount, newItemsCount - previousItemsCount);\n } else if (newItemsCount > 0 && newItemsCount < previousItemsCount) {\n getFastAdapter().notifyAdapterItemRangeChanged(itemsBeforeThisAdapter, newItemsCount);\n getFastAdapter().notifyAdapterItemRangeRemoved(itemsBeforeThisAdapter + newItemsCount, previousItemsCount - newItemsCount);\n } else if (newItemsCount == 0) {\n getFastAdapter().notifyAdapterItemRangeRemoved(itemsBeforeThisAdapter, previousItemsCount);\n } else {\n getFastAdapter().notifyAdapterDataSetChanged();\n }\n }", "public Combinatorics(T[] values) {\n this.values = values;\n this.size = -1;\n this.result = new ArrayList<T>();\n }", "public void setItems(ItemList items) {\r\n this.items = items;\r\n }", "@Override\n public void writeToParcel(Parcel dest, int flags)\n {\n dest.writeTypedList(mItems);\n }", "public Builder addAllOutputs(\n java.lang.Iterable<? extends org.hyperledger.fabric.protos.token.Transaction.PlainOutput> values) {\n if (outputsBuilder_ == null) {\n ensureOutputsIsMutable();\n com.google.protobuf.AbstractMessageLite.Builder.addAll(\n values, outputs_);\n onChanged();\n } else {\n outputsBuilder_.addAllMessages(values);\n }\n return this;\n }", "public Builder addAllOutputs(\n java.lang.Iterable<? extends org.hyperledger.fabric.protos.token.Transaction.PlainOutput> values) {\n if (outputsBuilder_ == null) {\n ensureOutputsIsMutable();\n com.google.protobuf.AbstractMessageLite.Builder.addAll(\n values, outputs_);\n onChanged();\n } else {\n outputsBuilder_.addAllMessages(values);\n }\n return this;\n }", "public Builder addAllOutputs(\n java.lang.Iterable<? extends org.hyperledger.fabric.protos.token.Transaction.PlainOutput> values) {\n if (outputsBuilder_ == null) {\n ensureOutputsIsMutable();\n com.google.protobuf.AbstractMessageLite.Builder.addAll(\n values, outputs_);\n onChanged();\n } else {\n outputsBuilder_.addAllMessages(values);\n }\n return this;\n }", "public Builder addItems(com.rpg.framework.database.Protocol.Item value) {\n if (itemsBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureItemsIsMutable();\n items_.add(value);\n onChanged();\n } else {\n itemsBuilder_.addMessage(value);\n }\n return this;\n }", "public T values(final Iterable<Object> values) {\r\n\t\tfinal List<Object> v = new ArrayList<>();\r\n\t\tfor (final Object o : values)\r\n\t\t\tif (o != null)\r\n\t\t\t\tv.add(o);\r\n\t\treturn values(v.toArray(new Object[0]));\r\n\t}", "default T multiParts(Part... multiParts) {\n return multiParts(Arrays.asList(multiParts));\n }", "static List<SubstantiveParametersParameterItem> createSubstantiveParametersParameterItem(List<String> collectionOfItems) {\n List<SubstantiveParametersParameterItem> substantiveParametersParameterItemList = new ArrayList<>();\n for (String item: collectionOfItems) {\n substantiveParametersParameterItemList.add(new SubstantiveParametersParameterItem(item));\n }\n return substantiveParametersParameterItemList;\n }", "private void setValues(ComboBox cb, Object[] values) {\n cb.getItems().clear();\n List<String> list = new ArrayList<>();\n\n for (Object value : values) {\n list.add(value.toString());\n }\n\n cb.getItems().addAll(values);\n cb.getSelectionModel().select(0);\n\n }", "public MultipleSeriesItem(int series,double x,String ycategory\r\n\t\t\t\t,String seriesname,String label)\r\n\t\t{\r\n\t\t\tthis.x =x;\r\n\t\t\tthis.ycategory=ycategory;\r\n\t\t\tthis.series=series;\r\n\t\t\tthis.seriesname=seriesname;\r\n\t\t\tthis.label=label;\r\n\t\t\t\r\n\t\t}", "@Incoming(\"multiplyVariants\")\n @Outgoing(\"wrapSseEvent\")\n public ProcessorBuilder<String, String> multiply() {\n // Multiply to 3 variants of same message\n return ReactiveStreams.<String>builder()\n .flatMap(o ->\n ReactiveStreams.of(\n // upper case variant\n o.toUpperCase(),\n // repeat twice variant\n o.repeat(2),\n // reverse chars 'tnairav'\n new StringBuilder(o).reverse().toString())\n );\n }", "@Override\r\n\tpublic void writeToParcel(Parcel out, int flags) {\n\t\tout.writeTypedList(items);\r\n\t}", "protected ObservableList<TreeItem> createTreeItems(ObservableList other) {\r\n ObservableList items = FXCollections.observableArrayList();\r\n other.stream().forEach(value -> items.add(createItem(value)));\r\n return items;\r\n }", "private MultiSellListContainer generateMultiSell(int listId, boolean inventoryOnly, PlayerInstance player, double taxRate)\n\t{\n\t\tfinal MultiSellListContainer listTemplate = getInstance().getList(listId);\n\t\tMultiSellListContainer list = new MultiSellListContainer();\n\t\tif (listTemplate == null)\n\t\t{\n\t\t\treturn list;\n\t\t}\n\t\t\n\t\tlist = new MultiSellListContainer();\n\t\tlist.setListId(listId);\n\t\t\n\t\tif (inventoryOnly)\n\t\t{\n\t\t\tif (player == null)\n\t\t\t{\n\t\t\t\treturn list;\n\t\t\t}\n\t\t\t\n\t\t\tItemInstance[] items;\n\t\t\tif (listTemplate.getMaintainEnchantment())\n\t\t\t{\n\t\t\t\titems = player.getInventory().getUniqueItemsByEnchantLevel(false, false, false, true);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\titems = player.getInventory().getUniqueItems(false, false, false, true);\n\t\t\t}\n\t\t\t\n\t\t\tint enchantLevel;\n\t\t\tfor (ItemInstance item : items)\n\t\t\t{\n\t\t\t\t// Only do the matchup on equipable items that are not currently equipped so for each appropriate item, produce a set of entries for the multisell list.\n\t\t\t\tif (!item.isWear() && ((item.getItem() instanceof Armor) || (item.getItem() instanceof Weapon)))\n\t\t\t\t{\n\t\t\t\t\tenchantLevel = listTemplate.getMaintainEnchantment() ? item.getEnchantLevel() : 0;\n\t\t\t\t\t// loop through the entries to see which ones we wish to include\n\t\t\t\t\tfor (MultiSellEntry ent : listTemplate.getEntries())\n\t\t\t\t\t{\n\t\t\t\t\t\tboolean doInclude = false;\n\t\t\t\t\t\t\n\t\t\t\t\t\t// check ingredients of this entry to see if it's an entry we'd like to include.\n\t\t\t\t\t\tfor (MultiSellIngredient ing : ent.getIngredients())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (item.getItemId() == ing.getItemId())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdoInclude = true;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// manipulate the ingredients of the template entry for this particular instance shown\n\t\t\t\t\t\t// i.e: Assign enchant levels and/or apply taxes as needed.\n\t\t\t\t\t\tif (doInclude)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlist.addEntry(prepareEntry(ent, listTemplate.getApplyTaxes(), listTemplate.getMaintainEnchantment(), enchantLevel, taxRate));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse // this is a list-all type\n\t\t{\n\t\t\t// if no taxes are applied, no modifications are needed\n\t\t\tfor (MultiSellEntry ent : listTemplate.getEntries())\n\t\t\t{\n\t\t\t\tlist.addEntry(prepareEntry(ent, listTemplate.getApplyTaxes(), false, 0, taxRate));\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn list;\n\t}", "public MultipleSeriesItem(int series,double x,String ycategory,\r\n\t\t\t\tdouble zval,String label,String seriesname)\r\n\t\t{\r\n\t\t\tthis.x =x;\r\n\t\t\tthis.ycategory=ycategory;\r\n\t\t\tthis.label=label;\r\n\t\t\tthis.zval=zval;\r\n\t\t\tthis.series=series;\r\n\t\t\tthis.seriesname=seriesname;\r\n\t\t\t\r\n\t\t}", "public MenuBox(MenuItem...items){\n\n //getChildren().add(createSeparator(210));\n\n for (MenuItem item : items){\n getChildren().addAll(item, createSeparator(210));\n }\n\n }", "public void convert(BaseViewHolder helper, MultiItemEntity item) {\n updateRideData(helper, (HistoryRideTraningItem) item);\n }", "public MultipleSeriesItem(int series,double x,String ycategory,double zval\r\n\t\t\t\t,String label,String seriesname,int seriescolor)\r\n\t\t{\r\n\t\t\tthis.x =x;\r\n\t\t\tthis.ycategory=ycategory;\r\n\t\t\tthis.zval=zval;\r\n\t\t\tthis.label=label;\r\n\t\t\tthis.series=series;\r\n\t\t\tthis.color=seriescolor;\r\n\t\t\tthis.seriesname=seriesname;\r\n\t\t\t\r\n\t\t}", "public void setRoomItems(ArrayList<Item> newRoomItems) {\n roomItems = newRoomItems;\n }", "public Builder addAllDeleteUserMonsterUuids(\n java.lang.Iterable<java.lang.String> values) {\n ensureDeleteUserMonsterUuidsIsMutable();\n com.google.protobuf.AbstractMessageLite.Builder.addAll(\n values, deleteUserMonsterUuids_);\n onChanged();\n return this;\n }", "public MultipleSeriesItem(int series,String xcategory, double y,String seriesname,int \r\n\t\t\tseriescolor)\r\n\t{\r\n\t\tthis.y =y;\r\n\t\tthis.xcategory=xcategory;\r\n\t\tthis.series=series;\r\n\t\tthis.color=seriescolor;\r\n\t\tthis.seriesname=seriesname;\r\n\t\t\r\n\t}", "public MultipleSeriesItem(int series,double x, double y, double zval,String label,\r\n\t\t\tString seriesname)\r\n\t{\r\n\t\tthis.y =y;\r\n\t\tthis.x=x;\r\n\t\tthis.label=label;\r\n\t\tthis.series=series;\r\n\t\tthis.seriesname=seriesname;\r\n\t\tthis.zval=zval;\r\n\t\t\r\n\t\t\r\n\t}", "public Builder addAllReault(\n java.lang.Iterable<? extends com.lesen.rpc.protobuf.LesenRPCProto.LesenRPCResult> values) {\n if (reaultBuilder_ == null) {\n ensureReaultIsMutable();\n super.addAll(values, reault_);\n onChanged();\n } else {\n reaultBuilder_.addAllMessages(values);\n }\n return this;\n }", "private void setItems(DataRelationModelDto dto, List<DataRelationModelItemDto> itemDtos) {\n\t\tList<String> dpdNameList = new ArrayList<>();\n\t\tList<String> targetDpdNameList = new ArrayList<>();\n\t\tfor (DataRelationModelItemDto itemDto : itemDtos) {\n\t\t\tdpdNameList.add(itemDto.getDpd().getDpdName());\n\t\t\ttargetDpdNameList.add(itemDto.getTargetDpd().getDpdName());\n\t\t}\n\t\tdto.setDpdNameList(dpdNameList);\n\t\tdto.setTargetDpdNameList(targetDpdNameList);\n\t}", "public Builder addAllGrammarMatch(\n java.lang.Iterable<? extends speech.multilang.Params.MultiRecognizerGrammarMatchList.MultiRecognizerGrammarMatch> values) {\n if (grammarMatchBuilder_ == null) {\n ensureGrammarMatchIsMutable();\n com.google.protobuf.AbstractMessageLite.Builder.addAll(\n values, grammarMatch_);\n onChanged();\n } else {\n grammarMatchBuilder_.addAllMessages(values);\n }\n return this;\n }", "public ChoiceDialog setMultiChoiceItems(@NonNull CharSequence[] items,\n @NonNull boolean[] checkedItems) {\n mItems = items;\n mCheckedItems = checkedItems;\n mIsSingleChoice = false;\n return this;\n }", "public MultipleSeriesItem(int series,double x,String ycategory,\r\n\t\t\t\tString seriesname,int seriescolor,String label)\r\n\t\t{\r\n\t\t\tthis.x =x;\r\n\t\t\tthis.ycategory=ycategory;\r\n\t\t\tthis.series=series;\r\n\t\t\tthis.color=seriescolor;\r\n\t\t\tthis.seriesname=seriesname;\r\n\t\t\tthis.label=label;\r\n\t\t\t\r\n\t\t\t\r\n\t\t}", "public MultipleSeriesItem(int series,double x, double y,double zval\r\n\t\t\t,String label,String seriesname,int seriescolor)\r\n\t{\r\n\t\tthis.y =y;\r\n\t\tthis.x=x;\r\n\t\tthis.label=label;\r\n\t\tthis.series=series;\r\n\t\tthis.zval=zval;\r\n\t\tthis.color=seriescolor;\r\n\t\tthis.seriesname=seriesname;\r\n\t\t\r\n\t}", "public static String serialize( List<String> selectedValues )\n {\n return serialize( selectedValues, DEFAULT_DELIMITER );\n }", "public void setItems(ObservableList<T> value) {\n\n this.getWrappedControl().setItems(value);\n }", "public ArrayList<Item> createItemList() {\n return itemLines\n .stream()\n .map(this::writeLineItemNumber)\n .map(this::createItem)\n .collect(Collectors.toCollection(ArrayList::new));\n }", "public Future<List<cn.vertxup.psi.domain.tables.pojos.POutTicket>> findManyByType(Collection<String> values) {\n return findManyByCondition(POutTicket.P_OUT_TICKET.TYPE.in(values));\n }", "public Builder addAllDonatori(\n java.lang.Iterable<? extends teledon.network.protobuffprotocol.TeledonProtobufs.Donator> values) {\n if (donatoriBuilder_ == null) {\n ensureDonatoriIsMutable();\n com.google.protobuf.AbstractMessageLite.Builder.addAll(\n values, donatori_);\n onChanged();\n } else {\n donatoriBuilder_.addAllMessages(values);\n }\n return this;\n }", "public Builder addAllVdus(Iterable<? extends VDU> values) {\n if (vdusBuilder_ == null) {\n ensureVdusIsMutable();\n com.google.protobuf.AbstractMessageLite.Builder.addAll(values, vdus_);\n onChanged();\n } else {\n vdusBuilder_.addAllMessages(values);\n }\n return this;\n }", "Items(int quantidade,Produto produto){\n\t\tqntd = quantidade;\n\t\tthis.produto = produto;\n\t\t\n\t}", "private static ArrayList<HistoryValue> convertToRPN(List<HistoryValue> historyValues) {\n ArrayList<HistoryValue> outputList = new ArrayList<>();\n ArrayList<OperatorValue> operatorList = new ArrayList<>();\n for (HistoryValue token : historyValues) {\n handleNumber(outputList, token);\n handleLeftParenthesis(operatorList, token);\n handleRightParenthesis(outputList, operatorList, token);\n handleOperator(outputList, operatorList, token);\n }\n putOperatorsOntoOutput(outputList, operatorList);\n return outputList;\n }", "public MenuBox(ArrayList<MenuItem> items) {\n getChildren().add(createSeparator(270));\n\n for(MenuItem item : items) {\n getChildren().addAll(item, createSeparator(270));\n }\n }", "public Builder setGrammarList(speech.multilang.Params.MultiRecognizerGrammarMatchList value) {\n if (grammarListBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n grammarList_ = value;\n onChanged();\n } else {\n grammarListBuilder_.setMessage(value);\n }\n bitField0_ |= 0x00000002;\n return this;\n }", "public static void writeLine(Writer w, List<String> values) throws IOException {\n\n boolean first = true;\n\n StringBuilder sb = new StringBuilder();\n for (String value : values) {\n if (!first) {\n sb.append(DEFAULT_SEPARATOR);\n }\n sb.append(format(value));\n first = false;\n }\n sb.append(\"\\n\");\n w.append(sb.toString());\n }", "private MetricValues metricValues(Set<MachineMetric> customSet,\n List<MachineMetric> defaults, List<Long> values) {\n List<MachineMetric> actualMetrics = defaults;\n List<Long> actualValues = values;\n if (customSet.size() > 0) {\n // custom set of machine metrics specified\n actualMetrics = new ArrayList<MachineMetric>();\n actualValues = new ArrayList<Long>();\n for (int i=0; i < defaults.size(); i++) {\n MachineMetric mm = defaults.get(i);\n if (customSet.contains(mm)) {\n actualMetrics.add(mm);\n actualValues.add(values.get(i));\n }\n }\n }\n return new MetricValues(actualMetrics, actualValues);\n }", "public Builder addAllMsg(\n Iterable<? extends Msg> values) {\n copyOnWrite();\n instance.addAllMsg(values);\n return this;\n }", "public Builder addAllMsg(\n Iterable<? extends Msg> values) {\n copyOnWrite();\n instance.addAllMsg(values);\n return this;\n }" ]
[ "0.6340076", "0.578717", "0.53648996", "0.52695507", "0.5126586", "0.5000349", "0.4939093", "0.49256456", "0.4859522", "0.47904187", "0.47754535", "0.4727186", "0.4706703", "0.4642687", "0.45858565", "0.45648736", "0.4448481", "0.44271037", "0.44161648", "0.44107828", "0.4407415", "0.4397958", "0.43878862", "0.43771216", "0.43750182", "0.43724954", "0.43603036", "0.43578225", "0.43497092", "0.4348743", "0.4344172", "0.43362656", "0.43348524", "0.433074", "0.43271312", "0.42857972", "0.4280631", "0.42772132", "0.42769524", "0.42679924", "0.4265516", "0.42599174", "0.4258409", "0.42565462", "0.42559856", "0.4254222", "0.42496032", "0.42428002", "0.42412528", "0.42349485", "0.42290205", "0.42282462", "0.42251372", "0.4220721", "0.42138624", "0.42127413", "0.42106286", "0.4207986", "0.4207228", "0.4206044", "0.4206044", "0.4206044", "0.42011213", "0.41990307", "0.41975272", "0.4194836", "0.4194784", "0.41907248", "0.41866028", "0.41843444", "0.41797808", "0.41793966", "0.41769662", "0.41747743", "0.41711032", "0.4166655", "0.41588148", "0.41539565", "0.41528374", "0.41499934", "0.41393527", "0.41333765", "0.41333285", "0.41281334", "0.41241497", "0.41208106", "0.4115428", "0.41133767", "0.4113011", "0.41033536", "0.41014057", "0.41013008", "0.4099704", "0.4099172", "0.4092131", "0.40880454", "0.40865073", "0.40805486", "0.40754983", "0.40754983" ]
0.7567837
0
Converts the specified value into a term.
private static Term toTerm(ByteBuffer value) { return new Constants.Value(value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Value.Builder setTerm(java.lang.Integer value) {\n validate(fields()[14], value);\n this.term = value;\n fieldSetFlags()[14] = true;\n return this;\n }", "public void setTerm(java.lang.Integer value) {\n this.term = value;\n }", "@Test public void term_value_01() {\n RDF_Term rt = testTermValue(\"123\") ;\n assertEquals(rt.getTermCase(), TermCase.VALINTEGER);\n assertEquals(123, rt.getValInteger()) ;\n }", "SingleTerm(Term t)\n {\n term = t;\n }", "public void setTerm(String value) {\r\n setAttributeInternal(TERM, value);\r\n }", "@Override\n public Query forValue(String value) {\n if (value == null) return null;\n for (TermQuery t : this._queries) {\n if (value.equals(t.getTerm().text())) return t;\n }\n // Why null?\n return new TermQuery(new Term(this._name, value));\n }", "Term getTerm();", "@Test public void term_value_roundtriple_1() {\n RDF_Term rt = testTermValue(\"'123'^^xsd:integer\") ;\n assertEquals(123, rt.getValInteger()) ;\n Node n = ProtobufConvert.convert(rt, prefixMap);\n assertEquals(XSDDatatype.XSDinteger, n.getLiteralDatatype());\n assertEquals(\"123\", n.getLiteralLexicalForm());\n }", "public String getTerm() {\n return term;\n }", "protected Float additionalTransformation(String term, Float value){\n\t\tif(!ENABLE_ADD_NORMALIZATION) return value;\n\t\t\n\t\tFloat result = value;\n\t\t//result *= this.weightTermUniqeness(term); \n\t\tresult = this.sigmoidSmoothing(result);\n\t\t\n\t\treturn result;\n\t}", "private RDF_Term testTerm(Node node, PrefixMap pmap, boolean asValue) {\n RDF_Term rt = ProtobufConvert.convert(node, pmap, asValue) ;\n\n if ( node == null) {\n assertTrue(rt.hasUndefined());\n return rt;\n }\n\n switch (rt.getTermCase()) {\n// message RDF_Term {\n// oneof term {\n// RDF_IRI iri = 1 ;\n// RDF_BNode bnode = 2 ;\n// RDF_Literal literal = 3 ;\n// RDF_PrefixName prefixName = 4 ;\n// RDF_VAR variable = 5 ;\n// RDF_Triple tripleTerm = 6 ;\n// RDF_ANY any = 7 ;\n// RDF_UNDEF undefined = 8 ;\n// RDF_REPEAT repeat = 9 ;\n//\n// // Value forms of literals.\n// int64 valInteger = 20 ;\n// double valDouble = 21 ;\n// RDF_Decimal valDecimal = 22 ;\n// }\n// }\n case IRI : {\n RDF_IRI iri = rt.getIri() ;\n assertEquals(node.getURI(), iri.getIri()) ;\n break;\n }\n case BNODE : {\n RDF_BNode bnode = rt.getBnode() ;\n assertEquals(node.getBlankNodeLabel(), bnode.getLabel()) ;\n break;\n }\n case LITERAL : {\n RDF_Literal lit = rt.getLiteral() ;\n assertEquals(node.getLiteralLexicalForm(), lit.getLex()) ;\n\n if (JenaRuntime.isRDF11) {\n // RDF 1.1\n if ( Util.isSimpleString(node) ) {\n assertTrue(lit.getSimple());\n // Protobug default is \"\"\n assertNullPB(lit.getDatatype()) ;\n assertEquals(RDF_PrefixName.getDefaultInstance(), lit.getDtPrefix());\n assertNullPB(lit.getLangtag()) ;\n } else if ( Util.isLangString(node) ) {\n assertFalse(lit.getSimple());\n assertNullPB(lit.getDatatype()) ;\n assertEquals(RDF_PrefixName.getDefaultInstance(), lit.getDtPrefix());\n assertNotSame(\"\", lit.getLangtag()) ;\n }\n else {\n assertFalse(lit.getSimple());\n // Regular typed literal.\n assertTrue(lit.getDatatype() != null || lit.getDtPrefix() != null );\n assertNullPB(lit.getLangtag()) ;\n }\n } else {\n // RDF 1.0\n if ( node.getLiteralDatatype() == null ) {\n if ( Util.isLangString(node ) ) {\n assertFalse(lit.getSimple());\n assertNullPB(lit.getDatatype()) ;\n assertNull(lit.getDtPrefix()) ;\n assertNotSame(\"\", lit.getLangtag()) ;\n } else {\n assertTrue(lit.getSimple());\n assertNullPB(lit.getDatatype()) ;\n assertEquals(RDF_PrefixName.getDefaultInstance(), lit.getDtPrefix());\n assertNullPB(lit.getLangtag()) ;\n }\n } else {\n assertTrue(lit.getDatatype() != null || lit.getDtPrefix() != null );\n }\n }\n break;\n }\n case PREFIXNAME : {\n assertNotNull(rt.getPrefixName().getPrefix()) ;\n assertNotNull(rt.getPrefixName().getLocalName()) ;\n String x = pmap.expand(rt.getPrefixName().getPrefix(), rt.getPrefixName().getLocalName());\n assertEquals(node.getURI(),x);\n break;\n }\n case VARIABLE :\n assertEquals(node.getName(), rt.getVariable().getName());\n break;\n case TRIPLETERM : {\n RDF_Triple encTriple = rt.getTripleTerm();\n Triple t = node.getTriple();\n RDF_Term rt_s = testTerm(t.getSubject(), pmap, asValue);\n RDF_Term rt_p = testTerm(t.getPredicate(), pmap, asValue);\n RDF_Term rt_o = testTerm(t.getObject(), pmap, asValue);\n assertEquals(encTriple.getS(), rt_s);\n assertEquals(encTriple.getP(), rt_p);\n assertEquals(encTriple.getO(), rt_o);\n break;\n }\n case ANY :\n assertEquals(Node.ANY, node);\n case REPEAT :\n break;\n case UNDEFINED :\n assertNull(node);\n return rt;\n case VALINTEGER : {\n long x = rt.getValInteger();\n assertTrue(integerSubTypes.contains(node.getLiteralDatatype()));\n //assertEquals(node.getLiteralDatatype(), XSDDatatype.XSDinteger);\n long x2 = Long.parseLong(node.getLiteralLexicalForm());\n assertEquals(x,x2);\n break;\n }\n case VALDOUBLE : {\n double x = rt.getValDouble();\n assertEquals(node.getLiteralDatatype(), XSDDatatype.XSDdouble);\n double x2 = Double.parseDouble(node.getLiteralLexicalForm());\n assertEquals(x, x2, 0.01);\n break;\n }\n case VALDECIMAL : {\n assertEquals(node.getLiteralDatatype(), XSDDatatype.XSDdecimal);\n NodeValue nv = NodeValue.makeNode(node);\n assertTrue(nv.isDecimal());\n\n long value = rt.getValDecimal().getValue() ;\n int scale = rt.getValDecimal().getScale() ;\n BigDecimal d = BigDecimal.valueOf(value, scale) ;\n assertEquals(nv.getDecimal(), d);\n break;\n }\n case TERM_NOT_SET :\n break;\n }\n\n // And reverse\n if ( ! asValue ) {\n // Value based does not preserve exact datatype or lexical form.\n Node n2 = ProtobufConvert.convert(rt, pmap);\n assertEquals(node, n2) ;\n }\n\n return rt;\n }", "public T caseTerm(Term object)\n {\n return null;\n }", "protected Object valueTranslator(Object value){\n\t\treturn value;\n\t}", "public String getTerm(){\n return this.term;\n }", "public Element compileTerm() {\n\t\tElement ele = null;\n\t\tString token, tokenType;\n\t\tString varName;\n\n\t\tElement termParent = document.createElement(\"term\");\n\n\t\ttoken = jTokenizer.returnTokenVal();\n\t\ttokenType = jTokenizer.tokenType();\n\n\t\t// Case 1: ( expression )\n\n\t\tif (token.equals(\"(\")) {\n\t\t\t// (\n\t\t\tele = createXMLnode(tokenType);\n\t\t\ttermParent.appendChild(ele);\n\n\t\t\t// exp\n\t\t\tjTokenizer.advance();\n\t\t\ttermParent.appendChild(compileExpression());\n\n\t\t\t// )\n\t\t\tjTokenizer.advance();\n\t\t\ttokenType = jTokenizer.tokenType();\n\t\t\tele = createXMLnode(tokenType);\n\t\t\ttermParent.appendChild(ele);\n\n\t\t}\n\n\t\t// Case 2: unaryOp term\n\t\telse if (token.matches(\"\\\\-|~\")) {\n\n\t\t\t// unary op\n\t\t\ttokenType = jTokenizer.tokenType();\n\t\t\tString op = jTokenizer.returnTokenVal();\n\t\t\tele = createXMLnode(tokenType);\n\t\t\ttermParent.appendChild(ele);\n\t\t\t\n\t\t\t\n\t\t\t//Since it is postfix, the term comes first\n\t\t\t\n\t\t\t// term\n\t\t\tjTokenizer.advance();\n\t\t\ttermParent.appendChild(compileTerm());\n\n\t\t\t// appending the op\n\t\t\tif (op.equals(\"~\")) {\n\t\t\t\twriter.writeArithmetic(\"not\");\n\t\t\t} else {\n\t\t\t\twriter.writeArithmetic(\"neg\");\n\t\t\t}\n\n\t\t}\n\t\t\n\t\t// Any constant or keyword\n\t\telse if (tokenType.matches(\"keyword|integerConstant|stringConstant\")) {\n\t\t\tele = createXMLnode(tokenType);\n\t\t\ttermParent.appendChild(ele);\n\t\t\t\n\t\t\t//pushing an integer constant\n\t\t\tif (tokenType.equals(\"integerConstant\")) {\n\t\t\t\twriter.writePush(\"constant\", Integer.parseInt(token));\t\n\t\t\t}\n\t\t\t//For string, have to iterate along the length of the string and call string.append\n\t\t\telse if (tokenType.equals(\"stringConstant\")) {\n\t\t\t\twriter.writePush(\"constant\", token.length());\n\t\t\t\twriter.writeCall(\"String.new\", 1);\n\n\t\t\t\tfor (int i = 0; i < token.length(); i++) {\n\t\t\t\t\twriter.writePush(\"constant\", (int) token.charAt(i));\n\t\t\t\t\twriter.writeCall(\"String.appendChar\", 2);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} \n\t\t\t//Pushing the keyword onto the stack, depending on what it is\n\t\t\telse if (tokenType.equals(\"keyword\")) {\n\t\t\t\tif (token.equals(\"true\")) {\n\t\t\t\t\twriter.writePush(\"constant\", 0);\n\t\t\t\t\twriter.writeArithmetic(\"not\");\n\t\t\t\t} else if (token.equals(\"this\")) {\n\t\t\t\t\twriter.writePush(\"pointer\", 0);\n\t\t\t\t} else if (token.equals(\"false\") || token.equals(\"null\")) {\n\t\t\t\t\twriter.writePush(\"constant\", 0);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Variable, Variable[expression] or subroutineCall\n\t\telse if (tokenType.equals(\"identifier\")) {\n\t\t\tele = createXMLnode(tokenType);\n\t\t\ttermParent.appendChild(ele);\n\t\t\tvarName = jTokenizer.returnTokenVal();\n\t\t\tjackTokenizer clone = new jackTokenizer(jTokenizer);\n\t\t\tclone.advance();\n\t\t\ttoken = clone.returnTokenVal();\n\n\t\t\t// Case 1: Array dereferencing\n\t\t\tif (token.equals(\"[\")) {\n\t\t\t\tjTokenizer.advance();\n\t\t\t\ttokenType = jTokenizer.tokenType();\n\t\t\t\tele = createXMLnode(tokenType);\n\t\t\t\ttermParent.appendChild(ele);\n\n\t\t\t\t// push base id\n\t\t\t\twriter.writePush(symTable.lookup(varName).kind, symTable.lookup(varName).index);\n\n\t\t\t\t// Exp\n\t\t\t\tjTokenizer.advance();\n\t\t\t\ttermParent.appendChild(compileExpression());\n\n\t\t\t\t// ]\n\t\t\t\tjTokenizer.advance();\n\t\t\t\ttokenType = jTokenizer.tokenType();\n\t\t\t\tele = createXMLnode(tokenType);\n\t\t\t\ttermParent.appendChild(ele);\n\n\t\t\t\t// base + offset\n\t\t\t\twriter.writeArithmetic(\"add\");\n\n\t\t\t\t// pop into that\n\t\t\t\twriter.writePop(\"pointer\", 1);\n\t\t\t\t// push value into stack\n\t\t\t\twriter.writePush(\"that\", 0);\n\t\t\t}\n\n\t\t\t// Case 2: variable/class.subroutine call\n\t\t\telse if (token.equals(\".\")) {\n\n\t\t\t\tboolean method = false;\n\n\t\t\t\t// .\n\t\t\t\tjTokenizer.advance();\n\t\t\t\ttokenType = jTokenizer.tokenType();\n\t\t\t\tele = createXMLnode(tokenType);\n\t\t\t\ttermParent.appendChild(ele);\n\n\t\t\t\t// subroutine name\n\t\t\t\tjTokenizer.advance();\n\t\t\t\ttokenType = jTokenizer.tokenType();\n\t\t\t\tString subName = jTokenizer.returnTokenVal();\n\t\t\t\tele = createXMLnode(tokenType);\n\t\t\t\ttermParent.appendChild(ele);\n\n\t\t\t\t// (\n\t\t\t\tjTokenizer.advance();\n\t\t\t\ttokenType = jTokenizer.tokenType();\n\t\t\t\tele = createXMLnode(tokenType);\n\t\t\t\ttermParent.appendChild(ele);\n\n\t\t\t\tString firstName = varName;\n\t\t\t\t//Similar to the compileDo method, have to distinguish between\n\t\t\t\t//method and function\n\t\t\t\tif (symTable.lookup(firstName) != null) {\n\t\t\t\t\tmethod = true;\n\t\t\t\t\twriter.writePush(symTable.lookup(firstName).kind, symTable.lookup(firstName).index);\n\t\t\t\t\tvarName = symTable.lookup(firstName).type;\n\t\t\t\t}\n\t\t\t\t// expressionList\n\t\t\t\tjTokenizer.advance();\n\t\t\t\tElement compileExpression = compileExpressionList();\n\t\t\t\tint nArgs = compileExpression.getChildNodes().getLength();\n\t\t\t\ttermParent.appendChild(compileExpression);\n\n\t\t\t\t// Checking if method or function\n\t\t\t\tif (method) {\n\t\t\t\t\tnArgs++;\n\t\t\t\t}\n\t\t\t\twriter.writeCall(varName + \".\" + subName, nArgs);\n\n\t\t\t\t// )\n\t\t\t\ttokenType = jTokenizer.tokenType();\n\t\t\t\tele = createXMLnode(tokenType);\n\t\t\t\ttermParent.appendChild(ele);\n\t\t\t}\n\n\t\t\t// Case 3: function call\n\t\t\telse if (token.equals(\"(\")) {\n\t\t\t\t// (\n\t\t\t\tjTokenizer.advance();\n\t\t\t\ttokenType = jTokenizer.tokenType();\n\t\t\t\tele = createXMLnode(tokenType);\n\t\t\t\ttermParent.appendChild(ele);\n\n\t\t\t\t// expression list\n\t\t\t\tjTokenizer.advance();\n\t\t\t\tElement node = compileExpressionList();\n\t\t\t\tint nArgs = node.getChildNodes().getLength();\n\t\t\t\ttermParent.appendChild(node);\n\n\t\t\t\t// )\n\t\t\t\ttokenType = jTokenizer.tokenType();\n\t\t\t\tele = createXMLnode(tokenType);\n\t\t\t\ttermParent.appendChild(ele);\n\n\t\t\t\t// Writing the VML for a method call\n\t\t\t\twriter.writePush(\"pointer\", 0);\n\t\t\t\twriter.writeCall(className + \".\" + varName, ++nArgs);\n\t\t\t}\n\t\t\t// Case 4: Variable name.\n\t\t\telse {\n\t\t\t\twriter.writePush(symTable.lookup(varName).kind, symTable.lookup(varName).index);\n\t\t\t}\n\t\t}\n\t\treturn termParent;\n\t}", "public CLPObjective setTerm(double value) {\n\t\t_solver.setObjectiveOffset(value);\n\t\treturn this;\n\t}", "public Concept termToConcept(Term term) {\r\n return nameToConcept(term.getName());\r\n }", "public String evalTerm() {\n\n // the value to return\n String value = \"\";\n\n if (this.selection == 1) {\n\n // evaluate option 1: <fac>\n value = this.fac.evalFac();\n\n } else if (this.selection == 2) {\n\n // evaluate option 2: <fac> * <term>\n value = this.fac.evalFac();\n String valueTerm = this.term.evalTerm();\n\n // perform integer multiplication\n int value1 = Integer.parseInt(value);\n int value2 = Integer.parseInt(valueTerm);\n int finalValue = value1 * value2;\n\n // convert back to string\n value = Integer.toString(finalValue);\n\n }\n\n // check for value greater than 99999999\n if (java.lang.Math.abs(Integer.parseInt(value)) > 99999999) {\n\n // error\n System.out.println(\"Error: Value exceeds 8 digits.\");\n System.exit(-1);\n\n }\n\n return value;\n\n }", "private double parseTerm() {\n double value = parseFactor();\n while (true) {\n if (token.getType().equals(Token.Type.DIVIDE)) { // division\n token = lexer.getNextToken();\n value /= parseFactor();\n } else if (token.getType().equals(Token.Type.MULTIPLY)|| \n \t\t token.getType().equals(Token.Type.LPAREN)|| \n \t \t token.getType().equals(Token.Type.SQRT)|| \n \t\t token.getType().equals(Token.Type.NUMBER)) { // multiplication\n if (token.getType().equals(Token.Type.MULTIPLY)) {\n \ttoken=lexer.getNextToken();\n }\n value *= parseFactor();\n } else {\n return value;\n }\n }\n\t}", "private Value generateLiteralTermType(TermMap termMap, String value)\n \t\t\tthrows R2RMLDataError, SQLException {\n \t\tif (termMap.getLanguageTag() != null) {\n \t\t\tif (!RDFDataValidator.isValidLanguageTag(termMap.getLanguageTag()))\n \t\t\t\tthrow new R2RMLDataError(\n \t\t\t\t\t\t\"[R2RMLEngine:generateLiteralTermType] This language tag is not valid : \"\n \t\t\t\t\t\t\t\t+ value);\n \t\t\treturn vf.createLiteral(value, termMap.getLanguageTag());\n \t\t} else if (termMap.getDataType() != null) {\n \t\t\t// 2. Otherwise, if the term map has a non-empty specified datatype\n \t\t\t// that is different from the natural RDF datatype corresponding to\n \t\t\t// the term map's\n \t\t\t// implicit SQL datatype,\n \t\t\t// then return the datatype-override RDF literal corresponding to\n \t\t\t// value and the specified datatype.\n \t\t\tif (!RDFDataValidator.isValidDatatype(termMap.getDataType()\n \t\t\t\t\t.getAbsoluteStringURI()))\n \t\t\t\tthrow new R2RMLDataError(\n \t\t\t\t// If the typed literal is ill-typed, then a data error is\n \t\t\t\t// raised.\n \t\t\t\t\t\t\"[R2RMLEngine:generateLiteralTermType] This datatype is not valid : \"\n \t\t\t\t\t\t\t\t+ value);\n \t\t\tSQLType implicitDatatype = extractImplicitDatatype((ObjectMap) termMap);\n \t\t\t// Convert implicit datatype into XSD\n \t\t\tXSDType implicitXSDType = SQLToXMLS\n \t\t\t\t\t.getEquivalentType(implicitDatatype);\n \t\t\tif (implicitXSDType != termMap.getDataType()) {\n \t\t\t\t// Type overidden\n \t\t\t\tlog.debug(\"[R2RMLEngine:generateLiteralTermType] Type will be overidden : \"\n \t\t\t\t\t\t+ termMap.getDataType() + \" != \" + implicitXSDType);\n \n \t\t\t}\n \t\t\t// Lexical RDF Natural form\n \t\t\t// value =\n \t\t\t// XSDLexicalTransformation.extractNaturalRDFFormFrom(termMap.getDataType(),\n \t\t\t// value);\n \t\t\tURI datatype = vf.createURI(termMap.getDataType()\n \t\t\t\t\t.getAbsoluteStringURI());\n \t\t\treturn vf.createLiteral(value, datatype);\n \n \t\t} else {\n \t\t\t// 3. Otherwise, return the natural RDF literal corresponding to\n \t\t\t// value.\n \t\t\treturn extractNaturalLiteralFormFrom(termMap, value);\n \t\t}\n \t}", "public void setTerm(Expression term) {\n this.term = term;\n }", "public CLPObjective setTerm(CLPVariable variable, double value) {\n\t\t_solver.setObjectiveCoefficient(variable, value);\n\t\treturn this;\n\t}", "protected Term createTermFrom(String tag) {\n\t\tTerm tmp = terms.getOrDefault(tag, new Term(tag, this, terms.size()));\n\t\tterms.put(tag, tmp);\n\t\t// termCounts.put(tmp, termCounts.getOrDefault(tmp,0)+1);\n\t\ttermsInCorpus += 1;\n\t\treturn tmp;\n\t}", "public Expression getTerm() {\n return term;\n }", "BigDecimal getTermValue();", "public void setTermcat(String value) {\r\n setAttributeInternal(TERMCAT, value);\r\n }", "public abstract URI getOntologyTermUri ( String valueLabel, String typeLabel ) throws OntologyDiscoveryException;", "private BNode generateBlankNodeTermType(TermMap termMap, String value) {\n \t\tif (value == null)\n \t\t\treturn vf.createBNode();\n \t\telse\n \t\t\treturn vf.createBNode(value);\n \t}", "public QueryMultiMatch setTerm(Object value, String... fields) {\n\t\tthis.value = value;\n\t\tthis.fields = fields;\n\n\t\treturn this;\n\t}", "public String makeConversion(String value);", "abstract public TermEnum terms(Term t) throws IOException;", "public java.lang.Integer getTerm() {\n return term;\n }", "public Term(String t) {\n this.t = t;\n \n RepCheck();\n }", "Astro term(Astro functor, AstroArg args);", "java.lang.String getValue();", "java.lang.String getValue();", "java.lang.String getValue();", "java.lang.String getValue();", "java.lang.String getValue();", "java.lang.String getValue();", "protected IExpressionValue term() throws TableFunctionMalformedException,\r\n\t\t\t\t\t\t\t\t\t\t\tInvalidProbabilityRangeException,\r\n\t\t\t\t\t\t\t\t\t\t\tSomeStateUndeclaredException{\r\n\t\tIExpressionValue temp1 = signedFactor();\r\n\t\tIExpressionValue temp2 = null;\r\n\t\t\r\n\t\tFloat temp1Value = null;\r\n\t\tFloat temp2Value = null;\r\n\t\t// LOOK FOR *// (OPTIONAL)\r\n\t\tswitch (look) {\r\n\t\tcase '*':\r\n\t\t\tmatch('*');\r\n\t\t\ttemp2 = this.signedFactor();\r\n\t\t\ttry {\r\n\t\t\t\ttemp1Value = Float.parseFloat(temp1.getValue());\r\n\t\t\t} catch (NumberFormatException e) {\r\n\t\t\t\ttemp1Value = Float.NaN;\r\n\t\t\t}\r\n\t\t\ttry {\r\n\t\t\t\ttemp2Value = Float.parseFloat(temp2.getValue());\r\n\t\t\t} catch (NumberFormatException e) {\r\n\t\t\t\ttemp2Value = Float.NaN;\r\n\t\t\t}\r\n\t\t\tif (!Float.isNaN(temp1Value) && !Float.isNaN(temp2Value)) {\r\n\t\t\t\t// TODO cut the subtree if it is known value\r\n\t\t\t\treturn new MultiplyOperationProbabilityValue(\r\n\t\t\t\t\t\ttemp1.isFixedValue()?(new SimpleProbabilityValue(temp1Value)):temp1 ,\r\n\t\t\t\t\t\t\t\ttemp2.isFixedValue()?(new SimpleProbabilityValue(temp2Value)):temp2);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\tcase '/':\r\n\t\t\tmatch('/');\r\n\t\t\ttemp2 = this.signedFactor();\r\n\t\t\ttry {\r\n\t\t\t\ttemp1Value = Float.parseFloat(temp1.getValue());\r\n\t\t\t} catch (NumberFormatException e) {\r\n\t\t\t\ttemp1Value = Float.NaN;\r\n\t\t\t}\r\n\t\t\ttry {\r\n\t\t\t\ttemp2Value = Float.parseFloat(temp2.getValue());\r\n\t\t\t} catch (NumberFormatException e) {\r\n\t\t\t\ttemp2Value = Float.NaN;\r\n\t\t\t}\r\n\t\t\tif (!Float.isNaN(temp1Value) && !Float.isNaN(temp2Value)) {\r\n\t\t\t\t// TODO cut the subtree if it is known value\r\n\t\t\t\treturn new DivideOperationProbabilityValue(\r\n\t\t\t\t\t\ttemp1.isFixedValue()?(new SimpleProbabilityValue(temp1Value)):temp1 ,\r\n\t\t\t\t\t\t\t\ttemp2.isFixedValue()?(new SimpleProbabilityValue(temp2Value)):temp2);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\t//default:\r\n\t\t\t//return temp1;\r\n\t\t}\r\n\t\t// Debug.println(\"Term is not matching to an * or / nor signed factor !!\");\r\n\t\t//return new SimpleProbabilityValue(Float.NaN);\r\n\t\treturn temp1;\r\n\t}", "public static String getLexicalForm(RDFNode value) {\n if (value.isLiteral()) {\n return ((Literal) value).getLexicalForm();\n } else if (value.isURIResource()) {\n return ((Resource) value).getURI();\n } else {\n return value.toString();\n }\n }", "TermType getTermType();", "private NFA term() {\n NFA startFactor = new NFA();\n while (more() && peek() != ')' && peek() != '|') {\n NFA newFactor = factor();\n //If a term is just an empty sequence of factors\n if (startFactor.getStates().isEmpty()) {\n startFactor = newFactor;\n } else {//concatentae the term if there are multple factor\n startFactor = combine(startFactor, newFactor);\n }\n }\n return startFactor;\n }", "public java.lang.Integer getTerm() {\n return term;\n }", "public Node term()\r\n\t{\r\n\t\tNode lhs = negaposi();\r\n\t\tif(lhs!=null)\r\n\t\t{\r\n\t\t\tint index = lexer.getPosition();\r\n\t\t\tLexer.Token token = lexer.getToken();\r\n\t\t\twhile(token == Lexer.Token.TIMES\r\n\t\t\t\t||token == Lexer.Token.DIVIDE)\r\n\t\t\t{\r\n\t\t\t\tNode rhs = negaposi(); \r\n\t\t\t\tif(rhs!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tif(token == Lexer.Token.TIMES)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tlhs = new Mul(lhs,rhs);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(token == Lexer.Token.DIVIDE)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tlhs = new Div(lhs,rhs);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tindex = lexer.getPosition();\r\n\t\t\t\t\ttoken = lexer.getToken();\r\n\t\t\t\t}\r\n\t\t\t\telse break;\r\n\t\t\t}\r\n\t\t\tlexer.setPosition(index);\r\n\t\t}\r\n\t\treturn lhs;\r\n\t}", "public StreamTerm term() {\n return term;\n }", "public void set(Term t) {\n \t\ttry {\n \t\t\tsetFunctor(t.functor);\n \t\t\tterms = t.getDeepCopyOfTerms();\n \t\t} catch (Exception e) {\n \t\t\tSystem.err.println(\"Error setting value for term \");\n \t\t\te.printStackTrace();\n \t\t}\n \t}", "public Vector mapTerm(String term) throws TermNotFoundException {\n int i = termIndex.get(term);\n\n if (i == -1) {\n throw new TermNotFoundException(term);\n }\n\n return new DenseVector(Uk[i]);\n }", "@Override\r\n\t\t\t\tpublic String textFormatter(String value) {\n\t\t\t\t\tString label = \"(\" + value + \")\";\r\n\t\t\t\t\treturn (label);\r\n\t\t\t\t}", "public Characteristic valueUri2Characteristic( String valueUri ) {\n if ( this.ontologies.isEmpty() ) {\n resetOntologies();\n }\n OntologyTerm o = findOntologyTermByUri( valueUri );\n\n if ( o == null ) return null;\n\n VocabCharacteristic myPhenotype = VocabCharacteristic.Factory.newInstance();\n\n myPhenotype.setValueUri( o.getUri() );\n myPhenotype.setValue( o.getLabel() );\n myPhenotype.setCategory( PhenotypeAssociationConstants.PHENOTYPE );\n myPhenotype.setCategoryUri( PhenotypeAssociationConstants.PHENOTYPE_CATEGORY_URI );\n\n return myPhenotype;\n }", "public interface Term {\n\t\n\t/**\n\t * Get the coefficient of a term\n\t * @return the coefficient \n\t */\n\tpublic double getCoefficient();\n\t\n\t/**\n\t * Get the exponent of a term\n\t * @return the exponent\n\t */\n\tpublic int getExponent();\n\t\n\t/**\n\t * Evaluate a term by a given value. c = constant, a(c)^n \n\t * @param x The value to be evaluated \n\t * @return The result of the evaluated term \n\t */\n\tpublic double evaluate(double x);\n\t\n}", "public Token(int ordinal, String value) {\r\n\t\tthis.ordinal = ordinal;\r\n\t\tthis.value = value;\r\n\t}", "String getValue();", "String getValue();", "String getValue();", "String getValue();", "String getValue();", "String getValue();", "String getValue();", "String getValue();", "String getValue();", "String getValue();", "public void setTermweig(String value) {\r\n setAttributeInternal(TERMWEIG, value);\r\n }", "Term getTermFromIndex(int index) {\n return terms.get(index);\n }", "public OntologyTerm findOntologyTermByUri( String valueUri ) {\n if ( this.ontologies.isEmpty() ) {\n resetOntologies();\n }\n if ( valueUri.isEmpty() ) {\n throw new IllegalArgumentException( \"URI to load was blank.\" );\n }\n\n OntologyTerm ontologyTerm = null;\n for ( AbstractOntologyService ontology : this.ontologies ) {\n ontologyTerm = ontology.getTerm( valueUri );\n if ( ontologyTerm != null ) return ontologyTerm;\n }\n\n throw new EntityNotFoundException( valueUri );\n }", "private String getTerm(ITermbase p_tb, long p_entryId) throws Exception\n {\n String entryXml = p_tb.getEntry(p_entryId);\n XmlParser parser = XmlParser.hire();\n Document dom = parser.parseXml(entryXml);\n Element root = dom.getRootElement();\n List langGrps = root\n .selectNodes(\"/conceptGrp/languageGrp/termGrp/term\");\n Element firstTerm = (Element) langGrps.get(0);\n String termText = firstTerm.getText();\n XmlParser.fire(parser);\n return termText;\n }", "GeneralTerm createGeneralTerm();", "@Override\r\n public Double evaluate(double number) {\r\n double result = this.reduce(0.0, t -> {\r\n Term term = (Term) t;\r\n return term.evaluate(number);\r\n });\r\n return result;\r\n }", "public String transform(String value){\n return value;\n }", "public T value(final Object value) {\r\n\t\treturn values(value);\r\n\t}", "QuoteTerm createQuoteTerm();", "public final JavaliParser.term_return term() throws RecognitionException {\n\t\tJavaliParser.term_return retval = new JavaliParser.term_return();\n\t\tretval.start = input.LT(1);\n\n\t\tObject root_0 = null;\n\n\t\tParserRuleReturnScope op =null;\n\t\tParserRuleReturnScope rightFactor =null;\n\t\tParserRuleReturnScope factor93 =null;\n\n\t\tRewriteRuleSubtreeStream stream_strongOp=new RewriteRuleSubtreeStream(adaptor,\"rule strongOp\");\n\t\tRewriteRuleSubtreeStream stream_factor=new RewriteRuleSubtreeStream(adaptor,\"rule factor\");\n\n\t\ttry {\n\t\t\t// /home/luca/svn-repos/cd_students/2015ss/master/CD2_A1/src/cd/parser/Javali.g:468:2: ( ( factor -> factor ) (op= strongOp rightFactor= factor -> ^( BinaryOp[$op.start, \\\"BinaryOp\\\"] $term strongOp $rightFactor) )* )\n\t\t\t// /home/luca/svn-repos/cd_students/2015ss/master/CD2_A1/src/cd/parser/Javali.g:469:3: ( factor -> factor ) (op= strongOp rightFactor= factor -> ^( BinaryOp[$op.start, \\\"BinaryOp\\\"] $term strongOp $rightFactor) )*\n\t\t\t{\n\t\t\t// /home/luca/svn-repos/cd_students/2015ss/master/CD2_A1/src/cd/parser/Javali.g:469:3: ( factor -> factor )\n\t\t\t// /home/luca/svn-repos/cd_students/2015ss/master/CD2_A1/src/cd/parser/Javali.g:469:5: factor\n\t\t\t{\n\t\t\tpushFollow(FOLLOW_factor_in_term1829);\n\t\t\tfactor93=factor();\n\t\t\tstate._fsp--;\n\n\t\t\tstream_factor.add(factor93.getTree());\n\t\t\t// AST REWRITE\n\t\t\t// elements: factor\n\t\t\t// token labels: \n\t\t\t// rule labels: retval\n\t\t\t// token list labels: \n\t\t\t// rule list labels: \n\t\t\t// wildcard labels: \n\t\t\tretval.tree = root_0;\n\t\t\tRewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,\"rule retval\",retval!=null?retval.getTree():null);\n\n\t\t\troot_0 = (Object)adaptor.nil();\n\t\t\t// 469:12: -> factor\n\t\t\t{\n\t\t\t\tadaptor.addChild(root_0, stream_factor.nextTree());\n\t\t\t}\n\n\n\t\t\tretval.tree = root_0;\n\n\t\t\t}\n\n\t\t\t// /home/luca/svn-repos/cd_students/2015ss/master/CD2_A1/src/cd/parser/Javali.g:470:3: (op= strongOp rightFactor= factor -> ^( BinaryOp[$op.start, \\\"BinaryOp\\\"] $term strongOp $rightFactor) )*\n\t\t\tloop29:\n\t\t\twhile (true) {\n\t\t\t\tint alt29=2;\n\t\t\t\tint LA29_0 = input.LA(1);\n\t\t\t\tif ( ((LA29_0 >= 67 && LA29_0 <= 68)||LA29_0==71||LA29_0==76) ) {\n\t\t\t\t\talt29=1;\n\t\t\t\t}\n\n\t\t\t\tswitch (alt29) {\n\t\t\t\tcase 1 :\n\t\t\t\t\t// /home/luca/svn-repos/cd_students/2015ss/master/CD2_A1/src/cd/parser/Javali.g:470:5: op= strongOp rightFactor= factor\n\t\t\t\t\t{\n\t\t\t\t\tpushFollow(FOLLOW_strongOp_in_term1843);\n\t\t\t\t\top=strongOp();\n\t\t\t\t\tstate._fsp--;\n\n\t\t\t\t\tstream_strongOp.add(op.getTree());\n\t\t\t\t\tpushFollow(FOLLOW_factor_in_term1847);\n\t\t\t\t\trightFactor=factor();\n\t\t\t\t\tstate._fsp--;\n\n\t\t\t\t\tstream_factor.add(rightFactor.getTree());\n\t\t\t\t\t// AST REWRITE\n\t\t\t\t\t// elements: rightFactor, strongOp, term\n\t\t\t\t\t// token labels: \n\t\t\t\t\t// rule labels: retval, rightFactor\n\t\t\t\t\t// token list labels: \n\t\t\t\t\t// rule list labels: \n\t\t\t\t\t// wildcard labels: \n\t\t\t\t\tretval.tree = root_0;\n\t\t\t\t\tRewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,\"rule retval\",retval!=null?retval.getTree():null);\n\t\t\t\t\tRewriteRuleSubtreeStream stream_rightFactor=new RewriteRuleSubtreeStream(adaptor,\"rule rightFactor\",rightFactor!=null?rightFactor.getTree():null);\n\n\t\t\t\t\troot_0 = (Object)adaptor.nil();\n\t\t\t\t\t// 471:4: -> ^( BinaryOp[$op.start, \\\"BinaryOp\\\"] $term strongOp $rightFactor)\n\t\t\t\t\t{\n\t\t\t\t\t\t// /home/luca/svn-repos/cd_students/2015ss/master/CD2_A1/src/cd/parser/Javali.g:471:7: ^( BinaryOp[$op.start, \\\"BinaryOp\\\"] $term strongOp $rightFactor)\n\t\t\t\t\t\t{\n\t\t\t\t\t\tObject root_1 = (Object)adaptor.nil();\n\t\t\t\t\t\troot_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(BinaryOp, (op!=null?(op.start):null), \"BinaryOp\"), root_1);\n\t\t\t\t\t\tadaptor.addChild(root_1, stream_retval.nextTree());\n\t\t\t\t\t\tadaptor.addChild(root_1, stream_strongOp.nextTree());\n\t\t\t\t\t\tadaptor.addChild(root_1, stream_rightFactor.nextTree());\n\t\t\t\t\t\tadaptor.addChild(root_0, root_1);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\n\t\t\t\t\tretval.tree = root_0;\n\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault :\n\t\t\t\t\tbreak loop29;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t}\n\n\t\t\tretval.stop = input.LT(-1);\n\n\t\t\tretval.tree = (Object)adaptor.rulePostProcessing(root_0);\n\t\t\tadaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);\n\n\t\t}\n\n\t\tcatch (RecognitionException re) {\n\t\t\treportError(re);\n\t\t\tthrow re;\n\t\t}\n\n\t\tfinally {\n\t\t\t// do for sure before leaving\n\t\t}\n\t\treturn retval;\n\t}", "public void setTermPath(String value) {\r\n setAttributeInternal(TERMPATH, value);\r\n }", "public abstract String toText(T value);", "private static Object getValue(Property property, Object value) {\n\n\t\tif (property instanceof DataTypeProperty) {\n\t\t\tXSDDatatype xsdDataType = ((DataTypeProperty) property).getDataType();\n\t\t\tvalue = \"\\\"\" + value.toString() + \"\\\"\" + xsdDataType.getXsdType();\n\t\t\treturn value;\n\t\t} else {\n\t\t\treturn Prefix.IOT_PLATFORM.getPrefix() + value.toString().toLowerCase().replaceAll(\" \", \"\");\n\t\t}\n\t}", "@Override\n\t\tpublic Object fromTerm(Term term, TypeDomain target, Jpc jpc) {\n\t\t\tObject converted = null;\n\t\t\tboolean converterFound = false;\n\t\t\tTerm unifiedTerm = null;\n\t\t\tif (JpcConverterManager.isValidConvertableTerm(term)) {\n\t\t\t\tString converterVarName = JpcPreferences.JPC_VAR_PREFIX + \"Converter\";\n\t\t\t\tQuery query = embeddedEngine.query(new Compound(JpcConverterManager.FROM_TERM_CONVERTER_FUNCTOR_NAME, asList(term, var(converterVarName))));\n\t\t\t\twhile (query.hasNext()) {\n\t\t\t\t\tSolution solution = query.next();\n\t\t\t\t\tunifiedTerm = term.replaceVariables(solution);\n\t\t\t\t\tunifiedTerm = unifiedTerm.compile(true);\n\t\t\t\t\tConversionFunction converter = (ConversionFunction) ((JRef) solution.get(converterVarName)).getReferent();\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconverted = new InterTypeConverterEvaluator(conversionGoal(unifiedTerm, target), jpc).apply(converter);\n\t\t\t\t\t\tconverterFound = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} catch (DelegateConversionException e) {} //just try with the next converter.\n\t\t\t\t}\n\t\t\t\tquery.close();\n\t\t\t}\n\t\t\tif (!converterFound) {\n\t\t\t\tthrow new DelegateConversionException(conversionGoal(term, target));\n\t\t\t} else {\n\t\t\t\ttry {\n\t\t\t\t\tterm.unify(unifiedTerm);\n\t\t\t\t} catch (UncompiledTermException e) {\n\t\t\t\t\t//just ignore the exception if the original term is not compiled.\n\t\t\t\t}\n\t\t\t\treturn converted;\n\t\t\t}\n\t\t}", "public T caseTERM(TERM object)\n {\n return null;\n }", "@Override\r\n\tpublic String inverseTranslateTerm(String term)\r\n\t{\r\n\t\tStringBuilder sb = new StringBuilder(term.length());\r\n\t\tMatcher matcher = s_termPattern.matcher(term);\r\n\t\tint start = 0;\r\n\t\twhile (matcher.find(start))\r\n\t\t{\r\n\t\t\t// Parse a Prolog term\r\n\t\t\tString symbol = matcher.group();\r\n\t\t\t\r\n\t\t\tif (matcher.group(\"quotedConst\") != null)\r\n\t\t\t{\r\n\t\t\t\tsb.append(inverseTranslateQuotedConst(symbol));\r\n\t\t\t}\r\n\t\t\telse if (matcher.group(\"var\") != null)\r\n\t\t\t{\r\n\t\t\t\tsb.append(inverseTranslateVariable(symbol));\r\n\t\t\t}\r\n\t\t\telse if (matcher.group(\"unquotedConst\") != null)\r\n\t\t\t{\r\n\t\t\t\tsb.append(inverseTranslateUnquotedConst(symbol));\r\n\t\t\t}\r\n\t\t\telse if (matcher.group(\"number\") != null)\r\n\t\t\t{\r\n\t\t\t\tsb.append(inverseTranslateNumber(symbol));\r\n\t\t\t}\r\n\t\t\telse if (matcher.group(\"string\") != null)\r\n\t\t\t{\r\n\t\t\t\tsb.append(inverseTranslateString(symbol));\r\n\t\t\t}\r\n\t\t\telse if (matcher.group(\"list\") != null)\r\n\t\t\t{\r\n\t\t\t\tsb.append(inverseTranslateList(symbol));\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tthrow new TranslatorException(\"Unable to parse answer term: \" + term);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tstart = matcher.end();\r\n\t\t\ttry {\r\n\t\t\t\t// Parse connectors between terms\r\n\t\t\t\tchar c = term.charAt(start);\r\n\t\t\t\tif (c == ',')\r\n\t\t\t\t\tsb.append(' ');\r\n\t\t\t\telse if (c == '(')\r\n\t\t\t\t\tsb.append(c);\r\n\t\t\t\telse if (c == ')')\r\n\t\t\t\t{\r\n\t\t\t\t\tdo\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tsb.append(c);\r\n\t\t\t\t\t\tc = term.charAt(++start);\r\n\t\t\t\t\t} while (c == ')');\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tthrow new TranslatorException(\"Unable to parse answer term: \" + term);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tcatch (IndexOutOfBoundsException e)\r\n\t\t\t{\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif (start != term.length())\r\n\t\t{\r\n\t\t\tthrow new TranslatorException(\"Unable to parse answer term: \" + term);\r\n\t\t}\r\n\t\t\r\n\t\treturn sb.toString();\r\n\t}", "@Override\n\tpublic String visitTerm(MicroParser.TermContext ctx) {\n\t\tString prefix = visit(ctx.factor_prefix());\n\t\tString termExpr = prefix + visit(ctx.factor());\n\t\t//System.out.println(\"in term :\"+termExpr);\n\t\t//System.out.println(\"in term, prefix is:\"+prefix);\n\t\tif((prefix.contentEquals(\"\"))) return termExpr;\n\t\tString op1, op2, result;\n\t\tString type = currentType;\n\t\tString[] ids = termExpr.split(\"/|\\\\*\");\n\t List<String> operands = new ArrayList<String>();\n\t List<Character> mulops = new ArrayList<Character>();\n\t \n\t //create a list of mulops\n\t for(int i=0;i<termExpr.length();i++) {\n\t \tif(termExpr.charAt(i)=='*' || termExpr.charAt(i)=='/')\n\t \t\tmulops.add(termExpr.charAt(i));\n\t }\n\t //create a list of operands \n\t for(String i:ids) \n\t \toperands.add(i);\n\t \n\t op1 = operands.get(0);\n\t op2 = operands.get(1);\n\t //System.out.println(\"in term op1 op2: \"+op1 +\" \" + op2);\n\t temp = new Temporary(type);\n \tresult = temp.fullName;\n \ttempList.addT(temp);\n\t //System.out.println(\"in term result: \"+result);\n\t if(mulops.get(0)=='*') {\n\t \tglobalIR.addStmt(IRStatement.generateArithmetic(type, \"MULT\", op1, op2, result));\n\t \t//System.out.println(globalIR.getLastStatement(globalIR));\n\t \toperands.remove(0); operands.remove(0); mulops.remove(0);\n\t }\n\t \t\n\t else {\n\t \tglobalIR.addStmt(IRStatement.generateArithmetic(type, \"DIV\", op1, op2, result));\n\t \t//System.out.println(globalIR.getLastStatement(globalIR));\n\t \toperands.remove(0); operands.remove(0); mulops.remove(0);\n\t }\n\t \n\t \t\n\t if(operands.size()==0) return result;\n\t //System.out.println(\"AFTER IF\");\n\t for(int i=0; i<operands.size();i++) {\n\t \top1 = result;\n\t \top2 = operands.get(i);\n\t \ttemp = new Temporary(type);\n\t \tresult = temp.fullName;\n\t \ttempList.addT(temp);\n\t \tif(mulops.get(0)=='*') {\n\t\t \tglobalIR.addStmt(IRStatement.generateArithmetic(type, \"MULT\", op1, op2, result));\n\t\t \t//System.out.println(globalIR.getLastStatement(globalIR));\n\t\t \tmulops.remove(0);\n\t \t}\n\t\t \t\n\t\t else {\n\t\t \tglobalIR.addStmt(IRStatement.generateArithmetic(type, \"DIV\", op1, op2, result));\n\t\t \t//System.out.println(globalIR.getLastStatement(globalIR));\n\t\t \tmulops.remove(0);\n\t\t }\n\t\t \t\n\t }\n\t return result;\n\t\t\n\t}", "public AcademicTerm(int termIndex, Term term) {\n this.termIndex = termIndex;\n this.term = term;\n }", "public Node term(Node n_parent) {\r\n\r\n if (token.get(lookAheadPossition).contains(\"ident(\") || token.get(lookAheadPossition).contains(\"num(\") || token.get(lookAheadPossition).contains(\"boollit(\") || token.get(lookAheadPossition).equals(\"LP\")) {\r\n System.out.println(\":: term:if:\" + n_parent.getData());\r\n Node n_factor = this.factor(n_parent);\r\n //if (n_parent.getData().contains(\"*\")) {n_parent.setNodeChild(n_factor); }\r\n //if (n_parent.getData().contains(\"DIV\")) {n_parent.setNodeChild(n_factor); }\r\n //if (n_parent.getData().contains(\"MOD\")) {n_parent.setNodeChild(n_factor); }\r\n //if (!(n_parent.getData().equals(\"makeown\"))) {n_parent.setNodeChild(n_factor); }\r\n return (this.restTerm(n_parent, n_factor));\r\n } else {\r\n\r\n return (null);\r\n }\r\n }", "Astro namedTerm(String tagName, AstroArg args);", "private TypeDictionaryDicoEffetTactiqueRecherche(int value, String name, String literal) {\n\t\tthis.value = value;\n\t\tthis.name = name;\n\t\tthis.literal = literal;\n\t}", "public VocabCharacteristic characteristicValueObject2Characteristic(\n CharacteristicValueObject characteristicValueObject ) {\n if ( this.ontologies.isEmpty() ) {\n resetOntologies();\n }\n VocabCharacteristic characteristic = VocabCharacteristic.Factory.newInstance();\n characteristic.setCategory( characteristicValueObject.getCategory() );\n characteristic.setCategoryUri( characteristicValueObject.getCategoryUri() );\n characteristic.setValue( characteristicValueObject.getValue() );\n\n if ( characteristic.getValueUri() != null && !characteristic.getValueUri().equals( \"\" ) ) {\n characteristic.setValueUri( characteristicValueObject.getValueUri() );\n } else {\n\n // format the query for lucene to look for ontology terms with an exact match for the value\n String value = \"\\\"\" + StringUtils.join( characteristicValueObject.getValue().trim().split( \" \" ), \" AND \" )\n + \"\\\"\";\n\n Collection<OntologyTerm> ontologyTerms = this.ontologyService.findTerms( value );\n\n for ( OntologyTerm ontologyTerm : ontologyTerms ) {\n if ( ontologyTerm.getLabel().equalsIgnoreCase( characteristicValueObject.getValue() ) ) {\n characteristic.setValueUri( ontologyTerm.getUri() );\n break;\n }\n }\n }\n return characteristic;\n }", "public Term nameToListedTerm(String name) {\r\n Concept concept = concepts.get(name);\r\n if (concept != null)\r\n return concept.getTerm(); // Concept associated Term\r\n return operators.get(name);\r\n }", "public Query getQuery(String value, Collection<String> termCollector) {\n Query result = null;\n\n String termValue = value;\n if(isOffByOne()){\n termValue = String.valueOf(Integer.parseInt(termValue) - 1);\n }\n\n if (index == Field.Index.ANALYZED || normalizer == null) {\n result = LuceneUtils.toQuery(getAnalyzer(), label, termValue, termCollector);\n }\n else {\n result = LuceneUtils.tokensToQuery(label, tokenize(termValue), termCollector);\n }\n\n return result;\n }", "private double term(boolean get){\n\t\t// compute the left argument which has to be a primary value or an expression with a higher priority than products\n\t\tdouble left = pot(get);\n\t\tfor(;;){\n\t\t\tswitch(curr_tok){\n\t\t\t\tcase MUL:{\n\t\t\t\t\tleft*=pot(true);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase DIV:{\n\t\t\t\t\tdouble d;\n\t\t\t\t\tif((d=pot(true)) != 0){\n\t\t\t\t\t\tleft/=d;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t//System.err.println(\"Error::TermParser::term(): Invalid operation. Division by 0.\");\n\t\t\t\t\treturn Double.NaN;\n\t\t\t\t}\n\t\t\t\tdefault:{\n\t\t\t\t\treturn left;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "protected Evaluable parseTerm() throws ParsingException {\n Evaluable factor = parseFactor();\n\n while (_token != null &&\n _token.type == TokenType.Operator &&\n \"*/%\".indexOf(_token.text) >= 0) {\n\n String op = _token.text;\n\n next(true);\n\n Evaluable factor2 = parseFactor();\n\n factor = new OperatorCallExpr(new Evaluable[] { factor, factor2 }, op);\n }\n\n return factor;\n }", "public CategoryBuilder setValue(String value)\n {\n fValue = value;\n return this;\n }", "private static List<Term> toTerms(ByteBuffer... values)\n {\n List<Term> terms = new ArrayList<>();\n for (ByteBuffer value : values)\n terms.add(toTerm(value));\n return terms;\n }", "public String getTerm() {\r\n return (String) getAttributeInternal(TERM);\r\n }", "public final PythonParser.term_return term() throws RecognitionException {\n PythonParser.term_return retval = new PythonParser.term_return();\n retval.start = input.LT(1);\n\n PythonTree root_0 = null;\n\n List list_right=null;\n PythonParser.factor_return left = null;\n\n PythonParser.term_op_return term_op208 = null;\n\n PythonParser.factor_return right = null;\n right = null;\n RewriteRuleSubtreeStream stream_term_op=new RewriteRuleSubtreeStream(adaptor,\"rule term_op\");\n RewriteRuleSubtreeStream stream_factor=new RewriteRuleSubtreeStream(adaptor,\"rule factor\");\n\n List ops = new ArrayList();\n\n try {\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1254:5: (left= factor ( ( term_op right+= factor )+ | -> $left) )\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1254:7: left= factor ( ( term_op right+= factor )+ | -> $left)\n {\n pushFollow(FOLLOW_factor_in_term5467);\n left=factor();\n\n state._fsp--;\n if (state.failed) return retval;\n if ( state.backtracking==0 ) stream_factor.add(left.getTree());\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1255:9: ( ( term_op right+= factor )+ | -> $left)\n int alt101=2;\n int LA101_0 = input.LA(1);\n\n if ( (LA101_0==STAR||(LA101_0>=SLASH && LA101_0<=DOUBLESLASH)) ) {\n alt101=1;\n }\n else if ( (LA101_0==EOF||LA101_0==NEWLINE||LA101_0==NAME||(LA101_0>=AND && LA101_0<=AS)||LA101_0==FOR||LA101_0==IF||(LA101_0>=IN && LA101_0<=IS)||(LA101_0>=NOT && LA101_0<=ORELSE)||(LA101_0>=RPAREN && LA101_0<=COMMA)||(LA101_0>=SEMI && LA101_0<=MINUS)||LA101_0==RBRACK||(LA101_0>=RCURLY && LA101_0<=BACKQUOTE)) ) {\n alt101=2;\n }\n else {\n if (state.backtracking>0) {state.failed=true; return retval;}\n NoViableAltException nvae =\n new NoViableAltException(\"\", 101, 0, input);\n\n throw nvae;\n }\n switch (alt101) {\n case 1 :\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1255:11: ( term_op right+= factor )+\n {\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1255:11: ( term_op right+= factor )+\n int cnt100=0;\n loop100:\n do {\n int alt100=2;\n int LA100_0 = input.LA(1);\n\n if ( (LA100_0==STAR||(LA100_0>=SLASH && LA100_0<=DOUBLESLASH)) ) {\n alt100=1;\n }\n\n\n switch (alt100) {\n \tcase 1 :\n \t // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1255:12: term_op right+= factor\n \t {\n \t pushFollow(FOLLOW_term_op_in_term5480);\n \t term_op208=term_op();\n\n \t state._fsp--;\n \t if (state.failed) return retval;\n \t if ( state.backtracking==0 ) stream_term_op.add(term_op208.getTree());\n \t pushFollow(FOLLOW_factor_in_term5484);\n \t right=factor();\n\n \t state._fsp--;\n \t if (state.failed) return retval;\n \t if ( state.backtracking==0 ) stream_factor.add(right.getTree());\n \t if (list_right==null) list_right=new ArrayList();\n \t list_right.add(right.getTree());\n\n \t if ( state.backtracking==0 ) {\n\n \t ops.add((term_op208!=null?term_op208.op:null));\n \t \n \t }\n\n \t }\n \t break;\n\n \tdefault :\n \t if ( cnt100 >= 1 ) break loop100;\n \t if (state.backtracking>0) {state.failed=true; return retval;}\n EarlyExitException eee =\n new EarlyExitException(100, input);\n throw eee;\n }\n cnt100++;\n } while (true);\n\n\n }\n break;\n case 2 :\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1261:8: \n {\n\n // AST REWRITE\n // elements: left\n // token labels: \n // rule labels: retval, left\n // token list labels: \n // rule list labels: \n // wildcard labels: \n if ( state.backtracking==0 ) {\n retval.tree = root_0;\n RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,\"rule retval\",retval!=null?retval.tree:null);\n RewriteRuleSubtreeStream stream_left=new RewriteRuleSubtreeStream(adaptor,\"rule left\",left!=null?left.tree:null);\n\n root_0 = (PythonTree)adaptor.nil();\n // 1261:8: -> $left\n {\n adaptor.addChild(root_0, stream_left.nextTree());\n\n }\n\n retval.tree = root_0;}\n }\n break;\n\n }\n\n\n }\n\n retval.stop = input.LT(-1);\n\n if ( state.backtracking==0 ) {\n\n retval.tree = (PythonTree)adaptor.rulePostProcessing(root_0);\n adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);\n }\n if ( state.backtracking==0 ) {\n\n if (!ops.isEmpty()) {\n retval.tree = actions.makeBinOp((left!=null?((PythonTree)left.tree):null), ops, list_right);\n }\n\n }\n }\n\n catch (RecognitionException re) {\n errorHandler.reportError(this, re);\n errorHandler.recover(this, input,re);\n retval.tree = (PythonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);\n }\n finally {\n }\n return retval;\n }", "public Token(String value, int lineNumber) {\n\t\tthis.value = value;\n\t\tthis.type = TokenType.WORD;\n\t\tthis.lineNumber = lineNumber;\n\t\tthis.numVal = 0;\n\t\tthis.wordVal = this.value.toUpperCase(Locale.ENGLISH);\n\t}", "private void constructTerm(String s) {\r\n int coefficient;\r\n int power;\r\n String regexPattern =\r\n \"([+-]?)([1-9]\\\\d*|0{1})([x]{1})(\\\\^{1})([1-9]\\\\d*|0{1})|([+-]?)([1-9]\\\\d*|0{1})\";\r\n Pattern p = Pattern.compile(regexPattern);\r\n Matcher m = p.matcher(s);\r\n if (!m.matches()) {\r\n throw new IllegalArgumentException(\"Illegal term, cannot be created\");\r\n }\r\n if (m.group(1) != null) {\r\n coefficient = Integer.parseInt(m.group(1).concat(m.group(2)));\r\n power = Integer.parseInt(m.group(5));\r\n addTerm(coefficient, power);\r\n } else if (m.group(6) != null) {\r\n coefficient = Integer.parseInt(m.group(6).concat(m.group(7)));\r\n power = 0;\r\n addTerm(coefficient, power);\r\n }\r\n }", "public String getValue();", "public String getValue();", "public String getValue();", "public String getValue();", "public String getValue();" ]
[ "0.66486806", "0.64844924", "0.6268487", "0.61910605", "0.6188349", "0.5851282", "0.5805958", "0.5782972", "0.57543296", "0.5698209", "0.56828916", "0.566285", "0.56572926", "0.56326586", "0.56063724", "0.5601072", "0.559937", "0.55985713", "0.55917287", "0.555287", "0.55149144", "0.5512604", "0.55100393", "0.5503381", "0.5491345", "0.54636806", "0.5433341", "0.5408768", "0.53868824", "0.5384189", "0.53740335", "0.5339149", "0.5309069", "0.52944696", "0.52858466", "0.52858466", "0.52858466", "0.52858466", "0.52858466", "0.52858466", "0.5273075", "0.52546394", "0.52418625", "0.5231842", "0.5223219", "0.5220326", "0.52159053", "0.5177891", "0.51657164", "0.5152931", "0.51463234", "0.51420873", "0.5135968", "0.5129922", "0.5129922", "0.5129922", "0.5129922", "0.5129922", "0.5129922", "0.5129922", "0.5129922", "0.5129922", "0.5129922", "0.5101213", "0.50930995", "0.508632", "0.50763845", "0.50729424", "0.50651103", "0.50522035", "0.5050355", "0.5031253", "0.5030491", "0.502177", "0.50205064", "0.5013931", "0.50122935", "0.5011401", "0.50041133", "0.5002619", "0.49704674", "0.49659255", "0.49247262", "0.49237725", "0.49236298", "0.49228457", "0.49194732", "0.4914159", "0.4900562", "0.4892679", "0.4890596", "0.48832914", "0.48751208", "0.4863819", "0.48631883", "0.4854036", "0.4854036", "0.4854036", "0.4854036", "0.4854036" ]
0.72597617
0
Converts the specified values into a List of terms.
private static List<Term> toTerms(ByteBuffer... values) { List<Term> terms = new ArrayList<>(); for (ByteBuffer value : values) terms.add(toTerm(value)); return terms; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected final List getValuesAsList(String values)\r\n {\r\n List list = new LinkedList();\r\n StringTokenizer tok = new StringTokenizer(values, DELIMITER);\r\n\r\n while(tok.hasMoreTokens())\r\n {\r\n // extract each value, trimming whitespace\r\n list.add(tok.nextToken().trim());\r\n }\r\n\r\n // return the list\r\n return list;\r\n }", "public Collection<EfoTermCount> searchTerms(Collection<String> values) {\n List<EfoTermCount> result = new ArrayList<EfoTermCount>();\n Set<String> ids = new HashSet<String>();\n for (String val : values) {\n for (EfoTerm term : efo.searchTerm(val)) {\n Long count = getCount(term.getId());\n if (count != null && !ids.contains(term.getId())) {\n result.add(new EfoTermCount(term, count));\n ids.add(term.getId());\n }\n }\n }\n return result;\n }", "public static List<ScoredTerm> convertToScoredTerm(Map<String, ? extends Number> terms) {\n return convertToScoredTerm(terms, 1.0);\n }", "public List<PropertyValueMember> terms() {\n return terms != null ? terms : new ArrayList<>();\n }", "java.util.List<java.lang.String> getValuesList();", "public static List quoteList(List values) {\n List quoted = new ArrayList();\n for (int i = 0; i < values.size(); i += 2) {\n quoted.add(values.get(i));\n String value = values.get(i + 1).toString();\n quoted.add(quote(value));\n }\n\n return quoted;\n }", "public static String list(List values) {\n return list(values, DFLT_QUOTE);\n }", "List getValues();", "public List<T> values();", "public static List<ScoredTerm> convertToScoredTerm(Map<String, ? extends Number> terms, double normalizer) {\n return terms.entrySet().parallelStream()\n .map(e -> new ScoredTerm(e.getKey(), e.getValue().doubleValue() / normalizer))\n .collect(Collectors.toList());\n }", "public synchronized List<T> getValues() {\n List<T> castVals = new ArrayList<>(values.size());\n for (Object obj : values) {\n castVals.add((T) obj);\n }\n return castVals;\n }", "public Term[] getTerms() { return terms; }", "public List<Object> getValues();", "public Collection<Term> getAll() {\n\t\treturn terms.values();\n\t}", "public List getTermList() {\n\t\tif (termList == null) {\n\t\t\ttermList = new ArrayList();\n\t\t\tSet termSet = getTermMap().keySet();\n\t\t\tfor (Iterator i = termSet.iterator(); i.hasNext();) {\n\t\t\t\ttermList.add((String) i.next());\n\t\t\t}\n\t\t\tCollections.sort(termList);\n\t\t}\n\t\treturn termList;\n\t}", "public abstract List toNameValueList();", "public void setTerms(Term[] terms) { this.terms = terms; }", "Listof<V> vals();", "public void AddValues(List<String> values) {\r\n\t\tValues = new ArrayList<>(values.size());\r\n\t\tfor(String val:values) {\r\n\t\t\twhile(val.charAt(val.length()-1)==' ')\r\n\t\t\t\tval = val.substring(0, val.length()-1);\r\n\t\t\twhile(val.charAt(0) == ' ')\r\n\t\t\t\tval = val.substring(1);\r\n\t\t\tValues.add(val);\r\n\t\t}\r\n\t}", "public void setValues(List<Object> values);", "public java.util.List<java.lang.String> getValuesList() {\n return java.util.Collections.unmodifiableList(result.values_);\n }", "private List<String> ListTransform(Object value) {\n\n if (value.toString().contains(lineDelimiter))\n return Arrays.asList(value.toString().split(lineDelimiter));\n\n List<String> lines = new ArrayList<>();\n if (!value.toString().equals(\"\"))\n lines.add(value.toString());\n\n return lines;\n }", "public List<NeonValue> getValues();", "private Term[] parseTermList() throws ParseException {\n \n Term[] terms = new Term[1];\n int count = 0;\n \n Term term = parseTerm(false);\n \n while (term != null) {\n \n if (count >= terms.length) {\n Term[] temp = new Term[2 * terms.length];\n System.arraycopy(terms, 0, temp, 0, terms.length);\n terms = temp;\n }\n terms[count++] = term;\n \n int tt = _tokenizer.next();\n if (tt == ',') {\n term = parseTerm(true);\n } else {\n _tokenizer.pushBack();\n term = null;\n }\n }\n \n if (count < terms.length) {\n Term[] temp = new Term[count];\n System.arraycopy(terms, 0, temp, 0, count);\n terms = temp;\n }\n \n return terms;\n }", "public Listof<V> vals() {\n return this.bst.toSortedList().map(i -> i.right);\n }", "public Future<List<cn.vertxup.psi.domain.tables.pojos.POutTicket>> findManyBySigma(Collection<String> values) {\n return findManyByCondition(POutTicket.P_OUT_TICKET.SIGMA.in(values));\n }", "@Override\n\tpublic void visit(ValueListExpression arg0) {\n\t\t\n\t}", "public AllowedValues(final Collection<String> values){\n \n this.valueOrRange = new ArrayList<>();\n for (String value: values){\n valueOrRange.add(new ValueType(value));\n }\n }", "public List<String> getValues() {\n\t\treturn (new Vector<String>(this.values));\n\t}", "ArrayList<Term> getTerms() {\n ArrayList<Term> terms = new ArrayList<>();\n String[] columns = {\"id\", \"name\", \"start_date\", \"end_date\"};\n Cursor cursor = db.query(\"term\", columns, null, null, null, null, null);\n while (cursor.moveToNext()) {\n Term term = new Term();\n term.setId(cursor.getInt(0));\n term.setName(cursor.getString(1));\n term.setStartDate(cursor.getString(2));\n term.setEndDate(cursor.getString(3));\n terms.add(term);\n }\n return terms;\n }", "T[] getValues();", "public List<?> queryByCriteria(List<String> fields, List<Object> values,\n List<String> operands) throws DataAccessLayerException {\n return queryByCriteria(fields, values, operands, null, null, false);\n }", "java.util.List<java.lang.String>\n getStrValuesList();", "public Future<List<cn.vertxup.psi.domain.tables.pojos.POutTicket>> findManyByOpBy(Collection<String> values) {\n return findManyByCondition(POutTicket.P_OUT_TICKET.OP_BY.in(values));\n }", "public ArrayList<Double> getValues() {\n\n ArrayList<Double> values = new ArrayList<Double>(); //create new arraylist to return\n FreqNode tmpNode; //create temp node \n\n //traverse entire table \n for (FreqNode node : frequencyTable) {\n //set node \n tmpNode = node;\n while (true) {\n if (tmpNode == null) {\n break;\n } else {\n //add value to node in table and cast to double \n values.add((node.getValue() * 1.0));\n //set it to the next node \n tmpNode = tmpNode.getNext();\n } //end else \n }//end if \n }\n // Return the keys\n return values;\n }", "public T values(final Iterable<Object> values) {\r\n\t\tfinal List<Object> v = new ArrayList<>();\r\n\t\tfor (final Object o : values)\r\n\t\t\tif (o != null)\r\n\t\t\t\tv.add(o);\r\n\t\treturn values(v.toArray(new Object[0]));\r\n\t}", "public List<String> getTermsForField(String field, Option<String[]> types) {\n final String facetName = \"terms\";\n final AggregationBuilder aggBuilder = AggregationBuilders.terms(facetName).field(field);\n final SearchSourceBuilder searchSource = new SearchSourceBuilder().aggregation(aggBuilder);\n final List<String> indices = new ArrayList<>();\n if (types.isSome()) {\n Arrays.stream(types.get()).forEach(t -> indices.add(this.getIndexName(t)));\n } else {\n Arrays.stream(getDocumentTypes()).forEach(t->indices.add(this.getIndexName(t)));\n }\n final SearchRequest searchRequest = new SearchRequest(indices.toArray(new String[0])).source(searchSource);\n try {\n final SearchResponse response = getClient().search(searchRequest, RequestOptions.DEFAULT);\n\n final List<String> terms = new ArrayList<>();\n final Terms aggs = response.getAggregations().get(facetName);\n\n for (Bucket bucket : aggs.getBuckets()) {\n terms.add(bucket.getKey().toString());\n }\n\n return terms;\n } catch (IOException e) {\n return chuck(e);\n }\n }", "@Override\n List<Value> values();", "public List<?> queryByCriteria(List<String> fields, List<Object> values)\n throws DataAccessLayerException {\n return queryByCriteria(fields, values, null, null, null, false);\n }", "@NotNull\n private static List<Object> toVariableValues(List<Value> arrayValues) {\n return arrayValues.stream()\n .map(ValueToVariableValueCompiler::toVariableValue)\n .collect(toList());\n }", "public abstract Set<String> getTerms(Document doc);", "java.util.List<com.google.api.servicecontrol.v1.MetricValue> getMetricValuesList();", "public List<ValueObject> getValueObjects()\r\n {\r\n List<ValueObject> vos = new ArrayList<ValueObject>();\r\n vos.add(getValueObject());\r\n return vos;\r\n }", "public ListVS<V> getValues() {\n ListVS<V> result = new ListVS<V>(getUniverse());\n for (V value : this.entries.values()) {\n result = result.add(value);\n }\n return result;\n }", "Listof<V> sortedVals();", "public TermsList getTermsList() {\n\t\treturn termsList;\n\t}", "private Set<CharacteristicValueObject> ontology2CharacteristicValueObject( Collection<OntologyTerm> ontologyTerms ) {\n\n Set<CharacteristicValueObject> characteristicsVO = new HashSet<CharacteristicValueObject>();\n\n for ( OntologyTerm ontologyTerm : ontologyTerms ) {\n CharacteristicValueObject phenotype = new CharacteristicValueObject( ontologyTerm.getLabel().toLowerCase(),\n ontologyTerm.getUri() );\n characteristicsVO.add( phenotype );\n }\n return characteristicsVO;\n }", "private static ArrayList<HistoryValue> convertToRPN(List<HistoryValue> historyValues) {\n ArrayList<HistoryValue> outputList = new ArrayList<>();\n ArrayList<OperatorValue> operatorList = new ArrayList<>();\n for (HistoryValue token : historyValues) {\n handleNumber(outputList, token);\n handleLeftParenthesis(operatorList, token);\n handleRightParenthesis(outputList, operatorList, token);\n handleOperator(outputList, operatorList, token);\n }\n putOperatorsOntoOutput(outputList, operatorList);\n return outputList;\n }", "public static <T extends Entidad> List<Object> buildValueList(T... entityList) {\r\n\t\tList<Object> values = new ArrayList<Object>();\r\n\t\tif (!ObjectUtils.isEmpty(entityList)) {\r\n\t\t\tfor (T entity: entityList) {\r\n\t\t\t\tvalues.add(entity.getValue());\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn values;\r\n\t}", "@Override\r\n\tpublic Collection<V> values() {\r\n\t\tCollection<V> valueList = new ArrayList<V>();\r\n\t\tfor (Object o : buckets) {\r\n\t\t\tBucket b = (Bucket) o;\r\n\t\t\tvalueList.addAll(b.values());\r\n\t\t}\r\n\t\treturn valueList;\r\n\t}", "public List<V> values() {\n return values;\n }", "public List<V> values() {\n return values;\n }", "public Future<List<cn.vertxup.psi.domain.tables.pojos.POutTicket>> findManyBySerial(Collection<String> values) {\n return findManyByCondition(POutTicket.P_OUT_TICKET.SERIAL.in(values));\n }", "public List getValues() {\r\n\t\tif (this.values == null) {\r\n\t\t\tthis.values = new ArrayList();\r\n\t\t}\r\n\t\treturn values;\r\n\t}", "public static <V> LinkedHashSet<V> asSet(V... values) {\n LinkedHashSet<V> ans = new LinkedHashSet<V>();\n for (int i = 0; i < values.length; i++)\n ans.add(values[i]);\n return ans;\n }", "public List<V> values()\r\n\t{\r\n\t\tList<V> values = new ArrayList<V>();\r\n\t\t\r\n\t\tfor(Entry element : data)\r\n\t\t{\r\n\t\t\tvalues.add(element.value);\r\n\t\t}\r\n\t\t\t\t\r\n\t\treturn values;\r\n\t}", "private String[] termsArray(Scanner scan){\r\n\t\tArrayList<String> list = new ArrayList<String>();\r\n\t\twhile (scan.hasNext()) {\r\n\t\t\tlist.add(scan.next());\r\n\t\t}\r\n\t\treturn (String[]) list.toArray(new String[0]);\r\n\t}", "java.util.List<it.unipr.aotlab.dmat.core.generated.MatrixPieceTripletsBytesWire.Triplet> \n getValuesList();", "private ArrayList<String> obtenerIds(ArrayList<String> values){\n\t\tArrayList<String> ids = new ArrayList<>();\n\t\tfor(String valor : values){\n\t\t\tids.add(postresId.get(valor));\n\t\t}\n\t\treturn ids;\n\t}", "@Override\n public Collection<T> values() {\n List<T> values = new ArrayList<>();\n for (Map.Entry<String, T> v : entries.values()) {\n values.add(v.getValue());\n }\n return values;\n }", "public T values(final Object... values) {\r\n\t\treturn op(ConditionValueType.VALUE, values);\r\n\t}", "public void addValues(String[] values) {\n this.values.addAll(Arrays.asList(values));\n }", "public static String list(List values, boolean quoteValue) {\n StringBuffer row = new StringBuffer();\n list(row, values, quoteValue);\n\n return row.toString();\n }", "ListOfValuesType createListOfValuesType();", "public static JCardValue multi(Object... values) {\n\t\treturn multi(Arrays.asList(values));\n\t}", "public Future<List<cn.vertxup.psi.domain.tables.pojos.POutTicket>> findManyByToAddress(Collection<String> values) {\n return findManyByCondition(POutTicket.P_OUT_TICKET.TO_ADDRESS.in(values));\n }", "@JsonIgnore\n List<T> getValues();", "public List<Stmt> convertToStmtList(Term... terms) {\n List<Stmt> stmts = new ArrayList<Stmt> (terms.length);\n for (Term term : terms) {\n if (term instanceof Expr) {\n term = xnf.Eval(term.position(), (Expr) term);\n } else if (!(term instanceof Stmt)) {\n throw new IllegalArgumentException(\"Invalid argument type: \"+term.getClass());\n }\n stmts.add((Stmt) term);\n }\n return stmts;\n }", "public Element.Builder setValues(final List<Sample> value) {\n _values = value;\n return this;\n }", "Values values();", "List<String> getLookupValues();", "private <TKey extends Comparable<TKey>, TValue> List<TValue> createValues(List<IKeyValueNode<TKey, TValue>> data) {\n List<TValue> values = new ArrayList<>();\n\n for (IKeyValueNode<TKey, TValue> node : data) {\n values.add(node.getValue());\n }\n\n return values;\n }", "public String[] getValues()\n {\n return values;\n }", "Collection<V> values();", "Collection<V> values();", "Object[] getValues();", "Object[] getValues();", "public static List<String> formPossibleValues(String enumeraion){\n\t\tList<String> ret = new ArrayList<String>();\n\t\tfor (String value : enumeraion.split(\";\"))\n\t\t\tret.add(value);\n\t\t\n\t\treturn ret;\n\t}", "public ArrayList<String> getTerms () throws FileNotFoundException {\n String inputFile = getInputFile();\r\n Scanner scanner = new Scanner (new File (inputFile));\r\n ArrayList<String> terms = new ArrayList<String>();\r\n ArrayList<String> definitions = new ArrayList<String>();\r\n while (scanner.hasNextLine()) {\r\n terms.add(scanner.nextLine()); //took out .toLowerCase() part so it prints correctly \r\n definitions.add(scanner.nextLine());\r\n }\r\n return terms;\r\n }", "public Listof<V> sortedVals() {\n return this.bst.toSortedList().map(i -> i.right);\n }", "@Override\r\n\t\t\tpublic String[] getTerms(Document doc) {\n\t\t\t\treturn null;\r\n\t\t\t}", "public Future<List<cn.vertxup.psi.domain.tables.pojos.POutTicket>> findManyByTags(Collection<String> values) {\n return findManyByCondition(POutTicket.P_OUT_TICKET.TAGS.in(values));\n }", "public static java.util.Collection literals()\n {\n final java.util.Collection<String> literals = new java.util.ArrayList<String>(values().length);\n for (int i = 0; i < values().length; i++)\n {\n literals.add(values()[i].name());\n }\n return literals;\n }", "@Nonnull\n public <T extends Serializable> List<T> getValues() {\n final T[] ary = values();\n return Arrays.asList(ary);\n }", "public Future<List<cn.vertxup.psi.domain.tables.pojos.POutTicket>> findManyByType(Collection<String> values) {\n return findManyByCondition(POutTicket.P_OUT_TICKET.TYPE.in(values));\n }", "@Override\n\tpublic Collection<V> values() {\n\t\tList<V> list = Util.newList();\n\t\tfor (K key : keys) {\n\t\t\tlist.add(map.get(key));\n\t\t}\n\t\t\n\t\treturn list;\n\t}", "public List<String> stem(List<String> terms) {\r\n\t\tPaiceHuskStemmer stemmer = null;\r\n\t\ttry {\r\n\t\t\tstemmer = PaiceHuskStemmer.getInstance(SVMClassifier.class.getClassLoader().getResource(\"stemrules.txt\").openStream());\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tstemmer.setPreStrip(false);\r\n\t\tfor (int i = 0; i < terms.size(); i++) {\r\n\t\t\tString w = terms.get(i);\r\n\t\t\tterms.set(i, stemmer.stripAffixes(w));\r\n\t\t}\r\n\t\treturn terms;\r\n\t}", "@Override\n\tprotected void generateTerms() {\t\t\n\t\tString[] terms = this.data.substring(this.semiColonIndex+6,this.data.length()).split(\"(?=-|\\\\+)\"); // splits string by \"-\" or \"+\" into array of terms\n\t\t\n\t\tfor (String numeric_term : terms) {\n \t\t \n\t\t\tint power;\n \t try {\n \t\t power = Integer.parseInt(numeric_term.charAt(numeric_term.length()-1) + \"\");\n \t } catch (NumberFormatException e) {\n \t\t power = 1; // to the power of 1 same as having no power\n \t }\n \t \n \t\t int multiplier;\n \t try {\n \t\t multiplier = Integer.parseInt(numeric_term.substring(1,3)); // works if 2 digit multiplier\n \t } catch (NumberFormatException e) {\n \t\t multiplier = Integer.parseInt(numeric_term.charAt(1) + \"\"); // works if 1 digit multiplier\n \t }\n \t\t \n \t\t String action = numeric_term.charAt(0) + \"\";\n \t\t \n \t\t Term term = new Term(power, multiplier, action);\n \t\t equation.addTerm(term); // add terms to equation object \n\t\t} \n\n\t}", "public static TreeNode buildTreeFromList(int... values) {\n TreeNode root = null;\n for(int val: values) {\n root = insert(root, val);\n }\n return root;\n }", "public Future<List<cn.vertxup.psi.domain.tables.pojos.POutTicket>> findManyByLanguage(Collection<String> values) {\n return findManyByCondition(POutTicket.P_OUT_TICKET.LANGUAGE.in(values));\n }", "public List<com.dator.jqtest.dao.model.tables.pojos.Route> fetchByStrategies(String... values) {\n return fetch(Route.ROUTE.STRATEGIES, values);\n }", "public void makeQueryTermList() {\n for (int i = 0; i < this.stemmed_query.size(); i++) {\n boolean added = false;\n String curTerm = this.stemmed_query.get(i);\n for (int j = 0; j < this.query_terms_list.size(); j++) {\n if (this.query_terms_list.get(j).strTerm.compareTo(curTerm) == 0) {\n this.query_terms_list.get(j).timeOccur++;\n added = true;\n break;\n }\n }\n if (added == false) {\n this.query_terms_list.add(new QueryTerm(curTerm));\n }\n }\n }", "public List<Term> getAllTerms() {\n\t\tsession.beginTransaction();\n\t\tList<Term> lis = session.createQuery(\"from Term\").list();\n\n\t\tfor (Term tm : lis) {\n\t\t\tSystem.out.println(tm.getId() + \" \" + tm.getTermName());\n\t\t}\n\t\treturn lis;\n\t}", "public Collection<T> coerce(String value,\n IParameterHandler<T> secondaryHandler)\n {\n String stripped = value.substring(value.indexOf(\"(\") + 1, value\n .lastIndexOf(\")\"));\n\n if (LOGGER.isDebugEnabled())\n LOGGER.debug(\"Stripped \" + value + \" to \" + stripped);\n\n /*\n * split at ,\n */\n String[] splits = stripped.split(\",\");\n List<T> rtn = new ArrayList<T>(splits.length);\n\n for (String split : splits)\n {\n split = split.trim();\n if (split.length() != 0)\n try\n {\n T secondary = secondaryHandler.coerce(split);\n rtn.add(secondary);\n }\n catch (Exception e)\n {\n LOGGER.error(\"Failed to coerce \" + split + \" with secondary handler \"\n + secondaryHandler, e);\n }\n }\n\n return rtn;\n }", "public static List<Term> findByUuid(\n\t\tString uuid, int start, int end,\n\t\tOrderByComparator<Term> orderByComparator) {\n\n\t\treturn getPersistence().findByUuid(uuid, start, end, orderByComparator);\n\t}", "@Override\n public List<? extends BusinessObject> getSearchResultsUnbounded(Map<String, String> fieldValues) {\n Collection searchResultsCollection;\n // Get the list and Convert to suitable list\n searchResultsCollection = getInvoiceDocumentsForReferralToCollectionsLookup(fieldValues);\n return this.buildSearchResultList(searchResultsCollection, new Long(searchResultsCollection.size()));\n }", "public Future<List<cn.vertxup.psi.domain.tables.pojos.POutTicket>> findManyByTypeBusiness(Collection<String> values) {\n return findManyByCondition(POutTicket.P_OUT_TICKET.TYPE_BUSINESS.in(values));\n }", "public CSVList(List<String> values)\n\t{\n\t\tsuper(values, sepReg, sep);\n\t}", "public Future<List<cn.vertxup.psi.domain.tables.pojos.POutTicket>> findManyByApprovedBy(Collection<String> values) {\n return findManyByCondition(POutTicket.P_OUT_TICKET.APPROVED_BY.in(values));\n }", "public Object[] getValues();" ]
[ "0.6775762", "0.61286527", "0.609638", "0.60908514", "0.607587", "0.6007632", "0.5961191", "0.5849253", "0.5807955", "0.56664723", "0.55516", "0.55023795", "0.54796934", "0.5435829", "0.54248637", "0.5418649", "0.5409392", "0.53975683", "0.5351346", "0.5345938", "0.5263766", "0.5254792", "0.5231208", "0.52272385", "0.52196264", "0.52041054", "0.51741654", "0.51732725", "0.5162758", "0.5147598", "0.51417214", "0.5135991", "0.51238275", "0.50963", "0.5095095", "0.50906837", "0.5089165", "0.50841224", "0.5068484", "0.5066648", "0.50625485", "0.50582606", "0.50503343", "0.50497943", "0.50440115", "0.5027575", "0.4993121", "0.49904647", "0.49815616", "0.4969567", "0.49617958", "0.49617958", "0.49527496", "0.4949303", "0.4947967", "0.4947563", "0.49388245", "0.49387574", "0.49373773", "0.49290642", "0.4910494", "0.49037185", "0.48971313", "0.48955533", "0.48820335", "0.4873486", "0.4866602", "0.48648137", "0.4861947", "0.4859812", "0.4850444", "0.48393387", "0.48378474", "0.4836177", "0.4836177", "0.48304653", "0.48304653", "0.48293316", "0.48270386", "0.48176908", "0.48151612", "0.48133126", "0.48125136", "0.481111", "0.48067242", "0.48046795", "0.48034", "0.4794278", "0.4783842", "0.4781117", "0.478031", "0.47778612", "0.47719657", "0.47663713", "0.47629842", "0.47556776", "0.47415188", "0.47361743", "0.473082", "0.47291622" ]
0.7809451
0
jhipsterneedleentityaddfield JHipster will add fields here, do not remove
public String getId() { return id; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void addField(\n JavaSymbolName propertyName,\n JavaType propertyType,\n String columnName,\n String columnType,\n JavaType className,\n boolean id,\n boolean oneToOne, boolean oneToMany, boolean manyToOne, boolean manyToMany, String mappedBy);", "Builder addMainEntity(String value);", "@Override\n\tpublic void save(Field entity) {\n\t\t\n\t}", "public void updateNonDynamicFields() {\n\n\t}", "public void setupFields()\n {\n FieldInfo field = null;\n field = new FieldInfo(this, \"ID\", Constants.DEFAULT_FIELD_LENGTH, null, null);\n field.setDataClass(Integer.class);\n field.setHidden(true);\n field = new FieldInfo(this, \"LastChanged\", Constants.DEFAULT_FIELD_LENGTH, null, null);\n field.setDataClass(Date.class);\n field.setHidden(true);\n field = new FieldInfo(this, \"Deleted\", 10, null, new Boolean(false));\n field.setDataClass(Boolean.class);\n field.setHidden(true);\n field = new FieldInfo(this, \"Description\", 25, null, null);\n field = new FieldInfo(this, \"CurrencyCode\", 3, null, null);\n field = new FieldInfo(this, \"LastRate\", 10, null, null);\n field.setDataClass(Double.class);\n field.setScale(-1);\n field = new FieldInfo(this, \"RateChangedDate\", 12, null, null);\n field.setDataClass(Date.class);\n field.setScale(Constants.DATE_ONLY);\n field = new FieldInfo(this, \"RateChangedBy\", 16, null, null);\n field.setDataClass(Integer.class);\n field = new FieldInfo(this, \"CostingRate\", 10, null, null);\n field.setDataClass(Double.class);\n field.setScale(-1);\n field = new FieldInfo(this, \"CostingChangedDate\", 12, null, null);\n field.setDataClass(Date.class);\n field.setScale(Constants.DATE_ONLY);\n field = new FieldInfo(this, \"CostingChangedBy\", 16, null, null);\n field.setDataClass(Integer.class);\n field = new FieldInfo(this, \"RoundAt\", 1, null, null);\n field.setDataClass(Short.class);\n field = new FieldInfo(this, \"IntegerDesc\", 20, null, \"Dollar\");\n field = new FieldInfo(this, \"FractionDesc\", 20, null, null);\n field = new FieldInfo(this, \"FractionAmount\", 10, null, new Integer(100));\n field.setDataClass(Integer.class);\n field = new FieldInfo(this, \"Sign\", 3, null, \"$\");\n field = new FieldInfo(this, \"LanguageID\", Constants.DEFAULT_FIELD_LENGTH, null, null);\n field.setDataClass(Integer.class);\n field = new FieldInfo(this, \"NaturalInteger\", 20, null, null);\n field = new FieldInfo(this, \"NaturalFraction\", 20, null, null);\n }", "public ChangeFieldEf() {\r\n\t\tthis(null, null);\r\n\t}", "@Override\r\n protected void createDbContentCreateEdit() {\n DbContentCreateEdit dbContentCreateEdit = new DbContentCreateEdit();\r\n dbContentCreateEdit.init(null);\r\n form.getModelObject().setDbContentCreateEdit(dbContentCreateEdit);\r\n dbContentCreateEdit.setParent(form.getModelObject());\r\n ruServiceHelper.updateDbEntity(form.getModelObject()); \r\n }", "Builder addMainEntity(Thing value);", "private void addFieldToBook(String config_id, GOlrField field) {\n if (!unique_fields.containsKey(field.id)) {\n unique_fields.put(field.id, field);\n } else {\n // check if defined fields are equivalent\n if (!unique_fields.get(field.id).equals(field)) {\n throw new IllegalStateException(field.id + \" is defined twice with different properties.\\n\"\n + unique_fields.get(field.id) + \"\\n\" + field);\n }\n }\n // Ensure presence of comments (description) list.\n if (!collected_comments.containsKey(field.id)) {\n collected_comments.put(field.id, new ArrayList<String>());\n }\n // And add to it if there is an available description.\n if (field.description != null) {\n ArrayList<String> comments = collected_comments.get(field.id);\n comments.add(\" \" + config_id + \": \" + field.description + \" \");\n collected_comments.put(field.id, comments);\n }\n }", "public void addField(TemplateField field)\r\n{\r\n\tfields.addElement(field);\r\n}", "@Override\r\n public void createNewEntity(String entityName) {\n\r\n }", "public PimsSysReqFieldDaoHibernate() {\n super(PimsSysReqField.class);\n }", "protected void addField(InstanceContainer container, Form form, MetaProperty metaProperty, boolean isReadonly) {\n MetaClass metaClass = container.getEntityMetaClass();\n Range range = metaProperty.getRange();\n\n boolean isRequired = isRequired(metaProperty);\n\n UiEntityAttributeContext attributeContext = new UiEntityAttributeContext(metaClass, metaProperty.getName());\n accessManager.applyRegisteredConstraints(attributeContext);\n\n if (!attributeContext.canView())\n return;\n\n if (range.isClass()) {\n UiEntityContext entityContext = new UiEntityContext(range.asClass());\n accessManager.applyRegisteredConstraints(entityContext);\n if (!entityContext.isViewPermitted()) {\n return;\n }\n }\n\n ValueSource valueSource = new ContainerValueSource<>(container, metaProperty.getName());\n\n ComponentGenerationContext componentContext =\n new ComponentGenerationContext(metaClass, metaProperty.getName());\n componentContext.setValueSource(valueSource);\n\n Field field = (Field) uiComponentsGenerator.generate(componentContext);\n\n if (requireTextArea(metaProperty, getItem(), MAX_TEXTFIELD_STRING_LENGTH)) {\n field = uiComponents.create(TextArea.NAME);\n }\n\n if (isBoolean(metaProperty)) {\n field = createBooleanField();\n }\n\n if (range.isClass()) {\n EntityPicker pickerField = uiComponents.create(EntityPicker.class);\n\n EntityLookupAction lookupAction = actions.create(EntityLookupAction.class);\n lookupAction.setScreenClass(EntityInspectorBrowser.class);\n lookupAction.setScreenOptionsSupplier(() -> new MapScreenOptions(\n ParamsMap.of(\"entity\", metaProperty.getRange().asClass().getName())));\n lookupAction.setOpenMode(OpenMode.THIS_TAB);\n\n pickerField.addAction(lookupAction);\n pickerField.addAction(actions.create(EntityClearAction.class));\n\n field = pickerField;\n }\n\n field.setValueSource(valueSource);\n field.setCaption(getPropertyCaption(metaClass, metaProperty));\n field.setRequired(isRequired);\n\n isReadonly = isReadonly || (disabledProperties != null && disabledProperties.contains(metaProperty.getName()));\n if (range.isClass() && !metadataTools.isEmbedded(metaProperty)) {\n field.setEditable(metadataTools.isOwningSide(metaProperty) && !isReadonly);\n } else {\n field.setEditable(!isReadonly);\n }\n\n field.setWidth(fieldWidth);\n\n if (isRequired) {\n field.setRequiredMessage(messageTools.getDefaultRequiredMessage(metaClass, metaProperty.getName()));\n }\n form.add(field);\n }", "FieldDefinition createFieldDefinition();", "public interface ExtendedFieldGroupFieldFactory extends FieldGroupFieldFactory\r\n{\r\n\t<T> CRUDTable<T> createTableField(Class<T> genericType, boolean manyToMany);\r\n}", "public interface JdlFieldView extends JdlField, JdlCommentView {\n //TODO This validation should be handled in JdlService\n default String getTypeName() {\n JdlFieldEnum type = getType();\n return switch (type) {\n case ENUM -> getEnumEntityName()\n .orElseThrow(() -> new IllegalStateException(\"An enum field must have its enum entity name set\"));\n default -> ((\"UUID\".equals(type.name())) ? type.name() : type.toCamelUpper());\n };\n }\n\n default String constraints() {\n List<String> constraints = new ArrayList<>();\n if (renderRequired()) constraints.add(requiredConstraint());\n if (isUnique()) constraints.add(uniqueConstraint());\n getMin().ifPresent(min -> constraints.add(minConstraint(min)));\n getMax().ifPresent(max -> constraints.add(maxConstraint(max)));\n getPattern().ifPresent(pattern -> constraints.add(patternConstraint(pattern)));\n return (!constraints.isEmpty()) ? \" \".concat(Joiner.on(\" \").join(constraints)) : null;\n }\n\n // TODO do not write required when field is primary key\n default boolean renderRequired() {\n // if (!isPrimaryKey() && isRequired() && ) constraints.add(JdlUtils.validationRequired());\n return isRequired() && !(getName().equals(\"id\") && getType().equals(JdlFieldEnum.UUID));\n }\n\n @NotNull\n default String requiredConstraint() {\n return \"required\";\n }\n\n @NotNull\n default String uniqueConstraint() {\n return \"unique\";\n }\n\n default String minConstraint(int min) {\n return switch (getType()) {\n case STRING -> validationMinLength(min);\n default -> validationMin(min);\n };\n }\n\n default String maxConstraint(int max) {\n return switch (getType()) {\n case STRING -> validationMaxLength(max);\n default -> validationMax(max);\n };\n }\n\n //TODO This validation should be handled in JdlService\n default String patternConstraint(String pattern) {\n return switch (getType()) {\n case STRING -> validationPattern(pattern);\n default -> throw new RuntimeException(\"Only String can have a pattern\");\n };\n }\n\n @NotNull\n default String validationMax(final int max) {\n return \"max(\" + max + \")\";\n }\n\n @NotNull\n default String validationMin(final int min) {\n return \"min(\" + min + \")\";\n }\n\n default String validationMaxLength(final int max) {\n return \"maxlength(\" + max + \")\";\n }\n\n @NotNull\n default String validationMinLength(final int min) {\n return \"minlength(\" + min + \")\";\n }\n\n @NotNull\n default String validationPattern(final String pattern) {\n return \"pattern(/\" + pattern + \"/)\";\n }\n}", "@attribute(value = \"\", required = true)\t\r\n\tpublic void addField(Field f) {\r\n\t\tfields.put(\"\" + fieldCount++, f);\r\n\t}", "@Override\r\n\tpublic void addField(Field field) \r\n\t{\r\n\t\tif(this.fields == null)\r\n\t\t{\r\n\t\t\tthis.fields = new ArrayList<>();\r\n\t\t}\r\n\t\tthis.fields.add(field);\r\n\t}", "void SaveBudgetKeyAdditional(BudgetKeyAdditionalEntity budgetKeyAdditionalEntity);", "public void createField(Field field) {\n Span span = this.tracer.buildSpan(\"Client.CreateField\").start();\n try {\n String path = String.format(\"/index/%s/field/%s\", field.getIndex().getName(), field.getName());\n String body = field.getOptions().toString();\n ByteArrayEntity data = new ByteArrayEntity(body.getBytes(StandardCharsets.UTF_8));\n clientExecute(\"POST\", path, data, null, \"Error while creating field\");\n } finally {\n span.finish();\n }\n }", "@Test\n\tpublic void testFieldCRUDConfig() {\n\t\tfinal IntrospectionResult introspection = getIntrospection();\n\t\tfinal String entityInputTypeName = Entity6.class.getSimpleName() + schemaConfig.getInputTypeNameSuffix();\n\t\tfinal IntrospectionFullType entityInputType = getFullType(introspection, entityInputTypeName);\n\t\tfinal String entity6TypeName = Entity6.class.getSimpleName();\n\t\tfinal IntrospectionFullType entityType = getFullType(introspection, entity6TypeName);\n\t\t// Check field attr1 is not readable\n\t\tfinal Optional<IntrospectionTypeField> attr1Field = getOptionalField(entityType, \"attr1\");\n\t\tAssert.assertFalse(\n\t\t\t\tMessage.format(\"There shouldn't be a readable field [{}] in [{}].\", \"typeField\", entity6TypeName),\n\t\t\t\tattr1Field.isPresent());\n\t\t// Check field attr2 is not saveable\n\t\tfinal Optional<IntrospectionInputValue> attr2InputField = getOptionalInputField(entityInputType, \"attr2\");\n\t\tAssert.assertFalse(\n\t\t\t\tMessage.format(\"There shouldn't be a not saveable field [{}] in [{}].\", \"attr2\", entityInputTypeName),\n\t\t\t\tattr2InputField.isPresent());\n\t\t// Check field attr3 is not nullable\n\t\tassertInputField(entityInputType, \"attr3\", IntrospectionTypeKindEnum.SCALAR, Scalars.GraphQLString.getName());\n\t\t// Check field attr4 is not nullableForCreate\n\t\tassertInputField(entityInputType, \"attr4\", IntrospectionTypeKindEnum.SCALAR, Scalars.GraphQLString.getName());\n\t\t// Check field attr5 is not nullableForUpdate\n\t\tassertInputField(entityInputType, \"attr5\", IntrospectionTypeKindEnum.SCALAR, Scalars.GraphQLString.getName());\n\t\t// Check field attr6 is not filterable\n\t\tfinal String entityFilterTypeName = Entity6.class.getSimpleName()\n\t\t\t\t+ schemaConfig.getQueryGetListFilterEntityTypeNameSuffix();\n\t\tfinal IntrospectionFullType entityFilterInputType = getFullType(introspection, entityFilterTypeName);\n\t\tfinal Optional<IntrospectionInputValue> attr4IinputField = getOptionalInputField(entityFilterInputType,\n\t\t\t\t\"attr6\");\n\t\tAssert.assertFalse(\n\t\t\t\tMessage.format(\"There shouldn't be a filterable field [{}] in [{}].\", \"attr6\", entityFilterTypeName),\n\t\t\t\tattr4IinputField.isPresent());\n\t\t// Check field attr7 is mandatory\n\t\t// Check field attr8 is mandatory for update\n\t\t// Check field attr9 is mandatory for create\n\n\t\t// Check field attr10 is not readable for ROLE1\n\t\t// Check field attr10 is not readable for ROLE1\n\n\t\t// Check field attr11 is not saveable for ROLE1\n\n\t\t// Check field attr12 is not nullable for ROLE1\n\n\t\t// Check field attr13 is not nullable for update for ROLE1\n\n\t\t// Check field attr14 is not nullable for create for ROLE1\n\n\t\t// Check field attr15 is mandatory for ROLE1\n\n\t\t// Check field attr16 is mandatory for update for ROLE1\n\n\t\t// Check field attr17 is mandatory for create for ROLE1\n\n\t\t// Check field attr18 is not readable for ROLE1 and ROLE2\n\n\t\t// Check field attr19 is not readable for ROLE1 and ROLE2\n\n\t\t// Check field attr20 is not readable for ROLE1 and not saveable ROLE2\n\n\t\t// Check field attr21 is not readable and not nullable for ROLE1 and\n\t\t// ROLE2\n\n\t\t// Check field attr21 is readable and nullable for other roles than ROLE\n\t\t// 1 and ROLE2\n\n\t\t// Check field attr22 is readable for ROLE1\n\n\t\t// Check field attr22 is not readable for everybody except ROLE1\n\t}", "public void addField()\n {\n DefaultMutableTreeNode node = (DefaultMutableTreeNode) availableFieldsComp.getTree().getLastSelectedPathComponent();\n if (node == null || !node.isLeaf() || !(node.getUserObject() instanceof DataObjDataFieldWrapper) )\n {\n return; // not really a field that can be added, just empty or a string\n }\n\n Object obj = node.getUserObject();\n if (obj instanceof DataObjDataFieldWrapper)\n {\n DataObjDataFieldWrapper wrapper = (DataObjDataFieldWrapper) obj;\n String sep = sepText.getText();\n if (StringUtils.isNotEmpty(sep))\n {\n try\n {\n DefaultStyledDocument doc = (DefaultStyledDocument) formatEditor.getStyledDocument();\n if (doc.getLength() > 0)\n {\n doc.insertString(doc.getLength(), sep, null);\n }\n }\n catch (BadLocationException ble) {}\n \n }\n insertFieldIntoTextEditor(wrapper);\n setHasChanged(true);\n }\n }", "Builder addMainEntity(Thing.Builder value);", "public interface FieldPopulator\n{\n List<String> getCoreFields();\n\n List<String> getSupportedFields();\n\n String getUriTemplate();\n}", "void addFieldBinding( FieldBinding binding );", "@Override\n\tprotected void initializeFields() {\n\n\t}", "public void setEntityAddDate(String entityAddDate);", "@Test\n public void createCustomFieldTest() throws ApiException {\n CustomFieldDefinitionJsonBean body = null;\n FieldDetails response = api.createCustomField(body);\n\n // TODO: test validations\n }", "protected void createFields()\n {\n createEffectiveLocalDtField();\n createDiscontinueLocalDtField();\n createScanTypeField();\n createContractNumberField();\n createContractTypeField();\n createProductTypeField();\n createStatusIndicatorField();\n createCivilMilitaryIndicatorField();\n createEntryUserIdField();\n createLastUpdateUserIdField();\n createLastUpdateTsField();\n }", "private void addField(JField jfield) {\n\n // Check for storage ID conflict; note we can get this legitimately when a field is declared only\n // in supertypes, where two of the supertypes are mutually unassignable from each other. In that\n // case, verify that the generated field is the same.\n JField other = this.jfields.get(jfield.storageId);\n if (other != null) {\n\n // If the descriptions differ, no need to give any more details\n if (!other.toString().equals(jfield.toString())) {\n throw new IllegalArgumentException(\"illegal duplicate use of storage ID \"\n + jfield.storageId + \" for both \" + other + \" and \" + jfield);\n }\n\n // Check whether the fields are exactly the same; if not, there is a conflict\n if (!other.isSameAs(jfield)) {\n throw new IllegalArgumentException(\"two or more methods defining \" + jfield + \" conflict: \"\n + other.getter + \" and \" + jfield.getter);\n }\n\n // OK - they are the same thing\n return;\n }\n this.jfields.put(jfield.storageId, jfield);\n\n // Check for name conflict\n if ((other = this.jfieldsByName.get(jfield.name)) != null)\n throw new IllegalArgumentException(\"illegal duplicate use of field name `\" + jfield.name + \"' in \" + this);\n this.jfieldsByName.put(jfield.name, jfield);\n jfield.parent = this;\n\n // Logging\n if (this.log.isTraceEnabled())\n this.log.trace(\"added {} to object type `{}'\", jfield, this.name);\n }", "@Override\n public Field<?> createField(Container container, Object itemId,\n Object propertyId, Component uiContext) {\n Field<?> field = super.createField(container, itemId,\n propertyId, uiContext);\n\n // ...and just set them as immediate\n ((AbstractField<?>) field).setImmediate(true);\n\n // Also modify the width of TextFields\n if (field instanceof TextField)\n field.setWidth(\"100%\");\n field.setRequired(true);\n ((TextField) field).setInputPrompt(\"Введите назначение\");\n field.addStyleName(ValoTheme.LAYOUT_HORIZONTAL_WRAPPING);\n field.focus();\n\n return field;\n }", "private void setNewField(String fieldName) {\n setNewField(fieldName, DBCreator.STRING_TYPE, null);\n }", "@Mapper(componentModel = \"spring\", uses = {HopDongMapper.class})\npublic interface GhiNoMapper extends EntityMapper<GhiNoDTO, GhiNo> {\n\n @Mapping(source = \"hopDong.id\", target = \"hopDongId\")\n GhiNoDTO toDto(GhiNo ghiNo);\n\n @Mapping(source = \"hopDongId\", target = \"hopDong\")\n GhiNo toEntity(GhiNoDTO ghiNoDTO);\n\n default GhiNo fromId(Long id) {\n if (id == null) {\n return null;\n }\n GhiNo ghiNo = new GhiNo();\n ghiNo.setId(id);\n return ghiNo;\n }\n}", "private void handleIdFields(JFieldVar field, JsonNode propertyNode) {\n if (propertyNode.has(JpaConstants.IS_ID_COLUMN) && propertyNode.get(JpaConstants.IS_ID_COLUMN).asBoolean(true)) {\n field.annotate(Id.class);\n }\n\n if (propertyNode.has(JpaConstants.GENERATED_VALUE)) {\n JsonNode generatedValueNode = propertyNode.get(JpaConstants.GENERATED_VALUE);\n JAnnotationUse jAnnotationUse = field.annotate(GeneratedValue.class);\n if (generatedValueNode.has(JpaConstants.STRATEGY)) {\n jAnnotationUse.param(JpaConstants.STRATEGY, GenerationType.valueOf(generatedValueNode.get(JpaConstants.STRATEGY).asText()));\n }\n }\n }", "void addField(\n JavaSymbolName propertyName,\n JavaType propertyType,\n String columnName,\n String columnType,\n JavaType className\n );", "@Override\n\tpublic void save(List<Field> entity) {\n\t\t\n\t}", "@Test\n @Transactional\n void createCommonTableFieldWithExistingId() throws Exception {\n commonTableField.setId(1L);\n CommonTableFieldDTO commonTableFieldDTO = commonTableFieldMapper.toDto(commonTableField);\n\n int databaseSizeBeforeCreate = commonTableFieldRepository.findAll().size();\n\n // An entity with an existing ID cannot be created, so this API call must fail\n restCommonTableFieldMockMvc\n .perform(\n post(ENTITY_API_URL).contentType(MediaType.APPLICATION_JSON).content(TestUtil.convertObjectToJsonBytes(commonTableFieldDTO))\n )\n .andExpect(status().isBadRequest());\n\n // Validate the CommonTableField in the database\n List<CommonTableField> commonTableFieldList = commonTableFieldRepository.findAll();\n assertThat(commonTableFieldList).hasSize(databaseSizeBeforeCreate);\n }", "HxField createField(final String fieldType,\n final String fieldName);", "public static CommonTableField createUpdatedEntity() {\n CommonTableField commonTableField = new CommonTableField()\n .title(UPDATED_TITLE)\n .entityFieldName(UPDATED_ENTITY_FIELD_NAME)\n .type(UPDATED_TYPE)\n .tableColumnName(UPDATED_TABLE_COLUMN_NAME)\n .columnWidth(UPDATED_COLUMN_WIDTH)\n .order(UPDATED_ORDER)\n .editInList(UPDATED_EDIT_IN_LIST)\n .hideInList(UPDATED_HIDE_IN_LIST)\n .hideInForm(UPDATED_HIDE_IN_FORM)\n .enableFilter(UPDATED_ENABLE_FILTER)\n .validateRules(UPDATED_VALIDATE_RULES)\n .showInFilterTree(UPDATED_SHOW_IN_FILTER_TREE)\n .fixed(UPDATED_FIXED)\n .sortable(UPDATED_SORTABLE)\n .treeIndicator(UPDATED_TREE_INDICATOR)\n .clientReadOnly(UPDATED_CLIENT_READ_ONLY)\n .fieldValues(UPDATED_FIELD_VALUES)\n .notNull(UPDATED_NOT_NULL)\n .system(UPDATED_SYSTEM)\n .help(UPDATED_HELP)\n .fontColor(UPDATED_FONT_COLOR)\n .backgroundColor(UPDATED_BACKGROUND_COLOR)\n .nullHideInForm(UPDATED_NULL_HIDE_IN_FORM)\n .endUsed(UPDATED_END_USED)\n .options(UPDATED_OPTIONS);\n return commonTableField;\n }", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface Record25HerfinancieeringMapper extends EntityMapper<Record25HerfinancieeringDTO, Record25Herfinancieering> {\n\n\n\n default Record25Herfinancieering fromId(Long id) {\n if (id == null) {\n return null;\n }\n Record25Herfinancieering record25Herfinancieering = new Record25Herfinancieering();\n record25Herfinancieering.setId(id);\n return record25Herfinancieering;\n }\n}", "protected synchronized void addFieldEntity(int fld_i, String entity) {\r\n // System.err.println(\"addFieldEntity(\" + fld_i + \",\\\"\" + entity + \"\\\")\");\r\n //\r\n // fld_i is used to indicate if this is a second iteration of addFieldEntity() to prevent\r\n // infinite recursion... not sure if it's correct... for example, what happens when\r\n // a post-processor transform converts a domain to an ip address - shouldn't that IP\r\n // address then be further decomposed?\r\n //\r\n if (fld_i != -1 && entity.equals(BundlesDT.NOTSET)) {\r\n ent_2_i.put(BundlesDT.NOTSET, -1); \r\n fld_dts.get(fld_i).add(BundlesDT.DT.NOTSET);\r\n\r\n //\r\n // Decompose a tag into it's basic elements\r\n //\r\n } else if (fld_i != -1 && fieldHeader(fld_i).equals(BundlesDT.TAGS)) {\r\n addFieldEntity(-1,entity); // Add the tag itself\r\n Iterator<String> it = Utils.tokenizeTags(entity).iterator();\r\n while (it.hasNext()) {\r\n String tag = it.next(); addFieldEntity(-1, tag);\r\n\tif (Utils.tagIsHierarchical(tag)) {\r\n String sep[] = Utils.tagDecomposeHierarchical(tag);\r\n\t for (int i=0;i<sep.length;i++) addFieldEntity(-1, sep[i]);\r\n\t} else if (Utils.tagIsTypeValue(tag)) {\r\n String sep[] = Utils.separateTypeValueTag(tag);\r\n\t tag_types.add(sep[0]);\r\n\t addFieldEntity(-1,sep[1]);\r\n\t}\r\n }\r\n\r\n //\r\n // Otherwise, keep track of the datatype to field correlation and run post\r\n // processors on the item to have those lookups handy.\r\n //\r\n } else {\r\n // System.err.println(\"determining datatype for \\\"\" + entity + \"\\\"\"); // DEBUG\r\n BundlesDT.DT datatype = BundlesDT.getEntityDataType(entity); if (dt_count_lu.containsKey(datatype) == false) dt_count_lu.put(datatype,0);\r\n // System.err.println(\"datatype for \\\"\" + entity + \"\\\" ==> \" + datatype); // DEBUG\r\n if (datatype != null) {\r\n// System.err.println(\"390:fld_i = \" + fld_i + \" (\" + fld_dts.containsKey(fld_i) + \")\"); // abc DEBUG\r\n// try { System.err.println(\" \" + fieldHeader(fld_i)); } catch (Throwable t) { } // abc DEBUG\r\n if (fld_i != -1) fld_dts.get(fld_i).add(datatype);\r\n if (ent_2_i.containsKey(entity) == false) {\r\n\t // Use special rules to set integer correspondance\r\n\t switch (datatype) {\r\n\t case IPv4: ent_2_i.put(entity, Utils.ipAddrToInt(entity)); break;\r\n\t case IPv4CIDR: ent_2_i.put(entity, Utils.ipAddrToInt((new StringTokenizer(entity, \"/\")).nextToken())); break;\r\n\t case INTEGER: ent_2_i.put(entity, Integer.parseInt(entity)); \r\n\t if (warn_on_float_conflict) checkForFloatConflict(fld_i);\r\n\t break;\r\n case FLOAT: ent_2_i.put(entity, Float.floatToIntBits(Float.parseFloat(entity))); \r\n\t if (warn_on_float_conflict) checkForFloatConflict(fld_i);\r\n break;\r\n\t case DOMAIN: ent_2_i.put(entity, Utils.ipAddrToInt(\"127.0.0.2\") + dt_count_lu.get(datatype)); // Put Domains In Unused IPv4 Space\r\n\t dt_count_lu.put(datatype, dt_count_lu.get(datatype) + 1);\r\n\t\t\t break;\r\n\r\n\t // Pray that these don't collide - otherwise x/y scatters will be off...\r\n\t default: ent_2_i.put(entity, dt_count_lu.get(datatype));\r\n\t dt_count_lu.put(datatype, dt_count_lu.get(datatype) + 1);\r\n\t\t\t break;\r\n }\r\n\t}\r\n\t// Map out the derivatives so that they will have values int the lookups\r\n\t// - Create the post processors\r\n\tif (post_processors == null) {\r\n\t String post_proc_strs[] = BundlesDT.listEnabledPostProcessors();\r\n\t post_processors = new PostProc[post_proc_strs.length];\r\n\t for (int i=0;i<post_processors.length;i++) post_processors[i] = BundlesDT.createPostProcessor(post_proc_strs[i], this);\r\n\t}\r\n\t// - Run all of the post procs against their correct types\r\n if (fld_i != -1) for (int i=0;i<post_processors.length;i++) {\r\n if (post_processors[i].type() == datatype) {\r\n\t String strs[] = post_processors[i].postProcess(entity);\r\n\t for (int j=0;j<strs.length;j++) {\r\n if (entity.equals(strs[j]) == false) addFieldEntity(-1, strs[j]);\r\n\t }\r\n }\r\n\t}\r\n } else if (ent_2_i.containsKey(entity) == false) {\r\n ent_2_i.put(entity, not_assoc.size());\r\n\tnot_assoc.add(entity);\r\n }\r\n }\r\n }", "void add(E entity) throws ValidationException, RepositoryException;", "private JSONObject addMetadataField(String field, String value, JSONObject metadataFields) throws JSONException{\n\t\tif (value != null && value != \"\"){\n\t\t\tmetadataFields.put(field, value);\n\t\t} return metadataFields;\n\t}", "@Label(\"Organization存储\")\npublic interface OrganizationRepository extends ModelQueryAndBatchUpdateRepository<Organization, EOrganization, Integer> {\n\n}", "public void init() {\n entityPropertyBuilders.add(new DefaultEntityComponentBuilder(environment));\n entityPropertyBuilders.add(new FilterTransientFieldComponentBuilder(environment));\n entityPropertyBuilders.add(new MakeAccessibleComponentBuilder(environment));\n entityPropertyBuilders.add(new PrimaryKeyComponentBuilder(environment));\n\n // Field meta property builders\n fieldPropertyBuilders.add(new FilterPrimaryKeyComponentBuilder(environment));\n fieldPropertyBuilders.add(new FilterTransientFieldComponentBuilder(environment));\n fieldPropertyBuilders.add(new MakeAccessibleComponentBuilder(environment));\n fieldPropertyBuilders.add(new TtlFieldComponentBuilder(environment));\n fieldPropertyBuilders.add(new CompositeParentComponentBuilder(environment));\n fieldPropertyBuilders.add(new CollectionFieldComponentBuilder(environment));\n fieldPropertyBuilders.add(new MapFieldComponentBuilder(environment));\n fieldPropertyBuilders.add(new SimpleFieldComponentBuilder(environment));\n }", "public void setUWCompany(entity.UWCompany value);", "@PrePersist()\r\n\tpublic void initEntity(){\r\n\t\tthis.name = WordUtils.capitalizeFully(this.name);\r\n\t}", "private void init() {\n FieldWrapper id = new FieldWrapper();\n id.fieldDescription = new HashMap<String, Object>();\n id.fieldDescription.put(\"fullName\", \"Id\");\n id.fieldDescription.put(\"type\", \"Text\");\n\n FieldWrapper name = new FieldWrapper();\n name.fieldDescription = new HashMap<String, Object>();\n name.fieldDescription.put(\"fullName\", \"Name\");\n\n FieldWrapper createdBy = new FieldWrapper();\n createdBy.fieldDescription = new HashMap<String, Object>();\n createdBy.fieldDescription.put(\"fullName\", \"CreatedBy\");\n createdBy.fieldDescription.put(\"type\", \"Lookup\");\n\n FieldWrapper lastModifiedBy = new FieldWrapper();\n lastModifiedBy.fieldDescription = new HashMap<String, Object>();\n lastModifiedBy.fieldDescription.put(\"fullName\", \"LastModifiedBy\");\n lastModifiedBy.fieldDescription.put(\"type\", \"Lookup\");\n\n FieldWrapper owner = new FieldWrapper();\n owner.fieldDescription = new HashMap<String, Object>();\n owner.fieldDescription.put(\"fullName\", \"Owner\");\n owner.fieldDescription.put(\"type\", \"Lookup\");\n\n fieldDescribe = new HashMap<String, FieldWrapper>();\n\n fieldDescribe.put((String) id.fieldDescription.get(\"fullName\"), id);\n fieldDescribe.put((String) name.fieldDescription.get(\"fullName\"), name);\n fieldDescribe.put((String) createdBy.fieldDescription.get(\"fullName\"), createdBy);\n fieldDescribe.put((String) lastModifiedBy.fieldDescription.get(\"fullName\"), lastModifiedBy);\n fieldDescribe.put((String) owner.fieldDescription.get(\"fullName\"), owner);\n }", "public ChangeFieldEf( EAdField<?> field,\r\n\t\t\tEAdOperation operation) {\r\n\t\tsuper();\r\n\t\tsetId(\"changeField\");\r\n\t\tthis.fields = new EAdListImpl<EAdField<?>>(EAdField.class);\r\n\t\tif (field != null)\r\n\t\t\tfields.add(field);\r\n\t\tthis.operation = operation;\r\n\t}", "@Mapper(uses ={DateComponent.class}, componentModel = \"spring\")\npublic interface CreateCodeMapper extends EntityMapper<CreateCodeDto , Code> {\n}", "private void prepareFields(Entity entity, boolean usePrimaryKey) \r\n\t\t\tthrows IllegalArgumentException, IllegalAccessException, InvocationTargetException{\r\n\t\tprimaryKeyTos = new ArrayList<FieldTO>();\r\n\t\tfieldTos = new ArrayList<FieldTO>();\r\n\t\tField[] fields = entity.getClass().getDeclaredFields();\t\r\n\t\t\r\n\t\t//trunk entity to persistence\r\n\t\tfor(int i=0; i<fields.length; i++){\r\n\t\t\tField reflectionField = fields[i];\r\n\t\t\tif(reflectionField!=null){\r\n\t\t\t\treflectionField.setAccessible(true);\r\n\t\t\t\tAnnotation annoField = reflectionField.getAnnotation(GPAField.class);\r\n\t\t\t\tAnnotation annoFieldPK = reflectionField.getAnnotation(GPAPrimaryKey.class);\r\n\t\t\t\tAnnotation annoFieldBean = reflectionField.getAnnotation(GPAFieldBean.class);\r\n\t\t\t\t/* \r\n\t\t\t\t ainda falta validar a chave primária do objeto\r\n\t\t\t\t por enquanto so esta prevendo pk usando sequence no banco\r\n\t\t\t\t objeto id sempre é gerado no banco por uma sequence\r\n\t\t\t\t*/\r\n\t\t\t\tif(annoFieldPK!=null && annoFieldPK instanceof GPAPrimaryKey){\r\n\t\t\t\t\tGPAPrimaryKey pk = (GPAPrimaryKey)annoFieldPK;\r\n\t\t\t\t\t//if(pk.ignore() == true){\r\n\t\t\t\t\t//\tcontinue;\r\n\t\t\t\t\t//}else{\r\n\t\t\t\t\tString name = pk.name();\r\n\t\t\t\t\tObject value = reflectionField.get(entity);\r\n\t\t\t\t\tfieldTos.add(new FieldTO(name, value));\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t\t//}\r\n\t\t\t\t}\r\n\t\t\t\tif(annoField!=null && annoField instanceof GPAField){\r\n\t\t\t\t\tGPAField field = (GPAField)annoField;\r\n\t\t\t\t\tString name = field.name();\r\n\t\t\t\t\tObject value = reflectionField.get(entity);\r\n\t\t\t\t\tfieldTos.add(new FieldTO(name, value));\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\tif(annoFieldBean!=null && annoFieldBean instanceof GPAFieldBean){\r\n\t\t\t\t\tGPAFieldBean field = (GPAFieldBean)annoFieldBean;\r\n\t\t\t\t\tString name = field.name();\r\n\t\t\t\t\tObject value = reflectionField.get(entity);\r\n\t\t\t\t\tfieldTos.add(new FieldTO(name, value));\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void addEntityMetadata() throws Exception {\n\n\t\tEntityMetadata entity = new EntityMetadata(entityType, false);\n\t\tentity.setRepositoryInstance(\"OperationalDB\");\n\t\tentity.setProviderType(\"RDBMSDataProvider\");\n\n\t\tMap<String, List<String>> providerParams = new HashMap<String, List<String>>();\n\t\tproviderParams.put(\"table\",\n\t\t\t\tArrays.asList(new String[] { \"APPLICATION_OBJECT\" }));\n\t\tproviderParams.put(\"id_column\", Arrays.asList(new String[] { \"ID\" }));\n\t\tproviderParams.put(\"id_type\", Arrays.asList(new String[] { \"guid\" }));\n\t\tproviderParams.put(\"optimistic_locking\",\n\t\t\t\tArrays.asList(new String[] { \"false\" }));\n\t\tproviderParams.put(\"flex_searchable_string_prefix\",\n\t\t\t\tArrays.asList(new String[] { \"I_VC\" }));\n\t\tproviderParams.put(\"flex_non_searchable_string_prefix\",\n\t\t\t\tArrays.asList(new String[] { \"U_VC\" }));\n\t\tproviderParams.put(\"flex_searchable_date_prefix\",\n\t\t\t\tArrays.asList(new String[] { \"I_DT\" }));\n\t\tproviderParams.put(\"flex_non_searchable_date_prefix\",\n\t\t\t\tArrays.asList(new String[] { \"U_DT\" }));\n\t\tproviderParams.put(\"flex_searchable_number_prefix\",\n\t\t\t\tArrays.asList(new String[] { \"I_NUM\" }));\n\t\tproviderParams.put(\"flex_non_searchable_number_prefix\",\n\t\t\t\tArrays.asList(new String[] { \"U_NUM\" }));\n\t\tproviderParams.put(\"flex_blob_prefix\",\n\t\t\t\tArrays.asList(new String[] { \"U_BLOB\" }));\n\n\t\tentity.setProviderParameters(providerParams);\n\t\tentity.setContainer(false);\n\n\t\tHashMap<String, Map<String, String>> metadataAttachments = new HashMap<String, Map<String, String>>();\n\t\tMap<String, String> prop = new HashMap<String, String>();\n\t\tprop.put(\"isEncrypted\", \"false\");\n\t\tmetadataAttachments.put(\"properties\", prop);\n\t\tAttributeDefinition attrDef = null;\n\t\tFieldDefinition fieldDef = null;\n\n\t\t// parameters: name, type, description, isRequired, isSearchable, isMLS,\n\t\t// defaultValue, groupName, metadataAttachments\n\n\t\tattrDef = new AttributeDefinition(\"givenName\", \"string\", null, true,\n\t\t\t\ttrue, false, null, \"Basic\", metadataAttachments);\n\t\tentity.addAttribute(attrDef);\n\t\t\n\t\tattrDef = new AttributeDefinition(\"lastName\", \"string\", null, true,\n\t\t\t\ttrue, false, null, \"Basic\", metadataAttachments);\n\t\tentity.addAttribute(attrDef);\n\t\t\n\t\tattrDef = new AttributeDefinition(\"email\", \"string\", null, true,\n\t\t\t\ttrue, false, null, \"Basic\", metadataAttachments);\n\t\tentity.addAttribute(attrDef);\n\t\t\n\t\tattrDef = new AttributeDefinition(\"startDate\", \"date\", null, false,\n\t\t\t\ttrue, false, null, \"Basic\", metadataAttachments);\n\t\tentity.addAttribute(attrDef);\n\t\t\n\t\tattrDef = new AttributeDefinition(\"endDate\", \"date\", null, false,\n\t\t\t\ttrue, false, null, \"Basic\", metadataAttachments);\n\t\tentity.addAttribute(attrDef);\n\t\t\n\t\tattrDef = new AttributeDefinition(\"employeeNo\", \"number\", null, true,\n\t\t\t\ttrue, false, null, \"Basic\", metadataAttachments);\n\t\tentity.addAttribute(attrDef);\n\n\n\t\tattrDef = new AttributeDefinition(\"__UID__\", \"string\", null, true,\n\t\t\t\ttrue, false, null, \"Basic\", metadataAttachments);\n\t\tentity.addAttribute(attrDef);\n\t\tfieldDef = new FieldDefinition(\"AO_UID\", \"string\",true);\n\t\tentity.addField(fieldDef);\n\t\tentity.addAttributeMapping(\"__UID__\", \"AO_UID\");\n\t\t\n\t\tattrDef = new AttributeDefinition(\"__NAME__\", \"string\", null, true,\n\t\t\t\ttrue, false, null, \"Basic\", metadataAttachments);\n\t\tentity.addAttribute(attrDef);\n\t\tfieldDef = new FieldDefinition(\"AO_NAME\", \"string\",true);\n\t\tentity.addField(fieldDef);\n\t\tentity.addAttributeMapping(\"__NAME__\", \"AO_NAME\");\n\n\t\t/*\n\t\t * attrDef = new AttributeDefinition(childEntityType, childEntityType,\n\t\t * null, false, true, false, null, \"Basic\", metadataAttachments);\n\t\t * entity.addChildEntityAttribute(attrDef);\n\t\t */\n\n\t\tString xmlString = getStringfromDoc(entity);\n\n\t\ttry {\n\t\t\tmgrConfig.createEntityMetadata(entity);\n\t\t\tSystem.out.println(\"Created entity type: \" + entityType);\n\n\t\t} catch (Exception e) {\n\t\t\t//fail(\"Unexpected exception: \" + getStackTrace(e));\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@ProviderType\npublic interface EmployeeModel extends BaseModel<Employee> {\n\n\t/*\n\t * NOTE FOR DEVELOPERS:\n\t *\n\t * Never modify or reference this interface directly. All methods that expect a employee model instance should use the {@link Employee} interface instead.\n\t */\n\n\t/**\n\t * Returns the primary key of this employee.\n\t *\n\t * @return the primary key of this employee\n\t */\n\tpublic long getPrimaryKey();\n\n\t/**\n\t * Sets the primary key of this employee.\n\t *\n\t * @param primaryKey the primary key of this employee\n\t */\n\tpublic void setPrimaryKey(long primaryKey);\n\n\t/**\n\t * Returns the uuid of this employee.\n\t *\n\t * @return the uuid of this employee\n\t */\n\t@AutoEscape\n\tpublic String getUuid();\n\n\t/**\n\t * Sets the uuid of this employee.\n\t *\n\t * @param uuid the uuid of this employee\n\t */\n\tpublic void setUuid(String uuid);\n\n\t/**\n\t * Returns the employee ID of this employee.\n\t *\n\t * @return the employee ID of this employee\n\t */\n\tpublic long getEmployeeId();\n\n\t/**\n\t * Sets the employee ID of this employee.\n\t *\n\t * @param employeeId the employee ID of this employee\n\t */\n\tpublic void setEmployeeId(long employeeId);\n\n\t/**\n\t * Returns the first name of this employee.\n\t *\n\t * @return the first name of this employee\n\t */\n\t@AutoEscape\n\tpublic String getFirstName();\n\n\t/**\n\t * Sets the first name of this employee.\n\t *\n\t * @param firstName the first name of this employee\n\t */\n\tpublic void setFirstName(String firstName);\n\n\t/**\n\t * Returns the last name of this employee.\n\t *\n\t * @return the last name of this employee\n\t */\n\t@AutoEscape\n\tpublic String getLastName();\n\n\t/**\n\t * Sets the last name of this employee.\n\t *\n\t * @param lastName the last name of this employee\n\t */\n\tpublic void setLastName(String lastName);\n\n\t/**\n\t * Returns the middle name of this employee.\n\t *\n\t * @return the middle name of this employee\n\t */\n\t@AutoEscape\n\tpublic String getMiddleName();\n\n\t/**\n\t * Sets the middle name of this employee.\n\t *\n\t * @param middleName the middle name of this employee\n\t */\n\tpublic void setMiddleName(String middleName);\n\n\t/**\n\t * Returns the birth date of this employee.\n\t *\n\t * @return the birth date of this employee\n\t */\n\tpublic Date getBirthDate();\n\n\t/**\n\t * Sets the birth date of this employee.\n\t *\n\t * @param birthDate the birth date of this employee\n\t */\n\tpublic void setBirthDate(Date birthDate);\n\n\t/**\n\t * Returns the post ID of this employee.\n\t *\n\t * @return the post ID of this employee\n\t */\n\tpublic long getPostId();\n\n\t/**\n\t * Sets the post ID of this employee.\n\t *\n\t * @param postId the post ID of this employee\n\t */\n\tpublic void setPostId(long postId);\n\n\t/**\n\t * Returns the sex of this employee.\n\t *\n\t * @return the sex of this employee\n\t */\n\tpublic Boolean getSex();\n\n\t/**\n\t * Sets the sex of this employee.\n\t *\n\t * @param sex the sex of this employee\n\t */\n\tpublic void setSex(Boolean sex);\n\n}", "public void createFieldEditors()\n\t{\n\t}", "private void addSetter(JavaObject object, JavaModelBeanField field) {\n\t\tIJavaCodeLines arguments = getArguments(field, object.getImports());\n\t\tSetterMethod method = new SetterMethod(field.getName(), field.getType(), arguments, objectType);\n\t\tobject.addBlock(method);\n\t}", "public interface GradeMapper {\n @Select(\"select * from grade\")\n public List<Grade> getByGradeNm();\n\n @Insert(\"insert into grade(grade_nm,teacher_id) values(#{gradeNm},#{teacherId})\")\n @Options(useGeneratedKeys=true,keyColumn=\"id\",keyProperty=\"id\")//设置id自增长\n public void save(Grade grade);\n}", "@Generated(\"Speedment\")\npublic interface Employee extends Entity<Employee> {\n \n /**\n * This Field corresponds to the {@link Employee} field that can be obtained\n * using the {@link Employee#getId()} method.\n */\n public final static ComparableField<Employee, Short> ID = new ComparableFieldImpl<>(\"id\", Employee::getId, Employee::setId);\n /**\n * This Field corresponds to the {@link Employee} field that can be obtained\n * using the {@link Employee#getFirstname()} method.\n */\n public final static StringField<Employee> FIRSTNAME = new StringFieldImpl<>(\"firstname\", o -> o.getFirstname().orElse(null), Employee::setFirstname);\n /**\n * This Field corresponds to the {@link Employee} field that can be obtained\n * using the {@link Employee#getLastname()} method.\n */\n public final static StringField<Employee> LASTNAME = new StringFieldImpl<>(\"lastname\", o -> o.getLastname().orElse(null), Employee::setLastname);\n /**\n * This Field corresponds to the {@link Employee} field that can be obtained\n * using the {@link Employee#getBirthdate()} method.\n */\n public final static ComparableField<Employee, Date> BIRTHDATE = new ComparableFieldImpl<>(\"birthdate\", o -> o.getBirthdate().orElse(null), Employee::setBirthdate);\n \n /**\n * Returns the id of this Employee. The id field corresponds to the database\n * column db0.sql696688.employee.id.\n * \n * @return the id of this Employee\n */\n Short getId();\n \n /**\n * Returns the firstname of this Employee. The firstname field corresponds to\n * the database column db0.sql696688.employee.firstname.\n * \n * @return the firstname of this Employee\n */\n Optional<String> getFirstname();\n \n /**\n * Returns the lastname of this Employee. The lastname field corresponds to\n * the database column db0.sql696688.employee.lastname.\n * \n * @return the lastname of this Employee\n */\n Optional<String> getLastname();\n \n /**\n * Returns the birthdate of this Employee. The birthdate field corresponds to\n * the database column db0.sql696688.employee.birthdate.\n * \n * @return the birthdate of this Employee\n */\n Optional<Date> getBirthdate();\n \n /**\n * Sets the id of this Employee. The id field corresponds to the database\n * column db0.sql696688.employee.id.\n * \n * @param id to set of this Employee\n * @return this Employee instance\n */\n Employee setId(Short id);\n \n /**\n * Sets the firstname of this Employee. The firstname field corresponds to\n * the database column db0.sql696688.employee.firstname.\n * \n * @param firstname to set of this Employee\n * @return this Employee instance\n */\n Employee setFirstname(String firstname);\n \n /**\n * Sets the lastname of this Employee. The lastname field corresponds to the\n * database column db0.sql696688.employee.lastname.\n * \n * @param lastname to set of this Employee\n * @return this Employee instance\n */\n Employee setLastname(String lastname);\n \n /**\n * Sets the birthdate of this Employee. The birthdate field corresponds to\n * the database column db0.sql696688.employee.birthdate.\n * \n * @param birthdate to set of this Employee\n * @return this Employee instance\n */\n Employee setBirthdate(Date birthdate);\n \n /**\n * Creates and returns a {@link Stream} of all {@link Borrowed} Entities that\n * references this Entity by the foreign key field that can be obtained using\n * {@link Borrowed#getEmployeeid()}. The order of the Entities are undefined\n * and may change from time to time.\n * <p>\n * Using this method, you may \"walk the graph\" and jump directly between\n * referencing Entities without using {@code JOIN}s.<p> N.B. The current\n * implementation supports lazy-loading of the referencing Entities.\n * \n * @return a {@link Stream} of all {@link Borrowed} Entities that references\n * this Entity by the foreign key field that can be obtained using {@link\n * Borrowed#getEmployeeid()}\n */\n Stream<Borrowed> findBorrowedsByEmployeeid();\n \n /**\n * Creates and returns a <em>distinct</em> {@link Stream} of all {@link\n * Borrowed} Entities that references this Entity by a foreign key. The order\n * of the Entities are undefined and may change from time to time.\n * <p>\n * Note that the Stream is <em>distinct</em>, meaning that referencing\n * Entities will only appear once in the Stream, even though they may\n * reference this Entity by several columns.\n * <p>\n * Using this method, you may \"walk the graph\" and jump directly between\n * referencing Entities without using {@code JOIN}s.<p> N.B. The current\n * implementation supports lazy-loading of the referencing Entities.\n * \n * @return a <em>distinct</em> {@link Stream} of all {@link Borrowed}\n * Entities that references this Entity by a foreign key\n */\n Stream<Borrowed> findBorroweds();\n}", "public interface FieldDAO extends CrudRepository<Field, Integer> {\n\n}", "protected Component constructCustomField(EntityModel<U> entityModel, AttributeModel attributeModel) {\n // override in subclasses\n return null;\n }", "public EsIndexPropertyBuilder addField(String fieldName, AllowableFieldEntry field) {\n this.fieldMap.put(fieldName, field);\n return this;\n }", "public AttributeField(Field field){\n this.field = field;\n }", "public void testFields()\n {\n TestUtils.testNoAddedFields(getTestedClass(), null);\n }", "public static void insertField(Field field) {\n\t\t\n\t\ttry{\n Connection connection = getConnection();\n\n\n try {\n PreparedStatement statement = connection.prepareStatement(\"INSERT INTO template_fields (field_id, form_name, field_name, field_value, field_type, field_mandatory)\"\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t+ \" VALUES ('\"+field.getTheId()+\"', '\"+field.getTheFormName()+\"', '\"+field.getTheName()+\"', 'Here is text 424', '\"+field.getTheType()+\"', '\"+field.getTheMandatory()+\"')\"); \n statement.executeUpdate();\n\n statement.close();\n connection.close();\n } catch (SQLException ex) {\n \t//23 stands for duplicate / unique entries in db, so listen for that error and update db if so\n \tif (ex.getSQLState().startsWith(\"23\")) {\n System.out.println(\"Duplicate\");\n PreparedStatement statement = connection.prepareStatement(\"UPDATE template_fields SET \"\n \t\t+ \"field_id = '\"+field.getTheId()+\"', field_name = '\"+field.getTheName()+\"',\"\n \t\t+ \" field_value = 'here text', field_type = '\"+field.getTheType()+\"'\"\n \t\t\t\t+ \"WHERE field_id = '\"+field.getTheId()+\"' \"); \n\t\t\t\t\tstatement.executeUpdate();\n\t\t\t\t\t\n\t\t\t\t\tstatement.close();\n\t\t\t\t\tconnection.close();\n \t}\n }\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n\t}", "@Override\r\n protected void addAdditionalFormFields(AssayDomainIdForm domainIdForm, DataRegion rgn)\r\n {\n rgn.addHiddenFormField(\"providerName\", domainIdForm.getProviderName());\r\n }", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface ProgrammePropMapper extends EntityMapper<ProgrammePropDTO, ProgrammeProp> {\n\n\n\n default ProgrammeProp fromId(Long id) {\n if (id == null) {\n return null;\n }\n ProgrammeProp programmeProp = new ProgrammeProp();\n programmeProp.setId(id);\n return programmeProp;\n }\n}", "void addEntity(IViewEntity entity);", "private void createListFields(SGTable table) {\n\t\t\t\n\t\t ListGridField LIST_COLUMN_FIELD = new ListGridField(\"FIELD_ID\", Util.TI18N.LIST_COLUMN_FIELD(), 145); \n\t\t LIST_COLUMN_FIELD.setCanEdit(false);\n\t\t ListGridField LIST_COLUMN_CNAME = new ListGridField(\"FIELD_CNAME\", Util.TI18N.LIST_COLUMN_CNAME(), 105); \n\t\t LIST_COLUMN_CNAME.setCanEdit(false);\n\t\t ListGridField LIST_COLUMN_WIDTH = new ListGridField(\"FIELD_WIDTH\",Util.TI18N.LIST_COLUMN_WIDTH(),40); \n\t\t ListGridField LIST_SHOW_FLAG = new ListGridField(\"SHOW_FLAG\",Util.TI18N.LIST_SHOW_FLAG(),50);\n\t\t LIST_SHOW_FLAG.setType(ListGridFieldType.BOOLEAN);\n\t\t ListGridField MODIFY_FLAG=new ListGridField(\"MODIFY_FLAG\",\"\",50);\n\t\t MODIFY_FLAG.setType(ListGridFieldType.BOOLEAN);\n\t\t MODIFY_FLAG.setHidden(true);\n\t\t table.setFields(LIST_COLUMN_FIELD, LIST_COLUMN_CNAME, LIST_COLUMN_WIDTH, LIST_SHOW_FLAG,MODIFY_FLAG);\n\t}", "public void addField(String fieldName, Object fieldValue, boolean forceAdd) {\n if (forceAdd\n || (this.beanMap.containsKey(fieldName)\n && this.beanMap.get(fieldName) == null && !this.deferredDescriptions\n .containsKey(fieldName))) {\n this.beanMap.put(fieldName, fieldValue);\n }\n }", "ObjectField createObjectField();", "@Override\n\tpublic void entityAdded(Entity entity)\n\t{\n\t\t\n\t}", "public JsonField() {\n }", "public void buildMetaFields() {\n for (AtreusMetaEntity metaEntity : environment.getMetaManager().getEntities()) {\n Class<?> entityType = metaEntity.getEntityType();\n\n // Build the fields\n for (Field field : entityType.getDeclaredFields()) {\n\n // Execute the meta property builder rule bindValue\n for (BaseEntityMetaComponentBuilder propertyBuilder : fieldPropertyBuilders) {\n if (!propertyBuilder.acceptsField((MetaEntityImpl) metaEntity, field)) {\n continue;\n }\n propertyBuilder.validateField((MetaEntityImpl) metaEntity, field);\n if (propertyBuilder.handleField((MetaEntityImpl) metaEntity, field)) {\n break;\n }\n }\n\n }\n }\n }", "@Test(enabled = false) //ExSkip\n public void insertMergeField(final DocumentBuilder builder, final String fieldName, final String textBefore, final String textAfter) throws Exception {\n FieldMergeField field = (FieldMergeField) builder.insertField(FieldType.FIELD_MERGE_FIELD, true);\n field.setFieldName(fieldName);\n field.setTextBefore(textBefore);\n field.setTextAfter(textAfter);\n }", "protected abstract void createFieldEditors();", "public BaseField setupField(int iFieldSeq)\n {\n BaseField field = null;\n if (iFieldSeq == 0)\n field = new HotelField(this, PRODUCT_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);\n //if (iFieldSeq == 1)\n // field = new DateField(this, START_DATE, Constants.DEFAULT_FIELD_LENGTH, null, null);\n //if (iFieldSeq == 2)\n // field = new DateField(this, END_DATE, Constants.DEFAULT_FIELD_LENGTH, null, null);\n //if (iFieldSeq == 3)\n // field = new StringField(this, DESCRIPTION, 10, null, null);\n //if (iFieldSeq == 4)\n // field = new CityField(this, CITY_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);\n //if (iFieldSeq == 5)\n // field = new CityField(this, TO_CITY_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);\n //if (iFieldSeq == 6)\n // field = new ContinentField(this, CONTINENT_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);\n //if (iFieldSeq == 7)\n // field = new RegionField(this, REGION_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);\n //if (iFieldSeq == 8)\n // field = new CountryField(this, COUNTRY_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);\n //if (iFieldSeq == 9)\n // field = new StateField(this, STATE_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);\n //if (iFieldSeq == 10)\n // field = new VendorField(this, VENDOR_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);\n if (iFieldSeq == 11)\n field = new HotelRateField(this, RATE_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);\n if (iFieldSeq == 12)\n field = new HotelClassField(this, CLASS_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);\n //if (iFieldSeq == 13)\n // field = new DateField(this, DETAIL_DATE, Constants.DEFAULT_FIELD_LENGTH, null, null);\n //if (iFieldSeq == 14)\n // field = new ShortField(this, PAX, Constants.DEFAULT_FIELD_LENGTH, null, new Short((short)2));\n //if (iFieldSeq == 15)\n // field = new HotelScreenRecord_LastChanged(this, LAST_CHANGED, Constants.DEFAULT_FIELD_LENGTH, null, null);\n //if (iFieldSeq == 16)\n // field = new BooleanField(this, REMOTE_QUERY_ENABLED, Constants.DEFAULT_FIELD_LENGTH, null, null);\n //if (iFieldSeq == 17)\n // field = new ShortField(this, BLOCKED, Constants.DEFAULT_FIELD_LENGTH, null, null);\n //if (iFieldSeq == 18)\n // field = new ShortField(this, OVERSELL, Constants.DEFAULT_FIELD_LENGTH, null, null);\n //if (iFieldSeq == 19)\n // field = new BooleanField(this, CLOSED, Constants.DEFAULT_FIELD_LENGTH, null, null);\n //if (iFieldSeq == 20)\n // field = new BooleanField(this, DELETE, Constants.DEFAULT_FIELD_LENGTH, null, null);\n //if (iFieldSeq == 21)\n // field = new BooleanField(this, READ_ONLY, Constants.DEFAULT_FIELD_LENGTH, null, null);\n //if (iFieldSeq == 22)\n // field = new ProductSearchTypeField(this, PRODUCT_SEARCH_TYPE_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);\n //if (iFieldSeq == 23)\n // field = new ProductTypeField(this, PRODUCT_TYPE_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);\n if (iFieldSeq == 24)\n field = new PaxCategorySelect(this, PAX_CATEGORY_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);\n if (field == null)\n field = super.setupField(iFieldSeq);\n return field;\n }", "private void exposeExposedFieldsToJs() {\n if (fieldsWithNameExposed.isEmpty()) {\n return;\n }\n\n MethodSpec.Builder exposeFieldMethod = MethodSpec\n .methodBuilder(\"vg$ef\")\n .addAnnotation(JsMethod.class);\n\n fieldsWithNameExposed\n .forEach(field -> exposeFieldMethod\n .addStatement(\"this.$L = $T.v()\",\n field.getName(),\n FieldsExposer.class)\n );\n\n exposeFieldMethod\n .addStatement(\n \"$T.e($L)\",\n FieldsExposer.class,\n fieldsWithNameExposed.stream()\n .map(ExposedField::getName)\n .collect(Collectors.joining(\",\"))\n );\n componentExposedTypeBuilder.addMethod(exposeFieldMethod.build());\n }", "@PostConstruct\n protected void initNewEntity() {\n setNewEntity(getService().create());\n }", "public void addField (String label, String field) {\n addField (label, field, \"\");\n }", "@Override\r\n protected void buildEditingFields() {\r\n LanguageCodeComboBox languageCodeComboBox = new LanguageCodeComboBox();\r\n languageCodeComboBox.setAllowBlank(false);\r\n languageCodeComboBox.setToolTip(\"The translation language's code is required. It can not be null. Please select one or delete the row.\");\r\n BoundedTextField tf = new BoundedTextField();\r\n tf.setMaxLength(256);\r\n tf.setToolTip(\"This is the translation corresponding to the selected language. This field is required. It can not be null.\");\r\n tf.setAllowBlank(false);\r\n addColumnEditorConfig(languageCodeColumnConfig, languageCodeComboBox);\r\n addColumnEditorConfig(titleColumnConfig, tf);\r\n }", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface OrganisationTypeMapper extends EntityMapper<OrganisationTypeDTO, OrganisationType> {\n\n\n @Mapping(target = \"organisations\", ignore = true)\n OrganisationType toEntity(OrganisationTypeDTO organisationTypeDTO);\n\n default OrganisationType fromId(Long id) {\n if (id == null) {\n return null;\n }\n OrganisationType organisationType = new OrganisationType();\n organisationType.setId(id);\n return organisationType;\n }\n}", "public void add() {\n preAdd();\n EntitySelect<T> entitySelect = getEntitySelect();\n entitySelect.setMultiSelect(true);\n getEntitySelect().open();\n }", "@Override\n\tprotected CoreEntity createNewEntity() {\n\t\treturn null;\n\t}", "@Data\npublic class <XXX>ModelInfo extends AbstractModelInfo {\n private <Field1DataType> <Field1>;\n /**\n * @return an corresponding {@link <XXX>Transformer} for this model info\n */\n @Override\n public Transformer getTransformer() {\n return new <XXX>Transformer(this);\n }", "Ack editProperty(ProjectEntity entity, String propertyTypeName, JsonNode data);", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface EmploymentTypeMapper extends EntityMapper<EmploymentTypeDTO, EmploymentType> {\n\n\n @Mapping(target = \"people\", ignore = true)\n EmploymentType toEntity(EmploymentTypeDTO employmentTypeDTO);\n\n default EmploymentType fromId(Long id) {\n if (id == null) {\n return null;\n }\n EmploymentType employmentType = new EmploymentType();\n employmentType.setId(id);\n return employmentType;\n }\n}", "EntityBeanDescriptor createEntityBeanDescriptor();", "private void createUserListFields(SGTable table) {\n\t\t ListGridField LIST_COLUMN_ID = new ListGridField(\"FIELD_ID\", Util.TI18N.LIST_COLUMN_FIELD(), 145);\n\t\t LIST_COLUMN_ID.setCanEdit(false);\n\t\t ListGridField LIST_COLUMN_CNAME = new ListGridField(\"FIELD_CNAME\", Util.TI18N.LIST_COLUMN_CNAME(), 105);\n\t\t LIST_COLUMN_CNAME.setCanEdit(false);\n\t\t ListGridField COLUMN_WIDTH = new ListGridField(\"FIELD_WIDTH\", Util.TI18N.LIST_COLUMN_WIDTH(), 40);\n\t\t LIST_COLUMN_CNAME.setCanEdit(false);\n\t\t table.setFields(LIST_COLUMN_ID, LIST_COLUMN_CNAME, COLUMN_WIDTH);\n }", "private void addFields(StringBuilder xml) {\n\t\tfor(FieldRequest field : fields) {\n\t\t\tstartElementWithAttributes(xml, \"Delta\");\n\t\t\taddStringAttribute(xml, \"id\", field.getId());\n\t\t\taddBooleanAttribute(xml, \"masked\", field.getMasked());\n\t\t\tcloseSimpleElementWithAttributes(xml);\n\t\t}\n\t}", "Builder addMainEntityOfPage(String value);", "@attribute(value = \"\", required = true)\t\r\n\tpublic void addCharField(CharField f) {\r\n\t\tfields.put(\"\" + fieldCount++, f);\r\n\t}", "@Override\n protected void createEntity() {\n ProjectStatus status = createProjectStatus(5);\n setEntity(status);\n }", "public interface CommonEntityMethod extends ToJson,GetFieldValue,SetFieldValue{\n}", "@ProviderType\npublic interface ItemShopBasketModel extends BaseModel<ItemShopBasket> {\n\n\t/*\n\t * NOTE FOR DEVELOPERS:\n\t *\n\t * Never modify or reference this interface directly. All methods that expect a item shop basket model instance should use the {@link ItemShopBasket} interface instead.\n\t */\n\n\t/**\n\t * Returns the primary key of this item shop basket.\n\t *\n\t * @return the primary key of this item shop basket\n\t */\n\tpublic long getPrimaryKey();\n\n\t/**\n\t * Sets the primary key of this item shop basket.\n\t *\n\t * @param primaryKey the primary key of this item shop basket\n\t */\n\tpublic void setPrimaryKey(long primaryKey);\n\n\t/**\n\t * Returns the item shop basket ID of this item shop basket.\n\t *\n\t * @return the item shop basket ID of this item shop basket\n\t */\n\tpublic long getItemShopBasketId();\n\n\t/**\n\t * Sets the item shop basket ID of this item shop basket.\n\t *\n\t * @param itemShopBasketId the item shop basket ID of this item shop basket\n\t */\n\tpublic void setItemShopBasketId(long itemShopBasketId);\n\n\t/**\n\t * Returns the shop basket ID of this item shop basket.\n\t *\n\t * @return the shop basket ID of this item shop basket\n\t */\n\tpublic long getShopBasketId();\n\n\t/**\n\t * Sets the shop basket ID of this item shop basket.\n\t *\n\t * @param shopBasketId the shop basket ID of this item shop basket\n\t */\n\tpublic void setShopBasketId(long shopBasketId);\n\n\t/**\n\t * Returns the name of this item shop basket.\n\t *\n\t * @return the name of this item shop basket\n\t */\n\t@AutoEscape\n\tpublic String getName();\n\n\t/**\n\t * Sets the name of this item shop basket.\n\t *\n\t * @param name the name of this item shop basket\n\t */\n\tpublic void setName(String name);\n\n\t/**\n\t * Returns the imported of this item shop basket.\n\t *\n\t * @return the imported of this item shop basket\n\t */\n\tpublic boolean getImported();\n\n\t/**\n\t * Returns <code>true</code> if this item shop basket is imported.\n\t *\n\t * @return <code>true</code> if this item shop basket is imported; <code>false</code> otherwise\n\t */\n\tpublic boolean isImported();\n\n\t/**\n\t * Sets whether this item shop basket is imported.\n\t *\n\t * @param imported the imported of this item shop basket\n\t */\n\tpublic void setImported(boolean imported);\n\n\t/**\n\t * Returns the exempt of this item shop basket.\n\t *\n\t * @return the exempt of this item shop basket\n\t */\n\tpublic boolean getExempt();\n\n\t/**\n\t * Returns <code>true</code> if this item shop basket is exempt.\n\t *\n\t * @return <code>true</code> if this item shop basket is exempt; <code>false</code> otherwise\n\t */\n\tpublic boolean isExempt();\n\n\t/**\n\t * Sets whether this item shop basket is exempt.\n\t *\n\t * @param exempt the exempt of this item shop basket\n\t */\n\tpublic void setExempt(boolean exempt);\n\n\t/**\n\t * Returns the price of this item shop basket.\n\t *\n\t * @return the price of this item shop basket\n\t */\n\tpublic Double getPrice();\n\n\t/**\n\t * Sets the price of this item shop basket.\n\t *\n\t * @param price the price of this item shop basket\n\t */\n\tpublic void setPrice(Double price);\n\n\t/**\n\t * Returns the active of this item shop basket.\n\t *\n\t * @return the active of this item shop basket\n\t */\n\tpublic boolean getActive();\n\n\t/**\n\t * Returns <code>true</code> if this item shop basket is active.\n\t *\n\t * @return <code>true</code> if this item shop basket is active; <code>false</code> otherwise\n\t */\n\tpublic boolean isActive();\n\n\t/**\n\t * Sets whether this item shop basket is active.\n\t *\n\t * @param active the active of this item shop basket\n\t */\n\tpublic void setActive(boolean active);\n\n\t/**\n\t * Returns the amount of this item shop basket.\n\t *\n\t * @return the amount of this item shop basket\n\t */\n\tpublic long getAmount();\n\n\t/**\n\t * Sets the amount of this item shop basket.\n\t *\n\t * @param amount the amount of this item shop basket\n\t */\n\tpublic void setAmount(long amount);\n\n\t/**\n\t * Returns the tax of this item shop basket.\n\t *\n\t * @return the tax of this item shop basket\n\t */\n\tpublic Double getTax();\n\n\t/**\n\t * Sets the tax of this item shop basket.\n\t *\n\t * @param tax the tax of this item shop basket\n\t */\n\tpublic void setTax(Double tax);\n\n\t/**\n\t * Returns the total of this item shop basket.\n\t *\n\t * @return the total of this item shop basket\n\t */\n\tpublic Double getTotal();\n\n\t/**\n\t * Sets the total of this item shop basket.\n\t *\n\t * @param total the total of this item shop basket\n\t */\n\tpublic void setTotal(Double total);\n\n}", "public static void providePOJOsFieldAndGetterSetter(\n final FileWriterWrapper writer,\n final Field field)\n throws IOException {\n String javaType = mapType(field.getOriginalDataType());\n\n writer.write(\" private \" + javaType + \" \" + field.getJavaName()\n + \" = null;\\n\\n\");\n\n writer.write(\" public \" + javaType + \" \" + field.getGetterName()\n + \"() {\\n\");\n writer.write(\" return \" + field.getJavaName() + \";\\n\");\n writer.write(\" }\\n\\n\");\n\n writer.write(\" public void \" + field.getSetterName() + \"(\"\n + javaType + \" newValue) {\\n\");\n writer.write(\" \" + field.getJavaName() + \" = newValue\"\n + \";\\n\");\n writer.write(\" }\\n\\n\");\n }", "@Override\n public boolean isDisableMetadataField() {\n return false;\n }", "@SuppressWarnings(\"all\")\n public AField create(IAPresenter source, Field reflectedJavaField, AEntity entityBean) {\n AField algosField = null;\n List items = null;\n boolean nuovaEntity = text.isEmpty(entityBean.id);\n EAFieldType type = annotation.getFormType(reflectedJavaField);\n String caption = annotation.getFormFieldName(reflectedJavaField);\n AIField fieldAnnotation = annotation.getAIField(reflectedJavaField);\n String width = annotation.getWidthEM(reflectedJavaField);\n boolean required = annotation.isRequired(reflectedJavaField);\n boolean focus = annotation.isFocus(reflectedJavaField);\n boolean enabled = annotation.isFieldEnabled(reflectedJavaField, nuovaEntity);\n Class targetClazz = annotation.getComboClass(reflectedJavaField);\n// boolean visible = annotation.isFieldVisibile(reflectedJavaField, nuovaEntity);\n Object bean;\n\n //@todo RIMETTERE\n// int rows = annotation.getNumRows(reflectionJavaField);\n// boolean nullSelection = annotation.isNullSelectionAllowed(reflectionJavaField);\n// boolean newItems = annotation.isNewItemsAllowed(reflectionJavaField);\n\n if (type == EAFieldType.text.noone) {\n return null;\n }// end of if cycle\n\n //@todo RIMETTERE\n// //--non riesco (per ora) a leggere le Annotation da una classe diversa (AEntity)\n// if (fieldAnnotation == null && reflectionJavaField.getName().equals(Cost.PROPERTY_ID)) {\n// type = EAFieldType.id;\n// }// end of if cycle\n\n if (type != null) {\n algosField = fieldFactory.crea(source, type, reflectedJavaField, entityBean);\n }// end of if cycle\n\n if (type == EAFieldType.combo && targetClazz != null && algosField != null) {\n bean = context.getBean(targetClazz);\n\n if (bean instanceof AService) {\n items = ((AService) bean).findAll();\n }// end of if cycle\n\n if (array.isValid(items)) {\n ((AComboField) algosField).fixCombo(items, false, false);\n }// end of if cycle\n }// end of if cycle\n\n\n //@todo RIMETTERE\n// if (type == EAFieldType.enumeration && targetClazz != null && algosField != null) {\n// if (targetClazz.isEnum()) {\n// items = new ArrayList(Arrays.asList(targetClazz.getEnumConstants()));\n// }// end of if cycle\n//\n// if (algosField != null && algosField instanceof AComboField && items != null) {\n// ((AComboField) algosField).fixCombo(items, false, false);\n// }// end of if cycle\n// }// end of if cycle\n\n //@todo RIMETTERE\n// if (type == EAFieldType.radio && targetClazz != null && algosField != null) {\n// //@todo PATCH - PATCH - PATCH\n// if (reflectionJavaField.getName().equals(\"attivazione\") && entityBean.getClass().getName().equals(Preferenza.class.getName())) {\n// items = new ArrayList(Arrays.asList(PrefEffect.values()));\n// }// end of if cycle\n// //@todo PATCH - PATCH - PATCH\n//\n// if (items != null) {\n// ((ARadioField) algosField).fixRadio(items);\n// }// end of if cycle\n// }// end of if cycle\n\n //@todo RIMETTERE\n// if (type == EAFieldType.link && targetClazz != null && algosField != null) {\n// String lowerName = text.primaMinuscola(targetClazz.getSimpleName());\n// Object bean = context.getBean(lowerName);\n// algosField.setTarget((ApplicationListener) bean);\n// }// end of if cycle\n//\n if (algosField != null && fieldAnnotation != null) {\n// algosField.setVisible(visible);\n algosField.setEnabled(enabled);\n algosField.setRequiredIndicatorVisible(required);\n algosField.setCaption(caption);\n// if (text.isValid(width)) {\n algosField.setWidth(width);\n// }// end of if cycle\n// if (rows > 0) {\n// algosField.setRows(rows);\n// }// end of if cycle\n algosField.setFocus(focus);\n//\n// if (LibParams.displayToolTips()) {\n// algosField.setDescription(fieldAnnotation.help());\n// }// end of if cycle\n//\n// if (type == EAFieldType.dateNotEnabled) {\n// algosField.setEnabled(false);\n// }// end of if cycle\n }// end of if cycle\n\n return algosField;\n }", "@Override\n protected final Map<String, String> createFieldToPropertyMapping() {\n // get super class mapping\n final Map<String, String> mapping = super.createFieldToPropertyMapping();\n \n mapping.put(this.tableName + \".rmres_id\", \"id\");\n mapping.put(this.tableName + \".cost_rmres\", \"cost\");\n mapping.put(this.tableName + \".config_id\", \"configId\");\n mapping.put(this.tableName + \".rm_arrange_type_id\", \"arrangeTypeId\");\n mapping.put(this.tableName + \".guests_external\", \"externalGuests\");\n mapping.put(this.tableName + \".guests_internal\", \"internalGuests\");\n \n return mapping;\n }", "private void addDescriptorFields (XmlDescriptor new_desc, Vector fields) {\n\t\tfor (int i = 0; i < fields.size(); i++) {\n\t\t\tJField jf = (JField)fields.elementAt(i);\n\t\t\tif (!jf._noMarshal) {\t\t\t\t\n\t\t\t\tif (jf.isXmlAttribute())\n\t\t\t\t\tnew_desc.addAttribute (jf);\n\t\t\t\telse\n\t\t\t\t\tnew_desc.addElement (jf);\n\t\t\t} else {\n\t\t\t\t//System.out.println (\"not adding unmarshal field..\" + jf.getJavaName ());\n\t\t\t}\n\t\t}\n\t}", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface ClientHeartbeatInfoMapper extends EntityMapper<ClientHeartbeatInfoDTO, ClientHeartbeatInfo> {\n\n\n\n default ClientHeartbeatInfo fromId(Long id) {\n if (id == null) {\n return null;\n }\n ClientHeartbeatInfo clientHeartbeatInfo = new ClientHeartbeatInfo();\n clientHeartbeatInfo.setId(id);\n return clientHeartbeatInfo;\n }\n}", "public EntityPropertyBean() {}", "public Field(String watermark,\n String showfieldname,\n String saveRequired,\n String jfunction,\n String onChange,\n String onKeyDown,\n String defaultValue,\n String type,\n String sqlValue,\n String field_name,\n String relation,\n String states,\n String relationField,\n String onClickVList,\n String jIdList,\n String name,\n String searchRequired,\n String id,\n String placeholder,\n String value,\n String fieldType,\n String onclicksummary,\n String newRecord,\n List<Field> dListArray,\n List<OptionModel> mOptionsArrayList,\n String onclickrightbutton,\n String webSaveRequired,\n String field_type) {\n\n this.watermark = watermark;\n this.showfieldname = showfieldname;\n this.saveRequired = saveRequired;\n this.jfunction = jfunction;\n this.onChange = onChange;\n this.onKeyDown = onKeyDown;\n this.defaultValue = defaultValue;\n this.type = type;\n this.sqlValue = sqlValue;\n this.field_name = field_name;\n this.relation = relation;\n this.states = states;\n this.relationField = relationField;\n this.onClickVList = onClickVList;\n this.jIdList = jIdList;\n this.name = name;\n this.searchRequired = searchRequired;\n this.id = id;\n this.placeholder = placeholder;\n this.value = value;\n this.fieldType = fieldType;\n this.onclicksummary = onclicksummary;\n this.newRecord = newRecord;\n this.dListArray = dListArray;\n this.optionsArrayList = mOptionsArrayList;\n this.onclickrightbutton = onclickrightbutton;\n this.webSaveRequired = webSaveRequired;\n this.field_type = field_type;\n\n// this( watermark, showfieldname, saveRequired, jfunction,\n// onChange, onKeyDown, defaultValue, type, sqlValue,\n// field_name, relation, states, relationField,\n// onClickVList, jIdList, name, \"\",\n// searchRequired, id, placeholder, value,\n// fieldType, onclicksummary, newRecord, \"\",\n// dListArray,mOptionsArrayList,onclickrightbutton);\n }" ]
[ "0.6293017", "0.59873044", "0.59336305", "0.5806434", "0.5701475", "0.5624825", "0.5623612", "0.56039536", "0.55894625", "0.55273145", "0.5526747", "0.55017185", "0.54510385", "0.5450061", "0.5448544", "0.5439888", "0.54212433", "0.5396721", "0.5392768", "0.53858346", "0.5378999", "0.536785", "0.5365382", "0.53556436", "0.53529626", "0.5319567", "0.53007275", "0.5281249", "0.5277528", "0.5277067", "0.52737373", "0.52603173", "0.5252275", "0.52383536", "0.5231789", "0.52261823", "0.52254486", "0.52196264", "0.52109486", "0.52093714", "0.5207507", "0.5204271", "0.5191535", "0.51883084", "0.51835644", "0.5145507", "0.51371396", "0.51370305", "0.513359", "0.5133399", "0.5132517", "0.51305276", "0.51232386", "0.51206523", "0.5115916", "0.5110423", "0.50980455", "0.50850934", "0.50786096", "0.50759697", "0.5072434", "0.5070488", "0.5067192", "0.50657487", "0.5062971", "0.5058868", "0.50552464", "0.50532824", "0.5053216", "0.5052736", "0.50525945", "0.50501037", "0.5047935", "0.50458974", "0.5041454", "0.5031601", "0.5031219", "0.5023578", "0.5022156", "0.50104606", "0.5007991", "0.5006376", "0.50038654", "0.4999004", "0.49894243", "0.49716264", "0.49584603", "0.49583098", "0.4955177", "0.49541172", "0.49514684", "0.49307403", "0.49282447", "0.49271563", "0.49249965", "0.49242115", "0.49131832", "0.4909141", "0.49078706", "0.49071813", "0.4901424" ]
0.0
-1
jhipsterneedleentityaddgetterssetters JHipster will add getters and setters here, do not remove
@Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof BenhNhan)) { return false; } return id != null && id.equals(((BenhNhan) o).id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface CommonEntityMethod extends ToJson,GetFieldValue,SetFieldValue{\n}", "static void setPropertiesFromGetters(TableEntity entity, ClientLogger logger) {\n Class<?> myClass = entity.getClass();\n\n // Do nothing if the entity is actually a `TableEntity` rather than a subclass\n if (myClass == TableEntity.class) {\n return;\n }\n\n for (Method m : myClass.getMethods()) {\n // Skip any non-getter methods\n if (m.getName().length() < 3\n || TABLE_ENTITY_METHODS.contains(m.getName())\n || (!m.getName().startsWith(\"get\") && !m.getName().startsWith(\"is\"))\n || m.getParameterTypes().length != 0\n || void.class.equals(m.getReturnType())) {\n continue;\n }\n\n // A method starting with `is` is only a getter if it returns a boolean\n if (m.getName().startsWith(\"is\") && m.getReturnType() != Boolean.class\n && m.getReturnType() != boolean.class) {\n continue;\n }\n\n // Remove the `get` or `is` prefix to get the name of the property\n int prefixLength = m.getName().startsWith(\"is\") ? 2 : 3;\n String propName = m.getName().substring(prefixLength);\n\n try {\n // Invoke the getter and store the value in the properties map\n entity.getProperties().put(propName, m.invoke(entity));\n } catch (ReflectiveOperationException | IllegalArgumentException e) {\n logger.logThrowableAsWarning(new ReflectiveOperationException(String.format(\n \"Failed to get property '%s' on type '%s'\", propName, myClass.getName()), e));\n }\n }\n }", "public interface UnitTypeProperties extends PropertyAccess<UnitTypeDTO> {\n @Editor.Path(\"id\")\n ModelKeyProvider<UnitTypeDTO> key();\n ValueProvider<UnitTypeDTO, String> id();\n ValueProvider<UnitTypeDTO, String> name();\n @Editor.Path(\"name\")\n LabelProvider<UnitTypeDTO> nameLabel();\n}", "@ProviderType\npublic interface EmployeeModel extends BaseModel<Employee> {\n\n\t/*\n\t * NOTE FOR DEVELOPERS:\n\t *\n\t * Never modify or reference this interface directly. All methods that expect a employee model instance should use the {@link Employee} interface instead.\n\t */\n\n\t/**\n\t * Returns the primary key of this employee.\n\t *\n\t * @return the primary key of this employee\n\t */\n\tpublic long getPrimaryKey();\n\n\t/**\n\t * Sets the primary key of this employee.\n\t *\n\t * @param primaryKey the primary key of this employee\n\t */\n\tpublic void setPrimaryKey(long primaryKey);\n\n\t/**\n\t * Returns the uuid of this employee.\n\t *\n\t * @return the uuid of this employee\n\t */\n\t@AutoEscape\n\tpublic String getUuid();\n\n\t/**\n\t * Sets the uuid of this employee.\n\t *\n\t * @param uuid the uuid of this employee\n\t */\n\tpublic void setUuid(String uuid);\n\n\t/**\n\t * Returns the employee ID of this employee.\n\t *\n\t * @return the employee ID of this employee\n\t */\n\tpublic long getEmployeeId();\n\n\t/**\n\t * Sets the employee ID of this employee.\n\t *\n\t * @param employeeId the employee ID of this employee\n\t */\n\tpublic void setEmployeeId(long employeeId);\n\n\t/**\n\t * Returns the first name of this employee.\n\t *\n\t * @return the first name of this employee\n\t */\n\t@AutoEscape\n\tpublic String getFirstName();\n\n\t/**\n\t * Sets the first name of this employee.\n\t *\n\t * @param firstName the first name of this employee\n\t */\n\tpublic void setFirstName(String firstName);\n\n\t/**\n\t * Returns the last name of this employee.\n\t *\n\t * @return the last name of this employee\n\t */\n\t@AutoEscape\n\tpublic String getLastName();\n\n\t/**\n\t * Sets the last name of this employee.\n\t *\n\t * @param lastName the last name of this employee\n\t */\n\tpublic void setLastName(String lastName);\n\n\t/**\n\t * Returns the middle name of this employee.\n\t *\n\t * @return the middle name of this employee\n\t */\n\t@AutoEscape\n\tpublic String getMiddleName();\n\n\t/**\n\t * Sets the middle name of this employee.\n\t *\n\t * @param middleName the middle name of this employee\n\t */\n\tpublic void setMiddleName(String middleName);\n\n\t/**\n\t * Returns the birth date of this employee.\n\t *\n\t * @return the birth date of this employee\n\t */\n\tpublic Date getBirthDate();\n\n\t/**\n\t * Sets the birth date of this employee.\n\t *\n\t * @param birthDate the birth date of this employee\n\t */\n\tpublic void setBirthDate(Date birthDate);\n\n\t/**\n\t * Returns the post ID of this employee.\n\t *\n\t * @return the post ID of this employee\n\t */\n\tpublic long getPostId();\n\n\t/**\n\t * Sets the post ID of this employee.\n\t *\n\t * @param postId the post ID of this employee\n\t */\n\tpublic void setPostId(long postId);\n\n\t/**\n\t * Returns the sex of this employee.\n\t *\n\t * @return the sex of this employee\n\t */\n\tpublic Boolean getSex();\n\n\t/**\n\t * Sets the sex of this employee.\n\t *\n\t * @param sex the sex of this employee\n\t */\n\tpublic void setSex(Boolean sex);\n\n}", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface Record25HerfinancieeringMapper extends EntityMapper<Record25HerfinancieeringDTO, Record25Herfinancieering> {\n\n\n\n default Record25Herfinancieering fromId(Long id) {\n if (id == null) {\n return null;\n }\n Record25Herfinancieering record25Herfinancieering = new Record25Herfinancieering();\n record25Herfinancieering.setId(id);\n return record25Herfinancieering;\n }\n}", "@Mapper(componentModel = \"spring\")\npublic interface SaleMapper extends EntityMapper<SaleDto, Sale> {\n\n @Mapping(source = \"client.id\", target = \"clientId\")\n @Mapping(source = \"client.name\", target = \"clientName\")\n SaleDto toDto(Sale sale);\n\n @Mapping(source = \"clientId\", target = \"client.id\")\n Sale toEntity(SaleDto saleDTO);\n\n default Sale fromId(Long id) {\n if (id == null) {\n return null;\n }\n Sale sale = new Sale();\n sale.setId(id);\n return sale;\n }\n\n}", "public interface ResourceEntityMapperExt {\n\n List<ResourceEntity> getAllResource();\n\n Set<ResourceEntity> selectRoleResourcesByRoleId(@Param(\"roleId\") String roleId);\n\n void disable(@Param(\"resourceId\") String resourceId);\n\n void enable(@Param(\"resourceId\") String resourceId);\n\n List<Map> getParentMenusByUserId(@Param(\"userId\") String userId);\n\n List<Map> getChildrenMenusByUserId(@Param(\"userId\") String userId);\n\n List<Map> getAllParentMenus();\n\n List<Map> getAllChildrenMenus();\n\n List<Map> queryResourceList();\n\n void deleteByResourceId(@Param(\"resourceId\")String resourceId);\n\n List<String> resourcesByRoleId(@Param(\"roleId\") String roleId);\n\n List<Map> getAllChildrenMenusBySourceId(@Param(\"sourceId\")String sourceId);\n}", "@Mapper(componentModel = \"spring\", uses = {SabegheMapper.class, NoeSabegheMapper.class})\npublic interface AdamKhesaratMapper extends EntityMapper<AdamKhesaratDTO, AdamKhesarat> {\n\n @Mapping(source = \"sabeghe.id\", target = \"sabegheId\")\n @Mapping(source = \"sabeghe.name\", target = \"sabegheName\")\n @Mapping(source = \"noeSabeghe.id\", target = \"noeSabegheId\")\n @Mapping(source = \"noeSabeghe.name\", target = \"noeSabegheName\")\n AdamKhesaratDTO toDto(AdamKhesarat adamKhesarat);\n\n @Mapping(source = \"sabegheId\", target = \"sabeghe\")\n @Mapping(source = \"noeSabegheId\", target = \"noeSabeghe\")\n AdamKhesarat toEntity(AdamKhesaratDTO adamKhesaratDTO);\n\n default AdamKhesarat fromId(Long id) {\n if (id == null) {\n return null;\n }\n AdamKhesarat adamKhesarat = new AdamKhesarat();\n adamKhesarat.setId(id);\n return adamKhesarat;\n }\n}", "public void toEntity(){\n\n }", "public interface EmployeeMapper extends BaseMapper<Employee> {\n\n @Override\n @Select(\"select * from employee\")\n List<Employee> findAll();\n\n @Override\n int save(Employee employee);\n}", "public interface RepositoryJpaMetadataProvider extends\n ItdTriggerBasedMetadataProvider {\n}", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface ProgrammePropMapper extends EntityMapper<ProgrammePropDTO, ProgrammeProp> {\n\n\n\n default ProgrammeProp fromId(Long id) {\n if (id == null) {\n return null;\n }\n ProgrammeProp programmeProp = new ProgrammeProp();\n programmeProp.setId(id);\n return programmeProp;\n }\n}", "@Mapper(componentModel = \"spring\", uses = {HopDongMapper.class})\npublic interface GhiNoMapper extends EntityMapper<GhiNoDTO, GhiNo> {\n\n @Mapping(source = \"hopDong.id\", target = \"hopDongId\")\n GhiNoDTO toDto(GhiNo ghiNo);\n\n @Mapping(source = \"hopDongId\", target = \"hopDong\")\n GhiNo toEntity(GhiNoDTO ghiNoDTO);\n\n default GhiNo fromId(Long id) {\n if (id == null) {\n return null;\n }\n GhiNo ghiNo = new GhiNo();\n ghiNo.setId(id);\n return ghiNo;\n }\n}", "@ProviderType\npublic interface LichChiTietModel\n\textends BaseModel<LichChiTiet>, GroupedModel, ShardedModel {\n\n\t/*\n\t * NOTE FOR DEVELOPERS:\n\t *\n\t * Never modify or reference this interface directly. All methods that expect a lich chi tiet model instance should use the {@link LichChiTiet} interface instead.\n\t */\n\n\t/**\n\t * Returns the primary key of this lich chi tiet.\n\t *\n\t * @return the primary key of this lich chi tiet\n\t */\n\tpublic long getPrimaryKey();\n\n\t/**\n\t * Sets the primary key of this lich chi tiet.\n\t *\n\t * @param primaryKey the primary key of this lich chi tiet\n\t */\n\tpublic void setPrimaryKey(long primaryKey);\n\n\t/**\n\t * Returns the lich chi tiet ID of this lich chi tiet.\n\t *\n\t * @return the lich chi tiet ID of this lich chi tiet\n\t */\n\tpublic long getLichChiTietId();\n\n\t/**\n\t * Sets the lich chi tiet ID of this lich chi tiet.\n\t *\n\t * @param lichChiTietId the lich chi tiet ID of this lich chi tiet\n\t */\n\tpublic void setLichChiTietId(long lichChiTietId);\n\n\t/**\n\t * Returns the group ID of this lich chi tiet.\n\t *\n\t * @return the group ID of this lich chi tiet\n\t */\n\t@Override\n\tpublic long getGroupId();\n\n\t/**\n\t * Sets the group ID of this lich chi tiet.\n\t *\n\t * @param groupId the group ID of this lich chi tiet\n\t */\n\t@Override\n\tpublic void setGroupId(long groupId);\n\n\t/**\n\t * Returns the language of this lich chi tiet.\n\t *\n\t * @return the language of this lich chi tiet\n\t */\n\t@AutoEscape\n\tpublic String getLanguage();\n\n\t/**\n\t * Sets the language of this lich chi tiet.\n\t *\n\t * @param language the language of this lich chi tiet\n\t */\n\tpublic void setLanguage(String language);\n\n\t/**\n\t * Returns the company ID of this lich chi tiet.\n\t *\n\t * @return the company ID of this lich chi tiet\n\t */\n\t@Override\n\tpublic long getCompanyId();\n\n\t/**\n\t * Sets the company ID of this lich chi tiet.\n\t *\n\t * @param companyId the company ID of this lich chi tiet\n\t */\n\t@Override\n\tpublic void setCompanyId(long companyId);\n\n\t/**\n\t * Returns the user ID of this lich chi tiet.\n\t *\n\t * @return the user ID of this lich chi tiet\n\t */\n\t@Override\n\tpublic long getUserId();\n\n\t/**\n\t * Sets the user ID of this lich chi tiet.\n\t *\n\t * @param userId the user ID of this lich chi tiet\n\t */\n\t@Override\n\tpublic void setUserId(long userId);\n\n\t/**\n\t * Returns the user uuid of this lich chi tiet.\n\t *\n\t * @return the user uuid of this lich chi tiet\n\t */\n\t@Override\n\tpublic String getUserUuid();\n\n\t/**\n\t * Sets the user uuid of this lich chi tiet.\n\t *\n\t * @param userUuid the user uuid of this lich chi tiet\n\t */\n\t@Override\n\tpublic void setUserUuid(String userUuid);\n\n\t/**\n\t * Returns the user name of this lich chi tiet.\n\t *\n\t * @return the user name of this lich chi tiet\n\t */\n\t@AutoEscape\n\t@Override\n\tpublic String getUserName();\n\n\t/**\n\t * Sets the user name of this lich chi tiet.\n\t *\n\t * @param userName the user name of this lich chi tiet\n\t */\n\t@Override\n\tpublic void setUserName(String userName);\n\n\t/**\n\t * Returns the create date of this lich chi tiet.\n\t *\n\t * @return the create date of this lich chi tiet\n\t */\n\t@Override\n\tpublic Date getCreateDate();\n\n\t/**\n\t * Sets the create date of this lich chi tiet.\n\t *\n\t * @param createDate the create date of this lich chi tiet\n\t */\n\t@Override\n\tpublic void setCreateDate(Date createDate);\n\n\t/**\n\t * Returns the created by user of this lich chi tiet.\n\t *\n\t * @return the created by user of this lich chi tiet\n\t */\n\tpublic long getCreatedByUser();\n\n\t/**\n\t * Sets the created by user of this lich chi tiet.\n\t *\n\t * @param createdByUser the created by user of this lich chi tiet\n\t */\n\tpublic void setCreatedByUser(long createdByUser);\n\n\t/**\n\t * Returns the modified date of this lich chi tiet.\n\t *\n\t * @return the modified date of this lich chi tiet\n\t */\n\t@Override\n\tpublic Date getModifiedDate();\n\n\t/**\n\t * Sets the modified date of this lich chi tiet.\n\t *\n\t * @param modifiedDate the modified date of this lich chi tiet\n\t */\n\t@Override\n\tpublic void setModifiedDate(Date modifiedDate);\n\n\t/**\n\t * Returns the modified by user of this lich chi tiet.\n\t *\n\t * @return the modified by user of this lich chi tiet\n\t */\n\tpublic long getModifiedByUser();\n\n\t/**\n\t * Sets the modified by user of this lich chi tiet.\n\t *\n\t * @param modifiedByUser the modified by user of this lich chi tiet\n\t */\n\tpublic void setModifiedByUser(long modifiedByUser);\n\n\t/**\n\t * Returns the gio bat dau of this lich chi tiet.\n\t *\n\t * @return the gio bat dau of this lich chi tiet\n\t */\n\tpublic Date getGioBatDau();\n\n\t/**\n\t * Sets the gio bat dau of this lich chi tiet.\n\t *\n\t * @param gioBatDau the gio bat dau of this lich chi tiet\n\t */\n\tpublic void setGioBatDau(Date gioBatDau);\n\n\t/**\n\t * Returns the mo ta of this lich chi tiet.\n\t *\n\t * @return the mo ta of this lich chi tiet\n\t */\n\t@AutoEscape\n\tpublic String getMoTa();\n\n\t/**\n\t * Sets the mo ta of this lich chi tiet.\n\t *\n\t * @param moTa the mo ta of this lich chi tiet\n\t */\n\tpublic void setMoTa(String moTa);\n\n\t/**\n\t * Returns the nguoi tham du of this lich chi tiet.\n\t *\n\t * @return the nguoi tham du of this lich chi tiet\n\t */\n\t@AutoEscape\n\tpublic String getNguoiThamDu();\n\n\t/**\n\t * Sets the nguoi tham du of this lich chi tiet.\n\t *\n\t * @param nguoiThamDu the nguoi tham du of this lich chi tiet\n\t */\n\tpublic void setNguoiThamDu(String nguoiThamDu);\n\n\t/**\n\t * Returns the nguoi chu tri of this lich chi tiet.\n\t *\n\t * @return the nguoi chu tri of this lich chi tiet\n\t */\n\t@AutoEscape\n\tpublic String getNguoiChuTri();\n\n\t/**\n\t * Sets the nguoi chu tri of this lich chi tiet.\n\t *\n\t * @param nguoiChuTri the nguoi chu tri of this lich chi tiet\n\t */\n\tpublic void setNguoiChuTri(String nguoiChuTri);\n\n\t/**\n\t * Returns the selected date of this lich chi tiet.\n\t *\n\t * @return the selected date of this lich chi tiet\n\t */\n\tpublic Date getSelectedDate();\n\n\t/**\n\t * Sets the selected date of this lich chi tiet.\n\t *\n\t * @param selectedDate the selected date of this lich chi tiet\n\t */\n\tpublic void setSelectedDate(Date selectedDate);\n\n\t/**\n\t * Returns the trangthai chi tiet of this lich chi tiet.\n\t *\n\t * @return the trangthai chi tiet of this lich chi tiet\n\t */\n\tpublic int getTrangthaiChiTiet();\n\n\t/**\n\t * Sets the trangthai chi tiet of this lich chi tiet.\n\t *\n\t * @param trangthaiChiTiet the trangthai chi tiet of this lich chi tiet\n\t */\n\tpublic void setTrangthaiChiTiet(int trangthaiChiTiet);\n\n\t/**\n\t * Returns the lich cong tac ID of this lich chi tiet.\n\t *\n\t * @return the lich cong tac ID of this lich chi tiet\n\t */\n\tpublic long getLichCongTacId();\n\n\t/**\n\t * Sets the lich cong tac ID of this lich chi tiet.\n\t *\n\t * @param lichCongTacId the lich cong tac ID of this lich chi tiet\n\t */\n\tpublic void setLichCongTacId(long lichCongTacId);\n\n\t/**\n\t * Returns the address of this lich chi tiet.\n\t *\n\t * @return the address of this lich chi tiet\n\t */\n\t@AutoEscape\n\tpublic String getAddress();\n\n\t/**\n\t * Sets the address of this lich chi tiet.\n\t *\n\t * @param address the address of this lich chi tiet\n\t */\n\tpublic void setAddress(String address);\n\n\t/**\n\t * Returns the note of this lich chi tiet.\n\t *\n\t * @return the note of this lich chi tiet\n\t */\n\t@AutoEscape\n\tpublic String getNote();\n\n\t/**\n\t * Sets the note of this lich chi tiet.\n\t *\n\t * @param note the note of this lich chi tiet\n\t */\n\tpublic void setNote(String note);\n\n\t/**\n\t * Returns the lydo tra ve of this lich chi tiet.\n\t *\n\t * @return the lydo tra ve of this lich chi tiet\n\t */\n\t@AutoEscape\n\tpublic String getLydoTraVe();\n\n\t/**\n\t * Sets the lydo tra ve of this lich chi tiet.\n\t *\n\t * @param lydoTraVe the lydo tra ve of this lich chi tiet\n\t */\n\tpublic void setLydoTraVe(String lydoTraVe);\n\n\t/**\n\t * Returns the organization ID of this lich chi tiet.\n\t *\n\t * @return the organization ID of this lich chi tiet\n\t */\n\tpublic long getOrganizationId();\n\n\t/**\n\t * Sets the organization ID of this lich chi tiet.\n\t *\n\t * @param organizationId the organization ID of this lich chi tiet\n\t */\n\tpublic void setOrganizationId(long organizationId);\n\n}", "private GetProperty(Builder builder) {\n super(builder);\n }", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface ClientHeartbeatInfoMapper extends EntityMapper<ClientHeartbeatInfoDTO, ClientHeartbeatInfo> {\n\n\n\n default ClientHeartbeatInfo fromId(Long id) {\n if (id == null) {\n return null;\n }\n ClientHeartbeatInfo clientHeartbeatInfo = new ClientHeartbeatInfo();\n clientHeartbeatInfo.setId(id);\n return clientHeartbeatInfo;\n }\n}", "public interface CreateEntityView<E extends SerializableEntity> extends EntityView {\r\n\r\n\t/**\r\n\t * Make save handler enabled\r\n\t * \r\n\t * @param enabled\r\n\t */\r\n\tvoid setSaveHandlerEnabled(boolean enabled);\r\n\t\r\n}", "public interface IGQLDynamicAttributeGetterSetter<ENTITY_TYPE, GETTER_ATTRIBUTE_TYPE, SETTER_ATTRIBUTE_TYPE>\n\t\textends\n\t\t\tIGQLDynamicAttributeGetter<ENTITY_TYPE, GETTER_ATTRIBUTE_TYPE>,\n\t\t\tIGQLDynamicAttributeSetter<ENTITY_TYPE, SETTER_ATTRIBUTE_TYPE> {\n\n}", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface EmploymentTypeMapper extends EntityMapper<EmploymentTypeDTO, EmploymentType> {\n\n\n @Mapping(target = \"people\", ignore = true)\n EmploymentType toEntity(EmploymentTypeDTO employmentTypeDTO);\n\n default EmploymentType fromId(Long id) {\n if (id == null) {\n return null;\n }\n EmploymentType employmentType = new EmploymentType();\n employmentType.setId(id);\n return employmentType;\n }\n}", "public interface SaleRowDTOProperties {\n\n Vehicle.KapschVehicle getVehicle();\n\n void setVehicle(Vehicle.KapschVehicle vehicle);\n\n}", "public interface PropertyDefEntity extends javax.ejb.EJBLocalObject {\n\n /**\n * Returns a PropertyDefDto data transfer object containing all parameters of\n * this property definition instance.\n *\n * @return PropertyDefDto the data transfer object containing all parameters of this instance\n * @see #setDto\n */\n public PropertyDefDto getDto();\n\n /**\n * Sets all data members of this property definition instance to the values\n * from the specified data transfer object.\n *\n * @param dto PropertyDefDto the data transfer object containing the new\n * parameters for this instance\n * @see #getDto\n */\n public void setDto(PropertyDefDto dto);\n\n}", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface MisteriosoMapper extends EntityMapper<MisteriosoDTO, Misterioso> {\n\n \n\n \n\n default Misterioso fromId(Long id) {\n if (id == null) {\n return null;\n }\n Misterioso misterioso = new Misterioso();\n misterioso.setId(id);\n return misterioso;\n }\n}", "@ProviderType\npublic interface PersonModel extends BaseModel<Person> {\n\n\t/*\n\t * NOTE FOR DEVELOPERS:\n\t *\n\t * Never modify or reference this interface directly. All methods that expect a person model instance should use the {@link Person} interface instead.\n\t */\n\n\t/**\n\t * Returns the primary key of this person.\n\t *\n\t * @return the primary key of this person\n\t */\n\tpublic long getPrimaryKey();\n\n\t/**\n\t * Sets the primary key of this person.\n\t *\n\t * @param primaryKey the primary key of this person\n\t */\n\tpublic void setPrimaryKey(long primaryKey);\n\n\t/**\n\t * Returns the uuid of this person.\n\t *\n\t * @return the uuid of this person\n\t */\n\t@AutoEscape\n\tpublic String getUuid();\n\n\t/**\n\t * Sets the uuid of this person.\n\t *\n\t * @param uuid the uuid of this person\n\t */\n\tpublic void setUuid(String uuid);\n\n\t/**\n\t * Returns the person ID of this person.\n\t *\n\t * @return the person ID of this person\n\t */\n\tpublic long getPersonId();\n\n\t/**\n\t * Sets the person ID of this person.\n\t *\n\t * @param personId the person ID of this person\n\t */\n\tpublic void setPersonId(long personId);\n\n\t/**\n\t * Returns the name of this person.\n\t *\n\t * @return the name of this person\n\t */\n\t@AutoEscape\n\tpublic String getName();\n\n\t/**\n\t * Sets the name of this person.\n\t *\n\t * @param name the name of this person\n\t */\n\tpublic void setName(String name);\n\n\t/**\n\t * Returns the age of this person.\n\t *\n\t * @return the age of this person\n\t */\n\tpublic int getAge();\n\n\t/**\n\t * Sets the age of this person.\n\t *\n\t * @param age the age of this person\n\t */\n\tpublic void setAge(int age);\n\n\t/**\n\t * Returns the gender of this person.\n\t *\n\t * @return the gender of this person\n\t */\n\t@AutoEscape\n\tpublic String getGender();\n\n\t/**\n\t * Sets the gender of this person.\n\t *\n\t * @param gender the gender of this person\n\t */\n\tpublic void setGender(String gender);\n\n\t/**\n\t * Returns the email ID of this person.\n\t *\n\t * @return the email ID of this person\n\t */\n\t@AutoEscape\n\tpublic String getEmailId();\n\n\t/**\n\t * Sets the email ID of this person.\n\t *\n\t * @param emailId the email ID of this person\n\t */\n\tpublic void setEmailId(String emailId);\n\n\t/**\n\t * Returns the nationality of this person.\n\t *\n\t * @return the nationality of this person\n\t */\n\t@AutoEscape\n\tpublic String getNationality();\n\n\t/**\n\t * Sets the nationality of this person.\n\t *\n\t * @param nationality the nationality of this person\n\t */\n\tpublic void setNationality(String nationality);\n\n\t/**\n\t * Returns the occupation of this person.\n\t *\n\t * @return the occupation of this person\n\t */\n\t@AutoEscape\n\tpublic String getOccupation();\n\n\t/**\n\t * Sets the occupation of this person.\n\t *\n\t * @param occupation the occupation of this person\n\t */\n\tpublic void setOccupation(String occupation);\n\n}", "@SuppressWarnings(\"unused\")\n@Repository\n@JaversSpringDataAuditable\n\npublic interface SellContractCustomerRepository extends JpaRepository<SellContractCustomer, Long> {\n\n SellContractCustomer findByCustomer_Id(Long customerId);\n\n List<SellContractCustomer> findAllBySellContract_Id(Long sellContractId);\n\n}", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface GradeMapper extends EntityMapper<GradeDTO, Grade> {\n\n\n @Mapping(target = \"subjects\", ignore = true)\n @Mapping(target = \"contents\", ignore = true)\n Grade toEntity(GradeDTO gradeDTO);\n\n default Grade fromId(Long id) {\n if (id == null) {\n return null;\n }\n Grade grade = new Grade();\n grade.setId(id);\n return grade;\n }\n}", "@Generated(\"Speedment\")\npublic interface Employee extends Entity<Employee> {\n \n /**\n * This Field corresponds to the {@link Employee} field that can be obtained\n * using the {@link Employee#getId()} method.\n */\n public final static ComparableField<Employee, Short> ID = new ComparableFieldImpl<>(\"id\", Employee::getId, Employee::setId);\n /**\n * This Field corresponds to the {@link Employee} field that can be obtained\n * using the {@link Employee#getFirstname()} method.\n */\n public final static StringField<Employee> FIRSTNAME = new StringFieldImpl<>(\"firstname\", o -> o.getFirstname().orElse(null), Employee::setFirstname);\n /**\n * This Field corresponds to the {@link Employee} field that can be obtained\n * using the {@link Employee#getLastname()} method.\n */\n public final static StringField<Employee> LASTNAME = new StringFieldImpl<>(\"lastname\", o -> o.getLastname().orElse(null), Employee::setLastname);\n /**\n * This Field corresponds to the {@link Employee} field that can be obtained\n * using the {@link Employee#getBirthdate()} method.\n */\n public final static ComparableField<Employee, Date> BIRTHDATE = new ComparableFieldImpl<>(\"birthdate\", o -> o.getBirthdate().orElse(null), Employee::setBirthdate);\n \n /**\n * Returns the id of this Employee. The id field corresponds to the database\n * column db0.sql696688.employee.id.\n * \n * @return the id of this Employee\n */\n Short getId();\n \n /**\n * Returns the firstname of this Employee. The firstname field corresponds to\n * the database column db0.sql696688.employee.firstname.\n * \n * @return the firstname of this Employee\n */\n Optional<String> getFirstname();\n \n /**\n * Returns the lastname of this Employee. The lastname field corresponds to\n * the database column db0.sql696688.employee.lastname.\n * \n * @return the lastname of this Employee\n */\n Optional<String> getLastname();\n \n /**\n * Returns the birthdate of this Employee. The birthdate field corresponds to\n * the database column db0.sql696688.employee.birthdate.\n * \n * @return the birthdate of this Employee\n */\n Optional<Date> getBirthdate();\n \n /**\n * Sets the id of this Employee. The id field corresponds to the database\n * column db0.sql696688.employee.id.\n * \n * @param id to set of this Employee\n * @return this Employee instance\n */\n Employee setId(Short id);\n \n /**\n * Sets the firstname of this Employee. The firstname field corresponds to\n * the database column db0.sql696688.employee.firstname.\n * \n * @param firstname to set of this Employee\n * @return this Employee instance\n */\n Employee setFirstname(String firstname);\n \n /**\n * Sets the lastname of this Employee. The lastname field corresponds to the\n * database column db0.sql696688.employee.lastname.\n * \n * @param lastname to set of this Employee\n * @return this Employee instance\n */\n Employee setLastname(String lastname);\n \n /**\n * Sets the birthdate of this Employee. The birthdate field corresponds to\n * the database column db0.sql696688.employee.birthdate.\n * \n * @param birthdate to set of this Employee\n * @return this Employee instance\n */\n Employee setBirthdate(Date birthdate);\n \n /**\n * Creates and returns a {@link Stream} of all {@link Borrowed} Entities that\n * references this Entity by the foreign key field that can be obtained using\n * {@link Borrowed#getEmployeeid()}. The order of the Entities are undefined\n * and may change from time to time.\n * <p>\n * Using this method, you may \"walk the graph\" and jump directly between\n * referencing Entities without using {@code JOIN}s.<p> N.B. The current\n * implementation supports lazy-loading of the referencing Entities.\n * \n * @return a {@link Stream} of all {@link Borrowed} Entities that references\n * this Entity by the foreign key field that can be obtained using {@link\n * Borrowed#getEmployeeid()}\n */\n Stream<Borrowed> findBorrowedsByEmployeeid();\n \n /**\n * Creates and returns a <em>distinct</em> {@link Stream} of all {@link\n * Borrowed} Entities that references this Entity by a foreign key. The order\n * of the Entities are undefined and may change from time to time.\n * <p>\n * Note that the Stream is <em>distinct</em>, meaning that referencing\n * Entities will only appear once in the Stream, even though they may\n * reference this Entity by several columns.\n * <p>\n * Using this method, you may \"walk the graph\" and jump directly between\n * referencing Entities without using {@code JOIN}s.<p> N.B. The current\n * implementation supports lazy-loading of the referencing Entities.\n * \n * @return a <em>distinct</em> {@link Stream} of all {@link Borrowed}\n * Entities that references this Entity by a foreign key\n */\n Stream<Borrowed> findBorroweds();\n}", "@Mapper(uses ={DateComponent.class}, componentModel = \"spring\")\npublic interface CreateCodeMapper extends EntityMapper<CreateCodeDto , Code> {\n}", "public void setUWCompany(entity.UWCompany value);", "@ProviderType\npublic interface ItemShopBasketModel extends BaseModel<ItemShopBasket> {\n\n\t/*\n\t * NOTE FOR DEVELOPERS:\n\t *\n\t * Never modify or reference this interface directly. All methods that expect a item shop basket model instance should use the {@link ItemShopBasket} interface instead.\n\t */\n\n\t/**\n\t * Returns the primary key of this item shop basket.\n\t *\n\t * @return the primary key of this item shop basket\n\t */\n\tpublic long getPrimaryKey();\n\n\t/**\n\t * Sets the primary key of this item shop basket.\n\t *\n\t * @param primaryKey the primary key of this item shop basket\n\t */\n\tpublic void setPrimaryKey(long primaryKey);\n\n\t/**\n\t * Returns the item shop basket ID of this item shop basket.\n\t *\n\t * @return the item shop basket ID of this item shop basket\n\t */\n\tpublic long getItemShopBasketId();\n\n\t/**\n\t * Sets the item shop basket ID of this item shop basket.\n\t *\n\t * @param itemShopBasketId the item shop basket ID of this item shop basket\n\t */\n\tpublic void setItemShopBasketId(long itemShopBasketId);\n\n\t/**\n\t * Returns the shop basket ID of this item shop basket.\n\t *\n\t * @return the shop basket ID of this item shop basket\n\t */\n\tpublic long getShopBasketId();\n\n\t/**\n\t * Sets the shop basket ID of this item shop basket.\n\t *\n\t * @param shopBasketId the shop basket ID of this item shop basket\n\t */\n\tpublic void setShopBasketId(long shopBasketId);\n\n\t/**\n\t * Returns the name of this item shop basket.\n\t *\n\t * @return the name of this item shop basket\n\t */\n\t@AutoEscape\n\tpublic String getName();\n\n\t/**\n\t * Sets the name of this item shop basket.\n\t *\n\t * @param name the name of this item shop basket\n\t */\n\tpublic void setName(String name);\n\n\t/**\n\t * Returns the imported of this item shop basket.\n\t *\n\t * @return the imported of this item shop basket\n\t */\n\tpublic boolean getImported();\n\n\t/**\n\t * Returns <code>true</code> if this item shop basket is imported.\n\t *\n\t * @return <code>true</code> if this item shop basket is imported; <code>false</code> otherwise\n\t */\n\tpublic boolean isImported();\n\n\t/**\n\t * Sets whether this item shop basket is imported.\n\t *\n\t * @param imported the imported of this item shop basket\n\t */\n\tpublic void setImported(boolean imported);\n\n\t/**\n\t * Returns the exempt of this item shop basket.\n\t *\n\t * @return the exempt of this item shop basket\n\t */\n\tpublic boolean getExempt();\n\n\t/**\n\t * Returns <code>true</code> if this item shop basket is exempt.\n\t *\n\t * @return <code>true</code> if this item shop basket is exempt; <code>false</code> otherwise\n\t */\n\tpublic boolean isExempt();\n\n\t/**\n\t * Sets whether this item shop basket is exempt.\n\t *\n\t * @param exempt the exempt of this item shop basket\n\t */\n\tpublic void setExempt(boolean exempt);\n\n\t/**\n\t * Returns the price of this item shop basket.\n\t *\n\t * @return the price of this item shop basket\n\t */\n\tpublic Double getPrice();\n\n\t/**\n\t * Sets the price of this item shop basket.\n\t *\n\t * @param price the price of this item shop basket\n\t */\n\tpublic void setPrice(Double price);\n\n\t/**\n\t * Returns the active of this item shop basket.\n\t *\n\t * @return the active of this item shop basket\n\t */\n\tpublic boolean getActive();\n\n\t/**\n\t * Returns <code>true</code> if this item shop basket is active.\n\t *\n\t * @return <code>true</code> if this item shop basket is active; <code>false</code> otherwise\n\t */\n\tpublic boolean isActive();\n\n\t/**\n\t * Sets whether this item shop basket is active.\n\t *\n\t * @param active the active of this item shop basket\n\t */\n\tpublic void setActive(boolean active);\n\n\t/**\n\t * Returns the amount of this item shop basket.\n\t *\n\t * @return the amount of this item shop basket\n\t */\n\tpublic long getAmount();\n\n\t/**\n\t * Sets the amount of this item shop basket.\n\t *\n\t * @param amount the amount of this item shop basket\n\t */\n\tpublic void setAmount(long amount);\n\n\t/**\n\t * Returns the tax of this item shop basket.\n\t *\n\t * @return the tax of this item shop basket\n\t */\n\tpublic Double getTax();\n\n\t/**\n\t * Sets the tax of this item shop basket.\n\t *\n\t * @param tax the tax of this item shop basket\n\t */\n\tpublic void setTax(Double tax);\n\n\t/**\n\t * Returns the total of this item shop basket.\n\t *\n\t * @return the total of this item shop basket\n\t */\n\tpublic Double getTotal();\n\n\t/**\n\t * Sets the total of this item shop basket.\n\t *\n\t * @param total the total of this item shop basket\n\t */\n\tpublic void setTotal(Double total);\n\n}", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface EightydMapper extends EntityMapper<EightydDTO, Eightyd> {\n\n\n\n default Eightyd fromId(Long id) {\n if (id == null) {\n return null;\n }\n Eightyd eightyd = new Eightyd();\n eightyd.setId(id);\n return eightyd;\n }\n}", "public interface MerchandiserEntities {\n\n static Entity outletEntity() {\n return new Entity(\n Entities.OUTLET_ENTITY,\n OutletModel.id,\n ArrayBuilder.<Field>create()\n .addAll(ImmutableList.of(\n field(OutletModel.name),\n field(OutletModel.address),\n field(OutletModel.qrCode),\n field(OutletModel.location, JavaType.OBJECT, hasOneLocation()),\n field(OutletModel.locationGps, JavaType.OBJECT, hasOneLocation()),\n field(OutletModel.locationNetwork, JavaType.OBJECT, hasOneLocation()),\n field(OutletModel.images, JavaType.ARRAY, hasManyOutletImages())\n ))\n .addAll(Entities.baseFields())\n .build(list -> list.toArray(new Field[list.size()])),\n new DbMapping(\n Entities.OUTLET_TABLE,\n OutletTable.id,\n ArrayBuilder.<ColumnMapping>create()\n .addAll(ImmutableList.of(\n column(OutletModel.name, OutletTable.name),\n column(OutletModel.address, OutletTable.address),\n column(OutletModel.qrCode, OutletTable.qr_code)\n ))\n .addAll(Entities.baseColumns())\n .build(list -> list.toArray(new ColumnMapping[list.size()])),\n ArrayBuilder.<RelationMapping>create()\n .addAll(ImmutableList.of(\n Entities.locationMapping(OutletModel.location, OutletTable.location_id),\n Entities.locationMapping(OutletModel.locationGps, OutletTable.location_id_gps),\n Entities.locationMapping(OutletModel.locationNetwork, OutletTable.location_id_network),\n outletImagesMapping()\n ))\n .addAll(Arrays.asList(Entities.baseRelationMappingsArray()))\n .build(list -> list.toArray(new RelationMapping[list.size()]))\n )\n );\n }\n\n static Relationship hasOneLocation() {\n return new Relationship(\n Relationship.Type.MANY_TO_ONE,\n Relationship.Name.HAS_ONE,\n Entities.LOCATION_ENTITY\n );\n }\n\n static Relationship hasManyOutletImages() {\n return new Relationship(\n Relationship.Type.ONE_TO_MANY,\n Relationship.Name.HAS_MANY,\n Entities.OUTLET_IMAGE_ENTITY\n );\n }\n\n static VirtualRelationMappingImpl outletImagesMapping() {\n return new VirtualRelationMappingImpl(\n Entities.OUTLET_IMAGE_TABLE,\n Entities.OUTLET_IMAGE_ENTITY,\n ImmutableList.of(\n new ForeignColumnMapping(\n OutletImageTable.outlet_id,\n OutletTable.id\n )\n ),\n OutletModel.images,\n new RelationMappingOptionsImpl(\n RelationMappingOptions.CascadeUpsert.YES,\n RelationMappingOptions.CascadeDelete.YES,\n true\n )\n );\n }\n\n static Entity outletImageEntity() {\n return new Entity(\n Entities.OUTLET_IMAGE_ENTITY,\n OutletImageModel.id,\n ArrayBuilder.<Field>create()\n .addAll(ImmutableList.of(\n field(OutletImageModel.title),\n field(OutletImageModel.description),\n field(OutletImageModel.uri),\n field(OutletImageModel.file),\n field(OutletImageModel.fileName),\n field(OutletImageModel.height),\n field(OutletImageModel.width),\n field(OutletImageModel.outlet, JavaType.OBJECT, hasOneOutlet())\n ))\n .addAll(Entities.baseFields())\n .build(list -> list.toArray(new Field[list.size()])),\n new DbMapping(\n Entities.OUTLET_IMAGE_TABLE,\n OutletImageTable.id,\n ArrayBuilder.<ColumnMapping>create()\n .addAll(ImmutableList.of(\n column(OutletImageModel.title, OutletImageTable.title),\n column(OutletImageModel.description, OutletImageTable.description),\n column(OutletImageModel.uri, OutletImageTable.uri),\n column(OutletImageModel.file, OutletImageTable.file),\n column(OutletImageModel.fileName, OutletImageTable.file_name),\n column(OutletImageModel.height, OutletImageTable.height),\n column(OutletImageModel.width, OutletImageTable.width)\n ))\n .addAll(Entities.baseColumns())\n .build(list -> list.toArray(new ColumnMapping[list.size()])),\n ArrayBuilder.<RelationMapping>create()\n .addAll(ImmutableList.of(\n new DirectRelationMappingImpl(\n OUTLET_TABLE,\n OUTLET_ENTITY,\n ImmutableList.of(\n new ForeignColumnMapping(\n OutletImageTable.outlet_id,\n OutletTable.id\n )\n ),\n OutletImageModel.outlet,\n new DirectRelationMappingOptionsImpl(\n RelationMappingOptions.CascadeUpsert.NO,\n RelationMappingOptions.CascadeDelete.NO,\n true,\n DirectRelationMappingOptions.LoadAndDelete.LOAD_AND_DELETE\n )\n )\n ))\n .addAll(Arrays.asList(Entities.baseRelationMappingsArray()))\n .build(list -> list.toArray(new RelationMapping[list.size()]))\n )\n );\n }\n\n static Relationship hasOneOutlet() {\n return new Relationship(\n Relationship.Type.MANY_TO_ONE,\n Relationship.Name.HAS_ONE,\n OUTLET_ENTITY\n );\n }\n\n static Entity locationEntity() {\n return new Entity(\n LOCATION_ENTITY,\n LocationModel.id,\n ArrayBuilder.<Field>create()\n .addAll(ImmutableList.of(\n Entities.field(LocationModel.lat),\n Entities.field(LocationModel.lng),\n Entities.field(LocationModel.accuracy)\n ))\n .addAll(Entities.baseFields())\n .build(list -> list.toArray(new Field[list.size()])),\n new DbMapping(\n LOCATION_TABLE,\n LocationTable.id,\n ArrayBuilder.<ColumnMapping>create()\n .addAll(ImmutableList.of(\n Entities.column(LocationModel.lat, LocationTable.lat),\n Entities.column(LocationModel.lng, LocationTable.lng),\n Entities.column(LocationModel.accuracy, LocationTable.accuracy)\n ))\n .addAll(Entities.baseColumns())\n .build(list -> list.toArray(new ColumnMapping[list.size()])),\n Entities.baseRelationMappingsArray()\n )\n );\n }\n}", "public interface RoleMapper {\n\n @Insert(\"insert into role values (role,desc) values (#{model.role},#{model.desc})\")\n @Options(useGeneratedKeys = true,keyProperty = \"model.id\")\n int insertRole(@Param(\"model\") RoleModel model);\n\n\n /**\n * 获取所有角色信息\n * @return\n */\n @Select(\"select id,role,desc,data_added,last_modified from role\")\n List<RoleModel> getAllRoles();\n\n\n /**\n * 获取角色Id\n * @param role\n * @return\n */\n @Select(\"select id from role where role=#{role}\")\n int getRoleId(String role);\n}", "@Mapper(componentModel = \"spring\", uses = {AanvraagberichtMapper.class})\npublic interface FdnAanvragerMapper extends EntityMapper<FdnAanvragerDTO, FdnAanvrager> {\n\n @Mapping(source = \"aanvraagbericht.id\", target = \"aanvraagberichtId\")\n FdnAanvragerDTO toDto(FdnAanvrager fdnAanvrager);\n\n @Mapping(target = \"adres\", ignore = true)\n @Mapping(target = \"legitimatiebewijs\", ignore = true)\n @Mapping(target = \"werksituaties\", ignore = true)\n @Mapping(target = \"gezinssituaties\", ignore = true)\n @Mapping(target = \"financieleSituaties\", ignore = true)\n @Mapping(source = \"aanvraagberichtId\", target = \"aanvraagbericht\")\n FdnAanvrager toEntity(FdnAanvragerDTO fdnAanvragerDTO);\n\n default FdnAanvrager fromId(Long id) {\n if (id == null) {\n return null;\n }\n FdnAanvrager fdnAanvrager = new FdnAanvrager();\n fdnAanvrager.setId(id);\n return fdnAanvrager;\n }\n}", "@DSDerby\n@Repository\npublic interface HillMapper extends BaseMapper<Hill> {\n\n}", "@MapperScan\npublic interface AdminMapper{\n //------------------Add your code here---------------------\n\n //------------------以下代码自动生成-----------------------\n\n /**\n * 根据条件查询全部\n * 参数:\n * map里的key为属性名(字段首字母小写)\n * value为查询的条件,默认为等于\n * 要改动sql请修改 *Mapper 类里的 _query() 方法\n */\n @SelectProvider(type = AdminSql.class,method = \"_queryAll\")\n List<AdminEntity> _queryAll(Map pagerParam);\n\n /**\n * 检验账号密码\n * @param account\n * @param password\n * @return\n */\n @SelectProvider(type = AdminSql.class,method = \"check\")\n List<AdminEntity> check(@Param(\"account\") String account, @Param(\"password\") String password);\n\n /**\n * 按id查询\n * 参数:\n * id : 要查询的记录的id\n */\n @SelectProvider(type = AdminSql.class,method = \"_get\")\n AdminEntity _get(String id);\n\n /**\n * 删除(逻辑)\n * 参数:\n * id : 要删除的记录的id\n */\n @DeleteProvider(type = AdminSql.class,method = \"_delete\")\n int _delete(String id);\n\n /**\n * 删除(物理)\n * 参数:\n * id : 要删除的记录的id\n */\n @DeleteProvider(type = AdminSql.class,method = \"_deleteForce\")\n int _deleteForce(String id);\n\n /**\n * 新增\n * 参数:\n * map里的key为属性名(字段首字母小写)\n * value为要插入的key值\n */\n @InsertProvider(type = AdminSql.class,method = \"_add\")\n int _add(Map params);\n\n /**\n * 按实体类新增\n * 参数:\n * 实体类对象,必须有id属性\n */\n @InsertProvider(type = AdminSql.class,method = \"_addEntity\")\n int _addEntity(AdminEntity bean);\n\n /**\n * 更新\n * 参数:\n * id : 要更新的记录的id\n * 其他map里的参数,key为属性名(字段首字母小写)\n * value为要更新成的值\n */\n @InsertProvider(type = AdminSql.class,method = \"_update\")\n int _update(Map params);\n\n /**\n * 按实体类更新\n * 参数:\n * 实体类对象,必须有id属性\n */\n @InsertProvider(type = AdminSql.class,method = \"_updateEntity\")\n int _updateEntity(AdminEntity bean);\n\n}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface CountryMapper extends EntityMapper<CountryDTO, Country> {\n\n\n @Mapping(target = \"cities\", ignore = true)\n @Mapping(target = \"countryLanguages\", ignore = true)\n Country toEntity(CountryDTO countryDTO);\n\n default Country fromId(Long id) {\n if (id == null) {\n return null;\n }\n Country country = new Country();\n country.setId(id);\n return country;\n }\n}", "@Mapper(componentModel = \"spring\", uses = {TravauxMapper.class, ChantierMapper.class, EmployeMapper.class})\npublic interface AffectationMapper extends EntityMapper<AffectationDTO, Affectation> {\n\n @Mapping(source = \"travaux.id\", target = \"travauxId\")\n @Mapping(source = \"travaux.nomTrav\", target = \"travauxNomTrav\")\n @Mapping(source = \"chantier.id\", target = \"chantierId\")\n @Mapping(source = \"chantier.nomChantier\", target = \"chantierNomChantier\")\n AffectationDTO toDto(Affectation affectation);\n\n @Mapping(source = \"travauxId\", target = \"travaux\")\n @Mapping(source = \"chantierId\", target = \"chantier\")\n Affectation toEntity(AffectationDTO affectationDTO);\n\n default Affectation fromId(Long id) {\n if (id == null) {\n return null;\n }\n Affectation affectation = new Affectation();\n affectation.setId(id);\n return affectation;\n }\n}", "public interface AllergyModelProperties extends PropertyAccess<AllergyModel> {\n ModelKeyProvider<AllergyModel> id();\n}", "@Mapper(componentModel = \"spring\", uses = {UserMapper.class, })\npublic interface PeopleMapper extends EntityMapper <PeopleDTO, People> {\n\n @Mapping(source = \"user.id\", target = \"userId\")\n @Mapping(source = \"user.firstName\", target = \"userFirstName\")\n @Mapping(source = \"user.lastName\", target = \"userLastName\")\n PeopleDTO toDto(People people);\n\n @Mapping(source = \"userId\", target = \"user\")\n @Mapping(target = \"seminarsPresenteds\", ignore = true)\n @Mapping(target = \"seminarsAttendeds\", ignore = true)\n @Mapping(target = \"specialGuestAts\", ignore = true)\n People toEntity(PeopleDTO peopleDTO);\n default People fromId(Long id) {\n if (id == null) {\n return null;\n }\n People people = new People();\n people.setId(id);\n return people;\n }\n\n default String peopleName(People people) {\n String name = \"\";\n if (people == null) {\n return null;\n }\n if (people.getUser() == null) {\n return null;\n }\n String firstName = people.getUser().getFirstName();\n if (firstName != null) {\n name += firstName;\n }\n String lastName = people.getUser().getLastName();\n if (lastName != null) {\n name += \" \" + lastName;\n }\n return name;\n }\n}", "@SuppressWarnings(\"unused\")\n@Repository\n@JaversSpringDataAuditable\npublic interface ReservoirCapacityRepository extends JpaRepository<ReservoirCapacity, Long> {\n\n}", "EntityDefinitionVisitor getEntityDefinitionStateSetterVisitor();", "@Mapper\n@Repository\npublic interface ClientDao {\n\n @Insert(value = \"insert into client_information(phone_number,user_name,password) values (#{phoneNumber},#{userName},#{password})\")\n void addClient(@Param(\"userName\") String userName, @Param(\"phoneNumber\") String phoneNumber , @Param(\"password\") String password);\n\n @Update(value = \"update client_information set sex=#{sex},user_name=#{user_name},email=#{email},\" +\n \"unit=#{unit},place=#{place} where phone_number=#{phone_number}\")\n void updateClient(@Param(\"phone_number\") String phone_number,@Param(\"user_name\") String user_name,@Param(\"sex\") String sex,@Param(\"email\") String email,@Param(\"unit\") String unit,@Param(\"place\") String place);\n\n @Select(value = \"select * from client_information where phone_number=#{phoneNumber}\")\n ClientVO selectClient(String phoneNumber);\n\n @Update(value = \"update client_information set password=#{password} where phone_number=#{phone_number}\")\n void updatePass(@Param(\"phone_number\") String phone_number,@Param(\"password\") String password);\n\n}", "public sealed interface EntityMapper<D, E>permits CarMapper,\n ModelMapper, ModelOptionMapper, PricingClassMapper, UserInfoMapper,\n TownMapper, AddressMapper, RoleMapper, BookingMapper, RentMapper {\n\n E toEntity(D dto);\n\n D toDto(E entity);\n\n Collection<E> toEntity(Collection<D> dtoList);\n\n Collection<D> toDto(Collection<E> entityList);\n\n @Named(\"partialUpdate\")\n @BeanMapping(nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE)\n void partialUpdate(@MappingTarget E entity, D dto);\n}", "@Bean\n\t@Lazy(false)\n\tAdditionalModelsConverter additionalModelsConverter() {\n\t\treturn new AdditionalModelsConverter();\n\t}", "@Test\n\tpublic void testSettersAddress() {\n\t\tassertTrue(beanTester.testSetters());\n\t}", "@Test\n\tpublic void testGettersAndSetters() {\n\t\tnew BeanTester().testBean(LeastCommonNodeInput.class, configuration);\n\n\t}", "@Service(name = \"CustomerService\")\n@OpenlegacyDesigntime(editor = \"WebServiceEditor\")\npublic interface CustomerServiceService {\n\n public CustomerServiceOut getCustomerService(CustomerServiceIn customerServiceIn) throws Exception;\n\n @Getter\n @Setter\n public static class CustomerServiceIn {\n \n Integer id3;\n }\n \n @ApiModel(value=\"CustomerServiceOut\", description=\"\")\n @Getter\n @Setter\n public static class CustomerServiceOut {\n \n @ApiModelProperty(value=\"Getuserdetails\")\n Getuserdetails getuserdetails;\n }\n}", "void generateWriteProperty2ContentValues(Builder methodBuilder, String beanName, TypeName beanClass, ModelProperty property);", "public interface SmooksTransformModel extends TransformModel {\n\n /** The \"smooks\" name. */\n public static final String SMOOKS = \"smooks\";\n\n /** The \"config\" name. */\n public static final String CONFIG = \"config\";\n \n /** The \"type\" name. */\n public static final String TYPE = \"type\";\n\n /** The \"reportPath\" name. */\n public static final String REPORT_PATH = \"reportPath\";\n \n /**\n * Gets the type attribute.\n * @return the type attribute\n */\n public String getTransformType();\n\n /**\n * Sets the type attribute.\n * @param type the type attribute\n * @return this SmooksTransformModel (useful for chaining)\n */\n public SmooksTransformModel setTransformType(String type);\n\n /**\n * Gets the config attribute.\n * @return the config attribute\n */\n public String getConfig();\n\n\n /**\n * Sets the config attribute.\n * @param config the config attribute\n * @return this SmooksTransformModel (useful for chaining)\n */\n public SmooksTransformModel setConfig(String config);\n\n /**\n * Gets the reportPath attribute.\n * @return the reportPath attribute\n */\n public String getReportPath();\n\n /**\n * Sets the reportPath attribute.\n * @param reportPath the reportPath attribute\n * @return this SmooksTransformModel (useful for chaining)\n */\n public SmooksTransformModel setReportPath(String reportPath);\n\n}", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface TarifLineMapper extends EntityMapper <TarifLineDTO, TarifLine> {\n \n \n default TarifLine fromId(Long id) {\n if (id == null) {\n return null;\n }\n TarifLine tarifLine = new TarifLine();\n tarifLine.setId(id);\n return tarifLine;\n }\n}", "@Bean\n\tpublic ExtendedMetadata extendedMetadata() {\n\t\tExtendedMetadata extendedMetadata = new ExtendedMetadata();\n\t\textendedMetadata.setIdpDiscoveryEnabled(true);\n\t\textendedMetadata.setSignMetadata(false);\n\t\textendedMetadata.setEcpEnabled(true);\n\t\treturn extendedMetadata;\n\t}", "public EntityPropertyBean() {}", "@Mapper\npublic interface SkuMapper {\n\n\n @Select(\"select * from Sku\")\n List<SkuParam> getAll();\n\n @Insert(value = {\"INSERT INTO Sku (skuName,price,categoryId,brandId,description) VALUES (#{skuName},#{price},#{categoryId},#{brandId},#{description})\"})\n @Options(useGeneratedKeys=true, keyProperty=\"skuId\")\n int insertLine(Sku sku);\n\n// @Insert(value = {\"INSERT INTO Sku (categoryId,brandId) VALUES (2,1)\"})\n// @Options(useGeneratedKeys=true, keyProperty=\"SkuId\")\n// int insertLine(Sku sku);\n\n @Delete(value = {\n \"DELETE from Sku WHERE skuId = #{skuId}\"\n })\n int deleteLine(@Param(value = \"skuId\") Long skuId);\n\n// @Insert({\n// \"<script>\",\n// \"INSERT INTO\",\n// \"CategoryAttributeGroup(id,templateId,name,sort,createTime,deleted,updateTime)\",\n// \"<foreach collection='list' item='obj' open='values' separator=',' close=''>\",\n// \" (#{obj.id},#{obj.templateId},#{obj.name},#{obj.sort},#{obj.createTime},#{obj.deleted},#{obj.updateTime})\",\n// \"</foreach>\",\n// \"</script>\"\n// })\n// Integer createCategoryAttributeGroup(List<CategoryAttributeGroup> categoryAttributeGroups);\n\n @Update(\"UPDATE Sku SET skuName = #{skuName} WHERE skuId = #{skuId}\")\n int updateLine(@Param(\"skuId\") Long skuId,@Param(\"skuName\")String skuName);\n\n\n @Select({\n \"<script>\",\n \"SELECT\",\n \"s.SkuName,c.categoryName,s.categoryId,b.brandName,s.price\",\n \"FROM\",\n \"Sku AS s\",\n \"JOIN\",\n \"Category AS c ON s.categoryId = c.categoryId\",\n \"JOIN\",\n \"Brand AS b ON s.brandId = b.brandId\",\n \"WHERE 1=1\",\n //范围查询,根据时间\n \"<if test=\\\" null != higherSkuParam.startTime and null != higherSkuParam.endTime \\\">\",\n \"AND s.updateTime &gt;= #{higherSkuParam.startTime}\",\n \"AND s.updateTime &lt;= #{ higherSkuParam.endTime}\",\n \"</if>\",\n //模糊查询,根据类别\n\n \"<if test=\\\"null != higherSkuParam.categoryName and ''!=higherSkuParam.categoryName\\\">\",\n \" AND c.categoryName LIKE CONCAT('%', #{higherSkuParam.categoryName}, '%')\",\n \"</if>\",\n\n //模糊查询,根据品牌\n\n \"<if test=\\\"null != higherSkuParam.brandName and ''!=higherSkuParam.brandName\\\">\",\n \" AND b.brandName LIKE CONCAT('%', #{higherSkuParam.brandName}, '%')\",\n \"</if>\",\n\n\n //模糊查询,根据商品名字\n \"<if test=\\\"null != higherSkuParam.skuName and ''!=higherSkuParam.skuName\\\">\",\n \" AND s.skuName LIKE CONCAT('%', #{higherSkuParam.skuName}, '%')\",\n \"</if>\",\n\n\n //根据多个类别查询\n \"<if test=\\\" null != higherSkuParam.categoryIds and higherSkuParam.categoryIds.size>0\\\" >\",\n \"AND s.categoryId IN\",\n \"<foreach collection=\\\"higherSkuParam.categoryIds\\\" item=\\\"data\\\" index=\\\"index\\\" open=\\\"(\\\" separator=\\\",\\\" close=\\\")\\\" >\",\n \" #{data} \",\n \"</foreach>\",\n \"</if>\",\n \"</script>\"\n })\n List<HigherSkuDTO> higherSelect(@Param(\"higherSkuParam\")HigherSkuParam higherSkuParam);\n\n\n\n// \"<if test=\\\" null != higherSkuParam.categoryName and ''!=higherSkuParam.categoryName \\\" >\",\n// \" AND c.categoryName LIKE \\\"%#{higherSkuParam.categoryName}%\\\" \",\n// \"</if>\",\n// \"<if test=\\\" null != higherSkuParam.skuName \\\" >\",\n// \"AND s.skuName LIKE \\\"%#{higherSkuParam.skuName}%\\\" \",\n// \"</if>\",\n}", "public void init() {\n entityPropertyBuilders.add(new DefaultEntityComponentBuilder(environment));\n entityPropertyBuilders.add(new FilterTransientFieldComponentBuilder(environment));\n entityPropertyBuilders.add(new MakeAccessibleComponentBuilder(environment));\n entityPropertyBuilders.add(new PrimaryKeyComponentBuilder(environment));\n\n // Field meta property builders\n fieldPropertyBuilders.add(new FilterPrimaryKeyComponentBuilder(environment));\n fieldPropertyBuilders.add(new FilterTransientFieldComponentBuilder(environment));\n fieldPropertyBuilders.add(new MakeAccessibleComponentBuilder(environment));\n fieldPropertyBuilders.add(new TtlFieldComponentBuilder(environment));\n fieldPropertyBuilders.add(new CompositeParentComponentBuilder(environment));\n fieldPropertyBuilders.add(new CollectionFieldComponentBuilder(environment));\n fieldPropertyBuilders.add(new MapFieldComponentBuilder(environment));\n fieldPropertyBuilders.add(new SimpleFieldComponentBuilder(environment));\n }", "public interface GradeMapper {\n @Select(\"select * from grade\")\n public List<Grade> getByGradeNm();\n\n @Insert(\"insert into grade(grade_nm,teacher_id) values(#{gradeNm},#{teacherId})\")\n @Options(useGeneratedKeys=true,keyColumn=\"id\",keyProperty=\"id\")//设置id自增长\n public void save(Grade grade);\n}", "EntityBeanDescriptor createEntityBeanDescriptor();", "@Mapper(componentModel = \"spring\", uses = {ClientMapper.class, UserAppMapper.class, DistrictMapper.class})\npublic interface CampusMapper extends EntityMapper<CampusDTO, Campus> {\n\n @Mapping(source = \"client\", target = \"clientDto\")\n @Mapping(source = \"district\", target = \"districtDto\")\n CampusDTO toDto(Campus campus);\n\n @Mapping(source = \"clientDto\", target = \"client\")\n @Mapping(source = \"districtDto\", target = \"district\")\n @Mapping(target = \"fields\", ignore = true)\n Campus toEntity(CampusDTO campusDTO);\n\n default Campus fromId(Long id) {\n if (id == null) {\n return null;\n }\n Campus campus = new Campus();\n campus.setId(id);\n return campus;\n }\n}", "@Mapper(componentModel = \"spring\", uses = {ProvinciaMapper.class})\npublic interface CodigoPostalMapper extends EntityMapper<CodigoPostalDTO, CodigoPostal> {\n\n @Mapping(source = \"provincia.id\", target = \"provinciaId\")\n @Mapping(source = \"provincia.nombreProvincia\", target = \"provinciaNombreProvincia\")\n CodigoPostalDTO toDto(CodigoPostal codigoPostal);\n\n @Mapping(source = \"provinciaId\", target = \"provincia\")\n CodigoPostal toEntity(CodigoPostalDTO codigoPostalDTO);\n\n default CodigoPostal fromId(Long id) {\n if (id == null) {\n return null;\n }\n CodigoPostal codigoPostal = new CodigoPostal();\n codigoPostal.setId(id);\n return codigoPostal;\n }\n}", "@Mapper\npublic interface UserMapper {\n /**\n * 功能描述\n * @author xgl\n * @date 2019/12/12\n * @param appUser\n * @return int\n */\n int registerAppUser(AppUser appUser);\n /**\n * 功能描述\n * @author xgl\n * @date 2019/12/12\n * @param baseUser\n * @return int\n */\n int registerBaseUser(BaseUser baseUser);\n /**\n * 功能描述\n * @author xgl\n * @date 2019/12/12\n * @param appUser\n * @return com.example.app.entity.BaseUser\n */\n AppUser loginAppUser(AppUser appUser);\n /**\n * 功能描述\n * @author xgl\n * @date 2019/12/12\n * @param\n * @return java.util.List<com.example.app.entity.College>\n */\n @Select(\"select * from col\")\n List<College> allCollege();\n /**\n * 功能描述\n * @author xgl\n * @date 2019/12/12\n * @param user\n * @return int\n */\n int hasUser(BaseUser user);\n /**\n * 功能描述\n * @author xgl\n * @date 2019/12/12\n * @param col_id\n * @return int\n */\n int hasCol(int col_id);\n /**\n * 功能描述\n * @author xgl\n * @date 2019/12/12\n * @param sms\n * @return int\n */\n int registerCode(SMS sms);\n /**\n * 功能描述\n * @author xgl\n * @date 2019/12/12\n * @param code\n * @return int\n */\n int getCode(@Param(\"code\") Integer code);\n /**\n * 功能描述\n * @author xgl\n * @date 2019/12/12\n * @param order\n * @return int\n */\n int insertOrder(Order order);\n /**\n * 功能描述\n * @author xgl\n * @date 2019/12/12\n * @param order\n * @return int\n */\n int insertOrderCount(Order order);\n\n}", "public interface TdHtFuncroleRelRepository {\n\n /**\n * @Purpose 根据id查找角色id和功能id\n * @version 4.0\n * @author lizhun\n * @param map\n * @return TdHtFuncroleRelDto\n */\n public TdHtFuncroleRelDto findFuncroleRelByRoleIdAndFuncId(Map<String,Integer> map);\n\n /**\n * @Purpose 根据权限id查找角色权限关联信息\n * @version 4.0\n * @author lizhun\n * @param role_id\n * @return List<TdHtFuncroleRelDto>\n */\n public List<TdHtFuncroleRelDto> findFuncroleRelsByRoleId(int role_id);\n /**\n * @Purpose 添加角色权限关联信息\n * @version 4.0\n * @author lizhun\n * @return void\n */\n public void insertFuncroleRel(TdHtFuncroleRelDto TdHtFuncroleRelDto);\n /**\n * @Purpose 修改角色限关联信息\n * @version 4.0\n * @author lizhun\n * @return void\n */\n public void updateFuncroleRel(TdHtFuncroleRelDto TdHtFuncroleRelDto);\n /**\n * @Purpose 修改角色所有功能不可用\n * @version 4.0\n * @author lizhun\n * @return void\n */\n public void updateFuncroleRelByRoleId(int role_id);\n}", "public interface AEntityProperty {\n}", "public interface EntitySource extends IdentifiableTypeSource, ToolingHintContextContainer, EntityNamingSourceContributor {\n\t/**\n\t * Obtain the primary table for this entity.\n\t *\n\t * @return The primary table.\n\t */\n\tpublic TableSpecificationSource getPrimaryTable();\n\n\t/**\n\t * Obtain the secondary tables for this entity\n\t *\n\t * @return returns an iterator over the secondary tables for this entity\n\t */\n\tpublic Map<String,SecondaryTableSource> getSecondaryTableMap();\n\n\tpublic String getXmlNodeName();\n\n\t/**\n\t * Obtain the named custom tuplizer classes to be used.\n\t *\n\t * @return The custom tuplizer class names\n\t */\n\tpublic Map<EntityMode,String> getTuplizerClassMap();\n\n\t/**\n\t * Obtain the name of a custom persister class to be used.\n\t *\n\t * @return The custom persister class name\n\t */\n\tpublic String getCustomPersisterClassName();\n\n\t/**\n\t * Is this entity lazy (proxyable)?\n\t *\n\t * @return {@code true} indicates the entity is lazy; {@code false} non-lazy.\n\t */\n\tpublic boolean isLazy();\n\n\t/**\n\t * For {@link #isLazy() lazy} entities, obtain the interface to use in constructing its proxies.\n\t *\n\t * @return The proxy interface name\n\t */\n\tpublic String getProxy();\n\n\t/**\n\t * Obtain the batch-size to be applied when initializing proxies of this entity.\n\t *\n\t * @return returns the the batch-size.\n\t */\n\tpublic int getBatchSize();\n\n\t/**\n\t * Is the entity abstract?\n\t * <p/>\n\t * The implication is whether the entity maps to a database table.\n\t *\n\t * @return {@code true} indicates the entity is abstract; {@code false} non-abstract; {@code null}\n\t * indicates that a reflection check should be done when building the persister.\n\t */\n\tpublic Boolean isAbstract();\n\n\t/**\n\t * Did the source specify dynamic inserts?\n\t *\n\t * @return {@code true} indicates dynamic inserts will be used; {@code false} otherwise.\n\t */\n\tpublic boolean isDynamicInsert();\n\n\t/**\n\t * Did the source specify dynamic updates?\n\t *\n\t * @return {@code true} indicates dynamic updates will be used; {@code false} otherwise.\n\t */\n\tpublic boolean isDynamicUpdate();\n\n\t/**\n\t * Did the source specify to perform selects to decide whether to perform (detached) updates?\n\t *\n\t * @return {@code true} indicates selects will be done; {@code false} otherwise.\n\t */\n\tpublic boolean isSelectBeforeUpdate();\n\n\t/**\n\t * Obtain the name of a named-query that will be used for loading this entity\n\t *\n\t * @return THe custom loader query name\n\t */\n\tpublic String getCustomLoaderName();\n\n\t/**\n\t * Obtain the custom SQL to be used for inserts for this entity\n\t *\n\t * @return The custom insert SQL\n\t */\n\tpublic CustomSql getCustomSqlInsert();\n\n\t/**\n\t * Obtain the custom SQL to be used for updates for this entity\n\t *\n\t * @return The custom update SQL\n\t */\n\tpublic CustomSql getCustomSqlUpdate();\n\n\t/**\n\t * Obtain the custom SQL to be used for deletes for this entity\n\t *\n\t * @return The custom delete SQL\n\t */\n\tpublic CustomSql getCustomSqlDelete();\n\n\t/**\n\t * Obtain any additional table names on which to synchronize (auto flushing) this entity.\n\t *\n\t * @return Additional synchronized table names or 0 sized String array, never return null.\n\t */\n\tpublic String[] getSynchronizedTableNames();\n\n\t/**\n\t * Get the actual discriminator value in case of a single table inheritance\n\t *\n\t * @return the actual discriminator value in case of a single table inheritance or {@code null} in case there is no\n\t * explicit value or a different inheritance scheme\n\t */\n\tpublic String getDiscriminatorMatchValue();\n\n\t/**\n\t * @return returns the source information for constraints defined on the table\n\t */\n\tpublic Collection<ConstraintSource> getConstraints();\n\n\t/**\n\t * Obtain the filters for this entity.\n\t *\n\t * @return returns an array of the filters for this entity.\n\t */\n\tpublic FilterSource[] getFilterSources();\n\n\tpublic List<JaxbHbmNamedQueryType> getNamedQueries();\n\n\tpublic List<JaxbHbmNamedNativeQueryType> getNamedNativeQueries();\n\n\tpublic TruthValue quoteIdentifiersLocalToEntity();\n\n}", "@Override\r\n public void createNewEntity(String entityName) {\n\r\n }", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface PerformerMapper extends EntityMapper<PerformerDTO, Performer> {\n\n\n\n default Performer fromId(Long id) {\n if (id == null) {\n return null;\n }\n Performer performer = new Performer();\n performer.setId(id);\n return performer;\n }\n}", "@Test\n\tpublic void testGettersAddress() {\n\t\tassertTrue(beanTester.testGetters());\n\t}", "public interface EmployeeRepository extends ArangoRepository<Employee, String> {}", "@Api(tags = \"Address Entity\")\n@RepositoryRestResource(collectionResourceRel = \"taxInformation\", path =\"taxInformation\")\npublic interface TaxInformationRepository extends PagingAndSortingRepository<TaxInformation,Integer> {\n}", "@Mapper\n@Repository\npublic interface StockMapper {\n\n @Insert(\"insert into product_stock(valued,product_id) values(#{valued},#{product_id})\")\n public void insertProductStock(ProductStock ProductStock);\n @Update(\"update product_stock set valued=#{valued},product_id=#{product_id} where id=#{id}\")\n public void updateProductStock(ProductStock ProductStock);\n @Delete(\"delete from product_stock where id=#{id}\")\n public void deleteProductStock(Integer id);\n @Select(\"select * from product_stock\")\n public List<ProductStock> selectAll();\n @Select(\"select * from product_stock where id=#{id}\")\n ProductStock selectById(Integer id);\n @Select(\"select * from product_stock where product_id=#{id}\")\n ProductStock findStockByProductId(Integer id);\n}", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface TemplateFormulaireMapper extends EntityMapper<TemplateFormulaireDTO, TemplateFormulaire> {\n\n\n @Mapping(target = \"questions\", ignore = true)\n TemplateFormulaire toEntity(TemplateFormulaireDTO templateFormulaireDTO);\n\n default TemplateFormulaire fromId(Long id) {\n if (id == null) {\n return null;\n }\n TemplateFormulaire templateFormulaire = new TemplateFormulaire();\n templateFormulaire.setId(id);\n return templateFormulaire;\n }\n}", "public void setupEntities() {\n }", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface OrderPaymentMapper extends EntityMapper<OrderPaymentDTO, OrderPayment> {\n\n\n\n default OrderPayment fromId(Long id) {\n if (id == null) {\n return null;\n }\n OrderPayment orderPayment = new OrderPayment();\n orderPayment.setId(id);\n return orderPayment;\n }\n}", "@Test\n\tpublic void testGettersAndSetters() {\n\t\tnew BeanTester().testBean(ShortestPathOutput.class, configuration);\n\t}", "@Repository\n@Mapper\npublic interface AppInfoMapper extends BaseMapper<AppInfoEntity> {\n}", "public interface LevelClearRecordService {\n\n /**\n * description: 根据传入bean查询挑战记录 <br>\n * version: 1.0 <br>\n * date: 2020/3/21 23:34 <br>\n * author: zhengzhiqiang <br>\n *\n * @param selectParam\n * @return siyi.game.dao.entity.LevelClearRecord\n */\n LevelClearRecord selectByBean(LevelClearRecord selectParam);\n\n /**\n * description: 插入挑战记录信息 <br>\n * version: 1.0 <br>\n * date: 2020/3/21 23:37 <br>\n * author: zhengzhiqiang <br>\n *\n * @param insertRecord\n * @return void\n */\n void insertSelective(LevelClearRecord insertRecord);\n\n /**\n * description: 根据主键更新挑战记录信息 <br>\n * version: 1.0 <br>\n * date: 2020/3/21 23:39 <br>\n * author: zhengzhiqiang <br>\n *\n * @param levelClearRecord\n * @return void\n */\n void updateByIdSelective(LevelClearRecord levelClearRecord);\n}", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface TipoTelaMapper {\n\n @Mapping(source = \"direccionamientoTela.id\", target = \"direccionamientoTelaId\")\n @Mapping(source = \"direccionamientoTela.nombre\", target = \"direccionamientoTelaNombre\")\n TipoTelaDTO tipoTelaToTipoTelaDTO(TipoTela tipoTela);\n\n @Mapping(source = \"direccionamientoTelaId\", target = \"direccionamientoTela\")\n @Mapping(target = \"telaCrudas\", ignore = true)\n TipoTela tipoTelaDTOToTipoTela(TipoTelaDTO tipoTelaDTO);\n\n default DireccionamientoTela direccionamientoTelaFromId(Long id) {\n if (id == null) {\n return null;\n }\n DireccionamientoTela direccionamientoTela = new DireccionamientoTela();\n direccionamientoTela.setId(id);\n return direccionamientoTela;\n }\n}", "public interface HealthBlockRecordsDataService extends MotechDataService<HealthBlock> {\n\n /**\n * finds the Health Block details by its parent code\n *\n * @param stateCode\n * @param districtCode\n * @param talukaCode\n * @param healthBlockCode\n * @return HealthBlock\n */\n @Lookup\n HealthBlock findHealthBlockByParentCode(@LookupField(name = \"stateCode\") Long stateCode, @LookupField(name = \"districtCode\") Long districtCode,\n @LookupField(name = \"talukaCode\") Long talukaCode, @LookupField(name = \"healthBlockCode\") Long healthBlockCode);\n\n}", "@Override\n public void loadEntityDetails() {\n \tsuper.loadEntityDetails();\n }", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface Owner3Mapper extends EntityMapper <Owner3DTO, Owner3> {\n \n @Mapping(target = \"car3S\", ignore = true)\n Owner3 toEntity(Owner3DTO owner3DTO); \n default Owner3 fromId(Long id) {\n if (id == null) {\n return null;\n }\n Owner3 owner3 = new Owner3();\n owner3.setId(id);\n return owner3;\n }\n}", "@Override\n public Entity getEntity() {\n return super.getEntity();\n }", "public interface ApiBaseUserRolePostSwitchPoService extends feihua.jdbc.api.service.ApiBaseService<BaseUserRolePostSwitchPo, BaseUserRolePostSwitchDto, String> {\n\n /**\n * 根据用户查询\n * @param userId\n * @return\n */\n BaseUserRolePostSwitchPo selectByUserId(String userId);\n}", "@JsonGetter(\"price_money\")\r\n public Money getPriceMoney() {\r\n return priceMoney;\r\n }", "public interface BaseService<Kiruvchi, Chiquvchi, ID> {\n\n //Create Entity\n ApiResponse addEntity(Kiruvchi kiruvchi);\n\n //Get Page<Entity>\n Page<Chiquvchi> getEntiyPageBySort(Optional<Integer> page, Optional<Integer> size, Optional<String> sortBy);\n\n //Get by id Optional<Entity> Sababi Http Status kodini tog'ri jo'natish uchun\n Optional<Chiquvchi> getEntityById(ID id);\n\n //Update Entity by id\n ApiResponse editState(ID id, Kiruvchi kiruvchi);\n\n //Delete Entity by id\n ApiResponse deleteEntityById(Integer id);\n}", "@Override\n protected JsonUtil getJsonUtil() {\n return super.getJsonUtil();\n }", "public interface ApplyOrderMapper extends CrudRepository<OrderEntity, Long> {\n}", "@Mapper(componentModel = \"spring\", uses = {UserMapper.class, CustomerMapper.class})\npublic interface WorkDayMapper extends EntityMapper<WorkDayDTO, WorkDay> {\n\n @Mapping(source = \"user.id\", target = \"userId\")\n @Mapping(source = \"user.login\", target = \"userLogin\")\n @Mapping(source = \"customer.id\", target = \"customerId\")\n WorkDayDTO toDto(WorkDay workDay);\n\n @Mapping(source = \"userId\", target = \"user\")\n @Mapping(source = \"customerId\", target = \"customer\")\n WorkDay toEntity(WorkDayDTO workDayDTO);\n\n default WorkDay fromId(Long id) {\n if (id == null) {\n return null;\n }\n WorkDay workDay = new WorkDay();\n workDay.setId(id);\n return workDay;\n }\n}", "@Mapper\npublic interface BCategoriesMapper {\n\n @Select(\"select * from t_categories\")\n List<CategoriesPo> findAll();\n\n @Select(\"select id,categoriesName,cAbbreviate from t_categories where id=#{id}\")\n CategoriesPo getById(@Param(\"id\") int id);\n\n @Insert(\"insert ignore into t_categories(categoriesName,cAbbreviate) values(#{categoriesName},#{cAbbreviate})\")\n boolean save(@Param(\"categoriesName\") String categoriesName, @Param(\"cAbbreviate\") String cAbbreviate);\n\n @Update(\"update t_categories set categoriesName=#{categoriesName},cAbbreviate=#{cAbbreviate} where id=#{id}\")\n boolean edit(@Param(\"id\") int id, @Param(\"categoriesName\") String categoriesName, @Param(\"cAbbreviate\") String cAbbreviate);\n\n @Delete(\"delete from t_categories where id=#{id}\")\n boolean deleteById(@Param(\"id\") int id);\n}", "@RepositoryRestResource\npublic interface WebsiteRepository extends JpaRepository<WebsiteEntity, Long> {\n\n}", "@FameProperty(name = \"accessors\", derived = true)\n public Collection<TWithAccesses> getAccessors() {\n throw new UnsupportedOperationException(\"Not yet implemented!\"); \n }", "@JsonGetter(\"product_details\")\n public ProductData getProductDetails ( ) { \n return this.productDetails;\n }", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface OTHERMapper extends EntityMapper<OTHERDTO, OTHER> {\n\n\n\n default OTHER fromId(Long id) {\n if (id == null) {\n return null;\n }\n OTHER oTHER = new OTHER();\n oTHER.setId(id);\n return oTHER;\n }\n}", "@Repository(\"productTypeMapper\")\npublic interface ProductTypeMapper extends CommonMapper<ProductTypeInfo> {\n}", "@JsonIgnoreProperties({\"ezdUmg\"})\npublic interface BigretUsersFilter {\n}", "@Override\n public void updateClassDescriptor(ClassDescriptor desc) {\n desc.getters = List.of();\n desc.setters = List.of();\n\n for (Iterator<Binding> iterator = desc.fields.iterator(); iterator.hasNext(); ) {\n Binding binding = iterator.next();\n \n if (!Modifier.isPublic(binding.field.getModifiers())) {\n iterator.remove();\n } else {\n Property property = getProperty(binding.annotations);\n if (property != null) {\n binding.fromNames = new String[]{property.name()};\n binding.toNames = new String[]{property.name()};\n } else {\n iterator.remove();\n }\n }\n }\n }", "@SuppressWarnings(\"deprecation\")\npublic interface SyntheticModelProviderPlugin extends Plugin<ModelContext> {\n /**\n * Creates a synthetic model\n *\n * @param context - context to create the model from\n * @return model - when the plugin indicates it supports it, it must return a model\n */\n springfox.documentation.schema.Model create(ModelContext context);\n\n /**\n * Creates a synthetic model properties\n *\n * @param context - context to create the model properties from\n * @return model - when the plugin indicates it supports it, it must provide properties by name\n */\n List<springfox.documentation.schema.ModelProperty> properties(ModelContext context);\n\n\n /**\n * Creates a synthetic model\n *\n * @param context - context to create the model from\n * @return model - when the plugin indicates it supports it, it must return a model\n */\n ModelSpecification createModelSpecification(ModelContext context);\n\n /**\n * Creates a synthetic model properties\n *\n * @param context - context to create the model properties from\n * @return model - when the plugin indicates it supports it, it must provide properties by name\n */\n List<PropertySpecification> propertySpecifications(ModelContext context);\n\n /**\n * Creates a dependencies for the synthetic model\n *\n * @param context - context to create the model dependencies from\n * @return model - when the plugin indicates it supports it, it may return dependent model types.\n */\n Set<ResolvedType> dependencies(ModelContext context);\n}", "@Bean\n public ModelMapper modelMapper() {\n ModelMapper mapper = new ModelMapper();\n\n mapper.addMappings(new PropertyMap<Permit, PermitDto>() {\n @Override\n protected void configure() {\n Converter<List<Code>, List<Integer>> codeConverter = mappingContext -> {\n List<Integer> result = new ArrayList<>();\n mappingContext.getSource().forEach(code -> result.add(code.getId()));\n return result;\n };\n\n using(codeConverter).map(source.getCodes()).setCodeIds(null);\n }\n });\n return mapper;\n }", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface TarifMapper extends EntityMapper <TarifDTO, Tarif> {\n \n \n default Tarif fromId(Long id) {\n if (id == null) {\n return null;\n }\n Tarif tarif = new Tarif();\n tarif.setId(id);\n return tarif;\n }\n}", "@SuppressWarnings(\"unused\")\n@Repository\npublic interface ChipsAdminRepository extends JpaRepository<ChipsAdmin, Long> {}", "@Bean\n public ExtendedMetadata extendedMetadata() {\n return new ExtendedMetadata();\n }", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface MedicoCalendarioMapper extends EntityMapper<MedicoCalendarioDTO, MedicoCalendario> {\n\n\n\n default MedicoCalendario fromId(Long id) {\n if (id == null) {\n return null;\n }\n MedicoCalendario medicoCalendario = new MedicoCalendario();\n medicoCalendario.setId(id);\n return medicoCalendario;\n }\n}", "@Override\n public CalificacionEntity toEntity() {\n CalificacionEntity calificacionEntity = super.toEntity();\n if (this.getHospedaje() != null) {\n calificacionEntity.setHospedaje(this.getHospedaje().toEntity());\n }\n return calificacionEntity;\n }" ]
[ "0.6329455", "0.610891", "0.5659298", "0.5650563", "0.55329704", "0.54645276", "0.5463555", "0.5449493", "0.54340285", "0.5415549", "0.5387973", "0.5379287", "0.5350966", "0.5341474", "0.5335219", "0.53296864", "0.53243345", "0.5322623", "0.5316597", "0.53026056", "0.5292526", "0.5278104", "0.52696973", "0.5264438", "0.524272", "0.5240863", "0.52405816", "0.52257204", "0.5225502", "0.5208189", "0.52035034", "0.51993555", "0.5196327", "0.5194019", "0.5185534", "0.51771927", "0.5171068", "0.516729", "0.5162768", "0.51577497", "0.51561534", "0.51497084", "0.5146936", "0.514425", "0.5140919", "0.51308364", "0.5126797", "0.51247585", "0.5123248", "0.51213336", "0.5113321", "0.5104318", "0.5101503", "0.50969326", "0.5094136", "0.5092239", "0.5091498", "0.50900376", "0.5073529", "0.5070525", "0.50615615", "0.505554", "0.50524414", "0.5051104", "0.50489044", "0.50464475", "0.5037615", "0.50371265", "0.50358605", "0.5028557", "0.502739", "0.5024667", "0.50235677", "0.50204575", "0.5018744", "0.5012904", "0.50124973", "0.5011896", "0.50115806", "0.50001645", "0.49940118", "0.49915367", "0.4983942", "0.49834493", "0.49810436", "0.49796236", "0.49772877", "0.49766958", "0.497276", "0.4970099", "0.49680746", "0.49680606", "0.4965675", "0.49653903", "0.4965101", "0.49640384", "0.49639958", "0.49599823", "0.49560654", "0.49502972", "0.4948193" ]
0.0
-1
args[0]: source file with semantic roles in the conll09 format (input) args[1]: target file with semantic roles in the conll09 format (input) args[4]: alignment file (input) args[5]: projected file (output)
public static void main(String args[]) throws Exception { String sourceFile = args[0]; //source file has supervised SRL tags String targetFile = args[1]; //target file has supervised SRL tags String alignmentFile = args[2]; String sourceClusterFilePath = args[3]; String targetClusterFilePath = args[4]; String projectionFilters = args[5]; double sparsityThresholdStart = Double.parseDouble(args[6]); double sparsityThresholdEnd = Double.parseDouble(args[6]); Alignment alignment = new Alignment(alignmentFile); HashMap<Integer, HashMap<Integer, Integer>> alignmentDic = alignment.getSourceTargetAlignmentDic(); final IndexMap sourceIndexMap = new IndexMap(sourceFile, sourceClusterFilePath); final IndexMap targetIndexMap = new IndexMap(targetFile, targetClusterFilePath); ArrayList<String> sourceSents = IO.readCoNLLFile(sourceFile); ArrayList<String> targetSents = IO.readCoNLLFile(targetFile); System.out.println("Projection started..."); DependencyLabelsAnalyser dla = new DependencyLabelsAnalyser(); for (int senId = 0; senId < sourceSents.size(); senId++) { if (senId % 100000 == 0) System.out.print(senId); else if (senId % 10000 == 0) System.out.print("."); Sentence sourceSen = new Sentence(sourceSents.get(senId), sourceIndexMap); Sentence targetSen = new Sentence(targetSents.get(senId), targetIndexMap); int maxNumOfProjectedLabels = dla.getNumOfProjectedLabels(sourceSen, alignmentDic.get(senId)); double trainGainPerWord = (double) maxNumOfProjectedLabels/targetSen.getLength(); if (trainGainPerWord >= sparsityThresholdStart && trainGainPerWord< sparsityThresholdEnd) { dla.analysSourceTargetDependencyMatch(sourceSen, targetSen, alignmentDic.get(senId), sourceIndexMap, targetIndexMap, projectionFilters); } } System.out.print(sourceSents.size() + "\n"); dla.writeConfusionMatrix("confusion_"+sparsityThresholdStart+"_"+sparsityThresholdEnd+".out", sourceIndexMap, targetIndexMap); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void main(String[] args) throws AlignmentException, IOException, URISyntaxException, OWLOntologyCreationException {\n\t\tfinal double threshold = 0.9;\n\t\tfinal String thresholdValue = removeCharAt(String.valueOf(threshold),1);\t\n\t\t\n\t\t/*** 2. Define the folder name holding all ontologies to be matched ***/\t\t\n\t\tFile topOntologiesFolder = new File (\"./files/ATMONTO_AIRM/ontologies\");\n\t\t//File topOntologiesFolder = new File (\"./files/expe_oaei_2011/ontologies\");\n\t\tFile[] ontologyFolders = topOntologiesFolder.listFiles();\n\t\t\n\t\t/*** 3. Define the folder name holding all reference alignments for evaluation of the computed alignments ***/\n\t\t//File refAlignmentsFolder = new File(\"./files/expe_oaei_2011/ref_alignments\");\n\t\tFile refAlignmentsFolder = new File(\"./files/ATMONTO_AIRM/ref_alignments\");\n\n\n\t\t/*** No need to touch these ***/\n\t\tString alignmentFileName = null;\n\t\tFile outputAlignment = null;\n\t\tPrintWriter writer = null;\n\t\tAlignmentVisitor renderer = null;\n\t\tProperties params = new Properties();\n\t\tAlignmentProcess a = null;\n\t\tString onto1 = null;\n\t\tString onto2 = null;\t\t\n\t\tString vectorFile1Name = null;\n\t\tString vectorFile2Name = null;\n\n//\t\t//String matcher\n//\t\tfor (int i = 0; i < ontologyFolders.length; i++) {\n//\n//\t\t\tFile[] files = ontologyFolders[i].listFiles();\n//\n//\t\t\tfor (int j = 1; j < files.length; j++) {\n//\t\t\t\tSystem.out.println(\"Matching \" + files[0] + \" and \" + files[1]);\n//\t\t\t\t\n//\t\t\t\t//used for retrieving the correct vector files and for presenting prettier names of the stored alignments \n//\t\t\t\tonto1 = files[0].getName().substring(files[0].getName().lastIndexOf(\"/\") +1, files[0].getName().lastIndexOf(\"/\") + 4);\n//\t\t\t\tonto2 = files[1].getName().substring(files[1].getName().lastIndexOf(\"/\") +4, files[1].getName().lastIndexOf(\"/\") + 7);\t\n//\t\t\t\t\t\t\t\n//\n//\t\t\t\t//match the files using the ISUBMatcher\n//\t\t\t\ta = new ISubMatcher();\n//\t\t\t\ta.init(files[0].toURI(), files[1].toURI());\n//\t\t\t\tparams = new Properties();\n//\t\t\t\tparams.setProperty(\"\", \"\");\n//\t\t\t\ta.align((Alignment)null, params);\t\n//\t\t\t\t\n//\t\t\t\t//store the computed alignment to file\n//\t\t\t\talignmentFileName = \"./files/expe_oaei_2011/isub_alignments/\" + onto1 + \"-\" + onto2 + \"-\" + \"ISub\" + \"-\" + thresholdValue + \".rdf\";\n//\t\t\t\toutputAlignment = new File(alignmentFileName);\n//\t\t\t\t\n//\t\t\t\twriter = new PrintWriter(\n//\t\t\t\t\t\tnew BufferedWriter(\n//\t\t\t\t\t\t\t\tnew FileWriter(outputAlignment)), true); \n//\t\t\t\trenderer = new RDFRendererVisitor(writer);\n//\n//\t\t\t\tBasicAlignment ISubAlignment = (BasicAlignment)(a.clone());\n//\t\t\t\t\t\t\t\n//\t\t\t\t//remove all correspondences with similarity below the defined threshold\n//\t\t\t\tISubAlignment.cut(threshold);\n//\n//\t\t\t\tISubAlignment.render(renderer);\n//\t\t\t\t\n//\t\t\t\tSystem.err.println(\"The ISub alignment contains \" + ISubAlignment.nbCells() + \" correspondences\");\n//\t\t\t\twriter.flush();\n//\t\t\t\twriter.close();\n//\t\t\t\t\n//\t\t\t\tSystem.out.println(\"\\nMatching with ISub Matcher completed!\");\n//\n//\t\t\t}\n//\t\t}\n\t\t\n\t\t //WEMatcher\n\t\t for (int i = 0; i < ontologyFolders.length; i++) {\n\n\t\t\tFile[] files = ontologyFolders[i].listFiles();\n\n\t\t\tfor (int j = 1; j < files.length; j++) {\n\t\t\t\tSystem.out.println(\"Matching \" + files[0] + \" and \" + files[1]);\n\t\t\t\t\n\t\t\t\t//used for retrieving the correct vector files and for presenting prettier names of the stored alignments \n\t\t\t\tonto1 = files[0].getName().substring(files[0].getName().lastIndexOf(\"/\") +1, files[0].getName().lastIndexOf(\"/\") + 4);\n\t\t\t\tonto2 = files[1].getName().substring(files[1].getName().lastIndexOf(\"/\") +4, files[1].getName().lastIndexOf(\"/\") + 7);\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t//get the relevant vector files for these ontologies\n//\t\t\t\tvectorFile1Name = \"./files/expe_oaei_2011/vector-files-single-ontology/vectorOutput-\" + onto1 + \".txt\";\n//\t\t\t\tvectorFile2Name = \"./files/expe_oaei_2011/vector-files-single-ontology/vectorOutput-\" + onto2 + \".txt\";\n\t\t\t\tvectorFile1Name = \"./files/ATMONTO_AIRM/vector-files-single-ontology/vectorOutput-\" + onto1 + \".txt\";\n\t\t\t\tvectorFile2Name = \"./files/ATMONTO_AIRM/vector-files-single-ontology/vectorOutput-\" + onto2 + \".txt\";\n\n\t\t\t\t//match the files using the WEGlobalMatcher\n\t\t\t\ta = new WEGlobalMatcher(vectorFile1Name, vectorFile2Name);\n\t\t\t\ta.init(files[0].toURI(), files[1].toURI());\n\t\t\t\tparams = new Properties();\n\t\t\t\tparams.setProperty(\"\", \"\");\n\t\t\t\ta.align((Alignment)null, params);\t\n\t\t\t\t\n\t\t\t\t//store the computed alignment to file\n//\t\t\t\talignmentFileName = \"./files/expe_oaei_2011/alignments/\" + onto1 + \"-\" + onto2 + \"-\" + \"WEGlobal\" + \"-\" + thresholdValue + \".rdf\";\n\t\t\t\talignmentFileName = \"./files/ATMONTO_AIRM/alignments/\" + onto1 + \"-\" + onto2 + \"-\" + \"WEGlobal\" + \"-\" + thresholdValue + \".rdf\";\n\t\t\t\toutputAlignment = new File(alignmentFileName);\n\t\t\t\t\n\t\t\t\twriter = new PrintWriter(\n\t\t\t\t\t\tnew BufferedWriter(\n\t\t\t\t\t\t\t\tnew FileWriter(outputAlignment)), true); \n\t\t\t\trenderer = new RDFRendererVisitor(writer);\n\n\t\t\t\tBasicAlignment WEGlobalAlignment = (BasicAlignment)(a.clone());\n\t\t\t\t\t\t\t\n\t\t\t\t//remove all correspondences with similarity below the defined threshold\n\t\t\t\tWEGlobalAlignment.cut(threshold);\n\n\t\t\t\tWEGlobalAlignment.render(renderer);\n\t\t\t\t\n\t\t\t\tSystem.err.println(\"The WEGlobal alignment contains \" + WEGlobalAlignment.nbCells() + \" correspondences\");\n\t\t\t\twriter.flush();\n\t\t\t\twriter.close();\n\t\t\t\t\n\t\t\t\tSystem.out.println(\"\\nMatching with WEGlobal Matcher completed!\");\n\t\t\t\t\n\t\t\t\t//match the files using the WELabelMatcher\n\t\t\t\ta = new WELabelMatcher(vectorFile1Name, vectorFile2Name);\n\t\t\t\ta.init(files[0].toURI(), files[1].toURI());\n\t\t\t\tparams = new Properties();\n\t\t\t\tparams.setProperty(\"\", \"\");\n\t\t\t\ta.align((Alignment)null, params);\t\n\t\t\t\t\n\t\t\t\t//store the computed alignment to file\n//\t\t\t\talignmentFileName = \"./files/expe_oaei_2011/alignments/\" + onto1 + \"-\" + onto2 + \"-\" + \"WELabel\" + \"-\" + thresholdValue + \".rdf\";\n\t\t\t\talignmentFileName = \"./files/ATMONTO_AIRM/alignments/\" + onto1 + \"-\" + onto2 + \"-\" + \"WELabel\" + \"-\" + thresholdValue + \".rdf\";\n\t\t\t\toutputAlignment = new File(alignmentFileName);\n\t\t\t\t\n\t\t\t\twriter = new PrintWriter(\n\t\t\t\t\t\tnew BufferedWriter(\n\t\t\t\t\t\t\t\tnew FileWriter(outputAlignment)), true); \n\t\t\t\trenderer = new RDFRendererVisitor(writer);\n\n\t\t\t\tBasicAlignment WELabelAlignment = (BasicAlignment)(a.clone());\n\t\t\t\t\t\t\t\n\t\t\t\t//remove all correspondences with similarity below the defined threshold\n\t\t\t\tWELabelAlignment.cut(threshold);\n\n\t\t\t\tWELabelAlignment.render(renderer);\n\t\t\t\t\n\t\t\t\tSystem.err.println(\"The WELabel alignment contains \" + WELabelAlignment.nbCells() + \" correspondences\");\n\t\t\t\twriter.flush();\n\t\t\t\twriter.close();\n\t\t\t\tSystem.out.println(\"Matching with WELabel Matcher completed!\");\n\t\t\t}\n\t\t}\n}", "public static void main(String[] args) {\n\t\tString s = \"this is a small house .\";\n\t\tString t = \"das ist ein kleines haus .\";\n\t\tString m = \"das ist |0-1| ein kleines |2-3| haus . |4-5|\";\n\t\tArrayList<String> x = new XlingualProjection().ExtractAlignments(s,t,m);\n\t\tfor (int i=0; i<x.size(); i++){\n\t\t\tSystem.out.println(x.get(i));\n\t\t}\n\t\n\t\tString[] y = new XlingualProjection().getSrcPhrases(x);\n\t\tint start = 0;\n\t\tint end = 0;\n\t\t\n\t\tfor(int i=0; i < y.length; i++){ // Traverse through each phrase\n \tend = start + y[i].length();\n \tSystem.out.println(y[i] + \" \" + start + \" \" + end);\n \t\t\n \t\tstart = end+1;\n }\n\n }", "public static void main(String[] args) throws AlignmentException, OntowrapException, IOException {\n\t\tFile inputAlignmentFile = new File(\"./files/ESWC_ATMONTO_AIRM/Evaluation/SWEET-ATMONTO/sweet-atmonto-aml.rdf\");\n\t\tString output = \"./files/ESWC_ATMONTO_AIRM/Evaluation/SWEET-ATMONTO/conceptScopeMismatchAlignment.rdf\";\t\t\n\n\n\t\t\n\t\t//parse the alignment file\n\t\tAlignmentParser parser = new AlignmentParser();\n\t\tBasicAlignment amlAlignment = (BasicAlignment) parser.parse(inputAlignmentFile.toURI().toString());\n\t\t\n\t\tSystem.out.println(\"The input alignment contains \" + amlAlignment.nbCells() + \" relations\");\n\t\t\n\t\tURIAlignment conceptScopeMismatchAlignment = detectConceptScopeMismatch(amlAlignment);\n\t\t\t\t\n\t\t//write produced alignment to file\n\t\tPrintWriter writer = new PrintWriter(\n\t\t\t\tnew BufferedWriter(\n\t\t\t\t\t\tnew FileWriter(output)), true); \n\t\tAlignmentVisitor renderer = new RDFRendererVisitor(writer);\n\n\t\tconceptScopeMismatchAlignment.render(renderer);\n\t\t\n\t\tSystem.out.println(\"The filtered alignment contains \" + conceptScopeMismatchAlignment.nbCells() + \" mismatch relations\");\n\t\t\n\t\twriter.flush();\n\t\twriter.close();\n\t\t\n\t\tString a = \"NavigationAid\";\n\t\tString b = \"RadioNavigationAid\";\n\t\t\n\t\tSystem.out.println(isCompound(a,b));\n\t\t\n\t\t\n\n\t}", "public static void main(String[] args) {\n\t\t\n\t\t List<Result> outputK = new ArrayList<Result>();\n\n\t\t\t\n\t\t\tint alignment_type = Integer.parseInt(args[0]);\n\t\t\t\n\t\t\tif(alignment_type==1){\n\t\t\t\t\n\t\t\t\tGlobalAlignment gb = new GlobalAlignment();\n\n\t\t\t\toutputK = \tgb.PerformGlobalAlignment(args[1],args[2],args[3],args[4],Integer.parseInt(args[5]),Integer.parseInt(args[6]));\n\t\t\t\t\n \n\t\t\t\t\n\t\t\t\tfor(int i=0;i<outputK.size();i++){\n\t\t\t\t\tResult r = outputK.get(i);\n\t\t\t\t\t\n\t\t\t\t\tSystem.out.println(r.score);\n \tSystem.out.println(\"id1 \"+r.id1+\" \"+r.startpos1+\" \"+r.seq1);\n\t\t\t\t\tSystem.out.println(\"id2 \"+r.id2+\" \"+r.startpos2+\" \"+r.seq2);\n//\t\t\t\t\t\n\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}else if(alignment_type==2){\n\t\t\t\t\n\t\t\t\tLocalAlignment loc = new LocalAlignment();\n\t\t\t\toutputK = \tloc.PerformLocalAlignment(args[1],args[2],args[3],args[4],Integer.parseInt(args[5]),Integer.parseInt(args[6]));\n\t\t\t\t\n \n\t\t\t\t\n\t\t\t\tfor(int i=0;i<outputK.size();i++){\n\t\t\t\t\tResult r = outputK.get(i);\n\n\t\t\t\t\tSystem.out.println(r.score);\n System.out.println(\"id1 \"+r.id1+\" \"+r.startpos1+\" \"+r.seq1);\n\t\t\t\t\tSystem.out.println(\"id2 \"+r.id2+\" \"+r.startpos2+\" \"+r.seq2);\n\n\n\t\t\t\t}\n\t\t\t\t\n\n\t\t\t}else if(alignment_type==3){\n\t\t\t\t\n\t\t \tDoveTail dt = new DoveTail();\t\t\n\t\t\t\toutputK = \tdt.PerformDoveTailAlignment(args[1],args[2],args[3],args[4],Integer.parseInt(args[5]),Integer.parseInt(args[6]));\n\t\t\t\t\n \n\t\t\t\t\n\t\t\t\tfor(int i=0;i<outputK.size();i++){\n\t\t\t\t\tResult r = outputK.get(i);\n\n\t\t\t\t\tSystem.out.println(r.score);\n System.out.println(\"id1 \"+r.id1+\" \"+r.startpos1+\" \"+r.seq1);\n\t\t\t\t\tSystem.out.println(\"id2 \"+r.id2+\" \"+r.startpos2+\" \"+r.seq2);\n\n\t\t\t\t}\n\t\t\t\t\n\n\t\t\t}else{\n\t\t\t\tSystem.out.println(\"Enter 1,2 or 3\");\n\t\t\t}\n\t\t\n\t\n\t}", "public static void main(String[] args) throws Exception {\n if (args.length != 4) {\r\n System.out.println(\"Usage: Java LabsChapter1216a sourceFile targetFile oldStr newStr\");\r\n System.exit(1);\r\n }\r\n //Check if source file exists\r\n File sourceFile = new File(args[0]);\r\n if(!sourceFile.exists()) {\r\n System.out.println(\"Source file \" + sourceFile.getName() + \" does not exist\");\r\n System.exit(2);\r\n }\r\n //Check if target file exists\r\n File targetFile = new File(args[1]);\r\n if (targetFile.exists()) {\r\n System.out.println(\"Target file \" + targetFile.getName() + \" already exist\");\r\n System.exit(3);\r\n }\r\n try (\r\n //Create input and out file\r\n Scanner input = new Scanner(sourceFile);\r\n java.io.PrintWriter output = new java.io.PrintWriter(targetFile);\r\n ) {\r\n while (input.hasNext()) {\r\n String str1 = input.nextLine();\r\n String str2 = str1.replaceAll(args[2], args[3]);\r\n output.println(str2);\r\n System.out.println(\"OldString: \" + args[2]);\r\n System.out.println(\"NewString: \" + args[3]);\r\n System.out.println(\"ReplacedString: \" + str2);\r\n }\r\n }\r\n }", "public static void main(String[] args) {\n\t\tString CorpusFilePath = \"C:\\\\Users\\\\singh\\\\Desktop\\\\mallet-2.0.8\\\\palm\\\\palm.txt\";\n\t\tString CorpusDirPath = \"C:\\\\Users\\\\singh\\\\Desktop\\\\mallet-2.0.8\\\\palm\\\\output\";\n\n\t\tBufferedWriter out = null;\n\t\tBufferedReader br = null;\n\t\ttry {\n\t\t\tSystem.out.print(\"START\");\n\t\t\tFileInputStream fis = new FileInputStream(new File(CorpusFilePath));\n\t\t\tString CorpusContent = IOUtils.toString(fis);\n\t\t\tString[] tokens = CorpusContent.split(\"ravikrsingh20\");\n\t\t\tfor (int i = 0; i < tokens.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tFile file = new File(CorpusDirPath + File.separator + i + \".txt\");\n\t\t\t\t\tfile.createNewFile();\n\t\t\t\t\tFileWriter fstream = new FileWriter(file);\n\t\t\t\t\tout = new BufferedWriter(fstream);\n\t\t\t\t\tout.write(tokens[i]);\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t} finally {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tout.flush();\n\t\t\t\t\t\tout.close();\n\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tSystem.out.print(\"DONE\");\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "static public void main(String[] args) throws IOException{\n\t\tString sample = \"h19x24\";\n\t\tString parentFolder = \"/media/kyowon/Data1/Dropbox/fCLIP/new24/\";\t\t\n\t\tString bedFileName = \"/media/kyowon/Data1/fCLIP/samples/sample3/bed/\" + sample + \".sorted.bed\";\n\t\tString dbFasta = \"/media/kyowon/Data1/RPF_Project/genomes/hg19.fa\";\n\t\tString parameterFileName = \"/media/kyowon/Data1/fCLIP/samples/sample3/bed/\" + sample + \".sorted.param\";\n\t\t\n\t\tString trainOutFileName = parentFolder + sample + \".train.csv\";\n\t\tString arffTrainOutFileName = parentFolder + sample + \".train.arff\";\n\t\t\n\t\tString cisOutFileName = parentFolder + sample + \".csv\";\n\t\tString transOutFileNameM = parentFolder + sample + \".pair.M.csv\";\n\t\tString transOutFileNameU = parentFolder + sample + \".pair.U.csv\";\n\t\tString transControlOutFileNameM = parentFolder + sample + \".pair.M.AntiSense.csv\";\n\t\tString transControlOutFileNameU = parentFolder + sample + \".pair.U.AntiSense.csv\";\n\t\tString rmskBed = \"/media/kyowon/Data1/fCLIP/Data/cat.rmsk.bed\";\n\t\tString siControlBed = \"/media/kyowon/Data1/fCLIP/RNAseq/siControl_R1_Aligned_Sorted.bed\";\n\t\tString siKDDroshaBed = \"/media/kyowon/Data1/fCLIP/RNAseq/siDrosha_R1_Aligned_Sorted.bed\";\n\t\tString siKDDicerBed = \"/media/kyowon/Data1/fCLIP/RNAseq/siDicer_R1_Aligned_Sorted.bed\";\n\t\t\n\t\tString cisBed5pFileName = cisOutFileName + \".5p.bed\";\n\t\tString cisBed3pFileName = cisOutFileName + \".3p.bed\";\n\t\t\n\t\tdouble unpairedScoreThreshold = 0.25; \n\t\tdouble pairedScoreThreshold = unpairedScoreThreshold/5;\n\t//\tdouble motifScoreThreshold = 0.15;\n\t\t\n\t\tint num3pPaired = 10;\n\t\tint num5pPaired = 20;\n\t\t\n\t\tString filteredTransOutFileName = transOutFileNameM + \".filtered.csv\";\n\t\t\n\t\tint blatHitThreshold = 100000000;\n\t\tint transPairSeqLength = FCLIP_Scorer.getFlankingNTNumber() *2 + 80;\n\t\t\n\t\tZeroBasedFastaParser fastaParser = new ZeroBasedFastaParser(dbFasta);\n\t\tMirGff3FileParser mirParser = new MirGff3FileParser(\"/media/kyowon/Data1/fCLIP/genomes/hsa_hg19.gff3\");\n\t\tAnnotationFileParser annotationParser = new AnnotationFileParser(\"/media/kyowon/Data1/fCLIP/genomes/hg19.refFlat.txt\");\n\t\tFCLIP_ScorerTrainer.train(parameterFileName, bedFileName, mirParser, annotationParser);\n\t\t\n\t\ttrain(trainOutFileName, arffTrainOutFileName, bedFileName, fastaParser, annotationParser, mirParser, parameterFileName, unpairedScoreThreshold, pairedScoreThreshold);\n\t\trunCis(cisOutFileName, arffTrainOutFileName, bedFileName, fastaParser, annotationParser, mirParser, parameterFileName, unpairedScoreThreshold, pairedScoreThreshold);\n\n\t\tScoredPositionOutputParser.generateBedFromCsv(cisOutFileName, cisBed5pFileName, cisBed3pFileName, false); // for fold change..\n\t//\tScoredPositionOutputParser.generateFastaForMotif(cisOutFileName, cisOutFileName + \".5p.motif.fa\", cisOutFileName + \".3p.motif.fa\",cisOutFileName + \".motif.m\", \"M\");\n\t\t\n\t\trunTrans(transOutFileNameM, transOutFileNameU, cisOutFileName, arffTrainOutFileName, blatHitThreshold, transPairSeqLength, false);\n\t\tCheckRepeat.generate(cisOutFileName, transOutFileNameM, cisBed5pFileName, cisBed3pFileName, rmskBed);\n\t\tCheckRepeat.generate(cisOutFileName, transOutFileNameU, cisBed5pFileName, cisBed3pFileName, rmskBed);\n\t\tScoredPairOutputParser.generateFastaForMotif(transOutFileNameM, transOutFileNameM + \".5p.motif.fa\", transOutFileNameM + \".3p.motif.fa\");\n\t\t//GenerateCircosLinkFiles.run(transOutFileNameM + \".rmsk.csv\", transOutFileNameM + \".link.txt\");\n\t//\tCheckCoverage.generate(cisOutFileName, transOutFileNameM, cisBed5pFileName, cisBed3pFileName, siKDDroshaBed, siControlBed);\n\t///\tCheckCoverage.generate(cisOutFileName, transOutFileNameM, cisBed5pFileName, cisBed3pFileName, siKDDicerBed, siControlBed);\n\t\t\n\t\trunTrans(transControlOutFileNameM, transControlOutFileNameU, cisOutFileName, arffTrainOutFileName, blatHitThreshold, transPairSeqLength, true);\t\t\n\t\tCheckRepeat.generate(cisOutFileName, transControlOutFileNameM, cisBed5pFileName, cisBed3pFileName, rmskBed);\n\t\tCheckRepeat.generate(cisOutFileName, transControlOutFileNameU, cisBed5pFileName, cisBed3pFileName, rmskBed);\n\t\tScoredPairOutputParser.generateFastaForMotif(transControlOutFileNameM, transControlOutFileNameM + \".5p.motif.fa\", transControlOutFileNameM + \".3p.motif.fa\");\n\t//\tGenerateCircosLinkFiles.run(transControlOutFileNameM + \".rmsk.csv\", transControlOutFileNameM + \".link.txt\");\n\t\t//CheckCoverage.generate(cisOutFileName, transControlOutFileNameM, cisBed5pFileName, cisBed3pFileName, siKDDroshaBed, siControlBed);\n\t//\tCheckCoverage.generate(cisOutFileName, transControlOutFileNameM, cisBed5pFileName, cisBed3pFileName, siKDDicerBed, siControlBed);\n\t\t\n\t\tfilterTransPairs(transOutFileNameM, filteredTransOutFileName, num3pPaired, num5pPaired);\n\t\tCheckRepeat.generate(cisOutFileName, filteredTransOutFileName, cisBed5pFileName, cisBed3pFileName, rmskBed);\n\t\tScoredPairOutputParser.generateFastaForMotif(filteredTransOutFileName, filteredTransOutFileName + \".5p.motif.fa\", filteredTransOutFileName + \".3p.motif.fa\");\n\t\t//GenerateCircosLinkFiles.run(filteredTransOutFileName + \".rmsk.csv\", filteredTransOutFileName + \".link.txt\");\n\t///\tCheckCoverage.generate(cisOutFileName, filteredTransOutFileName, cisBed5pFileName, cisBed3pFileName, siKDDroshaBed, siControlBed);\n\t//\tCheckCoverage.generate(cisOutFileName, filteredTransOutFileName, cisBed5pFileName, cisBed3pFileName, siKDDicerBed, siControlBed);\n\t\t\n\t\t\n\t\t// generate background for drosha and dicer..\n\t\t\n\t\t\n\t\t// motif different conditioin?? \n\t\t\n\t\t\t\t\n\t\t//GenerateDepthsForEncodeDataSets.generate(outFileName, outFileName + \".encode.csv\", annotationParser);\n\t\t\n\t\t\n\t}", "public static void main(String[] args) {\n int arg = 0;\n int seedNum = 100;\n int trainNum = 0;\n int testNum = 0;\n boolean treeFlag = false;\n boolean textFlag = false;\n //handle options\n while (args[arg].startsWith(\"-\")) {\n switch(args[arg]) {\n case (\"-tree\"):\n treeFlag = true;\n break;\n case (\"-text\"):\n textFlag = true;\n break;\n case (\"-seednum\"):\n arg++;\n seedNum = Integer.parseInt(args[arg]);\n break;\n case (\"-trainnum\"):\n arg++;\n trainNum = Integer.parseInt(args[arg]);\n break;\n case (\"-testnum\"):\n arg++;\n testNum = Integer.parseInt(args[arg]);\n break;\n case (\"-trainall\"):\n trainNum = Integer.MAX_VALUE;\n break;\n case (\"-testall\"):\n testNum = Integer.MAX_VALUE;\n break;\n default:\n throw new IllegalArgumentException(\"Unrecognized command: \" + args[arg]);\n }\n arg++;\n }\n File sourceDirectory = new File(args[arg]);\n arg++;\n File destinationDirectory = new File(args[arg]);\n\n if(treeFlag && textFlag) {\n System.err.println(\"Both text and tree flags detected, which one do you want?\");\n System.exit(2);\n }\n\n if (trainNum == Integer.MAX_VALUE && testNum == Integer.MAX_VALUE) {\n System.err.println(\"Can't max both train and test values!\");\n System.exit(3);\n }\n\n if (!sourceDirectory.isDirectory()) {\n System.err.println(\"ERROR: \" + sourceDirectory.getName() + \"is not a directory!\");\n System.exit(4);\n }\n if (!destinationDirectory.exists()) {\n destinationDirectory.mkdirs();\n } else if (!destinationDirectory.isDirectory()) {\n System.err.println(\"ERROR: \" + destinationDirectory.getName() + \"is not a directory!\");\n System.exit(5);\n }\n\n if (treeFlag) {\n createSeededFiles(\"tree\", seedNum, trainNum, testNum, sourceDirectory, destinationDirectory);\n } else if (textFlag) {\n createSeededFiles(\"text\", seedNum, trainNum, testNum, sourceDirectory, destinationDirectory);\n }\n }", "public static void main(String[] args) throws IOException {\n\t\tString short_1_A_Path = args[0];\n\t\tString short_1_B_Path = args[1];\n\t\tString OutPutPath = args[2];\n\t\tString DataSetName = args[3];\n\t\ttry {\n\t\t\tint Num=0;\n\t\t\tString readtemp1=\"\";\n\t\t\tString readtemp2=\"\";\n\t\t\tint Short1_NumLeft=0;\n\t\t\tint Short1_NumRight=0;\n\t\t\tString encoding = \"utf-8\";\n\t\t\tFile file1 = new File(short_1_A_Path);\n\t\t\tFile file2 = new File(short_1_B_Path);\n\t\t\tif (file1.exists()&&file2.exists()) {\n\t\t\t\tInputStreamReader read1 = new InputStreamReader(new FileInputStream(file1), encoding);\n\t\t\t\tInputStreamReader read2 = new InputStreamReader(new FileInputStream(file2), encoding);\n\t\t\t\tBufferedReader bufferedReader1 = new BufferedReader(read1);\n\t\t\t\tBufferedReader bufferedReader2 = new BufferedReader(read2);\n\t\t\t\twhile ((bufferedReader1.readLine())!=null && (bufferedReader2.readLine())!= null)\n\t\t\t\t{\n\t\t\t\t\t//The second line.\n readtemp1=bufferedReader1.readLine();\n readtemp2=bufferedReader2.readLine();\t\t\t\t\t\t\n\t\t\t\t //Write left.\n\t\t\t\t\tFileWriter writer1 = new FileWriter(OutPutPath + DataSetName+\".left.fasta\",true);\n\t\t\t\t\twriter1.write(\">\"+(Short1_NumLeft++)+\"\\n\"+readtemp1+\"\\n\");\n\t\t\t\t\twriter1.close();\n\t\t\t\t\t//Write right.\t\n\t\t\t\t\tFileWriter writer2 = new FileWriter(OutPutPath + DataSetName+\".right.fasta\",true);\n\t\t\t\t\twriter2.write(\">\"+(Short1_NumRight++)+\"\\n\"+readtemp2+\"\\n\");\n\t\t\t\t\twriter2.close();\n\t\t\t\t\t//Write all.\t\n\t\t\t\t\tFileWriter writer3 = new FileWriter(OutPutPath + DataSetName+\".fasta\", true);\n\t\t\t\t\twriter3.write(\">\"+(Num)+\"\\n\"+readtemp1 +\"\\n\"+\">\"+(Num)+\"\\n\"+readtemp2+\"\\n\");\n\t\t\t\t\twriter3.close();\n\t\t\t\t\t//The third line.\n\t\t\t\t\tbufferedReader1.readLine();\n\t\t\t\t\tbufferedReader2.readLine();\n\t\t\t\t //The fourth line.\n\t\t\t\t\tbufferedReader1.readLine();\n\t\t\t\t\tbufferedReader2.readLine();\n\t\t\t\t}\n\t\t\t\tbufferedReader1.close();\n\t\t\t\tbufferedReader2.close();\n\t\t\t} \n\t\t\telse \n\t\t\t{\n\t\t\t\tSystem.out.println(\"File is not exist!\");\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Error liaoxingyu\");\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public static void main(String[] args) throws IOException {\n\t String FinalContigWritePath=args[0];\n\t\tString ContigAfterPath=args[1];\n\t\tString ContigSPAdesPath=args[2];\n\t\tString MUMmerFile1=args[3];\n\t\tString MUMmerFile2=args[4];\n\t\tint SizeOfContigAfter=CommonClass.getFileLines(ContigAfterPath)/2;\n\t String ContigSetAfterArray[]=new String[SizeOfContigAfter];\n\t int RealSizeOfContigSetAfter=CommonClass.FastaToArray(ContigAfterPath,ContigSetAfterArray); \n\t System.out.println(\"The real size of ContigSetAfter is:\"+RealSizeOfContigSetAfter);\n\t\t//low.\n\t\tint SizeOfContigSPAdes=CommonClass.getFileLines(ContigSPAdesPath);\n\t String ContigSetSPAdesArray[]=new String[SizeOfContigSPAdes+1];\n\t int RealSizeOfContigSetSPAdes=CommonClass.FastaToArray(ContigSPAdesPath,ContigSetSPAdesArray); \n\t System.out.println(\"The real size of ContigSetSPAdes is:\"+RealSizeOfContigSetSPAdes);\n\t\t//Loading After.\n\t\tint LoadingContigAfterCount=0;\n\t\tString LoadingContigAfterArray[]=new String[RealSizeOfContigSetAfter]; \n\t\tfor(int r=0;r<RealSizeOfContigSetAfter;r++)\n\t\t{\n\t\t\t if(ContigSetAfterArray[r].length()>=64)\n\t\t\t {\n\t\t\t\t LoadingContigAfterArray[LoadingContigAfterCount++]=ContigSetAfterArray[r];\n\t\t\t }\n\t\t}\n\t\tSystem.out.println(\"File After loading process end!\");\n\t\t//Alignment1.\n\t\tint SizeOfMUMmerFile1 = CommonClass.getFileLines(MUMmerFile1);\n\t\tString MUMerArray1[] = new String[SizeOfMUMmerFile1];\n\t\tint RealSizeMUMmer1 = CommonClass.FileToArray(MUMmerFile1, MUMerArray1);\n\t\tSystem.out.println(\"The real size of MUMmer1 is:\" + RealSizeMUMmer1);\n\t\t//Alignment.\n\t\tint SizeOfMUMmerFile2 = CommonClass.getFileLines(MUMmerFile2);\n\t\tString MUMerArray2[] = new String[SizeOfMUMmerFile2];\n\t\tint RealSizeMUMmer2 = CommonClass.FileToArray(MUMmerFile2, MUMerArray2);\n\t\tSystem.out.println(\"The real size of MUMmer2 is:\" + RealSizeMUMmer2);\n\t\t//Get ID1.\n\t\tSet<Integer> hashSet = new HashSet<Integer>();\n\t\tfor(int f=4;f<RealSizeMUMmer1;f++)\n\t\t{\n\t\t\tString[] SplitLine1 = MUMerArray1[f].split(\"\\t|\\\\s+\");\n\t\t\tif(SplitLine1.length==14 && (SplitLine1[13].equals(\"[CONTAINS]\") || SplitLine1[13].equals(\"[BEGIN]\") || SplitLine1[13].equals(\"[END]\")))\n\t\t\t{\n\t\t\t\tString[] SplitLine2 = SplitLine1[11].split(\"_\");\n\t\t\t\tint SPAdes_id = Integer.parseInt(SplitLine2[1]);\n\t\t\t\thashSet.add(SPAdes_id);\n\t\t\t}\n\t\t}\n\t\t//Get ID2.\n\t\tfor(int g=4;g<RealSizeMUMmer2;g++)\n\t\t{\n\t\t\tString[] SplitLine11 = MUMerArray2[g].split(\"\\t|\\\\s+\");\n\t\t\tString[] SplitLine12 = SplitLine11[12].split(\"_\");\n\t\t\tint SPAdes_id = Integer.parseInt(SplitLine12[1]);\n\t\t\thashSet.add(SPAdes_id);\n\t\t}\n\t //Write.\n\t\tint LineNum1=0;\n\t for(int x=0;x<LoadingContigAfterCount;x++)\n\t {\n\t\t\t FileWriter writer1= new FileWriter(FinalContigWritePath+\"contig.AfterMerge.fa\",true);\n\t writer1.write(\">\"+(LineNum1++)+\":\"+LoadingContigAfterArray[x].length()+\"\\n\"+LoadingContigAfterArray[x]+\"\\n\");\n\t writer1.close();\n\t }\n\t //Filter.\n\t\tint CountAdd=0;\n\t\tSet<String> HashSetSave = new HashSet<String>();\n\t for(int k=0;k<RealSizeOfContigSetSPAdes;k++)\n\t {\n\t \tif(!hashSet.contains(k))\n\t \t{\n\t \t\tHashSetSave.add(ContigSetSPAdesArray[k]);\n\t \t}\n\t }\n\t\tSystem.out.println(\"The real size of un-useded contigs is:\" + HashSetSave.size());\n\t\t//Write.\n\t\tIterator<String> it = HashSetSave.iterator();\n\t\twhile (it.hasNext()) {\n\t\t\tString SPAdesString = it.next();\n\t\t\tint Flag=1;\n\t\t for(int x=0;x<LoadingContigAfterCount;x++)\n\t\t {\n\t\t \tif((LoadingContigAfterArray[x].length()>=SPAdesString.length())&&(LoadingContigAfterArray[x].contains(SPAdesString)))\n\t\t \t{\n\t\t \t\tFlag=0;\n\t\t \t\tbreak;\n\t\t \t}\n\t\t }\n\t\t\tif(Flag==1)\n\t\t\t{\n\t\t\t\tFileWriter writer = new FileWriter(FinalContigWritePath+\"contig.AfterMerge.fa\",true);\n\t\t\t\twriter.write(\">Add:\"+(LineNum1++)+\"\\n\"+SPAdesString+\"\\n\");\n\t\t\t\twriter.close();\n\t\t\t\tCountAdd++;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"The real size of add Complementary contigs is:\" + CountAdd);\n\t\tSystem.out.println(\"File write process end!\");\n }", "public static void main(String[] args) {\r\n\t\t\r\n\t\tScanner input;\r\n\t\ttry {\r\n\t\t\tinput = new Scanner(new File(\"mirror.in\"));\r\n\t\t\tPrintWriter output = new PrintWriter(\"mirror.out\");\r\n\t\t\t//Read the input\r\n\t\t\tn = input.nextInt();\r\n\t\t\tm = input.nextInt();\r\n\t\t\tmirrors = new char[n][m];\r\n\t\t\t//Read Mirror Positions nxm matrix\r\n\t\t\tfor (int i = 0; i < n; i++) {\r\n\t\t\t\tString temp = input.next();\r\n\t\t\t\tfor (int j = 0; j < m; j++) {\r\n\t\t\t\t\tmirrors[i][j] = temp.charAt(j);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//Get Target Directions\r\n\t\t\t//Left & Right boundaries\r\n\t\t\tfor (int i = 0; i < n; i++) {\r\n\t\t\t\tgetReflection(i,0,RIGHT);\r\n\t\t\t\tgetReflection(i,m-1,LEFT);\r\n\t\t\t}\r\n\t\t\t//Top & bottom boundaries\r\n\t\t\tfor (int i = 0; i < m; i++) {\r\n\t\t\t\tgetReflection(0,i,DOWN);\r\n\t\t\t\tgetReflection(n-1,i,UP);\r\n\t\t\t}\r\n\t\t\t//Write output to file\r\n\t\t\toutput.println(maxReflections);\r\n\t\t\toutput.close();\r\n\t\t\r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t}", "public static void main(String[] args) {\r\n\r\n\t\tif (args.length == 0) {\r\n\t\t\tlog.error(\"Specification and assembly filenames not given.\");\r\n\t\t\tSystem.exit(1);\r\n\t\t}\r\n\r\n\t\telse if (args.length == 1) {\r\n\t\t\tlog.error(\"Assembly file not given.\");\r\n\t\t\tlog.error(\"Specification file: \" + args[0]);\r\n\t\t\tSystem.exit(1);\r\n\t\t}\r\n\r\n\t\telse if (args.length > 2) {\r\n\t\t\tlog.error(\"Too many arguments provided.\");\r\n\t\t\tSystem.exit(1);\r\n\t\t}\r\n\r\n\t\tif (!args[0].endsWith(\".yaml\") || !args[1].endsWith(\".asm\")) {\r\n\t\t\tlog.error(\"Input is limited to two files.\");\r\n\t\t\tSystem.exit(1);\r\n\t\t}\r\n\r\n\t\ttry {\r\n\t\t\tvar file = new FileParser(args[0], args[1]);\r\n\t\t\tvar data = file.getData();\r\n\t\t\tvar asm = new Assembler(data);\r\n\r\n\t\t\tAssembler.writeLinesToFile(\"object_code.txt\", asm.getObjectCode());\r\n\t\t} catch (FileParserException e) {\r\n\t\t\tAssembler.writeLinesToFile(\"object_code.txt\", Lists.newArrayList(e.getMessage()));\r\n\t\t\tAssembler.writeLinesToFile(\"spec_error_report.txt\", e.getErrorReport());\r\n\t\t\tSystem.exit(1);\r\n\t\t} catch (AssemblerException | IOException e) {\r\n\t\t\tSystem.exit(1);\r\n\t\t}\r\n\t}", "public static void main (String[] args){\n\t\t Model model1 = ModelFactory.createDefaultModel();\n\t\t Model model2 = ModelFactory.createDefaultModel();\n\t\t // use the FileManager to find the input file\n\t\t InputStream in1 = FileManager.get().open( \"D:\\\\eclipse\\\\carta-de-exigencia-cetesb.rdf\" );\n\t\t InputStream in2 = FileManager.get().open( \"D:\\\\eclipse\\\\liminar-contra-a-usp.rdf\" );\n\t\tif (in1 == null || in2 ==null) {\n\t\t throw new IllegalArgumentException(\n\t\t \"File: \" + \"D:\\\\eclipse\\\\carta-de-exigencia-cetesb.rdf\" + \" not found\");\n\t\t}\n\n\t\t// read the RDF/XML file\n\t\tmodel1.read(in1, null);\n\t\tmodel2.read(new InputStreamReader (in2), \"\");\n\t\tModel model = model1.union(model2);\n\n\t\tmodel.write(System.out);\n\t\t// write it to standard out\n\t\t//model1.write(System.out);\n\t\t//model1.read(new InputStreamReader(in1 ), \"\"); \n\t}", "public static void main(String[] args) {\n\t\t\n\t\tString sourceNeo4jFolder = SOURCE_NEO4J_FOLDER;\n\t\tif (args.length > 0 && !args[0].isEmpty())\n\t\t\tsourceNeo4jFolder = args[0];\n\t\t\n\t\tString targetNeo4j4jFolder = TARGET_NEO4J_FOLDER;\n\t\tif (args.length > 1 && !args[1].isEmpty())\n\t\t\ttargetNeo4j4jFolder = args[1];\n\t\t\t\n\t\tLinker linker = new Compiler(sourceNeo4jFolder, targetNeo4j4jFolder);\t\t\t\n\t\tlinker.process();\n\t}", "public static void main(String args[]){\n\t\t//parameters that can be modified\n\t\tint topicNum=100;\n\t\tString sourceID=\"1864252027/\";\n\t\tint subnetworkSize=1100;\n\t\tString dir=\"sampleTest/\"+sourceID+subnetworkSize+\"/\";\n\t\tString fileName=\"ldaInput.txt\";\n\t\tint iterationNum=1000;\n\t\t\n\t\t//read training data from file\n\t\tSystem.out.println(\"loading files\");\n\t\tGraph network=GraphOperator.getFromFile(dir+\"sample.network\");\n\t\tHashMap<String,Message>trainingStatusMap=MessageListOperator.readMessageFromFile(dir+\"trainingSet.status\");\n\t\tHashMap<String,Message>commentMap=MessageListOperator.readMessageFromFile(dir+\"samplePreDoc.comment\");\n\t\t\n\t\tDocumentAssign.relateMessageToNetwork(network,trainingStatusMap,commentMap);\n\t\tDocumentAssign.optimizedAssign(network,dir,fileName);\n\t\t\n\t\tSystem.out.println(\"Training\");\t\n\t\t//training with Optimized assignment\n\t\tLDA_InfluMax.estimationFromScratch(50/((double)topicNum),0.01,topicNum,\n\t\t\t\titerationNum,iterationNum/2,dir,fileName,50);\n\t}", "@Override\n public void align(@NonNull PbVnAlignment alignment) {\n boolean noAgentiveA0 = alignment.proposition().predicate().ancestors(true).stream()\n .allMatch(s -> s.roles().stream()\n .map(r -> ThematicRoleType.fromString(r.type()).orElse(ThematicRoleType.NONE))\n .noneMatch(ThematicRoleType::isAgentive));\n\n for (PropBankPhrase phrase : alignment.sourcePhrases(false)) {\n List<NounPhrase> unaligned = alignment.targetPhrases(false).stream()\n .filter(i -> i instanceof NounPhrase)\n .map(i -> ((NounPhrase) i))\n .collect(Collectors.toList());\n if (phrase.getNumber() == ArgNumber.A0) {\n // TODO: seems like a hack\n if (alignment.proposition().predicate().verbNetId().classId().startsWith(\"51\") && noAgentiveA0) {\n for (NounPhrase unalignedPhrase : unaligned) {\n if (unalignedPhrase.thematicRoleType() == ThematicRoleType.THEME) {\n alignment.add(phrase, unalignedPhrase);\n break;\n }\n }\n } else {\n for (NounPhrase unalignedPhrase : unaligned) {\n if (EnumSet.of(ThematicRoleType.AGENT, ThematicRoleType.CAUSER,\n ThematicRoleType.STIMULUS, ThematicRoleType.PIVOT)\n .contains(unalignedPhrase.thematicRoleType())) {\n alignment.add(phrase, unalignedPhrase);\n break;\n }\n }\n }\n } else if (phrase.getNumber() == ArgNumber.A1) {\n for (NounPhrase unalignedPhrase : unaligned) {\n if (unalignedPhrase.thematicRoleType() == ThematicRoleType.THEME\n || unalignedPhrase.thematicRoleType() == ThematicRoleType.PATIENT) {\n alignment.add(phrase, unalignedPhrase);\n break;\n }\n }\n } else if (phrase.getNumber() == ArgNumber.A3) {\n if (containsNumber(phrase)) {\n continue;\n }\n for (NounPhrase unalignedPhrase : unaligned) {\n if (unalignedPhrase.thematicRoleType().isStartingPoint()) {\n alignment.add(phrase, unalignedPhrase);\n break;\n }\n }\n } else if (phrase.getNumber() == ArgNumber.A4) {\n if (containsNumber(phrase)) {\n continue;\n }\n for (NounPhrase unalignedPhrase : unaligned) {\n if (unalignedPhrase.thematicRoleType().isEndingPoint()) {\n alignment.add(phrase, unalignedPhrase);\n break;\n }\n }\n }\n\n\n }\n }", "public static void main(String[] args) throws Exception {\n Options options = new Options();\n \n Option fileOpt = new Option(\"f\", \"file\", true, \"target spec file\");\n fileOpt.setRequired(false);\n options.addOption(fileOpt);\n \n Option coverOpt = new Option(\"c\", \"cover\", false, \"Set if the input is a coverability check.\");\n coverOpt.setRequired(false);\n options.addOption(coverOpt);\n \n Option boundOpt = new Option(\"b\", \"bound\", true, \"Set a bound on the absolute values of entries in k\");\n boundOpt.setRequired(false);\n options.addOption(boundOpt);\n \n Option minOpt = new Option(\"m\", \"min\", false, \"Set if minization should be used.\");\n minOpt.setRequired(false);\n options.addOption(minOpt); \n Option verbOpt = new Option(\"v\", \"verbose\", false, \"Set if more output is required.\");\n verbOpt.setRequired(false);\n options.addOption(verbOpt);\n \n CommandLineParser parserCmd = new DefaultParser();\n HelpFormatter formatter = new HelpFormatter();\n CommandLine cmd;\n \n try {\n cmd = parserCmd.parse(options, args);\n } catch (ParseException e) {\n System.out.println(e.getMessage());\n formatter.printHelp(\"Inequalizer\", options);\n System.exit(1);\n return;\n }\n if (cmd.hasOption(\"cover\")) {\n cover = true;\n }\n if (cmd.hasOption(\"min\")) {\n Formula.isOpt = true;\n }\n if (cmd.hasOption(\"verbose\")) {\n log.setLevel(Level.ALL);\n } else {\n log.setLevel(Level.OFF);\n }\n if (cmd.hasOption(\"bound\")) {\n isBounded = true;\n bound = Integer.parseInt(cmd.getOptionValue(\"bound\"));\n }\n if (cmd.hasOption(\"file\")) {\n String filePath = cmd.getOptionValue(\"file\");\n if (!filePath.endsWith(\"spec\")) {\n System.out.println(\"Unrecognized Petri Net format\");\n System.exit(0);\n return;\n }\n File modelfile = new File(filePath);\n \n String mcmtext = FileUtils.readFileToString(modelfile, \"UTF-8\");\n ANTLRInputStream mcminput = new ANTLRInputStream(mcmtext);\n PNLexer lexer = new PNLexer(mcminput);\n CommonTokenStream tokens = new CommonTokenStream(lexer);\n PNParser parser = new PNParser(tokens);\n //System.out.println((parser.mcm()).getText());\n //System.out.println(parser.mcm());\n PetriNet.setNet(parser.pn().netz);\n } else {\n if(cmd.hasOption(\"verbose\"))\n {\n// log.setLevel(Level.OFF);\n// for (int i = 1; i < 100; i++) {\n setExample(7);\n// }\n// System.exit(0);\n }\n else formatter.printHelp(\"Inequalizer\", options);\n }\n \n log.info(PetriNet.getNet().toString());\n log.info(\"M0: \" + m0.toString() + \"\\n\");\n log.info(\"MF: \" + mF.toString() + \"\\n\");\n// System.out.println(\"#P: \"+PetriNet.getNet().getSize()+\" #T: \"+PetriNet.getNet().getTransitions().size());\n// int[] k={3,2};\n// Inequality in=new Inequality(k);\n// in.findC();\n// in.print();\n \nif (isBounded) phi = new Formula(bound, cover);\nelse phi =new Formula(cover);\n \n \n Inequality temp = phi.simplesolve();\n if (temp != null) {\n //System.out.println(\"1\");\n //System.exit(0);\n System.out.println(\"The formula for trivial invariants produced a result.\");\n temp.setCnotrel();\n for (PNTransition transition : PetriNet.getNet().getTransitions()) {\n if (temp.isRelevant(transition) && !temp.isTrivialStable(transition)) {\n System.err.println(\"The inequalite is not stable wrt: \" + transition.getName());\n }\n }\n } else {\n log.info(\"There is no trivial solution.\");\n if(quant) temp=phi.quantifiedsolve();\n else temp = Cegar();\n }\n if (temp != null) {\n System.out.println(cmd.getOptionValue(\"file\"));\n// System.out.println(\"The marking is not reachable, it is separated from M0 by the following inductive inequality:\");\n temp.print();\n } else {\n System.out.println(\"0\");\n// System.out.println(\"There is no inductive inequality.\");\n }\n \n }", "public static void main(String[] args) throws IOException, ParseException, ParserException {\n String scoresZipName = args[0];\n String serializedScoresZipName = args[1];\n\n System.err.println(\"Reading original ...\");\n TextScoreReader tsr = new TextScoreReader(new File(scoresZipName), Astar.ROOT_EDGELABEL, Astar.IGNORE_EDGELABEL);\n\n FileOutputStream fos = new FileOutputStream(serializedScoresZipName);\n ZipOutputStream zos = new ZipOutputStream(fos);\n\n serialize(zos, \"tagProbs.ser\", tsr.getSupertagProbabilities());\n serialize(zos, \"edgeProbs.ser\", tsr.getEdgeProbabilities());\n serialize(zos, \"types.ser\", tsr.getAllTypes());\n serialize(zos, \"supertagLexStr.ser\", makeStringInterner(tsr.getSupertagLexicon()));\n serialize(zos, \"edgeLabelLex.ser\", tsr.getEdgeLabelLexicon());\n serialize(zos, \"idToSupertagStr.ser\", makeStringMap(tsr.getIdToSupertag())); // SGraph not serializable -> convert graphs to strings\n\n System.err.println(\"Writing corpus ...\");\n ZipEntry ze = new ZipEntry(\"corpus.amconll\");\n zos.putNextEntry(ze);\n Writer w = new OutputStreamWriter(zos);\n AmConllSentence.write(w, tsr.getInputCorpus());\n\n System.err.println(\"Done.\");\n zos.close();\n }", "public static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tModel model = ModelFactory.createOntologyModel( OntModelSpec.OWL_DL_MEM_RULE_INF, null );\n\n\t\t// Load ontology 1\n\t\tmodel.read(\"file:///E:/Kuliah/TUGASAKHIR/TugasAkhirLatestFolder/Software/ontologyandmappingsanddatasources/endtoendtest/book1-test1.owl\");\n\n\t\t// Query in ontology 1\n\t\tQueryExecution qe = QueryExecutionFactory.create( QueryFactory.read( \"E:\\\\Kuliah\\\\TUGASAKHIR\\\\TugasAkhirLatestFolder\\\\Software\\\\ontologyandmappingsanddatasources\\\\endtoendtest\\\\book1-query1.sparql\" ), model );\n\t\tResultSet results = qe.execSelect();\n\t\t// PrefixMapping query;\n\t\t// Output query results\t\n\t\t// ResultSetFormatter.out(System.out, results, query);\n\n\t\t// Load ontology 2\n\t\tmodel = ModelFactory.createOntologyModel( OntModelSpec.OWL_DL_MEM_RULE_INF, null );\n\t\tmodel.read(\"file:///E:/Kuliah/TUGASAKHIR/TugasAkhirLatestFolder/Software/ontologyandmappingsanddatasources/endtoendtest/book2-test1.owl\");\n\t\t\t\n\t\t// Transform query\n\t\tString transformedQuery = null;\n\t\tString firstQuery = null;\n\t\ttry {\n\t\t InputStream in = new FileInputStream(\"E:/Kuliah/TUGASAKHIR/TugasAkhirLatestFolder/Software/ontologyandmappingsanddatasources/endtoendtest/book1-query1.sparql\");\n\t\t BufferedReader reader = new BufferedReader( new InputStreamReader(in) );\n\t\t String line = null;\n\t\t String queryString = \"\";\n\t\t while ((line = reader.readLine()) != null) {\n\t\t\tqueryString += line + \"\\n\";\n\t\t }\n\t\t firstQuery = queryString;\n\t\t Properties parameters = new Properties();\n\t\t \n\t\t AlignmentParser aparser = new AlignmentParser(0);\n//\t\t Mapping\n\t\t Alignment alu = aparser.parse(\"file:///E:/Kuliah/TUGASAKHIR/TugasAkhirLatestFolder/Software/align-4.9/html/tutorial/tutorial4/bookalignment.rdf\");\n\t\t BasicAlignment al = (BasicAlignment) alu;\n\t\t\ttransformedQuery = ((BasicAlignment)al).rewriteQuery( queryString, parameters );\n//\t\t transformedQuery = ((ObjectAlignment)al).\n\t\t} catch ( Exception ex ) { ex.printStackTrace(); }\n\n\t\t// Query ontology 2\n\t\tSystem.out.println(transformedQuery);\n//\t\tdisplayQueryAnswer( model, QueryFactory.create( transformedQuery ) );\n\t\tqe = QueryExecutionFactory.create( QueryFactory.create( firstQuery ), model );\n\t\tresults = qe.execSelect();\n\t\tSystem.out.println(results);\n\t\t\n\t\t// Output query results\t\n\t\t// ResultSetFormatter.out(System.out, results, query);\n\t}", "public static void main(String[] args) throws Exception\n {\n if (args.length==0 || args[0].equals(\"-h\")){\n System.err.println(\"Tests: call as $0 org1=g1.fa,org2=g2.fa annot.txt 5ss-motif 5ss-boundary 3ss-motif 3ss-boundary\");\n System.err.println(\"Outputs splice site compositions.\");\n System.exit(9);\n }\n \n int arg_idx=0;\n String genome_fa_list = args[arg_idx++];\n String annotation_file = args[arg_idx++];\n int donor_motif_length = Integer.parseInt(args[arg_idx++]);\n int donor_boundary_length = Integer.parseInt(args[arg_idx++]);\n int acceptor_motif_length = Integer.parseInt(args[arg_idx++]);\n int acceptor_boundary_length = Integer.parseInt(args[arg_idx++]);\n\n AnnotatedGenomes annotations = new AnnotatedGenomes();\n List<String> wanted_organisms = annotations.readMultipleGenomes(genome_fa_list);\n annotations.readAnnotations(annotation_file); \n \n SpliceSiteComposition ss5[] = new SpliceSiteComposition[wanted_organisms.size()];\n SpliceSiteComposition ss3[] = new SpliceSiteComposition[wanted_organisms.size()];\n \n for (int org_idx=0; org_idx<wanted_organisms.size(); org_idx++)\n {\n String org = wanted_organisms.get(org_idx);\n System.out.println(\"#SSC organism \"+org);\n \n SpliceSiteComposition don = ss5[org_idx] = new SpliceSiteComposition(donor_motif_length, donor_boundary_length, true);\n SpliceSiteComposition acc = ss3[org_idx] = new SpliceSiteComposition(acceptor_motif_length, acceptor_boundary_length, false);\n\n for (GenePred gene: annotations.getAllAnnotations(org))\n {\n don.countIntronSites(gene);\n acc.countIntronSites(gene);\n\n } // for gene \n \n //don.reportStatistics(System.out);\n //acc.reportStatistics(System.out);\n don.writeData(System.out);\n acc.writeData(System.out);\n \n } // for org\n }", "public static void main(String[] args) throws IOException {\n\t\tString groundTruthPath = \"C:/Users/15T-J000/Desktop/Malware_Classes_Ground_Truth.csv\";\n\t\tString resultPath = \"C:/Users/15T-J000/Desktop/sysnumresult.csv\";\n\t\tString outPath = \"C:/Users/15T-J000/Desktop/correction.csv\";\n\t\t\n\t\tint[] eachResult = {16, 17}; // Don't count index and name column (-2)\n\t\t\n\t\tMapping mapping = new Mapping();\n\t\tmapping.read(groundTruthPath, resultPath);\n\t\tmapping.compare(outPath, 17);\n\n\t}", "public static void main (String[] args) throws IOException {\n if (args.length < 6 || args.length % 2 == 1) {\n System.err.println (\"MENameTagger requires 4 + 2n arguments for n training corpora:\");\n System.err.println (\" state-file feature-file model-file props-file directory1 filelist1 [directory2 filelist2] ...\");\n System.exit (1);\n }\n String stateFile = args[0];\n String featureFile = args[1];\n String modelFile = args[2];\n String configFile = args[3];\n\t\tJetTest.initializeFromConfig (configFile);\n MENameTagger nt = new MENameTagger();\n\t\tnt.initialize (stateFile, featureFile);\n\t\tfor (int pass=1; pass <= 2; pass++) {\n\t\t\tMaxEntNE.pass = pass;\n\t\t\tMaxEntNE.trainingDocCount = 0;\n \tfor (int iarg = 4; iarg<args.length; iarg+=2) {\n \tString directory = args[iarg];\n \tString fileList = args[iarg+1];\n \tnt.train (directory, fileList);\n\t\t\t}\n }\n\t\tnt.mene.createModel();\n nt.store(modelFile);\n\t}", "public static void main(String[] args) {\n try {\n convert(\"d:\\\\MLDATA\\\\adult.data\", \"d:\\\\MLDATA\\\\adult_standard.csv\", \"[ \\t]*,[ \\t]*\");\n convert(\"d:\\\\MLDATA\\\\adult.test\", \"d:\\\\MLDATA\\\\adult_standard_test.csv\", \"[ \\t]*,[ \\t]*\");\n }\n catch (Exception e)\n {\n e.printStackTrace();\n }\n }", "public static void main(String[] args) {\n\t\tList<String> listSouceCode = Helper.getAllDataFromFolder(DATASET1);\n\n\t\t//Create the HMM for concepts\n\t\tHMMConcept hmmConcept = new HMMConcept();\n\t\thmmConcept.init();\n\t\tHMMConceptInit.initTransition(hmmConcept);\n\n\t\t//Now, let us test the training phase\n\t\t//Transition probabilities\n\t\tHMMConceptTransition.\n\t\t\tpreTransition(listSouceCode, hmmConcept);\n\t\tHMMConceptTransition.\n\t\t\ttargetTransition(listSouceCode, hmmConcept);\n\t\tHMMConceptTransition.\n\t\t\totherTransition(listSouceCode, hmmConcept);\n//\t\t//Observations probabilities\n\t\tHMMConceptObservation.\n\t\t\tpreObservation(listSouceCode, hmmConcept);\n\t\tHMMConceptObservation.\n\t\t\ttargetObservation(listSouceCode, hmmConcept);\n\t\tHMMConceptObservation.\n\t\t\totherObservation(listSouceCode, hmmConcept);\n\t\t\n//\t\tSystem.out.println(hmmConcept);\n\n//\t\t//*************************END of the HMM training***************************************\n\n\t\t///To extract knowledge, just uncomment the corresponding source code\n\t\t\n\t\t/**\n\t\t * EPICAM Knowledge extraction\n//\t\t */\n//\t\t//Knowledge extraction\n//\t\tList<String> testedSourceCode = Helper.getAllDataFromFolder(DATASET2);\n//\t\tList<Column> alphaTable;\n//\t\t\n//\t\tfor (String sourceFile : testedSourceCode) {\n//\t\t\talphaTable = MostLikelyExplanationConcept.\n//\t\t\t\t\tfillAlphaStartTable4Concepts(hmmConcept, sourceFile);\n//\n//\t\t\tString extracted = MostLikelyExplanationConcept.knowledgeExtraction(alphaTable);\n////\t\t\tWriting to an OWL file\n//\t\t\tHelper.writeDataToFile(CONCEPTSEXTRACTED, extracted);\n//\t\t\t//The number of false positives and the number of target\n//\t\t\tSystem.out.println(MostLikelyExplanationConcept.nbFalsePositive+\"\\n and nb target: \"+\n//\t\t\tMostLikelyExplanationConcept.nbTarget);\n//\t\t\t\n////\t\t\tSystem.out.println(Term2OWL.term2OWL(new File(CONCEPTSEXTRACTED)));\n//\n//\t\t}\n\n\t\t/**\n\t\t * Geoserver knowledge extraction\n\t\t */\n\n\t\tList<String> testedSourceCode = Helper.getAllDataFromFolder(GEOSERVER);\n\t\tList<Column> alphaTable;\n\t\t\n\t\tfor (String sourceFile : testedSourceCode) {\n\t\t\talphaTable = MostLikelyExplanationConcept.\n\t\t\t\t\tfillAlphaStartTable4Concepts(hmmConcept, sourceFile);\n\n\t\t\tString extracted = MostLikelyExplanationConcept.knowledgeExtraction(alphaTable);\n//\t\t\tWriting to an OWL file\n\t\t\tHelper.writeDataToFile(TERMSEXTRACTED2GEOSERVER, extracted);\n\t\t\t//The number of false positives and the number of target\n\t\t\t\n//\t\t\tSystem.out.println(Term2OWL.term2OWL(new File(CONCEPTSEXTRACTED)));\n\n\t}\n\t\tSystem.out.println(MostLikelyExplanationConcept.nbFalsePositive+\"\\n and nb target: \"+\n\t\tMostLikelyExplanationConcept.nbTarget);\n\t}", "public static void main(String[] args) throws ParserConfigurationException, IOException, TransformerException, OWLOntologyCreationException, OWLOntologyStorageException, SAXException {\n\t\tFile dis = new File(args[0]);\n\t\tFile csv = new File(args[1]);\n\t\tString dir = args[2];\n\t\tFile justDir = new File(args[3]);\n\t\tFile equvCSV = new File(args[4]);\n\t\t/**\n\t\tListManager lm = new ListManager();\n\t\tList<Case> caseList = lm.constructCaseListFromCSV(csv);\n\t\tXMLCaseWriter xcw = new XMLCaseWriter();\n\t\tFile xml = new File(dir + \"/cases.xml\");\n\t\txml.canWrite();\n\t\txcw.createXMLCaseFileFromList(csv, xml, caseList, \"iswc-2014\");\n\t\t/**\n\t\tint i = 0;\n\t\tList<Map<String,String>> records = CSVUtilities.getRecords(csv);\n\t\tfor(Map<String,String> r:records)\n\t\t{\n\t\t\t\n\t\t\tSystem.out.println(\"Map \" + i);\n\t\t\tfor(String k:r.keySet())\n\t\t\t{\n\t\t\t\tSystem.out.println(k);\n\t\t\t\tSystem.out.println(r.get(k));\n\t\t\t\tSystem.out.println(\"\");\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t\ti++;\n\t\t}\n\t\t**/\n\t\t\n\t\tListManager lm = new ListManager();\n\t\tList<Case> caseList = lm.constructCaseListFromCSV(csv);\n\t\tMap<String,List<Case>> splitMap = new HashMap<String,List<Case>>();\n\t\tMap<String,List<String>> equvMap = lm.getIDMapForEQClasses(equvCSV);\n\t\tXMLCaseWriter xcw = new XMLCaseWriter();\n\t\txcw.createOntologySortedXMLCaseFilesFromList(csv, new File(dir), justDir, equvMap, caseList, \"iswc-2014\");\n\t\t/**\n\t\tfor(Case c:caseList)\n\t\t{\n\t\t\tif(!splitMap.keySet().contains(c.getOntology()))\n\t\t\t{\n\t\t\t\tList<Case> list = new ArrayList<Case>();\n\t\t\t\tlist.add(c);\n\t\t\t\tsplitMap.put(c.getOntology().toString(), list);\n\t\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tList<Case> list = splitMap.get(c.getOntology().toString());\n\t\t\t\tlist.add(c);\n\t\t\t\tsplitMap.replace(c.getOntology().toString(), list);\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\tfor(String key:splitMap.keySet())\n\t\t{\n\t\t\tList<Case> clist = splitMap.get(key);\n\t\t\tXMLCaseWriter xcw = new XMLCaseWriter();\n\t\t\tFile xml = new File(dir + key + \".cases.xml\");\n\t\t\txml.canWrite();\n\t\t\txcw.createXMLCaseFileFromList(csv, xml, justDir, equvCSV, clist, \"iswc-2014\");\n\t\t\t\n\t\t}\n\t\t//List<Case> list = lm.constructCaseListFromDisFile(dis);\n\t\t//Map<Case,ArrayList<String>> m =lm.getCaseListMetaData(list, csv);\n\t\t\n\t\t/**\n\t\tfor(Case c:m.keySet())\n\t\t{\n\t\t\tSystem.out.println(c.getOntology().toString());\n\t\t\tSystem.out.println(c.getEntailment().toString());\n\t\t\tfor(String s: m.get(c))\n\t\t\t{\n\t\t\t\tSystem.out.println(s);\n\t\t\t}\n\t\t}\n\t\t**/\n\t\t/**\n\t\tArrayList<CaseData> cd = lm.constructCaseDataFromCSV(list, csv);\n\t\tfor(CaseData data:cd)\n\t\t{\n\t\t\tSystem.out.println(data.getCase().getOntology());\n\t\t\tSystem.out.println(data.getCase().getEntailment().toString());\n\t\t\tSystem.out.println(\"METADATA: \" + data.getMetaData().getMetaData());\n\t\t\tSystem.out.println(\"EVIDENCE \" + data.getEvidence().getMetaData());\n\t\t\tSystem.out.println(\"RV:\");\n\t\t\tfor(ReasonerVerdict rv:data.getReasonerVerdicts())\n\t\t\t{\n\t\t\t\tSystem.out.println(rv.getReasoner());\n\t\t\t\tSystem.out.println(rv.getValue());\n\t\t\t}\n\t\t\tSystem.out.println(\"SUBCASES:\");\n\t\t\tfor(Subcase s:data.getSubcases())\n\t\t\t{\n\t\t\t\tSystem.out.println(s.getJustification());\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t}\n\t\tList<Subcase> sc = lm.extractSubcasesFromCaseData(cd);\n\t\tArrayList<SubcaseData> scd = lm.constructSubCaseDataFromCSV(sc, csv);\n\t\tfor(SubcaseData data:scd)\n\t\t{\n\t\t\tSystem.out.println(data.getCase().getOntology());\n\t\t\tSystem.out.println(data.getCase().getEntailment().toString());\n\t\t\tSystem.out.println(data.getCase().getJustification());\n\t\t\tSystem.out.println(\"GEN REASONER: \" + data.getGeneratingReasoner());\n\t\t\tSystem.out.println(\"METADATA: \" + data.getMetaData().getMetaData());\n\t\t\tSystem.out.println(\"EVIDENCE \" + data.getEvidence().getMetaData());\n\t\t\tSystem.out.println(\"RV:\");\n\t\t\tfor(ReasonerVerdict rv:data.getReasonerVerdicts())\n\t\t\t{\n\t\t\t\tSystem.out.println(rv.getReasoner());\n\t\t\t\tSystem.out.println(rv.getValue());\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t}\n\t\t\n\t\tXMLCaseWriter xcw = new XMLCaseWriter();\n\t\txcw.createXMLCaseFileFromDisAndCSV(dis, csv, xml, \"iswc-2014\");\n\t\t//xcw.createXMLCaseFileFromDis(csv, xml, \"iswc\");\n\t\t * \n\t\t */\n\t\t}", "public static void main(String[] args) {\n String s1 = \"/Users/ElvisLee/Dropbox/workspace/drjava_workspace/algorithms/WordNet/wordnet/synsets.txt\";\n String s2 = \"/Users/ElvisLee/Dropbox/workspace/drjava_workspace/algorithms/WordNet/wordnet/hypernyms.txt\";\n WordNet wordnet = new WordNet(s1, s2);\n Outcast outcast = new Outcast(wordnet);\n for (int t = 0; t < args.length; t++) {\n In in = new In(args[t]);\n String[] nouns = in.readAllStrings();\n StdOut.println(args[t] + \": \" + outcast.outcast(nouns));\n }\n }", "static public void main(String argv[]) {\n for (String s : argv) {\n if (s.equals(\"-a\")) {\n SHOW_TREE = true;\n }\n else if (s.equals(\"-s\")) {\n SHOW_SYM_TABLES = true;\n }\n else if (s.equals(\"-c\")) {\n GENERATE_CODE = true;\n }\n //Check if the string ends with '.cm'\n else if (s.length() > 3 && s.substring(s.length()-3).equals(\".cm\")) { \n // If it does, make that the input file\n INPUT_FILE = s;\n }\n }\n\n if (INPUT_FILE == null) {\n System.out.println(\"No input file provided or incorrect file extension (must be .cm). Exiting...\");\n System.exit(-1);\n }\n\n // Retrieve the actual file name from between the path and the extension\n // E.g. tests/sort.cm gives a result of 'sort'\n int nameStartIndex = INPUT_FILE.lastIndexOf('/');\n int nameEndIndex = INPUT_FILE.lastIndexOf('.');\n FILE_NAME = INPUT_FILE.substring(nameStartIndex + 1, nameEndIndex);\n \n /* Start the parser */\n try {\n // Save original stdout to switch back to it as needed\n PrintStream console = System.out;\n\n if (!SHOW_SYM_TABLES && !SHOW_TREE && !GENERATE_CODE) {\n System.out.println(\"Showing errors only.\");\n System.out.println(\"Use [-a] flag to print the abstract syntax tree\" + \"\\n\" \n + \"Use [-s] flag to print the symbol table\" + \"\\n\"\n + \"Use [-c] to generate assembly code (.tm)\"); \n } \n\n parser p = new parser(new Lexer(new FileReader(INPUT_FILE)));\n // implement \"-a\", \"-s\", \"-c\" options\n Absyn result = (Absyn)(p.parse().value); \n \n if (result != null) {\n \n // If the '-a' flag is set, print the abstract syntax tree to a .abs file\n if (SHOW_TREE) {\n System.out.println(\"Abstract syntax tree written to '\" + FILE_NAME + \".abs'\");\n\n //Redirect stdout\n File absFile = new File(FILE_NAME + \".abs\");\n FileOutputStream absFos = new FileOutputStream(absFile);\n PrintStream absPS = new PrintStream(absFos);\n System.setOut(absPS);\n\n // Print abstract syntax tree to FILE_NAME.abs in current directory\n ShowTreeVisitor visitor = new ShowTreeVisitor();\n result.accept(visitor, 0, false); \n\n //Reset stdout\n System.setOut(console);\n }\n if (SHOW_SYM_TABLES) {\n //Redirect stdout to a .sym file \n File symFile = new File(FILE_NAME + \".sym\");\n FileOutputStream symFos = new FileOutputStream(symFile);\n PrintStream symPS = new PrintStream(symFos);\n System.setOut(symPS);\n } \n else {\n //Toss stdout output into the void while doing semantic analysis\n System.setOut(new PrintStream(OutputStream.nullOutputStream()));\n } \n\n // Perform semantic analysis\n SemanticAnalyzer analyzerVisitor = new SemanticAnalyzer();\n result.accept(analyzerVisitor, 0, false);\n\n //Restore stdout\n System.setOut(console);\n\n if (SHOW_SYM_TABLES) {\n //Print after having reported any errors\n System.out.println(\"Symbol table written to '\" + FILE_NAME + \".sym'\");\n }\n\n //Only generate code if the flag is set\n if (GENERATE_CODE) {\n\n //First, confirm that there are no syntax or semantic errors\n //HAS_ERRORS is true if there are any syntax errors or semantic errors, and false if both are error free\n HAS_ERRORS = (p.errorFound || analyzerVisitor.errorFound);\n\n if (HAS_ERRORS) {\n System.out.println(\"Cannot generate code while there are errors. Exiting...\");\n }\n else {\n //No syntax or semantic errors, proceed with code generation\n System.out.println(\"Assembly code written to '\" + FILE_NAME + \".tm'\");\n\n //Redirect stdout to .tm file\n File tmFile = new File(FILE_NAME + \".tm\");\n FileOutputStream tmFos = new FileOutputStream(tmFile);\n PrintStream tmPS = new PrintStream(tmFos);\n System.setOut(tmPS);\n\n //Perform code generation\n CodeGenerator generatorVisitor = new CodeGenerator();\n //result.accept(generatorVisitor, 0, false);\n generatorVisitor.visit(result, FILE_NAME + \".tm\");\n \n } \n }\n }\n\n } catch (FileNotFoundException e) {\n System.out.println(\"Could not find file '\" + INPUT_FILE + \"'. Check your spelling, and ensure it exists. Exiting...\");\n System.exit(-1); \n } catch (Exception e) {\n /* do cleanup here -- possibly rethrow e */\n e.printStackTrace();\n }\n }", "public static void main(String[] args) throws IOException, FormatMismatchException\n\t{\n\t\t//StandardArguments sargs = new StandardArguments();\n\t\t//sargs.bake(args);\n\t\t\n\t\tEdosTool tool = new EdosTool();\n\t\t\n\t\t/*if (!sargs.getLongSuffices(\"type=\").isEmpty())\n\t\t{\n\t\t\ttool.formatName = sargs.getLongSuffices(\"type=\").get(0);\n\t\t}\n\t\t\n\t\tif (!sargs.getLongSuffices(\"suffix=\").isEmpty())\n\t\t{\n\t\t\ttool.suffix = sargs.getLongSuffices(\"suffix=\").get(0);\n\t\t}\n\t\t\n\t\ttool.verbose = sargs.isSwitchPresent('v');\n\t\t\n\t\t\n\t\tfor (String t : sargs.getTargets())\n\t\t{\n\t\t\ttool.processExtract(new File(t));\n\t\t}*/\n\t}", "public static void main(String[] args) throws IOException {\n\t\tString MUMmerFile = args[0];\n\t\tString ErrorEPGAcontigFile = args[1];\n\t\tString ErrorFreeEPGAcontigFile = args[2];\n\t\tString SPAdescontigFile = args[3];\n\t\tString DataName = args[4];\n\t\tString FinalEPGAcontigPath = args[5];\n\t\t//Alignment.\n\t\tint SizeOfMUMmerFile = CommonClass.getFileLines(MUMmerFile);\n\t\tString MUMerArray[] = new String[SizeOfMUMmerFile];\n\t\tint RealSizeMUMmer = CommonClass.FileToArray(MUMmerFile, MUMerArray);\n\t\tSystem.out.println(\"The real size of MUMmer is:\" + RealSizeMUMmer);\n\t\t//Load EPGA.\n\t\tint SizeOfErrorEPGAFile = CommonClass.getFileLines(ErrorEPGAcontigFile);\n\t\tString ErrorEPGAcontigArray[] = new String[SizeOfErrorEPGAFile];\n\t\tint RealSizeErrorEPGAcontig = CommonClass.FastaToArray(ErrorEPGAcontigFile, ErrorEPGAcontigArray);\n\t\tSystem.out.println(\"The real size of Error EPGA assembly is:\" + RealSizeErrorEPGAcontig);\n\t\t//Load EPGA.\n\t\tint SizeOfErrorFreeEPGAFile = CommonClass.getFileLines(ErrorFreeEPGAcontigFile);\n\t\tString ErrorFreeEPGAcontigArray[] = new String[SizeOfErrorFreeEPGAFile];\n\t\tint RealSizeErrorFreeEPGAcontig = CommonClass.FastaToArray(ErrorFreeEPGAcontigFile, ErrorFreeEPGAcontigArray);\n\t\tSystem.out.println(\"The real size of Error Free EPGA assembly is:\" + RealSizeErrorFreeEPGAcontig);\n\t\t//Load SPAdes.\n\t\tint SizeOfSPAdesFile = CommonClass.getFileLines(SPAdescontigFile);\n\t\tString SPAdescontigArray[] = new String[SizeOfSPAdesFile];\n\t\tint RealSizeSPAdescontig = CommonClass.FastaToArray(SPAdescontigFile, SPAdescontigArray);\n\t\tSystem.out.println(\"The real size of SPAdes assembly is:\" + RealSizeSPAdescontig);\n\t\t//Process.\n\t\tSet<Integer> hashSet = new HashSet<Integer>();\n\t\tfor (int w = 4; w < RealSizeMUMmer; w++) {\n\t\t\tif (MUMerArray[w].charAt(0) != '#') {\n\t\t\t\tint CountSave = 0;\n\t\t\t\tString SaveTempArray[] = new String[RealSizeMUMmer];\n\t\t\t\tString[] SplitLine1 = MUMerArray[w].split(\"\\t|\\\\s+\");\n\t\t\t\tSaveTempArray[CountSave++] = MUMerArray[w];\n\t\t\t\tMUMerArray[w] = \"#\" + MUMerArray[w];\n\t\t\t\tfor (int e = w + 1; e < RealSizeMUMmer; e++) {\n\t\t\t\t\tif (MUMerArray[e].charAt(0) != '#') {\n\t\t\t\t\t\tString[] SplitLine2 = MUMerArray[e].split(\"\\t|\\\\s+\");\n\t\t\t\t\t\tif (SplitLine1[11].equals(SplitLine2[11])) {\n\t\t\t\t\t\t\tSaveTempArray[CountSave++] = MUMerArray[e];\n\t\t\t\t\t\t\tMUMerArray[e] = \"#\" + MUMerArray[e];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Mark read.\n\t\t\t\tfor (int r = 0; r < CountSave; r++) {\n\t\t\t\t\tString[] SplitLine31 = SaveTempArray[r].split(\"\\t|\\\\s+\");\n\t\t\t\t\tString[] SplitLine41 = SplitLine31[12].split(\"_\");\n\t\t\t\t\tint SPAdes_id = Integer.parseInt(SplitLine41[1]);\n\t\t\t\t\thashSet.add(SPAdes_id);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//Write.\n\t\tint CountCorrEPGA=0;\n\t\tString CorrEPGAContigArray[]=new String[2*(RealSizeErrorFreeEPGAcontig+RealSizeSPAdescontig)];\n\t\tint EPId = 0;\n\t\tfor (int w = 0; w < RealSizeErrorFreeEPGAcontig; w++) {\n CorrEPGAContigArray[CountCorrEPGA++]=ErrorFreeEPGAcontigArray[w];\n\t\t}\n\t\tIterator<Integer> it = hashSet.iterator();\n\t\twhile (it.hasNext()) {\n\t\t\tint EPGAIndex = it.next();\n CorrEPGAContigArray[CountCorrEPGA++]=SPAdescontigArray[EPGAIndex];\n\t\t}\n\t\t//Sort process.\n\t\tString exch=\"\";\n\t\tfor(int w=0;w<CountCorrEPGA;w++)\n\t\t{\n\t\t\tfor(int h=w+1;h<CountCorrEPGA;h++)\n\t\t\t{\n\t\t\t\tif(CorrEPGAContigArray[w].length()<CorrEPGAContigArray[h].length())\n\t\t\t\t{\n\t\t\t\t\texch=CorrEPGAContigArray[w];\n\t\t\t\t\tCorrEPGAContigArray[w]=CorrEPGAContigArray[h];\n\t\t\t\t\tCorrEPGAContigArray[h]=exch;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//Delete duplicate records.\n\t\tfor(int w=0;w<CountCorrEPGA;w++)\n\t\t{\n\t\t\tfor(int h=w+1;h<CountCorrEPGA;h++)\n\t\t\t{\n\t\t \tif(CorrEPGAContigArray[w].equals(CorrEPGAContigArray[h])||CorrEPGAContigArray[w].equals(CommonClass.reverse(CorrEPGAContigArray[h])))\n\t\t\t\t{\n\t\t\t\t\tCorrEPGAContigArray[h]=\"%\"+CorrEPGAContigArray[h];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(int j=0;j<CountCorrEPGA;j++)\n\t\t{\n\t\t\tif(CorrEPGAContigArray[j].charAt(0)!='%')\n\t\t\t{\n\t\t\t\t FileWriter writer = new FileWriter(FinalEPGAcontigPath + \"/CorrEPGAcontig.\" + DataName + \".fa\", true);\n\t\t\t writer.write(\">\" + (EPId++) + \"\\n\" + CorrEPGAContigArray[j] + \"\\n\");\n\t\t\t writer.close();\n\t\t\t}\n\t\t}\n\t\t//Free.\n\t\tMUMerArray=null;\n\t\tErrorEPGAcontigArray=null;\n\t\tErrorFreeEPGAcontigArray=null;\n\t\tSPAdescontigArray=null;\n\t\tCorrEPGAContigArray=null;\n\t}", "public static void main(String[] args) throws IOException {\n\t\tString MUMmerFile = args[0];\n\t\tString ErrorFreeEPGAcontigFile = args[1];\n\t\tString SPAdescontigFile = args[2];\n\t\tString DataName = args[3];\n\t\tString FinalEPGAcontigPath = args[4];\n\t\t//Alignment.\n\t\tint SizeOfMUMmerFile = CommonClass.getFileLines(MUMmerFile);\n\t\tString MUMerArray[] = new String[SizeOfMUMmerFile];\n\t\tint RealSizeMUMmer = CommonClass.FileToArray(MUMmerFile, MUMerArray);\n\t\tSystem.out.println(\"The real size of MUMmer is:\" + RealSizeMUMmer);\n\t\t//Load Error Free EPGA.\n\t\tint SizeOfErrorFreeEPGAFile = CommonClass.getFileLines(ErrorFreeEPGAcontigFile);\n\t\tString ErrorFreeEPGAcontigArray[] = new String[SizeOfErrorFreeEPGAFile];\n\t\tint RealSizeErrorFreeEPGAcontig = CommonClass.FastaToArray(ErrorFreeEPGAcontigFile, ErrorFreeEPGAcontigArray);\n\t\tSystem.out.println(\"The real size of Error Free EPGA assembly is:\" + RealSizeErrorFreeEPGAcontig);\n\t\t//Load SPAdes.\n\t\tint SizeOfSPAdesFile = CommonClass.getFileLines(SPAdescontigFile);\n\t\tString SPAdescontigArray[] = new String[SizeOfSPAdesFile];\n\t\tint RealSizeSPAdescontig = CommonClass.FastaToArray(SPAdescontigFile, SPAdescontigArray);\n\t\tSystem.out.println(\"The real size of SPAdes assembly is:\" + RealSizeSPAdescontig);\n\t\t//Process.\n\t\tSet<Integer> hashSet = new HashSet<Integer>();\n\t\tfor (int w = 4; w < RealSizeMUMmer; w++) \n\t\t{\n\t\t\tString[] SplitLine1 = MUMerArray[w].split(\"\\t|\\\\s+\");\n\t\t\tif(SplitLine1.length==14 && (SplitLine1[13].equals(\"[CONTAINS]\") || SplitLine1[13].equals(\"[BEGIN]\") || SplitLine1[13].equals(\"[END]\")))\n\t\t\t{\n\t\t\t\tString[] SplitLine2 = SplitLine1[11].split(\"_\");\n\t\t\t\tint SPAdes_id = Integer.parseInt(SplitLine2[1]);\n\t\t\t\thashSet.add(SPAdes_id);\n\t\t\t\tint EPGA_id = Integer.parseInt(SplitLine1[12]);\n\t\t\t\tSystem.out.println(\"SplitLine1[13]:\"+SplitLine1[13]+\"\\t\"+\"Spades:\"+SPAdes_id+\"\\t\"+\"epga:\"+EPGA_id);\n\t\t\t\tErrorFreeEPGAcontigArray[EPGA_id]=\"#\"+ErrorFreeEPGAcontigArray[EPGA_id];\t\n\t\t\t}\n\t\t}\n\t\t//Write.\n\t\tfor (int w = 0; w < RealSizeErrorFreeEPGAcontig; w++) \n\t\t{\n\t\t\tif(ErrorFreeEPGAcontigArray[w].charAt(0)!='#')\n\t\t\t{\n\t\t\t\tFileWriter writer = new FileWriter(FinalEPGAcontigPath + \"/ReplaceEPGAcontig.\" + DataName + \".fa\", true);\n\t\t\t\twriter.write(\">\" + (w) + \"\\n\" + ErrorFreeEPGAcontigArray[w] + \"\\n\");\n\t\t\t\twriter.close();\n\t\t\t}\n\t\t}\n\t\tIterator<Integer> it = hashSet.iterator();\n\t\twhile (it.hasNext()) {\n\t\t\tint SPAdesIndex = it.next();\n\t\t\tFileWriter writer = new FileWriter(FinalEPGAcontigPath + \"/ReplaceEPGAcontig.\" + DataName + \".fa\", true);\n\t\t\twriter.write(\">Add:\" + (SPAdesIndex) + \"\\n\" + SPAdescontigArray[SPAdesIndex] + \"\\n\");\n\t\t\twriter.close();\n\t\t}\n\t\t//Free.\n\t\tMUMerArray=null;\n\t\tErrorFreeEPGAcontigArray=null;\n\t\tSPAdescontigArray=null;\n\t}", "public static void main(String[] args) {\n\t\tString text = \"\\\"undifferentiated's thyroid carcinomas were carried out with antisera against calcitonin, calcitonin-gene related peptide (CGRP), somatostatin, and also thyroglobulin, using the PAP method. \";\n\t\ttext = text.replace('\\\"', ' ');\n\t\t\n\t\tStringUtil su = new StringUtil();\n\t\t\n\t\t// Extracting...\n\t\tString text2 = new String(text);\n\t\tEnvironmentVariable.setMoaraHome(\"./\");\n\t\tGeneRecognition gr = new GeneRecognition();\n\t\tArrayList<GeneMention> gms = gr.extract(MentionConstant.MODEL_BC2,text);\n\t\t// Listing mentions...\n\t\tSystem.out.println(\"Start\\tEnd\\tMention\");\n\t\tfor (int i=0; i<gms.size(); i++) {\n\t\t\tGeneMention gm = gms.get(i);\n\t\t\tSystem.out.println(gm.Start() + \"\\t\" + gm.End() + \"\\t\" + gm.Text());\n\t\t\t//System.out.println(text2.substring(gm.Start(), gm.End()));\n\t\t\tSystem.out.println(su.getTokenByPosition(text,gm.Start(),gm.End()).trim());\n\t\t}\n\t\tif (true){\n\t\t\treturn;\n\t\t}\n\t\t// Normalizing mentions...\n\t\tOrganism yeast = new Organism(Constant.ORGANISM_YEAST);\n\t\tOrganism human = new Organism(Constant.ORGANISM_HUMAN);\n\t\tExactMatchingNormalization gn = new ExactMatchingNormalization(human);\n\t\tgms = gn.normalize(text,gms);\n\t\t// Listing normalized identifiers...\n\t\t\n\t\tSystem.out.println(\"\\nStart\\tEnd\\t#Pred\\tMention\");\n\t\tfor (int i=0; i<gms.size(); i++) {\n\t\t\tGeneMention gm = gms.get(i);\n\t\t\tif (gm.GeneIds().size()>0) {\n\t\t\t\tSystem.out.println(gm.Start() + \"\\t\" + gm.End() + \"\\t\" + gm.GeneIds().size() + \n\t\t\t\t\t\"\\t\" + su.getTokenByPosition(text,gm.Start(),gm.End()).trim());\n\t\t\t\tfor (int j=0; j<gm.GeneIds().size(); j++) {\n\t\t\t\t\tGenePrediction gp = gm.GeneIds().get(j);\n\t\t\t\t\tSystem.out.print(\"\\t\" + gp.GeneId() + \" \" + gp.OriginalSynonym() + \" \" + gp.ScoreDisambig());\n\t\t\t\t\tSystem.out.println((gm.GeneId().GeneId().equals(gp.GeneId())?\" (*)\":\"\"));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public static void main(String[] args) throws IOException {\n\t\tString outPath = \"/home/sujay/Documents/FilesFromJavaCode/output/\";\n\t\tString inPath = \"/home/sujay/Documents/FilesFromJavaCode/input/\";\n\n\t\t// folder name need to generate\n\t\t// (At run time, based on selected company or selected Account number)\n\t\tString floder = \"1116884005_FEB-2020\";\n\n\t\t// Output path to create new folder and copy the file(s)\n\t\tString destPath = outPath + floder;\n\n\t\t// Creating a File object\n\t\tFile file = new File(destPath);\n\n\t\t// Checking is particular folder exist or not\n\t\tif (!file.exists()) {\n\t\t\t// Creating the directory, if not exist\n\t\t\tfile.mkdir();\n\t\t}\n\n\t\t// from path mention from yml file and file name have to be declare\n\t\tFile from = null;\n\t\tFile dest = null;\n\t\tint fileNum = 1;\n\t\tfor (int i = 1; i <= fileNum; i++) {\n\t\t\tfrom = new File(inPath + \"example-\" + i + \".csv\");\n\t\t\tdest = new File(destPath + \"/example-\" + i + \".csv\");\n\t\t\t// File exists copy from source to destination path else send error message\n\t\t\tif (from.exists()) {\n\t\t\t\tcopyFileSourceToDestination(from, dest);\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"From File is not exist & throw an Exception\");\n\t\t\t}\n\t\t}\n\t\tZipFolder2 zipFolder = new ZipFolder2();\n\t\tzipFolder.generateZipFile(destPath,destPath);\n\t}", "public static void main(String[] args)\n\t\t\tthrows FileNotFoundException, IOException {\n\t\tFileReader reader=new FileReader();\n\t\tEncryptDencrypt enDencrypt=new EncryptDencrypt();\n\t\tFileWriter writer=new FileWriter();\n\t\t\n\t\tSystem.out.println(\"加密文件:\");\n\t\tString plainStr=reader.read(\"src.txt\");\n\t\tString encryptStr=enDencrypt.encrypt(plainStr);\n\t\twriter.write(encryptStr, \"desprotype.txt\");\n\t\t\n\t\tSystem.out.println(\"解密文件:\");\n\t\tString enStr=reader.read(\"desprotype.txt\");\n\t\tString proStr=enDencrypt.deencrypyt(enStr);\n\t\twriter.write(proStr, \"srcprotype.txt\");\n\t}", "public static void main(String[] args) {\n // Check if the input file and output file are specified in the arguments\n if (args == null || args.length != 2) {\n System.out.println(\"Invalid arguments for the program.\");\n return;\n }\n\n String inputFile = args[0];\n Path inputFilePath = Paths.get(inputFile);\n\n String outputFile = args[1];\n Path outputFilePath = Paths.get(outputFile);\n\n // Check if the input file is valid\n if (Files.notExists(inputFilePath) || !Files.isReadable(inputFilePath) || !Files.isRegularFile(inputFilePath)) {\n System.out.println(\"Invalid input file.\");\n return;\n }\n\n // Create the output file if it doesn't exist\n if (Files.notExists(outputFilePath)) {\n try {\n Files.createFile(outputFilePath);\n } catch (IOException e) {\n System.out.println(\"Failed to create output file.\");\n e.printStackTrace();\n return;\n }\n }\n\n // Check if the output file is valid\n if (Files.notExists(outputFilePath) || !Files.isWritable(outputFilePath) || !Files.isRegularFile(outputFilePath)) {\n System.out.println(\"Invalid output file.\");\n return;\n }\n\n\n try {\n // Create folders for the temp generated files\n createTempFolder(TEMP_FOLDER);\n createTempFolder(TEMP_LONG_WORD_FOLDER);\n createTempFolder(TEMP_SORTED_WORD_FOLDER);\n\n // Analyze the words from the input file\n // Save words which are too long to separate files\n Path analyzeFile = analyzeFile(inputFilePath);\n\n // Read the words batch by batch\n // And save each batch of sorted words to separate files\n splitFileAndSortWord(analyzeFile);\n Files.delete(analyzeFile);\n\n // Merge sort the batches of sorted words to one file\n Path tempResultPath = mergeSortWord();\n deleteTempFolder(TEMP_SORTED_WORD_FOLDER);\n\n // Insert long words to the sorted word\n tempResultPath = mergeLongWord(tempResultPath);\n deleteTempFolder(TEMP_LONG_WORD_FOLDER);\n\n // Copy to results to the output file\n copyFile(tempResultPath, outputFilePath);\n\n } catch (IOException | RuntimeException | Error e) {\n System.out.println(\"Error occurred when running the program: \");\n e.printStackTrace();\n } finally {\n try {\n // Cleanup the temp generated files\n deleteTempFolder(TEMP_FOLDER);\n } catch (IOException e) {\n System.out.println(\"Error occurred when deleting temp generated files.\");\n }\n }\n }", "private void streamlinedGo(String[] argsList) {\n\t\tstates = alignment.getAminoAcidsAsFitchStates();\n\t\tbaseStates = phylogeny.getFitchStates(states).clone();\n\t\tambiguousAtRoot = 0;\n\t\tancestorAmbiguities = new boolean[baseStates.length];\n\t\t/* Establish how many ancestral states are ambiguous */\n\t\tfor(int i=0;i<baseStates.length;i++){\n\t\t\tHashSet<String> statesSet=baseStates[i];\n\t\t\tif(statesSet.size()>1){\n\t\t\t\tambiguousAtRoot++;\n\t\t\t\tancestorAmbiguities[i] = true;\n\t\t\t}\n\t\t}\n\t\t/* Attempt to resolve the rootnode states */\n\t\tphylogeny.resolveFitchStatesTopnode();\n\t\tphylogeny.resolveFitchStates(phylogeny.states);\n\t\t/* A new PR object used to hold reconstructions */\n\t\tpr = new ParsimonyReconstruction(states, phylogeny);\n\t\t/* Should now be resolved as far as possible.\n\t\t * Compare each taxon to tree root MRCA */\n\t\t//pr.printAncestralComparison();\n\n\t\t/*\n\t\t * Parse the args into lists\n\t\t * Then find the tips and MRCAs of each list. at this point print all branches below\n\t\t * Then walk through the MRCA / lists counting subs\n\t\t */\n\t\tint numberOfClades = argsList.length-2;\t// we'll assume the first two args are alignment and phylogeny respectively, and all the others (we've checked >2) are clades described by tips\n\t\t// Guessed the number of clades, initialise arrays\n\t\tcladeTips = new HashSet[numberOfClades];\n\t\tcladeTipsAsNodes = new HashSet[numberOfClades];\n\t\tMRCAnodes = new TreeNode[numberOfClades];\n\t\tMRCAcladesBranchTotals = new int[numberOfClades];\n\t\tMRCAcladesBranchTotalsTerminal = new int[numberOfClades];\n\t\tMRCAcladesBranchTotalsInternal = new int[numberOfClades];\n\t\tMRCAcladesSubstitutionTotals = new int[numberOfClades];\n\t\tMRCAcladesSubstitutionTotalsTerminal = new int[numberOfClades];\n\t\tMRCAcladesSubstitutionTotalsInternal = new int[numberOfClades];\n\t\tSystem.out.println(\"Assuming \"+numberOfClades+\" separate clades. Parsing clade descriptions...\");\n\t\t// Parse the clade lists\n\t\tfor(int i=2;i<argsList.length;i++){\n\t\t\tString[] taxaTokens = argsList[i].split(\":\");\n\t\t\tcladeTips[i-2] = new HashSet<String>();\n\t\t\tcladeTipsAsNodes[i-2] = new HashSet<TreeNode>();\n\t\t\tfor(String aTaxon:taxaTokens){\n\t\t\t\tcladeTips[i-2].add(aTaxon);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Check we've parsed them correctly\n\t\tSystem.out.println(\"Read these taxon lists:\");\n\t\tfor(int i=0;i<cladeTips.length;i++){\n\t\t\tSystem.out.print(\"Clade \"+i);\n\t\t\tfor(String taxon:cladeTips[i]){\n\t\t\t\tSystem.out.print(\" \"+taxon);\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t\t\n\t\t// Find the MRCA node of each clade, and also print all the branches beneath that MRCA node\n\t\tSystem.out.println(\"Searching the tree for the MRCAs of each clade...\");\n\t\tfor(int i=0;i<numberOfClades;i++){\n\t\t\t// Find the tip nodes corresponding to extant taxa\n\t\t\tIterator<String> itr = cladeTips[i].iterator();\n\t\t\twhile(itr.hasNext()){\n\t\t\t\tint nodeIDofTip = phylogeny.getTipNumber(itr.next());\n\t\t\t\tTreeNode tipNode = phylogeny.getNodeByNumberingID(nodeIDofTip);\n\t\t\t\tcladeTipsAsNodes[i].add(tipNode);\n\t\t\t}\n\t\t\t\t\n\t\t\t// Find the ID of the MRCA node\n\t\t\tint nodeIDofMRCA = phylogeny.getNodeNumberingIDContainingTaxa(cladeTips[i]);\n\t\t\tTreeNode cladeNodeMRCA = phylogeny.getNodeByNumberingID(nodeIDofMRCA);\n\t\t\tMRCAnodes[i] = cladeNodeMRCA;\n\n\t\t\t// Print all the branches below MRCA\n\t\t\tSystem.out.println(\"Found the MRCA of clade \"+i+\" (\"+nodeIDofMRCA+\"):\\n\"+cladeNodeMRCA.getContent()+\"\\nPrinting all branches below this node:\");\n\t\t\tMRCAcladesBranchTotals[i] = cladeNodeMRCA.howManyTips();\n\t\t\tfor(TreeBranch branch:cladeNodeMRCA.getBranches()){\n\t\t\t\tSystem.out.println(branch);\n\t\t\t\tInteger[] substitutions = StateComparison.printStateComparisonBetweenTwoNodes(branch.getParentNode().states, branch.getDaughterNode().states, branch.getParentNode().getContent(), branch.getDaughterNode().getContent());\n\t\t\t\tMRCAcladesSubstitutionTotals[i] = substitutions.length;\n\t\t\t\tif(branch.isEndsInTerminalTaxon()){\n\t\t\t\t\tMRCAcladesBranchTotalsTerminal[i]++;\n\t\t\t\t\tMRCAcladesSubstitutionTotalsTerminal[i] = substitutions.length;\n\t\t\t\t}else{\n\t\t\t\t\tMRCAcladesBranchTotalsInternal[i]++;\n\t\t\t\t\tMRCAcladesSubstitutionTotalsInternal[i] = substitutions.length;\n\t\t\t\t}\n\t\t\t\tSystem.out.println();\n\t\t\t}\n\t\t}\n\t\t\n\t\t// For each MRCA node and clade tips combination, compare and print substitutions\n\t\tSystem.out.println(\"Comparing ancestral clade MRCA node sequences with extant sequences...\");\n\t\tfor(int i=0;i<numberOfClades;i++){\n\t\t\tSystem.out.println(\"Comparing ancestral MRCA sequence for CLADE \"+i+\" against *ALL* clades' terminal taxa...\");\n\t\t\tTreeNode thisMRCA = MRCAnodes[i];\n\t\t\tfor(int j=0;j<cladeTipsAsNodes.length;j++){\n\t\t\t\tSystem.out.println(\"Clade MRCA: \"+i+\" -vs- clade tips: \"+j);\n\t\t\t\tint MRCAtoTipsSubstitutions = 0;\n\t\t\t\tfor(TreeNode someTip:cladeTipsAsNodes[j]){\n\t\t\t\t\tInteger[] substitutions = StateComparison.printStateComparisonBetweenTwoNodes(thisMRCA.states, someTip.states, \"MRCA_clade_\"+i, someTip.getContent());\n\t\t\t\t\tMRCAtoTipsSubstitutions+= substitutions.length;\n\t\t\t\t}\n\t\t\t\tSystem.out.println(\"Substitutions from Clade MRCA: \"+i+\" -vs- clade tips: \"+j+\": \"+MRCAtoTipsSubstitutions);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// All uncorrected pairwise comparisons\n\t\tSystem.out.println(\"Comparing extant sequences directly...\");\n\t\tfor(int i=0;i<numberOfClades;i++){\n\t\t\tfor(TreeNode someTip:cladeTipsAsNodes[i]){\n\t\t\t\tfor(int j=0;j<cladeTipsAsNodes.length;j++){\n\t\t\t\t\tSystem.out.println(\"Basis clade: \"+i+\" -vs- clade tips: \"+j);\n\t\t\t\t\tint MRCAtoTipsSubstitutions = 0;\n\t\t\t\t\tfor(TreeNode someOtherTip:cladeTipsAsNodes[j]){\n\t\t\t\t\t\tInteger[] substitutions = StateComparison.printStateComparisonBetweenTwoNodes(someTip.states, someOtherTip.states, someTip.getContent(), someOtherTip.getContent());\n\t\t\t\t\t\tMRCAtoTipsSubstitutions+= substitutions.length;\n\t\t\t\t\t}\n\t\t\t\t\tSystem.out.println(\"Substitutions from Clade MRCA: \"+i+\" -vs- clade tips: \"+j+\": \"+MRCAtoTipsSubstitutions);\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\n\t\t\n\t\t// Print a summary of each clade\n\t\tSystem.out.println(\"Summary of clade counts...\");\n\t\tSystem.out.println(\"Clade\\tbranches\\texternal\\tinternal\\t\\tsubstitutions\\texternal\\tinternal\");\n\t\tfor(int i=0;i<numberOfClades;i++){\n\t\t\tSystem.out.println(i\n\t\t\t\t\t+\"\\t\"+MRCAcladesBranchTotals[i]\n\t\t\t\t\t+\"\\t\"+MRCAcladesBranchTotalsTerminal[i]\n\t\t\t\t\t+\"\\t\"+MRCAcladesBranchTotalsInternal[i]+\"\\t\"\n\t\t\t\t\t+\"\\t\"+MRCAcladesSubstitutionTotals[i]\n\t\t\t\t\t+\"\\t\"+MRCAcladesSubstitutionTotalsTerminal[i]\n\t\t\t\t\t+\"\\t\"+MRCAcladesSubstitutionTotalsInternal[i]);\n\t\t}\n\t\tSystem.out.println(\"Done.\");\n\t}", "public boolean parseCommand(String[] args) {\n boolean retVal = false;\n // Set the defaults.\n this.help = false;\n this.debug = false;\n this.roleFile = null;\n // Parse the command line.\n CmdLineParser parser = new CmdLineParser(this);\n try {\n parser.parseArgument(args);\n if (this.help) {\n parser.printUsage(System.err);\n } else {\n // Create the role map.\n if (this.roleFile == null) {\n this.roleMap = null;\n if (debug) System.err.println(\"Functional assignments will be output.\");\n } else {\n this.roleMap = RoleMap.load(this.roleFile);\n if (debug) System.err.format(\"%d roles loaded from %s%n\", this.roleMap.fullSize(),\n this.roleFile);\n }\n // Load the genome.\n this.genome = new Genome(this.genomeFile);\n if (debug) System.err.format(\"%s loaded from file %s%n\", this.genome,\n this.genomeFile);\n // Load the stop prediction file.\n this.orfTrackerMap = ContigOrfTracker.readPredictionFile(this.startStopFile);\n if (debug) System.err.println(\"ORF predictions loaded from \" +\n this.startStopFile + \".\");\n // Load the role maps.\n this.startRoleMap = ContigStarts.contigStartsMap(this.genome, '+', this.roleMap);\n if (debug) System.err.println(\"Start roles computed.\");\n // We made it this far, we can run the application.\n retVal = true;\n }\n } catch (CmdLineException e) {\n System.err.println(e.getMessage());\n // For parameter errors, we display the command usage.\n parser.printUsage(System.err);\n } catch (IOException e) {\n e.printStackTrace(System.err);\n }\n return retVal;\n }", "public static void main(String[] args) {\n\n if (args.length < 2 || args.length > 3) {\n System.out.println(\"Usage: BuildDemoData <dir> <file> [<jenaflag>]\");\n System.out.println(\"where <dir> is the output directory\");\n System.out.println(\"where <file> is a properties file\");\n System.out.println(\"where <jenaflag> is any value\");\n System.exit(0);\n }\n\n Properties dataProps = new Properties();\n\n try {\n File props = new File(args[1]);\n FileInputStream fis = new FileInputStream(props);\n dataProps.load((InputStream) fis);\n } catch (Exception e) {\n System.err.println(e.toString());\n e.printStackTrace();\n }\n\n \tModel model = ModelFactory.createDefaultModel();\n try {\n model = getModelFromFiles(dataProps);\n } catch (Exception e) {\n System.err.println(e.toString());\n e.printStackTrace();\n }\n \n System.out.println(\"Writing no inferencing model...\");\n writeModel(model, args[0] + \"simileDemoNoInference.rdf\");\n System.out.println(\"Uninferenced model contains \" + model.size() + \" statements\");\n\n System.out.println(\"Inferencing...\"); \t\n if (args.length == 2) {\n Reasoner reasoner = new SimileReasoner();\n writeModel(reasoner.process(model), args[0] + \"simileDemoMappingInference.rdf\");\n } else {\n Reasoner reasoner = new JenaReasoner();\n writeModel(reasoner.process(model), args[0] + \"simileDemoJenaInference.rdf\");\n }\n \n System.out.println(\"Inferenced model contains \" + model.size() + \" statements\");\n }", "public static void main(String[] args) {\n\t\tString filename = \"C:/Users/Myky/Documents/EDAN55/Independent Set/g30.txt\";\n\t\tint[][] adjMatrix = readFile(filename);\n\t\tCounter counter = new Counter(0);\n\t\tint MIS = run(adjMatrix);\n\t\tprint(MIS);\n\n\t}", "public static void main(String[] args) {\n\t\tString inputFile = null;\n\n\t\tfinal int GCT_OUTPUT_FORMAT = 0;\n\t\tfinal int RES_OUTPUT_FORMAT = 1;\n\t\tfinal int ODF_OUTPUT_FORMAT = 2;\n\t\tfinal int SAME_OUTPUT_FORMAT = 3;\n\t\tint outputFormat = SAME_OUTPUT_FORMAT;\n\n\t\tint filterFlag = 0; // 0=no filter (default), 1=filter\n\t\tint rownormFlag = 0; // 0=no disc or norm (default), 1=disc., 2=normalization\n\t\tint log2Flag = 0; // 0=no transform, 1=log2 transform\n\t\tdouble minFoldChange = 1;\n\t\tdouble minDelta = 0;\n\n\t\tdouble threshold = 20;\n\t\tdouble ceiling = 16000;\n\t\tdouble remColThreshold = 0;\n\t\tint columnsAboveThreshold = -1;\n\n\t\tdouble probabilityThreshold = 1; // value for uniform probablity threshold filter\n\t\tint numExclude = 0; // number of experiments to exclude (max & min before applying variation filter\n\t\tString outputFileName = null;\n\n\t\tfor(int i = 0, length = args.length; i < length; i++) {\n\t\t\tif(args[i].charAt(0) != '-') {\n\t\t\t\tAnalysisUtil.exit(\"options must start with '-'\");\n\t\t\t}\n\t\t\tswitch (args[i].charAt(1)) {\n\t\t\t\tcase 'O':\n\t\t\t\t\toutputFileName = args[++i];\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'f':\n\t\t\t\t\tminFoldChange = Double.parseDouble(args[++i]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'd':\n\t\t\t\t\tminDelta = Double.parseDouble(args[++i]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 't':\n\t\t\t\t\tthreshold = Double.parseDouble(args[++i]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'c':\n\t\t\t\t\tceiling = Double.parseDouble(args[++i]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'p':\n\t\t\t\t\tprobabilityThreshold = Double.parseDouble(args[++i]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'e':\n\t\t\t\t\tnumExclude = Integer.parseInt(args[++i]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'n':\n\t\t\t\t\trownormFlag = Integer.parseInt(args[++i]);\n\t\t\t\t\tif(rownormFlag != 0 && rownormFlag != 1 && rownormFlag != 2) {\n\t\t\t\t\t\tAnalysisUtil.exit(\"Illegal option for row normalization.\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'F':\n\t\t\t\t\tinputFile = args[++i];\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'r':\n\t\t\t\t\toutputFormat = Integer.parseInt(args[++i]);\n\t\t\t\t\tif(outputFormat != GCT_OUTPUT_FORMAT && outputFormat != RES_OUTPUT_FORMAT && outputFormat != ODF_OUTPUT_FORMAT && outputFormat != SAME_OUTPUT_FORMAT) {\n\t\t\t\t\t\tAnalysisUtil.exit(\"Illegal option for output format.\");\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'g':\n\t\t\t\t\tlog2Flag = Integer.parseInt(args[++i]);\n\t\t\t\t\tif(log2Flag != 0 && log2Flag != 1) {\n\t\t\t\t\t\tAnalysisUtil.exit(\"Illegal option for log2 transform.\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n case 'a':\n try {\n columnsAboveThreshold = Integer.parseInt(args[++i]);\n } catch (NumberFormatException nfe) {\n AnalysisUtil.exit(\"Number of columns above threshold is not a number\");\n }\n if (columnsAboveThreshold <= 0) {\n AnalysisUtil.exit(\"Number of columns above threshold must be > 0\");\n }\n break;\n case 'b':\n try {\n remColThreshold = Double.parseDouble(args[++i]);\n } catch (NumberFormatException nfe) {\n System.err.println(\"threshold seen: \" + args[i] + \".\");\n AnalysisUtil.exit(\"Minimum threshold is not a number\");\n\n }\n break;\n\t\t\t\tcase 'V':\n\t\t\t\t\tfilterFlag = Integer.parseInt(args[++i]);\n\t\t\t\t\tif(filterFlag != 0 && filterFlag != 1) {\n\t\t\t\t\t\tAnalysisUtil.exit(\"Illegal option for filtering.\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'R': // for backwards compatibility\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tAnalysisUtil.exit(\"unrecognized option: \" + args[i]);\n\t\t\t}\n\t\t}\n\n if(rownormFlag == 1 && log2Flag == 1) {\n AnalysisUtil.exit(\"Cannot take the log2 of zero-centered data due to negative values. Please select row normalization OR log2 transform.\");\n }\n\n\t\tif(inputFile == null) {\n\t\t\tAnalysisUtil.exit(\"No input file specified.\");\n\t\t}\n\n\t\tif(outputFileName == null) {\n\t\t\tAnalysisUtil.exit(\"No output file specified.\");\n\t\t}\n\n\t\tIExpressionDataReader reader = AnalysisUtil.getExpressionReader(inputFile);\n\t\tExpressionData expressionData = (ExpressionData) AnalysisUtil.readExpressionData(reader, inputFile, new PreprocessExpressionDataCreator());\n\t\tDoubleMatrix2D dataset = (DoubleMatrix2D) expressionData.getExpressionMatrix();\n\t\tdouble[] geneArray = new double[dataset.getColumnCount()];\n\t\tTIntArrayList rowIndices = new TIntArrayList(); // indices to keep\n\t\tint columns = dataset.getColumnCount();\n\t\tRandom random = new Random();\n\t\tfor(int i = 0, rows = dataset.getRowCount(); i < rows; i++) {\n\t\t\tdouble mean = 0;\n\t\t\tdouble temp = 0;\n\t\t\tint numColAboveThres = 0;\n\t\t\tfor(int j = 0; j < columns; j++) {\n\t\t\t\tdouble datum = dataset.get(i, j);\n if (columnsAboveThreshold != -1 && datum >= remColThreshold) {\n numColAboveThres++;\n }\n\t\t\t\tif(filterFlag == 1) {\n\t\t\t\t\tif(datum < threshold) {\n\t\t\t\t\t\tdataset.set(i, j, threshold);\n\t\t\t\t\t}\n\t\t\t\t\tif(datum > ceiling) {\n\t\t\t\t\t\tdataset.set(i, j, ceiling);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tgeneArray[j] = dataset.get(i, j);\n\t\t\t\tmean = mean + geneArray[j];\n\t\t\t\ttemp = temp + geneArray[j] * geneArray[j];\n\t\t\t}\n\n\t\t\tArrays.sort(geneArray);\n\t\t\tdouble min = geneArray[numExclude];\n\t\t\tif(min == 0) {\n\t\t\t\tmin = 0.001;\n\t\t\t}\n\t\t\tdouble max = geneArray[columns - 1 - numExclude];\n\t\t\tmean = mean / columns;\n double sigma=temp / columns;\n sigma=sigma - mean * mean;\n sigma=(sigma>0) ? Math.sqrt(sigma) : 0.001;\n\n\t\t\tif( ( (filterFlag == 0 && random.nextDouble() < probabilityThreshold) ||\n\t\t\t (filterFlag == 1 && Math.abs(max)/Math.abs(min) >= minFoldChange && max - min >= minDelta))\n\t\t\t && (columnsAboveThreshold == -1 || numColAboveThres >= columnsAboveThreshold) ) {\n\t\t\t\trowIndices.add(i);\n for(int k = 0; k < columns; k++) {\n if(rownormFlag == 1) {\n dataset.set(i, k, (dataset.get(i, k) - mean) / sigma);\n }\n\n if(log2Flag == 1) {\n double x=Math.log(dataset.get(i, k));\n x/=log2;\n dataset.set(i, k, x);\n }\n }\n\t\t\t}\n\t\t}\n\n\t\tint[] indices = rowIndices.toNativeArray();\n\t\tif (indices.length == 0) {\n\t\t\tAnalysisUtil.exit(\"Filtered all genes.\");\n\t\t}\n\n\t\tString outputFormatName = null;\n\t\tswitch (outputFormat) {\n\t\t\tcase GCT_OUTPUT_FORMAT:\n\t\t\t\toutputFormatName = \"gct\";\n\t\t\t\tbreak;\n\t\t\tcase RES_OUTPUT_FORMAT:\n\t\t\t\toutputFormatName = \"res\";\n\t\t\t\tbreak;\n\t\t\tcase ODF_OUTPUT_FORMAT:\n\t\t\t\toutputFormatName = \"odf\";\n\t\t\t\tbreak;\n\t\t\tcase SAME_OUTPUT_FORMAT:\n\t\t\t\toutputFormatName = reader.getFormatName();\n\t\t\t\tbreak;\n\t\t}\n\n\t\tAnalysisUtil.write(expressionData.slice(rowIndices.toNativeArray(), null), outputFormatName, outputFileName, true);\n\t}", "public static void main(String[] args) throws Exception {\n final String gtid = \"rliang37\";\n\n Configuration conf = new Configuration();\n\n Job job = Job.getInstance(conf, \"Q4a_1\");\n\n /* TODO: Needs to be implemented */\n job.setJarByClass(Q4a.class);\n job.setMapperClass(DifferenceMapper.class);\n job.setReducerClass(DIfferenceReducer.class);\n //job.setCombinerClass(TokenizerReducer.class);\n job.setOutputKeyClass(Text.class);\n job.setOutputValueClass(IntWritable.class);\n\n FileInputFormat.addInputPath(job, new Path(args[0]));\n FileOutputFormat.setOutputPath(job, new Path(\"intermediate\"));\n job.waitForCompletion(true);\n\n\n Job job2 = Job.getInstance(conf, \"Q4a_2\");\n\n job2.setJarByClass(Q4a.class);\n job2.setMapperClass(CountMapper.class);\n job2.setReducerClass(CountReducer.class);\n //job2.setCombinerClass(TokenizerReducer2.class);\n job2.setOutputKeyClass(IntWritable.class);\n job2.setOutputValueClass(IntWritable.class);\n\n FileInputFormat.addInputPath(job2, new Path(\"intermediate\"));\n FileOutputFormat.setOutputPath(job2, new Path(args[1]));\n System.exit(job2.waitForCompletion(true) ? 0 : 1);\n }", "public static void main(String[] args) {\n\t\t// String path = \"/devel/ostwald/projects/schemedit-project/web/WEB-INF/data/Adn-to-Asf-mappings.xml\";\n\t\tString path = \"C:/Documents and Settings/ostwald/devel/projects/dcs-project/web/WEB-INF/data/Adn-to-Asn-v1.2.5-info.xml\";\n\t\tAsnToAdnMapper mapper = new AsnToAdnMapper(path);\n\n\t\tString id = Constants.ASN_PURL_BASE + \"S1002B43\";\n\t\tprtln(\"adnText for \" + id + \"\\n\" + mapper.getAdnText(id));\n\t\tString adnText = mapper.getAdnText(id);\n\t\tif (adnText != null)\n\t\t\tprtln(\"id back atcha: \" + mapper.getAsfId(adnText));\n\t}", "public static void main(String[] args) {\n new Merge().readAndWrite();\n }", "public static void main(String[] args) throws IOException, SQLException, ClassNotFoundException\n\t{\n\t if (args.length != 4)\n\t {\n\t System.err.println(\"Needs 4 args\");\n\t\t return; \n\t }\n\t \n String dir = args[0];\n\t\tint minTokens = Integer.parseInt(args[1]);\n\t\tString outFolder = args[2];\n\t\tString outFilename = args[3];\n\t\t\n\t\tfinal long startTime = System.currentTimeMillis();\n\t\t\n\t\t// make a list of all files \n\t\tFile folder = new File(dir);\n\t\tFile[] listOfFiles = folder.listFiles();\n\t\tList<File> files = new ArrayList<File>(Arrays.asList(listOfFiles));\n\t\tSystem.out.println(String.format(\"%d files in dir %s\", files.size(), dir));\n\n\t\t// configure CPD\n\t\tCPDConfiguration config = new CPDConfiguration();\n\t\tconfig.setLanguage(LanguageFactory.createLanguage(\"Java\"));\n\t\tconfig.setMinimumTileSize(minTokens);\n\t\tconfig.setEncoding(\"UTF-8\");\n\t\tconfig.setRenderer(new CSVRenderer());\n\t\t/* Has no effect\n\t\tconfig.setIgnoreAnnotations(true);\n\t\tconfig.setIgnoreIdentifiers(true);\n\t\tconfig.setIgnoreLiterals(true);*/\n\t\t\n\t\tStringBuilder dupOut = new StringBuilder();\n\t\tStringBuilder errOut = new StringBuilder();\n\t\tint totalCnt = 0;\n\t\tArrayList<Match> matchList = new ArrayList<>();\n\n\t\tfor(File file: files)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tmatchList.clear();\n\t\t\t\t\n\t\t\t\t// run CPD on this file\n\t\t\t\tCPD cpd = new CPD(config);\n\t\t\t\tcpd.add(file);\n\t\t\t\tcpd.go();\n\t\t\t\t\n\t\t\t\t// collect results\n\t\t\t\tIterator<Match> it = cpd.getMatches();\n\t\t\t\twhile(it.hasNext())\n\t\t\t\t{\n\t\t\t\t\tMatch m = it.next();\n\t\t\t\t\tmatchList.add(m);\n\t\t\t\t}\n\t\t\t\tif (!matchList.isEmpty()) // write to output\n\t\t\t\t{\n\t\t\t\t\tString csv = config.getRenderer().render(cpd.getMatches());\n\t\t\t\t\tdupOut.append(csv.substring(csv.indexOf('\\n') + 1)); // remove header\n\t\t\t\t\ttotalCnt += matchList.size();\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\terrOut.append(file.getName() + \",\" + e.getMessage() + \"\\n\");\n\t\t\t}\n\t\t}\n\t\t\n\t\t// write output to files\n\t\ttry\n\t\t{\n\t\t\tString name = folder.getName();\n\t\t\tnew FileReporter(new File(outFolder,outFilename)).report(dupOut.toString()); //name + \"-cpd\" + minTokens + \".csv\"\n\t\t\tnew FileReporter(new File(outFolder,name + \"-cpd\" + minTokens + \"-err.csv\")).report(errOut.toString());\n\t\t} catch (ReportException e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t\tSystem.out.println(\"Total nr of dups found \" + totalCnt);\n\t\t\n\t\tfinal long endTime = System.currentTimeMillis();\n\t\tSystem.out.println(\"Total execution time in s: \" + (endTime - startTime)/1000 );\n\t}", "public static void main(String[] args) {\n\t\t// Parse command-line arguments\n\t\tif (args.length < 1 || args.length > 2 || Arrays.asList(args).contains(\"-h\")) {\n\t\t\tprintUsage();\n\t\t\treturn;\n\t\t}\n\n\t\t// Parse file\n\t\tString filename = args[args.length - 1];\n\t\tHashSet<String> sequences = FastaFileReader.parseFastaFile(filename);\n\t\tif (sequences == null) {\n\t\t\tSystem.err.println(\"ERROR: Unable to parse FASTA file \\\"\" + filename + \"\\\"\");\n\t\t\treturn;\n\t\t}\n\n\t\t// Attempt to reconstruct the chromosome\n\t\tString result = UniqueChromosomeReconstructor.reconstructChromosome(sequences);\n\t\tif (result == null) {\n\t\t\tSystem.err.println(\"ERROR: Unable to reconstruct a unique chromosome\");\n\t\t\treturn;\n\t\t}\n\n\t\t// Report result\n\t\tSystem.out.println(\"The reconstructed chromosome is:\");\n\t\tSystem.out.println(result);\n\t\tSystem.out.println(\"Length: \" + result.length());\n\t}", "public static void main(String[] args) {\n\t\tHashtable<String, String> map = new Hashtable<String, String>();\n\t\tmap.put(\"edu.mayo.bmi.uima.common.type.DocumentID\",\n\t\t\t\t\"edu.mayo.bmi.uima.common.types.DocumentIDAnnotation\");\n\t\tmap.put(\"org.apache.ctakes.typesystem.type.textspan.LookupWindowAnnotation\",\n\t\t\t\t\"edu.mayo.bmi.uima.lookup.types.LookupWindowAnnotation\");\n//\t\tSpecify your mappings here\n/*\t\tmap.put(\"\",\n\t\t\t\t\"uima.tt.MCAnnotation\");\n\t\tmap.put(\"\",\n\t\t\t\t\"uima.tt.TCAnnotation\");\n\t\tmap.put(\"\",\n\t\t\t\t\"uima.tt.WHPAnnotation\");\n\t\tmap.put(\"\",\n\t\t\t\t\"uima.tt.OBJAnnotation\");\n\t\tmap.put(\"\",\n\t\t\t\t\"uima.tt.PSUBAnnotation\");\n\t\tmap.put(\"\",\n\t\t\t\t\"uima.tt.SUBAnnotation\");\n\t\tmap.put(\"\",\n\t\t\t\t\"uima.tt.AdjAnnotation\");\n\t\tmap.put(\"\",\n\t\t\t\t\"uima.tt.CNPAnnotation\");\n\t\tmap.put(\"\",\n\t\t\t\t\"uima.tt.NPAnnotation\");\n\t\tmap.put(\"\",\n\t\t\t\t\"uima.tt.NPListAnnotation\");\n\t\tmap.put(\"\",\n\t\t\t\t\"uima.tt.NPPAnnotation\");\n\t\tmap.put(\"\",\n\t\t\t\t\"uima.tt.PPAnnotation\");\n\t\tmap.put(\"\",\n\t\t\t\t\"uima.tt.PVGAnnotation\");\n\t\tmap.put(\"\",\n\t\t\t\t\"uima.tt.VGAnnotation\");\n*/\n\t\tmap.put(\"edu.mayo.bmi.uima.cdt.type.RomanNumeralAnnotation\",\n\t\t\t\t\"edu.mayo.bmi.uima.cdt.types.RomanNumeralAnnotation\");\n\t\tmap.put(\"edu.mayo.bmi.uima.cdt.type.FractionAnnotation\",\n\t\t\t\t\"edu.mayo.bmi.uima.cdt.types.FractionAnnotation\");\n\t\tmap.put(\"edu.mayo.bmi.uima.cdt.type.DateAnnotation\",\n\t\t\t\t\"edu.mayo.bmi.uima.cdt.types.DateAnnotation\");\n\t\tmap.put(\"edu.mayo.bmi.uima.cdt.type.ProblemListAnnotation\",\n\t\t\t\t\"edu.mayo.bmi.uima.cdt.types.ProblemListAnnotation\");\n\t\tmap.put(\"edu.mayo.bmi.uima.cdt.type.MeasurementAnnotation\",\n\t\t\t\t\"edu.mayo.bmi.uima.cdt.types.MeasurementAnnotation\");\n\t\tmap.put(\"edu.mayo.bmi.uima.cdt.type.PersonTitleAnnotation\",\n\t\t\t\t\"edu.mayo.bmi.uima.cdt.types.PersonTitleAnnotation\");\n\t\tmap.put(\"org.apache.ctakes.typesystem.type.textspan.Segment\",\n\t\t\t\t\"edu.mayo.bmi.uima.common.types.SegmentAnnotation\");\n\t\tmap.put(\"org.apache.ctakes.typesystem.type.textspan.Sentence\",\n\t\t\t\t\"edu.mayo.bmi.uima.common.types.SentenceAnnotation\");\n\t\tmap.put(\"org.apache.ctakes.typesystem.type.syntax.WordToken\",\n\t\t\t\t\"edu.mayo.bmi.uima.common.types.WordTokenAnnotation\");\n\t\tmap.put(\"org.apache.ctakes.typesystem.type.NumToken\",\n\t\t\t\t\"edu.mayo.bmi.uima.common.types.NumTokenAnnotation\");\n\t\tmap.put(\"org.apache.ctakes.typesystem.type.PunctuationToken\",\n\t\t\t\t\"edu.mayo.bmi.uima.common.types.PunctTokenAnnotation\");\n\t\tmap.put(\"org.apache.ctakes.typesystem.type.SymbolToken\",\n\t\t\t\t\"edu.mayo.bmi.uima.common.types.SymbolTokenAnnotation\");\n\t\tmap.put(\"org.apache.ctakes.typesystem.type.NewlineToken\",\n\t\t\t\t\"edu.mayo.bmi.uima.common.types.NewlineTokenAnnotation\");\n\t\tmap.put(\"org.apache.ctakes.typesystem.type.textsem.IdentifiedAnnotation\",\n\t\t\t\t\"edu.mayo.bmi.uima.common.types.NamedEntityAnnotation\");\n\t\tmap.put(\"org.apache.ctakes.typesystem.type.UmlsConcept\",\n\t\t\t\t\"edu.mayo.bmi.uima.common.types.UmlsConcept\");\n\t\tmap.put(\"org.apache.ctakes.typesystem.type.OntologyConcept\",\n\t\t\t\t\"edu.mayo.bmi.uima.common.types.OntologyConcept\");\n\n//\t\tPrepare the list of attributes to ignore when comparing elements\n\t\tConst.init();\n//\t\tInitialize a processor\n\t\tXcasProcessor p = new XcasProcessor();\n//\t\tProcess/parse the two files specified in args[0] and args[1]\n\t\tFile f1 = new File(args[0]);\n\t\tif (!f1.exists()) { System.err.println(args[0]+\" not exist!\"); System.exit(1); }\n\t\tFile f2 = new File(args[1]);\n\t\tif (!f2.exists()) { System.err.println(args[1]+\" not exist!\"); System.exit(1); }\n\t\tXcasFile xf1 = p.process(f1);\n\t\tXcasFile xf2 = p.process(f2);\n//\t\tChange xf1 to xf2 if the second command line argument is the open source output\n\t\tfor (XcasAnnotation a : xf1.getAllAnnotations())\n\t\t\tif (map.containsKey(a.getType()))\n\t\t\t\t\ta.setType(map.get(a.getType()));\n//\t\tConstruct an XcasDiff object from the two XcasFiles\n\t\tXcasDiff d = new XcasDiff(xf1, xf2);\n//\t\tPrint differences to stdout\n\t\td.printDiff();\n//\t\tPrint an HTML summary to file specified in args[2]\n\t\ttry {\n\t\t\td.printHTML(new FileWriter(args[2]));\n\t\t\tSystem.out.println();\n\t\t\tSystem.out.println(\"HTML summary written to \"+args[2]);\n\t\t} catch (IOException e) { e.printStackTrace(); }\n\t}", "public static void main(String[] args) throws FileNotFoundException {\n\t\tString automaton = \"Q0\t= (d -> Q1|a -> Q4),Q1\t= (e -> Q2),Q2\t= (f -> STOP),Q4\t= (b -> Q5),Q5\t= (c -> Q0).\";\n\t\tTransitionsParser tp = new TransitionsParser(new StringReader(automaton));\n\t\tFSM c = new FSM();\n\t\ttp.parse(c);\n\t\tSystem.out.println(\"Fsm: \" + c._transitions);\n\t\tSystem.out.println(\" same states: \" + c._sameStates);\n\t\tSystem.out.println(\" id->name: \" + c._stateIdToName);\n\t\tSystem.out.println(\" name->id: \" + c._stateNameToId);\n\t\tSystem.out.println(\" numberOfStates: \" + c.numberOfStates());\n\t\tSystem.out.println(\" alphabet: \" + c.getAlphabet());\n\t\tfor (int start=0; start<c.numberOfStates(); start++) {\n\t\t\tfor (String action : c.getAlphabet()) {\n\t\t\t\tint end = c.getTransition(start, action);\n\t\t\t\tif (end != -1) {\n\t\t\t\t\tSystem.out.format(\"Transition: %s --%s--> %s\\n\", start, action, end);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tSafetyAutomaton sa = new SafetyAutomaton(false, c, \"Fred\");\n\t\tSystem.out.println(sa);\n\t}", "public static void main(String arg[]) {\n\t\ttry {\n\t\t\tSource transformSource = new StreamSource(arg[0]);\n\t\t\tTransformerFactory tf = TransformerFactory.newInstance(\"com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl\", null);\n\t\t\tTransformer transformer = tf.newTransformer(transformSource);\n\t\t\tStreamSource inputSource = new StreamSource(arg[1]);\n\t\t\tStreamResult outputResult = new StreamResult(new File(arg[2]));\n\t\t\ttransformer.transform(inputSource,outputResult);\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace(System.err);\n\t\t}\n\t}", "public static void main(String[] args) throws IOException {\n\t\tBufferedReader br = new BufferedReader(new FileReader(new File(\"C:\\\\Users\\\\SHANDEMETZ\\\\Downloads\\\\Compressed\\\\gene_association.goa_human\\\\gene_association.goa_human\")));\n\t\tBufferedWriter bw = new BufferedWriter(new FileWriter(new File(\"outputs\\\\annotNameList.csv\")));;\n\t\tString line = \"\";\n\t\tString[] lineSplits;\n\t\tString[] lineSplits1;\n\t\tString annotName;\n\t\tString annotId;\n\t\tfor(int i = 0 ;i < 35;i++){\n\t\t\tbr.readLine();\n\t\t}\n\t\tMap<String,String> annotNameMap = new HashMap<String,String>();\n\t\tbr.readLine();\n\t\twhile(null != (line = br.readLine())){\n\t\t\tlineSplits = line.split(\"[\\t]\");\n\t\t\tlineSplits1 = lineSplits[4].split(\":\");\n\t\t\tannotId = lineSplits1[1];\n\t\t\tannotName = lineSplits[9];\n\t\t\tannotNameMap.put(annotId, annotName);\n\t\t}\n\t\tfor(Entry<String,String> entry:annotNameMap.entrySet()){\n\t\t\tbw = new BufferedWriter(new FileWriter(new File(\"outputs\\\\annotNameList.csv\"),true));\n\t\t\tSystem.out.println(entry.getKey()+\",\"+entry.getValue());\n\t\t\tbw.write(entry.getKey()+\",\"+entry.getValue());\n\t\t\tbw.write(\"\\n\");\n\t\t\tbw.close();\n\t\t}\n\t}", "public static void main(String args[])\r\n\t\tthrows Exception\r\n\t{\n\t\twrkDir = FileUtils.getTempUserDirectory(\"jhi-flapjack\");\r\n\t\twrkDir = new File(wrkDir, \"GobiiMabcConverter\");\r\n\t\twrkDir.mkdirs();\r\n\r\n\t\tGobiiMabcConverter converter = new GobiiMabcConverter();\r\n\r\n\t\t// Read/create the markers\r\n\t\tconverter.createMap(new File(args[0]));\r\n\t\t// Read/create the genotypes\r\n\t\tconverter.createGenotypes(new File(args[1]));\r\n\t\t// Read/create the qtls\r\n\t\tconverter.createQTL(new File(args[2]));\r\n\r\n\t\tCreateProjectSettings projectSettings = new CreateProjectSettings(\r\n\t\t\tnew File(wrkDir, \"map\"),\r\n\t\t\tnew File(wrkDir, \"geno\"),\r\n\t\t\tnull,\r\n\t\t\tnew File(wrkDir, \"qtl\"),\r\n\t\t\tnew FlapjackFile(args[3]),\r\n\t\t\tnull);\r\n\r\n\t\tDataImportSettings importSettings = new DataImportSettings();\r\n\t\timportSettings.setDecimalEnglish(true);\r\n\r\n\t\t// Make a Flapjack project\r\n\t\tCreateProject cp = new CreateProject(projectSettings, importSettings);\r\n\r\n\t\tcp.doProjectCreation();\r\n\t}", "public static void main(String[] args) throws Exception {\n // TODO Auto-generated method stub\n if (args.length != 3) {\n System.err.println(\"Enter valid number of arguments <Inputdirectory> <Outputlocation>\");\n System.exit(0);\n }\n ToolRunner.run(new Configuration(), new MovieLensTopMovies(), args);\n }", "public static void main(String[] args) {\n\t\tString filename = \"src/y20161B/B-small-practice\";\n\t\t//String filename = \"src/y20161B/B-large-practice\";\n\n\t\tFileInputStream file;\n\t\tint T;\n\n\t\ttry {\n\t\t\tfile = new FileInputStream(filename+\".in\");\n\n\t\t\tBufferedReader in = new BufferedReader(new InputStreamReader(file));\n\n\t\t\tT = Integer.parseInt(in.readLine());\n\n\t\t\tBufferedWriter bw = new BufferedWriter(new FileWriter(filename+\".out\"));\n\n\t\t\tfor (int i=0; i<T; i++) {\n\t\t\t\tint ind = i+1;\n\t\t\t\t// parser\n\t\t\t\tString buff[] = in.readLine().split(\" \");\n\t\t\t\tString C = buff[0];\n\t\t\t\tString J = buff[1];\n\t\t\t\t\n\t\t\t\t// calcul\n\t\t\t\tString res = solve(C, J);\n\t\t\t\t\n\t\t\t\tSystem.out.println(\"Result \"+i+\": \"+res);\n\t\t\t\tbw.write(\"Case #\"+ind+\": \"+res+\"\\n\");\n\t\t\t}\n\t\t\tbw.close();\n\n\t\t\tin.close();\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public static void main(String[] args) {\n\n System.out.println(\"\\n... MakeNetworks Arguments :<rootFileName> \"\n +\":<inputDirectory>+ :<outputDirectory> +:<extractGCC>\"\n + \":<year> :<weightType> :<useWhat> :<infoLevel>\");\n System.out.println(\"Fieldname types are:- Bus for Business and International Management\");\n System.out.println(\" - Phy for Physics & astronomy\");\n for (int i=0; i<weightTypeDescription.length; i++) {\n System.out.println(\"... weightType \"+i+\" = \"+weightTypeDescription[i]);\n } \n System.out.println(\"... useWhat: 1,3= use title, 2,3=use keywords\");\n for(int a=0; a<args.length; a++) {\n System.out.print((a==0?\"... Arguments: \":\" \")+args[a]);\n }\n System.out.println();\n \n HashSet<Integer> yearSet = new HashSet();\n HashSet<String> fieldnameSet = new HashSet();\n HashSet<Integer> weightTypeSet = new HashSet();\n HashSet<Integer> useWhatSet = new HashSet();\n \n \n int ano=0;\n //String rootFileName = \"ebrp_03_set_01_documentsTEST\";\n //String rootFileName = \"ebrp_03_set_01_documentsHARDTEST\";\n String rootFileName = \"ebrp_03_set_01_documents\";\n if ( (args.length>ano ) && (timgraph.isOtherArgument(args[ano]) )) {\n rootFileName=args[ano].substring(1);\n }\n System.out.println(\"--- Root of file name is \"+rootFileName);\n \n final String fileSep=System.getProperty(\"file.separator\");\n String dirBase=System.getProperty(\"user.dir\")+fileSep;\n \n //String inputDirectory =\"C:\\\\PRG\\\\JAVA\\\\Elsevier\\\\input\\\\\";\n String inputDirectory =\"C:\\\\DATA\\\\Elsevier\\\\input\\\\\";\n ano++;\n if ( (args.length>ano ) && (timgraph.isOtherArgument(args[ano]) )) inputDirectory=args[ano].substring(1); \n System.out.println(\"--- Input directory is \"+inputDirectory);\n \n String outputDirectory =\"C:\\\\DATA\\\\Elsevier\\\\output\\\\\";\n ano++;\n if ( (args.length>ano ) && (timgraph.isOtherArgument(args[ano]) )) outputDirectory=args[ano].substring(1); \n System.out.println(\"--- Output directory is \"+outputDirectory);\n \n \n boolean extractGCC=true;\n ano++;\n if ( (args.length>ano ) && (timgraph.isOtherArgument(args[ano]) )) extractGCC=(StringAsBoolean.isTrue(args[ano].charAt(1))?true:false); \n System.out.println(\"--- extracting GCC - \"+(extractGCC?\"yes\":\"no\"));\n \n int minDegreeIn=3;\n int minDegreeOut=3;\n double minWeight=0;\n System.out.println(\"--- extracting simplified GCC with min in degree - \"\n +minDegreeIn+\", min out degree - \"+minDegreeOut+\", and min weight \"+minWeight);\n \n // set up filter\n int minChar=2;\n int minL=3;\n boolean keepRejectList=true;\n ElsevierPapersFilter ipf = new ElsevierPapersFilter(minChar, minL, keepRejectList);\n \n \n if (rootFileName.equalsIgnoreCase(\"ALL\")){\n //rootFileName = \"ebrp_03_set_01_documentsHARDTEST\"; \n rootFileName = \"ebrp_03_set_01_documents\";\n yearSet.add(2002);\n yearSet.add(2006);\n yearSet.add(2010);\n fieldnameSet.add(\"Bus\"); //Business and International Management\n fieldnameSet.add(\"Phy\"); //Physics & astronomy\n weightTypeSet.add(0);\n weightTypeSet.add(1);\n useWhatSet.add(1);\n useWhatSet.add(2);\n useWhatSet.add(3);\n int infoLevelAll=-1;\n process(rootFileName, inputDirectory, outputDirectory,\n yearSet, fieldnameSet,\n weightTypeSet,\n useWhatSet,\n ipf,\n extractGCC,\n minDegreeIn, minDegreeOut, minWeight,\n infoLevelAll);\n System.exit(0);\n }\n System.out.println(\"--- file name root \"+rootFileName);\n\n int year = 2002;\n ano++;\n if ( (args.length>ano ) && (timgraph.isOtherArgument(args[ano]) )) year=Integer.parseInt(args[ano].substring(1, args[ano].length())); \n System.out.println(\"--- Year used \"+year);\n yearSet.add(year);\n\n // Bus= Business and International Management\n // Phy= Physics & astronomy\n String fieldname = \"Phy\"; \n ano++;\n if ( (args.length>ano ) && (timgraph.isOtherArgument(args[ano]) )) fieldname=args[ano].substring(1, args[ano].length()); System.out.println(\"--- fieldname used \"+fieldname);\n fieldnameSet.add(fieldname);\n\n // 1 = total weight one for each paper, terms have equal weight, P1 in file name\n int weightType=1;\n ano++;\n if ( (args.length>ano ) && (timgraph.isOtherArgument(args[ano]) )) weightType=Integer.parseInt(args[ano].substring(1, args[ano].length())); \n if ((weightType<0) || (weightType>=weightTypeShort.length)) throw new RuntimeException(\"illegal weightType of \"+weightType+\", must be between 0 and \"+(weightTypeShort.length-1)+\" inclusive\");\n System.out.println(\"--- Weight Type \"+weightType+\" = \"+weightTypeDescription[weightType]);\n weightTypeSet.add(weightType);\n \n\n // 1,3= use title, 2,3=use keywords\n int useWhat=1;\n ano++;\n if ( (args.length>ano ) && (timgraph.isOtherArgument(args[ano]) )) useWhat=Integer.parseInt(args[ano].substring(1, args[ano].length())); \n boolean useTitle=((useWhat&1)>0);\n boolean useKeywords=((useWhat&2)>0);\n System.out.println(\"--- \"+(useTitle?\"U\":\"Not u\")+\"sing titles\");\n System.out.println(\"--- \"+(useKeywords?\"U\":\"Not u\")+\"sing keywords\");\n useWhatSet.add(useWhat);\n\n // 0 for normal, 1 for some, 2 for all debugging info, -1 for minimal\n int infoLevel=0;\n ano++;\n if ( (args.length>ano ) && (timgraph.isOtherArgument(args[ano]) )) infoLevel=Integer.parseInt(args[ano].substring(1, args[ano].length())); \n System.out.println(\"--- infoLevel=\"+infoLevel);\n boolean infoOn=(infoLevel>1);\n\n// if (args.length>ano ) if (timgraph.isOtherArgument(args[ano])) graphMLOutput=StringFilter.trueString(args[ano].charAt(1));\n\n\n process(rootFileName, inputDirectory, outputDirectory,\n yearSet, fieldnameSet,\n weightTypeSet,\n useWhatSet,\n ipf,\n extractGCC,\n minDegreeIn, minDegreeOut, minWeight,\n infoLevel);\n }", "private static void parseArguments(String[] args, MiParaPipeLine p) throws IOException{\n options.addOption(\"i\", \"input-file\", true, \"FASTA input file for query sequences\");\n options.addOption(\"o\", \"output-folder\", true, \"output folder for prediction results\");\n options.addOption(\"t\", \"test\", true, \"run test example \");\n options.addOption(\"c\", \"config\", true, \"configuration file for miRPara\");\n options.addOption(\"a\", \"action\", true, \"action to perform\");\n options.addOption(\"h\", \"help \", false, \"print help\");\n\n logger.trace(\"parsing args\");\n CommandLineParser parser = new BasicParser();\n CommandLine cmd = null;\n\n \n try {\n cmd = parser.parse(options, args);\n if (cmd.hasOption(\"h\")){\n print_help();\n System.out.print(p.reportAvailableActions());\n }\n\n if (cmd.hasOption(\"t\")){ \n logger.info(\"test set to \" + cmd.getOptionValue(\"l\"));\n test = cmd.getOptionValue(\"t\").toLowerCase();\n }\n \n if (cmd.hasOption(\"i\")) {\n logger.info(\"input file set to \" + cmd.getOptionValue(\"i\"));\n p.setInputFilename(cmd.getOptionValue(\"i\"));\t\n } \n\n if (cmd.hasOption(\"o\")){\n logger.info(\"output folder is\" + cmd.getOptionValue(\"o\"));\n p.setOutputFolder(cmd.getOptionValue(\"o\"));\n }\n \n if (cmd.hasOption(\"a\")){\n logger.info(\"requested action is \" + cmd.getOptionValue(\"a\"));\n p.setAction(cmd.getOptionValue(\"a\"));\n }\n \n if (cmd.hasOption(\"c\")){\n configFile = cmd.getOptionValue(\"c\");\n logger.info(\"Configuration file is \" + configFile);\n p.setConfigFilename(configFile);\n }\n\n\n \n if(p.getConfigFilename()==null){\n throw new ParseException(\"no configuration file was specified\") ; \n }\n \n if(new File(p.getConfigFilename()).exists() == false){\n throw new IOException(\"configuration file <\" + p.getConfigFilename() + \"> does not exist\");\n } \n \n if(new File(p.getInputFilename()).exists()== false)\n {\n throw new IOException(\"input file <\" + p.getInputFilename() + \"> does not exist\");\n }\n \n if(new File(p.getOutputFolder()).exists() == false)\n {\n if (new File(p.getOutputFolder()).getParentFile().exists() == false)\n throw new IOException(\"parent file <\" + new File(p.getOutputFolder()).getParentFile() + \"> does not exist\");\n \n new File(p.getOutputFolder()).mkdir();\n logger.info(\"create results folder <\" + p.getOutputFolder() + \">\");\n }\n\n } catch (ParseException e) {\n\n logger.fatal(\"Failed to parse command line properties\", e);\n print_help();\n\n }\n\n \n }", "public static void main(String[] args) throws UIMAException, IOException, CpeDescriptorException, SAXException {\n\n if (args.length < 2) {\n System.out.println(\"Please provide where to write stats.\");\n System.exit(1);\n }\n\n // \"../data/stats/kbp/chinese_mention_surfaces.tsv\"\n String mentionSurfaceFile = args[0];\n\n // \"../data/stats/kbp/chinese_mention_coverage_report\"\n String statOutputDir = args[1];\n\n // A place to put intermediate files.\n String workingDir = args[2];\n\n Configuration commonConfig = new Configuration(\"settings/common.properties\");\n String typeSystemName = commonConfig.get(\"edu.cmu.cs.lti.event.typesystem\");\n\n TypeSystemDescription typeSystemDescription = TypeSystemDescriptionFactory\n .createTypeSystemDescription(typeSystemName);\n\n String[] datasetNames = {\"LDC2014E114\", \"LDC2015E105\", \"LDC2015E78\", \"LDC2015E112_R2\", \"ACE2005_Chinese\"};\n\n EventDataReader dataReader = new EventDataReader(workingDir, \"all\", false);\n\n for (String datasetName : datasetNames) {\n String dataConfigPath = commonConfig.get(\"edu.cmu.cs.lti.dataset.settings.path\");\n Configuration datasetConfig = new Configuration(\n new File(dataConfigPath, datasetName + \".properties\"));\n dataReader.readData(datasetConfig, dataConfigPath, typeSystemDescription);\n }\n\n CollectionReaderDescription reader = dataReader.getReader();\n\n AnalysisEngineDescription goldAnnotator = AnalysisEngineFactory.createEngineDescription(\n GoldStandardEventMentionAnnotator.class, typeSystemDescription,\n GoldStandardEventMentionAnnotator.PARAM_TARGET_VIEWS,\n new String[]{CAS.NAME_DEFAULT_SOFA, UimaConst.inputViewName},\n GoldStandardEventMentionAnnotator.PARAM_COPY_MENTION_TYPE, true,\n GoldStandardEventMentionAnnotator.PARAM_COPY_REALIS, true,\n GoldStandardEventMentionAnnotator.PARAM_COPY_CLUSTER, true,\n GoldStandardEventMentionAnnotator.PARAM_COPY_RELATIONS, true\n );\n\n AnalysisEngineDescription surfaceCollector = AnalysisEngineFactory\n .createEngineDescription(EventMentionSurfaceCollector.class,\n EventMentionSurfaceCollector.PARAM_OUTPUT_FILE_PATH, mentionSurfaceFile\n );\n\n SimplePipeline.runPipeline(reader, goldAnnotator, surfaceCollector);\n\n for (int i = 0; i < datasetNames.length; i++) {\n EventDataReader datasetEventReader = new EventDataReader(workingDir, datasetNames[i], false);\n\n String datasetName = datasetNames[i];\n\n CollectionReaderDescription dataSetReader = datasetEventReader.getReader();\n\n AnalysisEngineDescription stanfordProcessor = AnalysisEngineFactory.createEngineDescription(\n StanfordCoreNlpAnnotator.class, typeSystemDescription,\n StanfordCoreNlpAnnotator.PARAM_LANGUAGE, \"zh\",\n StanfordCoreNlpAnnotator.PARAM_SPLIT_ONLY, true\n );\n\n AnalysisEngineDescription coverageReport = AnalysisEngineFactory.createEngineDescription(\n EventMentionSurfaceCoverageReport.class,\n EventMentionSurfaceCoverageReport.PARAM_EVENT_MENTION_SURFACE, mentionSurfaceFile,\n EventMentionSurfaceCoverageReport.PARAM_REPORT_OUTPUT, statOutputDir,\n EventMentionSurfaceCoverageReport.PARAM_DATA_SET_NAME, datasetName\n );\n\n new BasicPipeline(dataSetReader, goldAnnotator, stanfordProcessor, coverageReport).run();\n }\n }", "public static void main(String[] args) throws IOException {\n\t\tString line = new String(Files.readAllBytes(Paths.get(\"input.txt\")));\n\t\t\n\t\tFiles.write(Paths.get(\"outputh.txt\"), getOutput(line).getBytes(), StandardOpenOption.CREATE);\n\t\t\n\t}", "public static void main(String[] args) {\n\t\tPreprocessing p = new Preprocessing();\r\n\t\tp.ZAData();\r\n\t\t//String ZA_dir = \"C:\\\\Users\\\\manja\\\\Google Drive\\\\SJSU\\\\Year 4\\\\CS 185C\\\\Midterm 2\\\\Malware files\\\\zeroaccess\";\r\n\t\t//String[] ZA_samples = p.get_samples(ZA_dir);\r\n\t\t// HashMap<String, Integer> ZA_opcode_dict = opcode_occurrences(ZA_dir,\r\n\t\t// ZA_samples);\r\n\t\t// System.out.println(ZA_opcode_dict);\r\n\t\t//String replace_ZA_dir = \"C:\\\\Users\\\\manja\\\\Google Drive\\\\SJSU\\\\Year 4\\\\CS 185C\\\\Midterm 2\\\\Malware files\\\\replace_za\";\r\n\t\t/* HashMap<String, String> ZA_OPCODE = new HashMap<String, String>() {\r\n\t\t\t{\r\n\t\t\t\tput(\"mov\", \"A\");\r\n\t\t\t\tput(\"push\", \"B\");\r\n\t\t\t\tput(\"call\", \"C\");\r\n\t\t\t\tput(\"cmp\", \"D\");\r\n\t\t\t\tput(\"pop\", \"E\");\r\n\t\t\t\tput(\"jz\", \"F\");\r\n\t\t\t\tput(\"jnz\", \"G\");\r\n\t\t\t\tput(\"add\", \"H\");\r\n\t\t\t\tput(\"test\", \"I\");\r\n\t\t\t\tput(\"lea\", \"J\");\r\n\t\t\t\tput(\"jmp\", \"K\");\r\n\t\t\t\tput(\"retn\", \"L\");\r\n\t\t\t\tput(\"xor\", \"M\");\r\n\t\t\t\tput(\"and\", \"N\");\r\n\t\t\t\tput(\"inc\", \"O\");\r\n\t\t\t\tput(\"sub\", \"P\");\r\n\t\t\t};\r\n\t\t};\r\n\t\tp.copy_replace(ZA_dir, replace_ZA_dir, ZA_samples, ZA_OPCODE);\r\n\t\tString[] ZA_modelData = p.splittingData(replace_ZA_dir);\r\n\t\tfor (String s : ZA_modelData)\r\n\t\t\tSystem.out.println(s);\r\n\t*/\r\n\t}", "public static void main(String[] args) throws Exception {\n CharStream input = CharStreams.fromFileName(\"T2-Ejercicios/T2-Ej2/Multiplo.txt\");\n FileOutputStream f = new FileOutputStream(\"T2-Ejercicios/T2-Ej2/MultiploOut.txt\");\n System.setOut(new PrintStream(f));\n // create a lexer that feeds off of input CharStream\n MultiploLexer lexer = new MultiploLexer(input);\n // create a buffer of tokens pulled from the lexer\n CommonTokenStream tokens = new CommonTokenStream(lexer);\n // create a parser that feeds off the tokens buffer\n MultiploParser parser = new MultiploParser(tokens);\n parser.r();\n System.out.println(); // print a \\n after translation\n }", "public static void lemmatize(String infilename, String outfilename) {\n\n final MADAMIRAWrapper wrapper = new MADAMIRAWrapper();\n JAXBContext jc = null;\n\n try {\n jc = JAXBContext.newInstance(MADAMIRA_NS);\n Unmarshaller unmarshaller = jc.createUnmarshaller();\n\n // The structure of the MadamiraInput object is exactly similar to the\n // madamira_input element in the XML\n final MadamiraInput input = (MadamiraInput)unmarshaller.unmarshal(\n new File( infilename ) );\n\n {\n int numSents = input.getInDoc().getInSeg().size();\n String outputAnalysis = input.getMadamiraConfiguration().\n getOverallVars().getOutputAnalyses();\n String outputEncoding = input.getMadamiraConfiguration().\n getOverallVars().getOutputEncoding();\n\n System.out.println(\"processing \" + numSents +\n \" sentences for analysis type = \" + outputAnalysis +\n \" and output encoding = \" + outputEncoding);\n }\n\n // The structure of the MadamiraOutput object is exactly similar to the\n // madamira_output element in the XML\n final MadamiraOutput output = wrapper.processString(input);\n\n {\n int numSents = output.getOutDoc().getOutSeg().size();\n System.out.println(\"processed output contains \"+numSents+\" sentences...\");\n }\n\n\n jc.createMarshaller().marshal(output, new File(outfilename));\n\n\n } catch (JAXBException ex) {\n System.out.println(\"Error marshalling or unmarshalling data: \"\n + ex.getMessage());\n } catch (InterruptedException ex) {\n System.out.println(\"MADAMIRA thread interrupted: \"\n +ex.getMessage());\n } catch (ExecutionException ex) {\n System.out.println(\"Unable to retrieve result of task. \" +\n \"MADAMIRA task may have been aborted: \"+ex.getCause());\n }\n\n wrapper.shutdown();\n }", "public static void main(String[] args)\r\n\t{\n\t\tSystem.out.println(\"Jon Heard's JVM Assembler\");\r\n\t\tSystem.out.println(\"version \" + VERSION);\r\n\t\tSystem.out.println(\"----------------------------\");\r\n\t\tSystem.out.println(\" ('-help' or '-h' for help)\");\r\n\t\tSystem.out.println(\"----------------------------\");\r\n\t\t\r\n\t\t/// Parse arguments\r\n\t\tboolean error = false;\r\n\t\tboolean helpTextPrinted = false;\r\n\t\tString sourceFileName = \"\";\t\t\r\n\t\tfor(String arg : args)\r\n\t\t{\r\n\t\t\tif(arg.startsWith(\"-\"))\r\n\t\t\t{\r\n\t\t\t\tif(arg.equals(\"-help\") || arg.equals(\"-h\"))\r\n\t\t\t\t{\r\n\t\t\t\t\tprintHelpText();\r\n\t\t\t\t\thelpTextPrinted = true;\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tSystem.err.println(\r\n\t\t\t\t\t\t\t\"ERROR: Invalid parameter '\" + arg + \"'.\");\r\n\t\t\t\t\terror = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse if(!sourceFileName.equals(\"\"))\r\n\t\t\t{\r\n\t\t\t\tSystem.err.println(\"ERROR: Invalid parameter '\" + arg + \"'.\");\r\n\t\t\t\terror = true;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tsourceFileName = arg;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(error || helpTextPrinted) return;\r\n\r\n\t\t/// Make sure we have a source file to load\r\n\t\tif(args.length < 1)\r\n\t\t{\r\n\t\t\tSystem.err.println(\"ERROR: A sourcefile must be included.\");\r\n\t\t\tSystem.err.println(\"\\tExample: \");\r\n\t\t\tSystem.err.println(\"\\tjvmasm MySource.asm\");\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t/// Make sure the source file exists\r\n\t\tFile sourceFile = new File(sourceFileName);\r\n\t\tif(!sourceFile.exists())\r\n\t\t{\r\n\t\t\tSystem.err.println(\r\n\t\t\t\t\t\"ERROR: the source file '\" + sourceFileName +\r\n\t\t\t\t\t\"' does not exist.\");\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t/// Load the source file into a string\r\n\t\tString sourceData = UtilMethods.fileToString(sourceFileName);\r\n\t\tif(sourceData == null)\r\n\t\t{\r\n\t\t\tSystem.err.println(\r\n\t\t\t\t\t\"ERROR: Unable to load the source file '\" + sourceFileName +\r\n\t\t\t\t\t\"'.\");\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t/// Parse the source file into a ClassRep object\r\n\t\tClassParser parser = new ClassParser();\r\n\t\tClassRep classRep = parser.parseSource(sourceFileName, sourceData);\r\n\t\tif(classRep == null)\r\n\t\t{\r\n\t\t\tSystem.err.println(\r\n\t\t\t\t\t\"ERROR: Failed to parse source file '\" + sourceFileName +\r\n\t\t\t\t\t\"'.\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\t/// Store the ClassRep into a class file\r\n\t\tString classFileName = classRep.getName() + \".class\";\r\n\t\tif(!UtilMethods.byteArrayToFile(\r\n\t\t\t\tclassRep.getJvmBytes(), classFileName))\r\n\t\t{\r\n\t\t\tSystem.err.println(\r\n\t\t\t\t\t\"ERROR: Failed to write class file '\" + classFileName +\r\n\t\t\t\t\t\"'.\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t}", "public static void main(String[] args) {\n\t\tString[] fileNames = {\r\n\t\t\t\t\"transByZipMonthYear\", \"transCountAndValByType\", \"transCountAndValByState\",\r\n\t\t\t\t\"customerBySsn\", \"updatedCustomer\", \"monthInvoice\",\"monthInvoiceTransactions\",\"custTransBetweenDates\"\r\n\t\t\t\t};\r\n\t\tString[] columnNames = {\r\n\t\t\t\t\"t_id,d,m,y,ccn,branch,transaction_type,transaction_value,c_ssn\",\r\n\t\t\t\t\"type, val, count\",\r\n\t\t\t\t\"state, val, count\",\r\n\t\t\t\t\"fName, mName,lName,ssn,ccn,aptN,streetN,custCity,custState,custCountry,custZip,custPhone,custEmail\",\r\n\t\t\t\t\"fName, mName,lName,ssn,ccn,aptN,streetN,custCity,custState,custCountry,custZip,custPhone,custEmail\",\r\n\t\t\t\t\"balance, fName, lName, id\",\r\n\t\t\t\t\"t_id,d,m,y,ccn,branch,transaction_type,transaction_value,c_ssn\",\r\n\t\t\t\t\"fName, mName, lName,t_id,d,m,y,ccn,branch,transaction_type,transaction_value\"\r\n\t\t\t\t\r\n\t\t};\r\n\t\tfor(int i = 0;i<fileNames.length;i++) {\r\n\t\t\tWriteToFile.overWrite(fileNames[i]);\r\n\t\t\tWriteToFile.writeToLoc(fileNames[i], columnNames[i]);\r\n\t\t}\r\n\t\t//might be easier to just non-append-write the files here to blank them out\r\n\t\t\t//narrator: it was.\t\r\n\t\tScanner scanner = new Scanner (System.in);\r\n\t\tselect(scanner);\r\n\t\tscanner.close();\r\n\t\treturn;\t\r\n\t}", "public static void main(String[] args) throws IOException {\n CommandLineParser parser = new DefaultParser();\n Options options = new Options();\n\n Option optModel = OptionBuilder.withArgName(\"model\")\n .hasArg()\n .withDescription(\"model used for simulation: \\n\\nmistransmission\\n constraint\\n constraintWithMistransmission\\n prior\\n priorWithMistransmission (default)\")\n .create(\"model\");\n options.addOption(optModel);\n \n options.addOption(\"stochastic\", false, \"sample from previous generation's distributions\"); \n \n options.addOption(\"superspeakers\", false, \"20% of speakers in grouped distance model connect to other group\"); \n\n Option optLogging = OptionBuilder.withArgName(\"logging\")\n .hasArg()\n .withDescription(\"logging level: \\nnone \\nsome \\nall \\ntabular \\ntroubleshooting\")\n .create(\"logging\");\n options.addOption(optLogging); \n\n Option optFreqNoun = OptionBuilder.withArgName(\"freqNoun\")\n .hasArg()\n .withDescription(\"noun frequency of the target word\")\n .create(\"freqNoun\");\n options.addOption(optFreqNoun); \n \n Option optFreqVerb = OptionBuilder.withArgName(\"freqVerb\")\n .hasArg()\n .withDescription(\"verb frequency of the target word\")\n .create(\"freqVerb\");\n options.addOption(optFreqVerb); \n \n Option optMisProbP = OptionBuilder.withArgName(\"misProbNoun\")\n .hasArg()\n .withDescription(\"mistransmission probability for nouns\")\n .create(\"misProbP\");\n options.addOption(optMisProbP); \n \n Option optMisProbQ = OptionBuilder.withArgName(\"misProbVerb\")\n .hasArg()\n .withDescription(\"mistransmission probability for verbs\")\n .create(\"misProbQ\");\n options.addOption(optMisProbQ); \n \n Option optLambda11 = OptionBuilder.withArgName(\"prior11General\")\n .hasArg()\n .withDescription(\"general prior probability for {1,1} stress pattern\")\n .create(\"prior11General\");\n options.addOption(optLambda11); \n \n Option optLambda22 = OptionBuilder.withArgName(\"prior22General\")\n .hasArg()\n .withDescription(\"general prior probability for {2,2} stress pattern\")\n .create(\"prior22General\");\n options.addOption(optLambda22); \n \n Option optTargetLambda11 = OptionBuilder.withArgName(\"prior11Target\")\n .hasArg()\n .withDescription(\"prior probability for {1,1} stress pattern in the target word prefix class\")\n .create(\"prior11Target\");\n options.addOption(optTargetLambda11); \n \n Option optTargetLambda22 = OptionBuilder.withArgName(\"prior22Target\")\n .hasArg()\n .withDescription(\"prior probability for {2,2} stress pattern in the target word prefix class\")\n .create(\"prior22Target\");\n options.addOption(optTargetLambda22); \n \n Option optDistModel = OptionBuilder.withArgName(\"distModel\")\n .hasArg()\n .withDescription(\"distance model:\\n none\\n absolute\\n probabilistic\\n random\\n lattice\\n grouped (default)\")\n .create(\"distModel\");\n options.addOption(optDistModel); \n \n options.addOption(\"priorClass\", false, \"use word pair prefixes as a class for sharing prior probabilities\"); \n \n Option optNumSpeakers = OptionBuilder.withArgName(\"numSpeakers\")\n .hasArg()\n .withDescription(\"number of speakers\")\n .create(\"numSpeakers\");\n options.addOption(optNumSpeakers); \n \n Option optTargetWord = OptionBuilder.withArgName(\"targetWord\")\n .hasArg()\n .withDescription(\"target word for logging\")\n .create(\"targetWord\");\n options.addOption(optTargetWord); \n \n options.addOption(\"help\", false, \"print this message\"); \n\n try { // parse the command line arguments\n CommandLine line = parser.parse(options, args);\n if(line.hasOption(\"model\")) {\n model = line.getOptionValue(\"model\");\n }\n if(line.hasOption(\"stochastic\")) { \n stochastic = true;\n } else {\n stochastic = false;\n }\n if(line.hasOption(\"superspeakers\")) { \n superspeakers = true;\n } else {\n superspeakers = false;\n }\n if(line.hasOption(\"logging\")) {\n logging = line.getOptionValue(\"logging\");\n }\n if(line.hasOption(\"freqNoun\")) {\n freqNoun = Integer.parseInt(line.getOptionValue(\"freqNoun\"));\n }\n if(line.hasOption(\"freqVerb\")) {\n freqVerb = Integer.parseInt(line.getOptionValue(\"freqVerb\"));\n }\n if(line.hasOption(\"misProbP\")) {\n misProbP = Integer.parseInt(line.getOptionValue(\"misProbP\"));\n }\n if(line.hasOption(\"misProbQ\")) {\n misProbQ = Integer.parseInt(line.getOptionValue(\"misProbQ\"));\n }\n if(line.hasOption(\"targetWord\")) {\n targetWord = line.getOptionValue(\"targetWord\");\n }\n if(line.hasOption(\"prior11General\")) {\n lambda11 = Integer.parseInt(line.getOptionValue(\"prior11General\"));\n }\n if(line.hasOption(\"prior22General\")) {\n lambda22 = Integer.parseInt(line.getOptionValue(\"prior22General\"));\n }\n if(line.hasOption(\"prior11Target\")) {\n targetClassLambda11 = Integer.parseInt(line.getOptionValue(\"prior11Target\"));\n }\n if(line.hasOption(\"prior22Target\")) {\n targetClassLambda22 = Integer.parseInt(line.getOptionValue(\"prior22Target\"));\n }\n if(line.hasOption(\"distModel\")) {\n distModel = line.getOptionValue(\"distModel\");\n }\n if(line.hasOption(\"priorClass\")) {\n priorClass = true;\n } else {\n priorClass = false;\n }\n if(line.hasOption(\"numSpeakers\")) {\n numSpeakers = Integer.parseInt(line.getOptionValue(\"numSpeakers\"));\n }\n if(line.hasOption(\"help\")) {\n HelpFormatter formatter = new HelpFormatter();\n formatter.printHelp( \"StressChange\", options );\n }\n } catch ( ParseException exp) {\n System.out.println(\"Unexpected exception: \" + exp.getMessage());\n }\n\n if (StressChange.logging.equals(\"tabular\")){\n System.out.println(\"Iteration,Speaker,Group,Word,Prefix,Noun prob,Verb prob\");\n }\n else if (!StressChange.logging.equals(\"none\")) {\n System.out.println(\"Simulating \" + model + \" model with \" + distModel + \" distance model, showing \" + logging + \" words\");\n System.out.println(\"N1 (target word noun frequency): \" + freqNoun);\n System.out.println(\"N2 (target word verb frequency): \" + freqVerb);\n }\n \n initialStress = new ReadPairs(System.getProperty(\"user.dir\") + \"/src/initialStressSmoothed.txt\").OpenFile(); // read in initial pairs\n\n SimState state = new StressChange(System.currentTimeMillis());\n state.start();\n \n do {\n convos.removeAllEdges();\n if (! StressChange.logging.equals(\"none\") && !StressChange.logging.equals(\"tabular\")){ System.out.println(\"\"); }\n //if (! StressChange.logging.equals(\"none\")){ System.out.println(\"Generation at year \" + (1500 + (state.schedule.getSteps()) * 25)); } // 25-year generations \n if (! StressChange.logging.equals(\"none\") && !StressChange.logging.equals(\"tabular\")){ System.out.println(\"==== ITERATION \" + (state.schedule.getSteps() + 1) + \" ====\"); }\n if (!state.schedule.step(state)) {\n break;\n }\n step++;\n } while (state.schedule.getSteps() < 49); // maximum 50 iterations\n state.finish();\n\n System.exit(0);\n }", "public static void main(String[] args) {\n\t\tString cwd = System.getProperty(\"user.dir\");\t\t\n\t\tString targetFile = cwd + File.pathSeparator + \"target\" + File.pathSeparator + \"testfile.txt\";\n\t\ttry(FileOutputStream fout = new FileOutputStream(targetFile)){\n\t\t\tfout.write(args[0].getBytes());\n\t\t\tfout.write(System.getProperty(\"line.separator\").getBytes());\n\t\t\t//Did we write it..for real??\n\t\t\tFileReaderDemo.readFile(targetFile);\n\t\t}catch(IOException e) {\n\t\t\t\n\t\t}\n\t}", "public static void main(String[] args) {\n\t\tinitializeDBMS();\n\t\t// read the input from file\n\t\tString input = readInput(\"input2.txt\");\n\t\tif (input != null) {\n\t\t\t// get the operations from input\n\t\t\tString[] operations = getOperations(input);\n\t\t\t// process operations\n\t\t\tprocessOperations(operations);\n\n\t\t\twriteToOutput(\"Success.\");\n\t\t} else {\n\t\t\twriteToOutput(\"Input error\");\n\t\t}\n\t\twriteToOutput(\"Final values on disk: \" + diskBlockInMemory);\n\t\twriteOutputFile(\"output2.txt\", output.toString());\n\t\tSystem.out.println(\"Done\");\n\n\t}", "public static void main(String[] args) throws FileNotFoundException {\n\t\tInputStream modelIn = new FileInputStream(\"en-token.bin\");\n\n\t\ttry {\n\t\t\tTokenizerModel model = new TokenizerModel(modelIn);\n\t\t\tTokenizer tokenizer = new TokenizerME(model);\n\t\t\tString txt1 = readFile(\"files/job_1.txt\", null);\n\t\t\ttokenize(txt1,tokenizer);\n\t\t\t\n\t\t//\tString txt2 = readFile(\"files/job_1.html\", null);\n\t\t//\ttokenize(txt2,tokenizer);\n\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\tif (modelIn != null) {\n\t\t\t\ttry {\n\t\t\t\t\tmodelIn.close();\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}", "public static void main(String args[]) throws IOException{\n\t\tString filename=null;\n\t\tString outfileNoS=\"CorpusOutputNoS.txt\";\n\t\tString outfileS=\"CorpusOutputS.txt\";\n\t\tString outfileT=\"CorpusOutputT.txt\";\n\t\tString str;\n\t\t\n\t\tFile out1= new File(outfileNoS);\n\t\twriter1= new FileWriter(out1);\n\t\t\n\t\tFile out2= new File(outfileS);\n\t\twriter2= new FileWriter(out2);\n\t\t\n\t\tFile out3= new File(outfileT);\n\t\twriter3= new FileWriter(out3);\n\t\t\n\t\tString given=null; \n\t\tif(args.length>0)\n\t\t\tfilename=args[0];\n\t\t\n\t\tcorpusTokens = new ArrayList<String>();\n\t\tcorpusUnigramCount = new HashMap<String, Integer>();\n\t\tcorpusBigramCount = new HashMap<String, Integer>();\n\t\tcorpusBigramProb= new HashMap<String,Double>();\n\t\tcorpusNumOfBigrams=0;\n\t\t\n\t\tScanner in = new Scanner(new File(filename));\n\t\t\n//----------------------------------CORPUS BEGIN-------------------------\n\t\t//finds unigram and Bigram count in Corpus and display it\n\t\tcorpusNumOfBigrams=findBigramCount(in,corpusTokens,corpusUnigramCount,corpusBigramCount);\n\t\t\n\t\t//Find corpus Bigram Prob and display it\n\t\tfindBigramProb(corpusUnigramCount,corpusBigramCount,corpusBigramProb,corpusTokens,corpusNumOfBigrams);\n\t\t\n\t\tint V= corpusUnigramCount.size();\n\n\t\t//display details of corpus\n\t\tstr=String.valueOf(corpusNumOfBigrams)+\"\\n\"; //number of Bigrams\n\t\tstr+=String.valueOf(corpusBigramCount.size())+\"\\n\";//Unique Bigram count \n\t\tstr+=String.valueOf(V)+\"\\n\";//Unique Unigram count \n\t\tstr+= String.valueOf(corpusTokens.size())+\"\\n\";//Total count\n\t\tstr+=\"\\n\";\n\t\twriter1.write(str);\n\t\t\n\t\tdisplayCount1(corpusUnigramCount);\n\t\tdisplayCount1(corpusBigramCount);\n\t\tdisplayProb1(corpusBigramProb);\n\t\t\n\t\t\n//-----------------------------------CORPUS END--------------------------------\n\n//-------------------------Add-one Smoothing begins--------------------\n\t\t\n\t\tfindBigramProbSmoothing(corpusBigramCount,V);\n\t\tdisplayProb2(bigramProbS);\n//----------------------Add-one smoothing ends--------------------------\n\t\t\n//-------------------Good-Turing Discounting Begins-------------------------\n\t\t\n\t\t//finds the initial bucket count using the bigram count before smoothing \n\t\tdoBucketCount(corpusBigramCount);\n\t\t\n\t\tstr=bucketCountT.size()+\"\\n\\n\";\n\t\twriter3.write(str);\n\t\tdisplayBucketCount3();\n\t\t\n\t\t//finding new Counts with Good Turing discounting\n\t\tfindBigramCountsTuring();\n\t\t\n\t\t\n\t\t//finding bigram probabilities with Good Turing discounting\n\t\tfindBigramProbTuring();\n\t\tdisplayProb3(bigramProbT);\n\t\t\n//--------------------Good-Turing Discounting Ends-------------------------\n\t\twriter1.close();\n\t\twriter2.close();\n\t\twriter3.close();\n\t}", "public static void main(String[] args) throws InvalidFormatException, FileNotFoundException, IOException {\n\n int classNumber = 2;\n int Ngram = 2; // The default value is unigram.\n int lengthThreshold = 5; // Document length threshold\n int numberOfCores = Runtime.getRuntime().availableProcessors();\n\n String tokenModel = \"./data/Model/en-token.bin\"; // Token model.\n\n EmbeddingParameter param = new EmbeddingParameter(args);\n\n String providedCV = String.format(\"%s/%s/%sSelectedVocab.txt\", param.m_prefix, param.m_data, param.m_data);\n String userFolder = String.format(\"%s/%s/Users\", param.m_prefix, param.m_data);\n String friendFile = String.format(\"%s/%s/%sFriends.txt\", param.m_prefix, param.m_data, param.m_data);\n String cvIndexFile = String.format(\"%s/%s/%sCVIndex.txt\", param.m_prefix, param.m_data, param.m_data);\n String cvIndexFile4Interaction = String.format(\"%s/%s/%sCVIndex4Interaction_fold_%d_train.txt\", param.m_prefix, param.m_data, param.m_data, param.m_kFold);\n\n MultiThreadedNetworkAnalyzer analyzer = null;\n int kFold = 5;\n\n if(param.m_data.equals(\"StackOverflow\")){\n analyzer = new MultiThreadedStackOverflowAnalyzer(tokenModel, classNumber, providedCV, Ngram, lengthThreshold, numberOfCores, true);\n } else\n analyzer = new MultiThreadedNetworkAnalyzer(tokenModel, classNumber, providedCV, Ngram, lengthThreshold, numberOfCores, true);\n analyzer.setAllocateReviewFlag(false); // do not allocate reviews\n\n // we store the interaction information before-hand, load them directly\n analyzer.loadUserDir(userFolder);\n analyzer.constructUserIDIndex();\n\n // if it is cv for doc, use all the interactions + part of docs\n if(param.m_mode.equals(\"cv4doc\") && !param.m_coldStartFlag){\n analyzer.loadCVIndex(cvIndexFile, kFold);\n analyzer.loadInteractions(friendFile);\n }\n // if it is cv for edge, use all the docs + part of edges\n else if(param.m_mode.equals(\"cv4edge\") && !param.m_coldStartFlag){\n analyzer.loadInteractions(cvIndexFile4Interaction);\n }\n // cold start for doc, use all edges, test doc perplexity on light/medium/heavy users\n else if(param.m_mode.equals(\"cv4doc\") && param.m_coldStartFlag) {\n cvIndexFile = String.format(\"%s/%s/ColdStart/%s_cold_start_4docs_fold_%d.txt\", param.m_prefix, param.m_data,\n param.m_data, param.m_kFold);\n analyzer.loadCVIndex(cvIndexFile, kFold);\n analyzer.loadInteractions(friendFile);\n }\n // cold start for edge, use all edges, learn user embedding for light/medium/heavy users\n else if(param.m_mode.equals(\"cv4edge\") && param.m_coldStartFlag){\n cvIndexFile4Interaction = String.format(\"%s/%s/ColdStart/%s_cold_start_4edges_fold_%d_interactions.txt\",\n param.m_prefix, param.m_data, param.m_data, param.m_kFold);\n analyzer.loadInteractions(cvIndexFile4Interaction);\n }\n // answerer recommendation for stackoverflow data only\n else if(param.m_mode.equals(\"ansrec\")){\n cvIndexFile = String.format(\"%s/%s/AnswerRecommendation/%sCVIndex4Recommendation.txt\",\n param.m_prefix, param.m_data, param.m_data);\n friendFile = String.format(\"%s/%s/AnswerRecommendation/%sFriends4Recommendation.txt\",\n param.m_prefix, param.m_data, param.m_data);\n analyzer.loadCVIndex(cvIndexFile, kFold);\n analyzer.loadInteractions(friendFile);\n }\n /***Start running joint modeling of user embedding and topic embedding****/\n double emConverge = 1e-10, alpha = 1 + 1e-2, beta = 1 + 1e-3, lambda = 1 + 1e-3, varConverge = 1e-6;//these two parameters must be larger than 1!!!\n _Corpus corpus = analyzer.getCorpus();\n\n long start = System.currentTimeMillis();\n LDA_Variational tModel = null;\n\n if(param.m_multiFlag && param.m_coldStartFlag) {\n tModel = new EUB4ColdStart_multithreading(param.m_emIter, emConverge, beta, corpus, lambda, param.m_number_of_topics,\n alpha, param.m_varIter, varConverge, param.m_embeddingDim);\n } else if(param.m_multiFlag && !param.m_coldStartFlag){\n tModel = new EUB_multithreading(param.m_emIter, emConverge, beta, corpus, lambda, param.m_number_of_topics,\n alpha, param.m_varIter, varConverge, param.m_embeddingDim);\n } else{\n tModel = new EUB(param.m_emIter, emConverge, beta, corpus, lambda, param.m_number_of_topics, alpha,\n param.m_varIter, varConverge, param.m_embeddingDim);\n }\n\n ((EUB) tModel).initLookupTables(analyzer.getUsers());\n ((EUB) tModel).setModelParamsUpdateFlags(param.m_alphaFlag, param.m_gammaFlag, param.m_betaFlag,\n param.m_tauFlag, param.m_xiFlag, param.m_rhoFlag);\n ((EUB) tModel).setMode(param.m_mode);\n\n ((EUB) tModel).setTrainInferMaxIter(param.m_trainInferIter);\n ((EUB) tModel).setTestInferMaxIter(param.m_testInferIter);\n ((EUB) tModel).setParamMaxIter(param.m_paramIter);\n ((EUB) tModel).setStepSize(param.m_stepSize);\n ((EUB) tModel).setGamma(param.m_gamma);\n ((EUB) tModel).setData(param.m_data);\n\n if(param.m_mode.equals(\"ansrec\")){\n String questionIds = String.format(\"%s/%s/AnswerRecommendation/%sSelectedQuestions.txt\",\n param.m_prefix, param.m_data, param.m_data);\n ((EUB) tModel).loadQuestionIds(questionIds);\n }\n\n if(param.m_multiFlag && param.m_coldStartFlag){\n ((EUB4ColdStart_multithreading) tModel).fixedCrossValidation(param.m_kFold, param.m_saveDir);\n } else{\n ((EUB) tModel).fixedCrossValidation(param.m_kFold, param.m_saveDir);\n }\n\n String saveDir = param.m_saveDir + String.format(\"%s_nuTopics_%d_dim_%d_fold_%d\", param.m_data,\n param.m_number_of_topics, param.m_embeddingDim, param.m_kFold);\n File dir = new File(saveDir);\n if(!dir.exists())\n dir.mkdir();\n\n tModel.printBeta(param.m_saveDir);\n if(param.m_mode.equals(\"ansrec\")){\n ((EUB) tModel).printTopicEmbeddingAsMtx(param.m_saveDir);\n ((EUB) tModel).printTheta(param.m_saveDir);\n }\n long end = System.currentTimeMillis();\n\n // the total time of training and testing in the unit of hours\n double hours = (end - start)/((1000*60*60) * 1.0);\n System.out.print(String.format(\"[Time]This training+testing process took %.2f hours.\\n\", hours));\n\n }", "public static void main (String args[]) {\n \n args = PrimitiveArray.stripDashedMembers( args );\n boolean testing = false;\n if ( testing ) {\n General.verbosity = General.verbosityDebug;\n General.showOutput(\"Setting variables for testing\");\n String input_file_name = \"S:\\\\jurgen\\\\t.blast\";\n String output_file_bin_name = \"S:\\\\jurgen\\\\t.bin\";\n String output_file_csv_name = \"S:\\\\jurgen\\\\t.csv\";\n boolean useBmrbStyle = true;\n int verbosity = 4; \n args = new String[] {\n input_file_name,\n output_file_bin_name,\n output_file_csv_name,\n (Boolean.valueOf( useBmrbStyle ).toString()),\n (new Integer( verbosity ).toString())\n };\n }\n \n General.showOutput(\"BlastTxt2BinAndCsv version: 6/22/2005\");\n if ( args.length != 5) {\n General.showError(\"Didn't find the expected number of arguments\\n\" +\n \"Usage: java -Xmx128m Wattos.Gobbler.Converters.BlastTxt2BinAndCsv \" +\n \"<blast text input file> \\n\" +\n \"<blast bin output file> \\n\" +\n \"<blast csv output file> \\n\" +\n \"<use the bmrb style of output true|false>\\n\" +\n \"<verbosity>\");\n General.showError(\"verbosity: 0-9:0 no output, 2 normal, including warnings, 3 no warnings, 9 debug\");\n General.showError(\"Arguments found are: \" + PrimitiveArray.toString(args));\n System.exit(1);\n }\n String input_file_name = args[0];\n String output_file_bin_name = args[1];\n String output_file_csv_name = args[2];\n boolean useBmrbStyle = Boolean.valueOf( args[3] ).booleanValue();\n int verbosity = Integer.parseInt( args[4] );\n \n General.verbosity = verbosity;\n \n General.showOutput(\"Reading input file from : \"+input_file_name);\n General.showOutput(\"Writing bin file to : \"+output_file_bin_name);\n General.showOutput(\"Writing csv file to : \"+output_file_csv_name);\n \n boolean overall_status = true; \n boolean status = false; \n try { // Catch any throwable and report\n status = BlastParser.convertBlast(input_file_name, output_file_bin_name, verbosity); \n if ( ! status ) {\n General.showError(\"Converting blast text output to binary representation: \" + input_file_name);\n overall_status = false;\n }\n if ( status ) {\n status = BlastMatchLoLoL.convertBin2CsvSingleFile( output_file_bin_name, output_file_csv_name, useBmrbStyle );\n if ( ! status ) {\n General.showError(\"Converting blast bin output to csv representation: \" + output_file_bin_name);\n overall_status = false;\n }\n } \n } catch ( Throwable t ) {\n General.showThrowable(t);\n }\n \n if ( ! overall_status ) {\n General.showError(\"Failed in Wattos.Gobbler.Converters.BlastTxt2BinAndCsv.\");\n System.exit(1);\n }\n General.showOutput(\"Done successfully with Wattos.Gobbler.Converters.BlastTxt2BinAndCsv\");\n }", "public static void main(String[] args) throws FileNotFoundException, TransformerException, ParserConfigurationException {\n\t\t\n\t\r\n\t\t\r\n\t}", "public static void main(String[] args) throws IOException {\n\t\tCharStream input = CharStreams.fromFileName(\"C:\\\\Users\\\\User\\\\eclipse-workspace\\\\Compilateur-Aisha-Liliya\\\\src\\\\test\\\\test0.txt\");\n\t\tLangageLexer lexer = new LangageLexer( input);\n\t\tLangageParser parser = new \tLangageParser(new CommonTokenStream(lexer));\n\t\tListener l =new Listener();\n\t\tparser.addParseListener(l);\n\t\t\n\t\tParseTree tree = parser.code();\n\tl.s.printTE();\n\tl.s.printTS();\n\tl.s.printQuad();\n\tl.s.printCODEOBJET();\n\t}", "public static void main(String[] args) throws IOException {\r\n\t\tString outputDirectory;\r\n\t\tString parsedFileName;\r\n\t\tString normalizedFileName;\r\n\r\n\t\t// build acquis\r\n\t\toutputDirectory = Config.get().outputDirectory + \"brown/\";\r\n\t\tparsedFileName = \"parsed.txt\";\r\n\t\tnormalizedFileName = \"normalized.txt\";\r\n\t\tString[] languages = Config.get().acquisLanguages.split(\",\");\r\n\t\tnew File(outputDirectory).mkdirs();\r\n\r\n\t\tfor (String language : languages) {\r\n\t\t\tString outputPath = outputDirectory + language + \"/\";\r\n\t\t\tnew File(outputPath).mkdirs();\r\n\r\n\t\t\ttry {\r\n\t\t\t\tAcquisMain.run(Config.get().acquisInputDirectory, outputPath\r\n\t\t\t\t\t\t+ parsedFileName, outputPath + normalizedFileName,\r\n\t\t\t\t\t\tlanguage);\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// // build acquis\r\n\t\t// outputDirectory = Config.get().outputDirectory + \"acquis/\";\r\n\t\t// parsedFileName = \"parsed.txt\";\r\n\t\t// normalizedFileName = \"normalized.txt\";\r\n\t\t// String[] languages = Config.get().acquisLanguages.split(\",\");\r\n\t\t// new File(outputDirectory).mkdirs();\r\n\t\t//\r\n\t\t// for (String language : languages) {\r\n\t\t// String outputPath = outputDirectory + language + \"/\";\r\n\t\t// new File(outputPath).mkdirs();\r\n\t\t//\r\n\t\t// try {\r\n\t\t// AcquisMain.run(Config.get().acquisInputDirectory,\r\n\t\t// outputPath + parsedFileName, outputPath\r\n\t\t// + normalizedFileName, language);\r\n\t\t// } catch (IOException e) {\r\n\t\t// e.printStackTrace();\r\n\t\t// }\r\n\t\t// }\r\n\r\n\t\t// // build enron\r\n\t\t// outputDirectory = Config.get().outputDirectory + \"enron/en/\";\r\n\t\t// parsedFileName = \"parsed.txt\";\r\n\t\t// normalizedFileName = \"normalized.txt\";\r\n\t\t// new File(outputDirectory).mkdirs();\r\n\t\t//\r\n\t\t// try {\r\n\t\t// EnronMain.run(Config.get().enronInputDirectory, outputDirectory\r\n\t\t// + parsedFileName, outputDirectory + normalizedFileName);\r\n\t\t// } catch (IOException e) {\r\n\t\t// e.printStackTrace();\r\n\t\t// }\r\n\t\t//\r\n\t\t// // build reuters\r\n\t\t// outputDirectory = Config.get().outputDirectory + \"reuters/en/\";\r\n\t\t// parsedFileName = \"parsed.txt\";\r\n\t\t// normalizedFileName = \"normalized.txt\";\r\n\t\t// new File(outputDirectory).mkdirs();\r\n\t\t//\r\n\t\t// try {\r\n\t\t// ReutersMain.run(Config.get().reutersInputDirectory,\r\n\t\t// outputDirectory + parsedFileName, outputDirectory\r\n\t\t// + normalizedFileName);\r\n\t\t// } catch (IOException e) {\r\n\t\t// e.printStackTrace();\r\n\t\t// }\r\n\t}", "public static void main(String[] args) throws IOException {\n \n // set parameter set list\n ParameterSetListMaker maker = new ParameterSetListMaker(DefaultParameterRecipes.getDEFAULT_PARAMETER_RECIPES());\n List<ParameterSet> psList = maker.getParameterSetList();\n \n //Get sequenceDNA a singleton chromsomome II currently\n Path p1 = Paths.get(ParameterSet.FA_SEQ_FILE);\n seq = new SequenceDNA(p1, new SeqInterval(ParameterSet.SEQUENCE_START, ParameterSet.SEQUENCE_END));\n \n //Get PUExpt chromosome II - a singleton\n Path p = Paths.get(ParameterSet.BIN_COUNT_FILE);\n pu = new PuExperiment(p, new SeqBin(ParameterSet.PU_BIN_SIZE,0)); //the pu experiment under study - also sets bin size for analysis\n \n //Get genbank annotation file of chromosome II - a singleton\n Path p2 = Paths.get(ParameterSet.CHROMOSOME_II_GENBANK);\n annotation = new SequenceDNAAnnotationGenbank(p2);\n \n //get transcript list - a singleton\n transcriptList = annotation.getTranscriptsByType(type-> type == Transcript.TRANSCRIPT_TYPE.MRNA || type == Transcript.TRANSCRIPT_TYPE.SNRNA ||\n type == Transcript.TRANSCRIPT_TYPE.RRNA || type == Transcript.TRANSCRIPT_TYPE.SNORNA || type == Transcript.TRANSCRIPT_TYPE.TRNA);\n \n //get Rif1 list\n Path rif1p = Paths.get(ParameterSet.RIF1_INTERVAL_FILE);\n rif1List = new Rif1Sites(rif1p).getRif1IntervalList();\n \n \n //RUN PARAMETER SETS FOR DYNAMIC SIMULATION\n \n //Iterate over all parameter sets\n for (ParameterSet paramSet : psList) { \n\n //Create probability distribution based on transcript exclusion and AT content\n probDistribution = new ProbabilityDistribution2(seq.atFunction(paramSet.getInitiatorSiteLength()), paramSet, \n annotation.getTranscriptBlocks(transcriptList));\n\n //Replicate molecules\n population = new ReplicatingMoleculePopulation(probDistribution, paramSet, rif1List);\n\n //Create new model comparator to compare pu data with predicted right fork frequency distribution from population of replicating molecules\n modelComparator = new AtModelComparator(pu, ParameterSet.SEQUENCE_START / ParameterSet.PU_BIN_SIZE, population.getPopulationAveRtForkFreqInBins());\n \n //print list of interTranscripts with probabilities\n /*System.out.println(\"index\\tstart\\tend\\tAT Content\\tRif1 index\\tprob\"); \n InterTranscriptSites sites = new InterTranscriptSites(seq, annotation.getTranscriptBlocks(transcriptList), rif1List, probDistribution);\n sites.getInterTranscriptList().forEach(System.out::println);\n System.out.println(\"\");*/\n\n switch (task) {\n case PRINT_PARAMETER_SET:\n System.out.println(paramSet); \n break;\n case PRINT_SEQUENCE:\n System.out.println(seq.intervalToString(new SeqInterval(0, seq.getLength() - 1)));\n break;\n case PRINT_CDF:\n System.out.println(paramSet); \n System.out.println(\"MIDPOINT\\tCDF\");\n probDistribution.printCDf(ParameterSet.PU_BIN_SIZE);\n break;\n case PRINT_MEAN_SQUARED_DEVIATION_RIGHT_FORK_FREQUENCY:\n System.out.println(\"MSD\\tNumPreRCs\\tExpConst\\tAttenuator\\tInitLength\\tMaxRate\\tStdDevPredicted\\tStdDevObserved\");\n System.out.println(modelComparator.getMeanSquaredDifference() + \"\\t\" + paramSet.getNumberInitiators() + \"\\t\" + paramSet.getExponentialPowerFactor() + \"\\t\" + \n paramSet.getAttenuationFactor() + \"\\t\" + paramSet.getInitiatorSiteLength() \n + \"\\t\" + paramSet.getMaxFiringProbabilityPerMin() + \"\\t\" + modelComparator.getPredictedStdDeviation() + \"\\t\" + modelComparator.getObservedStdDeviation());\n break;\n case PRINT_PREDICTED_AND_OBSERVED_RIGHT_FORK_FREQUENCIES:\n printPredictedAndObservedRtForkFrequencies(paramSet);\n break;\n case PRINT_INITIATION_FREQUENCIES:\n printInitiationFrequencies(paramSet);\n break;\n case PRINT_TERMINATION_FREQUENCIES:\n printTerminationFrequencies(paramSet);\n break;\n case PRINT_MEDIAN_REPLICATION_TIMES_FOR_BINS_IN_GENOME:\n System.out.println(paramSet);\n System.out.println(\"Position\\tMedianTime\");\n List<Double> replicationTimes = population.getPopulationMedianTimeOfReplicationInBins(ParameterSet.PU_BIN_SIZE, ParameterSet.NUMBER_BINS);\n for (int i = 0; i < replicationTimes.size(); i++) {\n System.out.println(i * ParameterSet.PU_BIN_SIZE + ParameterSet.PU_BIN_SIZE / 2 + \"\\t\" + replicationTimes.get(i));\n }\n break;\n case PRINT_SPHASE_DURATION_FOR_MOLECULES_IN_POPULATION:\n System.out.println(paramSet);\n population.getElapsedTimeList().stream().forEach(f-> System.out.println(f));\n break;\n case PRINT_FRACTION_REPLICATED_OF_BINS_AT_GIVEN_TIME:\n System.out.println(paramSet);\n System.out.println(\"ELAPSED TIME: \" + timeOfReplication + \" min\");\n System.out.println(\"Position\\tFxReplicated\");\n List<Double> fxReplicated = population.getPopulationAveFxReplicatedInBins(timeOfReplication, ParameterSet.PU_BIN_SIZE, ParameterSet.NUMBER_BINS, paramSet.getMinPerCycle());\n for (int i = 0; i < fxReplicated.size(); i++) {\n System.out.println(i * ParameterSet.PU_BIN_SIZE + ParameterSet.PU_BIN_SIZE / 2 + \"\\t\" + fxReplicated.get(i));\n }\n break;\n case PRINT_REPLICATION_TIME_OF_BIN_FOR_MOLECULES_IN_POPULATION:\n System.out.println(paramSet);\n System.out.println(\"BIN NUMBER: \" + binNumber);\n for (int i = 0; i < paramSet.getNumberCells(); i++) {\n System.out.println(population.getPopulationTimesOfReplicationOfBin(binNumber)[i]);\n }\n break;\n case PRINT_RF_DELTA_LIST:\n PrintDeltaAtContentAndNumberTranscribedPositionsOfBins();\n }\n } \n }", "public static void main(String[] args) throws FileNotFoundException, IOException, InterruptedException {\n ArrayList<Metric> metrics = new ArrayList<Metric>();\n metrics.add(new ELOC());\n metrics.add(new NOPA());\n metrics.add(new NMNOPARAM());\n MyClassifier c1 = new MyClassifier(\"Logistic Regression\");\n c1.setClassifier(new Logistic());\n String type = \"CodeSmellDetection\";\n String smell = \"Large Class\";\n Model model = new Model(\"antModel1\", \"ant\", \"https://github.com/apache/ant.git\", metrics, c1, \"\", type, smell);\n Process process = new Process();\n String periodLength = \"All\";\n String version = \"rel/1.8.3\";\n \n String projectName = model.getProjName();\n process.initGitRepositoryFromFile(scatteringFolderPath + \"/\" + projectName\n + \"/gitRepository.data\");\n try {\n DeveloperTreeManager.calculateDeveloperTrees(process.getGitRepository()\n .getCommits(), periodLength);\n DeveloperFITreeManager.calculateDeveloperTrees(process.getGitRepository()\n .getCommits(), periodLength);\n } catch (Exception ex) {\n Logger.getLogger(TestFile.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n List<Commit> commits = process.getGitRepository().getCommits();\n PeriodManager.calculatePeriods(commits, periodLength);\n List<Period> periods = PeriodManager.getList();\n \n String dirPath = Config.baseDir + projectName + \"/models/\" + model.getName();\n Files.createDirectories(Paths.get(dirPath));\n \n for (Period p : periods) {\n File periodData = new File(dirPath + \"/predictors.csv\");\n PrintWriter pw1 = new PrintWriter(periodData);\n \n String message1 = \"nome,\";\n for(Metric m : metrics) {\n message1 += m.getNome() + \",\";\n }\n message1 += \"isSmell\\n\";\n pw1.write(message1);\n \n //String baseSmellPatch = \"C:/ProgettoTirocinio/dataset/apache-ant-data/apache_1.8.3/Validated\";\n CalculateSmellFiles cs = new CalculateSmellFiles(model.getProjName(), \"Large Class\", \"1.8.1\");\n \n List<FileBean> smellClasses = cs.getSmellClasses();\n \n String projectPath = baseFolderPath + projectName;\n \n Git.gitReset(new File(projectPath));\n Git.clean(new File(projectPath));\n \n List<FileBean> repoFiles = Git.gitList(new File(projectPath), version);\n System.out.println(\"Repo size: \"+repoFiles.size());\n \n \n for (FileBean file : repoFiles) {\n \n if (file.getPath().contains(\".java\")) {\n File workTreeFile = new File(projectPath + \"/\" + file.getPath());\n\n ClassBean classBean = null;\n \n if (workTreeFile.exists()) {\n ArrayList<ClassBean> code = new ArrayList<>();\n ArrayList<ClassBean> classes = ReadSourceCode.readSourceCode(workTreeFile, code);\n \n String body = file.getPath() + \",\";\n if (classes.size() > 0) {\n classBean = classes.get(0);\n\n }\n for(Metric m : metrics) {\n try{\n body += m.getValue(classBean, classes, null, null, null, null) + \",\";\n } catch(NullPointerException e) {\n body += \"0.0,\";\n }\n }\n \n //isSmell\n boolean isSmell = false;\n for(FileBean sm : smellClasses) {\n if(file.getPath().contains(sm.getPath())) {\n System.out.println(\"ok\");\n isSmell = true;\n break;\n }\n }\n \n body = body + isSmell + \"\\n\";\n pw1.write(body); \n }\n }\n }\n Git.gitReset(new File(projectPath));\n pw1.flush();\n }\n \n WekaEvaluator we1 = new WekaEvaluator(baseFolderPath, projectName, new Logistic(), \"Logistic Regression\", model.getName());\n \n ArrayList<Model> models = new ArrayList<Model>();\n \n models.add(model);\n System.out.println(models);\n //create a project\n Project p1 = new Project(\"https://github.com/apache/ant.git\");\n p1.setModels(models);\n p1.setName(\"ant\");\n p1.setVersion(version);\n \n ArrayList<Project> projects;\n //projects.add(p1);\n \n //create a file\n// try {\n// File f = new File(Config.baseDir + \"projects.txt\");\n// FileOutputStream fileOut;\n// if(f.exists()){\n// projects = ProjectHandler.getAllProjects(); \n// Files.delete(Paths.get(Config.baseDir + \"projects.txt\"));\n// //fileOut = new FileOutputStream(f, true);\n// } else {\n// projects = new ArrayList<Project>();\n// Files.createFile(Paths.get(Config.baseDir + \"projects.txt\"));\n// }\n// fileOut = new FileOutputStream(f);\n// projects.add(p1);\n// ObjectOutputStream out = new ObjectOutputStream(fileOut);\n// out.writeObject(projects);\n// out.close();\n// fileOut.close();\n//\n// } catch (FileNotFoundException e) {\n// e.printStackTrace();\n// } catch (IOException e) {\n// e.printStackTrace();\n// }\n// ProjectHandler.setCurrentProject(p1);\n// Project curr = ProjectHandler.getCurrentProject();\n// System.out.println(curr.getGitURL()+\" --- \"+curr.getModels());\n// ArrayList<Project> projectest = ProjectHandler.getAllProjects();\n// for(Project testp : projectest){\n// System.out.println(testp.getModels());\n// }\n }", "public static void main(String[] args) throws JsonGenerationException, JsonMappingException, IOException{\n\t\tDictionary root = new Dictionary();\n\t\tparse Parse = new parse();\n long begin = System.currentTimeMillis();\n //String fileName = args[0];\n //String examine = args[1];\n Parse.parseFILE(\"word_tagged.txt\", root);\n long end = System.currentTimeMillis();\n System.out.println(\"insertion time elapse: \" + (double)(end-begin)/1000);\n \n \n /***********************Read data from phrase check dataset**************************/\n \n\t\tBigram n = new Bigram(Parse.parseFILE(\"Grammar.txt\"));\n\t n.train();\n\t ObjectMapper phrase = new ObjectMapper();\n\t String PhraseJson = phrase.writeValueAsString(n);\n\t phrase.writeValue(new File(\"Phrase.json\"), n);\n\t \n\t /***********************Read data from grammar rule dataset**************************/\n\t BuildRule rule = new BuildRule(Parse.parseFILE(\"Grammar.txt\"), 3, root);\n\t rule.train();\n\t \n\t System.out.println(rule.testing);\n\t ConvertToJson con = new ConvertToJson(rule);\n\t ObjectMapper mapper = new ObjectMapper();\n\t String ruleJson = mapper.writeValueAsString(rule);\n\t\tmapper.writeValue(new File(\"GrammarRule.json\"), rule);\n /***************************Begin to check*************************************/\n\t}", "public static void main(String[] args) {\n\t\tString sourceFile = \"E:\\\\workspace[java][ide]\\\\test\\\\src\\\\a.txt\";\n\t\tString targetFile = \"E:\\\\workspace[java][ide]\\\\test\\\\src\\\\b.txt\";\n\t\t//copy01(sourceFile, targetFile);\n\t\tString dst = \"E:\\\\workspace[java][ide]\\\\test\\\\src\\\\c.txt\";\n\t\tcopyFile(targetFile, dst);\n\t\t\n\t\t\n\t\tappendChars(dst, \"姚丹\");\n\t}", "public static void main(String[] args) throws Exception {\n\n\t\tDecimalFormat df = new DecimalFormat();\n\t\tdf.setMinimumFractionDigits(2);\n\t\tdf.setMaximumFractionDigits(2);\n\t\t\n\t\tlong startTime = new Date().getTime();\n\n\t\tCityGMLConverterConf conf;\n\n\t\tif (args.length == 1) {\n\t\t\tconf = new CityGMLConverterConf(args[0]);\n\t\t} else {\n\t\t\tconf = new CityGMLConverterConf();\n\t\t}\n\n\t\tconf.outputConf();\n\n\t\t// create new urban configuration\n\t\tUrbanCLMConfiguration uclm = new UrbanCLMConfiguration(conf.pollat,\n\t\t\t\tconf.pollon, conf.dlat, conf.dlon, conf.startlat_tot,\n\t\t\t\tconf.startlon_tot, conf.ie_tot, conf.je_tot, conf.n_uclass,\n\t\t\t\tconf.angle_udir, conf.ke_uhl, conf.hhl_uhl);\n\n\t\tPJ sourcePJ = new PJ(conf.proj4code);\n\t\tPJ targetPJ = new PJ(\"+init=epsg:4326 +latlong\");\n\n\t\t// set up citygml4j context\n\t\tCityGMLContext ctx = CityGMLContext.getInstance();\n\t\tCityGMLBuilder builder = ctx.createCityGMLBuilder();\n\t\tCityGMLInputFactory in = builder.createCityGMLInputFactory();\n\n\t\tList<Path> paths = new ArrayList<>();\n\t\tPath folder = Path.of(conf.inputGMLFolder);\n\t\tif (Files.isDirectory(folder)) {\n\t\t\tFiles.walk(Paths.get(conf.inputGMLFolder))\n\t\t\t\t\t.filter((p) -> p.toFile().getAbsolutePath().toLowerCase().endsWith(\"gml\")\n\t\t\t\t\t\t\t|| p.toFile().getAbsolutePath().toLowerCase().endsWith(\"xml\"))\n\t\t\t\t\t.forEach((p) -> paths.add(p));\n\t\t\tif (paths.isEmpty()) {\n\t\t\t\tSystem.err.println(\"No gml or xml files in \" + conf.inputGMLFolder + \" found\");\n\t\t\t\tSystem.err.println(\"Stopping now\");\n\t\t\t\tSystem.exit(10);\n\t\t\t}\n\t\t} else {\n\t\t\tpaths.add(folder);\n\t\t}\n\t\t\n\t\tCityGMLConverterStats stats = new CityGMLConverterStats(conf);\n\n\t\treadImpSurfaceFile(conf, uclm);\n\n\t\t// lock for parallel execution\n\t\tLock lock = new ReentrantLock();\n\t\t\n\t\tCityGMLConverterData cgml = new CityGMLConverterData(uclm, conf, sourcePJ, targetPJ, stats, df, lock);\n\t\tSystem.out.println(\"Reading files\");\n\n\t\tint pathsLengthLength = (int)(Math.log10(paths.size())+1);\n\t\t// here loop over citygmlfiles\n\t\tfor (int i = 0; i < paths.size(); i++) {\n\n\t\t\tPath file = paths.get(i);\n\n\t\t\tSystem.out.println(\" File \" + String.format(\"%\" + pathsLengthLength + \"d\",i + 1) + \"/\"\n\t\t\t\t\t+ paths.size() + \": \" + file);\n\n\t\t\tCityGMLReader reader = in.createCityGMLReader(file.toFile());\n\t\t\twhile (reader.hasNext()) {\n\t\t\t\tCityGML citygml;\n\t\t\t\t// try to read feature and skip if failed\n\t\t\t\ttry{\n\t\t\t\t\tcitygml = reader.nextFeature();\n\t\t\t\t} catch ( CityGMLReadException e ) {\n\t\t\t\t\tstats.addReadError(file.toString());;\n\t\t\t\t\tSystem.err.println(\"Cannot read \" + file);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (citygml.getCityGMLClass() == CityGMLClass.CITY_MODEL) {\n\t\t\t\t\tCityModel cityModel = (CityModel)citygml;\n\n\t\t\t\t\tcgml.addBuildings(cityModel);\n\t\t\t\t\t// everything that is need is now in cgmlct, rest can be deleted\n\t\t\t\t\tcityModel = null;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treader.close();\n\t\t}\n\t\t\n\t\tint nChunks;\n\t\tint nThreadsLocal;\n\t\tint nBuildingsPerThreadLocal;\n\t\tif (conf.nThreads == 1) {\n\t\t\tnChunks = 1;\n\t\t\tnThreadsLocal = 1;\n\t\t\tnBuildingsPerThreadLocal = cgml.buildings.size();\n\t\t\tSystem.out.println(\"Visibility calculation using 1 thread\");\n\t\t} else {\n\t\t\t// round up of division cgml.buildings.size() / conf.nBuildingsPerThread\n\t\t\tnChunks = (cgml.buildings.size() + conf.nBuildingsPerThread - 1) / conf.nBuildingsPerThread;\n\t\t\tnThreadsLocal = Math.min(conf.nThreads, nChunks);\n\t\t\tnBuildingsPerThreadLocal = conf.nBuildingsPerThread;\n\t\t\tSystem.out.println(\"Splitting visibility calculation in \" + \n\t\t\t\t\tnChunks + \" chunk(s) with \" + nBuildingsPerThreadLocal + \" buildings each, using \" + \n\t\t\t\t\tnThreadsLocal + \" thread(s)\");\n\t\t}\n\n\t\tExecutorService exec = Executors.newFixedThreadPool(nThreadsLocal);\n\t\t\n\t\tfor (int indexChunk = 0; indexChunk < nChunks; indexChunk++) {\n\t\t\texec.execute(new CityGMLVisibilityRunnable(cgml, indexChunk * conf.nBuildingsPerThread,\n\t\t\t\t\tMath.min((indexChunk + 1) * nBuildingsPerThreadLocal, cgml.buildings.size()), indexChunk,\n\t\t\t\t\tnChunks, conf));\n\t\t}\n\t\t\t\t\n\t\texec.shutdown();\n\t\texec.awaitTermination(Long.MAX_VALUE, TimeUnit.MILLISECONDS);\n\t\t\n\t\tif (!conf.saveMemory) cgml.calcStreetProperties();\n\t\t\n\t\tSystem.out.println(\"Largest Building: \" + df.format(Collections.max(stats.getBuildingHeights())) + \" m\");\n\t\tSystem.out.println(\"Smallest Building: \" + df.format(Collections.min(stats.getBuildingHeights())) + \" m\");\n\n\t\tuclm.fakeUrbanClassFrac();\n\t\tuclm.normBuildingFrac();\n\t\tuclm.normBuildProbAndCalcStreetFraction();\n\t\tuclm.normStreetWidth();\n\t\tuclm.calculateBuildingWidth();\n\t\tif (conf.consistentOutput) {\n\t\t\tuclm.defineMissingData(conf.frUrbLimit);\n\t\t}\n\t\t\n\t\tlong lasted = new Date().getTime() - startTime;\n\t\tSystem.out.printf(\"Urban parameter calculation took %.1f minutes%n\",\n\t\t\t\tlasted / 1000. / 60.);\n\t\t\n\t\tSystem.out.println(\"Creating output\");\n\t\t// text logs\n\t\tstats.writeLogs();\n\t\t\n\t\t// building statistics\n\t\tNetcdfFileWriter ncfile = NetcdfFileWriter.createNew(NetcdfFileWriter.Version.netcdf3, conf.statsFile);\n\t\tstats.toNetCDFfile(ncfile);\n\t\tncfile.close();\n\t\t\n\t\t// main output\n\t\tncfile = NetcdfFileWriter.createNew(NetcdfFileWriter.Version.netcdf3, conf.outputFile);\n\t\t// Add additional parameters to NetCDF file.\n\t\tDateFormatter dfDate = new DateFormatter();\n\t\tncfile.addGroupAttribute(null, new Attribute(\"creation_date\", dfDate.toDateTimeString(new Date())));\n\t\tconf.toNetCDFfile(ncfile);\n\t\tuclm.toNetCDFfile(ncfile);\n\t\tncfile.close();\n\n\t\tSystem.out.println(\"Finished\");\n\t}", "public static void main(String[] args) {\n\n\t\tScanner reader = new Scanner(System.in); // Reading from System.in\n\t\tSystem.out.println(\"Enter sequence1 : \");\n\t\tString seq1 = reader.nextLine(); // Scans the next token of the input as an string.\n\t\t\n\t\tScanner reader2 = new Scanner(System.in); // Reading from System.in\n\t\tSystem.out.println(\"Enter sequence2 : \");\n\t\tString seq2 = reader2.nextLine(); // Scans the next token of the input as an string.\n\n\t\tScanner reader3 = new Scanner(System.in); // Reading from System.in\n\t\tSystem.out.println(\"Enter a number: \");\n\t\tint maxgap = reader3.nextInt(); // Scans the next token of the input as an int.\n\n\t\t//System.out.println(seq1);\n\t\t//System.out.println(seq2);\n\t\t\n\t\tNWAlgorithm.testNWAlignment(seq1,seq2,maxgap);\n\t}", "public static void main(String[] args) throws Exception {\n\n CharStream input = CharStreams.fromFileName(\"source.txt\");\n GrammarLexer textLexer = new GrammarLexer(input);\n Token token;\n while ((token = textLexer.nextToken()).getType() != GrammarLexer.EOF) {\n System.out.printf(\"Line: %d, column: %d, lexeme: '%s', code: %d, token: %s.\\n\", token.getLine(),\n token.getCharPositionInLine() + 1, token.getText(), token.getType(),\n textLexer.getVocabulary().getDisplayName(token.getType()));\n }\n\n System.out.println(\"Traza lexer finalizada\");\n }", "public static void main(String[] args)throws IOException {\r\n\t\t\r\n\t\t String inputFolder = \"C:/Users/Nekromantik/Desktop/321\";\r\n\t\t String inputfile = \"C:/Users/Nekromantik/Desktop/222/disagreements.txt\";\r\n\t\t \r\n\t\t String outputfile = \"C:/Users/Nekromantik/Desktop/222/result.txt\";\r\n\t\t \r\n\t\t Eva_help2 test = new Eva_help2();\r\n\t\t test.generate(inputfile, inputFolder, outputfile);\r\n\t\t\r\n\t}", "public static void main(String[] args) {\n\t\tNormalize normal = new Normalize(2001, 2016, 1, 11);\r\n\t\t// normal.newsnum_daily2monthly(\"C:/Users/install/Desktop/hxs/bbc/bbcdata/newsnum.txt\",\r\n\t\t// \"C:/Users/install/Desktop/hxs/bbc/bbcdata/newsmonth.txt\");\r\n\t\t// normal.readmontlynums(\"C:/Users/install/Desktop/hxs/bbc/bbcdata/newsmonth.txt\");\r\n\t\t normal.dir2monthly(\"C:/Users/install/Desktop/hxs/test/FOX/tops/top238.txt\",\r\n\t\t \"C:/Users/install/Desktop/hxs/test/FOX/allfrq/\",\r\n\t\t \"C:/Users/install/Desktop/hxs/test/FOX/tops/\");\r\n//\t\tnormal.getmatrixfromfils(\"C:/Users/install/Desktop/hxs/bbc/MeSH/top120.txt\",\r\n//\t\t\t\t\"C:/Users/install/Desktop/hxs/bbc/bbcdata/topfrqswithspace/\");\r\n//\t\tnormal.normal(\"C:/Users/install/Desktop/hxs/bbc/bbcdata/newsmonth.txt\");\r\n\t}", "public static void main(String[] args) throws IOException {\n\t\tString FinalContigWritePath = args[0];\n\t\tString ContigAfterPath = args[1];\n\t\tString DataName = args[2];\n\t\tString RealString = CommonClass.readContigFile(ContigAfterPath);\n\t\t//Write.\n\t\tFileWriter writer1 = new FileWriter(FinalContigWritePath + \"contig.\" + DataName + \".changgeLines.fa\", true);\n\t\twriter1.write(RealString);\n\t\twriter1.close();\n\t\tSystem.out.println(\"File write process end!\");\n\t}", "public static boolean convertOneFileToModalMultipleSemantics(Path inPath, Path outPath, Path inDot, Path outDot, String dotBin, String[] semantics, TransformationParameter... params) throws IOException, ParseException, AnalysisException, TransformationException {\n if (semantics == null) return convertModal(inPath,outPath,inDot,outDot,dotBin,null, params);\n else{\n boolean success = true;\n int semNameNumber = 0;\n Set<String> semNames = new HashSet<>();\n for (String sem : semantics){\n\n // ensure every semantics name is unique\n semNameNumber++;\n String semName = SemanticsGenerator.thfName(sem);\n if (semName.equals(\"\") || semNames.contains(semName)) semName += semNameNumber;\n semNames.add(semName);\n\n log.info(\"Converting with semantics \" + semName + \" file \" + inPath.toString());\n String outproblem = outPath.toString();\n if (outproblem.endsWith(\".p\")) outproblem = outproblem.substring(0,outproblem.lastIndexOf(\".p\"));\n\n // only one semantic - leave out semantics name\n Path t_outPath = Paths.get(outproblem + \".p\");\n Path t_inDot = null;\n Path t_outDot = null;\n if (inDot != null) t_inDot = Paths.get(outproblem + \".in.dot\");\n if (outDot != null) t_outDot = Paths.get(outproblem + \".out.dot\");\n\n // multiple semantics - add semantics name\n if (semantics.length != 1) {\n t_outPath = Paths.get(outproblem + \"-\" + semName + \".p\");\n t_inDot = null;\n t_outDot = null;\n if (inDot != null) t_inDot = Paths.get(outproblem + \"-\" + semName + \".in.dot\");\n if (outDot != null) t_outDot = Paths.get(outproblem + \"-\" + semName + \".out.dot\");\n }\n success &= convertModal(inPath,t_outPath,t_inDot,t_outDot,dotBin,sem, params);\n }\n return success;\n }\n }", "public static void main(String[] args) throws IOException {\n\t\t\n\t\tFileManager csv=new FileManager();\n\t\t\n\t\tcsv.readListOfFiles();\n\t\tcsv.readFile();\n\t\t\n\t\t//csv.tk.displayTokens();\n\t\t//csv.it.displayHashMap();\n\t\tcsv.writeTokensToFile(csv.tk.tokensMap);\n\t\tcsv.matcher.longestSequence(csv.it);\t//csv.it.intTokenList was supposed to be passed but since I need csv.it object in caller so im passing it\n\t\tcsv.matcher.displaySubsequences(csv.it);\n\t\tcsv.writeMatchesToFile(csv.matcher.resultMap,csv.it);\n\t System.out.println(\"\\nProgram Ends \");\n\t \t \n\t}", "public static void main(String[] args) {\n\r\n\t\ttry{\r\n\t\t\tString tac2008Path = \"C:/Users/jipeng/Desktop/Qiang/updateSum/TAC2008_Update_Summarization_Documents/UpdateSumm08_test_docs_files\";\r\n\t\t\tExtractPrag ep = new ExtractPrag();\r\n\t\t\t\r\n\t\t\t//String wordPath = \"\";\r\n\t\t\t//ep.extractWords(wordPath)\r\n\t\t\tep.allDataset(tac2008Path);\r\n\t\t\t\r\n\t\t}catch(Exception e)\r\n\t\t{\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public static void main(String[] args) \n\t{\n\t\t// Konfiguration\n\t\tTraining training = new Training();\n\t\tint numberOfAttributes = 18;\n\t\tStatisticOutput statisticWriter = new StatisticOutput(\"data/statistics.txt\");\n\t\t\n\t\ttraining.printMessage(\"*** TCR-Predictor: Training ***\");\n\t\t\n\t\ttraining.printMessage(\"Datenbank von Aminosäure-Codierungen wird eingelesen\");\n\t\t// Lies die EncodingDB ein\n\t\tAAEncodingFileReader aa = new AAEncodingFileReader();\n\t\tAAEncodingDatabase db = aa.readAAEncodings(\"data/AAEncodings.txt\");\n\t\ttraining.printMessage(\"Es wurden \" + db.getEncodingDatabase().size() + \" Codierungen einglesen\");\n\t\t\n\t\ttraining.printMessage(\"Trainingsdatensatz wird eingelesen und prozessiert\");\n\t\t// Lies zunächst die gesamten Trainingsdaten ein\n\t\tExampleReader exampleReader = new ExampleReader();\n\t\t\n\t\t// Spalte das Datenset\n\t\tDataSplit dataSplit_positives = new DataSplit(exampleReader.getSequnces(\"data/positive.txt\"), 5);\n\t\tArrayList<ArrayList<String>> complete_list_positiv = dataSplit_positives.getDataSet();\n\t\t\n\t\tDataSplit dataSplit_negatives = new DataSplit(exampleReader.getSequnces(\"data/negative.txt\"), 5);\n\t\tArrayList<ArrayList<String>> complete_list_negativ = dataSplit_negatives.getDataSet();\n\t\t\n\t\t// Lege Listen für die besten Klassifizierer und deren Evaluation an\n\t\tModelCollection modelCollection = new ModelCollection();\n\t\t\n\t\t/*\n\t\t * \n\t\t * Beginne Feature Selection\n\t\t * \n\t\t */\n\t\tArrayList<String> positivesForFeatureSelection = training.concatenateLists(complete_list_positiv);\n\t\tArrayList<String> negativesForFeatureSelection = training.concatenateLists(complete_list_negativ);\n\t\t\n\t\ttraining.printMessage(\"Convertiere Daten ins Weka ARFF Format\");\t\t\n\t\t// Convertiere Daten in Wekas File Format\n\t\tARFFFileGenerator arff = new ARFFFileGenerator();\n\t\tInstances dataSet = arff.createARFFFile(positivesForFeatureSelection, negativesForFeatureSelection, db.getEncodingDatabase());\n\t\tdataSet.setClass(dataSet.attribute(\"activator\"));\t\t\t// Lege das nominale Attribut fest, wonach klassifiziert wird\n\t\tdataSet.deleteStringAttributes(); \t\t\t\t\t\t\t// Entferne String-Attribute\n\t\t\n\t\ttraining.printMessage(\"Führe Feature Selection (Filtering) aus\");\n\t\t// Beginne Feature Selection\n\t\tFeatureFilter featureFilter = new FeatureFilter();\n\t\tfeatureFilter.rankFeatures(dataSet, numberOfAttributes);\t\t\t\t\t// Wähle die x wichtigsten Features aus\n\t\tdataSet = featureFilter.getProcessedInstances();\n\t\ttraining.printMessage(\"Ausgewählte Features: \" + featureFilter.getTopResults());\n\n\t\t/*\n\t\t * Führe die äußere Evaluierung fünfmal durch und wähle das beste Modell\n\t\t */\n\t\tfor (int outer_run = 0; outer_run < 5; outer_run++)\n\t\t{\n\t\t\tstatisticWriter.writeString(\"===== Äußere Evaluation \" + (outer_run + 1) + \"/5 =====\\n\\n\");\n\t\t\t\n\t\t\t\n\t\t\tArrayList<ArrayList<String>> list_positives = new ArrayList<ArrayList<String>>();\n\t\t\tlist_positives.addAll(complete_list_positiv);\n\t\t\t\n\t\t\tArrayList<ArrayList<String>> list_negatives = new ArrayList<ArrayList<String>>();\n\t\t\tlist_negatives.addAll(complete_list_negativ);\n\t\t\t\n\t\t\t// Lege das erste Fragment beider Listen für nasted-Crossvalidation beiseite\n\t\t\tArrayList<String> outer_List_pos = new ArrayList<String>();\n\t\t\touter_List_pos.addAll(list_positives.get(outer_run));\n\t\t\tlist_positives.remove(outer_run);\n\t\t\t\n\t\t\tArrayList<String> outer_List_neg = new ArrayList<String>();\n\t\t\touter_List_neg.addAll(list_negatives.get(outer_run));\n\t\t\tlist_negatives.remove(outer_run);\n\t\t\t\n\t\t\t// Füge die verbleibende Liste zu einer Zusammen\n\t\t\tArrayList<String> inner_List_pos = training.concatenateLists(list_positives);\n\t\t\tArrayList<String> inner_List_neg = training.concatenateLists(list_negatives);\n\t\t\t\t\n\n\t\t\t/*\n\t\t\t * \n\t\t\t * Ab hier nur noch Arbeiten mit innerer Liste, die Daten zum Evaluieren bekommt Weka vorerst \n\t\t\t * nicht zu sehen!\n\t\t\t * \n\t\t\t */\n\t\t\ttraining.printMessage(\"Convertiere Daten ins Weka ARFF Format\");\t\t\n\t\t\t// Convertiere Daten in Wekas File Format\n\t\t\tarff = new ARFFFileGenerator();\n\t\t\tdataSet = arff.createARFFFile(inner_List_pos, inner_List_neg, db.getEncodingDatabase());\n\t\t\tdataSet.setClass(dataSet.attribute(\"activator\"));\t\t\t// Lege das nominale Attribut fest, wonach klassifiziert wird\n\t\t\tdataSet.deleteStringAttributes(); \t\t\t\t\t\t\t// Entferne String-Attribute\n\t\t\t\n\t\t\tfeatureFilter.processInstances(featureFilter.getRanking(), dataSet, numberOfAttributes); // Filtere das innere Datenset nach Vorgabe\n\t\t\tdataSet = featureFilter.getProcessedInstances();\n\t\t\t\n\t\t\ttraining.printMessage(\"Beginne Gridsearch\");\n\t\t\t// Gridsearch starten\n\t\n\t\t\t\n\t\t\t\n\t\t\tParameterOptimization optimizer = new ParameterOptimization();\n\t\t\tString logFileName = outer_run + \"_\" + numberOfAttributes;\n\t\t\tGridSearch gridSearch = optimizer.performGridSearch(dataSet, logFileName);\n\t\t\ttraining.printMessage(\"Gefundene Parameter [C, gamma]: \" + gridSearch.getValues()); // liefert unter diesen Settings 1.0 und 0.0\n\n\t\t\tSMO sMO = (SMO)gridSearch.getBestClassifier();\n\t\t\t\t\t\t\t\n\t\t\t/*\n\t\t\t * \n\t\t\t * Evaluationsbeginn \n\t\t\t *\n\t\t\t */\n\t\t\ttraining.printMessage(\"Evaluiere die Performance gegen das äußere Datenset\");\n\t\t\ttraining.printMessage(\"Transcodierung des Evaluationsdatensatzes\");\n\t\t\tarff = new ARFFFileGenerator();\n\t\t\tdataSet = arff.createARFFFile(outer_List_pos, outer_List_neg, db.getEncodingDatabase());\n\t\t\tdataSet.setClass(dataSet.attribute(\"activator\"));\t\t\t// Lege das nominale Attribut fest, wonach klassifiziert wird\n\t\t\tdataSet.deleteStringAttributes(); \t\t\t\t\t\t\t// Entferne String-Attribute\n\t\t\t\n\t\t\t// Führe Feature-Filtering mit den Einstellungen der GridSearch aus\n\t\t\ttraining.printMessage(\"Führe Feature Selection (Filtering) auf GridSearch-Basis aus\");\n\t\t\t// Beginne Feature Selection\n\t\t\tfeatureFilter.processInstances(featureFilter.getRanking(), dataSet, numberOfAttributes);\t // Wähle die x wichtigsten Features aus\n\t\t\tdataSet = featureFilter.getProcessedInstances();\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\ttraining.printMessage(\"Ermittle Performance\");\n\t\t\tEvaluator eval = new Evaluator();\n\t\t\teval.classifyDataSet(sMO, dataSet);\n\t\t\ttraining.printMessage(eval.printRawData());\n\t\t\t\n\t\t\t/*\n\t\t\t * Füge das Modell und die externe Evaulation zur Sammlung hinzu\n\t\t\t */\t\t\t\n\t\t\tmodelCollection.bestClassifiers.add(sMO);\n\t\t\tmodelCollection.evalsOfBestClassifiers.add(eval);\n\t\t\tmodelCollection.listOfNumberOfAttributes.add(numberOfAttributes);\n\t\t\tmodelCollection.listOfFeatureFilters.add(featureFilter);\n\t\t\t\n\t\t\tstatisticWriter.writeString(\"Verwendete Attribute: \" + featureFilter.getTopResults());\n\t\t\tstatisticWriter.writeString(eval.printRawData());\n\t\t\t\n\t\t}\n\t\tstatisticWriter.close();\n\t\t\n\t\t// Wähle das beste aller Modelle aus\n\t\ttraining.printMessage(\"Ermittle die allgemein besten Einstellungen\");\n\t\tModelSelection modelSelection = new ModelSelection();\n\t\tmodelSelection.calculateBestModel(modelCollection);\n\t\t\n\t\ttraining.printMessage(\"Das beste Model: \");\n\t\ttraining.printMessage(modelSelection.getBestEvaluator().printRawData());\n\t\tSystem.out.println(\"------ SMO ------\");\n\t\tfor (int i = 0; i < modelSelection.getBestClassifier().getOptions().length; i++)\n\t\t{\n\t\t\tSystem.out.print(modelSelection.getBestClassifier().getOptions()[i] + \" \");\n\t\t}\n\t\tSystem.out.println(\"\\n--- Features ---\");\n\t\tSystem.out.println(modelSelection.getBestListOfFeatures().getTopResults());\n\t\t\n\t\t// Schreibe das Modell in eine Datei\n\t\ttraining.printMessage(\"Das beste Modell wird auf Festplatte geschrieben\");\n\t\ttry\n\t\t{\n\t\t\tSerializationHelper.write(\"data/bestPredictor.model\", modelSelection.getBestClassifier());\n\t\t\tSerializationHelper.write(\"data/ranking.filter\", modelSelection.getBestListOfFeatures().getRanking());\n\t\t\tSerializationHelper.write(\"data/components.i\", (modelSelection.getBestListOfFeatures().getProcessedInstances().numAttributes()-1));\n\t\t}\n\t\tcatch (Exception ex)\n\t\t{\n\t\t\tSystem.err.println(\"Fehler beim Schreiben des Modells auf Festplatte: \" + ex);\n\t\t}\n\t}", "public static void main(String[] args){\n if (args.length != 4){\n System.out.println(\"Please provide a file name, source and destination node and an output file.\");\n System.exit(0);\n }\n\n findShortestRoadMap(args[0], args[1], args[2], args[3]);\n }", "public static void main(String[] args)\r\n\t{\n\t\tacceptConfig();\r\n\t\treadDictionary();\r\n\t\t//Then, it reads the input file and it prints the word (if contained on the file) or the suggestions\r\n\t\t//(if not contained) in the output file. These files are given by command line arguments\r\n\t\tprocessFile(args[0], args[1]);\r\n\t\t\r\n\t}", "public static void main( String[] args ) {\n if ( args .length < 2 ) {\n System .out .println( \"usage: jlink output input1 ... inputN\" );\n System .exit( 1 );\n }\n jlink linker = new jlink();\n linker .setOutfile( args[0] );\n //To maintain compatibility with the command-line version, we will only add files to be merged.\n for ( int i = 1; i < args .length; i++ ) {\n linker .addMergeFile( args[i] );\n }\n try {\n linker .link();\n } catch( Exception ex ) {\n System .err .print( ex .getMessage() );\n }\n }", "public static void main(String[] args) throws Exception, IOException, InterruptedException {\n\n\n\n\t \tString fileNameSRC = \"arffs/\"+\"filename\";\n\t \tFile arffFile1 = new File(fileNameSRC+\".arff\");\n\t \tString fileNameDEST = fileNameSRC+\"_subset.arff\";\n\t \tString authorToRemove =\"className\";\n\t \t\n\t\t\tBufferedReader br = new BufferedReader(new FileReader(arffFile1));\n \t String line;\n \t int counter=0;\n \t while ((line = br.readLine()) != null) {\n \t \tcounter++;\n \t if(!(line.endsWith(authorToRemove))){\n \t \tSystem.out.println(\"line: \"+counter);\n \t \tif(line.length()>10){\n \t \t\t//to check author order\n \t \tSystem.out.println(\"line: \"+line.substring(line.length()-10, line.length()));\n \t \t}\n \t \t//Util.writeFile(line + \"\\n\", fileNameDEST, true);\n \t \t}\t\t\t\n \t if((line.endsWith(authorToRemove))){\n \t \tSystem.out.println(\"found author at line: \"+counter);\n\t }\n\t }\n\t\n \t \n}", "public static void main(String[] args) {\n\n\t\tString docBody = null;\n\t\t\n\t\ttry {\n\t\t\tdocBody = new String(Files.readAllBytes(Paths.get(\"examples/doc1.txt\")), StandardCharsets.UTF_8);\n\t\t} catch (IOException e1) {\n\t\t\tSystem.exit(1);\n\t\t}\n\n\t\tSmartScriptParser parser = null;\n\t\t\n\t\ttry {\n\t\t\tparser = new SmartScriptParser(docBody);\n\t\t} catch (SmartScriptParserException e) {\n\t\t\tSystem.out.println(\"Unable to parse document!\");\n\t\t\tSystem.exit(-1);\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"If this line ever executes, you have failed this class!\");\n\t\t\tSystem.exit(-1);\n\t\t}\n\t\t\n\t\tDocumentNode document = parser.getDocumentNode();\n\t\tString originalDocumentBody = createOriginalDocumentBody(document);\n\t\tSystem.out.println(originalDocumentBody); \n\t\t\n\t\tSystem.out.println(\"==============\");\n\t\t\n\t\tSmartScriptParser parser2 = new SmartScriptParser(originalDocumentBody);\n\t\tDocumentNode document2 = parser2.getDocumentNode();\n\t\tString originalDocumentBody2 = createOriginalDocumentBody(document2);\n\t\tSystem.out.println(originalDocumentBody2);\n\t\t\n\t\tSystem.out.println(\"==============\");\n\t\t\n\t\tSystem.out.println(\"Documents are equal: \" + originalDocumentBody.equals(originalDocumentBody2));\n\n\t}", "public static void main(String[] args) {\n\tFile inputFile = new File(\".//src//inputs.txt\");\n\ttry {\n\tscanner = new Scanner(inputFile);\n\t} catch (FileNotFoundException e) {\n\tSystem.out.println(\"inputs.txt file not found\");\n\te.printStackTrace();\n\t}\n\t// Read Matrices from inputs.txt file\n\tSystem.out.println(\"Reading data from inputs.txt file placed in src directory(package)\");\n\t// Read first matrix\n\t// Read the number of rows\n\tint rows, columns;\n\trows = scanner.nextInt();\n\t// Read the number of columns\n\tcolumns = scanner.nextInt();\n\t// Read first Matrix\n\tint[][] a = readMatrix(rows, columns);\n\t// Read the second matrix\n\trows = scanner.nextInt();\n\t// Read the number of columns\n\tcolumns = scanner.nextInt();\n\t// Read first Matrix\n\tint[][] b = readMatrix(rows, columns);\n\n\t// Read the third matrix\n\trows = scanner.nextInt();\n\t// Read the number of columns\n\tcolumns = scanner.nextInt();\n\t// Read first Matrix\n\tint[][] c = readMatrix(rows, columns);\n\t// Generate a forth matrix with random number generator\n\tint[][] d = generateMatrix(rows, columns);\n\t// Print input Matrices\n\tSystem.out.println();\n\tSystem.out.println(\" ******* Matrix A *******\");\n\tprintMatrix(a);\n\tSystem.out.println();\n\tSystem.out.println(\" ******* Matrix B *******\");\n\tprintMatrix(b);\n\tSystem.out.println();\n\tSystem.out.println(\" ******* Matrix C *******\");\n\tprintMatrix(c);\n\tSystem.out.println();\n\tSystem.out.println(\" ******* Matrix D *******\");\n\tprintMatrix(d);\n\tSystem.out.println();\n\tSystem.out.println(\" ******* Transpose C *******\");\n\tprintMatrix(transpose (c));\n\tSystem.out.println();\n\tSystem.out.println(\" ******** A + B ********\");\n\tprintMatrix(add (a,b));\n\tSystem.out.println();\n\tSystem.out.println(\" ******** A * B ******** \");\n\tprintMatrix(multiply(a,b));\n\tSystem.out.println();\n\tSystem.out.println(\" ******** A - B ******** \");\n\tprintMatrix(subtract(a,b));\n\tSystem.out.println();\n\tSystem.out.println(\" ***** (A + B) - TransposeOf(C) ***** \");\n\tprintMatrix(subtract(add(a,b),transpose(c)));\n\tSystem.out.println();\n\tSystem.out.println(\" ***** ((A + B) - TransposeOf(C)) * A ***** \");\n\tprintMatrix(multiply(subtract(add(a,b),transpose(c)),a));\n\tSystem.out.println();\n\tSystem.out.println(\" ***** (((A + B) - TransposeOf(C)) * A) + D ***** \");\n\tprintMatrix(add(multiply(subtract(add(a,b),transpose(c)),a),d));\n\tSystem.out.println();\n\tSystem.out.println(\"***** Minimum Element in (((A + B) - TransposeOf(C)) * A) + D *****\");\n\tSystem.out.println(\"Minimum Element =\"+minOfElements(add(multiply(subtract(add(a,b),transpose(c)),a),d)));\n\tSystem.out.println();\n\tSystem.out.println(\"***** Sum of Elements in (((A + B) - TransposeOf(C)) * A) + D *****\");\n\tSystem.out.println(\"Sum of elements = \"+sumOfElements(add(multiply(subtract(add(a,b),transpose(c)),a),d)));\n\t}", "public static void main(String[] args) throws IOException {\n\t\tString folderName = \"D:/Postdoc/Data/LTA/\";\n\t\t\n\t\tFolderFiles folderFilesERPRate = new FolderFiles(folderName, Extension.TXT, \"ERPRate\");\n\t\tfolderFilesERPRate.combineFiles(\"_ERPRate.txt\");\n\t\tFolderFiles folderFilesTravelTimeSet = new FolderFiles(folderName, Extension.TXT, \"TravelTimeSet\");\n\t\tfolderFilesTravelTimeSet.combineFiles(\"_TravelTimeSet.txt\");\n\t}", "public static void main(String[] args) throws Exception {\r\n if(args.length != 2){\r\n System.err.println(\"Usage: Inverted <in> <out>\");\r\n System.exit(2);\r\n }\r\n /**\r\n * Load hadoop configuration (Only taking XML files that have a summary tag present)\r\n */\r\n Configuration conf = new Configuration();\r\n conf.set(\"xmlinput.start\", \"<movies>\");\r\n conf.set(\"xmlinput.end\", \"</movies>\");\r\n\r\n //define and submit job\r\n Job job = new Job(conf, \"Movies\");\r\n job.setJarByClass(Inverted.class);\r\n\r\n //define mappers, combiners and reducers\r\n job.setMapperClass(Movies.MoviesMapper.class);\r\n job.setCombinerClass(Movies.MoviesCombiner.class);\r\n job.setReducerClass(Movies.MoviesReducer.class);\r\n\r\n //set input type\r\n job.setInputFormatClass(XMLInputFormat.class);\r\n\r\n //define output type\r\n job.setOutputKeyClass(Text.class);\r\n job.setOutputValueClass(Text.class);\r\n\r\n //set concatenated paths\r\n String paths = new String();\r\n for (int i = 0; i < args.length-1; i++) {\r\n if (i > 0) {\r\n paths += \",\";\r\n }\r\n paths += args[i];\r\n }\r\n\r\n //set input and output\r\n org.apache.hadoop.mapreduce.lib.input.FileInputFormat.addInputPaths(job, paths);\r\n FileOutputFormat.setOutputPath(job, new Path(args[args.length-1]));\r\n\r\n System.exit(job.waitForCompletion(true) ? 0 : 1);\r\n }", "public static void main(String[] args) throws Exception {\n if (args.length > 0) {\n // The last command line arg is the source file name\n String inputFile = args[args.length - 1];\n InputStream is = new FileInputStream(inputFile);\n CharStream input = CharStreams.fromStream(is);\n\n // Create the lexer and parser objects and a token stream \"pipe\" between them\n BantamJavaLexer lexer = new BantamJavaLexer(input);\n CommonTokenStream tokens = new CommonTokenStream(lexer);\n BantamJavaParser parser = new BantamJavaParser(tokens);\n\n // Launch the parser\n // https://github.com/antlr/antlr4/blob/master/doc/listeners.md\n BantamJavaParser.ProgramContext tree = parser.program();\n ParserListener listener = new ParserListener();\n ParseTreeWalker.DEFAULT.walk(listener, tree); // initiate walk of tree with listener in use of default walker\n\n ErrorReporter reporter = new ErrorReporter();\n\n // BantamJavaVisitor semantics = new SemanticAnalyzer(listener.getGlobalScope());\n BantamJavaVisitor semantics1 = new SemanticAnalyzer(reporter);\n semantics1.visit(tree);\n BantamJavaVisitor semantics2 = new SemanticAnalyzer2(reporter);\n semantics2.visit(tree);\n\n // Print the parse tree\n System.out.println(tree.toStringTree(parser)); // print tree as text <label id=\"code.tour.main.7\"/>\n\n if (reporter.getErrorCount() == 0) {\n BantamJavaVisitor codeGen = new CodeGenerator(reporter);\n codeGen.visit(tree);\n }\n }\n else {\n System.err.println(\"ERROR: No source file specified.\");\n }\n }", "public static void main(String[] args) {\n\n\t\tSystem.out.println(\"Inputfile: \");\n\t\tScanner sc = new Scanner(System.in);\n System.out.println(\"Printing the file passed in:\");\n String inputfile = \"\";\n while(sc.hasNextLine()){\n \tinputfile = sc.nextLine();\n \tbreak;\n }\n System.out.println(\"Reading from: \" + inputfile);\n \n try {\n String fromfile = FileUtils.readFileToString( new File(\"C:\\\\Users\\\\fille\\\\Documents\\\\firstobj.obj\"));\n\n\t\tWavefontConverter conv = new WavefontConverter();\n\t\tconv.ToVertics(fromfile);\n\t\tArrayList<float[]>vertics = conv.meshes; \n\t\tArrayList<short[]> indices = conv.indices;\n\t\twriteToBinary(conv.mesh2,conv.by,\"test\");\n\t\treadfile();\n\t//\tToJavaclass(vertics,indices,\"Monkey\");\n\t\t\n }catch(Exception e) {\n \te.printStackTrace();\n }\n\t\t//conv.ToVertics(Files)\n\t}", "public static void main(String[] args){\r\n try {\r\n AnalizadorSintactico asin = new AnalizadorSintactico(\r\n new AnalizadorLexico( new FileReader(args[0])));\r\n Object result = asin.parse().value;\r\n System.out.println(\"\\n*** Resultados finales ***\");\r\n } catch (Exception ex) {\r\n ex.printStackTrace();\r\n }\r\n }", "public static void main(String[] args) {\r\n System.out.println(\"Starting\");\r\n try {\r\n File fastq = new File(\"data/HW4.fastq\");\r\n if (!fastq.exists()) {\r\n System.out.println(\"Can't find input file \" + fastq.getAbsolutePath());\r\n System.exit(1);\r\n }\r\n File fasta = new File(\"data/HW4.fasta\");\r\n FileConverter converter = new FileConverter(fastq, fasta);\r\n converter.convert();\r\n } catch (IOException x) {\r\n System.out.println(x.getMessage());\r\n }\r\n System.out.println(\"Done\");\r\n }", "public static void main(String[] args) {\n\t\tWordNet deneme = new WordNet(\"C:\\\\Users\\\\zzlawlzz\\\\Desktop\\\\synsets.txt\",\n\t\t\t\t\"C:\\\\Users\\\\zzlawlzz\\\\Desktop\\\\hypernyms.txt\");\n\t\tSystem.out.println(deneme.sap(\"arm\", \"leg\"));\n\t\tSystem.out.println(deneme.distance(\"arm\", \"eyes\"));\n\t\tSystem.out.println(deneme.distance(\"eyes\", \"mouth\"));\n\t}", "MafSource readSource(File sourceFile);", "public static void main(String[] args) throws Exception {\n\t\tAttributedReader reader = new AttributedReader();\n\t\tVariabilityModel afm = reader.parseFile(\"input/models/random/100-5-0-0.afm\");\n\t\tChocoReasoner reasoner = new ChocoReasoner();\n\t\tafm.transformTo(reasoner);\n\t\tChocoValidQuestion att= new ChocoValidQuestion();\n\t\treasoner.ask(att);\n\t\tSystem.out.println(att.isValid());\n\t}", "public static void main(String[] args) throws Exception {\n\n ImportCorpus currentRun = new ImportCorpus();\n\n currentRun.initializeOptionsFromCommandLine(args);\n //sentsPerDocument = currentRun.getSentsPerDocument();\n\n if(currentRun.getSerializedCorpusOutputPath() == null && currentRun.getOutputPath() == null) {\n System.out.println(\"Please specify a serialized corpus output file with the -sco flag and/or an XML output file with the -o flag.\");\n System.exit(0);\n }\n\n StoredCorpus corpus = currentRun.doImport(currentRun.getInputPath(), currentRun.getSerializedGazetteerPath(), currentRun.getCorpusFormat(), currentRun.getUseGoldToponyms(), currentRun.getSentsPerDocument());\n \n if(currentRun.getSerializedCorpusOutputPath() != null)\n currentRun.serialize(corpus, currentRun.getSerializedCorpusOutputPath());\n if(currentRun.getOutputPath() != null)\n currentRun.writeToXML(corpus, currentRun.getOutputPath());\n }" ]
[ "0.6695662", "0.6181555", "0.611007", "0.6052239", "0.5994832", "0.5957912", "0.5892558", "0.5838297", "0.57619685", "0.5759357", "0.5758834", "0.5750859", "0.57211065", "0.5699645", "0.5670189", "0.56596315", "0.56309366", "0.55733174", "0.55613446", "0.552573", "0.5504219", "0.5476685", "0.5475294", "0.5469493", "0.5422479", "0.54075587", "0.5401187", "0.53972864", "0.53687507", "0.53592324", "0.53508496", "0.53472704", "0.53341424", "0.5332513", "0.5331055", "0.53269523", "0.53262997", "0.53249115", "0.5320396", "0.5316307", "0.5309638", "0.5301634", "0.5299254", "0.5286493", "0.52828526", "0.5265019", "0.5264898", "0.52549005", "0.5254404", "0.5241607", "0.52330005", "0.5218646", "0.5216601", "0.52104706", "0.52061427", "0.5202569", "0.5195978", "0.51939666", "0.51869035", "0.51833296", "0.5179289", "0.51790786", "0.5177831", "0.51766133", "0.51751864", "0.51728415", "0.5171105", "0.51690286", "0.5164852", "0.51509464", "0.51493376", "0.5142183", "0.51402706", "0.51331455", "0.5131481", "0.51305723", "0.5128643", "0.51255125", "0.5122652", "0.51217926", "0.51216346", "0.5119075", "0.511667", "0.5114666", "0.51129955", "0.5110077", "0.51064074", "0.5099352", "0.5097568", "0.509755", "0.50931394", "0.50924397", "0.509197", "0.50833166", "0.5081206", "0.50711095", "0.5070362", "0.5064181", "0.5061444", "0.50613564" ]
0.7084444
0
Created by Khairy on 4/27/2018.
public interface MyDialogCloseListener { public void handleDialogClose(DialogInterface dialog); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "private stendhal() {\n\t}", "public final void mo51373a() {\n }", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n public int describeContents() { return 0; }", "private void poetries() {\n\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "private void m50366E() {\n }", "@Override\n public void init() {\n }", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n void init() {\n }", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void jugar() {\n\t\t\n\t}", "protected boolean func_70814_o() { return true; }", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "public void mo38117a() {\n }", "@Override\n public void init() {}", "@Override\n protected void initialize() {\n\n \n }", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\n protected void getExras() {\n }", "@Override\n protected void init() {\n }", "@Override\r\n\tpublic void init() {}", "private static void cajas() {\n\t\t\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "public void mo4359a() {\n }", "private Rekenhulp()\n\t{\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "private void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n public void init() {\n\n }", "@Override\n public void init() {\n\n }", "protected MetadataUGWD() {/* intentionally empty block */}", "@Override\n public int retroceder() {\n return 0;\n }", "public void gored() {\n\t\t\n\t}", "private MetallicityUtils() {\n\t\t\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override public int describeContents() { return 0; }", "@Override\n\tpublic void init() {\n\t}", "@Override\n public void initialize() { \n }", "@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "private void kk12() {\n\n\t}", "@Override\n public void initialize() {}", "@Override\n public void initialize() {}", "@Override\n public void initialize() {}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n\tpublic void init()\n\t{\n\n\t}", "@Override\n\tprotected void initialize() {\n\t}", "@Override\n\tprotected void initialize() {\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n\t\tpublic void init() {\n\t\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n public void initialize() {\n \n }", "@Override\n public void memoria() {\n \n }", "@Override\n public int getSize() {\n return 1;\n }", "public final void mo91715d() {\n }" ]
[ "0.5933475", "0.57016087", "0.56680626", "0.5623418", "0.5594203", "0.5566122", "0.55349255", "0.55349255", "0.55084836", "0.5489785", "0.5463237", "0.54442686", "0.541022", "0.5400567", "0.5398868", "0.5384805", "0.5381957", "0.53771275", "0.53771275", "0.53771275", "0.53771275", "0.53771275", "0.53771275", "0.5369263", "0.5365312", "0.53371245", "0.53345865", "0.53306955", "0.53306955", "0.53306955", "0.53306955", "0.53306955", "0.531869", "0.53172165", "0.5316078", "0.5312069", "0.5309091", "0.5299971", "0.5299949", "0.5290018", "0.5285028", "0.5285028", "0.52762324", "0.5266093", "0.52658546", "0.5263213", "0.52232885", "0.5221665", "0.5219782", "0.5219359", "0.52193195", "0.52161986", "0.52158535", "0.52157277", "0.52157277", "0.52157277", "0.52079415", "0.52057654", "0.52057654", "0.51979357", "0.51933634", "0.51928204", "0.51835346", "0.5179262", "0.5177879", "0.5177879", "0.5177879", "0.51737773", "0.51588976", "0.5156406", "0.5153752", "0.51463556", "0.51422364", "0.51422364", "0.51422364", "0.5134324", "0.51336366", "0.51333296", "0.51333296", "0.51333296", "0.51318735", "0.51318735", "0.5130101", "0.5119129", "0.5115525", "0.5115525", "0.51152766", "0.5114091", "0.51120305", "0.5105", "0.5097136", "0.5097136", "0.5097136", "0.5097136", "0.5097136", "0.5097136", "0.5097136", "0.50934494", "0.50924176", "0.508176", "0.5080518" ]
0.0
-1
Convert the given object to string with each line indented by 4 spaces (except the first line).
private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private String toIndentedString(Object object) {\n if (object == null) {\n return EndpointCentralConstants.NULL_STRING;\n }\n return object.toString().replace(EndpointCentralConstants.LINE_BREAK,\n EndpointCentralConstants.LINE_BREAK + EndpointCentralConstants.TAB_SPACES);\n }", "private String toIndentedString(Object o)\n/* */ {\n/* 128 */ if (o == null) {\n/* 129 */ return \"null\";\n/* */ }\n/* 131 */ return o.toString().replace(\"\\n\", \"\\n \");\n/* */ }", "private String toIndentedString( Object o )\n {\n if ( o == null )\n {\n return \"null\";\n }\n return o.toString().replace( \"\\n\", \"\\n \" );\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }" ]
[ "0.7884413", "0.7549383", "0.7497253", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267" ]
0.0
-1
/ initializes an event with null name and description, current date/time
public Event() { this.name = null; this.description = null; this.date = new GregorianCalendar(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public TimedEvent() {\n this(DEFAULT_LABEL + nextTaskID, DEFAULT_DATE, DEFAULT_TIME); // assigning default values\n }", "public Event() {\n // Unique random UID number for each event\n UID = UUID.randomUUID().toString().toUpperCase();\n TimeZone tz = TimeZone.getTimeZone(\"UTC\");\n Calendar cal = Calendar.getInstance(tz);\n\n /* get time stamp */\n int hour = cal.get(Calendar.HOUR);\n int minute = cal.get(Calendar.MINUTE);\n int second = cal.get(Calendar.SECOND);\n\n /* check current time */\n currentTime = \"\";\n if (hour < 10) {\n currentTime += \"0\" + hour;\n }\n else {\n currentTime += \"\" + hour;\n }\n if (minute < 10) {\n currentTime += \"0\" + minute;\n }\n else {\n currentTime += \"\" + minute;\n }\n if (second < 10) {\n currentTime += \"0\" + second;\n }\n else {\n currentTime += \"\" + second;\n }\n\n /* get date stamp */\n int year = cal.get(Calendar.YEAR);\n int month = cal.get(Calendar.MONTH);\n int day = cal.get(Calendar.DAY_OF_MONTH);\n\n /* check date */\n currentDate = \"\";\n if (year < 10) {\n currentDate += \"0\" + year;\n }\n else {\n currentDate += \"\" + year;\n }\n\n if (month < 10) {\n currentDate += \"0\" + month;\n }\n else {\n currentDate += \"\" + month;\n }\n if (day < 10) {\n currentDate += \"0\" + day;\n }\n else {\n currentDate += \"\" + day;\n }\n }", "public Event() {\r\n\r\n\t}", "public Event() {\n }", "public Event() {\n }", "public EventException() {\n super(\"OOPS!!! The description or time of an event cannot be empty.\");\n }", "public Event() {\n\t}", "public ScheduleEvent()\n\t{\n\n\t}", "public Event() {}", "public void setEventCreated() {\n Date now = new Date();\n this.eventCreated = now;\n }", "BasicEvent createBasicEvent();", "public Event(String description, String info) {\n super(description);\n this.details = new Date(info);\n this.info = info.trim();\n }", "private LogEvent()\n\t{\n\t\tsuper();\n\t}", "public Event() {\n\n }", "public Event(String name, LocalDateTime date) {\n super(name);\n this.date = date;\n }", "public\n CreateEvent()\n {}", "public static LogEvent createEmptyEvent()\n\t{\n\t\treturn new LogEvent();\n\t}", "Event createEvent();", "Event createEvent();", "public Event(String title, String location, String description, String date, String courseRelation, int scheduledTime) {\n\t\t\n\t\tthis.title = title;\n\t\tthis.location = location;\n\t\tthis.description = description;\n\t\tthis.date = date;\n\t\tthis.courseRelation = courseRelation;\n\t\tthis.scheduledTime = scheduledTime;\n\t}", "@Test\n public void constructor() {\n Event event1 = new Event(\"Eat Apple\", \"2020-12-12 12:00\", \"2020-12-12 13:00\",\n false);\n Event event2 = new Event(\"Write paper\", \"2020-05-05 12:00\", \"2020-05-06 23:59\",\n true);\n\n assertEquals(\"Eat Apple\", event1.description);\n assertEquals(LocalDateTime.parse(\"2020-12-12 12:00\", Event.PARSER_FORMATTER), event1.startAt);\n assertEquals(LocalDateTime.parse(\"2020-12-12 13:00\", Event.PARSER_FORMATTER), event1.endAt);\n assertEquals(false, event1.isDone);\n assertEquals(\"Write paper\", event2.description);\n assertEquals(LocalDateTime.parse(\"2020-05-05 12:00\", Event.PARSER_FORMATTER), event2.startAt);\n assertEquals(LocalDateTime.parse(\"2020-05-06 23:59\", Event.PARSER_FORMATTER), event2.endAt);\n assertEquals(true, event2.isDone);\n }", "public WorkTimeEvent() {\r\n super();\r\n }", "protected ICEvent() {}", "public NodeEvent() {\n\t\tthis(new Note(), DEFAULT_LIKELIHOOD);\n\t}", "public Eventd() {\n }", "public Event (String name, String dateTime) {\n\t\tsuper(name);\n\t\tthis.dateTime = dateTime;\n\t}", "Event(int start, int end, String eventName, String description) {\r\n this.start = start;\r\n this.end = end;\r\n this.eventName = eventName;\r\n this.description = description;\r\n }", "BasicEvents createBasicEvents();", "public Event(int id, String eventName){\n this.id = id;\n this.event = eventName;\n this.location = null;\n this.date = 0;\n this.startTime = \"00:00 AM\";\n this.endTime = \"00:00 AM\";\n this.notes = \"No notes\";\n this.allDay = false;\n this.bigId = -1;\n this.alarm = -1;\n\n }", "public Event(String description, String a) throws DateTimeParseException {\n super(description);\n this.at = Task.generateTime(a);\n }", "Event(String description, String at) {\n super(description);\n this.at = at;\n Date date = DateParser.parseDate(at);\n if (date != null) { this.at = date.toString(); }\n }", "public QPEvent() {}", "public Event(){\n\n }", "public JHI_ENTITY_AUDIT_EVENT() {\n this(\"jhi_entity_audit_event\", null);\n }", "public AbstractFoxEvent(Object source, String eventName) {\r\n super(source);\r\n this.eventName = eventName;\r\n this.createTimestamp = System.currentTimeMillis();\r\n }", "public CalendarEvent(String fullTitle) {\n Log.d(TAG, fullTitle);\n\n int firstSpaceLoc = fullTitle.indexOf(' ');\n if(firstSpaceLoc != -1) {\n this.date = fullTitle.substring(0, firstSpaceLoc);\n int useSpaceNum = 1;\n try {\n this.timeOccurring = fullTitle.substring(firstSpaceLoc + 1, fullTitle.indexOf('M') + 1);\n useSpaceNum = 2; //if we do find a time use the third space found in the fullTitle to get the title from the xml.\n } catch (Exception e){\n this.timeOccurring = \"06:00 AM\"; // if their is no specific time found in the title string, just set the time occuring to \"12am\".\n useSpaceNum = 0;\n Log.d(TAG, \"\\tNo time for calendar event found.\");\n } finally {\n this.title = fullTitle.substring(Utils.findNthIndexOf(fullTitle,\" \", useSpaceNum) + 1); // the rest of the title tag should be the name of the event.;\n parseEventType();\n logEvent();\n }\n }\n }", "public EventDetails() {\n initComponents();\n }", "public Event(String title, String location,\n LocalDateTime datetime, int duration, int eventCapacity){\n this.title = title;\n this.location = location;\n this.datetime = datetime;\n this.usernames = new ArrayList<>();\n this.duration = duration;\n this.eventCapacity = eventCapacity;\n uuid = UUID.randomUUID();\n this.type = \"event\";\n }", "Event(int start, int end, String eventName) {\r\n this.start = start;\r\n this.end = end;\r\n this.eventName = eventName;\r\n this.description = \"\";\r\n }", "protected AbstractEvent(long t, EventEngine eng) {\n // this sets the public final variables: time and engine\n time = t;\n engine = eng;\n parameters = null;\n }", "protected AbstractEvent(long t, EventEngine eng, String p) {\n // this sets the public final variables: time and engine\n time = t;\n engine = eng;\n parameters = p;\n }", "public EventCommand(String description, LocalDateTime eventDateTime) {\n this.description = description;\n this.eventDateTime = eventDateTime;\n }", "public void init() {\r\n setEventType(4);\r\n }", "public Event(){\n \n }", "public SoundEvent() \n\t{\n\tsuper(GAME_SOUND_EVENT);\n\t}", "public Events(String newDescripton, String newTime, String status) {\n super(newDescripton, status);\n this.date = LocalDate.parse(newTime);\n }", "public CustomerEvent()\r\n {\r\n this(0, 0, ENTER);\r\n }", "public MCalendarEventView()\r\n {\r\n }", "public void createEvent(String eventTitle, Date eventStartDate, Date eventEndDate, String description){\n Event event = new Event(\n eventTitle, eventStartDate, eventEndDate, description, this.userId\n );\n\n }", "public Evento(String nom, String lug, String desc){\n\t\tthis.nombre=nom;\n\t\tthis.lugar=lug;\n\t\tthis.descripcion=desc;\t\t\n\t}", "@Override\n protected void initEventAndData() {\n }", "protected Event(Parcel in) {\n id = in.readInt();\n date = in.readInt();\n event = in.readString();\n location = in.readString();\n startTime = in.readString();\n endTime = in.readString();\n notes = in.readString();\n byte tmpAllDay = in.readByte();\n allDay = tmpAllDay == 0 ? null : tmpAllDay == 1;\n bigId = in.readInt();\n alarm = in.readInt();\n }", "public Event(String description, String checker, String info) {\n super(description, checker);\n this.details = new Date(info);\n this.info = info.trim();\n }", "public ApplicationEvent(Object source) {\n super(source);\n this.timestamp = System.currentTimeMillis();\n }", "public void createGenesisEvent() {\n handleNewEvent(buildEvent(null, null));\n }", "public Events(String newDescripton, String newDate) {\n super(newDescripton);\n ExceptionGenerator.checkDateFormat(newDate);\n this.date = LocalDate.parse(newDate);\n }", "private void createEvents() {\n\t}", "public Event(long id, String name, Date startTime, Date endTime)\n\t{\n\t\tthis.id = id;\n\t\tthis.name = name;\n\t\tthis.startTime = startTime;\n\t\tthis.endTime = endTime;\n\t\tthis.billings = new ArrayList<Billing>();\n\t\tthis.seatingPlan = null;\n\t}", "public ServiceEvent() {\n // eventSenderID and eventSenderClass are initialized by the OperatingSystem! \n }", "Event generateEventWithName(String description) throws Exception {\n fordate++;\n return new Event(\n new Description(description),\n new StartTime(\"0800\"),\n new StartDate(Integer.toString(Integer.parseInt(\"100301\") + fordate)),\n new EndTime(\"1200\"),\n new EndDate(Integer.toString(Integer.parseInt(\"100301\") + fordate)),\n new Location(\"House of 1\"),\n new UniqueTagList(new Tag(\"tag\"))\n );\n }", "@Override\n\tpublic void initializeScehduleWithOneEvent() {\n\t\tdouble time = getTimeOfNextBirth();\n\t\tEvent birthEvent = new Event(time, EventType.BIRTH, this);\n\t\tbirthEvent.setTag(true);\n\t\tschedule.add(birthEvent);\t\n\t}", "public EventTimeline() {\n this(0, 0, 91, 9);\n }", "public History(String eventTitle, String eventDate) {\n\n mEventTitle = eventTitle;\n mEventDate = eventDate;\n\n }", "protected Event(String title, String location,\n LocalDateTime datetime, int duration, int eventCapacity, String type){\n this.title = title;\n this.location = location;\n this.datetime = datetime;\n this.usernames = new ArrayList<>();\n this.duration = duration;\n this.eventCapacity = eventCapacity;\n uuid = UUID.randomUUID();\n this.type = type;\n }", "public TimedEvent(String label, Date date, Time time) {\n super(label, date); // using the constructor of its superclass\n this.setTime(time); // assigns the time argument value to the attribute\n }", "public Event(EventType type, String eventKey) \n\t{\n\t\tsuper();\n\t\tthis.evntType = type;\n\t\tthis.key = eventKey;\n\t\tthis.uuid = UUID.randomUUID().toString();\n\t\tthis.milliseconds = 0;\n\t\tthis.repeated = false;\n\t}", "Appointment(){\n this.description =\" \";\n this.beginTime=null;\n this.endTime = null;\n }", "public Event(Long timestamp) {\r\n \tthis.timestamp = timestamp;\r\n }", "public EventMessage(Event event)\r\n {\r\n //super(\"EventMessage\");\r\n super(TYPE_IDENT, event);\r\n }", "public ACLEvent(JSONObject j) {\r\n this(j.getString(\"id\"), j.getString(\"name\"), new Date(kCentralGMTOffestMillis+(long)j.getDouble(\"start\")), new Date(kCentralGMTOffestMillis+(long)j.getDouble(\"finish\")), j.getString(\"stage\"));\r\n }", "private void initEvents(){\n ArrayList<Event> en = new ArrayList();\n en.add(new Event_MessangerOfGods(this.village));\n en.add(new Event_PaganPriest(this.village));\n this.events = en;\n }", "public Event(Long artistId, Date date, String message) {\r\n this.artistId = artistId;\r\n this.date = date;\r\n this.message = message;\r\n }", "@TargetApi(Build.VERSION_CODES.HONEYCOMB)\n\t@Override\n\tpublic void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tsetContentView(R.layout.event_details);\n\t\tgetActionBar().setDisplayHomeAsUpEnabled(true);\n\n\t\ttitle = (TextView) findViewById(R.id.event_name);\n\t\torganization = (TextView) findViewById(R.id.organization);\n\t\tdepartment = (TextView) findViewById(R.id.department);\n\t\tlocation = (TextView) findViewById(R.id.location);\n\t\tdate = (TextView) findViewById(R.id.date);\n\t\ttime = (TextView) findViewById(R.id.time);\n\t\tdescription = (TextView) findViewById(R.id.description);\n\n\t\tIntent i = getIntent();\n\t\tevent = (EventData)i.getSerializableExtra(\"the_event\");\n\n\t\ttitle.setText(event.getTitle());\n\t\torganization.setText(event.getOrganization());\n\t\tif (event.getOrganization().equals(event.getDepartment()))\n\t\t\tdepartment.setText(\"\");\n\t\telse\n\t\t\tdepartment.setText(event.getDepartment());\n\t\tlocation.setText(event.getLocation());\n\t\tif (event.getDateFrom().equals(event.getDateTo())) \n\t\t\tdate.setText(event.getRegularDateFrom());\n\t\telse \n\t\t\tdate.setText(event.getRegularDateFrom() + \" to \" + event.getRegularDateTo());\n\n\t\tif (event.getTimeFrom().equals(event.getTimeTo())) \n\t\t\ttime.setText(event.getRegularTimeFrom());\n\t\telse \n\t\t\ttime.setText(event.getRegularTimeFrom() + \" to \" + event.getRegularTimeTo());\n\t\tdescription.setText(event.getDescription());\n\n\t\tfinal Button calendar = (Button) findViewById(R.id.btn1);\n\t\tcalendar.setOnClickListener(new View.OnClickListener() {\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tCalendar cal = Calendar.getInstance(); \n\t\t\t\tIntent intent = new Intent(Intent.ACTION_EDIT);\n\t\t\t\tintent.setType(\"vnd.android.cursor.item/event\");\n\t\t\t\tintent.putExtra(\"beginTime\", event.getBeginTime());\n\t\t\t\tintent.putExtra(\"endTime\", event.getEndTime());\n\t\t\t\tintent.putExtra(\"title\", event.getOrganization() + \"- \" + event.getTitle());\n\t\t\t\tintent.putExtra(Events.EVENT_LOCATION, event.getLocation());\n\t\t\t\tintent.putExtra(Events.DESCRIPTION, event.getDescription());\n\t\t\t\tstartActivity(intent);\n\t\t\t}\n\t\t});\n\n\t\tfinal Button reminder = (Button) findViewById(R.id.btn2);\n\t\treminder.setOnClickListener(new View.OnClickListener() {\n\t\t\tprivate Calendar mcurrentTime;\n\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tmcurrentTime = Calendar.getInstance();\n\n\t\t\t\tDatePickerDialog datePicker = new DatePickerDialog(EventDetailsActivity.this, new DatePickerDialog.OnDateSetListener() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void onDateSet(DatePicker view, int year, int monthOfYear,\n\t\t\t\t\t\t\tint dayOfMonth) {\n\t\t\t\t\t\tmcurrentTime.set(Calendar.YEAR, year);\n\t\t\t\t\t\tmcurrentTime.set(Calendar.MONTH, monthOfYear);\n\t\t\t\t\t\tmcurrentTime.set(Calendar.DAY_OF_MONTH, dayOfMonth);\n\t\t\t\t\t}\n\t\t\t\t}, mcurrentTime.get(Calendar.YEAR), mcurrentTime.get(Calendar.MONTH), mcurrentTime.get(Calendar.DAY_OF_MONTH));\n\t\t\t\t\n\t\t\t\t//now add the time\n\t\t\t\tint hour = mcurrentTime.get(Calendar.HOUR_OF_DAY);\n\t\t\t\tint minute = mcurrentTime.get(Calendar.MINUTE);\n\t\t\t\tTimePickerDialog mTimePicker = new TimePickerDialog(EventDetailsActivity.this, new TimePickerDialog.OnTimeSetListener() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void onTimeSet(TimePicker timePicker, int selectedHour, int selectedMinute) {\n\t\t\t\t\t\tmcurrentTime.set(Calendar.HOUR_OF_DAY, selectedHour);\n\t\t\t\t\t\tmcurrentTime.set(Calendar.MINUTE, selectedMinute);\n\n\t\t\t\t\t\t//create alarm notification\n\t\t\t\t\t\tcreateAlarm(mcurrentTime);\n\t\t\t\t\t\tToast.makeText(getApplicationContext(),\n\t\t\t\t\t\t\t\t\"Sucessfully added reminder\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\t}\n\t\t\t\t}, hour, minute, false);\n\t\t\t\t\n\t\t\t\tmTimePicker.setTitle(\"Select Time\");\n\t\t\t\tmTimePicker.show();\n\t\t\t\t\n\t\t\t\tdatePicker.show();\n\t\t\t\tdatePicker.setTitle(\"Select Date\");\n\t\t\t}\n\t\t});\n\t}", "com.walgreens.rxit.ch.cda.EIVLEvent addNewEvent();", "public Event(int type) {\n this.type=type;\n this.arg=null;\n }", "@Override //to be moved to Cloud service\r\n\tpublic void createEvent(String eventName) {\n\t\t\r\n\t}", "private void initializeEvents() {\r\n\t}", "public CreateEventFragment() {\n // Required empty public constructor\n }", "public Activity() {\n title = \"\";\n comment = \"\";\n startTime = (new GregorianCalendar()).getTime();\n endTime = (new GregorianCalendar()).getTime();\n }", "EventItem(double absoluteTime_, double relativeTime_) {\n absoluteTime = absoluteTime_;\n relativeTime = relativeTime_;\n link = null;\n }", "public VertexEvent() {\n\t\tsuper();\n\n\t\tthis.jobVertexID = new JobVertexID();\n\t\tthis.jobVertexName = null;\n\t\tthis.totalNumberOfSubtasks = -1;\n\t\tthis.indexOfSubtask = -1;\n\t\tthis.currentExecutionState = ExecutionState.CREATED;\n\t\tthis.description = null;\n\t}", "StartEvent createStartEvent();", "public Event(String NAME, String TYPE, String URl, double min, double max,long ID,String IMGURL, String DATE){\n this.name = NAME;\n this.type = TYPE;\n this.url=URl;\n this.priceMin = min ;\n this.priceMax=max;\n this.id =ID;\n this.imgURL= IMGURL;\n this.date = DATE;\n\n\n }", "public InspectorEvent (double time,double clock, Inspector insp, factoryComponent fc,EventTypes type){\n eventfTime = time + clock;\n eventsTime = clock;\n this.fc = fc;\n this.insp = insp;\n eventType = type;\n }", "private IEvent createEvent() throws RodinDBException {\n\t\tfinal IMachineRoot mch = createMachine(\"mch\");\n\t\treturn mch.createChild(IEvent.ELEMENT_TYPE, null, null);\n\t}", "public OrgDay() {\n events = new LinkedList<>();\n }", "public Event (String eventline){\r\n\t\t\t//String delims = \"[ +]\";\r\n\r\n\t\t\tString[] tokens = eventline.split(\" +\");\r\n\t\t\tdate = Integer.parseInt(tokens[0]);\r\n\t\t\tticket = Integer.parseInt(tokens[1]);\r\n\t\t\tname = tokens[2];\r\n\t\t\toriginal = eventline;\r\n\t\t}", "public EventDataUpdate ()\n\t{\n\t\tm_Fields = new Hashtable<String, String>();\n\t\tm_nType = EVENTDATA_UPDATE_NONE;\n\t}", "public Event(String name, LocalDateTime date, boolean isDone) {\n super(name, isDone);\n this.date = date;\n }", "private void addEvent() {\n String name = selectString(\"What is the name of this event?\");\n ReferenceFrame frame = selectFrame(\"Which frame would you like to define the event in?\");\n double time = selectDouble(\"When does the event occur (in seconds)?\");\n double x = selectDouble(\"Where does the event occur (in light-seconds)?\");\n world.addEvent(new Event(name, time, x, frame));\n System.out.println(\"Event added!\");\n }", "public Event(String description, String at) throws DukeException {\n\n super(description);\n this.at = at;\n try {\n String[] dateTimeUnformattedArr = at.substring(1).split(\" \");\n String dateUnformatted = dateTimeUnformattedArr[0];\n String timeUnformatted = dateTimeUnformattedArr[1];\n this.date = extractDate(dateUnformatted);\n this.time = extractTime(timeUnformatted);\n } catch (StringIndexOutOfBoundsException | ArrayIndexOutOfBoundsException | DateTimeException a) {\n throw new DukeException(\"Date / time not formatted correctly, please follow format: yyyy/mm/dd hh:mm\");\n }\n }", "public FlowEventDump() {\n data = new FlowEventDumpDataImpl();\n }", "@Override\r\n\tprotected void initEvents() {\n\t\t\r\n\t}", "public DescribeEventsRequest() {}", "public QPEvent(Event event) {\n this.eventName = event.getEventName();\n this.eventTime = event.getEventTime();\n this.eventType = event.getEventType();\n this.parameters = event.getParameters();\n this.unitId = event.getUnitId();\n if (event.getParameters() != null) {\n for (String key : event.getParameters().keySet()) {\n this.setParameter(key, event.getParameters().get(key));\n }\n }\n }", "private Event(Integer id, String label, boolean objectOnly)\n {\n super();\n this.setId(id);\n this.label = label;\n if(objectOnly) return;\n }", "public Event createEvent(String name) {\r\n\t\tEvent newEvent = new Event(this.GID, name);\r\n\t\tevents.add(newEvent);\r\n\t\treturn newEvent;\r\n\t}", "private EventController()\n {\n events = new ArrayList<>();\n currentCalendar = Calendar.getInstance();\n }", "public static Event createEntity(EntityManager em) {\n Event event = new Event()\n .name(DEFAULT_NAME)\n .gpx(DEFAULT_GPX)\n .gpxContentType(DEFAULT_GPX_CONTENT_TYPE)\n .kmRoute(DEFAULT_KM_ROUTE)\n .timeRoute(DEFAULT_TIME_ROUTE)\n .date(DEFAULT_DATE)\n .descripction(DEFAULT_DESCRIPCTION)\n .observacionsPrev(DEFAULT_OBSERVACIONS_PREV);\n return event;\n }", "@Test\n\tpublic void testConstructor()\n\t{\n\t\tfinal Object rawData = new Object();\n\t\tfinal String id = \"TestId\";\n\t\tfinal DataSeries ds = new DataSeries();\n\t\tfinal RawDataEvent testObj = new RawDataEvent(rawData, id, ds);\n\n\t\tassertEquals(ds, testObj.getDataSeries());\n\t\tassertEquals(id, testObj.getIdentifier());\n\t\tassertEquals(rawData, testObj.getRawDataSource());\n\t}" ]
[ "0.7222036", "0.717496", "0.70867467", "0.7085524", "0.7085524", "0.702021", "0.7008945", "0.69643986", "0.68954104", "0.6885155", "0.67962563", "0.67955256", "0.6774571", "0.67278033", "0.67055506", "0.6688345", "0.6665348", "0.6640679", "0.6640679", "0.6609422", "0.6604761", "0.6603893", "0.6599034", "0.65123445", "0.6509041", "0.6503454", "0.6471701", "0.6454111", "0.64532745", "0.6446319", "0.64183015", "0.64130646", "0.6385611", "0.63851804", "0.63838834", "0.63550943", "0.63467497", "0.63432604", "0.6336545", "0.63121283", "0.6305435", "0.629773", "0.627036", "0.62514085", "0.624283", "0.6229149", "0.6226547", "0.6225607", "0.62214637", "0.62121654", "0.6205667", "0.6202702", "0.62018895", "0.61969405", "0.6186934", "0.61647403", "0.61630344", "0.6154393", "0.61507446", "0.61422294", "0.6137504", "0.6133516", "0.61169297", "0.6097956", "0.609639", "0.60836756", "0.6080936", "0.6078705", "0.60699666", "0.60661954", "0.60635334", "0.60362214", "0.59694916", "0.5966235", "0.5964631", "0.5954946", "0.5953257", "0.59456754", "0.5925536", "0.5921178", "0.5921053", "0.5918536", "0.5917034", "0.59107995", "0.5901703", "0.588203", "0.5872218", "0.58539313", "0.5846783", "0.5842825", "0.58365715", "0.5830301", "0.58209413", "0.5819812", "0.5811374", "0.580735", "0.5798327", "0.57956517", "0.5787707", "0.5778986" ]
0.83772844
0
/ returns time as string > m/d/yyyy
public String getDateString() { int year = date.get(Calendar.YEAR); int month = date.get(Calendar.MONTH); // month is stored from 0-11 so adjust +1 for final display int day_of_month = date.get(Calendar.DAY_OF_MONTH); return String.valueOf(month + 1) + '/' + String.valueOf(day_of_month) + '/' + year; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private String getDateTime() {\n SimpleDateFormat sdf = new SimpleDateFormat(\"[yyyy/MM/dd - HH:mm:ss]\");\n return sdf.format(new Date());\n }", "private String getDateTime() {\n SimpleDateFormat sdf = new SimpleDateFormat(\"[yyyy/MM/dd - HH:mm:ss]\");\n return sdf.format(new Date());\n }", "private String getDateTime() {\n SimpleDateFormat sdf = new SimpleDateFormat(\"[yyyy/MM/dd - HH:mm:ss]\");\n return sdf.format(new Date());\n }", "private String getDateTime() {\n DateFormat dateFormat = new SimpleDateFormat(\"MM/dd/yyyy HH:mm\");\n Date date = new Date();\n return dateFormat.format(date);\n }", "java.lang.String getTime();", "private static String getTime() {\n\t\tDate getDate = new Date();\n\t\tString timeFormat = \"M/d/yy hh:mma\";\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(timeFormat);\n\t\treturn \"[\" + sdf.format(getDate) + \"]\\t\";\n\t}", "public static String getDateTime(){\n String pattern = \"MM/dd/yyyy HH:mm:ss\";\n DateFormat df = new SimpleDateFormat(pattern);\n Date today = Calendar.getInstance().getTime();\n String todayAsString = df.format(today);\n return todayAsString;\n }", "public static String getDateTime() {\n\t\tString sDateTime=\"\";\n\t\ttry {\n\t\t\tSimpleDateFormat sdfDate = new SimpleDateFormat(\"dd-MM-yyyy\");\n\t\t\tSimpleDateFormat sdfTime = new SimpleDateFormat(\"HH:mm:ss\");\n\t\t\tDate now = new Date();\n\t\t\tString strDate = sdfDate.format(now);\n\t\t\tString strTime = sdfTime.format(now);\n\t\t\tstrTime = strTime.replace(\":\", \"-\");\n\t\t\tsDateTime = \"D\" + strDate + \"_T\" + strTime;\n\t\t} catch (Exception e) {\n\t\t\tSystem.err.println(e);\n\t\t}\n\t\treturn sDateTime;\n\t}", "public static String getDateTime() {\n\t\treturn new SimpleDateFormat(\"dd/MM/yyyy HH:mm:ss\").format(new Date());\n\t}", "public static String getTimeString() {\n\t\treturn getTimeString(time);\n\t}", "public String getSystemDateTime() {\n\t\tjava.text.SimpleDateFormat sdfDate = new java.text.SimpleDateFormat(\"yyyy/MM/dd\");\n java.text.SimpleDateFormat sdfTime = new java.text.SimpleDateFormat(\"HH:mm\");\n Date now = new Date();\n String strDate = sdfDate.format(now);\n String strTime = sdfTime.format(now);\n System.out.println(\"Date: \" + strDate);\n System.out.println(\"Time: \" + strTime); \n return \"date\"+strDate+\" \"+strTime;\n\t}", "private String prettyTime() {\n String[] dt = time.split(\"T\");\n String[] ymd = dt[0].split(\"-\");\n String[] hms = dt[1].split(\":\");\n\n int hour = Integer.parseInt(hms[0]);\n\n String date = getMonth(Integer.parseInt(ymd[1])) + \" \" + ymd[2] + \", \" + ymd[0];\n String time = (hour > 12 ? hour - 12 : hour) + \":\" + hms[1] + \":\" + hms[2].substring(0, hms[2].indexOf(\".\"));\n return date + \" at \" + time;\n }", "public static String getTimeString() {\n SimpleDateFormat formatter = new SimpleDateFormat(\"EEE MMM dd HH:mm:ss yyyy\");\n return formatter.format(new java.util.Date());\n }", "private static String timeFor(Date date)\n\t{\n\t\tDateFormat df = new InternetDateFormat();\n\t\tString theTime = df.format(date);\n\t\treturn theTime;\n\t}", "public static String getYYYYMMDD()\r\n/* 65: */ {\r\n/* 66: 81 */ String nowTime = \"\";\r\n/* 67: 82 */ Date now = new Date();\r\n/* 68: 83 */ SimpleDateFormat formatter = new SimpleDateFormat(\"yyyyMMdd\");\r\n/* 69: 84 */ nowTime = formatter.format(now);\r\n/* 70: 85 */ return nowTime;\r\n/* 71: */ }", "public String getTimeString() {\n int hour = date.get(Calendar.HOUR);\n int minute = date.get(Calendar.MINUTE);\n\n String AM_PM = \"PM\";\n if (date.get(Calendar.AM_PM) == Calendar.AM) AM_PM = \"AM\";\n\n String hour_fixed = String.valueOf(hour);\n if (hour == 0) hour_fixed = \"12\";\n\n String minute_fixed = String.valueOf(minute);\n while (minute_fixed.length() < 2) {\n minute_fixed = \"0\" + minute_fixed;\n }\n\n return hour_fixed + \":\" + minute_fixed + ' ' + AM_PM;\n }", "java.lang.String getToDate();", "public String getTime() {\n String pattern = \"yyyy-MM-dd HH:mm:ss\";\n SimpleDateFormat simpleDateFormat = new SimpleDateFormat(pattern);\n\n String date = simpleDateFormat.format(new Date());\n return date;\n }", "String getDate();", "String getDate();", "public static String getDateString(){\n\t\t\tCalendar now = Calendar.getInstance();\n\t\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd__HH-mm-ss\");\n\t\t\treturn sdf.format(now.getTime());\n\t }", "public String getDate(){\n String d=\"\";\n String m=\"\";\n if(day<10){\n d=0+(String.valueOf(day));\n }\n else{\n d=String.valueOf(day);\n }\n\n if(month<10){\n m=0+(String.valueOf(month));\n }\n else{\n m=String.valueOf(month);\n }\n //returning day/month/year\n return (d+\"/\"+m+\"/\"+String.valueOf(year));\n }", "public String getTimeAndDate() {\n\t\t\tDateFormat dateFormat = new SimpleDateFormat(\"dd MMM hh:mm\");\n\t\t\tCalendar cal = Calendar.getInstance();\n\t\t\tString dateAndTime = dateFormat.format(cal.getTime());\n\t\t\treturn dateAndTime;\n\t\t}", "public String getDateTime(){\n LocalDateTime ldt = LocalDateTime.ofInstant(Instant.ofEpochMilli(this.datePosted), ZoneId.systemDefault());\n String dateOnly = ldt.toString().substring(0, 10);\n String timeOnly = ldt.toString().substring(11, ldt.toString().length()-4);\n return dateOnly + \" at \" + timeOnly;\n }", "private static String getDateStr() {\n\t\tDate date = Calendar.getInstance().getTime();\n\t\tDateFormat dateFormat = new SimpleDateFormat(\"MMddyyy\");\n\t\tString dateStr = dateFormat.format(date);\n\t\treturn dateStr;\n\t}", "public String getYYYYMMDDhhmmssTime(Long time) {\n\t\tString result = \"\";\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"YYYYMMDDhhmmss\");\n\t\tresult = sdf.format(new Date(time));\n\t\treturn result;\n\t}", "java.lang.String getDate();", "private String TimeConversion() {\n\n int hours, minutes, seconds, dayOfWeek, date, month, year;\n\n seconds = ((raw[27] & 0xF0) >> 4) + ((raw[28] & 0x03) << 4);\n minutes = ((raw[28] & 0xFC) >> 2);\n hours = (raw[29] & 0x1F);\n dayOfWeek = ((raw[29] & 0xE0) >> 5);\n date = (raw[30]) & 0x1F;\n month = ((raw[30] & 0xE0) >> 5) + ((raw[31] & 0x01) << 3);\n year = (((raw[31] & 0xFE) >> 1) & 255) + 2000;\n\n\n\n return hR(month) + \"/\" + hR(date) + \"/\" + year + \" \" + hR(hours) + \":\" + hR(minutes) + \":\" + hR(seconds) + \":00\";\n }", "public String getUserDateString() {\n\t\tString[] tmpArr = this.getUserDate();\n\t\tString year = tmpArr[0];\n\t\tString month = tmpArr[1];\n\t\tString day = tmpArr[2];\n\t\tString out = year + \"/\" + month + \"/\" + day;\n\t\treturn out;\n\t}", "public String getDateTime() {\n\t\t\n\t\tDateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern(\"yyyy/MM/dd HH:mm:ss\"); \n\t\t\n\t\tLocalDateTime currentDateTime = LocalDateTime.now(); \n\t\t\n\t\treturn dateTimeFormatter.format(currentDateTime);\n\t}", "public static String getDateAndTime() {\n Calendar JCalendar = Calendar.getInstance();\n String JMonth = JCalendar.getDisplayName(Calendar.MONTH, Calendar.SHORT, Locale.UK);\n String JDate = JCalendar.getDisplayName(Calendar.DATE, Calendar.LONG, Locale.UK);\n String JHour = JCalendar.getDisplayName(Calendar.HOUR, Calendar.LONG, Locale.UK);\n String JSec = JCalendar.getDisplayName(Calendar.SECOND, Calendar.LONG, Locale.UK);\n\n return JDate + \"th \" + JMonth + \"/\" + JHour + \".\" + JSec + \"/24hours\";\n }", "public String getDateTimeFormated(Context context){\n SimpleDateFormat sdf = new SimpleDateFormat(\"dd/MM/yyyy HH:mm:ss\"\n , context.getResources().getConfiguration().locale);\n sdf.setTimeZone(TimeZone.getDefault());\n return sdf.format(new Date(mDateTime));\n //setting the dateformat to dd/MM/yyyy HH:mm:ss which is how the date is displayed when a dream is saved\n }", "@RequiresApi(api = Build.VERSION_CODES.N)\n private String getDateTime() {\n DateFormat dateFormat = new SimpleDateFormat(\"yyyy/MM/dd HH:mm:ss\");\n Date date = new Date();\n return dateFormat.format(date);\n }", "String getTime(){\n\t\tCalendar c = Calendar.getInstance();\n int mseconds = c.get(Calendar.MILLISECOND);\n String currentDateandTime = mDateFormat.format(new Date()) + String.format(\"-%04d\", mseconds);\n \n return currentDateandTime;\n\t}", "private String formatTime(LocalDateTime time){\n return time.getYear() + \"-\" + time.getMonthValue() + \"-\" + time.getDayOfMonth()\n + \" \" + time.getMinute() + \":\" + time.getSecond();\n }", "public static String getYYYYMMDDHHMMSS()\r\n/* 56: */ {\r\n/* 57: 68 */ String nowTime = \"\";\r\n/* 58: 69 */ Date now = new Date();\r\n/* 59: 70 */ SimpleDateFormat formatter = new SimpleDateFormat(\"yyyyMMddHHmmss\");\r\n/* 60: 71 */ nowTime = formatter.format(now);\r\n/* 61: 72 */ return nowTime;\r\n/* 62: */ }", "public static String TimeFormate() {\n\t\tString time;\n\t\tSimpleDateFormat dateFormat1 = new SimpleDateFormat();\n\t dateFormat1.setTimeZone(TimeZone.getTimeZone(\"US/Eastern\"));\n\t Calendar cal = Calendar.getInstance();\n\t cal.add(Calendar.MINUTE, 3);\n String n=dateFormat1.format(cal.getTime());\n //n=\"03/09/20 8:30 AM\";\n System.out.println(\"Full Date = \" +n);\n int colonindex=n.indexOf(\":\");\n //System.out.println(\": placed= \" +colonindex);\n //String tt =n.substring(colonindex, n.length());\n //System.out.println(\"tt= \" +tt);\n String tt1 =n.substring(colonindex-2,colonindex-1);\n System.out.println(\"tt1= \" +tt1);\n if(tt1.equals(\"1\")) {\n \t time=n.substring(colonindex-2, n.length());\n \t System.out.println(\"Time with two digits in hours= \" +time);\n }\n else {\n \t time=n.substring(colonindex-1, n.length());\n \t System.out.println(\"Time with one digit in hours= \" +time);\n }\n return time;\n\t}", "public String toString() {\n if (time != null) {\n DateTimeFormatter formatter = DateTimeFormatter.ofPattern(\"yyyy-MM-dd HH:mm\");\n return time.format(formatter);\n } else {\n return \"INVALID TIME\";\n }\n }", "String timeStamp() {\n\n\t\tCalendar now = Calendar.getInstance();\n\n\t\t String y = String.valueOf(now.get(now.YEAR));\n\t\t String mo = String.valueOf(now.get(now.MONTH)+1);\n\t\t String d = String.valueOf(now.get(now.DAY_OF_MONTH));\n\t\t String h = String.valueOf(now.get(now.HOUR_OF_DAY));\n\t\t String m = String.valueOf(now.get(now.MINUTE));\n\t\t String s = String.valueOf(now.get(now.SECOND));\n\t\t String ms = String.valueOf(now.get(now.MILLISECOND));\n\n\n\t return h + m + s + ms;\n\n\n\n }", "private String getDate()\r\n\t{\r\n\t\tCalendar cal = Calendar.getInstance();\r\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd HH:mm\");\r\n\t\treturn sdf.format(cal.getTime());\r\n\t}", "public static String timestamp(){\n\t\tDate date = new Date();\n\t\tDateFormat hourdateFormat = new SimpleDateFormat(\"dd/MM/yyyy HH:mm:ss \");\n\t\treturn hourdateFormat.format(date);\n\t}", "private String getDateTime() {\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"dd.MM.yyyy\", Locale.GERMANY);\n Date date = new Date();\n return dateFormat.format(date);\n }", "public String getTime(long time)\n {\n String format = \"yyyy-MM-dd HH:mm:ssSS\";\n Locale currentLocale = new Locale(\"DEU\", \"DEU\");;\n java.util.Date today = new java.util.Date(time);\n DateFormat dateFormatter =\n DateFormat.getDateInstance(DateFormat.DEFAULT, currentLocale);\n SimpleDateFormat formatter;\n formatter = new SimpleDateFormat(format, currentLocale);\n return formatter.format(today);\n }", "public static String getFormattedDate(long time) {\n SimpleDateFormat format = new SimpleDateFormat(\"MMMM dd, yyyy\");\n return format.format(new Date(time));\n }", "public String DateFormatted(){\n\t\tSimpleDateFormat simDate = new SimpleDateFormat(\"E, dd/MM/yy hh:mm:ss a\");\n\t\treturn simDate.format(date.getTime());\n\t}", "public String getTime() {\n return dateTime.format(c.getTime());\n }", "private void formatTime() {\r\n\t\tDate date = new Date();\r\n\t\tSimpleDateFormat ft = new SimpleDateFormat(\"yyyy/MM/dd HH:mm:ss\");\r\n\t\tm_timeSent = ft.format(date).toString();\r\n\t}", "private static String getDate()\n\t{\n\t\tString dateString = null;\n\t\tDate sysDate = new Date( System.currentTimeMillis() );\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"dd-MM-yy HH:mm:ss\");\n\t\tdateString = sdf.format(sysDate);\n\t\treturn dateString;\n\t}", "public static String getTime() {\r\n\r\n\t\t//Gets current date and time\r\n\t\tDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\r\n\t\tDate date = new Date();\r\n\t\tcurrDateTime = dateFormat.format(date);\r\n\t\treturn currDateTime;\r\n\t}", "public String getTime() {\n boolean pastNoon = hour >= 12;\n if(pastNoon && hour == 12) {\n return hour + \"pm\";\n }\n else if(pastNoon) {\n return (hour - 12) + \"pm\";\n }\n else if(hour == 0) {\n return \"12am\";\n }\n else {\n return hour + \"am\";\n }\n }", "public String getNiceDate(){\n\t\treturn sDateFormat.format(mTime);\n\t}", "public static String getPrintToDirectoryTime() {\n @SuppressLint(\"SimpleDateFormat\") SimpleDateFormat sdf = new SimpleDateFormat(\"MMdd\");\n return sdf.format(System.currentTimeMillis());\n }", "public static String getDate()\r\n {\r\n Date now = new Date();\r\n DateFormat df = new SimpleDateFormat (\"yyyy-MM-dd'T'hh-mm-ss\");\r\n String currentTime = df.format(now);\r\n return currentTime; \r\n \r\n }", "public String getDateConvert() {\n SimpleDateFormat dateFormat1 = new SimpleDateFormat(\"MMM dd yyyy - hh:mm\");\n SimpleDateFormat dateFormat2 = new SimpleDateFormat(\"a\");\n String date = dateFormat1.format(this.timePost) + dateFormat2.format(this.timePost).toLowerCase();\n return date;\n }", "@SuppressLint(\"SimpleDateFormat\")\n\tpublic static String getStringTime(Long time){\n\t\tSimpleDateFormat dateaf = new SimpleDateFormat(\"MM-dd\"); \n\t\tSimpleDateFormat timef = new SimpleDateFormat(\"HH:mm\"); \n\t\tString date = dateaf.format(time);\n\t\tString times = timef.format(time);\n\t\tString result = date+\" \"+times;\n\t\treturn result;\n\t}", "private String getDate() {\n\t\tSimpleDateFormat parseFormat = new SimpleDateFormat(\"hh:mm a\");\n\t\tDate date = new Date();\n\t\tString s = parseFormat.format(date);\n\t\treturn s;\n\t}", "public String getTimestamp() \n{\n Calendar now = Calendar.getInstance();\n return String.format(\"20%1$ty-%1$tm-%1$td_%1$tHh%1$tMm%1$tSs\", now);\n}", "public String getTime(){\r\n String time = \"\";\r\n return time;\r\n }", "public static String getDateTime(String publishtime) {\n if (publishtime != null && !publishtime.equals(\"\")) {\n SimpleDateFormat data = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n return data.format(new Date(Long.parseLong(publishtime) * 1000L));\n }\n return \"\";\n }", "private static String getTimeStamp()\r\n\t{\r\n\t\tDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd_HH.mm.ss\");\r\n\t\tDate date = new Date();\r\n\t\treturn dateFormat.format(date);\r\n\t}", "private static String getDate() {\n return new SimpleDateFormat(\"yyyyMMddHHmmss\").format\n (new Date(System.currentTimeMillis()));\n }", "public static String getNowTime(){\r\n\t\tDate date = new Date();\r\n\t\tDateFormat format = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\r\n\t\tString time = format.format(date);\r\n\t\treturn time;\r\n\t}", "public static String getPrintToTextTime() {\n @SuppressLint(\"SimpleDateFormat\") SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n return sdf.format(System.currentTimeMillis());\n }", "protected String date(String format, double time) {\n\t\treturn new java.util.Date((long)(time*1000)).toString();\n\t}", "public String toString() {\n\treturn String.format(\"%d/%d/%d\", year, month, day);\t\r\n\t}", "public String toString()\n {\n return String.format(\"%d:%02d:%02d %s %d/%d/%d\", \n ((getHour() == 0 || getHour() == 12) ? 12 : getHour() % 12),\n getMinute(), getSecond(), (getHour() < 12 ? \"AM\" : \"PM\"), \n \tmonth, day, year);\n }", "private static String getFormattedCurrentDateAndTime(){\n StringBuilder dateAndTime = new StringBuilder();\n LocalDateTime now = LocalDateTime.now();\n\n String hour = Integer.toString(now.getHour());\n String minute = Integer.toString(now.getMinute());\n\n if (hour.length() == 1){\n hour = \"0\" + hour;\n }\n if (minute.length() == 1){\n minute = \"0\" + minute;\n }\n\n //Creates \"XX/XX/XX @ XX:XX\" format (24 hours)\n dateAndTime.append(now.getMonthValue()).append(\"/\").\n append(now.getDayOfMonth()).append(\"/\").\n append(now.getYear()).append(\" @ \").\n append(hour).append(\":\").\n append(minute);\n\n return dateAndTime.toString();\n }", "public String getDate()\n {\n return day + \"/\" + month + \"/\" + year;\n }", "private static String time() throws Exception {\n\t\tDateFormat dateFormat = new SimpleDateFormat(\"HH-mm-ss \");\n\t\t// get current date time with Date()\n\t\tDate date = new Date();\n\t\t// Now format the date\n\t\tString date1 = dateFormat.format(date);\n\t\t// System.out.println(date1);\n\t\treturn date1;\n\t}", "public String getTime() {\n\t}", "public static String converTimeToReadable(long time) {\n // check if its in the last minute:\n long diff = (new Date()).getTime() - time;\n // TimeUnit.MILLISECONDS.toMinutes(diff)\n\n if (diff / 60000 < 1) {\n return \"now\";\n }\n\n // if its more then a minute, then write time\n String str = \"\";\n Date date = new Date(time);\n\n try {\n SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd\");\n Date currentDay = sdf.parse(sdf.format(new Date()));\n Date lastLocationDay = sdf.parse(sdf.format(time));\n long daysDifference = TimeUnit.MILLISECONDS\n .toDays(currentDay.getTime() - lastLocationDay.getTime());\n\n // ispis:\n str += getNameOfTheDay(daysDifference, lastLocationDay);\n\n } catch (ParseException ex) {\n // if something fails, just write the date\n str += new SimpleDateFormat(\"dd.MM.yyyy\").format(date);\n }\n\n /*\n String dayOfTheWeek = (String) DateFormat.format(\"EEEE\", date); // Thursday\n String day = (String) DateFormat.format(\"dd\", date); // 20\n String monthString = (String) DateFormat.format(\"MMM\", date); // Jun\n String monthNumber = (String) DateFormat.format(\"MM\", date); // 06\n String year = (String) DateFormat.format(\"yyyy\", date); // 2013\n */\n\n str += \", \";\n str += new SimpleDateFormat(\"HH:mm\").format(date);\n\n return str;\n }", "private String getTime(Calendar c) {\n\t\t\n\t\tStringBuffer sb = new StringBuffer();\n\t\t\n\t\tsb.append(EventHelper.getTime(c));\n\t\tif (!sb.toString().equals(\"noon\")) {\n\t\t\tsb.append(\" \");\n\t\t\tsb.append(EventHelper.getAmPm(c));\n\t\t}\n\t\t\n\t\treturn sb.toString();\n\t\t\n\t}", "public String getTime()\n {\n SimpleDateFormat newDateFormat = new SimpleDateFormat(\"HH:mm\");\n String MySDate = newDateFormat.format(this.dueDate);\n return MySDate;\n }", "private String getCurrentTime() {\n DateFormat dateFormat = new SimpleDateFormat(\"dd/MM/yyyy HH:mm:ss\");\n Date date = new Date();\n return dateFormat.format(date);\n }", "public String convertDateToString(){\n\t\tString aDate = \"\";\n\t\taDate += Integer.toString(day);\n\t\taDate += \"/\";\n\t\taDate += Integer.toString(month);\n\t\taDate += \"/\";\n\t\taDate += Integer.toString(year);\n\t\treturn aDate;\n\t}", "public String toString() {\r\n\t\treturn String.format(\"%02d/%02d/%02d\", month, day, year);\r\n\r\n\t}", "public String toString()\n {\n String str = \"\";\n\n if (day < 10)\n {\n str += \"0\";\n }\n str += day + \"/\";\n\n if (month < 10)\n {\n str += \"0\";\n }\n str += month + \"/\";\n\n str += year + \"; \";\n\n if (hour < 10)\n {\n str += \"0\";\n }\n str += hour + \":\";\n\n if (minute < 10)\n {\n str += \"0\";\n }\n str += minute;\n\n return str;\n }", "public String getTime(){\r\n\t\tDate date = new GregorianCalendar().getTime();\r\n\r\n\t\tString time= new SimpleDateFormat(\"HH:mm:ss\").format(date.getTime());\r\n\t\t\r\n\t\treturn time;\r\n\t}", "String dateToString(int year, int month, int day, int hour, int minute, double seconds);", "public static void main(String[] args)\r\n/* 96: */ {\r\n/* 97:104 */ SimpleDateFormat df = new SimpleDateFormat(\"yyyy-MM-dd\");\r\n/* 98:105 */ String qiandaotime = df.format(new Date());\r\n/* 99:106 */ System.out.println(qiandaotime);\r\n/* 100: */ }", "public static String getTime()\n {\n Date time = new Date();\n SimpleDateFormat timeFormat = new SimpleDateFormat(\"HH:mm:ss\");\n return timeFormat.format(time);\n }", "public static String getDateTime() {\n Calendar cal = Calendar.getInstance(TimeZone.getTimeZone(\"UTC\"));\n Date currentLocalTime = cal.getTime();\n SimpleDateFormat df = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss.SSS\");\n df.setTimeZone(TimeZone.getTimeZone(\"UTC\"));\n String date = df.format(currentLocalTime);\n return date;\n }", "static String getTime(int time) {\r\n\t\tint hours = time / 60;\r\n\t\tint minutes = time % 60;\r\n\r\n\t\tString ampm;\r\n\t\tif (time >= 720) ampm = \"PM\";\r\n\t\telse ampm = \"AM\";\r\n\r\n\t\treturn (String.format(\"%d:%02d%s\", hours, minutes, ampm));\r\n\t}", "public String getDateHourRepresentation()\n\t{\n\t\tchar[] charArr = new char[13];\n\t\tcharArr[2] = charArr[5] = charArr[10] = '/';\n\t\tint day = m_day;\n\t\tint month = m_month;\n\t\tint year = m_year;\n\t\tint hour = m_hour;\n\t\tfor(int i = 0; i < 2; i++)\n\t\t{\n\t\t\tcharArr[1 - i] = Character.forDigit(day % 10, 10);\n\t\t\tcharArr[4 - i] = Character.forDigit(month % 10, 10);\n\t\t\tcharArr[12 - i] = Character.forDigit(hour % 10, 10);\n\t\t\tday /= 10;\n\t\t\tmonth /= 10;\n\t\t\thour /=10;\n \t\t}\n\t\tfor(int i = 0; i < 4; i++)\n\t\t{\n\t\t\tcharArr[9 - i] = Character.forDigit(year % 10, 10);\n\t\t\tyear /= 10;\n\t\t}\n\t\treturn new String(charArr);\n\t}", "protected String getDateTimeString(String input) {\n String result;\n DateTimeFormatter datePattern = DateTimeFormatter.ofPattern(\"MMM dd yyyy\");\n if (dateTime == null) {\n result = input;\n } else {\n String date = getDate().format(datePattern);\n String time = getTime().toString();\n result = date + Constants.SPACE + time;\n }\n return result;\n }", "public String getFileFormattedDateTime() {\n return this.optionalTime.map(x -> getFileFormattedDate() + \" | \" + x.format(DateTimeFormatter.ofPattern(\n \"HHmm\"))).orElse(getFileFormattedDate());\n }", "public static String date(Long time, Context context){\n\t\t\n //FORMAT TIME\n\t\tString res = \"\";\n Long tsLong = System.currentTimeMillis()/1000;\t\n \tlong dv = Long.valueOf(time)*1000;// its need to be in milisecond\n \tDate df = new java.util.Date(dv);\n \t//LESS THAN 24\n \tif((tsLong-time)<86400){\n \t\tDateFormat timeFormat = android.text.format.DateFormat.getTimeFormat(context);\n \t\tres = timeFormat.format(df);\n \t}else{\n \t\tDateFormat dateFormat = android.text.format.DateFormat.getMediumDateFormat(context);\n \t\tres = dateFormat.format(df);\n \t}\t\n \tif(time.equals(0l)){\n \t\t\n \t\tres = context.getResources().getString(R.string.never);\n \t}\n \treturn res;\n\t}", "protected final static String getDateStamp() {\n\n\t\treturn\n\n\t\tnew SimpleDateFormat(\"MMM d, yyyy h:mm:ss a zzz\").format(new Date());\n\n\t}", "public String getTimeString(){\n StringBuilder sBuilder = new StringBuilder();\n sBuilder.append(hourPicker.getValue())\n .append(':')\n .append(minutePicker.getValue())\n .append(':')\n .append(secondsPicker.getValue())\n .append('.')\n .append(decimalPicker.getValue());\n return sBuilder.toString();\n }", "public String getDateString(){\n return Utilities.dateToString(date);\n }", "private String currentTime()\t{\n\t\tCalendar c = Calendar.getInstance(); \n\n\t\tString seconds;\n\t\tif(c.get(Calendar.SECOND) < 10)\t{\n\t\t\tseconds = \"0\"+Integer.toString(c.get(Calendar.SECOND));\n\t\t} else {\n\t\t\tseconds = Integer.toString(c.get(Calendar.SECOND));\n\t\t}\n\n\t\tString minutes;\n\t\tif(c.get(Calendar.MINUTE) < 10)\t{\n\t\t\tminutes = \"0\"+Integer.toString(c.get(Calendar.MINUTE));\n\t\t} else {\n\t\t\tminutes = Integer.toString(c.get(Calendar.MINUTE));\n\t\t}\n\n\t\tString hours;\n\t\tif(c.get(Calendar.HOUR_OF_DAY) < 10)\t{\n\t\t\thours = \"0\"+Integer.toString(c.get(Calendar.HOUR_OF_DAY));\n\t\t} else {\n\t\t\thours = Integer.toString(c.get(Calendar.HOUR_OF_DAY));\n\t\t}\n\n\t\tString day;\n\t\tif(c.get(Calendar.DATE) < 10)\t{\n\t\t\tday = \"0\"+Integer.toString(c.get(Calendar.DATE));\n\t\t} else {\n\t\t\tday = Integer.toString(c.get(Calendar.DATE));\n\t\t}\n\n\t\tString month;\n\t\tif((c.get(Calendar.MONTH)+1) < 10)\t{\n\t\t\tmonth = \"0\"+Integer.toString(c.get(Calendar.MONTH)+1);\n\t\t} else {\n\t\t\tmonth = Integer.toString(c.get(Calendar.MONTH)+1);\n\t\t}\n\n\t\tString year;\n\t\tif(c.get(Calendar.YEAR) < 10)\t{\n\t\t\tyear = \"0\"+Integer.toString(c.get(Calendar.YEAR));\n\t\t} else {\n\t\t\tyear = Integer.toString(c.get(Calendar.YEAR));\n\t\t}\n\n\t\treturn day+\"/\"+month+\"/\"+year + \" \"+hours+\":\"+minutes+\":\"+seconds;\t\n\t}", "public static String timeToString(Date date)\r\n/* 24: */ {\r\n/* 25: 31 */ return sdfTime.format(date);\r\n/* 26: */ }", "public static String getDate() {\n return getDate(System.currentTimeMillis());\n }", "private static String dateChange(int time) {\n int hour = time / 3600;\n time %= 3600;\n int minute = time / 60;\n int second = time % 60;\n\n String strHour = hour > 9 ? String.valueOf(hour) : \"0\" + hour;\n String strMinute = minute > 9 ? String.valueOf(minute) : \"0\" + minute;\n String strSecond = second > 9 ? String.valueOf(second) : \"0\" + second;\n\n return String.join(\":\", strHour, strMinute, strSecond);\n }", "public String toString() {\n\t\treturn String.format(\"%d/%d/%d\", year, month, day);\n\t}", "public static String ShowDate(){\n Date date = new Date();\n SimpleDateFormat sdf = new SimpleDateFormat(\"HH:mm:ss.SS a\");\n String HH_MM = sdf.format(date);\n return HH_MM;\n }", "public String toUniversalString()\n {\n return String.format(\n \"%02d:%02d:%02d %d/%d/%d\", getHour(), getMinute(), getSecond(), \n \t\tmonth, day, year);\n }", "public String getDateCreationLibelle() {\n\t\tDateTimeFormatter format = DateTimeFormatter.ofPattern(\"dd/MM/yyyy hh:mm:ss\");\n\t\treturn this.dateCreation.format(format);\n\t}", "public String toString() {\n return this.time != null ? this.time.format(TIME_FORMATTER) : \"\";\n }", "public String getTime() {\n Date date = new Date();\n return (date.toString());\n }" ]
[ "0.7619771", "0.75867593", "0.75867593", "0.74526924", "0.7360908", "0.73545283", "0.7263238", "0.71943057", "0.71811795", "0.7063391", "0.7054175", "0.70434964", "0.7030587", "0.69885087", "0.6974095", "0.6940172", "0.6879997", "0.6846532", "0.6838285", "0.6838285", "0.68186545", "0.68160903", "0.6815017", "0.6814564", "0.6791868", "0.6789119", "0.67851794", "0.6759452", "0.6758196", "0.675569", "0.67515296", "0.6746811", "0.673961", "0.6735927", "0.67341965", "0.67113584", "0.6707959", "0.67033255", "0.67002666", "0.668706", "0.6685128", "0.6679099", "0.66749066", "0.6671676", "0.666909", "0.66622216", "0.6653298", "0.66479665", "0.664423", "0.6642356", "0.66352165", "0.66261834", "0.661853", "0.6608851", "0.6592201", "0.6587373", "0.6572701", "0.6567881", "0.6566195", "0.6562896", "0.65594727", "0.6557363", "0.65536386", "0.655341", "0.6538939", "0.65172166", "0.6506849", "0.6503311", "0.6501796", "0.65009564", "0.6491695", "0.6491103", "0.64906895", "0.6485066", "0.6482113", "0.6472062", "0.6471073", "0.64704835", "0.6466836", "0.6449056", "0.6436082", "0.6421065", "0.6402577", "0.6372654", "0.6371494", "0.63713604", "0.6368534", "0.6368", "0.63663346", "0.6365785", "0.6352681", "0.63431776", "0.634223", "0.63381904", "0.63357085", "0.6329353", "0.63263524", "0.6325684", "0.63219935", "0.6321587" ]
0.6557129
62
/ returns time as string > h:mm AM/PM
public String getTimeString() { int hour = date.get(Calendar.HOUR); int minute = date.get(Calendar.MINUTE); String AM_PM = "PM"; if (date.get(Calendar.AM_PM) == Calendar.AM) AM_PM = "AM"; String hour_fixed = String.valueOf(hour); if (hour == 0) hour_fixed = "12"; String minute_fixed = String.valueOf(minute); while (minute_fixed.length() < 2) { minute_fixed = "0" + minute_fixed; } return hour_fixed + ":" + minute_fixed + ' ' + AM_PM; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getTime() {\n boolean pastNoon = hour >= 12;\n if(pastNoon && hour == 12) {\n return hour + \"pm\";\n }\n else if(pastNoon) {\n return (hour - 12) + \"pm\";\n }\n else if(hour == 0) {\n return \"12am\";\n }\n else {\n return hour + \"am\";\n }\n }", "static String getTime(int time) {\r\n\t\tint hours = time / 60;\r\n\t\tint minutes = time % 60;\r\n\r\n\t\tString ampm;\r\n\t\tif (time >= 720) ampm = \"PM\";\r\n\t\telse ampm = \"AM\";\r\n\r\n\t\treturn (String.format(\"%d:%02d%s\", hours, minutes, ampm));\r\n\t}", "public String getTime(){\n String mt=\"\";\n String hr=\"\";\n if(minute<10){\n mt=0+(String.valueOf(minute));\n }\n\n else{\n mt=String.valueOf(minute);\n }\n\n if(hour<10){\n hr=0+(String.valueOf(hour));\n }\n else{\n hr=String.valueOf(hour);\n }\n //return hour:minute\n return (hr+\":\"+mt);\n }", "public static String getTime()\n {\n Date time = new Date();\n SimpleDateFormat timeFormat = new SimpleDateFormat(\"HH:mm:ss\");\n return timeFormat.format(time);\n }", "public String getPrintFormattedTime() {\n return this.optionalTime.map(x -> x.format(DateTimeFormatter.ofPattern(\"HHmma\"))).orElse(\"\");\n }", "public String getTimeString() {\n DateFormat format = new SimpleDateFormat(\"HH:mm\");\n return format.format(mDate);\n }", "public static String getNowTimeHHMM() {\n\t\tSimpleDateFormat timeFormat = new SimpleDateFormat(\"HH:mm\");\n\t\treturn timeFormat.format(new Date());\n\t}", "public static String getTimeString() {\n\t\treturn getTimeString(time);\n\t}", "public String getFormatedTime() {\n DateFormat displayFormat = new SimpleDateFormat(\"HH:mm\", Locale.GERMAN);\n return displayFormat.format(mEvent.getTime());\n }", "public static String getHHMM()\r\n/* 74: */ {\r\n/* 75: 94 */ String nowTime = \"\";\r\n/* 76: 95 */ Date now = new Date();\r\n/* 77: 96 */ SimpleDateFormat formatter = new SimpleDateFormat(\"HH:mm\");\r\n/* 78: 97 */ nowTime = formatter.format(now);\r\n/* 79: 98 */ return nowTime;\r\n/* 80: */ }", "public String getTimeInString() {\n int minutes = (time % 3600) / 60;\n int seconds = time % 60;\n String timeString = String.format(\"%02d:%02d\", minutes, seconds);\n\n return timeString;\n }", "public String toString () {\n String dayTime;\n\n if (isPM == true)\n dayTime = \"PM\";\n\n else\n dayTime = \"AM\";\n\n String hourString = String.format(\"%02d\", hour);\n String minString = String.format(\"%02d\", minute);\n return (hourString + \":\" + minString + \" \" + dayTime);\n }", "java.lang.String getTime();", "public String timeToString() {\n\t\tString start = \"\";\n\t\tString hmSep = \":\";\n\t\tString msSep = \":\";\n\t\tif (hour < 10)\n\t\t\tstart = new String(\"0\");\n\t\tif (minute < 10)\n\t\t\thmSep = new String(\":0\");\n\t\tif (second < 10)\n\t\t\tmsSep = new String(\":0\");\n\t\treturn new String(start\n\t\t\t\t+ hour + hmSep\n\t\t\t\t+ minute + msSep\n\t\t\t\t+ second);\n\t}", "private String prettyTime() {\n String[] dt = time.split(\"T\");\n String[] ymd = dt[0].split(\"-\");\n String[] hms = dt[1].split(\":\");\n\n int hour = Integer.parseInt(hms[0]);\n\n String date = getMonth(Integer.parseInt(ymd[1])) + \" \" + ymd[2] + \", \" + ymd[0];\n String time = (hour > 12 ? hour - 12 : hour) + \":\" + hms[1] + \":\" + hms[2].substring(0, hms[2].indexOf(\".\"));\n return date + \" at \" + time;\n }", "public static String TimeFormate() {\n\t\tString time;\n\t\tSimpleDateFormat dateFormat1 = new SimpleDateFormat();\n\t dateFormat1.setTimeZone(TimeZone.getTimeZone(\"US/Eastern\"));\n\t Calendar cal = Calendar.getInstance();\n\t cal.add(Calendar.MINUTE, 3);\n String n=dateFormat1.format(cal.getTime());\n //n=\"03/09/20 8:30 AM\";\n System.out.println(\"Full Date = \" +n);\n int colonindex=n.indexOf(\":\");\n //System.out.println(\": placed= \" +colonindex);\n //String tt =n.substring(colonindex, n.length());\n //System.out.println(\"tt= \" +tt);\n String tt1 =n.substring(colonindex-2,colonindex-1);\n System.out.println(\"tt1= \" +tt1);\n if(tt1.equals(\"1\")) {\n \t time=n.substring(colonindex-2, n.length());\n \t System.out.println(\"Time with two digits in hours= \" +time);\n }\n else {\n \t time=n.substring(colonindex-1, n.length());\n \t System.out.println(\"Time with one digit in hours= \" +time);\n }\n return time;\n\t}", "private String getDate() {\n\t\tSimpleDateFormat parseFormat = new SimpleDateFormat(\"hh:mm a\");\n\t\tDate date = new Date();\n\t\tString s = parseFormat.format(date);\n\t\treturn s;\n\t}", "public String getTime() {\n\t\t\tDateFormat dateFormat = new SimpleDateFormat(\"HH:mm:ss\");\n\t\t\tCalendar cal = Calendar.getInstance();\n\t\t\tString time = dateFormat.format(cal.getTime());\n\t\t\treturn time;\n\t\t}", "public String formatTime() {\n if ((myGameTicks / 16) + 1 != myOldGameTicks) {\n myTimeString = \"\";\n myOldGameTicks = (myGameTicks / 16) + 1;\n int smallPart = myOldGameTicks % 60;\n int bigPart = myOldGameTicks / 60;\n myTimeString += bigPart + \":\";\n if (smallPart / 10 < 1) {\n myTimeString += \"0\";\n }\n myTimeString += smallPart;\n }\n return (myTimeString);\n }", "public String toString()\r\n {\r\n DecimalFormat twoDigits = new DecimalFormat( \"00\" );\r\n\r\n return ( this.getHour() == 12 || this.getHour() == 0 ?\r\n 12 : this.getHour() % 12 ) + \":\" +\r\n twoDigits.format( this.getMinute() ) + \":\" +\r\n twoDigits.format( this.getSecond() ) +\r\n ( this.getHour() < 12 ? \" AM\" : \" PM\" );\r\n }", "public String getTime(){\r\n\t\tDate date = new GregorianCalendar().getTime();\r\n\r\n\t\tString time= new SimpleDateFormat(\"HH:mm:ss\").format(date.getTime());\r\n\t\t\r\n\t\treturn time;\r\n\t}", "public String toString() {\n return String.format(\"%d: %02d: %02d %s\",\n ((hour == 0 || hour == 12) ? 12 :hour % 12 ),\n minutes, seconds, (hour < 12 ? \"AM\" : \"PM\"));\n\n }", "public static String formatTime(long time) {\n long tmp = time;\n int hour = (int) (time / 3600);\n tmp -= hour * 3600;\n int min = (int) (tmp / 60);\n int sec = (int) (tmp - min * 60);\n\n String hourText = hour < 10 ? \"0\" + hour : \"\" + hour;\n String minText = min < 10 ? \"0\" + min : \"\" + min;\n String secText = sec < 10 ? \"0\" + sec : \"\" + sec;\n\n\n return hourText + \":\" + minText + \":\" + secText;\n }", "private String convertToAMPM(Date time) {\r\n\r\n String modifier = \"\";\r\n String dateTime = Util.formateDate(time, \"yyyy-MM-dd HH:mm\");\r\n\r\n\r\n // Get the raw time\r\n String rawTime = dateTime.split(\" \")[1];\r\n // Get the hour as 24 time and minutes\r\n String hour24 = rawTime.split(\":\")[0];\r\n String minutes = rawTime.split(\":\")[1];\r\n // Convert the hour\r\n Integer hour = Integer.parseInt(hour24);\r\n\r\n if (hour != 12 && hour != 0) {\r\n modifier = hour < 12 ? \"am\" : \"pm\";\r\n hour %= 12;\r\n } else {\r\n modifier = (hour == 12 ? \"pm\" : \"am\");\r\n hour = 12;\r\n }\r\n // Concat and return\r\n return hour.toString() + \":\" + minutes + \" \" + modifier;\r\n }", "private static String timeLine()\n {\n return String.format(STR_FORMAT_1 + STR_FORMAT_2, TIME_STR, TIME);\n }", "String formatTime(int time) {\r\n\t\tint h = time / 3600;\r\n\t\ttime %= 3600;\r\n\t\tint m = time / 60;\r\n\t\ttime %= 60;\r\n\t\tint s = time;\r\n\t\treturn String.format(\"%02d:%02d:%02d\", h, m, s);\r\n\t}", "public static String getHHMM(String time)\r\n\t{\r\n\t\tString finalTime = \"00/00 AM/PM\";\r\n\t\tString hh = time.substring(0, 2);\r\n\t\tString mm = time.substring(3, 5);\r\n\r\n\t\tint newHH = Integer.parseInt(hh);\r\n\t\tint newMM = Integer.parseInt(mm);\r\n\r\n\t\tnewMM = newMM % 60;\r\n\r\n\t\tif (newHH == 0)\r\n\t\t{\r\n\t\t\tfinalTime = \"12:\" + newMM + \" PM\";\r\n\t\t} else\r\n\t\t{\r\n\r\n\t\t\tif (newHH > 12)\r\n\t\t\t{\r\n\t\t\t\tnewHH = newHH % 12;\r\n\t\t\t\tfinalTime = newHH + \":\" + newMM + \" PM\";\r\n\t\t\t} else\r\n\t\t\t\tfinalTime = newHH + \":\" + newMM + \" AM\";\r\n\t\t}\r\n\r\n\t\tString HH = finalTime.substring(0, finalTime.indexOf(\":\"));\r\n\t\tString MM = finalTime.substring(finalTime.indexOf(\":\") + 1, finalTime\r\n\t\t\t\t.indexOf(\" \"));\r\n\t\tString AMPM = finalTime.substring(finalTime.indexOf(\" \"), finalTime\r\n\t\t\t\t.length());\r\n\r\n\t\tif (MM.length() == 1)\r\n\t\t\tMM = \"0\" + MM;\r\n\r\n\t\tfinalTime = HH + \":\" + MM /*+ \" \" */+ AMPM;\r\n\r\n\t\treturn (finalTime);\r\n\t}", "static String timeConversion(String s) {\n /*\n * Write your code here.\n */\n String res = \"\";\n String hrs = s.substring(0, 2);\n String min = s.substring(3, 5);\n String sec = s.substring(6, 8);\n String ampm = s.substring(8);\n int hr = Integer.parseInt(hrs);\n if((ampm.equalsIgnoreCase(\"PM\")) && (hr != 12)) {\n hr += 12;\n if(hr >= 24) {\n hr = 24 - hr;\n }\n }\n else if(ampm.equalsIgnoreCase(\"AM\")) {\n if(hr == 12) {\n hr = 0;\n }\n }\n if(hr < 10) {\n res = res + \"0\" + Integer.toString(hr);\n }\n else {\n res += Integer.toString(hr);\n }\n res = res +\":\" +min +\":\" + sec;\n return res;\n }", "public String getTimeString() {\n // Converts slot to the minute it starts in the day\n int slotTimeMins =\n SlopeManagerApplication.OPENING_TIME * 60 + SESSION_LENGTHS_MINS * getSlot();\n\n Calendar cal = Calendar.getInstance();\n cal.set(Calendar.HOUR_OF_DAY, slotTimeMins/60);\n cal.set(Calendar.MINUTE, slotTimeMins % 60);\n cal.set(Calendar.SECOND, 0);\n cal.set(Calendar.MILLISECOND, 0);\n @SuppressLint(\"SimpleDateFormat\") SimpleDateFormat sdf = new SimpleDateFormat(\"HH:mm\");\n return sdf.format(cal.getTime());\n }", "public String getTime() {\n return String.format(\"%02d\", hours) + \":\" + String.format(\"%02d\", minutes);\n }", "static String timeConversion(String s) {\n\n\t\tStringBuilder sb = new StringBuilder();\n\t\tboolean isAm = s.contains(\"AM\");\n\t\t\n\t\ts = s.replace(\"AM\", \"\");\n\t\ts = s.replace(\"PM\", \"\");\n\t\t\n\t\tString str[] = s.split(\":\");\n\t\tint time = Integer.parseInt(str[0]);\n\t\t\n\t\t\n\t\tif(time < 12 && !isAm) {\n\t\t\ttime = time + 12;\n\t\t\tsb.append(time).append(\":\");\n\t\t}else if(time == 12 && isAm) {\n\t\t\tsb.append(\"00:\");\n\t\t}else {\n\t\t\tif (time < 10) sb.append(\"0\").append(time).append(\":\");\n\t\t\telse sb.append(time).append(\":\");\n\t\t}\n\n\t\tsb.append(str[1]).append(\":\").append(str[2]);\n\t\treturn sb.toString();\n\t}", "public static String getPrintToTextTime() {\n @SuppressLint(\"SimpleDateFormat\") SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n return sdf.format(System.currentTimeMillis());\n }", "@Override\n\tpublic String toString() {\n\t\tLocalTime lT = LocalTime.of(hour, minute);\n\t\tDateTimeFormatter.ofPattern(\"hh:mm\").format(lT);\n\t\treturn lT.toString() + \" \" + timeType;\n\t}", "private static String getTime() {\n\t\tDate getDate = new Date();\n\t\tString timeFormat = \"M/d/yy hh:mma\";\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(timeFormat);\n\t\treturn \"[\" + sdf.format(getDate) + \"]\\t\";\n\t}", "public static String TimeConverter(long t)\r\n {\r\n int h, m, s, ms;\r\n ms = (int)t;\r\n h = ms / 3600000;\r\n ms = ms % 3600000;\r\n m = ms / 60000;\r\n ms = ms % 60000;\r\n s = ms / 1000;\r\n ms = ms % 1000;\r\n return h + \" :: \" + m + \" :: \" + s + \" :: \" + ms;\r\n }", "private String formatTime(LocalDateTime time){\n return time.getYear() + \"-\" + time.getMonthValue() + \"-\" + time.getDayOfMonth()\n + \" \" + time.getMinute() + \":\" + time.getSecond();\n }", "public String toString() {\n if (time != null) {\n DateTimeFormatter formatter = DateTimeFormatter.ofPattern(\"yyyy-MM-dd HH:mm\");\n return time.format(formatter);\n } else {\n return \"INVALID TIME\";\n }\n }", "@SuppressLint(\"SimpleDateFormat\")\n\tpublic static String getStringTime(Long time){\n\t\tSimpleDateFormat dateaf = new SimpleDateFormat(\"MM-dd\"); \n\t\tSimpleDateFormat timef = new SimpleDateFormat(\"HH:mm\"); \n\t\tString date = dateaf.format(time);\n\t\tString times = timef.format(time);\n\t\tString result = date+\" \"+times;\n\t\treturn result;\n\t}", "public static String ShowDate(){\n Date date = new Date();\n SimpleDateFormat sdf = new SimpleDateFormat(\"HH:mm:ss.SS a\");\n String HH_MM = sdf.format(date);\n return HH_MM;\n }", "public String toString() {\n return this.time != null ? this.time.format(TIME_FORMATTER) : \"\";\n }", "public String getFormattedTime() {\n return formattedTime;\n }", "public static String time(int time) {\n return time((long)time);\n }", "public String getTime(DateTime date) {\n DateTimeFormatter time = DateTimeFormat.forPattern(\"hh:mm a\");\n return date.toString(time);\n }", "private String TimeConversion() {\n\n int hours, minutes, seconds, dayOfWeek, date, month, year;\n\n seconds = ((raw[27] & 0xF0) >> 4) + ((raw[28] & 0x03) << 4);\n minutes = ((raw[28] & 0xFC) >> 2);\n hours = (raw[29] & 0x1F);\n dayOfWeek = ((raw[29] & 0xE0) >> 5);\n date = (raw[30]) & 0x1F;\n month = ((raw[30] & 0xE0) >> 5) + ((raw[31] & 0x01) << 3);\n year = (((raw[31] & 0xFE) >> 1) & 255) + 2000;\n\n\n\n return hR(month) + \"/\" + hR(date) + \"/\" + year + \" \" + hR(hours) + \":\" + hR(minutes) + \":\" + hR(seconds) + \":00\";\n }", "public String toString() {\n return hour+\" \"+minute;\r\n }", "public static String time_str(double t) {\n int hours = (int) t/3600;\n int rem = (int) t - hours*3600;\n int mins = rem / 60;\n int secs = rem - mins*60;\n return String.format(\"%02d:%02d:%02d\", hours, mins, secs);\n //return hoursMinutesSeconds(t);\n }", "public String getTimeString(){\n StringBuilder sBuilder = new StringBuilder();\n sBuilder.append(hourPicker.getValue())\n .append(':')\n .append(minutePicker.getValue())\n .append(':')\n .append(secondsPicker.getValue())\n .append('.')\n .append(decimalPicker.getValue());\n return sBuilder.toString();\n }", "private String getTime(Calendar c) {\n\t\t\n\t\tStringBuffer sb = new StringBuffer();\n\t\t\n\t\tsb.append(EventHelper.getTime(c));\n\t\tif (!sb.toString().equals(\"noon\")) {\n\t\t\tsb.append(\" \");\n\t\t\tsb.append(EventHelper.getAmPm(c));\n\t\t}\n\t\t\n\t\treturn sb.toString();\n\t\t\n\t}", "public String getTime() {\n String show = time;\n return show;\n }", "java.lang.String getPlayTime();", "public String getTime(){\r\n String time = \"\";\r\n return time;\r\n }", "public String toString() {\n\t\treturn hours + \"h\" + minutes + \"m\";\n\t}", "private void formatTime() {\r\n\t\tDate date = new Date();\r\n\t\tSimpleDateFormat ft = new SimpleDateFormat(\"yyyy/MM/dd HH:mm:ss\");\r\n\t\tm_timeSent = ft.format(date).toString();\r\n\t}", "public static String getFormattedTime(Context context, Calendar time) {\n final String skeleton = DateFormat.is24HourFormat(context) ? \"EHm\" : \"Ehma\";\n final String pattern = DateFormat.getBestDateTimePattern(Locale.getDefault(), skeleton);\n return (String) DateFormat.format(pattern, time);\n }", "static String timeConversion1(String s) {\n String[] timeSplit = s.split(\":\");\n String hours = timeSplit[0];\n String minutes = timeSplit[1];\n String seconds = timeSplit[2].substring(0, 2);\n String ampm = timeSplit[2].substring(2);\n\n int hour = Integer.parseInt(hours);\n\n int differential = 0;\n if (\"PM\".equals(ampm) && hour != 12) {\n differential = 12;\n }\n\n\n hour += differential;\n hour = hour % 24;\n\n hours = String.format(\"%02d\", hour);\n\n return hours + \":\" + minutes + \":\" + seconds;\n\n }", "public static String longToHHMM(long longTime)\r\n/* 150: */ {\r\n/* 151:219 */ SimpleDateFormat formatter = new SimpleDateFormat(\"HH:mm\");\r\n/* 152:220 */ Date strtodate = new Date(longTime);\r\n/* 153:221 */ return formatter.format(strtodate);\r\n/* 154: */ }", "private String getMinutesInTime(int time) {\n String hour = String.valueOf(time / 60);\n String minutes = String.valueOf(time % 60);\n\n if(minutes.length() < 2) {\n minutes = \"0\" + minutes;\n }\n\n return hour + \":\" + minutes;\n\n }", "static String timeConversion(String s) {\n String[] timeSplit = s.split(\":\");\n String hours = timeSplit[0];\n String minutes = timeSplit[1];\n String seconds = timeSplit[2].substring(0, 2);\n String ampm = timeSplit[2].substring(2, 4);\n\n String newHours;\n if (ampm.equals(\"AM\")) {\n newHours = hours.equals(\"12\") ? \"00\" : hours;\n\n } else {\n newHours = hours.equals(\"12\") ? hours : String.valueOf(Integer.parseInt(hours) + 12);\n }\n\n return newHours + \":\" + minutes + \":\" + seconds;\n\n }", "public static String timeAsString(long totalTime) {\n long second = totalTime / 1000 % 60;\n long minute = totalTime / (1000 * 60) % 60;\n long hour = totalTime / (1000 * 60 * 60);\n\n return String.format(\"%02d:%02d:%02d\", hour, minute, second);\n }", "public String FormatTime(int hour, int minute) {\n\n String time;\n time = \"\";\n String formattedMinute;\n\n if (minute / 10 == 0) {\n formattedMinute = \"0\" + minute;\n } else {\n formattedMinute = \"\" + minute;\n }\n\n\n if (hour == 0) {\n time = \"12\" + \":\" + formattedMinute + \" AM\";\n } else if (hour < 12) {\n time = hour + \":\" + formattedMinute + \" AM\";\n } else if (hour == 12) {\n time = \"12\" + \":\" + formattedMinute + \" PM\";\n } else {\n int temp = hour - 12;\n time = temp + \":\" + formattedMinute + \" PM\";\n }\n\n\n return time;\n }", "public String getCurrentTimeHourMin() {\n\t\t\t\t// DateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n\t\t\t\t// need to change after the date format is decided\n\t\t\t\tDateFormat dateFormat = new SimpleDateFormat(\"HH:mm\");\n\t\t\t\tDate date = new Date();\n\t\t\t\treturn dateFormat.format(date);\n\t\t\t}", "public static String convertFromTime(int time){\n int hour = time/100;\n int min = time%100;\n String hourStr = String.format(\"%02d\", hour);\n String minStr = String.format(\"%02d\",min);\n return hourStr + \":\" + minStr;\n }", "public static String getTimeString(int t) {\n\t\tint hours = t / 3600;\n\t\tint minutes = (t / 60) % 60;\n\t\tint seconds = t % 60;\n\t\treturn (hours < 10 ? \"0\" : \"\")\n\t\t\t+ hours\n\t\t\t+ (minutes < 10 ? \":0\" : \":\")\n\t\t\t+ minutes\n\t\t\t+ (seconds < 10 ? \":0\" : \":\")\n\t\t\t+ seconds;\n\t}", "public String getTime()\n {\n SimpleDateFormat newDateFormat = new SimpleDateFormat(\"HH:mm\");\n String MySDate = newDateFormat.format(this.dueDate);\n return MySDate;\n }", "public String gameTimeToText()\n {\n // CALCULATE GAME TIME USING HOURS : MINUTES : SECONDS\n if ((startTime == null) || (endTime == null))\n return \"\";\n long timeInMillis = endTime.getTimeInMillis() - startTime.getTimeInMillis();\n return timeToText(timeInMillis);\n }", "public String getCurrentTimeHourMinSec() {\n\t\t\t\t// DateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n\t\t\t\t// need to change after the date format is decided\n\t\t\t\tDateFormat dateFormat = new SimpleDateFormat(\"HH:mm:ss\");\n\t\t\t\tDate date = new Date();\n\t\t\t\treturn dateFormat.format(date);\n\t\t\t}", "public String getFullHour()\n {\n\n String str = \"\";\n\n if (hour < 10)\n {\n str += \"0\";\n }\n str += hour + \":\";\n\n if (minute < 10)\n {\n str += \"0\";\n }\n str += minute;\n\n return str;\n }", "private static String formatTime(String time) {\n\t\treturn String.format(\"%s:%s\", time.substring(0, 2), time.substring(2));\n\t}", "public String amOrpm() {\n\t\tif (this.total % 24 < 12) {\n\t\t\treturn \"AM\";\n\t\t} else {\n\t\t\treturn \"PM\";\n\t\t}\n\t}", "public String getYYYYMMDDhhmmssTime(Long time) {\n\t\tString result = \"\";\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"YYYYMMDDhhmmss\");\n\t\tresult = sdf.format(new Date(time));\n\t\treturn result;\n\t}", "private String formatTime(Date dateObject) {\n SimpleDateFormat timeFormat = new SimpleDateFormat(\"h:mm a\", Locale.getDefault());\n return timeFormat.format(dateObject);\n }", "static String timeConversion(String s) {\n /*\n * Write your code here.\n */\n String conversion = \"\";\n String time = s.substring(s.length()-2,s.length());\n String hour = s.substring(0,2);\n if(time.equals(\"AM\")){\n if(Integer.parseInt(hour)==12){\n conversion = \"00\"+s.substring(2,s.length()-2);\n }\n else{\n conversion = s.substring(0,s.length()-2);\n }\n }else{\n if(Integer.parseInt(hour)==12){\n conversion = \"12\"+s.substring(2,s.length()-2);\n }\n else{\n conversion = (Integer.parseInt(hour)+12) + s.substring(2,s.length()-2);\n }\n }\n\n return conversion;\n }", "private String formatTime(Date dateObject) {\r\n SimpleDateFormat timeFormat = new SimpleDateFormat(\"h:mm a\");\r\n return timeFormat.format(dateObject);\r\n }", "java.lang.String getArrivalTime();", "java.lang.String getArrivalTime();", "public String retornaHora(){\n\t\tCalendar calendar = new GregorianCalendar();\n\t\tSimpleDateFormat hora = new SimpleDateFormat(\"HH\");\n\t\tSimpleDateFormat minuto = new SimpleDateFormat(\"mm\");\n\t\tDate date = new Date();\n\t\tcalendar.setTime(date);\n\t\treturn hora.format(calendar.getTime()) + \"h\" + minuto.format(calendar.getTime());\n\t}", "public static SimpleDateFormat getHourFormat() {\n return new SimpleDateFormat(\"HH:mm\");\n }", "static String timeConversion(String s) {\n if(s.indexOf('P') >= 0 && s.substring(0, 2).equals(\"12\")){\n }\n else if(s.indexOf('P') >= 0){\n Integer n = Integer.parseInt(s.substring(0, 2));\n s = removeHour(s);\n n += 12;\n String hour = Integer.toString(n);\n s = hour + s;\n }\n else if (s.indexOf('A') >= 0 && s.substring(0, 2).equals(\"12\")){\n s = \"00\" + s.substring(2);\n }\n return removeHourFormat(s);\n }", "public String toString()\n {\n return String.format(\"%d:%02d:%02d %s %d/%d/%d\", \n ((getHour() == 0 || getHour() == 12) ? 12 : getHour() % 12),\n getMinute(), getSecond(), (getHour() < 12 ? \"AM\" : \"PM\"), \n \tmonth, day, year);\n }", "public String toString()\n {\n String output = new String();\n output = \"The time is \" + hour + \":\" + min + \":\" + sec + \"\\n\";\n return output;\n }", "public static String getDisplayTimeFormat(Date val) {\n\n\t\tif (val != null) {\n\n\t\t\tSimpleDateFormat format = new SimpleDateFormat(\"hh:mm a\");\n\t\t\treturn \"\" + format.format(val);\n\n\t\t} else {\n\n\t\t\treturn null;\n\n\t\t}\n\n\t}", "public String timeFormatter(int hour, int min) {\n String minString = String.valueOf(min);\n String amOrPm = \"AM\";\n if (hour > 12) {\n hour -= 12;\n amOrPm = \"PM\";\n }\n if (minString.length() < 2) {\n minString = \"0\" + minString;\n }\n return (String.valueOf(hour) + \":\" + minString + \" \" + amOrPm);\n\n }", "public static String getNowTime(){\r\n\t\tDate date = new Date();\r\n\t\tDateFormat format = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\r\n\t\tString time = format.format(date);\r\n\t\treturn time;\r\n\t}", "public String getTime() {\n String pattern = \"yyyy-MM-dd HH:mm:ss\";\n SimpleDateFormat simpleDateFormat = new SimpleDateFormat(pattern);\n\n String date = simpleDateFormat.format(new Date());\n return date;\n }", "private String formatTime(Date dateObject) {\n @SuppressLint(\"SimpleDateFormat\") SimpleDateFormat timeFormat = new SimpleDateFormat(\"h:mm a\");\n return timeFormat.format(dateObject);\n }", "public String formatTime(Date date) {\n String result = \"\";\n if (date != null) {\n result = DateUtility.simpleFormat(date, MEDIUM_TIME_FORMAT);\n }\n return result;\n }", "public String getTime() {\n return time;\n }", "private String formatTime(long length) {\n\t\tString hms = \"\";\n\t\tif(length < 3600000) {\n\t\t\thms = String.format(\"%02d:%02d\",\n\t\t\t\t\tTimeUnit.MILLISECONDS.toMinutes(length) - TimeUnit.HOURS.toMinutes(TimeUnit.MILLISECONDS.toHours(length)),\n\t\t\t\t\tTimeUnit.MILLISECONDS.toSeconds(length) - TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS.toMinutes(length)));\n\t\t} else {\n\t\t\thms = String.format(\"%02d:%02d:%02d\", TimeUnit.MILLISECONDS.toHours(length),\n\t\t\t\t\tTimeUnit.MILLISECONDS.toMinutes(length) - TimeUnit.HOURS.toMinutes(TimeUnit.MILLISECONDS.toHours(length)),\n\t\t\t\t\tTimeUnit.MILLISECONDS.toSeconds(length) - TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS.toMinutes(length)));\n\t\t}\n\n\t\treturn hms;\n\t}", "private static String timeFor(Date date)\n\t{\n\t\tDateFormat df = new InternetDateFormat();\n\t\tString theTime = df.format(date);\n\t\treturn theTime;\n\t}", "public String getNiceTime(){\n\t\treturn sTimeFormat.format(mTime);\n\t}", "public String getAnserTime() {\r\n \tString time=null;\r\n\t\tif(anserTime!=null){\r\n\t\t\tSimpleDateFormat sf=new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\r\n\t\t\ttime=sf.format(anserTime);\r\n\t\t}\r\n return time;\r\n }", "public static String getTimeString() {\n SimpleDateFormat formatter = new SimpleDateFormat(\"EEE MMM dd HH:mm:ss yyyy\");\n return formatter.format(new java.util.Date());\n }", "private static String time() throws Exception {\n\t\tDateFormat dateFormat = new SimpleDateFormat(\"HH-mm-ss \");\n\t\t// get current date time with Date()\n\t\tDate date = new Date();\n\t\t// Now format the date\n\t\tString date1 = dateFormat.format(date);\n\t\t// System.out.println(date1);\n\t\treturn date1;\n\t}", "public String getTime() {\r\n\t\treturn time;\r\n\t}", "public static String tenthsToStringShort(int time) {\r\n\t\t// If we have negative time, just return zero\r\n\t\tif ( time < 0 ) {\r\n\t\t\treturn \"0:00\";\r\n\t\t}\r\n\t\t\r\n\t\tint sec = (time / 10) % 60;\r\n\t\tint min = (time / 10) / 60;\r\n\t\treturn String.format(\"%d:%02d\", min, sec);\r\n\t}", "private String formatTime(final long time) {\n if ( time == 0 ) {\n return \"-\";\n }\n if ( time < 1000 ) {\n return time + \" ms\";\n } else if ( time < 1000 * 60 ) {\n return time / 1000 + \" secs\";\n }\n final long min = time / 1000 / 60;\n final long secs = (time - min * 1000 * 60);\n return min + \" min \" + secs / 1000 + \" secs\";\n }", "private String formatTime(Date dateObject)\n {\n SimpleDateFormat timeFormat = new SimpleDateFormat(\"h:mm a\");\n timeFormat.setTimeZone(Calendar.getInstance().getTimeZone());\n return timeFormat.format(dateObject);\n }", "public static String formatTime(final long ms){\n long s = ms / 1000, m = s / 60, h = m / 60;\n s %= 60; m %= 60; h %= 24;\n return String.format(\"%02d:%02d:%02d\", h, m, s);\n }", "@Override\n\tpublic String getTime() {\n\t\treturn time;\n\t}", "public String getTime() {\n\t\treturn time;\n\t}" ]
[ "0.8043321", "0.7949251", "0.78242105", "0.7722443", "0.7717895", "0.7710452", "0.7529038", "0.75114787", "0.7490902", "0.7477396", "0.7473579", "0.7433354", "0.7423318", "0.74049205", "0.73633647", "0.7354707", "0.73363376", "0.73294455", "0.729434", "0.7292748", "0.728215", "0.723976", "0.721763", "0.7192244", "0.7176089", "0.7168219", "0.71514875", "0.71271574", "0.7117235", "0.70955396", "0.70951647", "0.7087605", "0.7083472", "0.7078474", "0.70490754", "0.7044897", "0.70031697", "0.69925463", "0.69868463", "0.6976836", "0.6963236", "0.6941686", "0.69209933", "0.6906201", "0.68893427", "0.68883216", "0.6886614", "0.687203", "0.68578917", "0.6857528", "0.6857234", "0.6856339", "0.6843484", "0.68379086", "0.6835397", "0.6821675", "0.6816843", "0.6812846", "0.6809351", "0.6793001", "0.6777482", "0.6775671", "0.6773613", "0.67585224", "0.67540985", "0.6747357", "0.67428607", "0.67423624", "0.67385507", "0.67274886", "0.6726134", "0.670817", "0.67053103", "0.6695954", "0.6695954", "0.66772085", "0.667082", "0.6667864", "0.6656009", "0.6649351", "0.66456103", "0.6641682", "0.6634288", "0.66158265", "0.6614704", "0.66141903", "0.6613785", "0.660576", "0.6604637", "0.66009945", "0.6596152", "0.65849686", "0.6583424", "0.6576279", "0.65604776", "0.65503913", "0.6543836", "0.6541815", "0.65297574", "0.6529367" ]
0.79353
2
/ returns true if given event is before this event
public Boolean before(Event event) { int result = this.compareTo(event); if (result < 0) return true; return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean hasPlayedBefore ( ) {\n\t\treturn extract ( handle -> handle.hasPlayedBefore ( ) );\n\t}", "public boolean isSetBefore() {\n return this.before != null;\n }", "public Boolean after(Event event) {\n int result = this.compareTo(event);\n return result > 0;\n }", "public boolean isBefore(Date date)\n {\n return isBefore(new SpentOn(date));\n }", "public boolean isBefore(Group3Date b) {\n\t\t\treturn compareTo(b) < 0;\n\t\t}", "public abstract boolean isBefore(SoSensor s);", "@Override\n\tpublic boolean isEventStarted() {\n\t\treturn status>=EventStarted;\n\t}", "public boolean isBefore(Date b) {\r\n\t\treturn compareTo(b) < 0;\r\n\t}", "public boolean isBefore(AbsTime refEpoch)\n {\n // The result to return\n boolean res;\n\n // Check for special values.\n if (isASAP()) {\n // ASAP is before any other time, except ASAP.\n if (refEpoch.isASAP()) {\n res = false;\n } else {\n res = true;\n }\n } else if (isNEVER()) {\n // NEVER is after any other time, except NEVER.\n res = false;\n } else if (refEpoch.isASAP()) {\n // No time is before ASAP, including ASAP.\n res = false;\n } else if (refEpoch.isNEVER()) {\n // Any time is before NEVER, except NEVER, which is taken care\n // of above.\n res = true;\n } else {\n // Do the comparison.\n res = (itsValue < refEpoch.itsValue);\n }\n\n return res;\n }", "public boolean isBeforeNow() {\r\n return isBefore(DateTimeUtils.currentTimeMillis());\r\n }", "public boolean isBefore(Book b1, Book b2);", "public boolean isBefore(Date that) {\n return compareTo(that) < 0;\n }", "boolean hasEvent();", "public boolean isBefore(@NonNull final CalendarDay other) {\n return date.isBefore(other.getDate());\n }", "public boolean isBeforeImage()\n\t{\n\t\treturn beforeImage;\n\t}", "public boolean isEventCondition() {\n return true;\n }", "public static boolean before(Date target, Date date){\n Calendar cal1 = Calendar.getInstance();\n cal1.setTime(target);\n\n Calendar cal2 = Calendar.getInstance();\n cal2.setTime(date);\n\n if(cal1.compareTo(cal2) == -1) return true;\n return false;\n }", "public boolean before(DependencyElement after) {\n\t\tDependencyElement n = next;\n\t\twhile (n != null) {\n\t\t\tif (n == after) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tn = n.next;\n\t\t}\n\t\treturn false;\n\t}", "public boolean isBefore(Date d2)\r\n\t{\r\n\t\tint ret = this.compareTo(d2);\r\n\t\treturn ret < 0;\r\n\t}", "@Override\n\tpublic boolean \t\t\thasPriorityOver (EventI e)\n\t{\n\t\treturn false;\n\t}", "public boolean hasPrevious()\n {\n // TODO: implement this method\n return false;\n }", "public boolean hasPrev() {\n return cursor != null && ((Entry<T>) cursor).prev!= null && ((Entry) cursor).prev.prev != null;\n }", "@objid (\"0480e45a-6886-42c0-b13c-78b8ab8f713d\")\n boolean isIsEvent();", "public boolean hasPrevious() {\n\t\t\t\treturn false;\r\n\t\t\t}", "boolean isSetEvent();", "public boolean hasPreviousElement() {\n return false;\n }", "public boolean isBefore(SpentOn spentOn)\n {\n return ( (calendar.get(Calendar.YEAR) < spentOn.calendar.get(Calendar.YEAR))\n )\n || ( (calendar.get(Calendar.YEAR) == spentOn.calendar.get(Calendar.YEAR))\n && (calendar.get(Calendar.MONTH) < spentOn.calendar.get(Calendar.MONTH))\n )\n || ( (calendar.get(Calendar.YEAR) == spentOn.calendar.get(Calendar.YEAR))\n && (calendar.get(Calendar.MONTH) == spentOn.calendar.get(Calendar.MONTH))\n && (calendar.get(Calendar.DAY_OF_MONTH) < spentOn.calendar.get(Calendar.DAY_OF_MONTH))\n );\n }", "@Override\r\n\t\tpublic boolean hasPrevious() {\n\t\t\treturn false;\r\n\t\t}", "boolean wasShownBefore(MultiViewElement element) {\n return shownElements.contains(element);\n }", "boolean hasPrevious();", "boolean hasPrevious();", "boolean hasPrevious();", "boolean hasPrevious();", "protected void assertEvent(boolean fExpected)\n {\n Eventually.assertThat(invoking(this).wasInserted(), is(fExpected));\n }", "private boolean shouldProcessEvent(TimeSeriesEvent e) {\r\n return modCountOnLastRefresh < e.getSeriesModCount();\r\n }", "@Override\n\tpublic Position<E> before(Position<E> p) throws IllegalArgumentException {\n\t\tif (this.first() == p) {\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\treturn convert(p).prev;\n\t}", "public IEvent getPreviousEvent();", "public boolean hasPrevious() \n\t{\n\t\tboolean res = false;\n\t\tif(actual != null) {\n\n\t\t\tif(esUltimo && actual != null)\n\t\t\t\tres=true;\n\t\t\telse {\n\t\t\t\tres = actual.darAnterior() != null;\n\t\t\t}\n\t\t}\n\t\treturn res;\n\t}", "private static boolean isInOrderTimestamp(\n long timestamp,\n long prevTimestamp)\n {\n long timestampDiff = timestamp - prevTimestamp;\n\n // Assume that a diff this big must be due to reordering. Don't update\n // with reordered samples.\n return (timestampDiff < 0x80000000L);\n }", "public boolean isSameEvent(Event event) {\n if (this == event) {\n return true;\n } else if (event == null) {\n return false;\n } else {\n return this.getName().equals(event.getName())\n && this.getTime().equals(event.getTime());\n }\n }", "@CheckReturnValue\n public boolean hasPrevious() {\n return offset > 0;\n }", "public boolean isBefore(MonthDay other) {\n if(month < other.month) {\n return true;\n } else if(month == other.month && day < other.day) {\n return true;\n } else {\n return false;\n }\n }", "public boolean isBefore(ReadableInstant instant) {\nCodeCoverCoverageCounter$1ib8k6g9t1mz1yofrpsdr7xlpbrhwxq3l.statements[17]++;\nint CodeCoverConditionCoverageHelper_C5;\r\n if ((((((CodeCoverConditionCoverageHelper_C5 = 0) == 0) || true) && (\n(((CodeCoverConditionCoverageHelper_C5 |= (2)) == 0 || true) &&\n ((instant == null) && \n ((CodeCoverConditionCoverageHelper_C5 |= (1)) == 0 || true)))\n)) && (CodeCoverCoverageCounter$1ib8k6g9t1mz1yofrpsdr7xlpbrhwxq3l.conditionCounters[5].incrementCounterOfBitMask(CodeCoverConditionCoverageHelper_C5, 1) || true)) || (CodeCoverCoverageCounter$1ib8k6g9t1mz1yofrpsdr7xlpbrhwxq3l.conditionCounters[5].incrementCounterOfBitMask(CodeCoverConditionCoverageHelper_C5, 1) && false)) {\nCodeCoverCoverageCounter$1ib8k6g9t1mz1yofrpsdr7xlpbrhwxq3l.branches[9]++;\r\n return isBeforeNow();\n\r\n } else {\n CodeCoverCoverageCounter$1ib8k6g9t1mz1yofrpsdr7xlpbrhwxq3l.branches[10]++;}\r\n return isBefore(instant.getMillis());\r\n }", "@Override\n\t\tpublic int compareTo(Event other) {\n\t\t\tif (this.time < other.time + 1.0e-9) return -1;\n\t\t\telse if (this.time > other.time - 1.0e-9) return 1;\n\t\t\telse {\n\t\t\t\tif(this.active > other.active) return 1;\n\t\t\t\telse return -1;\n\t\t\t}\n\t\t}", "public boolean isPartialBefore(Date b) {\r\n\t\treturn comparePartialTo(b) < 0;\r\n\t}", "@Override\r\n public boolean hasPrevious() {\n return returned.prev != header;\r\n }", "public boolean hasPrevious() {\n\t\tif(prevIndex > -1) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public boolean isBeforeOrEquals(AbsTime refEpoch)\n {\n // The result to return.\n boolean res;\n\n // Check for special values.\n if (isASAP()) {\n // ASAP is before or equal to any time, including ASAP.\n res = true;\n } else if (isNEVER()) {\n // NEVER only before or equal to NEVER.\n if (refEpoch.isNEVER()) {\n res = true;\n } else {\n res = false;\n }\n } else if (refEpoch.isASAP()) {\n // No time is before or equal ASAP, except ASAP, which is already\n // considered above.\n res = false;\n } else if (refEpoch.isNEVER()) {\n // Any time is before or equal to NEVER, including NEVER.\n res = true;\n } else {\n // Do the comparison.\n res = (itsValue <= refEpoch.itsValue);\n }\n\n return res;\n }", "public boolean isBeforeFirst() throws SQLException {\n\n try {\n debugCodeCall(\"isBeforeFirst\");\n checkClosed();\n return result.getRowId() < 0;\n }\n catch (Exception e) {\n throw logAndConvert(e);\n }\n }", "public static final Function<Date,Boolean> before(final Date date) {\r\n return new Before(date);\r\n }", "@Override\n\tpublic boolean beforeHandle(BaseEvent event) {\n\t\treturn false;\n\t}", "public boolean hasPrevious() {\n return position > 0;\n }", "public boolean previous() {\n boolean result = true;\n try {\n element = iterator.previous();\n } catch(NoSuchElementException ex) {\n result = false;\n }\n return result;\n }", "@Override\r\n\tpublic boolean hasPredecessor() {\n\t\treturn false;\r\n\t}", "public static boolean LifecycleBefore(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"LifecycleBefore\")) return false;\n if (!nextTokenIs(b, JB_TOKEN_BEFORE)) return false;\n boolean r, p;\n Marker m = enter_section_(b, l, _NONE_, null);\n r = consumeToken(b, JB_TOKEN_BEFORE);\n p = r; // pin = 1\n r = r && report_error_(b, WhiteSpace(b, l + 1));\n r = p && LifecycleBefore_2(b, l + 1) && r;\n exit_section_(b, l, m, JB_LIFECYCLE_BEFORE, r, p, null);\n return r || p;\n }", "boolean onEvent(Event event);", "public boolean cardPlayedBefore() {\n boolean played = false;\n if (playedCards.size()>0) {\n played = true;\n }\n return played;\n }", "public Optional<Instant> getBefore() {\n\t\t\treturn before;\n\t\t}", "@Override\r\n public boolean hasPrevious() {\r\n if (previous.data == null) {\r\n return false;\r\n }\r\n return true;\r\n }", "boolean hasDeliveryDateBefore();", "public Optional<Instant> getBefore() {\n\t\treturn before;\n\t}", "protected boolean isOrdered(PBFTServerMessage m){\n\n long nextPrePrepareSEQ = getStateLog().getNextPrePrepareSEQ();\n\n if(m != null && m.getSequenceNumber() != null){\n\n long seqn = m.getSequenceNumber();\n\n if(m instanceof PBFTPrePrepare){\n return seqn == nextPrePrepareSEQ;\n }\n }\n\n return false;\n\n }", "public boolean isPredecessor(long sid) {\n return sid == predecessorSid.get();\n }", "public boolean hasPrevious() {\n\t\t\treturn previousPosition < vector.size();\n\t\t}", "Position<T> before(Position<T> p) throws IllegalStateException;", "boolean hasChangeEvent();", "private boolean checkMovePrevious(PositionTracker tracker) {\n\t\t \n\t\t if(tracker.getExactRow() == 0) { //initiate if statement\n\t\t\t if(tracker.getExactColumn() == 0) //initiate if statement\n\t\t\t\t return false; //returns the value false\n\t\t }\n\t\t \n\t\t return true; //returns the boolean value true\n\t }", "public boolean addEvent(Event event) {\n\t\tboolean result = false;\n\t\t/* if event was created */\n\t\tif (event != null && event.getFinal_date() != null && event.getInitial_date() != null) {\n\t\t\tevents.add(event);\n\t\t\tresult = true;\n\t\t}\n\t\treturn result;\n\t}", "public boolean priorTo(OperationOption other) {\n if (Double.compare(priority, other.priority) < 0)\n return true;\n\n if (Double.compare(priority, other.priority) > 0)\n return false;\n\n return operation.getJob().getId() < other.operation.getJob().getId();\n }", "public static boolean isTimeBefore(String time)\n\t{\n\t\treturn isTimeBefore(time, getDateTimeFormat());\n\t}", "public boolean isBefore(Date date2)\n {\n if (year < date2.year)\n return true;\n else if (year == date2.year && month < date2.month)\n return true;\n else if (year == date2.year && month == date2.month && day < date2.day)\n return true;\n else if (year == date2.year && month == date2.month && day == date2.day\n && hour < date2.hour)\n return true;\n else if (year == date2.year && month == date2.month && day == date2.day\n && hour == date2.hour && minute < date2.minute)\n return true;\n else\n return false;\n }", "public boolean isSelfMessageProcessingEvent();", "private boolean isFirstTime() {\n SharedPreferences preferences = getActivity().getPreferences(MODE_PRIVATE);\n boolean ranBefore = preferences.getBoolean(\"RanBefore\", false);\n if (!ranBefore) {\n\n SharedPreferences.Editor editor = preferences.edit();\n editor.putBoolean(\"RanBefore\", true);\n editor.apply();\n mBind.topLayout.setVisibility(View.VISIBLE);\n mBind.topLayout.setOnTouchListener(new View.OnTouchListener() {\n\n @Override\n public boolean onTouch(View v, MotionEvent event) {\n mBind.topLayout.setVisibility(View.INVISIBLE);\n return false;\n }\n\n });\n }\n return ranBefore;\n\n }", "public boolean hasPushEvent();", "public boolean isFirstClick(){\n\t\treturn firsttime;\n\t}", "public boolean hasPrevious() {\r\n \treturn index > 0; \r\n }", "public boolean preaction() {\n\t\tboolean p = true;\r\n\t\tif(!model.setSCVBuilding(2*preactionTime+duration)) { // adding time before and after\r\n\t\t\tp = false;\r\n\t\t}\r\n\t\tif(p) {\r\n\t\t\t//System.out.println(model.printTime() + \" <SCActionBuilding> Preaction\");\r\n\t\t\tpreactionComplete=true;\r\n\t\t}\r\n\t\treturn p;\r\n\t\t\r\n\t}", "public boolean hasEventId() {\n return fieldSetFlags()[13];\n }", "@Override\n public boolean evaluate(Event event) {\n return true;\n }", "@Description(\"request was sent before {date}\")\n public static Criteria<HarEntry> recordedStartedDateTimeBefore(@DescriptionFragment(\"date\") Date date) {\n checkArgument(nonNull(date), \"Date should be defined\");\n\n return condition(entry -> {\n Date startedDateTime = entry.getStartedDateTime();\n\n return startedDateTime.before(date);\n });\n }", "Date PrevEvent(Date d);", "public boolean isBeforeFirst() throws SQLException {\n/* 151 */ return (this.currentPositionInEntireResult < 0);\n/* */ }", "public boolean hasNextEvent() {\n \treturn next != null;\n }", "public boolean isBefore(final String date1, final String date2) {\n return compare(date1, date2) < 0;\n }", "public boolean hasEventTimestamp() {\n return fieldSetFlags()[14];\n }", "@Override\n public boolean hasPrevious()\n {\n if(left == null)\n {\n return false;\n }\n else\n {\n return true;\n }\n }", "public boolean isLower(DateTime dt) {\n return Long.parseLong(this.vStamp) < Long.parseLong(dt.getStamp());\r\n }", "public boolean isCorrectEvent()\n {\n return m_fCorrectEvent;\n }", "public boolean isFirst() {\n\t\treturn (prev == null);\n\t}", "public boolean wasJustPressed() {\n\t\treturn (mNow && (!mLast));\n\t}", "public BwCalendar fetchBeforeCalendar() {\n return beforeCalendar;\n }", "public boolean isBefore(People p){\n\t\t//If P is higher age\n\t\tif( this.age==7 && p.age!=7)\n\t\t\treturn true;\n\t\t//If current is professor\n\t\tif(this.age!=7 && this.age!=8){\n\t\t\treturn p.age ==8;\n\t\t}\n\t\t//If p is professor\n\t\tif(p.age!=7 && p.age!=8){\n\t\t\treturn this.age ==7;\n\t\t}\n\t\t//If current is 8\n\t\tif(this.age==8 && p.age==7){\n\t\t\treturn false;\n\t\t}\n\t\t//Same age - age 7\n\t\tif(this.age== p.age && this.age==7){\n\t\t\treturn this.height <= p.height;\n\t\t}\n\t\tif(this.age== p.age && this.age==8){\n\t\t\treturn this.height >= p.height;\n\t\t}\n\t\tSystem.out.println(\"Some Error!!\"+this.age+\" \"+this.height+\" \"+p.age+\" \"+p.height);\n\t\treturn false;\n\t}", "protected boolean shouldStartEditingTimer(EventObject event) {\n\tif((event instanceof MouseEvent) &&\n\t SwingUtilities.isLeftMouseButton((MouseEvent)event)) {\n\t MouseEvent me = (MouseEvent)event;\n\n\t return (me.getClickCount() == 1 &&\n\t\t inHitRegion(me.getX(), me.getY()));\n\t}\n\treturn false;\n }", "@Override\r\n\tpublic boolean isLessThan(Node node) {\n\t\treturn false;\r\n\t}", "public boolean isFirstClick() {\n return firstClick;\n }", "private boolean isLeftButtonEvent(MouseEvent me) {\r\n\t\treturn ((me.getModifiers() & MouseEvent.BUTTON1_MASK) == MouseEvent.BUTTON1_MASK);\r\n\t}", "public boolean isFirstClickCompMove() {\n return firstClickCompMove;\n }", "public boolean shouldHaveArrivedEarlier(int sID);", "public boolean isInFrontOf(CoordinateImpl coordinate) {\n return rank > coordinate.getRank();\n }", "public boolean hasPrevious() {\n return getPage() > 0;\n }" ]
[ "0.69310045", "0.6829495", "0.67855406", "0.66013294", "0.64792156", "0.6446922", "0.63571596", "0.6341764", "0.6198244", "0.61819893", "0.6174917", "0.61356527", "0.610951", "0.60474855", "0.60258555", "0.59890616", "0.59023166", "0.58961165", "0.5856654", "0.58360034", "0.5802002", "0.5791921", "0.57687575", "0.5751599", "0.5743776", "0.56848997", "0.566762", "0.5665281", "0.565047", "0.5646601", "0.5646601", "0.5646601", "0.5646601", "0.56364524", "0.5632748", "0.56187564", "0.55943584", "0.5579364", "0.55772233", "0.55695057", "0.5569048", "0.55648774", "0.55577755", "0.5551065", "0.5543702", "0.55431503", "0.5536075", "0.5530879", "0.5523905", "0.5520862", "0.55184036", "0.5515713", "0.55109245", "0.55027634", "0.54984754", "0.54920316", "0.54911053", "0.546203", "0.54560035", "0.5440655", "0.5439172", "0.5436643", "0.5431821", "0.5420329", "0.54100996", "0.54095286", "0.5404546", "0.5391883", "0.5387228", "0.53699815", "0.53684527", "0.5367403", "0.53612745", "0.5360525", "0.53528637", "0.53479767", "0.5345689", "0.5340681", "0.5340583", "0.53339493", "0.5321934", "0.53216124", "0.530305", "0.5293037", "0.52838564", "0.5266735", "0.52538466", "0.52535033", "0.5251925", "0.52476597", "0.5246918", "0.5245233", "0.5239997", "0.5233701", "0.5228307", "0.52230024", "0.5221292", "0.5210322", "0.52014554", "0.5200471" ]
0.8579671
0
/ returns true if given event is after this event
public Boolean after(Event event) { int result = this.compareTo(event); return result > 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Boolean before(Event event) {\n int result = this.compareTo(event);\n if (result < 0) return true;\n return false;\n }", "public boolean isSetAfter() {\n return this.after != null;\n }", "@Override\n public boolean isAfterLast() {\n boolean result = true;\n if (mCalllogDatas != null) {\n result = (mIndex >= mCalllogDatas.size()) ? true : false;\n }\n\n MyLogger.logD(CLASS_TAG, \"isAfterLast():\" + result);\n return result;\n }", "public boolean after(DependencyElement before) {\n\t\tDependencyElement p = prev;\n\t\twhile (p != null) {\n\t\t\tif (p == before) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tp = p.prev;\n\t\t}\n\t\treturn false;\n\t}", "public boolean isAfter(Date date)\n {\n return isAfter(new SpentOn(date));\n }", "public boolean isAfter(Group3Date b) {\n\t\t\treturn compareTo(b) > 0;\n\t\t}", "boolean hasEvent();", "protected void assertEvent(boolean fExpected)\n {\n Eventually.assertThat(invoking(this).wasInserted(), is(fExpected));\n }", "@Override\n\tpublic boolean isEventComplete() {\n\t\treturn status==EventCompleted;\n\t}", "boolean hasLastAction();", "public boolean isAfter(Date b) {\r\n\t\treturn compareTo(b) > 0;\r\n\t}", "public boolean hasNextEvent() {\n \treturn next != null;\n }", "public boolean isAfterNow() {\r\n return isAfter(DateTimeUtils.currentTimeMillis());\r\n }", "public boolean handleEvent(Event e){\r\n\t\tthis.handledEvents++;\r\n\t\tif(this.ptModes.contains(super.getMode())){\r\n\t\t\thandler.handleEvent(e);\r\n\t\t\tif(this.handledEvents == this.nrOfExpEvents){\r\n\t\t\t\thandler.finish(this);\r\n\t\t\t\treturn true;\r\n\t\t\t}else{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(first == null){\r\n\t\t\t\tfirst = e.getTime();\r\n\t\t\t}else{\r\n\t\t\t\tlast = e.getTime();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.handledEvents == nrOfExpEvents){\r\n\t\t\t\tthis.tripTTime = last - first;\r\n\t\t\t\treturn true;\r\n\t\t\t}else{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}", "private boolean shouldProcessEvent(TimeSeriesEvent e) {\r\n return modCountOnLastRefresh < e.getSeriesModCount();\r\n }", "public boolean wasJustPressed() {\n\t\treturn (mNow && (!mLast));\n\t}", "public boolean isAfter(Date that) {\n return compareTo(that) > 0;\n }", "boolean onEvent(Event event);", "public boolean isAfter(AbsTime refEpoch)\n {\n return !isBeforeOrEquals(refEpoch);\n }", "@objid (\"0480e45a-6886-42c0-b13c-78b8ab8f713d\")\n boolean isIsEvent();", "private boolean eventOccured(History.HistoryView stateHistory){\n\t\tif(step-lastEvent >= maxStepInterval){\n\t\t\treturn true;\n\t\t}\n\t\telse{\n\t\t\t// Check deaths of our footmen\n\t\t\tboolean event = deathOccured(stateHistory, playernum);\n\t\t\t// Check deaths of enemy footmen\n\t\t\tevent = event || deathOccured(stateHistory, playernum);\n\t\t\t// Check if footmen has been hurt\n\t\t\tevent = event || hasBeenDamaged(stateHistory, playernum);\n\t\t\treturn event;\n\t\t}\n\t}", "public boolean isAfter(@NonNull final CalendarDay other) {\n return date.isAfter(other.getDate());\n }", "public boolean isEventCondition() {\n return true;\n }", "public boolean firedRecently(double time);", "public boolean ready() {\n diff = eventTime - System.currentTimeMillis(); //Step 4,5\n return System.currentTimeMillis() >= eventTime;\n }", "private boolean repostIfFollowsKeyEvents(WindowEvent paramWindowEvent)\n/* */ {\n/* 282 */ if (!(paramWindowEvent instanceof TimedWindowEvent)) {\n/* 283 */ return false;\n/* */ }\n/* 285 */ TimedWindowEvent localTimedWindowEvent = (TimedWindowEvent)paramWindowEvent;\n/* 286 */ long l = localTimedWindowEvent.getWhen();\n/* 287 */ synchronized (this) {\n/* 288 */ KeyEvent localKeyEvent = this.enqueuedKeyEvents.isEmpty() ? null : (KeyEvent)this.enqueuedKeyEvents.getFirst();\n/* 289 */ if ((localKeyEvent != null) && (l >= localKeyEvent.getWhen())) {\n/* 290 */ TypeAheadMarker localTypeAheadMarker = this.typeAheadMarkers.isEmpty() ? null : (TypeAheadMarker)this.typeAheadMarkers.getFirst();\n/* 291 */ if (localTypeAheadMarker != null) {\n/* 292 */ Window localWindow = localTypeAheadMarker.untilFocused.getContainingWindow();\n/* */ \n/* */ \n/* 295 */ if ((localWindow != null) && (localWindow.isFocused())) {\n/* 296 */ SunToolkit.postEvent(AppContext.getAppContext(), new SequencedEvent(paramWindowEvent));\n/* 297 */ return true;\n/* */ }\n/* */ }\n/* */ }\n/* */ }\n/* 302 */ return false;\n/* */ }", "@GuardedBy(\"mLock\")\n private boolean shouldSendEvent(TimeZoneProviderEvent newEvent) {\n if (!newEvent.isEquivalentTo(mLastEventSent)) {\n return true;\n }\n\n // Guard against implementations that generate a lot of uninteresting events in a short\n // space of time and would cause the time_zone_detector to evaluate time zone suggestions\n // too frequently.\n //\n // If the new event and last event sent are equivalent, the client will still send an update\n // if their creation times are sufficiently different. This enables the time_zone_detector\n // to better understand how recently the location time zone provider was certain /\n // uncertain, which can be useful when working out ordering of events, e.g. to work out\n // whether a suggestion was generated before or after a device left airplane mode.\n long timeSinceLastEventMillis =\n newEvent.getCreationElapsedMillis() - mLastEventSent.getCreationElapsedMillis();\n return timeSinceLastEventMillis > mEventFilteringAgeThresholdMillis;\n }", "public boolean inDelaySlot() {\r\n\t\treturn !empty() && backSteps.peek().inDelaySlot;\r\n\t}", "public boolean isNextClockChangeCalled();", "public boolean isAfter(Date d2)\r\n\t{\r\n\t\tint ret = this.compareTo(d2);\r\n\t\treturn ret > 0;\r\n\t}", "public boolean hasPassed(final long delta){\n return stamp + delta <= System.currentTimeMillis();\n }", "public boolean isCorrectEvent()\n {\n return m_fCorrectEvent;\n }", "public boolean match(Event e);", "public boolean isPartialAfter(Date b) {\r\n\t\treturn comparePartialTo(b) > 0;\r\n\t}", "public boolean isAfter(ReadableInstant instant) {\nCodeCoverCoverageCounter$1ib8k6g9t1mz1yofrpsdr7xlpbrhwxq3l.statements[19]++;\nint CodeCoverConditionCoverageHelper_C7;\r\n if ((((((CodeCoverConditionCoverageHelper_C7 = 0) == 0) || true) && (\n(((CodeCoverConditionCoverageHelper_C7 |= (2)) == 0 || true) &&\n ((instant == null) && \n ((CodeCoverConditionCoverageHelper_C7 |= (1)) == 0 || true)))\n)) && (CodeCoverCoverageCounter$1ib8k6g9t1mz1yofrpsdr7xlpbrhwxq3l.conditionCounters[7].incrementCounterOfBitMask(CodeCoverConditionCoverageHelper_C7, 1) || true)) || (CodeCoverCoverageCounter$1ib8k6g9t1mz1yofrpsdr7xlpbrhwxq3l.conditionCounters[7].incrementCounterOfBitMask(CodeCoverConditionCoverageHelper_C7, 1) && false)) {\nCodeCoverCoverageCounter$1ib8k6g9t1mz1yofrpsdr7xlpbrhwxq3l.branches[13]++;\r\n return isAfterNow();\n\r\n } else {\n CodeCoverCoverageCounter$1ib8k6g9t1mz1yofrpsdr7xlpbrhwxq3l.branches[14]++;}\r\n return isAfter(instant.getMillis());\r\n }", "public boolean overlap(Event e)\n\t{\n\t\tTimeInterval compare = e.getTI();\n\t\tif ((compare.st.getHour() <= this.st.getHour()) && (this.st.getHour() <= compare.et.getHour()))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse if ((this.st.getHour() <= compare.st.getHour()) && (compare.st.getHour() <= this.et.getHour()))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public boolean ended() {\r\n\t\tif (System.nanoTime() >= timeKeyB) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "@Override\n\t\tpublic int compareTo(Event other) {\n\t\t\tif (this.time < other.time + 1.0e-9) return -1;\n\t\t\telse if (this.time > other.time - 1.0e-9) return 1;\n\t\t\telse {\n\t\t\t\tif(this.active > other.active) return 1;\n\t\t\t\telse return -1;\n\t\t\t}\n\t\t}", "@Override\r\n\tpublic boolean offerLast(E e) {\n\t\treturn false;\r\n\t}", "public boolean shouldTrack( ScannedRobotEvent e )\r\n {\n return ( enemy.none() || e.getDistance() < enemy.getDistance() - 70\r\n || e.getName().equals( enemy.getName() ) );\r\n }", "public boolean addEvent(Event event)\n {\n for(Event temp: events)\n {\n if(temp.isTimeConflict(event))\n {\n return false;\n }\n }\n\n this.events.add(event);\n return true;\n }", "boolean hasDeliveryDateAfter();", "public boolean isAfterLast() {\n/* 125 */ return (this.lastRowFetched && this.currentPositionInFetchedRows > this.fetchedRows.size());\n/* */ }", "@Override\n public boolean evaluate(Event event) {\n return true;\n }", "public boolean hasLapsed(int currentTime) {\n\t\tint currentTimeInSecs = currentTime;\n\t\tif (orderTimeInSecs < currentTimeInSecs) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public boolean hasNextEvent() throws IOException;", "@Override\n\tpublic boolean \t\t\thasPriorityOver (EventI e)\n\t{\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean apply(Event event1, Event event2) {\n\t\tif (event1.getEventType().equals(EventType.BREAK_START) &&\n\t\t\t\tevent2.getEventType().equals(EventType.BREAK_END)) {\n\t\t\treturn true;\n\t\t}\n\t\t\t\n\t\treturn false;\n\t}", "public boolean isAvailable(Event event){\n\t\tfor(Event e : events){\n\t\t\tif(e.timeOverlap(event))\n\t\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "@Override\n\t@Transient\n\tpublic String getEventType() {\n\t\treturn \"AFTER\";\n\t}", "public static boolean lastCheckpointReached(Order order) {\n\t\treturn (order.getCheckpoint3()!=null && order.getCheckpoint3().exists()) ? order.isReachedCheckpoint3() :\n\t\t\t(order.getCheckpoint2()!=null && order.getCheckpoint2().exists()) ? order.isReachedCheckpoint2() :\n\t\t\t(order.getCheckpoint1()!=null && order.getCheckpoint1().exists()) ? order.isReachedCheckpoint1() : true;\n\t}", "protected boolean isFinished() {\n\tif(this.motionMagicEndPoint >0) {\n \tif(Math.abs(RobotMap.motorLeftTwo.get() )< 0.09 && Math.abs(RobotMap.motorRightTwo.get() )> -0.09&& Timer.getFPGATimestamp()-starttime > 10) {\n \t\treturn true;\n \t}\n\t}\n\t\n return false;\n }", "@Override\n\tpublic boolean isCallbackOrderingPostreq(org.projectfloodlight.openflow.protocol.OFType type, String name) {\n\t\treturn false;\n\t}", "public boolean isEventUpdated(Event event) \n\t{\n\t\treturn false;\n\t}", "public boolean isAfterLast() throws SQLException {\n\n try {\n debugCodeCall(\"isAfterLast\");\n checkClosed();\n int row = result.getRowId();\n int count = result.getRowCount();\n return row >= count || count == 0;\n }\n catch (Exception e) {\n throw logAndConvert(e);\n }\n }", "boolean isSetEvent();", "@Override\n\tpublic boolean isEventStarted() {\n\t\treturn status>=EventStarted;\n\t}", "boolean hasPerformAt();", "public boolean isSelfMessageProcessingEvent();", "public boolean before(DependencyElement after) {\n\t\tDependencyElement n = next;\n\t\twhile (n != null) {\n\t\t\tif (n == after) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tn = n.next;\n\t\t}\n\t\treturn false;\n\t}", "public Optional<Boolean> isDestinationPositionAfter();", "public boolean isAfterOrEquals(AbsTime refEpoch)\n {\n return !isBefore(refEpoch);\n }", "public boolean isAtEnd()\n\t{\n\t\treturn (lineNow >= lineTime);\n\t}", "public boolean isLastPhase ()\n {\n return true;\n }", "public final static synchronized boolean getNextDeviceEvent(Event event, LinuxEventDevice device) throws IOException {\n\t\twhile (device.getNextEvent(linux_event)) {\n\t\t\tLinuxAxisDescriptor descriptor = linux_event.getDescriptor();\n\t\t\tLinuxComponent component = device.mapDescriptor(descriptor);\n\t\t\tif (component != null) {\n\t\t\t\tfloat value = component.convertValue(linux_event.getValue(), descriptor);\n\t\t\t\tevent.set(component, value, linux_event.getNanos());\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public boolean isAfterLast() throws SQLException\n {\n return m_rs.isAfterLast();\n }", "protected boolean isFinished() {\n logger.info(\"Ending left drive\");\n \treturn timer.get()>howLongWeWantToMove;\n }", "public boolean hasPlayedBefore ( ) {\n\t\treturn extract ( handle -> handle.hasPlayedBefore ( ) );\n\t}", "public boolean addEvent(Event event) {\n\t\tboolean result = false;\n\t\t/* if event was created */\n\t\tif (event != null && event.getFinal_date() != null && event.getInitial_date() != null) {\n\t\t\tevents.add(event);\n\t\t\tresult = true;\n\t\t}\n\t\treturn result;\n\t}", "boolean isCalledNext();", "public boolean shouldTrack( ScannedRobotEvent e )\n {\n // track if we have no enemy, the one we found is significantly\n // closer, or we scanned the one we've been tracking.\n return ( enemy.none() || e.getDistance() < enemy.getDistance() - 70\n || e.getName().equals( enemy.getName() ) );\n }", "@Override\n protected boolean isFinished() {\n return Timer.getFPGATimestamp()-startT >= 1.5;\n }", "public boolean getMoveCompletedEndsBack()\r\n {\r\n return (m_moveCompletedEndsBack);\r\n }", "boolean hasPrevious();", "boolean hasPrevious();", "boolean hasPrevious();", "boolean hasPrevious();", "public static boolean LifecycleAfter(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"LifecycleAfter\")) return false;\n if (!nextTokenIs(b, JB_TOKEN_AFTER)) return false;\n boolean r, p;\n Marker m = enter_section_(b, l, _NONE_, null);\n r = consumeToken(b, JB_TOKEN_AFTER);\n p = r; // pin = 1\n r = r && report_error_(b, WhiteSpace(b, l + 1));\n r = p && LifecycleAfter_2(b, l + 1) && r;\n exit_section_(b, l, m, JB_LIFECYCLE_AFTER, r, p, null);\n return r || p;\n }", "public static boolean isTimeAfter(String time)\n\t{\n\t\treturn isTimeAfter(time, getDateTimeFormat());\n\t}", "@Override\r\n public boolean addEvent(Events event) {\r\n java.text.SimpleDateFormat SQL_Datetime = new java.text.SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\r\n String currentTime = SQL_Datetime.format(LocalDateTime.now());\r\n String EventDatetime = SQL_Datetime.format( event.getDate());\r\n \r\n if (currentTime.compareTo(EventDatetime)<0) {\r\n return false;\r\n }\r\n else {\r\n em.persist(event);\r\n }\r\n return true;\r\n }", "public abstract boolean isBefore(SoSensor s);", "public boolean isSameEvent(Event event) {\n if (this == event) {\n return true;\n } else if (event == null) {\n return false;\n } else {\n return this.getName().equals(event.getName())\n && this.getTime().equals(event.getTime());\n }\n }", "public boolean onTarget(long timestamp)\n {\n return compareToTimestamp(timestamp) == 0;\n }", "protected boolean isFinished() {\n //boolean onTarget = Math.abs(\n //encoderValue - Math.abs(Robot.arm.getArmEncoderValue())) <= RobotMap.ArmConstants.ARM_ENCODER_BUFFER;\n boolean hasBeenZeroed = Robot.arm.hasButtonBeenPressed();\n boolean onTarget = false;\n if(initialPos < setpoint) {\n onTarget = Math.abs(Robot.arm.getArmEncoderValue()) >= setpoint;\n }else if(initialPos >= setpoint) {\n onTarget = Math.abs(Robot.arm.getArmEncoderValue()) <= setpoint;\n }\n return this.isTimedOut() || !hasBeenZeroed || onTarget;\n }", "public boolean isDone()\n {\n return (this.elapsed >= this.duration);\n }", "protected boolean isFinished() {\n\t\treturn Robot.elevator.isInPosition(newPosition, direction);\n\t}", "protected boolean isFinished() {\r\n if (Math.abs(motorWithEncoder.getSetpoint() - motorWithEncoder.getPosition()) < 0.5) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }", "protected boolean isOrdered(PBFTServerMessage m){\n\n long nextPrePrepareSEQ = getStateLog().getNextPrePrepareSEQ();\n\n if(m != null && m.getSequenceNumber() != null){\n\n long seqn = m.getSequenceNumber();\n\n if(m instanceof PBFTPrePrepare){\n return seqn == nextPrePrepareSEQ;\n }\n }\n\n return false;\n\n }", "public boolean wasJustReleased() {\n\t\treturn (!mNow && mLast);\n\t}", "private void waitForEventToBeExecuted( LogEventRequest packedEvent, LogEvent event,\n boolean waitMoreTime ) {\n\n synchronized (listenerMutex) {\n\n //we need to wait for the event to be handled\n queue.add(packedEvent);\n\n try {\n\n // Start waiting and release the lock. The queue processing thread will notify us after the event is\n // handled or if an exception occurs. In case handling the event hangs - we put some timeout\n long startTime = System.currentTimeMillis();\n long timeout = EVENT_WAIT_TIMEOUT;\n if (waitMoreTime) {\n timeout = EVENT_WAIT_LONG_TIMEOUT;\n }\n\n listenerMutex.wait(timeout);\n\n if (System.currentTimeMillis() - startTime > timeout - 100) {\n atsConsoleLogger.warn(\"The expected \"\n + event.getClass().getSimpleName()\n + \" logging event did not complete in \" + timeout + \" ms\");\n }\n } catch (InterruptedException ie) {\n throw new DbAppenederException(TimeUtils.getFormattedDateTillMilliseconds()\n + \": \"\n + \"Main thread interrupted while waiting for event \"\n + event.getClass().getSimpleName(), ie);\n }\n }\n\n //check for exceptions - if they are none, then we are good to go\n checkForExceptions();\n\n //this event has already been through the queue\n }", "@Override\r\n public boolean hasPrevious() {\n return returned.prev != header;\r\n }", "public boolean hasPrevious()\n {\n // TODO: implement this method\n return false;\n }", "public boolean isAfter(MonthDay other) {\n if(month > other.month) {\n return true;\n } else if(month == other.month && day > other.day) {\n return true;\n } else {\n return false;\n }\n }", "@Override\n\tprotected boolean isFinished() {\n\t\treturn (System.currentTimeMillis() > Endtime);\n\t}", "public boolean isAfterPos(int ipos) {\n return this.base.isAfterPos(ipos);\n }", "boolean hasChangeEvent();", "@CheckReturnValue\n public boolean hasPrevious() {\n return offset > 0;\n }", "boolean hasEvents() {\n return !currentSegment.isEmpty() || !historySegments.isEmpty();\n }", "public boolean hasPreviousElement() {\n return false;\n }", "public boolean onLastCoordinate() {\n\t\treturn Matrix.INSTANCE.onLastMatrixCoordinate(this.location, this);\n\t}" ]
[ "0.6365171", "0.62515247", "0.6226535", "0.61835295", "0.6140682", "0.6107336", "0.60582143", "0.598686", "0.59650207", "0.59072", "0.59060645", "0.58538145", "0.5763308", "0.57312405", "0.5703181", "0.56517994", "0.5650676", "0.56300676", "0.5622933", "0.56210685", "0.5617772", "0.5575481", "0.5548333", "0.5537417", "0.5513752", "0.5493495", "0.5477549", "0.5469064", "0.54584897", "0.54409796", "0.54268396", "0.54112345", "0.5399306", "0.5373634", "0.53723216", "0.5362998", "0.53534126", "0.5330914", "0.5307135", "0.5303859", "0.53013396", "0.52989596", "0.52887595", "0.52703214", "0.52640575", "0.5262195", "0.5245253", "0.52400655", "0.5234131", "0.52334523", "0.523101", "0.52187496", "0.5212085", "0.5206005", "0.51996124", "0.5197125", "0.518836", "0.51854986", "0.51854837", "0.5179656", "0.5160947", "0.5155005", "0.51548606", "0.5149977", "0.5146707", "0.5146505", "0.5143131", "0.5133345", "0.5132297", "0.5120331", "0.5116887", "0.5114027", "0.51130444", "0.51101375", "0.51101375", "0.51101375", "0.51101375", "0.51051503", "0.5103644", "0.5102587", "0.5101886", "0.5097179", "0.50887334", "0.50847924", "0.50770813", "0.5076378", "0.50732195", "0.50569755", "0.5054146", "0.5050033", "0.5039765", "0.5038921", "0.5035281", "0.50345534", "0.50328237", "0.5031915", "0.5023828", "0.5014891", "0.5010443", "0.5000945" ]
0.85238916
0
/ returns true if given is on the same day as this event
public Boolean sameDay(Event event) { int year_given = event.getDate().get(Calendar.YEAR); int month_given = event.getDate().get(Calendar.MONTH); int day_given = event.getDate().get(Calendar.DATE); int year = this.getDate().get(Calendar.YEAR); int month = this.getDate().get(Calendar.MONTH); int day = this.getDate().get(Calendar.DATE); return (year == year_given) && (month == month_given) && (day == day_given); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean hasToDay();", "boolean hasFromDay();", "boolean hasDay();", "boolean hasDay();", "boolean hasContinuousDay();", "public boolean occursOn(int year, int month, int day){\n if (day == mDay){\n return true;\n }\n else {\n return false;\n }\n }", "public boolean wasToday() {\n\t\tlong endInMillis = endTime.getTime();\n\t\tCalendar endTimeDate = Calendar.getInstance();\n\t\tendTimeDate.setTimeInMillis(endInMillis);\n\t\tCalendar today = Calendar.getInstance();\n\t\tif (today.get(Calendar.YEAR) == endTimeDate.get(Calendar.YEAR) && today.get(Calendar.DAY_OF_YEAR) == endTimeDate.get(Calendar.DAY_OF_YEAR)) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "private boolean checkIfHabitDoneToday() {\n ArrayList<HabitEvent> eventList = habit_type.getHabitEvents();\n Locale locale = new Locale(\"English\", \"Canada\");\n SimpleDateFormat simpleDateFormat = new SimpleDateFormat(\"EEEE',' MMMM d',' yyyy\", locale);\n String currentDate = simpleDateFormat.format(new Date());\n Calendar calendar = Calendar.getInstance();\n int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK);\n if (dayOfWeek == 1) {\n dayOfWeek = 8;\n }\n if (!habit_type.getWeeklyPlan()[dayOfWeek - 2]) {\n return true;\n }\n for (HabitEvent event : eventList) {\n if (currentDate.equals(event.getCompletionDateString())) {\n return true;\n }\n }\n return false;\n }", "public boolean isSameEvent(Event event) {\n if (this == event) {\n return true;\n } else if (event == null) {\n return false;\n } else {\n return this.getName().equals(event.getName())\n && this.getTime().equals(event.getTime());\n }\n }", "public boolean equals(Date d) {\r\n if (month == d.getMonth() && day == d.getDay()) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }", "public boolean occursOn(int year, int month, int day) {\n\t\tif (year == onetimeAppt.get(Calendar.YEAR)) {\n\t\t\tif (month == onetimeAppt.get(Calendar.MONTH)) {\n\t\t\t\tif (day == onetimeAppt.get(Calendar.DATE)) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "private boolean isNewDay(Calendar calDate) {\n\t\tif (days.size() == 0)\r\n\t\t\treturn true;\r\n\r\n\t\t// get the last day entry\r\n\t\tDay day = days.get(days.size() - 1);\r\n\r\n\t\t// we have a new day if\r\n\t\t// 1a. the previous day was different OR\r\n\t\t// 1b. the previous day last entry was before the day begins AND\r\n\t\t// 2. if the time is after a certain hour (i.e. 4 a.m.) AND\r\n\t\t// 3. more then X number of hours have passed since anything changed\r\n\t\tif (calDate.get(Calendar.HOUR_OF_DAY) > Day.BEGINING_HOUR_OF_DAY\r\n\t\t\t\t&& (day.lastTime.get(Calendar.DAY_OF_YEAR) < calDate.get(Calendar.DAY_OF_YEAR) || day.lastTime\r\n\t\t\t\t\t\t.get(Calendar.HOUR_OF_DAY) < Day.BEGINING_HOUR_OF_DAY)) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}", "public boolean equals(Object obj) {\n if(obj instanceof CalendarEvent) {\n CalendarEvent event = (CalendarEvent) obj;\n if (event.getDate().equalsIgnoreCase(this.date) && event.getTimeOccurring().equalsIgnoreCase(this.getTimeOccurring()) &&\n event.getTitle().equalsIgnoreCase(this.title) && event.getType() == this.type) {\n return true;\n }\n }\n return false;\n\n }", "private boolean isEasterMonday(final Calendar date) {\n Calendar paquesMonday = getEasterDate(date.get(Calendar.YEAR));\n paquesMonday.add(Calendar.DATE, 1);\n return date.get(Calendar.DAY_OF_YEAR) == paquesMonday\n .get(Calendar.DAY_OF_YEAR)\n && date.get(Calendar.MONTH) == paquesMonday.get(Calendar.MONTH);\n }", "public boolean checkDate(){\n Calendar c = Calendar.getInstance();\n Date currentDate = new Date(c.get(Calendar.DAY_OF_MONTH),c.get(Calendar.MONTH)+1, c.get(Calendar.YEAR));\n return (isEqualOther(currentDate) || !isEarlyThanOther(currentDate));\n\n }", "public boolean runsOn( GTFSDate date ) {\n\t\tif( date.before( this.start_date) ) {\n\t\t\tthrow new DateOutOfBoundsException( date+\" is before period start \"+this.start_date );\n\t\t}\n\t\tif( date.after( this.end_date) ) {\n\t\t\tthrow new DateOutOfBoundsException( date+\" is after period end \"+this.end_date );\n\t\t}\n\t\t\n\t\t//Return false if service is canceled on this day; true of it specifically runs\n\t\tServiceCalendarDate exception = this.getServiceCalendarDate(date);\n\t\tif(exception != null) {\n\t\t\tif( exception.exception_type.intValue() == ServiceCalendarDateExceptionType.ADDED ) {\n\t\t\t\treturn true;\n\t\t\t} else if( exception.exception_type.intValue() == ServiceCalendarDateExceptionType.REMOVED ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Return true if it runs on today's DOW\n\t\tGregorianCalendar cal = new GregorianCalendar(date.year,date.month-1,date.day);\n\t\tint dow = cal.get(GregorianCalendar.DAY_OF_WEEK);\n\t\tif((dow==GregorianCalendar.MONDAY && this.monday.val ) ||\n\t\t (dow==GregorianCalendar.TUESDAY && this.tuesday.val ) ||\n\t\t (dow==GregorianCalendar.WEDNESDAY && this.wednesday.val) ||\n\t\t (dow==GregorianCalendar.THURSDAY && this.thursday.val ) ||\n\t\t (dow==GregorianCalendar.FRIDAY && this.friday.val ) ||\n\t\t (dow==GregorianCalendar.SATURDAY && this.saturday.val ) ||\n\t\t (dow==GregorianCalendar.SUNDAY && this.sunday.val )) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "private boolean isEqualDate(DateStruct d1, DateStruct d2)\n {\n boolean isEqual = false;\n if ( d1.year == d2.year && d1.month == d2.month && d1.day == d2.day )\n {\n isEqual = true;\n }\n return isEqual;\n }", "public static boolean isSingleDayEvent(String test) {\n String[] components = test.split(\" \");\n String startTime = components[1];\n\n //If the format is dd/mm/yyyy hhmm k\n if (components.length == 3) {\n String duration = components[2];\n return endOnTheSameDay (startTime, duration);\n //If the format is dd/mm/yyyy hhmm to hhmm\n } else if (components.length == 4) {\n String endtime = components[3];\n return endTimeAfterStart(startTime, endtime);\n } else {\n return false;\n }\n }", "boolean hasOrderByDay();", "public boolean hasToDay() {\n return toDay_ != null;\n }", "public static boolean isSameDay(Date date1, Date date2) {\n if (date1 == null || date2 == null) {\n throw new IllegalArgumentException(\"The dates must not be null\");\n }\n Calendar cal1 = Calendar.getInstance();\n cal1.setTime(date1);\n Calendar cal2 = Calendar.getInstance();\n cal2.setTime(date2);\n return isSameDay(cal1, cal2);\n }", "public boolean dateIsEqual(Date date){\n\t\tboolean isEqual=true;\n\t\t\n\t\tif(!(date.getMonth()==month && date.getYear()==year && date.getDay()==day)){\n\t\t\tisEqual=false;\n\t\t\t\n\t\t}\n\t\t\n\t\treturn isEqual;\n\t}", "public static boolean isToday(Date date) {\r\n\t\treturn isSameDay(date, Calendar.getInstance().getTime());\r\n\t}", "public static boolean isSameDay(Date date1, Date date2) {\r\n\t\tif (date1 == null || date2 == null) {\r\n\t\t\tthrow new IllegalArgumentException(\"The dates must not be null\");\r\n\t\t}\r\n\t\tCalendar cal1 = Calendar.getInstance();\r\n\t\tcal1.setTime(date1);\r\n\t\tCalendar cal2 = Calendar.getInstance();\r\n\t\tcal2.setTime(date2);\r\n\t\treturn isSameDay(cal1, cal2);\r\n\t}", "boolean hasDate();", "public boolean occurOn(int year, int month, int day, int hour, int minute)\n {\n Calendar tempdate = new GregorianCalendar(year,month,day,hour,minute);\n if(getDate().equals(tempdate))\n return true;\n else\n return false;\n }", "private static boolean isDay(long sunrise, long sunset, long currentTime) {\n\n Calendar calendarSunrise = Calendar.getInstance();\n Calendar calendarSunset = Calendar.getInstance();\n Calendar calendarCurrentTime = Calendar.getInstance();\n\n calendarSunrise.setTimeInMillis(sunrise);\n calendarSunset.setTimeInMillis(sunset);\n calendarCurrentTime.setTimeInMillis(currentTime);\n\n if (calendarCurrentTime.get(calendarCurrentTime.HOUR_OF_DAY)\n > calendarSunrise.get(calendarSunrise.HOUR_OF_DAY)\n &&\n calendarCurrentTime.get(calendarCurrentTime.HOUR_OF_DAY)\n < calendarSunset.get(calendarSunset.HOUR_OF_DAY)) {\n\n Log.d(TAG_WEATHER_MANAGEMENT, \"isDay: true\");\n return true;\n } else {\n Log.d(TAG_WEATHER_MANAGEMENT, \"isDay: false\");\n return false;\n }\n }", "public boolean equals(MyDate other){\n \t\tif (other.year == year){\n \t\t\tif (other.month == month){\n \t\t\t\tif (other.day == day){\n \t\t\t\t\treturn true;\n \t\t\t\t}\n \t\t\t}\n \t\t}\n\n\t\treturn false;\n\t}", "public boolean checkSingleEvent(JSONObject jSONObject) {\n try {\n String string = jSONObject.getString(\"title\");\n String string2 = jSONObject.getString(Message.START_DATE);\n String string3 = jSONObject.getString(Message.END_DATE);\n Calendar instance = Calendar.getInstance();\n instance.setTime(DateUtils.parseDate(string2));\n Calendar instance2 = Calendar.getInstance();\n instance2.setTime(DateUtils.parseDate(string3));\n if (CalendarManager.checkEvent(this.mWXSDKInstance.getContext(), string, \"\", instance, instance2)) {\n return true;\n }\n return false;\n } catch (Exception e) {\n WXLogUtils.e(TAG, (Throwable) e);\n return false;\n }\n }", "private boolean checkTuesdayEleven(Schedule sched)\n\t{\n\t\t//Looks at all the course's timeslots and checks time start time and day\n\t\tfor(int i = 0; i<sched.getCourses().size();i++)\n\t\t{\n\t\t\tif(sched.getCourses().get(i).getSlot() != null)\n\t\t\t{\n\t\t\t\tif((sched.getCourses().get(i).getSlot().getDay() == ScheduleDay.TU) && \n\t\t\t\t\t\t(sched.getCourses().get(i).getSlot().getStartTime() == 1100))\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//If we made it here, we found no conflict. Check passes \n\t\treturn true;\n\t}", "public boolean isToday()\n {\n Calendar todayCalendar = Calendar.getInstance();\n\n return (calendar.get(Calendar.YEAR ) == todayCalendar.get(Calendar.YEAR ))\n && (calendar.get(Calendar.MONTH ) == todayCalendar.get(Calendar.MONTH ))\n && (calendar.get(Calendar.DAY_OF_MONTH) == todayCalendar.get(Calendar.DAY_OF_MONTH));\n }", "public static boolean isSameDay(java.util.Date date1, java.util.Date date2) {\n if (date1 == null || date2 == null) {\n throw new IllegalArgumentException(\"The dates must not be null\");\n }\n Calendar cal1 = Calendar.getInstance();\n cal1.setTime(date1);\n Calendar cal2 = Calendar.getInstance();\n cal2.setTime(date2);\n return isSameDay(cal1, cal2);\n }", "public boolean timeValidated(Event e) {\n\t\tLocalDate date = e.sDate;\n\t\tLocalTime stime = e.sTime;\n\t\tLocalTime etime = e.eTime;\n\t\tArrayList<Event> list = new ArrayList<Event>();\n\t\tif(map.containsKey(date)) {\n\t\t\tlist = map.get(date);\n\n\t\t\tfor(int i = 0; i<list.size(); i++) {\n\t\t\t\tEvent evnt = list.get(i);\n\n\t\t\t\tif(e.sTime.equals(evnt.sTime) || e.eTime.equals(evnt.eTime)) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t//check for start times\n\t\t\t\tif(e.sTime.isBefore(evnt.sTime)) {\n\t\t\t\t\tif(!e.eTime.isBefore(evnt.sTime)) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//check for end time\n\t\t\t\tif(e.sTime.isAfter(evnt.sTime)) {\n\t\t\t\t\tif(!e.sTime.isAfter(evnt.eTime)) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn true;\n\t\t}\n\t}", "public boolean isFirstOfTheDay() {\r\n return !strDate.equals(game.settings.getLastSeen());\r\n }", "public boolean equals(SpentOn spentOn)\n {\n return (calendar.get(Calendar.YEAR) == spentOn.calendar.get(Calendar.YEAR))\n && (calendar.get(Calendar.MONTH) == spentOn.calendar.get(Calendar.MONTH))\n && (calendar.get(Calendar.DAY_OF_MONTH) == spentOn.calendar.get(Calendar.DAY_OF_MONTH));\n }", "public boolean hasDay() {\n return day_ != null;\n }", "public boolean isEqual(DateTime dt) {\n return Long.parseLong(this.vStamp) == Long.parseLong(dt.getStamp());\r\n }", "public static boolean inRange(long quakeTime) throws Exception {\n SimpleDateFormat dayFormatter = new SimpleDateFormat(\"MM/dd/yyyy\");\n String quakeDay = dayFormatter.format(new Date(quakeTime));\n String currentDay = dayFormatter.format(new Date());\n return (quakeDay.equals(currentDay));\n }", "public boolean runsAt(Date date);", "public static boolean isSameDay(Calendar cal1, Calendar cal2) {\n if (cal1 == null || cal2 == null) {\n throw new IllegalArgumentException(\"The date must not be null\");\n }\n return cal1.get(Calendar.ERA) == cal2.get(Calendar.ERA) &&\n cal1.get(Calendar.YEAR) == cal2.get(Calendar.YEAR) &&\n cal1.get(Calendar.DAY_OF_YEAR) == cal2.get(Calendar.DAY_OF_YEAR);\n }", "private boolean isSame(Calendar first, Calendar second)\n {\n return (first.get(Calendar.DAY_OF_MONTH) == second.get(Calendar.DAY_OF_MONTH))\n && (first.get(Calendar.MONTH) == second.get(Calendar.MONTH))\n && (first.get(Calendar.YEAR) == second.get(Calendar.YEAR));\n }", "public static boolean isToday(java.util.Date date) {\n return isSameDay(date, Calendar.getInstance().getTime());\n }", "public boolean equals(Object obj)\n {\n if (!(obj instanceof Date))\n {\n return false;\n }\n\n Date other = (Date) obj;\n\n return day == other.day && month == other.month && year == other.year\n && hour == other.hour && minute == other.minute;\n }", "boolean isMatch(ZonedDateTime date);", "private boolean checkDate(PoliceObject po, LocalDate start, LocalDate end) {\n LocalDate formattedEvent = LocalDate.parse(po.getDate());\n boolean isAfter = formattedEvent.isAfter(start) || formattedEvent.isEqual(start);\n boolean isBefore = formattedEvent.isBefore(end) || formattedEvent.isEqual(end);\n return (isAfter && isBefore);\n }", "private boolean equalsDate(Date thisDate, Date otherDate) {\n if (otherDate == null) {\n return false;\n }\n SimpleDateFormat dateFormating = new SimpleDateFormat(\"yyyy-MM-dd hh:mm:ss\");\n String thisDateString = dateFormating.format(thisDate);\n String otherDateString = dateFormating.format(otherDate);\n if (!thisDateString.equals(otherDateString)) {\n return false;\n }\n \n return true;\n }", "public boolean overlap(Event e)\n\t{\n\t\tTimeInterval compare = e.getTI();\n\t\tif ((compare.st.getHour() <= this.st.getHour()) && (this.st.getHour() <= compare.et.getHour()))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse if ((this.st.getHour() <= compare.st.getHour()) && (compare.st.getHour() <= this.et.getHour()))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "@Override\n public boolean equals(Object obj){\n if(obj==null) return false;\n if(this == obj) return true;\n if(this.getClass() != obj.getClass()) return false;\n Event e = (Event) obj;\n if(this.uuid.equals(e.uuid)) return true;\n return this.title.equals(e.title) && this.datetime == e.datetime && this.type.equals(e.type) &&\n this.location.equals(e.location);\n }", "public boolean equals(Object obj){\n\t\tif (obj == null)\n\t\t\treturn false;\n\t\tif (obj == this)\n\t\t\treturn true;\n\t\tif (!(obj instanceof Date))\n\t\t return false;\n\t\tFlatCell flatCell = (FlatCell) obj;\n\t\treturn (flatCell.day == this.day && flatCell.flatCalendar == this.flatCalendar);\n\t}", "private boolean isToday(Calendar currentCal){\n return currentCal.get(Calendar.DATE) == Calendar.getInstance().get(Calendar.DATE)\n && currentCal.get(Calendar.MONTH) == Calendar.getInstance().get(Calendar.MONTH)\n && currentCal.get(Calendar.YEAR) == Calendar.getInstance().get(Calendar.YEAR);\n }", "@Override\n public boolean equals (Object o){\n if(this == o){\n return true;\n }\n if(o == null){\n return false;\n }\n if(getClass() != o.getClass()){\n return false;\n }\n\n CinemaDate cd = (CinemaDate) o;\n return this.day.equals(cd.getDay()) && this.month.equals(cd.getMonth()) && this.time.equals(cd.getTime());\n }", "boolean checkDayNight(boolean daytime);", "public boolean hasDay() {\n return dayBuilder_ != null || day_ != null;\n }", "public boolean hasDay() {\n return day_ != null;\n }", "private boolean isTomorrow(Calendar currentCal){\n return currentCal.get(Calendar.DATE) == Calendar.getInstance().get(Calendar.DATE)+1\n && currentCal.get(Calendar.MONTH) == Calendar.getInstance().get(Calendar.MONTH)\n && currentCal.get(Calendar.YEAR) == Calendar.getInstance().get(Calendar.YEAR);\n }", "public boolean hasFromDay() {\n return fromDay_ != null;\n }", "boolean hasDayNight();", "public boolean isEqual(MonthDay other) {\n if(month == other.month && day == other.day) {\n return true;\n } else {\n return false;\n }\n }", "public static boolean isWorkingDay(Date d) {\r\n \tLocalDate date = d.toLocalDate();\r\n \tArrayList<LocalDate> phDates = getPhDates();\r\n \t\r\n \tif(date.getDayOfWeek() == DayOfWeek.SATURDAY)\r\n\t\t\treturn false;\r\n\t\tif(date.getDayOfWeek() == DayOfWeek.SUNDAY)\r\n\t\t\treturn false;\r\n\t\tif(phDates.contains(date))\r\n\t\t\treturn false;\r\n\r\n\t\treturn true; \t\r\n }", "public static boolean isSameDay(Calendar cal1, Calendar cal2) {\n if (cal1 == null || cal2 == null) {\n throw new IllegalArgumentException(\"The dates must not be null\");\n }\n return (cal1.get(Calendar.ERA) == cal2.get(Calendar.ERA) &&\n cal1.get(Calendar.YEAR) == cal2.get(Calendar.YEAR) &&\n cal1.get(Calendar.DAY_OF_YEAR) == cal2.get(Calendar.DAY_OF_YEAR));\n }", "public static boolean isSameDay(Calendar cal1, Calendar cal2) {\n if (cal1 == null || cal2 == null) {\n throw new IllegalArgumentException(\"The dates must not be null\");\n }\n return (cal1.get(Calendar.ERA) == cal2.get(Calendar.ERA) &&\n cal1.get(Calendar.YEAR) == cal2.get(Calendar.YEAR) &&\n cal1.get(Calendar.DAY_OF_YEAR) == cal2.get(Calendar.DAY_OF_YEAR));\n }", "public static boolean equals(Date a, Date b) {\n if (a == null || b == null) return (a == null && b == null);\n if (a == b) return true;\n Calendar cal1 = Calendar.getInstance();\n Calendar cal2 = Calendar.getInstance();\n cal1.setTime(a);\n cal2.setTime(b);\n return cal1.get(Calendar.YEAR) == cal2.get(Calendar.YEAR) &&\n cal1.get(Calendar.DAY_OF_YEAR) == cal2.get(Calendar.DAY_OF_YEAR);\n }", "public static boolean isToday(Calendar cal) {\n return isSameDay(cal, Calendar.getInstance());\n }", "public boolean onTheHolidayList(ArrayList<Integer> list, int day){\r\n\t\tfor(int i = 0; i < list.size(); i++){\r\n\t\t\tif(list.get(i) == day)\r\n\t\t\t\treturn true;\r\n\t\t}\r\n\t\t\r\n\t\treturn false; //By default.\r\n\t}", "public static boolean isSameDay(Calendar cal1, Calendar cal2) {\r\n\t\tif (cal1 == null || cal2 == null) {\r\n\t\t\tthrow new IllegalArgumentException(\"The dates must not be null\");\r\n\t\t}\r\n\t\treturn (cal1.get(Calendar.ERA) == cal2.get(Calendar.ERA) &&\r\n\t\t\t\tcal1.get(Calendar.YEAR) == cal2.get(Calendar.YEAR) &&\r\n\t\t\t\tcal1.get(Calendar.DAY_OF_YEAR) == cal2.get(Calendar.DAY_OF_YEAR));\r\n\t}", "public boolean canSaveCalendarDayOff(CalendarDayOff calendarDayOff,Calendar calendar) {\nreturn true;\n}", "public abstract boolean inDaylightTime(java.util.Date date);", "boolean hasWeekday();", "public boolean isSetDay()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().count_elements(DAY$0) != 0;\n }\n }", "private boolean isToday(Date lectureDate){\n Date now = new Date();\n if(lectureDate.getYear()<now.getYear()|| lectureDate.getYear()>now.getYear()){\n return false;\n }else{\n if(lectureDate.getMonth()<now.getMonth()||(lectureDate.getMonth()>now.getMonth())){\n return false;\n }else{\n if(lectureDate.getDate()<now.getDate()|| lectureDate.getDate()>now.getDate()){\n return false;\n }else{\n return true;\n }\n }\n }\n }", "public boolean hasDay() {\n return dayBuilder_ != null || day_ != null;\n }", "boolean isSetFoundingDate();", "public boolean hasToDay() {\n return toDayBuilder_ != null || toDay_ != null;\n }", "boolean isDayTracked(String userName, int dayOfYear);", "public boolean checkDateByClickingButtonsToday(String[] args) throws ParseException\n\t{\n\t\t// click ing on the value for the tab \n\t\tutils.clickAnelemnt(this.tabMbrCompositeInteraction, \"Member Composite\", \"Interaction tab\");\n\t\tif(utils.clickAnelemnt(this.tabMbrCompositeInteraction, \"Member Composite\", \"Interaction tab\"))\n\t\t{\t\t\t\n\t\t\tif(this.clickServcRequestContractToday())\n\t\t\t{\n\t\t\t\tif(this.checkSearchForServiceRequestsForContractsTable(\"\"))\n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\t\n\n\n\t}", "@Override\n public boolean equals(Object o) {\n return o instanceof Date && month == ((Date)o).month && dayOfMonth == ((Date)o).dayOfMonth && year == ((Date)o).year;\n }", "@Test\n public void equals() {\n assertTrue(DATE_A.equals(DATE_A));\n\n // different object, same values -> returns true.\n assertTrue(DATE_A.equals(new Date(DATE_A.getWeek(), DATE_A.getDay(), DATE_A.getTime())));\n\n // different values -> returns false.\n assertFalse(DATE_A.equals(DATE_AFTER_READING));\n\n // different week -> returns false\n assertFalse(DATE_A.equals(DATE_B));\n }", "public boolean checkDate() {\n\t\tboolean cd = checkDate(this.year, this.month, this.day, this.hour);\n\t\treturn cd;\n\t}", "boolean getFromDayNull();", "boolean hasStartDate();", "public boolean canUpdateCalendarDayOff(CalendarDayOff calendarDayOff) {\nreturn true;\n}", "boolean hasOrderDate();", "boolean hasExchangeTime();", "private boolean isPentecost(final Calendar date) {\n Calendar paquesMonday = getEasterDate(date.get(Calendar.YEAR));\n paquesMonday.add(Calendar.DAY_OF_YEAR, 50);\n return date.get(Calendar.DAY_OF_YEAR) == paquesMonday\n .get(Calendar.DAY_OF_YEAR)\n && date.get(Calendar.MONTH) == paquesMonday.get(Calendar.MONTH);\n }", "public boolean checkDateEqual(LocalDate date) {\n return date.equals(this.date);\n }", "boolean hasDateTime();", "public boolean equals(Object O){\n\t if (!(O instanceof Date))\n\t return false;\n\t Date other = (Date) O;\n\t return this.year == other.year && this.month == other.month && this.day == other.day;\n }", "@Override\n public boolean equals(Object other) {\n if (other == this) return true;\n if (other == null) return false;\n if (other.getClass() != this.getClass()) return false;\n Date that = (Date) other;\n return (this.month == that.month) && (this.day == that.day) && (this.year == that.year);\n }", "boolean hasTradeDate();", "public static boolean isDateInCurrentWeek(Date date) {\n Calendar currentCalendar = Calendar.getInstance();\n int week = currentCalendar.get(Calendar.WEEK_OF_YEAR);\n int year = currentCalendar.get(Calendar.YEAR);\n Calendar targetCalendar = Calendar.getInstance();\n targetCalendar.setTime(date);\n int targetWeek = targetCalendar.get(Calendar.WEEK_OF_YEAR);\n int targetYear = targetCalendar.get(Calendar.YEAR);\n return week == targetWeek && year == targetYear;\n }", "public boolean reminderExists(Event event) \r\n\t{\r\n\t for (Reminder reminder : this.getAllReminders())\r\n\t {\r\n\t if (reminder.getEvent().equals(event))\r\n\t return true;\r\n\t }\r\n\t \r\n\t return false; \r\n\t}", "@Override\r\n public boolean equals(Object o) {\r\n if ((o != null) && (o instanceof HISDate)) {\r\n return compareTo((HISDate) o) == 0;\r\n }\r\n\r\n return false;\r\n }", "public boolean hasFromDay() {\n return fromDayBuilder_ != null || fromDay_ != null;\n }", "public boolean checkDate(int year, int month, int day, double hour) {\n\t\tdouble jd = swe_julday(year, month, day, hour, SE_GREG_CAL);\n\t\tIDate dt = swe_revjul(jd, SE_GREG_CAL);\n\t\treturn (dt.year == year && dt.month == month && dt.day == day);\n\t}", "private boolean makeCalendarByDays() {\n if (calendar != null) {\n for (Date date:calendar.keySet()) {\n Date startDay;\n if (date.getTime() > date.getTime() - 3600000 * 2 - date.getTime() % 86400000)\n startDay = new Date(date.getTime() + 3600000 * 22 - date.getTime() % 86400000);\n else startDay = new Date(date.getTime() - 3600000 * 2 - date.getTime() % 86400000);\n calendarByDays.put(startDay, calendar.get(date));\n }\n return true;\n }\n return false;\n }", "public boolean thirtyoneDays() {\n String[] months = new String[]{\"January\", \"March\", \"May\", \"July\", \"August\", \"October\", \"December\"};\n for (String m : months) {\n if (m.equals(this.month)) {\n return true;\n }\n }\n return false;\n }", "@Override\n public boolean equals(Object object) {\n if (!(object instanceof WeekDays)) {\n return false;\n }\n WeekDays other = (WeekDays) object;\n if ((this.day == null && other.day != null) || (this.day != null && !this.day.equals(other.day))) {\n return false;\n }\n return true;\n }", "public static Boolean isEntry(LocalDate date, Date dateEmployee) {\n return date.equals(convertDate(dateEmployee));\n }", "boolean isSetDate();", "public static boolean isWorkDay(Date date) {\n\t\tthrow new IllegalStateException(\"no database connection\");\r\n\t}" ]
[ "0.74001944", "0.72203207", "0.7021614", "0.7021614", "0.6785171", "0.65652484", "0.6552367", "0.6534843", "0.6532344", "0.65032494", "0.6464899", "0.63876444", "0.63688076", "0.634883", "0.6324419", "0.6306291", "0.6264309", "0.62399095", "0.62379783", "0.6232404", "0.62285155", "0.61919266", "0.61861944", "0.61761427", "0.61690915", "0.61375463", "0.61265665", "0.60969144", "0.6084068", "0.60641855", "0.60544676", "0.60525095", "0.6045488", "0.60312593", "0.6021131", "0.6011012", "0.5998158", "0.59960717", "0.5977885", "0.5975156", "0.59721994", "0.596391", "0.5963226", "0.5962109", "0.5935042", "0.59269327", "0.5918487", "0.59157264", "0.5913788", "0.59134984", "0.5913433", "0.5905382", "0.5894496", "0.5894259", "0.5884865", "0.587324", "0.5859324", "0.5859054", "0.58494836", "0.58429223", "0.58429223", "0.5831151", "0.58288324", "0.58262473", "0.5815029", "0.58036005", "0.5802237", "0.5790922", "0.5775299", "0.5764529", "0.5755868", "0.5751934", "0.57517785", "0.5749193", "0.5744489", "0.5741743", "0.5730104", "0.572043", "0.57125515", "0.57103944", "0.570343", "0.567304", "0.5671619", "0.5671401", "0.56689346", "0.5667485", "0.5660003", "0.56548935", "0.56436574", "0.563533", "0.56295633", "0.5627923", "0.5610084", "0.5607489", "0.5601455", "0.56000197", "0.55909926", "0.5590976", "0.55841535", "0.5582035" ]
0.8112335
0
/ returns time difference between this event and another event in milliseconds
public long getTimeDifference(Event event) { return this.getDate().getTimeInMillis() - event.getDate().getTimeInMillis(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private long getTimeDifference(Time timeValue1, Time timeValue2){\n return (timeValue2.getTime()-timeValue1.getTime())/1000;\n }", "protected double difftime(double t2, double t1) {\n\t\treturn t2 - t1;\n\t}", "public long getEventTime();", "public long getElapsedTime(){\n long timePassed = endTime - startTime;\n return timePassed;\n }", "long elapsedTime();", "public long getDifference() {\n return getDifference(System.currentTimeMillis());\n }", "public float getTime() {\n return Math.abs(endTime - startTime) / 1000000f;\n }", "private static float tock(){\n\t\treturn (System.currentTimeMillis() - startTime);\n\t}", "long getElapsedTime();", "protected double getElapsedTime() {\n\t\treturn Utilities.getTime() - startTime;\n\t}", "public Long getTimeLapsed() {\r\n\t\tif(moodTimestamp == null) \r\n\t\t\treturn null;\r\n\t\telse \r\n\t\t\treturn ((System.currentTimeMillis()/1000) - moodTimestamp.longValue());\r\n\t}", "@Override\n\t\tpublic int compareTo(Event other) {\n\t\t\tif (this.time < other.time + 1.0e-9) return -1;\n\t\t\telse if (this.time > other.time - 1.0e-9) return 1;\n\t\t\telse {\n\t\t\t\tif(this.active > other.active) return 1;\n\t\t\t\telse return -1;\n\t\t\t}\n\t\t}", "private long getDuration() throws Exception {\n\treturn dtEnd.getTime() - dtStart.getTime();\n }", "private long getDistanceFromSecondMark(){\n long numSecsElapsed = (long)Math.floor(timeElapsed / WorkoutStatic.ONE_SECOND);\n return timeElapsed - numSecsElapsed * WorkoutStatic.ONE_SECOND;\n }", "public int compareTo(Event other){\n return other.timestamp.compareTo(timestamp);\n }", "public long timeElapsed()\n {\n return (System.currentTimeMillis() - this.startTime) / 1000;\n }", "public long getTimeTaken();", "public double getElapsedTime(){\n double CurrentTime = System.currentTimeMillis();\n double ElapseTime = (CurrentTime - startTime)/1000;\n return ElapseTime;\n }", "long getElapsedTime(Context context);", "public long getEventTime() {\n return eventTime;\n }", "@Override\n public long deltaTo(Counter otherCounter)\n {\n return otherCounter.getAsLong() - this.getAsLong();\n }", "public static long GetElapsedTime() {\n\t\treturn System.currentTimeMillis() - _lTime;\n\t}", "public long getDifference(final long timeValue) {\n return stamp - timeValue;\n }", "T getEventTime();", "long getSince();", "private static long timeDiff(final Date startDate, final Date endDate, final TimeUnit timeUnit) {\n if (startDate == null) {\n throw new NullPointerException(\"start\");\n }\n\n if (endDate == null) {\n throw new NullPointerException(\"end\");\n }\n\n return timeUnit.convert(endDate.getTime() - startDate.getTime(), TimeUnit.MILLISECONDS);\n }", "public long sinceStart() {\n return System.currentTimeMillis() - lastStart;\n }", "static int calculateTimeDelta(TimeInterval interval_1, TimeInterval interval_2) {\n TimeInterval earlier;\n TimeInterval later;\n if (interval_1.getStartTime().before(interval_2.getStartTime())) {\n earlier = interval_1;\n later = interval_2;\n } else {\n earlier = interval_2;\n later = interval_1;\n }\n\n return (int) (later.getStartTime().getTime() - earlier.getStopTime().getTime());\n }", "@Override\n\tpublic long getTime() {\n\t\treturn System.nanoTime() - startTime;\n\t}", "@Override\n\tpublic long getTimeLapsed(long start, long end) {\n\t\tlong difference=(end - start);\n\t\treturn difference;\t}", "public int totalTime()\n {\n return departureTime - arrivalTime;\n }", "private static long getDateDiff(Date date1, Date date2, TimeUnit timeUnit) {\n long diffInMillies = date2.getTime() - date1.getTime();\n return timeUnit.convert(diffInMillies, TimeUnit.MILLISECONDS);\n }", "private static float timeForEvent(float simulationTime, int amountEvents) {\r\n float humAmount = (amountEvents * 2) - 1;\r\n float timeInMilli = simulationTime * 3600f;\r\n\r\n return timeInMilli / humAmount;\r\n }", "public float eventAgeSeconds() { return neventAgeSeconds(address()); }", "public long delta(@NotNull(message = \"delta time can't be NULL\")\n final Time time) {\n return this.msec - time.msec;\n }", "public Double waitTimeCalculatior(long start) {\n\t\t\t\tdouble difference = (System.currentTimeMillis() - start);\n\t\t\t\treturn difference;\n\t\t\t}", "public int getTotalTime();", "public long getTimeElapsed() {\r\n\t long now = new Date().getTime();\r\n\t long timePassedSinceLastUpdate = now - this.updatedSimTimeAt;\r\n\t return this.pTrialTime + timePassedSinceLastUpdate;\r\n\t}", "public static float getDelta() \r\n {\r\n return (currentTime - lastTime) * DAMPING; \r\n }", "@Override\n\tpublic int compare(Player o1, Player o2) {\n\t\treturn (int) (o1.getTime() - o2.getTime());\t\t\t\t\t\t\t\t\t\t//returns the time difference, if big, then player two is better \n\t}", "public double getDuration() {\n if (null == firstTime) {\n return 0.0;\n }\n return lastTime.timeDiff_ns(firstTime);\n }", "public double getTime() { return duration; }", "private String getTimestampDifference(){\r\n Log.d(TAG, \"getTimestampDifference: getting timestamp difference.\");\r\n\r\n String difference = \"\";\r\n Calendar c = Calendar.getInstance();\r\n SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss'Z'\", Locale.UK);\r\n sdf.setTimeZone(TimeZone.getTimeZone(\"Asia/Dubai\"));//google 'android list of timezones'\r\n Date today = c.getTime();\r\n sdf.format(today);\r\n Date timestamp;\r\n\r\n final String photoTimestamp = mJobPhoto.getDate_created();\r\n try{\r\n timestamp = sdf.parse(photoTimestamp);\r\n difference = String.valueOf(Math.round(((today.getTime() - timestamp.getTime()) / 1000 / 60 / 60 / 24 )));\r\n }catch (ParseException e){\r\n Log.e(TAG, \"getTimestampDifference: ParseException: \" + e.getMessage() );\r\n difference = \"0\";\r\n }\r\n return difference;\r\n }", "public double getWaitTime(Flight flight2) {\n Calendar date1 = createNewCalendar(arrivalDateTime);\n Calendar date2 = createNewCalendar(flight2.getDepartureDateTime());\n // get the difference in time in milliseconds\n double timeDifference = date2.getTimeInMillis() - date1.getTimeInMillis();\n // convert to hours\n return timeDifference / (1000 * 60 * 60);\n }", "public long getTotalTime() {\n/* 73 */ return this.totalTime;\n/* */ }", "public double timeSince(TimePos aTimePos)\r\n {\r\n return (m_time.getTimeInMillis() - aTimePos.m_time.getTimeInMillis()) / 1000;\r\n }", "public static long getDiffInMilliSeconds(Date date1, Date date2){\n return date1.getTime() - date2.getTime();\n }", "private long getTotalDuration() {\n if(mMarkers.size() == 0) {\n return 0;\n }\n long first = mMarkers.get(0).time;\n long last = mMarkers.get(mMarkers.size() - 1).time;\n return last - first;\n }", "public long getTimeOfLastValuesChanged();", "public Timestamp getDeltaTime() {\n\treturn mDelta;\n }", "public float getSecondsElapsed() { return _startTime==0? 0 : (System.currentTimeMillis() - _startTime)/1000f; }", "private static String getPrettyTimeDiffInMinutes(Calendar c1, Calendar c2) {\n\t\tif (c1.getTimeZone() == null || c2.getTimeZone() == null \n\t\t\t\t|| c1.getTimeZone().getRawOffset() != c2.getTimeZone().getRawOffset()) {\n\t\t\treturn \"N.A.\";\n\t\t}\n\t\telse {\n\t\t\t//Log.d(TAG, \"c2: \" + c2 + \", c1: \" + c1);\n\t\t\tlong diff = c2.getTimeInMillis() - c1.getTimeInMillis();\n\t\t\t\n\t\t\tif (diff / Utils.DAY_SCALE != 0) {\n\t\t\t\treturn \"many days ago\";\n\t\t\t}\n\t\t\telse if (diff / Utils.HOUR_SCALE != 0) {\n\t\t\t\treturn \"many hours ago\";\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn (diff / Utils.MINUTE_SCALE) + \" min(s) ago\";\n\t\t\t}\n\t\t}\n\t}", "public double getDifference()\n {\n return first - second;\n }", "public long duration() {\n\t\treturn end - start;\n\t}", "public long elapsedMillis() {\n/* 162 */ return elapsedTime(TimeUnit.MILLISECONDS);\n/* */ }", "public Long getTime() {\n if (timeEnd == null) {\n return null;\n }\n return timeEnd - timeStart;\n }", "public static long getTotalHitTime() {\r\n return _time;\r\n }", "public double getNextTime(){\n\t\tif(timeoutSet.peek() == null && eventSet.peek() == null) return Double.MAX_VALUE;\n\t\telse if(eventSet.peek() != null && timeoutSet.peek() != null) return Math.min(eventSet.peek().getTime(), timeoutSet.peek().getTime());\n\t\telse if(eventSet.peek() == null && timeoutSet.peek() != null) return timeoutSet.peek().getTime();\n\t\treturn eventSet.peek().getTime();\n\t}", "public int getDuration() {\n\t\treturn (int) ((endTime.getTime()-startTime.getTime())/1000) + 1;\n\t}", "public String fnTimeDiffference(long startTime, long endTime) {\r\n\r\n\t\t//Finding the difference in milliseconds\r\n\t\tlong delta = endTime - startTime;\r\n\r\n\t\t//Finding number of days\r\n\t\tint days = (int) delta / (24 * 3600 * 1000);\r\n\r\n\t\t//Finding the remainder\r\n\t\tdelta = (int) delta % (24 * 3600 * 1000);\r\n\r\n\t\t//Finding number of hrs\r\n\t\tint hrs = (int) delta / (3600 * 1000);\r\n\r\n\t\t//Finding the remainder\r\n\t\tdelta = (int) delta % (3600 * 1000);\r\n\r\n\t\t//Finding number of minutes\r\n\t\tint min = (int) delta / (60 * 1000);\r\n\r\n\t\t//Finding the remainder\r\n\t\tdelta = (int) delta % (60 * 1000);\r\n\r\n\t\t//Finding number of seconds\r\n\t\tint sec = (int) delta / 1000;\r\n\r\n\t\t//Concatenting to get time difference in the form day:hr:min:sec \r\n\t\t//String strTimeDifference = days + \":\" + hrs + \":\" + min + \":\" + sec;\r\n\t\tString strTimeDifference = days + \"d \" + hrs + \"h \" + min + \"m \" + sec + \"s\";\r\n\t\treturn strTimeDifference;\r\n\t}", "public long getElapsedTime() {\n\t\treturn this.getTime();\n\t}", "@Transient\n \tpublic int getDuration() {\n \t\tint duration = (int) (this.endTime.getTime() - this.startTime.getTime());\n \t\treturn duration / 1000;\n \t}", "public long getElapsedTime()\r\n {\r\n if(isRunning)\r\n {\r\n long endTime = System.currentTimeMillis();\r\n return elapsedTime=endTime-startTime;\r\n }\r\n else\r\n {\r\n return elapsedTime;\r\n }\r\n }", "public int getExtraTimeGiven()\r\n {\r\n return extraTimeGiven;\r\n }", "private float distanceTo(BasicEvent event) {\n final float dx = event.x - location.x;\n final float dy = event.y - location.y;\n// return Math.abs(dx)+Math.abs(dy);\n return distanceMetric(dx, dy);\n// dx*=dx;\n// dy*=dy;\n// float distance=(float)Math.sqrt(dx+dy);\n// return distance;\n }", "public String elapsedTime() {\n return totalWatch.toString();\n }", "public float getElapsed()\n {\n return this.elapsed;\n }", "public double getElapsedTime()\n\t{\n\t\tdouble elapsedTime = 0. ;\n\t\tEnumeration<SpItem> children = children() ;\n\t\tSpItem child = null ;\n\n\t\twhile( children.hasMoreElements() )\n\t\t{\n\t\t\tchild = children.nextElement() ;\n\t\t\tif( child instanceof SpObs && (( SpObs )child).isOptional() )\n\t\t\t\t\telapsedTime += ( ( SpObs )child ).getElapsedTime() ;\n\t\t\telse if( child instanceof SpMSB )\n\t\t\t\telapsedTime += (( SpMSB )child).getElapsedTime() ;\n\t\t}\n\n\t\tint totRemaining = 0 ;\n\t\tfor( int i = 0 ; i < size() ; i++ )\n\t\t\ttotRemaining += getRemaining( i ) ;\n\n\t\telapsedTime *= totRemaining ;\n\t\treturn elapsedTime ;\n\t}", "@Override\n public double getMaxTimeBeetween2Measurement() {\n return super.getMaxTimeBeetween2Measurement();\n }", "public int calcTravelTime(Request request) {\r\n\t\tNdPoint currentLocation = space.getLocation(this);\r\n\t\tNdPoint s1location = request.getOrigin();\r\n\t\tNdPoint s2location = request.getDestination();\r\n\r\n\t\t// Calc time between current position and first source\r\n\t\tdouble distance1 = this.space.getDistance(currentLocation, s1location);\r\n\t\t// Calc time between first source and second source\r\n\t\tdouble distance2 = this.space.getDistance(s1location, s2location);\r\n\t\t// Added times\r\n\t\tdouble totaldistance = distance1 + distance2;\r\n\t\tint totaltime = (int) (totaldistance / (this.speed * 0.5));\r\n\r\n\t\treturn totaltime;\r\n\t}", "long duration();", "public long hoverTime() {\n\t\treturn hoverStart == 0 ? 0 : Calendar.getInstance().getTimeInMillis() - hoverStart;\n\t}", "public double getElapsedTime() {\r\n return (double) (elapsedTime / 1000.0); // convert from milliseconds to seconds\r\n }", "public long getElapsedMs()\n\t{\n\t\tif (m_running)\n\t\t{\n\t\t\tlong systemMs = SystemClock.elapsedRealtime();\n\t\t\treturn m_elapsedMs + (systemMs - m_lastMs);\n\t\t}\n\n\t\treturn m_elapsedMs;\n\t}", "public long getElapsedMilliseconds() {\n\t\tlong elapsed;\n\t\tif (running) {\n\t\t\telapsed = (System.nanoTime() - startTime);\n\t\t} else {\n\t\t\telapsed = (stopTime - startTime);\n\t\t}\n\t\treturn elapsed / nsPerMs;\n\t}", "public int compareTo(Instruction other){\n return this.arrivalTime - other.arrivalTime;\n }", "public static String timeDifference(long start) {\r\n\t\treturn timeDifference(start, System.currentTimeMillis());\r\n\t}", "public static long getDateDiffer(Calendar cal1, Calendar cal2){\n long millis1 = cal1.getTimeInMillis();\n long millis2 = cal2.getTimeInMillis();\n\n // Calculate difference in milliseconds\n long diff = millis2 - millis1;\n\n // Calculate difference in seconds\n long diffSeconds = diff / 1000;\n\n // Calculate difference in minutes\n long diffMinutes = diff / (60 * 1000);\n\n // Calculate difference in hours\n long diffHours = diff / (60 * 60 * 1000);\n\n // Calculate difference in days\n long diffDays = diff / (24 * 60 * 60 * 1000);\n\n System.out.println(\"In milliseconds: \" + diff + \" milliseconds.\");\n System.out.println(\"In seconds: \" + diffSeconds + \" seconds.\");\n System.out.println(\"In minutes: \" + diffMinutes + \" minutes.\");\n System.out.println(\"In hours: \" + diffHours + \" hours.\");\n System.out.println(\"In days: \" + diffDays + \" days.\");\n\n return diffDays;\n }", "private static int compareEndTimes(TaskItem task1, TaskItem task2) {\n\t\tif (task1 instanceof FloatingTask) {\n\t\t\tif (task2 instanceof FloatingTask) {\n\t\t\t\treturn 0;\n\t\t\t} else {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t} else if (task1 instanceof DeadlinedTask) {\n\t\t\tif (task2 instanceof FloatingTask) {\n\t\t\t\treturn 1;\n\t\t\t} else if (task2 instanceof DeadlinedTask) {\n\t\t\t\tDate endTime1 = ((DeadlinedTask) task1).getEndTime();\n\t\t\t\tDate endTime2 = ((DeadlinedTask) task2).getEndTime();\n\t\t\t\treturn endTime2.compareTo(endTime1);\n\t\t\t} else {\n\t\t\t\tDate endTime1 = ((DeadlinedTask) task1).getEndTime();\n\t\t\t\tDate endTime2 = ((TimedTask) task2).getEndTime();\n\t\t\t\treturn endTime2.compareTo(endTime1);\n\t\t\t}\n\t\t} else {\n\t\t\tif (task2 instanceof FloatingTask) {\n\t\t\t\treturn 1;\n\t\t\t} else if (task2 instanceof DeadlinedTask) {\n\t\t\t\tDate endTime1 = ((TimedTask) task1).getEndTime();\n\t\t\t\tDate endTime2 = ((DeadlinedTask) task2).getEndTime();\n\t\t\t\treturn endTime2.compareTo(endTime1);\n\t\t\t} else {\n\t\t\t\tDate endTime1 = ((TimedTask) task1).getEndTime();\n\t\t\t\tDate endTime2 = ((TimedTask) task2).getEndTime();\n\t\t\t\treturn endTime2.compareTo(endTime1);\n\t\t\t}\n\t\t}\n\t}", "protected static double getFPGATime() {\n return (System.currentTimeMillis() - startTime) / 1000.0;\n }", "long getTotalDoExamTime();", "public float timeBeforeDestruction(){\n\t\tif(destroyTime < Float.MAX_VALUE){\n\t\t\treturn destroyTime - Main.time;\n\t\t}else{\n\t\t\treturn Float.MAX_VALUE;\n\t\t}\n\t}", "public long timeDifference(Datum datum) {\n\t\treturn (date.getTime() - datum.getTime()) / 60000;\n }", "public static long getDateDiff(Date date1, Date date2, TimeUnit timeUnit) {\n\t\t long diffInMillies = date2.getTime() - date1.getTime();\n\t\t return timeUnit.convert(diffInMillies,TimeUnit.MILLISECONDS);\n\t\t}", "public long getSinceTimeMs(int index) {\n return sinceTimeMs_.getLong(index);\n }", "public double getTotalTime()\n\t{\n\t\tdouble elapsedTime = 0. ;\n\t\tEnumeration<SpItem> children = children() ;\n\t\tSpItem child = null ;\n\t\tboolean hasObsChild = false ;\n\n\t\twhile( children.hasMoreElements() )\n\t\t{\n\t\t\tchild = children.nextElement() ;\n\t\t\tif( child instanceof SpObs )\n\t\t\t{\n\t\t\t\thasObsChild = true ;\n\t\t\t\telapsedTime += (( SpObs )child).getElapsedTime() ;\n\t\t\t}\n\t\t\telse if( child instanceof SpMSB )\n\t\t\t{\n\t\t\t\telapsedTime += (( SpMSB )child).getTotalTime() ;\n\t\t\t}\n\t\t}\n\n\t\t// If there is an Obs child, we should add a slew time as well,\n\t\t// which is just the instrument slew time times the number of\n\t\t// targets. We don't do this if the child is an MSB since this\n\t\t// already adds a slew time\n\t\tdouble slewTime = 0. ;\n\t\tif( hasObsChild )\n\t\t{\n\t\t\tSpInstObsComp inst = SpTreeMan.findInstrument( this ) ;\n\t\t\tif( inst != null )\n\t\t\t\tslewTime = inst.getSlewTime() * size() ;\n\t\t}\n\n\t\t// Get the total number of repeats for each target\n\t\tint totRemaining = 0 ;\n\t\tfor( int i = 0 ; i < size() ; i++ )\n\t\t\ttotRemaining += getRemaining( i ) ;\n\n\t\telapsedTime *= totRemaining ;\n\t\telapsedTime += slewTime ;\n\n\t\treturn elapsedTime ;\n\t}", "public int compareTo(Time other) {\n // if both times have a date, return the difference if there is one, else\n // continue with standard comparison\n if (this.date != null && other.date != null) {\n if (this.date.compareTo(other.date) != 0) {\n return this.date.compareTo(other.date);\n }\n }\n\n boolean nextDay = DayOfWeek.isNextDay(this.day, other.day);\n\n // if other day is not the day after this day and days aren't the same\n if (!nextDay && !DayOfWeek.isSameDay(this.day, other.day)) {\n return this.day - other.day;\n\n // if other day is day after this day\n } else if (nextDay) {\n return this.hour - (other.hour + 24); // add 24 to represent next day\n\n // if day is the same\n } else {\n if (this.hour != other.hour) {\n return this.hour - other.hour;\n } else {\n return this.minute - other.minute;\n }\n }\n }", "public double computeElapsedTime() {\r\n\r\n long now = System.currentTimeMillis();\r\n\r\n elapsedTime = (double) (now - startTime);\r\n\r\n // if elasedTime is invalid, then set it to 0\r\n if (elapsedTime <= 0) {\r\n elapsedTime = (double) 0.0;\r\n }\r\n\r\n return (double) (elapsedTime / 1000.0); // return in seconds!!\r\n }", "protected EditorLanguage timeDiff(String varStart, String varEnd)\n\t{\n\t\treturn text('(').text(varEnd).text(\" - \").text(varStart).text(\") / 1000.0\");\n\t}", "public long elapsedTime(long startTime,long endTime){\r\n\t\tlong elapsedTime=(endTime-startTime)/1000;\r\n\t\treturn elapsedTime;\r\n\t}", "public long getDifference(DateTime dt) {\n return (this.date.getTime() - dt.date.getTime()) / 1000;\r\n }", "@Override\n public int compareTo(Record otherRecord) {\n return (int) (otherRecord.mCallEndTimestamp - mCallEndTimestamp);\n }", "@Override\n\tpublic double getTouchTime();", "public static long substract(Date source, Date target) {\n long t = STARDARD_FROM_TIMEMILLS;\n long sTimeMills = source.getTime() - t;\n long tTimeMills = target.getTime() - t;\n if (sTimeMills < tTimeMills) {\n long temp = sTimeMills;\n sTimeMills = tTimeMills;\n tTimeMills = temp;\n }\n long start = sTimeMills / TIME_MILLS_ONE_DAY;\n long end = tTimeMills / TIME_MILLS_ONE_DAY;\n return start - end;\n }", "public static long getElapsedTime() {\n long time = System.currentTimeMillis() - START_TIME;\n // long time = System.nanoTime() / 1000000;\n return time;\n }", "public long getSortTime(){ \n return endTime - startTime;\n }", "private long getGameDuration() {\n return ((System.currentTimeMillis() - startGameTime) / 1000);\n }", "public static int getMinDistanceTime(Asteroid a, Asteroid b) {\n\n\t\tdouble minDistance = -1;\n\t\tint minDistTime = Integer.MAX_VALUE;\n\t\tfor(int t = 0; t < 20*365; t++){\n\t\t\tdouble distance = Point.distance(a.orbit.positionAt((long)t - a.epoch),b.orbit.positionAt((long)t - b.epoch));\n\t\t\tif(distance < minDistance){\n\t\t\t\tminDistance = distance;\n\t\t\t\tminDistTime = t;\n\t\t\t}\t\t\t\n\t\t}\n\t\treturn minDistTime;\n\t}", "public int duration (long start, long end){\n\t\tlong duration = end - start;\n\t\tint time = (int)(duration /1000);\n\t\treturn time;\n\t}", "long getTimeBoltABoltB();" ]
[ "0.6734482", "0.6586785", "0.6281938", "0.62009436", "0.609947", "0.6090342", "0.6071892", "0.6070723", "0.6027795", "0.6007805", "0.5991828", "0.5963168", "0.58987886", "0.5875428", "0.58630174", "0.58575416", "0.58520144", "0.58496666", "0.58207405", "0.5817793", "0.58060557", "0.5786846", "0.57204884", "0.5720065", "0.5718313", "0.5717872", "0.571612", "0.5715462", "0.5706198", "0.5704881", "0.56972146", "0.56707007", "0.5669068", "0.5654102", "0.5616365", "0.560967", "0.56082636", "0.56070477", "0.5604299", "0.5597227", "0.5593315", "0.5587379", "0.55790347", "0.5574538", "0.556335", "0.5546369", "0.5545574", "0.55400527", "0.55333143", "0.55316025", "0.55209494", "0.55174136", "0.55170035", "0.55156994", "0.551132", "0.5503694", "0.5498653", "0.54887265", "0.54859316", "0.54643023", "0.5453665", "0.5453184", "0.54421926", "0.5427168", "0.5426166", "0.54226637", "0.54191077", "0.54160297", "0.5414957", "0.54122084", "0.5397558", "0.53951126", "0.53934884", "0.5391215", "0.5387042", "0.5386375", "0.5381518", "0.53808343", "0.5377191", "0.53685486", "0.53683776", "0.5368068", "0.5354375", "0.5352306", "0.5345792", "0.5337467", "0.53189987", "0.5318721", "0.5316417", "0.5315918", "0.5315272", "0.53118616", "0.5311406", "0.53031254", "0.5298087", "0.52962244", "0.5292092", "0.5289154", "0.52888036", "0.52874357" ]
0.6705224
1
Function to set value of field.
public void setSpecialization(final String specialization) { this.specialization = specialization.trim(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setField(String value) {\n JsoHelper.setAttribute(jsObj, \"field\", value);\n }", "public void setValue(Object val);", "public void setValue(Object value);", "public void setValue(Object value) { this.value = value; }", "@CheckReturnValue\n T setField(String field, @Nullable Object value);", "public void setValue(String fieldName, Object value) {\n try {\n Field field = FieldUtils.getField(object.getClass(), fieldName, true);\n if (field != null) {\n FieldUtils.writeField(field, object, value, true);\n } else {\n logger.error(\"Unable to set value on field because the field does not exits on class: \" + object.getClass());\n }\n } catch (IllegalAccessException e) {\n logger.error(e);\n }\n }", "public void setValue(String value);", "public void setValue(String value);", "public void setValue(String value);", "public void setValue(String value);", "public void setValue (String Value);", "void setValue(Object value);", "public void setValue(final Object value) { _value = value; }", "public void setField(String aValue) {\n String oldValue = field;\n field = aValue;\n changeSupport.firePropertyChange(\"field\", oldValue, aValue);\n }", "public void setValue(Object value) {\n this.value = value;\n }", "@Override\n public void setValue(Object val)\n {\n value = val;\n }", "public void setValue(Object value)\r\n\t{\r\n\t\tm_value = value;\r\n\t}", "private void setValue(Object entity, Field targetField, String targetValue) {\n if ( null == entity || null == targetField || 0 >= targetField.getName().length() ) {\n throw new IllegalStateException();\n }\n final Method[] declaredMethods = entity.getClass().getDeclaredMethods();\n final String fieldName = targetField.getName();\n String expectedMethodName = null;\n if ( fieldName.length() > 1 ) {\n expectedMethodName = \"set\" + fieldName.substring(0).toUpperCase() + fieldName.substring(1, fieldName.length() - 1);\n } else {\n expectedMethodName = \"set\" + fieldName.substring(0).toUpperCase();\n }\n Method expectedMethod = null;\n for ( Method method : declaredMethods ) {\n if ( method.getName().equals(expectedMethodName) ) {\n expectedMethod = method;\n }\n }\n if ( null != expectedMethod ) {\n boolean accessibilityChanged = false;\n try {\n if ( !expectedMethod.isAccessible() ) {\n expectedMethod.setAccessible(true);\n accessibilityChanged = true;\n }\n expectedMethod.invoke(entity, targetValue);\n } catch (Exception e) {\n Logger.getLogger(getClass().getName()).log(Level.SEVERE, e.getMessage(), e);\n } finally {\n if ( accessibilityChanged ) {\n expectedMethod.setAccessible(false);\n }\n }\n } else {\n boolean accessibilityChanged = false;\n if ( !targetField.isAccessible() ) {\n targetField.setAccessible(true);\n accessibilityChanged = true;\n }\n try {\n targetField.set(entity, targetValue);\n } catch (Exception e) {\n Logger.getLogger(getClass().getName()).log(Level.SEVERE, e.getMessage(), e);\n } finally {\n if ( accessibilityChanged ) {\n targetField.setAccessible(false);\n }\n }\n }\n }", "public void setFieldValue(String value){\r\n\t\ttextBox.setValue(value);\r\n\t}", "public void setDataIntoField(String fieldLabel, String value){\n reporter.info(\"Set data \"+value+\" into field\"+fieldLabel);\n setText(LOCATORS.getBy(COMPONENT_NAME,\"FIELD_INPUT_BY_NAME\",fieldLabel),value,SHORT_TIMEOUT);\n }", "public void setValue(Value value) {\n this.value = value;\n }", "String setValue();", "public void setValue(IveObject val){\r\n\tvalue = val;\r\n\tnotifyFromAttr();\r\n }", "@Override\n\tpublic void setValue(Object value) {\n\t\t\n\t}", "void setValue(String value);", "void setValue(String value);", "public V setValue(V value);", "void setValue(T value);", "void setValue(T value);", "public void setValue(Object value)\r\n {\r\n m_value = value;\r\n }", "public void setField(String field, String contents) throws RemoteException;", "public void setValue(T value) \n\t{\n\t\tthis.value = value;\n\t}", "public void setValue(T value) {\n\t\tthis.value = value;\n\t}", "public void setValue(T value) {\n\t\tthis.value = value;\n\t}", "protected void setValue(T value) {\r\n this.value = value;\r\n }", "public void setValue(T value) {\n this.value = value;\n }", "@Override\n public void setField(int id, int value) {\n \n }", "public abstract void setValue(T value);", "public void setValue(Object value) {\n setValue(value.toString());\n }", "public void set(Object requestor, String field);", "public void setValue(S s) { value = s; }", "@Override\n\tpublic void setField(int id, int value) {\n\t\t\n\t}", "@Override\n\tpublic void setField(int id, int value) {\n\t\t\n\t}", "public void setValue(Object value) {\n\t\tthis.value = value;\n\t\tsetValueAction(value);\n\t}", "void setValue(T value)\n\t\t{\n\t\t\tthis.value = value;\n\t\t}", "public void setValue(Entity value) {\r\n\t\t\tthis.value = value;\r\n\t\t}", "@SuppressWarnings(\"UnusedReturnValue\")\n @Override\n public T setField(T f) {\n T temp = mField;\n mField = f;\n return temp;\n }", "@Override\n public void setField (String fieldToModify, String value, Double duration) {\n\n }", "protected abstract void setValue(V value);", "void setValue(Object object, Object value);", "public void setValue(String value) {\r\n this.value = value;\r\n }", "public void setValue(String value) {\r\n this.value = value;\r\n }", "public void setValue(String value) {\r\n this.value = value;\r\n }", "public void setValue(String value) {\r\n this.value = value;\r\n }", "public void setValue(String value) {\r\n this.value = value;\r\n }", "public void setValue(A value) {this.value = value; }", "void setValue4Po(String poFieldName, Object val);", "void setValue(V value);", "private void setField( String fieldName, String value )\n {\n JTextField field =\n ( JTextField ) fields.get(fieldName);\n\n field.setText(value);\n }", "public void setValue(Object o){\n \tthis.value = o;\n }", "public void setValue( String value )\n {\n this.value = value;\n }", "public void setValue(String value) {\n\t this.valueS = value;\n\t }", "public void setValue(String value) {\r\n\t\tthis.value = value;\r\n\t}", "public void setValue(String text) {\n\t\tthis.value = text;\n\t}", "public void setValue(String value)\n {\n this.value = value;\n }", "public void setValue(String value) {\n\t\tthis.value = value;\n\t}", "Form setElementValue(String elementId, String value);", "public void setValue(String value)\r\n\t\t{ textField.setText(value); }", "public void setValue(String value) {\n set (value);\n }", "@SuppressWarnings(\"UnusedReturnValue\")\n @Override\n public T setField (T f) {\n T temp = mField;\n mField = f;\n return temp;\n }", "public void set(String value){\n switch (field){\n case 0:\n nomComplet = value;\n break;\n case 1:\n rv1 = value;\n break;\n case 2:\n dateDispo = LocalDate.parse(value,formatter);\n break;\n case 3:\n competencePrincipale = value;\n break;\n case 4:\n exp = Double.parseDouble(value);\n break;\n case 5:\n trancheExp = value;\n break;\n case 6:\n ecole = value;\n break;\n case 7:\n classeEcole = value;\n break;\n case 8:\n fonctions = value;\n break;\n case 9:\n dateRV1 = LocalDate.parse(value,formatter);\n case 10:\n rv2 = value;\n break;\n case 11:\n metiers = value;\n break;\n case 12:\n originePiste = value;\n break;\n }\n field++;\n }", "public void setValue(String value) {\n\t\tthis.value = value;\n\t}", "public void setValue(String value) {\n\t\tthis.value = value;\n\t}", "public void setValue(String value) {\n\t\tthis.value = value;\n\t}", "public void setValue(String value) {\n\t\tthis.value = value;\n\t}", "public void setValue(String value) {\n this.value = value;\n }", "public void setValue(String value) {\n this.value = value;\n }", "public void setValue(String value) {\n this.value = value;\n }", "public void setValue(String value) {\n this.value = value;\n }", "public void setValue(String value) {\n this.value = value;\n }", "void setMyField(String val) {\n\t\ttry {\n\t\t\tmyField = Integer.parseInt(val);\n\t\t} catch (NumberFormatException e) {\n\t\t\tmyField = 0;\n\t\t}\n\t}", "public int setValue (int val);", "void setValue(final String value);", "public <T> void setProperty(String field, T value) {\n try {\n Field f = this.getClass().getDeclaredField(field); \n f.set(this, value);\n } catch (NoSuchFieldException ex) {\n System.out.println(\"Field no found...\");\n System.out.println(ex.getMessage());\n\n } catch (IllegalAccessException ex) {\n System.out.println(ex.getMessage());\n }\n }", "void setValue(java.lang.String value);", "public void set(Object requestor, String field, JComponent comp);", "void setValue(int value);", "V setValue(final V value) {\n\t setMethod.accept(value);\n\n\t return value;\n\t}", "public FieldInstruction setField(BCField field) {\n if (field == null)\n return setFieldIndex(0);\n return setField(field.getDeclarer().getName(), field.getName(),\n field.getTypeName());\n }", "public void setData(T val) {\r\n\t\tthis.val = val;\r\n\t}", "public void setValue(int value);", "public void val(String value) {\r\n\t\tjquery.val(this, value, webDriver);\r\n\t}", "@Override\n\tpublic void setValue(String arg0, String arg1) {\n\t\t\n\t}", "public void setValue(String value) {\n\t\tmValue = value;\n\t}", "@Test\n public void test_setTelephone() {\n String value = \"new_value\";\n instance.setTelephone(value);\n\n assertEquals(\"'setTelephone' should be correct.\",\n value, TestsHelper.getField(instance, \"telephone\"));\n }", "public FieldInstruction setField(Field field) {\n if (field == null)\n return setFieldIndex(0);\n return setField(field.getDeclaringClass(), field.getName(),\n field.getType());\n }", "@Override\n public void setValue(Node value) throws ValueFormatException,\n VersionException, LockException, ConstraintViolationException,\n RepositoryException {\n \n }", "public abstract void setValue(ELContext context, Object value);", "public void setValue(final V value) {\n this.value = value;\n }", "void setToValue(int val);", "@Override\n\tpublic void setValue(Object object) {\n\t\t\n\t}" ]
[ "0.75242764", "0.7406097", "0.7370838", "0.7359126", "0.7221497", "0.7156935", "0.71487206", "0.71487206", "0.71487206", "0.71487206", "0.71480525", "0.71228945", "0.7114565", "0.71074474", "0.70958424", "0.70928484", "0.70729786", "0.7060842", "0.70562", "0.704448", "0.70284194", "0.701346", "0.697712", "0.6973397", "0.6965153", "0.6965153", "0.6963388", "0.6934862", "0.6934862", "0.6933782", "0.6904932", "0.6884213", "0.6880595", "0.6880595", "0.6876405", "0.68696076", "0.6856383", "0.6847552", "0.684515", "0.682274", "0.6798376", "0.67740625", "0.67740625", "0.67655575", "0.67546445", "0.67457527", "0.6735528", "0.6719391", "0.6709226", "0.6705559", "0.67030245", "0.67030245", "0.67030245", "0.67030245", "0.67030245", "0.66964686", "0.66826665", "0.6681939", "0.6679927", "0.6660732", "0.66403294", "0.66367805", "0.66281945", "0.6623834", "0.6616305", "0.6608808", "0.66030544", "0.65865225", "0.65809137", "0.6561699", "0.6560805", "0.6556852", "0.6556852", "0.6556852", "0.6556852", "0.6556061", "0.6556061", "0.6556061", "0.6556061", "0.6556061", "0.65503156", "0.6548568", "0.65189487", "0.6517483", "0.65023416", "0.648941", "0.64841545", "0.648402", "0.6464192", "0.6445693", "0.64401495", "0.64303935", "0.64243025", "0.6408013", "0.6402826", "0.6393994", "0.63895065", "0.6388673", "0.6382114", "0.63781726", "0.637776" ]
0.0
-1
Function to set value of field. increases the number of prescriptions written by 1.
public void addFormulas() { countFormulas++; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setValue(int value);", "void setValue(int value);", "public void setDmaValue(int value);", "public void setValue(int n) {\n\t\t\tthis.value = n;\n\t}", "public void setValue(int value) {\r\n this.value = value;\r\n }", "public void setValue(int new_value){\n this.value=new_value;\n }", "public void setValue(int value)\n {\n this.value = value;\n }", "@Override\n public void setField(int id, int value) {\n \n }", "public abstract void setValue(int value);", "public void aendereWert (int value) {\n\t\tvalue = 0 ;\n\t}", "public abstract void setCntPrepaid(int cntPrepaid);", "public int setValue (int val);", "void setNextValue() {\n this.value = this.value * 2;\n }", "public void setValue(int value) {\n this.value = value;\n }", "public void setValue(int value) {\n this.value = value;\n }", "public void setValue(int value) {\n this.value = value;\n }", "public void setValue(int value) {\n this.value = value;\n }", "public void setValue(int value) {\n this.value = value;\n }", "public void setValue(int value) {\r\n\t\tthis.value = value;\r\n\t}", "public void setValue(int value) {\r\n\t\tthis.value = value;\r\n\t}", "public void setValue(int value) {\r\n\t\tthis.value = value;\r\n\t}", "public void setValue(int value) {\r\n\t\tthis.value = value;\r\n\t}", "public void setValue(int value) {\r\n\t\tthis.value = value;\r\n\t}", "public void setCounter(int value) { \n\t\tthis.count = value;\n\t}", "public void setValue(int value) {\n\t\tthis.removeAllPCData();\n\t\ttry {\n\t\t\tthis.appendChild(new XPCData(Integer.toString(value)));\n\t\t} catch (Exception e) {\n\t\t\t//ignoring this because it shouldn't break\n\t\t}\n\t}", "public void setValue(int value) {\n\t\tthis._value = value;\n\t}", "public void setValue(int value) {\n\t\tthis.value = value;\n\t}", "public void setValue(int value) {\n\t\tthis.value = value;\n\t}", "public void setIntValue(int newValue){\n value = newValue; //set value to newValue\n }", "void setIntValue(int value)\n {\n this.value = value;\n }", "public void setValue(Integer value) {\n _value = value ;\n }", "@Override\n\tpublic void setField(int id, int value) {\n\t\t\n\t}", "@Override\n\tpublic void setField(int id, int value) {\n\t\t\n\t}", "void setValue(Short value);", "public void setCounter(Short __newValue)\n {\n counter = __newValue;\n }", "public void setValue(int value) {\n m_value = value;\n }", "public void setRecord(int value){\n SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this.getContext());\n SharedPreferences.Editor editor = prefs.edit(); editor.putInt(\"record\", value);\n editor.commit();\n }", "public void setIncrement( final int value ) {\n checkWidget();\n if( value >= 1 && value <= maximum - minimum ) {\n increment = value;\n }\n }", "public void incValue(){\n\t\tif(this.value < 9){\n\t\t\tthis.value++;\n\t\t}\n\t\telse{\n\t\t\tthis.value = 0;\n\t\t}\n\t}", "public abstract void setCntPoa(int cntPoa);", "public void set()\n\t{\n\t\tbitHolder.setValue(1);\n\t}", "public void setValue (int value)\r\n\t{\r\n\t\tsuper.setText (Integer.toString (value));\r\n\t\tvalidateTextField ();\r\n\t}", "public void setpremiumcounter() {\n\t\tmPref.edit().putInt(PREF_CONVERTED, -1).commit();\r\n\t}", "void xsetValue(gov.nih.nlm.ncbi.www.MedlineSiDocument.MedlineSi.Type.Value value);", "public void setValue(int value) {\n\t\tm_value = value;\n\t}", "@Override\n public void setValue (int newValue){\n super.setValue(newValue);\n updateChildesValues(newValue);\n\n }", "void set(long newValue);", "public void set_count(int c);", "public void setRecord3(int value){\n SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this.getContext());\n SharedPreferences.Editor editor = prefs.edit(); editor.putInt(\"record3\", value);\n editor.commit();\n }", "public void setValue(Number value) {\n this.value = value;\n }", "public void set(int value)\n {\n set(value, true);\n }", "public void setValue(Object value) { this.value = value; }", "public void setValue(short value) {\n this.value = value;\n }", "public void setValue(int value)\n {\n // we have assumed value 1 for X and 10 for O\n this.value = value;\n }", "public void apply() { writable.setValue(value); }", "public void setPrecioc(int p){\n this.precioc=p;\n \n }", "public void setValue (String Value);", "public void addValue() {\n addValue(1);\n }", "public void increment(){\n value+=1;\n }", "public void set(int value)\n\t{\n\t\tbitHolder.setValue(value);\n\t}", "String setValue();", "public int setValue(int value) {\n\t\tthis.value = value;\n\t\treturn 0;\n\t}", "public void setlatercounter() {\n\t\tmPref.edit().putInt(PREF_CONVERTED, 7).commit();\r\n\t}", "private static void setValueInt(int value)\n {\n Util.valueInt = value;\n }", "public void setRecord2(int value){\n SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this.getContext());\n SharedPreferences.Editor editor = prefs.edit(); editor.putInt(\"record2\", value);\n editor.commit();\n }", "public void setValue(short value) {\n this.value = value;\n }", "public void setValue(int newValue) {\t\r\n\t\tthis.value = newValue;\r\n\t}", "void setValue4Po(String poFieldName, Object val);", "public void setValue(int val)\r\n {\r\n value = val;\r\n }", "void setToValue(int val);", "public void setValue (int newValue) {\n myValue = newValue;\n }", "public void setC_Subscription_ID (int C_Subscription_ID)\n{\nset_ValueNoCheck (\"C_Subscription_ID\", new Integer(C_Subscription_ID));\n}", "public void setValue(long value) {\n\t this.value = value;\n\t }", "public void setOneNewWanted () {\r\n numWanted ++;\r\n }", "public void set_value(int value) {\n\t\tthis.value = value;\n\t}", "public void setValue(Integer value) {\n\t\tthis.value = value;\n\t}", "@Override\n public void setField (String fieldToModify, String value, Double duration) {\n\n }", "public void setCount(int value) {\n this.count = value;\n }", "public void setCount(int value) {\n this.count = value;\n }", "public void setCount(int value) {\n this.count = value;\n }", "public void setInumber(final String value)\n\t{\n\t\tsetInumber( getSession().getSessionContext(), value );\n\t}", "public void set_count(int value) {\n setUIntBEElement(offsetBits_count(), 16, value);\n }", "public void set(int value){\n val = value;\n }", "private static void setCounter() {++counter;}", "public void setValue(String value);", "public void setValue(String value);", "public void setValue(String value);", "public void setValue(String value);", "public void setCurrentRecord(Integer value) {\n this.currentRecord = value;\n }", "public void IncrementCounter()\r\n {\r\n \tsetCurrentValue( currentValue.add(BigInteger.ONE)); \r\n \r\n log.debug(\"counter now: \" + currentValue.intValue() );\r\n \r\n }", "public void write(SecureObject o, int value){\n o.currentValue = value;\n //System.out.println(o.name +\" was written as \" + value);\n }", "public void setValue(Object value);", "public void\t\tset(int val) { value = val; }", "public void setField(String value) {\n JsoHelper.setAttribute(jsObj, \"field\", value);\n }", "public void setValue(Value value) {\n this.value = value;\n }", "public void setValue(S s) { value = s; }", "public abstract void setCntFtc(int cntFtc);", "public void increasecounter() {\n\t\tmPref.edit().putInt(PREF_CONVERTED, counter + 1).commit();\r\n\t}", "public void setProcessed (boolean Processed)\n{\nset_Value (\"Processed\", new Boolean(Processed));\n}", "void setValue(double value);", "public void setDocumentNo (String DocumentNo)\n{\nif (DocumentNo == null) throw new IllegalArgumentException (\"DocumentNo is mandatory\");\nif (DocumentNo.length() > 30)\n{\nlog.warning(\"Length > 30 - truncated\");\nDocumentNo = DocumentNo.substring(0,30);\n}\nset_Value (\"DocumentNo\", DocumentNo);\n}" ]
[ "0.6574399", "0.6480327", "0.63862014", "0.63301", "0.62867296", "0.62576514", "0.6189976", "0.6163574", "0.61586976", "0.6124076", "0.61215615", "0.61039996", "0.60986626", "0.60819805", "0.60819805", "0.60790247", "0.60790247", "0.60790247", "0.6059419", "0.6059419", "0.6059419", "0.6059419", "0.6059419", "0.60412794", "0.602957", "0.6021885", "0.59878033", "0.59878033", "0.5984884", "0.598015", "0.59739554", "0.5944702", "0.5944702", "0.59338695", "0.5915742", "0.5897395", "0.5896163", "0.5891416", "0.58646536", "0.58638734", "0.5861224", "0.5851354", "0.58448935", "0.5840893", "0.5829042", "0.58165556", "0.5813969", "0.5800278", "0.5797318", "0.57932407", "0.579015", "0.57890755", "0.578591", "0.57807285", "0.57774097", "0.57635605", "0.57604855", "0.57563215", "0.57552147", "0.574527", "0.57414633", "0.57407403", "0.57398385", "0.57395804", "0.5732838", "0.5730836", "0.57288265", "0.57231903", "0.57205313", "0.57176805", "0.57122904", "0.5703389", "0.56946784", "0.5672974", "0.5663872", "0.56634104", "0.56505805", "0.5649528", "0.5649528", "0.5649528", "0.5636498", "0.5634677", "0.56201315", "0.5616074", "0.5614595", "0.5614595", "0.5614595", "0.5614595", "0.560774", "0.56049925", "0.5604563", "0.56006646", "0.5596932", "0.5590236", "0.55889535", "0.5586092", "0.55839634", "0.557949", "0.5577041", "0.55729115", "0.5571432" ]
0.0
-1
Creates a new empty account storage
public AccountStorage() { accounts = new ConcurrentHashMap<>(); minerMap = new ConcurrentHashMap<>(); blockMap = new ConcurrentHashMap<>(); initAccounts(); logger.info("AccountStorage: New AccountStorage created."); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n @POST\n @Path(\"/storages\")\n public Response createStorage() throws Exception {\n URI resourceUri = new URI(\"/1\");\n return Response.created(resourceUri).build();\n }", "Account create();", "@Override\n public void createDirectory(File storageName) throws IOException {\n }", "public StorageManager() {\n makeDirectory();\n }", "public Storage() {\n\n }", "public DefaultStorage() {\n }", "Account create(Context context);", "public StorageConfig() {\n }", "private InternalStorage() {}", "public Account()\n {\n id = UUID.randomUUID();\n }", "public Storage(String filePath) {\n file = new File(filePath);\n try {\n file.getParentFile().mkdir();\n file.createNewFile();\n } catch (IOException e) {\n System.err.println(\"Unable to create file\");\n }\n }", "public static void main(String[] args) throws Exception {\n\t\t \n\t\t GoogleCredentials credentials = GoogleCredentials.fromStream(new FileInputStream(\"/home/sahana/Downloads/access.json\"));\n\t\t \n\t\t Storage storage = StorageOptions.newBuilder().setCredentials(credentials).build().getService();\n\t\t \n\t\t System.out.println(storage);\n\n\t\t // The name for the new bucket\n\t\t String bucketName = \"sahana\"; // \"my-new-bucket\";\n\t\t \n\t\t // Creates the new bucket\n\t\t Bucket bucket = storage.create(BucketInfo.of(bucketName));\n\n\t\t System.out.printf(\"Bucket %s created.%n\", bucket.getName()); \n\t\t \n\t\t //Bucket bucket = storage.create(BucketInfo.newBuilder(bucketName).setStorageClass(StorageClass.MULTI_REGIONAL).setLocation(\"asia\").build()); \n\t\t /*String bucketName = \"my_unique_bucket\";\n\t\t String blobName = \"my_blob_name\";\n\t\t BlobId blobId = BlobId.of(bucketName, blobName);\n\t\t BlobInfo blobInfo = BlobInfo.newBuilder(blobId).setContentType(\"text/plain\").build();\n\t\t Blob blob = storage.create(blobInfo);\n\t\t \n\t\t System.out.println(blob); */\n\t\t }", "public Storage(String path) throws IOException {\n assert path != null : \"Path for file storage cannot be null.\";\n file = new File(path);\n if (!file.getParentFile().exists()) {\n file.getParentFile().mkdir();\n file.createNewFile();\n }\n }", "private static Account createAndStoreAccount(String fileName, String GID, String name, Context activity) {\r\n\t\tAccount newAccount = new Account(GID, name); \r\n\t\tAccount.currentAccount = newAccount;\r\n\t\t\r\n\t try {\r\n\t //use buffering\r\n\t FileOutputStream fos = activity.openFileOutput(fileName, Context.MODE_PRIVATE);\r\n\t\t\tObjectOutputStream oos = new ObjectOutputStream(fos);\r\n\t\t\toos.writeObject(newAccount); \r\n\t try {\r\n\t \toos.writeObject(newAccount);\r\n\t }\r\n\t finally {\r\n\t \toos.close();\r\n\t }\r\n\t } \r\n\t catch(IOException ex){\r\n\t System.out.println(\"Cannot perform output.\");\r\n\t }\r\n\t\t\r\n\t\treturn newAccount;\r\n\t}", "public void createUserAccount(UserAccount account);", "public Storage() {\n this(null, DEFAULT_MAX, DEFAULT_MAX_SIZE);\n }", "private Account createAccount(byte[] address) {\n return new Account(address);\n }", "public abstract void createAccount(JSONObject account);", "public StorageConfiguration() {\n }", "public static Account createNewAccount(String GID, String name, Context activity) {\r\n\t\t\r\n\t\tString[] emailParts = GID.split(\"@\"); \r\n\t\t\r\n\t\t//Check if this Account is already stored\r\n\t\tString fileName = name + \"_\" + emailParts[0] + \"_\" + emailParts[1]; \r\n\t\t\r\n\t\tFile f = new File(activity.getFilesDir(), fileName);\r\n\t\t\r\n\t\tif(f.exists()) {\r\n\t\t try {\r\n\t\t //use buffering\r\n\t\t FileInputStream fis = activity.openFileInput(fileName);\r\n\t\t\t\tObjectInputStream ois = new ObjectInputStream(fis);\r\n\t\t\t\ttry {\r\n\t\t\t\t\tAccount recoveredAccount = (Account) ois.readObject();\r\n\t\t\t\t\tcurrentAccount = recoveredAccount;\r\n\t\t\t return recoveredAccount;\r\n\t\t\t\t}\r\n\t\t finally {\r\n\t\t \tois.close();\r\n\t\t }\r\n\t\t }\r\n\t\t \r\n\t\t catch(ClassNotFoundException ex){\r\n\t\t \tSystem.out.println(\"Cannot perform input. Class not found.\");\r\n\t\t \treturn createAndStoreAccount(fileName, GID, name);\r\n\t\t }\r\n\t\t catch(IOException ex){\r\n\t\t System.out.println(\"Cannot perform input.\");\r\n\t\t return createAndStoreAccount(fileName, GID, name);\r\n\t\t }\r\n\t\t \r\n\t\t} else {\r\n\t\t\treturn createAndStoreAccount(fileName, GID, name, activity);\r\n\t\t}\r\n\t}", "private void createNewAccount() {\n\n // if user has not provided valid data, do not create an account and return from method\n if (!validateData()) {\n return;\n }\n\n // If flag value is false, that means email provided by user doesn't exists in database\n // so initialize the loader to create a new account\n if (!mEmailExistsFlag) {\n getLoaderManager().initLoader(CREATE_NEW_ACCOUNT_LOADER_ID, null, this);\n } else {\n // If flag is true, that means email provided by user already exists in database\n // so restart the loader and allow user to enter new email address for account\n getLoaderManager().restartLoader(CREATE_NEW_ACCOUNT_LOADER_ID, null, this);\n }\n\n }", "Account() { }", "private void initial(){\n storeAccount(\"201799990001030047\");\n }", "@Test\n\tpublic void createAccountSavingTest() {\n\t\tsetChequingRadioDefaultOff();\n\t\trdbtnSaving.setSelected(true);\n\t\tdata.setRdbtnSaving(rdbtnSaving);\n\t\tAccount account = data.createNewAccount();\n\t\taccountTest = new Account(TEST_ACCOUNT_NAME, bankTest,\n\t\t\t\tAccount.Types.SAVING.getAccountType());\n\t\tassertEquals(accountTest, account);\n\t}", "public ExternallyOwnedAccount() {}", "public static StellarAccount createEntity(EntityManager em) {\n StellarAccount stellarAccount = new StellarAccount()\n .name(DEFAULT_NAME)\n .accountId(DEFAULT_ACCOUNT_ID)\n .secretSeed(DEFAULT_SECRET_SEED);\n return stellarAccount;\n }", "public abstract void createAccount(final GDataAccount account)\n throws ServiceException;", "@Override\n public void createNewAccount(String accountType) {\n FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();\n fragmentTransaction.replace(R.id.create_container, new CreateAccount().newInstance(accountType)).commit();\n }", "CommunityStorage createCommunityStorage( String name, byte[] user_short_pid ) \r\n throws CommunityException;", "public static Account createNewAccount(String GID, String name) {\r\n\t\t\r\n\t\tString[] emailParts = GID.split(\"@\"); \r\n\t\t\r\n\t\t//Check if this Account is already stored\r\n\t\tString fileName = name + \"_\" + emailParts[0] + \"_\" + emailParts[1]; \r\n\t\t\r\n\t\tFile f = new File(fileName);\r\n\t\t\r\n\t\tif(f.exists()) {\r\n\t\t try {\r\n\t\t //use buffering\r\n\t\t InputStream file = new FileInputStream(fileName);\r\n\t\t InputStream buffer = new BufferedInputStream(file);\r\n\t\t ObjectInput input = new ObjectInputStream(buffer);\r\n\t\t \r\n\t\t try {\r\n\t\t\t //deserialize the Account object\r\n\t\t\t Account recoveredAccount = (Account)input.readObject();\r\n\t\t\t currentAccount = recoveredAccount;\r\n\t\t\t return recoveredAccount;\r\n\t\t }\r\n\t\t \r\n\t\t finally {\r\n\t\t \tinput.close();\r\n\t\t }\r\n\t\t }\r\n\t\t \r\n\t\t catch(ClassNotFoundException ex){\r\n\t\t \tSystem.out.println(\"Cannot perform input. Class not found.\");\r\n\t\t \treturn createAndStoreAccount(fileName, GID, name);\r\n\t\t }\r\n\t\t catch(IOException ex){\r\n\t\t System.out.println(\"Cannot perform input.\");\r\n\t\t return createAndStoreAccount(fileName, GID, name);\r\n\t\t }\r\n\t\t \r\n\t\t} else {\r\n\t\t\treturn createAndStoreAccount(fileName, GID, name);\r\n\t\t}\r\n\t}", "public static Account createSyncAccount(Context context) {\n Account newAccount = new Account(\n ACCOUNT, ACCOUNT_TYPE);\n // Get an instance of the Android account manager\n AccountManager accountManager =\n (AccountManager) context.getSystemService(\n ACCOUNT_SERVICE);\n /*\n * Add the account and account type, no password or user data\n * If successful, return the Account object, otherwise report an error.\n */\n if (accountManager.addAccountExplicitly(newAccount, null, null)) {\n /*\n * If you don't set android:syncable=\"true\" in\n * in your <provider> element in the manifest,\n * then call context.setIsSyncable(account, AUTHORITY, 1)\n * here.\n */\n } else {\n /*\n * The account exists or some other error occurred. Log this, report it,\n * or handle it internally.\n */\n }\n return newAccount;\n }", "@Override\n\tpublic Account createAccount(Account account) {\n\t\tif(account != null) {\n\t\t\taccountList.add(account);\n\t\t\treturn account;\n\t\t}\n\t\t\n\t\treturn null;\n\t}", "public static Account CreateSyncAccount(Context context) {\n Account newAccount = new Account(\n ACCOUNT, ACCOUNT_TYPE);\n // Get an instance of the Android account manager\n AccountManager accountManager =\n (AccountManager) context.getSystemService(\n ACCOUNT_SERVICE);\n /*\n * Add the account and account type, no password or user data\n * If successful, return the Account object, otherwise report an error.\n */\n if (accountManager.addAccountExplicitly(newAccount, null, null)) {\n /*\n * If you don't set android:syncable=\"true\" in\n * in your <provider> element in the manifest,\n * then call context.setIsSyncable(account, AUTHORITY, 1)\n * here.\n */\n } else {\n /*\n * The account exists or some other error occurred. Log this, report it,\n * or handle it internally.\n */\n }\n\n return newAccount;\n }", "public AccountDatabase() {\n accounts = new Account[5];\n size = 0;\n }", "int createAccount(Account account);", "public AccountManager(){\r\n allAccounts.put(\"CreditCard\",credits);\r\n allAccounts.put(\"LineOfCredit\",lineOfCredits);\r\n allAccounts.put(\"Chequing\",chequing);\r\n allAccounts.put(\"Saving\",saving);\r\n createAccount(\"3\", 0);\r\n primaryAccount = chequing[0];\r\n }", "private StorageFacade() {\n }", "public void createStorageFile() throws IoDukeException {\n PrintWriter writer = null;\n try {\n writer = getStorageFile();\n } catch (IOException e) {\n throw new IoDukeException(\"Error opening task file for reading\");\n } finally {\n if (writer != null) {\n writer.close();\n }\n }\n }", "static Wallet createInMemoryWallet() {\n return new InMemoryWallet();\n }", "public static Account createSyncAccount(Context context) {\n // Create the account type and default account\n Account newAccount = new Account(Constants.ACCOUNT, context.getResources().getString(R.string.sync_account_type));\n // Get an instance of the Android account manager\n AccountManager accountManager = (AccountManager) context.getSystemService(ACCOUNT_SERVICE);\n\n if (accountManager.addAccountExplicitly(newAccount, null, null)) {\n ContentResolver.setIsSyncable(newAccount, context.getResources().getString(R.string.content_authority), 1);\n ContentResolver.setSyncAutomatically(newAccount, context.getResources().getString(R.string.content_authority), true);\n //Set periodic sync duration in seconds\n ContentResolver.addPeriodicSync(newAccount, context.getResources().getString(R.string.content_authority), new Bundle(), Constants.SYNC_FREQUENCY);\n if (INFO_LOG) {\n Log.i(\"BDCloudUtils-createSyncAccount\", \"Sync Account added = \" + newAccount);\n }\n } else {\n if (ERROR_LOG) {\n Log.wtf(\"BDCloudUtils-createSyncAccount\", \"Error creating sync account\");\n }\n }\n\n return newAccount;\n }", "public StorageResource() {\n }", "public Storage(int storageSize) {\n\t\tstorageSpace = new Block[storageSize];\n\t}", "public void nonDefaultBucket() {\n FirebaseStorage storage = FirebaseStorage.getInstance(\"gs://my-custom-bucket\");\n // [END storage_non_default_bucket]\n }", "public void createAccount(){\n System.out.println(\"vi skal starte \");\n }", "public Account() {\n this(null, 0);\n }", "public AzureStorageContainer() {\n }", "@TargetApi(Build.VERSION_CODES.FROYO)\n public static void createSyncAccount(Context context) {\n boolean newAccount = false;\n boolean setupComplete = PreferenceManager\n .getDefaultSharedPreferences(context).getBoolean(PREF_SETUP_COMPLETE, false);\n\n // Create account, if it's missing. (Either first run, or user has deleted account.)\n Account account = acccountBuilder(context);\n AccountManager accountManager = (AccountManager) context.getSystemService(Context.ACCOUNT_SERVICE);\n if (accountManager.addAccountExplicitly(account, null, null)) {\n // Inform the system that this account supports sync\n ContentResolver.setIsSyncable(account, CONTENT_AUTHORITY, 1);\n // Inform the system that this account is eligible for auto sync when the network is up\n ContentResolver.setSyncAutomatically(account, CONTENT_AUTHORITY, true);\n // Recommend a schedule for automatic synchronization. The system may modify this based\n // on other scheduled syncs and network utilization.\n ContentResolver.addPeriodicSync(account, CONTENT_AUTHORITY, new Bundle(), SYNC_FREQUENCY);\n newAccount = true;\n }\n\n if (newAccount) {\n AccountUtils.setActiveAccount(context, account.name);\n }\n\n // Schedule an initial sync if we detect problems with either our account or our local\n // data has been deleted. (Note that it's possible to clear app data WITHOUT affecting\n // the account list, so wee need to check both.)\n if (newAccount || !setupComplete) {\n requestManualSync(account);\n PreferenceManager.getDefaultSharedPreferences(context).edit()\n .putBoolean(PREF_SETUP_COMPLETE, true).commit();\n }\n }", "@Override\n public StorageOutputStream create(File file) throws IOException {\n\treturn null;\n }", "private void login() {\n if (blobStore != null) {\n return;\n }\n if (swiftUsername == null || swiftPassword == null || swiftAuthUrl == null || swiftContainer == null) {\n logger.error(\"Blob storage account is not configured\");\n throw new IllegalArgumentException(\"ERROR: Blob storage account is not configured\");\n }\n blobStore = ContextBuilder.newBuilder(blobApi)\n .endpoint(swiftAuthUrl)\n .credentials(swiftUsername, swiftPassword)\n .buildView(BlobStoreContext.class)\n .getBlobStore();\n\n if (!blobStore.containerExists(swiftContainer)) {\n// CreateContainerOptions options = CreateContainerOptions.Builder\n// .withMetadata(ImmutableMap.of(\"description\", \"E-PRTR data\"));\n// blobStore.createContainerInLocation(null, swiftContainer, options);\n Location location = getRegion();\n blobStore.createContainerInLocation(location, swiftContainer);\n }\n }", "public Account() {\n\t}", "public Account() {\n\n\t}", "@Test\n @Order(4)\n void create_account_2() {\n Account empty = service.createAccount(client.getId());\n Assertions.assertEquals(client.getId(), empty.getClientId());\n Assertions.assertNotEquals(-1, empty.getId());\n Assertions.assertEquals(0, empty.getAmount());\n client.addAccount(empty);\n }", "Cloud createCloud();", "public void createAccount() {\n\t\tSystem.out.print(\"Enter Name: \");\n\t\tString name = nameCheck(sc.next());\n\t\tSystem.out.print(\"Enter Mobile No.: \");\n\t\tlong mobNo = mobCheck(sc.nextLong());\n\t\tlong accNo = mobNo - 1234;\n\t\tSystem.out.print(\"Enter Balance: \"); \n\t\tfloat balance = amountCheck(sc.nextFloat());\n\t\tuserBean BeanObjCreateAccountObj = new userBean(accNo, name, mobNo, balance);\n\t\tSystem.out.println(\"Account created with Account Number: \" +accNo);\n\t\tServiceObj.bankAccountCreate(BeanObjCreateAccountObj);\n\t\t\n\t\n\t}", "@Test\n\tpublic void testCreateAdminAccountWithEmptyName() {\n\t\tString name = \"\";\n\t\tString username = \"Catherine\";\n\t\tString error = null;\n\t\tAdminAccount user = null; \n\t\ttry {\n\t\t\tuser = adminAccountService.createAdminAccount(username, PASSWORD1, name);\n\t\t} catch (InvalidInputException e) {\n\t\t\terror = e.getMessage();\n\t\t}\n\n\t\tassertNull(user);\n\t\t// check error\n\t\tassertEquals(\"Name cannot be empty.\", error);\n\t}", "public ChassisStashStorage() {\n super();\n }", "@Override\n public void onCreate(SQLiteDatabase db) {\n db.execSQL(\"create table Accounts (id integer primary key autoincrement, name text, surname text, phone text, password text, status text, chatID text);\");\n }", "public External withStorageAccount(StorageAccount storageAccount) {\n this.storageAccount = storageAccount;\n return this;\n }", "public Account() {\n super();\n }", "public void create(){}", "public Account() {\n }", "private void createAccounts(){\r\n for(int i = 0; i < accountInTotal; i++){\r\n try {\r\n Account tempAccount = new Account(startingBonds);\r\n theAccounts.add(tempAccount);\r\n } catch(Exception e){\r\n System.err.println(\"Error\");\r\n }\r\n }\r\n }", "public static Storage create(String fileName) throws DukeException {\n try {\n if (!Files.exists(Storage.DATA_DIR)) {\n Files.createDirectory(Storage.DATA_DIR);\n }\n Path filePath = Paths.get(Storage.DATA_DIR.toString(), fileName);\n BufferedWriter writer = Files.newBufferedWriter(filePath);\n return new Storage(writer);\n } catch (IOException e) {\n throw Ui.ioException(e);\n }\n }", "@Test\n public void testGenericStorageSerializationAndStorageFunctions() {\n String serializationFilename = \"TestStorage\";\n\n // Creating the GenericStorage which is under test\n GenericStorage<String, TestObject> storage = new GenericStorage\n (serializationFilename);\n\n // Creating the key we'll use to store the object\n String key = \"Hello\";\n\n // Creating a bogus object to see if it is stored and recovered properly\n TestObject testObj = new TestObject(\"HelloThisIsATest\");\n\n\n // Storing the object\n storage.create(key, testObj);\n\n // Is the object properly stored\n assert(storage.exists(key));\n assert(storage.read(key).equals(testObj));\n\n // Trying to serialize the object\n storage.saveStorage();\n\n // Resetting the storage to null\n storage = null;\n storage = new GenericStorage(\"TestStorage\");\n\n // The object shouldn't exist anymore in the storage\n assert(!storage.exists(key));\n\n // The storage should be restored with the serialization\n storage.loadStorage();\n\n // Is the object properly stored\n assert(storage.exists(key));\n assert(storage.read(key).equals(testObj));\n\n }", "static Wallet createFileSystemWallet(Path basePath) throws IOException {\n return new FileSystemWallet(basePath);\n }", "private Account createAccount8() {\n Account account = new Account(\"123456008\", \"Jean Sans Enfant\",\n new SimpleDate(4, 23, 1976).asDate(), \"[email protected]\", true, false, new CreditCard(\"4320123412340008\"));\n\n return account;\n }", "private void createAccount()\n {\n // check for blank or invalid inputs\n if (Utils.isEmpty(edtFullName))\n {\n edtFullName.setError(\"Please enter your full name.\");\n return;\n }\n\n if (Utils.isEmpty(edtEmail) || !Utils.isValidEmail(edtEmail.getText().toString()))\n {\n edtEmail.setError(\"Please enter a valid email.\");\n return;\n }\n\n if (Utils.isEmpty(edtPassword))\n {\n edtPassword.setError(\"Please enter a valid password.\");\n return;\n }\n\n // check for existing user\n AppDataBase database = AppDataBase.getAppDataBase(this);\n User user = database.userDao().findByEmail(edtEmail.getText().toString());\n\n if (user != null)\n {\n edtEmail.setError(\"Email already registered.\");\n return;\n }\n\n user = new User();\n user.setId(database.userDao().findMaxId() + 1);\n user.setFullName(edtFullName.getText().toString());\n user.setEmail(edtEmail.getText().toString());\n user.setPassword(edtPassword.getText().toString());\n\n database.userDao().insert(user);\n\n Intent intent = new Intent(this, LoginActivity.class);\n intent.putExtra(\"user\", user);\n startActivity(intent);\n }", "public void createAccount() {\n System.out.println(\"Would you like to create a savings or checking account?\");\n String AccountRequest = input.next().toLowerCase().trim();\n createAccount(AccountRequest);\n\n }", "public Storage() {\n\t\tstorageReader = new StorageReader();\n\t\tstorageWriter = new StorageWriter();\n\t\tdirectoryManager = new DirectoryManager();\n\n\t\tFile loadedDirectory = storageReader.loadDirectoryConfigFile(FILENAME_DIRCONFIG);\n\t\tif (loadedDirectory != null) {\n\t\t\tif (directoryManager.createDirectory(loadedDirectory) == true) {\n\t\t\t\tdirectory = loadedDirectory;\n\t\t\t\tSystem.out.println(\"{Storage} Directory loaded | \" + directory.getAbsolutePath());\n\t\t\t} else { //loaded directory was invalid or could not be created\n\t\t\t\tdirectoryManager.createDirectory(DEFAULT_DIRECTORY);\n\t\t\t\tdirectory = DEFAULT_DIRECTORY;\n\t\t\t}\n\t\t} else { //directory config file was not found\n\t\t\tdirectoryManager.createDirectory(DEFAULT_DIRECTORY);\n\t\t\tdirectory = DEFAULT_DIRECTORY;\n\t\t}\n\t}", "public SavingAccount()\n\t\t{\n\t\t\tsuper();\n\t\t}", "public Account() {\n }", "public Account() {\n }", "@Override\n\tpublic URI create(URI uri) throws StorageSecuirtyException,\n\t\t\tResourceAccessException {\n\t\treturn null;\n\t}", "@Override\n\tpublic User createNewUser(Account account) {\n\t\treturn new User(account);\n\t\t\n\t}", "@Test\n\tvoid testCreateAccount() {\n\t\t\n\t\t// Data Object for unregister user\n\t\tUser user = new User(\"Create AccountExample\", \"CreateAccount\", \"[email protected]\");\n\t\t\n\t\t// Prepare data\n\t\tUserDAO dao = new UserDAO();\n\t\tboolean exist = false;\n\t\t\n\t\ttry {\n\t\t\t// Creating User in DB\n\t\t\tdao.createAccount(user, \"CreateAccountPassword\");\n\t\t\t\n\t\t\t// Boolean confirming if exist\n\t\t\texist = !dao.availabilityUsername(user.getUsername());\n\t\t\t\n\t\t\t// Deleting account\n\t\t\tdao.deleteAccount(user.getUsername());\n\t\t\t\n\t\t} catch (ClassNotFoundException | UnsupportedEncodingException | SQLException | GeneralSecurityException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\t// Asserting that the create account works\n\t\tassertTrue(exist);\n\t}", "T create() throws PersistException;", "public static final Account createDefaultStudentAccount() {\n Name name = new Name(\"Bob\");\n Credential credential = new Credential(\"student\", \"student\");\n MatricNumber matricNumber = new MatricNumber(\"A0123456X\");\n PrivilegeLevel privilegeLevel = new PrivilegeLevel(1);\n Account student = new Account(name, credential, matricNumber, privilegeLevel);\n return student;\n }", "public Account() {\n\n }", "GenerateUserAccount () {\r\n }", "public UserAccount() {\n\n\t}", "public InMemoryKeyValueStorage() {\n this(SEGMENT_IDENTIFIER);\n }", "public Account createAccount(String accountId) throws LedgerException {\n // Check uniqueness of 'accountId'\n if (getExistingAccount(accountId) != null) {\n throw new LedgerException(\n \"create account\",\n String.format(\"The account '%s' already exists.\", accountId)\n );\n }\n\n // The accountId is unique, so create new account\n Account newAccount = new Account(accountId);\n\n // Update currentBlock with new account\n this.currentBlock.addAccount(newAccount);\n return newAccount;\n }", "@Test\n\tpublic void createNewMyKeyEmptyName() {\n\t\tRsaKeyStore ks = new RsaKeyStore();\n\t\tboolean re = ks.createNewMyKeyPair(\"\");\n\t\tassertFalse(\"Should not have created new my keypair: empty name\", re);\n\t}", "private void createAccount() {\n mAuth.createUserWithEmailAndPassword(mTextEmail.getText().toString(), mTextPassword.getText().toString()).addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n Log.d(TAG, \"createUserWithEmail:onComplete:\" + task.isSuccessful());\n\n if(!task.isSuccessful()){\n Toast.makeText(SignInActivity.this, \"Account creation failed!\", Toast.LENGTH_SHORT).show();\n } else {\n Toast.makeText(SignInActivity.this, \"Account creation success!\", Toast.LENGTH_SHORT).show();\n }\n }\n });\n }", "Account(){\r\n\t\t//id, balance and annualInterestRate are set to 0, the dateCreated is set to the current date and time\r\n\t\t setId(0);\r\n\t\t setBalance(0);\r\n\t\t setAnnualInterestRate(0);\r\n\t\t this.dateCreated = new Date(System.currentTimeMillis());\r\n\t }", "UserAccount createUserAccount(User user, double amount);", "@Override\n\tpublic void createAccount(String username, Bank bank) {\n\t\ttry {\n\t\tAccount newAccount = new Account(username, bank.getBankID(), bank.getNumOfAccounts()+1);\n\t\tbank.setNumOfAccounts(bank.getNumOfAccounts()+1);\n\t\taddAccount(bank, newAccount);\n\t\t}catch(NullPointerException e) {\n\t\t\tSystem.out.println(\"Could not find bank\");\n\t\t}\n\t\t\n\t}", "public Account() {\n this(DSL.name(\"account\"), null);\n }", "@Test\n public void testDeleteAllUserData() {\n storage().deleteAllUserData();\n createSomeUserData();\n Assertions.assertEquals(8, countStorageEntities());\n // ^ TODO Change to 9 after https://github.com/Apicurio/apicurio-registry/issues/1721\n // Delete all\n storage().deleteAllUserData();\n Assertions.assertEquals(0, countStorageEntities());\n }", "public abstract FlowNodeStorage instantiateStorage(MockFlowExecution exec, File storageDirectory);", "public void createAccount(double balance) {\r\n\t\tAccount account = new Account(balance);\r\n\t\tsetPlayerAccount(account);\r\n\t}", "@Override\n public void createPartition(Partition partition) {\n \n }", "WithCreate withProperties(AccountProperties properties);", "@Test\n\tpublic void testCreateAdminAccountWithEmptyPassword() {\n\t\tString username = \"Catherine\";\n\t\tString password = \"\";\n\t\tString error = null;\n\t\tAdminAccount user = null; \n\t\ttry {\n\t\t\tuser = adminAccountService.createAdminAccount(username, password, NAME1);\n\t\t} catch (InvalidInputException e) {\n\t\t\terror = e.getMessage();\n\t\t}\n\n\t\tassertNull(user);\n\t\t// check error\n\t\tassertEquals(\"Password cannot be empty.\", error);\n\t}", "public Account(String currency) {\n //numAccount += 1;\n incrementNumAccount();\n this.accountID = numAccount;\n this.dateOfCreation = LocalDate.now();\n\n setPrimaryCurrency(currency);\n this.currencyBalance = Money.of(0, this.primaryCurrency);\n ownerID = new ArrayList<>();\n }", "public Account createAccount() {\n\t\t\n\t\tAccountBuilder builder = new AccountBuilder();\n\t\tUserRole role = new UserRole();\n\t\trole.setUsername(getUsername());\n\t\trole.setRole(\"ROLE_USER\");\n\t\t\n\t\t//builds the account entity using the front end POJO\n\t\tbuilder\n\t\t\t.withUsername(getUsername())\n\t\t\t.withPassword(getPassword())\n\t\t\t.withLastName(getLastName())\n\t\t\t.withFirstName(getFirstName())\n\t\t\t.withRole(role)\n\t\t\t.withStatus(AccountStatus.ACTIVE)\n\t\t\t.withEmail(getEmail())\n\t\t\t.withStoreCd(getStoreCd());\n\t\t\n return builder.build();\n\t}", "public UserStorage() {\n this.base = new TreeMap<>();\n }", "void saveStorage(StorageEntity storage);", "private void createPassenger() {\n account = new Account(\"driver\", \"password\", \"[email protected]\",\n \"Dan\", \"20 Howard Street\", 1234567, 64278182123L);\n }", "public static AccountRest createAccount(ExternalTestCurrency currency, String id) {\n\t\tAccountRestBuilder builder = createAccountBuilder(currency, id);\n\t\treturn builder.build();\n\t}" ]
[ "0.61896574", "0.6074514", "0.60308725", "0.60121447", "0.584099", "0.57221305", "0.5673384", "0.55663043", "0.5558084", "0.551353", "0.5499", "0.5489575", "0.54832804", "0.54764265", "0.54432017", "0.5440419", "0.5438835", "0.5426008", "0.5423047", "0.5411219", "0.54018843", "0.5365521", "0.53644484", "0.5353314", "0.5324869", "0.53018737", "0.5291509", "0.527779", "0.52759373", "0.52728087", "0.52701813", "0.52681863", "0.5256268", "0.52557397", "0.5254559", "0.5236289", "0.52329874", "0.5232948", "0.52255267", "0.52227885", "0.5221856", "0.5218942", "0.5218508", "0.5218448", "0.5213574", "0.51947296", "0.51824975", "0.5167405", "0.5161904", "0.51608044", "0.5138905", "0.51314354", "0.51223624", "0.5120134", "0.51144356", "0.5113761", "0.51101243", "0.51076496", "0.5106352", "0.5094539", "0.5092119", "0.5088357", "0.5078188", "0.5078076", "0.50738204", "0.5069509", "0.5069078", "0.50580543", "0.5055442", "0.50478923", "0.5047199", "0.5047199", "0.50461894", "0.50457305", "0.5027059", "0.50253415", "0.5009617", "0.50062156", "0.49980512", "0.49907333", "0.49860606", "0.49658206", "0.4961352", "0.49609905", "0.49586266", "0.49533617", "0.49505666", "0.4946194", "0.4943337", "0.49396423", "0.4926497", "0.49232435", "0.49190876", "0.4916031", "0.49131542", "0.490924", "0.49090472", "0.49075887", "0.4906696", "0.4899246" ]
0.65295106
0
Initializes the accounts from the genesis block of the blockchain and all the blocks already created
private void initAccounts() { ((GenesisBlock) DependencyManager.getBlockchain().getGenesisBlock()).getAccountBalances().forEach((key, value) -> { Account account = getAccount(key); account.addBalance(value); }); DependencyManager.getBlockchain().getChain().getChain().forEach(this::parseBlock); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void initAccount() {\n initAccount(Huobi.PLATFORM_NAME, Gateio.PLATFORM_NAME, \"EOS_USDT\", 14.5632);\n\n\n initAccount(Huobi.PLATFORM_NAME, Fcoin.PLATFORM_NAME, \"LTCUSDT\", 112.610000000);\n initAccount(Huobi.PLATFORM_NAME, Fcoin.PLATFORM_NAME, \"BCHUSDT\", 1032.690000000);\n initAccount(Huobi.PLATFORM_NAME, Fcoin.PLATFORM_NAME, \"ETHUSDT\", 572.300000000);\n\n initAccount(Huobi.PLATFORM_NAME, Dragonex.PLATFORM_NAME, \"EOSUSDT\", 13.1469);\n initAccount(Huobi.PLATFORM_NAME, Dragonex.PLATFORM_NAME, \"NEOUSDT\", 48.4760);\n initAccount(Huobi.PLATFORM_NAME, Dragonex.PLATFORM_NAME, \"ETHUSDT\", 572.1195);\n }", "public static void init() {\n Handler.log(Level.INFO, \"Loading Blocks\");\n\n oreAluminum = new BaseOre(Config.oreAluminumID).setUnlocalizedName(Archive.oreAluminum)\n .setHardness(3.0F).setResistance(5.0F);\n\n blockGrinder = new BaseContainerBlock(Config.blockGrinderID, Archive.grinderGUID)\n .setUnlocalizedName(Archive.blockGrinder);\n\n blockOven = new BaseContainerBlock(Config.blockOvenID, Archive.ovenGUID)\n .setUnlocalizedName(Archive.blockOven);\n }", "public static void initializeBlockFields() {\n KitchenMod.LOGGER.log(\"Initializing static block fields\");\n KMComposterBlock.rinit();\n\n StakeBlock.registerPlant(GRAPE_VINE);\n StakeBlock.registerPlant(TOMATO_VINE);\n StakeBlock.registerPlant(VANILLA_VINE);\n }", "@Before\n public void initTest() {\n AccountCapsule ownerAccountFirstCapsule =\n new AccountCapsule(\n ByteString.copyFromUtf8(ACCOUNT_NAME_FIRST),\n ByteString.copyFrom(ByteArray.fromHexString(OWNER_ADDRESS_FIRST)),\n AccountType.Normal,\n 10000_000_000L);\n AccountCapsule ownerAccountSecondCapsule =\n new AccountCapsule(\n ByteString.copyFromUtf8(ACCOUNT_NAME_SECOND),\n ByteString.copyFrom(ByteArray.fromHexString(OWNER_ADDRESS_SECOND)),\n AccountType.Normal,\n 20000_000_000L);\n\n dbManager.getAccountStore()\n .put(ownerAccountFirstCapsule.getAddress().toByteArray(), ownerAccountFirstCapsule);\n dbManager.getAccountStore()\n .put(ownerAccountSecondCapsule.getAddress().toByteArray(), ownerAccountSecondCapsule);\n\n dbManager.getDynamicPropertiesStore().saveLatestBlockHeaderTimestamp(1000000);\n dbManager.getDynamicPropertiesStore().saveLatestBlockHeaderNumber(10);\n dbManager.getDynamicPropertiesStore().saveNextMaintenanceTime(2000000);\n }", "@Before\n\tpublic void init() {\n\t\tthis.acccountMock = new AccountDTO();\n\t\tthis.acccountMock.setId(ACCOUNT_ID);\n\t\tthis.acccountMock.setActive(true);\n\t\tthis.acccountMock.setBankingTransactions(new ArrayList<>());\n\n\t}", "public static void initialize()\n {\n CHUNK_LOADER = new ChunkLoader();\n //VILLAGE_INDICATOR = new VillageIndicator();\n\n BLOCK_LIST.add(CHUNK_LOADER);\n //BLOCK_LIST.add(VILLAGE_INDICATOR);\n Log.info(\"=========================================================> Initialized Blocks\");\n }", "public BlockChain() {\n this.blockChain = new ArrayList<>();\n this.chainHash = \"\";\n }", "public static void init()\n {\n oreStarSteel = new BlockOreStarSteel(MSAConfig.ores, Material.rock);\n storageStarSteel = new BlockStorageStarSteel(MSAConfig.storageBlock, Material.iron);\n // tech blocks\n launchTower = new BlockLaunchTower(MSAConfig.launchTower, Material.iron);\n launchTowerController = new BlockLaunchControl(MSAConfig.launchController, Material.iron);\n rocketAssembler = new BlockRocketAssembler(MSAConfig.rocketAssembler, Material.iron);\n comSatellite = new BlockComSatellite(MSAConfig.comSatellite, Material.iron);\n ssBuilding = new BlockSSBuilding(MSAConfig.ssBuilding, Material.rock);\n commandCenter = new BlockCommandCenter(MSAConfig.commandCenter, Material.iron);\n\n /* Register Blocks */\n // ore blocks\n GameRegistry.registerBlock(oreStarSteel, \"oreStarSteel\");\n GameRegistry.registerBlock(storageStarSteel, \"storageStarSteel\");\n // tech blocks\n GameRegistry.registerBlock(launchTower, \"launchTower\");\n GameRegistry.registerBlock(launchTowerController, \"launchTowerController\");\n GameRegistry.registerBlock(rocketAssembler, \"rocketAssembler\");\n GameRegistry.registerBlock(comSatellite, \"comSatellite\");\n GameRegistry.registerBlock(ssBuilding, \"ssBuilding\");\n GameRegistry.registerBlock(commandCenter, \"commandCenter\");\n\n /* Set block harvest level */\n // ore blocks\n MinecraftForge.setBlockHarvestLevel(oreStarSteel, \"pickaxe\", 2);\n MinecraftForge.setBlockHarvestLevel(storageStarSteel, \"pickaxe\", 2);\n // building blocks\n MinecraftForge.setBlockHarvestLevel(ssBuilding, \"pickaxe\", 2);\n // tech blocks\n MinecraftForge.setBlockHarvestLevel(launchTower, \"pickaxe\", 1);\n }", "private static void assignBankAccounts() {\n\t\tfor (Customer customer : customerList) {\n\t\t\t//make sure customer has no current accounts before adding serialized accounts\n\t\t\tcustomer.clearAccounts();\n\t\t\t\n\t\t\tfor (BankAccount account : accountList) {\n\t\t\t\tif (account.getCustomer().getUsername().equals(customer.getUsername())) {\n\t\t\t\t\tcustomer.addAccount(account);\n\t\t\t\t} else if (account.getJointCustomer() != null\n\t\t\t\t\t\t&& account.getJointCustomer().getUsername().equals(customer.getUsername()))\n\t\t\t\t\tcustomer.addAccount(account);\n\t\t\t}\n\t\t}\n\t}", "private void initDataTransferAccountsData() throws HpcException {\n for (HpcDataTransferType dataTransferType : HpcDataTransferType.values()) {\n // Get the data transfer system account.\n final List<HpcIntegratedSystemAccount> accounts =\n systemAccountDAO.getSystemAccount(dataTransferType);\n if (accounts != null && accounts.size() == 1) {\n singularDataTransferAccounts.put(dataTransferType, accounts.get(0));\n } else if (accounts != null && accounts.size() > 1) {\n initMultiDataTransferAccountsMap(dataTransferType, accounts);\n }\n }\n }", "public void initAccounts() {\n Datastore mongoDataStore = DatabaseHandler.getInstance().getMongoDataStore();\n\n User user = users.get(0);\n\n Account account1 = new Account(\"Account1\", 500);\n Account account2 = new Account(\"Account2\", 100);\n Account account3 = new Account(\"Account3\", 200);\n ArrayList<Account> accounts = new ArrayList<>();\n accounts.add(account1);\n accounts.add(account2);\n accounts.add(account3);\n mongoDataStore.save(accounts);\n user.setAccounts(accounts);\n\n user = users.get(1);\n account1 = new Account(\"Account4\", 100);\n account2 = new Account(\"Account5\", 200);\n accounts = new ArrayList<>();\n accounts.add(account1);\n accounts.add(account2);\n mongoDataStore.save(accounts);\n user.setAccounts(accounts);\n\n user = users.get(2);\n account1 = new Account(\"Account6\", 300);\n accounts = new ArrayList<>();\n accounts.add(account1);\n mongoDataStore.save(accounts);\n user.setAccounts(accounts);\n\n user = users.get(3);\n account1 = new Account(\"Account7\", 400);\n account2 = new Account(\"Account8\", 500);\n account3 = new Account(\"Account9\", 100);\n Account account4 = new Account(\"Account10\", 200);\n accounts = new ArrayList<>();\n accounts.add(account1);\n accounts.add(account2);\n accounts.add(account3);\n accounts.add(account4);\n mongoDataStore.save(accounts);\n user.setAccounts(accounts);\n\n user = users.get(4);\n account1 = new Account(\"Account11\", 300);\n accounts = new ArrayList<>();\n accounts.add(account1);\n mongoDataStore.save(accounts);\n user.setAccounts(accounts);\n }", "public account() {\n initComponents();\n autoID();\n branch();\n }", "public AccountStorage() {\n accounts = new ConcurrentHashMap<>();\n minerMap = new ConcurrentHashMap<>();\n blockMap = new ConcurrentHashMap<>();\n initAccounts();\n logger.info(\"AccountStorage: New AccountStorage created.\");\n }", "private void createAccounts(){\r\n for(int i = 0; i < accountInTotal; i++){\r\n try {\r\n Account tempAccount = new Account(startingBonds);\r\n theAccounts.add(tempAccount);\r\n } catch(Exception e){\r\n System.err.println(\"Error\");\r\n }\r\n }\r\n }", "private void initSystemAccountsData() throws HpcException {\n for (HpcIntegratedSystem system : HpcIntegratedSystem.values()) {\n // Get the data transfer system account.\n final List<HpcIntegratedSystemAccount> accounts = systemAccountDAO.getSystemAccount(system);\n if (accounts != null && accounts.size() == 1) {\n singularSystemAccounts.put(system, accounts.get(0));\n }\n }\n }", "public void populateAccountsTable() {\n Account account1 = createAccountFromFile(\"DummyAccount1.json\");\n Account account2 = createAccountFromFile(\"DummyAccount2.json\");\n\n // Account 1 will have both contacts associated to it\n account1.setContactIds(Set.of(contacts.get(0).getUid(), contacts.get(1).getUid()));\n\n // Account 2 will only have 1 contact associated to it\n account2.setContactIds(Set.of(contacts.get(0).getUid()));\n\n accountService.postAccount(account1);\n accountService.postAccount(account2);\n }", "public GraphView(List<Account> accounts, List<Block> blocks) {\n this.accounts = accounts;\n this.blocks = blocks;\n walletPositions = new List();\n initComponent();\n }", "public static void preInit() {\n registerBlocks();\n }", "private void initial(){\n storeAccount(\"201799990001030047\");\n }", "public AccountManager(){\r\n allAccounts.put(\"CreditCard\",credits);\r\n allAccounts.put(\"LineOfCredit\",lineOfCredits);\r\n allAccounts.put(\"Chequing\",chequing);\r\n allAccounts.put(\"Saving\",saving);\r\n createAccount(\"3\", 0);\r\n primaryAccount = chequing[0];\r\n }", "private void initConfig() {\n Path walletPath;\n Wallet wallet;\n\n // load a CCP\n Path networkConfigPath; \n \n try {\n \t\n \tif (!isLoadFile) {\n // Load a file system based wallet for managing identities.\n walletPath = Paths.get(\"wallet\");\n wallet = Wallet.createFileSystemWallet(walletPath);\n\n // load a CCP\n networkConfigPath = Paths.get(\"\", \"..\", \"basic-network\", configFile);\n \n builder = Gateway.createBuilder();\n \n \tbuilder.identity(wallet, userId).networkConfig(networkConfigPath).discovery(false);\n \t\n \tisLoadFile = true;\n \t}\n } catch (Exception e) {\n \te.printStackTrace();\n \tthrow new RuntimeException(e);\n }\n\t}", "public BankAccount() {\n numberOfAccounts++;\n this.accountNumber = accountNumberGenerator(); \n }", "@Test\n\tpublic void parseBlock()\n\t{\n\t\tDBSet databaseSet = DBSet.createEmptyDatabaseSet();\n\t\t\t\t\t\t\t\t\n\t\t//PROCESS GENESISBLOCK\n\t\tGenesisBlock genesisBlock = new GenesisBlock();\n\t\tgenesisBlock.process(databaseSet);\n\t\t\t\t\t\t\t\t\n\t\t//CREATE KNOWN ACCOUNT\n\t\tbyte[] seed = Crypto.getInstance().digest(\"test\".getBytes());\n\t\tbyte[] privateKey = Crypto.getInstance().createKeyPair(seed).getA();\n\t\tPrivateKeyAccount generator = new PrivateKeyAccount(privateKey);\n\t\t\t\t\t\t\t\t\t\t\n\t\t//PROCESS GENESIS TRANSACTION TO MAKE SURE GENERATOR HAS FUNDS\n\t\tTransaction transaction = new GenesisTransaction(generator, BigDecimal.valueOf(1000).setScale(8), NTP.getTime());\n\t\ttransaction.process(databaseSet);\n\t\t\t\t\t\t\t\t\n\t\t//GENERATE NEXT BLOCK\n\t\tBlockGenerator blockGenerator = new BlockGenerator();\n\t\tBlock block = blockGenerator.generateNextBlock(databaseSet, generator, genesisBlock);\n\t\t\t\t\t\t\n\t\t//FORK\n\t\tDBSet fork = databaseSet.fork();\n\t\t\t\t\n\t\t//GENERATE PAYMENT 1\n\t\tAccount recipient = new Account(\"XUi2oga2pnGNcZ9es6pBqxydtRZKWdkL2g\");\n\t\tlong timestamp = block.getTimestamp();\n\t\tbyte[] signature = PaymentTransaction.generateSignature(databaseSet, generator, recipient, BigDecimal.valueOf(100).setScale(8), BigDecimal.valueOf(1).setScale(8), timestamp);\n\t\tTransaction payment1 = new PaymentTransaction(generator, recipient, BigDecimal.valueOf(100).setScale(8), BigDecimal.valueOf(1).setScale(8), timestamp, generator.getLastReference(databaseSet), signature);\n\t\tpayment1.process(fork);\n\t\tblock.addTransaction(payment1);\t\n\t\t\t\t\n\t\t//GENERATE PAYMENT 2\n\t\tAccount recipient2 = new Account(\"XLPYYfxKEiDcybCkFA7jXcxSdePMMoyZLt\");\n\t\tsignature = PaymentTransaction.generateSignature(fork, generator, recipient2, BigDecimal.valueOf(100).setScale(8), BigDecimal.valueOf(1).setScale(8), timestamp);\n\t\tTransaction payment2 = new PaymentTransaction(generator, recipient2, BigDecimal.valueOf(100).setScale(8), BigDecimal.valueOf(1).setScale(8), timestamp, generator.getLastReference(fork), signature);\n\t\tblock.addTransaction(payment2);\t\n\t\t\t\t\t\t\n\t\t//ADD TRANSACTION SIGNATURE\n\t\tbyte[] transactionsSignature = Crypto.getInstance().sign(generator, block.getGeneratorSignature());\n\t\tblock.setTransactionsSignature(transactionsSignature);\n\t\t\t\t\n\t\t//CONVERT TO BYTES\n\t\tbyte[] rawBlock = block.toBytes();\n\t\t\t\t\n\t\ttry \n\t\t{\t\n\t\t\t//PARSE FROM BYTES\n\t\t\tBlock parsedBlock = BlockFactory.getInstance().parse(rawBlock);\n\t\t\t\t\t\n\t\t\t//CHECK INSTANCE\n\t\t\tassertEquals(false, parsedBlock instanceof GenesisBlock);\n\t\t\t\t\t\n\t\t\t//CHECK SIGNATURE\n\t\t\tassertEquals(true, Arrays.equals(block.getSignature(), parsedBlock.getSignature()));\n\t\t\t\t\t\n\t\t\t//CHECK GENERATOR\n\t\t\tassertEquals(block.getGenerator().getAddress(), parsedBlock.getGenerator().getAddress());\t\n\t\t\t\t\t\n\t\t\t//CHECK BASE TARGET\n\t\t\tassertEquals(block.getGeneratingBalance(), parsedBlock.getGeneratingBalance());\t\n\t\t\t\n\t\t\t//CHECK FEE\n\t\t\tassertEquals(block.getTotalFee(), parsedBlock.getTotalFee());\t\n\t\t\t\t\t\n\t\t\t//CHECK REFERENCE\n\t\t\tassertEquals(true, Arrays.equals(block.getReference(), parsedBlock.getReference()));\t\n\t\t\t\t\t\n\t\t\t//CHECK TIMESTAMP\n\t\t\tassertEquals(block.getTimestamp(), parsedBlock.getTimestamp());\t\t\n\t\t\t\n\t\t\t//CHECK TRANSACTIONS COUNT\n\t\t\tassertEquals(block.getTransactionCount(), parsedBlock.getTransactionCount());\t\t\n\t\t}\n\t\tcatch (Exception e) \n\t\t{\n\t\t\tfail(\"Exception while parsing transaction.\");\n\t\t}\n\t\t\t\t\n\t\t//PARSE TRANSACTION FROM WRONG BYTES\n\t\trawBlock = new byte[50];\n\t\t\n\t\ttry \n\t\t{\t\n\t\t\t//PARSE FROM BYTES\n\t\t\tBlockFactory.getInstance().parse(rawBlock);\n\t\t\t\t\t\n\t\t\t//FAIL\n\t\t\tfail(\"this should throw an exception\");\n\t\t}\n\t\tcatch (Exception e) \n\t\t{\n\t\t\t//EXCEPTION IS THROWN OK\n\t\t}\t\t\t\n\t}", "public void initialize() {\n\t\tinitialize(seedValue0, seedValue1);\n\t}", "public static void reInitialize() {\r\n accounts = new Hashtable<String, Account>();\r\n }", "public GlAccountBank () {\n\t\tsuper();\n\t}", "public Bank() {\n accounts = new Account[2];\n numOfAccounts = 0;\n }", "private static void Initialize()\n\t{\n\t\tcurrentPC = 3996;\n\t\tcurrentFilePointer = 0;\n\t\tmemoryBlocks = new int[4000];\n\t\tregisterFile = new HashMap<String, Integer>();\n\t\tstages = new HashMap<String, Instruction>();\n\t\tlatches = new HashMap<String, Instruction>();\n\t\tspecialRegister = 0;\n\t\tisComplete = false;\n\t\tisValidSource = true;\n\t\tSystem.out.println(\"-----Initialization Completed------\");\n\t}", "public static void initializeBlocks() {\n if (Config.enableGiveADamn) {\n giveADamn = new GiveADamn();\n }\n\n if (Config.enableGlowstone) {\n glowstone = new HeavyLight();\n }\n\n if (Config.enableSpicedSand) {\n sandSpiced = new SpicedSand();\n }\n /*\n\n if (Config.enableMuffler){\n muffler = new Muffler();\n }\n */\n }", "@Test\n\tpublic void processBlock()\n\t{\n\t\tDBSet databaseSet = DBSet.createEmptyDatabaseSet();\n\t\t\t\t\t\t\t\t\t\t\n\t\t//PROCESS GENESISBLOCK\n\t\tGenesisBlock genesisBlock = new GenesisBlock();\n\t\tgenesisBlock.process(databaseSet);\n\t\t\t\t\t\t\t\t\t\t\n\t\t//CREATE KNOWN ACCOUNT\n\t\tbyte[] seed = Crypto.getInstance().digest(\"test\".getBytes());\n\t\tbyte[] privateKey = Crypto.getInstance().createKeyPair(seed).getA();\n\t\tPrivateKeyAccount generator = new PrivateKeyAccount(privateKey);\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t//PROCESS GENESIS TRANSACTION TO MAKE SURE GENERATOR HAS FUNDS\n\t\tTransaction transaction = new GenesisTransaction(generator, BigDecimal.valueOf(1000).setScale(8), NTP.getTime());\n\t\ttransaction.process(databaseSet);\n\t\t\t\t\t\t\t\t\n\t\t//GENERATE NEXT BLOCK\n\t\tBlockGenerator blockGenerator = new BlockGenerator();\n\t\tBlock block = blockGenerator.generateNextBlock(databaseSet, generator, genesisBlock);\n\t\t\n\t\t//FORK\n\t\tDBSet fork = databaseSet.fork();\n\t\t\n\t\t//GENERATE PAYMENT 1\n\t\tAccount recipient = new Account(\"XUi2oga2pnGNcZ9es6pBqxydtRZKWdkL2g\");\n\t\tlong timestamp = block.getTimestamp();\n\t\tbyte[] signature = PaymentTransaction.generateSignature(databaseSet, generator, recipient, BigDecimal.valueOf(100).setScale(8), BigDecimal.valueOf(1).setScale(8), timestamp);\n\t\tTransaction payment1 = new PaymentTransaction(generator, recipient, BigDecimal.valueOf(100).setScale(8), BigDecimal.valueOf(1).setScale(8), timestamp, generator.getLastReference(databaseSet), signature);\n\t\tpayment1.process(fork);\n\t\tblock.addTransaction(payment1);\t\n\t\t\n\t\t//GENERATE PAYMENT 2\n\t\tAccount recipient2 = new Account(\"XLPYYfxKEiDcybCkFA7jXcxSdePMMoyZLt\");\n\t\tsignature = PaymentTransaction.generateSignature(fork, generator, recipient2, BigDecimal.valueOf(100).setScale(8), BigDecimal.valueOf(1).setScale(8), timestamp);\n\t\tTransaction payment2 = new PaymentTransaction(generator, recipient2, BigDecimal.valueOf(100).setScale(8), BigDecimal.valueOf(1).setScale(8), timestamp, generator.getLastReference(fork), signature);\n\t\tblock.addTransaction(payment2);\t\n\t\t\n\t\t//ADD TRANSACTION SIGNATURE\n\t\tbyte[] transactionsSignature = blockGenerator.calculateTransactionsSignature(block, generator);\n\t\tblock.setTransactionsSignature(transactionsSignature);\n\t\t\n\t\t//CHECK VALID\n\t\tassertEquals(true, block.isSignatureValid());\n\t\tassertEquals(true, block.isValid(databaseSet));\n\t\t\n\t\t//PROCESS BLOCK\n\t\tblock.process(databaseSet);\n\t\t\n\t\t//CHECK BALANCE GENERATOR\n\t\tassertEquals(true, generator.getConfirmedBalance(databaseSet).compareTo(BigDecimal.valueOf(800)) == 0);\n\t\t\n\t\t//CHECK LAST REFERENCE GENERATOR\n\t\tassertEquals(true, Arrays.equals(generator.getLastReference(databaseSet), payment2.getSignature()));\n\t\t\n\t\t//CHECK BALANCE RECIPIENT\n\t\tassertEquals(true, recipient.getConfirmedBalance(databaseSet).compareTo(BigDecimal.valueOf(1100)) == 0);\n\t\t\n\t\t//CHECK LAST REFERENCE RECIPIENT\n\t\tassertEquals(false, Arrays.equals(recipient.getLastReference(databaseSet), payment1.getSignature()));\n\t\t\n\t\t//CHECK BALANCE RECIPIENT2\n\t\tassertEquals(true, recipient2.getConfirmedBalance(databaseSet).compareTo(BigDecimal.valueOf(100)) == 0);\n\t\t\t\t\n\t\t//CHECK LAST REFERENCE RECIPIENT\n\t\tassertEquals(true, Arrays.equals(recipient2.getLastReference(databaseSet), payment2.getSignature()));\n\t\t\n\t\t//CHECK TOTAL FEE\n\t\tassertEquals(true, block.getTotalFee().compareTo(BigDecimal.valueOf(2)) == 0);\n\t\t\n\t\t//CHECK TOTAL TRANSACTIONS\n\t\tassertEquals(2, block.getTransactionCount());\n\t\t\n\t\t//CHECK LAST BLOCK\n\t\tassertEquals(true, Arrays.equals(block.getSignature(), databaseSet.getBlockMap().getLastBlock().getSignature()));\n\t}", "public GenesisConfig(String communityName,\n ArrayList<GenesisItem> genesisItems) {\n\n // First of all, get account state from TAU blockchain.\n Pair<byte[], byte[]> senderKey = AccountManager.getInstance().getKeyPair();\n\n this.communityName = communityName;\n long timeStamp = System.currentTimeMillis() / 1000;\n byte[] chainID = chainID(communityName, senderKey.first, timeStamp);\n\n // create genesis transaction\n this.genesisTx = new GenesisTx(1L, chainID, timeStamp, DefaultGenesisTxFee,\n senderKey.first, BigInteger.ZERO, genesisItems);\n this.genesisTx.signTransactionWithPriKey(senderKey.second);\n\n this.version = 1L;\n this.timeStamp = System.currentTimeMillis() / 1000;\n\n HorizontalItem item = HorizontalItem.with(this.genesisTx.getTxID());\n this.horizontalHash = item.getHash();\n\n this.baseTarget = DefaultBaseTarget;\n this.cummulativeDifficulty = DefaultCummulativeDifficulty;\n\n this.pubkey = new byte[senderKey.first.length];\n System.arraycopy(senderKey.first, 0, this.pubkey, 0, senderKey.first.length);\n\n this.generationSignature = HashUtil.sha1hash(this.pubkey);\n this.signature = null;\n\n // construct genesis block\n this.genesisBlock = new Block(this);\n this.genesisBlock.signBlock(senderKey.second);\n this.signature = this.genesisBlock.getSignature();\n }", "@Before\n public void init() {\n \tcontract = CandidateContract.load(\n web3j,\n CREDENTIALS,\n new DefaultWasmGasProvider()\n );\n }", "public void init() {\n\t\t\n\t\t\n\t\tprepareGaborFilterBankConcurrent();\n\t\t\n\t\tprepareGaborFilterBankConcurrentEnergy();\n\t}", "public BankAccount()\n {\n \t//intializing instance variables\n \t//at the time object creation constuctor executes \n \t\n \taccountHolderName=\"unknow\";\n \taccountBalance=0;\n \t\n }", "public void begin(){\n\t\tTransaction block = new Transaction();\n\t\tblock.setPrev(blocks.getLast());\n\t\tblocks.add(block);\n\t}", "public BankDataBase()\n {\n accounts = new Account[ 2 ];\n accounts[ 0 ] = new Account( 12345, 54321, 1000.0, 1200.0 );\n accounts[ 1 ] = new Account( 98765, 56789, 200.0, 200.0 );\n }", "public void begin(BigInteger firstBlock, BigInteger lastBlock) {\n for(Staker pool: pools) {\n try {\n String validator = pool.getIdentity();\n\n double startStakeWeight = calculateStakeWeightAtBlockForValidator(validator, firstBlock.longValue());\n double endStakeWeight = calculateStakeWeightAtBlockForValidator(validator, lastBlock.longValue());\n\n double avgStakeWeight = (startStakeWeight + endStakeWeight) / 2;\n avgDefaultStakeWeightMap.put(validator, avgStakeWeight);\n } catch (Exception e) {\n log.warn(\"Error calculating avgStakeWeight for missing stakeweights\", e);\n }\n }\n\n }", "@Test\n\tpublic void orphanBlock()\n\t{\n\t\tDBSet databaseSet = DBSet.createEmptyDatabaseSet();\n\t\t\t\t\t\t\t\t\t\t\n\t\t//PROCESS GENESISBLOCK\n\t\tGenesisBlock genesisBlock = new GenesisBlock();\n\t\tgenesisBlock.process(databaseSet);\n\t\t\t\t\t\t\t\t\t\t\n\t\t//CREATE KNOWN ACCOUNT\n\t\tbyte[] seed = Crypto.getInstance().digest(\"test\".getBytes());\n\t\tbyte[] privateKey = Crypto.getInstance().createKeyPair(seed).getA();\n\t\tPrivateKeyAccount generator = new PrivateKeyAccount(privateKey);\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t//PROCESS GENESIS TRANSACTION TO MAKE SURE GENERATOR HAS FUNDS\n\t\tTransaction transaction = new GenesisTransaction(generator, BigDecimal.valueOf(1000).setScale(8), NTP.getTime());\n\t\ttransaction.process(databaseSet);\n\t\t\t\t\t\t\t\t\n\t\t//GENERATE NEXT BLOCK\n\t\tBlockGenerator blockGenerator = new BlockGenerator();\n\t\tBlock block = blockGenerator.generateNextBlock(databaseSet, generator, genesisBlock);\n\t\t\n\t\t//FORK\n\t\tDBSet fork = databaseSet.fork();\n\t\t\n\t\t//GENERATE PAYMENT 1\n\t\tAccount recipient = new Account(\"XUi2oga2pnGNcZ9es6pBqxydtRZKWdkL2g\");\n\t\tlong timestamp = block.getTimestamp();\n\t\tbyte[] signature = PaymentTransaction.generateSignature(databaseSet, generator, recipient, BigDecimal.valueOf(100).setScale(8), BigDecimal.valueOf(1).setScale(8), timestamp);\n\t\tTransaction payment1 = new PaymentTransaction(generator, recipient, BigDecimal.valueOf(100).setScale(8), BigDecimal.valueOf(1).setScale(8), timestamp, generator.getLastReference(databaseSet), signature);\n\t\tpayment1.process(fork);\n\t\tblock.addTransaction(payment1);\t\n\t\t\n\t\t//GENERATE PAYMENT 2\n\t\tAccount recipient2 = new Account(\"XLPYYfxKEiDcybCkFA7jXcxSdePMMoyZLt\");\n\t\tsignature = PaymentTransaction.generateSignature(fork, generator, recipient2, BigDecimal.valueOf(100).setScale(8), BigDecimal.valueOf(1).setScale(8), timestamp);\n\t\tTransaction payment2 = new PaymentTransaction(generator, recipient2, BigDecimal.valueOf(100).setScale(8), BigDecimal.valueOf(1).setScale(8), timestamp, generator.getLastReference(fork), signature);\n\t\tblock.addTransaction(payment2);\t\n\t\t\n\t\t//ADD TRANSACTION SIGNATURE\n\t\tbyte[] transactionsSignature = blockGenerator.calculateTransactionsSignature(block, generator);\n\t\tblock.setTransactionsSignature(transactionsSignature);\n\t\t\n\t\t//CHECK VALID\n\t\tassertEquals(true, block.isSignatureValid());\n\t\tassertEquals(true, block.isValid(databaseSet));\n\t\t\n\t\t//PROCESS BLOCK\n\t\tblock.process(databaseSet);\n\t\t\n\t\t//ORPHAN BLOCK\n\t\tblock.orphan(databaseSet);\n\t\t\n\t\t//CHECK BALANCE GENERATOR\n\t\tassertEquals(true, generator.getConfirmedBalance(databaseSet).compareTo(BigDecimal.valueOf(1000)) == 0);\n\t\t\n\t\t//CHECK LAST REFERENCE GENERATOR\n\t\tassertEquals(true, Arrays.equals(generator.getLastReference(databaseSet), transaction.getSignature()));\n\t\t\n\t\t//CHECK BALANCE RECIPIENT\n\t\tassertEquals(true, recipient.getConfirmedBalance(databaseSet).compareTo(BigDecimal.valueOf(1000)) == 0);\n\t\t\n\t\t//CHECK LAST REFERENCE RECIPIENT\n\t\tassertEquals(false, Arrays.equals(recipient.getLastReference(databaseSet), payment1.getSignature()));\n\t\t\n\t\t//CHECK BALANCE RECIPIENT2\n\t\tassertEquals(true, recipient2.getConfirmedBalance(databaseSet).compareTo(BigDecimal.valueOf(0)) == 0);\n\t\t\t\t\n\t\t//CHECK LAST REFERENCE RECIPIENT\n\t\tassertEquals(true, Arrays.equals(recipient2.getLastReference(databaseSet), new byte[0]));\n\t\t\n\t\t//CHECK LAST BLOCK\n\t\tassertEquals(true, Arrays.equals(genesisBlock.getSignature(), databaseSet.getBlockMap().getLastBlock().getSignature()));\n\t}", "public static void main(String[] args) throws NoSuchAlgorithmException,\n SignatureException, InvalidKeyException {\n Random random = new Random();\n int numBitsKeyPair = 512;\n KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance(\"RSA\");\n keyPairGenerator.initialize(numBitsKeyPair);\n KeyPair scroogeKeyPair = keyPairGenerator.genKeyPair();\n KeyPair aliceKeyPair = keyPairGenerator.genKeyPair();\n KeyPair bobKeyPair = keyPairGenerator.genKeyPair();\n\n // Always create genesis block first\n Block genesis = new Block(null, scroogeKeyPair.getPublic()); // new Block (byte[] prevHash, PublicKey address)\n genesis.finalize(); // Computes the message digest/hash\n\n // Then, create blockchain from genesis block\n BlockChain blockchain = new BlockChain(genesis);\n\n // And initialize BlockHandler with \"genesis blockchain\".\n // I personally think that the framework is inkonsistent here.\n // If all access to the blockchain is supposed to be done through the BlockHandler,\n // then the blockchain should be initialized there as well.\n // Anyways, further access to the blockchain is done through the BlockHandler\n BlockHandler blockHandler = new BlockHandler(blockchain);\n\n // Now, let the tests begin!\n\n //***********************************\n // Test 1: Process a block with no transactions\n Block block = new Block(genesis.getHash(), aliceKeyPair.getPublic()); // previous: the genesis block\n block.finalize();\n // Process block immediately without adding any transactions\n if (blockHandler.processBlock(block)) { // basically invokes blockchain.addBlock()\n System.out.println(\"Successfully added valid block. Test 1 is passed.\\n\");\n } else {\n System.out.println(\"Failed to add valid block. Test 1 has failed.\\n\");\n }// again, unit tests are way better than this!\n\n\n //***********************************\n // Test 22: Process a transaction, create a block, process a transaction, create a block, ...\n // For a clean test, recreate the blockchain\n blockchain = new BlockChain(genesis);\n blockHandler = new BlockHandler(blockchain);\n\n boolean testIsPassed = true;\n\n // some transaction to play with\n Transaction transaction;\n Signature signature = Signature.getInstance(\"SHA256withRSA\");\n // start with a successor of the genesis block\n Block previousBlock = genesis;\n\n for (int i = 0; i < 20; i++) {\n // create a new transaction in every round\n transaction = new Transaction();\n // every block consists of its hash, a hash of the previous block,\n // exactly one coinbase transaction and a list of other transactions.\n // here, we only want to reassign the coinbase transaction\n transaction.addInput(previousBlock.getCoinbase().getHash(), 0); // addInput(byte[] prevTxHash, int outputIndex)\n\n // let's assign all outputs of all transactions to scrooge\n // I personally would prefer a getter here for the coinbase\n transaction.addOutput(Block.COINBASE, scroogeKeyPair.getPublic()); // transaction.addOutput(double value, PublicKey address)\n signature.initSign(scroogeKeyPair.getPrivate());\n signature.update(transaction.getRawDataToSign(0));\n transaction.addSignature(signature.sign(), 0);\n transaction.finalize(); // Computes the message digest/hash\n\n blockHandler.processTx(transaction); // basically invokes blockchain.addTransaction() that adds transaction to the transaction pool\n\n // so far, we have created a valid transaction that should be available in the transaction pool\n // so let's try to create a block from it\n Block newBlock = blockHandler.createBlock(scroogeKeyPair.getPublic());\n testIsPassed = testIsPassed &&\n newBlock != null &&\n newBlock.getPrevBlockHash().equals(previousBlock.getHash()) &&\n newBlock.getTransactions().size() == 1 &&\n newBlock.getTransaction(0).equals(transaction);\n\n if (!testIsPassed) {\n System.out.println(i + \"Failed to add block with valid transaction. Test 22 has failed.\\n\");\n return;\n }\n previousBlock = newBlock;\n }\n System.out.println(\"Successfully added blocks with valid transactions. Test 22 is passed.\\n\");\n }", "@Override\n\tpublic void initApp() throws IOException {\n\t\tdepositAccountInitService.initConfigData();\n\t}", "public void initializeBlocks(final int baseIndex, final Block startBlock, int n) {\n /* Fill in the rest of the blocks in the current nursery. */\n final int remaining = numBlocks - baseIndex;\n final int m = Math.min(remaining, n);\n initializeWithBlock(baseIndex, m, startBlock, false);\n n -= m;\n if (n > 0) {\n Nursery nursery = next;\n /* Fill in the remaining nurseries. */\n while (n > 0) {\n final int blocks = Math.min(n, numBlocks);\n nursery.initializeWithBlock(0, blocks, startBlock, true);\n n -= numBlocks;\n nursery = nursery.next;\n }\n }\n }", "private void initPeers() {\n this.servers.clear();\n this.clients.clear();\n\n if (SharedPrefUtils.isConnectionNfcEnabled(this)) {\n clients.add(new NFCClient(this, walletServiceBinder));\n servers.add(new NFCServerACSCLTV(this, walletServiceBinder));\n servers.add(new NFCServerCLTV(this, walletServiceBinder));\n\n }\n\n if (SharedPrefUtils.isConnectionBluetoothLeEnabled(this)) {\n clients.add(new BluetoothLEClient(this, walletServiceBinder));\n servers.add(new BluetoothLEServer(this, walletServiceBinder));\n }\n\n if (SharedPrefUtils.isConnectionWiFiDirectEnabled(this)) {\n clients.add(new WiFiClient(this, walletServiceBinder));\n servers.add(new WiFiServer(this, walletServiceBinder));\n }\n\n for (AbstractServer server : servers) {\n server.setPaymentRequestDelegate(getClientPaymentRequestDelegate());\n }\n\n for (AbstractClient client : clients) {\n client.setPaymentRequestDelegate(getClientPaymentRequestDelegate());\n if(client instanceof NFCClient) {\n client.start();\n }\n }\n\n }", "@BeforeEach\n void initialize() {\n password1 = \"pwd\";\n email1 = \"[email protected]\";\n loginRequest1 = new LoginRequest(email1, password1);\n\n password2 = \"pwd2\";\n email2 = \"[email protected]\";\n loginRequest2 = new LoginRequest(email2, password2);\n }", "public GenesisConfig(long version, long timeStamp,\n BigInteger baseTarget, BigInteger cummulativeDifficulty,\n byte[] pubkey, byte[] signature, GenesisTx genesisTx) {\n\n this.version = version;\n this.timeStamp = timeStamp;\n this.baseTarget = baseTarget;\n this.cummulativeDifficulty = cummulativeDifficulty;\n this.pubkey = pubkey;\n\n // According to POT consensus,\n // generationSignature = hash(previous block generationSignature + pubkey)\n // here previous block generationSignature is null.\n this.generationSignature = HashUtil.sha1hash(this.pubkey);\n this.signature = signature;\n this.genesisTx = genesisTx;\n HorizontalItem item = HorizontalItem.with(this.genesisTx.getTxID());\n this.horizontalHash = item.getHash();\n this.communityName = TauGenesisTransaction.CommunityName;\n\n // construct genesis block\n this.genesisBlock = new Block(this);\n }", "public void initialize() {\n\n list.add(user1);\n list.add(user2);\n list.add(user3);\n }", "public AccountDatabase() {\n accounts = new Account[5];\n size = 0;\n }", "@Test\n\tpublic void validateBlock()\n\t{\n\t\tDBSet databaseSet = DBSet.createEmptyDatabaseSet();\n\t\t\t\t\t\t\n\t\t//PROCESS GENESISBLOCK\n\t\tGenesisBlock genesisBlock = new GenesisBlock();\n\t\tgenesisBlock.process(databaseSet);\n\t\t\t\t\t\t\n\t\t//CREATE KNOWN ACCOUNT\n\t\tbyte[] seed = Crypto.getInstance().digest(\"test\".getBytes());\n\t\tbyte[] privateKey = Crypto.getInstance().createKeyPair(seed).getA();\n\t\tPrivateKeyAccount generator = new PrivateKeyAccount(privateKey);\n\t\t\t\t\t\t\t\t\n\t\t//PROCESS GENESIS TRANSACTION TO MAKE SURE GENERATOR HAS FUNDS\n\t\tTransaction transaction = new GenesisTransaction(generator, BigDecimal.valueOf(1000).setScale(8), NTP.getTime());\n\t\ttransaction.process(databaseSet);\n\t\t\t\t\t\t\n\t\t//GENERATE NEXT BLOCK\n\t\tBlockGenerator blockGenerator = new BlockGenerator();\n\t\tBlock newBlock = blockGenerator.generateNextBlock(databaseSet, generator, genesisBlock);\n\t\t\t\t\n\t\t//ADD TRANSACTION SIGNATURE\n\t\tbyte[] transactionsSignature = Crypto.getInstance().sign(generator, newBlock.getGeneratorSignature());\n\t\tnewBlock.setTransactionsSignature(transactionsSignature);\n\t\t\n\t\t//CHECK IF VALID\n\t\tassertEquals(true, newBlock.isValid(databaseSet));\n\t\t\n\t\t//CHANGE REFERENCE\n\t\tBlock invalidBlock = BlockFactory.getInstance().create(newBlock.getVersion(), new byte[128], newBlock.getTimestamp(), newBlock.getGeneratingBalance(), newBlock.getGenerator(), newBlock.getGeneratorSignature());\n\t\t\n\t\t//CHECK IF INVALID\n\t\tassertEquals(false, invalidBlock.isValid(databaseSet));\n\t\t\n\t\t//CHANGE TIMESTAMP\n\t\tinvalidBlock = BlockFactory.getInstance().create(newBlock.getVersion(), newBlock.getReference(), 1L, newBlock.getGeneratingBalance(), newBlock.getGenerator(), newBlock.getGeneratorSignature());\n\t\t\n\t\t//CHECK IF INVALID\n\t\tassertEquals(false, invalidBlock.isValid(databaseSet));\n\t\t\n\t\t//CHANGE BASETARGET\n\t\tinvalidBlock = BlockFactory.getInstance().create(newBlock.getVersion(), newBlock.getReference(), newBlock.getTimestamp(), 1L, newBlock.getGenerator(), newBlock.getGeneratorSignature());\n\t\t\t\t\n\t\t//CHECK IF INVALID\n\t\tassertEquals(false, invalidBlock.isValid(databaseSet));\n\t\t\n\t\t//ADD INVALID TRANSACTION\n\t\tinvalidBlock = blockGenerator.generateNextBlock(databaseSet, generator, genesisBlock);\n\t\tAccount recipient = new Account(\"XUi2oga2pnGNcZ9es6pBqxydtRZKWdkL2g\");\n\t\tlong timestamp = newBlock.getTimestamp();\n\t\tbyte[] signature = PaymentTransaction.generateSignature(databaseSet, generator, recipient, BigDecimal.valueOf(-100).setScale(8), BigDecimal.valueOf(1).setScale(8), timestamp);\n\t\tTransaction payment = new PaymentTransaction(generator, recipient, BigDecimal.valueOf(-100).setScale(8), BigDecimal.valueOf(1).setScale(8), timestamp, generator.getLastReference(databaseSet), signature);\n\t\tinvalidBlock.addTransaction(payment);\t\t\n\t\t\n\t\t//CHECK IF INVALID\n\t\tassertEquals(false, invalidBlock.isValid(databaseSet));\n\t\t\n\t\t//ADD GENESIS TRANSACTION\n\t\tinvalidBlock = blockGenerator.generateNextBlock(databaseSet, generator, genesisBlock);\t\n\t\ttransaction = new GenesisTransaction(generator, BigDecimal.valueOf(1000).setScale(8), newBlock.getTimestamp());\n\t\tinvalidBlock.addTransaction(transaction);\t\n\t\t\n\t\t//CHECK IF INVALID\n\t\tassertEquals(false, invalidBlock.isValid(databaseSet));\n\t}", "@Override\n public void createBlockchain(String name, Block genesisBlock) {\n BlockNodeEntity blockNodeEntity = getBlockNodeEntity(name, genesisBlock);\n blockRepository.save(blockNodeEntity);\n }", "public void initialize() {\r\n addSprite(this.info.getBackground());\r\n createBorders();\r\n defineDeathBlock();\r\n addIndicators();\r\n BlockRemover removeBlock = new BlockRemover(this, this.remainingBlocks);\r\n// this.remainingBlocks=removeBlock.getRemainingBlocks();\r\n ScoreTrackingListener scoreTrackingListener = new ScoreTrackingListener(this.score);\r\n for (int i = 0; i < info.blocks().size(); i++) {\r\n info.blocks().get(i).addHitListener(removeBlock);\r\n info.blocks().get(i).addHitListener(scoreTrackingListener);\r\n info.blocks().get(i).addToGame(this);\r\n }\r\n }", "@BeforeEach\n void setUp() {\n returnAccount = Account.builder().id(1L).lastName(ANY_LAST_NAME).build();\n }", "public BankImpl() {\n accounts = new HashMap<Integer,Account>();\n }", "private final void initializeCache() {\r\n try {\r\n UserIndex index = makeUserIndex(this.dbManager.getUserIndex());\r\n for (UserRef ref : index.getUserRef()) {\r\n String email = ref.getEmail();\r\n String userString = this.dbManager.getUser(email);\r\n User user = makeUser(userString);\r\n this.updateCache(user);\r\n }\r\n }\r\n catch (Exception e) {\r\n server.getLogger().warning(\"Failed to initialize users \" + StackTrace.toString(e));\r\n }\r\n }", "public static void init () {\n\t\t\n\t\t/*\n\t\t * Letter block naming and registry code\n\t\t */\n\t\tfor (int i = 0; i <= NameHandler.length(); ++i) {\n\t\t\tBlockLetter bL = new BlockLetter();\n\t\t\tString name = NameHandler.getNameFromIndex(i);\n\t\t\tbL.setBlockName(name);\n\t\t\tGameRegistry.registerBlock(bL, name);\n\t\t\tletterBlocks.add(bL);\n\t\t}\n\t\t\n\t\tcopperBlock.setBlockName(Names.Blocks.COPPER_BLOCK);\n\t\ttinBlock.setBlockName(Names.Blocks.TIN_BLOCK);\n\t\tsilverBlock.setBlockName(Names.Blocks.SILVER_BLOCK);\n\t\tclassicBronzeBlock.setBlockName(Names.Blocks.CLASSIC_BRONZE_BLOCK);\n\t\tmildBronzeBlock.setBlockName(Names.Blocks.MILD_BRONZE_BLOCK);\n\t\telectrumBlock.setBlockName(Names.Blocks.ELECTRUM_BLOCK);\n\t\tcopperDustBlock.setBlockName(Names.Blocks.COPPER_DUST_BLOCK);\n\t\t\n\t\tcopperOre.setBlockName(Names.Blocks.COPPER_ORE);\n\t\ttinOre.setBlockName(Names.Blocks.TIN_ORE);\n\t\tsilverOre.setBlockName(Names.Blocks.SILVER_ORE);\n\t\t\n\t\tmarble.setBlockName(Names.Blocks.MARBLE);\n\t\t\n\t\tgrindstone.setBlockName(Names.Blocks.GRINDSTONE);\n\t\t\n\t\tGameRegistry.registerBlock(column, Names.Blocks.COLUMN);\n\t\tGameRegistry.registerBlock(copperBlock, Names.Blocks.COPPER_BLOCK);\n\t\tGameRegistry.registerBlock(tinBlock, Names.Blocks.TIN_BLOCK);\n\t\tGameRegistry.registerBlock(silverBlock, Names.Blocks.SILVER_BLOCK);\n\t\tGameRegistry.registerBlock(classicBronzeBlock, Names.Blocks.CLASSIC_BRONZE_BLOCK);\n\t\tGameRegistry.registerBlock(mildBronzeBlock, Names.Blocks.MILD_BRONZE_BLOCK);\n\t\tGameRegistry.registerBlock(electrumBlock, Names.Blocks.ELECTRUM_BLOCK);\n\t\tGameRegistry.registerBlock(copperDustBlock, Names.Blocks.COPPER_DUST_BLOCK);\n\t\t\n\t\tGameRegistry.registerBlock(copperOre, Names.Blocks.COPPER_ORE);\n\t\tGameRegistry.registerBlock(tinOre, Names.Blocks.TIN_ORE);\n\t\tGameRegistry.registerBlock(silverOre, Names.Blocks.SILVER_ORE);\n\t\tGameRegistry.registerBlock(marble, Names.Blocks.MARBLE);\n\t\t\n\t\tGameRegistry.registerBlock(grindstone, Names.Blocks.GRINDSTONE);\n\t}", "public BankAccount() {\r\n\t\tbalance=0;\r\n\t\t\r\n\t}", "private void clearGenesis() {\n bitField0_ = (bitField0_ & ~0x00000001);\n genesis_ = getDefaultInstance().getGenesis();\n }", "public Account()\n {\n // initialise instance variables\n balance = 0.00;\n remainder = 0;\n }", "private void initialize(FujabaTransaction fujaba_tx) {\n for (FujabaRecord f_rec : fujaba_tx.getChanges()) {\n if (f_rec.getRecordType() == CoobraType.CHANGE) {\n FujabaChangeRecord fc_rec = (FujabaChangeRecord) f_rec;\n\n switch (fc_rec.getChangeKind()) {\n case CREATE_OBJECT:\n changes_.add(new MiradorCreateRecord(fc_rec, this));\n break;\n\n case DESTROY_OBJECT:\n// changes_.add(new MiradorDestroyRecord(fc_rec, this));\n break;\n\n case ALTER_FIELD:\n changes_.add(new MiradorAlterRecord(fc_rec, this));\n break;\n }\n }\n }\n\n Debug.dbg.println(\"\\n\\t>>> Creating Mirador Transaction - \"\n + tx_id_ + \": \" + tx_name_ + \" <<<\");\n for (ListIterator<MiradorRecord> it = changeIterator(); it.hasNext();)\n Debug.dbg.println(it.next());\n }", "BankAccount(double initBalance, Customer customer) throws CreditHistoryException {\n\t\tif (CreditAgency.checkCreditHistory(customer))\n\t\t\tthrow new CreditHistoryException();\n\t\tsetRandomNo();\n\t\tthis.balance = initBalance;\n\t\tthis.cheque = 0;\n\t\tthis.customer = customer;\n\t\tthis.PIN = getRandomPIN(6);\n\t\tthis.isSuspended = false;\n\t}", "public saccoAccount (int account_num, double initial_balance) \r\n {\r\n\r\n account = account_num;\r\n balance = initial_balance;\r\n\r\n }", "public void initialize() {\n\n\t\tthis.subNetGenes = getSubNetGenes(species, xmlFile);\n\t\tthis.subNetwork = getSubNetwork(subNetGenes, oriGraphFile);\n\t\tHPNUlilities.dumpLocalGraph(subNetwork, subNetFile);\n\t\t/* Create level file for the original graph */\n\t\tHPNUlilities.createLevelFile(codePath, oriGraphFile, oriLevel,\n\t\t\t\tglobalLevelFile, penaltyType, partitionSize);\n\n\t}", "private static void initializeLists() {\n\t\t\n\t\t//read from serialized files to assign array lists\n\t\t//customerList = (ArrayList<Customer>) readObject(customerFile);\n\t\t//employeeList = (ArrayList<Employee>) readObject(employeeFile);\n\t\t//applicationList = (ArrayList<Application>) readObject(applicationFile);\n\t\t//accountList = (ArrayList<BankAccount>) readObject(accountFile);\n\t\t\n\t\t//read from database to assign array lists\n\t\temployeeList = (ArrayList<Employee>)employeeDao.readAll();\n\t\tcustomerList = (ArrayList<Customer>)customerDao.readAll();\n\t\taccountList = (ArrayList<BankAccount>) accountDao.readAll();\n\t\tapplicationList = (ArrayList<Application>)applicationDao.readAll();\n\t\t\n\t\tassignBankAccounts();\n\t}", "@Before\r\n public void setUp() throws Exception {\r\n bank.addPerson(p1);\r\n bank.addPerson(p2);\r\n\r\n bank.addAccount(p1, a1);\r\n bank.addAccount(p2, a2);\r\n bank.addAccount(p2, a3);\r\n }", "public BankAccount() {\t\n\t\tthis.accountNumber = UUID.randomUUID().toString().substring(0, 6);\n\t\tthis.balance = 0;\n\t\tthis.accountType = \"Bank account\";\n\t}", "private Bank() {\r\n\t\tsuper();\r\n\t\tlogService = new Logger(\"driverName\");\r\n\t\tlogger = new Logger(\"driverName\");\r\n\t\tthis.balance = balance;\r\n\t\tthis.clients = new Client[100];\r\n\t}", "private void initializeTxIfFirst()\n {\n Transaction tx = tm.getTransaction();\n if ( !txHook.hasAnyLocks( tx ) ) txHook.initializeTransaction( tm.getEventIdentifier() );\n }", "@Override\n public void initialize()\n {\n super.initialize();\n log.info(\"Initialize \" + name);\n Map<String, Collection<?>> beans;\n generator = service.getRandomSeedRepo().\n getRandomSeed(\"EvSocialClass-\" + name, 1, \"initialize\");\n\n Config.recycle();\n config = Config.getInstance();\n config.configure(service.getServerConfiguration());\n\n beans = config.getBeans();\n unpackBeans(beans);\n\n // Create and set up the customer instances\n evCustomers = new ArrayList<EvCustomer>();\n if (null == customerAttributeList) {\n // boot session - dynamic configuration\n configureForBoot(beans);\n }\n else {\n // sim session - restore from boot record\n configureForSim(beans);\n }\n }", "private void initComponents() {\r\n\t\trand = new Random();\r\n\t\tfetchProfiles();\r\n\t\tgetPeopleFromFile();\r\n\t}", "private void initialize() throws IOException {\n final Random random;\n if (params.getCustomSeed() == null) {\n random = RandomUtils.getRandomPrintSeed();\n } else {\n System.out.println(\"Using custom seed: \" + params.getCustomSeed());\n random = new Random(params.getCustomSeed());\n }\n\n final EventEmitterFactory factory = new EventEmitterFactory(random, addressBook);\n\n factoryConfig.accept(factory);\n\n caller = callerSupplier.apply(factory);\n listener = listenerSupplier.apply(factory);\n\n final Pair<Connection, Connection> connections =\n connectionFactory.createConnections(caller.getNodeId(), listener.getNodeId());\n caller.setSyncConnection(connections.left());\n listener.setSyncConnection(connections.right());\n\n customInitialization.accept(caller, listener);\n }", "public void initialize() {\n\n getStartUp();\n }", "@PostConstruct\n protected void init(){\n// account = new Account(2, \"SE-002\", \"Prayuth\", \"The minister\",\n// 3.59, imageBaseUrl+ \"tu.jpg\", false, 15,\n// \"The great man ever!!!!\",null);\n// accounts.add(account);\n// account = new Account(3, \"SE-003\", \"Jurgen\", \"Kloop\",\n// 2.15, imageBaseUrl + \"Kloop.gif\", true, 2,\n// \"The man for the Kop\",null);\n// accounts.add(account);\n }", "private void initData() throws Exception {\n runTX(new Callable<Void>() {\n @Override\n public Void call() throws Exception {\n createOrganizationRoles(dm);\n createPaymentTypes(dm);\n createUserRoles(dm);\n supplier = Organizations.createOrganization(dm,\n OrganizationRoleType.SUPPLIER);\n UserGroup defaultGroupSup = new UserGroup();\n defaultGroupSup.setOrganization(supplier);\n defaultGroupSup.setIsDefault(true);\n defaultGroupSup.setName(\"default\");\n dm.persist(defaultGroupSup);\n technologyProvider = Organizations.createOrganization(dm,\n OrganizationRoleType.TECHNOLOGY_PROVIDER);\n UserGroup defaultGroupTP = new UserGroup();\n defaultGroupTP.setOrganization(technologyProvider);\n defaultGroupTP.setIsDefault(true);\n defaultGroupTP.setName(\"default\");\n dm.persist(defaultGroupTP);\n tpAndSup = Organizations.createOrganization(dm,\n OrganizationRoleType.TECHNOLOGY_PROVIDER,\n OrganizationRoleType.SUPPLIER);\n supplierAdminUser = Organizations.createUserForOrg(dm, supplier,\n true, \"admin\");\n supplier2 = Organizations.createOrganization(dm,\n OrganizationRoleType.SUPPLIER);\n UserGroup defaultGroup = new UserGroup();\n defaultGroup.setOrganization(supplier2);\n defaultGroup.setIsDefault(true);\n defaultGroup.setName(\"default\");\n dm.persist(defaultGroup);\n UserGroup defaultGroupTpAndSp = new UserGroup();\n defaultGroupTpAndSp.setOrganization(tpAndSup);\n defaultGroupTpAndSp.setIsDefault(true);\n defaultGroupTpAndSp.setName(\"default\");\n dm.persist(defaultGroupTpAndSp);\n Organizations.createUserForOrg(dm, supplier2, true, \"admin\");\n customer = Organizations.createCustomer(dm, supplier);\n UserGroup defaultGroup1 = new UserGroup();\n defaultGroup1.setOrganization(customer);\n defaultGroup1.setIsDefault(true);\n defaultGroup1.setName(\"default\");\n dm.persist(defaultGroup1);\n customer2 = Organizations.createCustomer(dm, supplier2);\n customerUser = Organizations.createUserForOrg(dm, customer,\n true, \"admin\");\n OrganizationReference onBehalf = new OrganizationReference(\n supplier, customer,\n OrganizationReferenceType.ON_BEHALF_ACTING);\n dm.persist(onBehalf);\n onBehalf = new OrganizationReference(supplier, supplier2,\n OrganizationReferenceType.ON_BEHALF_ACTING);\n dm.persist(onBehalf);\n onBehalf = new OrganizationReference(supplier,\n technologyProvider,\n OrganizationReferenceType.ON_BEHALF_ACTING);\n dm.persist(onBehalf);\n onBehalf = new OrganizationReference(supplier, tpAndSup,\n OrganizationReferenceType.ON_BEHALF_ACTING);\n dm.persist(onBehalf);\n return null;\n }\n });\n }", "public Account(String currency) {\n //numAccount += 1;\n incrementNumAccount();\n this.accountID = numAccount;\n this.dateOfCreation = LocalDate.now();\n\n setPrimaryCurrency(currency);\n this.currencyBalance = Money.of(0, this.primaryCurrency);\n ownerID = new ArrayList<>();\n }", "public void init() {\n\t\tfor (Node node : nodes)\n\t\t\tnode.init();\n\t}", "public NciAtm1() {\n initComponents();\n this.setLocationRelativeTo(null);\n initiateAccounts();\n }", "public CreateAccount() {\n initComponents();\n selectionall();\n }", "private void initAccountChoiceCache() {\n \tArrayList<AlertMeStorage.AlertMeUser> accounts = alertMe.getUserAccountList();\n \t//AlertMeStorage.AlertMeUser currentAcc = alertMe.getCurrentSession();\n \tint accSize = (accounts!=null && !accounts.isEmpty())? accounts.size():0;\n\t\tif (AlertMeConstants.DEBUGOUT) Log.w(TAG, \"initAccountChoiceCache() START\");\n \taccountNamesChoiceList = null;\n \taccountIDsChoiceList = null;\n \tif (accSize>1) {\n \t\tint i = 0;\n \t\tint cSz = accSize;\n \t\tCollections.sort(accounts, AlertMeStorage.AlertMeUser.getComparator(false));\n \t\taccountNamesChoiceList = new String[cSz];\n \t\taccountIDsChoiceList = new long[cSz];\n \t\tfor (AlertMeStorage.AlertMeUser account: accounts) {\n \t\t\tboolean addToList = false;\n \t\t\tif (account!=null && account.id!=-1) {\n \t\t\t\taddToList = true;\n \t\t\t}\n \t\t\tif (addToList) {\n \t\t\t\taccountNamesChoiceList[i] = account.username;\n \t\t\t\taccountIDsChoiceList[i] = account.id;\n \t\t\t\ti++;\n \t\t\t}\n \t\t}\n \t}\n\t\tif (AlertMeConstants.DEBUGOUT) Log.w(TAG, \"initAccountChoiceCache() END\");\n }", "public void initialize(long seed0, long seed1) {\n\t\tbytesDigested = 0;\n\t\tbyteCount = 0;\n\t\thashState[0] = seed0;\n\t\thashState[1] = seed1;\n\t}", "public Bank(String name, int accs){\n bankAccounts = new Account[accs];\n bankName = name;\n maxAccounts = accs;\n currAccounts = 0; //empty\n }", "public void initBlockTerrain(Application app, Node rootNode){\r\n CubesTestAssets.registerBlocks();\r\n CubesSettings blockSettings = CubesTestAssets.getSettings(app);\r\n blockSettings.setBlockSize(5);\r\n blockTerrain = new BlockTerrainControl(blockSettings, new Vector3Int(2, 1, 2));\r\n blockTerrain.setBlockArea(new Vector3Int(0, 0, 0), new Vector3Int(32, 1, 32), CubesTestAssets.BLOCK_STONE);\r\n blockTerrain.setBlocksFromNoise(new Vector3Int(0, 1, 0), new Vector3Int(32, 5, 32), 0.5f, CubesTestAssets.BLOCK_GRASS);\r\n terrainNode = new Node();\r\n terrainNode.addControl(blockTerrain);\r\n rootNode.attachChild(terrainNode);\r\n }", "public GoldCoin(){\n \tinit();\n }", "private void initOrganisations ()\n {\n try\n {\n \t// don't support registration with a BLOCKED organisation\n \t\t\torganisations = DccdUserService.getService().getNonblockedOrganisations();\n \t\t}\n catch (UserServiceException e)\n {\n \t\t\t// We need organisations when registering\n \t\t\te.printStackTrace();\n \t\t\tgetSession().error(\"Failed to retrieve organisations\"); // use resource?\n \t\t\t// go to the error page!\n \t\t\tthrow new RestartResponseException(ErrorPage.class);\n \t\t}\n }", "public User_Account() {\r\n\t\tfirstName=middleName=lastName = null;\r\n\t\taddress=city=state=zip=null;\r\n\t\tphone=email=webLinks= new ArrayList <String>(); \r\n\t\tedu = new ArrayList <Education>();\r\n\t\twork = new ArrayList <Work>();\r\n\t}", "public Account(String firstName, String lastName, String SSN,\n String email, String password, String cardNum, String accId,\n double gpa, String schoolName, HashMap<String, Transaction> pendingTransactions,\n HashMap<String, Transaction> completedTransactions) {\n //Map<String, Transaction> dailyTransactions) {\n this.firstName = firstName;\n this.lastName = lastName;\n this.SSN = SSN;\n this.cardNum = cardNum;\n this.email = email;\n this.password = password;\n this.accId = accId;\n dailyLimit = 50.00;\n accCreditLimit = 1000.00;\n creditUsed = getCreditUsed();\n this.gpa = gpa;\n cashBackRate = gpa / 2;\n this.schoolName = schoolName;\n this.pendingTransactions = pendingTransactions;\n this.completedTransactions = completedTransactions;\n this.cashBackToDate = 0.0;\n //this.dailyTransactions = dailyTransactions;\n }", "public final void loadAccounts() {\n DBUtil.select(\n \"select id, created, account_name, account_pass, account_email, timezone from \"\n + ConfigUtil.getAntiFraudDatabaseSchema()\n + \".af_account\",\n new ResultSetProcessor() {\n @Override\n public void process(ResultSet resultSet) throws SQLException {\n while (resultSet.next() ) {\n AfAccount account = createAccountFromResultSet(resultSet);\n }\n }\n });\n }", "public Bank() throws Exception\r\n\t{\r\n\t\tScanner fileScan = new Scanner(new File(\"C:\\\\Users\\\\jason\\\\workspace\\\\proj1fa14\\\\bankdata.txt\"));\r\n\t\taccounts = new Account[10];\r\n\t\tnumAccounts = 0;\r\n\t\tCustomer customer;\r\n\t\tAccount account;\r\n\t\tfor(int i = 0; i<9; i++)\r\n\t\t{\r\n\t\t\tString first = fileScan.next();\r\n\t\t\t//System.out.println(first);\r\n\t\t\tString last = fileScan.next();\r\n\t\t\t//System.out.println(last);\r\n\t\t\tint age = fileScan.nextInt();\r\n\t\t\tString pN = fileScan.next();\r\n\t\t\tint ba = fileScan.nextInt();\r\n\t\t\tint ch = fileScan.nextInt();\r\n\t\t\tString accNum = fileScan.next();\r\n\t\t\tcustomer = new Customer(first,last,age,pN);\r\n\t\t\taccount = new Account(customer,ba,ch, accNum);\r\n\t\t\taccounts[i] = account;\r\n\t\t\tnumAccounts++;\r\n\t\t}\r\n\t\tfileScan.close();\r\n\t}", "public void initialize() {\n\t\tmaze = new Block[width][height];\n\t\tborder();\n\t}", "private void initializeAll() {\n initialize(rows);\n initialize(columns);\n initialize(boxes);\n }", "private static void registerIdentity() {\n lastBlockchainIdentity.registerIdentity(null);\n //System.out.println(\"Identity created: \" + lastIdentityId);\n //this is the base58 id\n lastIdentityId = lastTx.getCreditBurnIdentityIdentifier().toStringBase58();\n\n System.out.println(\"Identity created: \" + lastTx.getCreditBurnIdentityIdentifier().toStringBase58());\n /*DashPlatformProtocol dpp = new DashPlatformProtocol(dataProvider);\n\n kit.wallet().getBlockchainIdentityFundingKeyChain().getKeyByPubKeyHash(lastTx.getCreditBurnPublicKeyId().getBytes());\n IdentityPublicKey identityPublicKey = new IdentityPublicKey(lastTx.getUsedDerivationPathIndex()+1,\n IdentityPublicKey.TYPES.ECDSA_SECP256K1, Base64.toBase64String(lastTx.getCreditBurnPublicKey().getPubKey()), true);\n List<IdentityPublicKey> keyList = new ArrayList<>();\n keyList.add(identityPublicKey);\n Identity identity = dpp.identity.create(Base58.encode(lastTx.getCreditBurnIdentityIdentifier().getBytes()), Identity.IdentityType.USER,\n keyList);\n IdentityCreateTransition st = new IdentityCreateTransition(Identity.IdentityType.USER,\n lastTx.getLockedOutpoint().toStringBase64(), keyList, 0);\n\n st.sign(identityPublicKey, Utils.HEX.encode(lastTx.getCreditBurnPublicKey().getPrivKeyBytes()));\n\n DapiClient client = new DapiClient(EvoNetParams.MASTERNODES[1], true);\n client.applyStateTransition(st);\n client.shutdown();\n lastIdentityId = lastTx.getCreditBurnIdentityIdentifier().toStringBase58();\n System.out.println(\"Identity created: \" + lastIdentityId);\n*/\n //sleep(30*1000);\n lastBlockchainIdentity.watchIdentity(1, 1000, RetryDelayType.LINEAR,\n new RegisterIdentityCallback() {\n @Override\n public void onComplete(@NotNull String uniqueId) {\n System.out.println(\"Identity created and found\");\n blockchainUser(lastTx);\n }\n\n @Override\n public void onTimeout() {\n System.out.println(\"Identity was not created or found.\");\n }\n }\n );\n //lastBlockchainIdentity.monitorForBlockchainIdentityWithRetryCount(30, 5000, BlockchainIdentity.RetryDelayType.LINEAR);\n }", "public BankAccount() {\n\t\tthis.money = 0;\n\t}", "private void initialise() {\n \thashFamily = new Hash[this.r];\n for(int i= 0; i < this.r;i++)\n {\n \tthis.hashFamily[i] = new Hash(this.s * 2);\n }\n this.net = new OneSparseRec[this.r][this.s *2];\n for(int i = 0 ; i < this.r; i++)\n \tfor(int j =0 ; j< this.s * 2 ; j++)\n \t\tthis.net[i][j] = new OneSparseRec();\n \n }", "public BoardBuilder initializeBlocksOnBoard(){\n\t\t// Sets color of alternate Blocks of Board as BLACK & WHITE\n\t\tboardInitialized = true;\n\t\treturn this;\n\t}", "public static void initializeTwitterAccount()\n\t{\n\t\tString cK = \"\";\n\t\tString cS = \"\";\n\t\tString aT = \"\";\n\t\tString aTS = \"\";\n\t\ttA = new TwitterAccount(cK, cS, aT, aTS);\n\t}", "BankAccount(){\n\t\tSystem.out.println(\"NEW ACCOUNT CREATED\");\t\n\t}", "@PostConstruct\n\tprotected void initialize() throws Exception {\n\t\t// // Create sample roles\n\t\tRole roleAdmin = roleRepository.findByName(\"R_SUPER_ADMIN\");\n\t\tif (roleRepository.findByName(\"R_SUPER_ADMIN\") == null) {\n\t\t\tlogger.debug(\"Creating default admin role ...\");\n\t\t\troleAdmin = new Role(\"Super Admin\", \"R_SUPER_ADMIN\", \"This is a role for super administrator.\");\n\t\t\troleAdmin.setIsRestricted(true);\n\t\t\troleRepository.save(roleAdmin);\n\t\t}\n\t\t// // Create default users\n\t\tif (accountRepository.findByUsername(\"admin\") == null) {\n\t\t\tlogger.debug(\"Creating default admin account ...\");\n\t\t\taccountRepository.save(new Account(\"admin\", passwordEncoder.encode(\"admin\"), \"[email protected]\", \"Kent\",\n\t\t\t\t\troleRepository.findByName(\"R_SUPER_ADMIN\"), true));\n\t\t}\n\n\t}", "public Account()\n {\n balance = 0;\n balanceChangeLock = new ReentrantLock();\n sufficientFundsCondition = balanceChangeLock.newCondition();\n }", "public MyBank() {\n initComponents();\n fillClients();\n }", "public static void main(String[] args) {\n\r\n\t\t\r\n\t\tArrayList<Block> blockChain = new ArrayList<Block>();\r\n\t\t\r\n\t\tString[] initialValues = {\"Linus has 700 Euro\", \"Florian has 500 Euro\"};\r\n\t\tBlock firstblock = new Block(initialValues, 0);\r\n\t\tblockChain.add(firstblock);\r\n\t\tSystem.out.println(\"Erster Block ist \" + firstblock.toString());\r\n\t\tSystem.out.println(\"Die block chain ist\" + blockChain.toString());\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\tString[] payBlock = {\"Florian gives Linus 400 Euro\", \"Thomas buy 800 Euro\"};\r\n\t\tBlock secondblock = new Block(payBlock, firstblock.getBlockHash());\r\n\t\tblockChain.add(secondblock);\r\n\t\tSystem.out.println(\"Zweiter Block ist \" + secondblock.toString());\r\n\t\tSystem.out.println(\"Die block chain ist\" + blockChain.toString());\r\n\t\t\r\n\t\tString[] payBack = {\"Linus gives Florian 400 Euro\"};\r\n\t\tBlock thirdblock = new Block(payBack, secondblock.getBlockHash());\r\n\t\tblockChain.add(thirdblock);\r\n\t\tSystem.out.println(\"Zweiter Block ist \" + thirdblock.toString());\r\n\t\tSystem.out.println(\"Die block chain ist\" + blockChain.toString());\r\n\t\t\r\n\t}", "public void initialize()\n {\n if (!this.seedInitialized)\n {\n throw new IllegalStateException(\"Seed \" + this.maxHeight + \" not initialized\");\n }\n\n this.heightOfNodes = new Vector();\n this.tailLength = 0;\n this.firstNode = null;\n this.firstNodeHeight = -1;\n this.isInitialized = true;\n System.arraycopy(this.seedNext, 0, this.seedActive, 0, messDigestTree\n .getDigestSize());\n }", "public BankDatabase() {\r\n accounts = new Account[3];\r\n Connection c = null;\r\n Statement stmt = null;\r\n try {\r\n Class.forName(\"org.postgresql.Driver\");\r\n c = DriverManager\r\n .getConnection(\"jdbc:postgresql://localhost:5432/ATM\",\r\n \"postgres\", \"0000\");\r\n c.setAutoCommit(false);\r\n stmt = c.createStatement();\r\n ResultSet rs = stmt.executeQuery( \"SELECT * FROM accounts;\" );\r\n var i = 0;\r\n while ( rs.next() ) {\r\n int theAccountNumber = rs.getInt(\"accountnumber\");\r\n int thePin = rs.getInt(\"pin\");\r\n double theAvailiableBalance = rs.getDouble(\"availiablebalance\");\r\n double theTotalBalance = rs.getDouble(\"totalbalance\");\r\n accounts[i] = new Account( theAccountNumber, thePin, theAvailiableBalance, theTotalBalance);\r\n i++;\r\n }\r\n rs.close();\r\n stmt.close();\r\n c.close();\r\n } catch ( Exception e ) {\r\n System.err.println( e.getClass().getName()+\": \"+ e.getMessage() );\r\n System.exit(0);\r\n }\r\n\r\n\r\n// accounts = new Account[2]; // just 2 accounts for testing\r\n// accounts[0] = new Account(12345, 54321, 1000.0, 1200.0);\r\n// accounts[1] = new Account(98765, 56789, 200.0, 200.0);\r\n }", "public void initialize() {\r\n\t\tremoveAllCards();\r\n\t\tfor (int i = 0; i < 4; i++) {\r\n\t\t\tfor (int j = 0; j < 13; j++) {\r\n\t\t\t\tBigTwoCard card = new BigTwoCard(i, j);\r\n\t\t\t\taddCard(card);\r\n\t\t\t}\r\n\t\t}\t\r\n\t}" ]
[ "0.6603556", "0.59975773", "0.5862145", "0.57608104", "0.5736122", "0.5730488", "0.57234246", "0.5639268", "0.5624792", "0.55915123", "0.5589558", "0.55454546", "0.5544683", "0.5492148", "0.5484297", "0.5461032", "0.54448986", "0.5415064", "0.54021645", "0.5393345", "0.5390835", "0.5385173", "0.5318836", "0.5314453", "0.53087914", "0.5304771", "0.5303608", "0.5292234", "0.5289474", "0.5280085", "0.52607137", "0.52565145", "0.52469045", "0.5246268", "0.52378345", "0.5223986", "0.5186481", "0.5186288", "0.5182892", "0.51783913", "0.5175191", "0.5172698", "0.51712906", "0.51696956", "0.5164194", "0.51580274", "0.5155016", "0.515375", "0.51295435", "0.5124597", "0.51237965", "0.5122665", "0.5116142", "0.5110199", "0.5102194", "0.5100174", "0.50748456", "0.50678223", "0.5066086", "0.5060127", "0.5018495", "0.5004", "0.5000416", "0.49997845", "0.49977556", "0.49964863", "0.49947384", "0.49748772", "0.4971352", "0.49705744", "0.4967411", "0.49538907", "0.49538124", "0.49517277", "0.49412966", "0.49397036", "0.49366748", "0.49350494", "0.4934707", "0.49158183", "0.49101186", "0.49031776", "0.49005255", "0.49000528", "0.48978886", "0.4894904", "0.48943594", "0.48894855", "0.4884633", "0.48786312", "0.4876002", "0.48756802", "0.487441", "0.4872076", "0.4871195", "0.48695537", "0.4869103", "0.48639634", "0.4844534", "0.48438632" ]
0.8276235
0
Parses a block of the blockchain to get the accounts of it and add the accounts and block and releases the balance of the blocks
public void parseBlock(Block block) { Account account = getAccount(block.getCoinbase()); account.addMinedBlock(block); minerMap.put(block.getBlockNumber(), account); blockMap.put(block.getBlockNumber(), block); releaseBlockedBalances(block.getBlockNumber()); parseTransactions(block.getTransactions()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n\tpublic void parseBlock()\n\t{\n\t\tDBSet databaseSet = DBSet.createEmptyDatabaseSet();\n\t\t\t\t\t\t\t\t\n\t\t//PROCESS GENESISBLOCK\n\t\tGenesisBlock genesisBlock = new GenesisBlock();\n\t\tgenesisBlock.process(databaseSet);\n\t\t\t\t\t\t\t\t\n\t\t//CREATE KNOWN ACCOUNT\n\t\tbyte[] seed = Crypto.getInstance().digest(\"test\".getBytes());\n\t\tbyte[] privateKey = Crypto.getInstance().createKeyPair(seed).getA();\n\t\tPrivateKeyAccount generator = new PrivateKeyAccount(privateKey);\n\t\t\t\t\t\t\t\t\t\t\n\t\t//PROCESS GENESIS TRANSACTION TO MAKE SURE GENERATOR HAS FUNDS\n\t\tTransaction transaction = new GenesisTransaction(generator, BigDecimal.valueOf(1000).setScale(8), NTP.getTime());\n\t\ttransaction.process(databaseSet);\n\t\t\t\t\t\t\t\t\n\t\t//GENERATE NEXT BLOCK\n\t\tBlockGenerator blockGenerator = new BlockGenerator();\n\t\tBlock block = blockGenerator.generateNextBlock(databaseSet, generator, genesisBlock);\n\t\t\t\t\t\t\n\t\t//FORK\n\t\tDBSet fork = databaseSet.fork();\n\t\t\t\t\n\t\t//GENERATE PAYMENT 1\n\t\tAccount recipient = new Account(\"XUi2oga2pnGNcZ9es6pBqxydtRZKWdkL2g\");\n\t\tlong timestamp = block.getTimestamp();\n\t\tbyte[] signature = PaymentTransaction.generateSignature(databaseSet, generator, recipient, BigDecimal.valueOf(100).setScale(8), BigDecimal.valueOf(1).setScale(8), timestamp);\n\t\tTransaction payment1 = new PaymentTransaction(generator, recipient, BigDecimal.valueOf(100).setScale(8), BigDecimal.valueOf(1).setScale(8), timestamp, generator.getLastReference(databaseSet), signature);\n\t\tpayment1.process(fork);\n\t\tblock.addTransaction(payment1);\t\n\t\t\t\t\n\t\t//GENERATE PAYMENT 2\n\t\tAccount recipient2 = new Account(\"XLPYYfxKEiDcybCkFA7jXcxSdePMMoyZLt\");\n\t\tsignature = PaymentTransaction.generateSignature(fork, generator, recipient2, BigDecimal.valueOf(100).setScale(8), BigDecimal.valueOf(1).setScale(8), timestamp);\n\t\tTransaction payment2 = new PaymentTransaction(generator, recipient2, BigDecimal.valueOf(100).setScale(8), BigDecimal.valueOf(1).setScale(8), timestamp, generator.getLastReference(fork), signature);\n\t\tblock.addTransaction(payment2);\t\n\t\t\t\t\t\t\n\t\t//ADD TRANSACTION SIGNATURE\n\t\tbyte[] transactionsSignature = Crypto.getInstance().sign(generator, block.getGeneratorSignature());\n\t\tblock.setTransactionsSignature(transactionsSignature);\n\t\t\t\t\n\t\t//CONVERT TO BYTES\n\t\tbyte[] rawBlock = block.toBytes();\n\t\t\t\t\n\t\ttry \n\t\t{\t\n\t\t\t//PARSE FROM BYTES\n\t\t\tBlock parsedBlock = BlockFactory.getInstance().parse(rawBlock);\n\t\t\t\t\t\n\t\t\t//CHECK INSTANCE\n\t\t\tassertEquals(false, parsedBlock instanceof GenesisBlock);\n\t\t\t\t\t\n\t\t\t//CHECK SIGNATURE\n\t\t\tassertEquals(true, Arrays.equals(block.getSignature(), parsedBlock.getSignature()));\n\t\t\t\t\t\n\t\t\t//CHECK GENERATOR\n\t\t\tassertEquals(block.getGenerator().getAddress(), parsedBlock.getGenerator().getAddress());\t\n\t\t\t\t\t\n\t\t\t//CHECK BASE TARGET\n\t\t\tassertEquals(block.getGeneratingBalance(), parsedBlock.getGeneratingBalance());\t\n\t\t\t\n\t\t\t//CHECK FEE\n\t\t\tassertEquals(block.getTotalFee(), parsedBlock.getTotalFee());\t\n\t\t\t\t\t\n\t\t\t//CHECK REFERENCE\n\t\t\tassertEquals(true, Arrays.equals(block.getReference(), parsedBlock.getReference()));\t\n\t\t\t\t\t\n\t\t\t//CHECK TIMESTAMP\n\t\t\tassertEquals(block.getTimestamp(), parsedBlock.getTimestamp());\t\t\n\t\t\t\n\t\t\t//CHECK TRANSACTIONS COUNT\n\t\t\tassertEquals(block.getTransactionCount(), parsedBlock.getTransactionCount());\t\t\n\t\t}\n\t\tcatch (Exception e) \n\t\t{\n\t\t\tfail(\"Exception while parsing transaction.\");\n\t\t}\n\t\t\t\t\n\t\t//PARSE TRANSACTION FROM WRONG BYTES\n\t\trawBlock = new byte[50];\n\t\t\n\t\ttry \n\t\t{\t\n\t\t\t//PARSE FROM BYTES\n\t\t\tBlockFactory.getInstance().parse(rawBlock);\n\t\t\t\t\t\n\t\t\t//FAIL\n\t\t\tfail(\"this should throw an exception\");\n\t\t}\n\t\tcatch (Exception e) \n\t\t{\n\t\t\t//EXCEPTION IS THROWN OK\n\t\t}\t\t\t\n\t}", "public void addValue(JsonObject block, HashMap<String, Integer> balance){\n JsonArray transactions = block.get(\"Transactions\").getAsJsonArray();\n int N = transactions.size();\n String minerId = block.get(\"MinerID\").getAsString();\n getOrInit(minerId, balance);\n for (int i=0; i<N; i++) {\n \tJsonObject Tx = transactions.get(i).getAsJsonObject();\n \tint current = getOrInit(minerId, balance);\n \tbalance.put(minerId, current + Tx.get(\"MiningFee\").getAsInt());\n }\n return;\n }", "public HashMap<String, Integer> compute_balance(JsonObject block) {\n \tHashMap<String, Integer> balance = new HashMap<>();\n \tStack<JsonObject> s = new Stack<JsonObject>();\n \tString initHash = \"0000000000000000000000000000000000000000000000000000000000000000\";\n \tString prevHash = block.get(\"PrevHash\").getAsString();\n \ts.push(block);\n \t\n \twhile (!prevHash.equals(initHash)) {\n JsonObject now = blocks.get(prevHash);\n s.push(now);\n try{\n prevHash = now.get(\"PrevHash\").getAsString();\n } catch (NullPointerException e){\n System.out.println(\"Null pointer in compute_balance(), prevHash:\" + prevHash);\n break;\n }\n \t}\n \t\n \twhile(!s.empty()) {\n \t\tJsonObject now = s.pop();\n \t\tUpdate_by_block(balance, now);\n \t}\n \t\n \treturn balance;\n }", "private void initAccounts() {\n ((GenesisBlock) DependencyManager.getBlockchain().getGenesisBlock()).getAccountBalances().forEach((key, value) -> {\n Account account = getAccount(key);\n account.addBalance(value);\n });\n DependencyManager.getBlockchain().getChain().getChain().forEach(this::parseBlock);\n }", "@Test\n\tpublic void processBlock()\n\t{\n\t\tDBSet databaseSet = DBSet.createEmptyDatabaseSet();\n\t\t\t\t\t\t\t\t\t\t\n\t\t//PROCESS GENESISBLOCK\n\t\tGenesisBlock genesisBlock = new GenesisBlock();\n\t\tgenesisBlock.process(databaseSet);\n\t\t\t\t\t\t\t\t\t\t\n\t\t//CREATE KNOWN ACCOUNT\n\t\tbyte[] seed = Crypto.getInstance().digest(\"test\".getBytes());\n\t\tbyte[] privateKey = Crypto.getInstance().createKeyPair(seed).getA();\n\t\tPrivateKeyAccount generator = new PrivateKeyAccount(privateKey);\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t//PROCESS GENESIS TRANSACTION TO MAKE SURE GENERATOR HAS FUNDS\n\t\tTransaction transaction = new GenesisTransaction(generator, BigDecimal.valueOf(1000).setScale(8), NTP.getTime());\n\t\ttransaction.process(databaseSet);\n\t\t\t\t\t\t\t\t\n\t\t//GENERATE NEXT BLOCK\n\t\tBlockGenerator blockGenerator = new BlockGenerator();\n\t\tBlock block = blockGenerator.generateNextBlock(databaseSet, generator, genesisBlock);\n\t\t\n\t\t//FORK\n\t\tDBSet fork = databaseSet.fork();\n\t\t\n\t\t//GENERATE PAYMENT 1\n\t\tAccount recipient = new Account(\"XUi2oga2pnGNcZ9es6pBqxydtRZKWdkL2g\");\n\t\tlong timestamp = block.getTimestamp();\n\t\tbyte[] signature = PaymentTransaction.generateSignature(databaseSet, generator, recipient, BigDecimal.valueOf(100).setScale(8), BigDecimal.valueOf(1).setScale(8), timestamp);\n\t\tTransaction payment1 = new PaymentTransaction(generator, recipient, BigDecimal.valueOf(100).setScale(8), BigDecimal.valueOf(1).setScale(8), timestamp, generator.getLastReference(databaseSet), signature);\n\t\tpayment1.process(fork);\n\t\tblock.addTransaction(payment1);\t\n\t\t\n\t\t//GENERATE PAYMENT 2\n\t\tAccount recipient2 = new Account(\"XLPYYfxKEiDcybCkFA7jXcxSdePMMoyZLt\");\n\t\tsignature = PaymentTransaction.generateSignature(fork, generator, recipient2, BigDecimal.valueOf(100).setScale(8), BigDecimal.valueOf(1).setScale(8), timestamp);\n\t\tTransaction payment2 = new PaymentTransaction(generator, recipient2, BigDecimal.valueOf(100).setScale(8), BigDecimal.valueOf(1).setScale(8), timestamp, generator.getLastReference(fork), signature);\n\t\tblock.addTransaction(payment2);\t\n\t\t\n\t\t//ADD TRANSACTION SIGNATURE\n\t\tbyte[] transactionsSignature = blockGenerator.calculateTransactionsSignature(block, generator);\n\t\tblock.setTransactionsSignature(transactionsSignature);\n\t\t\n\t\t//CHECK VALID\n\t\tassertEquals(true, block.isSignatureValid());\n\t\tassertEquals(true, block.isValid(databaseSet));\n\t\t\n\t\t//PROCESS BLOCK\n\t\tblock.process(databaseSet);\n\t\t\n\t\t//CHECK BALANCE GENERATOR\n\t\tassertEquals(true, generator.getConfirmedBalance(databaseSet).compareTo(BigDecimal.valueOf(800)) == 0);\n\t\t\n\t\t//CHECK LAST REFERENCE GENERATOR\n\t\tassertEquals(true, Arrays.equals(generator.getLastReference(databaseSet), payment2.getSignature()));\n\t\t\n\t\t//CHECK BALANCE RECIPIENT\n\t\tassertEquals(true, recipient.getConfirmedBalance(databaseSet).compareTo(BigDecimal.valueOf(1100)) == 0);\n\t\t\n\t\t//CHECK LAST REFERENCE RECIPIENT\n\t\tassertEquals(false, Arrays.equals(recipient.getLastReference(databaseSet), payment1.getSignature()));\n\t\t\n\t\t//CHECK BALANCE RECIPIENT2\n\t\tassertEquals(true, recipient2.getConfirmedBalance(databaseSet).compareTo(BigDecimal.valueOf(100)) == 0);\n\t\t\t\t\n\t\t//CHECK LAST REFERENCE RECIPIENT\n\t\tassertEquals(true, Arrays.equals(recipient2.getLastReference(databaseSet), payment2.getSignature()));\n\t\t\n\t\t//CHECK TOTAL FEE\n\t\tassertEquals(true, block.getTotalFee().compareTo(BigDecimal.valueOf(2)) == 0);\n\t\t\n\t\t//CHECK TOTAL TRANSACTIONS\n\t\tassertEquals(2, block.getTransactionCount());\n\t\t\n\t\t//CHECK LAST BLOCK\n\t\tassertEquals(true, Arrays.equals(block.getSignature(), databaseSet.getBlockMap().getLastBlock().getSignature()));\n\t}", "public void updateTransPool(JsonObject block){\n JsonArray transactions = block.get(\"Transactions\").getAsJsonArray();\n \tint N = transactions.size();\n \tfor(int i=0; i<N; i++) {\n \t\tJsonObject Tx = transactions.get(i).getAsJsonObject();\n \t\tif(TxPool_new.contains(Tx))\n \t\t\tTxPool_new.remove(Tx);\n \t\tTxPool_used.add(Tx);\n }\n }", "public void pushComputedBlock(String block){\n JsonParser parser = new JsonParser();\n \tJsonObject Block = (JsonObject) parser.parse(block);\n\n processNewBlock(Block);\n\n }", "@Test\n\tpublic void validateBlock()\n\t{\n\t\tDBSet databaseSet = DBSet.createEmptyDatabaseSet();\n\t\t\t\t\t\t\n\t\t//PROCESS GENESISBLOCK\n\t\tGenesisBlock genesisBlock = new GenesisBlock();\n\t\tgenesisBlock.process(databaseSet);\n\t\t\t\t\t\t\n\t\t//CREATE KNOWN ACCOUNT\n\t\tbyte[] seed = Crypto.getInstance().digest(\"test\".getBytes());\n\t\tbyte[] privateKey = Crypto.getInstance().createKeyPair(seed).getA();\n\t\tPrivateKeyAccount generator = new PrivateKeyAccount(privateKey);\n\t\t\t\t\t\t\t\t\n\t\t//PROCESS GENESIS TRANSACTION TO MAKE SURE GENERATOR HAS FUNDS\n\t\tTransaction transaction = new GenesisTransaction(generator, BigDecimal.valueOf(1000).setScale(8), NTP.getTime());\n\t\ttransaction.process(databaseSet);\n\t\t\t\t\t\t\n\t\t//GENERATE NEXT BLOCK\n\t\tBlockGenerator blockGenerator = new BlockGenerator();\n\t\tBlock newBlock = blockGenerator.generateNextBlock(databaseSet, generator, genesisBlock);\n\t\t\t\t\n\t\t//ADD TRANSACTION SIGNATURE\n\t\tbyte[] transactionsSignature = Crypto.getInstance().sign(generator, newBlock.getGeneratorSignature());\n\t\tnewBlock.setTransactionsSignature(transactionsSignature);\n\t\t\n\t\t//CHECK IF VALID\n\t\tassertEquals(true, newBlock.isValid(databaseSet));\n\t\t\n\t\t//CHANGE REFERENCE\n\t\tBlock invalidBlock = BlockFactory.getInstance().create(newBlock.getVersion(), new byte[128], newBlock.getTimestamp(), newBlock.getGeneratingBalance(), newBlock.getGenerator(), newBlock.getGeneratorSignature());\n\t\t\n\t\t//CHECK IF INVALID\n\t\tassertEquals(false, invalidBlock.isValid(databaseSet));\n\t\t\n\t\t//CHANGE TIMESTAMP\n\t\tinvalidBlock = BlockFactory.getInstance().create(newBlock.getVersion(), newBlock.getReference(), 1L, newBlock.getGeneratingBalance(), newBlock.getGenerator(), newBlock.getGeneratorSignature());\n\t\t\n\t\t//CHECK IF INVALID\n\t\tassertEquals(false, invalidBlock.isValid(databaseSet));\n\t\t\n\t\t//CHANGE BASETARGET\n\t\tinvalidBlock = BlockFactory.getInstance().create(newBlock.getVersion(), newBlock.getReference(), newBlock.getTimestamp(), 1L, newBlock.getGenerator(), newBlock.getGeneratorSignature());\n\t\t\t\t\n\t\t//CHECK IF INVALID\n\t\tassertEquals(false, invalidBlock.isValid(databaseSet));\n\t\t\n\t\t//ADD INVALID TRANSACTION\n\t\tinvalidBlock = blockGenerator.generateNextBlock(databaseSet, generator, genesisBlock);\n\t\tAccount recipient = new Account(\"XUi2oga2pnGNcZ9es6pBqxydtRZKWdkL2g\");\n\t\tlong timestamp = newBlock.getTimestamp();\n\t\tbyte[] signature = PaymentTransaction.generateSignature(databaseSet, generator, recipient, BigDecimal.valueOf(-100).setScale(8), BigDecimal.valueOf(1).setScale(8), timestamp);\n\t\tTransaction payment = new PaymentTransaction(generator, recipient, BigDecimal.valueOf(-100).setScale(8), BigDecimal.valueOf(1).setScale(8), timestamp, generator.getLastReference(databaseSet), signature);\n\t\tinvalidBlock.addTransaction(payment);\t\t\n\t\t\n\t\t//CHECK IF INVALID\n\t\tassertEquals(false, invalidBlock.isValid(databaseSet));\n\t\t\n\t\t//ADD GENESIS TRANSACTION\n\t\tinvalidBlock = blockGenerator.generateNextBlock(databaseSet, generator, genesisBlock);\t\n\t\ttransaction = new GenesisTransaction(generator, BigDecimal.valueOf(1000).setScale(8), newBlock.getTimestamp());\n\t\tinvalidBlock.addTransaction(transaction);\t\n\t\t\n\t\t//CHECK IF INVALID\n\t\tassertEquals(false, invalidBlock.isValid(databaseSet));\n\t}", "public String processTransaction(Transaction transaction) throws LedgerException {\n // throws LedgerException on invalid transaction\n validateTransaction(transaction);\n\n // Add completed transaction to block\n int numberOfTransactions = this.currentBlock.addTransaction(transaction);\n\n // When transaction limit reached, validate and commit block and create new one\n if (numberOfTransactions == TRANSACTIONS_PER_BLOCK) {\n try {\n validateBlock(this.currentBlock);\n } catch (LedgerException e) {\n throw new LedgerException(\"process transaction\", e.getReason());\n }\n\n // Make transactions and account balances immutable\n Block completedBlock = this.currentBlock;\n completedBlock.commitBlock(this.seed);\n\n // Add current block to the end of the blockMap\n this.blockMap.put((this.blockMap.size() + 1), completedBlock);\n\n // Create new block with accountBalanceMap copied from completedBlock\n this.currentBlock = new Block(this.blockMap.size() + 1, completedBlock);\n }\n\n return transaction.getTransactionId();\n }", "private void validateBlock(Block block) throws LedgerException {\n // Check correct number of transactions\n if ( ! block.validateTransactions() ) {\n throw new LedgerException(\n \"validate\",\n \"Invalid block. The block does not contain exactly 10 transactions.\"\n );\n }\n\n // Check account balances/total\n if ( ! block.validateAccountBalances() ) {\n throw new LedgerException(\n \"validate\",\n \"Invalid block. Total currency does not equal MAX_ACCOUNT_BALANCE.\"\n );\n }\n\n // Check that the hashses match\n if ( ! block.validateHash(this.seed) ) {\n throw new LedgerException(\n \"validate\",\n \"Invalid block. Hashes do not match.\"\n );\n }\n }", "public void collectMoney(int idBlock) {\n wallet.collectMoney(idBlock);\n }", "public JsonObject raw_block() {\n \tJsonObject block = new JsonObject();\n \tblock.addProperty(\"BlockID\", blockId);\n \tif(!BlockChain.isEmpty())\n \t block.addProperty(\"PrevHash\", Hash.getHashString(getLongestBranch().last_block.toString()));\n \telse {\n \t\tblock.addProperty(\"PrevHash\", \"0000000000000000000000000000000000000000000000000000000000000000\");\n \t}\n \tblock.addProperty(\"Nonce\", \"00000000\");\n block.addProperty(\"MinerID\", \"Server\"+String.format(\"%02d\", minerId));\n \n \tJsonArray newTxPool = new JsonArray();\n \tJsonArray transactions = new JsonArray();\n \tint N = TxPool_new.size();\n \tint i;\n \tfor (i=0; i<N && i<50; i++) {\n \t\ttransactions.add(TxPool_new.get(i));\n \t\t//TxPool_used.add(TxPool_new.get(i));\n \t}\n \tfor (; i<N; i++)\n \t\tnewTxPool.add(TxPool_new.get(i));\n \tblock.add(\"Transactions\", transactions);\n\n \treturn block;\n }", "@Test\n\tpublic void parseGenesisBlock()\n\t{\n\t\tbyte[] rawBlock = gb.toBytes(true, forDB);\n\t\t//CHECK length\n\t\tassertEquals(rawBlock.length, gb.getDataLength(forDB));\n\t\t\t\n\t\tBlock parsedBlock = null;\n\t\ttry \n\t\t{\t\n\t\t\t//PARSE FROM BYTES\n\t\t\tparsedBlock = BlockFactory.getInstance().parse(rawBlock, forDB);\t\t\n\t\t\t\t\t\n\t\t}\n\t\tcatch (Exception e) \n\t\t{\n\t\t\tfail(\"Exception while parsing transaction.\" + e);\n\t\t}\n\t\t\n\t\t//CHECK length\n\t\tassertEquals(rawBlock.length, parsedBlock.getDataLength(forDB));\n\n\t\t//CHECK SIGNATURE\n\t\tassertEquals(true, Arrays.equals(gb.getSignature(), parsedBlock.getSignature()));\n\t\t\t\t\n\t\t//CHECK BASE TARGET\n\t\tassertEquals(gb.getGeneratingBalance(db), parsedBlock.getGeneratingBalance(db));\t\n\t\t\n\t\t//CHECK FEE\n\t\tassertEquals(gb.getTotalFee(), parsedBlock.getTotalFee());\t\n\n\t\t//CHECK TRANSACTION COUNT\n\t\tassertEquals(gb.getTransactionCount(), parsedBlock.getTransactionCount());\n\n\t\t//CHECK REFERENCE\n\t\tassertEquals(true, Arrays.equals(gb.getReference(), parsedBlock.getReference()));\t\t\t\n\n\t\t//CHECK GENERATOR\n\t\tassertEquals(gb.getCreator().getAddress(), parsedBlock.getCreator().getAddress());\t\n\t\t\t\t\n\t\t//CHECK INSTANCE\n\t\t////assertEquals(true, parsedBlock instanceof GenesisBlock);\n\t\t\t\t\n\t\t//PARSE TRANSACTION FROM WRONG BYTES\n\t\trawBlock = new byte[50];\n\t\t\n\t\ttry \n\t\t{\t\n\t\t\t//PARSE FROM BYTES\n\t\t\tBlockFactory.getInstance().parse(rawBlock, forDB);\n\t\t\t\t\t\n\t\t\t//FAIL\n\t\t\tfail(\"this should throw an exception\");\n\t\t}\n\t\tcatch (Exception e) \n\t\t{\n\t\t\t//EXCEPTION IS THROWN OK\n\t\t}\t\n\t}", "private void readBlocks(List<Element> blockElements, Model model)\n throws ObjectExistsException {\n // Add the blocks.\n for (int i = 0; i < blockElements.size(); i++) {\n Element curBlockElement = blockElements.get(i);\n Integer blockID;\n try {\n blockID = Integer.valueOf(curBlockElement.getAttributeValue(\"id\"));\n }\n catch (NumberFormatException e) {\n blockID = null;\n }\n Block curBlock = model.createBlock(blockID);\n TCSObjectReference<Block> blockRef = curBlock.getReference();\n String blockName = curBlockElement.getAttributeValue(\"name\");\n if (blockName == null || blockName.isEmpty()) {\n blockName = \"BlockName\" + i + \"Unknown\";\n }\n model.getObjectPool().renameObject(curBlock.getReference(), blockName);\n // Add members.\n List<Element> memberElements = curBlockElement.getChildren(\"member\");\n for (int j = 0; j < memberElements.size(); j++) {\n Element curMemberElement = memberElements.get(j);\n String memberName = curMemberElement.getAttributeValue(\"name\");\n if (memberName == null || memberName.isEmpty()) {\n memberName = \"MemberName\" + j + \"Unknown\";\n }\n TCSResource<?> curMember\n = (TCSResource<?>) model.getObjectPool().getObject(memberName);\n curBlock.addMember(curMember.getReference());\n }\n List<Element> properties = curBlockElement.getChildren(\"property\");\n for (int k = 0; k < properties.size(); k++) {\n Element curPropElement = properties.get(k);\n String curKey = curPropElement.getAttributeValue(\"name\");\n if (curKey == null || curKey.isEmpty()) {\n curKey = \"Key\" + k + \"Unknown\";\n }\n String curValue = curPropElement.getAttributeValue(\"value\");\n if (curValue == null || curValue.isEmpty()) {\n curValue = \"Value\" + k + \"Unknown\";\n }\n model.getObjectPool().setObjectProperty(blockRef, curKey, curValue);\n }\n }\n }", "public void addBlock(Block block)\n {\n SolrInputDocument solr_doc = new SolrInputDocument();\n solr_doc.setField(\"type\",\"Block\");\n solr_doc.setField(\"hash\", block.getHash_block());\n solr_doc.setField(\"block_num\", block.getBlock_num());\n solr_doc.setField(\"version\", block.getVersion());\n solr_doc.setField(\"transaction_merkle_root\", block.getTransac_merkle_root());\n solr_doc.setField(\"timestamps\", block.getTimestamp());\n solr_doc.setField(\"datetime\", block.getDatetime());\n solr_doc.setField(\"difficulty\", block.getDifficulty());\n solr_doc.setField(\"cumulative_difficulty\", block.getCumulative_difficulty());\n solr_doc.setField(\"nonce\", block.getNonce());\n solr_doc.setField(\"how_much_transaction\", block.getHow_much_transaction());\n solr_doc.setField(\"value_out\", block.getValue_out());\n solr_doc.setField(\"block_fee\", block.getBlock_fee());\n solr_doc.setField(\"avg_coin_out\", block.getAvg_coin_age());\n solr_doc.setField(\"coin_days_destroyed\", block.getCoin_days_destroyed());\n solr_doc.setField(\"cumulative_coin_days_destroyed\", block.getCumulative_coin_days_destroyed());\n\n try {\n client.add(solr_doc);\n } catch (SolrServerException | IOException e) {\n e.printStackTrace();\n }\n\n commit();\n }", "public static void main(String[] args) throws UnknownHostException, IOException \r\n{\t\r\n Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider()); //Adds Bouncycastle as a security provider of various cryptographic algorithm used later\r\n Shivani=new Wallet(\"Shivani\",\"1234\"); //Initialzing the wallets with their userID and passwords\r\n Pushkar=new Wallet(\"Pushkar\",\"1234\");\r\n walletsHash.put(Shivani.PublicAddress,Shivani); //Put these wallets into wallet hash for fast access\r\n walletsHash.put(Pushkar.PublicAddress, Pushkar);\r\n n=new Node(8332); //Starting the network for comunnication on port 8332 \r\n n.socket.joinGroup(n.address); //Joining the network\r\n bchain=new blockChain(); //Creating the blockchain with genesis block\r\n n.send(bchain.chain.get(0),n.address,n.port); //Transamit this block over the network\r\n db=new Dbconnect();\r\n n.receiveBlock();\r\n db.AddBlockToDB(bchain.chain.get(0)); //Add this block to database\r\n \r\n /*\r\n Getting login to your wallet\r\n */\r\n Scanner in=new Scanner(System.in);\r\n System.out.println(\"Welcome to Wallet\\nPlease Enter Your UserID \");\r\n String userId=in.next();\r\n in.nextLine();\r\n boolean flag=walletsHash.containsKey(userId);\r\n if(flag)\r\n {\r\n System.out.println(\"Enter Password\");\r\n String password=in.next();\r\n Wallet w=walletsHash.get(userId);\r\n if(w.password.equalsIgnoreCase(password))\r\n {\r\n \r\n \r\n System.out.println(\"Welcome \"+w.name+\" to Wallet\");\r\n int ch;\r\n //Displays the full menu for the user\r\n do\r\n {\r\n System.out.println(\"Select from following operation\\n1.Check Balance\\n2.Send Funds\\n3.Receive Transaction \\n4.Receive Block \\n5.Start mining \\n6.View Blockchain\\n7.Logout\");\r\n Scanner sc=new Scanner(System.in);\r\n ch=sc.nextInt();\r\n sc.nextLine();\r\n switch(ch)\r\n {\r\n //Check wallet balance\r\n case 1:System.out.println(w.name+\" you have \"+w.getBalance()+\"BTC in your Wallet\");\r\n break;\r\n // Send funds to a user on Bitcoin network\r\n case 2:System.out.println(\"Enter Public address of Receiver\");\r\n String receiver=sc.next();\r\n sc.nextLine();\r\n if(walletsHash.containsKey(receiver))\r\n {\r\n System.out.println(\"Enter Amount to be send:\");\r\n float amount=sc.nextFloat();\r\n Transaction t=w.sendFunds(walletsHash.get(receiver).PublicAddress,amount);\r\n if(t.verifiySignature(w.publicKey))\r\n {\r\n t.processTransaction();\r\n System.out.println(\"Tranaction created with transaction id = \"+t.getTransactionId()+\" and transmitted to the Bitcoin network\");\r\n n.send(t,n.address,n.port);\r\n n.receiveTransaction();\r\n }\r\n else\r\n {\r\n System.err.println(\"Signature verification fails!!!!\");\r\n }\r\n }\r\n else\r\n {\r\n System.out.println(\"No Such Receiver exist In Network\");\r\n }\r\n break;\r\n case 3: System.out.println(\"Receiving transaction from network.........\");\r\n Transaction rt=n.receiveTransaction();\r\n System.out.println(rt.toString());\r\n for(TransactionOutput o:rt.outputs)\r\n {\r\n UTXOs.put(o.id, o);\r\n }\r\n for(TransactionInput i:rt.inputs)\r\n {\r\n if(i.UTXO==null)\r\n continue;\r\n UTXOs.remove(i); \r\n }\r\n \r\n db.AddTransactionToDB(rt);\r\n System.out.println(\"Transaction received sucessfully\");\r\n break;\r\n case 4: System.out.println(\"Receiving block from network.........\");\r\n Block b=n.receiveBlock();\r\n if(bchain.isBlockValid(b, difficulty))\r\n {\r\n bchain.addtochain(b);\r\n db.AddBlockToDB(b);\r\n }\r\n else\r\n {\r\n System.err.println(\"Block is not valid\");\r\n }\r\n System.out.println(\"Block received sucessfully\");\r\n break;\r\n case 5: \r\n Block mblock=w.startMining();\r\n System.out.println(\"New mined block created successfully and broadcasted over the network\");\r\n db.AddBlockToDB(mblock);\r\n bchain.addtochain(mblock);\r\n n.send(mblock,n.address,n.port);\r\n n.receiveBlock();\r\n break;\r\n case 6:\r\n bchain.toString();\r\n break;\r\n case 7:\r\n System.out.println(\"Thanks for using this application\\n Have a nice day ^_^\");\r\n break;\r\n default:\r\n System.out.println(\"This option is not valid\\nPlease try again...\");\r\n }\r\n }while(ch!=7); \r\n }\r\n else\r\n {\r\n System.out.println(\"Incorrect Password!!!\\nTry again\");\r\n }\r\n \r\n }\r\n else\r\n {\r\n System.out.println(\"No Such Wallet Exists!!!!!\\nTry Again\");\r\n }\r\n \r\n}", "public Map<String, Integer> getAccountBalances() throws LedgerException {\n Block lastBlock;\n\n try {\n // Retrieve most recent completed block\n lastBlock = getBlock(blockMap.size());\n } catch (LedgerException e) {\n // Catch exception that 'Block does not exist' and throw a more specific error\n throw new LedgerException(\"get account balances\", \"No blocks have been committed yet.\");\n }\n\n // Get accountBalanceMap from the last committed block\n Map<String, Account> accountMap = lastBlock.getBalanceMap();\n\n // Create new map to store values\n Map<String, Integer> accountBalancesMap = new HashMap<String, Integer>();\n\n // Iterate through accounts to retrieve their current balances.\n for (Map.Entry<String, Account> entry : accountMap.entrySet() ) {\n accountBalancesMap.put(entry.getKey(), entry.getValue().getBalance());\n }\n\n return accountBalancesMap;\n }", "public void addBlock(Block block) {\r\n if (null == blocks) {\r\n blocks = new ArrayList<Block>();\r\n }\r\n blocks.add(block);\r\n maxEntries += block.getHowMany();\r\n }", "@Test\n\tpublic void orphanBlock()\n\t{\n\t\tDBSet databaseSet = DBSet.createEmptyDatabaseSet();\n\t\t\t\t\t\t\t\t\t\t\n\t\t//PROCESS GENESISBLOCK\n\t\tGenesisBlock genesisBlock = new GenesisBlock();\n\t\tgenesisBlock.process(databaseSet);\n\t\t\t\t\t\t\t\t\t\t\n\t\t//CREATE KNOWN ACCOUNT\n\t\tbyte[] seed = Crypto.getInstance().digest(\"test\".getBytes());\n\t\tbyte[] privateKey = Crypto.getInstance().createKeyPair(seed).getA();\n\t\tPrivateKeyAccount generator = new PrivateKeyAccount(privateKey);\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t//PROCESS GENESIS TRANSACTION TO MAKE SURE GENERATOR HAS FUNDS\n\t\tTransaction transaction = new GenesisTransaction(generator, BigDecimal.valueOf(1000).setScale(8), NTP.getTime());\n\t\ttransaction.process(databaseSet);\n\t\t\t\t\t\t\t\t\n\t\t//GENERATE NEXT BLOCK\n\t\tBlockGenerator blockGenerator = new BlockGenerator();\n\t\tBlock block = blockGenerator.generateNextBlock(databaseSet, generator, genesisBlock);\n\t\t\n\t\t//FORK\n\t\tDBSet fork = databaseSet.fork();\n\t\t\n\t\t//GENERATE PAYMENT 1\n\t\tAccount recipient = new Account(\"XUi2oga2pnGNcZ9es6pBqxydtRZKWdkL2g\");\n\t\tlong timestamp = block.getTimestamp();\n\t\tbyte[] signature = PaymentTransaction.generateSignature(databaseSet, generator, recipient, BigDecimal.valueOf(100).setScale(8), BigDecimal.valueOf(1).setScale(8), timestamp);\n\t\tTransaction payment1 = new PaymentTransaction(generator, recipient, BigDecimal.valueOf(100).setScale(8), BigDecimal.valueOf(1).setScale(8), timestamp, generator.getLastReference(databaseSet), signature);\n\t\tpayment1.process(fork);\n\t\tblock.addTransaction(payment1);\t\n\t\t\n\t\t//GENERATE PAYMENT 2\n\t\tAccount recipient2 = new Account(\"XLPYYfxKEiDcybCkFA7jXcxSdePMMoyZLt\");\n\t\tsignature = PaymentTransaction.generateSignature(fork, generator, recipient2, BigDecimal.valueOf(100).setScale(8), BigDecimal.valueOf(1).setScale(8), timestamp);\n\t\tTransaction payment2 = new PaymentTransaction(generator, recipient2, BigDecimal.valueOf(100).setScale(8), BigDecimal.valueOf(1).setScale(8), timestamp, generator.getLastReference(fork), signature);\n\t\tblock.addTransaction(payment2);\t\n\t\t\n\t\t//ADD TRANSACTION SIGNATURE\n\t\tbyte[] transactionsSignature = blockGenerator.calculateTransactionsSignature(block, generator);\n\t\tblock.setTransactionsSignature(transactionsSignature);\n\t\t\n\t\t//CHECK VALID\n\t\tassertEquals(true, block.isSignatureValid());\n\t\tassertEquals(true, block.isValid(databaseSet));\n\t\t\n\t\t//PROCESS BLOCK\n\t\tblock.process(databaseSet);\n\t\t\n\t\t//ORPHAN BLOCK\n\t\tblock.orphan(databaseSet);\n\t\t\n\t\t//CHECK BALANCE GENERATOR\n\t\tassertEquals(true, generator.getConfirmedBalance(databaseSet).compareTo(BigDecimal.valueOf(1000)) == 0);\n\t\t\n\t\t//CHECK LAST REFERENCE GENERATOR\n\t\tassertEquals(true, Arrays.equals(generator.getLastReference(databaseSet), transaction.getSignature()));\n\t\t\n\t\t//CHECK BALANCE RECIPIENT\n\t\tassertEquals(true, recipient.getConfirmedBalance(databaseSet).compareTo(BigDecimal.valueOf(1000)) == 0);\n\t\t\n\t\t//CHECK LAST REFERENCE RECIPIENT\n\t\tassertEquals(false, Arrays.equals(recipient.getLastReference(databaseSet), payment1.getSignature()));\n\t\t\n\t\t//CHECK BALANCE RECIPIENT2\n\t\tassertEquals(true, recipient2.getConfirmedBalance(databaseSet).compareTo(BigDecimal.valueOf(0)) == 0);\n\t\t\t\t\n\t\t//CHECK LAST REFERENCE RECIPIENT\n\t\tassertEquals(true, Arrays.equals(recipient2.getLastReference(databaseSet), new byte[0]));\n\t\t\n\t\t//CHECK LAST BLOCK\n\t\tassertEquals(true, Arrays.equals(genesisBlock.getSignature(), databaseSet.getBlockMap().getLastBlock().getSignature()));\n\t}", "public void addBlock(Block block) {\n\t\tblock.setId(this.generateID());\n\t\tthis.blocks.put(block.getId(), block);\n\t}", "public static void main(String[] args) {\n\r\n\t\t\r\n\t\tArrayList<Block> blockChain = new ArrayList<Block>();\r\n\t\t\r\n\t\tString[] initialValues = {\"Linus has 700 Euro\", \"Florian has 500 Euro\"};\r\n\t\tBlock firstblock = new Block(initialValues, 0);\r\n\t\tblockChain.add(firstblock);\r\n\t\tSystem.out.println(\"Erster Block ist \" + firstblock.toString());\r\n\t\tSystem.out.println(\"Die block chain ist\" + blockChain.toString());\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\tString[] payBlock = {\"Florian gives Linus 400 Euro\", \"Thomas buy 800 Euro\"};\r\n\t\tBlock secondblock = new Block(payBlock, firstblock.getBlockHash());\r\n\t\tblockChain.add(secondblock);\r\n\t\tSystem.out.println(\"Zweiter Block ist \" + secondblock.toString());\r\n\t\tSystem.out.println(\"Die block chain ist\" + blockChain.toString());\r\n\t\t\r\n\t\tString[] payBack = {\"Linus gives Florian 400 Euro\"};\r\n\t\tBlock thirdblock = new Block(payBack, secondblock.getBlockHash());\r\n\t\tblockChain.add(thirdblock);\r\n\t\tSystem.out.println(\"Zweiter Block ist \" + thirdblock.toString());\r\n\t\tSystem.out.println(\"Die block chain ist\" + blockChain.toString());\r\n\t\t\r\n\t}", "public void addBlock(Block b) {\n String previousHash = \"\";\n if (blockChain.size() == 0) {\n previousHash = \"\";\n } else {\n previousHash = getLatestBlock().proofOfWork();\n }\n b.previousHash = previousHash;\n chainHash = b.proofOfWork();\n blockChain.add(b);\n }", "public boolean checkLegitTrans(JsonObject block){\n HashMap<String, Integer> balance = compute_balance(block);\n return Update_by_block(balance, block);\n }", "@Test\n\tpublic void validateSignatureBlock()\n\t{\n\t\tDBSet databaseSet = DBSet.createEmptyDatabaseSet();\n\t\t\t\t\n\t\t//PROCESS GENESISBLOCK\n\t\tGenesisBlock genesisBlock = new GenesisBlock();\n\t\tgenesisBlock.process(databaseSet);\n\t\t\t\t\n\t\t//CREATE KNOWN ACCOUNT\n\t\tbyte[] seed = Crypto.getInstance().digest(\"test\".getBytes());\n\t\tbyte[] privateKey = Crypto.getInstance().createKeyPair(seed).getA();\n\t\tPrivateKeyAccount generator = new PrivateKeyAccount(privateKey);\n\t\t\t\t\t\t\n\t\t//PROCESS GENESIS TRANSACTION TO MAKE SURE GENERATOR HAS FUNDS\n\t\tTransaction transaction = new GenesisTransaction(generator, BigDecimal.valueOf(1000).setScale(8), NTP.getTime());\n\t\ttransaction.process(databaseSet);\n\t\t\t\t\n\t\t//GENERATE NEXT BLOCK\n\t\tBlockGenerator blockGenerator = new BlockGenerator();\n\t\tBlock newBlock = blockGenerator.generateNextBlock(databaseSet, generator, genesisBlock);\n\t\t\n\t\t//ADD TRANSACTION SIGNATURE\n\t\tbyte[] transactionsSignature = Crypto.getInstance().sign(generator, newBlock.getGeneratorSignature());\n\t\tnewBlock.setTransactionsSignature(transactionsSignature);\n\t\t\n\t\t//CHECK IF SIGNATURE VALID\n\t\tassertEquals(true, newBlock.isSignatureValid());\n\t\t\n\t\t//INVALID TRANSACTION SIGNATURE\n\t\ttransactionsSignature = new byte[64];\n\t\tnewBlock.setTransactionsSignature(transactionsSignature);\n\t\t\n\t\t//CHECK IF SIGNATURE INVALID\n\t\tassertEquals(false, newBlock.isSignatureValid());\n\t\t\n\t\t//INVALID GENERATOR SIGNATURE\n\t\tnewBlock = BlockFactory.getInstance().create(newBlock.getVersion(), newBlock.getReference(), newBlock.getTimestamp(), newBlock.getGeneratingBalance(), generator, new byte[32]);\n\t\ttransactionsSignature = Crypto.getInstance().sign(generator, newBlock.getGeneratorSignature());\n\t\tnewBlock.setTransactionsSignature(transactionsSignature);\n\t\t\n\t\t///CHECK IF SIGNATURE INVALID\n\t\tassertEquals(false, newBlock.isSignatureValid());\n\t\t\n\t\t//VALID TRANSACTION SIGNATURE\n\t\tnewBlock = blockGenerator.generateNextBlock(databaseSet, generator, genesisBlock);\t\n\t\t\n\t\t//ADD TRANSACTION\n\t\tAccount recipient = new Account(\"XUi2oga2pnGNcZ9es6pBqxydtRZKWdkL2g\");\n\t\tlong timestamp = newBlock.getTimestamp();\n\t\tbyte[] signature = PaymentTransaction.generateSignature(databaseSet, generator, recipient, BigDecimal.valueOf(100).setScale(8), BigDecimal.valueOf(1).setScale(8), timestamp);\n\t\tTransaction payment = new PaymentTransaction(generator, recipient, BigDecimal.valueOf(100).setScale(8), BigDecimal.valueOf(1).setScale(8), timestamp, generator.getLastReference(databaseSet), signature);\n\t\tnewBlock.addTransaction(payment);\n\t\t\n\t\t//ADD TRANSACTION SIGNATURE\n\t\ttransactionsSignature = blockGenerator.calculateTransactionsSignature(newBlock, generator);\n\t\tnewBlock.setTransactionsSignature(transactionsSignature);\n\t\t\n\t\t//CHECK VALID TRANSACTION SIGNATURE\n\t\tassertEquals(true, newBlock.isSignatureValid());\t\n\t\t\n\t\t//INVALID TRANSACTION SIGNATURE\n\t\tnewBlock = blockGenerator.generateNextBlock(databaseSet, generator, genesisBlock);\t\n\t\t\n\t\t//ADD TRANSACTION\n\t\tpayment = new PaymentTransaction(generator, recipient, BigDecimal.valueOf(200).setScale(8), BigDecimal.valueOf(1).setScale(8), timestamp, generator.getLastReference(databaseSet), signature);\n\t\tnewBlock.addTransaction(payment);\n\t\t\t\t\n\t\t//ADD TRANSACTION SIGNATURE\n\t\ttransactionsSignature = blockGenerator.calculateTransactionsSignature(newBlock, generator);\n\t\tnewBlock.setTransactionsSignature(transactionsSignature);\n\t\t\n\t\t//CHECK INVALID TRANSACTION SIGNATURE\n\t\tassertEquals(false, newBlock.isSignatureValid());\t\n\t}", "public void addBlock(Block block){\n\t\tblocks.addElement(block);\n\t}", "Block saveBlock(Block block) throws BlockExistsException;", "void updateBlock(Block block) ;", "@Override\n\tpublic void addBlock(Block block) {\n\t\tem.persist(block);\n\t}", "public void balance(){\n\t\tnamesTree.balance();\n\t\taccountNumbersTree.balance();\n\t}", "private static void depositAmount(String format, Bank bank, String username) {\n\n\t\tObjectOutputStream oos = null;\n\t\tString outputFile = \"resource/Transactions.txt\";\n\n\t\ttry {\n\t\t\toos = new ObjectOutputStream(new FileOutputStream(outputFile));\n\t\t\tbank.transactions.add(0, format);\n\n//\t\t\tfor (String t:bank.transactions)\n\t\t\toos.writeObject(bank.transactions);\n\t\t\toos.close();\n\t\t\tSystem.out.println(\"serilization is done\");\n\t\t}\n\n\t\tcatch (Exception e) {\n\t\t\te.printStackTrace();\n\n\t\t} finally {\n\t\t\tif (oos != null)\n\t\t\t\ttry {\n\t\t\t\t\toos.close();\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tSystem.out.println();\n\t\t\t\t}\n\n\t\t}\n\n\t}", "public void ProtectMe(Block block){\n \tplugin.getProtect().add(block);\r\n \t\t//run the timer to load the block\r\n \t\r\n \tif(plugin.getTreeprotect_Timer().getPoolSize() < plugin.getTreeprotect_Timer().getMaximumPoolSize()){\r\n \t\tplugin.getTreeprotect_Timer().schedule(new Runnable() {\r\n \t\t\t\tpublic void run() {\r\n \t\t\t\t\tif(!(plugin.getProtect().isEmpty())){\r\n \t\t\t\t\t\t//remove it from the list\r\n \t\t\t\t\t\tplugin.getProtect().remove(0);\r\n \t\t\t\t\t}\r\n \t\t\t\t}\r\n \t\t\t}, plugin.getProtectTime(), TimeUnit.MILLISECONDS);\r\n \t}\r\n \t}", "public void addBlock(Block block) {\n this.blocks.add(block);\n }", "public void putBlock(JsonObject block){\n blocks.put(Hash.getHashString(block.toString()), block);\n }", "public BlockChain() {\n this.blockChain = new ArrayList<>();\n this.chainHash = \"\";\n }", "public void blockAdded(Response block) {\n try {\n long id = block.getId(\"block\");\n blockList.add(0, block);\n blockMap.put(block.getId(\"block\"), block);\n fireTableRowsInserted(0, 0);\n } catch (IdentifierException exc) {\n // Ignore the block\n }\n }", "Block createBlock();", "public void parse(String blockName) throws IllegalArgumentException {\n String copy = \"\";\n if (implicitMain && !\"main\".equals(blockName) && !blockName.startsWith(\"main.\")) {\n blockName = \"main.\" + blockName;\n }\n try {\n copy = blocks.get(blockName).toString();\n } catch (NullPointerException e) {\n if (!this.failSilently) {\n throw new IllegalArgumentException(\n \"Block '\" + blockName + \"' not found.\" +\n \" Matches \" + locateBlock(blockName));\n }\n }\n //pattern = Pattern.compile(\"\\\\{([\\\\w\\\\.]+)\\\\}\");\n Matcher matcher = pattern.matcher(copy);\n //blockPattern = Pattern.compile(\"_BLOCK_\\\\.(.+)\");\n for (Matcher matcher2; matcher.find(); ) {\n String match = matcher.group(1);\n matcher2 = blockPattern.matcher(match);\n if (matcher2.find()) {\n if (parsedBlocks.containsKey(matcher2.group(1))) {\n copy = copy.replaceFirst(\"\\\\{\" + match + \"\\\\}\", escape(\n parsedBlocks.get(matcher2.group(1)).toString()));\n } else {\n copy = copy.replaceFirst(\"\\\\{\" + match + \"\\\\}\", \"\");\n }\n } else {\n if (vars.containsKey(match)) {\n copy = copy.replaceFirst(\"\\\\{\" + match + \"\\\\}\", escape(\n vars.get(match).toString()));\n } else {\n // Leave unchanged because it might be wanted in output.\n // Can always be removed by assigning empty value.\n //copy = copy.replaceFirst(\"\\\\{\"+match+\"\\\\}\", \"\");\n }\n }\n }\n if (parsedBlocks.containsKey(blockName)) {\n parsedBlocks.put(blockName, parsedBlocks.get(blockName) + copy);\n } else {\n parsedBlocks.put(blockName, copy);\n }\n if (subBlocks.containsKey(blockName)) {\n parsedBlocks.put(subBlocks.get(blockName), \"\");\n }\n }", "public void applyTransaction(Transaction tx, byte[] coinbase) {\n\t\tif (blockchain != null)\n\t\t\tblockchain.addWalletTransaction(tx);\n\n\t\t// TODO: what is going on with simple wallet transfer ?\n\n\t\t// 1. VALIDATE THE NONCE\n\t\tbyte[] senderAddress = tx.getSender();\n\n\t\tAccountState senderAccount = repository.getAccountState(senderAddress);\n\n\t\tif (senderAccount == null) {\n\t\t\tif (stateLogger.isWarnEnabled())\n\t\t\t\tstateLogger.warn(\"No such address: {}\",\n\t\t\t\t\t\tHex.toHexString(senderAddress));\n\t\t\treturn;\n\t\t}\n\n\t\tBigInteger nonce = repository.getNonce(senderAddress);\n\t\tif (nonce.compareTo(new BigInteger(tx.getNonce())) != 0) {\n\t\t\tif (stateLogger.isWarnEnabled())\n\t\t\t\tstateLogger.warn(\"Invalid nonce account.nonce={} tx.nonce={}\",\n\t\t\t\t\t\tnonce.longValue(), new BigInteger(tx.getNonce()));\n\t\t\treturn;\n\t\t}\n\n\t\t// 2.1 PERFORM THE GAS VALUE TX\n\t\t// (THIS STAGE IS NOT REVERTED BY ANY EXCEPTION)\n\n\t\t// first of all debit the gas from the issuer\n\t\tBigInteger gasDebit = tx.getTotalGasValueDebit();\n\n\t\t// The coinbase get the gas cost\n\t\trepository.addBalance(coinbase, gasDebit);\n\n\t\tbyte[] contractAddress;\n\n\t\t// Contract creation or existing Contract call\n\t\tif (tx.isContractCreation()) {\n\n\t\t\t// credit the receiver\n\t\t\tcontractAddress = tx.getContractAddress();\n\t\t\trepository.createAccount(contractAddress);\n\t\t\tstateLogger.info(\"New contract created address={}\",\n\t\t\t\t\tHex.toHexString(contractAddress));\n\t\t} else {\n\n\t\t\tcontractAddress = tx.getReceiveAddress();\n\t\t\tAccountState receiverState = repository.getAccountState(tx\n\t\t\t\t\t.getReceiveAddress());\n\n\t\t\tif (receiverState == null) {\n\t\t\t\trepository.createAccount(tx.getReceiveAddress());\n\t\t\t\tif (stateLogger.isInfoEnabled())\n\t\t\t\t\tstateLogger.info(\"New account created address={}\",\n\t\t\t\t\t\t\tHex.toHexString(tx.getReceiveAddress()));\n\t\t\t}\n\t\t}\n\n\t\t// 2.2 UPDATE THE NONCE\n\t\t// (THIS STAGE IS NOT REVERTED BY ANY EXCEPTION)\n\t\tBigInteger balance = repository.getBalance(senderAddress);\n\t\tif (balance.compareTo(BigInteger.ZERO) == 1) {\n\t\t\trepository.increaseNonce(senderAddress);\n\n\t\t\tif (stateLogger.isInfoEnabled())\n\t\t\t\tstateLogger.info(\n\t\t\t\t\t\t\"Before contract execution the sender address debit with gas total cost, \"\n\t\t\t\t\t\t\t\t+ \"\\n sender={} \\n gas_debit= {}\",\n\t\t\t\t\t\tHex.toHexString(tx.getSender()), gasDebit);\n\t\t}\n\n\t\t// actual gas value debit from the sender\n\t\t// the purchase gas will be available for the\n\t\t// contract in the execution state, and\n\t\t// can be validate using GAS op\n\t\tif (gasDebit.signum() == 1) {\n\t\t\tif (balance.compareTo(gasDebit) == -1) {\n\t\t\t\tlogger.info(\"No gas to start the execution: sender={}\",\n\t\t\t\t\t\tHex.toHexString(tx.getSender()));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\trepository.addBalance(senderAddress, gasDebit.negate());\n\t\t}\n\n\t\t// 3. START TRACKING FOR REVERT CHANGES OPTION !!!\n\t\tRepository trackRepository = repository.getTrack();\n\t\ttrackRepository.startTracking();\n\n\t\ttry {\n\n\t\t\t// 4. THE SIMPLE VALUE/BALANCE CHANGE\n\t\t\tif (tx.getValue() != null) {\n\n\t\t\t\tBigInteger senderBalance = repository.getBalance(senderAddress);\n\t\t\t\tBigInteger contractBalance = repository.getBalance(contractAddress);\n\n\t\t\t\tif (senderBalance.compareTo(new BigInteger(1, tx.getValue())) >= 0) {\n\n\t\t\t\t\trepository.addBalance(contractAddress,\n\t\t\t\t\t\t\tnew BigInteger(1, tx.getValue()));\n\t\t\t\t\trepository.addBalance(senderAddress,\n\t\t\t\t\t\t\tnew BigInteger(1, tx.getValue()).negate());\n\n\t\t\t\t\tif (stateLogger.isInfoEnabled())\n\t\t\t\t\t\tstateLogger.info(\"Update value balance \\n \"\n\t\t\t\t\t\t\t\t+ \"sender={}, receiver={}, value={}\",\n\t\t\t\t\t\t\t\tHex.toHexString(senderAddress),\n\t\t\t\t\t\t\t\tHex.toHexString(contractAddress),\n\t\t\t\t\t\t\t\tnew BigInteger(tx.getValue()));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// 3. FIND OUT WHAT IS THE TRANSACTION TYPE\n\t\t\tif (tx.isContractCreation()) {\n\n\t\t\t\tbyte[] initCode = tx.getData();\n\n\t\t\t\tBlock lastBlock = blockchain.getLastBlock();\n\n\t\t\t\tProgramInvoke programInvoke = ProgramInvokeFactory\n\t\t\t\t\t\t.createProgramInvoke(tx, lastBlock, trackRepository);\n\n\t\t\t\tif (logger.isInfoEnabled())\n\t\t\t\t\tlogger.info(\"running the init for contract: addres={}\",\n\t\t\t\t\t\t\tHex.toHexString(tx.getContractAddress()));\n\n\t\t\t\tVM vm = new VM();\n\t\t\t\tProgram program = new Program(initCode, programInvoke);\n\t\t\t\tvm.play(program);\n\t\t\t\tProgramResult result = program.getResult();\n\t\t\t\tapplyProgramResult(result, gasDebit, trackRepository,\n\t\t\t\t\t\tsenderAddress, tx.getContractAddress(), coinbase);\n\n\t\t\t} else {\n\n\t\t\t\tbyte[] programCode = trackRepository.getCode(tx\n\t\t\t\t\t\t.getReceiveAddress());\n\t\t\t\tif (programCode != null) {\n\n\t\t\t\t\tBlock lastBlock = blockchain.getLastBlock();\n\n\t\t\t\t\tif (logger.isInfoEnabled())\n\t\t\t\t\t\tlogger.info(\"calling for existing contract: addres={}\",\n\t\t\t\t\t\t\t\tHex.toHexString(tx.getReceiveAddress()));\n\n\t\t\t\t\tProgramInvoke programInvoke = ProgramInvokeFactory\n\t\t\t\t\t\t\t.createProgramInvoke(tx, lastBlock, trackRepository);\n\n\t\t\t\t\tVM vm = new VM();\n\t\t\t\t\tProgram program = new Program(programCode, programInvoke);\n\t\t\t\t\tvm.play(program);\n\n\t\t\t\t\tProgramResult result = program.getResult();\n\t\t\t\t\tapplyProgramResult(result, gasDebit, trackRepository,\n\t\t\t\t\t\t\tsenderAddress, tx.getReceiveAddress(), coinbase);\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (RuntimeException e) {\n\t\t\ttrackRepository.rollback();\n\t\t\treturn;\n\t\t}\n\t\ttrackRepository.commit();\n\t\tpendingTransactions.put(Hex.toHexString(tx.getHash()), tx);\n\t}", "Block getBlock(String congName, String blockName, String blockNumber);", "public static BlockRecord toXMLForExistingRecord(String input, int pnum) {\n \n int UnverifiedBlockPort;\n int BlockChainPort;\n UnverifiedBlockPort = 4710 + pnum;\n BlockChainPort = 4820 + pnum;\n try {\n String[] tokens = new String[20];\n String stringXML;\n String InputLineStr;\n String suuid;\n UUID idA;\n BlockRecord[] blockArray = new BlockRecord[20];\n\n JAXBContext jaxbContext = JAXBContext.newInstance(BlockRecord.class);\n Marshaller jaxbMarshaller = jaxbContext.createMarshaller();\n StringWriter sw = new StringWriter();\n jaxbMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);\n int n = 0;\n \n //building the block\n blockArray[n] = new BlockRecord();\n blockArray[n].setABlockNum(input.substring(input.indexOf(\"<ABlockNum>\") + 11, input.indexOf(\"</ABlockNum>\")));\n blockArray[n].setACreatingProcess(\"Process\" + Integer.toString(pnum));\n blockArray[n].setASHA256String(input.substring(input.indexOf(\"<ASHA256String>\") + 15, input.indexOf(\"</ASHA256String>\")));\n blockArray[n].setASignedSHA256(input.substring(input.indexOf(\"<ASignedSHA256>\") + 15, input.indexOf(\"</ASignedSHA256>\")));\n blockArray[n].setAVerificationProcessID(Integer.toString(pnum));\n blockArray[n].setTimestamp(input.substring(input.indexOf(\"<ATimestamp>\") + 12, input.indexOf(\"</ATimestamp>\")));\n blockArray[n].setFSSNum(input.substring(input.indexOf(\"<FSSNum>\") + 8, input.indexOf(\"</FSSNum>\")));\n blockArray[n].setFFname(input.substring(input.indexOf(\"<FFname>\") + 8, input.indexOf(\"</FFname>\")));\n blockArray[n].setFLname(input.substring(input.indexOf(\"<FLname>\") + 8, input.indexOf(\"</FLname>\")));\n blockArray[n].setFDOB(input.substring(input.indexOf(\"<FDOB>\") + 6, input.indexOf(\"</FDOB>\")));\n blockArray[n].setGDiag(input.substring(input.indexOf(\"<GDiag>\") + 7, input.indexOf(\"</GDiag>\")));\n blockArray[n].setGTreat(input.substring(input.indexOf(\"<GTreat>\") + 8, input.indexOf(\"</GTreat>\")));\n blockArray[n].setGRx(input.substring(input.indexOf(\"<GRx>\") + 5, input.indexOf(\"</GRx>\")));\n \n // Generate a new block ID\n idA = UUID.randomUUID();\n suuid = new String(UUID.randomUUID().toString());\n blockArray[n].setABlockID(suuid);\n stringXML = sw.toString();\n for (int i = 0; i < n; i++) {\n jaxbMarshaller.marshal(blockArray[i], sw);\n }\n String fullBlock = sw.toString();\n String XMLHeader = \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"yes\\\"?>\";\n String cleanBlock = fullBlock.replace(XMLHeader, \"\");\n String XMLBlock = XMLHeader + \"\\n<BlockLedger>\" + cleanBlock + \"</BlockLedger>\";\n System.out.println(XMLBlock);\n return blockArray[n];\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n \n return null;\n }", "@Override\n\tpublic void processTransaction(Transaction transactionObject) {\n\t\t\n\t\ttrasactionList.addLast(transactionObject);\n\t\t\n\t\tif ( transactionObject.getTransactionType() == 'C'){\n\t\t\t\n\t\t\tbalance -= transactionObject.getTransactionAmount(); \n\t\t\t\n\t\t}\n\t\t\n\t\telse if ( transactionObject.getTransactionType() == 'D'){\n\t\t\t\n\t\t\tbalance += transactionObject.getTransactionAmount(); \n\t\t}\n\t}", "public void addLast(MemoryBlock block) {\n\t\tNode clone = head.previous; \n\t\tNode newNode = new Node(block);\n\t\tnewNode.previous = clone;\n\t\tnewNode.next = head;\n\t\thead.previous = newNode;\n\t\tclone.next = newNode;\n\t\tsize++;\n\t}", "public void addPendingBlock(Block block) {\n\n\t\tList<Block> sameIndexBlocks = pendingBlocks.get(block.getIndex());\n\t\tif(sameIndexBlocks == null) {\n\t\t\tsameIndexBlocks = new ArrayList<Block>();\n\t\t\tpendingBlocks.put(block.getIndex(), sameIndexBlocks);\n\t\t}\n\t\tsameIndexBlocks.add(block);\n\t}", "protected void readBlock(BlockMetadata blockMetadata) throws IOException\n {\n readerContext.initialize(stream, blockMetadata, consecutiveBlock);\n ReaderContext.Entity entity;\n while ((entity = readerContext.next()) != null) {\n\n counters.getCounter(ReaderCounterKeys.BYTES).add(entity.getUsedBytes());\n\n byte[] record = entity.getRecord();\n\n if (record != null) {\n counters.getCounter(ReaderCounterKeys.RECORDS).increment();\n records.emit(record);\n }\n }\n }", "@Override\n public void createBlockchain(String name, Block genesisBlock) {\n BlockNodeEntity blockNodeEntity = getBlockNodeEntity(name, genesisBlock);\n blockRepository.save(blockNodeEntity);\n }", "public static BlockRecord toXML(String input, int pnum) {\n \t\n String toReturn = \"\";\n int UnverifiedBlockPort;\n int BlockChainPort;\n UnverifiedBlockPort = 4710 + pnum;\n BlockChainPort = 4820 + pnum;\n\n System.out.println(\"Process number: \" + pnum + \" Ports: \" + UnverifiedBlockPort + \" \" +\n BlockChainPort + \"\\n\");\n\n try {\n String[] tokens = new String[10];\n String stringXML;\n String InputLineStr;\n String suuid;\n UUID idA;\n BlockRecord[] blockArray = new BlockRecord[20];\n JAXBContext jaxbContext = JAXBContext.newInstance(BlockRecord.class);\n Marshaller jaxbMarshaller = jaxbContext.createMarshaller();\n StringWriter sw = new StringWriter();\n jaxbMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);\n\n int n = 0;\n blockArray[n] = new BlockRecord();\n blockArray[n].setASHA256String(\"SHA string goes here...\");\n blockArray[n].setASignedSHA256(\"Signed SHA string goes here...\");\n\n idA = UUID.randomUUID();\n suuid = new String(UUID.randomUUID().toString());\n blockArray[n].setABlockID(suuid);\n blockArray[n].setACreatingProcess(\"Process\" + Integer.toString(pnum));\n blockArray[n].setAVerificationProcessID(\"To be set later...\");\n tokens = input.split(\" +\"); \n \n //build the block\n blockArray[n].setTimestamp(tokens[iTIME]);\n blockArray[n].setFSSNum(tokens[iSSNUM]);\n blockArray[n].setFFname(tokens[iFNAME]);\n blockArray[n].setFLname(tokens[iLNAME]);\n blockArray[n].setFDOB(tokens[iDOB]);\n blockArray[n].setGDiag(tokens[iDIAG]);\n blockArray[n].setGTreat(tokens[iTREAT]);\n blockArray[n].setGRx(tokens[iRX]);\n \n stringXML = sw.toString();\n for (int i = 0; i < n; i++) {\n jaxbMarshaller.marshal(blockArray[i], sw);\n }\n String fullBlock = sw.toString();\n String XMLHeader = \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"yes\\\"?>\";\n String cleanBlock = fullBlock.replace(XMLHeader, \"\");\n String XMLBlock = XMLHeader + \"\\n<BlockLedger>\" + cleanBlock + \"</BlockLedger>\";\n System.out.println(XMLBlock);\n return blockArray[n];\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n \n return null;\n\n }", "private void releaseBlockedBalances(int blockNumber) {\n int key = blockNumber - Blockchain.REQUIRED_BLOCK_CONFIRMATIONS;\n Account account = minerMap.get(key);\n if (account != null) {\n double sumToUnlock = Blockchain.BLOCK_REWARD;\n Block block = blockMap.get(blockNumber);\n\n if (block != null) {\n for (Transaction transaction : block.getTransactions()) {\n sumToUnlock += transaction.getTransactionFee();\n }\n blockMap.remove(blockNumber);\n }\n account.unlockBalance(sumToUnlock);\n minerMap.remove(blockNumber);\n }\n }", "public boolean checkNewTrans(JsonObject block){\n \tJsonArray transactions = block.get(\"Transactions\").getAsJsonArray();\n \tint N = transactions.size();\n \tfor (int i=0; i<N; i++) {\n \t\tJsonObject Tx = transactions.get(i).getAsJsonObject();\n \t\tif (TxPool_used.contains(Tx))\n \t\t\treturn false;\n }\n return true;\n }", "public static void main(String[] args) throws NoSuchAlgorithmException,\n SignatureException, InvalidKeyException {\n Random random = new Random();\n int numBitsKeyPair = 512;\n KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance(\"RSA\");\n keyPairGenerator.initialize(numBitsKeyPair);\n KeyPair scroogeKeyPair = keyPairGenerator.genKeyPair();\n KeyPair aliceKeyPair = keyPairGenerator.genKeyPair();\n KeyPair bobKeyPair = keyPairGenerator.genKeyPair();\n\n // Always create genesis block first\n Block genesis = new Block(null, scroogeKeyPair.getPublic()); // new Block (byte[] prevHash, PublicKey address)\n genesis.finalize(); // Computes the message digest/hash\n\n // Then, create blockchain from genesis block\n BlockChain blockchain = new BlockChain(genesis);\n\n // And initialize BlockHandler with \"genesis blockchain\".\n // I personally think that the framework is inkonsistent here.\n // If all access to the blockchain is supposed to be done through the BlockHandler,\n // then the blockchain should be initialized there as well.\n // Anyways, further access to the blockchain is done through the BlockHandler\n BlockHandler blockHandler = new BlockHandler(blockchain);\n\n // Now, let the tests begin!\n\n //***********************************\n // Test 1: Process a block with no transactions\n Block block = new Block(genesis.getHash(), aliceKeyPair.getPublic()); // previous: the genesis block\n block.finalize();\n // Process block immediately without adding any transactions\n if (blockHandler.processBlock(block)) { // basically invokes blockchain.addBlock()\n System.out.println(\"Successfully added valid block. Test 1 is passed.\\n\");\n } else {\n System.out.println(\"Failed to add valid block. Test 1 has failed.\\n\");\n }// again, unit tests are way better than this!\n\n\n //***********************************\n // Test 22: Process a transaction, create a block, process a transaction, create a block, ...\n // For a clean test, recreate the blockchain\n blockchain = new BlockChain(genesis);\n blockHandler = new BlockHandler(blockchain);\n\n boolean testIsPassed = true;\n\n // some transaction to play with\n Transaction transaction;\n Signature signature = Signature.getInstance(\"SHA256withRSA\");\n // start with a successor of the genesis block\n Block previousBlock = genesis;\n\n for (int i = 0; i < 20; i++) {\n // create a new transaction in every round\n transaction = new Transaction();\n // every block consists of its hash, a hash of the previous block,\n // exactly one coinbase transaction and a list of other transactions.\n // here, we only want to reassign the coinbase transaction\n transaction.addInput(previousBlock.getCoinbase().getHash(), 0); // addInput(byte[] prevTxHash, int outputIndex)\n\n // let's assign all outputs of all transactions to scrooge\n // I personally would prefer a getter here for the coinbase\n transaction.addOutput(Block.COINBASE, scroogeKeyPair.getPublic()); // transaction.addOutput(double value, PublicKey address)\n signature.initSign(scroogeKeyPair.getPrivate());\n signature.update(transaction.getRawDataToSign(0));\n transaction.addSignature(signature.sign(), 0);\n transaction.finalize(); // Computes the message digest/hash\n\n blockHandler.processTx(transaction); // basically invokes blockchain.addTransaction() that adds transaction to the transaction pool\n\n // so far, we have created a valid transaction that should be available in the transaction pool\n // so let's try to create a block from it\n Block newBlock = blockHandler.createBlock(scroogeKeyPair.getPublic());\n testIsPassed = testIsPassed &&\n newBlock != null &&\n newBlock.getPrevBlockHash().equals(previousBlock.getHash()) &&\n newBlock.getTransactions().size() == 1 &&\n newBlock.getTransaction(0).equals(transaction);\n\n if (!testIsPassed) {\n System.out.println(i + \"Failed to add block with valid transaction. Test 22 has failed.\\n\");\n return;\n }\n previousBlock = newBlock;\n }\n System.out.println(\"Successfully added blocks with valid transactions. Test 22 is passed.\\n\");\n }", "private void parseBankAccount(String[] info, Account account) {\n BankTracker b = new BankTracker(info[2], Float.parseFloat(info[1]), LocalDate.parse(info[3]),\n Double.parseDouble(info[4]));\n account.getBankTrackerList().add(b);\n }", "public Integer getAccountBalance(String address) throws LedgerException {\n // Convenience variable for throwing exceptions\n String action = \"get account balance\";\n\n Account account;\n Block lastBlock;\n\n try {\n // Retrieve most recent completed block\n lastBlock = getBlock(blockMap.size());\n } catch (LedgerException e) {\n // Catch 'Block does not exist' and throw more specific exception\n throw new LedgerException(action, \"No blocks have been commited yet.\");\n }\n\n // If the account does not exist, throw an Exception\n if ( (account = lastBlock.getAccount(address)) == null ) {\n throw new LedgerException(action, \"Account does not exist.\");\n }\n\n return account.getBalance();\n }", "private void parseTransactions(List<Transaction> transactions) {\n transactions.forEach(transaction -> {\n Account senderAccount = getAccount(transaction.getSender());\n Account receiverAccount = getAccount(transaction.getReceiver());\n senderAccount.addOutgoingTransaction(transaction);\n receiverAccount.addIncomingTransaction(transaction);\n });\n }", "public static void addDespawningBlock(Block block, int seconds) {\n FileConfiguration config = MyZ.instance.getBlocksConfig();\n ConfigurationSection section = config.createSection(block.getWorld().getName() + \"_\" + block.getX() + \"_\" + block.getY() + \"_\"\n + block.getZ());\n section.set(\"respawn\", false);\n section.set(\"type\", block.getType().toString());\n section.set(\"data\", block.getData());\n section.set(\"time\", ticks + seconds);\n MyZ.instance.saveBlocksConfig();\n }", "private void mergeBankStatementLine(FIN_BankStatementLine bsline) {\n BigDecimal totalCredit = bsline.getCramount();\n BigDecimal totalDebit = bsline.getDramount();\n FIN_BankStatement bs = bsline.getBankStatement();\n OBCriteria<FIN_BankStatementLine> obc = OBDal.getInstance().createCriteria(\n FIN_BankStatementLine.class);\n obc.add(Restrictions.eq(FIN_BankStatementLine.PROPERTY_BANKSTATEMENT, bsline.getBankStatement()));\n obc.add(Restrictions.eq(FIN_BankStatementLine.PROPERTY_LINENO, bsline.getLineNo()));\n obc.add(Restrictions.ne(FIN_BankStatementLine.PROPERTY_ID, bsline.getId()));\n obc.add(Restrictions.isNull(FIN_BankStatementLine.PROPERTY_FINANCIALACCOUNTTRANSACTION));\n\n if (obc.list().size() > 0) {\n bs.setProcessed(false);\n OBDal.getInstance().save(bs);\n OBDal.getInstance().flush();\n\n for (FIN_BankStatementLine bsl : obc.list()) {\n totalCredit = totalCredit.add(bsl.getCramount());\n totalDebit = totalDebit.add(bsl.getDramount());\n for (FIN_ReconciliationLineTemp tempbsline : getRecTempLines(bsl)) {\n tempbsline.setBankStatementLine(bsline);\n OBDal.getInstance().save(tempbsline);\n }\n OBDal.getInstance().remove(bsl);\n }\n\n if (totalCredit.compareTo(BigDecimal.ZERO) != 0 && totalDebit.compareTo(BigDecimal.ZERO) != 0) {\n BigDecimal total = totalCredit.subtract(totalDebit);\n if (total.compareTo(BigDecimal.ZERO) == -1) {\n bsline.setCramount(BigDecimal.ZERO);\n bsline.setDramount(total.abs());\n } else {\n bsline.setCramount(total);\n bsline.setDramount(BigDecimal.ZERO);\n }\n } else {\n bsline.setCramount(totalCredit);\n bsline.setDramount(totalDebit);\n }\n\n OBDal.getInstance().save(bsline);\n OBDal.getInstance().flush();\n\n bs.setProcessed(true);\n OBDal.getInstance().save(bs);\n OBDal.getInstance().flush();\n }\n\n }", "public boolean commit() {\n\t\tif (blocks.size() <= 1) return false;\n\n\t\tHashMap<String, Integer> pairMap = new HashMap<String, Integer>();\n\t\tHashMap<Integer, Integer> countMap = new HashMap<Integer, Integer>();\n\n\t\tListIterator<Transaction> iterator = blocks.listIterator();\n\t\twhile (iterator.hasNext()) {\n\t\t\tTransaction block = iterator.next();\n\t\t\tpairMap.putAll((Map<? extends String, ? extends Integer>) block.getNameValue());\n\t\t}\n\n\t\tfor (Entry<String, Integer> entry : pairMap.entrySet()) {\n\t\t\tInteger value = entry.getValue();\n\t\t\tif(countMap.get(value) == null){\n\t\t\t\tcountMap.put(value, new Integer(1));\n\t\t\t}\n\t\t\telse{\n\t\t\t\tcountMap.put(value, new Integer(countMap.get(value) + 1));\n\t\t\t}\n\t\t\tpairMap.put(entry.getKey(),entry.getValue());\n\t\t}\t\t\n\n\t\tblocks = new LinkedList<Transaction>();\n\t\tblocks.add(new Transaction(pairMap, countMap));\n\n\t\treturn true;\n\t}", "private void addBlockAddresses(MemoryBlockDB block, boolean addToAll) {\n\t\tAddress start = block.getStart();\n\t\tAddress end = block.getEnd();\n\t\tif (addToAll) {\n\t\t\tallAddrSet.add(start, end);\n\t\t}\n\t\tif (block.isExternalBlock()) {\n\t\t\taddrSetView.externalBlock.add(start, end);\n\t\t}\n\t\telse if (block.isExecute()) {\n\t\t\taddrSetView.execute.add(start, end);\n\t\t}\n\t\tif (block.isMapped()) {\n\t\t\t// Identify source-blocks which block maps onto and add as a mapped-block to each of these\n\t\t\tAddressRange mappedRange = block.getSourceInfos().get(0).getMappedRange().get();\n\t\t\tfor (MemoryBlockDB b : getBlocks(mappedRange.getMinAddress(),\n\t\t\t\tmappedRange.getMaxAddress())) {\n\t\t\t\tif (!b.isMapped()) {\n\t\t\t\t\tb.addMappedBlock(block);\n\t\t\t\t}\n\t\t\t}\n\t\t\tAddressSet mappedSet = getMappedIntersection(block, addrSetView.initialized);\n\t\t\taddrSetView.initialized.add(mappedSet);\n\t\t\taddrSetView.initializedAndLoaded.add(getMappedIntersection(block, addrSetView.initializedAndLoaded));\n\t\t}\n\t\telse if (block.isInitialized()) {\n\t\t\taddrSetView.initialized.add(block.getStart(), block.getEnd());\n\t\t\tif (block.isLoaded()) {\n\t\t\t\taddrSetView.initializedAndLoaded.add(block.getStart(), block.getEnd());\n\t\t\t}\n\t\t}\n\t}", "private Block parseBlock(Tokenizer in) {\n\t\tBlock block = new Block();\n\t\tToken next = in.next();\n\t\twhile (next.type != Token.TokenType.CLOSE_BRACE) {\n\t\t\tin.pushTokens(next);\n\t\t\tblock.statements.add(parseStmt(in));\n\t\t\tnext = in.next();\n\t\t}\n\t\treturn block;\n\t}", "@Override\n public void returnBlock(Block b) {\n b.reset();\n blocks.add(b);\n if (blocks.size() > highReservedBlocks) { // too many unused blocks\n synchronized (BlocksPool.class) { // can be easily changed to lock-free\n while (blocks.size() > lowReservedBlocks) {\n this.blocks.poll().clean();\n }\n }\n }\n }", "@NotNull\n TokenBalance balance(@NotNull String address, @NotNull String contract) throws EtherScanException;", "public void fillBlock(Block block) {\n\n\t\tfor (int j = block.UpperLeft().x; j <= block.LowerRight().x; j++) { \n\t\t\tfor (int k = block.UpperLeft().y; k <= block.LowerRight().y; k++) { \n\t\t\t\tblocksPosition.put(new Point(j,k), block); \n\t\t\t\t//Blocks.add(block); \n\t\t\t} \n\t\t} \n\t}", "public void deleteBlock(JsonObject block){\n blocks.remove(Hash.getHashString(block.toString()));\n }", "public lnrpc.Rpc.WalletBalanceResponse walletBalance(lnrpc.Rpc.WalletBalanceRequest request) {\n return blockingUnaryCall(\n getChannel(), getWalletBalanceMethod(), getCallOptions(), request);\n }", "public void placeBlockInTopResSpace(Block block, TT tt){\n ResidualSpace res = rs_stack.pop();\n\n // Place the block, this also updates the locations of the parcels inside it\n block.setLocation(res.getLocation().clone());\n\n block_placements.add(block.getId()); // Add the id of the placed block\n\n for(Parcel p:block.getPacking()){\n packing.addParcel(p);\n }\n\n this.total_value = packing.getTotalValue();\n\n // Update the hashkey\n// hashKey = tt.updateHash(hashKey, block_placements.size(), block.getId());\n\n // Remove parcels from the availability\n removeFromBres(block);\n\n // Calculate the new residual spaces\n generateDaughterResSpaces(block, res);\n }", "public BaseJson<BigDecimal> wallet_balance() throws Exception {\n String s = main(\"wallet_balance\",\"[]\");\n return JsonHelper.jsonStr2Obj(s, BaseJson.class);\n }", "public void append(Block block) {\r\n\t\tfor(Entry s : block) {\r\n\t\t\tappend(s.code,s.attributes());\r\n\t\t}\r\n\t}", "public void setBlockRecord() {\r\n\t\t\tthis.blockRecord = new ArrayList<BlockList>();\r\n\t\t}", "private static void registerBlock(Block b)\n\t{\n\t}", "public RemoteCall<BigInteger> balanceOf(String account) {\n final Function function = new Function(FUNC_BALANCEOF,\n Arrays.<Type>asList(new org.web3j.abi.datatypes.Address(account)),\n Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}));\n return executeRemoteCallSingleValueReturn(function, BigInteger.class);\n }", "alluxio.proto.journal.Block.BlockInfoEntry getBlockInfo();", "@Override\n public Iterable<AccountAmount> extractNonFeeTransfers(AccountID payerAccountId, TransactionBody body,\n TransactionRecord transactionRecord) {\n LinkedList<AccountAmount> result = new LinkedList<>();\n if (body.hasCryptoTransfer()) {\n for (var accountAmount : body.getCryptoTransfer().getTransfers().getAccountAmountsList()) {\n result.add(accountAmount);\n }\n } else if (body.hasCryptoCreateAccount()) {\n var amount = body.getCryptoCreateAccount().getInitialBalance();\n result.add(AccountAmount.newBuilder().setAccountID(payerAccountId).setAmount(0 - amount).build());\n if (ResponseCodeEnum.SUCCESS == transactionRecord.getReceipt().getStatus()) {\n var newAccountId = transactionRecord.getReceipt().getAccountID();\n result.add(AccountAmount.newBuilder().setAccountID(newAccountId).setAmount(amount).build());\n }\n } else if (body.hasContractCreateInstance()) {\n var amount = body.getContractCreateInstance().getInitialBalance();\n result.add(AccountAmount.newBuilder().setAccountID(payerAccountId).setAmount(0 - amount).build());\n if (ResponseCodeEnum.SUCCESS == transactionRecord.getReceipt().getStatus()) {\n var contractAccountId = contractIdToAccountId(transactionRecord.getReceipt().getContractID());\n result.add(AccountAmount.newBuilder().setAccountID(contractAccountId).setAmount(amount).build());\n }\n } else if (body.hasContractCall()) {\n var amount = body.getContractCall().getAmount();\n var contractAccountId = contractIdToAccountId(body.getContractCall().getContractID());\n result.add(AccountAmount.newBuilder().setAccountID(contractAccountId).setAmount(amount).build());\n result.add(AccountAmount.newBuilder().setAccountID(payerAccountId).setAmount(0 - amount).build());\n }\n return result;\n }", "private void listBalances() {\n\t\t\r\n\t}", "@SubscribeEvent\n public static void registerBlock(final RegistryEvent.Register<Block> event){\n walletBlock = new WalletBlock();\n event.getRegistry().register(walletBlock);\n }", "public void setBlock(Block newBlock) {\n\t\tthis.block = newBlock;\n\t}", "private void processInput()\n{\n File f1 = input_file;\n\n try (BufferedReader br = new BufferedReader(new FileReader(f1))) {\n List<DylockLockEntry> ents = new ArrayList<DylockLockEntry>();\n List<DylockLockEntry> lents = new ArrayList<DylockLockEntry>();\n double ltime = 0;\n double ntime = 0;\n for ( ; ; ) {\n\t String ln = br.readLine(); \n\t if (ln == null) break;\n\t if (ln.startsWith(\"ENDBLOCK\")) {\n\t processBlock(lents);\n\t List<DylockLockEntry> xents = lents;\n\t lents = ents;\n\t ents = xents;\n\t ltime = ntime;\n\t ntime = 0;\n\t }\n\t else {\n\t DylockLockEntry ent = new DylockLockEntry(this,ln);\n\t double t0 = ent.getTime();\n\t if (t0 <= ltime) lents.add(ent);\n\t else {\n\t if (t0 > ntime) ntime = t0;\n\t ents.add(ent);\n\t }\n\t }\n }\n processBlock(ents);\n }\n catch (IOException e) {\n System.err.println(\"DYLOCK: Problem reading input file: \" + e);\n }\n}", "@Test\n\tpublic void testChargePinDebitCardInvalidPinBlock() throws Exception {\t\n\t\tHashMap<String, Object> mapBody = new HashMap<String, Object>();\n\t\tmapBody.put(\"amount\", 1.00);mapBody.put(\"currency\", \"USD\");\n\t\tHashMap<String, Object> card = returnMapCardWithCardPresent();\n\t\tHashMap<String, Object> cardPresent = (HashMap<String, Object>) card.get(\"cardPresent\");\n\t\tcardPresent.put(\"pinBlock\", \"invalidPin\");\n\t\tcard.put(\"cardPresent\", cardPresent);\n\t\tmapBody.put(\"card\", card);\n\t\t\n\t\tHttpResponse response = TestUtil.post(CCChargeUrl,\n\t\t\t\tCCChargeHeaderParams, mapBody);\n\t\tvalidateErrorRes(response, 400, \"invalid_request\", \"PMT-4000\", \"PINBlock is invalid.\", \"PINBlock\", \"https://developer.intuit.com/v2/docs?redirectID=PayErrors\");\n\t}", "public void mergeBlock(BasicBlock bb){\n this.tail.remove();\n if(bb.getParent().getExitBB() == bb){\n bb.getParent().setExitBB(this);\n }\n\n Instruction ptr = bb.getHead();\n while(ptr != null){\n if(ptr instanceof Phi){\n Instruction nct = ptr.getNxt();\n ((Phi) ptr).getRes().replaceUser(((Phi) ptr).getBranches().iterator().next().getFirst());\n ptr.remove();\n ptr = nct;\n } else {\n ptr.setBasicBlock(this);\n ptr.setPrev(tail);\n if(this.head == null)\n head = ptr;\n else tail.setNxt(ptr);\n\n tail = ptr;\n ptr = ptr.getNxt();\n }\n }\n\n for(BasicBlock succ: bb.getSuccessors()){\n this.successors.add(succ);\n succ.getPredecessorBB().add(this);\n }\n bb.setHead(null);\n bb.setTail(null);\n bb.replaceUser(this);\n bb.deleteItself();\n\n }", "@Test\n public void fieldAddressBlock() throws Exception {\n Document doc = new Document();\n DocumentBuilder builder = new DocumentBuilder(doc);\n\n FieldAddressBlock field = (FieldAddressBlock) builder.insertField(FieldType.FIELD_ADDRESS_BLOCK, true);\n\n Assert.assertEquals(\" ADDRESSBLOCK \", field.getFieldCode());\n\n // Setting this to \"2\" will include all countries and regions,\n // unless it is the one specified in the ExcludedCountryOrRegionName property.\n field.setIncludeCountryOrRegionName(\"2\");\n field.setFormatAddressOnCountryOrRegion(true);\n field.setExcludedCountryOrRegionName(\"United States\");\n field.setNameAndAddressFormat(\"<Title> <Forename> <Surname> <Address Line 1> <Region> <Postcode> <Country>\");\n\n // By default, this property will contain the language ID of the first character of the document.\n // We can set a different culture for the field to format the result with like this.\n field.setLanguageId(\"1033\");\n\n Assert.assertEquals(\n \" ADDRESSBLOCK \\\\c 2 \\\\d \\\\e \\\"United States\\\" \\\\f \\\"<Title> <Forename> <Surname> <Address Line 1> <Region> <Postcode> <Country>\\\" \\\\l 1033\",\n field.getFieldCode());\n //ExEnd\n\n doc = DocumentHelper.saveOpen(doc);\n field = (FieldAddressBlock) doc.getRange().getFields().get(0);\n\n TestUtil.verifyField(FieldType.FIELD_ADDRESS_BLOCK,\n \" ADDRESSBLOCK \\\\c 2 \\\\d \\\\e \\\"United States\\\" \\\\f \\\"<Title> <Forename> <Surname> <Address Line 1> <Region> <Postcode> <Country>\\\" \\\\l 1033\",\n \"«AddressBlock»\", field);\n Assert.assertEquals(\"2\", field.getIncludeCountryOrRegionName());\n Assert.assertEquals(true, field.getFormatAddressOnCountryOrRegion());\n Assert.assertEquals(\"United States\", field.getExcludedCountryOrRegionName());\n Assert.assertEquals(\"<Title> <Forename> <Surname> <Address Line 1> <Region> <Postcode> <Country>\",\n field.getNameAndAddressFormat());\n Assert.assertEquals(\"1033\", field.getLanguageId());\n }", "public static LinkedList<TempBlock> getAll(Block block) {\r\n\t\treturn instances_.get(block);\r\n\t}", "public void debitBankAccount() {\n\t\tint beforeDebit = this.sender.getBankAccount().getAmount();\n\t\tthis.sender.getBankAccount().setAmount(beforeDebit - this.getCost());\n\t\tSystem.out.println(this.getCost() + \" euros is debited from \" + this.sender.getName()\n\t\t\t\t+ \" account whose balance is now \" + this.sender.getBankAccount().getAmount() + \" euros\");\n\t}", "public void DepositMoneyInBank() {\n\n for (int i = 0; i < commands.length; i++) {\n commands[i].execute();\n storage.push(commands[i]);\n }\n }", "public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tString username, password, payee;\n\t\tUser user;\n\t\tBank bank = new Bank();\n\t\tObjectOutputStream oos = null;\n\t\tString outputFile = \"resource/Bank.txt\";\n\t\tObjectInputStream ois = null;\n\t\tString inputFile = \"resource/Bank.txt\";\n\t\tString trInputFile = \"resource/Transactions.txt\";\n\t\tFile f = new File(outputFile);\n\n\t\tdouble amount;\n\n\t\tint choice;\n\t\tdashbord: while (true) {\n\t\t\tSystem.out.println(\"\\n-------------------\");\n\t\t\tSystem.out.println(\"BANK OF MyBank\");\n\t\t\tSystem.out.println(\"-------------------\\n\");\n\t\t\tSystem.out.println(\"1. Register account.\");\n\t\t\tSystem.out.println(\"2. Login.\");\n\t\t\tSystem.out.println(\"3. Update accounts.\");\n\t\t\tSystem.out.println(\"4. Exit.\");\n\t\t\tSystem.out.print(\"\\nEnter your choice : \");\n\t\t\tchoice = sc.nextInt();\n\t\t\tsc.nextLine();\n\t\t\tswitch (choice) {\n\t\t\tcase 1:\n\t\t\t\tSystem.out.print(\"Enter name : \");\n\t\t\t\tString name = sc.nextLine();\n\t\t\t\tSystem.out.print(\"Enter address : \");\n\t\t\t\tString address = sc.nextLine();\n\t\t\t\tSystem.out.print(\"Enter contact number : \");\n\t\t\t\tString phone = sc.nextLine();\n\t\t\t\tSystem.out.println(\"Set username : \");\n\t\t\t\tusername = sc.next();\n\t\t\t\t// -------------------------------------------------------\n\n\t\t\t\ttry {\n\t\t\t\t\tois = new ObjectInputStream(new FileInputStream(inputFile));\n\t\t\t\t\tif (f.length() != 0) {\n\n\t\t\t\t\t\tbank.userMap = (Map<String, User>) ois.readObject();\n\t\t\t\t\t}\n\n\t\t\t\t} catch (EOFException e) {\n\t\t\t\t\tSystem.out.println(\"its end of the record\");\n\t\t\t\t}\n\n\t\t\t\tcatch (Exception e) {\n\t\t\t\t\te.printStackTrace();\n\n\t\t\t\t} finally {\n\t\t\t\t\tif (ois != null)\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tois.close();\n\t\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\t// --------------------------------------------------------\n\n\t\t\t\twhile (bank.userMap.containsKey(username)) {\n\t\t\t\t\tSystem.out.println(\"Username already exists. Set again : \");\n\t\t\t\t\tusername = sc.next();\n\t\t\t\t}\n\t\t\t\tSystem.out.println(\n\t\t\t\t\t\t\"Set a password (minimum 8 chars; minimum 1 digit, 1 lowercase, 1 uppercase, 1 special character[!@#$%^&*_]) :\");\n\t\t\t\tpassword = sc.next();\n\t\t\t\tsc.nextLine();\n\t\t\t\twhile (!password.matches(((\"(?=.*\\\\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&*_]).{8,}\")))) {\n\t\t\t\t\tSystem.out.println(\"Invalid password . Set again :\");\n\t\t\t\t\tpassword = sc.next();\n\t\t\t\t}\n\t\t\t\tSystem.out.println(\"Enter initial deposit :10000 \");\n\t\t\t\tamount = sc.nextDouble();\n//\t\t\t\twhile (!sc.hasNextDouble()) {\n//\t\t\t\t\tSystem.out.println(\"Invalid amount. Enter again :\");\n//\t\t\t\t\tamount=sc.nextDouble();\n//\t\t\t\t}\n\n//\t\t\t\tsc.nextLine();\n\t\t\t\tuser = new User(name, address, phone, username, password, amount, new Date());\n\t\t\t\ttry {\n\t\t\t\t\toos = new ObjectOutputStream(new FileOutputStream(outputFile));\n//\t\t\t\t\tif(f.length()==0)\n\t\t\t\t\tbank.userMap.put(username, user);\n\t\t\t\t\tfor (Entry<String, User> entry : bank.userMap.entrySet())\n\t\t\t\t\t\toos.writeObject(bank.userMap);\n\t\t\t\t\toos.close();\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t} finally {\n\t\t\t\t\tif (oos != null)\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\toos.close();\n\t\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tSystem.out.println(\"Enter username : \");\n\t\t\t\tusername = sc.next();\n\t\t\t\tsc.nextLine();\n\t\t\t\tSystem.out.println(\"Enter password : \");\n\t\t\t\tpassword = sc.next();\n\t\t\t\tsc.nextLine();\n\n\t\t\t\ttry {\n\t\t\t\t\tois = new ObjectInputStream(new FileInputStream(inputFile));\n\n\t\t\t\t\twhile (true) {\n\t\t\t\t\t\tbank.userMap = (Map<String, User>) ois.readObject();\n\t\t\t\t\t\tSystem.out.println(bank.userMap);\n\t\t\t\t\t\t// System.out.println(bank.userMap);\n\t\t\t\t\t\tif (bank.userMap.containsKey(username)) {\n\t\t\t\t\t\t\tuser = bank.userMap.get(username);\n\t\t\t\t\t\t\tif (bank.userMap.get(username).getPassword().equals(password)) {\n//\t\t\t\t\t\t\tSystem.out.println(\"hi\");\n\t\t\t\t\t\t\t\twhile (true) {\n\n\t\t\t\t\t\t\t\t\tSystem.out.println(\"\\n---------------------------------\");\n\t\t\t\t\t\t\t\t\tSystem.out.println(\"W E L C O M E, \" + username.toUpperCase());\n\t\t\t\t\t\t\t\t\tSystem.out.println(\"-----------------------------------\\n\");\n\t\t\t\t\t\t\t\t\tSystem.out.println(\"1. Deposit.\");\n\t\t\t\t\t\t\t\t\tSystem.out.println(\"2. Transfer.\");\n\t\t\t\t\t\t\t\t\tSystem.out.println(\"3. Last 5 transactions.\");\n\t\t\t\t\t\t\t\t\tSystem.out.println(\"4. User information.\");\n\t\t\t\t\t\t\t\t\tSystem.out.println(\"5. Log out.\");\n\t\t\t\t\t\t\t\t\tSystem.out.print(\"\\nEnter your choice : \");\n\t\t\t\t\t\t\t\t\tchoice = sc.nextInt();\n\t\t\t\t\t\t\t\t\tsc.nextLine();\n\t\t\t\t\t\t\t\t\tswitch (choice) {\n\t\t\t\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\t\t\t\tSystem.out.print(\"Enter amount : \");\n//\t\t\t\t\t\t\t\t\twhile (!sc.hasNextDouble()) {\n//\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"Invalid amount. Enter again :\");\n//\t\t\t\t\t\t\t\t\t\tsc.nextLine();\n//\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tamount = sc.nextDouble();\n\t\t\t\t\t\t\t\t\t\tsc.nextLine();\n\t\t\t\t\t\t\t\t\t\tSystem.out.println(amount);\n\n\t\t\t\t\t\t\t\t\t\tdeposit(amount, new Date(), bank, username, user, payee = null);\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\t\t\t\tSystem.out.print(\"Enter payee username : \");\n\t\t\t\t\t\t\t\t\t\tpayee = sc.next();\n\t\t\t\t\t\t\t\t\t\tsc.nextLine();\n\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"Enter amount : \");\n//\t\t\t\t\t\t\t\t\twhile (!sc.hasNextDouble()) {\n//\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"Invalid amount. Enter again :\");\n//\t\t\t\t\t\t\t\t\t\tsc.nextLine();\n//\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tamount = sc.nextDouble();\n\t\t\t\t\t\t\t\t\t\tsc.nextLine();\n//\t\t\t\t\t\t\t\t\tif (amount > 300000) {\n//\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"Transfer limit exceeded. Contact bank manager.\");\n//\t\t\t\t\t\t\t\t\t\tbreak;\n//\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t// --------------------------------------------------------------------------------\n\t\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\t\tois = new ObjectInputStream(new FileInputStream(inputFile));\n\n//\t\t\t\t\t\t\t\t\t while(true) {\n\t\t\t\t\t\t\t\t\t\t\tbank.userMap = (Map<String, User>) ois.readObject();\n//\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"whil\");\n//\t\t\t\t\t\t\t\t\t\tSystem.out.println(bank.userMap);\n//\t\t\t\t\t\t\t\t\t\tSystem.out.println(bank.userMap.get(username).getPassword().equals(password));\n\t\t\t\t\t\t\t\t\t\t\tif (bank.userMap.containsKey(payee)) {\n\t\t\t\t\t\t\t\t\t\t\t\twithdraw(amount, new Date(), bank, username, user);\n\t\t\t\t\t\t\t\t\t\t\t\tdeposit(amount, new Date(), bank, username, bank.userMap.get(payee),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tpayee);\n\n\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"Username doesn't exist.\");\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} catch (EOFException e) {\n\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"its end of the record\");\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\tcatch (Exception e) {\n\t\t\t\t\t\t\t\t\t\t\te.printStackTrace();\n\n\t\t\t\t\t\t\t\t\t\t} finally {\n\t\t\t\t\t\t\t\t\t\t\tif (ois != null)\n\t\t\t\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\t\t\t\tois.close();\n\t\t\t\t\t\t\t\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\t\tois = new ObjectInputStream(new FileInputStream(trInputFile));\n\n\t\t\t\t\t\t\t\t\t\t\twhile (true) {\n\t\t\t\t\t\t\t\t\t\t\t\tbank.transactions = (ArrayList<String>) ois.readObject();\n\t\t\t\t\t\t\t\t\t\t\t\tfor (String tr : bank.transactions)\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (tr.contains(username))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(tr);\n\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} catch (EOFException e) {\n\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"its end of the record\");\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\tcatch (Exception e) {\n\t\t\t\t\t\t\t\t\t\t\te.printStackTrace();\n\n\t\t\t\t\t\t\t\t\t\t} finally {\n\t\t\t\t\t\t\t\t\t\t\tif (ois != null)\n\t\t\t\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\t\t\t\tois.close();\n\t\t\t\t\t\t\t\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t}\n\n//\t\t\t\t\t\t\t\t\tSet set = bank.transactions.entrySet();\n//\t\t\t\t\t\t\t Iterator iterator = set.iterator();\n//\t\t\t\t\t\t\t \n//\t\t\t\t\t\t\t while (iterator.hasNext()) {\n//\t\t\t\t\t\t\t Map.Entry entry = (Map.Entry)iterator.next();\n//\t\t\t\t\t\t\t System.out.println();\n//\t\t\t\t\t\t\t }\n//\t\t\t\t\t\t\t\t\tfor (String transactions : user.transactions) {\n//\t\t\t\t\t\t\t\t\t\tSystem.out.println(transactions);\n//\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\tcase 4:\n\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"Accountholder name : \" + user.getName());\n\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"Accountholder address : \" + user.getAddress());\n\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"Accountholder contact : \" + user.getPhone());\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\tcase 5:\n\t\t\t\t\t\t\t\t\t\tcontinue dashbord;\n\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"Wrong choice !\");\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tSystem.out.println(\"wrong password\");\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tSystem.out.println(\"user name dosnt exist\");\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t} catch (OptionalDataException e) {\n\t\t\t\t\tSystem.out.println();\n\t\t\t\t} catch (EOFException e) {\n\t\t\t\t\tSystem.out.println();\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t} finally {\n\t\t\t\t\tif (oos != null)\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\toos.close();\n\t\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\tSystem.out.println(\"Enter username : \");\n\t\t\t\tusername = sc.next();\n\t\t\t\tuser = bank.userMap.get(username);\n\t\t\t\tif (bank.userMap.containsKey(username)) {\n\t\t\t\t\tbank.userMap.replace(username, new User(user.getName(), user.getAddress(), user.getPhone(),\n\t\t\t\t\t\t\tuser.getName(), user.getPassword(), user.getAmount(), new Date()));\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(\"Username doesn't exist.\");\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\tSystem.out.println(\"\\nThank you for choosing Bank Of MyBank.\");\n\t\t\t\tSystem.exit(1);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tSystem.out.println(\"Wrong choice !\");\n\t\t\t}\n\n\t\t}\n\t}", "private void transferToBankAccount() {\n ArrayList<Coin> selectedCoins;\n String collection;\n mGoldAmount = 0.0;\n mBankTransferTotal = 0;\n\n if (mRecyclerViewCol.getVisibility() == View.VISIBLE) {\n selectedCoins = getSelectedCoins(Data.COLLECTED);\n collection = Data.COLLECTED;\n // Impose 25 coin limit\n if (selectedCoins.size() > (25 - Data.getCollectedTransferred())) {\n displayToast(getString(R.string.msg_25_coin_limit));\n return;\n }\n } else {\n selectedCoins = getSelectedCoins(Data.RECEIVED);\n collection = Data.RECEIVED;\n }\n\n if (selectedCoins.size() == 0) {\n displayToast(getString(R.string.msg_please_select_coins));\n return;\n }\n\n // Transfer selected coins to bank account\n mBankTransferInProgress = true;\n mProgressBar.setVisibility(View.VISIBLE);\n Log.d(TAG, \"[transferToBankAccount] transfer in progress...\");\n\n for (Coin c : selectedCoins) {\n double value = c.getValue();\n String currency = c.getCurrency();\n double exchange = value * mExchangeRates.get(currency);\n mGoldAmount += exchange;\n Data.removeCoinFromCollection(c, collection, new OnEventListener<String>() {\n\n @Override\n public void onSuccess(String string) {\n mBankTransferTotal++;\n Log.d(TAG, \"[transferToBankAccount] number processed: \" + mBankTransferTotal);\n // If all coins have been processed\n if (mBankTransferTotal == selectedCoins.size()) {\n\n // Get current date\n LocalDateTime now = LocalDateTime.now();\n DateTimeFormatter format = DateTimeFormatter.ofPattern(\n \"yyyy/MM/dd\", Locale.ENGLISH);\n String date = format.format(now);\n\n // Add transaction to firebase\n Transaction transaction = new Transaction(mGoldAmount, date);\n Data.addTransaction(transaction, mBankTransferTotal, collection);\n\n // Clear transfer flag\n mBankTransferInProgress = false;\n\n // Update the view\n if (mRecyclerViewCol.getVisibility() == View.VISIBLE) {\n updateCollectedView();\n } else {\n updateReceivedView();\n }\n mProgressBar.setVisibility(View.INVISIBLE);\n Log.d(TAG, \"[transferToBankAccount] transfer complete\");\n displayToast(getString(R.string.msg_transfer_complete));\n }\n }\n\n @Override\n public void onFailure(Exception e) {\n mBankTransferTotal++;\n // If all coins have been processed\n if (mBankTransferTotal == selectedCoins.size()) {\n\n // Clear transfer flag\n mBankTransferInProgress = false;\n mProgressBar.setVisibility(View.INVISIBLE);\n Log.d(TAG, \"[transferToBankAccount] transfer failed\");\n\n // Update the view\n if (mRecyclerViewCol.getVisibility() == View.VISIBLE) {\n updateCollectedView();\n } else {\n updateReceivedView();\n }\n\n } else {\n displayToast(getString(R.string.msg_failed_to_transfer) + c.getCurrency()\n + \" worth \" + c.getValue());\n }\n Log.d(TAG, \"[sendCoins] failed to transfer coin: \" + c.getId());\n }\n });\n }\n }", "private void addStatementsToBlock(Block block, List<Statement> statements) {\n\t\tfor (Statement s : statements) {\r\n\t\t\tblock.addStatement(s.makeClone());\r\n\t\t}\r\n\t}", "void removeBlock(Block block);", "public void update(byte[] block) {\n update(block, 0, block.length - 1);\n }", "@Override\r\n\tpublic Object visitBlock(Block block, Object arg) throws Exception {\r\n\t\tint numScopes = symbolTable.enterScope();\r\n\t\t// visit children\r\n\t\tfor (BlockElem elem : block.elems) {\r\n\t\t\telem.visit(this, arg);\r\n\t\t}\r\n\t\tint numScopesExit = symbolTable.leaveScope();\r\n\t\tcheck(numScopesExit > 0 && numScopesExit == numScopes,\r\n\t\t\t\t\"unbalanced scopes\", block);\r\n\t\treturn null;\r\n\t}", "public void updateAge(int block, int age){\n\t\tblocks[block].updateAge(age);\n\t\tsortBlocks();\n\t}", "private static Item registerBlockItem(Block block, Item.Settings settings){\n Identifier id = Registry.BLOCK.getId(block);\n return CottonItemHelper.registerItem(id.getNamespace(), id.getPath(), new BlockItem(block, settings));\n }", "@NotNull\n List<Block> blocksMined(@NotNull String address) throws EtherScanException;", "private void depositBank() throws InterruptedException{\n\n log(\"banking!\");\n if(!getBank().isOpen()){\n getBank().open();\n Timing.waitCondition(() -> getBank().isOpen(), 5000);\n }else{\n getBank().depositAllExcept(item -> item.getName().endsWith(\" axe\"));\n\n }\n\n }", "private static void assignBankAccounts() {\n\t\tfor (Customer customer : customerList) {\n\t\t\t//make sure customer has no current accounts before adding serialized accounts\n\t\t\tcustomer.clearAccounts();\n\t\t\t\n\t\t\tfor (BankAccount account : accountList) {\n\t\t\t\tif (account.getCustomer().getUsername().equals(customer.getUsername())) {\n\t\t\t\t\tcustomer.addAccount(account);\n\t\t\t\t} else if (account.getJointCustomer() != null\n\t\t\t\t\t\t&& account.getJointCustomer().getUsername().equals(customer.getUsername()))\n\t\t\t\t\tcustomer.addAccount(account);\n\t\t\t}\n\t\t}\n\t}", "public Account load() throws IOException {\n Account account = new Account();\n try {\n FileReader fileReader = new FileReader(fileName);\n BufferedReader bufferedReader = new BufferedReader(fileReader);\n String line;\n while ((line = bufferedReader.readLine()) != null) {\n //if (line.contains(\"#\")) { continue; }\n String[] info = line.split(\" @ \");\n\n switch (info[0]) {\n case \"INIT\":\n account.setToInitialize(Boolean.parseBoolean(info[1]));\n break;\n case \"BS\":\n account.setBaseSavings(Float.parseFloat((info[1])));\n break;\n case \"INC\":\n parseIncome(info, account);\n break;\n case \"EXP\":\n parseExpenditure(info, account);\n break;\n case \"G\":\n parseGoal(info, account);\n break;\n case \"INS\":\n parseInstalment(info, account);\n break;\n case \"LOA\":\n parseLoan(info, account);\n break;\n case \"BAN\":\n parseBankAccount(info, account);\n break;\n default:\n throw new DukeException(\"OOPS!! Your file has been corrupted/ input file is invalid!\");\n }\n }\n bufferedReader.close();\n } catch (FileNotFoundException err) {\n final File parentDir = new File(\"dataFG\");\n parentDir.mkdir();\n final String hash = \"moneyAccount\";\n final String fileName = hash + \".txt\";\n final File file = new File(parentDir, fileName);\n file.createNewFile();\n } catch (IOException | DateTimeParseException | DukeException e) {\n e.printStackTrace();\n }\n return account;\n }", "private void setBlock(Block block) {\r\n this.block = block;\r\n }", "public void addBlockToPA(IGUIBlock block, int index) {\n blockLink.addBlockPair(block, blockHandler.getFromPalette(index));\n addExistingBlockAsProgram(block);\n }", "protected abstract int addBlock(Collection<Record> candidates,\n Map.Entry block);", "@Override\n public int execute() throws InterruptedOperationException, CancelOperationException {\n Logger logger = Log4j.getLogger();\n int success = 0;\n try {\n String accountNumber = null;\n BigDecimal amount = BigDecimal.ONE;\n Transaction transaction;\n LocalDateTime now;\n String userId = BankApp.getCurrentUser().getUserId();\n List<String> accountNumbers = accountDao.getAccountNumbers(userId);\n ConsoleHelper.println(\"\");\n ConsoleHelper.displayMenuBanner();\n ConsoleHelper.printlnWithTab(\"[DEPOSIT]\");\n ConsoleHelper.printAccountList();\n\n boolean isValidInput = false;\n do {\n ConsoleHelper.printWithTab(\"Into: \");\n String input = ConsoleHelper.readString();\n for (int i = 1; i <= accountNumbers.size(); i++) {\n if (input.equals(String.valueOf(i))) {\n accountNumber = accountNumbers.get(i - 1);\n isValidInput = true;\n break;\n }\n }\n\n } while (!isValidInput);\n\n isValidInput = false;\n do {\n ConsoleHelper.printWithTab(\"Amount: \");\n String input = ConsoleHelper.readString();\n try {\n double inputValue = Double.parseDouble(input);\n amount = BigDecimal.valueOf(inputValue);\n int decimalPlaces = ConsoleHelper.getNumberOfDecimalPlaces(amount);\n if (decimalPlaces == 0 && amount.compareTo(BigDecimal.valueOf(0)) > 0) {\n isValidInput = true;\n } else {\n ConsoleHelper.printlnWithTab(\"Invalid amount, we only accept whole number deposit.\");\n }\n } catch (NumberFormatException e) {\n // the amount format is not valid\n }\n } while (!isValidInput);\n\n int countAccount = accountDao.deposit(accountNumber, amount);\n now = LocalDateTime.now();\n Account account = accountDao.getAccount(accountNumber);\n transaction = new Transaction(TransactionType.DEPOSIT, userId, now, amount, account);\n int countTransaction = transactionDao.addTransaction(transaction);\n success = countAccount == 1 && countTransaction == 1 ? 1 : 0;\n if (success == 1) {\n ConsoleHelper.printlnWithTab(\"Deposit completed.\");\n ConsoleHelper.println(\"\");\n } else {\n ConsoleHelper.printlnWithTab(\"System failure, deposit cancelled. Please try later.\");\n }\n try {\n Thread.sleep(1500);\n } catch (InterruptedException e) {\n logger.error(\"Interrupted Exception when thread sleep\", e);\n }\n } catch (CancelOperationException e) {\n // do nothing, allow user to return to main menu\n }\n return success;\n }", "public static void addRespawningBlock(Block block, int seconds) {\n FileConfiguration config = MyZ.instance.getBlocksConfig();\n ConfigurationSection section = config.createSection(block.getWorld().getName() + \"_\" + block.getX() + \"_\" + block.getY() + \"_\"\n + block.getZ());\n section.set(\"respawn\", true);\n section.set(\"type\", block.getType().toString());\n section.set(\"data\", block.getData());\n section.set(\"time\", ticks + seconds);\n MyZ.instance.saveBlocksConfig();\n }", "public BlockCollection(Block block, int amount)\n\t{\n\t\tthis.block = block;\n\t\tthis.amount = amount;\n\t}", "protected void validateUserBlock(UserBlock userBlock) throws WikiException {\r\n\t\tcheckLength(userBlock.getBlockReason(), 200);\r\n\t\tcheckLength(userBlock.getUnblockReason(), 200);\r\n\t}", "public Block electBlock(Blockchain blockchain) {\n\t\telectedBlock = blockchain.get( randomizer.nextInt( blockchain.size() ) );\n\t\treturn electedBlock;\n\t}" ]
[ "0.6573192", "0.6565449", "0.6516452", "0.642484", "0.60029656", "0.57973444", "0.5731119", "0.5584274", "0.5581651", "0.5477554", "0.54739374", "0.5460253", "0.54506975", "0.54463893", "0.54370856", "0.539848", "0.5370954", "0.53387946", "0.53112847", "0.5288664", "0.52746964", "0.52594113", "0.52476007", "0.520528", "0.51908684", "0.519007", "0.51722044", "0.51472163", "0.5100165", "0.50814426", "0.5076156", "0.5063223", "0.5040984", "0.5039653", "0.5039152", "0.50270844", "0.5018073", "0.49970958", "0.4979772", "0.4979516", "0.49780664", "0.49337888", "0.49275735", "0.49256378", "0.4908493", "0.49078214", "0.48856577", "0.4857559", "0.48540312", "0.48518947", "0.48199734", "0.4813223", "0.481094", "0.4802553", "0.4798161", "0.47787794", "0.47751603", "0.47733137", "0.47655773", "0.4764047", "0.47493058", "0.4746013", "0.47448394", "0.47386286", "0.47281364", "0.47233474", "0.4706774", "0.47056264", "0.47035256", "0.47026515", "0.47011444", "0.46921512", "0.46880952", "0.46880898", "0.46864226", "0.46842837", "0.46655366", "0.46603316", "0.4657635", "0.46546915", "0.4654599", "0.46542406", "0.46540004", "0.46533802", "0.46481705", "0.464629", "0.4639111", "0.46376616", "0.46324772", "0.4630906", "0.4627853", "0.46253517", "0.46232918", "0.4622634", "0.4621473", "0.4614552", "0.46121004", "0.46102628", "0.4609621", "0.46087447" ]
0.70706505
0
Releases the locked balance of a block if its enough times checked
private void releaseBlockedBalances(int blockNumber) { int key = blockNumber - Blockchain.REQUIRED_BLOCK_CONFIRMATIONS; Account account = minerMap.get(key); if (account != null) { double sumToUnlock = Blockchain.BLOCK_REWARD; Block block = blockMap.get(blockNumber); if (block != null) { for (Transaction transaction : block.getTransactions()) { sumToUnlock += transaction.getTransactionFee(); } blockMap.remove(blockNumber); } account.unlockBalance(sumToUnlock); minerMap.remove(blockNumber); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void basicReleaseLock() {\n if (logger.isTraceEnabled(LogMarker.DLS_VERBOSE)) {\n logger.trace(LogMarker.DLS_VERBOSE, \"[DLockToken.basicReleaseLock] releasing ownership: {}\",\n this);\n }\n\n leaseId = -1;\n lesseeThread = null;\n leaseExpireTime = -1;\n thread = null;\n recursion = 0;\n ignoreForRecovery = false;\n\n decUsage();\n }", "@KeepForSdk\n public void release() {\n if (this.zzm.decrementAndGet() < 0) {\n Log.e(\"WakeLock\", String.valueOf(this.zze).concat(\" release without a matched acquire!\"));\n }\n String zza = zza(null);\n synchronized (this.zza) {\n if (this.zzi) {\n int i;\n Integer[] numArr = (Integer[]) this.zzj.get(zza);\n if (numArr != null) {\n if (numArr[0].intValue() == 1) {\n this.zzj.remove(zza);\n i = 1;\n } else {\n numArr[0] = Integer.valueOf(numArr[0].intValue() - 1);\n }\n }\n i = 0;\n }\n if (!this.zzi) {\n }\n }\n zza(0);\n }", "public final void release() {\n explicitlyLocked = false;\n byteBase.unlock();\n }", "public void unlock(){\n logger.log(Level. INFO,\"unlock() \"+lockState+\".\");\n this.lock.lock();\n logger.log(Level. INFO,\"unlock taking mutex :\"+lockState+\".\");\n switch(this.lockState){\n \t\t\tcase RLT:\n \t\t\tlockState = State.RLC;\n \t\t\tbreak;\n \t\t\tcase WLT:\n \t\t\tlockState = State.WLC;\n \t\t\tcase RLT_WLC:\n \t\t\tlockState = State.WLC;\t\n break;\n default:\n logger.log(Level.WARNING,\"Unlock with : \"+lockState+\".\");\n break;\n \t\t}\n this.available.signal();\t\n logger.log(Level.WARNING,\"SIGNAL\");\n this.lock.unlock();\n \t}", "public void unlockExclusiveAndTakeWriteLock()\n {\n long s = initiateExclusiveLockRelease();\n long n = nextSeq( s ) - EXL_MASK + CNT_UNIT;\n unconditionallySetState( n );\n }", "void releaseLock(QName lockQName, String lockToken);", "void lockReleased(String lock);", "public void releasePingLock() {\r\n\t\tbeingPinged.set(false);\r\n\t}", "public abstract void unlock();", "public void unlock() {\n if(semaphore != null && semaphore.availablePermits() == 0) {\n semaphore.release();\n }\n }", "public void releaseDeferredLock() {\r\n return;\r\n }", "final void internalRelease() {\n if(!explicitlyLocked) {\n byteBase.unlock();\n }\n }", "private void signalFree() {\n block.release();\n }", "@Override\n public boolean free() {\n synchronized (this) {\n if (isUnavailable()) {\n return false;\n }\n\n logger.info(\"releasing lock: {}\", this);\n setState(LockState.UNAVAILABLE);\n }\n\n return true;\n }", "@Override\n public void unlock() {\n }", "protected void unlock() {\n synchronized ( lock )\n {\n lock.notify();\n }\n }", "@Override\n\tpublic void unlock() {\n\t\t\n\t}", "@Override\n\tpublic void unLock() {\n\t\t\n\t}", "public void releaseLock() throws JedisException {\n if (fetch == true) {\n redisTemplate.delete(lockKey);\n LOGGER.info(\"release redis distribution_lock [{}] suceess \", lockKey);\n }\n }", "public void closeLock(){\n /*Code to send the locking signal to the physical device Gate*/\n }", "@Override\r\n\tpublic boolean unlockIt() {\n\t\treturn false;\r\n\t}", "public void unlock() {\n setLock.unlock(this);\n }", "private PluginResult releaseWakeLock() {\n PluginResult result = null;\n\n if( this.wakeLock != null ) {\n this.wakeLock.release();\n this.wakeLock = null;\n\n result = new PluginResult(PluginResult.Status.OK, \"OK\");\n }\n else {\n result = new PluginResult(PluginResult.Status.ILLEGAL_ACCESS_EXCEPTION, \"No WakeLock active - acquire first\");\n }\n\n return result;\n }", "@Override\n\tprotected void unLockNbr() {\n\t\t\n\t}", "void lockGranted(LockHandle lockHandle);", "private void internalReadUnlock() {\n checkpointLock.readLock().unlock();\n\n if (ASSERTION_ENABLED)\n CHECKPOINT_LOCK_HOLD_COUNT.set(CHECKPOINT_LOCK_HOLD_COUNT.get() - 1);\n }", "@Override\n public void releasePermit() {\n balancer.release();\n }", "public void unlock() {\n islandLocked = false;\n }", "public Locks release() {\n\t\tif( DB.getConf().getBoolean(\"locks.disabled\")) return this;\n\t\tproxy.tell( new ReleaseLock(lockId), ActorRef.noSender());\n\t\treturn this;\n\t}", "void downgradeToReadLocks();", "@Override\n\tpublic boolean unlockIt() {\n\t\treturn false;\n\t}", "synchronized boolean releaseLock(int leaseIdToRelease, RemoteThread remoteThread) {\n return releaseLock(leaseIdToRelease, remoteThread, true);\n }", "public final void releaseNoCopy() {\n explicitlyLocked = false;\n byteBase.unlockNoCopy();\n }", "public void unlock() {\n try {\n if (lock != null)\n lock.release();\n if (channel != null)\n channel.close();\n }\n catch (Exception e) {\n throw new ReviewedStingException(\"An error occurred while unlocking file\", e);\n }\n }", "public Object reduce_lock() {\n \t\tthis.lock.lock();\n switch(this.lockState){\n case WLT:\n \t\t while(this.lockState==State.WLT){\n \t\t\t try{\t\t \n \t\t\t\t this.available.await();\n \t\t }catch(InterruptedException i){}\n \t\t }\n this.lockState = State.RLC;\t\n \t\t\tbreak;\n \t\t\tcase RLT_WLC:\n \t\t\t this.lockState=State.RLT;\n \t\t\tbreak;\n \t\t\tcase WLC:\n \t\t\t this.lockState=State.RLC;\n \t\t\tbreak;\n \t\t\tdefault: \n logger.log(Level.SEVERE,\"reduce : Lock incoherent :\"+lockState+\".\");\n break;\n \t\t}\n //busy = true; \n logger.log(Level.INFO,\"I was <b>reduced</b> to \"+this.lockState+\".\");\n \t\tthis.lock.unlock();\n \t\treturn obj;\n \t}", "public synchronized void unblock() {\n\t\tsetBlocked(false);\n\t}", "public void unlockBack()\n {\n m_bBackLock = false;\n }", "void updateNextUnblockTime(int t);", "public boolean isUnblockable();", "public void onUnblock();", "void unlock(Object obj, Object owner, boolean releaseMultiLocked)\r\n throws LockNotReleasedException, ClassCastException, ChannelException, LockMultiLockedException;", "void release()\n {\n synchronized (m_lock)\n {\n m_released = true;\n\n m_lock.notifyAll();\n }\n }", "public boolean checkBlockX()\n {\n if (mBlockedTime == 0)\n {\n return false;\n }\n\n double tBlockDelay = mBlockedTime - time();\n mBlockedTime = 0;\n if (tBlockDelay <= 0)\n {\n return false;\n }\n mBlockedMessage.add(mName + \" GC blocked from \" + time() + \" + until \" + (time() + tBlockDelay));\n hold(tBlockDelay);\n out();\n return true;\n }", "private void releaseArrow()\n {\n \tif(bowCharge >= minReleaseCharge)\n \t{\n\t currentArrow.release(bowCharge);\n\t firedArrows.add(currentArrow);\n\t System.out.println(\"released arrow, power \" + bowCharge\n\t \t+ \" angle \" + currentArrow.getMovementAngle()); \n \t}\n \tisChargingArrow = false;\n \tcurrentArrow = null;\n \tbowCharge = 0;\n }", "public void releaseReadLock() {\r\n return;\r\n }", "protected void releaseFromPrison() {\n\t\tisInPrison = false;\r\n\t\tnumberOfRound = 0;\r\n\t}", "public boolean holdsLock(TransactionId tid, PageId p) {\n // some code goes here\n // not necessary for lab1|lab2\n return false;\n }", "void releaseReadLock();", "public void unlockGarage()\n {\n m_bGarageLock = false;\n }", "public void cleanupOldBlocks (long threshTime) ;", "final void internalReleaseNoCopy() {\n if(!explicitlyLocked) {\n byteBase.unlockNoCopy();\n }\n }", "public static void banker(){\n while(terminatedCount < taskList.size()){\n releaseArr = new int [numResources];\n\n // first address any blocked tasks\n addressWaitingBanker();\n // address any unblocked tasks\n addressNonWaitingBanker();\n // update released resources\n updateResources();\n time += 1;\n\n for(Instruction i : removeSet){\n waitingList.remove(i);\n }\n Collections.sort(waitingList);\n }\n\n }", "void unlockWrite(long stamp);", "public void unlock(String x)\n {\n if(x.equals(((DataStore1)ds).temp_p))\n {\n \t\tm.Unlock();\n \t\tif(((DataStore1)ds).balance > 500)\n \t\t\tm.AboveMinBalance();\n \t\telse\n \t\t\tm.BelowMinBalance();\n }\n else\n \t\tm.IncorrectUnlock();\n }", "@Override\n public void run()\n {\n storage.unblock(Storage.Type.SHADE);\n }", "private boolean releaseLocalLock( Locks.ResourceType type, long resourceId, PrimitiveLongIntMap localLocks )\n {\n int lockCount = localLocks.remove( resourceId );\n if(lockCount == -1)\n {\n throw new IllegalStateException( this + \" cannot release lock that it does not hold: \" +\n type + \"[\" + resourceId + \"].\" );\n }\n\n if(lockCount > 1)\n {\n localLocks.put( resourceId, lockCount-1 );\n return true;\n }\n return false;\n }", "public void unlock() {\n/* 246 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "private void unblock(int node)\n {\n this.blocked[node] = false;\n Vector Bnode = this.B[node];\n while (Bnode.size() > 0) {\n Integer w = (Integer) Bnode.get(0);\n Bnode.remove(0);\n if (this.blocked[w.intValue()]) {\n this.unblock(w.intValue());\n }\n }\n }", "@Override public void checkpointReadUnlock() {\n if (checkpointLock.writeLock().isHeldByCurrentThread())\n return;\n\n checkpointLock.readLock().unlock();\n\n if (ASSERTION_ENABLED)\n CHECKPOINT_LOCK_HOLD_COUNT.set(CHECKPOINT_LOCK_HOLD_COUNT.get() - 1);\n }", "private void producerShutdownSpinLock() {\n\t\twhile (!imageProducer.isTerminated()) {\n\t\t\t// spin spin\n\t\t}\n\t}", "public void deleteBarrier() {\n if(stater == 3) return;\n stater = 3;\n }", "public void endHold();", "public synchronized void release() {\n m_available = true;\n notify();\n }", "public void releaseLocksTo(Lock to) {\n while (nlocks > 0) {\n if (locks[nlocks - 1] == to)\n return;\n locks[--nlocks].unlock();\n }\n }", "@Override\n public void unlock() {\n Preconditions.checkState(connection != null);\n checkThread();\n unlockLatency.record(() -> {\n if (locked) {\n try {\n Transaction tnx = session.beginTransaction();\n try {\n DbLockRecord record = fetch(session, false, true);\n if (record == null) {\n throw new LockException(\n String.format(\"[%s][%s][%s] Lock record not found.\",\n id().getNamespace(), id().getName(), threadId()));\n }\n if (record.isLocked() && instanceId().compareTo(record.getInstanceId()) == 0) {\n record.setLocked(false);\n record.setInstanceId(null);\n record.setTimestamp(-1);\n\n session.save(record);\n } else {\n long delta = System.currentTimeMillis() - lockedTime;\n if (delta > lockExpiryTimeout()) {\n throw new LockException(\n String.format(\"[%s][%s] Lock expired. [thread=%d]\",\n id().getNamespace(), id().getName(), threadId()));\n }\n throw new LockException(\n String.format(\"[%s][%s] Lock not held by current thread. [thread=%d]\",\n id().getNamespace(), id().getName(), threadId()));\n }\n locked = false;\n tnx.commit();\n } catch (Throwable t) {\n tnx.rollback();\n throw new LockException(t);\n } finally {\n locked = false;\n lockedTime = 0;\n session.clear();\n super.unlock();\n }\n } catch (Exception ex) {\n throw new LockException(ex);\n }\n } else {\n throw new LockException(\n String.format(\"[%s][%s] Lock not held by current thread. [thread=%d]\",\n id().getNamespace(), id().getName(), threadId()));\n }\n });\n }", "public void unleash() {\n\t\tlocked = false;\n\t\tfloat percent = framesAccelerated/60.0f;\n\t\tif (percent > 1) percent = 2 - percent;\n\t\tif (percent < 0) percent = 0;\n\t\t\n\t\tif (player.aiControlled()) {\n\t\t\tpercent = AIcontroller.randomStartBoost();\n\t\t}\n\t\t\n\t\tspeed = MAX_SPEED * percent;\n\t}", "public void releaseLock() throws LockException {\n\t\tlong[] err = new long[1];\n\t\tDpsHelper dps = null;\n\t\t\n\t\ttry {\n\t\t\tdps = DpsHelperHolder.getDpsHelper();\n\t\t\tdps.dlReleaseLock(id, err);\n\t\t} catch(Exception e) {\n\t\t\t// Either dps cannot be initialized or releaseLock went wrong.\n\t\t\t// An error code of 65534 indicates that this error occurred inside\n\t\t\t// the dps JNI glue layer and not inside the actual lock functions.\n\t\t\tthrow new LockException(65534, e.getMessage());\n\t\t}\n\t\t\n\t\tif (err[0] != 0) {\n\t\t\tthrow new LockException(dps.dlGetLastDistributedLockErrorCode(), \n\t\t\t\t\tdps.dlGetLastDistributedLockErrorString());\n\t\t}\n\t\t\n\t\treturn;\t\n\t}", "public void releaseLock(LockedDocument lockedDoc) {\n try {\n \tservice.releaseLock(lockedDoc);\n \tmObjects.addStatusList(\"Document lock released.\");\n } catch (InvalidRequest e) {\n \tmObjects.addStatusList(\"Error saving document: \" + e.getMessage());\n \tToast.makeText(this, \"Error releasing document due to invalid request\", \n Toast.LENGTH_LONG).show();\n } catch (LockExpired e) {\n \tmObjects.addStatusList(\"Lock had already expired; release failed.\");\n \tToast.makeText(this, \"Lock expired\", Toast.LENGTH_LONG).show();\n }\n }", "protected void onBSUnlock() {\n\n }", "public void unlock() {\n int id = ThreadID.get();\n \n this.levels[id].set(0);\n\n }", "@Override\r\n\tpublic void releaseObject() {\r\n\t\tfinished = false;\r\n\r\n\t\tarm.rotate(90);\r\n\r\n\t\topenHand();\r\n\t\ttry {\r\n\t\t\tThread.sleep(WAIT_TIME);\r\n\t\t} catch (InterruptedException e) {\r\n\t\t}\r\n\r\n\t\tarm.rotate(-90);\r\n\t\tarm.stop();\r\n\t\tarm.flt();\r\n\t\tfinished = true;\r\n\t}", "public void mo957b() {\n if (this.f14245a) {\n throw new IllegalStateException(\"Already released\");\n }\n }", "public void drain(double amount) {\r\n capacity = Math.max(capacity -= amount, 0);\r\n }", "public void unlock(int key);", "protected void checkDeadLock()\r\n/* 303: */ {\r\n/* 304:389 */ EventExecutor e = executor();\r\n/* 305:390 */ if ((e != null) && (e.inEventLoop())) {\r\n/* 306:391 */ throw new BlockingOperationException(toString());\r\n/* 307: */ }\r\n/* 308: */ }", "@Test\r\n\tpublic final void testUnsetLock() {\r\n\t\tlistener.unsetLock();\r\n\t\tassertTrue(\"Listener should not be locked\",listener.isLocked());\r\n\t}", "public boolean freeLock(String lockKey) {\n\t\ttry {\n\t\t\tlong locked = jedis.del(lockKey);\n\t\t\tif (locked > 0) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}finally{\n\t\t\t//释放redis链接\n//\t\t\tboolean returnFlag = singlePool.returnResource(jedis);\n//\t\t\tlogger.info(\"returnFlag=====\"+returnFlag);\n\t\t\tjedis.close();\n\t\t}\n\t\treturn false;\n\t}", "synchronized boolean releaseLock(int leaseIdToRelease, RemoteThread remoteThread,\n boolean decRecursion) {\n\n if (leaseIdToRelease == -1) {\n return false;\n }\n if (destroyed) {\n return true;\n }\n\n // return false if not locked by calling thread\n if (!isLeaseHeld(leaseIdToRelease) || !isLeaseHeldByCurrentOrRemoteThread(remoteThread)) {\n return false;\n }\n\n // reduce recursion if recursion > 0\n else if (decRecursion && getRecursion() > 0) {\n incRecursion(-1);\n decUsage();\n if (logger.isTraceEnabled(LogMarker.DLS_VERBOSE)) {\n logger.trace(LogMarker.DLS_VERBOSE, \"[DLockToken.releaseLock] decremented recursion: {}\",\n this);\n }\n return true;\n }\n\n // release lock entirely\n else {\n basicReleaseLock();\n return true;\n }\n }", "void unlock(Object obj, Object owner)\r\n throws LockNotReleasedException, ClassCastException, ChannelException;", "void unlockLastEdge();", "public void ProtectMe(Block block){\n \tplugin.getProtect().add(block);\r\n \t\t//run the timer to load the block\r\n \t\r\n \tif(plugin.getTreeprotect_Timer().getPoolSize() < plugin.getTreeprotect_Timer().getMaximumPoolSize()){\r\n \t\tplugin.getTreeprotect_Timer().schedule(new Runnable() {\r\n \t\t\t\tpublic void run() {\r\n \t\t\t\t\tif(!(plugin.getProtect().isEmpty())){\r\n \t\t\t\t\t\t//remove it from the list\r\n \t\t\t\t\t\tplugin.getProtect().remove(0);\r\n \t\t\t\t\t}\r\n \t\t\t\t}\r\n \t\t\t}, plugin.getProtectTime(), TimeUnit.MILLISECONDS);\r\n \t}\r\n \t}", "private void unlock(UserInputDto inputDto) {\n // Deserialize treadmill status from token\n TreadmillStatus treadmillStatus = deserializeByToken(inputDto.getToken());\n\n // Treadmill is unlocked already\n if (TreadmillStatusEnum.UNLOCKED.getValue().equals(treadmillStatus.getLockStatus())) {\n throw new BizException(\"error.unlocked.already\", \"该跑步机已解锁\");\n }\n\n // Update treadmill status\n treadmillStatus.setAuthType(CommonConstants.DEFAULT_AUTH_TYPE);\n treadmillStatus.setLockStatus(TreadmillStatusEnum.UNLOCKED.getValue());\n treadmillStatus.setCurrentUsrId(CommonConstants.DEFAULT_USERID);\n // Unlock time\n treadmillStatus.setStartTime(new Date());\n treadmillStatus.setDuration(CommonConstants.DEFAULT_DURATION);\n\n // Update redis cache todo Not completed\n redisDbDao.setexBySerialize(TOKEN_PREFIX + inputDto.getToken(), CommonConstants.DEFAULT_DURATION, treadmillStatus);\n }", "void unlock(String name) {\n executeLockFree(connection -> doUnlock(name, connection));\n }", "public void markUnsold(){\n\n myMaxRejectCountCount--;\n }", "public abstract boolean unlock(String oid, String lockKey) throws OIDDoesNotExistException, InvalidLockException;", "protected static boolean isLock(Block block) {\r\n return Lock.isLock(block, null);\r\n }", "public void releaseLocks() {\n releaseLocksTo(null);\n }", "@Override\n public boolean tryReleaseShared(final int releases) {\n for (; ; ) {\n int oldCount = getState();\n if (oldCount == 0) {\n return false;\n }\n int newCount = oldCount - 1;\n if (compareAndSetState(oldCount, newCount)) {\n return newCount == 0;\n }\n }\n }", "public void unLock(Long userId, CurrencyName curId, BigInteger newBalance) {\n ValueOperations<String, Object> values = redisTemplate.opsForValue();\n String lockKEy = getKey(userId, curId, true);\n String wKey = getKey(userId, curId, false);\n values.set(wKey, newBalance);\n redisTemplate.delete(lockKEy);\n\n }", "public void release() throws DeviceException {\n \t\ttry {\n \t\t\tcontroller.caput(holdChannel, 0, 2.0);\n \t\t} catch (Throwable e) {\n \t\t\tthrow new DeviceException(\"failed to release hole on robot\", e);\n \t\t}\n \t}", "public Boolean balanced() {\r\n\t\tif(allocated() > getAmount()) {\r\n\t\t\treturn false;\r\n\t\t}else {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}", "@Override\n\t\tpublic void unlock() {\n\n\t\t\tsynchronized (lock) {\n\t\t\t\treaders--;\n\t\t\t\tlock.notifyAll();\n\t\t\t}\n\n\t\t}", "public void abandon() {\n lock.lock();\n try {\n eligibleSyncs.clear();\n abandoned = true;\n } finally {\n lock.unlock();\n }\n }", "public bankacc() {\n\t\tbalance = 0;\n\t\tlockBalance = new ReentrantLock();\n\t\tcorrectBalanceCond = lockBalance.newCondition();\n\t}", "private final void maintain(){\n\t\tif(host.getStrength()>MAINTENANCE_COST){\n\t\t\thost.expend(MAINTENANCE_COST);\n\t\t}\n\t\telse{\n\t\t\tkill();\n\t\t}\n\t}", "public void free(int reservation) {\n this.freeSet.set(reservation - this.loRange);\n }", "@Override\n\tpublic void unlock() {\n\t\tSystem.out.println(\"Card in ATM1 is unlocked !\");\n\t}", "public void unlockSimcard() {\n // if sim is locked by Pin , need to unlock it\n Xlog.d(TAG,\"unlockSimcard() ,mITelephony \" + mITelephony);\n try {\n if (mITelephony != null) {\n int simState = FeatureOption.MTK_GEMINI_SUPPORT ?\n (mITelephonyEx.getSimIndicatorState(mSlotId))\n : (mITelephony.getSimIndicatorState());\n if (PhoneConstants.SIM_INDICATOR_LOCKED == simState) {\n mCellConnMgr.handleCellConn(mSlotId, GeminiUtils.PIN1_REQUEST_CODE);\n Xlog.d(TAG,\"Data enable check change request pin , mSlotId \" + mSlotId);\n }\n }\n } catch (RemoteException e) {\n Xlog.e(TAG, \"RemoteException\");\n } catch (NullPointerException ex) {\n Xlog.e(TAG, \"NullPointerException\");\n }\n \n }", "void bust() {\n\t\t_loses++;\n\t\t//_money -= _bet;\n\t\tclearHand();\n\t\t_bet = 0;\n\t}", "public void uponRelease() {\n try {\n\n int size = waitingList.size();\n if (size > 0) {\n int random = (int) (stream.getNumber() * size);\n NodeThread next = (NodeThread)waitingList.get(random);\n next.wakeUp();\n }\n\n } catch (IOException e) {}\n }" ]
[ "0.6685806", "0.6554283", "0.6433289", "0.62516975", "0.62004083", "0.61872566", "0.61750823", "0.61383224", "0.61292005", "0.6119835", "0.608526", "0.60597414", "0.60200924", "0.6005759", "0.5995232", "0.59630096", "0.59308386", "0.59071803", "0.5893761", "0.58909625", "0.5841667", "0.58350587", "0.58076996", "0.580746", "0.5789821", "0.57815844", "0.5775943", "0.5772903", "0.5768848", "0.57595074", "0.5756742", "0.57529235", "0.57299083", "0.57266873", "0.5702205", "0.5683649", "0.5668169", "0.56653136", "0.5664944", "0.56594956", "0.5658344", "0.5651858", "0.56495535", "0.5647438", "0.56402177", "0.5640147", "0.56232953", "0.56175715", "0.5613216", "0.5612376", "0.56080854", "0.55950147", "0.55821407", "0.5560834", "0.5553475", "0.55503386", "0.55361456", "0.55344665", "0.5524043", "0.551804", "0.5505182", "0.548924", "0.5489207", "0.5483034", "0.54759765", "0.54742223", "0.5473405", "0.5458385", "0.54571956", "0.5455431", "0.5445542", "0.54447883", "0.54438466", "0.54415023", "0.5412736", "0.5406195", "0.53922206", "0.53856516", "0.53798527", "0.5373446", "0.53699666", "0.53693897", "0.5349829", "0.533352", "0.5327378", "0.53228164", "0.5316275", "0.53059036", "0.5304765", "0.5304505", "0.5302929", "0.52972126", "0.5295819", "0.5295098", "0.52739745", "0.5267342", "0.5260985", "0.5260822", "0.5259298", "0.5257819" ]
0.63929987
3
Parses the given transactions and adds the receiver and sender from the accounts
private void parseTransactions(List<Transaction> transactions) { transactions.forEach(transaction -> { Account senderAccount = getAccount(transaction.getSender()); Account receiverAccount = getAccount(transaction.getReceiver()); senderAccount.addOutgoingTransaction(transaction); receiverAccount.addIncomingTransaction(transaction); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void executeTransaction(List<ClientTransaction> transactions) throws ServiceException {\t\n\t\tConnection conn = connectDB();\n\t\ttry {\n\t\t\tfor (ClientTransaction transaction : transactions) {\n\t\t\t\tif (transaction.getStatus() == TransactionStatus.APPROVED) {\n\t\t\t\t\tPreparedStatement ps = prepareStmt(conn, \"SELECT * FROM client_transaction WHERE id = ?\");\n\t\t\t\t\tps.setInt(1, transaction.getId()); // transaction-specific id\n\t\t\t\t\tResultSet rs = ps.executeQuery();\n\t\t\t\t\trs.next();\n\t\t\t\t\t\n\t\t\t\t\t// extracts USERID of sender & receiver\n\t\t\t\t\ttransaction.setFromAccount(rs.getInt(\"user_id\"));\n\t\t\t\t\ttransaction.setToAccount(rs.getInt(\"to_account_num\"));\n\t\t\t\t\tBigDecimal amount = rs.getBigDecimal(\"amount\");\n\n\t\t\t\t\t// Deduct money from sender's account\n\t\t\t\t\tPreparedStatement psf = prepareStmt(conn, \"UPDATE client_account SET amount = amount - ? WHERE user_id = ?\");\n\t\t\t\t\tpsf.setBigDecimal(1, amount);\n\t\t\t\t\tpsf.setInt(2, transaction.getFromAccount());\n\t\t\t\t\t\n\t\t\t\t\t// Insert money into recipient's account\n\t\t\t\t\tPreparedStatement pst = prepareStmt(conn, \"UPDATE client_account SET amount = amount + ? WHERE user_id = ?\");\n\t\t\t\t\tpst.setBigDecimal(1, amount);\n\t\t\t\t\tpst.setInt(2, transaction.getToAccount());\n\n\t\t\t\t\tint from = psf.executeUpdate();\n\t\t\t\t\tint to = pst.executeUpdate();\n\n\t\t\t\t\tif (from != 1 || to != 1)\n\t\t\t\t\t\tthrow new ServiceException(new IllegalStateException(\"From/to account not properly updated.\"));\n\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (SQLException e) {\n\t\t\tthrow ServiceException.wrap(e);\n\t\t}\n\t}", "public boolean insertTransactionsAndCreateAccounts(List<Transaction> transactions) {\n\t\ttry (final AutoCommittingHandle handle = new AutoCommittingHandle(dbi)) {\n\t\t\ttry {\n\t\t\t\t// fetch all existing accounts, initializing a map entry for each that contains an empty set of\n\t\t\t\t// transactions as its value\n\t\t\t\tfinal Map<Account, List<Transaction>> existingAccounts = new HashMap<>();\n\t\t\t\tfor (final Account existingAccount : getAccountsWithTransactions(handle)) {\n\t\t\t\t\texistingAccounts.put(existingAccount, new ArrayList<>());\n\t\t\t\t}\n\n\t\t\t\t// a map of new accounts to add\n\t\t\t\tfinal Map<Account, List<Transaction>> newAccounts = new HashMap<>();\n\n\t\t\t\t// sort new transactions into the map of accounts\n\t\t\t\tfor (final Transaction transaction : transactions) {\n\t\t\t\t\tfinal Optional<Account> existingAccount = existingAccounts.keySet()\n\t\t\t\t\t .stream()\n\t\t\t\t\t .filter(a -> a.getAccountNumber()\n\t\t\t\t\t .equals(transaction.getAccountNumber()))\n\t\t\t\t\t .findFirst();\n\t\t\t\t\tfinal Optional<Account> newAccount = newAccounts.keySet()\n\t\t\t\t\t .stream()\n\t\t\t\t\t .filter(a -> a.getAccountNumber()\n\t\t\t\t\t .equals(transaction.getAccountNumber()))\n\t\t\t\t\t .findFirst();\n\n\t\t\t\t\tif (!existingAccount.isPresent() && newAccount.isPresent()) {\n\t\t\t\t\t\tnewAccounts.get(newAccount.get()).add(transaction);\n\t\t\t\t\t} else if (existingAccount.isPresent() && !newAccount.isPresent()) {\n\t\t\t\t\t\texistingAccounts.get(existingAccount.get()).add(transaction);\n\t\t\t\t\t} else if (!existingAccount.isPresent() && !newAccount.isPresent()) {\n\t\t\t\t\t\tfinal List<Transaction> newTransactions = Arrays.asList(transaction);\n\t\t\t\t\t\t// TODO: can we assume account type and balance/currency? - instead, prompt user for details?\n\t\t\t\t\t\tfinal Account account = Account.newBuilder(transaction.getAccountNumber())\n\t\t\t\t\t\t .setType(AccountType.CHECKING)\n\t\t\t\t\t\t .setBalance(Money.zero(CurrencyUnit.CAD))\n\t\t\t\t\t\t .addTransactions(newTransactions)\n\t\t\t\t\t\t .build();\n\t\t\t\t\t\tnewAccounts.put(account, newTransactions);\n\t\t\t\t\t} else if (existingAccount.isPresent() && newAccount.isPresent()) {\n\t\t\t\t\t\tthrow new IllegalStateException(\"Account can't exist in new and existing maps\");\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfor (final Entry<Account, List<Transaction>> entry : newAccounts.entrySet()) {\n\t\t\t\t\t// sum the transactions to compute an updated balance for the account\n\t\t\t\t\tfinal List<Money> transactionAmounts = entry.getValue()\n\t\t\t\t\t .stream()\n\t\t\t\t\t .map(Transaction::getAmount)\n\t\t\t\t\t .collect(Collectors.toList());\n\t\t\t\t\tfinal Money balance = Money.zero(entry.getKey().getBalance().getCurrencyUnit())\n\t\t\t\t\t .plus(transactionAmounts);\n\n\t\t\t\t\t// insert a copy of the account with the correct balance and list of transactions\n\t\t\t\t\tfinal Account updatedAccount = Account.newBuilder(entry.getKey())\n\t\t\t\t\t .setBalance(balance)\n\t\t\t\t\t .addTransactions(entry.getValue())\n\t\t\t\t\t .build();\n\n\t\t\t\t\tinsertAccountWithTransactions(handle, updatedAccount);\n\t\t\t\t}\n\n\t\t\t\tfor (final Entry<Account, List<Transaction>> entry : existingAccounts.entrySet()) {\n\t\t\t\t\t// sum the transactions to compute an updated balance for the account\n\t\t\t\t\tfinal List<Money> transactionAmounts = entry.getValue()\n\t\t\t\t\t .stream()\n\t\t\t\t\t .map(Transaction::getAmount)\n\t\t\t\t\t .collect(Collectors.toList());\n\t\t\t\t\tfinal Money balance = entry.getKey()\n\t\t\t\t\t .getBalance()\n\t\t\t\t\t .plus(transactionAmounts);\n\n\t\t\t\t\t// update the account with the correct balance and set of transactions\n\t\t\t\t\t// this adds the new transactions to the set of transactions already in the account\n\t\t\t\t\tfinal Account updatedAccount = Account.newBuilder(entry.getKey())\n\t\t\t\t\t .setBalance(balance)\n\t\t\t\t\t .addTransactions(entry.getValue())\n\t\t\t\t\t .build();\n\n\t\t\t\t\taccountDao.updateAccount(handle, updatedAccount);\n\t\t\t\t\ttransactionDao.insertTransactions(handle, entry.getValue());\n\t\t\t\t}\n\t\t\t} catch (final Exception ex) {\n\t\t\t\tlog.error(\"Failed to insert tranactions\", ex);\n\t\t\t\thandle.rollback();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}", "List<TransactionVO> addPendingTransactions(List<SignedTransaction> transactions);", "public Flowable<List<Transaction>> addTransactions(List<Transaction> transactions) {\n return executeTransaction((realm, subscriber) -> {\n realm.copyToRealmOrUpdate(transactions);\n subscriber.onNext(transactions);\n });\n }", "private void handleTransaction() throws Exception {\r\n\t\tString receiver;\r\n\t\tString amount;\r\n\t\tMessage sendTransaction = new Message().addData(\"task\", \"transaction\").addData(\"message\", \"do_transaction\");\r\n\t\tMessage response;\r\n\r\n\t\tthis.connectionData.getTerminal().write(\"enter receiver\");\r\n\t\treceiver = this.connectionData.getTerminal().read();\r\n\r\n\t\t// tries until a amount is typed that's between 1 and 10 (inclusive)\r\n\t\tdo {\r\n\t\t\tthis.connectionData.getTerminal().write(\"enter amount (1-10)\");\r\n\t\t\tamount = this.connectionData.getTerminal().read();\r\n\t\t} while (!amount.matches(\"[0-9]|10\"));\r\n\r\n\t\t// does the transaction\r\n\t\tsendTransaction.addData(\"receiver\", this.connectionData.getAes().encode(receiver)).addData(\"amount\",\r\n\t\t\t\tthis.connectionData.getAes().encode(amount));\r\n\r\n\t\tthis.connectionData.getConnection().write(sendTransaction);\r\n\r\n\t\tresponse = this.connectionData.getConnection().read();\r\n\t\tif (response.getData(\"message\").equals(\"success\")) {\r\n\t\t\tthis.connectionData.getTerminal().write(\"transaction done\");\r\n\t\t} else {\r\n\t\t\tthis.connectionData.getTerminal().write(\"transaction failed. entered correct username?\");\r\n\t\t}\r\n\t}", "@Transactional\n\tpublic String addTransaction(int toAccNo, int fromAccNo, Transaction tran) {\n\t\t\tEntityManager entityManager = getEntityManager();\n\t\t\tAccountdetail acc = (Accountdetail) entityManager.createQuery(\"select a from Accountdetail a where a.accountnumber =: toaccNo\").setParameter(\"toaccNo\", toAccNo ).getSingleResult();\n\t\t\tAccountdetail acc1 = (Accountdetail) entityManager.createQuery(\"select ac from Accountdetail ac where ac.accountnumber =: fromAccNo\").setParameter(\"fromAccNo\", fromAccNo ).getSingleResult();\n\t\t\t\n\t\t\t//Validation -----> The Balance amount should be greater than the Amount Transfered \n\t\t\tif(acc1.getCurrentbalance()>=tran.getAmounttransferred()) {\n\t\t\t\t\ttran.setAccountto(acc);\n\t\t\t\t\ttran.setAccountfrom(acc1);\n\t\t\t\t\tentityManager.merge(tran);\n\t\t\t\t\t\n\t\t\t\t\t//Taking the amount transfered\n\t\t\t\t\tint amt = tran.getAmounttransferred();\n\t\t\t\t\tSystem.out.println(toAccNo);\n\t\t\t\t\t\n\t\t\t\t\t//Also crediting and debiting the amount from the accounts \n\t\t\t\t\tacc.setCurrentbalance(acc.getCurrentbalance()+amt);\n\t\t\t\t\tacc1.setCurrentbalance(acc1.getCurrentbalance()-amt);\n\t\t\t\t\t\n\t\t\t\t\t//Mailing the details of the transaction to the Respective Account Numbers\n\t\t\t\t\tString info_deb = \"Amount debited from your account.\\nAmount -->\"+amt+\"\\nTo Account -->\"+acc.getAccountnumber();\n String info_rec = \"Amount credited to your account.\\nAmount -->\"+amt+\"\\nFrom Account -->\"+acc1.getAccountnumber();\n mailService.sendMail(info_deb, acc1.getCustomerdetail().getEmail());\n mailService.sendMail(info_rec, acc.getCustomerdetail().getEmail());\n \n\t\t\t\t\treturn \"Transaction Inserted\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//If Balance is less than the Amount Transfered \n\t\t\t\telse if(acc1.getCurrentbalance()<tran.getAmounttransferred()) {\n\t\t\t\t\treturn \"insufficient funds\";\n\t\t\t\t}\n\t\t\t\n\t\t\t\t//If the Details is wrong\n\t\t\t\telse {\n\t\t\t\t\treturn \"Wrong details. Please try again\";\n\t\t\t\t}\n\t }", "public void saveTransactions(List<Transaction> transactions) {\r\n Session session = HibernateUtil.getSessionFactory().getCurrentSession();\r\n try {\r\n org.hibernate.Transaction hbtransaction = session.beginTransaction();\r\n for(Transaction trans : transactions) {\r\n // don't save \"duplicate\" transactions\r\n Query q = session.createQuery (\"from finance.entity.Transaction trans WHERE trans.transdate = :transdate AND trans.amount = :amount AND trans.vendor = :vendor AND trans.account.uid = :accountuid\");\r\n q.setParameter(\"transdate\", trans.getTransdate());\r\n q.setParameter(\"amount\", trans.getAmount());\r\n q.setParameter(\"vendor\", trans.getVendor());\r\n Account acct = trans.getAccount();\r\n q.setParameter(\"accountuid\", acct.getUid());\r\n List<Transaction> transactionList = (List<Transaction>) q.list();\r\n if (transactionList.isEmpty()) {\r\n session.save(trans);\r\n }\r\n }\r\n hbtransaction.commit();\r\n } catch (Exception e) {\r\n throw e;\r\n }\r\n }", "public TransactionResponse processAllTransaction() throws ParseException {\n TransactionResponse response = new TransactionResponse();\n\n //User0\n response.setTransaction(new Transaction(\"user0\",\"0001\", \"type0\",\"user0_Billing\",\"user0_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-02-00\")));\n\n //User1\n response.setTransaction(new Transaction(\"user1\", \"0101\",\"type0\",\"user1_Billing\", \"user1_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-02-02\")));\n\n response.setTransaction(new Transaction(\"user1\", \"0102\", \"type1\",\"user1_Billing\", \"user1_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-03-00\")));\n\n //User2\n response.setTransaction(new Transaction(\"user2\", \"0201\", \"type1\",\"user2_Billing\", \"user2_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-01-00\")));\n\n response.setTransaction(new Transaction(\"user2\", \"0202\", \"type2\",\"user2_Billing\", \"user2_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-03-01\")));\n\n response.setTransaction(new Transaction(\"user2\", \"0203\",\"type1\",\"user2_Billing\", \"user2_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-03-01\")));\n\n //User3\n response.setTransaction(new Transaction(\"user3\", \"0301\",\"type0\",\"user3_Billing\", \"user3_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-02-02\")));\n\n response.setTransaction(new Transaction(\"user3\", \"0302\",\"type1\",\"user3_Billing\", \"user3_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-03-01\")));\n\n return response;\n }", "public void processTransaction(String transactionCode, int accountNum0, int amount, int accountNum1, String accountName) {\n if (transactions.containsKey(transactionCode)) {\n transactions.get(transactionCode).processTransaction(accountNum0, amount, accountNum1, accountName);\n } else {\n System.out.println(\"Unknown transaction code \\\"\" + transactionCode + \"\\\".\");\n }\n }", "public void loadTransactions(List<Transaction> transactions)\n\t\t\tthrows IOException {\n\n\t\tfor (Transaction transaction : transactions) {\n\t\t\t\n\t\t\tString yearMonth = monthYearFormat\n\t\t\t\t\t.format(transaction.getTxtnDate());\n\t\t\tString rowKey =transaction.getAcountId() + \"-\" + yearMonth;\t\t\t\n\t\t\tdouble amount = transaction.getAmount();\n\t\t\t\n\t\t\ttry {\n\t\t\t\tthis.writer.addRow(rowKey, transaction.getTxtnDate(), UUID.fromString(transaction.getTxtnId()), amount, transaction.getType(), transaction.getReason());\n\t\t\t} catch (InvalidRequestException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t\t\n\t\t\t\tSystem.exit(5);\n\t\t\t}\t\n\t\t}\n\t}", "@Override\n\tpublic void processTransaction(Transaction transactionObject) {\n\t\t\n\t\ttrasactionList.addLast(transactionObject);\n\t\t\n\t\tif ( transactionObject.getTransactionType() == 'C'){\n\t\t\t\n\t\t\tbalance -= transactionObject.getTransactionAmount(); \n\t\t\t\n\t\t}\n\t\t\n\t\telse if ( transactionObject.getTransactionType() == 'D'){\n\t\t\t\n\t\t\tbalance += transactionObject.getTransactionAmount(); \n\t\t}\n\t}", "public void applyTransaction(Transaction tx, byte[] coinbase) {\n\t\tif (blockchain != null)\n\t\t\tblockchain.addWalletTransaction(tx);\n\n\t\t// TODO: what is going on with simple wallet transfer ?\n\n\t\t// 1. VALIDATE THE NONCE\n\t\tbyte[] senderAddress = tx.getSender();\n\n\t\tAccountState senderAccount = repository.getAccountState(senderAddress);\n\n\t\tif (senderAccount == null) {\n\t\t\tif (stateLogger.isWarnEnabled())\n\t\t\t\tstateLogger.warn(\"No such address: {}\",\n\t\t\t\t\t\tHex.toHexString(senderAddress));\n\t\t\treturn;\n\t\t}\n\n\t\tBigInteger nonce = repository.getNonce(senderAddress);\n\t\tif (nonce.compareTo(new BigInteger(tx.getNonce())) != 0) {\n\t\t\tif (stateLogger.isWarnEnabled())\n\t\t\t\tstateLogger.warn(\"Invalid nonce account.nonce={} tx.nonce={}\",\n\t\t\t\t\t\tnonce.longValue(), new BigInteger(tx.getNonce()));\n\t\t\treturn;\n\t\t}\n\n\t\t// 2.1 PERFORM THE GAS VALUE TX\n\t\t// (THIS STAGE IS NOT REVERTED BY ANY EXCEPTION)\n\n\t\t// first of all debit the gas from the issuer\n\t\tBigInteger gasDebit = tx.getTotalGasValueDebit();\n\n\t\t// The coinbase get the gas cost\n\t\trepository.addBalance(coinbase, gasDebit);\n\n\t\tbyte[] contractAddress;\n\n\t\t// Contract creation or existing Contract call\n\t\tif (tx.isContractCreation()) {\n\n\t\t\t// credit the receiver\n\t\t\tcontractAddress = tx.getContractAddress();\n\t\t\trepository.createAccount(contractAddress);\n\t\t\tstateLogger.info(\"New contract created address={}\",\n\t\t\t\t\tHex.toHexString(contractAddress));\n\t\t} else {\n\n\t\t\tcontractAddress = tx.getReceiveAddress();\n\t\t\tAccountState receiverState = repository.getAccountState(tx\n\t\t\t\t\t.getReceiveAddress());\n\n\t\t\tif (receiverState == null) {\n\t\t\t\trepository.createAccount(tx.getReceiveAddress());\n\t\t\t\tif (stateLogger.isInfoEnabled())\n\t\t\t\t\tstateLogger.info(\"New account created address={}\",\n\t\t\t\t\t\t\tHex.toHexString(tx.getReceiveAddress()));\n\t\t\t}\n\t\t}\n\n\t\t// 2.2 UPDATE THE NONCE\n\t\t// (THIS STAGE IS NOT REVERTED BY ANY EXCEPTION)\n\t\tBigInteger balance = repository.getBalance(senderAddress);\n\t\tif (balance.compareTo(BigInteger.ZERO) == 1) {\n\t\t\trepository.increaseNonce(senderAddress);\n\n\t\t\tif (stateLogger.isInfoEnabled())\n\t\t\t\tstateLogger.info(\n\t\t\t\t\t\t\"Before contract execution the sender address debit with gas total cost, \"\n\t\t\t\t\t\t\t\t+ \"\\n sender={} \\n gas_debit= {}\",\n\t\t\t\t\t\tHex.toHexString(tx.getSender()), gasDebit);\n\t\t}\n\n\t\t// actual gas value debit from the sender\n\t\t// the purchase gas will be available for the\n\t\t// contract in the execution state, and\n\t\t// can be validate using GAS op\n\t\tif (gasDebit.signum() == 1) {\n\t\t\tif (balance.compareTo(gasDebit) == -1) {\n\t\t\t\tlogger.info(\"No gas to start the execution: sender={}\",\n\t\t\t\t\t\tHex.toHexString(tx.getSender()));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\trepository.addBalance(senderAddress, gasDebit.negate());\n\t\t}\n\n\t\t// 3. START TRACKING FOR REVERT CHANGES OPTION !!!\n\t\tRepository trackRepository = repository.getTrack();\n\t\ttrackRepository.startTracking();\n\n\t\ttry {\n\n\t\t\t// 4. THE SIMPLE VALUE/BALANCE CHANGE\n\t\t\tif (tx.getValue() != null) {\n\n\t\t\t\tBigInteger senderBalance = repository.getBalance(senderAddress);\n\t\t\t\tBigInteger contractBalance = repository.getBalance(contractAddress);\n\n\t\t\t\tif (senderBalance.compareTo(new BigInteger(1, tx.getValue())) >= 0) {\n\n\t\t\t\t\trepository.addBalance(contractAddress,\n\t\t\t\t\t\t\tnew BigInteger(1, tx.getValue()));\n\t\t\t\t\trepository.addBalance(senderAddress,\n\t\t\t\t\t\t\tnew BigInteger(1, tx.getValue()).negate());\n\n\t\t\t\t\tif (stateLogger.isInfoEnabled())\n\t\t\t\t\t\tstateLogger.info(\"Update value balance \\n \"\n\t\t\t\t\t\t\t\t+ \"sender={}, receiver={}, value={}\",\n\t\t\t\t\t\t\t\tHex.toHexString(senderAddress),\n\t\t\t\t\t\t\t\tHex.toHexString(contractAddress),\n\t\t\t\t\t\t\t\tnew BigInteger(tx.getValue()));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// 3. FIND OUT WHAT IS THE TRANSACTION TYPE\n\t\t\tif (tx.isContractCreation()) {\n\n\t\t\t\tbyte[] initCode = tx.getData();\n\n\t\t\t\tBlock lastBlock = blockchain.getLastBlock();\n\n\t\t\t\tProgramInvoke programInvoke = ProgramInvokeFactory\n\t\t\t\t\t\t.createProgramInvoke(tx, lastBlock, trackRepository);\n\n\t\t\t\tif (logger.isInfoEnabled())\n\t\t\t\t\tlogger.info(\"running the init for contract: addres={}\",\n\t\t\t\t\t\t\tHex.toHexString(tx.getContractAddress()));\n\n\t\t\t\tVM vm = new VM();\n\t\t\t\tProgram program = new Program(initCode, programInvoke);\n\t\t\t\tvm.play(program);\n\t\t\t\tProgramResult result = program.getResult();\n\t\t\t\tapplyProgramResult(result, gasDebit, trackRepository,\n\t\t\t\t\t\tsenderAddress, tx.getContractAddress(), coinbase);\n\n\t\t\t} else {\n\n\t\t\t\tbyte[] programCode = trackRepository.getCode(tx\n\t\t\t\t\t\t.getReceiveAddress());\n\t\t\t\tif (programCode != null) {\n\n\t\t\t\t\tBlock lastBlock = blockchain.getLastBlock();\n\n\t\t\t\t\tif (logger.isInfoEnabled())\n\t\t\t\t\t\tlogger.info(\"calling for existing contract: addres={}\",\n\t\t\t\t\t\t\t\tHex.toHexString(tx.getReceiveAddress()));\n\n\t\t\t\t\tProgramInvoke programInvoke = ProgramInvokeFactory\n\t\t\t\t\t\t\t.createProgramInvoke(tx, lastBlock, trackRepository);\n\n\t\t\t\t\tVM vm = new VM();\n\t\t\t\t\tProgram program = new Program(programCode, programInvoke);\n\t\t\t\t\tvm.play(program);\n\n\t\t\t\t\tProgramResult result = program.getResult();\n\t\t\t\t\tapplyProgramResult(result, gasDebit, trackRepository,\n\t\t\t\t\t\t\tsenderAddress, tx.getReceiveAddress(), coinbase);\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (RuntimeException e) {\n\t\t\ttrackRepository.rollback();\n\t\t\treturn;\n\t\t}\n\t\ttrackRepository.commit();\n\t\tpendingTransactions.put(Hex.toHexString(tx.getHash()), tx);\n\t}", "@Override\n public Iterable<AccountAmount> extractNonFeeTransfers(AccountID payerAccountId, TransactionBody body,\n TransactionRecord transactionRecord) {\n LinkedList<AccountAmount> result = new LinkedList<>();\n if (body.hasCryptoTransfer()) {\n for (var accountAmount : body.getCryptoTransfer().getTransfers().getAccountAmountsList()) {\n result.add(accountAmount);\n }\n } else if (body.hasCryptoCreateAccount()) {\n var amount = body.getCryptoCreateAccount().getInitialBalance();\n result.add(AccountAmount.newBuilder().setAccountID(payerAccountId).setAmount(0 - amount).build());\n if (ResponseCodeEnum.SUCCESS == transactionRecord.getReceipt().getStatus()) {\n var newAccountId = transactionRecord.getReceipt().getAccountID();\n result.add(AccountAmount.newBuilder().setAccountID(newAccountId).setAmount(amount).build());\n }\n } else if (body.hasContractCreateInstance()) {\n var amount = body.getContractCreateInstance().getInitialBalance();\n result.add(AccountAmount.newBuilder().setAccountID(payerAccountId).setAmount(0 - amount).build());\n if (ResponseCodeEnum.SUCCESS == transactionRecord.getReceipt().getStatus()) {\n var contractAccountId = contractIdToAccountId(transactionRecord.getReceipt().getContractID());\n result.add(AccountAmount.newBuilder().setAccountID(contractAccountId).setAmount(amount).build());\n }\n } else if (body.hasContractCall()) {\n var amount = body.getContractCall().getAmount();\n var contractAccountId = contractIdToAccountId(body.getContractCall().getContractID());\n result.add(AccountAmount.newBuilder().setAccountID(contractAccountId).setAmount(amount).build());\n result.add(AccountAmount.newBuilder().setAccountID(payerAccountId).setAmount(0 - amount).build());\n }\n return result;\n }", "public boolean combine(Transaction tr) {\r\n if(tr.getAccountNumber() == getAccountNumber()) {\r\n balance += tr.getTransactionAmount();\r\n return true;\r\n }\r\n return false;\r\n }", "public static void main(String[] args) {\n Account anushaAccount = new Account(456123, \"SBIK1014\", 100);\n Account priyaAccount = new Account(789456, \"SBIK1014\", 200);\n Account dhanuAccount = new Account(951753, \"SBIK1014\", 300);\n\n ArrayList<Account> accounts = new ArrayList<>();\n\n accounts.add(anushaAccount);\n accounts.add(priyaAccount);\n accounts.add(dhanuAccount);\n\n TransactionHistory anuTranHist1 = new TransactionHistory(\"8-Jun-2018\", \"savaings\", 25000);\n TransactionHistory anuTranHist2 = new TransactionHistory(\"28-nov-2018\", \"current\", 50000);\n TransactionHistory anuTranHist3 = new TransactionHistory(\"15-Mar-2018\", \"savaings\", 5000);\n\n TransactionHistory priyaTranHist1 = new TransactionHistory(\"8-Jun-2018\", \"savaings\", 25000);\n TransactionHistory priyaTranHist2 = new TransactionHistory(\"28-nov-2018\", \"current\", 50000);\n TransactionHistory priyaTranHist3 = new TransactionHistory(\"15-Mar-2018\", \"savaings\", 5000);\n\n TransactionHistory dhanuTranHist1 = new TransactionHistory(\"8-Jun-2018\", \"savaings\", 25000);\n TransactionHistory dhanuTranHist2 = new TransactionHistory(\"28-nov-2018\", \"current\", 50000);\n TransactionHistory dhanuTranHist3 = new TransactionHistory(\"15-Mar-2018\", \"savaings\", 5000);\n\n\n ArrayList<TransactionHistory> anuTransactionHistory = new ArrayList<>();\n anuTransactionHistory.add(anuTranHist1);\n anuTransactionHistory.add(anuTranHist2);\n anuTransactionHistory.add(anuTranHist3);\n\n ArrayList<TransactionHistory> priyaTransactionHistory = new ArrayList<>();\n anuTransactionHistory.add(priyaTranHist1);\n anuTransactionHistory.add(priyaTranHist2);\n anuTransactionHistory.add(priyaTranHist3);\n\n ArrayList<TransactionHistory> dhanuTransactionHistory = new ArrayList<>();\n anuTransactionHistory.add(dhanuTranHist1);\n anuTransactionHistory.add(dhanuTranHist2);\n anuTransactionHistory.add(dhanuTranHist3);\n\n //useless code\n //you have already instantiated arraylist above and filled it with objects.. you can use that\n // List<Account> accountDetails=Arrays.asList(anushaAccount,priyaAccount,dhanuAccount);\n //List<TransactionHistory> transHistory=Arrays.asList(anuTranHist1,anuTranHist2,anuTranHist3);\n\n Customer anusha = new Customer(\"anusha\", 26, \"28-mar-92\", anushaAccount, anuTransactionHistory);\n Customer priya = new Customer(\"priya\", 22, \"15-oct-96\", priyaAccount, priyaTransactionHistory);\n Customer dhanu = new Customer(\"dhanu\", 32, \"05-jan-82\", dhanuAccount, dhanuTransactionHistory);\n\n anusha.setAccount(anushaAccount);\n priya.setAccount(priyaAccount);\n dhanu.setAccount(dhanuAccount);\n\n List<Customer> customerDetails = Arrays.asList(anusha, priya, dhanu);\n\n\n Bank bank = new Bank(\"SBI\", \"BNGLR\", customerDetails);\n\n// use the utitlity class here and output the customer object with the highest amount\n // check if your logic is running fine and fix this by morning. I have to finish work, and will leave it to you.\n Customer highestAmountCustomer = BankUtility.getCustomerWithHighestDeposit(bank);\n\n System.out.println(\"Customer with highest bank balance is \"+ highestAmountCustomer.getName() + \" with value \"+highestAmountCustomer.getAccount().getAmount());\n }", "void addInvitedTrans(ITransaction transaction, String userId);", "@Test\n public void transactionSum() {\n final Transaction transaction1 = new Transaction(\"774cedda\", State.CANCELED, 1000L, new Date());\n final Account account1 = new Account(\"1001\", 0L, Collections.singletonList(transaction1));\n final Transaction transaction2 = new Transaction(\"337868a7\", State.FINISHED, 8000L, new Date());\n final Transaction transaction3 = new Transaction(\"f8047f86\", State.CANCELED, 10000L, new Date());\n final Account account2 = new Account(\"1002\", 8000L, Arrays.asList(transaction2, transaction3));\n\n final long actual = calcSumOfCancelledTransOnNonEmptyAccounts(Arrays.asList(account1, account2));\n\n Assert.assertEquals(actual, 10_000L);\n }", "void sendTransaction(IUserAccount target, ITransaction trans, IUserAccount user);", "private void validateTransaction(Transaction transaction) throws LedgerException {\n // Convenience variable for throwing exceptions\n String action = \"process transaction\";\n\n // Get Accounts related to the transaction\n Account payer = transaction.getPayer();\n Account receiver = transaction.getReceiver();\n Account master = this.currentBlock.getAccount(\"master\");\n\n // Check accounts are linked to valid/exisiting accounts\n if ( payer == null || receiver == null || master == null ) {\n throw new LedgerException(action, \"Transaction is not linked to valid account(s).\");\n }\n\n // Check for transaction id uniqueness\n validateTransactionId(transaction.getTransactionId());\n\n // Get total transaction withdrawal\n int amount = transaction.getAmount();\n int fee = transaction.getFee();\n int withdrawal = amount + fee;\n\n /*\n * Check the transaction is valid.\n *\n * Withdrawal, and receiver's ending balance must be _greater than_ the\n * MIN_ACCOUNT_BALANCE and _less than_ the MAX_ACCOUNT_BALANCE. The number\n * must be checked against both ends of the range in cases where an amount\n * would exceed MAX_ACCOUNT_BALANCE (i.e. Integer.MAX_VALUE), which will\n * wrap around to a value < 0.\n */\n if (withdrawal < MIN_ACCOUNT_BALANCE || withdrawal > MAX_ACCOUNT_BALANCE) {\n throw new LedgerException(action, \"Withdrawal exceeds total available currency.\");\n } else if ( payer.getBalance() < withdrawal ) {\n throw new LedgerException(action, \"Payer has an insufficient balance.\");\n } else if ( fee < MIN_FEE ) {\n throw new LedgerException(action, \"The transaction does not meet the minimum fee requried.\");\n } else if ( (amount + receiver.getBalance()) < MIN_ACCOUNT_BALANCE || (amount + receiver.getBalance()) > MAX_ACCOUNT_BALANCE) {\n throw new LedgerException(action, \"Receiver's balance would exceed maximum allowed.\");\n }\n\n // Valid transaction, Transfer funds\n payer.withdraw(withdrawal);\n receiver.deposit(amount);\n master.deposit(fee);\n }", "@Override\r\n\tpublic void fundTransfer(String sender, String reciever, double amount) {\n\t\t\r\n\t\tString name, newMobileNo;\r\n\t\tfloat age;\r\n\t\tdouble amountFund;\r\n\t\t\r\n\t\tCustomer custSender = custMap.get(sender);\r\n\t\tCustomer custReciever = custMap.get(reciever);\r\n\t\t\r\n\t\tdouble recieverAmount = custReciever.getInitialBalance();\r\n\t\tdouble senderAmount = custSender.getInitialBalance();\r\n\t\tif(senderAmount - amount > 500){\r\n\t\t\trecieverAmount += amount;\r\n\t\t\tsenderAmount -= amount;\r\n\t\t\tSystem.out.println(\"Fund Transferred\");\r\n\t\t}\r\n\t\tname = custSender.getName();\r\n\t\tnewMobileNo = custSender.getMobileNo();\r\n\t\tage = custSender.getAge();\r\n\t\tamountFund = senderAmount;\r\n\t\t\r\n\t\tcustSender.setAge(age);\r\n\t\tcustSender.setInitialBalance(senderAmount);\r\n\t\tcustSender.setMobileNo(newMobileNo);\r\n\t\tcustSender.setName(name);\r\n\t\t\r\n\t\tcustMap.put(newMobileNo, custSender);\r\n\t\t\r\n\t\tname = custReciever.getName();\r\n\t\tnewMobileNo = custReciever.getMobileNo();\r\n\t\tage = custReciever.getAge();\r\n\t\tamountFund = recieverAmount;\r\n\t\t\r\n\t\tcustReciever.setAge(age);\r\n\t\tcustReciever.setInitialBalance(recieverAmount);\r\n\t\tcustReciever.setMobileNo(newMobileNo);\r\n\t\tcustReciever.setName(name);\r\n\t\t\r\n\t\tcustMap.put(newMobileNo, custReciever);\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t}", "public void createTransaction(Transaction transaction,String token) {\n Account senderAccount = accountRepository.getAccountByIBAN(transaction.getSender());\n Account receiverAccount = accountRepository.getAccountByIBAN(transaction.getReceiver());\n User userPerformingAction = jwtUtil.getUserFromToken(token);\n Role userRole = jwtUtil.getRoleFromToken(token);\n // check if accounts exist\n if (senderAccount == null || receiverAccount == null) {\n throw new IllegalArgumentException(\"Accounts sender and receiver cannot be found\");\n }\n if ((userRole == Role.EMPLOYEE) && checkIfTransactionIsPossible(senderAccount,receiverAccount) ){\n makeTransaction(senderAccount, receiverAccount, transaction);\n }\n else if(userRole == Role.CUSTOMER){\n if (utils.authorizeAccount(senderAccount,userPerformingAction) && checkIfTransactionIsPossible(senderAccount,receiverAccount)){\n makeTransaction(senderAccount, receiverAccount, transaction);\n }\n else {\n throw new SecurityException(\"Unauthorized to perform transaction\");\n }\n }\n }", "public void addTransaction(Transaction transaction) throws TransactionFailedException,\n\tLowBalanceException,AccountDoesNotExistException {\n\t\t\n\t\tint amount = 0;\n\t\t\n\t\tAccount account = accountDAO.listByAccountId(transaction.getAccountId());\n\t\n\t\tif(account== null){\n\t\t\tthrow new AccountDoesNotExistException(\"Account with \"+ transaction.getAccountId() +\" does not exists\");\n\t\t}\n\t\tif (transaction.getType().equals(\"D\")) {\n\n\t\t\tif (account.getAmount() >= transaction.getAmount())\n\t\t\t\tamount = account.getAmount() - transaction.getAmount();\n\t\t\telse {\n\t\t\t\tthrow new LowBalanceException(\"Low Balance..!!\");\n\t\t\t}\n\n\t\t} else {\n\t\t\tamount = account.getAmount() + transaction.getAmount();\n\t\t}\n\t\taccount.setAmount(amount);\n\t\taccountDAO.update(account);\n\t\ttransactionDAO.save(transaction);\n\t}", "Transaction parseFromSms(SMSNotification sms);", "private void addAllTransactions(\n java.lang.Iterable<? extends com.google.protobuf.ByteString> values) {\n ensureTransactionsIsMutable();\n com.google.protobuf.AbstractMessageLite.addAll(\n values, transactions_);\n }", "@Test\n public void customerCanPerformTransferBetweenAccounts() {\n String ownerId = \"ownerId\";\n Account accountFrom = AccountFactory.createAccount(AccountFactory.AccountType.SAVINGS, ownerId);\n Account accountTo = AccountFactory.createAccount(AccountFactory.AccountType.SAVINGS, ownerId);\n\n // Put some money in the from account\n Transaction transaction = new Transaction.Builder().setDescription(\"Test\").setAmount(DollarAmount.fromInt(100)).setType(Transaction.Type.DEPOSIT).build();\n accountFrom.applyTransaction(transaction);\n assertEquals(accountFrom.getAccountBalance(), DollarAmount.fromInt(100));\n\n // Attempt transfer\n Account.transfer(accountFrom, accountTo, DollarAmount.fromInt(30));\n\n // Assert transfer was successful\n assertEquals(DollarAmount.fromInt(70), accountFrom.getAccountBalance());\n assertEquals(DollarAmount.fromInt(30), accountTo.getAccountBalance());\n }", "public List<Transaction> checkTransactions(List<Transaction> transactions) {\r\n List<Transaction> transactionList = new ArrayList<Transaction>();\r\n Session session = HibernateUtil.getSessionFactory().getCurrentSession();\r\n try {\r\n org.hibernate.Transaction hbtransaction = session.beginTransaction();\r\n for(Transaction trans : transactions) {\r\n Query q = session.createQuery (\"from finance.entity.Transaction trans WHERE trans.transdate = :transdate AND trans.amount = :amount AND trans.vendor = :vendor AND trans.account.uid = :accountuid\");\r\n q.setParameter(\"transdate\", trans.getTransdate());\r\n q.setParameter(\"amount\", trans.getAmount());\r\n q.setParameter(\"vendor\", trans.getVendor());\r\n Account acct = trans.getAccount();\r\n q.setParameter(\"accountuid\", acct.getUid());\r\n List<Transaction> foundTransactions = (List<Transaction>) q.list();\r\n if (foundTransactions.isEmpty()) {\r\n transactionList.add(trans);\r\n }\r\n }\r\n hbtransaction.commit();\r\n } catch (Exception e) {\r\n throw e;\r\n }\r\n return transactionList;\r\n }", "public void transferFunds(BankAccount account1, BankAccount account2, double amount){\n if(account1.checkAccountOpen()&&account2.checkAccountOpen()){\n if((account1.getCurrentBalance()-amount)>0) {\n if (isSameAccount(account1, account2)) {\n account1.subtractCreditTransaction(amount);\n account2.addDebitTransaction(amount);\n } else {\n System.out.println(\"This transaction could not be processed. BankAccount owners are not the same.\");\n }\n }\n else {\n System.out.println(\"Appropriate funds not found. Please check your current balance.\");\n }\n\n\n }\n }", "public void addTransaction(Transactions t){\n listOfTransactions.put(LocalDate.now(), t);\n }", "void processTransaction(String[] transaction) {\n\t\titemsetSets.get(itemsetSets.size() - 1).processTransaction(transaction);\n\t}", "boolean addTransaction(int accountNumber, double transactionAmount,\n int transactionType, String transactionJournalEntry, long transactionTimestamp) {\n if (transactionType == 0 || transactionType == 2) {\n if (AccountList.getInstance(context).getAccount(accountNumber).withdraw(transactionAmount)) {\n databaseHandler.addTransaction(transactionList.size(),\n accountNumber, transactionAmount, transactionType, transactionJournalEntry, transactionTimestamp);\n transactionList.add(new Transaction(transactionList.size() + 1, accountNumber, transactionAmount, transactionType, transactionJournalEntry, transactionTimestamp));\n databaseHandler.updateAccount(accountNumber,\n -transactionAmount);\n return true;\n } else {\n return false;\n }\n } else {\n AccountList.getInstance(context).getAccount(accountNumber).deposit(transactionAmount);\n databaseHandler.addTransaction(transactionList.size(),\n accountNumber, transactionAmount, transactionType, transactionJournalEntry, transactionTimestamp);\n transactionList.add(new Transaction(transactionList.size() + 1, accountNumber, transactionAmount, transactionType, transactionJournalEntry, transactionTimestamp));\n databaseHandler.updateAccount(accountNumber, transactionAmount);\n return true;\n }\n }", "public static void ProcessTransaction(){\r\n\t Iterator<String> iter = masterEventsFile.iterator();\r\n\t //this uses the deletePastEvents method to delete all the past events in the masterEventsFile\r\n\t while (iter.hasNext()){\r\n\t\t String e = iter.next();\r\n\t \r\n\t //for (String e : masterEventsFile){\r\n\t\t Event CheckEvent = new Event(e);\r\n\t\t boolean pastDate = deletePastEvents(CheckEvent);\r\n\t\t if (!pastDate){\r\n\t\t\t break;\r\n\t\t } \r\n\t }\r\n\t //makes each line of the masterEventFile into an Event object for easier processing\r\n\t for (String e : masterEventsFile){\r\n\t\t Event event = new Event(e);\r\n\t\t alteredEventsFile.add(event);\r\n\t }\r\n\t //makes each line into a Transaction object for easier processing\r\n\t for (String t: mergedEventTransactionFile){\r\n\t\t Transaction transaction= new Transaction(t);\r\n\t\t allTransactions.add(transaction);\r\n\t }\r\n\t \r\n\t //Iterates through each Transaction processing them one at a time based on their id\r\n\t for (Transaction t: allTransactions){\r\n\t\t //process sell, return, create, add, delete,end\r\n\t\t if(t.id == 00){\r\n\t\t\t break;\r\n\t\t }\r\n\t\t Event changeEvent = findEvent(t.name);\r\n\t\t if (changeEvent != null){\r\n\t\t\t if (t.id == 01){\t\t\t\t\t\t//sell transaction\r\n\t\t\t\t if((changeEvent.ticket -t.ticket)<0){\r\n\t\t\t\t\t System.out.println(\"Sell transaction could not be performed, not enough tickets\"); //Contraints: no event should ever have a negative nmber of ticekts\r\n\t\t\t\t }else{\r\n\t\t\t\t\t changeEvent.ticket = changeEvent.ticket -t.ticket;\r\n\t\t\t\t }\r\n\t\t\t }else if (t.id == 02){\t\t\t\t//return transaction\r\n\t\t\t\t changeEvent.ticket =changeEvent.ticket + t.ticket;\r\n\t\t\t }else if (t.id == 04){\t\t\t\t//add transaction\r\n\t\t\t\t changeEvent.ticket += t.ticket;\t\r\n\t\t\t }else if (t.id == 05){\t\t\t\t//delete transaction\r\n\t\t\t\t changeEvent = null;\r\n\t\t\t }\r\n\t\t }else{\t\t\t\t\t\t\t\t//constraint: a new event must have a name different from all existing events\r\n\t\t\t if(t.id == 03){\t\t\t\t\t\t//create transaction\r\n\t\t\t\t Event newEvent = new Event (t.getEventLine());\r\n\t\t\t\t InsertEvent(newEvent);\t\t//constraint: <asterEventFile must be kept in ascending order by date\r\n\t\t\t }\r\n\t\t }\r\n\t }\r\n\t \r\n\t String newMasterEventsFile = \"\";\r\n\t String newCurrentEventsFile = \"\"\r\n\t\t\t ;\r\n\t // creates two strings in proper format for output to currenteventsFile and MasterEventsFile\r\n\t for (Event e: alteredEventsFile){\t\t\t\t\t\t\t\t//assumes correct input... constraint:every line is exactly 33 characters(plus newline)\r\n\t\t newMasterEventsFile += e.getEventLine() +\"\\n\";\r\n\t\t newCurrentEventsFile += e.getCurrentEventLine() + \"\\n\";\r\n\t }\r\n\t \r\n\t //does file output stuff\r\n\t try{\r\n\t\t endBackEnd(newMasterEventsFile, newCurrentEventsFile);\r\n\t\t} catch (Exception e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n }", "private void rewardTransaction (PublicKey recipient, ArrayList<Transfer> transfers) {\n int rewardTransferId = 0;\n if (!transfers.isEmpty()) {\n Transfer latestTransfer = this.transfers.get(this.transfers.size() - 1);\n rewardTransferId = latestTransfer.transferId + 1;\n }\n\n transfers.add(new Transfer(100, recipient, rewardTransferId));\n }", "void addTransaction(String[] transaction) {\t\t\n\t\tItemsets frequentItemsets = itemsetSets.get(0);\n\t\t\n\t\tfor (String item : transaction) {\n\t\t\tfrequentItemsets.addTransactionItemset(new Itemset(item));\n\t\t}\n\t}", "private void loadTransactions(String transactionFileName)\n {\n try\n {\n /* Open the file to read */\n File inputFile = new File(transactionFileName);\n\n /* Create a scanner to begin reading from file */\n Scanner input = new Scanner(inputFile);\n\n while (input.hasNextLine())\n {\n //read...\n String currentLine = input.nextLine();\n\n //parse on commas...\n String[] splitLine = currentLine.split(\",\");\n\n //DateFormat class to parse Date from file\n DateFormat dateFormat = DateFormat.getDateInstance(DateFormat.SHORT);\n\n int transactionId = Integer.parseInt(splitLine[0]);\n\n String accountTypeChar = splitLine[1];\n TransactionType transactionType = null;\n switch (accountTypeChar)\n {\n case \"D\":\n transactionType = TransactionType.DEBIT;\n break;\n\n case \"C\":\n transactionType = TransactionType.CREDIT;\n break;\n\n case \"T\":\n transactionType = TransactionType.TRANSFER;\n }\n\n String description = splitLine[2];\n Date date = dateFormat.parse(splitLine[3]);\n double amount = Double.parseDouble(splitLine[4]);\n int accountId = Integer.parseInt(splitLine[5]);\n\n Transaction transaction = new Transaction(transactionId,\n transactionType,\n description,\n date,\n amount,\n accountId);\n\n transactionHashMap.putIfAbsent(accountId, new ArrayList<>());\n transactionHashMap.get(accountId).add(transaction);\n }\n\n input.close();\n\n } catch (Exception e)\n {\n e.printStackTrace();\n }\n }", "protected final Transaction addTransaction(Transaction trans) {\n\t\treturn addTransactionTo(getAccount(), trans);\n\t}", "private void createTransaction() {\n\n String inputtedAmount = etAmount.getText().toString().trim().replaceAll(\",\", \"\");\n\n if (inputtedAmount.equals(\"\") || Double.parseDouble(inputtedAmount) == 0) {\n etAmount.setError(getResources().getString(R.string.Input_Error_Amount_Empty));\n return;\n }\n\n if (mAccount == null) {\n ((ActivityMain) getActivity()).showError(getResources().getString(R.string.Input_Error_Account_Empty));\n return;\n }\n\n if(mCategory == null) {\n ((ActivityMain) getActivity()).showError(getResources().getString(R.string.Input_Error_Category_Income_Empty));\n return;\n }\n\n Double amount = Double.parseDouble(etAmount.getText().toString().replaceAll(\",\", \"\"));\n if(amount < 0) {\n ((ActivityMain) getActivity()).showError(getResources().getString(R.string.Input_Error_Amount_Invalid));\n return;\n }\n\n int CategoryId = mCategory != null ? mCategory.getId() : 0;\n String Description = tvDescription.getText().toString();\n int accountId = mAccount.getId();\n String strEvent = tvEvent.getText().toString();\n Event event = null;\n\n if (!strEvent.equals(\"\")) {\n event = mDbHelper.getEventByName(strEvent);\n if (event == null) {\n long eventId = mDbHelper.createEvent(new Event(0, strEvent, mCal, null));\n if (eventId != -1) {\n event = mDbHelper.getEvent(eventId);\n }\n }\n }\n\n boolean isDebtValid = true;\n // Less: DebtCollect, More: Borrow\n if(mCategory.getDebtType() == Category.EnumDebt.LESS) { // Income -> Debt Collecting\n List<Debt> debts = mDbHelper.getAllDebtByPeople(tvPeople.getText().toString());\n\n Double lend = 0.0, debtCollect = 0.0;\n for(Debt debt : debts) {\n if(mDbHelper.getCategory(debt.getCategoryId()).isExpense() && mDbHelper.getCategory(debt.getCategoryId()).getDebtType() == Category.EnumDebt.MORE) {\n lend += debt.getAmount();\n }\n\n if(!mDbHelper.getCategory(debt.getCategoryId()).isExpense() && mDbHelper.getCategory(debt.getCategoryId()).getDebtType() == Category.EnumDebt.LESS) {\n debtCollect += debt.getAmount();\n }\n }\n\n if(debtCollect + amount > lend) {\n isDebtValid = false;\n ((ActivityMain) getActivity()).showError(getResources().getString(R.string.message_debt_collect_invalid));\n }\n }\n\n if(isDebtValid) {\n Transaction transaction = new Transaction(0,\n TransactionEnum.Income.getValue(),\n amount,\n CategoryId,\n Description,\n 0,\n accountId,\n mCal,\n 0.0,\n \"\",\n event);\n\n long newTransactionId = mDbHelper.createTransaction(transaction);\n\n if (newTransactionId != -1) {\n\n if(mCategory.getDebtType() == Category.EnumDebt.LESS || mCategory.getDebtType() == Category.EnumDebt.MORE) {\n Debt newDebt = new Debt();\n newDebt.setCategoryId(mCategory.getId());\n newDebt.setTransactionId((int) newTransactionId);\n newDebt.setAmount(amount);\n newDebt.setPeople(tvPeople.getText().toString());\n\n long debtId = mDbHelper.createDebt(newDebt);\n if(debtId != -1) {\n ((ActivityMain) getActivity()).showToastSuccessful(getResources().getString(R.string.message_transaction_create_successful));\n cleanup();\n\n if(getFragmentManager().getBackStackEntryCount() > 0) {\n // Return to last fragment\n getFragmentManager().popBackStackImmediate();\n }\n } else {\n ((ActivityMain) getActivity()).showError(getResources().getString(R.string.message_transaction_create_fail));\n mDbHelper.deleteTransaction(newTransactionId);\n }\n } else {\n ((ActivityMain) getActivity()).showToastSuccessful(getResources().getString(R.string.message_transaction_create_successful));\n cleanup();\n\n if(getFragmentManager().getBackStackEntryCount() > 0) {\n // Return to last fragment\n getFragmentManager().popBackStackImmediate();\n }\n }\n\n } else {\n ((ActivityMain) getActivity()).showError(getResources().getString(R.string.message_transaction_create_fail));\n }\n }\n\n }", "public List<Transaction> splitTransactions(List<Transaction> transactions) {\r\n Session session = HibernateUtil.getSessionFactory().getCurrentSession();\r\n try {\r\n org.hibernate.Transaction hbtransaction = session.beginTransaction();\r\n for(Transaction trans : transactions) {\r\n session.saveOrUpdate(trans);\r\n }\r\n hbtransaction.commit();\r\n } catch (Exception e) {\r\n throw e;\r\n }\r\n return transactions;\r\n }", "@Override\n public void processTransaction(CashTransactionParameters transaction) {\n try{\n if(transaction.getTransactionType() == TransactionType.CREDIT)\n cashMoneyWalletModuleManagerImpl.doCreateCashDepositTransaction(transaction);\n else\n cashMoneyWalletModuleManagerImpl.doCreateCashWithdrawalTransaction(transaction);\n\n //Send Broadcast to android wallet so it can refresh the screen\n broadcaster.publish(BroadcasterType.UPDATE_VIEW, CashMoneyWalletBroadcasterConstants.CSH_REFERENCE_WALLET_UPDATE_TRANSACTION_VIEW);\n\n }catch(CantCreateDepositTransactionException e){\n //Send Broadcast to android wallet so it can refresh the screen, indicating an error\n broadcaster.publish(BroadcasterType.UPDATE_VIEW, CashMoneyWalletBroadcasterConstants.CSH_REFERENCE_WALLET_UPDATE_TRANSACTION_VIEW_TRANSACTION_FAILED);\n\n }catch(CantCreateWithdrawalTransactionException e){\n //Send Broadcast to android wallet so it can refresh the screen, indicating an error\n broadcaster.publish(BroadcasterType.UPDATE_VIEW, CashMoneyWalletBroadcasterConstants.CSH_REFERENCE_WALLET_UPDATE_TRANSACTION_VIEW_TRANSACTION_FAILED);\n\n }catch(CashMoneyWalletInsufficientFundsException e){\n //Send Broadcast to android wallet so it can refresh the screen, indicating an error of insufficient funds\n broadcaster.publish(BroadcasterType.UPDATE_VIEW, CashMoneyWalletBroadcasterConstants.CSH_REFERENCE_WALLET_UPDATE_TRANSACTION_VIEW_INSUFICCIENT_FUNDS);\n }\n }", "private boolean getAddresses(){\n try {\n URLtoJSON URLtoJSON = new URLtoJSON();\n JSONObject json = URLtoJSON.open(this.URL+\"merchant/\"+this.GUID+\"/list?password=\"+this.pswd()+\"&api_code=\"+this.ApiCode);\n \n if(!json.isNull(\"error\")) return false; //If there is no transactions return false;\n JSONArray nameArray = json.names();\n JSONArray TotalArray = json.toJSONArray(nameArray);\n JSONArray JAddresses = TotalArray.getJSONArray(0);\n \n for(int i = 0; i < JAddresses.length(); i++){\n String O=\"false\";\n String S=\"false\";\n String N=\"false\";\n String[] Label=JAddresses.getJSONObject(i).getString(\"label\").split(\"_\",-1);\n if(Label.length==3){\n O=Label[1];\n S=Label[0];\n N=Label[2];\n }\n String[] Matched=this.matchDB(JAddresses.getJSONObject(i).getString(\"address\"));\n String[] Details= new String[]{\n \"S: \"+S, //0 Transaction ID\n Matched[0], //1 Sender\n Float.toString(JAddresses.getJSONObject(i).getLong(\"total_received\")/100000000)+\" (BTC)\",//2 Amount in btc\n O, //3 Choosen option\n \"btc\", //4 Currency\n \"O: \"+Matched[2], //5 Date\n Matched[1] //6 Senders nem or false \n };\n if(!this.list.contains(Details)){\n this.list.add(Details);\n if(!\"false\".equals(O) && !O.equals(\"\")){\n this.setAmountsAndEntries(Integer.parseInt(O), JAddresses.getJSONObject(i).getLong(\"total_received\"), Details[6]); //add the amount and rise the entries\n }\n }\n }\n return true;\n } catch (JSONException | NumberFormatException e) {\n e.printStackTrace();\n }\n return false;\n }", "public void addTransaction(Transaction trans)\n {\n SolrInputDocument solr_doc = new SolrInputDocument();\n solr_doc.setField(\"type\",\"Transaction\");\n solr_doc.setField(\"hashBlock\",trans.getHashBlock());\n solr_doc.setField(\"trans_id_split\",trans.getTrans_id_split());\n solr_doc.setField(\"transaction_id\",trans.getTransaction_id());\n solr_doc.setField(\"transaction_fee\",trans.getTransaction_fee());\n solr_doc.setField(\"transaction_size_kb\",trans.getTransaction_size_kb());\n solr_doc.setField(\"from_amout\",trans.getFrom_amout());\n solr_doc.setField(\"to_amount\",trans.getTo_amount());\n\n try {\n client.add(solr_doc);\n } catch (SolrServerException | IOException e) {\n e.printStackTrace();\n }\n\n commit();\n\n }", "void addConfirmedTransaction(int transId, String userId);", "public String processTransaction(Transaction transaction) throws LedgerException {\n // throws LedgerException on invalid transaction\n validateTransaction(transaction);\n\n // Add completed transaction to block\n int numberOfTransactions = this.currentBlock.addTransaction(transaction);\n\n // When transaction limit reached, validate and commit block and create new one\n if (numberOfTransactions == TRANSACTIONS_PER_BLOCK) {\n try {\n validateBlock(this.currentBlock);\n } catch (LedgerException e) {\n throw new LedgerException(\"process transaction\", e.getReason());\n }\n\n // Make transactions and account balances immutable\n Block completedBlock = this.currentBlock;\n completedBlock.commitBlock(this.seed);\n\n // Add current block to the end of the blockMap\n this.blockMap.put((this.blockMap.size() + 1), completedBlock);\n\n // Create new block with accountBalanceMap copied from completedBlock\n this.currentBlock = new Block(this.blockMap.size() + 1, completedBlock);\n }\n\n return transaction.getTransactionId();\n }", "@Test\n public void processTransactionManagerCaseD()\n {\n acc_db.addAccount(acc);\n acc_db.addAccount(acc2);\n\n acc3 = new Account(3,\"Jacob&Leon3\",2000);\n acc_db.addAccount(acc3);\n\n trans_mang.processTransaction(acc.get_Account_Number(), acc2.get_Account_Number(), 30);\n\n Assert.assertEquals(false,trans_mang.processTransaction(acc.get_Account_Number(),acc3.get_Account_Number(),30));\n }", "public Transfer(Account from, int[] amounts, Account to) {\n this.from = from;\n this.amounts = amounts;\n this.to = to;\n }", "void addTransaction(Transaction transaction, long timestamp) throws TransactionNotInRangeException;", "public Map<String, ArrayList<Record>> initiateTransaction(Records records) throws JAXBException;", "@Test\n public void CompoundTransaction_AddTransactionTest()\n {\n ct = new CompoundTransaction(\"compound\");\n\n acc_db.addAccount(acc);\n acc_db.addAccount(acc2);\n\n ct.addTransaction(new Transaction(\"atomic1\", acc_db,acc.get_Account_Number(),acc2.get_Account_Number(),10));\n\n ct.addTransaction(new Transaction(\"atomic2\",acc_db,acc.get_Account_Number(),acc2.get_Account_Number(),40));\n\n Assert.assertEquals(2, ct.getTransaction_list().size());\n }", "private void initAccounts() {\n ((GenesisBlock) DependencyManager.getBlockchain().getGenesisBlock()).getAccountBalances().forEach((key, value) -> {\n Account account = getAccount(key);\n account.addBalance(value);\n });\n DependencyManager.getBlockchain().getChain().getChain().forEach(this::parseBlock);\n }", "public void broadCastTransaction(final String mTransaction, int mWallet_id) {\r\n this.mWallet_id = mWallet_id;\r\n try {\r\n mJsonRequest.put(SDKHelper.RAW_TX, mTransaction);\r\n } catch (JSONException e) {\r\n e.printStackTrace();\r\n }\r\n String mTransactionHistoryUrl = \"\";\r\n if (SDKConstants.WALLET_TYPE== SDKHelper.ZERO){\r\n mTransactionHistoryUrl = SDKHelper.TESTNET_URL_PUSH_TRANSACTION_URL;\r\n }else{\r\n mTransactionHistoryUrl = SDKHelper.MAIN_PUSH_TRANSACTION_URL;\r\n }\r\n JsonObjectRequest jsonObjReq = new JsonObjectRequest(Request.Method.POST, mTransactionHistoryUrl,\r\n mJsonRequest, responselistner, errorListener) {\r\n /**\r\n * Passing some request headers\r\n * */\r\n @Override\r\n public Map<String, String> getHeaders() throws AuthFailureError {\r\n Map headers = new HashMap();\r\n headers.put(\"Content-Type\", \"application/json; charset=utf-8\");\r\n return headers;\r\n }\r\n\r\n @Override\r\n protected Map<String, String> getParams() throws AuthFailureError {\r\n return super.getParams();\r\n }\r\n\r\n };\r\n SDKControl.getInstance().cancelPendingRequests(new RequestQueue.RequestFilter() {\r\n @Override\r\n public boolean apply(Request<?> request) {\r\n return true;\r\n }\r\n });\r\n SDKControl.getInstance().cancelPendingRequests(SDKHelper.TAG_SEND_TRANS);\r\n jsonObjReq.setRetryPolicy(new DefaultRetryPolicy(SDKHelper.WEBCALL_TIMEOUT, SDKHelper.RETRY_COUNT,\r\n DefaultRetryPolicy.DEFAULT_BACKOFF_MULT));\r\n jsonObjReq.setShouldCache(false);\r\n // Adding request to request queue\r\n SDKControl.getInstance().addToRequestQueue(jsonObjReq, SDKHelper.TAG_SEND_TRANS);\r\n\r\n }", "private void automaticPayment(String accountName, String reciever, String billName, final int amount, String date) {\n Log.d(TAG, \"makeTransaction: Has been called\");\n final DocumentReference senderDocRef = db.collection(\"users\").document(user.getEmail())\n .collection(\"accounts\").document(accountName);\n\n final DocumentReference recieverDocRef = db.collection(\"companies\").document(reciever);\n\n final DocumentReference billDocRef = db.collection(\"companies\").document(reciever).collection(\"customer\")\n .document(user.getEmail()).collection(\"bills\").document(billName);\n\n db.runTransaction(new Transaction.Function<Void>() {\n @Override\n public Void apply(Transaction transaction) throws FirebaseFirestoreException {\n DocumentSnapshot sender = transaction.get(senderDocRef);\n DocumentSnapshot reciever = transaction.get(recieverDocRef);\n\n\n int senderBalance = sender.getLong(\"balance\").intValue();\n int recieverBalance = reciever.getLong(\"amount\").intValue();\n int transactionBalance = Math.abs(amount);\n\n if (senderBalance >= transactionBalance) {\n transaction.update(senderDocRef, \"balance\", senderBalance - transactionBalance);\n transaction.update(recieverDocRef, \"amount\", recieverBalance + transactionBalance);\n transaction.update(billDocRef, \"isPaid\", true);\n\n\n SimpleDateFormat dateformat = new SimpleDateFormat(\"dd-MM-yyyy\");\n Date newDate = new Date();\n Calendar cal = Calendar.getInstance();\n cal.setTime(newDate);\n cal.add(Calendar.MONTH, 1);\n newDate = cal.getTime();\n transaction.update(billDocRef, \"recurring\", dateformat.format(newDate));\n } else {\n Log.d(TAG, \"apply: Transaction ikke fuldført\");\n }\n\n // Success\n return null;\n }\n }).addOnSuccessListener(new OnSuccessListener<Void>() {\n @Override\n public void onSuccess(Void aVoid) {\n Log.d(TAG, \"Transaction success!\");\n }\n })\n .addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n Log.w(TAG, \"Transaction failure.\", e);\n }\n });\n\n }", "public void addTransaction\n \t\t(SIPServerTransaction serverTransaction) throws IOException {\n \tsynchronized (serverTransactions) {\n \t\tthis.serverTransactions.add(serverTransaction);\n \t\tserverTransaction.map();\n \t}\n }", "@Test\n public void processTransactionManagerCaseC()\n {\n acc_db.addAccount(acc);\n acc_db.addAccount(acc2);\n\n acc3 = new Account(3,\"Jacob&Leon3\",2000);\n acc_db.addAccount(acc3);\n\n\n trans_mang.processTransaction(acc.get_Account_Number(), acc2.get_Account_Number(), 30);\n\n Assert.assertEquals(false,trans_mang.processTransaction(acc3.get_Account_Number(),acc2.get_Account_Number(),30));\n }", "@Test\n public void processTransactionManagerCaseB()\n {\n acc_db.addAccount(acc);\n acc_db.addAccount(acc2);\n\n Assert.assertEquals(true,trans_mang.processTransaction(acc.get_Account_Number(),acc2.get_Account_Number(),30));\n }", "protected boolean isTransferTransactionValid(StateTransferTransaction tr) {\n\t\tString fromAddressPublicKey = ((StateTransferTransaction)tr).from;\n\t\tString toAddressPublicKey = ((StateTransferTransaction)tr).to;\t\t\t\t\n\t\tdouble amount = ((StateTransferTransaction)tr).amount;\n\t\tint nonce = ((StateTransferTransaction)tr).getNonce();\n\t\t\t\n\t\t// getting the fromAccount to be modified\n\t\tAccountInterface accountFromModify = null;\n\t\tint accountFromModifyFound = 0;\n\t\tboolean accountFromIsGood = false;\n\t\tfor(AccountInterface account: accounts) {\n\t\t\tif (account.getAddress().equals(fromAddressPublicKey)){\n\t\t\t\taccountFromModify = account;\n\t\t\t\taccountFromModifyFound ++;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (accountFromModifyFound > 1) {\n\t\t\t// more than one account is found ?? -> raise error\n\t\t\tServiceBus.logger.log(\"more than one matching account has been found at transfer transaction TrID : \" + tr.getTransctionId());\n\t\t\treturn false;\n\t\t}\n\t\telse if (accountFromModifyFound == 1) {\n\t\t\tif (tr.getNonce() != accountFromModify.getNonce() + 1) {\n\t\t\t\t// error -> nonce not matching -> pssible replay attack\n\t\t\t\tServiceBus.logger.log(\"Nonce is not valid at transaction, possible replay aatack\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse {\t\t\t\t\n\t\t\t\tif (accountFromModify.getBalance() < amount){\n\t\t\t\t\t// not enoguh fund on the account\n\t\t\t\t\tServiceBus.logger.log(\"Not enoguh fund on the account at transfer transaction TrID : \" + tr.getTransctionId());\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t// all cool but still not return because the second account has to be checked as well\n\t\t\t\telse {\n\t\t\t\t\taccountFromIsGood = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t\n\t\t}else if (accountFromModifyFound == 0) {\n\t\t\t// error, if the account does not exist, you can not transfer money from that\n\t\t\tServiceBus.logger.log(\"The account from which you want to transfer the fund does not exist, TrID : \" + tr.getTransctionId());\n\t\t\treturn false;\n\t\t}\n\t\t\n\n\t\t// getting the toAccount to be modified\n\t\tAccountInterface accountToModify = null;\n\t\tint accountToModifyFound = 0;\n\t\tboolean accountToIsGood = false;\n\t\tfor(AccountInterface account: accounts) {\n\t\t\tif (account.getAddress().equals(toAddressPublicKey)){\n\t\t\t\taccountToModify = account;\n\t\t\t\taccountToModifyFound ++;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (accountToModifyFound > 1) {\n\t\t\t// more than one account is found ?? -> raise error\n\t\t\tServiceBus.logger.log(\"More than one account is found at matching the transfer transaction TrID : \" + tr.getTransctionId());\n\t\t\treturn false;\n\t\t}\n\t\telse if (accountToModifyFound == 1) {\n\t\t\taccountToIsGood = true;\n\t\t\t\t\n\t\t}else if (accountToModifyFound == 0) {\n\t\t\t// error, if the account does not exist, you can not transfer money from that\n\t\t\tServiceBus.logger.log(\"The to account does not exist, TrID : \" + tr.getTransctionId());\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t// transfer is only possible if the asset type is the same, otherwise it is an exchange\n\t\tif (!accountToModify.getAssetType().equals(accountFromModify.getAssetType())){\n\t\t\t// error, from and to asset type must be the same\n\t\t\tServiceBus.logger.log(\"From and to asset type must be the same, TrID : \" + tr.getTransctionId(), Severity.WARNING);\n\t\t\treturn false;\t\t\t\n\t\t}\n\t\t\t\t\n\t\t// final check if all good return true\n\t\tif (accountFromIsGood && accountToIsGood){\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t// default value\n\t\treturn false;\t\t\t\n\t}", "public void processTransaction(String userName, String merchantName, double transactionAmount) throws Exception {\n User user = userManagementService.getUserFromUserName(userName);\n if(user == null)\n throw new Exception(USER_NOT_FOUND);\n\n Merchant merchant = merchantManagementService.getMerchantFromName(merchantName);\n if(merchant == null)\n throw new Exception(MERCHANT_NOT_FOUND);\n\n if(!isValidTransaction(user.getRemainingCreditLimit(), transactionAmount))\n throw new Exception(INVALID_TRANSACTION);\n\n //update remainingCreditLimit\n user.updateRemainingCreditLimit(transactionAmount);\n\n //update dueAmount\n user.updateDueAmount(transactionAmount);\n\n Transaction transaction = new Transaction(userName, merchantName, transactionAmount);\n\n //update discount\n double discountAmount = transactionAmount * merchant.getDiscountPercentage();\n transaction.setDiscountAmount(discountAmount);\n\n //update actualPayableAmount\n double actualPayableAmount = transactionAmount - discountAmount;\n transaction.setActualPaybleAmount(actualPayableAmount);\n\n //save the transaction\n transactions.add(transaction);\n }", "Collection lookupTransactions(String email);", "public abstract Response makeTransfer(Transaction transaction) throws AccountNotFoundException, InsufficientFundsException;", "private void insertTestTransactionsForAccount(SmsAccount smsAccount) {\n\n\t\tint g = 10000;\n\t\tfor (int i = 0; i < 10; i++) {\n\t\t\tSmsTransaction smsTransaction = new SmsTransaction();\n\t\t\tsmsTransaction.setCreditBalance(10L);\n\t\t\tsmsTransaction.setSakaiUserId(\"sakaiUserId\" + i);\n\t\t\tsmsTransaction.setTransactionDate(new Date(System\n\t\t\t\t\t.currentTimeMillis()\n\t\t\t\t\t+ g));\n\t\t\tsmsTransaction.setTransactionTypeCode(\"TC\");\n\t\t\tsmsTransaction.setTransactionCredits(666);\n\t\t\tsmsTransaction.setSmsAccount(smsAccount);\n\t\t\tsmsTransaction.setSmsTaskId(1L);\n\t\t\tg += 1000;\n\t\t\thibernateLogicLocator.getSmsTransactionLogic()\n\t\t\t\t\t.insertReserveTransaction(smsTransaction);\n\t\t}\n\t}", "@Test\n public void processTransactionManagerCaseA()\n {\n acc_db.addAccount(acc);\n acc_db.addAccount(acc2);\n\n Assert.assertEquals(false,trans_mang.processTransaction(acc.get_Account_Number(),acc2.get_Account_Number(),2000));\n }", "public Task(Account[] allAccounts, String trans) {\n accounts = allAccounts;\n transaction = trans;\n }", "public void saveTransaction(Transaction transaction) {\r\n Session session = HibernateUtil.getSessionFactory().getCurrentSession();\r\n try {\r\n org.hibernate.Transaction hbtransaction = session.beginTransaction();\r\n // don't save \"duplicate\" transactions\r\n Query q = session.createQuery (\"from finance.entity.Transaction trans WHERE trans.transdate = :transdate AND trans.amount = :amount AND trans.vendor = :vendor AND trans.account.uid = :accountuid\");\r\n q.setParameter(\"transdate\", transaction.getTransdate());\r\n q.setParameter(\"amount\", transaction.getAmount());\r\n q.setParameter(\"vendor\", transaction.getVendor());\r\n Account acct = transaction.getAccount();\r\n q.setParameter(\"accountuid\", acct.getUid());\r\n List<Transaction> transactionList = (List<Transaction>) q.list();\r\n if (transactionList.isEmpty()) {\r\n session.save(transaction);\r\n }\r\n hbtransaction.commit();\r\n } catch (Exception e) {\r\n throw e;\r\n }\r\n }", "public List<TransferEventResponse> getTransferEvents(KlayTransactionReceipt.TransactionReceipt transactionReceipt) {\n List<SmartContract.EventValuesWithLog> valueList = extractEventParametersWithLog(TRANSFER_EVENT, transactionReceipt);\n ArrayList<TransferEventResponse> responses = new ArrayList<TransferEventResponse>(valueList.size());\n for (SmartContract.EventValuesWithLog eventValues : valueList) {\n TransferEventResponse typedResponse = new TransferEventResponse();\n typedResponse.log = eventValues.getLog();\n typedResponse.from = (String) eventValues.getIndexedValues().get(0).getValue();\n typedResponse.to = (String) eventValues.getIndexedValues().get(1).getValue();\n typedResponse.value = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue();\n responses.add(typedResponse);\n }\n return responses;\n }", "public void addTransaction(String s) {\r\n\t\ttransactions.add(s);\r\n\t}", "public void addTransaction\n \t\t(SIPClientTransaction clientTransaction) {\n \tsynchronized (clientTransactions) {\n \t\tclientTransactions.add(clientTransaction);\n \t}\n }", "@Test\n public void testTariffTransaction ()\n {\n initializeService();\n accountingService.addTariffTransaction(TariffTransaction.Type.SIGNUP,\n tariffB1, customerInfo1, 2, 0.0, 42.1);\n accountingService.addTariffTransaction(TariffTransaction.Type.CONSUME,\n tariffB1, customerInfo2, 7, -77.0, 7.7);\n accountingService.addRegulationTransaction(tariffB1, customerInfo1,\n 2, 10.0, -2.5);\n accountingService.addRegulationTransaction(tariffB1, customerInfo2,\n 7, -10.0, 2.0);\n assertEquals(4, accountingService.getPendingTransactions().size(), \"correct number in list\");\n assertEquals(4, accountingService.getPendingTariffTransactions().size(), \"correct number in ttx list\");\n List<BrokerTransaction> pending = accountingService.getPendingTransactions();\n List<BrokerTransaction> signups = filter(pending,\n new Predicate<BrokerTransaction>() {\n public boolean apply (BrokerTransaction tx) {\n return (tx instanceof TariffTransaction &&\n ((TariffTransaction)tx).getTxType() == TariffTransaction.Type.SIGNUP);\n }\n });\n assertEquals(1, signups.size(), \"one signup\");\n TariffTransaction ttx = (TariffTransaction)signups.get(0);\n assertNotNull(ttx, \"first ttx not null\");\n assertEquals(42.1, ttx.getCharge(), 1e-6, \"correct charge id 0\");\n Broker b1 = ttx.getBroker();\n Broker b2 = brokerRepo.findById(bob.getId());\n assertEquals(b1, b2, \"same broker\");\n List<BrokerTransaction> consumes = filter(pending,\n new Predicate<BrokerTransaction>() {\n public boolean apply (BrokerTransaction tx) {\n return (tx instanceof TariffTransaction &&\n ((TariffTransaction)tx).getTxType() == TariffTransaction.Type.CONSUME);\n }\n });\n assertEquals(2, consumes.size(), \"two consumes\");\n ttx = (TariffTransaction)consumes.get(0);\n assertNotNull(ttx, \"second ttx not null\");\n TariffTransaction ttx1 = (TariffTransaction)consumes.get(1);\n assertNotNull(ttx1, \"third ttx not null\");\n if (ttx.isRegulation()) {\n // swap\n ttx = ttx1;\n ttx1 = (TariffTransaction)consumes.get(0);\n }\n assertEquals(-77.0, ttx.getKWh(), 1e-6, \"correct amount 1\");\n assertFalse(ttx.isRegulation(), \"not regulation\");\n assertEquals(-10.0, ttx1.getKWh(), 1e-6, \"correct amount 2\");\n assertTrue(ttx1.isRegulation(), \"regulation\");\n List<BrokerTransaction> produces = filter(pending,\n new Predicate<BrokerTransaction>() {\n public boolean apply (BrokerTransaction tx) {\n return (tx instanceof TariffTransaction &&\n ((TariffTransaction)tx).getTxType() == TariffTransaction.Type.PRODUCE);\n }\n });\n assertEquals(1, produces.size(), \"one produce\");\n ttx = (TariffTransaction)produces.get(0);\n assertEquals(10.0, ttx.getKWh(), 1e-6, \"correct amount 3\");\n assertTrue(ttx.isRegulation(), \"regulation\");\n }", "public static Transaction generateSendTransaction(String strPrivateKey, String creatorAddress, String receiverAddress,\n TransactionHistory transactionHistory) {\n List<Creation> creations = new ArrayList<Creation>();\n List<Input> inputs = new ArrayList<Input>();\n List<Output> outputs = new ArrayList<Output>();\n\n // Get sender address from private key\n BigInteger privateKey = Bitcoin.decodePrivateKey(strPrivateKey);\n byte[] publicKey = Bitcoin.generatePublicKey(privateKey);\n String senderAddress = Bitcoin.publicKeyToAddress(publicKey);\n\n // Variable for counting number of coupons in referred transaction outputs\n int couponsInInputs = 0;\n\n // Find previous transaction outputs to refer to\n Iterator<Transaction> transactionIterator = transactionHistory.iterator();\n while (transactionIterator.hasNext() && couponsInInputs < 1) {\n Transaction transaction = transactionIterator.next();\n Iterator<Output> outputIterator = transaction.getOutputs().iterator();\n while (outputIterator.hasNext() && couponsInInputs < 1) {\n Output output = outputIterator.next();\n if (output.getCreatorAddress().equals(creatorAddress) && output.getAddress().equals(senderAddress)\n && output.getInputId() == 0) {\n Input input = new Input(output.getOutputId());\n inputs.add(input);\n couponsInInputs += output.getAmount();\n }\n }\n }\n\n // Check if enough coupons are available\n if (couponsInInputs <= 0) {\n throw new IllegalArgumentException();\n }\n\n // Set that 1 coupon should be sent to receiver address\n Output output = new Output(creatorAddress, 1, receiverAddress);\n outputs.add(output);\n\n // Send remaining coupons in referred transaction outputs back to the user as change\n if (couponsInInputs > 1) {\n Output changeOutput = new Output(creatorAddress, couponsInInputs - 1, senderAddress);\n outputs.add(changeOutput);\n }\n\n // Create transaction, sign it and return it\n Transaction transaction = new Transaction(creations, inputs, outputs);\n transaction.signTransaction(privateKey);\n return transaction;\n\n }", "public void PushTransaction(Transaction new_transaction){\n try{\n \n FileWriter fileWriter = new FileWriter(\"C:\\\\Users\\\\cmpun\\\\Desktop\\\\SoftwareEngineeringProject\\\\src\\\\softwareengineeringproject\\\\TransactionLog.txt\", true);\n\n fileWriter.write(new_transaction.Date + \",\" + new_transaction.processed_items + \",\" + new_transaction.Total + \"\\n\");\n \n fileWriter.close();\n\n }catch(Exception E){\n \n System.out.println(\"Unable to enter transaction into Log...\");\n \n }\n \n }", "@Override\n\tpublic boolean send(String userId, ArrayList<String> transactionIds,\n\t\t\tfloat netValue) {\n\t\t// TODO Auto-generated method stub\n\t\t// Account senderAccount = accountManager.getAccountByUserId(userId);\n\t\tAccount senderAccount = accountManager.getAccountByUserId(userId);\n\t\tif (senderAccount == null) {\n\t\t\ttry {\n\t\t\t\tsenderAccount = accountDao.getByUserId(userId);\n\t\t\t\tif (senderAccount == null)\n\t\t\t\t\treturn false;\n\t\t\t} catch (AccountNotFoundException e) {\n\t\t\t\tSystem.out.println(e.getMessage());\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t}\n\t\tUser sender;// = userManager.getUser(senderAccount);\n\t\tif (userManager.hasUser(senderAccount)) {\n\t\t\tsender=utils.reinitializeUser(senderAccount);\n\t\t\tif(sender==null)\n\t\t\t{\n\t\t\t\t//throw exception\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\tsender = userManager.getUser(senderAccount);\n\t\tArrayList<Transaction> transactions = sender\n\t\t\t\t.getTransactions(transactionIds);\n\t\t// this below statement also sets the receiver objects depending on the\n\t\t// transactions\n\t\tSuggestion newSuggestion = suggestionCreator.createSuggestion(\n\t\t\t\tsenderAccount, transactions, netValue);\n\t\tString suggestionId = suggestionDao.addSuggestion(newSuggestion);\n\t\tif (suggestionId == null) {\n\t\t\tsuggestionId = suggestionDao.addSuggestion(newSuggestion);\n\t\t\tif (suggestionId == null) {\n\t\t\t\t// an exception should be thrown\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\tnewSuggestion.setSuggestionId(suggestionId);\n\t\tArrayList<SuggestionReceiver> receivers = newSuggestion.getReceivers();\n\t\tsender.addSuggestion(newSuggestion);\n\t\tfor (int i = 0; i < receivers.size(); i++) {\n\t\t\t// we are creating seperate notification object for each receiver so\n\t\t\t// each one of them has its own identity\n\t\t\tNotification newNotification = notificationCreator\n\t\t\t\t\t.createNotification(senderAccount, transactionIds,\n\t\t\t\t\t\t\tnetValue, true, false,\n\t\t\t\t\t\t\tnewSuggestion.getSuggestionId(), receivers.get(i)\n\t\t\t\t\t\t\t\t\t.getReceiver().getUserId());\n\t\t\tUser receiver;\n\t\t\tif (!userManager.hasUser(receivers.get(i).getReceiver())) {\n\t\t\t\treceiver = userManager.reInitializeUser(receivers.get(i)\n\t\t\t\t\t\t.getReceiver());\n\t\t\t\t// fix this\n\t\t\t}\n\t\t\treceiver = userManager.getUser(receivers.get(i).getReceiver());\n\t\t\treceiver.addNewNotification(newNotification);\n\t\t\tuserManager.setUser(receiver);\n\t\t}\n\t\treturn true;\n\t}", "@RequestMapping(value = \"/accounts/transaction\", method = RequestMethod.POST)\n\tpublic ResponseEntity<String> transaction(\n\t\t\t@RequestBody Transaction transaction) {\n\t\tlogger.debug(\"AccountController.transaction: \" + transaction.toString());\n\t\tif (transaction.getType().equals(TransactionType.DEBIT)) {\n\t\t\tlogger.debug(\"debit transaction\");\n\t\t\tAccount accountResponse = this.service.findAccount(transaction\n\t\t\t\t\t.getAccountId());\n\n\t\t\tBigDecimal currentBalance = accountResponse.getBalance();\n\n\t\t\tBigDecimal newBalance = currentBalance.subtract(transaction\n\t\t\t\t\t.getAmount());\n\n\t\t\tif (newBalance.compareTo(BigDecimal.ZERO) >= 0) {\n\t\t\t\taccountResponse.setBalance(newBalance);\n\t\t\t\tthis.service.saveAccount(accountResponse);\n\t\t\t\t// TODO save transaction?\n\t\t\t\tlogger.debug(\"transaction processed.\");\n\t\t\t\treturn new ResponseEntity<String>(\"SUCCESS\",\n\t\t\t\t\t\tgetNoCacheHeaders(), HttpStatus.OK);\n\n\t\t\t} else {\n\t\t\t\t// no sufficient founds available\n\t\t\t\treturn new ResponseEntity<String>(\"FAILED\",\n\t\t\t\t\t\tgetNoCacheHeaders(), HttpStatus.EXPECTATION_FAILED);\n\t\t\t}\n\n\t\t} else if (transaction.getType().equals(TransactionType.CREDIT)) {\n\t\t\tlogger.debug(\"credit transaction\");\n\t\t\tAccount accountResponse = this.service.findAccount(transaction.getAccountId());\n\n\t\t\tBigDecimal currentBalance = accountResponse.getBalance();\n\n\t\t\tlogger.debug(\"AccountController.transaction: current balance='\"\n\t\t\t\t\t+ currentBalance + \"'.\");\n\n\t\t\tif (transaction.getAmount().compareTo(BigDecimal.ZERO) > 0) {\n\n\t\t\t\tBigDecimal newBalance = currentBalance.add(transaction.getAmount());\n\t\t\t\tlogger.debug(\"AccountController.increaseBalance: new balance='\"\n\t\t\t\t\t\t+ newBalance + \"'.\");\n\n\t\t\t\taccountResponse.setBalance(newBalance);\n\t\t\t\tthis.service.saveAccount(accountResponse);\n\t\t\t\t// TODO save transaction?\n\t\t\t\treturn new ResponseEntity<String>(\"SUCCESS\", getNoCacheHeaders(), HttpStatus.OK);\n\n\t\t\t} else {\n\t\t\t\t// amount can not be negative for increaseBalance, please use\n\t\t\t\t// decreaseBalance\n\t\t\t\treturn new ResponseEntity<String>(\"FAILED\", getNoCacheHeaders(),\n\t\t\t\t\t\tHttpStatus.EXPECTATION_FAILED);\n\t\t\t}\n\n\t\t}\n\t\treturn null;\n\t}", "protected boolean applyTransferTransaction(StateTransferTransaction tr) {\n\t\tString fromAddress = ((StateTransferTransaction)tr).from;\n\t\tString toAddress = ((StateTransferTransaction)tr).to;\t\t\t\t\n\t\tDouble amount = ((StateTransferTransaction)tr).amount;\n\n\t\tfor(AccountInterface account: accounts) {\n\t\t\tif (account.getAddress().equals(fromAddress)){\n\t\t\t\taccount.decreaseBalance(amount);\n\t\t\t\taccount.decreaseBalance(amount);\t\t\t\t\t\t\t\n\t\t\t}\n\t\t}\n\n\t\tfor(AccountInterface account: accounts) {\n\t\t\tif (account.getAddress().equals(toAddress)){\n\t\t\t\taccount.decreaseBalance(amount);\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "@Test\n public void processCompoundTransaction_TestD() throws Exception {\n ct = new CompoundTransaction(\"compound1\");\n ct1 = new CompoundTransaction(\"compound2\");\n\n acc3 = new Account(3,\"Jacob&Leon3\",2000);\n\n acc_db.addAccount(acc);\n acc_db.addAccount(acc2);\n acc_db.addAccount(acc3);\n\n ct.addTransaction(new Transaction(\"atomic1\", acc_db,acc.get_Account_Number(),acc2.get_Account_Number(),100));\n ct.addTransaction(new Transaction(\"atomic2\", acc_db,acc3.get_Account_Number(),acc2.get_Account_Number(),100));\n\n ct1.addTransaction(new Transaction(\"atomic3\",acc_db,acc.get_Account_Number(),acc2.get_Account_Number(),200));\n\n ct.addTransaction(ct1);\n\n Assert.assertEquals(true,trans_mang.processCompoundTransaction(ct));\n }", "private boolean checkIfTransactionIsPossible(Account sender, Account receiver){\n if ((sender.getType() == Account.TypeEnum.SAVING) || (receiver.getType() == Account.TypeEnum.SAVING) ){\n // one cannot directly transfer from a savings account to an account that is not of the same customer\n if (sender.getOwnerId() == receiver.getOwnerId()) {\n if (!sender.getIBAN().equals(receiver.getIBAN())) {\n return true;\n } else {\n throw new IllegalArgumentException(\"Accounts sender and receiver cannot be the same account\");\n }\n } else {\n throw new IllegalArgumentException(\"Saving Accounts sender or receiver cannot belong to different customers\");\n }\n }\n //if senderAccount is Checking, can send money to other checking account or his own saving account\n else if(sender.getType() == Account.TypeEnum.CHECKING){\n if (!sender.getIBAN().equals(receiver.getIBAN())) {\n return true;\n } else {\n throw new IllegalArgumentException(\"Accounts sender and receiver cannot be the same account\");\n }\n }\n return false;\n }", "public boolean AddTransactionToAccount(Double transaction)\n {\n\n if(this.transactions.add(transaction)){\n System.out.println(\"Failed to add transaction: \" + transaction);\n return false;\n }\n System.out.println(\"Successfully added Transaction: \" + transaction);\n return true;\n }", "protected boolean isTransferTransactionValidEx(StateTransferTransaction tr) {\n\t\tString fromAddressPublicKey = ((StateTransferTransaction)tr).from;\n\t\tString toAddressPublicKey = ((StateTransferTransaction)tr).to;\t\t\t\t\n\t\tdouble amount = ((StateTransferTransaction)tr).amount;\n\t\tint nonce = ((StateTransferTransaction)tr).getNonce();\n\t\t\t\n\t\t// getting the fromAccount to be modified\n\t\tAccountInterface accountFromModify = null;\n\t\tint accountFromModifyFound = 0;\n\t\tboolean accountFromIsGood = false;\n\t\tfor(AccountInterface account: accounts) {\n\t\t\tif (account.getAddress().equals(fromAddressPublicKey)){\n\t\t\t\taccountFromModify = account;\n\t\t\t\taccountFromModifyFound ++;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (accountFromModifyFound > 1) {\n\t\t\t// more than one account is found ?? -> raise error\n\t\t\tServiceBus.logger.log(\"more than one matching account has been found at transfer transaction TrID : \" + tr.getTransctionId());\n\t\t\treturn false;\n\t\t}\n\t\telse if (accountFromModifyFound == 1) {\n\t\t\tif (tr.getNonce() != accountFromModify.getNonce() + 1) {\n\t\t\t\t// error -> nonce not matching -> pssible replay attack\n\t\t\t\tServiceBus.logger.log(\"Nonce is not valid at transaction, possible replay aatack\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse {\t\t\t\t\n\t\t\t\tif (accountFromModify.getBalance() < amount){\n\t\t\t\t\t// not enoguh fund on the account\n\t\t\t\t\tServiceBus.logger.log(\"Not enoguh fund on the account at transfer transaction TrID : \" + tr.getTransctionId());\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t// all cool but still not return because the second account has to be checked as well\n\t\t\t\telse {\n\t\t\t\t\taccountFromIsGood = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t\n\t\t}else if (accountFromModifyFound == 0) {\n\t\t\t// error, if the account does not exist, you can not transfer money from that\n\t\t\tServiceBus.logger.log(\"The account from which you want to transfer the fund does not exist, TrID : \" + tr.getTransctionId());\n\t\t\treturn false;\n\t\t}\n\t\t\n\n\t\t// getting the toAccount to be modified\n\t\tAccountInterface accountToModify = null;\n\t\tint accountToModifyFound = 0;\n\t\tboolean accountToIsGood = false;\n\t\tfor(AccountInterface account: accounts) {\n\t\t\tif (account.getAddress().equals(toAddressPublicKey)){\n\t\t\t\taccountToModify = account;\n\t\t\t\taccountToModifyFound ++;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (accountToModifyFound > 1) {\n\t\t\t// more than one account is found ?? -> raise error\n\t\t\tServiceBus.logger.log(\"More than one account is found at matching the transfer transaction TrID : \" + tr.getTransctionId());\n\t\t\treturn false;\n\t\t}\n\t\telse if (accountToModifyFound == 1) {\n\t\t\taccountToIsGood = true;\n\t\t\t\t\n\t\t}else if (accountToModifyFound == 0) {\n\t\t\t// to account can be added to the state, asset type logic is questionable\n\t\t\t\n\t\t\tAccountBase account = new AccountBase(\n\t\t\t\t\t((StateTransferTransaction)tr).from,\n\t\t\t\t\t((StateTransferTransaction)tr).getNonce(),\n\t\t\t\t\t\"\",\n\t\t\t\t\t((StateTransferTransaction)tr).amount,\n\t\t\t\t\taccountFromModify.getAssetType());\t\n\t\t\taccounts.add(account);\n\t\t\t\n\t\t\taccountToIsGood = true;\n\t\t}\n\t\t\n\t\t// transfer is only possible if the asset type is the same, otherwise it is an exchange\n\t\tif (!accountToModify.getAssetType().equals(accountFromModify.getAssetType())){\n\t\t\t// error, from and to asset type must be the same\n\t\t\tServiceBus.logger.log(\"From and to asset type must be the same, TrID : \" + tr.getTransctionId(), Severity.WARNING);\n\t\t\treturn false;\t\t\t\n\t\t}\n\t\t\t\t\n\t\t// final check if all good return true\n\t\tif (accountFromIsGood && accountToIsGood){\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t// default value\n\t\treturn false;\t\t\t\n\t}", "private void updateTransaction() {\n LogUtils.logEnterFunction(Tag);\n\n String inputtedAmount = etAmount.getText().toString().trim().replaceAll(\",\", \"\");\n if (inputtedAmount.equals(\"\") || Double.parseDouble(inputtedAmount) == 0) {\n etAmount.setError(getResources().getString(R.string.Input_Error_Amount_Empty));\n return;\n }\n\n if (mAccount == null) {\n ((ActivityMain) getActivity()).showError(getResources().getString(R.string.Input_Error_Account_Empty));\n return;\n }\n\n Double amount = Double.parseDouble(inputtedAmount);\n int categoryId = mCategory != null ? mCategory.getId() : 0;\n String description = tvDescription.getText().toString();\n int accountId = mAccount.getId();\n String strEvent = tvEvent.getText().toString();\n Event event = null;\n\n if (!strEvent.equals(\"\")) {\n event = mDbHelper.getEventByName(strEvent);\n if (event == null) {\n long eventId = mDbHelper.createEvent(new Event(0, strEvent, mCal, null));\n if (eventId != -1) {\n event = mDbHelper.getEvent(eventId);\n }\n }\n }\n\n // Less: Repayment, More: Lend\n if(mCategory.getDebtType() == Category.EnumDebt.LESS || mCategory.getDebtType() == Category.EnumDebt.MORE) {\n\n boolean isDebtValid = true;\n if(mCategory.getDebtType() == Category.EnumDebt.LESS) { // Income -> Debt Collecting\n List<Debt> debts = mDbHelper.getAllDebtByPeople(tvPeople.getText().toString());\n\n Double lend = 0.0, debtCollect = 0.0;\n for(Debt debt : debts) {\n if(mDbHelper.getCategory(debt.getCategoryId()).isExpense() && mDbHelper.getCategory(debt.getCategoryId()).getDebtType() == Category.EnumDebt.MORE) {\n lend += debt.getAmount();\n }\n\n if(!mDbHelper.getCategory(debt.getCategoryId()).isExpense() && mDbHelper.getCategory(debt.getCategoryId()).getDebtType() == Category.EnumDebt.LESS) {\n debtCollect += debt.getAmount();\n }\n }\n\n if(debtCollect + amount > lend) {\n isDebtValid = false;\n ((ActivityMain) getActivity()).showError(getResources().getString(R.string.message_debt_collect_invalid));\n }\n\n } // End DebtType() == Category.EnumDebt.LESS\n if(isDebtValid) {\n Transaction transaction = new Transaction(mTransaction.getId(),\n TransactionEnum.Income.getValue(),\n amount,\n categoryId,\n description,\n 0,\n accountId,\n mCal,\n 0.0,\n \"\",\n event);\n\n int row = mDbHelper.updateTransaction(transaction);\n if (row == 1) { // Update transaction OK\n\n if(mDbHelper.getDebtByTransactionId(mTransaction.getId()) != null) {\n Debt debt = mDbHelper.getDebtByTransactionId(mTransaction.getId());\n debt.setCategoryId(mCategory.getId());\n debt.setAmount(amount);\n debt.setPeople(tvPeople.getText().toString());\n\n int debtRow = mDbHelper.updateDebt(debt);\n if(debtRow == 1) {\n ((ActivityMain) getActivity()).showToastSuccessful(getResources().getString(R.string.message_transaction_update_successful));\n cleanup();\n // Return to last fragment\n getFragmentManager().popBackStackImmediate();\n } else {\n // Revert update\n mDbHelper.updateTransaction(mTransaction);\n ((ActivityMain) getActivity()).showToastSuccessful(getResources().getString(R.string.message_transaction_update_fail));\n }\n } else {\n Debt newDebt = new Debt();\n newDebt.setCategoryId(mCategory.getId());\n newDebt.setTransactionId((int) mTransaction.getId());\n newDebt.setAmount(amount);\n newDebt.setPeople(tvPeople.getText().toString());\n\n long debtId = mDbHelper.createDebt(newDebt);\n if(debtId != -1) {\n ((ActivityMain) getActivity()).showToastSuccessful(getResources().getString(R.string.message_transaction_create_successful));\n cleanup();\n // Return to last fragment\n getFragmentManager().popBackStackImmediate();\n } else {\n // Revert update\n mDbHelper.updateTransaction(mTransaction);\n ((ActivityMain) getActivity()).showToastSuccessful(getResources().getString(R.string.message_transaction_update_fail));\n }\n } // End create new Debt\n\n } // End Update transaction OK\n } // End isDebtValid\n\n } else { // CATEGORY NORMAL\n Transaction transaction = new Transaction(mTransaction.getId(),\n TransactionEnum.Income.getValue(),\n amount,\n categoryId,\n description,\n 0,\n accountId,\n mCal,\n 0.0,\n \"\",\n event);\n\n int row = mDbHelper.updateTransaction(transaction);\n if (row == 1) { // Update transaction OK\n if(mDbHelper.getDebtByTransactionId(mTransaction.getId()) != null) {\n mDbHelper.deleteDebt(mDbHelper.getDebtByTransactionId(mTransaction.getId()).getId());\n }\n // Return to last fragment\n getFragmentManager().popBackStackImmediate();\n }\n }\n\n LogUtils.logLeaveFunction(Tag);\n }", "@Test\n\tpublic void testTransfer() {\n\t\tAccount acc1 = new Account(00000, \"acc1\", true, 1000.00, 0, false);\n\t\tAccount acc2 = new Account(00001, \"acc2\", true, 1000.00, 0, false);\n\t\taccounts.add(acc1);\n\t\taccounts.add(acc2);\n\n\t\ttransactions.add(0, new Transaction(10, \"acc1\", 00000, 0, \"\"));\n\t\ttransactions.add(1, new Transaction(02, \"acc1\", 00000, 200.00, \"\"));\n\t\ttransactions.add(2, new Transaction(02, \"acc2\", 00001, 200.00, \"\"));\n\t\ttransactions.add(3, new Transaction(00, \"acc1\", 00000, 0, \"\"));\n\n\t\ttransHandler = new TransactionHandler(accounts, transactions);\n\t\toutput = transHandler.HandleTransactions();\n\n\t\t// ArrayList<Account> expected = new ArrayList();\n\t\t// expected.add(0, new Account(00000, \"acc1\", true, 949.90, 0002, false));\n\t\t// expected.add(1, new Account(00001, \"acc2\", true, 1050.00, 0002, false));\n\n\t\tif (outContent.toString().contains(\"Money Transfered\")) {\n\t\t\ttestResult = true;\n\t\t} else {\n\t\t\ttestResult = false;\n\t\t}\n\n\t\tassertTrue(\"money not transfered\", testResult);\n\t}", "public boolean doTransaction() {\r\n int nonce = -1;\r\n TransactionOperation transactionOperation = null;\r\n try {\r\n double balance;\r\n \r\n //read the stream for requests from client\r\n byte[] cipherText = (byte [])is.readObject();\r\n \r\n // decrypt the ciphertext to obtain the signed message\r\n ATMSessionMessage atmSessionMessage = (ATMSessionMessage) crypto.decryptRijndael(cipherText, kSession);\r\n if(!(currTimeStamp < atmSessionMessage.getTimeStamp())) error (\"Time stamp does not match\");\r\n \r\n //interpret the transaction operation in the request\r\n SignedMessage signedMessage = atmSessionMessage.getSignedMessage();\r\n \r\n \r\n \t\t//verify signature\r\n \t\ttry {\r\n \t\t\tif(!crypto.verify(signedMessage.msg, signedMessage.signature, currAcct.kPub))\r\n \t\t\t{\r\n \t\t\t\tSystem.out.println(\"Digital signature failed...\");\r\n \t\t\t}\r\n \t\t\tSystem.out.println(\"Message signature valid...\");\r\n \t\t} catch (SignatureException e2) {\r\n \t\t\te2.printStackTrace();\r\n \t\t\treturn false;\r\n \t\t} catch (KeyException e2) {\r\n \t\t\te2.printStackTrace();\r\n \t\t\treturn false;\r\n \t\t}\r\n \t\t\r\n TransactionMessage transactionMessage = (TransactionMessage)signedMessage.getObject();\r\n transactionOperation = transactionMessage.getOperation();\r\n \r\n //print the signed message\r\n System.out.println(\"\\n\" + (new Date()).toString());\r\n System.out.println(signedMessage.toString());\r\n \r\n //strip out the parameters embedded \r\n nonce = atmSessionMessage.getNonce();\r\n double value = transactionMessage.getValue();\r\n \r\n //print the timestamp when the transaction takes place\r\n Date now = new Date();\r\n System.out.println(\"\\n\" + now.toString());\r\n \r\n //re-route the request to the appropriate handling function\r\n if(transactionOperation == TransactionOperation.Deposit) {\r\n \t System.out.println(\"ACCT #:\" + currAcct.getNumber() + \" DEPOSIT: \" + value);\r\n currAcct.deposit(value);\r\n \r\n System.out.println(\"\\n\" + (now).toString());\r\n System.out.println(\"Deposit Complete. BALANCE:\" + currAcct.getBalance());\r\n }\r\n else if(transactionOperation == TransactionOperation.Withdraw) {\r\n \t System.out.println(\"ACCT #:\" + currAcct.getNumber() + \" WITHDRAW: \" + value);\r\n \t currAcct.withdraw(value);\r\n \t \r\n System.out.println(\"\\n\" + (now).toString());\r\n System.out.println(\"Withdrawal Complete. BALANCE:\" + currAcct.getBalance());\r\n }\r\n else if(transactionOperation == TransactionOperation.EndSession) \r\n \t {\r\n \t \tSystem.out.println(\"\\nTerminating session with ACCT#: \" + currAcct.getNumber());\r\n \t \treturn false;\r\n \t \t\r\n \t }\r\n \r\n accts.save();\r\n //create a successful reply Success and set the balance\r\n balance = currAcct.getBalance(); \r\n transactionMessage = new TransactionMessage(MessageType.ResponseSuccess,transactionOperation,balance);\r\n atmSessionMessage = new ATMSessionMessage(transactionMessage);\r\n \r\n //set the nonce \r\n atmSessionMessage.setNonce(nonce);\r\n currTimeStamp = atmSessionMessage.getTimeStamp();\r\n //encrypt the response and send it\r\n cipherText = crypto.encryptRijndael(atmSessionMessage, kSession);\r\n os.writeObject((Serializable)cipherText);\r\n \r\n //Logging.....\r\n //get the signed message and encrypt it\r\n \r\n signedMessage.encryptMessage(this.kLog);\r\n \r\n //encrypt the action\r\n //archive the signed message for logging and non-repudiation purposes \r\n SignedAction signedAction = new SignedAction(currAcct.getNumber(), atmSessionMessage.getTimeStamp(), signedMessage);\r\n \r\n //flush out transaction record to the audit file\r\n BankServer.log.write(signedAction);\r\n \r\n\t return true;\r\n }\r\n catch(Exception e){\r\n if(e instanceof TransException) replyFailure(transactionOperation,nonce);\r\n System.out.println(\"Terminating session with ACCT#: \" + currAcct.getNumber());\r\n \t//e.printStackTrace();\r\n \r\n return true;\r\n }\r\n }", "protected final Transaction addTransactionTo(Account account,\n\t\t\tTransaction trans) {\n\t\tboolean result = account.addTransaction(trans);\n\n\t\tif (result == false) {\n\t\t\ttrans = null;\n\n\t\t\tinform(getProperty(\"error.title\") + \" \\\"\" + account + \"\\\".\",\n\t\t\t\t\tgetProperty(\"error.description\"));\n\t\t}\n\n\t\treturn trans;\n\t}", "public AccountManager(String transactionsFileName,\n String checkingAccountFileName,\n String savingsAccountFileName,\n String cdAccountFileName,\n String atmAccountFileName,\n String creditCardAccountFileName,\n String termLoanAccountFileName)\n {\n accounts = new ArrayList<>();\n\n //Load transactions first so the hash map is built\n loadTransactions(transactionsFileName);\n\n loadCheckingAccounts(checkingAccountFileName);\n loadSavingsAccounts(savingsAccountFileName);\n loadCDAccounts(cdAccountFileName);\n loadATMAccounts(atmAccountFileName);\n loadCreditCardAccounts(creditCardAccountFileName);\n loadTermLoanAccounts(termLoanAccountFileName);\n }", "public void addTransaction(EtmPoint transaction) {\n double miliseconds = transaction.getTransactionTime();\n\n measurements++;\n total += miliseconds;\n max = max > miliseconds ? max : miliseconds;\n min = min > miliseconds || min == 0 ? miliseconds : min;\n }", "void addTransaction(Transaction transaction) throws SQLException, BusinessException;", "public void addToStatement(String account, double amount, String transactionType, String accountType) {\n\t\tList<String> myList = getStatement();\n\t\tDecimalFormat df = new DecimalFormat(\".##\");\n\t\tmyList.add(LocalDate.now() +\"\\t\"+ account +\" \\t\"+ df.format(amount) +\" \\t\"+ df.format(balance) +\" \\t\"+ transactionType +\n\t\t\t\t\" \\t\" + accountType);\n\t}", "public boolean processTransaction() {\n\n // Checks to see if the signature can be verified.\n if (verifySignature() == false) {\n System.out.println(\"# Transaction signature could not be verified.\");\n return false;\n }\n\n // Gathers all transaction inputs, making sure they are unspent.\n for (TransactionInput i : inputs) {\n i.UTXO = BasicBlockchain.UTXOs.get(i.transactionOutputId);\n }\n\n // Checks if transaction amount is valid.\n if (getInputsValue() < BasicBlockchain.minimumTransaction) {\n System.out.println(\"# Transaction inputs are too small.\");\n return false;\n }\n\n // Generates transaction outputs.\n // Get value of the inputs then the leftover change.\n float leftOver = getInputsValue() - value;\n transactionId = calculateHash();\n // Send value to recipient.\n outputs.add(new TransactionOutput(this.recipient, value, transactionId));\n // Send the leftover \"change\" back to sender.\n outputs.add(new TransactionOutput(this.sender, leftOver, transactionId));\n\n\n // Adds outputs to the unspent list.\n for (TransactionOutput o : outputs) {\n BasicBlockchain.UTXOs.put(o.id, o);\n }\n\n // Removes the transaction inputs from the blockchain's UTXO list as spent.\n for (TransactionInput i : inputs) {\n if (i.UTXO == null) continue;\n BasicBlockchain.UTXOs.remove(i.UTXO.id);\n }\n\n return true;\n }", "public void pay(InternalAccountOwner from, InternalAccountOwner to, BigDecimal amount) {\n PerformPaymentData data;\n try {\n data = transactionService.getPaymentData(from, to, null);\n } catch (EntityNotFoundException e) {\n System.out.println(\"Some of the users were not found. Transaction aborted.\");\n return;\n }\n\n // try to figure out the type of payment (for some reason)\n List<TransferTypeWithCurrencyVO> types = data.getPaymentTypes();\n TransferTypeWithCurrencyVO paymentType = CollectionHelper.first(types);\n if (paymentType == null) {\n System.out.println(\"There is no possible payment type.\");\n }\n\n // set up payment to be made\n PerformPaymentDTO payment = new PerformPaymentDTO();\n payment.setType(paymentType);\n payment.setFrom(from);\n payment.setTo(to);\n payment.setAmount(amount);\n\n try {\n PaymentVO result = paymentService.perform(payment);\n TransactionAuthorizationStatus authStatus = result.getAuthorizationStatus();\n if (authStatus == TransactionAuthorizationStatus.PENDING_AUTHORIZATION) {\n System.out.println(\"The payment is pending authorization.\");\n } else {\n System.out.println(\"The payment has been processed.\");\n }\n } catch (InsufficientBalanceException e) {\n System.out.println(\"Insufficient balance\");\n } catch (MaxPaymentsPerDayExceededException e) {\n System.out.println(\"Maximum daily amount of transfers \"\n + e.getMaxPayments() + \" has been reached\");\n } catch (MaxPaymentsPerWeekExceededException e) {\n System.out.println(\"Maximum weekly amount of transfers \"\n + e.getMaxPayments() + \" has been reached\");\n } catch (MaxPaymentsPerMonthExceededException e) {\n System.out.println(\"Maximum monthly amount of transfers \"\n + e.getMaxPayments() + \" has been reached\");\n } catch (MinTimeBetweenPaymentsException e) {\n System.out.println(\"A minimum period of time should be awaited to make \"\n + \"a payment of this type\");\n } catch (MaxAmountPerDayExceededException e) {\n System.out.println(\"Maximum daily amount of \"\n + e.getMaxAmount() + \" has been reached\");\n } catch (MaxAmountPerWeekExceededException e) {\n System.out.println(\"Maximum weekly amount of \"\n + e.getMaxAmount() + \" has been reached\");\n } catch (MaxAmountPerMonthExceededException e) {\n System.out.println(\"Maximum monthly amount of \"\n + e.getMaxAmount() + \" has been reached\");\n } catch (Exception e) {\n System.out.println(\"The payment couldn't be performed\");\n }\n\n }", "Collection lookupTransactions(String email, String reason);", "private void submitTransaction() {\n String amountGiven = amount.getText().toString();\n double decimalAmount = Double.parseDouble(amountGiven);\n amountGiven = String.format(\"%.2f\", decimalAmount);\n String sourceGiven = source.getText().toString();\n String descriptionGiven = description.getText().toString();\n String clientId = mAuth.getCurrentUser().getUid();\n String earnedOrSpent = \"\";\n\n if(amountGiven.isEmpty()){\n amount.setError(\"Please provide the amount\");\n amount.requestFocus();\n return;\n }\n\n if(sourceGiven.isEmpty()){\n source.setError(\"Please provide the source\");\n source.requestFocus();\n return;\n }\n\n if(descriptionGiven.isEmpty()){\n descriptionGiven = \"\";\n }\n\n int selectedRadioButton = radioGroup.getCheckedRadioButtonId();\n\n if(selectedRadioButton == R.id.radioSpending){\n Log.d(\"NewTransactionActivity\", \"Clicked on Spending\");\n earnedOrSpent = \"Spent\";\n }\n else{\n Log.d(\"NewTransactionActivity\", \"Clicked on Earning\");\n earnedOrSpent = \"Earned\";\n }\n\n storeTransactionToDatabase(clientId, earnedOrSpent, amountGiven, sourceGiven, descriptionGiven);\n\n }", "public AccountTransactionDTO(String accountNumber, Date transactionTs, TransactionType type, BigDecimal amount) {\n\t\tthis.accountNumber = accountNumber;\n\t\tthis.transactionTs = transactionTs;\n\t\tthis.type = type;\n\t\tthis.amount = amount;\n\t}", "private void executeTransaction(ArrayList<Request> transaction) {\n // create a new TransactionMessage\n TransactionMessage tm = new TransactionMessage(transaction);\n //if(tm.getStatementCode(0)!=8&&tm.getStatementCode(0)!=14)\n // return;\n try {\n ByteArrayOutputStream bos = new ByteArrayOutputStream();\n ObjectOutputStream oos = new ObjectOutputStream(bos);\n oos.writeObject(tm);\n oos.flush();\n\n byte[] data = bos.toByteArray();\n\n byte[] buffer = null;\n long startTime = System.currentTimeMillis();\n buffer = clientShim.execute(data);\n long endTime = System.currentTimeMillis();\n if (reqIndex < maxNoOfRequests && id > 0) {\n System.out.println(\"#req\" + reqIndex + \" \" + startTime + \" \" + endTime + \" \" + id);\n }\n reqIndex++;\n\n father.addTransaction();\n\n // IN THE MEAN TIME THE INTERACTION IS BEING EXECUTED\n\n\t\t\t\t/*\n\t\t\t\t * possible values of r: 0: commit 1: rollback 2: error\n\t\t\t\t */\n int r = ByteBuffer.wrap(buffer).getInt();\n //System.out.println(\"r = \"+r);\n if (r == 0) {\n father.addCommit();\n } else if (r == 1) {\n father.addRollback();\n } else {\n father.addError();\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public void insertAccountWithTransactions(AutoCommittingHandle handle, Account account) {\n\t\taccountDao.insertAccount(handle, account);\n\t\tfor (final Transaction transaction : account.getTransactions()) {\n\t\t\ttransactionDao.insertTransaction(handle, transaction);\n\t\t}\n\t}", "public boolean addTransaction(Transaction trans) {\n if (trans == null) {\n return false;\n }\n if (!previousHash.equals(\"0\")) {\n if (!trans.processTransaction()) {\n System.out.println(\"Transaction failed to process. Transaction discarded!\");\n return false;\n }\n }\n transactions.add(trans);\n System.out.println(\"Transaction successfully added to the block\");\n return true;\n }", "protected abstract Transaction createAndAdd();", "private static void assignBankAccounts() {\n\t\tfor (Customer customer : customerList) {\n\t\t\t//make sure customer has no current accounts before adding serialized accounts\n\t\t\tcustomer.clearAccounts();\n\t\t\t\n\t\t\tfor (BankAccount account : accountList) {\n\t\t\t\tif (account.getCustomer().getUsername().equals(customer.getUsername())) {\n\t\t\t\t\tcustomer.addAccount(account);\n\t\t\t\t} else if (account.getJointCustomer() != null\n\t\t\t\t\t\t&& account.getJointCustomer().getUsername().equals(customer.getUsername()))\n\t\t\t\t\tcustomer.addAccount(account);\n\t\t\t}\n\t\t}\n\t}", "public static void transfer() {\n\t\ttry {\n\t\t\tif (!LoginMgr.isLoggedIn()) {\n\t\t\t\tthrow new NotLoggedInException();\n\t\t\t}\n\n\t\t\t// Scanner s = new Scanner(System.in);\n\t\t\tSystem.out.println(\"Enter account number to transfer to: \");\n\t\t\tString accNum = \"\";\n\t\t\tif (Quinterac.s.hasNextLine())\n\t\t\t\taccNum = Quinterac.s.nextLine();\n\n\t\t\tif (!ValidAccListMgr.checkAccNumExist(accNum)) {\n\t\t\t\tSystem.out.println(\"Please enter a valid account number\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tSystem.out.println(\"Enter account number to transfer from: \");\n\t\t\tString accNumB = \"\";\n\t\t\tif (Quinterac.s.hasNextLine())\n\t\t\t\taccNumB = Quinterac.s.nextLine();\n\n\t\t\tif (!ValidAccListMgr.checkAccNumExist(accNumB)) {\n\t\t\t\tSystem.out.println(\"Please enter a valid account number\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tSystem.out.println(\"Enter the amount of money to transfer in cents: \");\n\t\t\tint amount = 0;\n\t\t\tif (Quinterac.s.hasNextInt())\n\t\t\t\tamount = Integer.parseInt(Quinterac.s.nextLine());\n\n\t\t\tString modeName = LoginMgr.checkMode();\n\t\t\tif (modeName.equals(\"machine\")) {\n\t\t\t\tatmCheckTransferValid(accNum, amount, accNumB);\n\t\t\t} else if (modeName.equals(\"agent\")) {\n\t\t\t\tagentCheckTransferValid(accNum, amount, accNumB);\n\t\t\t}\n\n\t\t} catch (NotLoggedInException e) {\n\t\t\tSystem.out.println(e.getMessage());\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(e.getMessage());\n\t\t}\n\n\t}", "public boolean makeTransfer(String fromAccountNumber,\r\n\t\t\tString toAccountNumber, double amount, String memo) {\r\n\t\tif (DaoUtility.isAccountNumberValid(fromAccountNumber)\r\n\t\t\t\t&& DaoUtility.isAccountNumberValid(toAccountNumber)) {\r\n\t\t} else\r\n\t\t\treturn false;\r\n\r\n\t\t// do transaction\r\n\t\tConnection conn = dbConnector.getConnection();\r\n\t\tif (conn==null)\r\n\t\t\treturn false;\r\n\t\t\r\n\t\tPreparedStatement st;\r\n\t\tString sql;\r\n\t\tResultSet rs;\r\n\r\n\t\ttry {\r\n\t\t\tconn.setAutoCommit(false);\r\n\t\t\tSavepoint savepnt = conn.setSavepoint();\r\n\r\n\t\t\ttry {\r\n\t\t\t\tint fromAccountId=0;\r\n\t\t\t\tint toAccountId=0;\r\n\t\t\t\tString fromName=\"SECRET USER\";\r\n\t\t\t\tString toName=\"SECRET USER\";\r\n\t\t\t\tString fname,mname,lname;\r\n\t\t\t\t\r\n\t\t\t\tst = conn.prepareStatement(\"select tbAccount.aid,balance,isactive,\"\r\n\t\t\t\t\t\t+ \"fname,mname,lname from tbAccount, tbClient \"\r\n\t\t\t\t\t\t+ \" where acnumber= ? and tbAccount.cid=tbClient.cid\");\r\n\t\t\t\tst.setString(1, fromAccountNumber);\r\n\t\t\t\trs = st.executeQuery();\r\n\t\t\t\tif (rs.next()){\r\n\t\t\t\t\tfromAccountId = rs.getInt(\"aid\");\r\n\t\t\t\t\tdouble balance = rs.getDouble(\"balance\");\r\n\t\t\t\t\tboolean isactive = rs.getBoolean(\"isactive\");\r\n\t\t\t\t\tfname = rs.getString(\"fname\");\r\n\t\t\t\t\tmname = rs.getString(\"mname\");\r\n\t\t\t\t\tlname = rs.getString(\"lname\");\r\n\t\t\t\t\tfromName = fname + \" \" + (mname==null?\"\":mname) + \" \" +lname;\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (balance<amount || !isactive) { //not enough money or frozen\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tst = conn.prepareStatement(\"select aid,isactive,\"\r\n\t\t\t\t\t\t+ \" fname,mname,lname from tbAccount,tbClient \"\r\n\t\t\t\t\t\t+ \" where acnumber= ? and tbAccount.cid=tbClient.cid\");\r\n\t\t\t\tst.setString(1, toAccountNumber);\r\n\t\t\t\trs = st.executeQuery();\r\n\t\t\t\tif (rs.next()){\r\n\t\t\t\t\ttoAccountId = rs.getInt(\"aid\");\r\n\t\t\t\t\tboolean isactive = rs.getBoolean(\"isactive\");\r\n\t\t\t\t\tfname = rs.getString(\"fname\");\r\n\t\t\t\t\tmname = rs.getString(\"mname\");\r\n\t\t\t\t\tlname = rs.getString(\"lname\");\r\n\t\t\t\t\ttoName = fname + \" \" + (mname==null?\"\":mname) + \" \" +lname;\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (!isactive) { //frozen\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t// substract balance of fromAccount\r\n\t\t\t\tst = conn.prepareStatement(\r\n\t\t\t\t\t\t\"update tbAccount set balance = balance - ? \"\r\n\t\t\t\t\t\t\t\t+ \" where balance >= ? \"\r\n\t\t\t\t\t\t\t\t+ \" and acnumber = ? \"\r\n\t\t\t\t\t\t\t\t+ \" and isactive=TRUE \");\r\n\t\t\t\tst.setDouble(1, amount);\r\n\t\t\t\tst.setDouble(2, amount);\r\n\t\t\t\tst.setString(3, fromAccountNumber);\r\n\t\t\t\tint nRs = st.executeUpdate();\r\n\t\t\t\tif (nRs <= 0)\r\n\t\t\t\t{\r\n\t\t\t\t\tconn.rollback(savepnt);\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// add balance of toAccount\r\n\t\t\t\tst = conn.prepareStatement(\r\n\t\t\t\t\t\t\"update tbAccount set balance = balance + ? \"\r\n\t\t\t\t\t\t\t\t+ \" where acnumber = ? \"\r\n\t\t\t\t\t\t\t\t+ \" and isactive=TRUE \");\r\n\t\t\t\tst.setDouble(1, amount);\r\n\t\t\t\tst.setString(2, toAccountNumber);\r\n\t\t\t\tnRs = st.executeUpdate();\r\n\t\t\t\tif (nRs <= 0)\r\n\t\t\t\t{\r\n\t\t\t\t\tconn.rollback(savepnt);\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// insert 2 transaction record\r\n\t\t\t\t// insert into tbTransaction(aid, trtype, amount, description)\r\n\t\t\t\t// values( select aid from tbAccount where acnumber='acnumber',\r\n\t\t\t\t// DEPOSIT_TRANSACTION_TYPE_ID,\r\n\t\t\t\t// amount, 'transfer 123.4 dollars to 3333343 on 2014-09-19')\r\n\t\t\t\t//\r\n\t\t\t\tDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd\");\r\n\t\t\t\tjava.util.Date date = new java.util.Date();\r\n\t\t\t\tString currentDate = dateFormat.format(date); // 2014-08-06\r\n\r\n\t\t\t\tsql = String.format(\r\n\t\t\t\t\t\t\"insert into tbTransaction(aid,trtype,amount,description) \"\r\n\t\t\t\t\t\t\t\t+ \" values( %d, \" + \"\t\t\t%d, \"\r\n\t\t\t\t\t\t\t\t+ \"\t\t\t%f, 'Transfer out %.2f dollars to %s(%s) on %s. MEMO: %s' ) \", \r\n\t\t\t\t\t\t\t\tfromAccountId,\r\n\t\t\t\t\tTRANSFER_OUT_TRANSACTION_TYPE_ID, amount, amount,\r\n\t\t\t\t\ttoAccountNumber, toName, currentDate,memo);\r\n\t\t\t\tnRs = st.executeUpdate(sql);\r\n\t\t\t\tif (nRs<=0)\r\n\t\t\t\t{\r\n\t\t\t\t\tconn.rollback(savepnt);\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tsql = String.format(\r\n\t\t\t\t\t\t\"insert into tbTransaction(aid,trtype,amount,description) \"\r\n\t\t\t\t\t\t\t\t+ \" values( %d, \" + \" %d, \"\r\n\t\t\t\t\t\t\t\t+ \"\t%f, 'Transfer in %.2f dollars from %s(%s) on %s. MEMO: %s' ) \", \r\n\t\t\t\t\t\t\t\ttoAccountId,\r\n\t\t\t\t\tTRANSFER_IN_TRANSACTION_TYPE_ID, amount, amount,\r\n\t\t\t\t\tfromAccountNumber, fromName, currentDate,memo);\r\n\t\t\t\tnRs = st.executeUpdate(sql);\r\n\t\t\t\tif (nRs<=0)\r\n\t\t\t\t{\r\n\t\t\t\t\tconn.rollback(savepnt);\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn true;\r\n\t\t\t\t\r\n\t\t\t} catch (Exception ex) {\r\n\t\t\t\tex.printStackTrace();\r\n\t\t\t\tconn.rollback(savepnt);\r\n\t\t\t} finally {\r\n\t\t\t\tconn.setAutoCommit(true);\r\n\t\t\t}\r\n\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\r\n\t\t} finally {\r\n\t\t\ttry {\r\n\t\t\t\tif (conn != null)\r\n\t\t\t\t\tconn.close();\r\n\t\t\t} catch (SQLException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}", "public Receipt recordTransaction(Transaction t) throws RemoteException;", "@RequestMapping(value = \"/Reservation/{reservation_reservationId}/transactionses\", method = RequestMethod.POST)\n\t@ResponseBody\n\tpublic Transactions newReservationTransactionses(@PathVariable Integer reservation_reservationId, @RequestBody Transactions transactions) {\n\t\treservationService.saveReservationTransactionses(reservation_reservationId, transactions);\n\t\treturn transactionsDAO.findTransactionsByPrimaryKey(transactions.getTransactionId());\n\t}", "private void clearTransactions() {\n transactions_ = emptyProtobufList();\n }", "public boolean transferAmount(String id,String sourceAccount,String targetAccount,int amountTransfer) throws SQLException {\n\t\n\tConnection con = null;\n\tcon = DatabaseUtil.getConnection();\n\tint var=0;\n\tint var2=0;\n\tPreparedStatement ps1 = null;\n\tPreparedStatement ps2 = null;\n\tPreparedStatement ps3 = null;\n\tPreparedStatement ps4 = null;\n\tResultSet rs1 = null;\n\tResultSet rs2 = null;\n\tResultSet rs3 = null;\n\tResultSet rs4 = null;\n\tboolean flag=false;\n\n\tcon = DatabaseUtil.getConnection();\n\t\n\t//Account account=new Account();\n\tps1=con.prepareStatement(\"select Balance from CustomerAccount_RBM where SSN_ID=? and Account_Type=?\");\n\tps1.setInt(1,Integer.parseInt(id));\n\tps1.setString(2,targetAccount);\n\trs1=ps1.executeQuery();\n\t\n\twhile (rs1.next()) {\n\t var = rs1.getInt(1);\n\t \n\t if (rs1.wasNull()) {\n\t System.out.println(\"id is null\");\n\t }\n\t}\n\t\n\tint targetAmount=var+amountTransfer;\n\tSystem.out.println(\"target amount \"+targetAmount);\n\t//System.out.println(\"very good\");\n\tps2=con.prepareStatement(\"select Balance from CustomerAccount_RBM where SSN_ID=? and Account_Type=?\");\n\tps2.setInt(1,Integer.parseInt(id));\n\tps2.setString(2,sourceAccount);\n\trs2=ps2.executeQuery();\n\t\n\twhile (rs2.next()) {\n\t var2 = rs2.getInt(1);\n\t //System.out.println(\"id=\" + var);\n\t if (rs2.wasNull()) {\n\t System.out.println(\"name is null\");\n\t }\n\t}\n\t\n\tint sourceAmount=var2-amountTransfer;\n\tSystem.out.println(\"source amount\"+ sourceAmount);\n\tif(sourceAmount<0 ) {\n\t\tSystem.out.println(\"Unable to tranfer\");\n\t}else {\n\t\tflag=true;\n\t\tps3=con.prepareStatement(\"update CustomerAccount_RBM set Balance=? where Account_Type=?\");\n\t\tps3.setInt(1,sourceAmount);\n\t\tps3.setString(2,sourceAccount);\n\t\t//System.out.println(\"hey\");\n\t\trs3=ps3.executeQuery();\n\t\t\n\t\tps4=con.prepareStatement(\"update CustomerAccount_RBM set Balance=? where Account_Type=?\");\n\t\tps4.setInt(1,targetAmount);\n\t\tps4.setString(2,targetAccount);\n\t\trs4=ps4.executeQuery();\n\t\t//System.out.println(\"Transfer Dao1\");\n\t}\n\tDatabaseUtil.closeConnection(con);\n\tDatabaseUtil.closeStatement(ps1);\n\tDatabaseUtil.closeStatement(ps2);\n\tDatabaseUtil.closeStatement(ps3);\n\tDatabaseUtil.closeStatement(ps4);\n\treturn flag;\n}", "public Transaction[] handleTxs(Transaction[] possibleTxs) {\n // IMPLEMENT THIS\n List<Transaction> validTxs = new ArrayList<>();\n for (Transaction tx : possibleTxs) {\n if (isValidTx(tx)) {\n validTxs.add(tx);\n ArrayList<Transaction.Output> outputs = tx.getOutputs();\n for (int idx = 0; idx < outputs.size(); idx++) {\n UTXO utxo = new UTXO(tx.getHash(), idx);\n utxoPool.addUTXO(utxo, outputs.get(idx));\n }\n }\n }\n\n return validTxs.toArray(new Transaction[0]);\n }", "@JsonProperty(\"transaction\")\n public void setTransaction(Transaction transaction) {\n this.transactionList.add(transaction);\n }" ]
[ "0.6385395", "0.61593", "0.6060375", "0.59397787", "0.58578837", "0.56426275", "0.5625661", "0.55404824", "0.55022967", "0.54756516", "0.53942305", "0.5330794", "0.53219646", "0.532193", "0.5279304", "0.52383834", "0.523467", "0.522239", "0.52145076", "0.52127707", "0.52042097", "0.5200445", "0.51958066", "0.51955193", "0.5194742", "0.5193196", "0.5171867", "0.51670766", "0.5120998", "0.5102737", "0.5096295", "0.5095023", "0.50826514", "0.5072066", "0.5066932", "0.50571215", "0.50436455", "0.5025955", "0.5021752", "0.50093967", "0.49944314", "0.4986699", "0.4980594", "0.49762973", "0.49692065", "0.4961243", "0.49319753", "0.4918172", "0.49104077", "0.49099016", "0.48927805", "0.4887697", "0.4880337", "0.4872738", "0.48693636", "0.48681784", "0.48665795", "0.4864229", "0.4856241", "0.48539025", "0.48526093", "0.48498264", "0.48368645", "0.48289555", "0.4827375", "0.48254657", "0.48216125", "0.48066375", "0.47958666", "0.4794249", "0.47871768", "0.47815618", "0.47798255", "0.47785166", "0.47724655", "0.4770859", "0.47683397", "0.4764587", "0.47496817", "0.47449702", "0.47377864", "0.47336948", "0.4729114", "0.4726554", "0.4725112", "0.47226322", "0.47176167", "0.47175175", "0.471591", "0.47156987", "0.471112", "0.47072178", "0.46995565", "0.46995336", "0.4698991", "0.4695763", "0.46884352", "0.46859032", "0.4676791", "0.46703857" ]
0.8120108
0
Returns an account depending on the address
public Account getAccount(String address) { Account account = accounts.get(address); if (account == null) { account = createAccount(SHA3Util.hexToDigest(address)); accounts.put(address, account); } return account; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public AccountInterface getAccount(String _address) {\n\t\tfor (AccountInterface account: accounts) {\n\t\t\tif (account.getAddress().equals(_address))\n\t\t\t\treturn account;\n\t\t}\n\t\treturn null;\t\t\n\t}", "AccountDetail getAccount(String number) throws Exception;", "public Account getAccount(byte[] address) {\n String addressAsHex = SHA3Util.digestToHex(address);\n Account account = accounts.get(addressAsHex);\n if (account == null) {\n account = createAccount(address);\n accounts.put(addressAsHex, account);\n }\n return account;\n }", "Account getAccount(Integer accountNumber);", "Account getAccount();", "java.lang.String getAccount();", "@Override\n public Account get(final Address address) {\n BonsaiLayeredWorldState currentLayer = this;\n while (currentLayer != null) {\n final Optional<StateTrieAccountValue> maybeStateTrieAccount =\n currentLayer.trieLog.getAccount(address);\n final Optional<StateTrieAccountValue> maybePriorStateTrieAccount =\n currentLayer.trieLog.getPriorAccount(address);\n if (currentLayer == this && maybeStateTrieAccount.isPresent()) {\n return new BonsaiAccount(\n BonsaiLayeredWorldState.this, address, maybeStateTrieAccount.get(), false);\n } else if (maybePriorStateTrieAccount.isPresent()) {\n return new BonsaiAccount(\n BonsaiLayeredWorldState.this, address, maybePriorStateTrieAccount.get(), false);\n } else if (maybeStateTrieAccount.isPresent()) {\n return null;\n }\n if (currentLayer.getNextWorldView().isEmpty()) {\n currentLayer = null;\n } else if (currentLayer.getNextWorldView().get() instanceof BonsaiLayeredWorldState) {\n currentLayer = (BonsaiLayeredWorldState) currentLayer.getNextWorldView().get();\n } else {\n return currentLayer.getNextWorldView().get().get(address);\n }\n }\n return null;\n }", "private Account createAccount(byte[] address) {\n return new Account(address);\n }", "public abstract GDataAccount getAccount(String account) throws ServiceException;", "public Account getAccountByOwnerAndName(String user,String accountName);", "public BellvilleAccountant read(String account){\n BellvilleAccountant bellAccount = findAccountant(account);\r\n return bellAccount;\r\n }", "public static String getUserAddress(String accountNumber){\n return \"select ui_serviceaddress from user_information where ui_account = '\"+accountNumber+\"'\";\n }", "public HDAddressDescription findAddress(Address addr) {\n HDAddressDescription retval = null;\n for (HDAccount acct : mAccounts) {\n retval = acct.findAddress(addr);\n if (retval != null)\n return retval;\n }\n return retval;\n }", "List<Account> findAccountByAddressStartingWith(String pattern);", "public P2PUser getUser(NAddress address);", "Account getAccount(int id);", "private static void lookupAccount(String email) {\n\t\t\n\t}", "BillingAccount getBillingAccount();", "public static Account getAccountDetails(int accountId) throws SQLException {\n boolean cdt1 = Checker.checkValidUserAccountAccountId(accountId);\n // if it is a account id, establish a connection\n if (cdt1) {\n EnumMapRolesAndAccounts map = new EnumMapRolesAndAccounts();\n map.createEnumMap();\n Connection connection = DatabaseDriverHelper.connectOrCreateDataBase();\n ResultSet results = DatabaseSelector.getAccountDetails(accountId, connection);\n while (results.next()) {\n // get the account details\n String name = results.getString(\"NAME\");\n BigDecimal balance = new BigDecimal(results.getString(\"BALANCE\"));\n // make an account class (either chequing, savings, or tfsa) based on the type\n if (DatabaseSelectHelper.getAccountType(accountId) == map.accountTypes.get(AccountTypes.CHEQUING)) {\n ChequingAccount chequing = new ChequingAccountImpl(accountId, name, balance);\n connection.close();\n return chequing;\n } else if (DatabaseSelectHelper.getAccountType(accountId) == map.accountTypes.get(AccountTypes.SAVINGS)) {\n SavingsAccount savings = new SavingsAccountImpl(accountId, name, balance);\n connection.close();\n return savings;\n } else if (DatabaseSelectHelper.getAccountType(accountId) == map.accountTypes.get(AccountTypes.TFSA)) {\n TFSA tfsa = new TFSAImpl(accountId, name, balance);\n connection.close();\n return tfsa;\n } else if (DatabaseSelectHelper.getAccountType(accountId) == map.accountTypes.get(AccountTypes.RESTRICTEDSAVING)) {\n RestrictedSavingsAccount rsa = new RestrictedSavingsAccountImpl(accountId, name, balance);\n connection.close();\n return rsa;\n } else if (DatabaseSelectHelper.getAccountType(accountId) == map.accountTypes.get(AccountTypes.BALANCEOWING)) {\n BalanceOwingAccount boa = new BalanceOwingAccountImpl(accountId, name, balance);\n connection.close();\n return boa;\n }\n }\n }\n return null;\n }", "List<AccountDetail> findAllByAddressStartingWith(String address);", "@Override\n\tpublic String getAccountAddress(String account) throws WalletException {\n\t\treturn null;\n\t}", "@Override\r\n\tpublic AccountDTO getAccount(String email) {\n\t\treturn accountDao.getAccount(email);\r\n\t}", "public static Account getAccount(String accountId) {\r\n return (accounts.get(accountId));\r\n }", "java.lang.String getAccountId();", "java.lang.String getAccountId();", "java.lang.String getAccountId();", "public static String getUserAccount(String account){\n return \"select ui_account from user_information where ui_account = '\"+account+\"'\";\n }", "java.lang.String getAccountNumber();", "@Override\n\tpublic Person getPersonByAccount(String account) {\n\t\tString hql = \"from \" + Common.TABLE_PERSON + \" where account = ?\";\n\t\tString pro[] = new String[1];\n\t\tpro[0] = account;\n\t\tPerson p = (Person) dao.loadObject(hql,pro);\n\t\tif(p != null)\n\t\t\treturn p;\n\t\treturn null;\n\t}", "public LocalAccount\t\tgetAccount();", "public BankAccountInterface getAccount(String accountID){\n BankAccountInterface account = null;\n for(int i = 0; i < accounts.size(); i++){\n if(accounts.get(i).getAccountID().equals(accountID)){\n account = accounts.get(i);\n break;\n } \n }\n return account;\n }", "UserAccount getUserAccountById(long id);", "private static Account getAccount(Node node) {\n if (node.getNodeType() == Node.ELEMENT_NODE) {\n Element element = (Element) node;\n int accNum = Integer.parseInt(getTagValue(\"accountNumber\", element));\n String password = getTagValue(\"password\", element);\n double balance = Double.parseDouble(getTagValue(\"accountBalance\", element));\n String cusName = getTagValue(\"customerName\", element);\n String cusAddress = getTagValue(\"customerAddress\", element);\n String cusPhone = getTagValue(\"customerPhoneNum\", element);\n return new Account(accNum, password, balance, cusName, cusAddress, cusPhone);\n }\n return new Account();\n }", "private static Address getOfficialByAddress(String address) throws Exception {\n\t\tString USER_AGENT = \"Mozilla/5.0\";\n\n\t\tString name = \"\", country = \"US\", zip = \"\", city = \"\", state = \"\", line1 = \"\", line2 = \"\";\n\t\tAddress to = null;\n\t\t// Replaces all strings with '%20' for URL completion\n\t\taddress = address.replace(\" \", \"%20\");\n\t\tString urlString = \"https://www.googleapis.com/civicinfo/v2/representatives?key=AIzaSyAEU9J6KzUL_gXPGi-4S6XekJuEC0JRWjA&address=\" + address;\n\t\tURL url = new URL(urlString);\n\t\tHttpURLConnection con = (HttpURLConnection) url.openConnection();\n\t\t// By default it is GET request\n\t\tcon.setRequestMethod(\"GET\");\n\t\t//add request header\n\t\tcon.setRequestProperty(\"User-Agent\", USER_AGENT);\n\t\t\n\t\t// Reading response from input Stream\n\t\tBufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));\n\t \n\t\tString output;\n\t\tStringBuffer response = new StringBuffer();\n\t\twhile ((output = in.readLine()) != null) {\n\t\t\tresponse.append(output);\t\n\t\t}\n\t\tin.close();\n\t\t\n\t\t// Constructs JSONOBject to parse the response\n\t\tJSONObject object = new JSONObject(response.toString());\n\t\tJSONArray addresses = object.getJSONArray(\"officials\");\n\t\t\n\t\t// Takes array of individuals response and selects last index of it by default (may be optimized for more specific selections)\n\t\tJSONObject person = addresses.getJSONObject(addresses.length()-1);\n\t\tJSONArray fields = person.getJSONArray(\"address\");\n\t\tJSONObject addressTo = fields.getJSONObject(0);\n\t\t\t\t\n\t\tif(person.has(\"name\"))\n\t\t\tname = person.getString(\"name\");\n\t\t\n\t\tif(addressTo.has(\"zip\"))\n\t\t\tzip = addressTo.getString(\"zip\");\n\t\t\n\t\tif(addressTo.has(\"city\"))\n\t\t\tcity = addressTo.getString(\"city\");\n\t\t\n\t\tif(addressTo.has(\"state\"))\n\t\t\tstate = addressTo.getString(\"state\");\n\t\t\n\t\tif(addressTo.has(\"line2\"))\n\t\t\tline2 = addressTo.getString(\"line2\");\n\t\t\n\t\tif(addressTo.has(\"line1\"))\n\t\t\t line1 = addressTo.getString(\"line1\");\n\t\t\n\t\tto = new Address(name, country, zip, city, state, line2, line1);\n\t\t\n\n\t\treturn to;\n\t\t\n\t \n\t }", "public MnoAccount getAccountById(String id);", "private Account getAccount( int accountNumber )\n {\n for( Account currentAccount : accounts )\n {\n if( currentAccount.getAccountNumber() == accountNumber )\n {\n return currentAccount;\n }\n \n }\n return null;\n }", "Optional<Account> getAccountByUsername(String username);", "net.nyhm.protonet.example.proto.AccountProto.Account getAccount();", "net.nyhm.protonet.example.proto.AccountProto.Account getAccount();", "public CarerAccount getAccountWithUsername(String search){\n\t\tCarerAccount item = null;\n\n\t\tint count = 0;\n for (int i = 0; i < CarerAccounts.size(); ++i) {\n if (CarerAccounts.get(i).getUsername().equals(search)){\n\t\t\t\tcount++;\n item = CarerAccounts.get(i);\n\t\t\t}\n\t\t}\n\t\treturn item;\n\t}", "public abstract Address getCustomerAddress();", "public abstract LinphoneAddress getAddress();", "public Account searchAccount(String account_no)\n {\n Account account=null;\n \n try\n {\n String query=\"select * from account where account_no=\"+account_no;\n PreparedStatement ps=this.conn.prepareStatement(query);\n \n ResultSet rs=ps.executeQuery();\n \n if(rs.next())\n {\n account=new Account();\n \n account.setAccount_no(rs.getString(\"account_no\"));\n account.setAadhar_id(rs.getString(\"aadhar_no\"));\n account.setAccount_type(rs.getString(\"ac_type\"));\n account.setInterest_rate(rs.getString(\"interest\"));\n account.setBalance(rs.getString(\"balance\"));\n account.setAccount_status(rs.getString(\"ac_status\"));\n account.setName(rs.getString(\"name\"));\n }\n \n }catch(Exception e)\n {\n JOptionPane.showMessageDialog(null,e);\n }\n return account;\n }", "AionAddress createAccount(String password);", "public Account getAccount(Player p) {\n\t\tif (p == null)\n\t\t\treturn null; // safety\n\t\t// If the account is in memory, return it\n\t\tfor ( Account a : accounts) {\n\t\t\tif (a.isFor(p.getUniqueId()))\n\t\t\t\treturn a;\n\t\t}\n\t\t// spawn a new account object with default values\n\t\tAccount acct = new Account(p.getName(), p.getUniqueId());\n\t\t// load account status from yml file, if it exists\n\t\tacct.openAccount();\n\t\t// append to the bank list\n\t\taccounts.add(acct);\n\t\treturn acct;\n\t}", "public Account getSpecifiedAccount(String type, int accountNumber) {\r\n /*\r\n * Here is the table :\r\n * - 1 : Credit\r\n * - 2 : LineOfCredit\r\n * - 3 : Chequing\r\n * - 4 : Saving\r\n * */\r\n System.out.println(\"Accessing account...\");\r\n Account specifiedAccount;\r\n switch (type){\r\n case \"1\":\r\n specifiedAccount = credits[accountNumber-1];\r\n break;\r\n case \"2\":\r\n specifiedAccount = lineOfCredits[accountNumber-1];\r\n break;\r\n case \"3\":\r\n specifiedAccount = chequing[accountNumber-1];\r\n break;\r\n case \"4\":\r\n specifiedAccount = saving[accountNumber-1];\r\n break;\r\n default:\r\n specifiedAccount = null;\r\n break;\r\n }\r\n return specifiedAccount;\r\n }", "String getAddress(int type);", "List<Account> getAccountByCountryOrState(String country,String state);", "public AccountInfo getAccount()\n {\n if(accountInfo == null)\n {\n System.out.println(\"You need to generate an account before getting the details.\");\n return null;\n }\n return accountInfo;\n }", "kr.pik.message.Profile.ProfileMessage.ContactAddress getContactAddress(int index);", "private Account getAccount(int accountNumber) {\r\n // loop through accounts searching for matching account number\r\n for (Account currentAccount : accounts) {\r\n // return current account if match found\r\n if (currentAccount.getAccountNumber() == accountNumber) {\r\n return currentAccount;\r\n }\r\n }\r\n\r\n return null; // if no matching account was found, return null\r\n }", "private Account findAccount(String name, String email) throws AccountNotFoundException {\n for (Account current: accounts) {\n if (name.equals(current.getName()) && email.equals(current.getEmail())) {\n return current;\n }\n }\n throw new AccountNotFoundException();\n }", "public static PhoneAccount getInstance(PhoneNumber phoneNumber, Person accountHolder, String type) {\n\t\tPhoneAccount pa = phoneAccounts.get(phoneNumber); \n\t\t\n\t\tif(pa != null) {\n\t\t\treturn pa; \n\t\t}\n\t\t\n\t\tif(type.equals(PAY_AS_YOU_GO)) {\n\t\t\tpa = new PayAsYouGoAccount(phoneNumber, accountHolder);\n\t\t\tLOG.info(\"Pay as you go account created\");\n\t\t} else if(type.equals(UNLIMITED)) {\n\t\t\tpa = new UnlimitedAccount(phoneNumber, accountHolder);\n\t\t\tLOG.info(\"Unlimited account created\");\n\t\t} else {\n\t\t\tLOG.warning(\"Invalid phone account type: \" + type);\n\t\t\tthrow new IllegalArgumentException(\"Invalid Phone Account type: \" + type);\n\t\t}\n\t\t\n\t\tphoneAccounts.put(phoneNumber, pa);\n\t\treturn pa;\n\t}", "java.lang.String getAddress();", "java.lang.String getAddress();", "java.lang.String getAddress();", "java.lang.String getAddress();", "java.lang.String getAddress();", "java.lang.String getAddress();", "public BankAccount lookUp(String name){\n\t\t// create an Entry with the given name, a \"dummy\" accountNumber (1) and zero balance\n\t\t// This \"dummy\" accountNumber will be ignored when executing getData\n\t\tBankAccount lookFor = new BankAccount(name, 1, 0);\n\t\treturn (BankAccount)namesTree.findData(lookFor);\n\t}", "Account findByAccountType(String accountType);", "public final AfAccount getAccount(String accountName) {\n return _accounts.get(accountName);\n }", "java.lang.String getLoginAccount();", "java.lang.String getLoginAccount();", "@Override\n\tpublic Account getAccount(String username) {\n\t\treturn map.get(username);\n\t}", "List<Account> findByAddressStartingWith(String startAddress);", "String getAddress();", "String getAddress();", "public PhoneAccount getPhoneAccount(PhoneAccountHandle handle, UserHandle userHandle) {\n return getPhoneAccount(handle, userHandle, /* acrossProfiles */ false);\n }", "static void printAccountBalance(String address){\n }", "public Address getDefaultBillingAddress();", "Account getAccount(Long recvWindow, Long timestamp);", "public Account loadAccount(ExternalAccountInfoSupplier externalAccountInfoSupplier) {\n Type type = externalAccountInfoSupplier.getType();\n String externalId = externalAccountInfoSupplier.getExternalId();\n Supplier<String> email = memoize(externalAccountInfoSupplier::getExternalEmail);\n\n // Find an account via this external id and type\n Optional<Account> optionalAccount = accountService.findByExternalAccount(type, externalId);\n return optionalAccount.map(Optional::of).orElseGet(() ->\n // ...if the account is not found, find it by email\n accountService.findByEmail(email.get())\n // ...if its there, create an external account for future references\n .map(account -> createExternalAccount(account, type, externalId)))\n // If no account available create completely new account\n .orElseGet(() -> createAccount(externalAccountInfoSupplier));\n }", "public Account findAccount() {\n Account[] accounts = accountManager.getAccountsByType(ACCOUNT_TYPE);\n\n // only one matching account - use it, and remember it for the next time.\n if (accounts.length == 1) {\n persistAccountName(accounts[0].name);\n return accounts[0];\n }\n\n // No accounts, create one and use it if created, otherwise we have no account to use\n\n if (accounts.length == 0) {\n String accountName = createAccount();\n if (accountName != null) {\n persistAccountName(accountName);\n return accountManager.getAccountsByType(ACCOUNT_TYPE)[0];\n } else {\n Log.i(LOG_TAG, \"User failed to create a valid account\");\n return null;\n }\n }\n\n // Still valid previously chosen account - use it\n\n Account account;\n String accountName = getPersistedAccountName();\n if (accountName != null && (account = chooseAccount(accountName, accounts)) != null) {\n return account;\n }\n\n // Either there is no saved account name, or our saved account vanished\n // Have the user select the account\n\n accountName = selectAccount(accounts);\n if (accountName != null) {\n persistAccountName(accountName);\n return chooseAccount(accountName, accounts);\n }\n\n // user didn't choose an account at all!\n Log.i(LOG_TAG, \"User failed to choose an account\");\n return null;\n }", "public static ATMAccount createAccount() {\r\n\t\tString userName;\r\n\t\tdouble userBalance;\r\n\t\tint digit = -1;\r\n\r\n\t\tSystem.out.println(\"Please enter a name for the account: \");\r\n\t\tuserInput.nextLine();\r\n\t\tuserName = userInput.nextLine();\r\n\r\n\t\t//Requests digits 1 by 1 for the pin number\r\n\t\tString accPin = \"\";\r\n\t\tfor (int i = 1; i < 5; i++) {\r\n\t\t\tdigit = -1;\r\n\t\t\tSystem.out.println(\"Please enter digit #\" + i + \" of\" + \"your pin.\");\r\n\t\t\tdo {\r\n\t\t\t\tdigit = userInput.nextInt();\r\n\t\t\t} while (digit < 0 || digit > 9);\r\n\t\t\taccPin += digit;\r\n\t\t}\r\n\r\n\t\tSystem.out.println(\"Please put the amount of money you would like to \" + \"initially deposit into the account: \");\r\n\t\tuserBalance = userInput.nextDouble();\r\n\t\tRandom accountIDGenerator = new Random();\r\n\t\tint userID = accountIDGenerator.nextInt(2147483647);\r\n\t\tATMAccount account = new ATMAccount(userID, userName, Integer.parseInt(accPin), userBalance);\r\n\t\tSystem.out.println(\"Acount Information: \\n\"+account.toString());\r\n\t\treturn account;\r\n\t}", "public String getAccount(){\n\t\treturn account;\n\t}", "public String getAccount() {\n return account;\n }", "public String getAccount() {\n return account;\n }", "public String getAccount() {\n return account;\n }", "public String getAccount() {\n return account;\n }", "public String getAccount() {\n return account;\n }", "public String getAccount() {\n return account;\n }", "public String getAccount() {\n return account;\n }", "public String getAccount() {\n return account;\n }", "public String getAccount() {\n return account;\n }", "public String getAccount() {\n return account;\n }", "public Account getAccount(String username)\n\t {\n\t\t Account account = null;\n\t\t \n\t\t String columns[] = new String[] {DatabaseContract.AccountContract.COLUMN_NAME_USERNAME,\n\t\t\t\t \t\t\t\t\t\t\tDatabaseContract.AccountContract.COLUMN_NAME_BALANCE,\n\t\t\t\t \t\t\t\t\t\t\tDatabaseContract.AccountContract.COLUMN_NAME_AUTH_TOKEN};\n\t\t \n\t\t String where = DatabaseContract.AccountContract.COLUMN_NAME_USERNAME + \" = ? \";\n\t\t \n\t\t Cursor cursor = db.query(DatabaseContract.AccountContract.TABLE_NAME,\n\t\t\t\t columns,\n\t\t\t\t where,\n\t\t\t\t new String[] {username},\n\t\t\t\t null, null, null);\n\t\t\n\t\t if(cursor.getCount() > 0)\n\t\t {\n\t\t\t cursor.moveToFirst();\n\t\t\t \n\t\t\t int userCol = cursor.getColumnIndex(DatabaseContract.AccountContract.COLUMN_NAME_USERNAME);\n\t\t\t int balCol = cursor.getColumnIndex(DatabaseContract.AccountContract.COLUMN_NAME_BALANCE);\n\t\t\t int authCol = cursor.getColumnIndex(DatabaseContract.AccountContract.COLUMN_NAME_AUTH_TOKEN);\n\t\t\t \n\t\t\t String usernameString = cursor.getString(userCol);\n\t\t\t String authTokenString = cursor.getString(authCol);\n\t\t\t int balance = cursor.getInt(balCol);\n\t\t\t \n\t\t\t account = new Account(usernameString, authTokenString, balance); \n\t\t }\n\t\t \n\t\t cursor.close();\n\t\t return account;\n\t }", "public Friend findFriend(Address addr);", "@Override\n public Account findByAccountNumber(String accountNumber) {\n Query findByAccNum = new Query();\n findByAccNum.addCriteria(Criteria.where(\"accountNumber\").is(accountNumber));\n Account found = operations.findOne(findByAccNum, Account.class);\n return found;\n }", "public String getAccount() {\r\n return account;\r\n }", "public Account getAccount(int accound_index){\n return accounts[accound_index];\n }", "public InternetAddress getFromAddress();", "public void getAddress() {\n if (mLocation != null) {\n mBusinessAddress = AppUtil.getAddress(getContext(), mLocation);\n } else {\n mLocation = null;\n if (ActivityCompat.checkSelfPermission(getContext(), android.Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(getContext(), android.Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED) {\n LocationManager locationManager = (LocationManager) getActivity().getSystemService(LOCATION_SERVICE);\n Criteria criteria = new Criteria();\n Location currLocation = locationManager.getLastKnownLocation(locationManager.getBestProvider(criteria, false));\n if (currLocation != null) {\n mBusinessAddress = AppUtil.getAddress(getContext(), new LatLng(currLocation.getLatitude(), currLocation.getLongitude()));\n } else {\n locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 5000, 5, this);\n if (mCurrLocation != null) {\n mBusinessAddress = AppUtil.getAddress(getContext(), new LatLng(mCurrLocation.getLatitude(), mCurrLocation.getLongitude()));\n } else {\n // Default location in case location search doesn't work on first try\n mBusinessAddress = DiscoverConstants.DEFAULT_LOCATION;\n }\n }\n } else {\n mBusinessAddress = null;\n }\n }\n }", "public UserAccount getUserAccountByLoginId(String loginId);", "Optional<Account> findByNumber(long number);", "public Account fillAccount(String emailAddress, String name) {\n\t\tAccount acct = new Account();\n\t\t// Set the unique Id on our side that we pass when we are creating this account\n\t\tacct.setMerchantAccountId(VindiciaUtil.createUniqueId(\"account\")); \n\n\t\t// Specify customer's email address here . This the address where customer\n\t\t// will receive CashBox generated emails\n\t\tacct.setEmailAddress(emailAddress);\n\t\tacct.setName(name);\n\t\t\n\t\treturn acct;\n\t}", "AccountModel findById(String accountNumber) throws AccountException;", "@GetMapping(value=\"/{address}\", produces = MediaType.APPLICATION_JSON_VALUE)\n public ResponseEntity<Mono<Address>> getAddress(@PathVariable String address)\n { \t\n \ttry\n \t{\n \t\torg.nhindirect.config.store.Address retAddress = addRepo.findByEmailAddressIgnoreCase(address).block();\n \t\tif (retAddress == null)\n \t\t\treturn ResponseEntity.status(HttpStatus.NOT_FOUND).cacheControl(noCache).build();\n \t\t\n \t\torg.nhindirect.config.store.Domain domain = domainRepo.findById(retAddress.getDomainId()).block();\n \t\t\n \t\treturn ResponseEntity.status(HttpStatus.OK).cacheControl(noCache).body(\n \t\t\t\tMono.just(EntityModelConversion.toModelAddress(retAddress, domain.getDomainName())));\n \t}\n \tcatch (Exception e)\n \t{\n \t\tlog.error(\"Error looking up address.\", e);\n \t\treturn ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).cacheControl(noCache).build();\n \t}\n }", "@Override\n\tpublic Account getAccount(Bank bank, String username) {\n\t\tif (cache.contains(bank)){\n\t\t\tfor (Account accountInBank : bank.getAccounts()) {\n\t\t\t\tif (accountInBank.getUsername().equals(username)) {\n\t\t\t\t\treturn accountInBank;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "Long getAccountId();" ]
[ "0.7655736", "0.70808685", "0.6997892", "0.68408346", "0.6775621", "0.67185694", "0.66620266", "0.65859616", "0.6572309", "0.657066", "0.65411526", "0.65205634", "0.6302669", "0.6298596", "0.62687755", "0.6251726", "0.6239711", "0.62358415", "0.62160176", "0.6215224", "0.61765575", "0.61625224", "0.6150907", "0.61443585", "0.61443585", "0.61443585", "0.61271626", "0.60943586", "0.60736465", "0.60649663", "0.6062083", "0.6057327", "0.60524994", "0.6036017", "0.6033277", "0.60270673", "0.6023791", "0.5994948", "0.5994948", "0.5981237", "0.59718645", "0.5967259", "0.5949404", "0.59365463", "0.5930285", "0.5925437", "0.59018844", "0.5898836", "0.5894757", "0.58904696", "0.58760023", "0.58518094", "0.5836707", "0.5832862", "0.5832862", "0.5832862", "0.5832862", "0.5832862", "0.5832862", "0.5830665", "0.5823135", "0.5813011", "0.5807034", "0.5807034", "0.5805607", "0.57951534", "0.5790397", "0.5790397", "0.57729095", "0.5756364", "0.57484925", "0.57476413", "0.57475644", "0.57377094", "0.57180756", "0.57113624", "0.5711324", "0.5711324", "0.5711324", "0.5711324", "0.5711324", "0.5711324", "0.5711324", "0.5711324", "0.5711324", "0.5711324", "0.5705653", "0.5701889", "0.5696504", "0.5695595", "0.56951416", "0.5682109", "0.5672186", "0.5657115", "0.5653006", "0.56504875", "0.56472397", "0.5641041", "0.5629821", "0.562276" ]
0.73661184
1
Returns an account depending on the address
public Account getAccount(byte[] address) { String addressAsHex = SHA3Util.digestToHex(address); Account account = accounts.get(addressAsHex); if (account == null) { account = createAccount(address); accounts.put(addressAsHex, account); } return account; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public AccountInterface getAccount(String _address) {\n\t\tfor (AccountInterface account: accounts) {\n\t\t\tif (account.getAddress().equals(_address))\n\t\t\t\treturn account;\n\t\t}\n\t\treturn null;\t\t\n\t}", "public Account getAccount(String address) {\n Account account = accounts.get(address);\n if (account == null) {\n account = createAccount(SHA3Util.hexToDigest(address));\n accounts.put(address, account);\n }\n return account;\n }", "AccountDetail getAccount(String number) throws Exception;", "Account getAccount(Integer accountNumber);", "Account getAccount();", "java.lang.String getAccount();", "@Override\n public Account get(final Address address) {\n BonsaiLayeredWorldState currentLayer = this;\n while (currentLayer != null) {\n final Optional<StateTrieAccountValue> maybeStateTrieAccount =\n currentLayer.trieLog.getAccount(address);\n final Optional<StateTrieAccountValue> maybePriorStateTrieAccount =\n currentLayer.trieLog.getPriorAccount(address);\n if (currentLayer == this && maybeStateTrieAccount.isPresent()) {\n return new BonsaiAccount(\n BonsaiLayeredWorldState.this, address, maybeStateTrieAccount.get(), false);\n } else if (maybePriorStateTrieAccount.isPresent()) {\n return new BonsaiAccount(\n BonsaiLayeredWorldState.this, address, maybePriorStateTrieAccount.get(), false);\n } else if (maybeStateTrieAccount.isPresent()) {\n return null;\n }\n if (currentLayer.getNextWorldView().isEmpty()) {\n currentLayer = null;\n } else if (currentLayer.getNextWorldView().get() instanceof BonsaiLayeredWorldState) {\n currentLayer = (BonsaiLayeredWorldState) currentLayer.getNextWorldView().get();\n } else {\n return currentLayer.getNextWorldView().get().get(address);\n }\n }\n return null;\n }", "private Account createAccount(byte[] address) {\n return new Account(address);\n }", "public abstract GDataAccount getAccount(String account) throws ServiceException;", "public Account getAccountByOwnerAndName(String user,String accountName);", "public BellvilleAccountant read(String account){\n BellvilleAccountant bellAccount = findAccountant(account);\r\n return bellAccount;\r\n }", "public static String getUserAddress(String accountNumber){\n return \"select ui_serviceaddress from user_information where ui_account = '\"+accountNumber+\"'\";\n }", "public HDAddressDescription findAddress(Address addr) {\n HDAddressDescription retval = null;\n for (HDAccount acct : mAccounts) {\n retval = acct.findAddress(addr);\n if (retval != null)\n return retval;\n }\n return retval;\n }", "List<Account> findAccountByAddressStartingWith(String pattern);", "public P2PUser getUser(NAddress address);", "Account getAccount(int id);", "private static void lookupAccount(String email) {\n\t\t\n\t}", "BillingAccount getBillingAccount();", "public static Account getAccountDetails(int accountId) throws SQLException {\n boolean cdt1 = Checker.checkValidUserAccountAccountId(accountId);\n // if it is a account id, establish a connection\n if (cdt1) {\n EnumMapRolesAndAccounts map = new EnumMapRolesAndAccounts();\n map.createEnumMap();\n Connection connection = DatabaseDriverHelper.connectOrCreateDataBase();\n ResultSet results = DatabaseSelector.getAccountDetails(accountId, connection);\n while (results.next()) {\n // get the account details\n String name = results.getString(\"NAME\");\n BigDecimal balance = new BigDecimal(results.getString(\"BALANCE\"));\n // make an account class (either chequing, savings, or tfsa) based on the type\n if (DatabaseSelectHelper.getAccountType(accountId) == map.accountTypes.get(AccountTypes.CHEQUING)) {\n ChequingAccount chequing = new ChequingAccountImpl(accountId, name, balance);\n connection.close();\n return chequing;\n } else if (DatabaseSelectHelper.getAccountType(accountId) == map.accountTypes.get(AccountTypes.SAVINGS)) {\n SavingsAccount savings = new SavingsAccountImpl(accountId, name, balance);\n connection.close();\n return savings;\n } else if (DatabaseSelectHelper.getAccountType(accountId) == map.accountTypes.get(AccountTypes.TFSA)) {\n TFSA tfsa = new TFSAImpl(accountId, name, balance);\n connection.close();\n return tfsa;\n } else if (DatabaseSelectHelper.getAccountType(accountId) == map.accountTypes.get(AccountTypes.RESTRICTEDSAVING)) {\n RestrictedSavingsAccount rsa = new RestrictedSavingsAccountImpl(accountId, name, balance);\n connection.close();\n return rsa;\n } else if (DatabaseSelectHelper.getAccountType(accountId) == map.accountTypes.get(AccountTypes.BALANCEOWING)) {\n BalanceOwingAccount boa = new BalanceOwingAccountImpl(accountId, name, balance);\n connection.close();\n return boa;\n }\n }\n }\n return null;\n }", "List<AccountDetail> findAllByAddressStartingWith(String address);", "@Override\n\tpublic String getAccountAddress(String account) throws WalletException {\n\t\treturn null;\n\t}", "@Override\r\n\tpublic AccountDTO getAccount(String email) {\n\t\treturn accountDao.getAccount(email);\r\n\t}", "public static Account getAccount(String accountId) {\r\n return (accounts.get(accountId));\r\n }", "java.lang.String getAccountId();", "java.lang.String getAccountId();", "java.lang.String getAccountId();", "public static String getUserAccount(String account){\n return \"select ui_account from user_information where ui_account = '\"+account+\"'\";\n }", "java.lang.String getAccountNumber();", "@Override\n\tpublic Person getPersonByAccount(String account) {\n\t\tString hql = \"from \" + Common.TABLE_PERSON + \" where account = ?\";\n\t\tString pro[] = new String[1];\n\t\tpro[0] = account;\n\t\tPerson p = (Person) dao.loadObject(hql,pro);\n\t\tif(p != null)\n\t\t\treturn p;\n\t\treturn null;\n\t}", "public LocalAccount\t\tgetAccount();", "public BankAccountInterface getAccount(String accountID){\n BankAccountInterface account = null;\n for(int i = 0; i < accounts.size(); i++){\n if(accounts.get(i).getAccountID().equals(accountID)){\n account = accounts.get(i);\n break;\n } \n }\n return account;\n }", "UserAccount getUserAccountById(long id);", "private static Account getAccount(Node node) {\n if (node.getNodeType() == Node.ELEMENT_NODE) {\n Element element = (Element) node;\n int accNum = Integer.parseInt(getTagValue(\"accountNumber\", element));\n String password = getTagValue(\"password\", element);\n double balance = Double.parseDouble(getTagValue(\"accountBalance\", element));\n String cusName = getTagValue(\"customerName\", element);\n String cusAddress = getTagValue(\"customerAddress\", element);\n String cusPhone = getTagValue(\"customerPhoneNum\", element);\n return new Account(accNum, password, balance, cusName, cusAddress, cusPhone);\n }\n return new Account();\n }", "public MnoAccount getAccountById(String id);", "private static Address getOfficialByAddress(String address) throws Exception {\n\t\tString USER_AGENT = \"Mozilla/5.0\";\n\n\t\tString name = \"\", country = \"US\", zip = \"\", city = \"\", state = \"\", line1 = \"\", line2 = \"\";\n\t\tAddress to = null;\n\t\t// Replaces all strings with '%20' for URL completion\n\t\taddress = address.replace(\" \", \"%20\");\n\t\tString urlString = \"https://www.googleapis.com/civicinfo/v2/representatives?key=AIzaSyAEU9J6KzUL_gXPGi-4S6XekJuEC0JRWjA&address=\" + address;\n\t\tURL url = new URL(urlString);\n\t\tHttpURLConnection con = (HttpURLConnection) url.openConnection();\n\t\t// By default it is GET request\n\t\tcon.setRequestMethod(\"GET\");\n\t\t//add request header\n\t\tcon.setRequestProperty(\"User-Agent\", USER_AGENT);\n\t\t\n\t\t// Reading response from input Stream\n\t\tBufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));\n\t \n\t\tString output;\n\t\tStringBuffer response = new StringBuffer();\n\t\twhile ((output = in.readLine()) != null) {\n\t\t\tresponse.append(output);\t\n\t\t}\n\t\tin.close();\n\t\t\n\t\t// Constructs JSONOBject to parse the response\n\t\tJSONObject object = new JSONObject(response.toString());\n\t\tJSONArray addresses = object.getJSONArray(\"officials\");\n\t\t\n\t\t// Takes array of individuals response and selects last index of it by default (may be optimized for more specific selections)\n\t\tJSONObject person = addresses.getJSONObject(addresses.length()-1);\n\t\tJSONArray fields = person.getJSONArray(\"address\");\n\t\tJSONObject addressTo = fields.getJSONObject(0);\n\t\t\t\t\n\t\tif(person.has(\"name\"))\n\t\t\tname = person.getString(\"name\");\n\t\t\n\t\tif(addressTo.has(\"zip\"))\n\t\t\tzip = addressTo.getString(\"zip\");\n\t\t\n\t\tif(addressTo.has(\"city\"))\n\t\t\tcity = addressTo.getString(\"city\");\n\t\t\n\t\tif(addressTo.has(\"state\"))\n\t\t\tstate = addressTo.getString(\"state\");\n\t\t\n\t\tif(addressTo.has(\"line2\"))\n\t\t\tline2 = addressTo.getString(\"line2\");\n\t\t\n\t\tif(addressTo.has(\"line1\"))\n\t\t\t line1 = addressTo.getString(\"line1\");\n\t\t\n\t\tto = new Address(name, country, zip, city, state, line2, line1);\n\t\t\n\n\t\treturn to;\n\t\t\n\t \n\t }", "private Account getAccount( int accountNumber )\n {\n for( Account currentAccount : accounts )\n {\n if( currentAccount.getAccountNumber() == accountNumber )\n {\n return currentAccount;\n }\n \n }\n return null;\n }", "Optional<Account> getAccountByUsername(String username);", "net.nyhm.protonet.example.proto.AccountProto.Account getAccount();", "net.nyhm.protonet.example.proto.AccountProto.Account getAccount();", "public CarerAccount getAccountWithUsername(String search){\n\t\tCarerAccount item = null;\n\n\t\tint count = 0;\n for (int i = 0; i < CarerAccounts.size(); ++i) {\n if (CarerAccounts.get(i).getUsername().equals(search)){\n\t\t\t\tcount++;\n item = CarerAccounts.get(i);\n\t\t\t}\n\t\t}\n\t\treturn item;\n\t}", "public abstract Address getCustomerAddress();", "public abstract LinphoneAddress getAddress();", "public Account searchAccount(String account_no)\n {\n Account account=null;\n \n try\n {\n String query=\"select * from account where account_no=\"+account_no;\n PreparedStatement ps=this.conn.prepareStatement(query);\n \n ResultSet rs=ps.executeQuery();\n \n if(rs.next())\n {\n account=new Account();\n \n account.setAccount_no(rs.getString(\"account_no\"));\n account.setAadhar_id(rs.getString(\"aadhar_no\"));\n account.setAccount_type(rs.getString(\"ac_type\"));\n account.setInterest_rate(rs.getString(\"interest\"));\n account.setBalance(rs.getString(\"balance\"));\n account.setAccount_status(rs.getString(\"ac_status\"));\n account.setName(rs.getString(\"name\"));\n }\n \n }catch(Exception e)\n {\n JOptionPane.showMessageDialog(null,e);\n }\n return account;\n }", "AionAddress createAccount(String password);", "public Account getAccount(Player p) {\n\t\tif (p == null)\n\t\t\treturn null; // safety\n\t\t// If the account is in memory, return it\n\t\tfor ( Account a : accounts) {\n\t\t\tif (a.isFor(p.getUniqueId()))\n\t\t\t\treturn a;\n\t\t}\n\t\t// spawn a new account object with default values\n\t\tAccount acct = new Account(p.getName(), p.getUniqueId());\n\t\t// load account status from yml file, if it exists\n\t\tacct.openAccount();\n\t\t// append to the bank list\n\t\taccounts.add(acct);\n\t\treturn acct;\n\t}", "public Account getSpecifiedAccount(String type, int accountNumber) {\r\n /*\r\n * Here is the table :\r\n * - 1 : Credit\r\n * - 2 : LineOfCredit\r\n * - 3 : Chequing\r\n * - 4 : Saving\r\n * */\r\n System.out.println(\"Accessing account...\");\r\n Account specifiedAccount;\r\n switch (type){\r\n case \"1\":\r\n specifiedAccount = credits[accountNumber-1];\r\n break;\r\n case \"2\":\r\n specifiedAccount = lineOfCredits[accountNumber-1];\r\n break;\r\n case \"3\":\r\n specifiedAccount = chequing[accountNumber-1];\r\n break;\r\n case \"4\":\r\n specifiedAccount = saving[accountNumber-1];\r\n break;\r\n default:\r\n specifiedAccount = null;\r\n break;\r\n }\r\n return specifiedAccount;\r\n }", "String getAddress(int type);", "List<Account> getAccountByCountryOrState(String country,String state);", "public AccountInfo getAccount()\n {\n if(accountInfo == null)\n {\n System.out.println(\"You need to generate an account before getting the details.\");\n return null;\n }\n return accountInfo;\n }", "kr.pik.message.Profile.ProfileMessage.ContactAddress getContactAddress(int index);", "private Account getAccount(int accountNumber) {\r\n // loop through accounts searching for matching account number\r\n for (Account currentAccount : accounts) {\r\n // return current account if match found\r\n if (currentAccount.getAccountNumber() == accountNumber) {\r\n return currentAccount;\r\n }\r\n }\r\n\r\n return null; // if no matching account was found, return null\r\n }", "private Account findAccount(String name, String email) throws AccountNotFoundException {\n for (Account current: accounts) {\n if (name.equals(current.getName()) && email.equals(current.getEmail())) {\n return current;\n }\n }\n throw new AccountNotFoundException();\n }", "public static PhoneAccount getInstance(PhoneNumber phoneNumber, Person accountHolder, String type) {\n\t\tPhoneAccount pa = phoneAccounts.get(phoneNumber); \n\t\t\n\t\tif(pa != null) {\n\t\t\treturn pa; \n\t\t}\n\t\t\n\t\tif(type.equals(PAY_AS_YOU_GO)) {\n\t\t\tpa = new PayAsYouGoAccount(phoneNumber, accountHolder);\n\t\t\tLOG.info(\"Pay as you go account created\");\n\t\t} else if(type.equals(UNLIMITED)) {\n\t\t\tpa = new UnlimitedAccount(phoneNumber, accountHolder);\n\t\t\tLOG.info(\"Unlimited account created\");\n\t\t} else {\n\t\t\tLOG.warning(\"Invalid phone account type: \" + type);\n\t\t\tthrow new IllegalArgumentException(\"Invalid Phone Account type: \" + type);\n\t\t}\n\t\t\n\t\tphoneAccounts.put(phoneNumber, pa);\n\t\treturn pa;\n\t}", "public BankAccount lookUp(String name){\n\t\t// create an Entry with the given name, a \"dummy\" accountNumber (1) and zero balance\n\t\t// This \"dummy\" accountNumber will be ignored when executing getData\n\t\tBankAccount lookFor = new BankAccount(name, 1, 0);\n\t\treturn (BankAccount)namesTree.findData(lookFor);\n\t}", "java.lang.String getAddress();", "java.lang.String getAddress();", "java.lang.String getAddress();", "java.lang.String getAddress();", "java.lang.String getAddress();", "java.lang.String getAddress();", "Account findByAccountType(String accountType);", "public final AfAccount getAccount(String accountName) {\n return _accounts.get(accountName);\n }", "java.lang.String getLoginAccount();", "java.lang.String getLoginAccount();", "@Override\n\tpublic Account getAccount(String username) {\n\t\treturn map.get(username);\n\t}", "List<Account> findByAddressStartingWith(String startAddress);", "String getAddress();", "String getAddress();", "public PhoneAccount getPhoneAccount(PhoneAccountHandle handle, UserHandle userHandle) {\n return getPhoneAccount(handle, userHandle, /* acrossProfiles */ false);\n }", "static void printAccountBalance(String address){\n }", "Account getAccount(Long recvWindow, Long timestamp);", "public Account loadAccount(ExternalAccountInfoSupplier externalAccountInfoSupplier) {\n Type type = externalAccountInfoSupplier.getType();\n String externalId = externalAccountInfoSupplier.getExternalId();\n Supplier<String> email = memoize(externalAccountInfoSupplier::getExternalEmail);\n\n // Find an account via this external id and type\n Optional<Account> optionalAccount = accountService.findByExternalAccount(type, externalId);\n return optionalAccount.map(Optional::of).orElseGet(() ->\n // ...if the account is not found, find it by email\n accountService.findByEmail(email.get())\n // ...if its there, create an external account for future references\n .map(account -> createExternalAccount(account, type, externalId)))\n // If no account available create completely new account\n .orElseGet(() -> createAccount(externalAccountInfoSupplier));\n }", "public Address getDefaultBillingAddress();", "public Account findAccount() {\n Account[] accounts = accountManager.getAccountsByType(ACCOUNT_TYPE);\n\n // only one matching account - use it, and remember it for the next time.\n if (accounts.length == 1) {\n persistAccountName(accounts[0].name);\n return accounts[0];\n }\n\n // No accounts, create one and use it if created, otherwise we have no account to use\n\n if (accounts.length == 0) {\n String accountName = createAccount();\n if (accountName != null) {\n persistAccountName(accountName);\n return accountManager.getAccountsByType(ACCOUNT_TYPE)[0];\n } else {\n Log.i(LOG_TAG, \"User failed to create a valid account\");\n return null;\n }\n }\n\n // Still valid previously chosen account - use it\n\n Account account;\n String accountName = getPersistedAccountName();\n if (accountName != null && (account = chooseAccount(accountName, accounts)) != null) {\n return account;\n }\n\n // Either there is no saved account name, or our saved account vanished\n // Have the user select the account\n\n accountName = selectAccount(accounts);\n if (accountName != null) {\n persistAccountName(accountName);\n return chooseAccount(accountName, accounts);\n }\n\n // user didn't choose an account at all!\n Log.i(LOG_TAG, \"User failed to choose an account\");\n return null;\n }", "public static ATMAccount createAccount() {\r\n\t\tString userName;\r\n\t\tdouble userBalance;\r\n\t\tint digit = -1;\r\n\r\n\t\tSystem.out.println(\"Please enter a name for the account: \");\r\n\t\tuserInput.nextLine();\r\n\t\tuserName = userInput.nextLine();\r\n\r\n\t\t//Requests digits 1 by 1 for the pin number\r\n\t\tString accPin = \"\";\r\n\t\tfor (int i = 1; i < 5; i++) {\r\n\t\t\tdigit = -1;\r\n\t\t\tSystem.out.println(\"Please enter digit #\" + i + \" of\" + \"your pin.\");\r\n\t\t\tdo {\r\n\t\t\t\tdigit = userInput.nextInt();\r\n\t\t\t} while (digit < 0 || digit > 9);\r\n\t\t\taccPin += digit;\r\n\t\t}\r\n\r\n\t\tSystem.out.println(\"Please put the amount of money you would like to \" + \"initially deposit into the account: \");\r\n\t\tuserBalance = userInput.nextDouble();\r\n\t\tRandom accountIDGenerator = new Random();\r\n\t\tint userID = accountIDGenerator.nextInt(2147483647);\r\n\t\tATMAccount account = new ATMAccount(userID, userName, Integer.parseInt(accPin), userBalance);\r\n\t\tSystem.out.println(\"Acount Information: \\n\"+account.toString());\r\n\t\treturn account;\r\n\t}", "public String getAccount(){\n\t\treturn account;\n\t}", "public String getAccount() {\n return account;\n }", "public String getAccount() {\n return account;\n }", "public String getAccount() {\n return account;\n }", "public String getAccount() {\n return account;\n }", "public String getAccount() {\n return account;\n }", "public String getAccount() {\n return account;\n }", "public String getAccount() {\n return account;\n }", "public String getAccount() {\n return account;\n }", "public String getAccount() {\n return account;\n }", "public String getAccount() {\n return account;\n }", "public Account getAccount(String username)\n\t {\n\t\t Account account = null;\n\t\t \n\t\t String columns[] = new String[] {DatabaseContract.AccountContract.COLUMN_NAME_USERNAME,\n\t\t\t\t \t\t\t\t\t\t\tDatabaseContract.AccountContract.COLUMN_NAME_BALANCE,\n\t\t\t\t \t\t\t\t\t\t\tDatabaseContract.AccountContract.COLUMN_NAME_AUTH_TOKEN};\n\t\t \n\t\t String where = DatabaseContract.AccountContract.COLUMN_NAME_USERNAME + \" = ? \";\n\t\t \n\t\t Cursor cursor = db.query(DatabaseContract.AccountContract.TABLE_NAME,\n\t\t\t\t columns,\n\t\t\t\t where,\n\t\t\t\t new String[] {username},\n\t\t\t\t null, null, null);\n\t\t\n\t\t if(cursor.getCount() > 0)\n\t\t {\n\t\t\t cursor.moveToFirst();\n\t\t\t \n\t\t\t int userCol = cursor.getColumnIndex(DatabaseContract.AccountContract.COLUMN_NAME_USERNAME);\n\t\t\t int balCol = cursor.getColumnIndex(DatabaseContract.AccountContract.COLUMN_NAME_BALANCE);\n\t\t\t int authCol = cursor.getColumnIndex(DatabaseContract.AccountContract.COLUMN_NAME_AUTH_TOKEN);\n\t\t\t \n\t\t\t String usernameString = cursor.getString(userCol);\n\t\t\t String authTokenString = cursor.getString(authCol);\n\t\t\t int balance = cursor.getInt(balCol);\n\t\t\t \n\t\t\t account = new Account(usernameString, authTokenString, balance); \n\t\t }\n\t\t \n\t\t cursor.close();\n\t\t return account;\n\t }", "public Friend findFriend(Address addr);", "@Override\n public Account findByAccountNumber(String accountNumber) {\n Query findByAccNum = new Query();\n findByAccNum.addCriteria(Criteria.where(\"accountNumber\").is(accountNumber));\n Account found = operations.findOne(findByAccNum, Account.class);\n return found;\n }", "public String getAccount() {\r\n return account;\r\n }", "public Account getAccount(int accound_index){\n return accounts[accound_index];\n }", "public InternetAddress getFromAddress();", "public void getAddress() {\n if (mLocation != null) {\n mBusinessAddress = AppUtil.getAddress(getContext(), mLocation);\n } else {\n mLocation = null;\n if (ActivityCompat.checkSelfPermission(getContext(), android.Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(getContext(), android.Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED) {\n LocationManager locationManager = (LocationManager) getActivity().getSystemService(LOCATION_SERVICE);\n Criteria criteria = new Criteria();\n Location currLocation = locationManager.getLastKnownLocation(locationManager.getBestProvider(criteria, false));\n if (currLocation != null) {\n mBusinessAddress = AppUtil.getAddress(getContext(), new LatLng(currLocation.getLatitude(), currLocation.getLongitude()));\n } else {\n locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 5000, 5, this);\n if (mCurrLocation != null) {\n mBusinessAddress = AppUtil.getAddress(getContext(), new LatLng(mCurrLocation.getLatitude(), mCurrLocation.getLongitude()));\n } else {\n // Default location in case location search doesn't work on first try\n mBusinessAddress = DiscoverConstants.DEFAULT_LOCATION;\n }\n }\n } else {\n mBusinessAddress = null;\n }\n }\n }", "public UserAccount getUserAccountByLoginId(String loginId);", "Optional<Account> findByNumber(long number);", "public Account fillAccount(String emailAddress, String name) {\n\t\tAccount acct = new Account();\n\t\t// Set the unique Id on our side that we pass when we are creating this account\n\t\tacct.setMerchantAccountId(VindiciaUtil.createUniqueId(\"account\")); \n\n\t\t// Specify customer's email address here . This the address where customer\n\t\t// will receive CashBox generated emails\n\t\tacct.setEmailAddress(emailAddress);\n\t\tacct.setName(name);\n\t\t\n\t\treturn acct;\n\t}", "AccountModel findById(String accountNumber) throws AccountException;", "@GetMapping(value=\"/{address}\", produces = MediaType.APPLICATION_JSON_VALUE)\n public ResponseEntity<Mono<Address>> getAddress(@PathVariable String address)\n { \t\n \ttry\n \t{\n \t\torg.nhindirect.config.store.Address retAddress = addRepo.findByEmailAddressIgnoreCase(address).block();\n \t\tif (retAddress == null)\n \t\t\treturn ResponseEntity.status(HttpStatus.NOT_FOUND).cacheControl(noCache).build();\n \t\t\n \t\torg.nhindirect.config.store.Domain domain = domainRepo.findById(retAddress.getDomainId()).block();\n \t\t\n \t\treturn ResponseEntity.status(HttpStatus.OK).cacheControl(noCache).body(\n \t\t\t\tMono.just(EntityModelConversion.toModelAddress(retAddress, domain.getDomainName())));\n \t}\n \tcatch (Exception e)\n \t{\n \t\tlog.error(\"Error looking up address.\", e);\n \t\treturn ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).cacheControl(noCache).build();\n \t}\n }", "@Override\n\tpublic Account getAccount(Bank bank, String username) {\n\t\tif (cache.contains(bank)){\n\t\t\tfor (Account accountInBank : bank.getAccounts()) {\n\t\t\t\tif (accountInBank.getUsername().equals(username)) {\n\t\t\t\t\treturn accountInBank;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "@Override\n\tpublic Account getAccount(String username) throws SQLException {\n\t\tif (username.length() > Account.getMaxString())\n\t\t\treturn null;\n\t\t\n\t\t// Prepare required account variables\n\t\tString password;\n\t\tString email;\n\t\tint id;\n\n\t\t// Prepare SQL line\n\t\tString sqlQuery = \"SELECT * \"\n\t\t\t\t+ \"FROM account \"\n\t\t\t\t+ \"WHERE username LIKE ?\";\n\t\tPreparedStatement statement = dbConnection.prepareStatement(sqlQuery);\n\t\tstatement.setString(1, username);\n\n\t\t// Execute SQL query\n\t\tResultSet result = statement.executeQuery();\n\n\t\t// If result found, set variables\n\t\t// Otherwise, return null\n\t\tif (result.next()) {\n\t\t\tid = result.getInt(\"id\");\n\t\t\tusername = result.getString(\"username\");\n\t\t\tpassword = result.getString(\"password\");\n\t\t\temail = result.getString(\"email\");\n\t\t\tstatement.close();\n\t\t\tresult.close();\n\t\t}\n\t\telse {\n\t\t\tstatement.close();\n\t\t\tresult.close();\n\t\t\treturn null;\n\t\t}\n\n\t\t// Create account & return it\n\t\tAccount account = new Account(id, username, password, email);\n\t\treturn account;\n\t}" ]
[ "0.765735", "0.73675513", "0.70830977", "0.6843662", "0.67778784", "0.67197627", "0.66624206", "0.6587281", "0.6573827", "0.6571377", "0.65424454", "0.65194935", "0.6302788", "0.629904", "0.62674195", "0.6254284", "0.6241283", "0.62360895", "0.6217586", "0.6213923", "0.6176791", "0.61643434", "0.6153094", "0.61457753", "0.61457753", "0.61457753", "0.61279434", "0.609501", "0.6074728", "0.60665107", "0.60635823", "0.6058898", "0.60557663", "0.60354894", "0.6033606", "0.60292506", "0.6025282", "0.599617", "0.599617", "0.5983424", "0.5970399", "0.59656006", "0.59516007", "0.59380865", "0.5931962", "0.5927343", "0.5899492", "0.58983356", "0.5896501", "0.5889599", "0.5877906", "0.5853412", "0.5837779", "0.58320856", "0.58306015", "0.58306015", "0.58306015", "0.58306015", "0.58306015", "0.58306015", "0.5823988", "0.5814857", "0.58082056", "0.58082056", "0.58069754", "0.5794522", "0.5788511", "0.5788511", "0.5772634", "0.57560694", "0.5749757", "0.5747662", "0.5746334", "0.5739554", "0.57202667", "0.5713501", "0.57133704", "0.57133704", "0.57133704", "0.57133704", "0.57133704", "0.57133704", "0.57133704", "0.57133704", "0.57133704", "0.57133704", "0.57083035", "0.57018083", "0.56987095", "0.5697729", "0.56975555", "0.56814826", "0.56705874", "0.56585366", "0.565436", "0.56512123", "0.5649637", "0.5639893", "0.56311506", "0.56250983" ]
0.69996774
3
Creates a new account with a given address
private Account createAccount(byte[] address) { return new Account(address); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "AionAddress createAccount(String password);", "public Address createAddress(String address);", "Account create();", "public void createUserAccount(UserAccount account);", "public Account createAccount(String login, String name, String surname, String city, String street, int number) throws Exception {\r\n\t\tif (login==null || login.equals(\"\")) throw(new Exception(\"Nazwa konta nie moze byc pusta\"));\r\n\t\tif (findAccount(login)!=null) throw(new Exception(\"Konto juz istnieje\"));\r\n\t\tAccount newAccount = new Account(login, name, surname, city, street, number);\r\n\t\tlistOfAccounts.add( newAccount );\r\n\t\treturn newAccount;\r\n\t}", "public void createAccount() {\n\t\tSystem.out.print(\"Enter Name: \");\n\t\tString name = nameCheck(sc.next());\n\t\tSystem.out.print(\"Enter Mobile No.: \");\n\t\tlong mobNo = mobCheck(sc.nextLong());\n\t\tlong accNo = mobNo - 1234;\n\t\tSystem.out.print(\"Enter Balance: \"); \n\t\tfloat balance = amountCheck(sc.nextFloat());\n\t\tuserBean BeanObjCreateAccountObj = new userBean(accNo, name, mobNo, balance);\n\t\tSystem.out.println(\"Account created with Account Number: \" +accNo);\n\t\tServiceObj.bankAccountCreate(BeanObjCreateAccountObj);\n\t\t\n\t\n\t}", "public Account createAccount(String emailAddress) {\n\t\tAccount acct = fillAccount(emailAddress, emailAddress);\n\t\t\n\t\ttry {\n\t\t\tboolean created = acct.update(null);\n\t\t\tif (created) \n\t\t\t\tSystem.out.println(\"Account created\");\n\t\t\telse\n\t\t\t\tSystem.out.println(\"Account updated\");\n\t\t} catch (VindiciaReturnException e) {\n\t\t\tSystem.out.println(\"Vindicia response string: \" + e.getMessage() + \" , Call SOAP ID: \" + e.getSoapId());\n\t\t\te.printStackTrace();\n\t\t} catch (VindiciaServiceException e) {\n\t\t\tSystem.out.println(\"Vindicia response string: \" + e.getMessage());\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn acct;\n\t}", "Address createAddress();", "public static void createAccount(String name, String address, String contactNum, String userId, String password, float initDeposit) {\n\t\tcustomerList.add(new Customer(name, address, contactNum, new SavingsAccount(userId, password, initDeposit)));\n\t}", "int createAccount(Account account);", "private void createAccount()\n {\n // check for blank or invalid inputs\n if (Utils.isEmpty(edtFullName))\n {\n edtFullName.setError(\"Please enter your full name.\");\n return;\n }\n\n if (Utils.isEmpty(edtEmail) || !Utils.isValidEmail(edtEmail.getText().toString()))\n {\n edtEmail.setError(\"Please enter a valid email.\");\n return;\n }\n\n if (Utils.isEmpty(edtPassword))\n {\n edtPassword.setError(\"Please enter a valid password.\");\n return;\n }\n\n // check for existing user\n AppDataBase database = AppDataBase.getAppDataBase(this);\n User user = database.userDao().findByEmail(edtEmail.getText().toString());\n\n if (user != null)\n {\n edtEmail.setError(\"Email already registered.\");\n return;\n }\n\n user = new User();\n user.setId(database.userDao().findMaxId() + 1);\n user.setFullName(edtFullName.getText().toString());\n user.setEmail(edtEmail.getText().toString());\n user.setPassword(edtPassword.getText().toString());\n\n database.userDao().insert(user);\n\n Intent intent = new Intent(this, LoginActivity.class);\n intent.putExtra(\"user\", user);\n startActivity(intent);\n }", "public void createAccount() {\n System.out.println(\"Would you like to create a savings or checking account?\");\n String AccountRequest = input.next().toLowerCase().trim();\n createAccount(AccountRequest);\n\n }", "public static ATMAccount createAccount() {\r\n\t\tString userName;\r\n\t\tdouble userBalance;\r\n\t\tint digit = -1;\r\n\r\n\t\tSystem.out.println(\"Please enter a name for the account: \");\r\n\t\tuserInput.nextLine();\r\n\t\tuserName = userInput.nextLine();\r\n\r\n\t\t//Requests digits 1 by 1 for the pin number\r\n\t\tString accPin = \"\";\r\n\t\tfor (int i = 1; i < 5; i++) {\r\n\t\t\tdigit = -1;\r\n\t\t\tSystem.out.println(\"Please enter digit #\" + i + \" of\" + \"your pin.\");\r\n\t\t\tdo {\r\n\t\t\t\tdigit = userInput.nextInt();\r\n\t\t\t} while (digit < 0 || digit > 9);\r\n\t\t\taccPin += digit;\r\n\t\t}\r\n\r\n\t\tSystem.out.println(\"Please put the amount of money you would like to \" + \"initially deposit into the account: \");\r\n\t\tuserBalance = userInput.nextDouble();\r\n\t\tRandom accountIDGenerator = new Random();\r\n\t\tint userID = accountIDGenerator.nextInt(2147483647);\r\n\t\tATMAccount account = new ATMAccount(userID, userName, Integer.parseInt(accPin), userBalance);\r\n\t\tSystem.out.println(\"Acount Information: \\n\"+account.toString());\r\n\t\treturn account;\r\n\t}", "private void createAccount(String username, String passphrase, String email) {\n\tif (!AccountManager.getUniqueInstance().candidateUsernameExists(username)) {\n\t try {\n\t\tAccountManager.getUniqueInstance().createCandidateAccount(username, \n\t\t\t\t\t\t\t\t\t passphrase, \n\t\t\t\t\t\t\t\t\t email);\n\t } catch (Exception e) {\n\t\tthrow new RuntimeException(\"creation failed\");\n\t }\n\t} else {\n\t throw new RuntimeException(\"username already exists\");\n\t}\n }", "abstract public Address createAddress(String addr);", "@POST\r\n @Path(\"/create\")\r\n @Consumes(MediaType.APPLICATION_FORM_URLENCODED)\r\n @Produces(MediaType.APPLICATION_JSON)\r\n public NewAccount createNewCustomerAccount(@FormParam(\"accountNumber\") int accountNumber,\r\n @FormParam(\"accountType\") String accountType,\r\n @FormParam(\"accountBalance\") double accountBalance\r\n ){\r\n return newaccountservice.createNewAccount(accountNumber, accountType, accountBalance);\r\n }", "public static void createAccount(String name, String address, String contactNum, SavingsAccount savings) {\n\t\tcustomerList.add(new Customer(name, address, contactNum, savings));\n\t}", "UserAccount createUserAccount(User user, double amount);", "public abstract void createAccount(final GDataAccount account)\n throws ServiceException;", "private void createNewAccount() {\n\n // if user has not provided valid data, do not create an account and return from method\n if (!validateData()) {\n return;\n }\n\n // If flag value is false, that means email provided by user doesn't exists in database\n // so initialize the loader to create a new account\n if (!mEmailExistsFlag) {\n getLoaderManager().initLoader(CREATE_NEW_ACCOUNT_LOADER_ID, null, this);\n } else {\n // If flag is true, that means email provided by user already exists in database\n // so restart the loader and allow user to enter new email address for account\n getLoaderManager().restartLoader(CREATE_NEW_ACCOUNT_LOADER_ID, null, this);\n }\n\n }", "Account create(Context context);", "public void addUser(String username, String password, String name, String phone, String email, String address, Date dob) throws AccountException {\n accounts.add(new Account(username, getMd5(password), name, phone, email, address, dob));\n }", "@POST\n @Path(\"/user/account\")\n @Consumes(MediaType.APPLICATION_FORM_URLENCODED)\n public void createUserAccount(@FormParam(\"name\") String name, @FormParam(\"email\") String email, @FormParam(\"password\") String password, @FormParam(\"con_password\") String confirmPassword, @FormParam(\"address\") String address){\n \n System.out.println(name);\n System.out.println(email);\n System.out.println(password);\n System.out.println(confirmPassword);\n System.out.println(address);\n \n }", "public void signup(String username, String password, String phoneNum,\r\n\t\t\tString address) {\n\t\tuserInfoMapper.signup(username, password, phoneNum, address);\r\n\t}", "public Account createAccount(Account account){\n\t\t\n\t\taccount.createdDate = new Date();\n\t\taccount.isActive = true;\n\t\t\n\t\t\n\t\taccount.person = personService.createPerson(account.person);\n\t\taccount.person.personSettings = personalSettingsService.createSettings(account.person.personSettings);\n\t\t\n\t\t\n\t\treturn account;\n\t}", "public Account fillAccount(String emailAddress, String name) {\n\t\tAccount acct = new Account();\n\t\t// Set the unique Id on our side that we pass when we are creating this account\n\t\tacct.setMerchantAccountId(VindiciaUtil.createUniqueId(\"account\")); \n\n\t\t// Specify customer's email address here . This the address where customer\n\t\t// will receive CashBox generated emails\n\t\tacct.setEmailAddress(emailAddress);\n\t\tacct.setName(name);\n\t\t\n\t\treturn acct;\n\t}", "public void createBillingAddress() throws Exception{\n\t\t\n\t\ttype(firstNameTextBox,\"bob\");\n\t\ttype(lastNameTextBox,\"test\");\n\t\ttype(addressLine1TextBox,\"2716 Ocean Park Blvd Suite 1030\");\n\t\ttype(addressLine2TextBox,\"test house\");\n\t\ttype(cityTextBox,\"Santa Monica\");\n\t\ttype(zipcodeTextBox,\"90405\");\n\t\tselect(stateSelectBox,8);\n\t\ttype(phoneTextField,\"6666654686\");\n\t\ttype(companyTextField,\"test company\");\n\t\n\t}", "public void createAccount(Account account) \n\t\t\tthrows SQLException, RegisterAccountDBException {\n\t\t\n\t\tString msg =\"Could not create account\";\n\t\tint updateRows=0;\n\t\t\n\t\ttry {\n\t\t\t//if(!accountExist(account.getPersonnr())) {\n\t\t\tif(getStudentInfo(account.getPersonnr())==null) {\n\t\t\tString personnr = account.getPersonnr();\n\t\t\tcreateAccountStmt.setString(1, personnr);\n\t\t updateRows = createAccountStmt.executeUpdate();\n\t\t if(updateRows!=1) {\n\t\t \thandleException(msg, null);\n\t\t }\n\t\t\tconnection.commit();\n\t\t }\n\t\t}catch (SQLException ex) {\n\t\t\thandleException(msg , ex);\t\n\t\t}\n\t}", "void createCustomerAccount(String mobileNumber) throws Exception;", "@Override\n\tpublic void createAccount(String username, Bank bank) {\n\t\ttry {\n\t\tAccount newAccount = new Account(username, bank.getBankID(), bank.getNumOfAccounts()+1);\n\t\tbank.setNumOfAccounts(bank.getNumOfAccounts()+1);\n\t\taddAccount(bank, newAccount);\n\t\t}catch(NullPointerException e) {\n\t\t\tSystem.out.println(\"Could not find bank\");\n\t\t}\n\t\t\n\t}", "@Test\n\tpublic void createAccount() {\t\n\t\t\n\t\tRediffOR.setCreateAccoutLinkClick();\n\t\tRediffOR.getFullNameTextField().sendKeys(\"Kim Smith\");\n\t\tRediffOR.getEmailIDTextField().sendKeys(\"Kim Smith\");\n\t\t\t\t\t\n\t\t\n\t}", "@Override\r\n\tpublic Adress createAdress(Adress adress) {\n\t\tem.persist(adress);\r\n\t\treturn adress;\r\n\t}", "public void makeNewUser(String name, int age, String address, String password)\n throws SQLException, ConnectionFailedException, DatabaseInsertException {\n if (this.currentUserAuthenticated) {\n // find the role ID that corresponds to customer\n EnumMapRolesAndAccounts map = new EnumMapRolesAndAccounts();\n map.createEnumMap();\n int roleId = map.roleIds.get(Roles.CUSTOMER);\n int userId = DatabaseInsertHelper.insertNewUser(name, age, address, roleId, password);\n System.out.println(\"User ID - \" + userId);\n System.out.println(\"succesfully made user\");\n } else {\n System.out.println(\"failed making user\");\n throw new ConnectionFailedException();\n }\n }", "protected void createAccount(JSONArray args, final CallbackContext callbackContext) {\n\t\tLog.d(TAG, \"CREATEACCOUNT\");\n\t\ttry {\n\t\t\tString email = args.getString(0);\n\t\t\tString password = args.getString(1);\n\t\t\tString userName = null;\n\t\t\tif (args.length() == 3) {\n\t\t\t\tuserName = args.optString(2);\n\t\t\t}\n\t\t\tNotificare.shared().createAccount(email, password, userName, new NotificareCallback<Boolean>() {\n\n\t\t\t\t@Override\n\t\t\t\tpublic void onSuccess(Boolean result) {\n\t\t\t\t\tif (callbackContext == null) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tcallbackContext.success();\n\t\t\t\t}\n\n\t\t\t\t@Override\n\t\t\t\tpublic void onError(NotificareError error) {\n\t\t\t\t\tif (callbackContext == null) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tcallbackContext.error(error.getLocalizedMessage());\n\t\t\t\t}\n\t\t\t});\n\t\t} catch (JSONException e) {\n\t\t\tcallbackContext.error(\"JSON parse error\");\n\t\t}\n\t}", "@Test(priority=1, dataProvider=\"User Details\")\n\t\tpublic void registration(String firstname,String lastname,String emailAddress,\n\t\t\t\tString telephoneNum,String address1,String cityName,String postcodeNum,\n\t\t\t\tString country,String zone,String pwd,String confirm_pwd) throws Exception{\n\t\t\t\n\t\t\thomePage = new HomePage(driver);\n//'**********************************************************\t\t\t\n//Calling method to click on 'Create Account' link\n\t\t\tregistraionPageOC = homePage.clickCreateAccount();\n//'**********************************************************\t\t\t\n//Calling method to fill user details in Registration page and verify account is created\n\t\t\tregistraionPageOC.inputDetails(firstname,lastname,emailAddress,telephoneNum,address1,cityName,postcodeNum,country,zone,pwd,confirm_pwd);\n\t\t\ttry{\n\t\t\tAssert.assertEquals(\"Your Account Has Been Created!\", driver.getTitle(),\"Titles Not Matched: New Account Not Created\");\n\t\t\textentTest.log(LogStatus.PASS, \"Registration: New User Account is created\");\n\t\t\t}catch(Exception e){\n\t\t\t\textentTest.log(LogStatus.FAIL, \"Registration is not successful\");\n\t\t\t}\n\t\t}", "public void create(UserValidator account) {\n Account validated = new Account();\n validated.setUsername(account.getUsername());\n validated.setPassword(passwordEncoder.encode(account.getPassword()));\n validated.setFirstName(account.getFirstName());\n validated.setLastName(account.getLastName());\n validated.getAuthorities().add(\"USER\");\n\n this.accountRepository.save(validated);\n }", "@POST\n @Consumes(MediaType.APPLICATION_JSON)\n @Produces(MediaType.TEXT_PLAIN)\n public Response createAccount(\n AccountModel input, @Context HttpServletResponse response) {\n if (input.getEmail() == null || input.getEmail().equals(\"\") || input.getPassword() == null || input.getPassword().isEmpty()\n || input.getUserName() == null || input.getUserName().isEmpty()) {\n return Response.status(Response.Status.BAD_REQUEST).build();\n }\n Customer customer = new Customer();\n customer.setEmail(input.getEmail());\n customer.setPassword(input.getPassword());\n customer.setUserName(input.getUserName());\n String sendToken = TokenUtil.getToken(input.getEmail(), input.getPassword());\n customer.setToken(sendToken);\n Long id = customerRef.save(customer);\n if (id != null || id > 0) {\n response.setHeader(\"AuthHeader\", sendToken);\n return Response.status(Response.Status.CREATED).build();\n }\n return Response.status(Response.Status.NOT_IMPLEMENTED).build();\n\n }", "public Friend createFriendWithAddress(String address);", "public CoinbaseAccount createCoinbaseAccount(String name) throws IOException {\n\n class Payload {\n @JsonProperty\n String name;\n Payload(String name) {\n this.name = name;\n }\n }\n \n Payload payload = new Payload(name);\n\n String path = \"/v2/accounts\";\n String apiKey = exchange.getExchangeSpecification().getApiKey();\n BigDecimal timestamp = coinbase.getTime(Coinbase.CB_VERSION_VALUE).getData().getEpoch();\n String body = new ObjectMapper().writeValueAsString(payload);\n String signature = getSignature(timestamp, HttpMethod.POST, path, body);\n showCurl(HttpMethod.POST, apiKey, timestamp, signature, path, body);\n \n return coinbase.createAccount(MediaType.APPLICATION_JSON, Coinbase.CB_VERSION_VALUE, apiKey, signature, timestamp, payload).getData();\n }", "public abstract void createAccount(JSONObject account);", "public void createESEAccount(String farmerId, String farmerAcctNo, Date txnTime, int type);", "private void onClickCreateAddressButton() {\n // Validate\n if (!formValidated()) {\n } else {\n\n ContentValues values = new ContentValues();\n values.put(\"address_form[id]\", \"\");\n values.put(\"address_form[first_name]\", name.getText().toString());\n values.put(\"address_form[last_name]\", family.getText().toString());\n values.put(\"address_form[address1]\", address.getText().toString());\n values.put(\"address_form[address2]\", postal_code.getText().toString());\n values.put(\"address_form[region]\", region_Id);\n values.put(\"address_form[city]\", city_Id);\n if (post_id != UNKNOWN_POSTAL_CODE) {\n values.put(\"address_form[postcode]\", post_id);\n } else {\n values.put(\"address_form[postcode]\", \"\");\n }\n values.put(\"address_form[phone]\", cellphone.getText().toString());\n values.put(\"address_form[is_default_shipping]\", 1);\n values.put(\"address_form[is_default_billing]\", 1);\n\n values.put(\"address_form[gender]\", gender_lable);\n\n\n triggerCreateAddress(createAddressUrl, values);\n }\n }", "public Account createAccount(String accountId) throws LedgerException {\n // Check uniqueness of 'accountId'\n if (getExistingAccount(accountId) != null) {\n throw new LedgerException(\n \"create account\",\n String.format(\"The account '%s' already exists.\", accountId)\n );\n }\n\n // The accountId is unique, so create new account\n Account newAccount = new Account(accountId);\n\n // Update currentBlock with new account\n this.currentBlock.addAccount(newAccount);\n return newAccount;\n }", "public BankAccount createAccount(String name, String pin, int initialDeposit) {\n\t\tString accountNumber = \"\";\n\n\t\tString sql = \"INSERT INTO accounts (id, name, pin, balance, balance_saving) VALUES(?, ?, ?, ?, ?)\";\n\t\ttry (PreparedStatement pstmt = dbConnection.prepareStatement(sql)) {\n\t\t\t// not sure why this was changed, but the database should of been auto-incrementing id\n\t\t\tpstmt.setInt(1, getNumAccounts() + 1);\n\t\t\tpstmt.setString(2, name);\n\t\t\tpstmt.setString(3, pin);\n\t\t\tpstmt.setInt(4, initialDeposit);\n\t\t\tpstmt.setInt(5, 0);\n\n\t\t\tpstmt.executeUpdate();\n\t\t\tResultSet genky = pstmt.getGeneratedKeys();\n\t\t\taccountNumber = Long.toString(genky.getLong(1));\n\t\t} catch (SQLException e) {\n\t\t\tSystem.out.println(e.getMessage());\n\t\t}\n\n\t\treturn authenticateAccount(accountNumber, pin);\n\t}", "public void createUser(String firstName, String emailAddress) {\n\n this.firstName = firstName;\n this.emailAddress = emailAddress;\n\n }", "Adresse createAdresse();", "@Override\n\tpublic String createUserAccountQuery(String username, String password, String firstName, String lastName,\n\t\t\tString dob, String accountType, String accountID, String creationDate, String requestDate,\n\t\t\tString phoneNumber, String email, boolean isApproved) {\n\t\treturn null;\n\t}", "public Long createAndStoreAddress(Address address, Long userId)\n {\n \tLong returnValue = Long.valueOf(0);\n\n address.setCreatedByID(userId);\n address.setUpdatedByID(userId);\n address.setDateCreated(new Date());\n address.setDateUpdated(new Date());\n \n this.sessionFactory.getCurrentSession().save(address);\n \n returnValue = address.getId();\n\t\t\n\t\treturn returnValue;\n }", "public void createAccount(double balance) {\r\n\t\tAccount account = new Account(balance);\r\n\t\tsetPlayerAccount(account);\r\n\t}", "public void createAccount(){\n System.out.println(\"vi skal starte \");\n }", "public void createAccount(String username, String password) {\n\t\tString send;\n\t\tsend = \"<NewAccount=\" + username + \",\" + password + \">\";\n\n\t\ttry {\n\t\t\tdos.writeUTF(send);\n\t\t} catch (Exception e) {\n\t\t\t//TODO\n\t\t}\n\t}", "public void creatUser(String name, String phone, String email, String password);", "private void createUser(String Address, String Phone_number,String needy) {\n // TODO\n // In real apps this userId should be fetched\n // by implementing firebase auth\n if (TextUtils.isEmpty(userId)) {\n userId = mFirebaseDatabase.push().getKey();\n }\n\n com.glitch.annapurna.needy user = new needy(Address,Phone_number,needy);\n\n mFirebaseDatabase.child(userId).setValue(user);\n\n addUserChangeListener();\n }", "@Override\n public boolean createAccount(String fullName, String username, String password, String email){\n // will change this if we make some errors.\n if(!usernameToPerson.containsKey(username)) { // check that there is not someone with that username\n Organizer og = new Organizer(fullName, username, password, email);\n updateUsernameToPerson(og.getUsername(), og); // see below\n idToPerson.put(og.getID(), og);\n return true;\n }\n\n return false;\n\n }", "private void CreateUserAccount(final String lname, String lemail, String lpassword, final String lphone, final String laddress, final String groupid, final String grouppass ){\n mAuth.createUserWithEmailAndPassword(lemail,lpassword).addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if(task.isSuccessful()){\n //account creation successful\n showMessage(\"Account Created\");\n //after user account created we need to update profile other information\n updateUserInfo(lname, pickedImgUri,lphone, laddress, groupid, grouppass, mAuth.getCurrentUser());\n }\n else{\n //account creation failed\n showMessage(\"Account creation failed\" + task.getException().getMessage());\n regBtn.setVisibility(View.VISIBLE);\n loadingProgress.setVisibility(View.INVISIBLE);\n\n }\n }\n });\n }", "@Override\n\tpublic void createAccount(Account p) {\n\t\t\n\t\ttry {\n\t\t\tConnection con = conUtil.getConnection();\n\t\t\t//To use our functions/procedure we need to turn off autocommit\n\t\t\tcon.setAutoCommit(false);\n\t\t\t\n\t\t\tString deleteFromTable = \"DELETE FROM accounts WHERE owner_id='8'\";\n\t try (Connection conn = conUtil.getConnection();\n\t PreparedStatement pstmt = conn.prepareStatement(deleteFromTable)) {\n\n\t // set the corresponding param\n\t pstmt.setInt(1, p.getOwner_id());\n\t // execute the delete statement\n\t pstmt.executeUpdate();\n\n\t } catch (SQLException e) {\n\t System.out.println(e.getMessage());\n\t }\n\t\t\t\n\t\t\tString sql = \"insert into accounts( owner_id, balance ) values (?,?)\";\n\t\t\tCallableStatement cs = con.prepareCall(sql);\n\t\t\t\n\t\t\tcs.setInt(1, p.getOwner_id());\n\t\t\tcs.setDouble(2, p.getBalance());\n\t\t\t\n\t\t\tcs.execute();\n\t\t\t\n\t\t\tcon.setAutoCommit(true);\n\t\t\t\n\t\t} catch(SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t}", "public static String createCustomer(String account, String serviceAddress, String email, String phonePlaceHolder){\n return \"insert into user_information(ui_account, ui_email, ui_phone, ui_serviceaddress)\" +\n \" values('\"+account+\"'\"+\",'\"+email+\"'\"+\",'\"+phonePlaceHolder+\"'\"+\",'\"+serviceAddress+\"')\";\n }", "public @NotNull Address newAddress();", "public boolean\tnewAccount(String type, String name, float balance) throws IllegalArgumentException;", "@Override\r\n\tpublic boolean createAccount(Account account) {\n\t\treturn dao.createAccount(account);\r\n\t}", "public ClientAccount(String name, Name contact, Address address) {\n\t\tthis.name = name;\n\t\tthis.contact = contact;\n\t\tthis.address = address;\n\t}", "String addAccount(UserInfo userInfo);", "private void createPassenger() {\n account = new Account(\"driver\", \"password\", \"[email protected]\",\n \"Dan\", \"20 Howard Street\", 1234567, 64278182123L);\n }", "HttpStatus createUserAccount(final String realm, final String username, final String firstName,\n\t\t\tfinal String lastName, final String email, final String password);", "@PostMapping(\"/account/create\")\n @PreAuthorize(\"hasRole('USER') or hasRole('ADMIN')\")\n\tpublic ResponseEntity createAccount(\n\t \t @AuthenticationPrincipal UserDetailsImpl userDetail\n\t ){\n\t\t\tAccount account = new Account(userDetail.getId());\n\t\t\t// save the account to the database\n\t\t\tAccount createdAccount = accountRepository.save(account);\n\t \t // response\n\t return ResponseEntity.ok(\n\t \t\tcreatedAccount\n\t );\n\t }", "public void createAccountOnClick(View v){\n\n String email = emailTextView.getText().toString();\n String password = passwordTextView.getText().toString();\n createEmailAndPasswordAccount(email, password);\n\n }", "private void createAccount() {\n mAuth.createUserWithEmailAndPassword(mTextEmail.getText().toString(), mTextPassword.getText().toString()).addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n Log.d(TAG, \"createUserWithEmail:onComplete:\" + task.isSuccessful());\n\n if(!task.isSuccessful()){\n Toast.makeText(SignInActivity.this, \"Account creation failed!\", Toast.LENGTH_SHORT).show();\n } else {\n Toast.makeText(SignInActivity.this, \"Account creation success!\", Toast.LENGTH_SHORT).show();\n }\n }\n });\n }", "@Test\n public void createDuplicateAccount() {\n final String username1 = \"[email protected]\";\n final String username2 = \"[email protected]\";\n final String username3 = \"[email protected]\";\n final String firstname = \"william\";\n final String lastname = \"shakespeare\";\n final String address = \"@iaeste.org\";\n\n final CreateUserRequest request1 = new CreateUserRequest(username1, firstname, lastname);\n final CreateUserResponse response1 = administration.createUser(token, request1);\n assertThat(response1, is(not(nullValue())));\n assertThat(response1.isOk(), is(true));\n assertThat(response1.getUser(), is(not(nullValue())));\n assertThat(response1.getUser().getAlias(), is(firstname + '.' + lastname + address));\n\n final CreateUserRequest request2 = new CreateUserRequest(username2, firstname, lastname);\n final CreateUserResponse response2 = administration.createUser(token, request2);\n assertThat(response2, is(not(nullValue())));\n assertThat(response2.isOk(), is(true));\n assertThat(response2.getUser(), is(not(nullValue())));\n assertThat(response2.getUser().getAlias(), is(firstname + '.' + lastname + 2 + address));\n\n final CreateUserRequest request3 = new CreateUserRequest(username3, firstname, lastname);\n final CreateUserResponse response3 = administration.createUser(token, request3);\n assertThat(response3, is(not(nullValue())));\n assertThat(response3.isOk(), is(true));\n assertThat(response3.getUser(), is(not(nullValue())));\n assertThat(response3.getUser().getAlias(), is(firstname + '.' + lastname + 3 + address));\n }", "Document createAccount(String username, String accountDisplayName,\n String accountFullName, double balance, double interestRate);", "public void saveNewAddress(Address addr) throws BackendException;", "public @NotNull Address newAddress(@NotNull @Size(min = 1, max = 255) final String street,\r\n\t\t\t@NotNull @Size(min = 1, max = 255) final String city, @NotNull final State state, @NotNull Integer zipcode);", "public int createAccount(User user) throws ExistingUserException,\n UnsetPasswordException;", "@Override\n\tpublic int addAddress(Address address) {\n\t\treturn sqlSessionTemplate.insert(sqlId(\"addFullAddress\"),address);\n\t}", "@Override\r\n\tpublic UserAddress addUserAddress(UserAddress address) throws AddressNotFoundException, ValidateAddressException {\r\n\t\t\tvalidateAddress(address);\r\n\t\treturn useraddressrepository.save(address);\r\n\t\t}", "public Account createAccount() {\n\t\t\n\t\tAccountBuilder builder = new AccountBuilder();\n\t\tUserRole role = new UserRole();\n\t\trole.setUsername(getUsername());\n\t\trole.setRole(\"ROLE_USER\");\n\t\t\n\t\t//builds the account entity using the front end POJO\n\t\tbuilder\n\t\t\t.withUsername(getUsername())\n\t\t\t.withPassword(getPassword())\n\t\t\t.withLastName(getLastName())\n\t\t\t.withFirstName(getFirstName())\n\t\t\t.withRole(role)\n\t\t\t.withStatus(AccountStatus.ACTIVE)\n\t\t\t.withEmail(getEmail())\n\t\t\t.withStoreCd(getStoreCd());\n\t\t\n return builder.build();\n\t}", "public static com.ifl.rapid.customer.model.CRM_Trn_Address create(\n\t\tint AddressId) {\n\t\treturn getPersistence().create(AddressId);\n\t}", "public void createAccount(String acctId, String pass, String cardNo, String email) {\n accountId = acctId;\n password = pass;\n cardNumber = cardNo;\n customerEmail = email;\n \n try {\n //conect to database\n Class.forName(\"com.mysql.jdbc.Driver\");\n con = DriverManager.getConnection(\"jdbc:mysql://localhost:3306/make_order_request\", \"root\", \"admin\");\n Statement mystmt = con.createStatement();\n\n //write SQL query to update code in database\n String query = \"INSERT INTO customer_account(account_id, password, card_no, customer_email) VALUES (?,?,?,?)\";\n PreparedStatement ps = con.prepareStatement(query);\n ps.setString(1, accountId);\n ps.setString(2, password);\n ps.setInt(3, Integer.parseInt(cardNumber));\n ps.setString(4, customerEmail);\n\n ps.executeUpdate();\n\n return;\n\n } catch (Exception e) {\n e.printStackTrace();\n \n }\n\n }", "String insertClientAccount(ClientAccount account) throws ServiceException;", "public static JSONObject createAccount(Context context, String firstName, String lastName, String email, String password) {\n\t\ttry {\n\t\t\tfirstName = URLEncoder.encode(firstName, \"UTF-8\");\n\t\t\tlastName = URLEncoder.encode(lastName, \"UTF-8\");\n\t\t\temail = URLEncoder.encode(email, \"UTF-8\");\n\t\t\tpassword = URLEncoder.encode(password, \"UTF-8\");\n\t\t\tString response = makeAPICall(context, \"createuser.php?first_name=\" + firstName + \"&last_name=\" + lastName + \"&email=\" + email + \"&password=\" + password);\n\t\t\treturn new JSONObject(response);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}\n\t}", "@Override\r\n\tpublic boolean createAccount(Account account) throws Exception {\n\t\tboolean flag = false;\r\n\t\ttry {\r\n\t\t\tflag = this.dao.createAccount(account);\r\n\t\t}catch(Exception e) {\r\n\t\t\tthrow e;\r\n\t\t}finally {\r\n\t\t\tthis.dbc.close();\r\n\t\t}\r\n\t\treturn flag;\r\n\t}", "@Override\n public void onClick(View v) {\n Phone = RegisterPhone.getText().toString();\n Password = RegisterPassword.getText().toString();\n Name = RegisterName.getText().toString();\n\n\n CreateNewAccount(Phone,Password,Name);\n }", "private void createAccountConfig (String address) {\n\t\tProperties accountConfig = new Properties();\n\t\t\n\t\t/*\n\t\t * Load any previous version of the property file at the address.\n\t\t */\n\t\tFile accountConfigFile = new File(address);\n\t\ttry {\n\t\t\t/*\n\t\t\t * Creates file/directory if it could not be found\n\t\t\t */\n\t\t\tif(accountConfigFile.getParentFile().mkdirs()) System.err.println(\"[WARNING] Account properties directory location was missing and has been created.\");\n\t\t\tif(accountConfigFile.createNewFile()) System.err.println(\"[WARNING] Account properties file was missing and has been created.\");\n\t\t\t\n\t\t\taccountConfig.load(new FileReader(accountConfigFile));\n\t\t} catch (IOException e) {\n\t\t\tSystem.err.println(\"[ERROR]: Could not initialize account properties file: \" + address);\n\t\t\tSystem.err.println(e.getMessage());\n\t\t}\n\t\t\n\t\t/*\n\t\t * Check to see if any properties are missing.\n\t\t */\n\t\tif(!accountConfig.containsKey(\"username\")) accountConfig.put(\"username\", \"\");\n\t\tif(!accountConfig.containsKey(\"password\")) accountConfig.put(\"password\", \"\");\n\t\tif(!accountConfig.containsKey(\"rememberLogin\")) accountConfig.put(\"rememberLogin\", \"false\");\n\t\t\n\t\tthis.accountConfig = accountConfig;\n\t\t\n\t\t/*\n\t\t * Save any changes\n\t\t */\n\t\tthis.saveAccountConfig();\n\t}", "private void createAccount(String email, String password) {\n if (!validateForm()) {\n return;\n }\n\n mAuth.createUserWithEmailAndPassword(email, password)\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (!task.isSuccessful()) {\n Toast.makeText(MainActivity.this, \"Unable to creat Account\", Toast.LENGTH_SHORT).show();\n }\n }\n });\n }", "public void addAccount(Account account,Person person);", "@Override\r\n\tpublic boolean create(Account newAccount) {\n\t\treturn daoref.create(newAccount);\r\n\t}", "public void addAccount(String user, String password);", "public void setAccountAddress(String name, String street,\n String city, String state, String zip, String country) {\n setA_Name(name);\n setA_Street(street);\n setA_City(city);\n setA_State(state);\n setA_Zip(zip);\n setA_Country(country);\n }", "private void createAccount(User user) throws IOException {\n File accounts = new File(\"accounts.txt\");\n if (!accounts.exists()) {\n accounts.createNewFile();\n }\n\n FileOutputStream fileOutputStream = new FileOutputStream(accounts, true);\n BufferedWriter bufferedWriter = new BufferedWriter(new OutputStreamWriter(fileOutputStream));\n\n bufferedWriter.write(user.getUserName() + \":\" + user.getUserPass());\n bufferedWriter.newLine();\n bufferedWriter.flush();\n }", "private Account createAccount8() {\n Account account = new Account(\"123456008\", \"Jean Sans Enfant\",\n new SimpleDate(4, 23, 1976).asDate(), \"[email protected]\", true, false, new CreditCard(\"4320123412340008\"));\n\n return account;\n }", "public com.vh.locker.ejb.Contact create(java.lang.Long id, java.lang.String name, java.lang.String nickName, java.lang.String phone, java.lang.String email, com.vh.locker.ejb.User anUser) throws javax.ejb.CreateException;", "public static void fillUpAddAddress() throws Exception {\n\t\tString fName = Generic.ReadRandomCellData(\"Names\");\n\t\tString lName = Generic.ReadRandomCellData(\"Names\");\n\n\t\tString email = Generic.ReadFromExcel(\"Email\", \"LoginDetails\", 1);\n\t\tString mobileNum = Generic.ReadFromExcel(\"GCashNum\", \"LoginDetails\", 1);\n\t\ttry {\n\n\t\t\tsendKeys(\"CreateAccount\", \"FirstName\", fName);\n\n\t\t\tclickByLocation(\"42,783,1038,954\");\n\t\t\tenterTextByKeyCodeEvent(lName);\n\n//\t\t\tsendKeys(\"CreateAccount\", \"UnitNo\", Generic.ReadFromExcel(\"UnitNo\", \"LoginDetails\", 1));\n//\t\t\tsendKeys(\"CreateAccount\", \"StreetNo\", Generic.ReadFromExcel(\"StreetName\", \"LoginDetails\", 1));\n\t\t\tAddAddress(1);\n\t\t\tThread.sleep(2000);\n\t\t\tsendKeys(\"CreateAccount\", \"Email\", email);\n\t\t\tThread.sleep(2000);\n\t\t\tsendKeys(\"CreateAccount\", \"MobileNumber\", mobileNum);\n\t\t\tControl.takeScreenshot();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "public Buyer(String username, String password, String firstName, String lastName, String emailAddress, String phoneNumber) {\n super(username, password, firstName, lastName, emailAddress, phoneNumber);\n this.role = 1;\n credit = 10000;\n ProgramManager.getProgramManagerInstance().addAccountToList(username, this);\n }", "@Override\n\tpublic User createNewUser(Account account) {\n\t\treturn new User(account);\n\t\t\n\t}", "public String createAccount(Account account){\n try {\n List<Account> accounts = new ArrayList<>();\n\n if(!accountsFile.createNewFile()){\n accounts = mapper.readValue(accountsFile, new TypeReference<ArrayList<Account>>(){});\n }\n List<Account> customerAccounts = getAccountsForUSer(accounts, account.getCustomerName());\n if(!customerAccounts.stream().anyMatch(a -> a.getAccountName().equals(account.getAccountName()))){\n accounts.add(account);\n mapper.writerWithDefaultPrettyPrinter().writeValue(accountsFile, accounts);\n } else {\n return messageService.accountAlreadyExist(account.getCustomerName(), account.getAccountName());\n }\n } catch (Exception e) {\n return messageService.unexpectedError(e);\n }\n return messageService.accountCreated(account.getAccountName(), account.getCustomerName());\n }", "public IndividualAddress(final int address)\n\t{\n\t\tsuper(address);\n\t}", "BankAccount(String accountType){\n\t\tSystem.out.println(\"NEW ACCOUNT: \" + accountType);\n\t\tthis.accountType = accountType; \n\t}", "AccountModel add(AccountModel account) throws AccountException;", "Builder setAddress(String address);", "@Override\n\tpublic Account createAccount(Account account) {\n\t\tif(account != null) {\n\t\t\taccountList.add(account);\n\t\t\treturn account;\n\t\t}\n\t\t\n\t\treturn null;\n\t}", "public void createAccount(View view) {\n Intent intent = new Intent(this, UserAccountCreateActivity.class);\n startActivity(intent);\n }" ]
[ "0.78974134", "0.73751354", "0.7371898", "0.71816313", "0.7081386", "0.7010762", "0.69127434", "0.6862811", "0.6835322", "0.6807134", "0.6745996", "0.6663216", "0.6660596", "0.6655196", "0.66416746", "0.6634303", "0.6544995", "0.6543129", "0.6510869", "0.64883673", "0.6479983", "0.6420492", "0.6402597", "0.639974", "0.6393993", "0.6378142", "0.634583", "0.6337287", "0.63305545", "0.62960714", "0.62899745", "0.6269218", "0.62618214", "0.6249104", "0.62326777", "0.62307286", "0.6229338", "0.6228454", "0.62241143", "0.6220885", "0.6208416", "0.6204542", "0.61985546", "0.6192905", "0.6177", "0.61733717", "0.61676913", "0.6166806", "0.6163932", "0.61462927", "0.614473", "0.614328", "0.6142928", "0.6140714", "0.61389947", "0.6134026", "0.613337", "0.6129562", "0.6122963", "0.6118455", "0.61171615", "0.61068046", "0.60755837", "0.6064956", "0.60568374", "0.60540867", "0.60416967", "0.6028846", "0.60182", "0.600868", "0.59897447", "0.59779876", "0.59690595", "0.59590256", "0.5957157", "0.5951354", "0.59304595", "0.59290606", "0.5906495", "0.5905081", "0.5893949", "0.5882768", "0.58692783", "0.5864064", "0.5851853", "0.5851753", "0.5847729", "0.5825667", "0.5819834", "0.5810785", "0.58068216", "0.5798599", "0.5795441", "0.5783803", "0.5779463", "0.57793844", "0.5778249", "0.5773877", "0.5766892", "0.57629174" ]
0.74276936
1
new EazyCoopUtility().generateLoanScheduleFlat("1", "1", 1000.0, 0.1, 4, null, 1, new java.util.Date());
public static void main_(String args[]) { System.out.println(""); System.out.println(""); //new EazyCoopUtility().generateLoanScheduleReducing("1", "1", 1000.0, 0.1, 4, null, 1, new java.util.Date()); System.out.println(""); System.out.println(""); //new EazyCoopUtility().generateLoanScheduleReducingEqualInstallments("1", "1", 1000.0, 0.1, 4, null, 1, new java.util.Date()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void generateSchedule(){\n\t\t\n\t}", "public boolean generateSchedule(){\r\n return true;\r\n }", "@Override\n\tpublic List<LoanRepaymentSchedule> generateRepaymentScheduleByMultipleDisbursement(LoanLineOfCredit loanLoc, Money sanctionAmount, List<LoanRepaymentSchedule> myltipleRepaymentScheduleList, Date businessDate, Date firstInstallmentDate , String loanType , Long borrowingLoc ) {\n\t\tlogger.info(\"Start : Generating default repayment schedule to loan repayment schedule table in generateRepaymentSchedule() method.\");\n\t\tPacsLoanApplication loanApplication = loanLoc.getPacsLoanApplication();\n\t\tMoney prevOutstandingAmount = Money.ZERO;\n\t\tString reducingFrequency = null;\n\t\tdouble reducingFreq = 0;\n\t\tint reducingFreqInt = 0;\n\t\tList<LoanRepaymentSchedule> repaymentScheduleList = new ArrayList<LoanRepaymentSchedule>();\n\t\tif (loanApplication != null && loanLoc != null) {\n\t\t\tDate sanctionDate = null;\n\t\t\t//Date firstDueDate = null;\n\t\t\tInteger numOfInstallments = null;\n\t\t\tif(myltipleRepaymentScheduleList.size() > 0) {\n\t\t\t\tsanctionDate = businessDate;\n\t\t\t\tlogger.info(\" sanctionDate : \" + sanctionDate);\n\t\t\t\t//firstDueDate = myltipleRepaymentScheduleList.get(0).getInstallmentDate();\n\t\t\t\t//logger.info(\" firstDueDate : \" + firstDueDate);\n\t\t\t\tnumOfInstallments = myltipleRepaymentScheduleList.size();\n\t\t\t\tlogger.info(\" numOfInstallments : \" + numOfInstallments);\n\t\t\t\tlogger.info(\" sanctionAmount : \" + sanctionAmount);\n\t\t\t\tInteger loanPeriod = loanApplication.getLoanPeriod();\n\t\t\t\tlogger.info(\" loanPeriod : \" + loanPeriod);\n\t\t\t\tInteger frequencyValue = loanApplication.getInstallmentFrequency().getValue();\n\t\t\t\tlogger.info(\" frequencyValue : \" + frequencyValue);\n\t\t\t\tProduct product = loanApplication.getProduct();\n\t\t\t\tInterestCategory interestCategory = loanApplication.getInterestCategory();\n\t\t\t\tif (product != null && interestCategory != null) {\n\t\t\t\t\tRepaymentSchedule repaymentSchedule = product.getRepaymentSchedule();\n\t\t\t\t\tlogger.info(\" repaymentSchedule : \" + repaymentSchedule.getValue());\n\t\t\t\t\tRepaymentType repaymentType = product.getRepaymentType();\n\t\t\t\t\tlogger.info(\" repaymentType : \" + repaymentType.getValue());\n\t\t\t\t\tMoney principalAmountSum = Money.ZERO;\n\t\t\t\t\tMoney principalAmount = calculatePrincipalAmount(sanctionAmount, numOfInstallments);\n\t\t\t\t\tMoney tempPrincipalAmount = Money.ZERO;\n\t\t\t\t\tlogger.info(\" principalAmount : \" + principalAmount);\n\t\t\t\t\tMoney interestAmount = Money.ZERO;\n\t\t\t\t\tMoney tempInterestAmount = Money.ZERO;\n\t\t\t\t\t\n\t\t\t\t\tInteger interestCategoryId = interestCategory.getId();\n\t\t\t\t\tif(\"B\".equalsIgnoreCase(loanType)){\n\t\t\t\t\tinterestCategoryId=\tKLSServiceFactory.getBorrowingProductService().getProductById(loanLoc.getProduct().getBorrowingProductId()).getInterestCategoryId();\n\t\t\t\t\t}else{\n\t\t\t\t\tinterestCategoryId =\tinterestCategory.getId();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tList<SlabwiseInterestRate> interestSlabs = getInterestSlabs(interestCategoryId, sanctionDate);\n\t\t\t\t\tBigDecimal interestRate = (getInterestRate(interestSlabs, sanctionAmount)).divide(BigDecimal.valueOf(100));\n\t\t\t\t\tlogger.info(\" interestRate per annum : \" + interestRate);\n\t\t\t\t\tdouble interestRatePerMonth = 0d;\n\t\t\t\t\tif(frequencyValue != null) {\n\t\t\t\t\t\tif(frequencyValue == 1) {\n\t\t\t\t\t\t\tinterestRatePerMonth = interestRate.doubleValue() / 12;\n\t\t\t\t\t\t} else if(frequencyValue == 3) {\n\t\t\t\t\t\t\tinterestRatePerMonth = interestRate.doubleValue() / 4;\n\t\t\t\t\t\t} else if(frequencyValue == 6) {\n\t\t\t\t\t\t\tinterestRatePerMonth = interestRate.doubleValue() / 2;\n\t\t\t\t\t\t} else if(frequencyValue == 12) {\n\t\t\t\t\t\t\tinterestRatePerMonth = interestRate.doubleValue() / 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tlogger.info(\" interestRate per month : \" + interestRatePerMonth);\n\t\t\t\t\tMoney outstandingAmount = sanctionAmount;\n\t\t\t\t\tMoney tempOutstandingAmount = Money.ZERO;\n\t\t\t\t\t//Date installmentDate = firstDueDate;\n\t\t\t\t\tMoney installmentAmount = principalAmount.add(interestAmount);\n\t\t\t\t\tMoney tempInstallmentAmount = Money.ZERO;\n\t\t\t\t\tboolean isEquated = RepaymentSchedule.PRINCIPAL_AND_INTEREST.equals(repaymentSchedule)\n\t\t\t\t\t\t\t&& RepaymentType.EQUATED_INSTALLMENTS.equals(repaymentType);\n\t\t\t\t\tlogger.info(\" isEquated : \" + isEquated);\n\t\t\t\t\tboolean isNonEquated = RepaymentSchedule.PRINCIPAL_AND_INTEREST.equals(repaymentSchedule)\n\t\t\t\t\t\t\t&& RepaymentType.NON_EQUATED_INSTALLMENTS.equals(repaymentType);\n\t\t\t\t\tlogger.info(\" isNonEquated : \" + isNonEquated);\n\t\t\t\t\tif (isEquated) {\n\t\t\t\t\t\tinstallmentAmount = calculateInstallmentAmount(outstandingAmount, numOfInstallments, interestRatePerMonth);\n\t\t\t\t\t} else if (isNonEquated) {\n\t\t\t\t\t\treducingFrequency = PropertiesUtil.getRepaymentProperty(ServiceConstants.REDUCING_FREQUENCY);\n\t\t\t\t\t\treducingFreq = new Double(reducingFrequency).doubleValue();\n\t\t\t\t\t\treducingFreqInt = new Double(reducingFrequency).intValue();\n\t\t\t\t\t\tlogger.info(\" reducingFreq : \" + reducingFreq);\n\t\t\t\t\t\tlogger.info(\" interestRate : \" + interestRate);\n\t\t\t\t\t}\n\t\t\t\t\tlogger.info(\" installmentAmount : \" + installmentAmount);\n\t\t\t\t\tlogger.info(\" interestAmount : \" + interestAmount);\n\t\t\t\t\tCalendar calendar = Calendar.getInstance();\n\t\t\t\t\tfor (int i = 0; i < numOfInstallments; i++) {\n\t\t\t\t\t\tLoanRepaymentSchedule loanRepaymentSchedule = myltipleRepaymentScheduleList.get(i);\n\t\t\t\t\t\tif (isEquated) {\n\t\t\t\t\t\t\tinterestAmount = calculateInterestAmount(outstandingAmount, interestRatePerMonth);\n\t\t\t\t\t\t\tprincipalAmount = installmentAmount.subtract(interestAmount);\n\t\t\t\t\t\t\tlogger.info(\" principalAmount : \" + principalAmount);\n\t\t\t\t\t\t\tprevOutstandingAmount = outstandingAmount;\n\t\t\t\t\t\t\tlogger.info(\" prevOutstandingAmount : \" + prevOutstandingAmount);\n\t\t\t\t\t\t} else if (isNonEquated) {\n\t\t\t\t\t\t\tint j = i+1;\n\t\t\t\t\t\t\tif ((reducingFreqInt != 0 && (j % reducingFreqInt) == 1) || reducingFreqInt == 1) {\n\t\t\t\t\t\t\t\tlogger.info(\" interestRate per annum reducing frequency : \" + interestRate);\n\t\t\t\t\t\t\t\tinterestAmount = calculateInterestAmount(outstandingAmount, interestRate.doubleValue(), reducingFreq);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tinstallmentAmount = principalAmount.add(interestAmount);\n\t\t\t\t\t\t\tlogger.info(\" installmentAmount reducing frequency : \" + installmentAmount);\n\t\t\t\t\t\t\tprevOutstandingAmount = outstandingAmount;\n\t\t\t\t\t\t\tlogger.info(\" prevOutstandingAmount : \" + prevOutstandingAmount);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlogger.info(\" interestAmount : \" + interestAmount);\n\t\t\t\t\t\ttempInterestAmount = loanRepaymentSchedule.getInterestAmount().add(interestAmount);\n\t\t\t\t\t\tloanRepaymentSchedule.setInterestAmount(tempInterestAmount);\n\t\t\t\t\t\ttempInterestAmount = Money.ZERO;\n\t\t\t\t\t\ttempInstallmentAmount = loanRepaymentSchedule.getInstallmentAmount().add(installmentAmount);\n\t\t\t\t\t\tloanRepaymentSchedule.setInstallmentAmount(tempInstallmentAmount);\n\t\t\t\t\t\ttempInstallmentAmount = Money.ZERO;\n//\t\t\t\t\t\tloanRepaymentSchedule.setInstallmentDate(installmentDate);\n\t\t\t\t\t\t//installmentDate = Date.valueOf(getInstallmentDate(calendar, installmentDate, frequencyValue));\n\t\t\t\t\t\t//logger.info(\" installmentDate : \" + installmentDate);\n\t\t\t\t\t\toutstandingAmount = outstandingAmount.subtract(principalAmount);\n\t\t\t\t\t\tlogger.info(\" outstandingAmount : \" + outstandingAmount);\n\t\t\t\t\t\ttempOutstandingAmount = loanRepaymentSchedule.getLoanOutstandingAmount().add(outstandingAmount);\n\t\t\t\t\t\tloanRepaymentSchedule.setLoanOutstandingAmount(tempOutstandingAmount);\n\t\t\t\t\t\ttempPrincipalAmount =loanRepaymentSchedule.getPrincipalAmount().add(principalAmount);\n\t\t\t\t\t\tloanRepaymentSchedule.setPrincipalAmount(tempPrincipalAmount);\n\t\t\t\t\t\ttempPrincipalAmount = Money.ZERO;\n\t\t\t\t\t\tif(loanRepaymentSchedule.getLoanRepaymentScheduleId() == null) {\n\t\t\t\t\t\t\tLoanRepaymentScheduleId id = new LoanRepaymentScheduleId();\n\t\t\t\t\t\t\tif(\"B\".equalsIgnoreCase(loanType)){\n\t\t\t\t\t\t\tid.setLineOfCreditId(borrowingLoc);\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tid.setLineOfCreditId(loanLoc.getId());\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tid.setInstallmentNumber(i);\n\t\t\t\t\t\t\tloanRepaymentSchedule.setLoanRepaymentScheduleId(id);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (RepaymentSchedule.PRINCIPAL.equals(repaymentSchedule)) {\n\t\t\t\t\t\t\tprincipalAmountSum = principalAmountSum.add(principalAmount);\n\t\t\t\t\t\t\tlogger.info(\" principalAmountSum : \" + principalAmountSum);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (i == numOfInstallments) {\n\t\t\t\t\t\t\tif (RepaymentSchedule.PRINCIPAL.equals(repaymentSchedule)) {\n\t\t\t\t\t\t\t\tMoney adjustment = sanctionAmount.subtract(principalAmountSum);\n\t\t\t\t\t\t\t\tlogger.info(\" adjustment : \" + adjustment.getAmount());\n\t\t\t\t\t\t\t\tif (!adjustment.isZero()) {\n\t\t\t\t\t\t\t\t\tloanRepaymentSchedule.setLoanOutstandingAmount(Money.ZERO);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tprincipalAmount = principalAmount.add(adjustment);\n\t\t\t\t\t\t\t\tlogger.info(\" principalAmount after adjustment : \" + principalAmount);\n\t\t\t\t\t\t\t\tinstallmentAmount = principalAmount.add(interestAmount);\n\t\t\t\t\t\t\t\tlogger.info(\" installmentAmount after adjustment : \" + installmentAmount);\n\t\t\t\t\t\t\t\ttempInstallmentAmount = loanRepaymentSchedule.getInstallmentAmount().add(installmentAmount);\n\t\t\t\t\t\t\t\tloanRepaymentSchedule.setInstallmentAmount(tempInstallmentAmount);\n\t\t\t\t\t\t\t} else if (isEquated) {\n\t\t\t\t\t\t\t\tprincipalAmount = prevOutstandingAmount;\n\t\t\t\t\t\t\t\tlogger.info(\" principalAmount for the last schedule : \" + principalAmount);\n\t\t\t\t\t\t\t\tinstallmentAmount = principalAmount.add(interestAmount);\n\t\t\t\t\t\t\t\tlogger.info(\" installmentAmount for the last schedule : \" + installmentAmount);\n\t\t\t\t\t\t\t\ttempInstallmentAmount = loanRepaymentSchedule.getInstallmentAmount().add(installmentAmount);\n\t\t\t\t\t\t\t\tloanRepaymentSchedule.setInstallmentAmount(tempInstallmentAmount);\n\t\t\t\t\t\t\t\tloanRepaymentSchedule.setLoanOutstandingAmount(Money.ZERO);\n\t\t\t\t\t\t\t} else if (isNonEquated) {\n\t\t\t\t\t\t\t\tprincipalAmount = prevOutstandingAmount;\n\t\t\t\t\t\t\t\tlogger.info(\" principalAmount for the last schedule : \" + principalAmount);\n\t\t\t\t\t\t\t\tinstallmentAmount = principalAmount.add(interestAmount);\n\t\t\t\t\t\t\t\tlogger.info(\" installmentAmount for the last schedule : \" + installmentAmount);\n\t\t\t\t\t\t\t\ttempInstallmentAmount = loanRepaymentSchedule.getInstallmentAmount().add(installmentAmount);\n\t\t\t\t\t\t\t\tloanRepaymentSchedule.setInstallmentAmount(tempInstallmentAmount);\n\t\t\t\t\t\t\t\tloanRepaymentSchedule.setLoanOutstandingAmount(Money.ZERO);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttempPrincipalAmount = loanRepaymentSchedule.getPrincipalAmount().add(principalAmount);\n\t\t\t\t\t\t\tloanRepaymentSchedule.setPrincipalAmount(tempPrincipalAmount);\n\t\t\t\t\t\t}\n\t\t\t\t\t\trepaymentScheduleList.add(loanRepaymentSchedule);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\trepaymentScheduleList = generateRepaymentSchedule(loanLoc, sanctionAmount, businessDate, firstInstallmentDate , loanType , borrowingLoc);\n\t\t\t}\n\t\t}\n\t\tlogger.info(\"End : Generating default repayment schedule to loan repayment schedule table in generateRepaymentSchedule() method.\");\n\t\treturn repaymentScheduleList;\n\t}", "Schedule createSchedule();", "ConferenceScheduleBuilderService startLunch();", "public void generatePlan(Integer id,Date fromDate, Date toDate) throws Exception;", "TimerSchedule createTimerSchedule();", "public void createTempSpecialDayTrainSchedule(Timestamp date);", "public Loan(){\n\t\tthis(\"\", 0, 0, 0, 0);\n\t\tstart_date = null;\n\t}", "public static void main(String[] args) {\n Task a = new Task(\"s\", new Date(0), new Date(1000*3600*24*7), 3600);\n a.setActive(true);\n System.out.println(a.getStartTime());\n System.out.println(a.getEndTime());\n System.out.println(a.nextTimeAfter(new Date(0)));\n\n\n\n }", "public abstract void schedule();", "public static Schedule initializeSchedule(String[] args) {\n\n if (args.length == 5) { // Level 3\n RandomGenerator r = new RandomGenerator(Integer.parseInt(args[0]), \n Double.parseDouble(args[3]), Double.parseDouble(args[4]), 0);\n return new Schedule(r, args[1], args[2], \"1\", \"0\", \"0\", \"0\");\n } else if (args.length == 6) { // Level 4\n RandomGenerator r = new RandomGenerator(Integer.parseInt(args[0]), \n Double.parseDouble(args[4]), Double.parseDouble(args[5]), 0);\n return new Schedule(r, args[1], args[3], args[2], \"0\", \"0\", \"0\");\n } else if (args.length == 8) { // Level 5\n RandomGenerator r = new RandomGenerator(Integer.parseInt(args[0]), \n Double.parseDouble(args[4]), Double.parseDouble(args[5]), \n Double.parseDouble(args[6]));\n return new Schedule(r, args[1], args[3], args[2], args[7], \"0\", \"0\");\n } else if (args.length == 9) { // Level 6\n RandomGenerator r = new RandomGenerator(Integer.parseInt(args[0]), \n Double.parseDouble(args[5]), Double.parseDouble(args[6]), \n Double.parseDouble(args[7]));\n return new Schedule(r, args[1], args[4], args[3], args[8], args[2], \"0\");\n } else if (args.length == 10) { // Level 7\n RandomGenerator r = new RandomGenerator(Integer.parseInt(args[0]), \n Double.parseDouble(args[5]), Double.parseDouble(args[6]), \n Double.parseDouble(args[7]));\n return new Schedule(r, args[1], args[4], args[3], args[8], args[2], args[9]);\n } else {\n throw new IllegalArgumentException(\"Invalid Input\");\n }\n }", "public Schedule() {\n\t\t// TODO Auto-generated constructor stub\n\t}", "private void seedScheduleCanaryCheck(CanaryEndpoint canaryEndpoint) {\n\n scheduledExecutorService.schedule(\n queryCanaryEndpoint(canaryEndpoint),\n nextInt(1, 10),\n TimeUnit.SECONDS);\n }", "@Override\r\n\tpublic void doInitialSchedules() {\n\t}", "abstract public void computeSchedule();", "public static void printDonationCalendar() {\n\t\t\tString [] args = null;\n\t\t\tScheduler.main(args);\n\t\t}", "private static String buildSequence() {\n\t\tSimpleDateFormat dateFormatGMT = new SimpleDateFormat(\"yyyyMMddHHmmssSSS\");\n\t\tdateFormatGMT.setTimeZone(TimeZone.getTimeZone(\"GMT\")); // set to Greenwich mean time.\n\t\treturn dateFormatGMT.format(new Date());\n\t}", "private void beginSchedule(){\n\t\tDivaApp.getInstance().submitScheduledTask(new RandomUpdater(this), RandomUpdater.DELAY, RandomUpdater.PERIOD);\n\t}", "private MySchedule getRandomInitialSchedule() {\r\n\t\tArrayList<MyCourse> courses = new ArrayList<MyCourse>();\r\n\t\tfor (MyClass aClass : this.allClasses)\r\n\t\t\tcourses.add(new MyCourse(aClass,\r\n\t\t\t\tthis.getRandomRoom(),\r\n\t\t\t\tthis.getRandomInstructor(),\r\n\t\t\t\tthis.getRandomTimeSlot()));\r\n\t\tMySchedule result = new MySchedule(courses);\r\n\t\treturn result.getEnergy() > 0 ? result : this.getRandomInitialSchedule();\r\n\t}", "public static void main(String[] args) {\n\t\tint[] a = {3,5,-1,2,-1,-11,1,-2,4};\n//\t\tint[] a = {1,0,-1};\n//\t\trearrange(a);\n//\t\tfor(int i = 0; i < a.length; i++)\n//\t\t\tSystem.out.print(a[i] + \" \");\n//\t\tSystem.out.println();\n\t\t\n\t\tString d = \"01/01/2015\";\n\t\tString[] date = d.split(\"/\");\n//\t\tSystem.out.println(date);\n//\t\tCalendar c = Calendar.getInstance();\n//\t\tint startYear = Integer.parseInt(date[2]);\n//\t\tint startMonth = Integer.parseInt(date[1]);\n//\t\tint startDate = Integer.parseInt(date[0]);\n//\t\tc.set(startYear, startMonth, startDate);\n//\t\tString[] days = {\"Monday\",\"Thursday\"};\n//\t\tString[] res = recurringTask(d, 2, days, 4);\n//\t\tfor(int i = 0; i < res.length; i++)\n//\t\t\tSystem.out.println(res[i]);\n//\t\t System.out.println(c.get(Calendar.DAY_OF_MONTH));\n//\t\t System.out.println(c.get(Calendar.DAY_OF_WEEK));\n//\t\t System.out.println(c.get(Calendar.DATE));\n\t\t \n\t\tSystem.out.println(Math.floor(2.4)); \n\t\tdouble[] departures = {2.4,1};\n\t\tdouble[] dest = {5,7.3};\n\t\t \n\t \n\t\t\t\t\n\t\t\t\t\n\t\n\t\t\n\t\t \n\t\t \n\t\t \n\t\t\t\n\t\t\n\t}", "private void scheduleJob() {\n\n }", "ConferenceScheduleBuilderService createEventsFromStartToLunch();", "public abstract void maintenanceSchedule() ;", "public static void main(String[] args)\n {\n int[] costList = {50,60,160,60,80,100,100,120,150,150,150,200,40,240,220,220,200,200,180,180,140,100,80,60};\n \n BatteryCharger charger = new BatteryCharger(costList);\n \n System.out.println(charger.getChargeStartTime(1));\n System.out.println(charger.getChargeStartTime(2));\n System.out.println(charger.getChargeStartTime(3));\n System.out.println(charger.getChargeStartTime(4));\n System.out.println(charger.getChargeStartTime(5));\n System.out.println(charger.getChargeStartTime(6));\n System.out.println(charger.getChargeStartTime(7));\n System.out.println(charger.getChargeStartTime(8));\n System.out.println(charger.getChargeStartTime(9));\n System.out.println(charger.getChargeStartTime(10));\n }", "@Scheduled(cron = \"0 0 10 17 8 ?\")\n\tpublic void scheduleTaskYearly() {\n\t\tlog.info(\"Cron Task :: Execution Time Every 10:00 o'clock in 17 August - {}\", dateTimeFormatter.format(LocalDateTime.now()));\n\t}", "private void schedule(PlanRecord plan, Context context) {\n Date d = null;\n\n try {\n DateTime test = new DateTime();\n test.setStringSQL(plan.offset);\n d = test.getYearMonthDay();\n } catch (java.text.ParseException e) {\n Log.e(\"PlanReceiver-schedule\", \"Couldn't schedule \" + plan.name + \"\\n e:\" + e);\n e.printStackTrace();\n }\n\n Log.e(\"PlanReceiver-schedule\", \"d.year=\" + (d.getYear() + 1900) + \" d.date=\" + d.getDate() + \" d.month=\" + d.getMonth());\n\n Calendar firstRun = new GregorianCalendar(d.getYear() + 1900, d.getMonth(), d.getDate());\n Log.e(\"PlanReceiver-schedule\", \"FirstRun:\" + firstRun);\n\n Intent intent = new Intent(context, PlanReceiver.class);\n intent.putExtra(\"plan_id\", plan.id);\n intent.putExtra(\"plan_acct_id\", plan.acctId);\n intent.putExtra(\"plan_name\", plan.name);\n intent.putExtra(\"plan_value\", plan.value);\n intent.putExtra(\"plan_type\", plan.type);\n intent.putExtra(\"plan_category\", plan.category);\n intent.putExtra(\"plan_memo\", plan.memo);\n intent.putExtra(\"plan_offset\", plan.offset);\n intent.putExtra(\"plan_rate\", plan.rate);\n intent.putExtra(\"plan_next\", plan.next);\n intent.putExtra(\"plan_scheduled\", plan.scheduled);\n intent.putExtra(\"plan_cleared\", plan.cleared);\n\n //Parse Rate (token 0 is amount, token 1 is type)\n final String phrase = plan.rate;\n final String[] tokens = phrase.split(\"[ ]+\");\n\n final PendingIntent sender = PendingIntent.getBroadcast(context, Integer.parseInt(plan.id), intent, PendingIntent.FLAG_UPDATE_CURRENT);\n\n //Get the AlarmManager service\n final AlarmManager am = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);\n\n final Locale locale = context.getResources().getConfiguration().locale;\n final DateTime nextRun = new DateTime();\n\n if (tokens[1].contains(\"Days\")) {\n Log.d(\"PlanReceiver-schedule\", \"Days\");\n\n //If Starting Time is in the past, fire off next day(s)\n while (firstRun.before(Calendar.getInstance())) {\n firstRun.add(Calendar.DAY_OF_MONTH, Integer.parseInt(tokens[0]));\n }\n\n Log.d(\"PlanReceiver-schedule\", \"firstRun is \" + firstRun);\n\n nextRun.setCalendar(firstRun);\n\n ContentValues planValues = new ContentValues();\n planValues.put(DatabaseHelper.PLAN_NEXT, nextRun.getSQLDate(locale));\n context.getContentResolver().update(Uri.parse(MyContentProvider.PLANS_URI + \"/\" + plan.id), planValues, DatabaseHelper.PLAN_ID + \"=\" + plan.id, null);\n\n am.setRepeating(AlarmManager.RTC_WAKEUP, firstRun.getTimeInMillis(), (Integer.parseInt(tokens[0]) * AlarmManager.INTERVAL_DAY), sender);\n } else if (tokens[1].contains(\"Weeks\")) {\n Log.d(\"PlanReceiver-schedule\", \"Weeks\");\n\n //If Starting Time is in the past, fire off next week(s)\n while (firstRun.before(Calendar.getInstance())) {\n firstRun.add(Calendar.WEEK_OF_MONTH, Integer.parseInt(tokens[0]));\n }\n\n Log.d(\"PlanReceiver-schedule\", \"firstRun is \" + firstRun);\n\n nextRun.setCalendar(firstRun);\n\n ContentValues planValues = new ContentValues();\n planValues.put(DatabaseHelper.PLAN_NEXT, nextRun.getSQLDate(locale));\n context.getContentResolver().update(Uri.parse(MyContentProvider.PLANS_URI + \"/\" + plan.id), planValues, DatabaseHelper.PLAN_ID + \"=\" + plan.id, null);\n\n am.setRepeating(AlarmManager.RTC_WAKEUP, firstRun.getTimeInMillis(), (Integer.parseInt(tokens[0]) * AlarmManager.INTERVAL_DAY) * 7, sender);\n } else if (tokens[1].contains(\"Months\")) {\n Log.d(\"PlanReceiver-schedule\", \"Months\");\n Calendar cal = Calendar.getInstance();\n cal.setTimeInMillis(cal.getTimeInMillis());\n cal.add(Calendar.MONTH, Integer.parseInt(tokens[0]));\n\n //If Starting Time is in the past, fire off next month(s)\n while (firstRun.before(Calendar.getInstance())) {\n firstRun.add(Calendar.MONTH, Integer.parseInt(tokens[0]));\n }\n\n Log.d(\"PlanReceiver-schedule\", \"firstRun is \" + firstRun);\n\n nextRun.setCalendar(firstRun);\n\n ContentValues planValues = new ContentValues();\n planValues.put(DatabaseHelper.PLAN_NEXT, nextRun.getSQLDate(locale));\n context.getContentResolver().update(Uri.parse(MyContentProvider.PLANS_URI + \"/\" + plan.id), planValues, DatabaseHelper.PLAN_ID + \"=\" + plan.id, null);\n\n am.setRepeating(AlarmManager.RTC_WAKEUP, firstRun.getTimeInMillis(), cal.getTimeInMillis(), sender);\n } else {\n Log.e(\"PlanReceiver-schedule\", \"Could not set alarm; Something wrong with the rate\");\n }\n\n }", "public void makeNow() {\n makeNow(0);\n }", "private List<Schedule> getSchedules(String traverserName, int delay) {\n List<ScheduleTimeInterval> intervals =\n new ArrayList<ScheduleTimeInterval>();\n intervals.add(new ScheduleTimeInterval(\n new ScheduleTime(0),\n new ScheduleTime(0)));\n \n List<Schedule> schedules = new ArrayList<Schedule>();\n Schedule schedule = new Schedule(traverserName, false, 60, delay, intervals);\n schedules.add(schedule);\n return schedules;\n }", "public String create(Schedule arg0) {\n\t\treturn null;\n\t}", "Alarm createAlarm();", "@Override\n public long generateNewTimeToNextContract() {\n return new Random().nextInt(5);\n }", "public Schedule() {\r\n }", "Period mo20733e();", "@Override\n public void mySchedule(String date) {\n FastJsonRequest request = new FastJsonRequest(SystemUtils.mainUrl + MethodCode.CLASSSCHEDULE + MethodType.MYSCHEDULEV2, RequestMethod.POST);\n request.add(\"username\", application.getSystemUtils().getDefaultUsername());\n request.add(\"token\", application.getSystemUtils().getToken());\n request.add(\"date\", date);\n request.add(MethodCode.DEVICEID, application.getSystemUtils().getSn());\n request.add(MethodCode.DEVICETYPE, SystemUtils.deviceType);\n request.add(MethodCode.APPVERSION, SystemUtils.getVersionName(context));\n addQueue(MethodCode.EVENT_MYSCHEDULE, request);\n\n\n// startQueue();\n }", "@Override\n public Date generate() {\n int year = 2000 + Rng.instance().nextInt(20);\n int date = Rng.instance().nextInt(28) + 1;\n int month = Rng.instance().nextInt(10) + 1;\n\n Calendar calendar = Calendar.getInstance();\n calendar.set(year, month, date);\n\n return calendar.getTime();\n }", "private static List<FacilityFreeSchedule> generateFacilityFreeSchedules(Facility facility) {\n List<FacilityFreeSchedule> facilityFreeSchedules=new ArrayList<>();\n LocalDateTime now = LocalDateTime.now();\n Map<Integer,List<LocalDateTime>> workingHoursForMonth=workingHoursForFacilityPerWeek(facility, now);\n workingHoursForMonth.keySet().stream().forEach(weekIndex -> {\n List<LocalDateTime> workingHoursPerWeek = workingHoursForMonth.get(weekIndex);\n facilityFreeSchedules.addAll(workingHoursPerWeek.stream()\n .map(dateTime -> generateFacilityFreeSchedule(facility, dateTime, weekIndex))\n .collect(Collectors.toList()));\n });\n return facilityFreeSchedules;\n }", "public TestTask buildNonRecurringTaskWithStartDate() throws IllegalValueException {\n builder = new TaskBuilder();\n return builder.withName(\"non recurring\").withStartDate(\"11 oct 2016 11pm\")\n .withEndDate(\"12 oct 2016 11pm\").build();\n }", "@Override\n protected Scheduler scheduler() {\n return Scheduler.newFixedRateSchedule(0, 1, TimeUnit.DAYS);\n }", "java.lang.String getSchedule();", "private void buildSchedule() {\n\t\tclass RabbitsGrassSimulationStep extends BasicAction {\n\t\t\tpublic void execute() {\n\t\t\t\tSimUtilities.shuffle(rabbitList);\n\t\t\t\tfor (int i = 0; i < rabbitList.size(); i++) {\n\t\t\t\t\tRabbitsGrassSimulationAgent rabbit = rabbitList.get(i);\n\t\t\t\t\trabbit.step();\n\t\t\t\t}\n\n\t\t\t\treapDeadRabbits();\n\t\t\t\tgiveBirthToRabbits();\n\n\t\t\t\trabbitSpace.spreadGrass(growthRateGrass);\n\n\t\t\t\tdisplaySurf.updateDisplay();\n\t\t\t}\n\t\t}\n\n\t\tschedule.scheduleActionBeginning(0, new RabbitsGrassSimulationStep());\n\n\t\tclass UpdateNumberOfRabbitsInSpace extends BasicAction {\n\t\t\tpublic void execute() {\n\t\t\t\trabbitsAndGrassInSpace.step();\n\t\t\t}\n\t\t}\n\n\t\tschedule.scheduleActionAtInterval(1, new UpdateNumberOfRabbitsInSpace());\n\n\t}", "@Test\n public void calculateLoanScheduleOrSubmitLoanApplicationTest() throws ApiException {\n PostSelfLoansRequest body = null;\n String command = null;\n PostSelfLoansResponse response = api.calculateLoanScheduleOrSubmitLoanApplication(body, command);\n\n // TODO: test validations\n }", "public void buildSchedule() {\n class SimulationStep extends BasicAction {\n public void execute() {\n SimUtilities.shuffle(rabbitList);\n for (int i = 0; i < rabbitList.size(); i++) {\n RabbitsGrassSimulationAgent rabbit = rabbitList.get(i);\n rabbit.step();\n }\n\n reapDeadRabbits();\n\n displaySurf.updateDisplay();\n }\n }\n schedule.scheduleActionBeginning(0, new SimulationStep());\n\n class GrassGrowth extends BasicAction {\n public void execute() {\n space.spreadGrass(grassGrowthRate);\n }\n }\n schedule.scheduleActionBeginning(0, new GrassGrowth());\n\n class UpdatePopulationPlot extends BasicAction {\n public void execute() {\n populationPlot.step();\n }\n }\n schedule.scheduleActionAtInterval(5, new UpdatePopulationPlot());\n }", "private static \tvoid schedule(IMirror mirror) throws SchedulerException, ParseException {\n\n String mirrorID = \"none\";\n\t\ttry {\n\t\t\tmirrorID = mirror.getMirrorID();\n\t \n\t\t} catch (ConfigException e) {\n\t\t\tlogger.error(\"At this point the mirror must have a mirrorID which it has not: \" + e.getMessage());\n\t\t}\n\t\t\n\t\tString jobNameAKAMirrorID = mirrorID;\n\t\tString downloaderGroupName = DOWNLOADER;\n\t\tString diffGeneratorGroupName = DIFF_GENERATOR;\n\t\tString deltaGeneratorGroupName = DELTA_GENERATOR;\n\t\t\n\t\t/*\n\t\t * DELTA job\n\t\t */\n\t\tJobDetail deltaJobDetail = new JobDetail(jobNameAKAMirrorID,\n\t\t\t\t\t\t\t\tdeltaGeneratorGroupName, // default group\n\t\t\t\t\t\t\t\tDOMDeltaGeneratorJob.class); // the diff job\n\t\t\n\t\t/*\n\t\t * DIFF job\n\t\t */\n\t\tJobDetail diffJobDetail = new JobDetail(jobNameAKAMirrorID,\n\t\t\t\t\t\t\t\tdiffGeneratorGroupName, // default group\n\t\t\t\t\t\t\t\tDOMDiffGeneratorJob.class); // the diff job\n\t\t\n\t\t/*\n\t\t * DOWNLOADER job\n\t\t * This job is the point of entry in the workflow.\n\t\t * It needs to know about the 2 jobs which are next (see above).\n\t\t */\n\t\tJobDetail jobDetail = new JobDetail(jobNameAKAMirrorID, downloaderGroupName,\n\t\t\t\t\t\t\t\t\tDownloaderJob.class); // the job\n\t\t\n\t\tjobDetail.getJobDataMap().put(MIRROR, mirror);\n\t\tjobDetail.getJobDataMap().put(DELTA_GENERATOR, deltaJobDetail);\n\t\tjobDetail.getJobDataMap().put(DIFF_GENERATOR, diffJobDetail);\n\t\t\n\t\tCronTrigger trigger = new CronTrigger(\"CronTrigger for \" + mirror,\n\t\t\t\t\t\t\t\t\tdownloaderGroupName, jobNameAKAMirrorID, downloaderGroupName,\n\t\t\t\t\t\t\t\t\tmirror.getCronExpression() );\n\t\t// TODO remove below!\n\t\t//Trigger trigger = TriggerUtils.makeMinutelyTrigger(intervalHours);\n\t\t//Trigger trigger = TriggerUtils.makeHourlyTrigger(intervalHours);\n\t\ttrigger.setStartTime(new java.util.Date());\n\t\ttrigger.setName(\"Download Job for \" + mirror);\n\t\tsched.scheduleJob(jobDetail, trigger);\n\t\t\n\t\tlogger.info(\"Scheduled job for \" + mirror \n\t\t\t\t+ \" with cron expression '\" + mirror.getCronExpression() + \"'\");\n\t\t\n\t}", "public ArrayList<int[]> getSchedule(){\n // Initialize the output list\n ArrayList<int[]> schedule = new ArrayList<>();\n\n // Initialize a list of tuples in the form (rally id, rally duration, rally deadline)\n ArrayList<int[]> rallyList = new ArrayList<>();\n for (int i = 0; i < _rallies.size(); i++) {\n int[] info = new int[] {i, _rallies.get(i)[0], _rallies.get(i)[1]};\n rallyList.add(info);\n }\n\n // Sort them in an increasing order of the deadline\n rallyList.sort(Comparator.comparingInt(rally -> rally[2]));\n\n // Set the start time\n int f = 0;\n\n // If there is no way to finish any one of the rally before its deadline, then we will set this to true.\n boolean nuke = false;\n\n // Run a greedy algorithm (Scheduling to Minimize Lateness)\n for (int[] rally : rallyList) {\n int[] plan = new int[] {rally[0], f};\n int duration = rally[1];\n int deadline = rally[2];\n f += duration;\n\n if (f > deadline) {\n nuke = true;\n break;\n }\n\n schedule.add(plan);\n }\n\n if (nuke) {\n return new ArrayList<>();\n }\n\n return schedule;\n }", "public ArrayList<Timestamp> generateNonSportSchedule(int faculties[], String course[] ,Date startDate, Date endDate){\r\n \t\r\n \t\r\n \tArrayList<CourseStructure > allCourseStructure = new ArrayList<CourseStructure>();\r\n \tArrayList<CourseStructure > tempCourseStructure = new ArrayList<CourseStructure>();\r\n \tArrayList<Timestamp> allFreeSlot = new ArrayList<Timestamp>();\r\n \t\r\n \t\r\n \t// get all structureCourse based on faculty\r\n \tif(faculties.length>0){\r\n \t\tFacultyCourseManager facultyCourseManager = new FacultyCourseManager();\r\n \t\tallCourseStructure = facultyCourseManager.getCourseByFaculty(faculties);\r\n \t}//end if(faculties.length>0)\r\n \t\r\n \t//get all structureCourse based on course\r\n \tif(course.length>0){\r\n \t\tCourseStructureManager coursestructure = new CourseStructureManager();\r\n \t\ttempCourseStructure = coursestructure.getAllCourseStructureByCourse(course);\r\n \t}//end if(course.length>0)\r\n \t\r\n \t//merge both CourseStructure Arraylist\r\n \tfor(int i =0 ; i<tempCourseStructure.size();i++){\r\n \t\tif(!allCourseStructure.contains(tempCourseStructure.get(i))){\r\n \t\t\tallCourseStructure.add(tempCourseStructure.get(i));\r\n \t\t}//end if(!allCourseStructure.contains(tempCourseStructure.get(i))){\r\n \t}//for(int i =0 ; i<tempCourseStructure.size();i++)\r\n \t\r\n \t\r\n \t\r\n \t /* implement a genetic algorithm\r\n \t * to find the best fit date\r\n \t */\r\n \t//variables\r\n \tArrayList<Timestamp> allSolutions = new ArrayList<Timestamp>();\r\n \tArrayList<Integer> solutionFitness = new ArrayList<Integer>();\r\n \tint totalTime,fitnessValue=0;\r\n \tTimestamp time = new Timestamp(startDate.getYear(), startDate.getMonth(), startDate.getDate(), 8, 0, 0, 0);\r\n \tboolean result;\r\n \t//initialize population\r\n \t/*university start at 8a.m to 8p.m\r\n \t * This makes 12 hr\r\n \t * Total time = (endDate -StartDate) * 12\r\n \t */\r\n \t \r\n \t\r\n \tlong daysBetween = endDate.getTime()- startDate.getTime();\r\n \t\r\n totalTime = (int)( (daysBetween * 12)/ (1000 * 60 * 60 * 24) );\r\n allSolutions.add(time);\r\n Calendar calender = Calendar.getInstance();\r\n \tfor(int i=1;i<totalTime;i++){\r\n \t\tif(time.getHours()>0 && time.getHours()<20){\r\n \t\t\tcalender.setTime(time);\r\n \t\t\t\r\n \t\t\tcalender.add(Calendar.HOUR, 1);\r\n \t\t\tlong tim = calender.getTime().getTime();\r\n \t\t\ttime = new Timestamp(tim);\r\n \t\t\tallSolutions.add(time);\r\n \t\t}//end if(time.getHours()>0 && time.getHours()<8){\r\n \t\telse{\r\n \t\t\tcalender.setTime(time);\r\n \t\t\t\r\n \t\t\tcalender.add(Calendar.HOUR, 12);\r\n \t\t\tlong tim = calender.getTime().getTime();\r\n \t\t\ttime = new Timestamp(tim);\r\n \t\t\tallSolutions.add(time); \t\t\t\r\n \t\t}//end else \t\t \t\t\r\n \t}//end for(int i=1;i<totalTime;i++){\r\n \t\r\n \t\r\n \t//fitness\r\n \t/*\r\n \t * if current timetable slot is free = increase by 1\r\n \t * if module is not in current timetable slot = increase by 1\r\n \t * if module is not a degree = increase by 1\r\n \t * if module is not year 3 = increase by 1 \r\n \t */\r\n \tTimetableManager timetableManager = new TimetableManager();\r\n \t//travel through population\r\n \tfor(int i=0; i<allSolutions.size();i++){\r\n \t\t//travel through course Structure\r\n \r\n \t\tfor(int j=0;j<allCourseStructure.size();j++){\r\n \t\t\t\r\n \t\t\t//check for current timetable slot\r\n \t\tint day = allSolutions.get(i).getDay();\r\n \t\tTime temTime = new Time(allSolutions.get(i).getTime());\r\n \t\t\r\n \t\t//check for course structure timetable slot\r\n \t\tresult = timetableManager.findTimetableByDayTime(temTime, getDays(day), allCourseStructure.get(j).getCourse_structure_id());\r\n \t\tif(!result){\r\n \t\t\tfitnessValue++;\r\n \t\t}//end if(!result) \r\n \t\t\t\r\n \t\t}//end for(int j=0;j<allCourseStructure.size();j++){\r\n \t\t\r\n \t\tsolutionFitness.add(fitnessValue);\r\n \t\tfitnessValue = 0;\r\n \t}//end for (int i=0; i<allSolutions.size();i++){\r\n \t\r\n \tint maxFitness = Collections.max(solutionFitness);\r\n \tfor(int i =0 ; i<allSolutions.size();i++){\r\n \t\tif(solutionFitness.get(i) == maxFitness){\r\n \t\t\tallFreeSlot.add(allSolutions.get(i));\r\n \t\t}\t\r\n \t}\r\n \t\r\n \t\r\n \t\r\n \treturn allFreeSlot; \t\r\n }", "@Scheduled(fixedRateString = \"PT120M\")\n\tvoid someJob(){\n//\t\tString s = \"Testing message.\\nNow time is : \"+new Date();\n////\t\tSystem.out.println(s);\n//\t\tPushNotificationOptions.sendMessageToAllUsers(s);\n//\n\t\t//get all schedules in current dayOfWeek\n\t\tCollection<Notification> notifications = notificationService.findAllByDayOfWeekAndTime();\n\t\tfor(Notification notification : notifications){\n//\t\t\tSystem.out.println(notification.toString());\n//\t\t\tSystem.out.println(!notification.getStatus());\n////\t\t\tSystem.out.println(check(notification.getStartTime()));\n//\t\t\t//check for already not sent notifications , also check for time difference < TIME_CONSTANT\n//\t\t\tif(!notification.getStatus() && check(notification.getStartTime())){\n//\t\t\t\t//send push notification\n//\t\t\t\tPushNotificationOptions.sendMessageToAllUsers(notification.getMessage());\n//\t\t\t\t//mark the notification as sent\n//\t\t\t\tnotificationService.setStatus(notification.getNotificationId());\n//\t\t\t}\n\t\t\tif(checkForDayTime()){\n\t\t\t\tPushNotificationOptions.sendMessageToAllUsers(notification.getMessage());\n\t\t\t\tnotificationService.setStatus(notification.getNotificationId());\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t}", "public void toPunish() {\n\n //// TODO: 24/03/2017 delete the following lines\n// dalDynamic.addRowToTable2(\"23/03/2017\",\"Thursday\",4,walkingLength,deviation)\n\n\n\n int dev,sum=0;\n long id;\n id=dalDynamic.getRecordIdAccordingToRecordName(\"minutesWalkTillEvening\");\n Calendar now = Calendar.getInstance();//today\n Calendar calendar = Calendar.getInstance();\n SimpleDateFormat dateFormat=new SimpleDateFormat(\"dd/MM/yyyy\");\n String date;\n for (int i = 0; i <DAYS_DEVIATION ; i++) {\n date=dateFormat.format(calendar.getTime());\n Log.v(\"Statistic\",\"date \"+date);\n dev = dalDynamic.getDeviationAccordingToeventTypeIdAnddate(id,date);\n sum+=dev;\n calendar.add(Calendar.DATE,-1);//// TODO: -1-i????\n }\n if(sum==DAYS_DEVIATION){\n Intent intent = new Intent(context,BlankActivity.class);\n context.startActivity(intent);\n //todo:punishment\n }\n\n }", "public void initAlgorithm() {\n executor.scheduleAtFixedRate(scheduledThoughtsProducer::periodicalThoughtsCheck, 1, 5,TimeUnit.MINUTES);\n// executor.scheduleAtFixedRate(scheduledThoughtsProducer::periodicalThoughtsCheck, 2, 10,TimeUnit.SECONDS);\n\n // every day perform random thought dice roll\n // also roll for random time: 10am - 9pm\n Cron4j.scheduler.schedule(Cron4j.EVERY_DAY_AT_10_AM, () -> {\n int produceThoughtDice = (int) (Math.random() * 3); // 66% yes, 33% no\n if (produceThoughtDice < 2) {\n int timeShift = (int) (Math.random() * 12); // 0-11\n executor.schedule(scheduledThoughtsProducer::periodicalThoughtProduceSuitable, timeShift, TimeUnit.HOURS);\n } else {\n System.out.println(\"Thought not produced today because of the dice: \" + produceThoughtDice);\n }\n });\n// Cron4j.scheduler.schedule(Cron4j.EVERY_MINUTE, () -> {\n// executor.schedule(scheduledThoughtsProducer::periodicalThoughtProduceSuitable, 0, TimeUnit.SECONDS);\n// });\n\n // every week perform a statistical overview\n // should be not very long and with a lot of variations\n Cron4j.scheduler.schedule(Cron4j.EVERY_WEEK_SUNDAY_18_PM, () -> {\n// Cron4j.scheduler.schedule(Cron4j.EVERY_MINUTE, () -> {\n executor.schedule(scheduledThoughtsProducer::periodicalWeeklyThoughts, 0, TimeUnit.SECONDS);\n });\n\n // start the scheduler\n Cron4j.scheduler.start();\n }", "ConferenceScheduleBuilderService endLunch();", "public void scheduleDisbursementReport() {\n Log.logBanner(\"Scheduling Disbursement Report\");\n pageVerification();\n schedule();\n }", "CdapSuspendScheduleStep createCdapSuspendScheduleStep();", "public Loan(int s) {\r\n\t\tstockId = s;\r\n\t\tloanId = nextLoanId;\r\n\t\tnextLoanId++;\r\n\t\tloanFine = new Fine();\t\t\r\n\t\tloanDate = LocalDate.now();\r\n\t}", "public List<ScheduledAmortizationPayment> calculateAmortizationSchedule() {\n final int maxNumberOfPayments = loanRequest.getTermInMonths() + 1;\n LoanMonthlyPayment loanMonthlyPayment = this.calculateMonthlyPayment();\n int paymentNumber = 0;\n double totalPayments = 0;\n double totalInterestPaid = 0;\n double balance = loanRequest.getAmountBorrowed();\n List<ScheduledAmortizationPayment> payments = new LinkedList<ScheduledAmortizationPayment>();\n payments.add(new ScheduledAmortizationPayment(paymentNumber++, 0d, 0d, balance, 0d, 0d));\n while ((balance > 0) && (paymentNumber <= maxNumberOfPayments)) {\n double curMonthlyInterest = balance * loanMonthlyPayment.getMonthlyInterest();\n double curPayoffAmount = balance + curMonthlyInterest;\n double curMonthlyPaymentAmount = Math.min(loanMonthlyPayment.getMonthlyPayment(),\n curPayoffAmount);\n if ((paymentNumber == maxNumberOfPayments)\n && ((curMonthlyPaymentAmount == 0) || (curMonthlyPaymentAmount == curMonthlyInterest))) {\n curMonthlyPaymentAmount = curPayoffAmount;\n }\n double curMonthlyPrincipalPaid = curMonthlyPaymentAmount - curMonthlyInterest;\n double curBalance = balance - curMonthlyPrincipalPaid;\n totalPayments += curMonthlyPaymentAmount;\n totalInterestPaid += curMonthlyInterest;\n payments.add(new ScheduledAmortizationPayment(\n paymentNumber++, curMonthlyPaymentAmount, curMonthlyInterest,\n curBalance, totalPayments, totalInterestPaid\n )\n );\n balance = curBalance;\n }\n return payments;\n }", "@Test\n public void loanWithFlatChargesAndPeriodicAccrualAccountingEnabled() throws InterruptedException {\n\n final Integer clientID = ClientHelper.createClient(REQUEST_SPEC, RESPONSE_SPEC);\n ClientHelper.verifyClientCreatedOnServer(REQUEST_SPEC, RESPONSE_SPEC, clientID);\n\n // Add charges with payment mode regular\n List<HashMap> charges = new ArrayList<>();\n Integer flatDisbursement = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC, ChargesHelper.getLoanDisbursementJSON());\n addCharges(charges, flatDisbursement, \"100\", null);\n Integer flatSpecifiedDueDate = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, \"100\", false));\n addCharges(charges, flatSpecifiedDueDate, \"100\", \"29 September 2011\");\n Integer flatInstallmentFee = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanInstallmentJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, \"50\", false));\n addCharges(charges, flatInstallmentFee, \"50\", null);\n\n final Account assetAccount = ACCOUNT_HELPER.createAssetAccount();\n final Account incomeAccount = ACCOUNT_HELPER.createIncomeAccount();\n final Account expenseAccount = ACCOUNT_HELPER.createExpenseAccount();\n final Account overpaymentAccount = ACCOUNT_HELPER.createLiabilityAccount();\n\n List<HashMap> collaterals = new ArrayList<>();\n\n final Integer collateralId = CollateralManagementHelper.createCollateralProduct(REQUEST_SPEC, RESPONSE_SPEC);\n\n final Integer clientCollateralId = CollateralManagementHelper.createClientCollateral(REQUEST_SPEC, RESPONSE_SPEC,\n String.valueOf(clientID), collateralId);\n addCollaterals(collaterals, clientCollateralId, BigDecimal.valueOf(1));\n\n final Integer loanProductID = createLoanProduct(false, ACCRUAL_PERIODIC, assetAccount, incomeAccount, expenseAccount,\n overpaymentAccount);\n final Integer loanID = applyForLoanApplication(clientID, loanProductID, charges, null, \"12,000.00\", collaterals);\n Assertions.assertNotNull(loanID);\n HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);\n\n ArrayList<HashMap> loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n verifyLoanRepaymentSchedule(loanSchedule);\n\n List<HashMap> loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(flatDisbursement, loanCharges, \"100\", \"100.00\", \"0.0\", \"0.0\");\n validateCharge(flatSpecifiedDueDate, loanCharges, \"100\", \"100.00\", \"0.0\", \"0.0\");\n validateCharge(flatInstallmentFee, loanCharges, \"50\", \"200.00\", \"0.0\", \"0.0\");\n\n // check for disbursement fee\n HashMap disbursementDetail = loanSchedule.get(0);\n validateNumberForEqual(\"100.00\", String.valueOf(disbursementDetail.get(\"feeChargesDue\")));\n\n // check for charge at specified date and installment fee\n HashMap firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"150.00\", String.valueOf(firstInstallment.get(\"feeChargesDue\")));\n\n // check for installment fee\n HashMap secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"50.00\", String.valueOf(secondInstallment.get(\"feeChargesDue\")));\n\n LOG.info(\"-----------------------------------APPROVE LOAN-----------------------------------------\");\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.approveLoan(\"20 September 2011\", loanID);\n LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);\n LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap);\n\n LOG.info(\"-------------------------------DISBURSE LOAN-------------------------------------------\");\n String loanDetails = LOAN_TRANSACTION_HELPER.getLoanDetails(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.disburseLoanWithNetDisbursalAmount(\"20 September 2011\", loanID,\n JsonPath.from(loanDetails).get(\"netDisbursalAmount\").toString());\n LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);\n\n final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(Float.parseFloat(\"100.00\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.DEBIT) };\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 September 2011\", assetAccountInitialEntry);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, \"20 September 2011\",\n new JournalEntry(Float.parseFloat(\"100.00\"), JournalEntry.TransactionType.CREDIT));\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(flatDisbursement, loanCharges, \"100\", \"0.00\", \"100.0\", \"0.0\");\n\n LOG.info(\"-------------Make repayment 1-----------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 October 2011\", Float.parseFloat(\"3301.49\"), loanID);\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(flatDisbursement, loanCharges, \"100\", \"0.00\", \"100.0\", \"0.0\");\n validateCharge(flatSpecifiedDueDate, loanCharges, \"100\", \"0.00\", \"100.0\", \"0.0\");\n validateCharge(flatInstallmentFee, loanCharges, \"50\", \"150.00\", \"50.0\", \"0.0\");\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 October 2011\",\n new JournalEntry(Float.parseFloat(\"3301.49\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"3301.49\"), JournalEntry.TransactionType.CREDIT));\n\n LOAN_TRANSACTION_HELPER.addChargesForLoan(loanID, LoanTransactionHelper\n .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(flatSpecifiedDueDate), \"29 October 2011\", \"100\"));\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n\n secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"150.00\", String.valueOf(secondInstallment.get(\"feeChargesDue\")));\n LOG.info(\"----------- Waive installment charge for 2nd installment ---------\");\n LOAN_TRANSACTION_HELPER.waiveChargesForLoan(loanID, (Integer) getloanCharge(flatInstallmentFee, loanCharges).get(\"id\"),\n LoanTransactionHelper.getWaiveChargeJSON(String.valueOf(2)));\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(flatInstallmentFee, loanCharges, \"50\", \"100.00\", \"50.0\", \"50.0\");\n\n /*\n * JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount( assetAccount, \"20 September 2011\", new\n * JournalEntry(Float.parseFloat(\"50.0\"), JournalEntry.TransactionType.CREDIT));\n * JOURNAL_ENTRY_HELPER.checkJournalEntryForExpenseAccount (expenseAccount, \"20 September 2011\", new\n * JournalEntry(Float.parseFloat(\"50.0\"), JournalEntry.TransactionType.DEBIT));\n */\n final String jobName = \"Add Accrual Transactions\";\n\n SCHEDULER_JOB_HELPER.executeAndAwaitJob(jobName);\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n checkAccrualTransactions(loanSchedule, loanID);\n\n LOG.info(\"----------Make repayment 2------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 November 2011\", Float.parseFloat(\"3251.49\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 November 2011\",\n new JournalEntry(Float.parseFloat(\"3251.49\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"3251.49\"), JournalEntry.TransactionType.CREDIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"0\", String.valueOf(secondInstallment.get(\"totalOutstandingForPeriod\")));\n\n LOG.info(\"--------------Waive interest---------------\");\n LOAN_TRANSACTION_HELPER.waiveInterest(\"20 December 2011\", String.valueOf(61.79), loanID);\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap thirdInstallment = loanSchedule.get(3);\n validateNumberForEqual(\"60.59\", String.valueOf(thirdInstallment.get(\"interestOutstanding\")));\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 December 2011\",\n new JournalEntry(Float.parseFloat(\"61.79\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForExpenseAccount(expenseAccount, \"20 December 2011\",\n new JournalEntry(Float.parseFloat(\"61.79\"), JournalEntry.TransactionType.DEBIT));\n\n Integer flatPenaltySpecifiedDueDate = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, \"100\", true));\n LOAN_TRANSACTION_HELPER.addChargesForLoan(loanID, LoanTransactionHelper\n .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(flatPenaltySpecifiedDueDate), \"29 September 2011\", \"100\"));\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(flatPenaltySpecifiedDueDate, loanCharges, \"100\", \"0.00\", \"100.0\", \"0.0\");\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"100\", String.valueOf(secondInstallment.get(\"totalOutstandingForPeriod\")));\n\n // checking the journal entry as applied penalty has been collected\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 October 2011\",\n new JournalEntry(Float.parseFloat(\"3301.49\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"3301.49\"), JournalEntry.TransactionType.CREDIT));\n\n LOG.info(\"----------Make repayment 3 advance------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 November 2011\", Float.parseFloat(\"3301.49\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 November 2011\",\n new JournalEntry(Float.parseFloat(\"3301.49\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"3301.49\"), JournalEntry.TransactionType.CREDIT));\n\n LOAN_TRANSACTION_HELPER.addChargesForLoan(loanID, LoanTransactionHelper\n .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(flatPenaltySpecifiedDueDate), \"10 January 2012\", \"100\"));\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"100\", String.valueOf(fourthInstallment.get(\"penaltyChargesOutstanding\")));\n validateNumberForEqual(\"3239.68\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n\n LOG.info(\"----------Pay applied penalty ------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 January 2012\", Float.parseFloat(\"100\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 January 2012\",\n new JournalEntry(Float.parseFloat(\"100\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"100\"), JournalEntry.TransactionType.CREDIT));\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"0\", String.valueOf(fourthInstallment.get(\"penaltyChargesOutstanding\")));\n validateNumberForEqual(\"3139.68\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n\n LOG.info(\"----------Make repayment 4 ------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 January 2012\", Float.parseFloat(\"3139.68\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 January 2012\",\n new JournalEntry(Float.parseFloat(\"3139.68\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"3139.68\"), JournalEntry.TransactionType.CREDIT));\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.getLoanDetail(REQUEST_SPEC, RESPONSE_SPEC, loanID, \"status\");\n LoanStatusChecker.verifyLoanAccountIsClosed(loanStatusHashMap);\n }", "ConferenceScheduleBuilderService createEventsFromLunchToNetwork();", "@Scheduled(cron = \"${toil1.schedule1}\")\n\tpublic void toiL1Schedule1() {\n\t\tlog.info(\"Running toiL1Schedule1\");\n\t\trunToiL1Schedule();\n\t\trunToiBlogsL1Schedule();\n\t}", "private void generateCheckInTimes() throws ParseException {\n \n int numToGen = (Integer)occurSpinner.getValue();\n SimpleDateFormat aSdf = Constants.CHECKIN_DATE_FORMAT;\n DefaultListModel theModel = (DefaultListModel)checkInTimeList.getModel();\n \n //Get the white listed times\n int startHour = (Integer)startHourSpinner.getValue();\n int startMinute = (Integer)startMinSpinner.getValue(); \n int endHour = (Integer)endHourSpinner.getValue(); \n int endMinute = (Integer)endMinSpinner.getValue(); \n \n //Convert to absolute times\n int startTime = startHour * 60 + startMinute;\n int endTime = endHour * 60 + endMinute;\n \n //Get the frequency\n TimeFreq freqObj = (TimeFreq)freqCombo.getSelectedItem();\n \n //Get the current date\n Calendar theCalendar = Calendar.getInstance();\n Date currentDate;\n if( theModel.isEmpty() ){\n currentDate = new Date();\n } else {\n String currentDateStr = (String)theModel.get( theModel.size() - 1 ); \n currentDate = Constants.CHECKIN_DATE_FORMAT.parse(currentDateStr);\n }\n \n //Set the time\n theCalendar.setTime( currentDate ); \n \n //If the freq is hourly then make sure the start time is after the current time\n int theFreq = freqObj.getType(); \n if( theFreq != TimeFreq.HOURLY ){\n \n //Calculate the range\n int range;\n if( endTime >= startTime ){\n\n range = endTime - startTime;\n\n } else {\n\n //If the start time is greater than the stop time then the range is\n //start to max and min to end\n range = maximumTime - startTime;\n range += endTime;\n\n }\n\n //Generate some dates\n for( int i = 0; i < numToGen; i++ ){\n\n //Get the random num\n float rand = aSR.nextFloat();\n int theRand = (int)(rand * range);\n\n //Get the new absolute time\n int newTime = theRand + startTime;\n if( newTime > maximumTime )\n newTime -= maximumTime;\n \n //Convert to hour and second\n int newHour = newTime / 60;\n int newMin = newTime % 60; \n\n //Everything but hourly\n theCalendar.set( Calendar.HOUR_OF_DAY, newHour);\n theCalendar.set( Calendar.MINUTE, newMin);\n theCalendar.add( theFreq, 1);\n \n //Add the time\n String aDate = aSdf.format( theCalendar.getTimeInMillis());\n theModel.addElement(aDate);\n }\n \n } else {\n \n int currHour = theCalendar.get( Calendar.HOUR_OF_DAY );\n int currSecond = theCalendar.get( Calendar.MINUTE );\n \n int currTime = currHour * 60 + currSecond;\n \n //Go to the next day\n //Generate some dates\n for( int i = 0; i < numToGen; i++ ){\n \n //Get the random num\n float rand = aSR.nextFloat();\n int theRand = (int)(rand * 30);\n\n if( currTime + 60 > endTime ){\n theCalendar.add( Calendar.DAY_OF_YEAR, 1);\n theCalendar.set( Calendar.HOUR_OF_DAY, startHour);\n theCalendar.set( Calendar.MINUTE, startMinute);\n } else {\n theCalendar.add( theFreq, 1); \n theCalendar.add( Calendar.MINUTE, theRand );\n }\n \n \n //Add the time\n String aDate = aSdf.format( theCalendar.getTimeInMillis());\n theModel.addElement(aDate);\n\n //Update time\n currHour = theCalendar.get( Calendar.HOUR_OF_DAY );\n currSecond = theCalendar.get( Calendar.MINUTE );\n currTime = currHour * 60 + currSecond;\n \n }\n } \n \n \n \n }", "public static void main(String[] args) {\n\t\tint[] requests = {1, 2, 3};\n\t\tArrayList<Integer> results = new ArrayList<Integer>();\n\t\tint totalNights = scheduleRoomNight(requests, 0, results);\n\t\tSystem.out.println(\"For [1, 2, 3] Total nights = \" + totalNights + \"\\nSchedule as following:\");\n\t\tfor(int i = results.size() - 1; i >= 0 ; i--) {\n\t\t\tSystem.out.print(\" \" + results.get(i));\n\t\t}\n\t\tSystem.out.println();\n\t\t\n\t\trequests = new int[]{5, 1, 2, 6};\n\t\tresults.clear();\n\t\ttotalNights = scheduleRoomNight(requests, 0, results);\n\t\tSystem.out.println(\"For [5, 1, 2, 6] Total nights = \" + totalNights + \"\\nSchedule as following:\");\n\t\tfor(int i = results.size() - 1; i >= 0 ; i--) {\n\t\t\tSystem.out.print(\" \" + results.get(i));\n\t\t}\n\t\tSystem.out.println();\n\t\t\n\t\trequests = new int[]{5, 1, 2, 6, 20, 2};\n\t\tresults.clear();\n\t\ttotalNights = scheduleRoomNight(requests, 0, results);\n\t\tSystem.out.println(\"For [5, 1, 2, 6, 20, 2] Total nights = \" + totalNights + \"\\nSchedule as following:\");\n\t\tfor(int i = results.size() - 1; i >= 0 ; i--) {\n\t\t\tSystem.out.print(\" \" + results.get(i));\n\t\t}\n\t\t\n\t}", "@Test\r\n\tpublic void withdraw() {\n\t\tResult<String> loanWithdraw = qddPaymentService.loanWithdraw(141227113319030002L);\r\n\t\tSystem.out.println(loanWithdraw);\r\n\t}", "@Scheduled(cron = \"0 0 0 * * *\") //for 30 seconds trigger -> 0,30 * * * * * for 12am fires every day -> 0 0 0 * * *\n\tpublic void cronJob() {\n\t\tList<TodayBalance> tb = balanceService.findTodaysBalance();\n\t\tList<TodayBalance> alltb = new ArrayList<TodayBalance>();\n\t\talltb.addAll(tb);\n\t\t\n\t\n\t\tCalendar cal = Calendar.getInstance();\n\t\tcal.add(Calendar.DATE, -1);\n\t\n\t\tif(!alltb.isEmpty()) {\n\t\t\tfor (TodayBalance tbal : alltb ) {\n\t\t\t \n\t\t\t\tClosingBalance c = new ClosingBalance();\n\t\t\t\tc.setCbalance(tbal.getBalance());\n\t\t\t\tc.setDate((cal.getTime()).toString());\n\t\t \n\t\t\t\tclosingRepository.save(c);\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "public abstract Date getNextFireTime();", "void createDailyMessageRaport(String stringCurrentDate);", "java.util.Calendar getLastrun();", "TimeSpent createTimeSpent();", "public void generateWeeklySchedule(){\r\n for (int i = 0; i < numDayWorkWeek; i++)\r\n weeklySchedule.get(i).clear();\r\n\r\n int day = 0;\r\n int workHrs = 0;\r\n\r\n for (Task unfinishedTask: unfinished){\r\n if (day > numDayWorkWeek - 1) break;\r\n\r\n //if there is room for this task --> add it. Else, move to the next day\r\n if (workHrs + unfinishedTask.getHrsLeft() <= dailyWorkload){\r\n weeklySchedule.get(day).add(unfinishedTask);\r\n workHrs += unfinishedTask.getHrsLeft();\r\n }\r\n else{\r\n day++;\r\n weeklySchedule.get(day).add(unfinishedTask);\r\n workHrs = unfinishedTask.getHrsLeft();\r\n }\r\n }\r\n }", "void schedule(ScheduledJob job);", "public void anualTasks(){\n List<Unit> units = unitService.getUnits();\n for(Unit unit: units){\n double amount = 10000; //@TODO calculate amount based on unit type\n Payment payment = new Payment();\n payment.setPaymentMethod(PaymentMethod.Cash);\n Calendar calendar = Calendar.getInstance();\n calendar.set(Calendar.MONTH, 1);\n calendar.set(Calendar.DATE, 30);\n payment.setDate(LocalDate.now());\n TimeZone tz = calendar.getTimeZone();\n ZoneId zid = tz == null ? ZoneId.systemDefault() : tz.toZoneId();\n payment.setAmount(amount);\n payment.setDueDate(LocalDateTime.ofInstant(calendar.toInstant(), zid).toLocalDate());\n payment.setClient(unit.getOwner());\n payment.setUnit(unit);\n payment.setRecurringInterval(365L);\n payment.setStatus(PaymentStatus.Pending);\n paymentService.savePayment(payment);\n }\n }", "Schedule getSchedule(String departure, String arrival, int depYear, int depMonth);", "@Override\n protected Scheduler scheduler() {\n return Scheduler.newFixedRateSchedule(0, 1, TimeUnit.SECONDS);\n }", "private RepeatWeekdays() {}", "public void scheduleAlarm() {\n\n Calendar cal = Calendar.getInstance();\n Intent alarmIntent = new Intent(context, PeriodicTransactionService.class);\n alarmIntent.setAction(PeriodicTransactionService.ACTION);\n Bundle bundle = new Bundle();\n bundle.putInt(PeriodicTransactionService.USER_ID_PARAM, userId);\n alarmIntent.putExtras(bundle);\n PendingIntent pintent = PendingIntent.getService(context,\n MyAlarmManager.REQUEST_CODE,\n alarmIntent,\n PendingIntent.FLAG_UPDATE_CURRENT);\n AlarmManager alarm = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);\n alarm.setInexactRepeating(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(), 4 * 1000, pintent);\n }", "@Test\n public void testLoanRefundByCashAccrualBasedAccounting() {\n Calendar fourMonthsfromNowCalendar = Calendar.getInstance(Utils.getTimeZoneOfTenant());\n fourMonthsfromNowCalendar.add(Calendar.MONTH, -4);\n\n // FINERACT-885: If the loan starts on day 27-31th of month and not all months have that\n // many days, then loan payment will get reset to a day of month less than today's day\n // and 4th payment will be in the past. In such case, start the loan a few days later,\n // so that 4th payment is guaranteed to be in the future.\n if (fourMonthsfromNowCalendar.get(Calendar.DAY_OF_MONTH) > 27) {\n fourMonthsfromNowCalendar.add(Calendar.DAY_OF_MONTH, 4);\n }\n\n String fourMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n final Integer clientID = ClientHelper.createClient(REQUEST_SPEC, RESPONSE_SPEC);\n ClientHelper.verifyClientCreatedOnServer(REQUEST_SPEC, RESPONSE_SPEC, clientID);\n\n /***\n * Create loan product with Default STYLE strategy\n */\n\n final Account assetAccount = ACCOUNT_HELPER.createAssetAccount();\n final Account incomeAccount = ACCOUNT_HELPER.createIncomeAccount();\n final Account expenseAccount = ACCOUNT_HELPER.createExpenseAccount();\n final Account overpaymentAccount = ACCOUNT_HELPER.createLiabilityAccount();\n\n final Integer loanProductID = createLoanProduct(\"0\", \"0\", LoanProductTestBuilder.DEFAULT_STRATEGY, ACCRUAL_UPFRONT, assetAccount,\n incomeAccount, expenseAccount, overpaymentAccount);// ,\n // LoanProductTestBuilder.EQUAL_INSTALLMENTS,\n // LoanProductTestBuilder.FLAT_BALANCE);\n Assertions.assertNotNull(loanProductID);\n\n /***\n * Apply for loan application and verify loan status\n */\n final String savingsId = null;\n final String principal = \"12,000.00\";\n\n // Add charges with payment mode regular\n List<HashMap> charges = new ArrayList<>();\n\n Integer flatInstallmentFee = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanInstallmentJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, \"50\", false));\n addCharges(charges, flatInstallmentFee, \"50\", null);\n\n List<HashMap> collaterals = new ArrayList<>();\n\n final Integer collateralId = CollateralManagementHelper.createCollateralProduct(REQUEST_SPEC, RESPONSE_SPEC);\n Assertions.assertNotNull(collateralId);\n final Integer clientCollateralId = CollateralManagementHelper.createClientCollateral(REQUEST_SPEC, RESPONSE_SPEC,\n String.valueOf(clientID), collateralId);\n Assertions.assertNotNull(clientCollateralId);\n addCollaterals(collaterals, clientCollateralId, BigDecimal.valueOf(1));\n\n final Integer loanID = applyForLoanApplicationWithPaymentStrategyAndPastMonth(clientID, loanProductID, charges, savingsId,\n principal, LoanApplicationTestBuilder.DEFAULT_STRATEGY, -4, collaterals);\n Assertions.assertNotNull(loanID);\n HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);\n\n LOG.info(\"-----------------------------------APPROVE LOAN-----------------------------------------\");\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.approveLoan(fourMonthsfromNow, loanID);\n LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);\n LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap);\n\n LOG.info(\"-------------------------------DISBURSE LOAN-------------------------------------------\");\n String loanDetails = LOAN_TRANSACTION_HELPER.getLoanDetails(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.disburseLoanWithNetDisbursalAmount(fourMonthsfromNow, loanID,\n JsonPath.from(loanDetails).get(\"netDisbursalAmount\").toString());\n LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);\n\n final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(Float.parseFloat(\"1440\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"300.00\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.DEBIT) };\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, fourMonthsfromNow, assetAccountInitialEntry);\n\n ArrayList<HashMap> loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"2290\", String.valueOf(firstInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #1\n\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String threeMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(threeMonthsfromNow, Float.parseFloat(\"2290\"), loanID);\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"0.00\", String.valueOf(firstInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #2\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String twoMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(twoMonthsfromNow, Float.parseFloat(\"2290\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, twoMonthsfromNow,\n new JournalEntry(Float.parseFloat(\"2290\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"2290\"), JournalEntry.TransactionType.CREDIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n Map secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"0.00\", String.valueOf(secondInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #3\n // Pay 2290 more than expected\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String oneMonthfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(oneMonthfromNow, Float.parseFloat(\"4580\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, oneMonthfromNow,\n new JournalEntry(Float.parseFloat(\"4580\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"4580\"), JournalEntry.TransactionType.CREDIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap thirdInstallment = loanSchedule.get(3);\n validateNumberForEqual(\"0.00\", String.valueOf(thirdInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make refund of 20\n // max 2290 to refund. Pay 20 means only principal\n // Default style refund order(principal, interest, fees and penalties\n // paid: principal 2000, interest 240, fees 50, penalty 0\n // refund 20 means paid: principal 1980, interest 240, fees 50, penalty\n // 0\n\n // FINERACT-885: As loan may not have started exactly four months ago,\n // make final payment today and not four months from start (as that may be in the future)\n fourMonthsfromNowCalendar.setTime(Date.from(Utils.getLocalDateOfTenant().atStartOfDay(Utils.getZoneIdOfTenant()).toInstant()));\n final String now = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRefundByCash(now, Float.parseFloat(\"20\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, now,\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.DEBIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"principalOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"interestOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"feeChargesOutstanding\")));\n\n // Make refund of 2000\n // max 2270 to refund. Pay 2000 means only principal\n // paid: principal 1980, interest 240, fees 50, penalty 0\n // refund 2000 means paid: principal 0, interest 220, fees 50, penalty 0\n\n LOAN_TRANSACTION_HELPER.makeRefundByCash(now, Float.parseFloat(\"2000\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, now,\n new JournalEntry(Float.parseFloat(\"2000\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"1980\"), JournalEntry.TransactionType.DEBIT));\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, now,\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.DEBIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"2020.00\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n validateNumberForEqual(\"2000.00\", String.valueOf(fourthInstallment.get(\"principalOutstanding\")));\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"interestOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"feeChargesOutstanding\")));\n\n }", "void deschedule(ScheduledJob job);", "public static void main(String[] args) {\n Arrays.asList(\n LocalDate.now(),\n LocalTime.now(),\n LocalDateTime.now(),\n ZonedDateTime.now()).stream()\n .forEach(System.out::println);\n\n // LocalDate etc. may never be constructed directly!\n //LocalDate localDate = new LocalDate(); - will not compile: \"LocalDate(...) has private access\"\n\n // daily Scrum Standup at 9:15\n LocalTime dailyStandup = LocalTime.of(9, 15);\n // tomorrow (as seen from today, 18.5.17)\n LocalDate tomorrow = LocalDate.of(2017, Month.MAY, 19);\n\n // Constructing a new ZonedDateTime.\n ZoneId bern = ZoneId.of(\"Europe/Zurich\");\n ZonedDateTime bernStandup = ZonedDateTime.of(tomorrow, dailyStandup, bern);\n System.out.println(\"Scrum standup meeting tomorrow in Bern: \" + bernStandup); // 2017-05-19T09:15+02:00\n\n // Find other timezones\n String europeanTimezones = ZoneId.getAvailableZoneIds().stream()\n .filter(s -> s.contains(\"Europe\"))\n .limit(10)\n .reduce(\"\", (s, t) -> s + \", \" + t);\n System.out.print(\"Some timezones in Europe: \" + europeanTimezones);\n\n // When does our team in Shanghai have to be ready?\n ZoneId shanghai = ZoneId.of(\"Asia/Shanghai\");\n ZonedDateTime shanghaiStandup = bernStandup.withZoneSameInstant(shanghai);\n System.out.println(\"\\nScrum standup meeting tomorrow in Shanghai: \" + shanghaiStandup); // 15:15\n }", "public void schedule(Context context, int requestCode)\n {\n AlarmManager alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);\n\n int alarmID = 0;\n Days[] days = getDays();\n int routineID = id;\n String routineName = name;\n\n Calendar routineTime = Calendar.getInstance();\n\n try\n {\n routineTime.setTime(Objects.requireNonNull(formatter.parse(time)));\n }\n catch (Exception e)\n {\n e.printStackTrace();\n }\n\n // Schedule for each selected days\n for (Days day : days)\n {\n Calendar scheduleTime = Calendar.getInstance();\n\n // Set current calendar to current system time\n scheduleTime.setTimeInMillis(System.currentTimeMillis());\n scheduleTime.set(Calendar.HOUR_OF_DAY, routineTime.get(Calendar.HOUR_OF_DAY));\n scheduleTime.set(Calendar.MINUTE, routineTime.get(Calendar.MINUTE));\n scheduleTime.set(Calendar.SECOND, 0);\n scheduleTime.set(Calendar.MILLISECOND, 0);\n scheduleTime.set(Calendar.DAY_OF_MONTH, Calendar.DAY_OF_MONTH);\n\n switch(day)\n {\n case Sunday:\n scheduleTime.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY);\n break;\n\n case Monday:\n scheduleTime.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY);\n break;\n\n case Tuesday:\n scheduleTime.set(Calendar.DAY_OF_WEEK, Calendar.TUESDAY);\n break;\n\n case Wednesday:\n scheduleTime.set(Calendar.DAY_OF_WEEK, Calendar.WEDNESDAY);\n break;\n\n case Thursday:\n scheduleTime.set(Calendar.DAY_OF_WEEK, Calendar.THURSDAY);\n break;\n\n case Friday:\n scheduleTime.set(Calendar.DAY_OF_WEEK, Calendar.FRIDAY);\n break;\n\n case Saturday:\n scheduleTime.set(Calendar.DAY_OF_WEEK, Calendar.SATURDAY);\n break;\n }\n\n Log.i(\"Routine\", \"----- Scheduling -----\");\n\n // Check if whether the day selected has passed, if yes then\n // add 7 days into the scheduler\n if (scheduleTime.getTimeInMillis() <= System.currentTimeMillis())\n {\n scheduleTime.add(Calendar.DAY_OF_MONTH, 7);\n Log.i(\"Routine\", \"ADD 7 DAYS\");\n }\n\n // DEBUG LOG\n Log.i(\"Routine\", \"Routine ID : \" + routineID);\n Log.i(\"Routine\", \"Day : \" + scheduleTime.get(Calendar.DAY_OF_WEEK));\n Log.i(\"Routine\", \"Hours : \" + scheduleTime.get(Calendar.HOUR_OF_DAY));\n Log.i(\"Routine\", \"Minutes : \" + scheduleTime.get(Calendar.MINUTE));\n Log.i(\"Routine\", \"DOM : \" + scheduleTime.get(Calendar.DAY_OF_MONTH));\n Log.i(\"Routine\", \"Month : \" + scheduleTime.get(Calendar.MONTH));\n\n // Intent to handle broadcast from alarm manager\n Intent intent = new Intent(context, AlarmBroadcastReceiver.class);\n intent.putExtra(\"Routine ID\", routineID);\n intent.putExtra(\"Routine Name\", routineName);\n\n PendingIntent alarmPendingIntent = PendingIntent.getBroadcast(context, (routineID * 10) + alarmID, intent, 0);\n\n // Routine will always repeating\n int RUN_WEEKLY = 24 * 7 * 60 * 60 * 1000;\n\n switch(requestCode)\n {\n case REQ_ADD_SCHEDULE:\n Log.i(\"Routine\", \"SCHEDULE ACTION ADD\");\n\n // Schedule to alarm manager\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n alarmManager.setExactAndAllowWhileIdle(\n AlarmManager.RTC_WAKEUP,\n scheduleTime.getTimeInMillis(),\n alarmPendingIntent\n );\n }\n else\n {\n alarmManager.setExact(\n AlarmManager.RTC_WAKEUP,\n scheduleTime.getTimeInMillis(),\n alarmPendingIntent\n );\n }\n\n alarmID++;\n break;\n\n case REQ_DELETE_SCHEDULE:\n Log.i(\"Routine\", \"SCHEDULE ACTION REMOVE\");\n alarmManager.cancel(alarmPendingIntent);\n alarmID++;\n break;\n }\n }\n }", "public void generateSchedule(){\r\n DateTimeFormatter formatter = DateTimeFormatter.ofPattern(\"yyyy-MM-dd HH:mm:ss\"); // Date formatter used when getting SQL records\r\n Database db = new Database();\r\n Connection connection = null;\r\n String sql = \"\";\r\n String report = \"\";\r\n \r\n // Retrieve the inputted consultant's id\r\n User user = (User) combo_user.getValue();\r\n int userID = user.getId();\r\n try{\r\n connection = db.jdbc_connection.connect();\r\n Statement statement = connection.createStatement(); // Set up statement\r\n \r\n sql = \"SELECT appointment.appointmentID, customer.customerName, appointment.title, appointment.description, appointment.location, appointment.contact, \" +\r\n \"appointment.type, appointment.url, appointment.start, appointment.end FROM appointment \" +\r\n \"INNER JOIN customer ON appointment.customerID=customer.customerID \" +\r\n \"WHERE userID = \" + userID + \" GROUP BY appointment.start\"; \r\n ResultSet results = statement.executeQuery(sql); \r\n \r\n while(results.next()) { \r\n String customer = results.getString(\"customerName\");\r\n String title = results.getString(\"title\");\r\n String description = results.getString(\"description\");\r\n String location = results.getString(\"location\");\r\n String contact = results.getString(\"contact\");\r\n String type = results.getString(\"type\");\r\n String url = results.getString(\"url\");\r\n String start = results.getString(\"start\");\r\n String end = results.getString(\"end\");\r\n \r\n \r\n // Convert the start and end DATETIMES to the user's current timezone \r\n java.time.LocalDateTime start_converted = convertToCurrentZone(java.time.LocalDateTime.parse(start.replace(\".0\", \"\"), formatter));\r\n String month = start_converted.getMonth().toString();\r\n int day = start_converted.getDayOfMonth();\r\n int hour = start_converted.getHour();\r\n String minute = String.valueOf(start_converted.getMinute());\r\n \r\n if(minute.length() == 1) minute += \"0\"; // Add following zeroes\r\n \r\n report += month + \" \" + day + \" at \" + hour + \":\" + minute + \" - appointment with \" + customer + \"\\n\";\r\n } \r\n }catch(Exception e) {\r\n System.out.println(e.getMessage());\r\n }finally {\r\n try {\r\n connection.close();\r\n } catch (Exception e2) { // Closing databse error handling\r\n System.err.println(e2.getMessage());\r\n }\r\n } \r\n \r\n text_schedule.setText(report);\r\n }", "@Test\n public void testLoanRefundByCashCashBasedAccounting() {\n\n Calendar fourMonthsfromNowCalendar = Calendar.getInstance(Utils.getTimeZoneOfTenant());\n fourMonthsfromNowCalendar.add(Calendar.MONTH, -4);\n\n // FINERACT-885: If the loan starts on day 27-31th of month and not all months have that\n // many days, then loan payment will get reset to a day of month less than today's day\n // and 4th payment will be in the past. In such case, start the loan a few days later,\n // so that 4th payment is guaranteed to be in the future.\n if (fourMonthsfromNowCalendar.get(Calendar.DAY_OF_MONTH) > 27) {\n fourMonthsfromNowCalendar.add(Calendar.DAY_OF_MONTH, 4);\n }\n\n String fourMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n final Integer clientID = ClientHelper.createClient(REQUEST_SPEC, RESPONSE_SPEC);\n ClientHelper.verifyClientCreatedOnServer(REQUEST_SPEC, RESPONSE_SPEC, clientID);\n\n /***\n * Create loan product with Default STYLE strategy\n */\n\n final Account assetAccount = ACCOUNT_HELPER.createAssetAccount();\n final Account incomeAccount = ACCOUNT_HELPER.createIncomeAccount();\n final Account expenseAccount = ACCOUNT_HELPER.createExpenseAccount();\n final Account overpaymentAccount = ACCOUNT_HELPER.createLiabilityAccount();\n\n final Integer loanProductID = createLoanProduct(\"0\", \"0\", LoanProductTestBuilder.DEFAULT_STRATEGY, CASH_BASED, assetAccount,\n incomeAccount, expenseAccount, overpaymentAccount);\n Assertions.assertNotNull(loanProductID);\n\n /***\n * Apply for loan application and verify loan status\n */\n final String savingsId = null;\n final String principal = \"12,000.00\";\n\n // Add charges with payment mode regular\n List<HashMap> charges = new ArrayList<>();\n\n Integer flatInstallmentFee = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanInstallmentJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, \"50\", false));\n addCharges(charges, flatInstallmentFee, \"50\", null);\n\n List<HashMap> collaterals = new ArrayList<>();\n\n final Integer collateralId = CollateralManagementHelper.createCollateralProduct(REQUEST_SPEC, RESPONSE_SPEC);\n\n final Integer clientCollateralId = CollateralManagementHelper.createClientCollateral(REQUEST_SPEC, RESPONSE_SPEC,\n String.valueOf(clientID), collateralId);\n addCollaterals(collaterals, clientCollateralId, BigDecimal.valueOf(1));\n\n final Integer loanID = applyForLoanApplicationWithPaymentStrategyAndPastMonth(clientID, loanProductID, charges, savingsId,\n principal, LoanApplicationTestBuilder.DEFAULT_STRATEGY, -4, collaterals);\n Assertions.assertNotNull(loanID);\n HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);\n\n LOG.info(\"-----------------------------------APPROVE LOAN-----------------------------------------\");\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.approveLoan(fourMonthsfromNow, loanID);\n LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);\n LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap);\n\n LOG.info(\"-------------------------------DISBURSE LOAN-------------------------------------------\");\n String loanDetails = LOAN_TRANSACTION_HELPER.getLoanDetails(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.disburseLoanWithNetDisbursalAmount(fourMonthsfromNow, loanID,\n JsonPath.from(loanDetails).get(\"netDisbursalAmount\").toString());\n LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);\n\n final JournalEntry[] assetAccountInitialEntry = {\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.DEBIT) };\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, fourMonthsfromNow, assetAccountInitialEntry);\n\n ArrayList<HashMap> loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"2290\", String.valueOf(firstInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #1\n\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String threeMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(threeMonthsfromNow, Float.parseFloat(\"2290\"), loanID);\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"0.00\", String.valueOf(firstInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #2\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String twoMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(twoMonthsfromNow, Float.parseFloat(\"2290\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, twoMonthsfromNow,\n new JournalEntry(Float.parseFloat(\"2290\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"2000\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, twoMonthsfromNow,\n new JournalEntry(Float.parseFloat(\"50\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"240\"), JournalEntry.TransactionType.CREDIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n Map secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"0.00\", String.valueOf(secondInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #3\n // Pay 2290 more than expected\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String oneMonthfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(oneMonthfromNow, Float.parseFloat(\"4580\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, oneMonthfromNow,\n new JournalEntry(Float.parseFloat(\"4580\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"4000\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, oneMonthfromNow,\n new JournalEntry(Float.parseFloat(\"100\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"480\"), JournalEntry.TransactionType.CREDIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap thirdInstallment = loanSchedule.get(3);\n validateNumberForEqual(\"0.00\", String.valueOf(thirdInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make refund of 20\n // max 2290 to refund. Pay 20 means only principal\n // Default style refund order(principal, interest, fees and penalties\n // paid: principal 2000, interest 240, fees 50, penalty 0\n // refund 20 means paid: principal 1980, interest 240, fees 50, penalty\n // 0\n\n // FINERACT-885: As loan may not have started exactly four months ago,\n // make final payment today and not four months from start (as that may be in the future)\n fourMonthsfromNowCalendar.setTime(Date.from(Utils.getLocalDateOfTenant().atStartOfDay(Utils.getZoneIdOfTenant()).toInstant()));\n final String now = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRefundByCash(now, Float.parseFloat(\"20\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, now,\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.DEBIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"principalOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"interestOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"feeChargesOutstanding\")));\n\n // Make refund of 2000\n // max 2270 to refund. Pay 2000 means only principal\n // paid: principal 1980, interest 240, fees 50, penalty 0\n // refund 2000 means paid: principal 0, interest 220, fees 50, penalty 0\n\n LOAN_TRANSACTION_HELPER.makeRefundByCash(now, Float.parseFloat(\"2000\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, now,\n new JournalEntry(Float.parseFloat(\"2000\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"1980\"), JournalEntry.TransactionType.DEBIT));\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, now,\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.DEBIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"2020.00\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n validateNumberForEqual(\"2000.00\", String.valueOf(fourthInstallment.get(\"principalOutstanding\")));\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"interestOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"feeChargesOutstanding\")));\n\n }", "public FreeTime() {}", "public static void main(String[] args) {\n\n\t\t SimpleDateFormat sf = new SimpleDateFormat(\"yyyyMMddHHmmssSSS\");\n\t\t// for(int i=0; i<100; i++) {\n\t\t// String strDT = sf.format(new Date(System.currentTimeMillis()));\n\t\t// System.out.println(strDT);\n\t\t// }\n\n\t\t\n\t\tDate oldDate = new Date();\n\t\tCalendar gcal = new GregorianCalendar();\n\t\tgcal.setTime(oldDate);\n\t\tgcal.add(Calendar.SECOND, -4468);\n\t\tDate newDate = gcal.getTime();\n\t\tSystem.out.println(sf.format(oldDate));\n\t\tSystem.out.println(sf.format(newDate));\n\t}", "@Override\n\tpublic String getDailyWorkout() {\n\t\treturn \"Start Running the ground with 5 times\";\n\t}", "@Override\n public void run() {\n createScheduleFile();\n createWinnerScheduleFile();\n }", "ShipmentTimeEstimate createShipmentTimeEstimate();", "public static void main(String[] args) {\n\t\tMyTaskA a=new MyTaskA();\n\t\tMyTask task=new MyTask();\n\t\tCalendar ca=Calendar.getInstance();\n\t\tca.add(Calendar.SECOND, 10);\n\t\tCalendar ca1=Calendar.getInstance();\n\t\tca1.add(Calendar.SECOND, 11);\n\t\tSystem.out.println(\"计划执行时间为:\"+ca.getTime());\n\t\tSystem.out.println(\"计划执行时间为:\"+ca1.getTime());\n\t\tTimer t=new Timer();\n\t\tt.schedule(a, ca.getTime());\n\t\tt.schedule(task, ca1.getTime(),4000);\n\t\t\n\t}", "public void testPeriodic() {\r\n \r\n }", "protected abstract String scheduler_next();", "@Override\r\n public LocalDateTime bake_350degrees(LocalDateTime time) {\r\n System.out.println(\"Baking \"+quantity+\" batch(es) of cookies\");\r\n for(int count = 1; count <= quantity; count++) {\r\n \t time = time.plusMinutes(20);\r\n }\r\n return time;\r\n }", "public static void simulate (\r\n double maxtime,\r\n double arrival_rate,\r\n double service_rate0,\r\n double service_rate1,\r\n double service_rate2, \r\n double service_rate3_1,\r\n double service_rate3_2,\r\n double service_rate3_3,\r\n double p1,double p2,double p3,int k, double p01, double p02, double p3out, double p31, double p32)\r\n {\n StateB sysB = new StateB();\r\n \r\n double time= 0;\r\n double value2= ExpB.getExp(arrival_rate);\r\n\r\n EventB e1 = new EventB(time+value2,\"Birth\",\"Null\");\r\n EventB e2= new EventB(time+value2,\"Moniter\",\"Null\");\r\n Schedule.add(e1);\r\n Schedule.add(e2);\r\n \r\n while(time < maxtime){\r\n EventB next = Schedule.remove();\r\n time= next.time;\r\n next.function(maxtime,arrival_rate,service_rate0,service_rate1,service_rate2, service_rate3_1,\r\n service_rate3_2,service_rate3_3,p1,p2,p3,k,p01,p02,p3out,p31,p32,sysB);\r\n \r\n \r\n \r\n\r\n }\r\n // System.out.println(Double.toString(sysB.t_busy_time0) );\r\n // System.out.println(Double.toString(sysB.t_busy_time1) );\r\n // System.out.println(Double.toString(sysB.Qlength0) );\r\n // System.out.println(Double.toString(sysB.Qlength1) );\r\n // System.out.println(Double.toString(sysB.monitering_event) );\r\n // System.out.println(Double.toString(sysB.num_drop) );\r\n // System.out.println(Double.toString(sysB.completed_request) );\r\n // System.out.println(Double.toString(sysB.t_response_time) );\r\n\r\n System.out.println();\r\n double util0 = sysB.t_busy_time0 / maxtime;\r\n System.out.println(\"S0 UTIL:\"+ \" \" + Double.toString(util0) );\r\n double qlen0 = sysB.Qlength0/ sysB.monitering_event;\r\n System.out.println(\"S0 QLEN:\"+\" \"+ Double.toString(qlen0) );\r\n double Tresp0 = sysB.t_response_time0/sysB.completed_request0;\r\n System.out.println(\"S0 TRESP:\" + \" \"+ Double.toString(Tresp0) );\r\n \r\n System.out.println();\r\n \r\n double util11 = sysB.t_busy_time11/ maxtime;\r\n System.out.println(\"S1,1 UTIL:\"+ \" \" + Double.toString(util11) );\r\n double util12 = sysB.t_busy_time12/ maxtime;\r\n System.out.println(\"S1,2 UTIL:\"+ \" \" + Double.toString(util12) );\r\n double qlen11 = sysB.Qlength1/ sysB.monitering_event;\r\n System.out.println(\"S1 QLEN:\"+\" \"+ Double.toString(qlen11) );\r\n double Tresp11 = sysB.t_response_time1/ sysB.completed_request1;\r\n System.out.println(\"S1 TRESP:\" + \" \"+ Double.toString(Tresp11) );\r\n \r\n \r\n // System.out.println();\r\n // double util12 = sysB.t_busy_time12/ maxtime;\r\n // System.out.println(\"S1,2 UTIL:\"+ \" \" + Double.toString(util12) );\r\n // double qlen12 = sysB.Qlength1/ sysB.monitering_event;\r\n // System.out.println(\"S1,2 QLEN:\"+\" \"+ Double.toString(qlen12) );\r\n // double Tresp12 = sysB.t_response_time12/sysB.completed_request12;\r\n // System.out.println(\"S1,2 TRESP:\" + \" \"+ Double.toString(Tresp12) );\r\n\r\n System.out.println();\r\n double util2 = sysB.t_busy_time2/ maxtime;\r\n System.out.println(\"S2 UTIL:\"+ \" \" + Double.toString(util2) );\r\n double qlen2 = sysB.Qlength2/ sysB.monitering_event;\r\n System.out.println(\"S2 QLEN:\"+\" \"+ Double.toString(qlen2) );\r\n double Tresp2 = sysB.t_response_time2/sysB.completed_request2;\r\n System.out.println(\"S2 TRESP:\" + \" \"+ Double.toString(Tresp2) );\r\n System.out.println(\"S2 DROPPED:\" + \" \"+ Integer.toString(sysB.num_drop));\r\n\r\n System.out.println();\r\n double util3 = sysB.t_busy_time3/ maxtime;\r\n System.out.println(\"S3 UTIL:\"+ \" \" + Double.toString(util3) );\r\n double qlen3 = sysB.Qlength3/ sysB.monitering_event;\r\n System.out.println(\"S3 QLEN:\"+\" \"+ Double.toString(qlen3) );\r\n double Tresp3 = sysB.t_response_time3/sysB.completed_request3;\r\n System.out.println(\"S3 TRESP:\" + \" \"+ Double.toString(Tresp3) );\r\n\r\n \r\n\r\n System.out.println();\r\n\r\n double qtotal = (sysB.Qlength0 + sysB.Qlength1 + sysB.Qlength2+sysB.Qlength3) / sysB.monitering_event;\r\n System.out.println(\"QTOT:\"+\" \"+ Double.toString(qtotal) );\r\n // double Totalresp= sysB.t_response_time0 + sysB.t_response_time2 +sysB.t_response_time11 +sysB.t_response_time12 + sysB.t_response_time3;\r\n \r\n double total = sysB.t_response_timefinal/sysB.completed_system;\r\n \r\n System.out.println(\"TRESP:\"+ \" \" + Double.toString(total));\r\n // System.out.println(sysB.Qlength1);\r\n // System.out.println(sysB.Qlength2);\r\n // System.out.println(sysB.Qlength3);\r\n // System.out.println(sysB.Qlength0);\r\n \r\n // System.out.println(\"TRESP:\"+ \" \" + Double.toString(TTRESP));\r\n \r\n \r\n\r\n\r\n\r\n\r\n\r\n }", "private String makeEventRecurrence(LocalDateTime lastDay) {\n return \"RRULE:FREQ=WEEKLY;UNTIL=\" + formatTimeToICS(lastDay) + \"Z\" + \"\\n\";\n }", "private String generateCronExp() {\n LocalDate now = LocalDate.now();\n\n return String.format(\"0 0 0 %s %s ? %s\", now.getDayOfMonth() - 1, now.getMonthOfYear(),\n now.getYear());\n }", "@Scheduled(cron = \"0 * * * * ?\")\r\n public void cronJobSch() {\r\n SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss.SSS\");\r\n Date now = new Date();\r\n String strDate = sdf.format(now);\r\n System.out.println(\"Java cron job expression:: \" + strDate);\r\n }", "String makeNewSleep(){\n\t\tbeginSleepTime = new SimpleDateFormat(\"HH:mm\").format(new Date());\n\t\treturn beginSleepTime;\n\t}", "@Test\n\tpublic void test02() throws Throwable {\n\t\tint startHour=-15;\n\t\tint startMinute=30;\n\t\tint startDay=11;\n\t\tint startMonth=4;\n\t\tint startYear=2017;\n\t\tString title=\"Birthday Party\";\n\t\tString description=\"This is my birthday party.\";\n\t\t//Construct a new Appointment object with the initial data\n\t\tAppt appt1 = new Appt(startHour,\n\t\t\t\tstartMinute ,\n\t\t\t\tstartDay ,\n\t\t\t\tstartMonth ,\n\t\t\t\tstartYear ,\n\t\t\t\ttitle,\n\t\t\t\tdescription);\n\t\t// create another appointment\n\t\tstartHour=14;\n\t\tstartMinute=30;\n\t\tstartDay=11;\n\t\tstartMonth=4;\n\t\tstartYear=2017;\n\t\ttitle=\"Class\";\n\t\tdescription=\"Rescheduled class.\";\n\t\t//Construct a new Appointment object with the initial data\n\t\tAppt appt2 = new Appt(startHour,\n\t\t\t\tstartMinute ,\n\t\t\t\tstartDay ,\n\t\t\t\tstartMonth ,\n\t\t\t\tstartYear ,\n\t\t\t\ttitle,\n\t\t\t\tdescription);\n\t\t// create another appointment\n\t\tstartHour=13;\n\t\tstartMinute=30;\n\t\tstartDay=11;\n\t\tstartMonth=4;\n\t\tstartYear=2017;\n\t\ttitle=\"Meeting Today\";\n\t\tdescription=\"Meeting with the students.\";\n\t\t//Construct a new Appointment object with the initial data\n\t\tAppt appt3 = new Appt(startHour,\n\t\t\t\tstartMinute ,\n\t\t\t\tstartDay ,\n\t\t\t\tstartMonth ,\n\t\t\t\tstartYear ,\n\t\t\t\ttitle,\n\t\t\t\tdescription);\n\t\t//Create CalDay objects\n\t\tCalDay today = new CalDay (new GregorianCalendar(2017,4,11));\n\t\t//Set the calender appointments\n\t\ttoday.addAppt(appt1);\n\t\ttoday.addAppt(appt2);\n\t\ttoday.addAppt(appt3);\n\t\t//Assertions\n\t\tassertTrue(today.isValid());\n\t\tassertEquals(11, today.getDay());\n\t\tassertEquals(4, today.getMonth());\n\t\tassertEquals(2017, today.getYear());\n\t\tassertEquals(2, today.getSizeAppts());\n\t\tassertEquals(\"\\t --- 4/11/2017 --- \\n\" +\n\t\t\t\t\" --- -------- Appointments ------------ --- \\n\" +\n\t\t\t\t\"\\t4/11/2017 at 1:30pm ,Meeting Today, Meeting with the students.\\n\" +\n\t\t\t\t\" \\t4/11/2017 at 2:30pm ,Class, Rescheduled class.\\n\" +\n\t\t\t\t\" \\n\", today.toString());\n\t}", "public Loan() {\n this(2.5, 1, 1000);\n }", "@Override\r\n public void periodic() {\n\r\n }", "private long generateTime(int... times)\n\t{\n\t\tlong time = 0;\n\t\tlong[] constants =\n\t\t{ 1000, 1000 * 60, 1000 * 60 * 60, 1000 * 60 * 60 * 24 };\n\t\tint roof = Math.min(times.length, 4);\n\t\tfor (int i = 0; i < roof; i++)\n\t\t{\n\t\t\ttime += times[i] * constants[i];\n\t\t}\n\t\treturn time;\n\t}", "@Test\n public void radnomtest() throws Throwable {\n\n long startTime = Calendar.getInstance().getTimeInMillis();\n long elapsed = Calendar.getInstance().getTimeInMillis() - startTime;\n\n\n System.out.println(\"Start testing...\");\n\n\n for (int iteration = 0; elapsed < TestTimeout; iteration++) {\n long randomseed =10;//System.currentTimeMillis();\n //\t\t\tSystem.out.println(\" Seed:\"+randomseed );\n Random random = new Random(randomseed);\n\n int startHour=13;\n int startMinute=30;\n int startDay=10;\n int startMonth=4;\n int startYear=2017;\n String title=\"Birthday Party\";\n String description=ValuesGenerator.getString(random);\n //Construct a new Appointment object with the initial data\t \n Appt appt = new Appt(startHour,\n startMinute ,\n startDay ,\n startMonth ,\n startYear ,\n title,\n description);\n if ((iteration % 50) == 0){\n appt.setDescription(null);\n }\n for (int i = 0; i < NUM_TESTS; i++) {\n String methodName = ApptRandomTest.RandomSelectMethod(random);\n if (methodName.equals(\"isValid\")){\n int hour=(int) ValuesGenerator.getRandomIntBetween(random, 0, 23);\n appt.setStartHour(hour);\t\t\t\t\t\t \n int minute=(int) ValuesGenerator.getRandomIntBetween(random, 0, 59);\n appt.setStartMinute(minute);\t\t\t\t\t\t \n int day=(int) ValuesGenerator.getRandomIntBetween(random, 1, 31);\n appt.setStartDay(day);\t\t\t\t\t\t \n int month=(int) ValuesGenerator.getRandomIntBetween(random, 1, 12);\n appt.setStartMonth(month);\n //change to invalid hours\n hour=(int) ValuesGenerator.getRandomIntBetween(random, -10, -1);\n appt.setStartHour(hour);\n hour=(int) ValuesGenerator.getRandomIntBetween(random, 0, 23);\n appt.setStartHour(hour);\n hour=(int) ValuesGenerator.getRandomIntBetween(random, 24, 30);\n appt.setStartHour(hour);\n hour=(int) ValuesGenerator.getRandomIntBetween(random, 0, 23);\n appt.setStartHour(hour);\n //change to invalid minutes\n minute=(int) ValuesGenerator.getRandomIntBetween(random, -20, -1);\n appt.setStartMinute(minute);\n minute=(int) ValuesGenerator.getRandomIntBetween(random, 0, 59);\n appt.setStartMinute(minute);\n minute=(int) ValuesGenerator.getRandomIntBetween(random, 60, 70);\n appt.setStartMinute(minute);\n minute=(int) ValuesGenerator.getRandomIntBetween(random, 0, 59);\n appt.setStartMinute(minute);\n //change to invalid days\n day=(int) ValuesGenerator.getRandomIntBetween(random, -10, 0);\n appt.setStartDay(day);\n day=(int) ValuesGenerator.getRandomIntBetween(random, 1, 31);\n appt.setStartDay(day);\n day=(int) ValuesGenerator.getRandomIntBetween(random, 32, 40);\n appt.setStartDay(day);\n day=(int) ValuesGenerator.getRandomIntBetween(random, 1, 31);\n appt.setStartDay(day);\n //change to invalid months\n month=(int) ValuesGenerator.getRandomIntBetween(random, -10, 0);\n appt.setStartMonth(month);\t\t\t\t\t\t \n month=(int) ValuesGenerator.getRandomIntBetween(random, 1, 12);\n appt.setStartMonth(month);\n month=(int) ValuesGenerator.getRandomIntBetween(random, 12, 20);\n appt.setStartMonth(month);\n month=(int) ValuesGenerator.getRandomIntBetween(random, 1, 12);\n appt.setStartMonth(month);\n }\n\n }\n\n elapsed = (Calendar.getInstance().getTimeInMillis() - startTime);\n if((iteration%10000)==0 && iteration!=0 )\n System.out.println(\"elapsed time: \"+ elapsed + \" of \"+TestTimeout);\n\n }\n\n\n System.out.println(\"Done testing...\");\n }", "default void periodic()\n {\n // no-op\n }", "private void initialize(){\n// Schedule initializeList1, initializeList2, initializeList3, initializeList4,initializeList5,\n// initializeList6,initializeList7,initializeList8,initializeList9,\n// initializeList10,initializeList11,initializeList12,initializeList13,\n// initializeList14,initializeList15,initializeList16,initializeList17,\n// initializeList18,initializeList19,initializeList20,initializeList21,initializeList22;\n// initializeList1= new Schedule(\"A001\",\"LimKH\", 1629,\"A01\", \"pewdiepie\", \"0162313212\", \"Delivering\",\"5min\");\n// initializeList2= new Schedule(\"A002\",\"LimKW\", 1111,\"A02\", \"MsTingTT\", \"012432434\", \"Delivering\",\"5min\");\n// initializeList3= new Schedule(\"A003\",\"LowSK\",3456, \"A03\", \"AhLiao\", \"01312321213\", \"Delivering\",\"5min\");\n// initializeList4= new Schedule(\"A004\",\"NgWD\",9909, \"A04\", \"Kazuma\", \"015213797\", \"Delivering\",\"5min\"); \n// initializeList5= new Schedule(\"A005\",\"LooJW\",1233,\"A05\",\"Kalima\",\"01124356\",\"Delivering\",\"5min\");\n// initializeList6= new Schedule(\"A006\",\"LimJJ\",1012,\"A06\", \"LeongFoei\", \"01239909\", \"Delivering\",\"5min\");\n// initializeList7= new Schedule(\"A007\",\"MahHW\",3757,\"A07\",\"KongKong\",\"012283747\",\"Delivering\",\"5min\");\n// initializeList8= new Schedule(\"A008\",\"LoiKH\",9610,\"A08\",\"MigMing\",\"012636383\",\"Delivering\",\"5min\"); \n// initializeList9= new Schedule(\"A009\",\"LimNF\",5566,\"A09\",\"MsTing\",\"0192726363\",\"Delivering\",\"5min\");\n// initializeList10= new Schedule(\"A010\",\"LohKC\",6969,\"A10\",\"KitKat\",\"017265353\",\"Delivering\",\"5min\");\n// \n// initializeList11= new Schedule(\"A011\",\"LimKH\", 1629,\"A11\", \"Kari\", \"012213778\", \"Delivering\",\"5min\");\n// initializeList12= new Schedule(\"A012\",\"LimKW\", 1111,\"A12\", \"Yolo\", \"0162328212\", \"Delivering\",\"5min\");\n// initializeList13= new Schedule(\"A013\",\"LowSK\", 3456,\"A13\", \"Hahaha\", \"0198377213\", \"Delivering\",\"5min\");\n// initializeList14= new Schedule(\"A015\",\"LowSK\", 3456,\"A14\", \"Hahaha\", \"0198377213\", \"Delivering\",\"5min\");\n// initializeList15= new Schedule(\"A016\",\"LooJW\", 1233,\"A15\", \"Hahaha\", \"0198377213\", \"Delivering\",\"5min\");\n// initializeList16= new Schedule(\"A017\",\"LimJJ\", 1012,\"A16\", \"Hahaha\", \"0198377213\", \"Delivering\",\"5min\");\n// initializeList17= new Schedule(\"A018\",\"LimJJ\", 1012,\"A17\", \"Hahaha\", \"0198377213\", \"Delivering\",\"5min\");\n// initializeList18= new Schedule(\"A019\",\"LoiKH\", 9610,\"A18\", \"Hahaha\", \"0198377213\", \"Delivering\",\"5min\");\n// initializeList19= new Schedule(\"A020\",\"LimNF\", 5566,\"A19\", \"Hahaha\", \"0198377213\", \"Delivering\",\"5min\");\n// initializeList20= new Schedule(\"A021\",\"LimNF\", 5566,\"A20\", \"Hahaha\", \"0198377213\", \"Delivering\",\"5min\");\n// \n// //completed jobs\n// initializeList21= new Schedule(\"A022\",\"LimKH\", 1629,\"A21\", \"Doggo\", \"0198377213\", \"Completed\",\"5min\");\n// initializeList22= new Schedule(\"A023\",\"LimKH\", 1629,\"A22\", \"Cloud\", \"0198377213\", \"Completed\",\"5min\");\n// scheduleList.addSchedule(initializeList1);\n// scheduleList.addSchedule(initializeList2);\n// scheduleList.addSchedule(initializeList3);\n// scheduleList.addSchedule(initializeList4);\n// scheduleList.addSchedule(initializeList5);\n// scheduleList.addSchedule(initializeList6);\n// scheduleList.addSchedule(initializeList7);\n// scheduleList.addSchedule(initializeList8);\n// scheduleList.addSchedule(initializeList9);\n// scheduleList.addSchedule(initializeList10);\n// scheduleList.addSchedule(initializeList11);\n// scheduleList.addSchedule(initializeList12);\n// scheduleList.addSchedule(initializeList13);\n// scheduleList.addSchedule(initializeList14);\n// scheduleList.addSchedule(initializeList15);\n// scheduleList.addSchedule(initializeList16);\n// scheduleList.addSchedule(initializeList17); \n// scheduleList.addSchedule(initializeList18);\n// scheduleList.addSchedule(initializeList19);\n// scheduleList.addSchedule(initializeList20);\n// scheduleList.addSchedule(initializeList21);\n// scheduleList.addSchedule(initializeList22);\n \n \n\n for(int i = 0; i<scheduleList.getNumberOfSchedule();i++){\n int staff = scheduleList.getSchedule(i).getStaffID();\n jcbDeliveryman.addItem(staff);\n \n String order = scheduleList.getSchedule(i).getOrderID();\n jcbOrderNo.addItem(order);\n\n }\n \n \n// jcbDeliveryman.addActionListener(jcbOrderNo);\n// for(int i = 0; i<scheduleList.getNumberOfSchedule();i++){\n// jcbOrderNo.addItem(scheduleList.getSchedule(i).getOrderID());\n// }\n }", "public static void main(String[] args) {\n\t\tJobDetail job = JobBuilder.newJob(TimeJob.class).withIdentity(\"Time INfo\", \"group1\").build();\n\t\t// Create a trigger with identity\n\t\tTrigger trigger = TriggerBuilder.newTrigger().withIdentity(\"triggerINfo\", \"group1\")\n\t\t\t\t.withSchedule(SimpleScheduleBuilder.simpleSchedule().withIntervalInSeconds(5).repeatForever()).build();\n\t\t// Tie both Job and trigger to a scheduler\n\t\tScheduler scheduler;\n\t\ttry {\n\t\t\tscheduler = new StdSchedulerFactory().getScheduler();\n\t\t\tscheduler.start();\n\t\t\tscheduler.scheduleJob(null, trigger);\n\t\t} catch (SchedulerException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t}" ]
[ "0.7396723", "0.64071214", "0.6215945", "0.61795986", "0.5893254", "0.58477527", "0.5815326", "0.5812862", "0.57614917", "0.574428", "0.56554496", "0.5596532", "0.5562036", "0.55514026", "0.5505254", "0.54858595", "0.54722834", "0.5458162", "0.54384077", "0.5401259", "0.54010004", "0.5396975", "0.5373091", "0.537224", "0.53717256", "0.5359323", "0.53459376", "0.53311104", "0.53266084", "0.5323729", "0.5322914", "0.5299443", "0.5299419", "0.5278797", "0.5258049", "0.52530164", "0.5248782", "0.5248341", "0.52462965", "0.5235102", "0.5230643", "0.52298373", "0.5228289", "0.52251375", "0.522479", "0.520766", "0.5202148", "0.5200761", "0.51926464", "0.51815945", "0.51775664", "0.517702", "0.51683766", "0.5167531", "0.51647174", "0.51644176", "0.5162567", "0.51622814", "0.5152206", "0.51374245", "0.513679", "0.51328516", "0.51299864", "0.5126955", "0.51241505", "0.5121907", "0.51201403", "0.5102965", "0.50885385", "0.50872904", "0.5085533", "0.5082454", "0.50754", "0.5069471", "0.50598466", "0.5051198", "0.5047979", "0.5046652", "0.50456786", "0.5044905", "0.5021771", "0.5005161", "0.49808466", "0.49758294", "0.49755996", "0.49692813", "0.49692556", "0.49624455", "0.49561805", "0.49415395", "0.49400383", "0.49396202", "0.49395195", "0.49362767", "0.49332806", "0.493149", "0.4930669", "0.4926879", "0.49259147", "0.49193612" ]
0.65303355
1
SimpleDateFormat formatter = new SimpleDateFormat("ddMMyyyy");
public static void main(String args[]) { System.out.println(new EazyCoopUtility().deriveBranchCode("3")); DateFormat formatter = new SimpleDateFormat("dd/MM/yyyy"); try { System.out.println(formatter.parse("01/09/2015")); } catch (ParseException e) { // TODO Auto-generated catch block e.printStackTrace(); } String dateInString = "07/06/2013"; try { java.util.Date date = formatter.parse(dateInString); System.out.println(date); System.out.println(formatter.format(date)); } catch (ParseException e) { e.printStackTrace(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static String getYYYYMMDD()\r\n/* 65: */ {\r\n/* 66: 81 */ String nowTime = \"\";\r\n/* 67: 82 */ Date now = new Date();\r\n/* 68: 83 */ SimpleDateFormat formatter = new SimpleDateFormat(\"yyyyMMdd\");\r\n/* 69: 84 */ nowTime = formatter.format(now);\r\n/* 70: 85 */ return nowTime;\r\n/* 71: */ }", "private String YYYYMMDD(String str) {\n\t\tString[] s = str.split(\"/\");\n\t\treturn s[0] + parseToTwoInteger(Integer.parseInt(s[1].trim())) + parseToTwoInteger(Integer.parseInt(s[2].trim()));\n\t}", "public static String getDate() {\n\t\tDate date = new Date();\n\t\tSimpleDateFormat formatter = new SimpleDateFormat(\"ddMMYYYY\");\n\t\tString strDate = formatter.format(date);\n\t\treturn strDate;\n\t}", "private static String getDateStr() {\n\t\tDate date = Calendar.getInstance().getTime();\n\t\tDateFormat dateFormat = new SimpleDateFormat(\"MMddyyy\");\n\t\tString dateStr = dateFormat.format(date);\n\t\treturn dateStr;\n\t}", "public static String getddmmyyDate(String dt) {\n String dd = \"\", mm = \"\", yy = \"\";\n int i = 0;\n try {\n for (String retval : dt.split(\"-\")) {\n if (i == 0)\n yy = retval;\n else if (i == 1)\n mm = retval;\n else\n dd = retval;\n\n i++;\n }\n return (yy + \"-\" + mm + \"-\" + dd).toString();\n } catch (Exception e) {\n e.printStackTrace();\n return \"\";\n }\n }", "public static String dateToString(Date date){\n\t\tSimpleDateFormat formatter = new SimpleDateFormat(\"MMddyy\");\n\t\treturn formatter.format(date);\n\t}", "private static String convertToDDMMYYYY(Date date) {\n\t\tString returnStr = \"\";\n\t\ttry {\n\t\tDateFormat format1 = new SimpleDateFormat(\"dd/MM/yyyy\");\n\t\treturnStr = format1.format(date);\n\t\t\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn returnStr;\n\t}", "public static Date getFirstDate(Date date ) throws ParseException{ \n\t\tString format = \"yyyyMM\";\n\t\tdate = formatStrtoDate( format(date, format) + \"01\", format + \"dd\");\n\t\treturn date;\n\t}", "@Test public void Day_1__month__year()\t\t\t\t\t\t\t{tst_date_(\"03-31-02\"\t\t\t\t, \"2002-03-31\");}", "@Test public void Month_name_1__year__day()\t\t\t\t\t{tst_date_(\"2001 Mar 02\"\t\t\t, \"2001-03-02\");}", "public static String ddmmyyyyToyyyymmddd(String strDate) {\n DateFormat formatter = new SimpleDateFormat(\"dd-MM-yyyy\");\n Date date = null;\n try {\n date = (Date) formatter.parse(strDate);\n } catch (ParseException e) {\n e.printStackTrace();\n }\n SimpleDateFormat newFormat = new SimpleDateFormat(\"yyyy-MM-dd\");\n String finalString = newFormat.format(date);\n return finalString;\n }", "public static void main(String[] args) {\n\t\t LocalDate ldt = LocalDate.of(2016,12,21);\n DateTimeFormatter format = DateTimeFormatter.ofPattern(\"yyyy-MMM-dd\");\n DateTimeFormatter format1 = DateTimeFormatter.ofPattern(\"YYYY-mmm-dd\");\n System.out.println(ldt.format(format));\n System.out.println(ldt.format(format1));\n\t}", "@Test public void Month_name_1__day__year__guess()\t\t\t\t{tst_date_(\"02 Mar 01\"\t\t\t\t, \"2001-03-02\");}", "public String getDDMMMYYYYDate(String date) throws Exception {\n HashMap<Integer, String> month = new HashMap<Integer, String>();\n month.put(1, \"Jan\");\n month.put(2, \"Feb\");\n month.put(3, \"Mar\");\n month.put(4, \"Apr\");\n month.put(5, \"May\");\n month.put(6, \"Jun\");\n month.put(7, \"Jul\");\n month.put(8, \"Aug\");\n month.put(9, \"Sep\");\n month.put(10, \"Oct\");\n month.put(11, \"Nov\");\n month.put(12, \"Dec\");\n\n try {\n String[] dtArray = date.split(\"-\");\n return dtArray[1] + \"-\" + month.get(Integer.parseInt(dtArray[1])) + \"-\" + dtArray[0];\n } catch (Exception e) {\n throw new Exception(\"getDDMMMYYYYDate : \" + date + \" : \" + e.toString());\n }\n\n }", "@Test public void Year_2__month__day()\t\t\t\t\t\t\t{tst_date_(\"03/31/2001\"\t\t\t\t, \"2001-03-31\");}", "@Test public void Month_name_1__day__year()\t\t\t\t\t{tst_date_(\"2 Mar 2001\"\t\t\t\t, \"2001-03-02\");}", "@Test public void Year_0__month__day()\t\t\t\t\t\t\t{tst_date_(\"2001-03-31\"\t\t\t\t, \"2001-03-31\");}", "public String toString() { //toString method\n String startDateString2= \"\"; //Initialize\n try{\n Date date1 = new SimpleDateFormat(\"yyyyMMdd\").parse(full_Date);\n DateFormat df2 = new SimpleDateFormat(\"MMM dd, yyyy\");\n startDateString2 = df2.format(date1);\n \n return startDateString2;\n }catch(ParseException e){\n e.printStackTrace();\n }\n return startDateString2;\n \n}", "private String makeDateString(int day, int month, int year) {\n String str_month = \"\" + month;\n String str_day = \"\" + day;\n if (month < 10) {\n str_month = \"0\" + month;\n }\n if (day < 10) {\n str_day = \"0\" + day;\n }\n return year + \"-\" + str_month + \"-\" + str_day;\n }", "public static Date strToDate(String strDate)\r\n/* 127: */ {\r\n/* 128:178 */ SimpleDateFormat formatter = new SimpleDateFormat(\"yyyyMMdd\");\r\n/* 129:179 */ ParsePosition pos = new ParsePosition(0);\r\n/* 130:180 */ Date strtodate = formatter.parse(strDate, pos);\r\n/* 131:181 */ return strtodate;\r\n/* 132: */ }", "java.lang.String getStartDateYYYYMMDD();", "private static String getDate() {\n Scanner input = new Scanner(System.in);\n\n String monthName = input.next();\n int month = monthNum(monthName);\n int day = input.nextInt();\n String date = \"'2010-\" + month + \"-\" + day + \"'\";\n return date;\n }", "public static String yyyymmdddToddmmyyyy(String strDate) {\n DateFormat formatter = new SimpleDateFormat(\"yyyy-MM-dd\");\n Date date = null;\n try {\n date = (Date) formatter.parse(strDate);\n } catch (ParseException e) {\n e.printStackTrace();\n }\n SimpleDateFormat newFormat = new SimpleDateFormat(\"dd-MM-yyyy\");\n String finalString = newFormat.format(date);\n return finalString;\n }", "public static Date parseDateYYYYMMDD(String val) {\n\n\t\tDate d = null;\n\n\t\tif (val != null && !val.equals(\"0\")) {\n\t\t\tSimpleDateFormat format = new SimpleDateFormat(\"yyyy-MM-dd\");\n\t\t\ttry {\n\t\t\t\td = format.parse(val);\n\t\t\t} catch (ParseException e) {\n\t\t\t}\n\t\t}\n\n\t\treturn d;\n\n\t}", "public static String formatDate(Date date) {\n\t\tString newstring = new SimpleDateFormat(\"MM-dd-yyyy\").format(date);\n\t\treturn newstring;\n\t}", "public String checkDateMonth(Date aDate){\n if (aDate.getMonth() < 10) {\r\n String newDate = \"0\" + Integer.toString(aDate.getMonth()+1);\r\n \r\n return newDate;\r\n }\r\n return Integer.toString(aDate.getMonth());\r\n \r\n }", "public String changeDateFormat(String dateStr) {\n String inputPattern = \"MMM-dd-yyyy\";\n String outputPattern = \"MMMM dd, yyyy\";\n SimpleDateFormat inputFormat = new SimpleDateFormat(inputPattern);\n SimpleDateFormat outputFormat = new SimpleDateFormat(outputPattern);\n\n Date date = null;\n String str = null;\n\n try {\n date = inputFormat.parse(dateStr);\n str = outputFormat.format(date);\n } catch (ParseException e) {\n e.printStackTrace();\n }\n return str;\n\n }", "public static String dateStr(String input ){\n String mm = input.substring(0,2);\n String dd = input.substring(3,5);\n String yyyy = input.substring(6,10);\n return dd + \" - \" + mm + \" - \" + yyyy;\n }", "public static String getYearAndMonth(Date date){\r\n SimpleDateFormat df = new SimpleDateFormat(\"yyyy,MM\"); //EX 2016,02\r\n return df.format(date);\r\n }", "public static String dateStr(String str)\n {\n String month = str.split(\"/\")[0];\n String day = str.split(\"/\")[1];\n String year = str.split(\"/\")[2];\n return day + \"-\" + month + \"-\" + year;\n }", "public static String date_d(String sourceDate,String format) throws ParseException {\n SimpleDateFormat sdf_ = new SimpleDateFormat(\"yyyy-MM-dd\");\n SimpleDateFormat sdfNew_ = new SimpleDateFormat(format);\n return sdfNew_.format(sdf_.parse(sourceDate));\n }", "private String formatDate(String dateString) {\n DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern(\"LLL dd, yyyy\");\n LocalDate localDate = LocalDate.parse(dateString.substring(0, 10));\n return dateTimeFormatter.format(localDate);\n }", "public static void main(String[] args) {\n\t\t SimpleDateFormat sdf = new SimpleDateFormat (\"dd-MM-yyyy\");\n\t\t\t\t sdf.setLenient(false);\n\t\t\t\t String input = \"13-02-2018\"; \n\t\t\t\t System.out.println(\"Given Date is:\"+ input); \n\t\t\t\t Date dt;\n\t\t\t\t try {\n\t\t\t\t dt = sdf.parse(input); \n\t\t\t\t System.out.println(dt); \n\t\t\t\t } catch (ParseException e) { \n\t\t\t\t System.out.println(\"Invalid date entered :\" + input); \n\t\t\t\t }\n\n\t}", "private String convertDate(String date){\r\n String arrDate[] = date.split(\"/\");\r\n date = arrDate[2] + \"-\" + arrDate[1] + \"-\" + arrDate[0];\r\n return date;\r\n }", "private String createDate(){\n SimpleDateFormat date = new SimpleDateFormat(\"EEE, MMM d, yyyy\");\n String stringDate = date.format(new Date()); \n return stringDate;\n }", "private static String generateDateString(int year, int month, int dayOfMonth){\n //Add one to month b/c Android is zero-based while SimpleDateFormatter is not\n month++;\n String yearString = String.format(Locale.getDefault(), \"%04d\", year);\n String monthString = String.format(Locale.getDefault(), \"%02d\", month);\n String dayOfMonthString = String.format(Locale.getDefault(), \"%02d\", dayOfMonth);\n\n String result = yearString + \".\" + monthString + \".\" + dayOfMonthString;\n return result;\n }", "public static Date parseDateYYYYMMDDWithoutSeparator(String val) {\n\n\t\tDate d = null;\n\n\t\tif (val != null && !val.equals(\"0\")) {\n\t\t\tSimpleDateFormat format = new SimpleDateFormat(\"yyyyMMdd\");\n\t\t\ttry {\n\t\t\t\td = format.parse(val);\n\t\t\t} catch (ParseException e) {\n\t\t\t}\n\t\t}\n\n\t\treturn d;\n\n\t}", "public Date stringToDate(String d)\n\t{\n\t\tSimpleDateFormat format = new SimpleDateFormat(\"MMM-yyyy\");\n\t\t\n\t\tDate date = new Date();\n\t\t\n\t\ttry \n\t\t{\n\t\t\tdate = format.parse(d);\n\t\t} \n\t\tcatch (ParseException e) \n\t\t{\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\treturn date;\n\t}", "public void setString (String s) { //set method\n full_Date = s;\n if(!isValidDate(full_Date)) throw new IllegalArgumentException(\"Invalid Date Format!\");\n\n Year = Integer.parseInt(full_Date.substring(0,3));\n Month = Integer.parseInt(full_Date.substring(4,5));\n Day = Integer.parseInt(full_Date.substring(6,7));\n\n \n}", "public static String FormatDate(int day, int month, int year) {\r\n String jour = Integer.toString(day);\r\n String mois = Integer.toString(month + 1);\r\n if (jour.length() == 1) {\r\n jour = \"0\" + jour;\r\n }\r\n\r\n if (mois.length() == 1) {\r\n mois = \"0\" + mois;\r\n }\r\n return jour + \"/\" + mois + \"/\" + Integer.toString(year);\r\n }", "public static Object changeDateFormat(String date)\r\n\t{\n\t\tString temp=\"\";\r\n\t\tint len = date.length();\r\n\t\tfor(int i=0;i<len;i++)\r\n\t\t{\r\n\t\t\tchar ch = date.charAt(i);\r\n\t\t\tif(ch == ',')\r\n\t\t\t{\r\n\t\t\t\ttemp = temp+'/';\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\ttemp = temp+ch;\r\n\t\t\t}\r\n\t\t}\r\n\t\tString n=\"\"+temp.charAt(3)+temp.charAt(4);\r\n\t\tint month=Integer.parseInt(n);\r\n\t\tString m=\"\";\r\n\t\tswitch(month)\r\n\t\t{\r\n\t\t\tcase 1:\r\n\t\t\t\tm=\"jan\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 2:\r\n\t\t\t\tm=\"feb\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 3:\r\n\t\t\t\tm=\"mar\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 4:\r\n\t\t\t\tm=\"apr\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 5:\r\n\t\t\t\tm=\"may\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 6:\r\n\t\t\t\tm=\"jun\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 7:\r\n\t\t\t\tm=\"jul\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 8:\r\n\t\t\t\tm=\"aug\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 9:\r\n\t\t\t\tm=\"sep\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 10:\r\n\t\t\t\tm=\"oct\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 11:\r\n\t\t\t\tm=\"nov\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 12:\r\n\t\t\t\tm=\"dec\";\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tSystem.out.println(\"Enter a valid month\");\r\n\t\t\t}\r\n\t\t\tString s=(temp.substring(0, 3)+ m +temp.substring(5));\r\n\t\t\treturn s;\r\n\t\t}", "public String convertCalendarDateFormatFromNumbersToMonthDayComaYear(String stringDate) throws ParseException {\n\t\t\t\tDateFormat formatter = new SimpleDateFormat(\"yyyy-MM-dd\");\n\t\t\t\tDate date = formatter.parse(stringDate);\n\t\t\t\tlong mills = date.getTime();\n\t\t\t\tformatter = new SimpleDateFormat(\"MMM dd, yyyy\");\n\t\t\t\tdate = new Date(mills);\n\t\t\t\treturn formatter.format(date);\n\t\t\t}", "public static String dateConv(int date) {\n\t\tDate mills = new Date(date*1000L); \n\t\tString pattern = \"dd-MM-yyyy\";\n\t\tSimpleDateFormat simpleDateFormat = new SimpleDateFormat(pattern);\n\t\tsimpleDateFormat.setTimeZone(TimeZone.getTimeZone(\"GMT+1\"));\n\t\tString formattedDate = simpleDateFormat.format(mills);\n\t\treturn formattedDate;\n\t}", "public static Calendar extractDate(int date){\n Calendar c = Calendar.getInstance();\n String d = date+\"\";\n int year = Integer.parseInt(d.substring(0, 4));\n int month = Integer.parseInt(d.substring(4, 6))-1;\n int day = Integer.parseInt(d.substring(6, 8));\n c.set(year, month, day);\n return c;\n }", "public static String formatDate(Date date){\n\t\tCalendar now = Calendar.getInstance(); // Gets the current date and time\n\t\tint currentYear = now.get(Calendar.YEAR);\n\t\tint dateYear = Integer.parseInt(new SimpleDateFormat(\"yyyy\").format(date));\n\n\t\tif (dateYear <= currentYear){\n\t\t\treturn new SimpleDateFormat(\"E MMM dd HH:mm\").format(date);\n\t\t} else {\n\t\t\treturn new SimpleDateFormat(\"E yyyy MMM dd HH:mm\").format(date);\n\t\t}\n\t}", "public String format (Date date , String dateFormat) ;", "@Test\n void test7(){\n\n SimpleDateFormat formatter = new SimpleDateFormat(\"yyyy-MM-dd\");\n Date date = new Date();\n String dString = formatter.format(date);\n System.out.println(\"dString=\"+dString);\n\n Date datas = java.sql.Date.valueOf(dString);\n System.out.println(\"datas=\"+datas);\n\n\n }", "public String convertDateFormate(String dt) {\n String formatedDate = \"\";\n if (dt.equals(\"\"))\n return \"1970-01-01\";\n String[] splitdt = dt.split(\"-\");\n formatedDate = splitdt[2] + \"-\" + splitdt[1] + \"-\" + splitdt[0];\n \n return formatedDate;\n \n }", "public java.sql.Date format(String date) {\n int i = 0;\n int dateAttr[];\n dateAttr = new int[3];\n for(String v : date.split(\"/\")) {\n dateAttr[i] = Integer.parseInt(v);\n i++;\n }\n\n GregorianCalendar gcalendar = new GregorianCalendar();\n gcalendar.set(dateAttr[2], dateAttr[0]-1, dateAttr[1]); // Year,Month,Day Of Month\n java.sql.Date sdate = new java.sql.Date(gcalendar.getTimeInMillis());\n return sdate;\n }", "private void updateLabel() {\n String myFormat = \"dd-MM-YYYY\"; //In which you need put here\n SimpleDateFormat sdf = new SimpleDateFormat(myFormat, Locale.US);\n dateInput.setText(sdf.format(myCalendar.getTime()));\n }", "public int getDateAsNumber(){\n\t\tSimpleDateFormat f = new SimpleDateFormat(\"yyyyMMdd\");\n\t\treturn Integer.parseInt(f.format(date.get()));\n\t}", "@Bean(name = \"dateFormatter\")\n public SimpleDateFormat dateFormatter() {\n return new SimpleDateFormat(\"dd/MM/yyyy\");\n }", "private void setDate() {\n java.util.Date d1 = new java.util.Date();\n SimpleDateFormat df = new SimpleDateFormat(\"YYYY-MM-dd\");\n String formateDate = df.format(d1);\n lblDate.setText(formateDate); \n }", "public String ConvertDate(){\r\n//\t\tDate date=JavaUtils.getSystemDate();\r\n//\t DateFormat df = new SimpleDateFormat(\"yyyy/MM/dd\");\r\n\t String pattern = \"yyyy-MM-dd\";\r\n\t SimpleDateFormat simpleDateFormat = new SimpleDateFormat(pattern);\r\n\r\n\t String date = simpleDateFormat.format(new Date());\r\n//\t System.out.println(date);\r\n\t \r\n//\t String s = df.format(date);\r\n//\t String result = s;\r\n//\t try {\r\n//\t date=df.parse(result);\r\n//\t } catch (ParseException e) {\r\n//\t // TODO Auto-generated catch block\r\n//\t e.printStackTrace();\r\n//\t }\r\n\t return date;\r\n\t }", "public static String formatDate(Date date) {\n final SimpleDateFormat formatter = new SimpleDateFormat(\"MM-dd-yyyy\");\n return formatter.format(date);\n }", "public Date formatForDate(String data) throws ParseException{\n //definindo a forma da Data Recebida\n DateFormat formatUS = new SimpleDateFormat(\"dd-MM-yyyy\");\n return formatUS.parse(data);\n }", "private String formatDate(Date dateObject) {\r\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"LLL dd, yyyy\");\r\n return dateFormat.format(dateObject);\r\n }", "@Test\n public void toStringOk(){\n Date date = new Date(1,Month.january,1970);\n assertEquals(date.toString(),\"1 january 1970\");\n }", "public static void main(String[] args)\r\n/* 96: */ {\r\n/* 97:104 */ SimpleDateFormat df = new SimpleDateFormat(\"yyyy-MM-dd\");\r\n/* 98:105 */ String qiandaotime = df.format(new Date());\r\n/* 99:106 */ System.out.println(qiandaotime);\r\n/* 100: */ }", "public static String convertDateToSend(String gotdate){\n Calendar calendar = Calendar.getInstance();\n calendar.setTimeInMillis(Long.parseLong(gotdate));\n SimpleDateFormat inputFormat = new SimpleDateFormat(\"yyyyMMddHHmmss\");\n SimpleDateFormat outputFormat = new SimpleDateFormat(\"dd MMM yyyy\");\n /*Date parsedDate = null;\n try {\n parsedDate = inputFormat.parse(gotdate);\n } catch (ParseException e) {\n e.printStackTrace();\n }*/\n String formattedDate = outputFormat.format(calendar.getTime());\n return formattedDate;\n }", "public static String getFormattedMonthDay(String dateStr){\n\n Pattern fixDate = Pattern.compile(\"(\\\\d{4})(\\\\d{1,2})(\\\\d{1,2})\");\n Matcher correctDate = fixDate.matcher(dateStr);\n correctDate.find();\n\n String Nowiscorrect = String.format(\"%s/%s/%s\",\n correctDate.group(1),\n correctDate.group(2),\n correctDate.group(3));\n\n String MonthAndDay = currentDate.getdateWithMonthLetters(Nowiscorrect);\n\n\n Pattern rtl_CHARACTERS = Pattern.compile(\"^[۱-۹]+\");\n Matcher findTheYear = rtl_CHARACTERS.matcher(MonthAndDay);\n boolean isDone = findTheYear.find();\n\n return isDone ? findTheYear.replaceAll(\"\") : \"\";\n\n }", "public static String create(int year, int month, int date) {\r\n\t\tCalendar dateTime = createCalendar(year, month, date);\r\n\t\treturn YYYY_MM_DD_FORMATTER.format(dateTime.getTime());\r\n\t}", "void showdate(){\n \n Date d = new Date();\n SimpleDateFormat s = new SimpleDateFormat(\"yyyy-MM-dd\");\n jLabel4.setText(s.format(d));\n}", "public String getDate(){\n String d=\"\";\n String m=\"\";\n if(day<10){\n d=0+(String.valueOf(day));\n }\n else{\n d=String.valueOf(day);\n }\n\n if(month<10){\n m=0+(String.valueOf(month));\n }\n else{\n m=String.valueOf(month);\n }\n //returning day/month/year\n return (d+\"/\"+m+\"/\"+String.valueOf(year));\n }", "@Test public void Month_name_0__day__year__bad_day()\t\t\t{tst_date_(\"Mar 32 2001\"\t\t\t, \"Invalid day: 32\");}", "protected static SimpleDateFormat xsdDateFormat() {\n return new SimpleDateFormat(\"yyyy-MM-dd\");\n }", "public static void main(String[] args) throws ParseException {\n\n\t\tString startPattern = \"MMM yyyy\";\n\n\t\tString endPattern = \"MM-dd-yyyy\";\n\n\t\tString str = formateDate(\"mar 2019\", startPattern, endPattern);\n\t\tSystem.out.println(str);\n\n\t}", "private String formatDate(Date dateObject) {\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"LLL dd, yyyy\");\n return dateFormat.format(dateObject);\n }", "private String formatReleaseDate(String releaseDate) {\n SimpleDateFormat format = new SimpleDateFormat(\"yyyy-MM-dd\");\n Date dateObject;\n try {\n dateObject = format.parse(releaseDate);\n }\n catch (ParseException pe) {\n Log.e(LOG_TAG, \"Error while retrieving movie information\");\n return releaseDate;\n }\n format = new SimpleDateFormat(\"LLL dd, yyyy\");\n\n return format.format(dateObject);\n }", "java.lang.String getStartDateYYYY();", "private String toDate(Date appDate) throws ParseException {\n\t\tCalendar cal = Calendar.getInstance();\n\t\tcal.setTime(appDate);\n\t\tString formatedDate = cal.get(Calendar.DATE) + \"/\" + (cal.get(Calendar.MONTH) + 1) + \"/\" + cal.get(Calendar.YEAR);\n\t\tSystem.out.println(\"formatedDate : \" + formatedDate); \n\t\treturn formatedDate;\n\t}", "public String checkDateDay(Date aDate){\n if (aDate.getDate() < 10) {\r\n String newDate = \"0\" + Integer.toString(aDate.getDate());\r\n \r\n return newDate;\r\n }\r\n return Integer.toString(aDate.getDate());\r\n \r\n }", "private int caBeDate(String str){\n if(!isNumber(str)){\n return 0;\n }if(str.length()<2){\n return 0;\n }if(str.length()==2){\n return 1;\n }if(str.length() == 3){\n return 2;\n }if(str.length() == 4){\n return 3;\n }if(str.length()>4){\n return 6;\n }\n return 0;\n }", "private int getPublishingYear(String date) {\n String[] splitArray = date.split(\"-\");\n\n return Integer.parseInt(splitArray[splitArray.length - 1]);\n }", "public String asMonthYear() {\n return new SimpleDateFormat(\"MM/yyyy\").format(expiredAfter);\n\t}", "public void parseDate(String d)\n {\n\tdate.set(d);\n String [] dateList = d.split(\"-\");\n \n year.set(Integer.valueOf(dateList[0]));\n month.set(Integer.valueOf(dateList[1]));\n day.set(Integer.valueOf(dateList[2]));\n }", "public String dar_fecha(){\n Date date = new Date();\n DateFormat dateFormat = new SimpleDateFormat(\"dd/MM/yyyy\");\n return dateFormat.format(date).toString();\n\n }", "public Date212 (String s){ //initial constructor\n full_Date = s;\n // System.out.println(full_Date + \"jdjdj\");\n if (!isValidDate(full_Date)) throw new IllegalArgumentException(\"Invalid Date Format!\"); \n //If it is not true that the date is valid then throw a error.\n /* \n The substring methods to pull out the Year, Month, and Day.\n */\n Year = Integer.parseInt(full_Date.substring(0,3)); \n Month = Integer.parseInt(full_Date.substring(4,5));\n Day = Integer.parseInt(full_Date.substring(6,7));\n count++; \n addArray(this); //Calling the function \"addArray\" with 'this isntance of date212'\n // System.out.println(myDates[i]);\n\n }", "void showDate()\n {\n Date d=new Date();\n SimpleDateFormat s=new SimpleDateFormat(\"dd-MM-yyyy\");\n date.setText(s.format(d));\n }", "private String stringifyDate(Date date){\n\t\tDateFormat dateFormatter = new SimpleDateFormat(\"yyyy-MM-dd\");\t\t\n\t\treturn dateFormatter.format(date);\n\t}", "String getDate();", "String getDate();", "private String getDate(int year, int month, int day) {\n return new StringBuilder().append(month).append(\"/\")\n .append(day).append(\"/\").append(year).toString();\n }", "public static Date ParseFecha(String fecha)\n {\n //SimpleDateFormat formato = new SimpleDateFormat(\"dd-MM-yyyy\");\n SimpleDateFormat formato = new SimpleDateFormat(\"yyyy-MM-dd\");\n Date fechaDate = null;\n try {\n if(!fecha.equals(\"0\")){\n fechaDate = formato.parse(fecha);\n }\n\n }\n catch (ParseException ex)\n {\n System.out.println(ex);\n }\n return fechaDate;\n }", "public static String formatarDataAAAAMMDD(Date data) {\r\n\t\tString retorno = \"\";\r\n\t\tif (data != null) { // 1\r\n\t\t\tCalendar dataCalendar = new GregorianCalendar();\r\n\t\t\tStringBuffer dataBD = new StringBuffer();\r\n\r\n\t\t\tdataCalendar.setTime(data);\r\n\r\n\t\t\tdataBD.append(dataCalendar.get(Calendar.YEAR));\r\n\r\n\t\t\tif ((dataCalendar.get(Calendar.MONTH) + 1) > 9) {\r\n\t\t\t\tdataBD.append(dataCalendar.get(Calendar.MONTH) + 1);\r\n\t\t\t} else {\r\n\t\t\t\tdataBD.append(\"0\" + (dataCalendar.get(Calendar.MONTH) + 1));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (dataCalendar.get(Calendar.DAY_OF_MONTH) > 9) {\r\n\t\t\t\tdataBD.append(dataCalendar.get(Calendar.DAY_OF_MONTH));\r\n\t\t\t} else {\r\n\t\t\t\tdataBD.append(\"0\" + dataCalendar.get(Calendar.DAY_OF_MONTH));\r\n\t\t\t}\r\n\r\n\t\t\tretorno = dataBD.toString();\r\n\t\t}\r\n\t\treturn retorno;\r\n\t}", "public static String dayIndexToDate(int dayindex) {\n \t\tint year = 2011;\n \t\tint month = 7;\n \t\tint day = 9;\n \t\n \t\tCalendar cal = Calendar.getInstance();\n \t\tcal.set(year, month-1, day);\n \t\tcal.add(Calendar.DAY_OF_MONTH, dayindex-1);\n \t\treturn new SimpleDateFormat(\"EEEEEEEE dd\").format(cal.getTime());\n \t}", "public static void main(String[] args) {\r\n\t\tDateTimeFormatter df=DateTimeFormatter.ofPattern(\"dd/MM/yyyy\");\r\n\tLocalDate date=LocalDate.now().plusDays(11).plusMonths(2).plusYears(1);\r\n\tSystem.out.println(df.format(date));\r\n\t}", "private static Date getDate(String sdate)\n\t{\n\t\tDate date = null;\n\t\tSimpleDateFormat formatter = new SimpleDateFormat(\"MM/dd/yyyy\");\n\t\ttry {\n\t\t\tdate = formatter.parse(sdate);\n\t\t} catch (ParseException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn date;\n\t}", "public static String m24132a(Context context, Date date, String str) {\n return context != null ? new SimpleDateFormat(str, Locale.US).format(date) : \"\";\n }", "private String formatDate(final Date date) {\r\n\t\tfinal Calendar calendar = Calendar.getInstance();\r\n\t\tcalendar.setTime(date);\r\n\r\n\t\tfinal String dayOfMonth = formatDayOfMonth(calendar);\r\n\t\tfinal String month = formatMonth(calendar);\r\n\t\tfinal String year = String.valueOf(calendar.get(Calendar.YEAR));\r\n\r\n\t\treturn String.format(\"%s/%s/%s\", year, month, dayOfMonth);\r\n\t}", "public static String getYearMonthFormat(String strFormat) {\n String yearMonthFormat = \"\";\n String etemp = \"\";\n String regex = \".*[^a-zA-Z0-9]\";\n int epos = strFormat.lastIndexOf(\"d\");\n\n if (epos + 1 < strFormat.length()) {\n etemp = strFormat.substring(epos + 1, epos + 2);\n }\n\n yearMonthFormat = strFormat.replaceAll(\"d\", \"\");\n yearMonthFormat = yearMonthFormat.replaceAll(\"m\", \"M\");\n\n if (etemp.length() > 0)\n yearMonthFormat = yearMonthFormat.replaceFirst(etemp, \"\");\n\n if (yearMonthFormat.matches(regex)) {\n yearMonthFormat = yearMonthFormat.substring(0, yearMonthFormat.length() - 1);\n if (yearMonthFormat.matches(regex)) {\n yearMonthFormat = yearMonthFormat.substring(0, yearMonthFormat.length() - 1);\n }\n }\n return yearMonthFormat;\n }", "private static String dateFormatter(String date) {\n\t\tString[] dateArray = date.split(AnalyticsUDFConstants.SPACE_SEPARATOR);\n\t\ttry {\n\t\t\t// convert month which is in the format of string to an integer\n\t\t\tDate dateMonth = new SimpleDateFormat(AnalyticsUDFConstants.MONTH_FORMAT, Locale.ENGLISH).parse(dateArray[1]);\n\t\t\tCalendar cal = Calendar.getInstance();\n\t\t\tcal.setTime(dateMonth);\n\t\t\t// months begin from 0, therefore add 1\n\t\t\tint month = cal.get(Calendar.MONTH) + 1;\n\t\t\tString dateString = dateArray[5] + AnalyticsUDFConstants.DATE_SEPARATOR + month + AnalyticsUDFConstants.DATE_SEPARATOR + dateArray[2];\n\t\t\tDateFormat df = new SimpleDateFormat(AnalyticsUDFConstants.DATE_FORMAT_WITHOUT_TIME);\n\t\t\treturn df.format(df.parse(dateString));\n\t\t} catch (ParseException e) {\n\t\t\treturn null;\n\t\t}\n\t}", "public static String formatDate(String date){\n String formatedDate = date;\n if (!date.matches(\"[0-9]{2}-[0-9]{2}-[0-9]{4}\")){\n if (date.matches(\"[0-9]{1,2}/[0-9]{1,2}/([0-9]{2}|[0-9]{4})\"))\n formatedDate = date.replace('/', '-');\n if (date.matches(\"[0-9]{1,2}.[0-9]{1,2}.([0-9]{2}|[0-9]{4})\")){\n if (formatedDate.matches(\"[0-9]{1}.[0-9]{1,2}.([0-9]{2}|[0-9]{4})\"))\n formatedDate = \"0\" + formatedDate;\n if (formatedDate.matches(\"[0-9]{2}.[0-9]{1}.([0-9]{2}|[0-9]{4})\"))\n formatedDate = formatedDate.substring(0, 3) + \"0\" + \n formatedDate.substring(3);\n if (formatedDate.matches(\"[0-9]{2}.[0-9]{2}.[0-9]{2}\")){\n String thisYear = String.valueOf(LocalDate.now().getYear());\n String century = thisYear.substring(0,2);\n /* If the last two digits of the date are larger than the two last digits of \n * the current date, then we can suppose that the year corresponds to the last \n * century.\n */ \n if (Integer.valueOf(formatedDate.substring(6)) > Integer.valueOf(thisYear.substring(2)))\n century = String.valueOf(Integer.valueOf(century) - 1);\n formatedDate = formatedDate.substring(0, 6) + century +\n formatedDate.substring(6); \n }\n }\n }\n return formatedDate;\n }", "@Test\n\tvoid teststringtoint(){\n\t\tCalendar cal=Calendar.getInstance();\n\t\tint m=cal.get(Calendar.MONTH);\n\t\tint d=cal.get(Calendar.DATE);\n\t\tSystem.out.println(\"m==\"+m+\" d==\"+d);\n\t}", "private String formatDate(Date date) {\n String resultDate;\n SimpleDateFormat dateFormat;\n dateFormat = new SimpleDateFormat(\"dd/MM/yyyy\");\n resultDate = dateFormat.format(date);\n return resultDate;\n }", "public static String dateToString(Date date)\r\n/* 19: */ {\r\n/* 20: 23 */ return sdfDate.format(date);\r\n/* 21: */ }", "public static String makeDateString(int day, int month, int year) {\r\n\t\t\r\n\t\treturn makeYearString(year) + \"-\" +\r\n\t\tmakeMonthString(month) + \"-\" +\r\n\t\tmakeDayString(day);\r\n\t\t\r\n\t}", "public String asMonth() {\n \treturn new SimpleDateFormat(\"MM\").format(expiredAfter);\n }", "private String formatDate(String date)\n\t{\n\t\tif(date == null || date.isEmpty())\n\t\t{\n\t\t\treturn \"\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\tString[] dateSplit = date.split(\"/\");\n\t\t\tif(dateSplit.length != 3)\n\t\t\t{\n\t\t\t\treturn \"\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn getMonthName(dateSplit[0]) + \" \"+ dateSplit[1]+\", \"+ dateSplit[2];\n\t\t\t}\n\t\t}\n\t}", "public String getYear(){\n return rssData.getDate().split(\"/\")[2];\n }", "public DateUtil (int yyyy, int mm, int dd)\n {\n set(yyyy, mm, dd, CHECK);\n }" ]
[ "0.6722434", "0.64601475", "0.64306706", "0.641206", "0.6339544", "0.63288254", "0.6311233", "0.62635005", "0.62243795", "0.6212011", "0.6205631", "0.6150507", "0.61330664", "0.61139756", "0.6109415", "0.6104228", "0.6085866", "0.60699266", "0.60629755", "0.6044968", "0.6023198", "0.5976024", "0.59751916", "0.59016055", "0.5894775", "0.5876911", "0.5871312", "0.5822782", "0.5820561", "0.57976145", "0.5763302", "0.575874", "0.57527184", "0.5728963", "0.5728043", "0.57184905", "0.571315", "0.57123965", "0.57072073", "0.5707161", "0.5688976", "0.5680693", "0.5677975", "0.5672274", "0.5667002", "0.56665367", "0.5662659", "0.56600595", "0.56493443", "0.5647147", "0.563971", "0.5608817", "0.56086785", "0.5605542", "0.56054986", "0.55926144", "0.5591301", "0.55872697", "0.5583549", "0.55831033", "0.5581977", "0.55764663", "0.55633175", "0.55609715", "0.55560654", "0.55553585", "0.5554638", "0.5547065", "0.5531433", "0.55289906", "0.5509358", "0.55092126", "0.5500794", "0.5496106", "0.54912895", "0.5484681", "0.547221", "0.54715234", "0.5456271", "0.54549223", "0.54526067", "0.54526067", "0.54448444", "0.54370236", "0.5436823", "0.5435216", "0.54308563", "0.54216427", "0.541805", "0.5415684", "0.5410734", "0.5408871", "0.5384879", "0.53756106", "0.53688663", "0.5366677", "0.53641534", "0.5355192", "0.5347704", "0.5347503", "0.534636" ]
0.0
-1
Transaction Entry Object with headers & content
public String createProductAccount(Accnowbs obj) { String str = null; try { BASE_URI = getURI(); com.sun.jersey.api.client.config.ClientConfig config = new com.sun.jersey.api.client.config.DefaultClientConfig(); client = Client.create(config); getRoleparameters(); client.addFilter(new HTTPBasicAuthFilter(dname, dpwd)); webResource = client.resource(BASE_URI).path("glwsprdacno"); ClientResponse response = webResource.accept("application/xml").post(ClientResponse.class, obj); System.out.println("Server response : \n" + response.getStatus()); if (response.getStatus() != 201) { throw new RuntimeException("Failed : HTTP error code : " + response.getStatus() + ". Operation failed"); } String output = response.getEntity(String.class); System.out.println("Server response : \n"); System.out.println(output); str = output; } catch (Exception e) { e.printStackTrace(); } return str; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "TarEntry CreateEntry(byte[] headerBuffer);", "public HTTPResponse( Transaction t, Content ct, Headers hd ){\n super();\n\n Pia.debug(this, \"Constructor-- [ transaction t, content ct, headers hd ] on duty...\");\n\n contentObj = ct;\n headersObj = hd; // maybe generate?\n\n if( contentObj != null )\n contentObj.setHeaders( headersObj );\n \n requestTran = t;\n fromMachine( t.toMachine() );\n toMachine( t.fromMachine() );\n\n startThread();\n }", "public HTTPResponse( Transaction t, Content ct ){\n super();\n\n Pia.debug(this, \"Constructor-- [ transaction t, content ct ] on duty...\");\n\n contentObj = ct;\n headersObj = new Headers(); // blank header\n\n if( contentObj != null )\n contentObj.setHeaders( headersObj );\n \n requestTran = t;\n fromMachine( t.toMachine() );\n toMachine( t.fromMachine() );\n startThread();\n }", "public HTTPResponse( Transaction t, Content ct, boolean debug ){\n super();\n\n DEBUG = debug;\n Pia.debug(this, \"Constructor-- [ transaction t, content ct ] on duty...\");\n\n contentObj = ct;\n headersObj = new Headers(); // blank header\n\n if( contentObj != null )\n contentObj.setHeaders( headersObj );\n \n requestTran = t;\n fromMachine( t.toMachine() );\n toMachine( t.fromMachine() );\n }", "public Receipt recordTransaction(Transaction t) throws RemoteException;", "public void createTransaction(Transaction trans);", "Transaction createTransaction(Settings settings);", "Transaction createTransaction();", "public void onTransactionAdded(TransactionEntry transactionEntry);", "public Transaction(){\n\t\t\n\t\ttransactions = new HashMap<String, ArrayList<Products>>();\n\t}", "public ProcessTxnResult processTxn(TxnHeader hdr, Record txn, TxnDigest digest) {\n return dataTree.processTxn(hdr, txn, digest);\n }", "public Transaction(String transactionLine){\r\n\t\t\t//String delims = \"[\\\\s+]\";\r\n\t\t\tString[] tokens = transactionLine.split(\" +\");\r\n\t\t\tif (tokens[0].equals(\"\")){\r\n\t\t\t\tid = 00;\r\n\t\t\t}else{\r\n\t\t\t\tid = Integer.parseInt(tokens[0]);\r\n\t\t\t}\r\n\t\t\tif (id == 0){\r\n\t\t\t\tdate = 0;\r\n\t\t\t\tticket = 0;\r\n\t\t\t\tname = \"\";\r\n\t\t\t}else{\r\n\t\t\t\tdate = Integer.parseInt(tokens[2]);\r\n\t\t\t\tticket = Integer.parseInt(tokens[3]);\r\n\t\t\t\tname = tokens[1];\r\n\t\t\t\t\t\t\r\n\t\t\t}\r\n\r\n\t }", "public HTTPResponse( Transaction t, boolean doStart, boolean debug ){\n super();\n\n DEBUG = debug;\n Pia.debug(this, \"Constructor-- [ transaction t, boolean startThread ] on duty...\");\n\n contentObj = null;\n headersObj = new Headers(); // blank header\n\n requestTran = t;\n fromMachine( t.toMachine() );\n toMachine( t.fromMachine() );\n\n }", "Transaction getTransaction() { \r\n return tx;\r\n }", "public GenericEntry toGenericEntry() {\n GenericEntry entry = new GenericEntry();\n entry.addProperty(\"requestId\", requestId);\n if (completedDate != null) {\n entry.addProperty(\"completedDate\", DATE_FORMAT.format(completedDate));\n }\n if (requestDate != null) {\n entry.addProperty(\"beginDate\", DATE_FORMAT.format(requestDate));\n }\n if (numberOfFiles != 0) {\n entry.addProperty(\"numberOfFiles\", String.valueOf(numberOfFiles));\n }\n entry.addProperty(\"userEmailAddress\", userEmailAddress);\n entry.addProperty(\"adminEmailAddress\", adminEmailAddress);\n entry.addProperty(\"status\", status);\n return entry;\n }", "public final TarEntry CreateEntry(byte[] headerBuffer)\n\t\t{\n\t\t\treturn new TarEntry(headerBuffer);\n\t\t}", "public String getTransaction() {\n return transaction;\n }", "public TarArchiveEntry(byte[] headerBuf, ArchiveEntryEncoding encoding) throws IOException {\n this();\n parseTarHeader(headerBuf, encoding);\n }", "TransactionResponseDTO transferTransaction(TransactionRequestDTO transactionRequestDTO);", "public Transaction(JsonObject transObj) {\n this.symbol = transObj.get(\"symbol\").getAsString();\n this.price = transObj.get(\"price\").getAsDouble();\n this.volume = transObj.get(\"volume\").getAsInt();\n this.type = transObj.get(\"type\").getAsString(); //buy or sell\n this.date = transObj.get(\"date\").getAsString();\n this.time = transObj.get(\"time\").getAsString();\n this.profitFromSell = transObj.get(\"profitFromSell\").getAsDouble();\n this.averagePurchasePrice = transObj.get(\"averagePurchasePrice\").getAsDouble();\n }", "protected abstract Object getTransactionObject() throws TransactionInfrastructureException;", "TarEntry CreateEntry(String name);", "public AccountInfo(GenericEntry entry) { \n completedDate = checkDateAndParse(entry.getProperty(\"completedDate\"));\n requestDate = checkDateAndParse(entry.getProperty(\"requestDate\"));\n expiredDate = checkDateAndParse(entry.getProperty(\"expiredDate\"));\n requestId = entry.getProperty(\"requestId\");\n userEmailAddress = entry.getProperty(\"userEmailAddress\");\n adminEmailAddress = entry.getProperty(\"adminEmailAddress\");\n status = entry.getProperty(\"status\");\n \n numberOfFiles =\n entry.getProperty(\"numberOfFiles\") != null ? Integer.parseInt(entry\n .getProperty(\"numberOfFiles\")) : numberOfFiles;\n\n if (numberOfFiles > 0) {\n fileUrls = new String[numberOfFiles];\n for (int fileIndex = 0; fileIndex < numberOfFiles; fileIndex++) {\n fileUrls[fileIndex] = entry.getProperty(\"fileUrl\" + fileIndex);\n }\n }\n }", "Map retrievePreparedTransactions();", "public HTTPResponse( Transaction t, Machine from, Content ct,\n\t\t boolean doStart ){\n super();\n\n Pia.debug(this, \"Constructor-- [ transaction t, machine from, content ct ] on duty...\");\n\n contentObj = ct;\n headersObj = new Headers(); // blank header\n\n if( contentObj != null )\n contentObj.setHeaders( headersObj );\n\n requestTran = t;\n fromMachine( from );\n toMachine( t.fromMachine() );\n \n if( doStart )\n startThread();\n }", "protected abstract Transaction createAndAdd();", "private TransactionRequest initTransactionRequest() {\n TransactionRequest transactionRequestNew = new\n TransactionRequest(System.currentTimeMillis() + \"\", 20000);\n\n //set customer details\n transactionRequestNew.setCustomerDetails(initCustomerDetails());\n\n\n // set item details\n ItemDetails itemDetails = new ItemDetails(\"1\", 20000, 1, \"Trekking Shoes\");\n\n // Add item details into item detail list.\n ArrayList<ItemDetails> itemDetailsArrayList = new ArrayList<>();\n itemDetailsArrayList.add(itemDetails);\n transactionRequestNew.setItemDetails(itemDetailsArrayList);\n\n\n // Create creditcard options for payment\n CreditCard creditCard = new CreditCard();\n\n creditCard.setSaveCard(false); // when using one/two click set to true and if normal set to false\n\n// this methode deprecated use setAuthentication instead\n// creditCard.setSecure(true); // when using one click must be true, for normal and two click (optional)\n\n creditCard.setAuthentication(CreditCard.AUTHENTICATION_TYPE_3DS);\n\n // noted !! : channel migs is needed if bank type is BCA, BRI or MyBank\n// creditCard.setChannel(CreditCard.MIGS); //set channel migs\n creditCard.setBank(BankType.BCA); //set spesific acquiring bank\n\n transactionRequestNew.setCreditCard(creditCard);\n\n return transactionRequestNew;\n }", "public Transaction getTransaction()\n {\n return transaction;\n }", "public void commit(Transaction t) {\n\t\ttry {\n\t\t\tArrayList<Record> records = new ArrayList<Record>();\n\t\t\tfor (int i = 0; i < t.noOfBundles; i++) {\n\t\t\t\tString record = \"\";\n\t\t\t\tBundle b = t.bundles[i];\n\t\t\t\tbyte[] recd = b.data;\n\t\t\t\trecord = new String(recd);\n\t\t\t\tString rec[] = record.split(\"\\n\");\n\t\t\t\tRecord r = new Record();\n\t\t\t\tr.rowid = Long.parseLong(rec[0]);\n\t\t\t\tr.groupid = rec[1];\n\t\t\t\tr.key = rec[2];\n\t\t\t\tr.value = rec[3];\n\t\t\t\tr.user = rec[4];\n\t\t\t\tr.datatype = rec[5];\n\t\t\t\tr.timestamp = Long.parseLong(rec[6]);\n\t\t\t\tr.synced = \"Y\";\n\t\t\t\tif (r.datatype.equals(\"file\")) {\n\t\t\t\t\tint l = Integer.parseInt(r.value.substring(0,\n\t\t\t\t\t\t\tr.value.indexOf(' ')));\n\t\t\t\t\tString fileName = r.value\n\t\t\t\t\t\t\t.substring(r.value.indexOf(' ') + 1);\n\t\t\t\t\tfileName = deviceId + \"_\" + t.transactionId + \"_\" + i + \"_\"\n\t\t\t\t\t\t\t+ fileName;\n\t\t\t\t\tString path = storagePath + \"/\" + fileName;\n\t\t\t\t\tFile f = new File(path);\n\t\t\t\t\tFileOutputStream fos = new FileOutputStream(f);\n\t\t\t\t\tfor (int j = 1; j <= l; j++) {\n\t\t\t\t\t\tb = t.bundles[i + j];\n\t\t\t\t\t\tfos.write(b.data);\n\t\t\t\t\t}\n\t\t\t\t\tfos.close();\n\t\t\t\t\ti += l;\n\t\t\t\t\tr.value = path;\n\t\t\t\t}\n\t\t\t\trecords.add(r);\n\t\t\t}\n\t\t\tdh.putToRepository(records);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public HTTPResponse( Transaction t, boolean doStart ){\n Pia.debug(this, \"Constructor-- [ transaction t, boolean startThread ] on duty...\");\n\n handlers = new Queue();\n\n contentObj = null;\n headersObj = new Headers(); // blank header\n\n requestTran = t;\n fromMachine( t.toMachine() );\n toMachine( t.fromMachine() );\n\n if( doStart )\n startThread();\n }", "@Override\n\tpublic ParseObject packObject() {\n\t\tParseObject po = super.packObject();\n\t\tpo.put(USERS, ParseUtil.toListOfParseObjects(mUsers));\n\t\tpo.put(ORDERS, ParseUtil.toListOfParseObjects(mOrders));\n\t\tpo.put(REQUESTS, ParseUtil.toListOfParseObjects(mPendingRequests));\n\t\tpo.put(RESTAURANT_INFO, this.mRest.packObject());\n\t\tpo.put(TABLE_ID, mTableID);\n\t\treturn po;\n\t}", "private static void\n headersWrite (final Map.Entry <String, VersionedValue> entry, Hello self)\n {\n self.putString (entry.getKey ());\n self.putNumber4 (entry.getValue ().getVersion ());\n self.putString (entry.getValue ().getValue ());\n }", "@Override\n\tpublic ResultSet transactionBody(String type, int id, int value, int householdNum) {\n\t\t\n\t\tSystem.out.println(\"Transaction Body 1\");\n\t\t\n\t\treturn queryTable(type);\n\t\t\n\t}", "public Transaction() {\n }", "TxnResponseProto.TxnResponse getTxnresponse();", "public TransactionObj getTransaction(String sID){\n\t\treturn hmTransaction.get(sID);\n\t}", "public void addTransaction(Transaction trans)\n {\n SolrInputDocument solr_doc = new SolrInputDocument();\n solr_doc.setField(\"type\",\"Transaction\");\n solr_doc.setField(\"hashBlock\",trans.getHashBlock());\n solr_doc.setField(\"trans_id_split\",trans.getTrans_id_split());\n solr_doc.setField(\"transaction_id\",trans.getTransaction_id());\n solr_doc.setField(\"transaction_fee\",trans.getTransaction_fee());\n solr_doc.setField(\"transaction_size_kb\",trans.getTransaction_size_kb());\n solr_doc.setField(\"from_amout\",trans.getFrom_amout());\n solr_doc.setField(\"to_amount\",trans.getTo_amount());\n\n try {\n client.add(solr_doc);\n } catch (SolrServerException | IOException e) {\n e.printStackTrace();\n }\n\n commit();\n\n }", "private void addEntry( List<TicketEntry> entries, JSONObject entry){\n //parsing the entry fields and building it\n String barcode = (String) entry.get(\"barcode\");\n String desc = (String) entry.get(\"description\");\n int amount = Integer.parseInt((String) entry.get(\"amount\"));\n double PPU = Double.parseDouble((String) entry.get(\"PPU\"));\n double discountRate = Double.parseDouble((String) entry.get(\"discountRate\"));\n entries.add(new TicketEntryImpl(barcode,desc,amount,PPU,discountRate));\n }", "@Override\r\n\t\t\tpublic Object doInTransaction(TransactionStatus arg0) {\n\t\t\t\t\r\n\t\t\t\tSqlLogInspetor sqlLogInspetor = new SqlLogInspetor();\r\n\t\t\t\tsqlLogInspetor.enable();\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\tSignatureBean signatureBean = PlayerManagerTest.this.manager.deserializeSignature(\"eyJjbGF6ek5hbWUiOiJvcmcuanNvbnBsYXliYWNrLnBsYXllci5oaWJlcm5hdGUuZW50aXRpZXMuTWFzdGVyQkVudCIsInJhd0tleVZhbHVlcyI6WyIxIiwiMSJdLCJyYXdLZXlUeXBlTmFtZXMiOlsiamF2YS5sYW5nLkludGVnZXIiLCJqYXZhLmxhbmcuSW50ZWdlciJdfQ\");\r\n\t\t\t\tMasterBEnt masterBEnt = PlayerManagerTest.this.manager.getBySignature(signatureBean);\r\n\t\t\t\t\r\n\t\t\t\tsignatureBean = PlayerManagerTest.this.manager.deserializeSignature(\"eyJjbGF6ek5hbWUiOiJvcmcuanNvbnBsYXliYWNrLnBsYXllci5oaWJlcm5hdGUuZW50aXRpZXMuTWFzdGVyQUVudCIsImlzQ29sbCI6dHJ1ZSwicHJvcGVydHlOYW1lIjoiZGV0YWlsQUVudENvbCIsInJhd0tleVZhbHVlcyI6WyIxIl0sInJhd0tleVR5cGVOYW1lcyI6WyJqYXZhLmxhbmcuSW50ZWdlciJdfQ\");\r\n\t\t\t\tCollection<DetailAEnt> detailAEntCol = PlayerManagerTest.this.manager.getBySignature(signatureBean);\r\n\t\t\t\t\r\n\t\t\t\tsignatureBean = PlayerManagerTest.this.manager.deserializeSignature(\"eyJjbGF6ek5hbWUiOiJvcmcuanNvbnBsYXliYWNrLnBsYXllci5oaWJlcm5hdGUuZW50aXRpZXMuTWFzdGVyQkVudCIsImlzQ29tcCI6dHJ1ZSwicHJvcGVydHlOYW1lIjoibWFzdGVyQkNvbXAiLCJyYXdLZXlWYWx1ZXMiOlsiMSIsIjEiXSwicmF3S2V5VHlwZU5hbWVzIjpbImphdmEubGFuZy5JbnRlZ2VyIiwiamF2YS5sYW5nLkludGVnZXIiXX0\");\r\n\t\t\t\tMasterBComp masterBComp = PlayerManagerTest.this.manager.getBySignature(signatureBean);\r\n\r\n\t\t\t\tsignatureBean = PlayerManagerTest.this.manager.deserializeSignature(\"eyJjbGF6ek5hbWUiOiJvcmcuanNvbnBsYXliYWNrLnBsYXllci5oaWJlcm5hdGUuZW50aXRpZXMuTWFzdGVyQkVudCIsImlzQ29sbCI6dHJ1ZSwicHJvcGVydHlOYW1lIjoibWFzdGVyQkNvbXAuZGV0YWlsQUVudENvbCIsInJhd0tleVZhbHVlcyI6WyIxIiwiMSJdLCJyYXdLZXlUeXBlTmFtZXMiOlsiamF2YS5sYW5nLkludGVnZXIiLCJqYXZhLmxhbmcuSW50ZWdlciJdfQ\");\r\n\t\t\t\tCollection<DetailAEnt> compDetailAEntCol = PlayerManagerTest.this.manager.getBySignature(signatureBean);\r\n\r\n\t\t\t\tsignatureBean = PlayerManagerTest.this.manager.deserializeSignature(\"eyJjbGF6ek5hbWUiOiJvcmcuanNvbnBsYXliYWNrLnBsYXllci5oaWJlcm5hdGUuZW50aXRpZXMuTWFzdGVyQkVudCIsImlzQ29tcCI6dHJ1ZSwicHJvcGVydHlOYW1lIjoibWFzdGVyQkNvbXAubWFzdGVyQkNvbXBDb21wIiwicmF3S2V5VmFsdWVzIjpbIjEiLCIxIl0sInJhd0tleVR5cGVOYW1lcyI6WyJqYXZhLmxhbmcuSW50ZWdlciIsImphdmEubGFuZy5JbnRlZ2VyIl19\");\r\n\t\t\t\tMasterBCompComp masterBCompComp = PlayerManagerTest.this.manager.getBySignature(signatureBean);\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tsignatureBean = PlayerManagerTest.this.manager.deserializeSignature(\"eyJjbGF6ek5hbWUiOiJvcmcuanNvbnBsYXliYWNrLnBsYXllci5oaWJlcm5hdGUuZW50aXRpZXMuTWFzdGVyQkVudCIsImlzQ29sbCI6dHJ1ZSwicHJvcGVydHlOYW1lIjoibWFzdGVyQkNvbXAubWFzdGVyQkNvbXBDb21wLmRldGFpbEFFbnRDb2wiLCJyYXdLZXlWYWx1ZXMiOlsiMSIsIjEiXSwicmF3S2V5VHlwZU5hbWVzIjpbImphdmEubGFuZy5JbnRlZ2VyIiwiamF2YS5sYW5nLkludGVnZXIiXX0\");\r\n\t\t\t\tCollection<DetailAEnt> compCompDetailAEntCol = PlayerManagerTest.this.manager.getBySignature(signatureBean);\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tAssert.assertThat(\"masterBEnt.getMasterBComp(), sameInstance(masterBComp)\", masterBEnt.getMasterBComp(), sameInstance(masterBComp));\r\n\t\t\t\tAssert.assertThat(\"masterBEnt.getMasterBComp().getMasterBCompComp(), sameInstance(masterBCompComp)\", masterBEnt.getMasterBComp().getMasterBCompComp(), sameInstance(masterBCompComp));\r\n\t\t\t\t\r\n\t\t\t\tAssert.assertThat(\"masterBComp.getMasterBCompComp(), sameInstance(masterBCompComp)\", masterBComp.getMasterBCompComp(), sameInstance(masterBCompComp));\r\n\t\t\t\tAssert.assertThat(\"detailAEntCol, not(sameInstance(compDetailAEntCol))\", detailAEntCol, not(sameInstance(compDetailAEntCol)));\r\n\t\t\t\tAssert.assertThat(\"detailAEntCol, not(sameInstance(compCompDetailAEntCol))\", detailAEntCol, not(sameInstance(compCompDetailAEntCol)));\r\n\t\t\t\tAssert.assertThat(\"compDetailAEntCol, not(sameInstance(compCompDetailAEntCol))\", compDetailAEntCol, not(sameInstance(compCompDetailAEntCol)));\r\n\t\t\t\t\r\n\t\t\t\tsqlLogInspetor.disable();\r\n\t\t\t\t\r\n\t\t\t\treturn null;\r\n\t\t\t}", "private void executeTransaction(ArrayList<Request> transaction) {\n // create a new TransactionMessage\n TransactionMessage tm = new TransactionMessage(transaction);\n //if(tm.getStatementCode(0)!=8&&tm.getStatementCode(0)!=14)\n // return;\n try {\n ByteArrayOutputStream bos = new ByteArrayOutputStream();\n ObjectOutputStream oos = new ObjectOutputStream(bos);\n oos.writeObject(tm);\n oos.flush();\n\n byte[] data = bos.toByteArray();\n\n byte[] buffer = null;\n long startTime = System.currentTimeMillis();\n buffer = clientShim.execute(data);\n long endTime = System.currentTimeMillis();\n if (reqIndex < maxNoOfRequests && id > 0) {\n System.out.println(\"#req\" + reqIndex + \" \" + startTime + \" \" + endTime + \" \" + id);\n }\n reqIndex++;\n\n father.addTransaction();\n\n // IN THE MEAN TIME THE INTERACTION IS BEING EXECUTED\n\n\t\t\t\t/*\n\t\t\t\t * possible values of r: 0: commit 1: rollback 2: error\n\t\t\t\t */\n int r = ByteBuffer.wrap(buffer).getInt();\n //System.out.println(\"r = \"+r);\n if (r == 0) {\n father.addCommit();\n } else if (r == 1) {\n father.addRollback();\n } else {\n father.addError();\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public TokenTransactions() {}", "private Tx createTransaction(BitCoinResponseDTO btcDTO, SellerBitcoinInfo sbi) {\n\t\t\n\t\tTx tx = new Tx();\n\t\t\n\t\t\n\t\ttx.setDate(new Date());\n\t\ttx.setAmountOfMoney(btcDTO.getPrice_amount());\n\t\ttx.setStatus(TxStatus.PENDING);\n\t\ttx.setRecieverAddress(btcDTO.getPayment_url());\n\t\ttx.setorder_id(btcDTO.getId()); //ovaj id je na coin gate-u i moram ga cuvati u transakciji\n\t\ttx.setTxDescription(\"Porudzbina je kreirana od strane korisnika\");\n\t\ttx.setSbi(sbi);\n\t\t\n\t\t//trebace ovde jos da se setuje id korisnika koji je kreirao porudzbinu kako bi kasnije mogao da getuje sve\n\t\t//njegove transakcije\n\t\t\n\t\t\n\t\treturn tx;\n\t\t\n\t}", "public TarArchiveEntry() {\n this.version = VERSION_POSIX;\n this.name = \"\";\n this.linkName = \"\";\n this.linkFlag = LF_GNUTYPE_LONGNAME;\n String user = System.getProperty(\"user.name\", \"\");\n if (user.length() > MAX_NAMELEN) {\n user = user.substring(0, MAX_NAMELEN);\n }\n this.userName = user;\n this.groupName = \"\";\n this.userId = 0;\n this.groupId = 0;\n this.mode = DEFAULT_FILE_MODE;\n }", "public Transaction createTransaction(Credentials user, TransactionType tt) throws RelationException;", "void perform(Transaction tx,\n String userPrincipal,\n FedoraId fedoraId,\n String filename,\n String contentType,\n Collection<URI> digests,\n InputStream contentBody,\n long size,\n ExternalContent externalContent);", "@Override\n public Transaction getTransaction(NulsDigestData txHash) {\n return null;\n }", "public Transaction startTransaction(){\n\t\ttr = new Transaction(db);\n\t\treturn tr;\n\t}", "public MiradorTransaction(FujabaTransaction fujaba_tx) {\n tx_name_ = fujaba_tx.getName();\n tx_id_ = fujaba_tx.getId();\n merge_side_ = fujaba_tx.getMergeSide();\n initialize(fujaba_tx);\n }", "public abstract void generateReceipt(Transaction trans);", "TCommit createCommit();", "public Transaction getTransaction() {\n return transaction;\n }", "public ZipArchiveEntry(final java.util.zip.ZipEntry entry) throws ZipException {\n super(entry);\n setName(entry.getName());\n final byte[] extra = entry.getExtra();\n if (extra != null) {\n setExtraFields(ExtraFieldUtils.parse(extra, true, ExtraFieldUtils.UnparseableExtraField.READ));\n } else {\n setExtra();\n }\n setMethod(entry.getMethod());\n this.size = entry.getSize();\n }", "public TranscriptEntry(String filename) {\n JSONParser jsonParser = new JSONParser();\n try (FileReader reader = new FileReader(filename)){\n Object obj = jsonParser.parse(reader);\n\n JSONObject entry = (JSONObject) obj;\n JSONObject myCourse = (JSONObject) entry.get(\"course\");\n course = parseCourse(myCourse);\n grade = (String) entry.get(\"grade\");\n inProgress = (boolean) entry.get(\"inProgress\");\n courseComplete = (boolean) entry.get(\"courseComplete\");\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "Transaction getCurrentTransaction();", "protected final Transaction addTransaction(Transaction trans) {\n\t\treturn addTransactionTo(getAccount(), trans);\n\t}", "private Transaction(Engine destination, ByteBuffer bytes) {\n this(destination);\n deserialize(bytes);\n setStatus(Status.COMMITTED);\n\n }", "public TempTable(Schema sch, Transaction tx) {\r\n\t\tString tblname = nextTableName();\r\n\t\tti = new TableInfo(tblname, sch);\r\n\t\tthis.tx = tx;\r\n\t\tFileHeaderFormatter fhf = new FileHeaderFormatter();\r\n\t\tBuffer buff = tx.bufferMgr().pinNew(ti.fileName(), fhf);\r\n\t\ttx.bufferMgr().unpin(buff);\r\n\t}", "public long createTransaction(Credentials c, TransactionType tt) throws RelationException;", "public HeaderDescriptor() \n {\n super();\n xmlName = \"header\";\n elementDefinition = true;\n \n //-- set grouping compositor\n setCompositorAsSequence();\n org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;\n org.exolab.castor.mapping.FieldHandler handler = null;\n org.exolab.castor.xml.FieldValidator fieldValidator = null;\n //-- initialize attribute descriptors\n \n //-- initialize element descriptors\n \n //-- _transactionId\n desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(long.class, \"_transactionId\", \"transaction-id\", org.exolab.castor.xml.NodeType.Element);\n handler = new org.exolab.castor.xml.XMLFieldHandler() {\n public java.lang.Object getValue( java.lang.Object object ) \n throws IllegalStateException\n {\n Header target = (Header) object;\n if(!target.hasTransactionId())\n return null;\n return new java.lang.Long(target.getTransactionId());\n }\n public void setValue( java.lang.Object object, java.lang.Object value) \n throws IllegalStateException, IllegalArgumentException\n {\n try {\n Header target = (Header) object;\n // ignore null values for non optional primitives\n if (value == null) return;\n \n target.setTransactionId( ((java.lang.Long)value).longValue());\n }\n catch (java.lang.Exception ex) {\n throw new IllegalStateException(ex.toString());\n }\n }\n public java.lang.Object newInstance( java.lang.Object parent ) {\n return null;\n }\n };\n desc.setHandler(handler);\n desc.setRequired(true);\n desc.setMultivalued(false);\n addFieldDescriptor(desc);\n \n //-- validation code for: _transactionId\n fieldValidator = new org.exolab.castor.xml.FieldValidator();\n fieldValidator.setMinOccurs(1);\n { //-- local scope\n LongValidator typeValidator = new LongValidator();\n typeValidator .setMinInclusive(-1L);\n typeValidator .setMaxInclusive(4294967295L);\n fieldValidator.setValidator(typeValidator);\n }\n desc.setValidator(fieldValidator);\n //-- _opName\n desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, \"_opName\", \"op-name\", org.exolab.castor.xml.NodeType.Element);\n desc.setImmutable(true);\n handler = new org.exolab.castor.xml.XMLFieldHandler() {\n public java.lang.Object getValue( java.lang.Object object ) \n throws IllegalStateException\n {\n Header target = (Header) object;\n return target.getOpName();\n }\n public void setValue( java.lang.Object object, java.lang.Object value) \n throws IllegalStateException, IllegalArgumentException\n {\n try {\n Header target = (Header) object;\n target.setOpName( (java.lang.String) value);\n }\n catch (java.lang.Exception ex) {\n throw new IllegalStateException(ex.toString());\n }\n }\n public java.lang.Object newInstance( java.lang.Object parent ) {\n return null;\n }\n };\n desc.setHandler(handler);\n desc.setRequired(true);\n desc.setMultivalued(false);\n addFieldDescriptor(desc);\n \n //-- validation code for: _opName\n fieldValidator = new org.exolab.castor.xml.FieldValidator();\n fieldValidator.setMinOccurs(1);\n { //-- local scope\n StringValidator typeValidator = new StringValidator();\n typeValidator.setWhiteSpace(\"preserve\");\n fieldValidator.setValidator(typeValidator);\n }\n desc.setValidator(fieldValidator);\n //-- _opType\n desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(com.opengate.webservice.xml.types.OpTypeType.class, \"_opType\", \"op-type\", org.exolab.castor.xml.NodeType.Element);\n handler = new org.exolab.castor.xml.XMLFieldHandler() {\n public java.lang.Object getValue( java.lang.Object object ) \n throws IllegalStateException\n {\n Header target = (Header) object;\n return target.getOpType();\n }\n public void setValue( java.lang.Object object, java.lang.Object value) \n throws IllegalStateException, IllegalArgumentException\n {\n try {\n Header target = (Header) object;\n target.setOpType( (com.opengate.webservice.xml.types.OpTypeType) value);\n }\n catch (java.lang.Exception ex) {\n throw new IllegalStateException(ex.toString());\n }\n }\n public java.lang.Object newInstance( java.lang.Object parent ) {\n return null;\n }\n };\n handler = new org.exolab.castor.xml.handlers.EnumFieldHandler(com.opengate.webservice.xml.types.OpTypeType.class, handler);\n desc.setImmutable(true);\n desc.setHandler(handler);\n desc.setMultivalued(false);\n addFieldDescriptor(desc);\n \n //-- validation code for: _opType\n fieldValidator = new org.exolab.castor.xml.FieldValidator();\n { //-- local scope\n }\n desc.setValidator(fieldValidator);\n //-- _identifier\n desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, \"_identifier\", \"identifier\", org.exolab.castor.xml.NodeType.Element);\n desc.setImmutable(true);\n handler = new org.exolab.castor.xml.XMLFieldHandler() {\n public java.lang.Object getValue( java.lang.Object object ) \n throws IllegalStateException\n {\n Header target = (Header) object;\n return target.getIdentifier();\n }\n public void setValue( java.lang.Object object, java.lang.Object value) \n throws IllegalStateException, IllegalArgumentException\n {\n try {\n Header target = (Header) object;\n target.setIdentifier( (java.lang.String) value);\n }\n catch (java.lang.Exception ex) {\n throw new IllegalStateException(ex.toString());\n }\n }\n public java.lang.Object newInstance( java.lang.Object parent ) {\n return null;\n }\n };\n desc.setHandler(handler);\n desc.setRequired(true);\n desc.setMultivalued(false);\n addFieldDescriptor(desc);\n \n //-- validation code for: _identifier\n fieldValidator = new org.exolab.castor.xml.FieldValidator();\n fieldValidator.setMinOccurs(1);\n { //-- local scope\n StringValidator typeValidator = new StringValidator();\n typeValidator.setWhiteSpace(\"preserve\");\n fieldValidator.setValidator(typeValidator);\n }\n desc.setValidator(fieldValidator);\n //-- _connectorType\n desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(com.opengate.webservice.xml.types.ConnectorTypeType.class, \"_connectorType\", \"connector-type\", org.exolab.castor.xml.NodeType.Element);\n handler = new org.exolab.castor.xml.XMLFieldHandler() {\n public java.lang.Object getValue( java.lang.Object object ) \n throws IllegalStateException\n {\n Header target = (Header) object;\n return target.getConnectorType();\n }\n public void setValue( java.lang.Object object, java.lang.Object value) \n throws IllegalStateException, IllegalArgumentException\n {\n try {\n Header target = (Header) object;\n target.setConnectorType( (com.opengate.webservice.xml.types.ConnectorTypeType) value);\n }\n catch (java.lang.Exception ex) {\n throw new IllegalStateException(ex.toString());\n }\n }\n public java.lang.Object newInstance( java.lang.Object parent ) {\n return null;\n }\n };\n handler = new org.exolab.castor.xml.handlers.EnumFieldHandler(com.opengate.webservice.xml.types.ConnectorTypeType.class, handler);\n desc.setImmutable(true);\n desc.setHandler(handler);\n desc.setMultivalued(false);\n addFieldDescriptor(desc);\n \n //-- validation code for: _connectorType\n fieldValidator = new org.exolab.castor.xml.FieldValidator();\n { //-- local scope\n }\n desc.setValidator(fieldValidator);\n //-- _timestamp\n desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.util.Date.class, \"_timestamp\", \"timestamp\", org.exolab.castor.xml.NodeType.Element);\n handler = new org.exolab.castor.xml.XMLFieldHandler() {\n public java.lang.Object getValue( java.lang.Object object ) \n throws IllegalStateException\n {\n Header target = (Header) object;\n return target.getTimestamp();\n }\n public void setValue( java.lang.Object object, java.lang.Object value) \n throws IllegalStateException, IllegalArgumentException\n {\n try {\n Header target = (Header) object;\n target.setTimestamp( (java.util.Date) value);\n }\n catch (java.lang.Exception ex) {\n throw new IllegalStateException(ex.toString());\n }\n }\n public java.lang.Object newInstance( java.lang.Object parent ) {\n return new java.util.Date();\n }\n };\n handler = new org.exolab.castor.xml.handlers.DateFieldHandler(handler);\n desc.setImmutable(true);\n desc.setHandler(handler);\n desc.setRequired(true);\n desc.setMultivalued(false);\n addFieldDescriptor(desc);\n \n //-- validation code for: _timestamp\n fieldValidator = new org.exolab.castor.xml.FieldValidator();\n fieldValidator.setMinOccurs(1);\n { //-- local scope\n }\n desc.setValidator(fieldValidator);\n //-- _notification\n desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(com.opengate.webservice.xml.Notification.class, \"_notification\", \"notification\", org.exolab.castor.xml.NodeType.Element);\n handler = new org.exolab.castor.xml.XMLFieldHandler() {\n public java.lang.Object getValue( java.lang.Object object ) \n throws IllegalStateException\n {\n Header target = (Header) object;\n return target.getNotification();\n }\n public void setValue( java.lang.Object object, java.lang.Object value) \n throws IllegalStateException, IllegalArgumentException\n {\n try {\n Header target = (Header) object;\n target.setNotification( (com.opengate.webservice.xml.Notification) value);\n }\n catch (java.lang.Exception ex) {\n throw new IllegalStateException(ex.toString());\n }\n }\n public java.lang.Object newInstance( java.lang.Object parent ) {\n return new com.opengate.webservice.xml.Notification();\n }\n };\n desc.setHandler(handler);\n desc.setRequired(true);\n desc.setMultivalued(false);\n addFieldDescriptor(desc);\n \n //-- validation code for: _notification\n fieldValidator = new org.exolab.castor.xml.FieldValidator();\n fieldValidator.setMinOccurs(1);\n { //-- local scope\n }\n desc.setValidator(fieldValidator);\n //-- _ttl\n desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, \"_ttl\", \"ttl\", org.exolab.castor.xml.NodeType.Element);\n handler = new org.exolab.castor.xml.XMLFieldHandler() {\n public java.lang.Object getValue( java.lang.Object object ) \n throws IllegalStateException\n {\n Header target = (Header) object;\n if(!target.hasTtl())\n return null;\n return new java.lang.Integer(target.getTtl());\n }\n public void setValue( java.lang.Object object, java.lang.Object value) \n throws IllegalStateException, IllegalArgumentException\n {\n try {\n Header target = (Header) object;\n // if null, use delete method for optional primitives \n if (value == null) {\n target.deleteTtl();\n return;\n }\n target.setTtl( ((java.lang.Integer)value).intValue());\n }\n catch (java.lang.Exception ex) {\n throw new IllegalStateException(ex.toString());\n }\n }\n public java.lang.Object newInstance( java.lang.Object parent ) {\n return null;\n }\n };\n desc.setHandler(handler);\n desc.setMultivalued(false);\n addFieldDescriptor(desc);\n \n //-- validation code for: _ttl\n fieldValidator = new org.exolab.castor.xml.FieldValidator();\n { //-- local scope\n IntegerValidator typeValidator= new IntegerValidator();\n typeValidator.setMinInclusive(-1);\n typeValidator.setMaxInclusive(2147483647);\n fieldValidator.setValidator(typeValidator);\n }\n desc.setValidator(fieldValidator);\n }", "public interface TransactionInterface {\n\n\t/**\n\t * Get metadata about the transaction, this is used when the transaction is generated on the server\n\t * @return \n\t */\n\tpublic ActH01 getActH01();\n\t\n\tpublic void setActH01(ActH01 actH01);\n\t\n\t/**\n\t * \n\t * @return Get metadata about the transaction, this comes from the client\n\t */\n\tpublic ActH01 getClientActH01();\n\t\n\tpublic void setClientActH01(ActH01 actH01);\n\t\n\t/**\n\t * Get this transactions audit id\n\t * @return\n\t */\n\tpublic int getAuditId();\n\t\n\t/**\n\t * Get this transactions action type\n\t * @return\n\t */\n\tpublic int getActionType();\n\t\n\t/**\n\t * Get this transactions xml representation\n\t * @return\n\t */\n\tpublic String getAuditXml();\n\n\tpublic void setAuditXml(String xml);\n\n\t/**\n\t * Get this transactions replication, so get all the SQL that were executed by this transaction\n\t * @return\n\t */\n\tpublic String getReplicationXml();\n\n\tpublic void setReplicationXml(String xml);\n\t\n\t/**\n\t * Classpath location for the schema/xsd this transaction must be validated against\n\t * if this is not set or invalid you WILL NOT be able to execute the transaction \n\t * @return\n\t */\n\tpublic String getSchemaLocation();\n\n\t/**\n\t * \n\t * @param session\n\t * @return\n\t * @throws TransactionException\n\t * Execute the transaction, amongst other logic the transactions\n\t * executeWrite logic will be executed\n\t */\n\tpublic TransactionInterface executeWrite() throws TransactionException;\n\n}", "@Override\r\n\tpublic String toString() {\r\n\t\tString chaine = \"\\t * Transaction * \\t\\n\";\r\n\t\tchaine = chaine + \"[somme : \"+ this.somme + \"] \";\r\n\t\tchaine = chaine + \"[payeur : \"+ this.payeur + \"] \";\r\n\t\tchaine = chaine + \"[receveur :\"+ this.receveur + \"] \";\r\n\t\treturn chaine;\r\n\t}", "public Txn() {\n }", "public TransactionInfo getTransactionInfo(String transactionId){\n\t\tTransactionInfo trInfo = new TransactionInfo();\n\t\tfor (ExtendedBlock block: node.blockchain.getBlockchain()) {\n\t\t\tfor(StateTransaction tr: block.internBlock.transactions){\n\t\t\t\ttrInfo.transactionId = tr.getTransctionId();\n\t\t\t\ttrInfo.nonce = tr.getNonce();\n\t\t\t\ttrInfo.signature = tr.getSignature();\n\t\t\t\t\n\t\t\t\tif (tr instanceof StateDataTransaction) {\n\t\t\t\t\ttrInfo.fromAddress = ((StateDataTransaction)tr).GetAddressString();\n\t\t\t\t\ttrInfo.newValue = ((StateDataTransaction)tr).newValue;\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse if (tr instanceof StateTransferTransaction){\n\t\t\t\t\ttrInfo.fromAddress = CryptoUtil.getStringFromKey(((StateTransferTransaction)tr).fromAddress);\n\t\t\t\t\ttrInfo.toAddress = CryptoUtil.getStringFromKey(((StateTransferTransaction)tr).toAddress);\n\t\t\t\t\ttrInfo.amount = ((StateTransferTransaction)tr).amount;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// error unknown transaction in the chain\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\n\t\treturn trInfo;\n\t}", "public Transaction getTransaction() {\n return this.transaction;\n }", "private LedgerEntry buildLedgerEntry( Account account, String[] tupule ) \n throws Exception {\n \n LedgerEntry entry = new LedgerEntry() ;\n entry.setAccount( account ) ;\n entry.setValueDate( new Date( VALUE_DT_SDF.parse( tupule[1] ).getTime() ) ) ;\n \n entry.setRemarks( tupule[2] ) ;\n \n Float withdrawalAmt = getFloatValue( tupule[4] ) ;\n Float depositAmt = getFloatValue( tupule[5] ) ;\n if( depositAmt > 0 ) {\n entry.setAmount( depositAmt ) ;\n }\n else if( withdrawalAmt > 0 ) {\n entry.setAmount( -withdrawalAmt ) ;\n }\n \n entry.setBalance( getFloatValue( tupule[6] ) ) ;\n entry.generateHash() ;\n \n return entry ;\n }", "TarEntry CreateEntryFromFile(String fileName);", "BODY createBODY();", "public Transaction(String transactionID){\n\t\tString sql = \"SELECT * FROM mak213_bank1017.transaction \"; \n\t\tsql += \"WHERE transactionID = '\" + transactionID + \"'\"; \n\t\tSystem.out.println(sql);\n\t\tDbUtilities db = new MySqlUtilities();\n\t\ttry {\n\t\t\tResultSet rs = db.getResultSet(sql); \n\t\t\twhile(rs.next()){\n\t\t\t\tthis.transactionID = rs.getString(\"transactionID\");\n\t\t\t\tthis.accountID = rs.getString(\"accountID\");\n\t\t\t\tthis.type = rs.getString(\"type\");\n\t\t\t\tthis.amount = rs.getDouble(\"amount\");\n\t\t\t\tthis.balance = rs.getDouble(\"balance\");\n\t\t\t\tthis.transactionDate = new Date();\n\t\t\t}\n\t\t} catch (SQLException ex) {\n\t\t\tex.printStackTrace();\n\t\t\tErrorLogger.log(\"Could not retrieve transaction data\");\n\t\t\tErrorLogger.log(ex.getMessage());\n\t\t\t\n\t\t}\n\t\ttry {\n\t\t\tdb.closeDbConnection();\n\t\t} catch (SQLException e) {\n\t\t\tErrorLogger.log(\"Could not close connection\");\n\t\t\te.printStackTrace();\n\t\t} \n\n\t}", "private List<Transaction> getTransactionInformation(Map<Integer, CartLine> map) {\n\n\t\tlong subtotal = 0;\n\n\t\tfor (CartLine line : map.values()) {\n\n\t\t\tsubtotal += line.getUnitPrice() * line.getQuantity();\n\t\t}\n\n\t\tDetails details = new Details();\n\n\t\tdetails.setShipping(\"30000\");\n\t\tdetails.setSubtotal(\"\" + subtotal);\n\t\tdetails.setTax(\"0\");\n\n\t\tAmount amount = new Amount();\n\n\t\tamount.setCurrency(\"USD\");\n\t\tamount.setTotal(\"\" + (subtotal + 30000));\n\n\t\tamount.setDetails(details);\n\n\t\tTransaction transaction = new Transaction();\n\t\ttransaction.setAmount(amount);\n\t\ttransaction.setDescription(\"A\");\n\n\t\tItemList itemList = new ItemList();\n\n\t\tList<Item> items = new ArrayList<Item>();\n\n\t\tfor (CartLine line : map.values()) {\n\t\t\tItem item = new Item();\n\t\t\titem.setCurrency(\"USD\");\n\t\t\titem.setName(line.getProduct().getProductName());\n\t\t\titem.setPrice(\"\" + (line.getQuantity() * line.getUnitPrice()));\n\t\t\titem.setQuantity(\"\" + line.getQuantity());\n\n\t\t\titems.add(item);\n\t\t}\n\n\t\titemList.setItems(items);\n\t\ttransaction.setItemList(itemList);\n\n\t\tList<Transaction> transactions = new ArrayList<Transaction>();\n\t\ttransactions.add(transaction);\n\n\t\treturn transactions;\n\n\t}", "public void addTransaction(Transactions t){\n listOfTransactions.put(LocalDate.now(), t);\n }", "private void designBillTransactionInfo(CartReceiptResponse receiptResponse, final Document document, Locale locale)\n throws DocumentException, IOException {\n LOGGER.debug(\"Entered in designBillTransactionInfo() method\");\n SubmittedBill[] submittedBills = receiptResponse.getSubmittedBills();\n /* Start of Bill Submit Section */\n PdfPTable paymentSectionTable = new PdfPTable(3);\n paymentSectionTable.setWidths(new int[]{50, 150, 50});\n PdfPCell paymentSectionBlankSpaceCell = new PdfPCell(new Phrase(\" \", getFont(WHITE_COLOR, 8, Font.BOLD)));\n cellAlignment(paymentSectionBlankSpaceCell, Element.ALIGN_LEFT, GRAY_COLOR, 0);\n cellAddingToTable(paymentSectionTable, paymentSectionBlankSpaceCell, Rectangle.NO_BORDER, 3, 0);\n BigDecimal totalBillAmount = new BigDecimal(0);\n BigDecimal totalFeeAmount = new BigDecimal(0);\n Boolean flag = true;\n\n if (submittedBills != null && receiptResponse.getReturnedItems().length != 0) {\n returnPaymentHeading(locale, paymentSectionTable);\n for (final SubmittedBill submittedBill : submittedBills) {\n final ReturnReceiptItem[] returnReceiptItems = receiptResponse.getReturnedItems();\n for (final ReturnReceiptItem returnReceiptItem : returnReceiptItems) {\n long cartId = returnReceiptItem.getCartItemId();\n if (cartId == submittedBill.getId() &&\n submittedBill.getStatus().name().equalsIgnoreCase(PdfConstants.RETURNED)) {\n designReturnHeaderBillSection(submittedBill,\n returnReceiptItem,\n locale,\n paymentSectionTable,\n paymentSectionBlankSpaceCell, receiptResponse);\n }\n }\n }\n }\n\n if (submittedBills != null) {\n for (final SubmittedBill submittedBill : submittedBills) {\n BigDecimal transactionFee = new BigDecimal(0);\n if (submittedBill.getFee() != null) {\n transactionFee = submittedBill.getFee();\n }\n if (flag.equals(true)) {\n setTableForCells(paymentSectionTable, locale);\n cellAlignment(paymentSectionBlankSpaceCell, Element.ALIGN_LEFT, WHITE_COLOR, 0);\n cellAddingToTable(paymentSectionTable, paymentSectionBlankSpaceCell, Rectangle.NO_BORDER, 3, 0);\n flag = false;\n }\n\n\t\t\t\t/* Paid Biller Details Start */\n if (getStatusForPaid(submittedBill.getStatus().name())) {\n designSubmittedBillsSection(submittedBill, locale, paymentSectionTable);\n totalBillAmount = totalBillAmount.add(submittedBill.getAmount());\n totalFeeAmount = totalFeeAmount.add(transactionFee);\n }\n /* End Paid Biller Details */\n\n\t\t\t\t/* Failed Biller Details Start */\n if (getStatusForRejected(submittedBill.getStatus().name())) {\n LOGGER.debug(\"Enterd in to REJECTED Related section after checking all status\");\n designFailedBillsSection(locale, paymentSectionTable,\n submittedBill);\n }\n /* End Failed Biller Details */\n\n if (submittedBill.getStatus().name().equalsIgnoreCase(PdfConstants.RETURNED)) {\n LOGGER.debug(\"Enterd in to RETURNED Related section after checking all status\");\n designReturnedBillsSection(locale, paymentSectionTable, paymentSectionBlankSpaceCell,\n submittedBill);\n totalBillAmount = totalBillAmount.add(submittedBill.getAmount());\n totalFeeAmount = totalFeeAmount.add(transactionFee);\n }\n }\n }\n\n\t\t/* add blank Space Start */\n cellAlignment(paymentSectionBlankSpaceCell, Element.ALIGN_LEFT, WHITE_COLOR, 0);\n cellAddingToTable(paymentSectionTable, paymentSectionBlankSpaceCell, Rectangle.NO_BORDER, 3, 0);\n /* add blank space end */\n\n\t\t/* Calculating and displaying card service fee amount and service fee percent*/\n totalBillAmount = totalBillAmount.add(getCardServiceFeeAmount(receiptResponse, paymentSectionTable\n , paymentSectionBlankSpaceCell, locale));\n\t\t/* End of Card service fee */\n\n\t\t/* bill Total Paid start */\n drawTotalAmountCell(paymentSectionTable, paymentSectionBlankSpaceCell, locale, totalBillAmount, totalFeeAmount);\n /* bill Total Paid End */\n /* Add Line separator to the PDF document */\n addLineSeperator(paymentSectionTable, paymentSectionBlankSpaceCell);\n /* End of line separator */\n\n document.add(paymentSectionTable);\n LOGGER.debug(\"End pdfPaymentSection Table \");\n\n\n }", "public String toString(){\t\t\n //---------------------------------------------------------------------------\n StringBuffer buff=new StringBuffer(\"\\n*****ClassSQLContract: \"); \n buff.append(\"\\tbuffer=\"+buffer.toString()); \n buff.append(\"\\theaderDefinition=\"+header); \n buff.append(\"\\tsqlTagsGeneratorTable=\"+sqlTagsGeneratorTable); \n buff.append(\"\\ttableName=\"+tableName); \n return buff.toString(); \n\t}", "public Transaction() {\n this(0, 0, null);\n }", "public abstract Response makeTransfer(Transaction transaction) throws AccountNotFoundException, InsufficientFundsException;", "private Collection<StorableTransaction> getTransactionList(Object body) {\r\n Collection<StorableTransaction> txs = new ArrayList<>();\r\n JsonObject data = (JsonObject) body;\r\n data.getJsonArray(ID_COLLECTION).forEach(json -> {\r\n StorableTransaction tx = Serializer.unpack((JsonObject) json, StorableTransaction.class);\r\n tx.setTimestamp(timestampFrom(data.getLong(ID_TIME)));\r\n txs.add(tx);\r\n });\r\n return txs;\r\n }", "public Object getTransactionId() throws StandardException;", "TxnRequestProto.TxnRequest getTxnrequest();", "public HistoryEntryInventory(String itemName, Integer amount) {\n timestamp = new Date(); //Current time\n this.itemName = itemName;\n this.amount = amount;\n }", "@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)\n public void setTaskContent(Task taskObj, Boolean inbound, Map<String, Object> taskContent) {\n EntityManager eManager = null;\n ObjectOutputStream out = null; \n try {\n eManager = humanTaskEMF.createEntityManager();\n uTrnx.begin();\n \n ByteArrayOutputStream bos = new ByteArrayOutputStream();\n out = new ObjectOutputStream(bos);\n out.writeObject(taskContent);\n out.close();\n byte[] byteResults = bos.toByteArray();\n \n // persist the serialized results map into Content table\n Content content = new Content();\n content.setContent(byteResults);\n eManager.persist(content); // will generate a unique id for this content by jpa\n \n ContentData contentData = new ContentData();\n contentData.setContent(byteResults);\n contentData.setAccessType(org.jbpm.task.AccessType.Inline);\n taskObj.getTaskData().setOutput(content.getId(), contentData);\n eManager.merge(taskObj);\n \n uTrnx.commit();\n log.info(\"setTaskContent() taskId = \"+taskObj.getId()+\" : inbound = \"+inbound+\" contentBytes size = \"+byteResults.length);\n } catch(Exception x) {\n throw new RuntimeException(x);\n } finally {\n if(eManager != null)\n eManager.close();\n try {\n if(out != null)\n out.close();\n }catch(Exception x){x.printStackTrace();}\n }\n }", "void startTransaction();", "@Override\r\n public String toString() {\r\n return \"V1Settlement [\" + \"id=\" + id + \", status=\" + status + \", totalMoney=\" + totalMoney\r\n + \", initiatedAt=\" + initiatedAt + \", bankAccountId=\" + bankAccountId + \", entries=\"\r\n + entries + \"]\";\r\n }", "public boolean requestTransaction(String name,String reason,double amount){\n Transaction t1 = new Transaction(name,reason,amount);\n boolean done=t1.registertransaction();\n \n return done; \n \n}", "void beginTransaction();", "private void getTransactionDetailsRequest() {\r\n\t\tBasicXmlDocument document = new BasicXmlDocument();\r\n\t\tdocument.parseString(\"<\" + TransactionType.GET_TRANSACTION_DETAILS.getValue()\r\n\t\t\t\t+ \" xmlns = \\\"\" + XML_NAMESPACE + \"\\\" />\");\r\n\r\n\t\taddAuthentication(document);\r\n\t\taddReportingTransactionId(document);\r\n\r\n\t\tcurrentRequest = document;\r\n\t}", "public boolean doTransaction() {\r\n int nonce = -1;\r\n TransactionOperation transactionOperation = null;\r\n try {\r\n double balance;\r\n \r\n //read the stream for requests from client\r\n byte[] cipherText = (byte [])is.readObject();\r\n \r\n // decrypt the ciphertext to obtain the signed message\r\n ATMSessionMessage atmSessionMessage = (ATMSessionMessage) crypto.decryptRijndael(cipherText, kSession);\r\n if(!(currTimeStamp < atmSessionMessage.getTimeStamp())) error (\"Time stamp does not match\");\r\n \r\n //interpret the transaction operation in the request\r\n SignedMessage signedMessage = atmSessionMessage.getSignedMessage();\r\n \r\n \r\n \t\t//verify signature\r\n \t\ttry {\r\n \t\t\tif(!crypto.verify(signedMessage.msg, signedMessage.signature, currAcct.kPub))\r\n \t\t\t{\r\n \t\t\t\tSystem.out.println(\"Digital signature failed...\");\r\n \t\t\t}\r\n \t\t\tSystem.out.println(\"Message signature valid...\");\r\n \t\t} catch (SignatureException e2) {\r\n \t\t\te2.printStackTrace();\r\n \t\t\treturn false;\r\n \t\t} catch (KeyException e2) {\r\n \t\t\te2.printStackTrace();\r\n \t\t\treturn false;\r\n \t\t}\r\n \t\t\r\n TransactionMessage transactionMessage = (TransactionMessage)signedMessage.getObject();\r\n transactionOperation = transactionMessage.getOperation();\r\n \r\n //print the signed message\r\n System.out.println(\"\\n\" + (new Date()).toString());\r\n System.out.println(signedMessage.toString());\r\n \r\n //strip out the parameters embedded \r\n nonce = atmSessionMessage.getNonce();\r\n double value = transactionMessage.getValue();\r\n \r\n //print the timestamp when the transaction takes place\r\n Date now = new Date();\r\n System.out.println(\"\\n\" + now.toString());\r\n \r\n //re-route the request to the appropriate handling function\r\n if(transactionOperation == TransactionOperation.Deposit) {\r\n \t System.out.println(\"ACCT #:\" + currAcct.getNumber() + \" DEPOSIT: \" + value);\r\n currAcct.deposit(value);\r\n \r\n System.out.println(\"\\n\" + (now).toString());\r\n System.out.println(\"Deposit Complete. BALANCE:\" + currAcct.getBalance());\r\n }\r\n else if(transactionOperation == TransactionOperation.Withdraw) {\r\n \t System.out.println(\"ACCT #:\" + currAcct.getNumber() + \" WITHDRAW: \" + value);\r\n \t currAcct.withdraw(value);\r\n \t \r\n System.out.println(\"\\n\" + (now).toString());\r\n System.out.println(\"Withdrawal Complete. BALANCE:\" + currAcct.getBalance());\r\n }\r\n else if(transactionOperation == TransactionOperation.EndSession) \r\n \t {\r\n \t \tSystem.out.println(\"\\nTerminating session with ACCT#: \" + currAcct.getNumber());\r\n \t \treturn false;\r\n \t \t\r\n \t }\r\n \r\n accts.save();\r\n //create a successful reply Success and set the balance\r\n balance = currAcct.getBalance(); \r\n transactionMessage = new TransactionMessage(MessageType.ResponseSuccess,transactionOperation,balance);\r\n atmSessionMessage = new ATMSessionMessage(transactionMessage);\r\n \r\n //set the nonce \r\n atmSessionMessage.setNonce(nonce);\r\n currTimeStamp = atmSessionMessage.getTimeStamp();\r\n //encrypt the response and send it\r\n cipherText = crypto.encryptRijndael(atmSessionMessage, kSession);\r\n os.writeObject((Serializable)cipherText);\r\n \r\n //Logging.....\r\n //get the signed message and encrypt it\r\n \r\n signedMessage.encryptMessage(this.kLog);\r\n \r\n //encrypt the action\r\n //archive the signed message for logging and non-repudiation purposes \r\n SignedAction signedAction = new SignedAction(currAcct.getNumber(), atmSessionMessage.getTimeStamp(), signedMessage);\r\n \r\n //flush out transaction record to the audit file\r\n BankServer.log.write(signedAction);\r\n \r\n\t return true;\r\n }\r\n catch(Exception e){\r\n if(e instanceof TransException) replyFailure(transactionOperation,nonce);\r\n System.out.println(\"Terminating session with ACCT#: \" + currAcct.getNumber());\r\n \t//e.printStackTrace();\r\n \r\n return true;\r\n }\r\n }", "int insert(Transaction record);", "private Transaction creatTransaction(Bill bill, boolean b) {\n Transaction transaction = new Transaction();\n transaction.setDateOfTransaction(new Date());\n transaction.setCostOfTransaction(String.valueOf(bill.getCostOfBill()));\n transaction.setSerialOfTransaction(new TransactionSerialProducer().serialProducer());\n transaction.setFinished(b);\n transaction.setTypeOfTransaction(\"پرداخت قبض\");\n transaction.setBillingId(bill.getBillingId());\n transaction.setPaymentCode(bill.getPaymentCode());\n dbHelper = new DBHelper();\n dbHelper.insertTransaction(transaction);\n return transaction;\n }", "@Override\n public JSONObject dataBody() {\n\n JSONObject transactionAmount = new JSONObject();\n transactionAmount.put(\"value\", this.transactionAmount);\n transactionAmount.put(\"currency\", this.currency);\n\n JSONObject userInfo = new JSONObject();\n userInfo.put(\"custId\", this.customerId);\n\n JSONObject body = new JSONObject();\n body.put(\"requestType\", \"NATIVE_SUBSCRIPTION\");\n body.put(\"mid\", this.getMerchantId());\n body.put(\"websiteName\", \"WEBSTAGING\");\n body.put(\"orderId\", this.getOrderId());\n body.put(\"subscriptionPaymentMode\", this.subscriptionPaymentMode);\n body.put(\"subscriptionAmountType\", this.subscriptionAmountType);\n body.put(\"subscriptionMaxAmount\", this.subscriptionMaxAmount);\n body.put(\"subscriptionFrequency\", this.subscriptionFrequency);\n body.put(\"subscriptionFrequencyUnit\", this.subscriptionFrequencyUnit);\n body.put(\"subscriptionStartDate\", this.subscriptionStartDate);\n body.put(\"subscriptionExpiryDate\", this.subscriptionExpiryDate);\n body.put(\"subscriptionGraceDays\", this.subscriptionGraceDays);\n body.put(\"subscriptionEnableRetry\", this.subscriptionEnableRetry);\n body.put(\"subscriptionRetryCount\", this.subscriptionRetryCount);\n body.put(\"paytmSsoToken\", \"\");\n body.put(\"callbackUrl\", this.subscriptionCallbackURL);\n body.put(\"userInfo\", userInfo);\n body.put(\"txnAmount\", transactionAmount);\n\n return body;\n }", "public TarHeader(byte buff[]) throws IOException {\r\n this.header = buff;\r\n initlializeHeaderFields();\r\n }", "public boolean processTransaction() {\r\n\t\t\r\n\t\t\tif(verifySignature() == false) {\r\n\t\t\t\tSystem.out.println(\"#Transaction Signature failed to verify\");\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\ttransactionId = calulateHash();\r\n\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\treturn true;\r\n\t\t}", "void commit(Transaction transaction);", "public Transaction(int somme, int payeur, int receveur) {\r\n\t\tthis.somme = somme;\r\n\t\tthis.payeur = payeur;\r\n\t\tthis.receveur = receveur;\r\n\t}", "public Map<String, ArrayList<Record>> initiateTransaction(Records records) throws JAXBException;", "void sendTransactionToServer()\n \t{\n \t\t//json + sql magic\n \t}", "@Override\r\n\tpublic String toStringFormat() {\n\t\treturn transactionId + \" \" + merhcantId\r\n\t\t\t\t+ \" \" + transactionVolume + \" \" + transactionAmount\r\n\t\t\t\t+ \" \" + transactionDate+\"\\n\";\r\n\t}", "private void handleTransaction() throws Exception {\r\n\t\tString receiver;\r\n\t\tString amount;\r\n\t\tMessage sendTransaction = new Message().addData(\"task\", \"transaction\").addData(\"message\", \"do_transaction\");\r\n\t\tMessage response;\r\n\r\n\t\tthis.connectionData.getTerminal().write(\"enter receiver\");\r\n\t\treceiver = this.connectionData.getTerminal().read();\r\n\r\n\t\t// tries until a amount is typed that's between 1 and 10 (inclusive)\r\n\t\tdo {\r\n\t\t\tthis.connectionData.getTerminal().write(\"enter amount (1-10)\");\r\n\t\t\tamount = this.connectionData.getTerminal().read();\r\n\t\t} while (!amount.matches(\"[0-9]|10\"));\r\n\r\n\t\t// does the transaction\r\n\t\tsendTransaction.addData(\"receiver\", this.connectionData.getAes().encode(receiver)).addData(\"amount\",\r\n\t\t\t\tthis.connectionData.getAes().encode(amount));\r\n\r\n\t\tthis.connectionData.getConnection().write(sendTransaction);\r\n\r\n\t\tresponse = this.connectionData.getConnection().read();\r\n\t\tif (response.getData(\"message\").equals(\"success\")) {\r\n\t\t\tthis.connectionData.getTerminal().write(\"transaction done\");\r\n\t\t} else {\r\n\t\t\tthis.connectionData.getTerminal().write(\"transaction failed. entered correct username?\");\r\n\t\t}\r\n\t}", "com.google.protobuf.ByteString getTransactions(int index);", "public PaymentTransaction() {\n\t\tsuper(\"PAYMENT_TRANSACTION\", edu.uga.csci4050.group3.jooq.team3.Team3.TEAM3);\n\t}", "@Override public java.util.Map getExtra(int status) throws android.os.RemoteException\n{\nandroid.os.Parcel _data = android.os.Parcel.obtain();\nandroid.os.Parcel _reply = android.os.Parcel.obtain();\njava.util.Map _result;\ntry {\n_data.writeInterfaceToken(DESCRIPTOR);\n_data.writeInt(status);\nmRemote.transact(Stub.TRANSACTION_getExtra, _data, _reply, 0);\n_reply.readException();\njava.lang.ClassLoader cl = (java.lang.ClassLoader)this.getClass().getClassLoader();\n_result = _reply.readHashMap(cl);\n}\nfinally {\n_reply.recycle();\n_data.recycle();\n}\nreturn _result;\n}", "TR createTR();", "public Git.Entry getObject() { return ent; }" ]
[ "0.61393243", "0.59706783", "0.5804271", "0.574851", "0.5585244", "0.5507963", "0.5492807", "0.54041886", "0.5375431", "0.5300658", "0.52889746", "0.52506757", "0.5206115", "0.51721686", "0.5164416", "0.5154728", "0.51483315", "0.5131417", "0.5125987", "0.51158303", "0.50789905", "0.505465", "0.5051493", "0.50405174", "0.5011138", "0.5000986", "0.4995662", "0.4993629", "0.4982037", "0.49234048", "0.4915398", "0.4907296", "0.49046585", "0.49032223", "0.49010026", "0.48959607", "0.48906934", "0.4872401", "0.48607656", "0.4850272", "0.4848095", "0.4841979", "0.48316246", "0.48312855", "0.48312822", "0.48303372", "0.4817406", "0.48158818", "0.48156637", "0.4814554", "0.48032558", "0.47990763", "0.47989443", "0.47970608", "0.47955802", "0.47937125", "0.47868872", "0.4786424", "0.47788626", "0.47771198", "0.47650877", "0.4758786", "0.47580475", "0.47498924", "0.47472525", "0.47380215", "0.47204167", "0.47196016", "0.47115356", "0.47113144", "0.47055182", "0.4702339", "0.47019237", "0.470181", "0.46937975", "0.46936616", "0.46857876", "0.46839008", "0.46824548", "0.4679836", "0.4678198", "0.4677839", "0.4677837", "0.4668821", "0.4668382", "0.46650824", "0.4662763", "0.46567994", "0.46542066", "0.46474642", "0.46402758", "0.46330792", "0.46156466", "0.4614764", "0.4614395", "0.46134612", "0.4609441", "0.4605215", "0.45875058", "0.4587376", "0.4585674" ]
0.0
-1
new addition for loan interest accrued
public double getLoanAccruedInterest(String loanacctno, java.util.Date loancommencementdate, String branchId, String coyId, String intaccruedacct) { double accrint = 0.0; SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); String tempDate = formatter.format(loancommencementdate); String sql = "SELECT sum(debit) as totdebit FROM txns a inner join txnsheader b on a.txntype = b.txntype and a.txnserial = b.txnserial and a.companyid = b.companyid and a.branchid = b.branchid where a.accountno = '" + intaccruedacct + "' and a.docref = '" + loanacctno + "' and a.txntype = 'LIAP' and b.postdate >= {d '" + tempDate + "'} and a.branchid = " + branchId + " and a.companyid = " + coyId; Query query = sessionFactory.getCurrentSession().createSQLQuery(sql); accrint = (query == null || query.list().isEmpty()) ? 0.0 : (Double) query.list().get(0); return accrint; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void add_interest ()\r\n {\r\n\r\n balance += balance * (rate + BONUS_RATE);\r\n System.out.println (\"Interest added to account: \" + account);\r\n System.out.println (\"Current Balance: \" + balance);\r\n System.out.println();\r\n\r\n }", "public void addInterest() {\n\t\tdouble interest = getBalance() * interestRate / 100;\n\t\tdeposit(interest);\n\t}", "public void add_interest () \r\n {\r\n balance += balance * rate;\r\n System.out.println (\"Interest added to account: \" + account);\r\n System.out.println (\"Current Balance: \" + balance);\r\n System.out.println();\r\n\r\n }", "public void addInterest() {}", "public void interestIncrease(){\r\n for (SavingsAccount account : saving){\r\n if (account == null){\r\n break;\r\n }\r\n account.addInterest();\r\n }\r\n }", "public void increaseInterest() {\n\t\tthis.balance *= (1 + interestRate);\n\t}", "public void calcInterest() {\n double monthlyInterestRate = annualInterestRate / 12;\n double monthlyInterest = balance * monthlyInterestRate;\n balance += monthlyInterest;\n }", "@Override\r\n\tpublic void personalLoanInterest() {\n\t\t\r\n\t}", "public void applyInterest()\n {\n deposit( (getBalance()* getInterestRate()) /12);\n }", "public void earnMonthlyInterest(){\r\n\t\tbalance += balance * getYearlyInterestRate() / 12 ;\r\n\t}", "void updateInterest() {\n // FIXME: Currently unimplemented\n }", "public void calcInterest() {\n\t\tbalance = balance + (interestPct*balance);\n\t\t}", "@Override\r\n\tpublic void calculateLoanPayments() {\r\n\t\t\r\n\t\tBigDecimal numInstall = getNumberOfInstallments(this.numberOfInstallments);\r\n\t\tBigDecimal principle = this.loanAmount;\r\n\t\tBigDecimal duration = this.duration;\r\n\t\tBigDecimal totalInterest = getTotalInterest(principle, duration,\r\n\t\t\t\tthis.interestRate);\r\n\t\tBigDecimal totalRepayment = totalInterest.add(principle);\r\n\t\tBigDecimal repaymentPerInstallment = getRepaymentPerInstallment(\r\n\t\t\t\ttotalRepayment, numInstall);\r\n\t\tBigDecimal interestPerInstallment = getInterestPerInstallment(\r\n\t\t\t\ttotalInterest, numInstall);\r\n\t\tBigDecimal principlePerInstallment = getPrinciplePerInstallment(\r\n\t\t\t\trepaymentPerInstallment, interestPerInstallment, numInstall);\r\n\t\tBigDecimal principleLastInstallment = getPrincipleLastInstallment(\r\n\t\t\t\tprinciple, principlePerInstallment, numInstall);\r\n\t\tBigDecimal interestLastInstallment = getInterestLastInstallment(\r\n\t\t\t\ttotalInterest, interestPerInstallment, numInstall);\t\r\n\t\t\r\n\t\tfor(int i=0; i<this.numberOfInstallments-1;i++) {\r\n\t\t\tthis.principalPerInstallment.add(principlePerInstallment);\r\n\t\t\tthis.interestPerInstallment.add(interestPerInstallment);\r\n\t\t}\r\n\t\tthis.principalPerInstallment.add(principleLastInstallment);\r\n\t\tthis.interestPerInstallment.add(interestLastInstallment);\r\n\t}", "public void calculateMonthlyInterest(){\n double currentMonth;\n currentMonth = (double)(this.savingsBalance*annualInterestRate/12);\n this.savingsBalance += currentMonth;\n }", "public void calculateMonthlyInterest() {\r\n addSavingsBalance(getSavingsBalance().\r\n multiply(annualInterestRate.divide(\r\n BigDecimal.valueOf(12.0), 10, RoundingMode.HALF_UP)));\r\n }", "public void GetInterest() {\n\t\tSystem.out.println(\"balance=\"+bal);\r\n\t\tinterest_rate=((bal/100)*10);\r\n\t\t\r\n\t\tSystem.out.println(\"Interest :- \"+ interest_rate);\r\n\t\tbal=(int) (bal+interest_rate);\r\n\t\tSystem.out.println(\"Balance after interest:- \"+bal );\r\n\t}", "private void calculateLoanPayment() {\n double interest =\n Double.parseDouble(tfAnnualInterestRate.getText());\n int year = Integer.parseInt(tfNumberOfYears.getText());\n double loanAmount =\n Double.parseDouble(tfLoanAmount.getText());\n\n // Create a loan object. Loan defined in Listing 10.2\n loan lloan = new loan(interest, year, loanAmount);\n\n // Display monthly payment and total payment\n tfMonthlyPayment.setText(String.format(\"$%.2f\",\n lloan.getMonthlyPayment()));\n tfTotalPayment.setText(String.format(\"$%.2f\",\n lloan.getTotalPayment()));\n }", "public static void calculateLoanPayment() {\n\t\t//get values from text fields\n\t\tdouble interest = \n\t\t\t\tDouble.parseDouble(tfAnnualInterestRate.getText());\n\t\tint year = Integer.parseInt(tfNumberOfYears.getText());\n\t\tdouble loanAmount =\n\t\t\t\tDouble.parseDouble(tfLoanAmount.getText());\n\t\t\n\t\t//crate a loan object\n\t\t Loan loan = new Loan(interest, year, loanAmount);\n\t\t \n\t\t //Display monthly payment and total payment\n\t\t tfMonthlyPayment.setText(String.format(\"$%.2f\", loan.getMonthlyPayment()));\n\t\t tfTotalPayment.setText(String.format(\"$%.2f\", loan.getTotalPayment()));\n\t}", "public double getBalancePlusInterest()\n {\n return startingBalance * (1 + (interestRate / 12));\n }", "private void processOnLoanData(long phAwal, long premiAmountSumUpCurrentValue){\n long count = phAwal+premiAmountSumUpCurrentValue;\n //LogUtility.logging(TAG,LogUtility.infoLog,\"processOnLoanData\",\"count\",count+\"\");\n pokokHutang.add(count);\n }", "public void addInterestEarned(Equity holding) {\n \n double time = 0;\n double intrst = 0;\n double price = holding.getSimulationPrice();\n double newPrice = price;\n int steps = amount;\n \n switch(interval) {\n \n case DAY:\n time = amount / 365.0;\n break;\n case MONTH:\n time = amount / 12.0;\n break;\n case YEAR:\n time = amount;\n break;\n }\n \n switch(simType) {\n \n case NONE:\n holding.addPriceChange(newPrice);\n return;\n \n case BEAR:\n intrst = price * percentage * time;\n steps = amount;\n \n while(steps != 0) { \n \n newPrice -= ((1.0/amount) * intrst);\n steps--;\n }\n \n holding.addPriceChange(newPrice);\n break;\n \n case BULL:\n intrst = price * percentage * time;\n steps = amount;\n \n while(steps != 0) {\n \n newPrice += ((1.0/amount) * intrst);\n steps--;\n }\n \n holding.addPriceChange(newPrice);\n break;\n }\n }", "public double calcInterest(){\n double interest = (interestRate + 1) * balance;\n return interest;\n }", "private static void currentLoan() {\n\t\toutput(\"\");\r\n\t\tfor (loan loan : library.currentLoan()) {// method name changes CURRENT_LOANS to currentLoan() , variable name LIB to library\r\n\t\t\toutput(loan + \"\\n\");\r\n\t\t}\t\t\r\n\t}", "public void addBalance()\n\t\t{\n\t\t\tthis.setBalance_acc2(this.getBalance_acc2() + this.getTemp_d_acc2());\n\t\t}", "public void addInterest(TXSemanticTag interest);", "public void addMoney(double profit){\n money+=profit;\n }", "public void increase() {\n balance.multiply(1.001);\n }", "public void takeOutLoan(double value)\r\n {\r\n loan += value;\r\n addCash(value);\r\n }", "public Account getUpdatedAccount(Player p) {\n\n\t\tAccount a = getAccount(p);\n\t\tif (a != null) {\n\n\t\t\t// update Account with pending interest\n\n\t\t\tDate today = new Date();\n\t\t\tlong now = today.getTime() / 86400000 ;\n\t\t\t/* 'now' is an integral number of days since epoch.\n\t\t\t * There are 86,400 seconds in a day, and 1000 'ticks' in a getTime() value.\n\t\t\t * Interest is considered to compound at midnight\n\t\t\t */\n\t\t\t\n\t\t\t// Update account with accumulated interest, if applicable\n\t\t\t\n\t\t\tif (a.lastUpdate > 0 && rate > 1.0) {\n\t\t\t\tlong periods = now - a.lastUpdate;\n\t\t\t\tif (periods > 0) {\n\t\t\t\t\tBigDecimal oldamt = a.money;\n\t\t\t\t\tdouble newamt = oldamt.doubleValue() * Math.pow(rate, periods);\n\t\t\t\t\ta.money = new BigDecimal(newamt, context);\n\t\t\t\t\ta.money = a.money.setScale(Currency.getDecimals(), RoundingMode.HALF_UP);\n\t\t\t\t\tif (a.money.compareTo(maxMoney) > 0)\n\t\t\t\t\t\ta.money = maxMoney;\n\t\t\t\t\tBigDecimal interest = a.money.subtract(oldamt);\n\t\t\t\t\t\n\t\t\t\t\tp.sendMessage(ChatColor.YELLOW + \"Interest applied: \" + interest);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\ta.lastUpdate = now;\n\t\t\t\n\t\t}\n\t\treturn a;\n\t}", "public void calculateLoan(View view){\n Intent intent = new Intent(this, ResultActivity.class);\n\n //TODO: calculate monthly payment and determine\n double carPrice;\n double downPayment;\n double loadPeriod;\n double interestRate;\n\n \n\n //loan application status; approve or reject\n double monthlyPayment;\n String status;\n\n //Passing data using putExtra method\n //putExtra(TAG, value)\n intent.putExtra(MONTHLY_PAYMENT, monthlyPayment);\n intent.putExtra(LOAN_STATUS, status);\n startActivity(intent);\n }", "void addToAmount(double amount) {\n this.currentAmount += amount;\n }", "static int loanHelper(int principle,double interest,int payment,int month) {\n\n\t\tif (principle<=payment){ \n\t\t\tif (principle<=0) return 0;\n\t\t\telse { \n\t\t\t\tSystem.out.println(\"Month \" + month + \": $\" + principle); \n\t\t\t\treturn 1;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t\tSystem.out.println(\"Month \" + month + \": $\" + principle); \n\t\tmonth++;\n\t\treturn 1+ loanHelper((int) (((principle)*(1+interest/12))-payment), interest, payment,month);\n\n\n\n\t}", "public static void enterDetails(int num, double interest){\r\n Scanner s = new Scanner(System.in);\r\n String name;\r\n double amm=0;\r\n int term=-1;\r\n \r\n int loanType;\r\n \r\n do{\r\n System.out.println(\"Press 1: Business Loan\\n\"\r\n + \"Press 2: Personal Loan\");\r\n loanType = parseInt(s.next());\r\n }while(!(loanType == 1 || loanType == 2));\r\n \r\n while(amm <= 0 || amm > 100000){\r\n System.out.print(\"Enter loan ammount: \");\r\n amm = parseDouble(s.next());\r\n if(amm > 100000){\r\n System.out.println(\"Loan exceeds limit\");\r\n }\r\n }\r\n System.out.print(\"Enter the term in years: \");\r\n term = parseInt(s.next());\r\n if(!(term==3 || term==5)){\r\n System.out.println(\"Loan term set to 1 year\");\r\n }\r\n \r\n System.out.print(\"Enter last name: \");\r\n name = s.next();\r\n \r\n switch (loanType) {\r\n case 1:\r\n BusinessLoan b = new BusinessLoan(num, name, amm, term, interest);\r\n if(b.loanNum!=-1){\r\n loan.add(b);\r\n System.out.println(\"Loan approved\");\r\n } \r\n break;\r\n case 2:\r\n PersonalLoan p = new PersonalLoan(num, name, amm, term, interest);\r\n if(p.loanNum!=-1){\r\n loan.add(p);\r\n System.out.println(\"Loan approved\");\r\n }\r\n break;\r\n }\r\n System.out.println(\"---------------------------------------------\");\r\n }", "public void addBalance(long balance) {\r\n this.balance += balance;\r\n }", "public double getInterest(){return this.interest_rate;}", "public double getLoan()\r\n {\r\n return loan;\r\n }", "public void addCash(double added_cash) {\n cash += added_cash;\n }", "void addBalance(double amount) {\n\t\tbalance += amount;\n\t}", "void addIncomeToBudget();", "public void edicationLoan() {\n\t\tSystem.out.println(\"hsbc -- education loan\");\n\t\t\n\t}", "public void addMoney(int income) {\r\n\t\tmoney += income;\r\n\t}", "private static double totalPrice(double price_interest, double dwnpymnt) {\n \treturn price_interest + dwnpymnt;\n }", "private void increment() {\r\n salary = (int) (salary + salary * 0.2);\r\n }", "long getOpenInterest();", "ch.crif_online.www.webservices.crifsoapservice.v1_00.Amount addNewAmount();", "public void add(Double addedAmount) {\n }", "private void chargeInterest() {\n for(Map.Entry<String, Customer> entry : customers.entrySet()) {\n Customer customer = entry.getValue();\n payInterest(customer);\n }\n //collect interests from hasLoans\n for(Map.Entry<String, Customer> entry : hasloans.entrySet()) {\n Customer customer = entry.getValue();\n collectInterest(customer);\n }\n\n }", "public void calculateInterest(ActionEvent event) {\n try {\n double startkapital = Double.parseDouble(initialCapitalTextField.getText());\n double zinssatz = Double.parseDouble(interestRateTextField.getText());\n double laufzeit = Double.parseDouble(runningTimeTextField.getText());\n double zinsenOhneStartkapitalUndHoch = (1 + zinssatz / 100);\n double zinsenOhneStartkapitalMitHoch = Math.pow(zinsenOhneStartkapitalUndHoch, laufzeit);\n double zinsen = (zinsenOhneStartkapitalMitHoch * startkapital) - startkapital;\n\n interestLabel.setText(String.valueOf(zinsen));\n } catch (NumberFormatException e) {\n Alert alert = new Alert(Alert.AlertType.ERROR, \"Ungültige oder fehlende Eingabe\");\n alert.show();\n }\n }", "public void addToBill(int newBill){\n Bill = Bill + newBill;\n }", "public void AddCredits(int credits)\n {\n this.credits += credits;\n }", "public static void addAccount(String accType, float balance, String fName, String lName, float interest) {\n\t\tStatement stmt;\n\t\ttry {\n\t\t\tstmt = con.getConnection().createStatement();\n\t\t\t// insert the data\n\t\t\t\n\t\t\tjava.sql.Date currentDate = new java.sql.Date(Calendar.getInstance().getTime().getTime());\n\n\t\t\t\n\t\t\tstmt.executeUpdate(\"INSERT INTO ser322.account \" + \"VALUES (NULL, '\" + accType + \"', \" + balance + \", '\" + currentDate + \"'); \" +\n\t\t\t\"SET @last_id_in_account = Last_INSERT_ID();\" + \n\t\t\t\"INSERT INTO interest_rate VALUES(@last_id_in_account, (SELECT accType FROM account WHERE accID = @last_id_in_account),\" + interest + \");\");\n\t\t\t\n\t\t} catch (SQLException e) {\n\t\t\tSystem.out.println(\"[ERROR] - Add Account Error\");\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\tAccountsManager.populateFromSQL();\n\t\tAccountsPanel.refreshTabel(); \n\t \n\n\t}", "public void educationloan()\n\t\n\t{\n\t\tSystem.out.println(\"hsbc own education loans\");\n\t\t\n\t}", "@Override\n public double annualSalary(){\n double bonus = 0.00;\n\n if(currentStockPrice > 50){\n bonus = 30000;\n }\n\n return (super.annualSalary() + bonus);\n }", "@Override\n public double calculateInterest(double amount) {\n\t\treturn ( hasWithdrawalInPast10Days() ? 0.001 : 0.05 ) * amount;\n }", "public void updateInterest(){\n //Caculate when all fields are available\n String amountStr = amountInput.getText().toString();\n String yieldStr = annualizedYieldInput.getText().toString();\n String bankStr = bankInput.getText().toString();\n\n if (mStartDate!=null && mEndDate!=null\n && !Utils.isNullOrEmpty(amountStr)\n && !Utils.isNullOrEmpty(yieldStr)\n && !Utils.isNullOrEmpty(bankStr)){\n\n float days = Utils.getDiffDays(mStartDate,mEndDate);\n mAmount = Float.valueOf(amountStr);\n mYield = Float.valueOf(yieldStr);\n\n //Caculate the value\n mInterest = mAmount * (mYield/100)*(days/ Constants.DAYS_OF_ONE_YEAR);\n mInterest = Utils.roundFloat(mInterest);\n //Update the interest in UI\n expectedInterestInput.setText(Utils.formatFloat(mInterest));\n Log.d(Constants.LOG_TAG, \"start = \" + mStartDate.toString() + \"\\nend = \" + mEndDate.toString()\n + \"\\ndays = \" + days + \"\\namount = \" + mAmount + \"\\nyield = \" + mYield + \"\\ninterest = \" + mInterest);\n }\n }", "public void Deposit(double ammount){\n abal = ammount + abal;\n UpdateDB();\n }", "@Test\r\n\tpublic void withdraw() {\n\t\tResult<String> loanWithdraw = qddPaymentService.loanWithdraw(141227113319030002L);\r\n\t\tSystem.out.println(loanWithdraw);\r\n\t}", "public void annualProcess() {\n super.withdraw(annualFee);\n }", "public double addToBalance(double addAmount){\r\n\t\tbalance +=addAmount;\r\n\t\treturn balance;\r\n\t}", "private void addToBalance(double aBalance) {\n balance += aBalance;\n String out = String.format(\"<html><b>Balance</b><br>$%.2f</html>\", balance);\n balanceLabel.setText(out);\n }", "public void add (Document inLoan)\n \t{\n \t\tDuplicateLoanDataVO existingLoan;\n \t\tDuplicateLoanDataVO newLoan = new DuplicateLoanDataVO();\n \t\tString results = null;\n \n \t\tnewLoan.setDocument(inLoan);\n \n \t\tString key = XMLParser.getNodeValue(newLoan.getDocument(), \"APSUniqueAwardID\");\n \t\tif (key == null)\n \t\t{\n \t\t\tkey = \"0\";\n \t\t}\n \n \t\tInteger intKey = new Integer(key);\n \t\twhile (awardIdReference.containsKey(intKey))\n \t\t{\n \t\t\tintKey = new Integer(intKey.intValue() + 1);\n \t\t}\n \t\tawardIdReference.put(intKey, new Integer(newLoan.hashCode()));\n \n \t\tString dataProviderType = XMLParser.getNodeValue(newLoan.getDocument(), \"/Award/DataProviderType\");\n \t\tnewLoan.setProviderType(dataProviderType);\n \n \t\ttheLoanList.reset();\n \t\twhile (theLoanList.hasNext())\n \t\t{\n \t\t\texistingLoan = (DuplicateLoanDataVO)theLoanList.next();\n \t\t\tresults = dedupLoans(newLoan, existingLoan);\n \n \t\t\tif (results != null && results.equals(AggregateConstants.DUPLICATE))\n \t\t\t{\n \t\t\t\tlog.debug(\"Adding a duplicate loan\");\n \t\t\t\ttheLoanList.addDuplicate(existingLoan, newLoan);\n \t\t\t\treturn;\n \t\t\t}\n \t\t}\n \t\ttheLoanList.add(newLoan);\n \t}", "public synchronized void addToDonations(int amount){\n\t\ttotalDonations = totalDonations + amount;\n\t\t//System.out.println(\"Total Donations: \" +totalDonations);\n\t}", "public void saveLoan (Loan loan) throws SQLException{\n\t\tConnection conn = DataSource.getConnection();\n\t\t\n\t\ttry{\n\t\t\tString query = \"INSERT INTO loan (client_id, principal_amount, interest_rate, no_years, no_payments_yearly, start_date)\"\n\t\t\t\t\t\t+ \" VALUES ('\"+this.client_id+\"', \"+this.principal_amount+\", \"+this.interest_rate+\", \"+this.no_years+\", \"\n\t\t\t\t\t\t\t\t+ \"\"+this.no_payments_yearly+\", '\"+this.start_date+\"')\";\n\t\t\tStatement stat = conn.createStatement();\n\t\t\tstat.execute(query);\n\t\t\t\n\t\t\t// Deposit the money in the client's account\n\t\t\tClient client = Client.getClient(client_id);\n\t\t\tClient.deposit(client, principal_amount);\n\t\t}finally{\n\t\t\tconn.close();\n\t\t}\n\t}", "public Loan(double annualInterestRate, int numberOfYears, double loanAmount) {\n this.annualInterestRate = annualInterestRate;\n this.numberOfYears = numberOfYears;\n this.loanAmount = loanAmount;\n loanDate = new java.util.Date();\n }", "public void AddMoneySaved(double moneySaved){\n MoneySaved += moneySaved;\n }", "public void addToEstimate(double CO2Addition) {\n this.CO2 += CO2Addition;\n }", "void addBondToInvestmentAccount(Bond newBond, Ui ui) throws BankException {\n throw new BankException(\"This account does not support this feature\");\n }", "public void addMoney(final int newMoney) {\n\t\taddBehaviour(\n new OneShotBehaviour() {\n public void action() {\n budget += newMoney;\n System.out.println(newMoney + \" is added to wallet\");\n }\n }\n ); \n refreshGUI();\n }", "ch.crif_online.www.webservices.crifsoapservice.v1_00.Amount addNewCapitalPayed();", "public void applyInterest(double rate) {\n if ((rate > 0) && (balance < 0)) {\n withdraw((int) (-balance*rate));\n } \n if ((rate > 0) && (balance > 0)) {\n deposit((int) (balance*rate));\n }\n }", "@Override\n public Accumulator aggregate(Accumulator accumulator) {\n if (!getDate().isAfter(nextScheduledPaymentDate)) {\n amAttrs.setLoanAmount(accumulator.getBalance());\n MonetaryAmount periodInterest = AmortizationCalculator.getPeriodInterest(amAttrs);\n setTransaction(periodInterest);\n accumulator.addToBalance(periodInterest);\n setBalance(accumulator.getBalance());\n setFees(accumulator.getFeeBalance());\n setType(\"Period Interest\");\n setNote(\"Scheduled interest charge\");\n }\n\n return accumulator;\n\n }", "public ch.crif_online.www.webservices.crifsoapservice.v1_00.Amount addNewAmount()\n {\n synchronized (monitor())\n {\n check_orphaned();\n ch.crif_online.www.webservices.crifsoapservice.v1_00.Amount target = null;\n target = (ch.crif_online.www.webservices.crifsoapservice.v1_00.Amount)get_store().add_element_user(AMOUNT$6);\n return target;\n }\n }", "public double getInterest ()\n {\n return interest;\n }", "public void credit(double amount) {\n this.balance += amount;\n }", "public Bonus_Saver_Account (int account_num,double initial_balance, double interest_rate)\r\n {\r\n\r\n super (account_num, initial_balance, interest_rate);\r\n\r\n }", "public static void editLoanCost() {\n //We can only edit loan cost on Videos.\n char[] type = {'v'};\n String oldID = getExistingID(\"Video\", type);\n\n //Validate ID\n if (oldID != null) {\n //Run input validation\n String[] choiceOptions = {\"4\", \"6\"};\n int newLoan = Integer.parseInt(receiveStringInput(\"Enter new Loan Fee:\", choiceOptions, true, 1));\n try {\n //Replace the loan fee\n inv.replaceLoan(oldID, newLoan);\n } catch (IncorrectDetailsException e) {\n System.out.println(Utilities.ERROR_MESSAGE + \" Adding failed due to \" + e + \" with error message: \\n\" + e.getMessage());\n }\n } else System.out.println(Utilities.INFORMATION_MESSAGE + \"Incorrect ID, nothing was changed.\");\n }", "public void giveInterest(int accountId) throws SQLException,\n ConnectionFailedException,\n DatabaseInsertException {\n if (this.currentUserAuthenticated && this.currentCustomerAuthenticated) {\n // find if the account belongs to the user\n //List<Integer> accountIds = DatabaseSelectHelper.getAccountIds(this.currentUser.getId());\n boolean contains = false;\n int i = 0;\n List<Account> customerAccountList = this.currentCustomer.getAccounts();\n for (Account e : customerAccountList) {\n if (e.getId() == accountId) {\n contains = true;\n break;\n }\n i++;\n }\n \n if (contains) {\n // find out which account type it is\n // add interest to the account and update the balance\n // update database\n int role = DatabaseSelectHelper.getAccountType(accountId);\n BigDecimal interestRate = new BigDecimal(\"0\");\n // calculate balance after interest rate\n interestRate = DatabaseSelectHelper.getInterestRate(role).add(new BigDecimal(\"1\"));\n BigDecimal oldBalance = DatabaseSelectHelper.getBalance(accountId);\n BigDecimal newBalance = oldBalance.multiply(interestRate);\n newBalance = newBalance.setScale(2, RoundingMode.HALF_UP);\n DatabaseSelectHelper.getAccountDetails(accountId).addInterest();\n DatabaseUpdateHelper.updateAccountBalance(newBalance, accountId);\n \n this.currentCustomer.getAccounts().get(i).setBalance(newBalance);\n \n String msg = \"An interest rate has been added to your account: $\" + interestRate;\n int msgId = DatabaseInsertHelper.insertMessage(currentCustomer.getId(), msg);\n \n Message message = new MessageImpl(msgId, msg, false);\n currentCustomer.getMessagingCentre().addMessage(message);\n \n }\n }\n }", "public Loan(String cId, double pA, double iR, int nY, int nPy){\n\t\tclient_id = cId;\n\t\tprincipal_amount = pA;\n\t\tinterest_rate = iR;\n\t\tno_years = nY;\n\t\tno_payments_yearly = nPy;\n\t\t\n\t\tDate current_time = new Date();\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n\t\t// Adapt the java data format to the mysql one\n\t\tstart_date = sdf.format(current_time);\n\t}", "public Loan(double annualInterestRate, int numberOfYears, double loanAmount)\n {\n setAnnualInterestRate(annualInterestRate);\n setNumberOfYears(numberOfYears);\n setLoanAmount(loanAmount);\n loanDate = new Date();\n }", "public void setAmount(double amount) {\nloanAmount = amount;\n}", "private int adjustLoan(PreparedStatement updateLoan, int loanNumber, float adjustedLoanAmount) throws SQLException {\n updateLoan.setFloat(1, adjustedLoanAmount);\n updateLoan.setInt(2, loanNumber);\n return updateLoan.executeUpdate(); // TODO: call to executeUpdate on a PreparedStatement\n }", "static void bonus() {\n\t\tSystem.out.println(\"Yearly bonus is 20000\");\n\n\t}", "public Loan(String cId, double pA, double iR, int nY, int nPy, String date){\n\t\tclient_id = cId;\n\t\tprincipal_amount = pA;\n\t\tinterest_rate = iR;\n\t\tno_years = nY;\n\t\tno_payments_yearly = nPy;\n\t\tstart_date = date;\n\t}", "public void addJackpot(int amount){\n this.amount += amount;\n }", "public int addIncome(int ammt) {\n \n Integer incomeAmmt = ammt;\n this.incomeArray.add(incomeAmmt);\n \n return incomeAmmt;\n }", "private void savingAccountInterest(){\n if(this.watch.checkElapsedTime() >= 30){\n this.watch.stop(); // stopping stopwatch\n this.timeInterval = this.watch.elapsedTime(); // saving elapsed time in variable\n System.out.println(\"this.timeInterval == \"+this.timeInterval);\n this.bal += this.bal * 0.05 * Math.floor(this.timeInterval/30); // incrementing balance by 5% every 30 seconds\n this.watch.start();\n }\n }", "public Money getInterestDue();", "public void addBonus() {\r\n game.settings.setBonusDay(strDate);\r\n }", "@Override\r\n\tpublic double monthlyInterest() {\r\n\t\tdouble interest;\r\n \tif(isLoyal){\r\n \t//0.35%/12\r\n \t\tinterest = 0.35 / 100.0;\r\n \treturn interest / 12;\r\n \t} \r\n \telse //0.25%/12\r\n \t\tinterest = 0.25 / 100.0;\r\n \t\treturn interest / 12; \r\n\t}", "public void payFees(int fees) {\n feesPaid += fees;\n School.updateTotalMoneyEarned(feesPaid);\n }", "public int getLoan() {\n\t\treturn loan;\n\t}", "private void parseLoan(String[] info, Account account) {\n Loan l = new Loan(Float.parseFloat(info[1]), info[2],\n LocalDate.parse(info[3], dateTimeFormatter),\n Loan.Type.ALL);\n l.updateExistingLoan(info[4], info[5], Integer.parseInt(info[6]), Float.parseFloat(info[7]));\n account.getLoans().add(l);\n }", "public void enterPayment(int coinCount, Coin coinType)\n {\n balance = balance + coinType.getValue() * coinCount;\n // your code here\n \n }", "public void addCash(double amount) {\r\n cash += amount;\r\n }", "public double getloanAmount( double loanAmount) {\nreturn loanAmount;\n}", "public void changeBalance (int amount){\n balance += amount;\n }", "public double addToSpent(double addAmount){\r\n\t\tspent +=addAmount;\r\n\t\treturn spent;\r\n\t}", "void savingAddRecurringExpenditure(Transaction newExpenditure, Ui ui) throws BankException, TransactionException {\n throw new BankException(\"This account does not support this feature\");\n }", "public void increasePaymentCounter() throws SQLException{\n\t\tConnection conn = DataSource.getConnection();\n\t\ttry{\n\t\n\t\t\tString query = \"Update loan \"\n\t\t\t\t\t\t+ \" SET current_payment_counter = current_payment_counter+1\"\n\t\t\t\t\t\t+ \" WHERE client_id = '\"+this.client_id+\"' AND start_date = '\"+this.start_date+\"';\";\n\t\t\tStatement stat = conn.createStatement();\n\t\t\tstat.execute(query);\n\t\t\t\n\t\t}finally{\n\t\t\tconn.close();\n\t\t}\n\t}", "public void updateAccount() {\r\n\t\t\r\n\t\t//update all totals\r\n\t\ttotalYouOwe = 0.0;\r\n\t\ttotalOwedToYou = 0.0;\r\n\t\tbalance = 0.0;\r\n\t\tnetBalance = 0.0;\r\n\t\t\r\n\t\t//totalYouOwe and totalOwedToYou\r\n\t\tfor (Event e : events) {\r\n\t\t\tif (e.isParticipantByGID(GID)) {\r\n\t\t\t\tif (e.getParticipantByGID(GID).getBalance() > 0) {\r\n\t\t\t\t\ttotalOwedToYou = totalOwedToYou + e.getParticipantByGID(GID).getBalance(); \r\n\t\t\t\t} else {\r\n\t\t\t\t\ttotalYouOwe = totalYouOwe + (-e.getParticipantByGID(GID).getBalance());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//netBalance/balance - the same in current implementation\r\n\t\tnetBalance = totalOwedToYou - totalYouOwe;\r\n\t\tbalance = totalOwedToYou - totalYouOwe;\r\n\t\t\r\n\t\tupdatePastRelations();\r\n\t}", "public static void modifyInterestRate(double interestRate){\n annualInterestRate = interestRate;\n }" ]
[ "0.7636959", "0.7544266", "0.73536646", "0.7150546", "0.7150244", "0.7110045", "0.70644176", "0.6937276", "0.6781227", "0.67260146", "0.6650659", "0.65744287", "0.6571651", "0.64841294", "0.6420812", "0.6419105", "0.63457936", "0.63442713", "0.6338247", "0.63211966", "0.62875813", "0.6281428", "0.6200702", "0.6146164", "0.61439437", "0.6106195", "0.6067545", "0.5989976", "0.59666175", "0.592976", "0.5927017", "0.59122497", "0.5911484", "0.5907609", "0.5900432", "0.5896206", "0.5893434", "0.5871048", "0.5869404", "0.58653826", "0.58547646", "0.58453953", "0.58452004", "0.584313", "0.58286947", "0.5812815", "0.5809671", "0.57989293", "0.57789963", "0.5774598", "0.5774218", "0.57695943", "0.5762301", "0.5757527", "0.57558036", "0.57499087", "0.573447", "0.572874", "0.57215714", "0.5718834", "0.57159644", "0.57134247", "0.5711164", "0.57102525", "0.5705835", "0.5684912", "0.56848603", "0.5683916", "0.5682994", "0.56781024", "0.5670236", "0.5664357", "0.5663255", "0.56458104", "0.564456", "0.5643902", "0.56388044", "0.56320244", "0.56300485", "0.5630006", "0.5619533", "0.5610924", "0.5609662", "0.56060386", "0.5604028", "0.5601744", "0.5601586", "0.5600772", "0.55953646", "0.5592034", "0.5567871", "0.55584085", "0.5558155", "0.5555767", "0.55552757", "0.5555196", "0.55516976", "0.5546783", "0.5541406", "0.5537607", "0.55363244" ]
0.0
-1
TODO Autogenerated method stub
@Override public void actionPerformed(ActionEvent e) { if (jcb.isSelected()) { selectList.add(new Integer(site)); //System.out.println(selectList); } else { selectList.remove(new Integer(site)); //System.out.println(selectList); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
@Override public void actionPerformed(ActionEvent e) { if (e.getSource() == cancelBtn) { // AddBillView.this.dispose(); this.dispose(); } else if (e.getSource() == syncBtn) { if (!selectList.isEmpty()) { handleBill.syncBillToSelectFile(selectList, index); } this.dispose(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
Add Service from class path. Default is classpath:services.xml.
private Document getDocumentInClassPath()throws Exception{ DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = builderFactory.newDocumentBuilder(); Document doc = builder.parse(ServiceLoader.class.getResourceAsStream("/"+FILE_NAME)); return doc; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void addServiceImpl(String serviceName, FileObject configFile, boolean fromWSDL);", "public void addServiceImpl(String serviceName, FileObject configFile, boolean fromWSDL, String[] wscompileFeatures);", "public void addService() throws JNCException {\n setLeafValue(Epc.NAMESPACE,\n \"service\",\n null,\n childrenNames());\n }", "public void addService() throws JNCException {\n setLeafValue(Epc.NAMESPACE,\n \"service\",\n null,\n childrenNames());\n }", "void addService(ServiceInfo serviceInfo);", "public abstract T addService(ServerServiceDefinition service);", "ClassPath add(ClassPathElement element);", "public void addClassPath(String path) {\r\n throw new RuntimeException(\"Cannot add classpath : \"+path);\r\n }", "void setClassOfService(ClassOfService serviceClass);", "public void addService(Class<? extends IFloodlightService> clazz, \n\t IFloodlightService service) {\n\t\tserviceMap.put(clazz, service);\n\t}", "public void setServiceClass(java.lang.String serviceClass) {\n this.serviceClass = serviceClass;\n }", "@Override\n\tpublic <ITF> Optional<ITF> getService(Class<ITF> itfClass, String servicePath) {\n\t\treturn IRegistryProvider.INSTANCE.getService(itfClass, servicePath);\n\t}", "@Override\n\tpublic void loadService() {\n\t\t\n\t}", "private void addClasspath(String path)\n {\n if (classpath == null)\n {\n classpath = path;\n }\n else\n {\n classpath += File.pathSeparator + path;\n }\n }", "public void addService() throws Throwable\r\n\t{\r\n\t\tselServicOpt.click();\r\n\t\tverifyService();\r\n\t\twdlib.waitForElement(getSelServiceBtn());\r\n\t\tselServiceBtn.click();\r\n\t\twdlib.verify(wdlib.getPageTitle(),flib.getPropKeyValue(PROP_PATH, \"ServicesPage\") , \"Services Page \");\r\n\t\tServicesPage svpage=new ServicesPage();\r\n\t\tsvpage.selectServices();\r\n\t\t\r\n\t}", "private void registerService() {\r\n DFAgentDescription desc = new DFAgentDescription();\r\n desc.setName(getAID());\r\n ServiceDescription sd = new ServiceDescription();\r\n sd.setType(SERVICE_TYPE);\r\n sd.setName(SERVICE_NAME);\r\n desc.addServices(sd);\r\n try {\r\n DFService.register(this, desc);\r\n } catch (FIPAException e) {\r\n e.printStackTrace(System.err);\r\n }\r\n }", "public void registerService(String serviceName, Object service);", "public void setServicePath(String servicePath) {\n this.servicePath = servicePath;\n }", "public AddFavouriteService() {\n super(\"AddFavouriteService\");\n }", "ServicesPackage getServicesPackage();", "public abstract ServiceDelegate createServiceDelegate(java.net.URL wsdlDocumentLocation,\n QName serviceName, Class<? extends Service> serviceClass);", "public void startService(String id, String configLocation)\n throws IOException;", "public static void loadService() {\n Optional<EconomyService> optService = Sponge.getServiceManager().provide(EconomyService.class);\n if(optService.isPresent()) {\n service = optService.get();\n isLoaded = true;\n } else {\n isLoaded = false;\n }\n }", "public void addServiceName(String name) {\n if (name != null) {\n this.serviceNameSet.add(name);\n }\n }", "public Builder addServices(go.micro.runtime.RuntimeOuterClass.Service value) {\n if (servicesBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureServicesIsMutable();\n services_.add(value);\n onChanged();\n } else {\n servicesBuilder_.addMessage(value);\n }\n return this;\n }", "public Builder addServices(go.micro.runtime.RuntimeOuterClass.Service value) {\n if (servicesBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureServicesIsMutable();\n services_.add(value);\n onChanged();\n } else {\n servicesBuilder_.addMessage(value);\n }\n return this;\n }", "public void addFakeClassPathToRead(String path) {\n StringTokenizer stoken = new StringTokenizer(path, System.getProperty(\"path.separator\") );\n while (stoken.hasMoreTokens()) {\n filesToReadVec.addElement(new File((String)stoken.nextElement()));\n }\n }", "protected static ServiceDescription createServiceConfig( Element elem, String webinfPath )\n throws XMLParsingException, IOException {\n Map<String, Service> services = createServices( XMLTools.getElement( elem, StringTools.concat( 100, \"./\",\n dotPrefix,\n \"Services\" ),\n cnxt ), webinfPath );\n List<Integer> testIntervals = createTestIntervals( XMLTools.getElement( elem,\n StringTools.concat( 100, \"./\",\n dotPrefix,\n \"TestInterval\" ),\n cnxt ) );\n\n return new ServiceDescription( testIntervals, services );\n }", "public ServiceXML getService(String className) {\n return allXMLServices.get(className);\n }", "public abstract T addService(BindableService bindableService);", "public <T> void registerService(Class<T> serviceClass, T impl) {\n services.put(serviceClass, impl);\n }", "public static Versionized getService(String className, String version)\r\n\t\t\tthrows Exception {\n\t\tPath path = Paths.get(\"understandingTheJava7/service\", version);\r\n\t\tFileSystemClassLoader loader = new ParentLastClassLoader(path);\r\n\t\tClass<?> clazz = loader.loadClass(className);\r\n\t\treturn (Versionized) clazz.newInstance();\r\n\t}", "Service newService();", "private ServiceLocator(){}", "public go.micro.runtime.RuntimeOuterClass.Service.Builder addServicesBuilder() {\n return getServicesFieldBuilder().addBuilder(\n go.micro.runtime.RuntimeOuterClass.Service.getDefaultInstance());\n }", "public go.micro.runtime.RuntimeOuterClass.Service.Builder addServicesBuilder() {\n return getServicesFieldBuilder().addBuilder(\n go.micro.runtime.RuntimeOuterClass.Service.getDefaultInstance());\n }", "void addService(Long orderId, Long serviceId);", "public Collection<Service> createServices();", "public void addServices(Services services) {\n for(int i = 0; i < services.getServices().size(); i++) {\n this.services.add(services.getServices().get(i)); // Retrieve the name of the Service\n }\n for(int i = 0; i < services.getIndexes().size(); i++) {\n this.indexes.add(services.getIndexes().get(i)); // Retrieve the index of the Service\n }\n }", "protected Class getOnlineService () throws ClassNotFoundException {\n String className = config.getString(\"CLIENT_IMPL\");\n Class serviceClass = Class.forName(className);\n return serviceClass;\n }", "void addHost(Service newHost);", "@Override\r\n public <T> void registerService(Class<T> clazz, Object implementation) {\r\n synchronized (serviceRegistrations) {\r\n serviceRegistrations.add(bundleContext.registerService(clazz.getName(), implementation, null));\r\n }\r\n }", "public interface ServiceProvider {\n\n /**\n * This method allows to define a priority for a registered ServiceProvider instance. When multiple providers are\n * registered in the system the provider with the highest priority value is taken.\n *\n * @return the provider's priority (default is 0).\n */\n int getPriority();\n\n /**\n * Access a list of services, given its type. The bootstrap mechanism should\n * order the instance for precedence, hereby the most significant should be\n * first in order. If no such services are found, an empty list should be\n * returned.\n *\n * @param serviceType the service type.\n * @return The instance to be used, never {@code null}\n */\n <T> List<T> getServices(Class<T> serviceType);\n\n /**\n * Access a single service, given its type. The bootstrap mechanism should\n * order the instance for precedence, hereby the most significant should be\n * first in order and returned. If no such services are found, null is\n * returned.\n *\n * @param serviceType the service type.\n * @return The instance, (with highest precedence) or {@code null}, if no such service is available.\n */\n default <T> T getService(Class<T> serviceType) {\n return getServices(serviceType).stream().findFirst().orElse(null);\n }\n}", "private void addClasspathElement(String pathElement) {\n\t if (classpathElementsSet.add(pathElement)) {\n\t final File file = new File(pathElement);\n\t if (file.exists()) {\n\t classpathElements.add(file);\n\t }\n\t }\n\t}", "public void addService(ServiceType service, String name, String usertoken) throws AddServiceFailException, NoUserLoggedInException{\r\n\t\ttry {\r\n\t\t\tthis.service.addService(this.getLoggedInUser().getId(), service.getId(), name, usertoken);\r\n\t\t} catch (RemoteException e) {\r\n\t\t\tthrow new AddServiceFailException(ExceptionType.WARNING);\r\n\t\t}\r\n\t}", "public static <S> S createService(Context context, Class<S> serviceClass) {\n return ApiClient.getClient(RemoteConfiguration.BASE_URL).create(serviceClass);\n }", "String resolveClassPath(String classPath);", "public RouteEntryImpl addingService(ServiceReference<Object> reference) {\n Object service = context.getService(reference);\n RouteEntryImpl result = null;\n if (service instanceof CollectionResourceProvider) {\n result = addRoute(reference, service);\n } else if (service instanceof SingletonResourceProvider) {\n result = addRoute(reference, service);\n } else if (service instanceof RequestHandler) {\n result = addRoute(reference, service);\n }\n if (null == result) {\n context.ungetService(reference);\n }\n return result;\n }", "public Class getServiceClass() { return serviceClass; }", "protected static void setServiceLocation(URI serviceLocation) {\n Program.serviceLocation = serviceLocation;\n }", "ClassOfService getClassOfService();", "<T> T getService(Class<T> type);", "private void getServiceClasses(Class<?> service, Set<ProviderClass> sp) {\n LOGGER.log(Level.CONFIG, \"Searching for providers that implement: \" + service);\n Class<?>[] pca = ServiceFinder.find(service, true).toClassArray();\n for (Class pc : pca) {\n if (constrainedTo(pc)) {\n LOGGER.log(Level.CONFIG, \" Provider found: \" + pc);\n }\n }\n // Add service-defined providers to the set after application-defined\n for (Class pc : pca) {\n if (constrainedTo(pc)) {\n sp.add(new ProviderClass(pc, true));\n }\n }\n }", "protected static Map<String, Service> createServices( Element elem, String webinfPath )\n throws XMLParsingException, IOException {\n\n Map<String, Service> tmpServices = new HashMap<String, Service>();\n List<Element> list = XMLTools.getElements( elem, StringTools.concat( 100, \"./\", dotPrefix, \"Service\" ), cnxt );\n for ( Element child : list ) {\n String serviceName = XMLTools.getAttrValue( child, null, \"type\", null );\n\n String[] tokens = null;\n if ( ( tokens = serviceName.split( \":\" ) ).length == 2 ) {\n serviceName = tokens[1];\n }\n ServiceVersion serviceVersion = createServiceVersion( child, webinfPath );\n if ( !tmpServices.containsKey( serviceName ) ) {\n tmpServices.put( serviceName, new Service( serviceName ) );\n }\n tmpServices.get( serviceName ).getServiceVersions().put( serviceVersion.getVersion(), serviceVersion );\n }\n return tmpServices;\n }", "public Object getService(String serviceName);", "protected final void registerService(Object service){\n ModuleManager.getInstance().regService(this.moduleName,service);\n }", "Object getService(String serviceName);", "public static <T> T createService(Class<T> service) {\n return getInstanceRc().create(service);\n }", "IServiceContext createService(Class<?>... serviceModules);", "public void setClasspath(Path s) {\r\n createClasspath().append(s);\r\n }", "public interface Service {\n // Service-specific methods go here\n }", "public void serviceAdded(ServiceDescription service) {\n System.out.println(\"service added\");\n current = service;\n //set up channel to communicate with server\n //multiple beds -> multiple channels\n channel = ManagedChannelBuilder.forAddress(service.getAddress(), service.getPort())\n .usePlaintext(true)\n .build();\n\n //To call service methods, we first need to create a stub, \n //a blocking/synchronous stub: this means that the RPC call waits for the server to respond, \n //and will either return a response or raise an exception.\n blockingStub = ProjectorGrpc.newBlockingStub(channel);\n\n activateProjector();\n //listInputs();\n\n }", "@Override\n public String getServicesXMLPath()\n {\n return servicesXMLPath;\n }", "@SneakyThrows\n public void addURL(Path path) {\n if (ADD_URL == null || this.classLoader == null) {\n return;\n }\n try {\n ADD_URL.invoke(this.classLoader, path.toUri().toURL());\n } catch (IllegalAccessException | InvocationTargetException | MalformedURLException e) {\n e.printStackTrace();\n }\n }", "private void loadService() {\n if (!isServiceRunning(ShakeService.class)) {\n Intent intent = new Intent(this, ShakeService.class);\n this.startService(intent);\n }\n }", "public interface ServiceManagerInterface {\n\n /**\n * add a Service\n * @param servicePackage the service package to register\n * @param configuration The configuration of the client\n * @param profile the client profile\n * @return The added service description\n * @throws IOException\n * @throws SoapException\n */\n AGServiceDescription addService(\n AGServicePackageDescription servicePackage,\n AGParameter[] configuration,\n ClientProfile profile)\n throws IOException, SoapException;\n\n /**\n * gets the service manager description\n * @return service manager description\n * @throws IOException\n * @throws SoapException\n */\n AGServiceManagerDescription getDescription()\n throws IOException, SoapException;\n\n /**\n * gets the url of the node service\n * @return url of node service\n * @throws IOException\n * @throws SoapException\n */\n String getNodeServiceUrl()\n throws IOException, SoapException;\n\n /**\n * gets the available services\n * @return a vector of available services\n * @throws IOException\n * @throws SoapException\n */\n AGServiceDescription[] getServices()\n throws IOException, SoapException;\n\n /**\n * test whether the service manager is valid\n * @return the 'valid' state\n * @throws IOException\n * @throws SoapException\n */\n int isValid() throws IOException, SoapException;\n\n /**\n * removes a service from the service manager\n * @param serviceDescription the description of the service to be removed\n * @throws IOException\n * @throws SoapException\n */\n void removeService(AGServiceDescription serviceDescription)\n throws IOException, SoapException;\n\n /**\n * removes all services from the service manager\n * @throws IOException\n * @throws SoapException\n */\n void removeServices() throws IOException, SoapException;\n\n /**\n * sets the url for node service\n * @param nodeServiceUri\n * @throws IOException\n * @throws SoapException\n */\n void setNodeServiceUrl(String nodeServiceUri)\n throws IOException, SoapException;\n\n /**\n * shuts down the service manager\n * @throws IOException\n * @throws SoapException\n */\n void shutdown() throws IOException, SoapException;\n\n /**\n * stops all services on service manager\n * @throws IOException\n * @throws SoapException\n */\n void stopServices() throws IOException, SoapException;\n\n /**\n * gets the version number of the service manager\n * @return string with version of service manager\n * @throws IOException\n * @throws SoapException\n */\n String getVersion() throws IOException, SoapException;\n\n\n /**\n * Requests to join a bridge\n * @param bridgeDescription The description of the bridge\n * @throws IOException\n * @throws SoapException\n */\n void joinBridge(BridgeDescription bridgeDescription)\n throws IOException, SoapException;\n\n /**\n * Sets the streams of this service manager\n *\n * @param streamDescriptionList a vector of stream descriptions\n * @throws IOException\n * @throws SoapException\n */\n void setStreams(StreamDescription[] streamDescriptionList)\n throws IOException, SoapException;\n /**\n * adds a stream\n * @param argname stream description of new stream\n * @throws IOException\n * @throws SoapException\n */\n void addStream(StreamDescription argname)\n throws IOException, SoapException;\n /**\n * Removes a stream\n * @param argname The stream to remove\n * @throws IOException\n * @throws SoapException\n */\n void removeStream(StreamDescription argname)\n throws IOException, SoapException;\n /**\n * Sets the point of reference for network traffic\n * @param url The url of the point of reference server\n * @throws IOException\n * @throws SoapException\n */\n void setPointOfReference(String url)\n throws IOException, SoapException;\n\n /**\n * Sets the encryption\n * @param encryption The encryption\n * @throws IOException\n * @throws SoapException\n */\n void setEncryption(String encryption)\n throws IOException, SoapException;\n /**\n * Instructs the client to run automatic bridging\n * @throws IOException\n * @throws SoapException\n */\n void runAutomaticBridging()\n throws IOException, SoapException;\n\n /**\n * Determines if a service is enabled\n * @param service The service to get the status of\n * @return True if enabled, false otherwise\n * @throws IOException\n * @throws SoapException\n */\n boolean isServiceEnabled(AGServiceDescription service)\n throws IOException, SoapException;\n\n /**\n * Enables or disables a service\n * @param service The service to control\n * @param enabled True to enable, false to disable\n * @throws IOException\n * @throws SoapException\n */\n void enableService(AGServiceDescription service, boolean enabled)\n throws IOException, SoapException;\n\n /**\n * Gets the configuration parameters of a service\n * @param service The service to get the configuration of\n * @return The parameters\n * @throws IOException\n * @throws SoapException\n */\n AGParameter[] getServiceConfiguration(AGServiceDescription service)\n throws IOException, SoapException;\n /**\n * Sets the configuration parameters for a service\n * @param service The service to configure\n * @param config The new parameters\n * @throws IOException\n * @throws SoapException\n */\n void setServiceConfiguration(AGServiceDescription service,\n AGParameter[] config)\n throws IOException, SoapException;\n\n /**\n * Sets the client profile\n * @param profile The new profile\n * @throws IOException\n * @throws SoapException\n */\n void setClientProfile(ClientProfile profile)\n throws IOException, SoapException;\n}", "public Class getServiceClass()\n {\n return serviceClass;\n }", "SourceBuilder createService();", "public void serviceAdded(ServiceEvent event) {\n\t\t\tLog.e(\"z\", \"added serivce: \" + event);\n\t\t}", "public void setService(String service) {\n this.service = service;\n }", "private void createClassPath() {\n classPath = classFactory.createClassPath();\n }", "private void setService(Service service) {\n this.service = service;\n }", "public TestService_Service(URL wsdlLocation, WebServiceFeature... features) {\n super(wsdlLocation, SERVICE, features);\n }", "public InitService() {\n super(\"InitService\");\n }", "public void setService(CentralSystemServiceFactory service) {\n\t\tthis.service = service;\n\t}", "public org.biocatalogue.x2009.xml.rest.ServiceDeployment addNewServiceDeployment()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n org.biocatalogue.x2009.xml.rest.ServiceDeployment target = null;\r\n target = (org.biocatalogue.x2009.xml.rest.ServiceDeployment)get_store().add_element_user(SERVICEDEPLOYMENT$0);\r\n return target;\r\n }\r\n }", "public abstract ServiceLocator create(String name);", "Fog_Services createFog_Services();", "public ServiceDelegate createServiceDelegate(java.net.URL wsdlDocumentLocation, QName serviceName,\n Class<? extends Service> serviceClass, WebServiceFeature... features) {\n throw new UnsupportedOperationException(\n \"JAX-WS 2.2 implementation must override this default behaviour.\");\n }", "public <T extends Service> T getService(Class<T> clazz) throws ServiceException{\n\t\ttry {\n\t\t\treturn clazz.getDeclaredConstructor().newInstance();\n\t\t} catch (NoSuchMethodException | InvocationTargetException | IllegalAccessException | InstantiationException e) {\n\t\t\tthrow new ServiceException(e);\n\t\t}\n\t}", "void putServiceNameServiceInfos(net.zyuiop.ovhapi.api.objects.services.Service param0, java.lang.String serviceName) throws java.io.IOException;", "public interface Provider {\n Service newService();\n }", "public final void setService(java.lang.String service)\r\n\t{\r\n\t\tsetService(getContext(), service);\r\n\t}", "@Override\n protected void configureService() {\n if (installSolr) {\n // bind solr server, using the checklistbank.search.solr.server property\n install(new SolrModule(SolrConfig.fromProperties(getProperties(), \"solr.\")));\n }\n\n bind(NameUsageSearchService.class).to(NameUsageSearchServiceImpl.class).in(Scopes.SINGLETON);\n\n expose(NameUsageSearchService.class);\n }", "public void forceServiceInstantiation()\n {\n getService();\n\n _serviceModelObject.instantiateService();\n }", "public TestService_Service(URL wsdlLocation, QName serviceName, WebServiceFeature... features) {\n super(wsdlLocation, serviceName, features);\n }", "public Builder addClasspath(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureClasspathIsMutable();\n classpath_.add(value);\n onChanged();\n return this;\n }", "public java.lang.String getServiceClass() {\n return serviceClass;\n }", "public void setService(Text newService) {\n service = newService;\n }", "public static void addNewServices() {\n displayAddNewServicesMenu();\n processAddnewServicesMenu();\n }", "protected <T> T getService(Class<T> clazz) {\n \tfinal ServiceReference<T> ref = bundleContext.getServiceReference(clazz);\n \tassertNotNull(\"getService(\" + clazz.getName() + \") must find ServiceReference\", ref);\n \tfinal T result = (bundleContext.getService(ref));\n \tassertNotNull(\"getService(\" + clazz.getName() + \") must find service\", result);\n \treturn result;\n }", "public void setClassPath(String classPath) {\n this.classPath = classPath;\n }", "public void registerService(String serviceName){\n jmc.registerService(serviceName);\n }", "public ServiceInstance lookupInstance(String serviceName);", "public void install() throws ParseException, IOException {\r\n clearErrors();\r\n ServiceData sd = ServiceData.getLocalInstance();\r\n String[] typeNames = sd.getServiceTypeNames();\r\n for (int i = 0; i < typeNames.length; ++i) {\r\n install(typeNames[i]);\r\n }\r\n }", "@HystrixCommand(fallbackMethod = \"addServiceFallback\")\n\tpublic String addService() {\n\t\treturn restTemplate.getForEntity(\"http://COMPUTE-SERVICE/add?a=10&b=20\", String.class).getBody();\n\t}", "@Override\n\tpublic void serviceAdded(ServiceEvent arg0) {\n\t\tServiceInfo serviceInfo = mJmDNS.getServiceInfo(arg0.getType(),\n\t\t\t\targ0.getName());\n\t\tif (onFoundListener != null) {\n\t\t\tonFoundListener.onFound(serviceInfo);\n\t\t}\n\t}", "@Override\n public <T> T getToolService(Class<T> serviceClass)\n {\n if (serviceClass.isAssignableFrom(getClass()))\n {\n return (T)this;\n }\n return null;\n }", "<T> T getService(Class<T> type, boolean checkExistence);", "void addHasMicroService(MService newHasMicroService);" ]
[ "0.67977256", "0.62748384", "0.62739414", "0.62739414", "0.6147966", "0.6017845", "0.5937546", "0.59255475", "0.5857263", "0.5833075", "0.5678739", "0.5678171", "0.5662435", "0.5616029", "0.56134063", "0.5574865", "0.5506111", "0.5422962", "0.54213864", "0.53930783", "0.5372014", "0.5371067", "0.53368294", "0.532665", "0.53097296", "0.53097296", "0.5296081", "0.5290604", "0.52827466", "0.5262882", "0.5245803", "0.52386045", "0.52367085", "0.5232328", "0.52206", "0.52206", "0.52205604", "0.5209553", "0.5193685", "0.51711226", "0.5168912", "0.5161711", "0.5159629", "0.5140711", "0.5124575", "0.51190853", "0.51175916", "0.5097726", "0.50768185", "0.5045898", "0.50386727", "0.50187504", "0.50095254", "0.49966142", "0.4995981", "0.49946097", "0.4992024", "0.49855408", "0.4982723", "0.49771005", "0.49601996", "0.4960115", "0.49591312", "0.49347612", "0.49331746", "0.49208304", "0.4909435", "0.4877817", "0.4872792", "0.4857231", "0.48528785", "0.48343813", "0.48337245", "0.4830307", "0.4827793", "0.48265684", "0.48261666", "0.4819982", "0.4819552", "0.48171237", "0.48161498", "0.48127884", "0.48127067", "0.48083955", "0.4807401", "0.48063803", "0.48041278", "0.47892222", "0.47890672", "0.4789011", "0.47833347", "0.4771986", "0.47715145", "0.47628567", "0.47602123", "0.47541806", "0.4754137", "0.4753345", "0.47528508", "0.47505447" ]
0.4917428
66
Add Service from external configuration. Default is conf/services.xml.
private Document getDocumentInFileSys()throws Exception{ DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = builderFactory.newDocumentBuilder(); File file = new File(DIR,FILE_NAME); if(!file.exists()) return null; FileInputStream inStream =new FileInputStream(file); try{ Document doc = builder.parse(inStream); return doc; }finally{ inStream.close(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void addServiceImpl(String serviceName, FileObject configFile, boolean fromWSDL);", "public void addServiceImpl(String serviceName, FileObject configFile, boolean fromWSDL, String[] wscompileFeatures);", "void addService(ServiceInfo serviceInfo);", "public abstract T addService(ServerServiceDefinition service);", "public ServiceConfig addServiceConfig(String serviceName, Map attributes)\n throws SMSException {\n try {\n ServiceConfigManagerImpl scmi = ServiceConfigManagerImpl\n .getInstance(token, serviceName, \n ServiceManager.getVersion(serviceName));\n ServiceConfigImpl sci = scmi.getOrganizationConfig(token, orgName,\n null);\n if (sci == null || sci.isNewEntry()) {\n ServiceConfigManager scm = new ServiceConfigManager(\n serviceName, token);\n return (scm.createOrganizationConfig(orgName, attributes));\n } else {\n SMSEntry.debug.error(\"OrganizationConfigManager: \"\n + \"ServiceConfig already exists: \" + sci.getDN());\n throw (new SMSException(SMSEntry.bundle\n .getString(\"sms-service_already_exists1\")));\n }\n } catch (SSOException ssoe) {\n SMSEntry.debug.error(\"OrganizationConfigManager: Unable to \"\n + \"add Service Config\", ssoe);\n throw (new SMSException(SMSEntry.bundle\n .getString(\"sms-INVALID_SSO_TOKEN\"),\n \"sms-INVALID_SSO_TOKEN\"));\n }\n }", "private void registerService() {\r\n DFAgentDescription desc = new DFAgentDescription();\r\n desc.setName(getAID());\r\n ServiceDescription sd = new ServiceDescription();\r\n sd.setType(SERVICE_TYPE);\r\n sd.setName(SERVICE_NAME);\r\n desc.addServices(sd);\r\n try {\r\n DFService.register(this, desc);\r\n } catch (FIPAException e) {\r\n e.printStackTrace(System.err);\r\n }\r\n }", "protected static ServiceDescription createServiceConfig( Element elem, String webinfPath )\n throws XMLParsingException, IOException {\n Map<String, Service> services = createServices( XMLTools.getElement( elem, StringTools.concat( 100, \"./\",\n dotPrefix,\n \"Services\" ),\n cnxt ), webinfPath );\n List<Integer> testIntervals = createTestIntervals( XMLTools.getElement( elem,\n StringTools.concat( 100, \"./\",\n dotPrefix,\n \"TestInterval\" ),\n cnxt ) );\n\n return new ServiceDescription( testIntervals, services );\n }", "public void addService() throws JNCException {\n setLeafValue(Epc.NAMESPACE,\n \"service\",\n null,\n childrenNames());\n }", "public void addService() throws JNCException {\n setLeafValue(Epc.NAMESPACE,\n \"service\",\n null,\n childrenNames());\n }", "ServiceConfig getServiceConfig();", "ServiceConfig getServiceConfig();", "@Override\n protected void configureService() {\n if (installSolr) {\n // bind solr server, using the checklistbank.search.solr.server property\n install(new SolrModule(SolrConfig.fromProperties(getProperties(), \"solr.\")));\n }\n\n bind(NameUsageSearchService.class).to(NameUsageSearchServiceImpl.class).in(Scopes.SINGLETON);\n\n expose(NameUsageSearchService.class);\n }", "void setServiceConfiguration(AGServiceDescription service,\n AGParameter[] config)\n throws IOException, SoapException;", "public void startService(String id, String configLocation)\n throws IOException;", "org.apache.geronimo.corba.xbeans.csiv2.tss.TSSSasMechType.ServiceConfigurationList addNewServiceConfigurationList();", "private void ensureDescriptorLoaded(String serviceName, String cfgFile) {\n // get the admin access token for instantiating the ServiceManager and ServiceConfigManager instances\n SSOToken admTk = AccessController.doPrivileged(AdminTokenAction.getInstance());\n\n // get ServiceManager to see the list of all registered services and see if ours is in there\n ServiceManager sm = null;\n try {\n sm = new ServiceManager(admTk);\n } catch (Exception e) {\n e.printStackTrace();\n }\n boolean serviceExists = false;\n Set names = null;\n try {\n names = sm.getServiceNames();\n } catch (Exception e) {\n cLog.log(Level.SEVERE, \"Unable to obtain service names from ServiceManager to determine if \" + serviceName\n + \" is already registered or needs its service descriptor file \" + cfgFile\n + \" loaded. Assuming that it already loaded.\", e);\n return;\n }\n for (Object o : names) {\n String name = (String) o;\n if (serviceName.equals(name)) {\n serviceExists = true;\n }\n }\n\n // so ours isn't in there. Lets go register it.\n if (!serviceExists) {\n cLog.log(Level.INFO, serviceName + \" not found. Loading...\");\n ServiceConfigManager mgr = null;\n try {\n mgr = new ServiceConfigManager(serviceName, admTk);\n } catch (Exception e) {\n cLog.log(Level.SEVERE, \"Unable to obtain ServiceConfigManager to load \" + cfgFile + \". Not loading.\", e);\n return;\n }\n URL url = this.getClass().getClassLoader().getResource(cfgFile);\n\n if (url == null) {\n cLog.log(Level.SEVERE, \"Unable to locate classpath resource '\" + cfgFile\n + \"'. Must be loaded before the \" + serviceName + \" will be available in the admin console.\");\n return;\n }\n cLog.log(Level.INFO, \"Service Descriptor file for \" + serviceName + \" found at: \" + url.toString());\n\n InputStream is = null;\n try {\n is = url.openStream();\n } catch (Exception e) {\n cLog.log(Level.SEVERE, \"Unable to open resource \" + url.toString() + \". Must be loaded before the \"\n + serviceName + \" will be available in the admin console.\", e);\n return;\n }\n try {\n sm.registerServices(is);\n } catch (Exception e) {\n cLog.log(Level.SEVERE, \"Unable to load \" + cfgFile + \" file. Must be loaded before the \" + serviceName\n + \" will be available in the admin console.\", e);\n return;\n } finally {\n try {\n is.close();\n } catch (Exception e) {\n // ignore\n }\n }\n // wait one second for service cache update\n try {\n Thread.sleep(1000);\n } catch (InterruptedException e) {\n // ignore but move on since we'll exit out pretty quickly\n }\n }\n }", "public interface ConfigService {\n\n\n /**\n * eureka配置\n *\n * @param sb\n * @param addr\n */\n void eureka(StringBuilder sb, String addr);\n\n /**\n * redis配置\n *\n * @param sb\n * @param addr\n */\n void redis(StringBuilder sb, String addr);\n\n\n /**\n * 数据源配置\n *\n * @param sb\n */\n void thymeleafAndDatasource(StringBuilder sb);\n\n\n /**\n * 关于mybatis的配置\n *\n * @param sb\n * @param packages\n */\n void mybatis(StringBuilder sb, String packages);\n\n\n /**\n * 分页插件配置\n *\n * @param sb\n */\n void pagehelper(StringBuilder sb);\n\n /**\n * 生成application.yml\n *\n * @param name\n */\n void application(String name);\n\n\n /**\n * 生成application-xxx.yml\n *\n * @param branch\n * @param packages\n */\n void applicationBranch(String branch, String packages);\n\n\n /**\n * log文件\n *\n */\n void logBack();\n}", "private void initConfigServices() {\n List<ServiceDTO> customizedConfigServices = getCustomizedConfigService();\n\n if (customizedConfigServices != null) {\n setConfigServices(customizedConfigServices);\n return;\n }\n\n // update from meta service\n this.tryUpdateConfigServices();\n this.schedulePeriodicRefresh();\n }", "void addHost(Service newHost);", "public void registerService(String serviceName, Object service);", "public static void setupServicesAndParameters(){\n\t\t//replace services in use, e.g.:\n\t\t/*\n\t\tMap<String, ArrayList<String>> systemInterviewServicesMap = new HashMap<>();\n\t\t\n\t\t//CONTROL DEVICES\n\t\tArrayList<String> controlDevice = new ArrayList<String>();\n\t\t\tcontrolDevice.add(MyDeviceControlService.class.getCanonicalName());\n\t\tsystemInterviewServicesMap.put(CMD.CONTROL, controlDevice);\n\t\t\n\t\t//BANKING\n\t\tArrayList<String> banking = new ArrayList<String>();\n\t\t\tbanking.add(MyBankingService.class.getCanonicalName());\n\t\tsystemInterviewServicesMap.put(CMD.BANKING, banking);\n\t\t\t\n\t\tInterviewServicesMap.loadCustom(systemInterviewServicesMap);\n\t\t*/\n\t\t\n\t\t//defaults\n\t\tStart.setupServicesAndParameters();\n\t\t\n\t\t//add\n\t\t//e.g.: ParameterConfig.setHandler(PARAMETERS.ALARM_NAME, Config.parentPackage + \".parameters.AlarmName\");\n\t}", "@Autowired\n\tpublic void setConfigService(ConfigService configService) {\n\t\tthis.configService = configService;\n\t}", "public void addServiceName(String name) {\n if (name != null) {\n this.serviceNameSet.add(name);\n }\n }", "public static void loadService() {\n Optional<EconomyService> optService = Sponge.getServiceManager().provide(EconomyService.class);\n if(optService.isPresent()) {\n service = optService.get();\n isLoaded = true;\n } else {\n isLoaded = false;\n }\n }", "public void setService(String service) {\n this.service = service;\n }", "public interface ConfigService {\n\n /**\n * Retrieve instance with application configuration.\n * Instance is cached and updated when new config is stored.\n *\n * @return may return {@code null} if there is no config yet.\n */\n AppConfig retrieveApplicationConfig();\n\n /**\n * Store config - only config will be overrode and lost.\n * Also update cached config.\n *\n * @param appConfig to store\n */\n void storeApplicationConfig(AppConfig appConfig);\n}", "@Override\n\tpublic void loadService() {\n\t\t\n\t}", "public abstract void setServiceName(String serviceName);", "private List<ServiceDTO> getCustomizedConfigService() {\n String configServices = System.getProperty(\"apollo.configService\");\n if (Strings.isNullOrEmpty(configServices)) {\n // 2. Get from OS environment variable\n configServices = System.getenv(\"APOLLO_CONFIGSERVICE\");\n }\n if (Strings.isNullOrEmpty(configServices)) {\n // 3. Get from server.properties\n configServices = Foundation.server().getProperty(\"apollo.configService\", null);\n }\n\n if (Strings.isNullOrEmpty(configServices)) {\n return null;\n }\n\n logger.warn(\"Located config services from apollo.configService configuration: {}, will not refresh config services from remote meta service!\", configServices);\n\n // mock service dto list\n String[] configServiceUrls = configServices.split(\",\");\n List<ServiceDTO> serviceDTOS = Lists.newArrayList();\n\n for (String configServiceUrl : configServiceUrls) {\n configServiceUrl = configServiceUrl.trim();\n ServiceDTO serviceDTO = new ServiceDTO();\n serviceDTO.setHomepageUrl(configServiceUrl);\n serviceDTO.setAppName(ServiceNameConsts.APOLLO_CONFIGSERVICE);\n serviceDTO.setInstanceId(configServiceUrl);\n serviceDTOS.add(serviceDTO);\n }\n\n return serviceDTOS;\n }", "public void setServiceName(java.lang.String param){\n localServiceNameTracker = true;\n \n this.localServiceName=param;\n \n\n }", "public interface ConsumeServiceConfiguration {\n\n /**\n * @return the interfaces of all services that should be consumed\n */\n Set<Class<?>> getServiceInterfaces();\n\n /**\n * Returns the full URL of the server so that the service name only has to be appended to hit the required endpoint.\n * Must not end with a slash.\n */\n String getServerUrl();\n}", "Object getService(String serviceName, boolean checkExistence);", "public Object getService(String serviceName);", "public void addServices(Services services) {\n for(int i = 0; i < services.getServices().size(); i++) {\n this.services.add(services.getServices().get(i)); // Retrieve the name of the Service\n }\n for(int i = 0; i < services.getIndexes().size(); i++) {\n this.indexes.add(services.getIndexes().get(i)); // Retrieve the index of the Service\n }\n }", "public interface PointAService {\r\n\r\n\t/**\r\n\t * Initialisation function called directly after construction\r\n\t * \r\n\t * @param pParams\r\n\t * Map containing parameters specified in PointAConfig.xml\r\n\t */\r\n\tpublic void init(Map<String, String> pParams, Application pApp) throws Exception;\r\n}", "Object getService(String serviceName);", "public void assignService(String serviceName, Map attributes)\n throws SMSException {\n addServiceConfig(serviceName, attributes);\n }", "public void setService (String service) {\n\t this.service = service;\n\t}", "private static StandardServiceRegistry configureServiceRegistry() {\n return new StandardServiceRegistryBuilder()\n .applySettings(getProperties())\n .build();\n }", "public void setService(String service) {\n this.service = service;\n }", "public void setService(String service) {\n this.service = service;\n }", "public void setService(String service) {\n this.service = service;\n }", "void addService(Long orderId, Long serviceId);", "SourceBuilder createService();", "public void addService() throws Throwable\r\n\t{\r\n\t\tselServicOpt.click();\r\n\t\tverifyService();\r\n\t\twdlib.waitForElement(getSelServiceBtn());\r\n\t\tselServiceBtn.click();\r\n\t\twdlib.verify(wdlib.getPageTitle(),flib.getPropKeyValue(PROP_PATH, \"ServicesPage\") , \"Services Page \");\r\n\t\tServicesPage svpage=new ServicesPage();\r\n\t\tsvpage.selectServices();\r\n\t\t\r\n\t}", "public void setServiceName(String serviceName){\n this.serviceName = serviceName;\n }", "public LocalFileConfig(ServicesContainer services) {\n this.services = services;\n String localfilePropertyValue = System.getProperty(\"cashmanager.config.localfile\");\n if (localfilePropertyValue != null) {\n this.filePathAString = localfilePropertyValue;\n }\n }", "@Override\n protected void reconfigureService() {\n }", "private void init()\n {\n SystrayActivator.bundleContext\n .addServiceListener(new ProtocolProviderServiceListener());\n \n ServiceReference[] protocolProviderRefs = null;\n try\n {\n protocolProviderRefs\n = SystrayActivator.bundleContext.getServiceReferences(\n ProtocolProviderService.class.getName(),null);\n }\n catch (InvalidSyntaxException ex)\n {\n // this shouldn't happen since we're providing no parameter string\n // but let's log just in case.\n logger .error(\"Error while retrieving service refs\", ex);\n return;\n }\n \n // in case we found any\n if (protocolProviderRefs != null)\n {\n \n for (int i = 0; i < protocolProviderRefs.length; i++)\n {\n ProtocolProviderService provider\n = (ProtocolProviderService) SystrayActivator.bundleContext\n .getService(protocolProviderRefs[i]);\n \n this.addAccount(provider);\n }\n }\n }", "public interface ServiceManagerInterface {\n\n /**\n * add a Service\n * @param servicePackage the service package to register\n * @param configuration The configuration of the client\n * @param profile the client profile\n * @return The added service description\n * @throws IOException\n * @throws SoapException\n */\n AGServiceDescription addService(\n AGServicePackageDescription servicePackage,\n AGParameter[] configuration,\n ClientProfile profile)\n throws IOException, SoapException;\n\n /**\n * gets the service manager description\n * @return service manager description\n * @throws IOException\n * @throws SoapException\n */\n AGServiceManagerDescription getDescription()\n throws IOException, SoapException;\n\n /**\n * gets the url of the node service\n * @return url of node service\n * @throws IOException\n * @throws SoapException\n */\n String getNodeServiceUrl()\n throws IOException, SoapException;\n\n /**\n * gets the available services\n * @return a vector of available services\n * @throws IOException\n * @throws SoapException\n */\n AGServiceDescription[] getServices()\n throws IOException, SoapException;\n\n /**\n * test whether the service manager is valid\n * @return the 'valid' state\n * @throws IOException\n * @throws SoapException\n */\n int isValid() throws IOException, SoapException;\n\n /**\n * removes a service from the service manager\n * @param serviceDescription the description of the service to be removed\n * @throws IOException\n * @throws SoapException\n */\n void removeService(AGServiceDescription serviceDescription)\n throws IOException, SoapException;\n\n /**\n * removes all services from the service manager\n * @throws IOException\n * @throws SoapException\n */\n void removeServices() throws IOException, SoapException;\n\n /**\n * sets the url for node service\n * @param nodeServiceUri\n * @throws IOException\n * @throws SoapException\n */\n void setNodeServiceUrl(String nodeServiceUri)\n throws IOException, SoapException;\n\n /**\n * shuts down the service manager\n * @throws IOException\n * @throws SoapException\n */\n void shutdown() throws IOException, SoapException;\n\n /**\n * stops all services on service manager\n * @throws IOException\n * @throws SoapException\n */\n void stopServices() throws IOException, SoapException;\n\n /**\n * gets the version number of the service manager\n * @return string with version of service manager\n * @throws IOException\n * @throws SoapException\n */\n String getVersion() throws IOException, SoapException;\n\n\n /**\n * Requests to join a bridge\n * @param bridgeDescription The description of the bridge\n * @throws IOException\n * @throws SoapException\n */\n void joinBridge(BridgeDescription bridgeDescription)\n throws IOException, SoapException;\n\n /**\n * Sets the streams of this service manager\n *\n * @param streamDescriptionList a vector of stream descriptions\n * @throws IOException\n * @throws SoapException\n */\n void setStreams(StreamDescription[] streamDescriptionList)\n throws IOException, SoapException;\n /**\n * adds a stream\n * @param argname stream description of new stream\n * @throws IOException\n * @throws SoapException\n */\n void addStream(StreamDescription argname)\n throws IOException, SoapException;\n /**\n * Removes a stream\n * @param argname The stream to remove\n * @throws IOException\n * @throws SoapException\n */\n void removeStream(StreamDescription argname)\n throws IOException, SoapException;\n /**\n * Sets the point of reference for network traffic\n * @param url The url of the point of reference server\n * @throws IOException\n * @throws SoapException\n */\n void setPointOfReference(String url)\n throws IOException, SoapException;\n\n /**\n * Sets the encryption\n * @param encryption The encryption\n * @throws IOException\n * @throws SoapException\n */\n void setEncryption(String encryption)\n throws IOException, SoapException;\n /**\n * Instructs the client to run automatic bridging\n * @throws IOException\n * @throws SoapException\n */\n void runAutomaticBridging()\n throws IOException, SoapException;\n\n /**\n * Determines if a service is enabled\n * @param service The service to get the status of\n * @return True if enabled, false otherwise\n * @throws IOException\n * @throws SoapException\n */\n boolean isServiceEnabled(AGServiceDescription service)\n throws IOException, SoapException;\n\n /**\n * Enables or disables a service\n * @param service The service to control\n * @param enabled True to enable, false to disable\n * @throws IOException\n * @throws SoapException\n */\n void enableService(AGServiceDescription service, boolean enabled)\n throws IOException, SoapException;\n\n /**\n * Gets the configuration parameters of a service\n * @param service The service to get the configuration of\n * @return The parameters\n * @throws IOException\n * @throws SoapException\n */\n AGParameter[] getServiceConfiguration(AGServiceDescription service)\n throws IOException, SoapException;\n /**\n * Sets the configuration parameters for a service\n * @param service The service to configure\n * @param config The new parameters\n * @throws IOException\n * @throws SoapException\n */\n void setServiceConfiguration(AGServiceDescription service,\n AGParameter[] config)\n throws IOException, SoapException;\n\n /**\n * Sets the client profile\n * @param profile The new profile\n * @throws IOException\n * @throws SoapException\n */\n void setClientProfile(ClientProfile profile)\n throws IOException, SoapException;\n}", "public void setService(Text newService) {\n service = newService;\n }", "public abstract T addService(BindableService bindableService);", "public interface CentralConfRegistryService {\n void set(String key, Object value) throws ServiceException;\n\n void set(String key, Object value, String description) throws ServiceException;\n\n Object get(String key) throws ServiceException;\n}", "public abstract void listen(ServiceConfig serviceConfig) throws IOException;", "public void addService(Class<? extends IFloodlightService> clazz, \n\t IFloodlightService service) {\n\t\tserviceMap.put(clazz, service);\n\t}", "public void addService(ServiceType service, String name, String usertoken) throws AddServiceFailException, NoUserLoggedInException{\r\n\t\ttry {\r\n\t\t\tthis.service.addService(this.getLoggedInUser().getId(), service.getId(), name, usertoken);\r\n\t\t} catch (RemoteException e) {\r\n\t\t\tthrow new AddServiceFailException(ExceptionType.WARNING);\r\n\t\t}\r\n\t}", "private void registerLocalService() {\n WifiP2pDnsSdServiceInfo serviceInfo =\n WifiP2pDnsSdServiceInfo.newInstance(WifiDirectUtilities.SERVICE_NAME,\n \"_\" + WifiDirectUtilities.SERVICE_TYPE + \"._\" + WifiDirectUtilities.SERVICE_PROTOCOL,\n WifiDirectUtilities.SERVICE_RECORD);\n\n // Add the local service, sending the service info, network channel,\n // and listener that will be used to indicate success or failure of\n // the request.\n mManager.addLocalService(mChannel, serviceInfo, new WifiP2pManager.ActionListener() {\n @Override\n public void onSuccess() {\n // Command successful! Code isn't necessarily needed here,\n // Unless you want to update the UI or add logging statements.\n }\n\n @Override\n public void onFailure(int arg0) {\n // Command failed. Check for P2P_UNSUPPORTED, ERROR, or BUSY\n }\n });\n WifiDirectDnsSdListener listener = new WifiDirectDnsSdListener(this);\n mManager.setDnsSdResponseListeners(mChannel, listener, listener);\n }", "public PAServiceImpl (BundleContext bc) {\n this.bc = bc;\n \n // Read the default configuration file\n // TODO: Refactor the XSD schema and XML data file name constructors\n configReader = new XMLConfigParser(\n CWD_PATH + FILE_SEP + CONF_DIR + FILE_SEP + \"plugins.xml\",\n CWD_PATH + FILE_SEP + CONF_DIR + FILE_SEP + \"plugins.xsd\");\n // ... and retrieve all available metrics configurations\n if (configReader != null) {\n metricConfigurations = configReader.getMetricsConfiguration();\n }\n \n // Collect information about pre-existing metric services\n this.collectMetricsInfo();\n \n // Attach this object as a listener for metric services\n try {\n bc.addServiceListener(this, SREF_FILTER_METRIC);\n } catch (InvalidSyntaxException e) {\n logError(INVALID_FILTER_SYNTAX);\n }\n \n // Register an extension to the Equinox console, in order to\n // provide commands for managing metric services\n bc.registerService(\n CommandProvider.class.getName(),\n new PACommandProvider(this) ,\n null);\n }", "public abstract void addServiceListener(PhiDiscoverListener listener);", "public ServiceConfig getServiceConfig(String serviceName)\n throws SMSException {\n try {\n ServiceConfigManager scmgr = new ServiceConfigManager(serviceName,\n token);\n ServiceConfig scg = scmgr.getOrganizationConfig(orgName, null);\n return (scg);\n } catch (SSOException ssoe) {\n SMSEntry.debug.error(\"OrganizationConfigManager: Unable to \"\n + \"get Service Config\", ssoe);\n throw (new SMSException(SMSEntry.bundle\n .getString(\"sms-INVALID_SSO_TOKEN\"),\n \"sms-INVALID_SSO_TOKEN\"));\n }\n }", "public List<CatalogService> getService(String service);", "@Override\n\tpublic void configure(CServiceParameter arg0)\n\t{\n\n\t}", "@Override\n\tpublic Service upstreamServiceInit(List<String> configList) {\n\t\treturn null;\n\t}", "private void readAddServices(BufferedReader in) {\n\t\tString line, name = \"\", opis = \"\";\n\t\tDouble price = -1.0;\n\t\tStringTokenizer st;\n\t\ttry {\n\t\t\twhile ((line = in.readLine()) != null) {\n\t\t\t\tline = line.trim();\n\t\t\t\tif (line.equals(\"\") || line.indexOf('#') == 0)\n\t\t\t\t\tcontinue;\n\t\t\t\tst = new StringTokenizer(line, \";\");\n\t\t\t\twhile (st.hasMoreTokens()) {\n\t\t\t\t\tname = st.nextToken().trim();\n\t\t\t\t\topis = st.nextToken().trim();\n\t\t\t\t\tprice = Double.parseDouble(st.nextToken().trim());\n\t\t\t\t}\n\t\t\t\taddServices.put(name, new AdditionalService(name, opis, price));\n\t\t\t}\n\t\t} catch (Exception ex) {\n\t\t\tex.printStackTrace();\n\t\t}\n\t}", "public interface Provider {\n //Connection connect(String url, java.util.Properties info)\n Service newService();\n}", "@HystrixCommand(fallbackMethod = \"addServiceFallback\")\n\tpublic String addService() {\n\t\treturn restTemplate.getForEntity(\"http://COMPUTE-SERVICE/add?a=10&b=20\", String.class).getBody();\n\t}", "private void setService(Service service) {\n this.service = service;\n }", "void putServiceNameServiceInfos(net.zyuiop.ovhapi.api.objects.services.Service param0, java.lang.String serviceName) throws java.io.IOException;", "public TestService(ServiceConfiguration config) {\n this.config = config;\n System.out.println(\"starting service...\");\n this.start();\n }", "public static void loadDefaultServices(SSOToken token,\n OrganizationConfigManager ocm) throws SMSException {\n // Check if DIT has been migrated to 7.0\n if (!migratedTo70) {\n return;\n }\n Set defaultServices = ServiceManager.servicesAssignedByDefault();\n // Load the default services automatically\n OrganizationConfigManager parentOrg = ocm.getParentOrgConfigManager();\n if (defaultServices == null) {\n // There are no services to be loaded\n return;\n }\n \n Set assignedServices = new CaseInsensitiveHashSet(\n parentOrg.getAssignedServices());\n if (SMSEntry.debug.messageEnabled()) {\n SMSEntry.debug.message(\"OrganizationConfigManager\"\n + \"::loadDefaultServices \" + \"assignedServices : \"\n + assignedServices);\n }\n boolean doAuthServiceLater = false;\n String serviceName = null;\n \n // Copy service configuration\n Iterator items = defaultServices.iterator();\n while (items.hasNext() || doAuthServiceLater) {\n if (items.hasNext()) {\n serviceName = (String) items.next();\n if (serviceName.equals(ISAuthConstants.AUTH_SERVICE_NAME)) {\n doAuthServiceLater = true;\n continue;\n }\n } else if (doAuthServiceLater) {\n serviceName = ISAuthConstants.AUTH_SERVICE_NAME;\n doAuthServiceLater = false;\n }\n if (SMSEntry.debug.messageEnabled()) {\n SMSEntry.debug.message(\"OrganizationConfigManager\" +\n \"::loadDefaultServices:ServiceName \" + serviceName);\n }\n try {\n ServiceConfig sc = parentOrg.getServiceConfig(serviceName);\n Map attrs = null;\n if (sc != null && assignedServices.contains(serviceName)) {\n attrs = sc.getAttributesWithoutDefaults();\n if (SMSEntry.debug.messageEnabled()) {\n SMSEntry.debug\n .message(\"OrganizationConfigManager\"\n + \"::loadDefaultServices \"\n + \"Copying service from parent: \"\n + serviceName);\n }\n ServiceConfig scn = ocm\n .addServiceConfig(serviceName, attrs);\n // Copy sub-configurations, if any\n copySubConfig(sc, scn);\n }\n } catch (SSOException ssoe) {\n if (SMSEntry.debug.messageEnabled()) {\n SMSEntry.debug.message(\n \"OrganizationConfigManager.loadDefaultServices \" +\n \"SSOException in loading default services \",\n ssoe);\n }\n throw (new SMSException(SMSEntry.bundle\n .getString(\"sms-INVALID_SSO_TOKEN\"),\n \"sms-INVALID_SSO_TOKEN\"));\n }\n }\n }", "public void InitService() {\n\t\ttry {\r\n\t\t\tgetCommManager().register(this); \r\n\t\t} catch (CommunicationException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "java.lang.String getService();", "java.lang.String getService();", "java.lang.String getService();", "public InitService(String name) {\n super(\"InitService\");\n }", "Service(){\r\n\t\tserviceName =\"x\";\r\n\t\tserviceID = 0;\r\n\t\tserviceFee = 0.0;\r\n\t\tserviceDescrp = \"zztop\";\r\n\t}", "public interface ConfigurationService {\n /**\n * Get configuration by key\n *\n * @param configKey\n * @return\n */\n Configuration getConfigByKey(String configKey);\n}", "public abstract void setServiceType(String serviceType);", "public void setServiceContext(org.apache.axis2.context.xsd.ServiceContext param){\n localServiceContextTracker = true;\n \n this.localServiceContext=param;\n \n\n }", "protected final void registerService(Object service){\n ModuleManager.getInstance().regService(this.moduleName,service);\n }", "public interface ServiceProvider {\n\n /**\n * This method allows to define a priority for a registered ServiceProvider instance. When multiple providers are\n * registered in the system the provider with the highest priority value is taken.\n *\n * @return the provider's priority (default is 0).\n */\n int getPriority();\n\n /**\n * Access a list of services, given its type. The bootstrap mechanism should\n * order the instance for precedence, hereby the most significant should be\n * first in order. If no such services are found, an empty list should be\n * returned.\n *\n * @param serviceType the service type.\n * @return The instance to be used, never {@code null}\n */\n <T> List<T> getServices(Class<T> serviceType);\n\n /**\n * Access a single service, given its type. The bootstrap mechanism should\n * order the instance for precedence, hereby the most significant should be\n * first in order and returned. If no such services are found, null is\n * returned.\n *\n * @param serviceType the service type.\n * @return The instance, (with highest precedence) or {@code null}, if no such service is available.\n */\n default <T> T getService(Class<T> serviceType) {\n return getServices(serviceType).stream().findFirst().orElse(null);\n }\n}", "void setServiceId(java.lang.String serviceId);", "public InitService() {\n super(\"InitService\");\n }", "boolean addServiceInstance(Service service, InstancePublishInfo instancePublishInfo);", "public <T> void registerService(Class<T> serviceClass, T impl) {\n services.put(serviceClass, impl);\n }", "public void setServiceName(String serviceName)\r\n {\r\n this.serviceName = serviceName;\r\n }", "public Builder setService(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n service_ = value;\n onChanged();\n return this;\n }", "public Builder setService(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n service_ = value;\n onChanged();\n return this;\n }", "public Builder setService(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n service_ = value;\n onChanged();\n return this;\n }", "public final void setService(java.lang.String service)\r\n\t{\r\n\t\tsetService(getContext(), service);\r\n\t}", "public void onAdd(final ForwardEvent event) {\r\n\t\t// Get the values and validate the data\r\n\t\tfinal Textbox txtService = (Textbox) Path.getComponent(page, \"txtService\");\r\n\t\tfinal String serviceName = txtService.getValue().trim();\r\n\t\tfinal Doublebox txtCharge = (Doublebox) Path.getComponent(page, \"txtCharge\");\r\n\t\tfinal Checkbox chkHidden = (Checkbox) Path.getComponent(page, \"chkHidden\");\r\n\t\tLOGGER.debug(\"Adding new service: \" + txtService.getValue() + \"\\t\" + txtCharge.getValue());\r\n\t\tif (serviceName.length() <= 0 || txtCharge.getValue() == null) {\r\n\t\t\ttry {\r\n\t\t\t\tMessagebox.show(\"Enter the service name and charge\", \"Error in input\", Messagebox.OK, Messagebox.ERROR);\r\n\t\t\t} catch (final Exception e) {\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tfinal IPaymentDAO paymentDAO = (IPaymentDAO) SpringUtil.getBean(\"paymentDAO\");\r\n\t\tif (paymentDAO.checkService(serviceName)) {\r\n\t\t\ttry {\r\n\t\t\t\tMessagebox.show(\"Service already exists\", \"Error in input\", Messagebox.OK, Messagebox.ERROR);\r\n\t\t\t} catch (final Exception e) {\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// Create new service and save it\r\n\t\tfinal MasterService service = new MasterService();\r\n\t\tservice.setServiceName(txtService.getValue().trim());\r\n\t\tservice.setCharge(txtCharge.getValue());\r\n\t\tservice.setHidden(chkHidden.isChecked());\r\n\t\tpaymentDAO.addMasterService(service);\r\n\r\n\t\t// Add this new service to listmodel and invalidate the list\r\n\t\tfinal ListModelList services = (ListModelList) page.getAttribute(\"serviceslist\");\r\n\t\tservices.add(service);\r\n\t\tpage.setAttribute(\"serviceslist\", services);\r\n\t\tfinal Listbox lstservice = (Listbox) Path.getComponent(page, \"lstservice\");\r\n\t\tlstservice.setModel(services);\r\n\t\tlstservice.invalidate();\r\n\t\tLOGGER.debug(\"added service\");\r\n\t}", "Service newService();", "ServicesPackage getServicesPackage();", "public org.biocatalogue.x2009.xml.rest.ServiceDeployment addNewServiceDeployment()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n org.biocatalogue.x2009.xml.rest.ServiceDeployment target = null;\r\n target = (org.biocatalogue.x2009.xml.rest.ServiceDeployment)get_store().add_element_user(SERVICEDEPLOYMENT$0);\r\n return target;\r\n }\r\n }", "private void initService() {\r\n\t}", "public void serviceAdded(ServiceDescription service) {\n System.out.println(\"service added\");\n current = service;\n //set up channel to communicate with server\n //multiple beds -> multiple channels\n channel = ManagedChannelBuilder.forAddress(service.getAddress(), service.getPort())\n .usePlaintext(true)\n .build();\n\n //To call service methods, we first need to create a stub, \n //a blocking/synchronous stub: this means that the RPC call waits for the server to respond, \n //and will either return a response or raise an exception.\n blockingStub = ProjectorGrpc.newBlockingStub(channel);\n\n activateProjector();\n //listInputs();\n\n }", "public abstract ServiceLocator create(String name);", "public void setService(CentralSystemServiceFactory service) {\n\t\tthis.service = service;\n\t}", "public interface ServiceContext {\r\n /**\r\n * @return configuration for the service.\r\n */\r\n ServiceConfigurable service();\r\n}", "public Builder addService(ServerServiceDefinition service) {\n services.put(\n service.getServiceDescriptor().getName(),\n service);\n return this;\n }", "@Override\n public String getServicesXMLPath()\n {\n return servicesXMLPath;\n }" ]
[ "0.74331206", "0.6653691", "0.6540115", "0.6383961", "0.6354347", "0.6045102", "0.6028833", "0.60274017", "0.60274017", "0.6019688", "0.6019688", "0.59349567", "0.59056467", "0.58818686", "0.5866148", "0.57989377", "0.5742364", "0.57253253", "0.56853276", "0.5627213", "0.5585308", "0.55454314", "0.554344", "0.55392206", "0.5518702", "0.55124325", "0.55122465", "0.55040556", "0.54986507", "0.54778475", "0.5462934", "0.5456962", "0.54467964", "0.5444993", "0.5441001", "0.54406226", "0.5431701", "0.5427466", "0.5415763", "0.5398862", "0.5398862", "0.5398862", "0.53858876", "0.5360599", "0.5358159", "0.5334091", "0.53268886", "0.5318793", "0.5316348", "0.5274643", "0.5270317", "0.52688986", "0.52672195", "0.5264787", "0.5245018", "0.5228428", "0.5212307", "0.5197657", "0.51975125", "0.5195934", "0.51945573", "0.5184847", "0.51819706", "0.51796067", "0.51463664", "0.5128974", "0.512655", "0.51235956", "0.51101404", "0.51094997", "0.51044387", "0.5103022", "0.5103022", "0.5103022", "0.50937754", "0.50935024", "0.50789", "0.5070323", "0.5058341", "0.50559217", "0.50515187", "0.50431967", "0.5040331", "0.50335735", "0.50256187", "0.50252277", "0.5025014", "0.5025014", "0.5025014", "0.501717", "0.501585", "0.5012784", "0.5011931", "0.5003594", "0.4999429", "0.49986854", "0.4995206", "0.49944833", "0.49923044", "0.49838963", "0.49817485" ]
0.0
-1
TIME COMPLEXITY FOR LINEAR SEARCH IS O(n)
public int linearSearch(int[] array,int target) { for (var index = 0; index < array.length; index++) { if (array[index] == target) return index; } return -1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static double linSearchT(int s, Integer[] a){\n Random rand = new Random();\n int searchVar;\n Stopwatch timer = new Stopwatch();\n for (int i = 0; i < s; i++){\n searchVar = (int)(rand.nextDouble()*a.length);\n for (int j = 0; j < a.length; j++){\n if (a[j] == searchVar)\n break;\n }\n }\n return timer.elapsedTime(); // the method returns the elapsed time\n }", "public void linSearch(int current) {\r\n long average1 = 0, timeA = 0, stanDev = 0;\r\n System.out.println(\"\\nLINEAR SEARCH\\n\");\r\n for (int i = 0; i < 10; i++) {\r\n long start = System.nanoTime();\r\n for (int j = 10000000; A[j] >= current; j--) {\r\n if (current == A[j]) {\r\n long stop = System.nanoTime();\r\n long timelength = (stop - start);\r\n timeA += timelength;// USED FOR GETTING AVERAGE. \r\n lin[g][i] = timelength;//USED FOR STORING THE TIME IT TOOK FOR EACH TEST, IT IS USED LATER ON TO DISPLAY IN THE CHART.\r\n linear[i] = timelength;//USED FOR FINDING STANDARD DEVIATION.\r\n System.out.println(\"The number: \" + current + \" was found at index: \" + A[j] + \".\\n\"\r\n + \"It took: \" + timelength + \" nanoseconds.\");\r\n }\r\n }\r\n }\r\n average1 = (timeA / 10);\r\n linAvAndDev[h][0] = average1;//STORES THE AVEARGE FOR THE TESTS RUNS AND USED FOR THE CHART.\r\n for (int i = 0; i < 10; i++) {\r\n stanDev += Math.pow((linear[i] - average1), 2.0);\r\n }\r\n stanDev /= 10;\r\n stanDev = (long) Math.sqrt(stanDev);\r\n linAvAndDev[h][1] = stanDev;//STORES THE STANDARD DEVIATION AND IS USED FOR THE CHART. MIGHT NOT BE WORKING CORRECTLY.\r\n System.out.println(\"The Avearge time for the Linear Search was: \" + average1 + \" nanoseconds.\"\r\n + \"\\nThe Standard Deviation time for the Linear Search was: \" + stanDev + \" nanoseconds.\");\r\n g += 1;//USED FOR GOING THROUGH THE OBJECT ARRAY TO STORE INFORMATION.\r\n h += 1;\r\n }", "Long[] searchSolution(int timeLimit, Graph g);", "public static void searchTest() {\n\t\t//linear tests\n\t\tStopWatch1 timer;\n\t\tint[] array = generateArray(5000000,1,5000000);\n\t\tSystem.out.printf(\"%15s%10s%10s%10s%10s%10s%n\",\"Size\",\"Sort Type\",\"Pre-sort\",\"Value\",\"Index\",\"Time\");\n\t\tfor(int i = 0; i< 5; i++) {\n\t\t\ttimer = new StopWatch1();\n\t\t\tint temp = (int)(Math.random() * (5000000)) +1;\n\t\t\tSystem.out.printf(\"%15d%10s%10s%10d\",5000000,\"Linear\",\"Random\",temp);\n\t\t\ttimer.start();\n\t\t\tint result = Search.linearSearch(array, temp);\n\t\t\ttimer.stop();\n\t\t\tif(result>0) {\n\t\t\t\tSystem.out.printf(\"%10d\",result);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tSystem.out.printf(\"%10s\",\"Not Found\");\n\t\t\t}\n\t\t\tSystem.out.printf(\"%10d%n\", timer.getElapsedTime());\n\t\t\t\n\t\t}\n\t\tSort.mergeSort(array);\n\t\tfor(int i = 0; i< 5; i++) {\n\t\t\ttimer = new StopWatch1();\n\t\t\tint temp = (int)(Math.random() * (5000000)) +1;\n\t\t\tSystem.out.printf(\"%15d%10s%10s%10d\",5000000,\"Linear\",\"Sorted\",temp);\n\t\t\tint result = Search.linearSearch(array, temp);\n\t\t\tif(result>0) {\n\t\t\t\tSystem.out.printf(\"%10d\",result);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tSystem.out.printf(\"%10s\",\"Not Found\");\n\t\t\t}\n\t\t\tSystem.out.printf(\"%10d%n\", timer.getElapsedTime());\n\t\t}\n\t\tfor(int i =0; i< 5; i++) {\n\t\t\ttimer = new StopWatch1();\n\t\t\tint temp = (int)(Math.random() * (5000000)) +1;\n\t\t\tSystem.out.printf(\"%15d%10s%10s%10d\",5000000,\"Binary\",\"Sorted\",temp);\n\t\t\tint result = Search.binarySearch(array, temp);\n\t\t\tif(result>0) {\n\t\t\t\tSystem.out.printf(\"%10d\",result);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tSystem.out.printf(\"%10s\",\"Not Found\");\n\t\t\t}\n\t\t\tSystem.out.printf(\"%10d%n\", timer.getElapsedTime());\n\t\t}\n\t}", "public static void main(String[] args){\n int s = 80;\n int n = (int) Math.pow(10, 7);\n Integer[] a = new Integer[n];\n Random rand = new Random();\n for (int i = 0; i < n; i++){\n a[i] = (int) (n*rand.nextDouble());\n }\n double binTime = binSearchT(s, a);\n double linTime = linSearchT(s, a);\n System.out.println(\"binTime: \"+ binTime);\n System.out.println(\"linTime: \"+ linTime);\n\n }", "public static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\n\t\tint a[] = {2,1,3,-4,-2};\n\t\t//int a[] = {1 ,2, 3, 7, 5};\n\t\tboolean found = false;\n\t\t\n\t\t//this will solve in o n^2\n\t\tfor(int i = 0 ; i < a.length ; i++){\n\t\t\tint sum = 0;\n\t\t\tfor(int j = i ; j< a.length ; j++){\n\t\t\t\tsum += a[j] ;\n\t\t\t\tif(sum == 0){\n\t\t\t\t\tfound = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tif(found)\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\t\n\t\t// link : https://www.youtube.com/watch?v=PSpuM9cimxA&list=PLKKfKV1b9e8ps6dD3QA5KFfHdiWj9cB1s&index=49\n\t\tSystem.out.println(found + \" found\");\n\t\tfound = false;\n\t\t//solving with O of N with the help sets\n\t\t// x + 0 = y\n\t\tSet<Integer> set = new HashSet<>();\n\t\tint sum = 0;\n\t\tfor(int element : a){\n\t\t\tset.add(sum);\n\t\t\tsum += element;\n\t\t\tif(set.contains(sum)){\n\t\t\t\tfound = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println();\n\t\tSystem.out.println(set);\n\t\t\n\t\tSystem.out.println(found + \" found\");\n\t\t\n\t\t\n\t\tfound = false;\n\t\t// when the sum of subarray is K\n\t\t\n\t\t//solving with O of N with the help sets\n\t\t//x + k = y >>>\n\t\tSet<Integer> set1 = new HashSet<>();\n\t\tint k = 12;\n\t\tint summ = 0;\n\t\tfor(int element : a){\n\t\t\tset1.add(summ);\n\t\t\tsumm += element;\n\t\t\tif(set1.contains(summ - k)){ // y - k = x(alredy presnt or not)\n\t\t\t\tfound = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(set1);\n\t\tSystem.out.println();\n\t\tSystem.out.println(found + \" found\");\n\t\t\n\t\t\n\t}", "public static void main(String[] args) {\n Random r = new Random();\n// r.setSeed(1982);\n int R = 500;\n int L = 100000;\n\n int start = -500;\n int end = 500;\n HashSet<Point> hi3 = new HashSet<>();\n List<Point> hi5 = new ArrayList<>();\n Stopwatch sw = new Stopwatch();\n for (int i = 0; i < L; i += 1) {\n double ran = r.nextDouble();\n double x = start + (ran * (end - start));\n ran = r.nextDouble();\n double y = start + (ran * (end - start));\n Point temp = new Point(x, y);\n hi5.add(temp);\n\n }\n KDTree speedTest = new KDTree(hi5);\n NaivePointSet speedTest2 = new NaivePointSet(hi5);\n\n// for (int i = 0; i < 1000; i++) {\n// double ran = r.nextDouble();\n// double x2 = start + (ran *(end - start));\n// ran = r.nextDouble();\n// double y2 = start + (ran *(end - start));\n// assertEquals(speedTest2.nearest(x2, y2), speedTest.nearest(x2, y2 ));\n// }\n// assertEquals(speedTest2.nearest(r.nextInt(R + 1 - 500) + 500,\n// r.nextInt(R + 1 - 500) + 100), speedTest.nearest(427.535670, -735.656403));\n\n System.out.println(\"elapsed time1: \" + sw.elapsedTime());\n\n int R2 = 100;\n int L2 = 10000;\n Stopwatch sw2 = new Stopwatch();\n for (int i = 0; i < L2; i += 1) {\n\n speedTest2.nearest(r.nextDouble(), r.nextDouble());\n }\n\n System.out.println(\"elapsed time: \" + sw2.elapsedTime());\n }", "public static int f2(int N) { \n int x = 0; //O(1)\n for(int i = 0; i < N; i++) // O(n)\n // O(n)`\n for(int j = 0; j < i; j++) \n x++;\n return x;\n }", "public boolean linearIn(int[] outer, int[] inner) {\r\n int comp=0; // O(1)\r\n int count=0; // O(1)\r\n if(inner.length==0) // O(1)\r\n return true; // O(1)\r\n for(int i=0; i<outer.length; i++) { // O(n)\r\n if(outer[i]==inner[count]) { // O(1)\r\n comp++; // O(1)\r\n count++; // O(1)\r\n } else if(outer[i]>inner[count]) // O(1)\r\n return false; // O(1)\r\n if (comp==inner.length) // O(1)\r\n return true; // O(1)\r\n }\r\n return false; // O(1)\r\n}", "List<Long> getBestSolIntersection();", "public int solution(int N) {\n\n int l = 0; // 2*l - r\n int r = 1; // 2*r - l\n\n return search(l, r, N);\n }", "public static void main(String[] args) {\n\t\tint size = 600_000_000;\n\t\tint[] mas = new int[size];\n\t\tfor (int i = 0; i < size; i++) {\n\t\t\tmas[i] = i;\n\t\t}\n\n\t\t// positive test\n\t\tint target = size - 1;\n\n\t\tlong start = System.currentTimeMillis();\n\t\tlinearSearchTestPositive(mas, target, target);\n\t\tlong end = System.currentTimeMillis();\n\t\tSystem.out.println(end - start);\n\n\n\t\tlong start1 = System.currentTimeMillis();\n\t\tbinarySearchTestPositive(mas, target, target);\n\t\tlong end1 = System.currentTimeMillis();\n\t\tSystem.out.println(end1 - start1);\n\t}", "private static int search(int[] arr, int n, int x, int k) {\n\t\tint i = 0;\n\t\twhile (i < n) {\n\n\t\t\t// If x is found at index i\n\t\t\tif (arr[i] == x)\n\t\t\t\treturn i;\n\n\t\t\t// Jump the difference between\n\t\t\t// current array element and x\n\t\t\t// divided by k We use max here\n\t\t\t// to make sure that i moves\n\t\t\t// at-least one step ahead.\n\t\t\ti = i + Math.max(1, Math.abs(arr[i] - x) / k);\n\n\t\t}\n\n\t\tSystem.out.println(\"number is not\" + \" present!\");\n\n\t\treturn -1;\n\t}", "public static void main(String[] args) \n {\n int[] numOfPoints = { 1000, 10000, 7000, 10000, 13000 };\n for(int count = 0; count < numOfPoints.length; count++)\n {\n List<Point> pointsTobeUsed = new ArrayList<Point>();\n int current = numOfPoints[count];\n int inc = 0;\n \n //creating list of points to be used\n for(int x = 0; x <= current; x++)\n {\n \n if(x <= current/2)\n {\n pointsTobeUsed.add(new Point(x,x));\n \n }\n else\n {\n pointsTobeUsed.add(new Point(x, x - (1 + 2*(inc)) ) );\n inc++;\n }\n }\n \n //n logn implementation of Pareto optimal\n long timeStart = System.currentTimeMillis();\n \n // n logn quicksort\n pointsTobeUsed = quickSort(pointsTobeUsed, 0, pointsTobeUsed.size() -1 );\n \n \n \n ParetoOptimal(pointsTobeUsed);\n \n \n long timeEnd = System.currentTimeMillis();\n System.out.println(\"final:\" + \" exper: \" + (timeEnd - timeStart) + \" N: \" + current ); \n }\n }", "public static double binSearchT(int s, Integer[] a){\n Random rand = new Random();\n int searchVar;\n Stopwatch timer = new Stopwatch();\n Arrays.sort(a);\n for (int i = 0; i < s; i++){\n searchVar = (int)(rand.nextDouble()*a.length);\n Arrays.binarySearch(a, searchVar);\n }\n return timer.elapsedTime(); // the method returns the elapsed time\n }", "private static long calc1()\n {\n final int min = 1000;\n final int max = 10000;\n\n // initialize\n List<List<Integer>> m = new ArrayList<>();\n for (int k = 0; k < end; k++) {\n List<Integer> list = new ArrayList<Integer>();\n int n = 1;\n while (k >= start) {\n int p = pkn(k, n);\n if (p >= max) {\n break;\n }\n if (p >= min) {\n list.add(p);\n }\n n++;\n }\n m.add(list);\n }\n\n boolean[] arr = new boolean[end];\n arr[start] = true;\n\n List<Integer> solutions = new ArrayList<>();\n List<Integer> list = m.get(start);\n for (Integer first : list) {\n LinkedList<Integer> values = new LinkedList<>();\n values.add(first);\n f(m, arr, values, 1, solutions);\n // we stop at the first solution found\n if (!solutions.isEmpty()) {\n break;\n }\n }\n\n // solutions.stream().forEach(System.out::println);\n int res = solutions.stream().reduce(0, Integer::sum);\n return res;\n }", "public static int f1(int N) {\n int x = 0; //O(1)\n for(int i = 0; i < N; i++) // O(n) \n x++; \n return x; \n \n }", "private static void task22(int nUMS, AVLTree<Integer> h) {\n\t\t\n\t\tSystem.out.println(\"AVL Started...\");\n\t double search_start = 0, search_end = 0;\n\t int totalkeymatched = 0;\n\n\t search_start = System.nanoTime();\n\t \n\t for (int z = 0; z < nUMS; z++) {\n\t \tint checker= GenerateInt.generateNumber();\n\t \t\n//\t \tSystem.out.println(GenerateStrings.getAlphaNumericString(limit));\n\t if (h.contains(checker)) {\n\t\n//\t System.out.println(\"Key Matches\");\n\t totalkeymatched++;\n\t \t }\n\t }\n\t search_end = System.nanoTime();\n\t System.out.println(\"Average time for each search: \" + (search_end - search_start) / nUMS + \" nanoseconds\");\n\t System.out.println(\"TOTAL MATCHES \" + totalkeymatched);\n\t\t\n\t\t\n\t}", "@Override\n protected Integer compute() {\n if ((this.end - this.start) > 10) {\n int middle = (this.start + this.end) / 2;\n RecursiveTask<Integer> task1 = new SearchFJP<T>(\n this.array, start, middle, start, this.searchIndex\n );\n RecursiveTask<Integer> task2 = new SearchFJP<T>(\n this.array, middle, end, middle, this.searchIndex\n );\n task1.fork();\n task2.fork();\n return task1.join() + task2.join();\n } else {\n return serialSearch();\n }\n }", "private double calcNearestNeighborIndex(ArrayList<Point> pts) {\n int width = layoutPanel.getLayoutSize().width;\n int height = layoutPanel.getLayoutSize().height;\n\n // calculate average nearest neighbor\n double avgNN = 0;\n int n = pts.size();\n for (int i = 0; i < n; i++) {\n double minDist = Float.MAX_VALUE;\n for (int j = 0; j < n; j++) {\n if (i != j) {\n Point pti = pts.get(i);\n Point ptj = pts.get(j);\n double dist = Point2D\n .distanceSq(pti.x, pti.y, ptj.x, ptj.y);\n if (minDist > dist) {\n minDist = dist;\n }\n }\n }\n avgNN += Math.sqrt(minDist);\n }\n avgNN = avgNN / (double) n;\n\n // calculate estimated average neighbor\n double estANN = 1.0 / (2.0 * Math.sqrt((double) n\n / (double) (width * height)));\n\n return avgNN / estANN;\n }", "private static void task2(int nUMS, BinarySearchTree<Integer> t) {\n\t\tSystem.out.println(\"Binary Search Started...\");\n\t double search_start = 0, search_end = 0;\n\t int totalkeymatched = 0;\n\n\t search_start = System.nanoTime();\n\t \n\t for (int z = 0; z < nUMS; z++) {\n\t \tint checker= GenerateInt.generateNumber();\n\t \t\n//\t \tSystem.out.println(GenerateStrings.getAlphaNumericString(limit));\n\t if (t.contains(checker)) {\n\t\n//\t System.out.println(\"Key Matches\");\n\t totalkeymatched++;\n\t \t }\n\t }\n\t search_end = System.nanoTime();\n\t System.out.println(\"Average time for each search: \" + (search_end - search_start) / nUMS + \" nanoseconds\");\n\t System.out.println(\"TOTAL MATCHES \" + totalkeymatched);\n\t\t\n\t}", "public static void linearSearch(int[] array,int key){\n for(int i=0;i<array.length;i++){\n if(array[i]==key){\n System.out.println(key+\" was found in the list with \"+(i+1)+\" iterations\");break;}\n else if(i==array.length-1&&array[i]!=key){\n System.out.println(key+\" was not found in the list with \"+(i+1)+\" iterations\"); }\n }\n }", "private static void task222(int nUMS, RedBlackBST<Integer, Integer> i) {\n\t\tSystem.out.println(\"RED BLAST BST Started Search...\");\n\t double search_start = 0, search_end = 0;\n\t int totalkeymatched = 0;\n\n\t search_start = System.nanoTime();\n\t \n\t for (int z = 0; z < nUMS; z++) {\n\t \tint checker= GenerateInt.generateNumber();\n\t \t\n//\t \tSystem.out.println(GenerateStrings.getAlphaNumericString(limit));\n\t if (i.contains(checker)) {\n\t\n//\t System.out.println(\"Key Matches\");\n\t totalkeymatched++;\n\t \t }\n\t }\n\t search_end = System.nanoTime();\n\t System.out.println(\"Average time for each search: \" + (search_end - search_start) / nUMS + \" nanoseconds\");\n\t System.out.println(\"TOTAL MATCHES \" + totalkeymatched);\n\n\t}", "private static void task2222(int nUMS, SplayTree<Integer> j) {\n\t\tSystem.out.println(\"SPLAY Started Search...\");\n\t double search_start = 0, search_end = 0;\n\t int totalkeymatched = 0;\n\n\t search_start = System.nanoTime();\n\t \n\t for (int z = 0; z < nUMS; z++) {\n\t \tint checker= GenerateInt.generateNumber();\n\t \t\n//\t \tSystem.out.println(GenerateStrings.getAlphaNumericString(limit));\n\t if (j.contains(checker)) {\n\t\n//\t System.out.println(\"Key Matches\");\n\t totalkeymatched++;\n\t \t }\n\t }\n\t search_end = System.nanoTime();\n\t System.out.println(\"Average time for each search: \" + (search_end - search_start) / nUMS + \" nanoseconds\");\n\t System.out.println(\"TOTAL MATCHES \" + totalkeymatched);\n\n\t}", "public static double ludcmp(double a[][], int indx[])\n\t\t\t{\n\tint n = a.length;\n\tint i = 0, imax = 0, j = 0, k = 0;\n\tdouble big, dum, sum, temp;\n\tdouble d = 1.0;\n\tdouble vv[] = new double[n];\n\tfor (i = 0; i < n; i++) {\n big = 0.0;\n for (j = 0; j < n; j++)\n if ((temp = Math.abs(a[i][j])) > big)\n\t\tbig = temp;\n\n\tif (big == 0.0) {\n try {\n // no non-zero largest element\n\n throw new NRException(\"Error: Singular linearized system. Computation cannot proceed.\");\n } catch (NRException ex) {\n ex.printStackTrace();\n }\n\n\t}\n\tvv[i] = 1.0 / big;\n }\n\n for (j = 0; j < n; j++) {\n\tfor (i = 0; i < j; i++) {\n sum = a[i][j];\n for (k = 0; k < i; k++)\n sum -= (a[i][k] * a[k][j]);\n a[i][j] = sum;\n\t}\n\tbig = 0.0;\n\tfor (i = j; i < n; i++) {\n sum = a[i][j];\n for (k = 0; k < j; k++)\n sum -= (a[i][k] * a[k][j]);\n a[i][j] = sum;\n\t\n if ((dum = vv[i] * Math.abs(sum)) >= big) {\n\t\tbig = dum;\n\t\timax = i;\n\t\t}\n\t}\n\tif (j != imax) {\n\t\tfor (k = 0; k < n; k++) {\n\t\tdum = a[imax][k];\n\t\ta[imax][k] = a[j][k];\n\t\ta[j][k] = dum;\n }\n d = -d;\n vv[imax] = vv[j];\n }\n\tindx[j] = imax;\n\t// replace zero values with a nigh zero value so that\n\t// we don't get any divisions by zero.\n if (a[j][j] == 0.0)\n\t a[j][j] = TINY;\n\n\tif (j != n-1) {\n\tdum = 1.0 / (a[j][j]);\n\tfor (i = j + 1; i < n; i++)\n\t a[i][j] *= dum;\n\t}\n }\n\treturn d;\n\t}", "public int[] findAnyPairIndexesWhileLCMMinimized() {\n if (seq.length < 2) {\n return null;\n }\n int size = 0;\n for (int i = 1; i <= m; i++) {\n size += m / i;\n }\n\n IntegerMultiWayDeque deque = new IntegerMultiWayDeque(m + 1, size);\n for (int i = 1; i <= m; i++) {\n for (int j = i; j <= m; j += i) {\n if (!indexesOfSeq.isEmpty(j)) {\n deque.addLast(i, j / i);\n }\n }\n }\n\n long lcm = INF;\n int v1 = 0;\n int v2 = 0;\n\n for (int i = 1; i <= m; i++) {\n if (!indexesOfSeq.isEmpty(i) && indexesOfSeq.peekFirst(i) != indexesOfSeq.peekLast(i)) {\n lcm = v1 = v2 = i;\n break;\n }\n }\n\n IntegerVersionArray iva = new IntegerVersionArray(m + 1);\n IntegerDequeImpl stack = new IntegerDequeImpl(m);\n for (int i = 1; i <= m; i++) {\n iva.clear();\n stack.clear();\n while (!deque.isEmpty(i)) {\n int last = deque.removeFirst(i);\n factorize(last);\n int total = ie(iva, allFactors.size() - 1, 1, 0);\n if (total > 0) {\n int pop = 0;\n while (total > 0) {\n pop = stack.removeLast();\n if (GCDs.gcd(pop, last) == 1) {\n total--;\n }\n add(iva, pop, -1);\n }\n long l = LCMs.lcm(last, pop) * i;\n if (l < lcm) {\n lcm = l;\n v1 = last * i;\n v2 = pop * i;\n }\n }\n add(iva, last, 1);\n stack.addLast(last);\n }\n }\n\n return new int[]{indexesOfSeq.peekFirst(v1), indexesOfSeq.peekLast(v2)};\n }", "private int count1D(SearchContext ctx) {\n\t\tfinal SearchNode curNode = ctx.current();\n\n\t\tfinal int last1d = Integer.numberOfLeadingZeros(~curNode.contained);\n\t\tWaveletMatrix wm = zoWM[last1d];\n\t\tfinal WMNode wmNode = curNode.wmNodes[last1d];\n\t\tfinal int lv = wmNode.level;\n\t\tfinal int start = wmNode.start;\n\t\tfinal int end = start + curNode.width;\n\n\t\t// query range\n\t\tfinal int qmin = ctx.qmins[last1d];\n\t\tfinal int qmax = ctx.qmaxs[last1d];\n\n\t\t// path range (possible range of WaveletMatrix node)\n\t\tfinal int pmin = wmNode.path;\n\t\tfinal int pmax = pmin | ((1 << (lv+1)) - 1);\n\n\t\t// relation of query range and path range intersection\n\t\t// [qmin , qmax] query range\n\t\t// [pmin,pmax] path range contain minimum of query range\n\t\t// [pmin,pmax] path range contain maximum of query range\n\t\t// [pmin , pmax] path range fully contain query range\n\n\t\tif (pmax <= qmax) {\n\t\t\treturn end - start - little1D(lv, start, end, qmin, wm);\n\t\t}\n\t\telse if (qmin <= pmin) {\n\t\t\treturn little1D(lv, start, end, qmax + 1, wm);\n\t\t}\n\t\telse {\n\t\t\treturn little1D(lv, start, end, qmax + 1, wm) - little1D(lv, start, end, qmin, wm);\n\t\t}\n\t}", "public static boolean find3Numbers(int A[], int n, int X) { \n \n // Your code \n for(int i=0;i<n-2;i++)\n {\n HashSet<Integer> set = new HashSet<>();\n int toFind=X-A[i];\n for(int j=i+1;j<n;j++)\n {\n if(set.contains(toFind-A[j]))\n {\n return true;\n }\n set.add(A[j]);\n }\n }\n return false;\n }", "static long countTriplets(List<Long> arr, long r) {\n long result = 0L;\n long size = arr.size();\n\n ArrayList<long[]> duoList = new ArrayList<>();\n\n // triplet 이 될 수 있는 duo를 선발\n for (int i = 0; i < (size - 1); i++) {\n long firstItem = arr.get(i);\n\n for (int j = i + 1; j < size; j++) {\n long secondItem = arr.get(j);\n if (j >= (size - 1)) continue;\n if (secondItem / (float) firstItem == r) {\n long[] tripletAble = {i, j};\n // System.out.println(\"tripletAble : \" + Arrays.toString(tripletAble));\n if (duoList.contains(tripletAble)) {\n continue;\n } else {\n duoList.add(tripletAble);\n }\n }\n }\n }\n\n // duo인 int[] 의 두 번째 item (int[1]) 의 다음 index부터 탐색해서\n // 해당 수가 triplet이 될 수 있다면 result + 1\n // 판단 기준은 thirdItem / secondItem 이 r이 되는 경우\n int listSize = duoList.size();\n for (int k = 0; k < listSize; k++) {\n long[] targetArr = duoList.get(k);\n long secondIdx = targetArr[1];\n for (int l = (int) secondIdx + 1; l < size; l++) {\n\n long secondItem = arr.get((int) targetArr[1]);\n long thirdItem = arr.get(l);\n\n if (thirdItem / (float) secondItem == r) {\n result += 1L;\n }\n }\n }\n\n return result;\n }", "public static void main(String[] args){\n int MIN = Integer.parseInt(args[0]);\n MAX = Integer.parseInt(args[1]);\n cutoffs = new int[args.length - 2];\n cache = new ArrayList<IndexedArrayList<SuperSavvyTrieHelper2>>();\n for (int i = 2; i < args.length; i++){\n cutoffs[i - 2] = Integer.parseInt(args[i]);\n cache.add(new IndexedArrayList<SuperSavvyTrieHelper2>());\n }\n for (int i = 0; i < cutoffs.length / 2; i++){\n int temp = cutoffs[i];\n cutoffs[i] = cutoffs[cutoffs.length - 1 - i];\n cutoffs[cutoffs.length - 1 - i] = temp;\n }\n multiplicitiesUsed = new boolean[MAX + 1];\n basesUsed = new DoublyLinkedArray(MAX + 1);\n SuperSavvyTrieHelper2.setCorrespondance(basesUsed);\n /*\n long count1 = lowerRecursion(MAX, 0);\n long count2 = middleRecursion(MAX, 0);\n long count3 = upperRecursion(MAX, 0);\n long total = count1 + count2 + count3;\n System.out.printf(\"%d + %d + %d = %d\\n\", count1, count2, count3, total);\n */\n hitCounts = new long[cutoffs.length];\n missCounts = new long[cutoffs.length];\n statCollector = new StatCollector(cutoffs);\n\n long startTime = System.nanoTime();\n long[] values = new long[MAX - MIN + 1];\n for (int i = MIN; i <= MAX; i++) {\n values[i - MIN] = upperRecursionWrapper(i);\n }\n //long[] testValues = new long[] {1752443,1911046, 2067456,2249444,2429337, 2647532,2852449,3101167,3350292,3632299,3916575};\n for (int i = 0; i < values.length; i++){\n //if (testValues[i] != values[i]){\n System.out.printf(\"%d: %d\\n\", i + MIN, values[i]);\n //}\n }\n long endTime = System.nanoTime();\n System.out.printf(\"%f,\", (double)(endTime - startTime) / 1000000000.0);\n long totalMissCounts = 0;\n long totalMissWeight1 = 0;\n long totalMissWeight2 = 0;\n long totalMissWeight3 = 0;\n /*\n for (int i = 0; i < cutoffs.length; i++){\n long totalCounts = hitCounts[i] + missCounts[i];\n totalMissCounts += missCounts[i];\n totalMissWeight1 += missCounts[i] * cutoffs[i];\n totalMissWeight2 += (hitCounts[i] / missCounts[i]) * cutoffs[i];\n totalMissWeight3 += (hitCounts[i] - missCounts[i]) * cutoffs[i] * cutoffs[i];\n System.out.printf(\"\\tCache %d: %d/%d/%d (%.5f%%)\", cutoffs[i], hitCounts[i], missCounts[i], totalCounts, (double) hitCounts[i] / totalCounts);\n }\n System.out.printf(\"\\t\\tMissCounts: %d, weighted: %d, ratio: %d, diff^2: %d\\n\", totalMissCounts, totalMissWeight1, totalMissWeight2, totalMissWeight3);\n */\n statCollector.printAll();\n }", "private int getCondensedIndex(int n, int i, int j) {\n if (i < j) {\n return n * i - (i * (i + 1) / 2) + (j - i - 1);\n }\n else if (i > j) {\n return n * j - (j * (j + 1) / 2) + (i - j - 1);\n }\n else{\n return 0;\n }\n }", "private static boolean kthSmallesElementFound(int[] list1, int[] list2, int nElementsList1, int nElementsList2) {\n if(nElementsList2 < 1) {\n return true;\n }\n\n if(list1[nElementsList1-1] == list2[nElementsList2-1]) {\n return true;\n }\n\n if(nElementsList1 == list1.length) {\n return list1[nElementsList1-1] <= list2[nElementsList2];\n }\n\n if(nElementsList2 == list2.length) {\n return list2[nElementsList2-1] <= list1[nElementsList1];\n }\n\n return list1[nElementsList1-1] <= list2[nElementsList2] && list2[nElementsList2-1] <= list1[nElementsList1];\n }", "static int[] sol1(int[]a, int n){\r\n\t\tMap <Integer,Integer> map= new HashMap();\r\n\t\tfor (int i = 0; i< a.length; i++){\r\n\t\t\tmap.put(a[i],i);\r\n\t\t}\r\n\t\tArrays.sort(a);\r\n\t\tint i = 0; \r\n\t\tint j = a.length -1;\r\n\t\twhile (i <= j){\r\n\t\t\tif(a[i]+a[j]>n) j--;\r\n\t\t\telse if (a[i]+a[j]<n) i++;\r\n\t\t\telse break;\r\n\t\t}\r\n\t\tint[] ans= {map.get(a[i]),map.get(a[j])};\r\n\t\treturn ans;\r\n\t}", "@Test\n\tpublic void testLinearSearch() {\n\t\t//1. use the assertEquals method to test your linear search method.\n\t\tString[] test0 = {\"Taco\", \"Nacho\", \"Toquito\"};\n\t\tassertEquals(0, _00_LinearSearch.linearSearch(test0, \"Taco\"));\n\t\tassertEquals(1, _00_LinearSearch.linearSearch(test0, \"Nacho\"));\n\t\tassertEquals(2, _00_LinearSearch.linearSearch(test0, \"Toquito\"));\n\t\t\n\t\tString[] test1 = {\"Once\", \"upon\", \"a\", \"time\", \"in\", \"the\", \"East\"};\n\t\tassertEquals(6, _00_LinearSearch.linearSearch(test1, \"East\"));\n\t\t\n\t\tString[] test2 = {\"Taco\", \"Nacho\", \"Toquito\"};\n\t\tassertEquals(-1, _00_LinearSearch.linearSearch(test2, \"Loco\"));\n\t\n\t}", "public static void main(String args[] ) throws Exception {\n Scanner scanner = new Scanner(System.in);\n int n = scanner.nextInt();\n int[] seqArray = new int[n];\n for (int i = 0; i < n; i++) {\n seqArray[i] = scanner.nextInt();\n }\n // getSeqValue(seqArray); //this method is an accepted one on Hackerrank but time complexity is not order n; i.e. !O(n);\n getLinearOrderY(seqArray); // trying to get O(n) time complexity;\n }", "private static int queryLazy(int[] segtree, int[] lazyValue, int l, int r, int ns, int ne, int index) {\n if(lazyValue[index]!=0){\n segtree[index]+=lazyValue[index];\n if(ns!=ne){\n lazyValue[2*index]+=lazyValue[index];\n lazyValue[2*index+1]+=lazyValue[index];\n }\n lazyValue[index]=0;\n }\n if(r<ns || l>ne){\n //no overlap\n return Integer.MAX_VALUE;\n }\n if(ns>=l && ne<=r){\n //complete overlap\n return segtree[index];\n }else{\n //partial overlap\n int mid=(ns+ne)/2;\n int leftAns=queryLazy(segtree, lazyValue, l, r, ns, mid, 2*index);\n int rightAns=queryLazy(segtree, lazyValue, l, r, mid+1, ne, 2*index+1);\n return Math.min(leftAns,rightAns);\n }\n }", "private int exponentialSearch(IntArray arr, SourceCode codeSupport, int n, int x) throws LineNotExistsException {\r\n\r\n\t\tcodeSupport.highlight(0, 0, false);\r\n\t\tlang.nextStep();\r\n\t\tcodeSupport.toggleHighlight(0, 0, false, 2, 0);\r\n\t\tlang.nextStep();\r\n\t\tarr.highlightElem(0, null, null);\r\n\t\t\r\n\t\tif (arr.getData(0) == x) {\r\n\t\t\tcodeSupport.toggleHighlight(2, 0, false, 3, 0);\r\n\t\t\treturn 0;\r\n\t\t}\r\n\r\n\t\tcodeSupport.toggleHighlight(2, 0, false, 5, 0);\r\n\r\n\t\tarr.unhighlightElem(0, null, null);\r\n\t\tint i = 1;\r\n\t\tarr.highlightElem(i, null, null);\r\n\r\n\t\tlang.nextStep();\r\n\t\t\r\n\t\tcodeSupport.toggleHighlight(5, 0, false, 7, 0);\r\n\t\twhile (i < n && arr.getData(i) <= x) {\r\n\t\t\tlang.nextStep(\"Iteration \" + iteration++ + \" in Exponential Search\");\r\n\t\t\tcodeSupport.toggleHighlight(7, 0, false, 8, 0);\r\n\t\t\tarr.unhighlightElem(i, null, null);\r\n\t\t\ti = i * 2;\r\n\t\t\tarr.highlightElem(i, null, null);\r\n\t\t\tlang.nextStep();\r\n\t\t\tcodeSupport.toggleHighlight(8, 0, false, 7, 0);\r\n\t\t}\r\n\t\tlang.nextStep();\r\n\t\tcodeSupport.toggleHighlight(7, 0, false, 10, 0);\r\n\t\tlang.nextStep();\r\n\t\tcodeSupport.toggleHighlight(10, 0, false, 13, 0);\r\n\t\tlang.nextStep();\r\n\t\tarr.unhighlightCell(0,arr.getLength()-1, null, null);\r\n\t\tarr.highlightCell(i/2, Math.min(i, n), null, null);\r\n\t\treturn binarySearch(arr, codeSupport, i / 2, Math.min(i, n), x);\r\n\t}", "private Sim[] findNeighbors(Product p, ArrayList<Product> trainData, int k) {\n\t\tSimComparator sComparator = new SimComparator();\n\t\tPriorityQueue<Sim> pq = new PriorityQueue<Sim>(k, sComparator);\n\t\tfor (Product tp : trainData) {\n\t\t\tSim sim = getSimilarity(p, tp, weights);\n\t\t\tpq.offer(sim);\n\t\t}\n\t\tSim[] neighbors = new Sim[k];\n\t\tfor (int i = 0; i < k; i++)\n\t\t\tneighbors[i] = pq.poll();\n\t\treturn neighbors;\n\t}", "static public int solve(int n,int A[])\n {\n int freqArr[] = new int[1001];\n int dp[] = new int[1001];\n\n for(int i=0; i<n; i++){\n freqArr[A[i]]++;\n }\n\n dp[0] = 0;\n dp[1] = freqArr[1] > 0 ? freqArr[1] : 0;\n\n for(int i=2; i<=1000; i++){\n dp[i] = Math.max(dp[i-2] + i*freqArr[i], dp[i-1]);\n }\n return dp[1000];\n }", "public int[] findAnyPairIndexesWhileLCMMaximized() {\n if (seq.length < 2) {\n return null;\n }\n int size = 0;\n for (int i = 1; i <= m; i++) {\n size += m / i;\n }\n\n IntegerMultiWayDeque deque = new IntegerMultiWayDeque(m + 1, size);\n for (int i = 1; i <= m; i++) {\n for (int j = i; j <= m; j += i) {\n if (!indexesOfSeq.isEmpty(j)) {\n deque.addLast(i, j / i);\n }\n }\n }\n\n long lcm = -1;\n int v1 = 0;\n int v2 = 0;\n\n for (int i = m; i >= 1; i--) {\n if (!indexesOfSeq.isEmpty(i) && indexesOfSeq.peekFirst(i) != indexesOfSeq.peekLast(i)) {\n lcm = v1 = v2 = i;\n break;\n }\n }\n\n IntegerVersionArray iva = new IntegerVersionArray(m + 1);\n IntegerDequeImpl stack = new IntegerDequeImpl(m);\n for (int i = 1; i <= m; i++) {\n iva.clear();\n stack.clear();\n while (!deque.isEmpty(i)) {\n int last = deque.removeLast(i);\n factorize(last);\n int total = ie(iva, allFactors.size() - 1, 1, 0);\n if (total > 0) {\n int pop = 0;\n while (total > 0) {\n pop = stack.removeLast();\n if (GCDs.gcd(pop, last) == 1) {\n total--;\n }\n add(iva, pop, -1);\n }\n long l = LCMs.lcm(last, pop) * i;\n if (l > lcm) {\n lcm = l;\n v1 = last * i;\n v2 = pop * i;\n }\n }\n add(iva, last, 1);\n stack.addLast(last);\n }\n }\n\n return new int[]{indexesOfSeq.peekFirst(v1), indexesOfSeq.peekLast(v2)};\n }", "public abstract ParameterVector searchVector();", "public boolean containsNearbyAlmostDuplicate(int[] nums, int k, int t) {\n if (t < 0) return false;\n long sz = (long)t + 1;\n Map<Long, Long> map = new HashMap<>();\n for (int i = 0; i < nums.length; ++i) {\n long bucket = getBucket(nums[i], sz);\n if (map.containsKey(bucket)) return true;\n if (map.containsKey(bucket + 1) && Math.abs(nums[i] - map.get(bucket + 1)) < sz) return true;\n if (map.containsKey(bucket - 1) && Math.abs(nums[i] - map.get(bucket - 1)) < sz) return true;\n map.put(bucket, (long)nums[i]);\n if (i >= k) map.remove(getBucket(nums[i - k], sz));\n }\n return false;\n}", "private static double divideAndConquer(ArrayList<Point> X, ArrayList<Point> Y) {\n\n\t\t//Assigns size of array\n\t\tint size = X.size();\n\n\t\t//If less than 3 points, efficiency is better by brute force\n\t\tif (size <= 3) {\n\t\t\treturn BruteForceClosestPairs(X);\n\t\t}\n\t\t\n\t\t//Ceiling of array size / 2\n\t\tint ceil = (int) Math.ceil(size / 2);\n\t\t//Floor of array size / 2\n\t\tint floor = (int) Math.floor(size / 2);\n\t\t\n\t\t//Array list for x & y values left of midpoint\n\t\tArrayList<Point> xL = new ArrayList<Point>();\t\n\t\tArrayList<Point> yL = new ArrayList<Point>();\n\t\t\n\t\t//for [0 ... ceiling of array / 2]\n\t\t//add the points onto the new arrays\n\t\tfor (int i = 0; i < ceil; i++) {\n\t\t\t\n\t\t\txL.add(X.get(i));\n\t\t\tyL.add(Y.get(i));\n\t\t}\n\t\t\n\t\t// Array list for x & y values right of midpoint\n\t\tArrayList<Point> xR = new ArrayList<Point>();\n\t\tArrayList<Point> yR = new ArrayList<Point>();\n\t\t\n\t\t//for [floor of array / 2 ... size of array]\n\t\t//add the points onto the new arrays\n\t\tfor (int i = floor; i < size - 1; i++) {\n\n\t\t xR.add(X.get(i));\n\t\t\tyR.add(Y.get(i));\n\t\t}\n\t\t\n\t\t//Recursively find the shortest distance\n\t\tdouble distanceL = divideAndConquer(xL, yL);\n\t\tdouble distanceR = divideAndConquer(xR, xL);\n\t\t//Smaller of both distances\n\t\tdouble distance = Math.min(distanceL, distanceR);\n\t\t//Mid-line\n\t\tdouble mid = X.get(ceil - 1).getX();\n\n\t\tArrayList<Point> S = new ArrayList<Point>();\n\n\t\t//copy all the points of Y for which |x - m| < d into S[0..num - 1]\n\t\tfor (int i = 0; i < Y.size() - 1; i++) {\n\n\t\t\tif (Math.abs(X.get(i).getX() - mid) < distance) {\n\t\t\t\tS.add(Y.get(i));\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Square minimum distance\n\t\tdouble dminsq = distance * distance;\n\t\t//Counter\n\t\tint k = 0;\n\t\tint num = S.size();\n\n\t\tfor (int i = 0; i < num - 2; i++) {\n\t\t\t\n\t\t\tk = i + 1;\n\t\t\t\n\t\t\twhile (k <= num - 1 && (Math.pow((S.get(k).getY() - S.get(i).getY()), 2) < dminsq)) {\n\n\t\t\t\t//Find distance between points and find the minimum compared to dminsq\n\t\t\t\tdminsq = Math.min(Math.pow(S.get(k).getX() - S.get(i).getX(), 2) \n\t\t\t\t\t\t\t\t+ Math.pow(S.get(k).getY() - S.get(i).getY(), 2), dminsq);\n\n\t\t\t\tk = k + 1;\n\t\t\t}\n\t\t}\n\n\t\treturn Math.sqrt(dminsq);\n\t}", "private void findLargestNNIPointsIndexPair(float ratioInh, float ratioAct) {\n ArrayList<Point> pts0 = new ArrayList<Point>();\n ArrayList<Point> pts1 = new ArrayList<Point>();\n Dimension dim = layoutPanel.getLayoutSize();\n int height = dim.height;\n int width = dim.width;\n int size = height * width;\n int newNListSize;\n if (ratioInh > ratioAct) {\n newNListSize = (int) (size * ratioInh);\n pts0 = cnvIndexList2Points(layoutPanel.activeNList);\n pts1 = cnvIndexList2Points(layoutPanel.inhNList);\n } else {\n newNListSize = (int) (size * ratioAct);\n pts0 = cnvIndexList2Points(layoutPanel.inhNList);\n pts1 = cnvIndexList2Points(layoutPanel.activeNList);\n }\n double len = Math.sqrt((double) size / (double) newNListSize);\n\n ArrayList<Point> union = new ArrayList<Point>(pts0);\n union.addAll(pts1);\n double maxNNI = calcNearestNeighborIndex(union);\n ArrayList<Point> maxPts0 = pts0;\n ArrayList<Point> maxPts1 = pts1;\n for (int xShift = (int) Math.floor(-len / 2); xShift <= Math\n .ceil(len / 2); xShift++) {\n for (int yShift = (int) Math.floor(-len / 2); yShift <= Math\n .ceil(len / 2); yShift++) {\n if (xShift == 0 && yShift == 0) {\n continue;\n }\n int xShift0 = (int) Math.ceil((double) xShift / 2);\n int xShift1 = (int) Math.ceil((double) -xShift / 2);\n int yShift0 = (int) Math.ceil((double) yShift / 2);\n int yShift1 = (int) Math.ceil((double) -yShift / 2);\n // System.out.println(\"xShift = \" + xShift + \", xShift0 = \" +\n // xShift0 + \", xShift1 = \" + xShift1);\n ArrayList<Point> sftPts0 = getShiftedPoints(pts0, xShift0,\n yShift0);\n ArrayList<Point> sftPts1 = getShiftedPoints(pts1, xShift1,\n yShift1);\n union = new ArrayList<Point>(sftPts0);\n union.addAll(sftPts1);\n double nni = calcNearestNeighborIndex(union);\n if (nni > maxNNI) {\n maxNNI = nni;\n maxPts0 = sftPts0;\n maxPts1 = sftPts1;\n }\n }\n }\n\n if (ratioInh > ratioAct) {\n layoutPanel.activeNList = cnvPoints2IndexList(maxPts0);\n layoutPanel.inhNList = cnvPoints2IndexList(maxPts1);\n } else {\n layoutPanel.inhNList = cnvPoints2IndexList(maxPts0);\n layoutPanel.activeNList = cnvPoints2IndexList(maxPts1);\n }\n }", "public void search(IndexShort < O > index, short range, short k)\n throws Exception {\n // assertEquals(index.aDB.count(), index.bDB.count());\n // assertEquals(index.aDB.count(), index.bDB.count());\n // index.stats();\n index.resetStats();\n // it is time to Search\n int querySize = 1000; // amount of elements to read from the query\n String re = null;\n logger.info(\"Matching begins...\");\n File query = new File(testProperties.getProperty(\"test.query.input\"));\n File dbFolder = new File(testProperties.getProperty(\"test.db.path\"));\n BufferedReader r = new BufferedReader(new FileReader(query));\n List < OBPriorityQueueShort < O >> result = new LinkedList < OBPriorityQueueShort < O >>();\n re = r.readLine();\n int i = 0;\n long realIndex = index.databaseSize();\n\n while (re != null) {\n String line = parseLine(re);\n if (line != null) {\n OBPriorityQueueShort < O > x = new OBPriorityQueueShort < O >(\n k);\n if (i % 100 == 0) {\n logger.info(\"Matching \" + i);\n }\n\n O s = factory.create(line);\n if (factory.shouldProcess(s)) {\n if(i == 279){\n System.out.println(\"hey\");\n }\n index.searchOB(s, range, x);\n result.add(x);\n i++;\n }\n }\n if (i == querySize) {\n logger.warn(\"Finishing test at i : \" + i);\n break;\n }\n re = r.readLine();\n }\n \n logger.info(index.getStats().toString());\n \n int maxQuery = i;\n // logger.info(\"Matching ends... Stats follow:\");\n // index.stats();\n\n // now we compare the results we got with the sequential search\n Iterator < OBPriorityQueueShort < O >> it = result.iterator();\n r.close();\n r = new BufferedReader(new FileReader(query));\n re = r.readLine();\n i = 0;\n while (re != null) {\n String line = parseLine(re);\n if (line != null) {\n if (i % 300 == 0) {\n logger.info(\"Matching \" + i + \" of \" + maxQuery);\n }\n O s = factory.create(line);\n if (factory.shouldProcess(s)) {\n OBPriorityQueueShort < O > x2 = new OBPriorityQueueShort < O >(\n k);\n searchSequential(realIndex, s, x2, index, range);\n OBPriorityQueueShort < O > x1 = it.next();\n //assertEquals(\"Error in query line: \" + i + \" slice: \"\n // + line, x2, x1); \n \n assertEquals(\"Error in query line: \" + i + \" \" + index.debug(s) + \"\\n slice: \"\n + line + \" \" + debug(x2,index ) + \"\\n\" + debug(x1,index), x2, x1);\n\n i++;\n }\n \n }\n if (i == querySize) {\n logger.warn(\"Finishing test at i : \" + i);\n break;\n }\n re = r.readLine();\n }\n r.close();\n logger.info(\"Finished matching validation.\");\n assertFalse(it.hasNext());\n }", "private void searchNeighborhood(int nx, int ny, int nz) {\n\n if ((nx < 1) || (ny < 1) || (nz < 1)) return;\n if ((nx > w - 2) || (ny > h - 2) || (nz > d - 2)) return;\n\n float[] pixels = stack.getVoxels(nx - 1, ny -1, nz -1 , 3, 3, 3, null);\n\n //System.out.println(\"working on: \" + nx + \" \" + ny + \" \" + nz + \" : \" + pixels[13]);\n\n for (int i = 0; i < pixels.length; i++) {\n if (i == pixels.length/2) continue; //do check the center pixel\n\n int rx = (i % 9) % 3 - 1;\n int ry = (i % 9) / 3 - 1;\n int rz = i / 9 - 1;\n\n int sx = nx + rx;\n int sy = ny + ry;\n int sz = nz + rz;\n\n if (((pixels[i] > .5*value) && pixels[i] > threshold) ||\n (pixels[i] > (value - tolerance)) && (pixels[i] > threshold)) {\n\n Long index = (long)(sz*w*h + sy*w + sx);\n if (!neighborsList.contains((Long)index)) {\n neighborsList.add(index);\n //System.out.println(\"Added: \" + sx + \" \" + sy + \" \" + sz + \" : \" + pixels[i]);\n float d = (nx - sx)*(nx - sx) + (ny - sy)*(ny - sy) + (nz - sz)*(nz - sz);\n if (d < 15*15) {\n searchNeighborhood(sx, sy, sz);\n }\n }\n }\n else {\n //System.out.println(\"Rejected: \" + sx + \" \" + sy + \" \" + sz + \" : \" + pixels[i]);\n }\n\n }\n }", "static int[] find2(int a[]){\r\n int sum = a[0];\r\n int pro = a[0];\r\n for(int i=1;i<a.length;i++){\r\n sum += a[i];\r\n pro += a[i]*a[i];\r\n }\r\n int s = (n*(n+1))/2 - sum;\r\n int p = (n*(n+1)*(2*n+1))/6 - pro;\r\n return solveSP(s, p);\r\n }", "public static int solutionN2(int[] A) {\n\n\t\tclass Pair {\n\t\t\tpublic int start;\n\t\t\tpublic int end;\n\n\t\t\tpublic Pair(int start, int end) {\n\t\t\t\tthis.start = start;\n\t\t\t\tthis.end = end;\n\t\t\t}\n\t\t}\n\n\t\tPair[] pairs = new Pair[A.length];\n\n\t\tfor (int i = 0; i < A.length; i++) {\n\t\t\tpairs[i] = new Pair(i - A[i], i + A[i]);\n\t\t}\n\n\t\tArrays.sort(pairs, new Comparator<Pair>() {\n\t\t\t@Override\n\t\t\tpublic int compare(Pair o1, Pair o2) {\n\t\t\t\treturn o1.start - o2.start;\n\t\t\t}\n\t\t});\n\n\t\tint countIntersection = 0;\n\n\t\tfor (int i = 0; i < A.length; i++) {\n\t\t\tPair current = pairs[i];\n\n\t\t\tfor (int j = i + 1; j < A.length; j++) {\n\t\t\t\tPair p = pairs[j];\n\t\t\t\tif (current.end >= p.start) {\n\t\t\t\t\tcountIntersection++;\n\t\t\t\t} else {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\tif (countIntersection > 10000000)\n\t\t\treturn -1;\n\n\t\treturn countIntersection;\n\t}", "public int linSearch(Comparable c){\n\tfor (int i = 0; i < _size;i++){\n\t if (c.compareTo(_data[i]) == 0){\n\t\treturn i;\n\t }\n\t}\n\treturn -1;\n }", "private boolean performLineSearch() {\n\t\t// if true then it can't iterate any more\n\t\tif( lineSearch.iterate() ) {\n\t\t\t// see if the line search failed\n\t\t\tif( !lineSearch.isConverged() ) {\n\t\t\t\tif( firstStep ) {\n\t\t\t\t\t// if it failed on the very first step then it might have been too large\n\t\t\t\t\t// try halving the step size\n\t\t\t\t\tinitialStep /= 2;\n\t\t\t\t\tif( initialStep != 0 ) {\n\t\t\t\t\t\tinvokeLineInitialize(fx, maxStep);\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif( verbose != null && verboseLevel != 0 ) {\n\t\t\t\t\t\t\tverbose.println(\"Initial step reduced to zero\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn terminateSearch(false);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\treturn terminateSearch(false);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfirstStep = false;\n\t\t\t}\n\n\t\t\t// update variables\n\t\t\tdouble step = lineSearch.getStep();\n\n\t\t\t// save the new x\n\t\t\tSystem.arraycopy(function.getCurrentState(),0,x.data,0,N);\n\t\t\t// compute the change in the x\n\t\t\tfor( int i = 0; i < N; i++ )\n\t\t\t\ts.data[i] = step * searchVector.data[i];\n\t\t\tupdated = true;\n\n\t\t\t// convergence tests\n\t\t\t// function value at end of line search\n\t\t\tdouble fstp = lineSearch.getFunction();\n\n\t\t\tif( verbose != null ) {\n\t\t\t\tdouble actualStep = NormOps_DDRM.fastNormF(s);\n\t\t\t\tdouble ftest_val = Math.abs(fstp-fx)/Math.abs(fx);\n\t\t\t\tdouble gtest_val = Math.abs(derivAtZero);\n\n\t\t\t\tverbose.printf(\"%-4d %9.3E %10.3E %9.3E %9.3E %9.3E %6.3f\\n\",\n\t\t\t\t\t\titerations, fstp, fstp - fx,actualStep,ftest_val,gtest_val, maxStep);\n\t\t\t}\n\n\t\t\t// see if the actual different and predicted differences are smaller than the\n\t\t\t// error tolerance\n\t\t\tif( Math.abs(fstp-fx) <= ftol*Math.abs(fx) || Math.abs(derivAtZero) < gtol ) {\n\t\t\t\tif( verbose != null ) {\n\t\t\t\t\tverbose.println(\"converged after line search.\");\n\t\t\t\t}\n\t\t\t\treturn terminateSearch(true);\n\t\t\t}\n\n\t\t\tif( fstp > fx ) {\n\t\t\t\tthrow new RuntimeException(\"Bug! Worse results!\");\n\t\t\t}\n\n\t\t\t// current function value is now the previous\n\t\t\tfx = fstp;\n\n\t\t\t// start the loop again\n\t\t\tmode = 0;\n\t\t}\n\t\treturn false;\n\t}", "protected int search(double value) {\n int n = sequence.size();\n int left = 0, right = n - 1, index = 0;\n while (left != right) {\n index = (right - left) / 2 + left;\n if (value >= sequence.get(index == left ? index + 1 : index)) {\n left = index == left ? index + 1 : index;\n } else {\n right = index;\n }\n }\n while (left > 0 && value == sequence.get(left - 1)) {\n left -= 1;\n }\n return left;\n }", "public static int solveEfficient(int n) {\n if (n == 0 || n == 1)\n return 1;\n\n int n1 = 1;\n int n2 = 1;\n int sum = 0;\n\n for (int i = 2; i <= n; i++) {\n sum = n1 + n2;\n n1 = n2;\n n2 = sum;\n }\n return sum;\n }", "public abstract Solution<T> search(Searchable<T> s);", "private int linearSearch(final Integer element) {\n for (int i = 0; i < size; i++) {\n if (arrayList[i] == element) {\n return i;\n }\n }\n return -1;\n }", "void h(List<List<Integer>> r, List<Integer> t, int n, int s){ \n for(int i = s; i*i <= n; i++){\n if(n % i != 0) continue; \n t.add(i);\n t.add(n / i);\n r.add(new ArrayList<>(t));\n t.remove(t.size() - 1);\n h(r, t, n/i, i);\n t.remove(t.size() - 1);\n }\n }", "@Override\n public List<STPoint> nearestNeighbor(STPoint needle, STPoint boundValues, int n, int dim) {\n\n STPoint min = new STPoint(needle.getX()-boundValues.getX(), needle.getY()-boundValues.getY(), needle.getT()-boundValues.getT());\n STPoint max = new STPoint(needle.getX()+boundValues.getX(), needle.getY()+boundValues.getY(), needle.getT()+boundValues.getT());\n\n STRegion range = new STRegion(min, max);\n List<STPoint> allPoints = range(range);\n\n Quicksort qs = new Quicksort();\n\n qs.sortNearPoints(needle, allPoints, 0, allPoints.size() - 1, dim);\n\n allPoints.remove(0);//remove itself\n while(allPoints.size() > n){\n allPoints.remove(allPoints.size()-1);\n }\n\n if(allPoints.size()< 1){return null;}////\n\n return allPoints;\n }", "static long arrayManipulation(int n, int[][] queries) {\r\n long result = 0, sum = 0;\r\n long[] arr = new long[n];\r\n for(int i = 0; i < queries.length; i++){\r\n int firstIndex = queries[i][0] - 1;\r\n int lastIndex = queries[i][1] - 1;\r\n long numberToAdd = queries[i][2];\r\n arr[firstIndex] += numberToAdd;\r\n if (lastIndex+1 < n)\r\n arr[lastIndex+1] -= numberToAdd;\r\n }\r\n\r\n for(long l : arr){\r\n sum += l;\r\n if(sum > result)\r\n result = sum;\r\n }\r\n\r\n return result;\r\n }", "static long nPolyNTime(int[] n) {\n int temp = n.length;\n long sum = 0;\n if(n == null || n.length == 0) return -1;\n for(int i = 0; i < n.length; ++i) {\n while(temp --> 0) {\n for(int j = 0; j < n.length; ++j) {\n sum += n[i] + n[j];\n }\n }\n }\n return sum;\n }", "@Test\n\tpublic void testLinearSearch() {\n\t\t//1. use the assertEquals method to test your linear search method.\n\t\tString[] words = { \"cat\", \"dog\", \"bat\"};\n\t\tint result = _00_LinearSearch.linearSearch(words, \"cat\");\n\t\tassertEquals(0, result);\n\t\t\n\t\tString[] words2 = { \"1\", \"2\", \"3\", \"4\", \"5\"};\n\t\tint result2 = _00_LinearSearch.linearSearch(words2, \"4\");\n\t\tassertEquals(3, result2);\n\t\t\n\t\tString[] words3 = {\"hi\", \"hello\", \"hey\", \"aloha\", \"greetings\", \"salutations\"};\n\t\tint result3 = _00_LinearSearch.linearSearch(words3, \"salutations\");\n\t\tassertEquals(5, result3);\n\t}", "public static int exhaustiveSearchOptimized(final int[] A) {\n\t\tint[] sums = new int[A.length];\n\t\tsums[0] = A[0];\n\t\tfor (int i = 1; i < A.length; i++) {\n\t\t\tsums[i] = sums[i - 1] + A[i];\n\t\t}\n\t\tdouble min = Double.MAX_VALUE;\n\t\tint start = -1;\n\t\tfor (int s = 0; s < A.length - 1; s++) {\n\t\t\tfor (int e = s + 1; e < A.length; e++) {\n\t\t\t\tint sum = s > 0 ? sums[e] - sums[s - 1] : sums[e];\n\t\t\t\tdouble avg = (double) sum / (e - s + 1);\n\t\t\t\tif (avg < min) {\n\t\t\t\t\tmin = avg;\n\t\t\t\t\tstart = s;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn start;\n\t}", "int[][] Naive(int m, Pointd[] points){\n int[][] tours = new int[m][];\n for(int i=0; i<m; i++){\n if(i<points.length%m) tours[i] = new int[points.length/m+1];\n else tours[i] = new int[points.length/m];\n }\n\n //Select the first point, find the next closest point, find the next closest point to that etc\n boolean[] alreadyInTour = new boolean[points.length];\n double minDistance;\n double distance;\n Pointd pointA;\n Pointd pointB;\n int index = 0;\n int n;\n\n for(int k=0; k<m; k++){\n //Each row of tours, first find a node that isn't in a tour\n n = 0;\n while(alreadyInTour[n]) n++;\n pointA = points[n];\n tours[k][0] = n;\n alreadyInTour[n] = true;\n\n int iterate = 0;\n int j=1;\n while(j<tours[k].length){\n if(!alreadyInTour[iterate]){\n minDistance = Double.MAX_VALUE;\n //Find next closest point to pointA\n for(int i=0; i<points.length; i++){\n pointB = points[i];\n if(!alreadyInTour[i]){\n distance = Math.sqrt( Math.pow(pointA.x - pointB.x, 2) + Math.pow(pointA.y - pointB.y, 2) );\n if(distance < minDistance){\n minDistance = distance;\n index = i;\n }\n }\n }\n //System.out.println(index);\n tours[k][j] = index;\n alreadyInTour[index] = true;\n j++;\n }\n iterate++;\n if(iterate >= points.length) iterate = 0;\n }\n }\n for(int i=0; i<tours.length; i++){\n //System.out.println(Arrays.toString(tours[i]));\n }\n return tours;\n }", "private int optimize() {\n\t\t// items: Items sorted by value-to-weight ratio for linear relaxation\n\t\t// t: the decision vector being tested at each node\n\t\t// ws, vs, is, bs: stacks of weight, value, item id, whether bring item\n\t\t// p: stack pointer; i, b, weight, value: loop caches; best: max search\n\t\t// ss: stack size: Always <=2 children on stack for <=n-1 parents\n\t\tItem[] items = new Item[n];\n\t\tint ss = 2 * n;\n\t\tint[] itemsSorted = new int[n], t = new int[n], ws = new int[ss],\n\t\t\tvs = new int[ss], is = new int[ss], bs = new int[ss];\n\t\tint i, b, weight, value, best = 0, p = 0;\n\n\t\tfor (int j = 0; j < n; j++)\n\t\t\titems[j] = new Item(j);\n\t\tArrays.sort(items);\n\t\tfor (int j = 0; j < n; j++)\n\t\t\titemsSorted[j] = items[j].i();\n\t\titems = null; // For garbage collection.\n\n\t\t// Push item 0 onto the stack with and without bringing it.\n\t\tws[p] = 0; vs[p] = 0; is[p] = 0; bs[p] = 1; p++;\n\t\tws[p] = 0; vs[p] = 0; is[p] = 0; bs[p] = 0; p++;\n\n\t\twhile (p > 0) {\n\t\t\tp--; // Pop the latest item off the stack\n\t\t\ti = is[p]; b = bs[p];\n\t\t\tweight = ws[p] + w[i] * b;\n\t\t\tif (weight > k)\n\t\t\t\tcontinue;\n\t\t\tvalue = vs[p] + v[i] * b;\n\t\t\tif (bound(i, weight, value, itemsSorted) < best)\n\t\t\t\tcontinue;\n\t\t\tbest = Math.max(value, best);\n\t\t\tt[i] = b;\n\t\t\tif (i < n - 1) { // Push children onto stack w/ & w/o bringing item\n\t\t\t\tws[p] = weight; vs[p] = value; is[p] = i + 1; bs[p] = 1; p++;\n\t\t\t\tws[p] = weight; vs[p] = value; is[p] = i + 1; bs[p] = 0; p++;\n\t\t\t}\n\t\t\telse if (value >= best)\n\t\t\t\tSystem.arraycopy(t, 0, x, 0, n);\n\t\t}\n\t\treturn best;\n\t}", "public void binSearch(int current, int first, int last) {\r\n long average2 = 0, timeB = 0, stanDev = 0;\r\n System.out.println(\"\\nBINARY SEARCH\\n\");\r\n for (int i = 0; i < 10; i++) {\r\n long start = System.nanoTime();\r\n while (last >= first) {\r\n int mid = (last + first) / 2;//FINDS THE MID WAY POINT IN ORDER TO KEEP HALF-ING THE SEARCH RESULTS.\r\n if (A[mid] == current) {\r\n long stop = System.nanoTime();\r\n long timelength = (stop - start);\r\n timeB += timelength; // USED FOR GETTING AVERAGE. \r\n bin[k][i] = timelength;//USED FOR STORING THE TIME IT TOOK FOR EACH TEST, IT IS USED LATER ON TO DISPLAY IN THE CHART.\r\n binary[i] = timelength;//USED FOR FINDING STANDARD DEVIATION.\r\n System.out.println(\"The number: \" + current + \" was found in the array index: \" + A[mid]\r\n + \"\\nIt took: \" + timelength + \" nanoseconds.\");\r\n break;\r\n\r\n } else if (A[mid] < current) {\r\n first = mid + 1;\r\n } else {\r\n last = mid - 1;\r\n }\r\n }\r\n }\r\n average2 = (timeB / 10);\r\n linAvAndDev[h][0] = average2;\r\n for (int j = 0; j < 10; j++) {\r\n stanDev += Math.pow((binary[j] - average2), 2.0);\r\n }\r\n stanDev /= 10;\r\n stanDev = (long) Math.sqrt(stanDev);\r\n linAvAndDev[h][1] = stanDev;\r\n System.out.println(\"The Avearge time for the Binary Search was: \" + average2 + \" nanoseconds.\"\r\n + \"\\nThe Standard Deviation time for the Binary Search was: \" + stanDev + \" nanoseconds.\");\r\n h += 1;\r\n k += 1;\r\n }", "public void mainProcess(java.util.ArrayList<double[]> dataPoint, String dist) throws Exception {\n double[][] S = initAP(dataPoint);\r\n// double[][] S = readData(fn);\r\n double[][] A = new double[N][N];\r\n double[][] R = new double[N][N];\r\n //////////////////////////////////////\r\n\tfor(int m=0; m<iter; m++) {\r\n// System.out.println(m);\r\n for(int i=0; i<N; i++) {\r\n for(int k=0; k<N; k++) {\r\n double max = -1e100;\r\n for(int kk=0; kk<k; kk++) {\r\n if(S[i][kk]+A[i][kk]>max)\r\n max = S[i][kk]+A[i][kk];\r\n }\r\n for(int kk=k+1; kk<N; kk++) {\r\n if(S[i][kk]+A[i][kk]>max)\r\n max = S[i][kk]+A[i][kk];\r\n }\r\n R[i][k] = (1-lambda)*(S[i][k] - max) + lambda*R[i][k];\r\n }\r\n }\r\n for(int i=0; i<N; i++) {\r\n for(int k=0; k<N; k++) {\r\n if(i==k) {\r\n double sum = 0.0;\r\n for(int ii=0; ii<i; ii++) {\r\n sum += Math.max(0.0, R[ii][k]);\r\n }\r\n for(int ii=i+1; ii<N; ii++) {\r\n sum += Math.max(0.0, R[ii][k]);\r\n }\r\n A[i][k] = (1-lambda)*sum + lambda*A[i][k];\r\n } else {\r\n double sum = 0.0;\r\n int maxik = Math.max(i, k);\r\n int minik = Math.min(i, k);\r\n for(int ii=0; ii<minik; ii++) {\r\n sum += Math.max(0.0, R[ii][k]);\r\n }\r\n for(int ii=minik+1; ii<maxik; ii++) {\r\n sum += Math.max(0.0, R[ii][k]);\r\n }\r\n for(int ii=maxik+1; ii<N; ii++) {\r\n sum += Math.max(0.0, R[ii][k]);\r\n }\r\n A[i][k] = (1-lambda)*Math.min(0.0, R[k][k]+sum) + lambda*A[i][k];\r\n }\r\n }\r\n }\r\n }\r\n \r\n//\tdouble E[N][N] = {0};\r\n double[][] E = new double[N][N];\r\n\r\n//\tvector<int> center;\r\n java.util.ArrayList<Integer> center = new java.util.ArrayList<>();\r\n for(int i=0; i<N; i++) {\r\n E[i][i] = R[i][i] + A[i][i];\r\n if(E[i][i]>0) {\r\n center.add(i);\r\n }\r\n }\r\n// int idx[N] = {0};\r\n int idx[] = new int[N];\r\n\r\n\tfor(int i=0; i<N; i++) {\r\n int idxForI = 0;\r\n double maxSim = -1e100;\r\n for(int j=0; j<center.size(); j++) {\r\n int c = center.get(j);\r\n if (S[i][c]>maxSim) {\r\n maxSim = S[i][c];\r\n idxForI = c;\r\n }\r\n }\r\n idx[i] = idxForI;\r\n }\r\n// java.util.HashMap<Integer, String> colorMap = new java.util.HashMap<>();\r\n java.util.HashMap<Integer, Integer> idcMap = new java.util.HashMap<>();\r\n java.util.HashSet<Integer> idSet = new java.util.HashSet<>();\r\n for(int i=0; i<N; i++) {\r\n idcMap.put(i, idx[i]);\r\n idSet.add(idx[i]);\r\n// System.out.println(idx[i]+1);\r\n\t}\r\n java.io.FileWriter out = new java.io.FileWriter(dist);\r\n java.util.HashMap<Integer, String> colorMap = getColorMap(idSet);\r\n for(int i=0; i<N; i++){\r\n double d[] = dataPoint.get(i);\r\n if(idSet.contains(i)){\r\n out.write(i+\"\\t\"+d[0]+\"\\t\"+d[1]+\"\\t\"+colorMap.get(i)+\"\\n\");\r\n }\r\n else{\r\n out.write(i+\"\\t\"+d[0]+\"\\t\"+d[1]+\"\\t\"+colorMap.get(idcMap.get(i))+\"\\n\");\r\n }\r\n// System.out.println(i+\"\\t\"+d[0]+\"\\t\"+d[1]+\"\\t\"+colorMap.get(idcMap.get(i)));\r\n }\r\n out.close();\r\n// System.out.println(colorMap);\r\n /////////////////////////////////////////\r\n }", "public static void main(String[] args) throws IOException {\n int max = 100000;\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n N = Integer.parseInt(br.readLine());\n\n int arr[] = new int[max+1];\n\n for (int p=2; p<=99999; p++)\n {\n if (arr[p] == 0)\n { arr[p] = 1;\n for (int i=p*2; i<=max; i += p) {\n arr[i]++;\n }\n }\n }\n\n int mat[][] = new int[6][max+1];\n// for (int i = 2; i < arr.length; i++) {\n// mat[arr[i]][i] = 1;\n// }\n\n for (int i = 1; i < 6; i++) {\n for (int j = 2; j < mat[0].length; j++) {\n if(arr[j] == i) {\n mat[i][j] = mat[i][j - 1]+1;\n } else {\n mat[i][j] = mat[i][j - 1];\n }\n }\n }\n\n\n for (int i = 0; i < N; i++) {\n String str[] = br.readLine().split(\" \");\n int a = Integer.parseInt(str[0]);\n int b = Integer.parseInt(str[1]);\n int k = Integer.parseInt(str[2]);\n int ans = mat[k][b]-mat[k][a-1];\n System.out.println(ans);\n }\n }", "@Override\n public Solution solve(ISearchable domain) {\n if(domain==null)\n return null;\n Solution s2=domain.checkIfIsSmall();\n if(s2!=null){\n domain.isClear();\n return s2;\n }\n Solution sol = new Solution();\n temp.add(domain.getStartState());\n numOfNude++;\n domain.isVisit(domain.getStartState());\n ArrayList<AState> neighbors=new ArrayList<AState>();\n while(!temp.isEmpty()){\n AState curr=temp.poll();\n if(domain.isEqual(domain.getGoalState(),curr)){\n numOfNude++;\n sol =solutionPath(curr,sol);\n\n break;\n }\n neighbors=domain.getAllPossibleState(curr);\n for(int i=0;i<neighbors.size();i++){\n if(domain.isEqual(domain.getGoalState(),neighbors.get(i))){\n neighbors.get(i).pervState=curr;\n neighbors.get(i).setPrice(neighbors.get(i).getPrice()+curr.getPrice());\n numOfNude++;\n sol =solutionPath(neighbors.get(i),sol);\n break;\n }\n neighbors.get(i).pervState=curr;\n neighbors.get(i).setPrice(neighbors.get(i).getPrice()+curr.getPrice());\n temp.add(neighbors.get(i));\n numOfNude++;\n }\n }\n\n domain.isClear();\n return sol;\n }", "private void EvalFitness(){\r\n _FitVal=0;\r\n for(int i=0; i<7;i++)\r\n for(int j=i+1;j<8;j++){\r\n if( _Data[i]==_Data[j]) _FitVal++;\r\n if(j-i==Math.abs(_Data[i]-_Data[j])) _FitVal++;\r\n }\r\n }", "public List<Graph> search() {\n\n long start = System.currentTimeMillis();\n TetradLogger.getInstance().log(\"info\", \"Starting ION Search.\");\n logGraphs(\"\\nInitial Pags: \", this.input);\n TetradLogger.getInstance().log(\"info\", \"Transfering local information.\");\n long steps = System.currentTimeMillis();\n\n /*\n * Step 1 - Create the empty graph\n */\n List<Node> varNodes = new ArrayList<>();\n for (String varName : variables) {\n varNodes.add(new GraphNode(varName));\n }\n Graph graph = new EdgeListGraph(varNodes);\n\n /*\n * Step 2 - Transfer local information from the PAGs (adjacencies\n * and edge orientations)\n */\n // transfers edges from each graph and finds definite noncolliders\n transferLocal(graph);\n // adds edges for variables never jointly measured\n for (NodePair pair : nonIntersection(graph)) {\n graph.addEdge(new Edge(pair.getFirst(), pair.getSecond(), Endpoint.CIRCLE, Endpoint.CIRCLE));\n }\n TetradLogger.getInstance().log(\"info\", \"Steps 1-2: \" + (System.currentTimeMillis() - steps) / 1000. + \"s\");\n System.out.println(\"step2\");\n System.out.println(graph);\n\n /*\n * Step 3\n *\n * Branch and prune step that blocks problematic undirectedPaths, possibly d-connecting undirectedPaths\n */\n steps = System.currentTimeMillis();\n Queue<Graph> searchPags = new LinkedList<>();\n // place graph constructed in step 2 into the queue\n searchPags.offer(graph);\n // get d-separations and d-connections\n List<Set<IonIndependenceFacts>> sepAndAssoc = findSepAndAssoc(graph);\n this.separations = sepAndAssoc.get(0);\n this.associations = sepAndAssoc.get(1);\n Map<Collection<Node>, List<PossibleDConnectingPath>> paths;\n// Queue<Graph> step3PagsSet = new LinkedList<Graph>();\n HashSet<Graph> step3PagsSet = new HashSet<>();\n Set<Graph> reject = new HashSet<>();\n // if no d-separations, nothing left to search\n if (separations.isEmpty()) {\n // makes orientations preventing definite noncolliders from becoming colliders\n // do final orientations\n// doFinalOrientation(graph);\n step3PagsSet.add(graph);\n }\n // sets length to iterate once if search over path lengths not enabled, otherwise set to 2\n int numNodes = graph.getNumNodes();\n int pl = numNodes - 1;\n if (pathLengthSearch) {\n pl = 2;\n }\n // iterates over path length, then adjacencies\n for (int l = pl; l < numNodes; l++) {\n if (pathLengthSearch) {\n TetradLogger.getInstance().log(\"info\", \"Braching over path lengths: \" + l + \" of \" + (numNodes - 1));\n }\n int seps = separations.size();\n int currentSep = 1;\n int numAdjacencies = separations.size();\n for (IonIndependenceFacts fact : separations) {\n if (adjacencySearch) {\n TetradLogger.getInstance().log(\"info\", \"Braching over path nonadjacencies: \" + currentSep + \" of \" + numAdjacencies);\n }\n seps--;\n // uses two queues to keep up with which PAGs are being iterated and which have been\n // accepted to be iterated over in the next iteration of the above for loop\n searchPags.addAll(step3PagsSet);\n recGraphs.add(searchPags.size());\n step3PagsSet.clear();\n while (!searchPags.isEmpty()) {\n System.out.println(\"ION Step 3 size: \" + searchPags.size());\n double currentUsage = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();\n if (currentUsage > maxMemory) maxMemory = currentUsage;\n // deques first PAG from searchPags\n Graph pag = searchPags.poll();\n // Part 3.a - finds possibly d-connecting undirectedPaths between each pair of nodes\n // known to be d-separated\n List<PossibleDConnectingPath> dConnections = new ArrayList<>();\n // checks to see if looping over adjacencies\n if (adjacencySearch) {\n for (Collection<Node> conditions : fact.getZ()) {\n // checks to see if looping over path lengths\n if (pathLengthSearch) {\n dConnections.addAll(PossibleDConnectingPath.findDConnectingPathsOfLength\n (pag, fact.getX(), fact.getY(), conditions, l));\n } else {\n dConnections.addAll(PossibleDConnectingPath.findDConnectingPaths\n (pag, fact.getX(), fact.getY(), conditions));\n }\n }\n } else {\n for (IonIndependenceFacts allfact : separations) {\n for (Collection<Node> conditions : allfact.getZ()) {\n // checks to see if looping over path lengths\n if (pathLengthSearch) {\n dConnections.addAll(PossibleDConnectingPath.findDConnectingPathsOfLength\n (pag, allfact.getX(), allfact.getY(), conditions, l));\n } else {\n dConnections.addAll(PossibleDConnectingPath.findDConnectingPaths\n (pag, allfact.getX(), allfact.getY(), conditions));\n }\n }\n }\n }\n // accept PAG go to next PAG if no possibly d-connecting undirectedPaths\n if (dConnections.isEmpty()) {\n// doFinalOrientation(pag);\n// Graph p = screenForKnowledge(pag);\n// if (p != null) step3PagsSet.add(p);\n step3PagsSet.add(pag);\n continue;\n }\n // maps conditioning sets to list of possibly d-connecting undirectedPaths\n paths = new HashMap<>();\n for (PossibleDConnectingPath path : dConnections) {\n List<PossibleDConnectingPath> p = paths.get(path.getConditions());\n if (p == null) {\n p = new LinkedList<>();\n }\n p.add(path);\n paths.put(path.getConditions(), p);\n }\n // Part 3.b - finds minimal graphical changes to block possibly d-connecting undirectedPaths\n List<Set<GraphChange>> possibleChanges = new ArrayList<>();\n for (Set<GraphChange> changes : findChanges(paths)) {\n Set<GraphChange> newChanges = new HashSet<>();\n for (GraphChange gc : changes) {\n boolean okay = true;\n for (Triple collider : gc.getColliders()) {\n\n if (pag.isUnderlineTriple(collider.getX(), collider.getY(), collider.getZ())) {\n okay = false;\n break;\n }\n\n }\n if (!okay) {\n continue;\n }\n for (Triple collider : gc.getNoncolliders()) {\n if (pag.isDefCollider(collider.getX(), collider.getY(), collider.getZ())) {\n okay = false;\n break;\n }\n }\n if (okay) {\n newChanges.add(gc);\n }\n }\n if (!newChanges.isEmpty()) {\n possibleChanges.add(newChanges);\n } else {\n possibleChanges.clear();\n break;\n }\n }\n float starthitset = System.currentTimeMillis();\n Collection<GraphChange> hittingSets = IonHittingSet.findHittingSet(possibleChanges);\n recHitTimes.add((System.currentTimeMillis() - starthitset) / 1000.);\n // Part 3.c - checks the newly constructed graphs from 3.b and rejects those that\n // cycles or produce independencies known not to occur from the input PAGs or\n // include undirectedPaths from definite nonancestors\n for (GraphChange gc : hittingSets) {\n boolean badhittingset = false;\n for (Edge edge : gc.getRemoves()) {\n Node node1 = edge.getNode1();\n Node node2 = edge.getNode2();\n Set<Triple> triples = new HashSet<>();\n triples.addAll(gc.getColliders());\n triples.addAll(gc.getNoncolliders());\n if (triples.size() != (gc.getColliders().size() + gc.getNoncolliders().size())) {\n badhittingset = true;\n break;\n }\n for (Triple triple : triples) {\n if (node1.equals(triple.getY())) {\n if (node2.equals(triple.getX()) ||\n node2.equals(triple.getZ())) {\n badhittingset = true;\n break;\n }\n }\n if (node2.equals(triple.getY())) {\n if (node1.equals(triple.getX()) ||\n node1.equals(triple.getZ())) {\n badhittingset = true;\n break;\n }\n }\n }\n if (badhittingset) {\n break;\n }\n for (NodePair pair : gc.getOrients()) {\n if ((node1.equals(pair.getFirst()) && node2.equals(pair.getSecond())) ||\n (node2.equals(pair.getFirst()) && node1.equals(pair.getSecond()))) {\n badhittingset = true;\n break;\n }\n }\n if (badhittingset) {\n break;\n }\n }\n if (!badhittingset) {\n for (NodePair pair : gc.getOrients()) {\n for (Triple triple : gc.getNoncolliders()) {\n if (pair.getSecond().equals(triple.getY())) {\n if (pair.getFirst().equals(triple.getX()) &&\n pag.getEndpoint(triple.getZ(), triple.getY()).equals(Endpoint.ARROW)) {\n badhittingset = true;\n break;\n\n }\n if (pair.getFirst().equals(triple.getZ()) &&\n pag.getEndpoint(triple.getX(), triple.getY()).equals(Endpoint.ARROW)) {\n badhittingset = true;\n break;\n }\n }\n if (badhittingset) {\n break;\n }\n }\n if (badhittingset) {\n break;\n }\n }\n }\n if (badhittingset) {\n continue;\n }\n Graph changed = gc.applyTo(pag);\n // if graph change has already been rejected move on to next graph\n if (reject.contains(changed)) {\n continue;\n }\n // if graph change has already been accepted move on to next graph\n if (step3PagsSet.contains(changed)) {\n continue;\n }\n // reject if null, predicts false independencies or has cycle\n if (predictsFalseIndependence(associations, changed)\n || changed.existsDirectedCycle()) {\n reject.add(changed);\n }\n // makes orientations preventing definite noncolliders from becoming colliders\n // do final orientations\n// doFinalOrientation(changed);\n // now add graph to queue\n\n// Graph p = screenForKnowledge(changed);\n// if (p != null) step3PagsSet.add(p);\n step3PagsSet.add(changed);\n }\n }\n // exits loop if not looping over adjacencies\n if (!adjacencySearch) {\n break;\n }\n }\n }\n TetradLogger.getInstance().log(\"info\", \"Step 3: \" + (System.currentTimeMillis() - steps) / 1000. + \"s\");\n Queue<Graph> step3Pags = new LinkedList<>(step3PagsSet);\n\n /*\n * Step 4\n *\n * Finds redundant undirectedPaths and uses this information to expand the list\n * of possible graphs\n */\n steps = System.currentTimeMillis();\n Map<Edge, Boolean> necEdges;\n Set<Graph> outputPags = new HashSet<>();\n\n while (!step3Pags.isEmpty()) {\n Graph pag = step3Pags.poll();\n necEdges = new HashMap<>();\n // Step 4.a - if x and y are known to be unconditionally associated and there is\n // exactly one trek between them, mark each edge on that trek as necessary and\n // make the tiples on the trek definite noncolliders\n // initially mark each edge as not necessary\n for (Edge edge : pag.getEdges()) {\n necEdges.put(edge, false);\n }\n // look for unconditional associations\n for (IonIndependenceFacts fact : associations) {\n for (List<Node> nodes : fact.getZ()) {\n if (nodes.isEmpty()) {\n List<List<Node>> treks = treks(pag, fact.x, fact.y);\n if (treks.size() == 1) {\n List<Node> trek = treks.get(0);\n List<Triple> triples = new ArrayList<>();\n for (int i = 1; i < trek.size(); i++) {\n // marks each edge in trek as necessary\n necEdges.put(pag.getEdge(trek.get(i - 1), trek.get(i)), true);\n if (i == 1) {\n continue;\n }\n // makes each triple a noncollider\n pag.addUnderlineTriple(trek.get(i - 2), trek.get(i - 1), trek.get(i));\n }\n }\n // stop looping once the empty set is found\n break;\n }\n }\n }\n // Part 4.b - branches by generating graphs for every combination of removing\n // redundant undirectedPaths\n boolean elimTreks;\n // checks to see if removing redundant undirectedPaths eliminates every trek between\n // two variables known to be nconditionally assoicated\n List<Graph> possRemovePags = possRemove(pag, necEdges);\n double currentUsage = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();\n if (currentUsage > maxMemory) maxMemory = currentUsage;\n for (Graph newPag : possRemovePags) {\n elimTreks = false;\n // looks for unconditional associations\n for (IonIndependenceFacts fact : associations) {\n for (List<Node> nodes : fact.getZ()) {\n if (nodes.isEmpty()) {\n if (treks(newPag, fact.x, fact.y).isEmpty()) {\n elimTreks = true;\n }\n // stop looping once the empty set is found\n break;\n }\n }\n }\n // add new PAG to output unless a necessary trek has been eliminated\n if (!elimTreks) {\n outputPags.add(newPag);\n }\n }\n }\n outputPags = removeMoreSpecific(outputPags);\n// outputPags = applyKnowledge(outputPags);\n\n TetradLogger.getInstance().log(\"info\", \"Step 4: \" + (System.currentTimeMillis() - steps) / 1000. + \"s\");\n\n /*\n * Step 5\n *\n * Generate the Markov equivalence classes for graphs and accept only\n * those that do not predict false d-separations\n */\n steps = System.currentTimeMillis();\n Set<Graph> outputSet = new HashSet<>();\n for (Graph pag : outputPags) {\n Set<Triple> unshieldedPossibleColliders = new HashSet<>();\n for (Triple triple : getPossibleTriples(pag)) {\n if (!pag.isAdjacentTo(triple.getX(), triple.getZ())) {\n unshieldedPossibleColliders.add(triple);\n }\n }\n\n PowerSet<Triple> pset = new PowerSet<>(unshieldedPossibleColliders);\n for (Set<Triple> set : pset) {\n Graph newGraph = new EdgeListGraph(pag);\n for (Triple triple : set) {\n newGraph.setEndpoint(triple.getX(), triple.getY(), Endpoint.ARROW);\n newGraph.setEndpoint(triple.getZ(), triple.getY(), Endpoint.ARROW);\n }\n doFinalOrientation(newGraph);\n }\n for (Graph outputPag : finalResult) {\n if (!predictsFalseIndependence(associations, outputPag)) {\n Set<Triple> underlineTriples = new HashSet<>(outputPag.getUnderLines());\n for (Triple triple : underlineTriples) {\n outputPag.removeUnderlineTriple(triple.getX(), triple.getY(), triple.getZ());\n }\n outputSet.add(outputPag);\n }\n }\n }\n\n// outputSet = applyKnowledge(outputSet);\n outputSet = checkPaths(outputSet);\n\n output.addAll(outputSet);\n TetradLogger.getInstance().log(\"info\", \"Step 5: \" + (System.currentTimeMillis() - steps) / 1000. + \"s\");\n runtime = ((System.currentTimeMillis() - start) / 1000.);\n logGraphs(\"\\nReturning output (\" + output.size() + \" Graphs):\", output);\n double currentUsage = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();\n if (currentUsage > maxMemory) maxMemory = currentUsage;\n return output;\n }", "public static void checkSpeed(int testSize) {\r\n\t\tSystem.out.println(\"Beginning checkSpeed indexOf test of size \" + testSize);\r\n\t\t\r\n\t\t// keep track of starting time before constructing\r\n\t\tlong start = System.currentTimeMillis();\r\n\t\t\r\n\t\t// fill up the list with even numbers\r\n\t\tint dot = testSize / 10;\r\n\t\tSortedIntList list = new SortedIntList(false, testSize);\r\n\t\tSystem.out.print(\" Building list of the first \" + testSize + \" multiples of 2: \");\r\n\t\tboolean addTooSlow = false;\r\n\t\tfor (int i = 0; i < testSize; i++) {\r\n\t\t\tlist.add(2 * i);\r\n\t\t\tif (i % dot == 0) {\r\n\t\t\t\tSystem.out.print(\".\");\r\n\t\t\t}\r\n\t\t\tif (!addTooSlow && System.currentTimeMillis() >= start + testSize / 20) {\r\n\t\t\t\tSystem.out.print(\" (add is too slow) \");\r\n\t\t\t\taddTooSlow = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\t\tdouble elapsed = (System.currentTimeMillis() - start)/1000.0;\r\n\t\t// System.out.println(\" construction took \" + elapsed + \" seconds\");\r\n\t\t\r\n\t\t// keep track of starting time before indexOf tests\r\n\t\tSystem.out.print(\" Checking indexOf each element: \");\r\n\t\tstart = System.currentTimeMillis();\r\n\t\tdot = testSize / 10;\r\n\t\tfor (int i = 0; i < testSize; i++) {\r\n\t\t\tfor (int j = 0; j < 100; j++) {\r\n\t\t\t\tint actualIndex = list.indexOf(2 * i);\r\n\t\t\t\tif (actualIndex != i) {\r\n\t\t\t\t\tSystem.out.println();\r\n\t\t\t\t\tthrow new RuntimeException(\r\n\t\t\t\t\t\"\\n\\nindexOf \" + 2 * i + \" should have returned: \" +\r\n\t\t\t\t\ti + \",\\n but your method actually returned: \" +\r\n\t\t\t\t\tactualIndex + \"\\n\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (System.currentTimeMillis() >= start + testSize / 5) {\r\n\t\t\t\tSystem.out.println();\r\n\t\t\t\tthrow new RuntimeException(\r\n\t\t\t\t\"\\n\\nindexOf appears to be running too slowly.\\n\");\r\n\t\t\t}\r\n\t\t\tif (i % dot == 0) {\r\n\t\t\t\tSystem.out.print(\".\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tdouble elapsed2 = (System.currentTimeMillis() - start)/1000.0;\r\n\t\tif (addTooSlow) {\r\n\t\t\tSystem.out.println();\r\n\t\t\tthrow new RuntimeException(\r\n\t\t\t\"\\n\\nYour add method appears to have run too slowly. (runtime: \" + elapsed + \" seconds)\\n\");\r\n\t\t}\r\n\t\tSystem.out.println(\"\\n Passed! (runtime: \" + elapsed2 + \" seconds)\\n\");\r\n\t}", "private static int query(int[] segtree, int l, int r, int ns, int ne, int index) {\n if (ns >= l && ne <= r) {\n // complete overlap\n return segtree[index];\n } else if (ns > r || ne < l) {\n // no overlap\n return Integer.MAX_VALUE;\n } else {\n int mid = (ns + ne) / 2;\n int leftAns = query(segtree, l, r, ns, mid, 2 * index);\n int rightAns = query(segtree, l, r, mid + 1, ne, 2 * index + 1);\n return Math.min(leftAns, rightAns);\n }\n }", "static long countTriplets(List<Long> arr, long r) {\n List<List<Long>> candidates;\n List<List<Long>> triplets = new ArrayList<>();\n for (int i = 0; i < arr.size(); i++) {\n long root = arr.get(i);\n candidates = new ArrayList<>();\n\n for (int j = i + 1; j < arr.size(); j++) {\n long value = arr.get(j);\n\n candidates.forEach(candidate -> {\n long current = candidate.get(1);\n if (value / r == current) {\n List<Long> triplet = new ArrayList<>(candidate);\n triplet.add(value);\n triplets.add(triplet);\n }\n });\n\n if (value / r == root) {\n List<Long> candidate = new ArrayList<>();\n candidate.add(root);\n candidate.add(value);\n candidates.add(candidate);\n }\n }\n\n // List<Long> sig = new ArrayList<>();\n // for (int j = 0; j < arr.size(); j++) {\n // sig.set(j, j < i ? arr.get(i) : arr.get(i) / r);\n // }\n }\n\n return triplets.size();\n }", "private static int distance(ArrayList<Integer>[] adj, ArrayList<Integer>[] cost, int s, int t) {\n\n Set<Integer> visited = new HashSet<>(); //option 1\n Map<Integer, Integer> distance = new HashMap<>();\n// Queue<Integer> q = new PriorityQueue<>(11, (o1, o2) -> { //option 0\n// Integer d1 = distance.get(o1); //option 0\n// Integer d2 = distance.get(o2); //option 0\n Queue<Map.Entry<Integer, Integer>> q = new PriorityQueue<>(11, (o1, o2) -> { //option 1\n Integer d1 = o1.getValue(); //option 1\n Integer d2 = o2.getValue(); //option 1\n\n if (Objects.equals(d1, d2)) return 0;\n if (d1 == null) return 1;\n if (d2 == null) return -1;\n\n return d1 - d2;\n });\n\n distance.put(s, 0);\n// q.addAll(IntStream.range(0, adj.length).boxed().collect(Collectors.toList())); //option 0\n q.add(new AbstractMap.SimpleImmutableEntry<>(s, 0)); //option 1\n\n while (!q.isEmpty()) {\n// int u = q.remove(); //option 0\n int u = q.remove().getKey(); //option 1\n\n if (u == t) {\n Integer dist = distance.get(u);\n if (dist == null) return -1;\n return dist;\n }\n\n if (visited.contains(u)) continue; //option 1\n visited.add(u); //option 1\n\n List<Integer> adjList = adj[u];\n List<Integer> costList = cost[u];\n for (int i = 0; i < adjList.size(); i++) {\n int v = adjList.get(i);\n int w = costList.get(i);\n Integer dist = distance.get(v);\n Integer newDist = distance.get(u);\n if (newDist != null) newDist += w;\n\n if (newDist != null && (dist == null || dist > newDist)) {\n //relax\n distance.put(v, newDist);\n// q.remove(v); //option 0\n// q.add(v); //option 0\n q.add(new AbstractMap.SimpleImmutableEntry<>(v, distance.get(v))); //option 1\n }\n }\n }\n\n return -1;\n }", "public int solution2(int N) {\n\n int l = 0; // 2*l - r\n int r = 1; // 2*r - l\n\n return search2(l, r, N);\n }", "static int findIslands(ArrayList<ArrayList<Integer>> a, int N, int M)\n {\n \n // Your code here\n int island_count = 0;\n for(int i=0;i<N;i++){\n for(int j=0;j<M;j++){\n if(a.get(i).get(j) == 1){\n island_count++;\n explore_island(a, i, j);\n }\n }\n }\n \n return island_count;\n \n }", "private static long redelpol(int n, int k, int[][] untried, int startIndex, int endIndex, boolean[][] field)\n {\n if(k == n)\n return 1;\n\n else\n {\n long l = 0;\n\n for(int i = startIndex; i <= endIndex; ++i)\n {\n int x = untried[i][0], y = untried[i][1];\n\n field[x+n-1][y+1] = false;\n\n int cursor = 0;\n boolean a = false, b = false, c = false, d = false;\n\n if(x+1 < n && (field[x+1+n-1][y+1]))\n {\n field[x+1+n-1][y+1] = false;\n cursor++;\n untried[cursor+endIndex][0] = x+1;\n untried[cursor+endIndex][1] = y;\n a = true;\n }\n\n if(y + 1 < n && (field[x+n-1][y+1+1]))\n {\n field[x+n-1][y+1+1] = false;\n cursor++;\n untried[cursor+endIndex][0] = x;\n untried[cursor+endIndex][1] = y+1;\n b = true;\n }\n\n if(x-1 > -n && (field[x-1+n-1][y+1]))\n {\n field[x-1+n-1][y+1] = false;\n cursor++;\n untried[cursor+endIndex][0] = x-1;\n untried[cursor+endIndex][1] = y;\n c = true;\n }\n\n if(y-1 >= -1 && (field[x+n-1][y-1+1]))\n {\n field[x+n-1][y-1+1] = false;\n cursor++;\n untried[cursor+endIndex][0] = x;\n untried[cursor+endIndex][1] = y-1;\n d = true;\n }\n\n l += redelpol(n, k+1, untried, i+1, endIndex+cursor, field);\n\n if(a)\n field[x+1+n-1][y+1] = true;\n if(b)\n field[x+n-1][y+1+1] = true;\n if(c)\n field[x-1+n-1][y+1] = true;\n if(d)\n field[x+n-1][y-1+1] = true;\n }\n\n return l;\n }\n }", "int query(int l, int r) {\n l += n;\n r += n;\n int resl = identity;\n int resr = identity;\n while (l < r) {\n if ((l & 1) > 0) resl = combine(resl, st[l++]);\n if ((r & 1) > 0) resr = combine(st[--r], resr);\n l /= 2;\n r /= 2;\n }\n return combine(resl, resr);\n }", "public boolean containsNearbyDuplicate2(int[] nums, int k) {\n\n int max = Integer.MIN_VALUE;\n for (int i = 0; i < nums.length; i++) {\n max=Math.max(max,nums[i]);\n }\n Integer[] map = new Integer[max+1];\n for (int i = 0; i < nums.length; i++) {\n Integer c = map[nums[i]];\n if(c!=null && i-c<=k){\n return true;\n }else {\n map[nums[i]]=i;\n }\n }\n return false;\n }", "public static long solve(long[] data, long k) {\n int n = data.length;\n\n Buffer<Interval> buffer = new Buffer<>(Interval::new, x -> {}, n * 2);\n\n Randomized.shuffle(data);\n Arrays.sort(data);\n\n List<Interval> lastLevel = new ArrayList<>(n);\n List<Interval> curLevel = new ArrayList<>(n);\n lastLevel.add(newInterval(buffer, 0, n - 1));\n int level = Log2.floorLog(data[n - 1]);\n long mask = 0;\n for (; level >= 0; level--) {\n curLevel.clear();\n for (Interval interval : lastLevel) {\n int l = interval.l;\n int r = interval.r;\n int m = r;\n while (m >= l && Bits.get(data[m], level) == 1) {\n m--;\n }\n interval.m = m;\n }\n long total = 0;\n for (Interval interval : lastLevel) {\n total += (long) (interval.m - interval.l + 1) * (interval.relative.m - interval.relative.l + 1);\n total += (long) (interval.r - interval.m) * (interval.relative.r - interval.relative.m);\n }\n if (total < k) {\n k -= total;\n mask = Bits.set(mask, level, true);\n for (Interval interval : lastLevel) {\n if (interval.relative == interval) {\n if (interval.l <= interval.m && interval.m < interval.r) {\n Interval a = newInterval(buffer, interval.l, interval.m);\n Interval b = newInterval(buffer, interval.m + 1, interval.r);\n a.relative = b;\n b.relative = a;\n curLevel.add(a);\n curLevel.add(b);\n }\n } else if (interval.r >= interval.relative.r) {\n if (interval.l <= interval.m && interval.relative.r > interval.relative.m) {\n Interval a = newInterval(buffer, interval.l, interval.m);\n Interval b = newInterval(buffer, interval.relative.m + 1, interval.relative.r);\n a.relative = b;\n b.relative = a;\n curLevel.add(a);\n curLevel.add(b);\n }\n if (interval.m < interval.r && interval.relative.m >= interval.relative.l) {\n Interval a = newInterval(buffer, interval.m + 1, interval.r);\n Interval b = newInterval(buffer, interval.relative.l, interval.relative.m);\n a.relative = b;\n b.relative = a;\n curLevel.add(a);\n curLevel.add(b);\n }\n }\n }\n } else {\n for (Interval interval : lastLevel) {\n if (interval.relative == interval) {\n if (interval.l <= interval.m) {\n Interval a = newInterval(buffer, interval.l, interval.m);\n a.relative = a;\n curLevel.add(a);\n }\n if (interval.m < interval.r) {\n Interval a = newInterval(buffer, interval.m + 1, interval.r);\n a.relative = a;\n curLevel.add(a);\n }\n } else if (interval.r >= interval.relative.r) {\n if (interval.l <= interval.m && interval.relative.l <= interval.relative.m) {\n Interval a = newInterval(buffer, interval.l, interval.m);\n Interval b = newInterval(buffer, interval.relative.l, interval.relative.m);\n a.relative = b;\n b.relative = a;\n curLevel.add(a);\n curLevel.add(b);\n }\n if (interval.m < interval.r && interval.relative.m < interval.relative.r) {\n Interval a = newInterval(buffer, interval.m + 1, interval.r);\n Interval b = newInterval(buffer, interval.relative.m + 1, interval.relative.r);\n a.relative = b;\n b.relative = a;\n curLevel.add(a);\n curLevel.add(b);\n }\n }\n }\n }\n\n for (Interval interval : lastLevel) {\n buffer.release(interval);\n }\n\n List<Interval> tmp = curLevel;\n curLevel = lastLevel;\n lastLevel = tmp;\n }\n\n return mask;\n }", "public interface Searcher<T> {\r\n\t\r\n\t//the search method\r\n\tpublic Solution<T> search(Searchable<T> s);\r\n\t\r\n\t//get how many nodes were evaluated by the algorithm\r\n\tpublic int getNumberOfNodesEvaluated();\r\n}", "public static void solve(int n, List<Integer> a) {\n Collections.sort(a);\n Collections.reverse(a);\n double sum = a.stream().mapToDouble(num -> Double.valueOf(num)).sum();\n double currentN = Double.valueOf(n);\n double currentSum = sum;\n for(Integer next : a)\n {\n double nextDouble = Double.valueOf(next);\n if(nextDouble<=currentSum/currentN)\n {\n break;\n }\n currentSum -= nextDouble;\n currentN--;\n }\n System.out.println(currentSum/currentN);\n\n\n }", "private int searchR(Searching[] array, int start, int half, int end, int value) {\n if (value > array[end].getValue() || value < array[start].getValue()) {\n return -1;\n }\n int a = end - start;\n int b = array[end].getValue() - array[start].getValue();\n int c = value - array[start].getValue();\n int d = (c * a) / b;\n int slide = d + start;\n if (slide > end || slide < start) {\n return -1;\n }\n if (array[slide].getValue() == value) {\n return slide;\n }\n if (value < array[slide].getValue()) {\n end = slide;\n return searchR(array, start, half, end, value);\n } else {\n start = slide;\n return searchR(array, start, half, end, value);\n }\n }", "static int countCollinearFast(int[] a1, int[] a2, int[] a3)\n {\n //TODO: implement this method\n \tsort(a3);\n \tint count = 0;\n \tint search;\n \t\n \tfor (int i=0; i<a1.length; i++)\n \t\tfor (int j=0; j<a2.length; j++)\n \t\t{\n \t\t\tsearch = 2*a2[j] - a1[i];\n \t\t\tif (binarySearch(a3, search))\n \t\t\t\tcount++;\n \t\t}\n \t\n \treturn count;\n }", "public static int equilibriumPoint(long arr[], int n) {\n long sum=0;\n for(int i=0;i<n;++i){\n sum+=arr[i];\n }\n long right=0;\n for(int i=n-1;i>=0;i--){\n if(right==sum-(arr[i]+right))\n return i+1;\n right+=arr[i];\n }\n return -1;\n }", "public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint arr[] = new int[n];\n\t\tfor(int i=0;i<n;i++) {\n\t\t\tarr[i] = sc.nextInt();\n\t\t}\n\t\tint sum = sc.nextInt();\n\t\tHashMap<Integer,Integer> map = new HashMap<>();\n \t\tArrays.sort(arr);\n\t\tfor(int i=0;i<n;i++) {\n\t\t\tint temp = arr[i];\n\t\t\tint reqSum = sum-temp;\n\t\t\tarr[i]=0;\n\t\t\tint l=0;\n\t\t\tint r = n-1;\n\t\t\twhile(l<r) {\n\t\t\t\t//System.out.println(\"l \" + l + \" r \" + r + \" i = \"+ i);\n\t\t\t\tif(arr[l] + arr[r]==reqSum && arr[l]!=0 && arr[r]!=0 ) {\n\t\t\t\t\tint arr2[] = new int[3];\n\t\t\t\t\tarr2[0] = temp;\n\t\t\t\t\tarr2[1] = arr[l];\n\t\t\t\t\tarr2[2] = arr[r];\n\t\t\t\t\tif(map.containsKey(arr2[0]) || map.containsKey(arr2[1]) || map.containsKey(arr2[2])) {\n\t\t\t\t\t\t\n\t\t\t\t\t}else {\n\t\t\t\t\t\tArrays.sort(arr2);\n\t\t\t\t\t\tSystem.out.println(arr2[0] + \" \" + arr2[1] + \" \" + arr2[2]);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tl++;\n\t\t\t\t}else if(arr[l] + arr[r] < reqSum) {\n\t\t\t\t\tl++;\n\t\t\t\t\t\n\t\t\t\t}else {\n\t\t\t\t\tr--;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\tarr[i] = temp;\t\n\t\t\tmap.put(arr[i], 1);\n\t\t}\n\t}", "public void testContain_Stress() throws Exception {\n // the test start time.\n long startTime = System.currentTimeMillis();\n // run the test for RUN_TIMES times.\n for (int i = 0; i < StressTestsHelper.RUN_TIMES; i++) {\n for (int j = 0; j < 50; j++) {\n for (int k = 0; k < 50; k++) {\n this.lifelineSegment.contains(j, k);\n }\n }\n }\n // output the time used.\n long endTime = System.currentTimeMillis();\n System.out.println(\"Run \" + StressTestsHelper.RUN_TIMES\n + \" LifelineSegment#contains(int x, int y) method takes \" + (endTime - startTime) + \"ms\");\n\n }", "public ArrayList<Integer> linearSearch(ArrayList<Integer> arrl, int num) {\n\n\t\tthis.num = num; \n\t\tthis.arrayList = arrl;\n\t\tif(arrl.contains(num) == false) {\n\t\t\tSystem.out.println(\"Expense of \" + num + \" not found, try again...\\n\");\n\t\t\treturn arrl;\n\t\t}\n\t\telse\n\t\t\tfor(int i : arrl) {\n\t\t\t\tif(i == num) {\n\t\t\t\t\tSystem.out.println(\"Expense of \" + num + \" found.\\n\");\n\t\t\t\t}\n\t\t\t}\n\t\treturn arrl;\n\t}", "List<CoordinateDistance> getNearestCoordinates(Point coordinate, int n);", "public int Search(int key)\n {\n for(int i=0; i<n; i++)\n {\n if(a[i]==key)\n return 1;\n }\n return 0;\n }", "public HashMap<String, Double> search(String query) {\n // ===================================================\n // 1. Fetch all inverted lists corresponding to terms\n // in the query.\n // ===================================================\n String[] terms = query.split(\" \");\n HashMap<String, Integer> qf = new HashMap<String, Integer>();\n // Calculate term frequencies in the query\n for (String term : terms) {\n if (qf.containsKey(term))\n qf.put(term, qf.get(term) + 1);\n else\n qf.put(term, 1);\n }\n HashMap<String, Double> docScore = new HashMap<String, Double>();\n for (Entry<String, Integer> termEntry : qf.entrySet()) {\n String term = termEntry.getKey();\n int qfi = termEntry.getValue();\n\n // ===================================================\n // 2. Compute BM25 scores for documents in the lists.\n // Make a score list for documents in the inverted\n // lists. Assume that no relevance information is \n // available. For parameters, use k1=1.2, b=0.75, \n // k2=100.\n // ===================================================\n double k1 = 1.2;\n double b = 0.75;\n double k2 = 100;\n int ni = invIndex.get(term).size();\n\n\n for (Entry<String, IndexEntry> invListEntry : invIndex.get(term).entrySet()) {\n String docID = invListEntry.getKey();\n double bm25Score;\n if (docScore.containsKey(docID))\n bm25Score = docScore.get(docID);\n else\n bm25Score = 0;\n\n // length of the document\n int dl = docStat.get(docID);\n // frequency of the term in the document\n int fi = invListEntry.getValue().getTf();\n double K = k1 * ((1 - b) + b * ((double) dl / avdl));\n\n // ===================================================\n // 3. Accumulate scores for each term in a query\n // on the score list.\n // ===================================================\n bm25Score += Math.log((N - ni + 0.5) / (ni + 0.5))\n * (((k1 + 1) * fi * (k2 + 1) * qfi) / ((K + fi) * (k2 + qfi)));\n docScore.put(docID, bm25Score);\n }\n }\n\n return docScore;\n }", "private void powell(double[] p, double[][] xi, double ftol) {\r\n int ITMAX = 2000000000;\r\n Powell.search( p, xi, ftol, this, ITMAX, null );\r\n }", "@Test\n public void linearSearch_passListOfIntegers_returnIndexOfFirstFound() {\n int output = Java8Streams.linearSearch(Arrays.asList(4, 2, 5, 9), 9);\n\n assertThat(output).isEqualTo(3);\n }", "static double binarySearchForBuckets (double[] splits, double feature, boolean keepInvalid) { throw new RuntimeException(); }", "public static void main(String args[] ) throws Exception {\n Scanner s = new Scanner(System.in);\n int N=s.nextInt();\n long S=s.nextLong();\n long E=s.nextLong();\n long[] x=new long[N];\n long[] p=new long[N];\n int[] c=new int[N];\n for(int i=0;i<N;i++){\n x[i]=s.nextLong();\n p[i]=s.nextLong();\n c[i]=0;\n }\n long m=S;\n long dist=0;\n while(m<=E){\n long min=E;\n int index=0;\n for(int i=0;i<N;i++){\n if((x[i]-p[i])<min && c[i]==0){\n min=x[i]-p[i];\n index=i;\n }\n }\n if(m<(x[index]-p[index])){\n dist=dist+x[index]-p[index]-m;\n }\n\t if(m<(x[index]+p[index])){\n\t m=x[index]+p[index];\n\t }\n c[index]=1;\n }\n System.out.println(dist);\n }", "public boolean containsNearbyAlmostDuplicate(int[] nums, int k, int t) {\n if (t < 0) return false;\n TreeSet<Long> set = new TreeSet<>();\n for (int i = 0; i < nums.length; ++i) {\n long num = (long)nums[i];\n Long floor = set.floor(num), ceiling = set.ceiling(num);\n if (floor != null && num - floor <= t || ceiling != null && ceiling - num <= t) return true;\n set.add(num);\n if (i >= k) set.remove((long)nums[i - k]);\n }\n return false;\n}", "private static LinkedList<Integer> localSearch2Opt(File fileNameWithPath, int kNeighborHood ) throws Exception{\n\t\t\n\t\tString traceString = \"\";\n\t\tdouble bestCost = Double.POSITIVE_INFINITY;\n\t\tLinkedList<Integer> bestTspList = null;\n\t\tdouble bestCycleTime = Double.POSITIVE_INFINITY;\n\n\t\tif (Project.runId == -1 )\n\t\t\tProject.runId = 1;\n\n\t\t/* \n\t\t * read the file and build the cost table\n\t\t */\n parseEdges(fileNameWithPath);\n\n /*\n\t\t * time starts once you read the data\n */\n\t\tdouble baseTime = System.nanoTime();\n\n\t\t/*\n\t\t * invoking furthest insertion algorithm to get the tsp\n\t\t */\n\t\tlong startNodeSeed = (long)(1000.0*generator.nextDouble());\n\t\tLinkedList<Integer> currentTspList = FurthestInsertion.generateTSP(Project.sourceGTree,startNodeSeed);\n\t\t\n\t\tdouble currentTspCost = tspCost(currentTspList);\n\n\t\tbestTspList = currentTspList;\n\t\tbestCost = currentTspCost;\n\t\tbestCycleTime = System.nanoTime() - baseTime;\n\n\t\t/* print the trace file */\n\t\ttraceString = String.format(\"%.2f, %d\",Math.round(((System.nanoTime()-baseTime)/nanosecs)*100.0)/100.0,Math.round(bestCost));\n\t\tprintTrace(runId,traceString);\n\n\t\t/*\n\t\t * remove the last node as it matches the first\n\t\t */\n\t\tcurrentTspList.removeLast();\n\n\t\twhile ( true )\n\t\t{\n\t\t\t/*\n\t\t\t * reached cutoff time\n\t\t\t */\n\t\t\tif ( System.nanoTime()-baseTime >= Project.cutoffTimeSeconds*nanosecs ) {\n\t\t\t\ttimedOut=true;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tdouble cycleStartTime = System.nanoTime();\n\n\t\t\tLinkedList<Integer> newTspList = currentTspList;\n\n\t\t\t/* do a 2 opt search in current k=5 neighborhood to get a newtsp */\n\t\t\t/* 1. Pick the first random element in the current tsp */\n\t\t\tint element2 = (int)((double)(newTspList.size()-1) * generator.nextDouble());\n\t\t\tint element1 = element2 - 1;\n\t\t\tif ( element1 == -1 ){\n\t\t\t\telement1 = newTspList.size()-1;\n\t\t\t}\n\t\t\t\n int delta;\n\n\t\t\t/*\n\t\t\t * search in the neighborhood specified\n * if not specified search all\n\t\t\t */\n if ( kNeighborHood != -1 ) {\n\t\t\t /* We want to search in the specified k=n neighborhoods of element1 */\n\t\t\t delta= (int)(2*kNeighborHood*generator.nextDouble()) - kNeighborHood;\n } else {\n\t\t\t delta= (int)((newTspList.size()-1)*generator.nextDouble()) - (int)(newTspList.size()/2);\n\t\t\t}\n\n\t\t\tif ( delta == 0 ) {\n\t\t\t\tdelta = 2;\n\t\t\t} else if ( delta == 1 ) {\n\t\t\t\tdelta = 2;\n\t\t\t} else if ( delta == -1) {\n\t\t\t\tdelta = -2; }\n\n\t\t\tint element4 = element2 + delta;\n\n\t\t\tif ( element4 < 0 ) {\n\t\t\t\telement4 = newTspList.size()+element4;\n\t\t\t}else if ( element4 >= newTspList.size() ) {\n\t\t\t\telement4 = element4-(newTspList.size()-1);\n\t\t\t}\n\n\t\t\tint element3 = element4 -1;\n\t\t\tif ( element3 == -1 ){\n\t\t\t\telement3 = newTspList.size()-1;\n\t\t\t}\n\n\n\t\t\t/* \n\t\t\t * the new tsp will have element2->element4.......element1->element3....\n\t\t\t */\n\t\t\tInteger vertex_3 = newTspList.get(element3);\n\t\t\tnewTspList.set(element3,newTspList.get(element2));\n\t\t\tnewTspList.set(element2,vertex_3);\n\n\t\t\t/*\n\t\t\t * from element2+1 to element3-1 swap to reverse their order\n\t\t\t */\n\t\t\twhile ( element2 < element3 ){\n\t\t\t\telement3 = element3-1;\n\t\t\t\tif ( element3 == -1 ) {\n\t\t\t\t\telement3 = newTspList.size()-1;\n\t\t\t\t}\n\n\t\t\t\telement2 = element2 + 1;\n\t\t\t\tif ( element2 == newTspList.size() ) {\n\t\t\t\t\telement3 = 0;\n\t\t\t\t}\n\n\t\t\t\tInteger tempVertex = newTspList.get(element2);\n\t\t\t\tnewTspList.set(element2,newTspList.get(element3));\n\t\t\t\tnewTspList.set(element3,tempVertex);\n\n\t\t\t}\n\n\t\t\tdouble newTspCost = tspCost(newTspList);\n\n\t\t\t/* if new local search solution is better than eariler take the search and continue search\n\t\t\t */\n\t\t\tif ( newTspCost <= currentTspCost ){\n\t\t\t\tcurrentTspList = newTspList;\n\t\t\t\tcurrentTspCost = newTspCost;\n\t\t\t} else {\n\t\t\t/* if new local search solution is not better than eariler \n\t\t\t */\n\t\t\t\tcontinue;\n\t\t\t}\n\t\n\t\t\t//Subtract the start time from the finish time to get the actual algorithm running time; divide by 10e6 to convert to milliseconds\n\t\t\tdouble cycleTime = (System.nanoTime()-cycleStartTime);\n\n\t\t\t/* first improvement , take the best each time */\n\t\t\tif ( newTspCost < bestCost ) {\n\t\t\t\tbestCost = newTspCost;\n\t\t\t\tbestTspList = newTspList;\n\t\t\t\tbestCycleTime = cycleTime;\n\t\t\t\t/* print the trace file */\n\t\t\t\ttraceString = String.format(\"%.2f, %d\",Math.round(((System.nanoTime()-baseTime)/nanosecs)*100.0)/100.0,Math.round(bestCost));\n\t\t\t\tappendToTraceFile(runId,traceString);\n\n\t\t\t\tif ( bestCost <= optimalCost )\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}\n\n\t\t/* print the sol file */\n\t\tprintSol(runId,bestTspList,bestCost);\n\n\t\t/* print the tab results file */\n\t\tappendTabResults(runId,bestCycleTime,bestCost,bestTspList);\n\n\t\treturn bestTspList;\n\n\t}", "public static int example2(int[] arr) { // O(1)\r\n\t\tint n = arr.length, total = 0; // O(1)\r\n\t\tfor (int j = 0; j < n; j += 2) // note the increment of 2 // O(1)\r\n\t\t\ttotal += arr[j];\r\n\t\treturn total;\r\n\r\n\t\t/*\r\n\t\t * Explanation: Once Again, we have a (for) loop and it runs (n) times and this\r\n\t\t * for loop dominates the runtime.So this is linear time and the answer is O(n).\r\n\t\t * \r\n\t\t */\r\n\t}", "public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int T = sc.nextInt();\n for(int i = 0 ; i < T; i++) {\n int n = sc.nextInt();\n int a = sc.nextInt();\n int b = sc.nextInt();\n PriorityQueue<Integer> queue = new PriorityQueue<Integer>();\n int[][] m = new int[n][n];\n //n^2 * log(n)\n for(int row = 0; row < n; row++) {\n for(int col = 0; col < n; col++) {\n if(row == 0 && col == 0 && n != 1) {\n continue;\n }else if(row == 0) {\n m[row][col] = m[row][col - 1] + a;\n }else if(col == 0) {\n m[row][col] = m[row-1][col] + b;\n }else {\n m[row][col] = m[row-1][col-1] + a + b;\n }\n\n if(row + col == (n -1)) {\n pool.add(m[row][col]); //log(n)\n }\n }\n }\n //O(n*log(n))\n for (Integer item:pool) {\n queue.add(item); //O(logn)\n }\n while(!queue.isEmpty()) {\n System.out.print(queue.poll() + \" \"); //O(1)\n }\n System.out.println();\n queue.clear();\n pool.clear();\n }\n }", "@Test\n public void test2(){\n times = new ArrayList<Long>();\n for(int i = 0; i<threadnums.length; i++){\n BSTInterface tree = new LockFreeBST();\n makeThread2(tree, threadnums[i]);\n\n\n System.out.println( \"When there are \"+threadnums[i] + \"threads, there are \"+tree.getNum() + \" nodes\");\n\n long startTime=System.currentTimeMillis();\n for(int k = 0; k<100; k++)\n tree.search(totalnum/2);\n long endTime=System.currentTimeMillis();\n System.out.println( \"When there are \"+threadnums[i] + \"threads, the search takes \"+ (endTime-startTime) + \" ms\");\n }\n for(int i = 0; i<threadnums.length; i++){\n System.out.println(\"When there are \"+threadnums[i]+\" threads, \"+\"it takes \"+times.get(i)+\" ms\");\n }\n }", "public long numSimilarities();", "private static void get4ElementsSumCountFastest(String inputLine, int target) {\n String[] arr = inputLine.split(\" \");\n if (arr.length < 3) {\n System.out.println(0);\n return;\n }\n\n Map<Integer, Set<String>> pairSumMap = new HashMap<>();\n List<Integer> list = new ArrayList<>(arr.length);\n for (String s : arr) {\n list.add(Integer.parseInt(s.trim()));\n }\n\n int sum = 0, diff = 0;\n for (int i = 0; i < arr.length; i++) {\n for (int j = i + 1; j < arr.length; j++) {\n sum = list.get(i) + list.get(j);\n if (sum < target) {\n pairSumMap.putIfAbsent(sum, new HashSet<>());\n pairSumMap.get(sum).add(i + \"-\" + j);\n }\n }\n }\n\n for (Map.Entry<Integer, Set<String>> mk : pairSumMap.entrySet()) {\n diff = target - mk.getKey();\n if (pairSumMap.containsKey(diff)) {\n Set<String> indexesList = mk.getValue();\n for (String index : indexesList) {\n int indexOrgX = Integer.parseInt(index.split(\"-\")[0]);\n int indexOrgY = Integer.parseInt(index.split(\"-\")[1]);\n for (String newIdx : pairSumMap.get(diff)) {\n int indexNewX = Integer.parseInt(newIdx.split(\"-\")[0]);\n int indexNewY = Integer.parseInt(newIdx.split(\"-\")[1]);\n if (indexOrgX != indexNewX && indexOrgX != indexNewY && indexOrgY != indexNewX && indexOrgY != indexNewY) {\n System.out.println(1);\n return;\n }\n }\n }\n }\n }\n System.out.println(0);\n }", "private void locateBestMatch(int queryStartIdx){\n \n double dist;\n double bsfDist = Double.MAX_VALUE;\n int bsfIdx = -1;\n\n double[] query = zNormalise(series, queryStartIdx, this.windowSize, false);\n double[] comparison;\n\n for(int comparisonStartIdx = 0; comparisonStartIdx <= seriesLength-windowSize; comparisonStartIdx+=stride){\n \n // exclusion zone +/- windowSize/2 around the window\n if(comparisonStartIdx >= queryStartIdx-windowSize*1.5 && comparisonStartIdx <= queryStartIdx+windowSize*1.5){\n continue;\n }\n \n // using a bespoke version of this, rather than the shapelet version, for efficiency - see notes with method\n comparison = zNormalise(series, comparisonStartIdx, windowSize, false);\n dist = 0;\n\n for(int j = 0; j < windowSize;j++){\n dist += (query[j]-comparison[j])*(query[j]-comparison[j]);\n if(dist > bsfDist){\n dist = Double.MAX_VALUE;\n break;\n }\n }\n\n if(dist < bsfDist){\n bsfDist = dist;\n bsfIdx = comparisonStartIdx;\n }\n\n }\n \n this.distances[queryStartIdx] = bsfDist;\n this.indices[queryStartIdx] = bsfIdx;\n }" ]
[ "0.64294875", "0.6318114", "0.6120365", "0.6074353", "0.5905316", "0.5817478", "0.57524043", "0.56938833", "0.5627163", "0.5581339", "0.5532198", "0.5520221", "0.55090374", "0.5478759", "0.54302645", "0.5387349", "0.5315397", "0.53116673", "0.52926505", "0.52914244", "0.5279646", "0.5277665", "0.52577204", "0.52559936", "0.5229953", "0.522979", "0.5228958", "0.52271736", "0.52262694", "0.5191766", "0.5189446", "0.5187868", "0.51768756", "0.517434", "0.51647484", "0.5160704", "0.5160283", "0.5144847", "0.5142603", "0.5140607", "0.5138555", "0.51302516", "0.5115549", "0.51084894", "0.5079475", "0.50768864", "0.50681776", "0.5065308", "0.50611234", "0.505425", "0.50505304", "0.503104", "0.5030874", "0.5026478", "0.50237775", "0.50162286", "0.50132793", "0.5002373", "0.50012505", "0.50000525", "0.49997005", "0.4997337", "0.4996559", "0.4994309", "0.49870744", "0.498658", "0.49792445", "0.49721673", "0.49693903", "0.49692842", "0.49665618", "0.49651498", "0.4962671", "0.4958488", "0.49506003", "0.49479005", "0.49420464", "0.49419674", "0.49418667", "0.4932524", "0.4930559", "0.49273297", "0.49261448", "0.49224553", "0.49205732", "0.49200574", "0.4912562", "0.49060574", "0.49049324", "0.49013463", "0.4899072", "0.4897424", "0.48938274", "0.4890697", "0.48899966", "0.48884994", "0.48860157", "0.48853305", "0.48838836", "0.4881959", "0.48803824" ]
0.0
-1
TIME COMPLEXITY FOR BINARY SEARCH IS O(log2n)
public int binarySearchRecursive(int[] array,int target) { return binarySearchRecursive(array,target,0,array.length); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static double binSearchT(int s, Integer[] a){\n Random rand = new Random();\n int searchVar;\n Stopwatch timer = new Stopwatch();\n Arrays.sort(a);\n for (int i = 0; i < s; i++){\n searchVar = (int)(rand.nextDouble()*a.length);\n Arrays.binarySearch(a, searchVar);\n }\n return timer.elapsedTime(); // the method returns the elapsed time\n }", "private static void task2(int nUMS, BinarySearchTree<Integer> t) {\n\t\tSystem.out.println(\"Binary Search Started...\");\n\t double search_start = 0, search_end = 0;\n\t int totalkeymatched = 0;\n\n\t search_start = System.nanoTime();\n\t \n\t for (int z = 0; z < nUMS; z++) {\n\t \tint checker= GenerateInt.generateNumber();\n\t \t\n//\t \tSystem.out.println(GenerateStrings.getAlphaNumericString(limit));\n\t if (t.contains(checker)) {\n\t\n//\t System.out.println(\"Key Matches\");\n\t totalkeymatched++;\n\t \t }\n\t }\n\t search_end = System.nanoTime();\n\t System.out.println(\"Average time for each search: \" + (search_end - search_start) / nUMS + \" nanoseconds\");\n\t System.out.println(\"TOTAL MATCHES \" + totalkeymatched);\n\t\t\n\t}", "public static void searchTest() {\n\t\t//linear tests\n\t\tStopWatch1 timer;\n\t\tint[] array = generateArray(5000000,1,5000000);\n\t\tSystem.out.printf(\"%15s%10s%10s%10s%10s%10s%n\",\"Size\",\"Sort Type\",\"Pre-sort\",\"Value\",\"Index\",\"Time\");\n\t\tfor(int i = 0; i< 5; i++) {\n\t\t\ttimer = new StopWatch1();\n\t\t\tint temp = (int)(Math.random() * (5000000)) +1;\n\t\t\tSystem.out.printf(\"%15d%10s%10s%10d\",5000000,\"Linear\",\"Random\",temp);\n\t\t\ttimer.start();\n\t\t\tint result = Search.linearSearch(array, temp);\n\t\t\ttimer.stop();\n\t\t\tif(result>0) {\n\t\t\t\tSystem.out.printf(\"%10d\",result);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tSystem.out.printf(\"%10s\",\"Not Found\");\n\t\t\t}\n\t\t\tSystem.out.printf(\"%10d%n\", timer.getElapsedTime());\n\t\t\t\n\t\t}\n\t\tSort.mergeSort(array);\n\t\tfor(int i = 0; i< 5; i++) {\n\t\t\ttimer = new StopWatch1();\n\t\t\tint temp = (int)(Math.random() * (5000000)) +1;\n\t\t\tSystem.out.printf(\"%15d%10s%10s%10d\",5000000,\"Linear\",\"Sorted\",temp);\n\t\t\tint result = Search.linearSearch(array, temp);\n\t\t\tif(result>0) {\n\t\t\t\tSystem.out.printf(\"%10d\",result);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tSystem.out.printf(\"%10s\",\"Not Found\");\n\t\t\t}\n\t\t\tSystem.out.printf(\"%10d%n\", timer.getElapsedTime());\n\t\t}\n\t\tfor(int i =0; i< 5; i++) {\n\t\t\ttimer = new StopWatch1();\n\t\t\tint temp = (int)(Math.random() * (5000000)) +1;\n\t\t\tSystem.out.printf(\"%15d%10s%10s%10d\",5000000,\"Binary\",\"Sorted\",temp);\n\t\t\tint result = Search.binarySearch(array, temp);\n\t\t\tif(result>0) {\n\t\t\t\tSystem.out.printf(\"%10d\",result);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tSystem.out.printf(\"%10s\",\"Not Found\");\n\t\t\t}\n\t\t\tSystem.out.printf(\"%10d%n\", timer.getElapsedTime());\n\t\t}\n\t}", "public static void main(String[] args){\n int s = 80;\n int n = (int) Math.pow(10, 7);\n Integer[] a = new Integer[n];\n Random rand = new Random();\n for (int i = 0; i < n; i++){\n a[i] = (int) (n*rand.nextDouble());\n }\n double binTime = binSearchT(s, a);\n double linTime = linSearchT(s, a);\n System.out.println(\"binTime: \"+ binTime);\n System.out.println(\"linTime: \"+ linTime);\n\n }", "public static double linSearchT(int s, Integer[] a){\n Random rand = new Random();\n int searchVar;\n Stopwatch timer = new Stopwatch();\n for (int i = 0; i < s; i++){\n searchVar = (int)(rand.nextDouble()*a.length);\n for (int j = 0; j < a.length; j++){\n if (a[j] == searchVar)\n break;\n }\n }\n return timer.elapsedTime(); // the method returns the elapsed time\n }", "private static void task222(int nUMS, RedBlackBST<Integer, Integer> i) {\n\t\tSystem.out.println(\"RED BLAST BST Started Search...\");\n\t double search_start = 0, search_end = 0;\n\t int totalkeymatched = 0;\n\n\t search_start = System.nanoTime();\n\t \n\t for (int z = 0; z < nUMS; z++) {\n\t \tint checker= GenerateInt.generateNumber();\n\t \t\n//\t \tSystem.out.println(GenerateStrings.getAlphaNumericString(limit));\n\t if (i.contains(checker)) {\n\t\n//\t System.out.println(\"Key Matches\");\n\t totalkeymatched++;\n\t \t }\n\t }\n\t search_end = System.nanoTime();\n\t System.out.println(\"Average time for each search: \" + (search_end - search_start) / nUMS + \" nanoseconds\");\n\t System.out.println(\"TOTAL MATCHES \" + totalkeymatched);\n\n\t}", "static int binarySearch(long[] paramArrayOflong, int paramInt, long paramLong) {\n }", "private static void task2222(int nUMS, SplayTree<Integer> j) {\n\t\tSystem.out.println(\"SPLAY Started Search...\");\n\t double search_start = 0, search_end = 0;\n\t int totalkeymatched = 0;\n\n\t search_start = System.nanoTime();\n\t \n\t for (int z = 0; z < nUMS; z++) {\n\t \tint checker= GenerateInt.generateNumber();\n\t \t\n//\t \tSystem.out.println(GenerateStrings.getAlphaNumericString(limit));\n\t if (j.contains(checker)) {\n\t\n//\t System.out.println(\"Key Matches\");\n\t totalkeymatched++;\n\t \t }\n\t }\n\t search_end = System.nanoTime();\n\t System.out.println(\"Average time for each search: \" + (search_end - search_start) / nUMS + \" nanoseconds\");\n\t System.out.println(\"TOTAL MATCHES \" + totalkeymatched);\n\n\t}", "public void binSearch(int current, int first, int last) {\r\n long average2 = 0, timeB = 0, stanDev = 0;\r\n System.out.println(\"\\nBINARY SEARCH\\n\");\r\n for (int i = 0; i < 10; i++) {\r\n long start = System.nanoTime();\r\n while (last >= first) {\r\n int mid = (last + first) / 2;//FINDS THE MID WAY POINT IN ORDER TO KEEP HALF-ING THE SEARCH RESULTS.\r\n if (A[mid] == current) {\r\n long stop = System.nanoTime();\r\n long timelength = (stop - start);\r\n timeB += timelength; // USED FOR GETTING AVERAGE. \r\n bin[k][i] = timelength;//USED FOR STORING THE TIME IT TOOK FOR EACH TEST, IT IS USED LATER ON TO DISPLAY IN THE CHART.\r\n binary[i] = timelength;//USED FOR FINDING STANDARD DEVIATION.\r\n System.out.println(\"The number: \" + current + \" was found in the array index: \" + A[mid]\r\n + \"\\nIt took: \" + timelength + \" nanoseconds.\");\r\n break;\r\n\r\n } else if (A[mid] < current) {\r\n first = mid + 1;\r\n } else {\r\n last = mid - 1;\r\n }\r\n }\r\n }\r\n average2 = (timeB / 10);\r\n linAvAndDev[h][0] = average2;\r\n for (int j = 0; j < 10; j++) {\r\n stanDev += Math.pow((binary[j] - average2), 2.0);\r\n }\r\n stanDev /= 10;\r\n stanDev = (long) Math.sqrt(stanDev);\r\n linAvAndDev[h][1] = stanDev;\r\n System.out.println(\"The Avearge time for the Binary Search was: \" + average2 + \" nanoseconds.\"\r\n + \"\\nThe Standard Deviation time for the Binary Search was: \" + stanDev + \" nanoseconds.\");\r\n h += 1;\r\n k += 1;\r\n }", "@Test\n\tpublic void testBinarySearch() {\n\t\tint[] arr0 = {0, 1, 2, 3, 4, 5};\n\t\tassertEquals(0, _01_BinarySearch.binarySearch(arr0, 0, arr0.length - 1, 0));\n\t\tassertEquals(1, _01_BinarySearch.binarySearch(arr0, 0, arr0.length - 1, 1));\n\t\tassertEquals(2, _01_BinarySearch.binarySearch(arr0, 0, arr0.length - 1, 2));\n\t\tassertEquals(3, _01_BinarySearch.binarySearch(arr0, 0, arr0.length - 1, 3));\n\t\t\n\t\tassertEquals(-1, _01_BinarySearch.binarySearch(arr0, 0, arr0.length - 1, 99));\n\t\t\n\t\tint[] arr1 = {0, 43, 209, 388, 401, 599};\n\t\tassertEquals(2, _01_BinarySearch.binarySearch(arr1, 0, arr0.length - 1, 209));\n\t\tassertEquals(-1, _01_BinarySearch.binarySearch(arr1, 0, arr0.length - 1, 45));\n\t}", "abstract int binSearch(int[] array, int num, int left, int right);", "public void search(IndexShort < O > index, short range, short k)\n throws Exception {\n // assertEquals(index.aDB.count(), index.bDB.count());\n // assertEquals(index.aDB.count(), index.bDB.count());\n // index.stats();\n index.resetStats();\n // it is time to Search\n int querySize = 1000; // amount of elements to read from the query\n String re = null;\n logger.info(\"Matching begins...\");\n File query = new File(testProperties.getProperty(\"test.query.input\"));\n File dbFolder = new File(testProperties.getProperty(\"test.db.path\"));\n BufferedReader r = new BufferedReader(new FileReader(query));\n List < OBPriorityQueueShort < O >> result = new LinkedList < OBPriorityQueueShort < O >>();\n re = r.readLine();\n int i = 0;\n long realIndex = index.databaseSize();\n\n while (re != null) {\n String line = parseLine(re);\n if (line != null) {\n OBPriorityQueueShort < O > x = new OBPriorityQueueShort < O >(\n k);\n if (i % 100 == 0) {\n logger.info(\"Matching \" + i);\n }\n\n O s = factory.create(line);\n if (factory.shouldProcess(s)) {\n if(i == 279){\n System.out.println(\"hey\");\n }\n index.searchOB(s, range, x);\n result.add(x);\n i++;\n }\n }\n if (i == querySize) {\n logger.warn(\"Finishing test at i : \" + i);\n break;\n }\n re = r.readLine();\n }\n \n logger.info(index.getStats().toString());\n \n int maxQuery = i;\n // logger.info(\"Matching ends... Stats follow:\");\n // index.stats();\n\n // now we compare the results we got with the sequential search\n Iterator < OBPriorityQueueShort < O >> it = result.iterator();\n r.close();\n r = new BufferedReader(new FileReader(query));\n re = r.readLine();\n i = 0;\n while (re != null) {\n String line = parseLine(re);\n if (line != null) {\n if (i % 300 == 0) {\n logger.info(\"Matching \" + i + \" of \" + maxQuery);\n }\n O s = factory.create(line);\n if (factory.shouldProcess(s)) {\n OBPriorityQueueShort < O > x2 = new OBPriorityQueueShort < O >(\n k);\n searchSequential(realIndex, s, x2, index, range);\n OBPriorityQueueShort < O > x1 = it.next();\n //assertEquals(\"Error in query line: \" + i + \" slice: \"\n // + line, x2, x1); \n \n assertEquals(\"Error in query line: \" + i + \" \" + index.debug(s) + \"\\n slice: \"\n + line + \" \" + debug(x2,index ) + \"\\n\" + debug(x1,index), x2, x1);\n\n i++;\n }\n \n }\n if (i == querySize) {\n logger.warn(\"Finishing test at i : \" + i);\n break;\n }\n re = r.readLine();\n }\n r.close();\n logger.info(\"Finished matching validation.\");\n assertFalse(it.hasNext());\n }", "protected int find_among_b(Among v[])\n {\n\tint i = 0;\n\tint j = v.length;\n\n\tint c = cursor;\n\tint lb = limit_backward;\n\n\tint common_i = 0;\n\tint common_j = 0;\n\n\tboolean first_key_inspected = false;\n\n\twhile (true) {\n\t int k = i + ((j - i) >> 1);\n\t int diff = 0;\n\t int common = common_i < common_j ? common_i : common_j;\n\t Among w = v[k];\n\t int i2;\n\t for (i2 = w.s.length - 1 - common; i2 >= 0; i2--) {\n\t\tif (c - common == lb) {\n\t\t diff = -1;\n\t\t break;\n\t\t}\n\t\tdiff = current.charAt(c - 1 - common) - w.s[i2];\n\t\tif (diff != 0) break;\n\t\tcommon++;\n\t }\n\t if (diff < 0) {\n\t\tj = k;\n\t\tcommon_j = common;\n\t } else {\n\t\ti = k;\n\t\tcommon_i = common;\n\t }\n\t if (j - i <= 1) {\n\t\tif (i > 0) break;\n\t\tif (j == i) break;\n\t\tif (first_key_inspected) break;\n\t\tfirst_key_inspected = true;\n\t }\n\t}\n\twhile (true) {\n\t Among w = v[i];\n\t if (common_i >= w.s.length) {\n\t\tcursor = c - w.s.length;\n\t\tif (w.method == null) return w.result;\n\n\t\tboolean res;\n\t\ttry {\n\t\t Object resobj = w.method.invoke(this);\n\t\t res = resobj.toString().equals(\"true\");\n\t\t} catch (InvocationTargetException e) {\n\t\t res = false;\n\t\t // FIXME - debug message\n\t\t} catch (IllegalAccessException e) {\n\t\t res = false;\n\t\t // FIXME - debug message\n\t\t}\n\t\tcursor = c - w.s.length;\n\t\tif (res) return w.result;\n\t }\n\t i = w.substring_i;\n\t if (i < 0) return 0;\n\t}\n }", "private static void task22(int nUMS, AVLTree<Integer> h) {\n\t\t\n\t\tSystem.out.println(\"AVL Started...\");\n\t double search_start = 0, search_end = 0;\n\t int totalkeymatched = 0;\n\n\t search_start = System.nanoTime();\n\t \n\t for (int z = 0; z < nUMS; z++) {\n\t \tint checker= GenerateInt.generateNumber();\n\t \t\n//\t \tSystem.out.println(GenerateStrings.getAlphaNumericString(limit));\n\t if (h.contains(checker)) {\n\t\n//\t System.out.println(\"Key Matches\");\n\t totalkeymatched++;\n\t \t }\n\t }\n\t search_end = System.nanoTime();\n\t System.out.println(\"Average time for each search: \" + (search_end - search_start) / nUMS + \" nanoseconds\");\n\t System.out.println(\"TOTAL MATCHES \" + totalkeymatched);\n\t\t\n\t\t\n\t}", "public static void main(String[] args) {\n\t\tint size = 600_000_000;\n\t\tint[] mas = new int[size];\n\t\tfor (int i = 0; i < size; i++) {\n\t\t\tmas[i] = i;\n\t\t}\n\n\t\t// positive test\n\t\tint target = size - 1;\n\n\t\tlong start = System.currentTimeMillis();\n\t\tlinearSearchTestPositive(mas, target, target);\n\t\tlong end = System.currentTimeMillis();\n\t\tSystem.out.println(end - start);\n\n\n\t\tlong start1 = System.currentTimeMillis();\n\t\tbinarySearchTestPositive(mas, target, target);\n\t\tlong end1 = System.currentTimeMillis();\n\t\tSystem.out.println(end1 - start1);\n\t}", "void compareSearch();", "public static void main(String[] args){\n int MIN = Integer.parseInt(args[0]);\n MAX = Integer.parseInt(args[1]);\n cutoffs = new int[args.length - 2];\n cache = new ArrayList<IndexedArrayList<SuperSavvyTrieHelper2>>();\n for (int i = 2; i < args.length; i++){\n cutoffs[i - 2] = Integer.parseInt(args[i]);\n cache.add(new IndexedArrayList<SuperSavvyTrieHelper2>());\n }\n for (int i = 0; i < cutoffs.length / 2; i++){\n int temp = cutoffs[i];\n cutoffs[i] = cutoffs[cutoffs.length - 1 - i];\n cutoffs[cutoffs.length - 1 - i] = temp;\n }\n multiplicitiesUsed = new boolean[MAX + 1];\n basesUsed = new DoublyLinkedArray(MAX + 1);\n SuperSavvyTrieHelper2.setCorrespondance(basesUsed);\n /*\n long count1 = lowerRecursion(MAX, 0);\n long count2 = middleRecursion(MAX, 0);\n long count3 = upperRecursion(MAX, 0);\n long total = count1 + count2 + count3;\n System.out.printf(\"%d + %d + %d = %d\\n\", count1, count2, count3, total);\n */\n hitCounts = new long[cutoffs.length];\n missCounts = new long[cutoffs.length];\n statCollector = new StatCollector(cutoffs);\n\n long startTime = System.nanoTime();\n long[] values = new long[MAX - MIN + 1];\n for (int i = MIN; i <= MAX; i++) {\n values[i - MIN] = upperRecursionWrapper(i);\n }\n //long[] testValues = new long[] {1752443,1911046, 2067456,2249444,2429337, 2647532,2852449,3101167,3350292,3632299,3916575};\n for (int i = 0; i < values.length; i++){\n //if (testValues[i] != values[i]){\n System.out.printf(\"%d: %d\\n\", i + MIN, values[i]);\n //}\n }\n long endTime = System.nanoTime();\n System.out.printf(\"%f,\", (double)(endTime - startTime) / 1000000000.0);\n long totalMissCounts = 0;\n long totalMissWeight1 = 0;\n long totalMissWeight2 = 0;\n long totalMissWeight3 = 0;\n /*\n for (int i = 0; i < cutoffs.length; i++){\n long totalCounts = hitCounts[i] + missCounts[i];\n totalMissCounts += missCounts[i];\n totalMissWeight1 += missCounts[i] * cutoffs[i];\n totalMissWeight2 += (hitCounts[i] / missCounts[i]) * cutoffs[i];\n totalMissWeight3 += (hitCounts[i] - missCounts[i]) * cutoffs[i] * cutoffs[i];\n System.out.printf(\"\\tCache %d: %d/%d/%d (%.5f%%)\", cutoffs[i], hitCounts[i], missCounts[i], totalCounts, (double) hitCounts[i] / totalCounts);\n }\n System.out.printf(\"\\t\\tMissCounts: %d, weighted: %d, ratio: %d, diff^2: %d\\n\", totalMissCounts, totalMissWeight1, totalMissWeight2, totalMissWeight3);\n */\n statCollector.printAll();\n }", "private int LinearSearchAfterBinary(String filename, ArrayList<Integer> matchingPositions, String wordToBeSearched, int linesToSkip, boolean reverseFile)\n {\n try\n {\n //Try to open the index file using a Scanner\n Scanner indexFileFileScanner = new Scanner(new File(filename + \".ndx\"));\n\n //Counter for the data page accesses\n int dataPageCounter = 0;\n\n //Flag for the search process status\n boolean searchStatus = true;\n\n //Counter of the word matching\n int wordOccurrences = matchingPositions.size();\n\n //Check whether to search the top or the bottom part of the file\n if(reverseFile)\n {\n //Create an ArrayList object to store the part of the file to continue the search\n ArrayList<String> fileLines = new ArrayList<>();\n\n //Get the necessary lines from the file\n for(int index = 0; index < linesToSkip; index++)\n {\n fileLines.add(indexFileFileScanner.nextLine());\n }\n\n //If the word to be searched length is valid, scan every data page in the ArrayList, in reverse order\n while(fileLines.size() != dataPageCounter && searchStatus)\n {\n //Fetch the data page into the ByteBuffer\n ByteBuffer bytePageBuffer = ByteBuffer.wrap(StringToByteArrayTranslator(fileLines.get(fileLines.size() - dataPageCounter - 1), SizeConstants.getBufferSize()));\n\n //Search for the word to be searched in the data page\n searchStatus = LinearSearchBytePage(wordToBeSearched,bytePageBuffer.array(), matchingPositions);\n\n //Count the data page access\n dataPageCounter++;\n\n //Check if there no more occurrences of the word to be searched\n if(!matchingPositions.isEmpty())\n {\n //If there are continue the search\n if(wordOccurrences != matchingPositions.size())\n {\n wordOccurrences = matchingPositions.size();\n }\n else\n {\n //Stop the search\n searchStatus = false;\n }\n }\n }\n }\n else\n {\n //Skip lines of the file\n SkipLines(indexFileFileScanner, linesToSkip);\n\n //If the word to be searched length is valid, scan every data page in the file\n while(indexFileFileScanner.hasNext() && searchStatus)\n {\n //Fetch the data page into the ByteBuffer\n ByteBuffer bytePageBuffer = ByteBuffer.wrap(StringToByteArrayTranslator(indexFileFileScanner.nextLine(), SizeConstants.getBufferSize()));\n\n //Search for the word to be searched in the data page\n searchStatus = LinearSearchBytePage(wordToBeSearched,bytePageBuffer.array(), matchingPositions);\n\n //Count the data page access\n dataPageCounter++;\n\n //Check if there no more occurrences of the word to be searched\n if(!matchingPositions.isEmpty())\n {\n //If there are continue the search\n if(wordOccurrences != matchingPositions.size())\n {\n wordOccurrences = matchingPositions.size();\n }\n else\n {\n //Stop the search\n searchStatus = false;\n }\n }\n }\n }\n\n //Close the FileScanner\n indexFileFileScanner.close();\n\n //Return the number of data page accesses\n return dataPageCounter;\n }\n catch (FileNotFoundException e)\n {\n //Catch the FileNotFoundException and inform the user\n System.out.println(\"File: \" + this.Filename + \" cannot be opened.\");\n e.printStackTrace();\n return 0;\n }\n }", "Long[] searchSolution(int timeLimit, Graph g);", "@Test\n\tpublic void testBinarySearch() {\n\t\tint[] numbers = {0, 1, 2, 3, 4, 5, 6};\n\t\tint r1 = _01_BinarySearch.binarySearch(numbers, 0, numbers.length - 1, 4);\n\t\tassertEquals(4, r1);\n\t\t\n\t\tint[] numbers2 = {2, 4, 7, 9, 14};\n\t\tint r2 = _01_BinarySearch.binarySearch(numbers2, 0, numbers2.length - 1, 8);\n\t\tassertEquals(-1, r2);\n\t\t\n\t\tint[] numbers3 = {3, 5, 10, 16, 25};\n\t\tint r3 = _01_BinarySearch.binarySearch(numbers3, 0, numbers3.length - 1, 25);\n\t\tassertEquals(4, r3);\n\t\t\n\t}", "static int binarySearch(int[] paramArrayOfint, int paramInt1, int paramInt2) {\n }", "@Test\n public void testBinarySearch() {\n System.out.println(\"binarySearch\");\n int[] index = {10, 11, 12, 13, 14};\n int key = 12;\n int begin = 0;\n int end = 5;\n int expResult = 2;\n int result = Utils.binarySearch(index, key, begin, end);\n assertEquals(expResult, result);\n }", "private int binarySearch(T element) {\n int start = 0, end = sortedArray.size(), mid = 0;\n while (start < end) {\n mid = (end + start) / 2;\n int cmp = sortedArray.get(mid).compareTo(element);\n if (cmp == 0) {\n start = end = mid;\n }\n else if (cmp < 0) {\n start = mid + 1;\n }\n else {\n end = mid;\n }\n }\n return start;\n }", "private Integer serialSearch() {\n int currentIndex = startIndex;\n for (int i = start; i < end; i++) {\n if (this.searchIndex == currentIndex) {\n return currentIndex;\n }\n currentIndex++;\n }\n return 0;\n }", "private static int bSearch(int[] elements, int key) {\n int left = 0, right = elements.length - 1, mid = 0;\n while (left <= right) {\n mid = (left + right) / 2;\n\n if (key < elements[mid]) {\n right = mid - 1;\n } else if (key == elements[mid]) {\n return mid;\n } else {\n left = mid + 1;\n }\n }\n return -1;\n }", "private int recFind(int searchKey, int lowerbound, int upperbound) {\n\t\tint curIn = (lowerbound + upperbound) / 2;\n\t\tif (arr[curIn] == searchKey)\n\t\t\treturn curIn;\n\t\telse if (lowerbound > upperbound)\n\t\t\treturn n;\n\t\telse {\n\t\t\tif (arr[curIn] < searchKey)\n\t\t\t\treturn recFind(searchKey, curIn + 1, upperbound);\n\t\t\telse\n\t\t\t\treturn recFind(searchKey, lowerbound, curIn - 1);\n\t\t}\n\t}", "public static int binSearch(int[] a, int x) {\r\n int l = 0;\r\n int r = a.length;\r\n while (l != r) {\r\n // inv: l <= res <= r\r\n int m = (l + r) / 2;\r\n if (a[m] >= x) {\r\n r = m;\r\n }\r\n else {\r\n l = m + 1;\r\n }\r\n }\r\n return r;\r\n }", "public static void main(String[] args) throws java.lang.Exception {\n\n Scanner scn = new Scanner(System.in);\n\n int t = scn.nextInt();\n\n while (t != 0) {\n int n = scn.nextInt();\n\n int arr[] = new int[n];\n\n for (int i = 0; i < n; i++) {\n\n arr[i] = scn.nextInt();\n\n }\n int pos = scn.nextInt();\n long element = arr[pos-1];\n\n Arrays.sort(arr);\n \n for(int i=0;i<n;i++)\n System.out.print(arr[i]+\" \");\n \n System.out.println();\n System.out.println(bsearch(arr, element) +1 );\n t--;\n }\n\n }", "public int binarySearch(Long[] keys,Long target){\n\t\tif(keys ==null || keys.length ==0){\n\t\t\treturn -1;\n\t\t}\n\t\tint l = 0;\n\t\tint r = keys.length-1;\n\t\twhile(l<r){\n\t\t\tint mid = l + (r-l)/2;\n\t\t\tif(keys[mid] == target)\n\t\t\t\treturn mid;\n\t\t\tif(keys[mid]<target)\n\t\t\t\tl = mid+1;\n\t\t\telse\n\t\t\t\tr = mid-1;\n\t\t}\n\t\treturn l;\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\n\t\tint a[] = {2,1,3,-4,-2};\n\t\t//int a[] = {1 ,2, 3, 7, 5};\n\t\tboolean found = false;\n\t\t\n\t\t//this will solve in o n^2\n\t\tfor(int i = 0 ; i < a.length ; i++){\n\t\t\tint sum = 0;\n\t\t\tfor(int j = i ; j< a.length ; j++){\n\t\t\t\tsum += a[j] ;\n\t\t\t\tif(sum == 0){\n\t\t\t\t\tfound = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tif(found)\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\t\n\t\t// link : https://www.youtube.com/watch?v=PSpuM9cimxA&list=PLKKfKV1b9e8ps6dD3QA5KFfHdiWj9cB1s&index=49\n\t\tSystem.out.println(found + \" found\");\n\t\tfound = false;\n\t\t//solving with O of N with the help sets\n\t\t// x + 0 = y\n\t\tSet<Integer> set = new HashSet<>();\n\t\tint sum = 0;\n\t\tfor(int element : a){\n\t\t\tset.add(sum);\n\t\t\tsum += element;\n\t\t\tif(set.contains(sum)){\n\t\t\t\tfound = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println();\n\t\tSystem.out.println(set);\n\t\t\n\t\tSystem.out.println(found + \" found\");\n\t\t\n\t\t\n\t\tfound = false;\n\t\t// when the sum of subarray is K\n\t\t\n\t\t//solving with O of N with the help sets\n\t\t//x + k = y >>>\n\t\tSet<Integer> set1 = new HashSet<>();\n\t\tint k = 12;\n\t\tint summ = 0;\n\t\tfor(int element : a){\n\t\t\tset1.add(summ);\n\t\t\tsumm += element;\n\t\t\tif(set1.contains(summ - k)){ // y - k = x(alredy presnt or not)\n\t\t\t\tfound = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(set1);\n\t\tSystem.out.println();\n\t\tSystem.out.println(found + \" found\");\n\t\t\n\t\t\n\t}", "public static void ThreeSum_binsearch(int[] a, int k)\r\n\t{\r\n\t // sort the array\r\n\t Arrays.sort(a);\r\n\t for (int i = 0; i < a.length; ++i)\r\n\t {\r\n\t for (int j = i+1; j < a.length; ++j)\r\n\t {\r\n\t int diff = k - (a[i] + a[j]);\r\n\t int idx = Arrays.binarySearch(a, j+1, a.length, diff);\r\n\t if (idx > 0)\r\n\t {\r\n\t System.out.println(\"[\" + a[i] + \",\" + a[j] + \",\" + a[idx] + \"]\");\r\n\t }\r\n\t }\r\n\t }\r\n\t}", "public abstract Solution<T> search(Searchable<T> s);", "static int binarySearchHelp(int[] array, int searched) {\n\t\tint mid = array.length / 2;\r\n\t\tint first = 0;\r\n\t\tint last = array.length - 1;\r\n\r\n\t\twhile (array[mid] != searched && first <= last) {\r\n\t\t\tmid = (first + last) / 2;\r\n\t\t\tif (searched == array[mid]) {\r\n\t\t\t\treturn mid;\r\n\t\t\t}\r\n\t\t\tif (searched < array[mid]) {\r\n\t\t\t\tlast = mid - 1;\r\n\r\n\t\t\t}\r\n\t\t\tif (searched > array[mid]) {\r\n\t\t\t\tfirst = mid + 1;\r\n\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn -1;\r\n\t}", "private static int binarySearch0_BranchFreeUnrolledStatic16(int[] a, int key) {\n\t\tint low = 8;\n\t\tint midVal;\n\t\tint highMask;\n\n\t\tmidVal = a[low];\n\t\tlow += 4;\n\t\thighMask = (int) (((long) key - midVal) >> 63);\n\t\tlow -= 8 & highMask;\n\n\t\tmidVal = a[low];\n\t\tlow += 2;\n\t\thighMask = (int) (((long) key - midVal) >> 63);\n\t\tlow -= 4 & highMask;\n\n\t\tmidVal = a[low];\n\t\tlow += 1;\n\t\thighMask = (int) (((long) key - midVal) >> 63);\n\t\tlow -= 2 & highMask;\n\n\t\tmidVal = a[low];\n\t\thighMask = (int) (((long) key - midVal) >> 63);\n\t\tlow -= 1 & highMask;\n\n\t\treturn a[low] == key ? low : -(low + 1);\n\n\t}", "static double binarySearchForBuckets (double[] splits, double feature, boolean keepInvalid) { throw new RuntimeException(); }", "public static Boolean binarySearch(int[] arr, int n){\r\n if(arr.length == 0) return false;\r\n if(arr.length == 1 && arr[0] != n) return false; \r\n if(arr.length == 1 && arr[0] == n) return true; \r\n int start = 0;\r\n int mid = arr.length/2;\r\n int end = arr.length;\r\n int pos = mid;\r\n while(arr[pos] != n){\r\n if(n > arr[pos]){\r\n start = mid;\r\n mid = (end-start)/2+start;\r\n } else if(n < arr[pos]){\r\n end = mid;\r\n mid = (end-start)/2+start;\r\n System.out.println(\"here \" + start+ \" \" + mid + \" \" + end + \" pos= \" + pos);\r\n }\r\n pos = mid;\r\n if(arr[pos] == n) return true;\r\n if(start+1 == end){\r\n System.out.println(start+ \" \" + mid + \" \" + end + \" pos= \" + pos);\r\n return false;\r\n }\r\n }\r\n return true;\r\n}", "public static native int Find(long lpjFbxArrayVector2, long pElement, int pStartIndex);", "private void BinarySearch(Node node, int index) {\n Node left, right;\n left = node.left;\n right = node.right;\n\n int leftIndex = (2 * index) + 1;\n int rightIndex = (2 * index) + 2;\n if (left != null) {\n ArrayTree[leftIndex] = left.key;\n BinarySearch(left, leftIndex);\n lastIndex = Math.max(leftIndex, lastIndex);\n } else {\n if (leftIndex < ArrayTree.length - 1) {\n ArrayTree[leftIndex] = 0;\n }\n }\n\n if (right != null) {\n ArrayTree[rightIndex] = right.key;\n BinarySearch(right, rightIndex);\n lastIndex = Math.max(rightIndex, lastIndex);\n } else {\n if (rightIndex < ArrayTree.length - 1) {\n ArrayTree[rightIndex] = 0;\n }\n }\n }", "static int binSearch(int []arr,int key) {\n\t\tint start=0;\n\t\tint end=arr.length-1;\n\t\tdo {\n\t\t\tint pc=(start+end)/2;\n\t\t\tif(arr[pc]==key) {\n\t\t\t\treturn pc;\n\t\t\t}else if(arr[pc]<key) {\n\t\t\t\tstart=pc+1;\n\t\t\t}else\n\t\t\t\tend=pc-1;\n\t\t}while(start<=end);\n\t\t\n\t\treturn -1;\n\t}", "public int binarySearchIterative(int[] array,int target) {\n var left = 0;\n var right = array.length -1;\n while (left <= right) {\n int middle = (left + right) / 2;\n if (array[middle] == target)\n return middle;\n if (array[middle] < target)\n left = middle + 1;\n else\n right = middle - 1;\n }\n return -1;\n }", "@SuppressWarnings(\"unchecked\") // stops Java complaining about the call to compare\n private int findIndexOf(Comparable<E> item) {\n if (count == 0) { //this is where the binary search happens that reduces the time and computational power it takes to search the collection\n return count; // if count == 0 it returns the count variable to break the loop and show that the collection is empty\n }\n int low = 0; //Sets up three variables to keep track of the start and end values of index and the middle of the collection, this helps\n int high = count - 1; //the search algorithm becase the array always knows where the middle is and so the collection can contnually half using the three\n int mid; //variables to find a single value, while the low is less or equal to the high variable,\n while (low <= high) {\n\n mid = (low + high) / 2;\n\n int compareValue = item.compareTo(data[mid]); // the value we are trying to find\n if (compareValue == 0) return mid; //returns the middle value,\n if (compareValue > 0) low = mid + 1; //if greater than it changes low value to equal the middle, plus one(as mid is already checked)\n else high = mid - 1; //else it changes to the lower half of the collecton to search there.\n }\n return low; //Hopefully if found it will then return low,\n }", "public static void main(String[] args) \n\t{\n\t \n\t\tlong startTimer = System.currentTimeMillis();\n\t\t//mrethod 1\n\t\tint res=Utility.binarySearchWord();\n\t\tif(res==-1)\n\t\t\tSystem.out.println(\"your word not found\");\n\t\t else\n\t\t System.out.println(\"your word found at index:\"+res);\n\t\tlong first=System.currentTimeMillis();\n\t\tSystem.out.println((first-startTimer)/1000+\"seconds\");\n\t \n\t\t//method 2\n\t\tint res1=Utility.binarySearchForInteger();\n\t\tif(res1==-1)\n\t\t\tSystem.out.println(\"your no. not found\");\n\t\t else\n\t\t System.out.println(\"your no.found at index:\"+res1);\n\t\tlong second=System.currentTimeMillis();\n\t\tSystem.out.println((second-first)/1000+\"seconds\");\n\t\t\n\t\t//method 3\n\t\tint res3[]=Utility.bubbleSortForIntegers();\n\t\tfor(int i=0;i<res3.length;i++)\n\t\t\tSystem.out.println(res3[i]);\n\t\tlong third=System.currentTimeMillis();\n\t\tSystem.out.println((third-second)/1000+\"seconds\");\n\t\t\n\t\t//method 4\n\t\tString res4[]=Utility.bubbleSortForStrings();\n\t\tfor(int i=0;i<res4.length;i++)\n\t\t\tSystem.out.println(res4[i]);\n\t\tlong fourth=System.currentTimeMillis();\n\t\tSystem.out.println((fourth-third)/1000+\"seconds\");\n\t\t\n\t\t//method 5\n\t\tint res5[]=Utility.insertionSortForInteger();\n\t\tfor(int i=0;i<res5.length;i++)\n\t\t\tSystem.out.println(res5[i]);\n\t\tlong fifth=System.currentTimeMillis();\n\t\tSystem.out.println((fifth-fourth)/1000+\"seconds\");\n\t\t\n\t\t//method 6\n\t\tString res6[]=Utility.insertionSortForString();\n\t\tfor(int i=0;i<res6.length;i++)\n\t\t\tSystem.out.println(res6[i]);\n\t\tlong sixth=System.currentTimeMillis();\n\t\tSystem.out.println((sixth-fifth)/1000+\"seconds\");\n\t}", "public boolean linearIn(int[] outer, int[] inner) {\r\n int comp=0; // O(1)\r\n int count=0; // O(1)\r\n if(inner.length==0) // O(1)\r\n return true; // O(1)\r\n for(int i=0; i<outer.length; i++) { // O(n)\r\n if(outer[i]==inner[count]) { // O(1)\r\n comp++; // O(1)\r\n count++; // O(1)\r\n } else if(outer[i]>inner[count]) // O(1)\r\n return false; // O(1)\r\n if (comp==inner.length) // O(1)\r\n return true; // O(1)\r\n }\r\n return false; // O(1)\r\n}", "private static int binarySearch0(double[] a, int fromIndex, int toIndex,\n\t\t\tdouble key) {\n\t\tint low = fromIndex;\n\t\tint high = toIndex - 1;\n\n\t\twhile (low <= high) {\n\t\t\tint mid = (low + high) >>> 1;\n\t\t\t\tdouble midVal = a[mid];\n\n\t\t\t\tint cmp;\n\t\t\t\tif (midVal < key) {\n\t\t\t\t\tcmp = -1; // Neither val is NaN, thisVal is smaller\n\t\t\t\t} else if (midVal > key) {\n\t\t\t\t\tcmp = 1; // Neither val is NaN, thisVal is larger\n\t\t\t\t} else {\n\t\t\t\t\tlong midBits = Double.doubleToLongBits(midVal);\n\t\t\t\t\tlong keyBits = Double.doubleToLongBits(key);\n\t\t\t\t\tcmp = (midBits == keyBits ? 0 : // Values are equal\n\t\t\t\t\t\t(midBits < keyBits ? -1 : // (-0.0, 0.0) or (!NaN, NaN)\n\t\t\t\t\t\t\t1)); // (0.0, -0.0) or (NaN, !NaN)\n\t\t\t\t}\n\n\t\t\t\tif (cmp < 0)\n\t\t\t\t\tlow = mid + 1;\n\t\t\t\telse if (cmp > 0)\n\t\t\t\t\thigh = mid - 1;\n\t\t\t\telse\n\t\t\t\t\treturn mid; // key found\n\t\t}\n\t\treturn -(low + 1); // key not found.\n\t}", "public int binarySearch(int[] numbers, int numToSearch){\n\n QuickSort quickSort = new QuickSort();\n quickSort.sort(numbers);\n\n //Above code is tightly coupled with either of the algo to be used, we can not manage using sort algo dynamically.\n\n\n // Login to search\n\n //Return the number found\n\n return 5; //returning any hypothetical number\n }", "public static int findCommon2(int[] in1, int[] in2) {\r\n\t\tint common = 0;\r\n\t\t//iterate through the shorter array and do a binary search for every element of short array in big array\r\n\t\tif (in2.length > in1.length) {\r\n\t\t\tfindCommon2(in2, in1);\r\n\t\t}\r\n\t\t//nlogn\r\n\t\tArrays.sort(in2);\r\n\t\t//mlogn\r\n\t\tfor (int i = 0; i < in1.length; i++) {\r\n\t\t\tif(Arrays.binarySearch(in2, in1[i]) > 0) {\r\n\t\t\t\t++common;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn common;\r\n\t}", "protected int search(double value) {\n int n = sequence.size();\n int left = 0, right = n - 1, index = 0;\n while (left != right) {\n index = (right - left) / 2 + left;\n if (value >= sequence.get(index == left ? index + 1 : index)) {\n left = index == left ? index + 1 : index;\n } else {\n right = index;\n }\n }\n while (left > 0 && value == sequence.get(left - 1)) {\n left -= 1;\n }\n return left;\n }", "static void binarySearch(int mat[][], int i, int j_low, int j_high, int x){\n\t\t\n\t\twhile(j_low < j_high){\n\t\t\t\n\t\t}\n\t}", "public int Search(int key)\n {\n for(int i=0; i<n; i++)\n {\n if(a[i]==key)\n return 1;\n }\n return 0;\n }", "public static void main(String args[])\n {\n BinarySerach ob = new BinarySerach();\n int arr[] = { 2, 5, 3, 1, 7, 4 };\n\n\n // Arrays.binarySearch(arr,5);\nArrays.sort(arr);\n System.out.println(Arrays.binarySearch(arr,5));\n Arrays.sort(arr);\n int n = arr.length;\n int x = 5;\n int result = ob.binarySearch(arr, x);\n if (result == -1)\n System.out.println(\"Element not present\");\n else\n System.out.println(\"Element found at \"\n + \"index \" + result);\n }", "public static int[] binaryearch(int[] nums, int left, int right, int target) {\n int[] indexs = {-1, -1};\n if (left > right) {\n return indexs;\n }\n int middle = (right - left) / 2 + left;\n if (nums[middle] == target) {\n int[] results = new int[]{middle, middle};\n if (middle > left && nums[middle - 1] == nums[middle]) {\n //左侧还有\n int[] indexs2 = binaryearch(nums, left, middle - 1, target);\n if (indexs2[0] != -1) {\n results[0] = indexs2[0];\n }\n }\n if (middle < right && nums[middle + 1] == nums[middle]) {\n // //右侧还有\n int[] indexs2 = binaryearch(nums, middle + 1, right, target);\n if (indexs2[1] != -1) {\n results[1] = indexs2[1];\n }\n }\n return results;\n } else if (nums[middle] < target) {\n indexs = binaryearch(nums, middle + 1, right, target);\n\n } else {\n indexs = binaryearch(nums, left, middle - 1, target);\n }\n return indexs;\n\n }", "private int binarySearchQ7(int first, int last, K key)\n {\n int index;\n \n if (first > last)\n index = first; \n else \n {\n int mid = first + (last - first) / 2;\n K midKey = dictionary[mid].getKey(); \n if (key.equals(midKey))\n index = mid; \n else if (key.compareTo(midKey) < 0)\n index = binarySearchQ7(first, mid - 1, key);\n else\n index = binarySearchQ7(mid + 1, last, key);\n } \n return index;\n }", "public int binarySearch(ArrayList<Integer> a, int val){\n int low = 0;\n int high = a.size() - 1;\n \n while(high - low > 3){\n int mid = (low + high)/2;\n if(a.get(mid) > val){\n high = mid - 1;\n }\n else{\n low = mid; \n }\n }\n int i;\n for(i=low; i<=high; ++i){\n if(a.get(i) > val)\n return i;\n }\n return i;\n }", "private int searchR(Searching[] array, int start, int half, int end, int value) {\n if (value > array[end].getValue() || value < array[start].getValue()) {\n return -1;\n }\n int a = end - start;\n int b = array[end].getValue() - array[start].getValue();\n int c = value - array[start].getValue();\n int d = (c * a) / b;\n int slide = d + start;\n if (slide > end || slide < start) {\n return -1;\n }\n if (array[slide].getValue() == value) {\n return slide;\n }\n if (value < array[slide].getValue()) {\n end = slide;\n return searchR(array, start, half, end, value);\n } else {\n start = slide;\n return searchR(array, start, half, end, value);\n }\n }", "private static int binarySearch0(float[] a, int fromIndex, int toIndex,\n\t\t\tfloat key) {\n\t\tint low = fromIndex;\n\t\tint high = toIndex - 1;\n\n\t\twhile (low <= high) {\n\t\t\tint mid = (low + high) >>> 1;\n\t\tfloat midVal = a[mid];\n\n\t\tint cmp;\n\t\tif (midVal < key) {\n\t\t\tcmp = -1; // Neither val is NaN, thisVal is smaller\n\t\t} else if (midVal > key) {\n\t\t\tcmp = 1; // Neither val is NaN, thisVal is larger\n\t\t} else {\n\t\t\tint midBits = Float.floatToIntBits(midVal);\n\t\t\tint keyBits = Float.floatToIntBits(key);\n\t\t\tcmp = (midBits == keyBits ? 0 : // Values are equal\n\t\t\t\t(midBits < keyBits ? -1 : // (-0.0, 0.0) or (!NaN, NaN)\n\t\t\t\t\t1)); // (0.0, -0.0) or (NaN, !NaN)\n\t\t}\n\n\t\tif (cmp < 0)\n\t\t\tlow = mid + 1;\n\t\telse if (cmp > 0)\n\t\t\thigh = mid - 1;\n\t\telse\n\t\t\treturn mid; // key found\n\t\t}\n\t\treturn -(low + 1); // key not found.\n\t}", "public int binarySearch(int[] nums, int searchFor) {\n\t\tint[] sortedNo = this.sortAlgo.sort(nums);\n\t\treturn 3;\n\t}", "public static void main(String[] args) {\n\n Scanner sc = new Scanner(System.in);\n System.out.println(\"Enter number of elements\");\n int i = sc.nextInt();\n int[] array = new int[i];\n\n\n System.out.println(\"Enter \" + i + \" integers\");\n\n for (int c = 0; c < i; c++) {\n array[c] = sc.nextInt();\n }\n\n System.out.println(\"Enter value to find\");\n int search = sc.nextInt();\n\n MyBinarySearch mbs = new MyBinarySearch();\n Arrays.sort(array);\n System.out.println(search + \" was found at index \" + mbs.binarySearch(array, search) + \" in array \" + Arrays.toString(array));\n\n\n// MyBinarySearch mbs = new MyBinarySearch();\n// int[] arr = {2, 4, 6, 8, 10, 12, 14, 16};\n// System.out.println(\"Key 14's position: \"+mbs.binarySearch(arr, 14));\n// int[] arr1 = {6,34,78,123,432,900};\n// System.out.println(\"Key 432's position: \"+mbs.binarySearch(arr1, 432));\n }", "private int d(@Nullable K ☃) {\r\n/* 127 */ return (xq.f(System.identityHashCode(☃)) & Integer.MAX_VALUE) % this.b.length;\r\n/* */ }\r\n/* */ private int b(@Nullable K ☃, int i) {\r\n/* */ int j;\r\n/* 131 */ for (j = i; j < this.b.length; j++) {\r\n/* 132 */ if (this.b[j] == ☃) {\r\n/* 133 */ return j;\r\n/* */ }\r\n/* 135 */ if (this.b[j] == a) {\r\n/* 136 */ return -1;\r\n/* */ }\r\n/* */ }", "public Integer binSearch(Integer target, Integer[] data, Integer left, Integer right) {\n if (right - left == 1) {\n if (data[left] == target) return left;\n if (data[right] == target) return right;\n }\n if (right - left == 0) {\n if (data[left] == target) return left;\n }\n Integer midpt = (right + left) / 2 ;\n if (target == data[midpt]) return midpt ;\n if (target > data[midpt] ) return binSearch(target, data, midpt, right) ;\n if (target < data[midpt] ) return binSearch(target, data, left, midpt) ;\n\n return -1;\n }", "public static int search(int[] nums, int target) {\n\n int length = nums.length;\n int i = 0;\n int j = length - 1;\n if (length == 0) return -1;\n\n while (true) {\n int index = (i + j) / 2;\n\n int value = nums[index];\n if (value == target) return index;\n\n //Using the invariant that either i - mid OR mid-j has\n //to be sorted at any point of the computation\n if (nums[j] >= value) {\n if (target > value && target <= nums[j]) i = index;\n else if (target > value && target > nums[j]) j = index;\n else j = index;\n }\n else {\n if (target < value && target >= nums[i]) j = index;\n else if (target < value && target < nums[i]) i = index;\n else i = index;\n }\n\n if (i + 1 == j) {\n if (nums[i] == target) return i;\n if (nums[j] == target) return j;\n return -1;\n }\n\n if (i == j || i >= length || j >= length) return -1;\n }\n\n }", "static int search(int[] in, int j, int start, int end) {\n\t\tint k=start;\n\t\twhile(k<end) {\n\t\t\tif(in[k]== j) {\n\t\t\t\treturn k;\n\t\t\t}\n\t\t\tk++;\n\t\t}\n\t\treturn 0;\n\t}", "static int find(int[] arr){\n\t\tif(arr.length==1) return -1;\n\t\tint slow = arr[0] , fast = arr[arr[0]];\n\t\twhile(slow!=fast){\n\t\t\tslow = arr[slow];\n\t\t\tfast = arr[arr[fast]];\n\t\t}\n\t\tslow = 0;\n\t\twhile(slow!=fast){\n\t\t\tslow = arr[slow];\n\t\t\tfast = arr[fast];\n\t\t}\n\t\treturn slow;\n\n\t}", "@Test\n public void test2(){\n times = new ArrayList<Long>();\n for(int i = 0; i<threadnums.length; i++){\n BSTInterface tree = new LockFreeBST();\n makeThread2(tree, threadnums[i]);\n\n\n System.out.println( \"When there are \"+threadnums[i] + \"threads, there are \"+tree.getNum() + \" nodes\");\n\n long startTime=System.currentTimeMillis();\n for(int k = 0; k<100; k++)\n tree.search(totalnum/2);\n long endTime=System.currentTimeMillis();\n System.out.println( \"When there are \"+threadnums[i] + \"threads, the search takes \"+ (endTime-startTime) + \" ms\");\n }\n for(int i = 0; i<threadnums.length; i++){\n System.out.println(\"When there are \"+threadnums[i]+\" threads, \"+\"it takes \"+times.get(i)+\" ms\");\n }\n }", "private int findPos( AnyType x )\n {\n int offset = 1;\n int currentPos = myhash( x );\n \n while( array[ currentPos ] != null &&\n !array[ currentPos ].key.equals( x ) )\n {\n currentPos += offset; // Linear probing.\n if( currentPos >= array.length )\n currentPos -= array.length;\n }\n \n return currentPos;\n }", "private int BinaryReadIndexFile(String filename, ArrayList<Integer> matchingPositions, String wordToBeSearched)\n {\n try\n {\n //Initialize the file object\n File LocalInputFile = new File(filename + \".ndx\");\n\n //Try to open the index file using a Scanner\n Scanner indexFileFileScanner = new Scanner(LocalInputFile);\n\n //Get the files lines number\n int mMaxFileLines = 0;\n while(indexFileFileScanner.hasNext())\n {\n //Read every line in the file\n indexFileFileScanner.nextLine();\n mMaxFileLines++;\n }\n\n //Index to the bottom part of the search area of the file\n int bottomFilePageIndex = 0;\n \n //Index to the top part of the search area of the file\n int topFilePageIndex = mMaxFileLines;\n\n //Index to the middle data page of the search area of the file\n int middleFilePageIndex;\n \n //Counter for the data page accesses\n int dataPageAccessesCounter = 0;\n \n //Status of the search process\n int searchStatus;\n\n //Search while there are data pages to access, if topFilePageIndex is greater than bottomFilePageIndex, the search fails automatically\n while (bottomFilePageIndex <= topFilePageIndex)\n {\n //Reinitialize the FileScanner object\n indexFileFileScanner = new Scanner(LocalInputFile);\n \n //Find the middle data page index\n middleFilePageIndex = (bottomFilePageIndex + topFilePageIndex)/2;\n\n //Skip the lines until the middle point\n SkipLines(indexFileFileScanner, middleFilePageIndex);\n\n //Fetch the data page from the file\n ByteBuffer bytePageBuffer = ByteBuffer.wrap(StringToByteArrayTranslator(indexFileFileScanner.nextLine(), SizeConstants.getBufferSize()));\n\n //Execute the binary search in the page\n searchStatus = BinarySearchBytePage(wordToBeSearched,bytePageBuffer.array(), matchingPositions, filename, middleFilePageIndex);\n\n //Count the data page access\n dataPageAccessesCounter++;\n\n //If the word's to be searched length is invalid or the word is found in the page, but is neither the first or the last word in the page\n if (searchStatus == -2 || searchStatus == -1)\n {\n //Complete the binary search\n break;\n }\n else if (searchStatus == -3)\n {\n //If the search must be continued in the top part of the search area of the file\n bottomFilePageIndex = middleFilePageIndex + 1;\n }\n else if (searchStatus == -4)\n {\n //If the search must be continued in the bottom part of the search area of the file\n topFilePageIndex = middleFilePageIndex - 1;\n }\n else\n {\n //Add the new data page accesses\n dataPageAccessesCounter += searchStatus;\n\n //Complete the binary search\n break;\n }\n }\n //Close the FileScanner object\n indexFileFileScanner.close();\n\n //Return the number of the data page file accesses\n return dataPageAccessesCounter;\n }\n catch (FileNotFoundException e)\n {\n //Catch the FileNotFoundException and inform the user\n System.out.println(\"File: \" + this.Filename + \" cannot be opened.\");\n e.printStackTrace();\n return 0;\n }\n }", "public static int binarySearch(java.util.List arg0, java.lang.Object arg1)\n { return 0; }", "public static int binSearchRotatedIter(int src[], int lo, int hi, int target){\n\n while(lo<=hi){\n int mid = lo + (hi-lo)/2;\n if(src[mid]==target) return mid;\n //if bottom half is sorted\n if(src[lo]<=src[mid]){\n \n if(src[lo]<=target && target<src[mid]){\n hi=mid-1;\n }else{\n lo=mid+1;\n }\n }\n //if upper half is sorted\n else{\n if(src[mid]<target && target<=src[hi]){\n lo=mid+1;\n }else{\n hi=mid-1;\n }\n }\n }\n return -1;\n}", "abstract public void search();", "private int binarySearchByIndex(List<Span> spans, int index){\n int left = 0,right = spans.size() - 1,mid,row;\n int max = right;\n while(left <= right){\n mid = (left + right) / 2;\n if(mid < 0) return 0;\n if(mid > max) return max;\n row = spans.get(mid).startIndex;\n if(row == index) {\n return mid;\n }else if(row < index){\n left = mid + 1;\n }else{\n right = mid - 1;\n }\n }\n int result = Math.max(0,Math.min(left,max));\n while(result > 0) {\n if(spans.get(result).startIndex > index) {\n result--;\n }else{\n break;\n }\n }\n while(result < right) {\n if(getSpanEnd(result,spans) < index) {\n result++;\n }else{\n break;\n }\n }\n return result;\n }", "public static void useBinarySearch1() {\n int[] numbers = {-3, 2, 8, 12, 17, 29, 44, 58, 79};\n int index = Arrays.binarySearch(numbers, 29);\n System.out.println(\"29 is found at index \" + index);\n }", "public int binarySearch(int[] nums, int target, int left, int right) {\n int res = left - 1;\n while (left <= right) {\n int mid = left + (right - left) / 2;\n if (nums[mid] <= target) {\n right = mid - 1;\n } else {\n res = mid;\n left = mid + 1;\n }\n }\n return res;\n }", "public HashMap<String, Double> search(String query) {\n // ===================================================\n // 1. Fetch all inverted lists corresponding to terms\n // in the query.\n // ===================================================\n String[] terms = query.split(\" \");\n HashMap<String, Integer> qf = new HashMap<String, Integer>();\n // Calculate term frequencies in the query\n for (String term : terms) {\n if (qf.containsKey(term))\n qf.put(term, qf.get(term) + 1);\n else\n qf.put(term, 1);\n }\n HashMap<String, Double> docScore = new HashMap<String, Double>();\n for (Entry<String, Integer> termEntry : qf.entrySet()) {\n String term = termEntry.getKey();\n int qfi = termEntry.getValue();\n\n // ===================================================\n // 2. Compute BM25 scores for documents in the lists.\n // Make a score list for documents in the inverted\n // lists. Assume that no relevance information is \n // available. For parameters, use k1=1.2, b=0.75, \n // k2=100.\n // ===================================================\n double k1 = 1.2;\n double b = 0.75;\n double k2 = 100;\n int ni = invIndex.get(term).size();\n\n\n for (Entry<String, IndexEntry> invListEntry : invIndex.get(term).entrySet()) {\n String docID = invListEntry.getKey();\n double bm25Score;\n if (docScore.containsKey(docID))\n bm25Score = docScore.get(docID);\n else\n bm25Score = 0;\n\n // length of the document\n int dl = docStat.get(docID);\n // frequency of the term in the document\n int fi = invListEntry.getValue().getTf();\n double K = k1 * ((1 - b) + b * ((double) dl / avdl));\n\n // ===================================================\n // 3. Accumulate scores for each term in a query\n // on the score list.\n // ===================================================\n bm25Score += Math.log((N - ni + 0.5) / (ni + 0.5))\n * (((k1 + 1) * fi * (k2 + 1) * qfi) / ((K + fi) * (k2 + qfi)));\n docScore.put(docID, bm25Score);\n }\n }\n\n return docScore;\n }", "public static void checkSpeed(int testSize) {\r\n\t\tSystem.out.println(\"Beginning checkSpeed indexOf test of size \" + testSize);\r\n\t\t\r\n\t\t// keep track of starting time before constructing\r\n\t\tlong start = System.currentTimeMillis();\r\n\t\t\r\n\t\t// fill up the list with even numbers\r\n\t\tint dot = testSize / 10;\r\n\t\tSortedIntList list = new SortedIntList(false, testSize);\r\n\t\tSystem.out.print(\" Building list of the first \" + testSize + \" multiples of 2: \");\r\n\t\tboolean addTooSlow = false;\r\n\t\tfor (int i = 0; i < testSize; i++) {\r\n\t\t\tlist.add(2 * i);\r\n\t\t\tif (i % dot == 0) {\r\n\t\t\t\tSystem.out.print(\".\");\r\n\t\t\t}\r\n\t\t\tif (!addTooSlow && System.currentTimeMillis() >= start + testSize / 20) {\r\n\t\t\t\tSystem.out.print(\" (add is too slow) \");\r\n\t\t\t\taddTooSlow = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\t\tdouble elapsed = (System.currentTimeMillis() - start)/1000.0;\r\n\t\t// System.out.println(\" construction took \" + elapsed + \" seconds\");\r\n\t\t\r\n\t\t// keep track of starting time before indexOf tests\r\n\t\tSystem.out.print(\" Checking indexOf each element: \");\r\n\t\tstart = System.currentTimeMillis();\r\n\t\tdot = testSize / 10;\r\n\t\tfor (int i = 0; i < testSize; i++) {\r\n\t\t\tfor (int j = 0; j < 100; j++) {\r\n\t\t\t\tint actualIndex = list.indexOf(2 * i);\r\n\t\t\t\tif (actualIndex != i) {\r\n\t\t\t\t\tSystem.out.println();\r\n\t\t\t\t\tthrow new RuntimeException(\r\n\t\t\t\t\t\"\\n\\nindexOf \" + 2 * i + \" should have returned: \" +\r\n\t\t\t\t\ti + \",\\n but your method actually returned: \" +\r\n\t\t\t\t\tactualIndex + \"\\n\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (System.currentTimeMillis() >= start + testSize / 5) {\r\n\t\t\t\tSystem.out.println();\r\n\t\t\t\tthrow new RuntimeException(\r\n\t\t\t\t\"\\n\\nindexOf appears to be running too slowly.\\n\");\r\n\t\t\t}\r\n\t\t\tif (i % dot == 0) {\r\n\t\t\t\tSystem.out.print(\".\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tdouble elapsed2 = (System.currentTimeMillis() - start)/1000.0;\r\n\t\tif (addTooSlow) {\r\n\t\t\tSystem.out.println();\r\n\t\t\tthrow new RuntimeException(\r\n\t\t\t\"\\n\\nYour add method appears to have run too slowly. (runtime: \" + elapsed + \" seconds)\\n\");\r\n\t\t}\r\n\t\tSystem.out.println(\"\\n Passed! (runtime: \" + elapsed2 + \" seconds)\\n\");\r\n\t}", "public int binarySearch(int[] nums, int target) {\n // write your code here\n if (nums == null || nums.length == 0) return -1;\n int start = 0, end = nums.length - 1;\n while (start + 1 < end) {\n int mid = start + (end - start) / 2;\n if (nums[mid] == target) {\n end = mid;\n }\n else if (nums[mid] < target) {\n start = mid;\n }\n else {\n end = mid;\n }\n }\n if (nums[start] == target) return start;\n if (nums[end] == target) return end;\n return -1;\n }", "public void search(String word)\r\n\t{\r\n\t\tHashtable<String, Integer> hashtable = new Hashtable<String, Integer>();\r\n\t\tFile dir = new File(\"C:\\\\Users\\\\jayad\\\\eclipse-workspace\\\\Search Engine\\\\src\\\\Webpages\\\\Text\\\\\");\r\n\t\tFile[] fileArray = dir.listFiles();\r\n\t\tint repeats = 0; // No. of times the searched word repeated in a same file\r\n\t\tint numofFiles = 0; // No. of files that contains the Searched word\r\n\t\ttry\r\n\t\t{\r\n\t\t\tdouble startTime = System.nanoTime();\r\n\t\t\tdouble startTimesearch = System.nanoTime();\r\n\t\t\tfor (int i = 1; i < fileArray.length; i++)\r\n\t\t\t{\r\n\t\t\t\trepeats = searchWord(fileArray[i], word);\r\n\t\t\t\thashtable.put(fileArray[i].getName(), repeats);\r\n\t\t\t\tif (repeats != 0)\r\n\t\t\t\t{\r\n\t\t\t\t\tnumofFiles++;\r\n\t\t\t\t\tif (fileArray[i].getName().toString().substring(0, 3) == \"null\")\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tfileArray[i].getName().toString();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"\\nNumber of files containing the word '\" + word + \"' is = \" + numofFiles);\r\n\t\t\tlong endTimesearch = System.nanoTime();\r\n\t\t\tdouble srchtime = endTimesearch - startTimesearch;\r\n\t\t\tSystem.out.println(\"\\nSeacrh Result execution time: \" + srchtime/1000000 + \" Milli Seconds\");\r\n\t\t\tif (numofFiles == 0)\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"\\nSearching closely related words\");\r\n\t\t\t\tsuggestword(word);\r\n\t\t\t}\r\n//\t\t\tSystem.out.println(\"\\nFor Synonyms of the word \"+ p+\" enter yes or no\");\r\n//\t\t\tString o =s1.nextLine();\r\n//\t\t\tif(o.equals(\"yes\")) {\r\n//\t\t\t\t\r\n//\t\t System.out.println(\"\\nSearching synonyms\");\r\n//\t\t \r\n//\t\t\t\twebsearch.suggestions(word);\t\r\n//\t\t\t\t\r\n//\t\t\t}\r\n\t\t\t\tdouble rankstart = System.nanoTime();\r\n\t\t\t\t\trank(hashtable, numofFiles);\r\n\t\t\t\tdouble rankend = System.nanoTime();\r\n\t\t\t\tdouble rankingTime = rankend - rankstart;\r\n\t\t\tSystem.out.println(\"\\nRanking Algorithm time: \" + rankingTime + \" nano Seconds\");\r\n\t\t\t\r\n\t\t\tdouble endTime = System.nanoTime();\r\n\t\t\tSystem.out.println(\"\\nTotal Execution Time: \" + (endTime - startTime)/1000000 + \" Milli Seconds\");\r\n\t\t}\r\n\t\tcatch (Exception e)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Exception:\" + e);\r\n\t\t}\r\n\t}", "public int searchCyc(int[] nums) {\n int lo = 0;\n int hi = nums.length - 1;\n\n while (lo < hi) {\n int mid = (lo + hi) / 2;\n if (nums[mid] > nums[hi]) {\n lo = mid + 1;\n } else { //\n hi = mid;\n }\n }\n\n //Loop ends when left == right\n return lo;\n}", "public static int f2(int N) { \n int x = 0; //O(1)\n for(int i = 0; i < N; i++) // O(n)\n // O(n)`\n for(int j = 0; j < i; j++) \n x++;\n return x;\n }", "private int binarySearchReference(String searchForThisWord2, String[] x)\n\t{\n\t\tint wordCounter = Arrays.binarySearch(x, searchForThisWord2);\t//creates an int called wordCounter that will look throu\n\t\twordCounter = wordCounter > 0 ? wordCounter : 1;\t//Gives properties to wordCounter. The first element (a) will be represented as 1\n\t\tSystem.out.println(\"The word \" + searchForThisWord2 + \"'s position in the English Dictionary is \" + wordCounter);\t//print statement\n\t\treturn wordCounter;\t//return the method\n\t}", "public abstract ParameterVector searchVector();", "public boolean search(int[] nums, int target) {\n if (nums == null || nums.length == 0) return false;\n int l = 0;\n int r = nums.length - 1;\n int m;\n while (l <= r) {\n m = (l + r) / 2; \n if (nums[m] == target) return true;\n int low, high;\n if (nums[m] >=nums[l]) {\n if(nums[m] == nums[l]){\n l++;\n }\n else{\n if (nums[l] <= target && target < nums[m]) {\n r = m - 1;\n }\n else {\n l = m + 1;\n }\n }\n }\n else {\n if (nums[m] == nums[r]){\n r--;\n } \n else{\n if (nums[m] < target && target <= nums[r]) {\n l = m + 1;\n }\n else {\n r = m - 1;\n }\n }\n }\n }\n return false;\n }", "public int linSearch(Comparable c){\n\tfor (int i = 0; i < _size;i++){\n\t if (c.compareTo(_data[i]) == 0){\n\t\treturn i;\n\t }\n\t}\n\treturn -1;\n }", "void search();", "void search();", "protected int binarySearch(int x) {\n if (arr.length == 0) {\n return -1;\n }\n\n int left = 0;\n int right = count - 1;\n\n while (left <= right) {\n int mid = (right + left) >>> 1;\n int val = arr[mid];\n\n if (val < x) {\n left = mid + 1;\n } else if (val > x) {\n right = mid - 1;\n }\n else {\n return mid;\n }\n }\n\n return -1;\n }", "public static void main(String[] args) {\n SearchTree search = new SearchTree(new Node(INITIAL_STATE), GOAL_STATE);\n long startTime = System.currentTimeMillis();\n\n search.breadthFirstSearch();\n// search.depthFirstSearch();\n// search.iterativeDeepening(10);\n\n long finishTime = System.currentTimeMillis();\n long totalTime = finishTime - startTime;\n System.out.println(\"\\n[Elapsed time: \" + totalTime + \" milliseconds]\");\n System.out.println(\"========================================================\");\n }", "@SuppressWarnings(\"unchecked\")\n\tpublic JSONArray findMatches(String query){\n\t\t\n\t\t// Increment the search tasks counter\n\t\t++numOfSearchTasks;\n\t\t\n\t\t// Start the timer for this task\n\t\tTimer.start();\n\t\t\n\t\t// Number of needed matches\n\t\tresultsToBeFound = 10;\n\t\t\n\t\t// Clear the matches list\n\t\tsetForTypeahead.clear();\n\t\t\n\t\t// The returned JSON array\n\t\tJSONArray arrayObj = new JSONArray();\n\t\t\n\t\t// Search in all predicates\n\t\tfor(int i = 0; i < predicatesList.size(); ++i){\n\t\t\tif(predicatesList.get(i).toLowerCase().contains(query.toLowerCase())){\n\t\t\t\tarrayObj.add(predicatesList.get(i));\n\t\t\t}\n\t\t\tArrayList<String> semanticRelations = semanticRelationsMap.get(query.toLowerCase());\n\t\t\tif(semanticRelations != null) {\n\t\t\t\tfor(String s : semanticRelations) {\n\t\t\t\t\tif(predicatesList.get(i).toLowerCase().contains(s.toLowerCase())){\n\t\t\t\t\t\tarrayObj.add(predicatesList.get(i));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Start the timer for this task\n\t\tTimer.start();\n\t\t\n\t\t// Search in index first\n\t\tCollection<Integer> list = in.search(query.toLowerCase());\n\t\tHashSet<Integer> output = null;\n\t\tif(list.size() > 0) {\n\t\t\toutput = (HashSet<Integer>) list;\n\t\t}\n\t\telse {\n\t\t\toutput = new HashSet<Integer>();\n\t\t}\n\n\t\t// If found a match, that's a hit\n\t\tif(output.size() > 0) {\n\t\t\t++numOfIndexHits;\n\t\t}\n\t\t\n\t\tfor(Integer index : output) {\n\t\t\tarrayObj.add(frequentLiteralsList.get(index));\n \t\t--resultsToBeFound;\n \t}\n\t\tdouble tempStopTime;\n\t\t// If all results were found in suffix tree\n\t\tif(resultsToBeFound < 0) {\n\t\t\tTimer.stop();\n\t\t\tsuffixTreeTime += Timer.getTimeInSeconds();\n\t\t\ttotalTime += Timer.getTimeInSeconds();\n\t\t\twriteStatsToFile();\n\t\t\treturn arrayObj;\n\t\t}\n\t\t\n\t\tTimer.stop();\n\t\tsuffixTreeTime += Timer.getTimeInSeconds();\n\t\ttempStopTime = Timer.getTimeInSeconds();\n\t\tTimer.start();\n\t\t// In length bins\n\t\t// Search in bins with a minimum length of the query\n\t\t// and a maximum of the query length + 10\n\t\tint minLength = query.length()-1;\n\t\tint maxLength = query.length() + 9;\n\t\t\n\t\tint minIndex = Integer.MAX_VALUE;\n\t\tint maxIndex = -1;\n\t\t\n\t\t// Determine which indices of the literals array\n\t\t// to search within\n\t\tfor(int i = 0; i < lengths.size(); ++i){\n\t\t\tif(lengths.get(i) > maxLength) {\n\t\t\t\tmaxIndex = indexes.get(i);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif(minLength >= lengths.get(i)) {\n\t\t\t\tminIndex = indexes.get(i);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpruningPercentage += 1 - (1.0 * (maxIndex - minIndex) / literalsList.size());\n\t\ttry{\n\t\tSystem.out.println(\"Searching for \" + query + \" between indeces: \" + minIndex + \n\t\t\t\t\" corresponding to length \" + (literalsList.get(minIndex).length()-5) +\n\t\t\t\t\" and \" + maxIndex + \" corresponding to length \" + \n\t\t\t\t(literalsList.get(maxIndex).length()-5));\n\t\t}\n\t\tcatch(IndexOutOfBoundsException e) {\n\t\t\tSystem.out.println(\"query = \" + query);\n\t\t\tSystem.out.println(\"minIndex = \" + minIndex);\n\t\t\tSystem.out.println(\"maxIndex = \" + maxIndex);\n\t\t}\n\t\t\n\t\t// Assign threads to search tasks\n\t\tint indexesPerThread = (maxIndex - minIndex) / (numOfCores);\n\t\t\n\t\t// Arraylist to keep track of threads\n\t\tArrayList<Thread> threads = new ArrayList<Thread>();\n\t\t\n\t\tfor(int i = minIndex; i < maxIndex; i += indexesPerThread) {\n\t\t\tthreads.add(new Thread(new SearchTask(i, i + indexesPerThread, query)));\n\t\t}\n\t\t\n\t\t// Start threads\n\t\tfor(int i = 0; i < threads.size(); ++i) {\n\t\t\tthreads.get(i).start();\n\t\t}\n\t\t\n\t\t// Join threads before continue\n\t\tfor(int i = 0; i < threads.size(); ++i) {\n\t\t\ttry {\n\t\t\t\tthreads.get(i).join();\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Stop timer\n\t\tTimer.stop();\n\t\ttotalTime += tempStopTime + Timer.getTimeInSeconds();\n\t\t\n\t\t// Sort by length\n\t\tArrayList<String> tempList = new ArrayList<String>();\n\t\tfor(String string : setForTypeahead) {\n\t\t\tif(!arrayObj.contains(string))\n\t\t\t\ttempList.add(string);\n\t\t}\n\t\tjava.util.Collections.sort(tempList, new LengthComparator());\n\t\t\n\t\t// Fill the array\n\t\tfor(int i = 0; i < tempList.size() && resultsToBeFound > 0; ++i, --resultsToBeFound) {\n\t\t\tarrayObj.add(tempList.get(i));\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t// Update the stats file with number of tasks and hits\n\t\twriteStatsToFile();\n\t\t\n\t\treturn arrayObj;\n\t}", "private static int search(int[] arr, int n, int x, int k) {\n\t\tint i = 0;\n\t\twhile (i < n) {\n\n\t\t\t// If x is found at index i\n\t\t\tif (arr[i] == x)\n\t\t\t\treturn i;\n\n\t\t\t// Jump the difference between\n\t\t\t// current array element and x\n\t\t\t// divided by k We use max here\n\t\t\t// to make sure that i moves\n\t\t\t// at-least one step ahead.\n\t\t\ti = i + Math.max(1, Math.abs(arr[i] - x) / k);\n\n\t\t}\n\n\t\tSystem.out.println(\"number is not\" + \" present!\");\n\n\t\treturn -1;\n\t}", "public int searchBigSortedArray(ArrayReader reader, int target) {\n int start = 0, end = start + 2;\n while (start + 1 < end) {\n int mid = start + (end - start) / 2;\n if (reader.get(mid) < target) {\n start = mid;\n end *= 2;\n }\n else {\n end = mid;\n }\n }\n if (reader.get(start) == target) return start;\n if (reader.get(end) == target) return end;\n return -1;\n }", "private static int binary_Search(int[] arr, int target) {\n\n\t\tint low = 0;\n\t\tint high = arr.length - 1;\n\n\t\twhile (low <= high) {\n\n\t\t\tint mid = low + (high - low) / 2;\n\t\t\tSystem.out.println(\"low = \" + low + \" mid = \" + mid + \" high =\" + high);\n\t\t\tif (arr[mid] == target) {\n\t\t\t\treturn mid;\n\t\t\t}\n\t\t\tif (arr[mid] < target) {\n\t\t\t\tlow = mid + 1;\n\n\t\t\t} else {\n\t\t\t\thigh = mid - 1;\n\t\t\t}\n\n\t\t\t// System.out.println(\"low = \" + low + \" high =\" + high);\n\t\t}\n\t\treturn -1;\n\t}", "public void linSearch(int current) {\r\n long average1 = 0, timeA = 0, stanDev = 0;\r\n System.out.println(\"\\nLINEAR SEARCH\\n\");\r\n for (int i = 0; i < 10; i++) {\r\n long start = System.nanoTime();\r\n for (int j = 10000000; A[j] >= current; j--) {\r\n if (current == A[j]) {\r\n long stop = System.nanoTime();\r\n long timelength = (stop - start);\r\n timeA += timelength;// USED FOR GETTING AVERAGE. \r\n lin[g][i] = timelength;//USED FOR STORING THE TIME IT TOOK FOR EACH TEST, IT IS USED LATER ON TO DISPLAY IN THE CHART.\r\n linear[i] = timelength;//USED FOR FINDING STANDARD DEVIATION.\r\n System.out.println(\"The number: \" + current + \" was found at index: \" + A[j] + \".\\n\"\r\n + \"It took: \" + timelength + \" nanoseconds.\");\r\n }\r\n }\r\n }\r\n average1 = (timeA / 10);\r\n linAvAndDev[h][0] = average1;//STORES THE AVEARGE FOR THE TESTS RUNS AND USED FOR THE CHART.\r\n for (int i = 0; i < 10; i++) {\r\n stanDev += Math.pow((linear[i] - average1), 2.0);\r\n }\r\n stanDev /= 10;\r\n stanDev = (long) Math.sqrt(stanDev);\r\n linAvAndDev[h][1] = stanDev;//STORES THE STANDARD DEVIATION AND IS USED FOR THE CHART. MIGHT NOT BE WORKING CORRECTLY.\r\n System.out.println(\"The Avearge time for the Linear Search was: \" + average1 + \" nanoseconds.\"\r\n + \"\\nThe Standard Deviation time for the Linear Search was: \" + stanDev + \" nanoseconds.\");\r\n g += 1;//USED FOR GOING THROUGH THE OBJECT ARRAY TO STORE INFORMATION.\r\n h += 1;\r\n }", "private static boolean binarySearch(String exWord) {\n\t\tint bot = 0;\n\t\tint top = DaleChallWords.getDaleChall().length;\t\n\t\tint mid;\n\t\twhile(bot <= top) {\n\t\t\tmid = (top + bot)/2;\n\t\t\tif(Concurrency.levenshtein(DaleChallWords.getDaleChall()[mid], exWord) > 2) {\n\t\t\t\tif(exWord.compareToIgnoreCase(DaleChallWords.getDaleChall()[mid]) < 0) {\n\t\t\t\t\t\ttop = mid -1;\n\t\t\t\t}\n\t\t\t\telse if(exWord.compareToIgnoreCase(DaleChallWords.getDaleChall()[mid]) > 0) { \n\t\t\t\t\tbot = mid +1;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "private int binarySearch(int[] array, int left, int right, int target) {\n\t\tif (left > right) {\n\t\t\treturn -1;\n\t\t}\n\t\twhile (left <= right) {\n\t\t\tint mid = left + (right - left) / 2;\n\t\t\tif (array[mid] == target) {\n\t\t\t\treturn mid;\n\t\t\t} else if (array[mid] < target) {\n\t\t\t\tleft = mid + 1;\n\t\t\t} else {\n\t\t\t\tright = mid - 1;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}", "public static int binary_search(int[] array, int n, int value)\n {\n int low = 0;\n while (low <= n) {\n int middle = (low + n) / 2;\n if (value == array[middle]) {\n return middle;\n }\n else if (value < array[middle]) {\n n = middle - 1;\n }\n else {\n low = middle + 1;\n }\n }\n return -1;\n \n }", "private int binarySearch(int[] r6, int r7, boolean r8) {\n /*\n r5 = this;\n int r0 = r6.length\n int r0 = r0 + -1\n r1 = 0\n r2 = r0\n r0 = 0\n L_0x0006:\n if (r0 > r2) goto L_0x001d\n int r3 = r0 + r2\n int r3 = r3 / 2\n r4 = r6[r3]\n if (r7 != r4) goto L_0x0011\n return r3\n L_0x0011:\n r4 = r6[r3]\n if (r7 >= r4) goto L_0x0019\n int r3 = r3 + -1\n r2 = r3\n goto L_0x0006\n L_0x0019:\n int r3 = r3 + 1\n r0 = r3\n goto L_0x0006\n L_0x001d:\n if (r2 >= 0) goto L_0x0020\n return r1\n L_0x0020:\n if (r8 == 0) goto L_0x002a\n int r7 = r2 + 1\n int r6 = r6.length\n int r6 = r6 + -1\n if (r7 > r6) goto L_0x002a\n goto L_0x002b\n L_0x002a:\n r7 = r2\n L_0x002b:\n return r7\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.taobao.tao.util.TaobaoImageUrlStrategy.binarySearch(int[], int, boolean):int\");\n }", "public boolean containsNearbyDuplicate2(int[] nums, int k) {\n\n int max = Integer.MIN_VALUE;\n for (int i = 0; i < nums.length; i++) {\n max=Math.max(max,nums[i]);\n }\n Integer[] map = new Integer[max+1];\n for (int i = 0; i < nums.length; i++) {\n Integer c = map[nums[i]];\n if(c!=null && i-c<=k){\n return true;\n }else {\n map[nums[i]]=i;\n }\n }\n return false;\n }", "private static int search(int[] arr, int findMe, int left, int right) {\n\t\tif (left > right) {\n\t\t\treturn FAILURE;\n\t\t}\n\t\tint mid = (left + right) / 2;\n\t\tif (findMe == arr[mid]) {\n\t\t\treturn mid;\n\t\t}\n\t\telse if (findMe < arr[mid]) {\n\t\t\treturn search(arr, findMe, left, mid - 1);\n\t\t}\n\t\telse {\n\t\t\treturn search(arr, findMe, mid + 1, right);\n\t\t}\n\t}", "@Test\n public void testBinarySearch() {\n int actualResult = binarySearch.BinarySearch(new int[]{2,4,5}, 5);\n // check if the value is correct\n assertEquals(5, actualResult);\n }", "static int binarySearch(@NotNull int[] search, int find) {\n int start, end, midPt;\n start = 0;\n end = search.length - 1;\n\n while (start <= end) {\n midPt = (start + end) / 2;\n if (search[midPt] == find) {\n return midPt;\n } else if (search[midPt] < find) {\n start = midPt + 1;\n } else {\n end = midPt - 1;\n }\n }\n\n return -1;\n }", "private int binaryFind(K key) {\n int sortedCount = this.sortedCount.get();\n // if there are no sorted keys, or the first item is already larger than key -\n // return the head node for a regular linear search\n if ((sortedCount == 0) || comparator.compareKeyAndSerializedKey(key, readKey(FIRST_ITEM)) <= 0) {\n return HEAD_NODE;\n }\n\n // optimization: compare with last key to avoid binary search\n if (comparator.compareKeyAndSerializedKey(key, readKey((sortedCount - 1) * FIELDS + FIRST_ITEM)) > 0) {\n return (sortedCount - 1) * FIELDS + FIRST_ITEM;\n }\n\n int start = 0;\n int end = sortedCount;\n\n while (end - start > 1) {\n int curr = start + (end - start) / 2;\n\n if (comparator.compareKeyAndSerializedKey(key, readKey(curr * FIELDS + FIRST_ITEM)) <= 0) {\n end = curr;\n } else {\n start = curr;\n }\n }\n\n return start * FIELDS + FIRST_ITEM;\n }", "@Test\n public void test1(){\n times = new ArrayList<Long>();\n for(int i = 0; i<threadnums.length; i++){\n BSTInterface tree = new LockFreeBST();\n makeThread1(tree, threadnums[i]);\n\n System.out.println( \"When there are \"+threadnums[i] + \" threads, there are \"+tree.getNum() + \" nodes\");\n\n long startTime=System.currentTimeMillis();\n for(int k = 0; k<100; k++)\n tree.search(totalnum/2);\n long endTime=System.currentTimeMillis();\n System.out.println( \"When there are \"+threadnums[i] + \"threads, the search takes \"+ (endTime-startTime) + \" ms\");\n }\n for(int i = 0; i<threadnums.length; i++){\n System.out.println(\"When there are \"+threadnums[i]+\" threads, \"+\"it takes \"+times.get(i)+\" ms\");\n }\n }", "public int BinarySearch(Object[] a, int size, Object key) {\n int start = 0;\n int end = size - 1;\n while (start < end) {\n int mid = (start + size) / 2;\n if (key.equals(a[mid])) {\n return mid;\n } else if (((Comparable) key).compareTo(a[mid]) > 0) {\n start = mid + 1;\n } else {\n end = mid - 1;\n }\n }\n return -1;\n }" ]
[ "0.7002095", "0.6823389", "0.6705069", "0.6633111", "0.6425044", "0.63302964", "0.63262224", "0.61992353", "0.61926943", "0.61789715", "0.61580247", "0.60528994", "0.6036464", "0.6018803", "0.6005085", "0.5978313", "0.5964652", "0.59593827", "0.59370273", "0.58929515", "0.58776724", "0.5837328", "0.58242285", "0.5822752", "0.579841", "0.5791461", "0.576906", "0.5761517", "0.5751972", "0.5741087", "0.57384574", "0.5738371", "0.572486", "0.57190394", "0.57167864", "0.56871074", "0.5675759", "0.56755733", "0.5665191", "0.56613755", "0.56458855", "0.56199974", "0.56134915", "0.56088096", "0.5605692", "0.5605144", "0.56045824", "0.5604424", "0.5598333", "0.5595726", "0.55942535", "0.55778104", "0.55640507", "0.5560316", "0.55512506", "0.55354613", "0.55293834", "0.5521132", "0.55179405", "0.5512752", "0.5511763", "0.5511404", "0.5508347", "0.550514", "0.55016035", "0.54974985", "0.54968935", "0.5495059", "0.54899055", "0.54844254", "0.54827195", "0.5475129", "0.54744536", "0.5472356", "0.54645187", "0.5462485", "0.5461905", "0.5461209", "0.54546696", "0.54493374", "0.54488343", "0.5442655", "0.5442655", "0.5440106", "0.54378587", "0.5435211", "0.5431528", "0.54305506", "0.5430026", "0.5425854", "0.5418453", "0.5418354", "0.5418236", "0.5409506", "0.54084104", "0.54056734", "0.54024816", "0.54021543", "0.54018086", "0.5401188", "0.5394684" ]
0.0
-1
Recursive Implementation of Binary Search
private int binarySearchRecursive(int[] array,int target,int left,int right) { if (left > right) return -1; int middle = (left + right) / 2; if (array[middle] == target) return middle; if (array[middle] < target) return binarySearchRecursive(array,target,middle+1,right); return binarySearchRecursive(array, target,left,middle-1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int binarySearchWithRecursion(int[] arr, int low, int high, int key){\n if (high < low)\n return -1;\n int mid = (low + high) / 2;\n if (key == arr[mid])\n return mid;\n if (key > arr[mid])\n return binarySearchWithRecursion(arr,(mid + 1), high, key);\n return binarySearchWithRecursion(arr, low, (mid - 1), key);\n }", "private static int binarySearchRecursively(int[] sortedArray, int input, int first, int last) {\n int mid = (first + last) / 2;\n\n if (last < first) {\n return -1;\n }\n if (input == sortedArray[mid]) {\n return mid;\n } else if (input < sortedArray[mid]) {\n return binarySearchRecursively(sortedArray, input, last, mid - 1);\n } else {\n return binarySearchRecursively(sortedArray, input, mid + 1, last);\n }\n }", "private int binarySearch(int[] array, int left, int right, int target) {\n\t\tif (left > right) {\n\t\t\treturn -1;\n\t\t}\n\t\twhile (left <= right) {\n\t\t\tint mid = left + (right - left) / 2;\n\t\t\tif (array[mid] == target) {\n\t\t\t\treturn mid;\n\t\t\t} else if (array[mid] < target) {\n\t\t\t\tleft = mid + 1;\n\t\t\t} else {\n\t\t\t\tright = mid - 1;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}", "public int binarySearchRecursion(int key, int first, int last) {\n if (first <= last) {\n int mid = (first + last) / 2;\n if (key == arr[mid]) return mid;\n else if (key < arr[mid]) return binarySearchRecursion(key, first, mid - 1);\n else return binarySearchRecursion(key, mid + 1, last);\n }\n return -1;\n }", "@Test\n\tpublic void testBinarySearch() {\n\t\tint[] arr0 = {0, 1, 2, 3, 4, 5};\n\t\tassertEquals(0, _01_BinarySearch.binarySearch(arr0, 0, arr0.length - 1, 0));\n\t\tassertEquals(1, _01_BinarySearch.binarySearch(arr0, 0, arr0.length - 1, 1));\n\t\tassertEquals(2, _01_BinarySearch.binarySearch(arr0, 0, arr0.length - 1, 2));\n\t\tassertEquals(3, _01_BinarySearch.binarySearch(arr0, 0, arr0.length - 1, 3));\n\t\t\n\t\tassertEquals(-1, _01_BinarySearch.binarySearch(arr0, 0, arr0.length - 1, 99));\n\t\t\n\t\tint[] arr1 = {0, 43, 209, 388, 401, 599};\n\t\tassertEquals(2, _01_BinarySearch.binarySearch(arr1, 0, arr0.length - 1, 209));\n\t\tassertEquals(-1, _01_BinarySearch.binarySearch(arr1, 0, arr0.length - 1, 45));\n\t}", "abstract int binSearch(int[] array, int num, int left, int right);", "private static int search(int[] arr, int findMe, int left, int right) {\n\t\tif (left > right) {\n\t\t\treturn FAILURE;\n\t\t}\n\t\tint mid = (left + right) / 2;\n\t\tif (findMe == arr[mid]) {\n\t\t\treturn mid;\n\t\t}\n\t\telse if (findMe < arr[mid]) {\n\t\t\treturn search(arr, findMe, left, mid - 1);\n\t\t}\n\t\telse {\n\t\t\treturn search(arr, findMe, mid + 1, right);\n\t\t}\n\t}", "static int binarySearch(int arr[], int l, int r, int x) {\n if (r >= l) { \r\n int mid = l + (r - l) / 2; \r\n if (arr[mid] == x) \r\n return mid; \r\n \r\n if (arr[mid] > x) \r\n return binarySearch(arr, l, mid - 1, x); \r\n \r\n \r\n return binarySearch(arr, mid + 1, r, x); \r\n } \r\n \r\n \r\n return -1; \r\n }", "public int binarySearch(int[] nums, int target, int left, int right) {\n int res = left - 1;\n while (left <= right) {\n int mid = left + (right - left) / 2;\n if (nums[mid] <= target) {\n right = mid - 1;\n } else {\n res = mid;\n left = mid + 1;\n }\n }\n return res;\n }", "public Integer binSearch(Integer target, Integer[] data, Integer left, Integer right) {\n if (right - left == 1) {\n if (data[left] == target) return left;\n if (data[right] == target) return right;\n }\n if (right - left == 0) {\n if (data[left] == target) return left;\n }\n Integer midpt = (right + left) / 2 ;\n if (target == data[midpt]) return midpt ;\n if (target > data[midpt] ) return binSearch(target, data, midpt, right) ;\n if (target < data[midpt] ) return binSearch(target, data, left, midpt) ;\n\n return -1;\n }", "public int binarySearchIterative(int[] array,int target) {\n var left = 0;\n var right = array.length -1;\n while (left <= right) {\n int middle = (left + right) / 2;\n if (array[middle] == target)\n return middle;\n if (array[middle] < target)\n left = middle + 1;\n else\n right = middle - 1;\n }\n return -1;\n }", "private static int binary_Search(int[] arr, int target) {\n\n\t\tint low = 0;\n\t\tint high = arr.length - 1;\n\n\t\twhile (low <= high) {\n\n\t\t\tint mid = low + (high - low) / 2;\n\t\t\tSystem.out.println(\"low = \" + low + \" mid = \" + mid + \" high =\" + high);\n\t\t\tif (arr[mid] == target) {\n\t\t\t\treturn mid;\n\t\t\t}\n\t\t\tif (arr[mid] < target) {\n\t\t\t\tlow = mid + 1;\n\n\t\t\t} else {\n\t\t\t\thigh = mid - 1;\n\t\t\t}\n\n\t\t\t// System.out.println(\"low = \" + low + \" high =\" + high);\n\t\t}\n\t\treturn -1;\n\t}", "public static int binarySearch(java.util.List arg0, java.lang.Object arg1)\n { return 0; }", "int binarySearch(int[] arr, int low, int high, int key){\n while(low <= high){\n int mid = (low + high) / 2;\n if (key < arr[mid])\n high = mid - 1;\n else if (key > arr[mid])\n low = mid + 1;\n else\n return mid;\n }\n return -1;\n }", "@Test\n\tpublic void testBinarySearch() {\n\t\tint[] numbers = {0, 1, 2, 3, 4, 5, 6};\n\t\tint r1 = _01_BinarySearch.binarySearch(numbers, 0, numbers.length - 1, 4);\n\t\tassertEquals(4, r1);\n\t\t\n\t\tint[] numbers2 = {2, 4, 7, 9, 14};\n\t\tint r2 = _01_BinarySearch.binarySearch(numbers2, 0, numbers2.length - 1, 8);\n\t\tassertEquals(-1, r2);\n\t\t\n\t\tint[] numbers3 = {3, 5, 10, 16, 25};\n\t\tint r3 = _01_BinarySearch.binarySearch(numbers3, 0, numbers3.length - 1, 25);\n\t\tassertEquals(4, r3);\n\t\t\n\t}", "private int recFind(int searchKey, int lowerbound, int upperbound) {\n\t\tint curIn = (lowerbound + upperbound) / 2;\n\t\tif (arr[curIn] == searchKey)\n\t\t\treturn curIn;\n\t\telse if (lowerbound > upperbound)\n\t\t\treturn n;\n\t\telse {\n\t\t\tif (arr[curIn] < searchKey)\n\t\t\t\treturn recFind(searchKey, curIn + 1, upperbound);\n\t\t\telse\n\t\t\t\treturn recFind(searchKey, lowerbound, curIn - 1);\n\t\t}\n\t}", "protected int binarySearch(int x) {\n if (arr.length == 0) {\n return -1;\n }\n\n int left = 0;\n int right = count - 1;\n\n while (left <= right) {\n int mid = (right + left) >>> 1;\n int val = arr[mid];\n\n if (val < x) {\n left = mid + 1;\n } else if (val > x) {\n right = mid - 1;\n }\n else {\n return mid;\n }\n }\n\n return -1;\n }", "static int binarySearchHelp(int[] array, int searched) {\n\t\tint mid = array.length / 2;\r\n\t\tint first = 0;\r\n\t\tint last = array.length - 1;\r\n\r\n\t\twhile (array[mid] != searched && first <= last) {\r\n\t\t\tmid = (first + last) / 2;\r\n\t\t\tif (searched == array[mid]) {\r\n\t\t\t\treturn mid;\r\n\t\t\t}\r\n\t\t\tif (searched < array[mid]) {\r\n\t\t\t\tlast = mid - 1;\r\n\r\n\t\t\t}\r\n\t\t\tif (searched > array[mid]) {\r\n\t\t\t\tfirst = mid + 1;\r\n\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn -1;\r\n\t}", "private int binarySearch(int[] nums, int target, int low, int high) {\n while (low <= high) {\n int mid = low + (high - low) / 2; // find mid\n\n if (nums[mid] == target) { // if number found\n if (mid == low || nums[mid] > nums[mid - 1]) // check if it is the first occurence\n return mid; // if it is return mid\n else\n high = mid - 1; // decrease high to reach the index\n } else if (nums[mid] > target) // if the value in num is greater\n high = mid - 1; // decrease high\n else\n low = mid + 1; // else increase low\n\n }\n\n return -1; // number not found\n }", "private static int binarySearch(int[] arr, int low, int high, int target) {\n\n\t\tif (low <= high) {\n\n\t\t\tint mid = low + (high - low) / 2;\n\n\t\t\tif (arr[mid] == target) {\n\t\t\t\treturn mid;\n\t\t\t}\n\n\t\t\tif (arr[mid] < target) {\n\t\t\t\treturn binarySearch(arr, mid + 1, high, target);\n\t\t\t} else {\n\t\t\t\treturn binarySearch(arr, low, mid - 1, target);\n\t\t\t}\n\n\t\t}\n\n\t\treturn -1;\n\t}", "public static int binarySearchRec(int[] arr, int from, int to, int key) {\n\t\t\n\t\tif (from<=to) {\n\t\t\tint mid=from+(to-from)/2;\n\t\t\tif (arr[mid]<key) \t\treturn binarySearchRec(arr, ++mid, to, key);//upper\t\n\t\t\telse if (arr[mid]>key) \treturn binarySearchRec(arr, from, --mid, key); //lower\n\t\t\telse \t\t\t\t\treturn mid;//found\n\t\t}\n\t\telse {//not found\n\t\t\tint shouldBeIndex=from;\n\t\t\treturn -shouldBeIndex-1;\n\t\t}\n\t}", "@Test\r\n\tpublic void test08_binarySearch() {\r\n\t\tRecursiveMethods rm = new RecursiveMethods();\r\n\r\n\t\tint[] a7 = {};\r\n\t\tassertFalse(rm.binarySearch(a7, 5)); // Search 5 in a7 -> {} False\r\n\r\n\t\tint[] a8 = { 1, 2, 3, 4, 5 };\r\n\t\tassertTrue(rm.binarySearch(a8, 3)); // Search 3 in a8 -> {1,2,3,4,5} ->\r\n\t\t\t\t\t\t\t\t\t\t\t// True\r\n\t\tassertTrue(rm.binarySearch(a8, 1)); // Search 1 in a8 -> {1,2,3,4,5} ->\r\n\t\t\t\t\t\t\t\t\t\t\t// True\r\n\t\tassertTrue(rm.binarySearch(a8, 5)); // Search 5 in a8 -> {1,2,3,4,5} ->\r\n\t\t\t\t\t\t\t\t\t\t\t// True\r\n\t\tassertFalse(rm.binarySearch(a8, 0)); // Search 0 in a8 -> {1,2,3,4,5} ->\r\n\t\t\t\t\t\t\t\t\t\t\t\t// False\r\n\t\tassertFalse(rm.binarySearch(a8, 6)); // Search 6 in a8 -> {1,2,3,4,5} ->\r\n\t\t\t\t\t\t\t\t\t\t\t\t// False\r\n\t}", "private int binarySearchLeft(int[] nums, int target) {\n \tint low=0;\n int high=nums.length-1;\n\n while(low<=high){\n int mid=low+(high-low)/2;\n if (nums[mid]==target){\n if(mid==0||nums[mid-1]<nums[mid]){\n return mid;\n }\n else{\n high=mid-1;\n }\n }\n else if(nums[mid]>target){\n high=mid-1;\n }\n else{\n low=mid+1;\n }\n \n }\n\t\treturn -1;\n\t}", "private int searchR(Searching[] array, int start, int half, int end, int value) {\n if (value > array[end].getValue() || value < array[start].getValue()) {\n return -1;\n }\n int a = end - start;\n int b = array[end].getValue() - array[start].getValue();\n int c = value - array[start].getValue();\n int d = (c * a) / b;\n int slide = d + start;\n if (slide > end || slide < start) {\n return -1;\n }\n if (array[slide].getValue() == value) {\n return slide;\n }\n if (value < array[slide].getValue()) {\n end = slide;\n return searchR(array, start, half, end, value);\n } else {\n start = slide;\n return searchR(array, start, half, end, value);\n }\n }", "public int binarySearch(int[] nums, int target) {\n // write your code here\n if (nums == null || nums.length == 0) return -1;\n int start = 0, end = nums.length - 1;\n while (start + 1 < end) {\n int mid = start + (end - start) / 2;\n if (nums[mid] == target) {\n end = mid;\n }\n else if (nums[mid] < target) {\n start = mid;\n }\n else {\n end = mid;\n }\n }\n if (nums[start] == target) return start;\n if (nums[end] == target) return end;\n return -1;\n }", "static int binarySearch(@NotNull int[] search, int find) {\n int start, end, midPt;\n start = 0;\n end = search.length - 1;\n\n while (start <= end) {\n midPt = (start + end) / 2;\n if (search[midPt] == find) {\n return midPt;\n } else if (search[midPt] < find) {\n start = midPt + 1;\n } else {\n end = midPt - 1;\n }\n }\n\n return -1;\n }", "static int binarySearch(int arr[], int start, int end, int target ){\n if(start>end){\n return -1;\n }\n int mid = start+(end-start)/2;\n \n if(arr[mid] == target && (mid==0 || arr[mid-1]!=target)){\n return mid;\n }\n if(arr[mid] == target){\n return mid;\n }\n if(arr[mid]>=target && arr[mid]>arr[start]){\n return binarySearch(arr,start,mid-1,target);\n }\n // else if(arr[mid]<arr[start] && arr[mid]<target){\n // return binarySearch(arr,mid+1,end,target);\n // }\n return binarySearch(arr,mid+1,end,target);\n }", "private static int binarySearchMine(int[] data, int target, int low, int high) {\n while (low <= high) {\n int median = (low + high) / 2;\n int current = data[median];\n if (current == target) {\n return median;\n } else if (target < current) {\n return binarySearchMine(data, target, low, median - 1);\n } else {\n return binarySearchMine(data, target, median + 1, high);\n }\n }\n return -1;\n }", "public int binarySearch(int x) {\n\n int l = 0, h = length - 1, mid;\n while (l <= h) {\n mid = l + (h-l)/2;\n if (arr[mid] == x) return mid;\n else if (x < arr[mid]) h = mid - 1;\n else if (x > arr[mid]) l = mid + 1;\n }\n return -1;\n }", "private void BinarySearch(Node node, int index) {\n Node left, right;\n left = node.left;\n right = node.right;\n\n int leftIndex = (2 * index) + 1;\n int rightIndex = (2 * index) + 2;\n if (left != null) {\n ArrayTree[leftIndex] = left.key;\n BinarySearch(left, leftIndex);\n lastIndex = Math.max(leftIndex, lastIndex);\n } else {\n if (leftIndex < ArrayTree.length - 1) {\n ArrayTree[leftIndex] = 0;\n }\n }\n\n if (right != null) {\n ArrayTree[rightIndex] = right.key;\n BinarySearch(right, rightIndex);\n lastIndex = Math.max(rightIndex, lastIndex);\n } else {\n if (rightIndex < ArrayTree.length - 1) {\n ArrayTree[rightIndex] = 0;\n }\n }\n }", "public int binarySearchLoop(int key) {\n int first = 0;\n int last = length - 1;\n int mid = length / 2;\n //only on sorted array\n //first , mid = half(floor), last;\n //is mid the key\n //is mid < or > from the key\n //if key is bigger, then we go right, the new first is mid+1, new mid is (mid+last)/2, and last is the same until the end of the GOING searching right\n //if key is smaller then we go left, the new last is mid-1, new mid is (first + mid)/2, and first is the same until the end of GOING searching left\n\n while (first <= last) {\n if (key == arr[mid]) return mid;\n\n else if (key < arr[mid]) {\n last = mid - 1;\n mid = (first + mid) / 2;\n } else {\n first = mid + 1;\n mid = (first + last) / 2;\n }\n }\n return -1;\n }", "private int binarySearch(T element) {\n int start = 0, end = sortedArray.size(), mid = 0;\n while (start < end) {\n mid = (end + start) / 2;\n int cmp = sortedArray.get(mid).compareTo(element);\n if (cmp == 0) {\n start = end = mid;\n }\n else if (cmp < 0) {\n start = mid + 1;\n }\n else {\n end = mid;\n }\n }\n return start;\n }", "public static void useBinarySearch1() {\n int[] numbers = {-3, 2, 8, 12, 17, 29, 44, 58, 79};\n int index = Arrays.binarySearch(numbers, 29);\n System.out.println(\"29 is found at index \" + index);\n }", "int binarySearch(int arr[], int x)\n {\n int l = 0, r = arr.length - 1;\n while (l <= r) {\n int m = l + (r - l) / 2;\n\n // Check if x is present at mid\n if (arr[m] == x)\n return m;\n\n // If x greater, ignore left half\n if (arr[m] < x)\n l = m + 1;\n\n // If x is smaller, ignore right half\n else\n r = m - 1;\n }\n\n // if we reach here, then element was\n // not present\n return -1;\n }", "private MyBinaryNode<K> searchRecursive(MyBinaryNode<K> current, K key) {\n\t\tif (current == null) \n\t\treturn null;\n\t\telse if(current.key.compareTo(key) == 0) \n\t\t\treturn current;\n\t\telse if(current.key.compareTo(key) < 0) \n\t\t\treturn searchRecursive(current.right, key);\n\t\telse\n\t\t\treturn searchRecursive(current.left, key); \n\t}", "public static int binarySearch(int[] ary, int target, int start, int end){\r\n\t\t//get the middle index\r\n\t\tint middle = (end-start)/2 + start;\r\n\t\tint result = 0;\r\n\t\t\r\n\t\t//Some end cases (error, out of scope, etc)\r\n\t\tif(end-start<0||target<ary[0]||target>ary[ary.length-1])\r\n\t\t\t\r\n\t\t\t//If element is not in the array display \r\n\t\t\treturn -1;\r\n\r\n\r\n\t\t//Recursive case 1: If target is less than, the next search occurs within start and middle-1\r\n\r\n\t\tif (target < ary[middle]) {\r\n\t\t\tresult = binarySearch(ary, target, start, middle-1 );\r\n\t\t}\r\n\t\t\r\n\t\t//Recursive case 2: If target is greater than, the next search occurs within middle+1 and end \r\n\t\telse if(target > ary[middle]) {\r\n\t\t\tresult = binarySearch(ary, target, middle+1, end);\r\n\t\t\r\n\t\t//End cases: If target is equal, done.\r\n\t\t}\r\n\t\telse if (target == ary[middle]) {\r\n\t\t\tresult = middle;\r\n\t\t}\r\n\r\n\t\t//Return results\r\n\t\treturn result;\r\n\t}", "@Test\n public void testBinarySearch() {\n System.out.println(\"binarySearch\");\n int[] index = {10, 11, 12, 13, 14};\n int key = 12;\n int begin = 0;\n int end = 5;\n int expResult = 2;\n int result = Utils.binarySearch(index, key, begin, end);\n assertEquals(expResult, result);\n }", "private static boolean binarySearchRecursive(int[] array, int number, int left, int right) {\n\t\tif(left>right) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t//Calculate mid point we can use left+right/2 also\n\t\t//below is used just to avoid integer index out of bound\n\t\tint mid=left+((right-left)/2);\n\t\t\n\t\t//check if the number is the mid number\n\t\tif(array[mid]==number) {\n\t\t\treturn true;\n\t\t}\n\t\t//Check if the number is lesser or greater since its lesser so mid-1\n\t\telse if(number<array[mid]) {\n\t\t\treturn binarySearchRecursive(array,number,left, mid-1); \n\t\t}else {\n\t\t\treturn binarySearchRecursive(array,number,mid+1,right); \n\t\t}\n\t}", "private int search(int key,int start,int end)\n\t{\n\t\tint position=start+(end-start)/2;\n\t\t\n\t\t// if element is not present in the list\n\t\tif(start >= end)\n\t\t{\n\t\t\tif ((start == end) && (data[start] == key))\n\t\t\t\treturn start;\n\t\t\telse\n\t\t\t\treturn -1;\n\t\t}\n\t\t\n\t\tif(key==data[position])\n\t\t\treturn position;\n\t\t\n\t\telse if(key < data[position])\n\t\t\treturn search(key,start,position-1);\n\t\t\n\t\telse if(key > data[position])\n\t\t\treturn search(key,position+1,end);\n\t\t\n\t\treturn -1;\n\t\t\n\t}", "static int BinarySearch(int[] arr, int target, int start, int end) {\n boolean isAsc = arr[start] < arr[end];\n\n while(start <= end) {\n // find the middle element\n// int mid = (start + end) / 2; // might be possible that (start + end) exceeds the range of int in java\n int mid = start + (end - start) / 2;\n\n if (arr[mid] == target) {\n return mid;\n }\n\n if (isAsc) {\n if (target < arr[mid]) {\n end = mid - 1;\n } else {\n start = mid + 1;\n }\n } else {\n if (target > arr[mid]) {\n end = mid - 1;\n } else {\n start = mid + 1;\n }\n }\n }\n return -1;\n }", "private static int search(int[] nums, int target, int start, int end)\r\n\t{\n\t\tif (end == start)\r\n\t\t\treturn nums[start] == target ? start : -1;\r\n\t\t\r\n\t\tif(end - start == 1)\r\n\t\t{\r\n\t\t\tif(nums[start] == target)\r\n\t\t\t\treturn start;\r\n\t\t\tif(nums[end] == target)\r\n\t\t\t\treturn end;\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t\t\r\n\t\t// If there are more than two elements\r\n\t\tint mid = (start + end) / 2;\r\n\t\tif (nums[mid] == target)\r\n\t\t\treturn mid;\r\n\t\telse if (nums[mid] > target)\r\n\t\t\treturn search(nums, target, start, mid - 1);\r\n\t\telse\r\n\t\t\treturn search(nums, target, mid + 1, end);\r\n\t}", "private int binarySearchQ7(int first, int last, K key)\n {\n int index;\n \n if (first > last)\n index = first; \n else \n {\n int mid = first + (last - first) / 2;\n K midKey = dictionary[mid].getKey(); \n if (key.equals(midKey))\n index = mid; \n else if (key.compareTo(midKey) < 0)\n index = binarySearchQ7(first, mid - 1, key);\n else\n index = binarySearchQ7(mid + 1, last, key);\n } \n return index;\n }", "public static int binarySearch(int[] elements, int start, int end, int findMe) {\n if (start > end) {\n return -1;\n }\n Integer mid = (start + end) / 2;\n Integer midElement = elements[mid];\n //is mid the element we are looking?\n if (findMe == midElement) {\n return mid;\n }\n if (findMe < midElement) {\n //its in left half\n return binarySearch(elements, start, mid - 1, findMe);\n } else {\n //in right half of array\n return binarySearch(elements, mid + 1, end, findMe);\n }\n }", "static int binarySearch(int[] array, int start, int end, int value) {\r\n\t\tif(end>=start) {\r\n\t\t\tint mid = (start+end)/2;\r\n\t\t\tif(array[mid]==value)\r\n\t\t\t\treturn mid;\r\n if(array[mid]>value)\r\n \treturn binarySearch(array, start, mid-1, value);\r\n return binarySearch(array, mid+1, end, value);\r\n\t\t}\r\n return -1;\r\n\t}", "static Integer BinarySearchRec(Integer[] tablica, int value, int low, int high) {\n if (high < low) {\n return -1;\n }\n\n int mid = (low + high) / 2;\n\n if (tablica[mid] > value) {\n return BinarySearchRec(tablica, value, low, mid - 1);\n } else if (tablica[mid] < value) {\n return BinarySearchRec(tablica, value, mid + 1, high);\n } else {\n return mid;\n }\n }", "public int binarySearchInteger(int[] arr,int start,int end,int search){\r\n\t\tint found=0;\r\n\t\tif(start>end){\r\n\t\t\tfound=-1;\r\n\t\t}else{\r\n\t\t\tint mid=(start+end)/2;\r\n\t\t\tif(search==arr[mid]){\r\n\t\t\t\tfound=mid;\r\n\t\t\t}else if(search>arr[mid]){\r\n\t\t\t\tfound=binarySearchInteger(arr, mid+1, end, search);\r\n\t\t\t}else if(search<arr[mid]){\r\n\t\t\t\tfound=binarySearchInteger(arr, start, mid, search);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn found;\r\n\t}", "public static int binarySearch(int[] num, int target) {\n\t\tint left = 0;\n\t\tint right = num.length - 1;\n\t\twhile (left <= right) {\n\t\t\tint middle = (left+right)/2;\n\t\t\tif (num[middle] == target) {\n\t\t\t\treturn middle;\n\t\t\t} else if (num[middle] < target) {\n\t\t\t\tleft = middle + 1;\n\t\t\t} else {\n\t\t\t\tright = middle - 1;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn -1;\n\t}", "public static int binarySearch(int[] arr, int target){\n\t\tint start = 0;\n\t\tint end = arr.length - 1;\n\n\t\twhile (start <= end){\n\t\t\tint mid = (end + start) / 2;\n\t\t\tif(arr[mid] == target){\n\t\t\t\treturn mid;\n\t\t\t} else if(target < arr[mid]){\n\t\t\t\tend = mid - 1;\n\t\t\t} else if(target > arr[mid]){\n\t\t\t\tstart = mid + 1;\n\t\t\t}\n\t\t}\n\n\t\treturn -1;\n\t}", "public int search(int[] nums, int target) {\n int left = 0;\n int right = nums.length - 1;\n while (left < right) {\n int mid = (left + right) / 2;\n if (nums[mid] > nums[right]) {\n left = mid + 1;\n } else {\n right = mid;\n }\n }\n int pivot = left;\n left = 0;\n right = nums.length - 1;\n while (left <= right) {\n int mid = (left + right) / 2;\n int realmid = (mid + pivot) % nums.length;\n if (nums[realmid] == target) {\n return realmid;\n } else if (nums[realmid] < target) {\n left = mid + 1;\n } else {\n right = mid - 1;\n }\n }\n return -1;\n }", "public int binarySearch(String searchKey) {\r\n\t\tint low = 0;\r\n\t\tint high = size -1;\r\n\t\tint middle;\r\n\t\t\r\n\t\twhile (low <= high) {\r\n\t\t\tmiddle = (high + low)/2;\r\n\t\t\tif (searchKey.equalsIgnoreCase(list[middle].getStudentName())) {\r\n\t\t\t\treturn middle; // Element was found\r\n\t\t\t}\r\n\t\t\telse if (searchKey.compareToIgnoreCase(list[middle].getStudentName())<0) {\r\n\t\t\t\thigh = middle -1;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tlow = middle +1;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn -1; // Element was not found\r\n\t}", "private static boolean binarySearch(int[] data, int target, int low, int high) {\n if (low > high) {\n return false;\n } else {\n int mid = (low + high) / 2;\n if (target == data[mid]) {\n return true;\n } else if (target < data[mid]) {\n return binarySearch(data, target, low, mid - 1);\n } else {\n return binarySearch(data, target, mid + 1, high);\n }\n }\n }", "public int binarySearchRecursive(int[] array,int target) {\n return binarySearchRecursive(array,target,0,array.length);\n }", "public static int binSearchRotatedIter(int src[], int lo, int hi, int target){\n\n while(lo<=hi){\n int mid = lo + (hi-lo)/2;\n if(src[mid]==target) return mid;\n //if bottom half is sorted\n if(src[lo]<=src[mid]){\n \n if(src[lo]<=target && target<src[mid]){\n hi=mid-1;\n }else{\n lo=mid+1;\n }\n }\n //if upper half is sorted\n else{\n if(src[mid]<target && target<=src[hi]){\n lo=mid+1;\n }else{\n hi=mid-1;\n }\n }\n }\n return -1;\n}", "private boolean search(BinaryNode<AnyType> curr, AnyType target) {\n\t\tif (curr != null) {\n\t\t\tif (curr.element.compareTo(target) < 0) {\n\t\t\t\treturn search(curr.right, target);\n\t\t\t} else if (curr.element.compareTo(target) > 0) {\n\t\t\t\treturn search(curr.left, target);\n\t\t\t} else {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\n\t}", "public static int binarySearchIter(int[] arr, int from, int to, int key) {\n\t\t\n\t\tint shouldBeIndex;\n\t\twhile (from<=to){\n\t\t\tint mid=from+(to-from)/2;\n\t\t\tif (arr[mid]<key) from=mid+1;//upper\n\t\t\telse if (arr[mid]>key) to=mid-1;//lower\n\t\t\telse return mid;//found\n\t\t}\n\t\t//not found\n\t\tshouldBeIndex=from;\n\t\treturn -shouldBeIndex-1;\n\t}", "public static int binaryFind(int []A, int s, int e, int key) {\n\tif(s>e) return -1;\n\tint mid = (s+e)/2;\n\tif(A[mid] == key) return mid;\n if(A[mid] < key) return binaryFind(A, mid+1, e, key);\n else return binaryFind(A, s, mid-1, key); //(A[mid] > key)\n }", "public static int binarySearch(int arr[], int low, int max, int searchItem)\n\t{\n\t\tif (max >= low)\n\t\t{\n\t\t\tint mid = low + (max - low)/2;\n\n\t\t\t// If the element is present at the middle itself\n\t\t\tif (arr[mid] == searchItem)\n\t\t\t\treturn mid;\n\n\t\t\t// If element is smaller than mid, then it can only be present in left sub-array\n\t\t\tif (arr[mid] > searchItem)\n\t\t\t\treturn binarySearch(arr, low, mid-1, searchItem);\n\n\t\t\t// Else the element can only be present in right sub-array\n\t\t\treturn binarySearch(arr, mid+1, max, searchItem);\n\t\t}\n\n\t\t// We reach here when element is not present in array\n\t\treturn -1;\n\t}", "public static int binarySearch(int[] list, int key) {\n int low = 0;\n int high = list.length - 1;\n \n while (high >= low) {\n int mid = (low + high) / 2;\n if (key < list[mid])\n high = mid - 1;\n else if (key == list[mid])\n return mid;\n else\n low = mid + 1;\n }\n return -1 - 1; // now high < low, key not found\n }", "public static int binarySearch2(int[] numbers, int target) {\n int min = 0;\n int max = numbers.length - 1;\n \n int mid = -1;\n while (min <= max) {\n mid = (max + min) / 2;\n if (numbers[mid] == target) {\n return mid; // found it!\n } else if (numbers[mid] < target) {\n min = mid + 1; // too small\n } else { // numbers[mid] > target\n max = mid - 1; // too large\n }\n mid = (max + min) / 2;\n }\n \n return -min - 1; // not found\n }", "static int binarySearch(int[] paramArrayOfint, int paramInt1, int paramInt2) {\n }", "public static Boolean binarySearch(int[] arr, int n){\r\n if(arr.length == 0) return false;\r\n if(arr.length == 1 && arr[0] != n) return false; \r\n if(arr.length == 1 && arr[0] == n) return true; \r\n int start = 0;\r\n int mid = arr.length/2;\r\n int end = arr.length;\r\n int pos = mid;\r\n while(arr[pos] != n){\r\n if(n > arr[pos]){\r\n start = mid;\r\n mid = (end-start)/2+start;\r\n } else if(n < arr[pos]){\r\n end = mid;\r\n mid = (end-start)/2+start;\r\n System.out.println(\"here \" + start+ \" \" + mid + \" \" + end + \" pos= \" + pos);\r\n }\r\n pos = mid;\r\n if(arr[pos] == n) return true;\r\n if(start+1 == end){\r\n System.out.println(start+ \" \" + mid + \" \" + end + \" pos= \" + pos);\r\n return false;\r\n }\r\n }\r\n return true;\r\n}", "public static int binarySearch(int[] array, int value, int start, int end){\n if(start <= end){\n int mid = (start+end)/2;\n if (array[mid] == value) return mid;\n else if(array[mid] < value) start = mid+1;\n else end = mid-1;\n return binarySearch(array, value, start, end);\n }\n return -1;\n }", "public static int binSearch(int[] a, int x, int l, int r) {\r\n if (l == r) {\r\n return r;\r\n }\r\n int m = (l + r) / 2;\r\n if (a[m] >= x) {\r\n return binSearch(a, x, l, m);\r\n }\r\n else {\r\n return binSearch(a, x, m + 1, r);\r\n }\r\n }", "private static int binary_search(int[] array, int num, int low, int high) {\n\t\t\n\t\treturn -1;\n\t}", "public int binarySearchAlgo(int a[], int low, int high, int x) {\n\t\tint mid = (low + high) / 2;\n\t\t// If mid is x simply return the value\n\t\tif (a[mid] == x) {\n\t\t\treturn mid;\n\t\t}\n\t\t// If we didn't find any element simply return -1\n\t\tif (low == high) {\n\t\t\treturn -1;\n\t\t}\n\t\t// If mid element value is less then x go search higher(right) indices\n\t\tif (a[mid] < x) {\n\t\t\treturn binarySearchAlgo(a, mid + 1, high, x);\n\t\t}\n\t\t// If mid element value is less then x go search lower(left) indices\n\t\telse /* if (a[mid] > x) */ {\n\t\t\treturn binarySearchAlgo(a, low, mid - 1, x);\n\t\t}\n\n\t}", "private static boolean binarySearch(int[] arr, int num, int start, int end) {\n\t\tif(arr==null || arr.length==0){\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tint mid;\r\n\t\t\r\n\t\twhile(start<=end){\r\n\t\t\t\r\n\t\t\tmid= start+ (end-start)/2;\r\n\t\t\t\r\n\t\t\tif(arr[mid]==num){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\telse if(num < arr[mid]){\r\n\t\t\t\tend=mid-1;\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tstart=mid+1;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "private int binaryFind(K key) {\n int sortedCount = this.sortedCount.get();\n // if there are no sorted keys, or the first item is already larger than key -\n // return the head node for a regular linear search\n if ((sortedCount == 0) || comparator.compareKeyAndSerializedKey(key, readKey(FIRST_ITEM)) <= 0) {\n return HEAD_NODE;\n }\n\n // optimization: compare with last key to avoid binary search\n if (comparator.compareKeyAndSerializedKey(key, readKey((sortedCount - 1) * FIELDS + FIRST_ITEM)) > 0) {\n return (sortedCount - 1) * FIELDS + FIRST_ITEM;\n }\n\n int start = 0;\n int end = sortedCount;\n\n while (end - start > 1) {\n int curr = start + (end - start) / 2;\n\n if (comparator.compareKeyAndSerializedKey(key, readKey(curr * FIELDS + FIRST_ITEM)) <= 0) {\n end = curr;\n } else {\n start = curr;\n }\n }\n\n return start * FIELDS + FIRST_ITEM;\n }", "private static int binarySearch0(double[] a, int fromIndex, int toIndex,\n\t\t\tdouble key) {\n\t\tint low = fromIndex;\n\t\tint high = toIndex - 1;\n\n\t\twhile (low <= high) {\n\t\t\tint mid = (low + high) >>> 1;\n\t\t\t\tdouble midVal = a[mid];\n\n\t\t\t\tint cmp;\n\t\t\t\tif (midVal < key) {\n\t\t\t\t\tcmp = -1; // Neither val is NaN, thisVal is smaller\n\t\t\t\t} else if (midVal > key) {\n\t\t\t\t\tcmp = 1; // Neither val is NaN, thisVal is larger\n\t\t\t\t} else {\n\t\t\t\t\tlong midBits = Double.doubleToLongBits(midVal);\n\t\t\t\t\tlong keyBits = Double.doubleToLongBits(key);\n\t\t\t\t\tcmp = (midBits == keyBits ? 0 : // Values are equal\n\t\t\t\t\t\t(midBits < keyBits ? -1 : // (-0.0, 0.0) or (!NaN, NaN)\n\t\t\t\t\t\t\t1)); // (0.0, -0.0) or (NaN, !NaN)\n\t\t\t\t}\n\n\t\t\t\tif (cmp < 0)\n\t\t\t\t\tlow = mid + 1;\n\t\t\t\telse if (cmp > 0)\n\t\t\t\t\thigh = mid - 1;\n\t\t\t\telse\n\t\t\t\t\treturn mid; // key found\n\t\t}\n\t\treturn -(low + 1); // key not found.\n\t}", "public static int binarySearch(java.util.List arg0, java.lang.Object arg1, java.util.Comparator arg2)\n { return 0; }", "public static int binSearch(int[] a, int first, int last, int key)\n\t{\t\n\t\tif(first <= last)\n\t\t{\n\t\t\tint mid = (first + last) / 2; //Divides the beginning of the array and the length of the array into 2\n\t\t\t\n\t\t\tif (a[mid] == key)\n\t\t\t{\n\t\t\t\treturn mid; \n\t\t\t}\n\t\t\t\n\t\t\telse if (a[mid] > key) //IF THE INDEX(WHICH IS THE MID) OF ARRAY A IS GREATER THAN THE KEY\n\t\t\t{\n\t\t\t\treturn last = mid - 1; //RETURNS THE LENGTH OF THE ARRAY WHICH IS THE DECREMENTED MID\n\t\t\t}\n\t\t\t\n\t\t\telse //IF THE INDEX(WHICH IS THE MID) OF ARRAY A IS LESS THAN THE KEY\n\t\t\t{\n\t\t\t\treturn first = mid + 1; //RETURNS THE FIRST = INCREMENTED MID\t\t\n\t\t\t}\n\t\t}\n\t\treturn -1;\t\n\t}", "private int binarySearchByIndex(List<Span> spans, int index){\n int left = 0,right = spans.size() - 1,mid,row;\n int max = right;\n while(left <= right){\n mid = (left + right) / 2;\n if(mid < 0) return 0;\n if(mid > max) return max;\n row = spans.get(mid).startIndex;\n if(row == index) {\n return mid;\n }else if(row < index){\n left = mid + 1;\n }else{\n right = mid - 1;\n }\n }\n int result = Math.max(0,Math.min(left,max));\n while(result > 0) {\n if(spans.get(result).startIndex > index) {\n result--;\n }else{\n break;\n }\n }\n while(result < right) {\n if(getSpanEnd(result,spans) < index) {\n result++;\n }else{\n break;\n }\n }\n return result;\n }", "public int search(int[] A, int target) {\n // write your code here\n if (A == null || A.length == 0) return -1;\n int start = 0, end = A.length - 1;\n while (start + 1 < end) {\n int mid = start + (end - start) / 2;\n if (A[mid] == target) return mid;\n if (A[mid] < A[start]) {\n if (target <= A[end] && target > A[mid]){\n start = mid;\n }\n else {\n end = mid;\n }\n }\n else {\n if (target >= A[start] && target < A[mid]) {\n end = mid;\n }\n else {\n start = mid;\n }\n }\n }\n if (A[start] == target) return start;\n if (A[end] == target) return end;\n return -1;\n }", "public int binarySearchRotated(int [] nums) {\n\t\tint n = nums.length;\n\t\tint low = 0;\n\t\tint high = n -1;\n\t\twhile(low <= high) {\n\t\t\tif(nums[low] <= nums[high]) return low;\n\t\t\tint mid = (low + high) >> 1;\n\t\t\tint next = (mid + 1) % n;\n\t\t\tint prev = (mid - 1) % n;\n\t\t\tif(nums[mid] <= nums[next] && nums[mid] <= nums[prev]) return mid;\n\t\t\telse if(nums[mid] <= nums[high]) high = mid-1;\n\t\t\telse if(nums[mid] >= nums[low]) low = mid+1;\n\t\t}\n\t\t\n\t\treturn -1;\n\t\t\n\t}", "static boolean testSearch() {\n BinaryTree tree = new BinaryTree();\n int[] profile = new int[1];\n\n // Implment insert method\n tree.insert(\"a\", 1);\n tree.insert(\"b\", 2);\n tree.insert(\"c\", 3);\n tree.insert(\"d\", 4);\n tree.insert(\"e\", 5);\n\n // Validates that search works correctly for every key in tree\n if(tree.search(\"a\", profile) != 1)\n return false;\n if(tree.search(\"b\", profile) != 2)\n return false;\n if(tree.search(\"c\", profile) != 3)\n return false;\n if(tree.search(\"d\", profile) != 4)\n return false;\n if(tree.search(\"e\", profile) != 5)\n return false;\n\n // Validates that search works if a key has been overwritten\n tree.insert(\"a\", 3);\n if(tree.search(\"a\", profile) != 3)\n return false;\n\n // Validates that search returns -1 if value is not found\n if(tree.search(\"f\", profile) != -1)\n return false;\n\n // Validates that profile is as expected\n if(profile[0] <= 0)\n return false;\n\n return true;\n }", "public static int binarySearchR(int[] numbers, int target,\n int min, int max) {\n // base case\n if (min > max) {\n return -1; // not found\n } else {\n // recursive case\n int mid = (max + min) / 2;\n if (numbers[mid] == target) {\n return mid;\n } else if (numbers[mid] < target) {\n return binarySearchR(numbers, target,\n mid + 1, max);\n } else {\n return binarySearchR(numbers, target,\n min, mid - 1);\n }\n }\n }", "private static int binarySearch0(float[] a, int fromIndex, int toIndex,\n\t\t\tfloat key) {\n\t\tint low = fromIndex;\n\t\tint high = toIndex - 1;\n\n\t\twhile (low <= high) {\n\t\t\tint mid = (low + high) >>> 1;\n\t\tfloat midVal = a[mid];\n\n\t\tint cmp;\n\t\tif (midVal < key) {\n\t\t\tcmp = -1; // Neither val is NaN, thisVal is smaller\n\t\t} else if (midVal > key) {\n\t\t\tcmp = 1; // Neither val is NaN, thisVal is larger\n\t\t} else {\n\t\t\tint midBits = Float.floatToIntBits(midVal);\n\t\t\tint keyBits = Float.floatToIntBits(key);\n\t\t\tcmp = (midBits == keyBits ? 0 : // Values are equal\n\t\t\t\t(midBits < keyBits ? -1 : // (-0.0, 0.0) or (!NaN, NaN)\n\t\t\t\t\t1)); // (0.0, -0.0) or (NaN, !NaN)\n\t\t}\n\n\t\tif (cmp < 0)\n\t\t\tlow = mid + 1;\n\t\telse if (cmp > 0)\n\t\t\thigh = mid - 1;\n\t\telse\n\t\t\treturn mid; // key found\n\t\t}\n\t\treturn -(low + 1); // key not found.\n\t}", "public int sortSearchHelper (int val, int low, int high, List<Integer> list) {\n \n // Binary search to find our element val in the insertion sorted array\n \n int mid = low + (high - low)/2;\n \n // Here, if binary search ends, means current mid is the value.\n \n if (low >= high) {\n \n list.add(mid, val);\n return mid;\n \n }\n \n // Check if given val is present on left or right side of mid value.\n \n if (val <= list.get(mid)) {\n \n return sortSearchHelper (val, low, mid, list);\n \n } else {\n \n return sortSearchHelper (val, mid + 1, high, list);\n \n }\n \n \n }", "public static int BinarySearch(int[] arr,int data){\n int si = 0, ei = arr.length - 1;\n while(si <= ei){\n int mid = (si + ei) / 2;\n if(arr[mid] == data)\n return mid;\n else if(data < arr[mid]){\n ei = mid - 1;\n }else si = mid + 1;\n }\n\n return -1;\n }", "public static int binarySearch(int[] array, int low, int high, int item){\n\t\n\t\tif(high < low)\n\t\t\treturn -1;\n\t\tint middle = (low + high) /2;\n\t\tif(item == array[middle])\n\t\t\treturn middle;\n\t\tif(item < array[middle])\n\t\t\treturn binarySearch(array,low,(middle-1),item);\n\t\telse\n\t\t\treturn binarySearch(array,(middle+1),high,item);\n\t}", "public int BinarySearch(Object[] a, int size, Object key) {\n int start = 0;\n int end = size - 1;\n while (start < end) {\n int mid = (start + size) / 2;\n if (key.equals(a[mid])) {\n return mid;\n } else if (((Comparable) key).compareTo(a[mid]) > 0) {\n start = mid + 1;\n } else {\n end = mid - 1;\n }\n }\n return -1;\n }", "@Test\n public void testBinarySearch() {\n int actualResult = binarySearch.BinarySearch(new int[]{2,4,5}, 5);\n // check if the value is correct\n assertEquals(5, actualResult);\n }", "public static int binarySearch(int[] numbers, int target) {\n int min = 0;\n int max = numbers.length - 1;\n \n while (min <= max) {\n int mid = (max + min) / 2;\n if (numbers[mid] == target) {\n return mid; // found it!\n } else if (numbers[mid] < target) {\n min = mid + 1; // too small\n } else { // numbers[mid] > target\n max = mid - 1; // too large\n }\n }\n \n return -1; // not found\n }", "static int binSearch(int []arr,int key) {\n\t\tint start=0;\n\t\tint end=arr.length-1;\n\t\tdo {\n\t\t\tint pc=(start+end)/2;\n\t\t\tif(arr[pc]==key) {\n\t\t\t\treturn pc;\n\t\t\t}else if(arr[pc]<key) {\n\t\t\t\tstart=pc+1;\n\t\t\t}else\n\t\t\t\tend=pc-1;\n\t\t}while(start<=end);\n\t\t\n\t\treturn -1;\n\t}", "private int searchKeyRecursive(T key, int startIndex, int endIndex) {\n int arraySize = endIndex - startIndex;\n\n int midIndex = startIndex + (arraySize / 2);\n\n //Works only for primitive types.\n if (array[midIndex] == key) {\n return midIndex;\n }\n\n if (arraySize == 1) {\n return -1;\n }\n\n// if (key.) {\n// return searchKeyRecursive(key, midIndex + 1, endIndex);\n// }\n\n\n return arraySize;\n }", "private static int bSearch(int[] elements, int key) {\n int left = 0, right = elements.length - 1, mid = 0;\n while (left <= right) {\n mid = (left + right) / 2;\n\n if (key < elements[mid]) {\n right = mid - 1;\n } else if (key == elements[mid]) {\n return mid;\n } else {\n left = mid + 1;\n }\n }\n return -1;\n }", "public static int binarySearch(int[] A, int x) {\n int low = 0;\n int high = A.length - 1;\n int mid = -1;\n while (low <= high) {\n mid = low + (high-low)/2;\n if (x >= A[mid]) {\n high = mid - 1;\n } else {\n low = mid + 1;\n }\n }\n if (mid >= 0 && x == A[mid]) {\n return mid;\n }\n return -1;\n }", "public void binarySearchForValue(int value){\n int lowIndex = 0;\n int highIndex = arraySize -1;\n\n while(lowIndex <= highIndex){\n int middleIndex = (lowIndex + highIndex)/2;\n\n if(theArray[middleIndex] < value){\n lowIndex = middleIndex + 1;\n } else if(theArray[middleIndex] > value) {\n highIndex = middleIndex -1;\n } else {\n System.out.println(\"Found a match for \" + value + \" at Index \" + middleIndex);\n // Exit the while loop.\n lowIndex = highIndex + 1;\n }\n\n printHorizontalArray(middleIndex, -1);\n }\n }", "private static int search(long[] numbers, int start, int end, long value) {\n if (start > end){\n return -1;\n }\n\n int middle = (start + end) / 2;\n\n if (numbers[middle] == value) {\n return middle;\n }\n\n if (numbers[middle] > value) {\n return search(numbers, start, middle - 1, value);\n }\n\n return search(numbers, middle + 1, end, value);\n }", "static int findFirstPosition(int[] nums, int target,int left,int right){\n while(left<=right){\n int mid=left+(right-left)/2;\n\n //If the target found\n if(nums[mid]==target){\n //if this is the first target from left\n if(mid==0 ||nums[mid-1]<nums[mid])\n return mid;\n else{\n //there are more targets available at left\n right=mid-1;\n }\n }\n if(target<nums[mid]){\n right=mid-1;\n }else if(target>nums[mid]){\n left=mid+1;\n }\n\n }\n return -1;\n }", "private Node<T> searchRecursively(Node<T> node, T value) {\n\n // If the key is less than that of the current node, calls this method again with the current node's\n // left branch as the new node to compare keys with.\n if (value.compareTo(node.getValue()) == -1) {\n node = node.getLeft();\n return searchRecursively(node, value);\n }\n\n // Otherwise, calls the method again, comparing with the current node's right branch.\n else if (value.compareTo(node.getValue()) == 1) {\n node = node.getRight();\n return searchRecursively(node, value);\n }\n\n // If the current node contains the key, returns this node.\n return node;\n }", "private Integer serialSearch() {\n int currentIndex = startIndex;\n for (int i = start; i < end; i++) {\n if (this.searchIndex == currentIndex) {\n return currentIndex;\n }\n currentIndex++;\n }\n return 0;\n }", "public int binarySearch(int[] numbers, int numToSearch){\n\n QuickSort quickSort = new QuickSort();\n quickSort.sort(numbers);\n\n //Above code is tightly coupled with either of the algo to be used, we can not manage using sort algo dynamically.\n\n\n // Login to search\n\n //Return the number found\n\n return 5; //returning any hypothetical number\n }", "@Override\r\n\t\r\n\t\r\n\t\r\n\tpublic int[] locate(int target) {\r\n\t\tint low = 0; \r\n\t\tint high = length()- 1;\r\n\t\t\r\n\t\twhile ( low <= high) {\r\n\t\t\tint mid = ((low + high)/2);\r\n\t\t\tint value = inspect(mid,0);\r\n\t\t\t\t\t\r\n\t\t\tif ( value == target) {\r\n\t\t\t\treturn new int[] {mid,0};\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\telse if (value < target) {\r\n\t\t\t\tlow = mid +1;\r\n\t\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\thigh = mid -1;\r\n\t\t}\r\n\t\t\r\n\t}\r\n\t\treturn binarySearch(high, target);\r\n\t}", "public int binarySearchString(String[] s,int start,int end,String search){\r\n\t\tstart=0;\r\n\t\tend=s.length;\r\n\t\twhile(start<end){\r\n\t\t\tint mid=(start+end)/2;\r\n\t\t\tif(search.compareTo(s[mid])<0){\r\n\t\t\t\tend=mid;\r\n\t\t\t}else if(search.compareTo(s[mid])>0){\r\n\t\t\t\tstart=mid+1;\r\n\t\t\t}else{\r\n\t\t\t\treturn mid;\r\n\t\t\t\t\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\treturn -1;\r\n\t}", "private int binarySearch(List<Span> spans, int line) {\n int left = 0,right = spans.size() - 1,mid,row;\n int max = right;\n while(left <= right){\n mid = (left + right) / 2;\n if(mid < 0) return 0;\n if(mid > max) return max;\n row = spans.get(mid).getLine();\n if(row == line) {\n return mid;\n }else if(row < line){\n left = mid + 1;\n }else{\n right = mid - 1;\n }\n }\n return Math.max(0,Math.min(left,max));\n }", "public static int binarySearch(List<Integer> values,\r\n int target) {\r\n /**\r\n * comparing with linear search, binarySearch is \r\n * more effective, and this method is also used to \r\n * find a certain number in the list of integers \r\n */\r\n int result = -1;\r\n /**\r\n * @return -1 if there is not exist a number which we find in\r\n * the list \r\n */\r\n\r\n int lo = 0;\r\n int hi = values.size() - 1;\r\n /**\r\n * declard two variables lo and hi and save the first and the last \r\n * position into these two variables \r\n */\r\n\r\n while (lo < hi && result < 0) {\r\n int mid = (lo + hi) / 2;\r\n if (target == values.get(lo)) {\r\n result = lo;\r\n } // if\r\n else if (target == values.get(mid)) {\r\n result = mid;\r\n } // else if\r\n else if (target == values.get(hi)) {\r\n result = hi;\r\n } // else if\r\n else if (target < values.get(mid)) {\r\n hi = mid - 1;\r\n } // else if\r\n else {\r\n lo = mid + 1;\r\n } // else\r\n } // while\r\n\r\n return result;\r\n }", "public int search(int[] nums, int target) {\n if (null == nums || nums.length == 0) {\n return -1;\n }\n int start = 0;\n int end = nums.length - 1;\n while (start <= end) {\n int mid = (start + end) / 2;\n if (nums[mid] == target)\n return mid;\n if (nums[start] <= nums[mid]) {\n if (target < nums[mid] && target >= nums[start])\n end = mid - 1;\n else\n start = mid + 1;\n }\n if (nums[mid] <= nums[end]) {\n if (target > nums[mid] && target <= nums[end])\n start = mid + 1;\n else\n end = mid - 1;\n }\n }\n return -1;\n }", "private int binarySearch(String[] arr, int low, int high, String targetVal) {\n\t\twhile(low <= high) {\n\t\t\tint mid = (low + high) / 2;\n\t\t\tarr[mid] = arr[mid].toLowerCase();\n\t\t\ttargetVal = targetVal.toLowerCase();\n\t\t\tif (arr[mid].compareTo(targetVal) < 0) {\n\t\t\t\tlow = mid + 1;\n\t\t\t} else if (arr[mid].compareTo(targetVal) > 0) {\n\t\t\t\thigh = mid -1;\n\t\t\t} else {\n\t\t\t\treturn mid;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn -1;\n\t}", "public static int callBinarySearch(int[] nums, int key) {\n return Arrays.binarySearch(nums,key);\n }", "public void binarySearchForValue(int value) {\n int lowIndex = 0;\n int highIndex = arraySize - 1;\n\n while (lowIndex <= highIndex) {\n int middleIndex = (highIndex + lowIndex) / 2;\n\n if (theArray[middleIndex] < value) {\n lowIndex = middleIndex + 1;\n } else if (theArray[middleIndex] > value) {\n highIndex = middleIndex - 1;\n } else {\n System.out.println(\"\\nFound a match for \" + value + \" at index \" + middleIndex);\n lowIndex = highIndex + 1;\n }\n\n printHorizontalArray(middleIndex, -1);\n }\n }" ]
[ "0.7724535", "0.7542866", "0.74627036", "0.74122864", "0.73986125", "0.73676574", "0.73439604", "0.7335401", "0.7327369", "0.7325441", "0.7230596", "0.72305906", "0.7208757", "0.72049034", "0.71993744", "0.7194672", "0.71942604", "0.71796834", "0.7146596", "0.7141306", "0.7137324", "0.7132561", "0.71310675", "0.71096647", "0.71021926", "0.7098028", "0.7088447", "0.70616275", "0.70088565", "0.69641316", "0.6961121", "0.6941524", "0.6934657", "0.69339836", "0.6913218", "0.6912242", "0.6906007", "0.6903394", "0.68869376", "0.68831277", "0.68777925", "0.6871274", "0.68607295", "0.68441486", "0.6816946", "0.68161947", "0.68035424", "0.67887396", "0.67791", "0.675967", "0.6752287", "0.6746247", "0.67393625", "0.673838", "0.6717701", "0.67076683", "0.6705698", "0.6702869", "0.6685861", "0.668409", "0.6681219", "0.6681058", "0.66789246", "0.6660872", "0.66379696", "0.66190785", "0.6616415", "0.6603665", "0.6591822", "0.65814376", "0.65757215", "0.6571623", "0.65708476", "0.6569923", "0.65540683", "0.6541179", "0.65410566", "0.6536588", "0.65291333", "0.6526486", "0.6523267", "0.6514248", "0.6502664", "0.64859414", "0.6484284", "0.64829296", "0.64794254", "0.6472942", "0.6440853", "0.6433093", "0.64180094", "0.6409887", "0.64096946", "0.64085495", "0.6406897", "0.64041424", "0.63971597", "0.6384296", "0.63824886", "0.6375707" ]
0.7729542
0
Iterative Implementation of Binary Search
public int binarySearchIterative(int[] array,int target) { var left = 0; var right = array.length -1; while (left <= right) { int middle = (left + right) / 2; if (array[middle] == target) return middle; if (array[middle] < target) left = middle + 1; else right = middle - 1; } return -1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract int binSearch(int[] array, int num, int left, int right);", "@Test\n\tpublic void testBinarySearch() {\n\t\tint[] arr0 = {0, 1, 2, 3, 4, 5};\n\t\tassertEquals(0, _01_BinarySearch.binarySearch(arr0, 0, arr0.length - 1, 0));\n\t\tassertEquals(1, _01_BinarySearch.binarySearch(arr0, 0, arr0.length - 1, 1));\n\t\tassertEquals(2, _01_BinarySearch.binarySearch(arr0, 0, arr0.length - 1, 2));\n\t\tassertEquals(3, _01_BinarySearch.binarySearch(arr0, 0, arr0.length - 1, 3));\n\t\t\n\t\tassertEquals(-1, _01_BinarySearch.binarySearch(arr0, 0, arr0.length - 1, 99));\n\t\t\n\t\tint[] arr1 = {0, 43, 209, 388, 401, 599};\n\t\tassertEquals(2, _01_BinarySearch.binarySearch(arr1, 0, arr0.length - 1, 209));\n\t\tassertEquals(-1, _01_BinarySearch.binarySearch(arr1, 0, arr0.length - 1, 45));\n\t}", "@Test\n\tpublic void testBinarySearch() {\n\t\tint[] numbers = {0, 1, 2, 3, 4, 5, 6};\n\t\tint r1 = _01_BinarySearch.binarySearch(numbers, 0, numbers.length - 1, 4);\n\t\tassertEquals(4, r1);\n\t\t\n\t\tint[] numbers2 = {2, 4, 7, 9, 14};\n\t\tint r2 = _01_BinarySearch.binarySearch(numbers2, 0, numbers2.length - 1, 8);\n\t\tassertEquals(-1, r2);\n\t\t\n\t\tint[] numbers3 = {3, 5, 10, 16, 25};\n\t\tint r3 = _01_BinarySearch.binarySearch(numbers3, 0, numbers3.length - 1, 25);\n\t\tassertEquals(4, r3);\n\t\t\n\t}", "public static int binSearchRotatedIter(int src[], int lo, int hi, int target){\n\n while(lo<=hi){\n int mid = lo + (hi-lo)/2;\n if(src[mid]==target) return mid;\n //if bottom half is sorted\n if(src[lo]<=src[mid]){\n \n if(src[lo]<=target && target<src[mid]){\n hi=mid-1;\n }else{\n lo=mid+1;\n }\n }\n //if upper half is sorted\n else{\n if(src[mid]<target && target<=src[hi]){\n lo=mid+1;\n }else{\n hi=mid-1;\n }\n }\n }\n return -1;\n}", "public Integer binSearch(Integer target, Integer[] data, Integer left, Integer right) {\n if (right - left == 1) {\n if (data[left] == target) return left;\n if (data[right] == target) return right;\n }\n if (right - left == 0) {\n if (data[left] == target) return left;\n }\n Integer midpt = (right + left) / 2 ;\n if (target == data[midpt]) return midpt ;\n if (target > data[midpt] ) return binSearch(target, data, midpt, right) ;\n if (target < data[midpt] ) return binSearch(target, data, left, midpt) ;\n\n return -1;\n }", "public static int binarySearchIter(int[] arr, int from, int to, int key) {\n\t\t\n\t\tint shouldBeIndex;\n\t\twhile (from<=to){\n\t\t\tint mid=from+(to-from)/2;\n\t\t\tif (arr[mid]<key) from=mid+1;//upper\n\t\t\telse if (arr[mid]>key) to=mid-1;//lower\n\t\t\telse return mid;//found\n\t\t}\n\t\t//not found\n\t\tshouldBeIndex=from;\n\t\treturn -shouldBeIndex-1;\n\t}", "public int binarySearch(int[] nums, int target, int left, int right) {\n int res = left - 1;\n while (left <= right) {\n int mid = left + (right - left) / 2;\n if (nums[mid] <= target) {\n right = mid - 1;\n } else {\n res = mid;\n left = mid + 1;\n }\n }\n return res;\n }", "static int binarySearchHelp(int[] array, int searched) {\n\t\tint mid = array.length / 2;\r\n\t\tint first = 0;\r\n\t\tint last = array.length - 1;\r\n\r\n\t\twhile (array[mid] != searched && first <= last) {\r\n\t\t\tmid = (first + last) / 2;\r\n\t\t\tif (searched == array[mid]) {\r\n\t\t\t\treturn mid;\r\n\t\t\t}\r\n\t\t\tif (searched < array[mid]) {\r\n\t\t\t\tlast = mid - 1;\r\n\r\n\t\t\t}\r\n\t\t\tif (searched > array[mid]) {\r\n\t\t\t\tfirst = mid + 1;\r\n\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn -1;\r\n\t}", "public static void useBinarySearch1() {\n int[] numbers = {-3, 2, 8, 12, 17, 29, 44, 58, 79};\n int index = Arrays.binarySearch(numbers, 29);\n System.out.println(\"29 is found at index \" + index);\n }", "private int binarySearch(int[] array, int left, int right, int target) {\n\t\tif (left > right) {\n\t\t\treturn -1;\n\t\t}\n\t\twhile (left <= right) {\n\t\t\tint mid = left + (right - left) / 2;\n\t\t\tif (array[mid] == target) {\n\t\t\t\treturn mid;\n\t\t\t} else if (array[mid] < target) {\n\t\t\t\tleft = mid + 1;\n\t\t\t} else {\n\t\t\t\tright = mid - 1;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}", "private int searchR(Searching[] array, int start, int half, int end, int value) {\n if (value > array[end].getValue() || value < array[start].getValue()) {\n return -1;\n }\n int a = end - start;\n int b = array[end].getValue() - array[start].getValue();\n int c = value - array[start].getValue();\n int d = (c * a) / b;\n int slide = d + start;\n if (slide > end || slide < start) {\n return -1;\n }\n if (array[slide].getValue() == value) {\n return slide;\n }\n if (value < array[slide].getValue()) {\n end = slide;\n return searchR(array, start, half, end, value);\n } else {\n start = slide;\n return searchR(array, start, half, end, value);\n }\n }", "private static int binary_Search(int[] arr, int target) {\n\n\t\tint low = 0;\n\t\tint high = arr.length - 1;\n\n\t\twhile (low <= high) {\n\n\t\t\tint mid = low + (high - low) / 2;\n\t\t\tSystem.out.println(\"low = \" + low + \" mid = \" + mid + \" high =\" + high);\n\t\t\tif (arr[mid] == target) {\n\t\t\t\treturn mid;\n\t\t\t}\n\t\t\tif (arr[mid] < target) {\n\t\t\t\tlow = mid + 1;\n\n\t\t\t} else {\n\t\t\t\thigh = mid - 1;\n\t\t\t}\n\n\t\t\t// System.out.println(\"low = \" + low + \" high =\" + high);\n\t\t}\n\t\treturn -1;\n\t}", "int binarySearch(int[] arr, int low, int high, int key){\n while(low <= high){\n int mid = (low + high) / 2;\n if (key < arr[mid])\n high = mid - 1;\n else if (key > arr[mid])\n low = mid + 1;\n else\n return mid;\n }\n return -1;\n }", "public int binarySearchLoop(int key) {\n int first = 0;\n int last = length - 1;\n int mid = length / 2;\n //only on sorted array\n //first , mid = half(floor), last;\n //is mid the key\n //is mid < or > from the key\n //if key is bigger, then we go right, the new first is mid+1, new mid is (mid+last)/2, and last is the same until the end of the GOING searching right\n //if key is smaller then we go left, the new last is mid-1, new mid is (first + mid)/2, and first is the same until the end of GOING searching left\n\n while (first <= last) {\n if (key == arr[mid]) return mid;\n\n else if (key < arr[mid]) {\n last = mid - 1;\n mid = (first + mid) / 2;\n } else {\n first = mid + 1;\n mid = (first + last) / 2;\n }\n }\n return -1;\n }", "private static int binarySearchMine(int[] data, int target, int low, int high) {\n while (low <= high) {\n int median = (low + high) / 2;\n int current = data[median];\n if (current == target) {\n return median;\n } else if (target < current) {\n return binarySearchMine(data, target, low, median - 1);\n } else {\n return binarySearchMine(data, target, median + 1, high);\n }\n }\n return -1;\n }", "private int recFind(int searchKey, int lowerbound, int upperbound) {\n\t\tint curIn = (lowerbound + upperbound) / 2;\n\t\tif (arr[curIn] == searchKey)\n\t\t\treturn curIn;\n\t\telse if (lowerbound > upperbound)\n\t\t\treturn n;\n\t\telse {\n\t\t\tif (arr[curIn] < searchKey)\n\t\t\t\treturn recFind(searchKey, curIn + 1, upperbound);\n\t\t\telse\n\t\t\t\treturn recFind(searchKey, lowerbound, curIn - 1);\n\t\t}\n\t}", "@Test\n public void testBinarySearch() {\n System.out.println(\"binarySearch\");\n int[] index = {10, 11, 12, 13, 14};\n int key = 12;\n int begin = 0;\n int end = 5;\n int expResult = 2;\n int result = Utils.binarySearch(index, key, begin, end);\n assertEquals(expResult, result);\n }", "private int binarySearch(T element) {\n int start = 0, end = sortedArray.size(), mid = 0;\n while (start < end) {\n mid = (end + start) / 2;\n int cmp = sortedArray.get(mid).compareTo(element);\n if (cmp == 0) {\n start = end = mid;\n }\n else if (cmp < 0) {\n start = mid + 1;\n }\n else {\n end = mid;\n }\n }\n return start;\n }", "public int binarySearch(int[] nums, int target) {\n // write your code here\n if (nums == null || nums.length == 0) return -1;\n int start = 0, end = nums.length - 1;\n while (start + 1 < end) {\n int mid = start + (end - start) / 2;\n if (nums[mid] == target) {\n end = mid;\n }\n else if (nums[mid] < target) {\n start = mid;\n }\n else {\n end = mid;\n }\n }\n if (nums[start] == target) return start;\n if (nums[end] == target) return end;\n return -1;\n }", "private static int binarySearchRecursively(int[] sortedArray, int input, int first, int last) {\n int mid = (first + last) / 2;\n\n if (last < first) {\n return -1;\n }\n if (input == sortedArray[mid]) {\n return mid;\n } else if (input < sortedArray[mid]) {\n return binarySearchRecursively(sortedArray, input, last, mid - 1);\n } else {\n return binarySearchRecursively(sortedArray, input, mid + 1, last);\n }\n }", "int binarySearchWithRecursion(int[] arr, int low, int high, int key){\n if (high < low)\n return -1;\n int mid = (low + high) / 2;\n if (key == arr[mid])\n return mid;\n if (key > arr[mid])\n return binarySearchWithRecursion(arr,(mid + 1), high, key);\n return binarySearchWithRecursion(arr, low, (mid - 1), key);\n }", "private int binarySearch(int[] nums, int target, int low, int high) {\n while (low <= high) {\n int mid = low + (high - low) / 2; // find mid\n\n if (nums[mid] == target) { // if number found\n if (mid == low || nums[mid] > nums[mid - 1]) // check if it is the first occurence\n return mid; // if it is return mid\n else\n high = mid - 1; // decrease high to reach the index\n } else if (nums[mid] > target) // if the value in num is greater\n high = mid - 1; // decrease high\n else\n low = mid + 1; // else increase low\n\n }\n\n return -1; // number not found\n }", "static void binarySearch(int mat[][], int i, int j_low, int j_high, int x){\n\t\t\n\t\twhile(j_low < j_high){\n\t\t\t\n\t\t}\n\t}", "protected int binarySearch(int x) {\n if (arr.length == 0) {\n return -1;\n }\n\n int left = 0;\n int right = count - 1;\n\n while (left <= right) {\n int mid = (right + left) >>> 1;\n int val = arr[mid];\n\n if (val < x) {\n left = mid + 1;\n } else if (val > x) {\n right = mid - 1;\n }\n else {\n return mid;\n }\n }\n\n return -1;\n }", "private int binarySearchRecursive(int[] array,int target,int left,int right) {\n if (left > right)\n return -1;\n\n int middle = (left + right) / 2;\n\n if (array[middle] == target)\n return middle;\n\n if (array[middle] < target)\n return binarySearchRecursive(array,target,middle+1,right);\n\n return binarySearchRecursive(array, target,left,middle-1);\n }", "public void binarySearchForValue(int value){\n int lowIndex = 0;\n int highIndex = arraySize -1;\n\n while(lowIndex <= highIndex){\n int middleIndex = (lowIndex + highIndex)/2;\n\n if(theArray[middleIndex] < value){\n lowIndex = middleIndex + 1;\n } else if(theArray[middleIndex] > value) {\n highIndex = middleIndex -1;\n } else {\n System.out.println(\"Found a match for \" + value + \" at Index \" + middleIndex);\n // Exit the while loop.\n lowIndex = highIndex + 1;\n }\n\n printHorizontalArray(middleIndex, -1);\n }\n }", "public static int binarySearch(java.util.List arg0, java.lang.Object arg1)\n { return 0; }", "private Integer serialSearch() {\n int currentIndex = startIndex;\n for (int i = start; i < end; i++) {\n if (this.searchIndex == currentIndex) {\n return currentIndex;\n }\n currentIndex++;\n }\n return 0;\n }", "private static int bSearch(int[] elements, int key) {\n int left = 0, right = elements.length - 1, mid = 0;\n while (left <= right) {\n mid = (left + right) / 2;\n\n if (key < elements[mid]) {\n right = mid - 1;\n } else if (key == elements[mid]) {\n return mid;\n } else {\n left = mid + 1;\n }\n }\n return -1;\n }", "private static int search(int[] arr, int findMe, int left, int right) {\n\t\tif (left > right) {\n\t\t\treturn FAILURE;\n\t\t}\n\t\tint mid = (left + right) / 2;\n\t\tif (findMe == arr[mid]) {\n\t\t\treturn mid;\n\t\t}\n\t\telse if (findMe < arr[mid]) {\n\t\t\treturn search(arr, findMe, left, mid - 1);\n\t\t}\n\t\telse {\n\t\t\treturn search(arr, findMe, mid + 1, right);\n\t\t}\n\t}", "private int binarySearchLeft(int[] nums, int target) {\n \tint low=0;\n int high=nums.length-1;\n\n while(low<=high){\n int mid=low+(high-low)/2;\n if (nums[mid]==target){\n if(mid==0||nums[mid-1]<nums[mid]){\n return mid;\n }\n else{\n high=mid-1;\n }\n }\n else if(nums[mid]>target){\n high=mid-1;\n }\n else{\n low=mid+1;\n }\n \n }\n\t\treturn -1;\n\t}", "public void binarySearchForValue(int value) {\n int lowIndex = 0;\n int highIndex = arraySize - 1;\n\n while (lowIndex <= highIndex) {\n int middleIndex = (highIndex + lowIndex) / 2;\n\n if (theArray[middleIndex] < value) {\n lowIndex = middleIndex + 1;\n } else if (theArray[middleIndex] > value) {\n highIndex = middleIndex - 1;\n } else {\n System.out.println(\"\\nFound a match for \" + value + \" at index \" + middleIndex);\n lowIndex = highIndex + 1;\n }\n\n printHorizontalArray(middleIndex, -1);\n }\n }", "static int binarySearch(@NotNull int[] search, int find) {\n int start, end, midPt;\n start = 0;\n end = search.length - 1;\n\n while (start <= end) {\n midPt = (start + end) / 2;\n if (search[midPt] == find) {\n return midPt;\n } else if (search[midPt] < find) {\n start = midPt + 1;\n } else {\n end = midPt - 1;\n }\n }\n\n return -1;\n }", "private static int binarySearch(int[] arr, int low, int high, int target) {\n\n\t\tif (low <= high) {\n\n\t\t\tint mid = low + (high - low) / 2;\n\n\t\t\tif (arr[mid] == target) {\n\t\t\t\treturn mid;\n\t\t\t}\n\n\t\t\tif (arr[mid] < target) {\n\t\t\t\treturn binarySearch(arr, mid + 1, high, target);\n\t\t\t} else {\n\t\t\t\treturn binarySearch(arr, low, mid - 1, target);\n\t\t\t}\n\n\t\t}\n\n\t\treturn -1;\n\t}", "public static int binarySearchRec(int[] arr, int from, int to, int key) {\n\t\t\n\t\tif (from<=to) {\n\t\t\tint mid=from+(to-from)/2;\n\t\t\tif (arr[mid]<key) \t\treturn binarySearchRec(arr, ++mid, to, key);//upper\t\n\t\t\telse if (arr[mid]>key) \treturn binarySearchRec(arr, from, --mid, key); //lower\n\t\t\telse \t\t\t\t\treturn mid;//found\n\t\t}\n\t\telse {//not found\n\t\t\tint shouldBeIndex=from;\n\t\t\treturn -shouldBeIndex-1;\n\t\t}\n\t}", "private int binarySearchByIndex(List<Span> spans, int index){\n int left = 0,right = spans.size() - 1,mid,row;\n int max = right;\n while(left <= right){\n mid = (left + right) / 2;\n if(mid < 0) return 0;\n if(mid > max) return max;\n row = spans.get(mid).startIndex;\n if(row == index) {\n return mid;\n }else if(row < index){\n left = mid + 1;\n }else{\n right = mid - 1;\n }\n }\n int result = Math.max(0,Math.min(left,max));\n while(result > 0) {\n if(spans.get(result).startIndex > index) {\n result--;\n }else{\n break;\n }\n }\n while(result < right) {\n if(getSpanEnd(result,spans) < index) {\n result++;\n }else{\n break;\n }\n }\n return result;\n }", "static int binarySearch(int[] paramArrayOfint, int paramInt1, int paramInt2) {\n }", "public static Boolean binarySearch(int[] arr, int n){\r\n if(arr.length == 0) return false;\r\n if(arr.length == 1 && arr[0] != n) return false; \r\n if(arr.length == 1 && arr[0] == n) return true; \r\n int start = 0;\r\n int mid = arr.length/2;\r\n int end = arr.length;\r\n int pos = mid;\r\n while(arr[pos] != n){\r\n if(n > arr[pos]){\r\n start = mid;\r\n mid = (end-start)/2+start;\r\n } else if(n < arr[pos]){\r\n end = mid;\r\n mid = (end-start)/2+start;\r\n System.out.println(\"here \" + start+ \" \" + mid + \" \" + end + \" pos= \" + pos);\r\n }\r\n pos = mid;\r\n if(arr[pos] == n) return true;\r\n if(start+1 == end){\r\n System.out.println(start+ \" \" + mid + \" \" + end + \" pos= \" + pos);\r\n return false;\r\n }\r\n }\r\n return true;\r\n}", "static int binarySearch(int arr[], int l, int r, int x) {\n if (r >= l) { \r\n int mid = l + (r - l) / 2; \r\n if (arr[mid] == x) \r\n return mid; \r\n \r\n if (arr[mid] > x) \r\n return binarySearch(arr, l, mid - 1, x); \r\n \r\n \r\n return binarySearch(arr, mid + 1, r, x); \r\n } \r\n \r\n \r\n return -1; \r\n }", "int binarySearch(int arr[], int x)\n {\n int l = 0, r = arr.length - 1;\n while (l <= r) {\n int m = l + (r - l) / 2;\n\n // Check if x is present at mid\n if (arr[m] == x)\n return m;\n\n // If x greater, ignore left half\n if (arr[m] < x)\n l = m + 1;\n\n // If x is smaller, ignore right half\n else\n r = m - 1;\n }\n\n // if we reach here, then element was\n // not present\n return -1;\n }", "static int binSearch(int []arr,int key) {\n\t\tint start=0;\n\t\tint end=arr.length-1;\n\t\tdo {\n\t\t\tint pc=(start+end)/2;\n\t\t\tif(arr[pc]==key) {\n\t\t\t\treturn pc;\n\t\t\t}else if(arr[pc]<key) {\n\t\t\t\tstart=pc+1;\n\t\t\t}else\n\t\t\t\tend=pc-1;\n\t\t}while(start<=end);\n\t\t\n\t\treturn -1;\n\t}", "public int binarySearch(int x) {\n\n int l = 0, h = length - 1, mid;\n while (l <= h) {\n mid = l + (h-l)/2;\n if (arr[mid] == x) return mid;\n else if (x < arr[mid]) h = mid - 1;\n else if (x > arr[mid]) l = mid + 1;\n }\n return -1;\n }", "public static int binSearch(int[] a, int first, int last, int key)\n\t{\t\n\t\tif(first <= last)\n\t\t{\n\t\t\tint mid = (first + last) / 2; //Divides the beginning of the array and the length of the array into 2\n\t\t\t\n\t\t\tif (a[mid] == key)\n\t\t\t{\n\t\t\t\treturn mid; \n\t\t\t}\n\t\t\t\n\t\t\telse if (a[mid] > key) //IF THE INDEX(WHICH IS THE MID) OF ARRAY A IS GREATER THAN THE KEY\n\t\t\t{\n\t\t\t\treturn last = mid - 1; //RETURNS THE LENGTH OF THE ARRAY WHICH IS THE DECREMENTED MID\n\t\t\t}\n\t\t\t\n\t\t\telse //IF THE INDEX(WHICH IS THE MID) OF ARRAY A IS LESS THAN THE KEY\n\t\t\t{\n\t\t\t\treturn first = mid + 1; //RETURNS THE FIRST = INCREMENTED MID\t\t\n\t\t\t}\n\t\t}\n\t\treturn -1;\t\n\t}", "static int BinarySearch(int[] arr, int target, int start, int end) {\n boolean isAsc = arr[start] < arr[end];\n\n while(start <= end) {\n // find the middle element\n// int mid = (start + end) / 2; // might be possible that (start + end) exceeds the range of int in java\n int mid = start + (end - start) / 2;\n\n if (arr[mid] == target) {\n return mid;\n }\n\n if (isAsc) {\n if (target < arr[mid]) {\n end = mid - 1;\n } else {\n start = mid + 1;\n }\n } else {\n if (target > arr[mid]) {\n end = mid - 1;\n } else {\n start = mid + 1;\n }\n }\n }\n return -1;\n }", "private static int binary_search(int[] array, int num, int low, int high) {\n\t\t\n\t\treturn -1;\n\t}", "private int binarySearchQ7(int first, int last, K key)\n {\n int index;\n \n if (first > last)\n index = first; \n else \n {\n int mid = first + (last - first) / 2;\n K midKey = dictionary[mid].getKey(); \n if (key.equals(midKey))\n index = mid; \n else if (key.compareTo(midKey) < 0)\n index = binarySearchQ7(first, mid - 1, key);\n else\n index = binarySearchQ7(mid + 1, last, key);\n } \n return index;\n }", "static int binarySearch(int[] array, int start, int end, int value) {\r\n\t\tif(end>=start) {\r\n\t\t\tint mid = (start+end)/2;\r\n\t\t\tif(array[mid]==value)\r\n\t\t\t\treturn mid;\r\n if(array[mid]>value)\r\n \treturn binarySearch(array, start, mid-1, value);\r\n return binarySearch(array, mid+1, end, value);\r\n\t\t}\r\n return -1;\r\n\t}", "public static int binarySearch2(int[] numbers, int target) {\n int min = 0;\n int max = numbers.length - 1;\n \n int mid = -1;\n while (min <= max) {\n mid = (max + min) / 2;\n if (numbers[mid] == target) {\n return mid; // found it!\n } else if (numbers[mid] < target) {\n min = mid + 1; // too small\n } else { // numbers[mid] > target\n max = mid - 1; // too large\n }\n mid = (max + min) / 2;\n }\n \n return -min - 1; // not found\n }", "@Override\r\n\t\r\n\t\r\n\t\r\n\tpublic int[] locate(int target) {\r\n\t\tint low = 0; \r\n\t\tint high = length()- 1;\r\n\t\t\r\n\t\twhile ( low <= high) {\r\n\t\t\tint mid = ((low + high)/2);\r\n\t\t\tint value = inspect(mid,0);\r\n\t\t\t\t\t\r\n\t\t\tif ( value == target) {\r\n\t\t\t\treturn new int[] {mid,0};\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\telse if (value < target) {\r\n\t\t\t\tlow = mid +1;\r\n\t\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\thigh = mid -1;\r\n\t\t}\r\n\t\t\r\n\t}\r\n\t\treturn binarySearch(high, target);\r\n\t}", "@Test\r\n\tpublic void test08_binarySearch() {\r\n\t\tRecursiveMethods rm = new RecursiveMethods();\r\n\r\n\t\tint[] a7 = {};\r\n\t\tassertFalse(rm.binarySearch(a7, 5)); // Search 5 in a7 -> {} False\r\n\r\n\t\tint[] a8 = { 1, 2, 3, 4, 5 };\r\n\t\tassertTrue(rm.binarySearch(a8, 3)); // Search 3 in a8 -> {1,2,3,4,5} ->\r\n\t\t\t\t\t\t\t\t\t\t\t// True\r\n\t\tassertTrue(rm.binarySearch(a8, 1)); // Search 1 in a8 -> {1,2,3,4,5} ->\r\n\t\t\t\t\t\t\t\t\t\t\t// True\r\n\t\tassertTrue(rm.binarySearch(a8, 5)); // Search 5 in a8 -> {1,2,3,4,5} ->\r\n\t\t\t\t\t\t\t\t\t\t\t// True\r\n\t\tassertFalse(rm.binarySearch(a8, 0)); // Search 0 in a8 -> {1,2,3,4,5} ->\r\n\t\t\t\t\t\t\t\t\t\t\t\t// False\r\n\t\tassertFalse(rm.binarySearch(a8, 6)); // Search 6 in a8 -> {1,2,3,4,5} ->\r\n\t\t\t\t\t\t\t\t\t\t\t\t// False\r\n\t}", "public static int binSearch(int[] a, int x, int l, int r) {\r\n if (l == r) {\r\n return r;\r\n }\r\n int m = (l + r) / 2;\r\n if (a[m] >= x) {\r\n return binSearch(a, x, l, m);\r\n }\r\n else {\r\n return binSearch(a, x, m + 1, r);\r\n }\r\n }", "static int binarySearch(int arr[], int start, int end, int target ){\n if(start>end){\n return -1;\n }\n int mid = start+(end-start)/2;\n \n if(arr[mid] == target && (mid==0 || arr[mid-1]!=target)){\n return mid;\n }\n if(arr[mid] == target){\n return mid;\n }\n if(arr[mid]>=target && arr[mid]>arr[start]){\n return binarySearch(arr,start,mid-1,target);\n }\n // else if(arr[mid]<arr[start] && arr[mid]<target){\n // return binarySearch(arr,mid+1,end,target);\n // }\n return binarySearch(arr,mid+1,end,target);\n }", "public static int binarySearch(int[] list, int key) {\n int low = 0;\n int high = list.length - 1;\n \n while (high >= low) {\n int mid = (low + high) / 2;\n if (key < list[mid])\n high = mid - 1;\n else if (key == list[mid])\n return mid;\n else\n low = mid + 1;\n }\n return -1 - 1; // now high < low, key not found\n }", "private static int binarySearch0(double[] a, int fromIndex, int toIndex,\n\t\t\tdouble key) {\n\t\tint low = fromIndex;\n\t\tint high = toIndex - 1;\n\n\t\twhile (low <= high) {\n\t\t\tint mid = (low + high) >>> 1;\n\t\t\t\tdouble midVal = a[mid];\n\n\t\t\t\tint cmp;\n\t\t\t\tif (midVal < key) {\n\t\t\t\t\tcmp = -1; // Neither val is NaN, thisVal is smaller\n\t\t\t\t} else if (midVal > key) {\n\t\t\t\t\tcmp = 1; // Neither val is NaN, thisVal is larger\n\t\t\t\t} else {\n\t\t\t\t\tlong midBits = Double.doubleToLongBits(midVal);\n\t\t\t\t\tlong keyBits = Double.doubleToLongBits(key);\n\t\t\t\t\tcmp = (midBits == keyBits ? 0 : // Values are equal\n\t\t\t\t\t\t(midBits < keyBits ? -1 : // (-0.0, 0.0) or (!NaN, NaN)\n\t\t\t\t\t\t\t1)); // (0.0, -0.0) or (NaN, !NaN)\n\t\t\t\t}\n\n\t\t\t\tif (cmp < 0)\n\t\t\t\t\tlow = mid + 1;\n\t\t\t\telse if (cmp > 0)\n\t\t\t\t\thigh = mid - 1;\n\t\t\t\telse\n\t\t\t\t\treturn mid; // key found\n\t\t}\n\t\treturn -(low + 1); // key not found.\n\t}", "public int binarySearchRecursion(int key, int first, int last) {\n if (first <= last) {\n int mid = (first + last) / 2;\n if (key == arr[mid]) return mid;\n else if (key < arr[mid]) return binarySearchRecursion(key, first, mid - 1);\n else return binarySearchRecursion(key, mid + 1, last);\n }\n return -1;\n }", "public static int binarySearch(int[] ary, int target, int start, int end){\r\n\t\t//get the middle index\r\n\t\tint middle = (end-start)/2 + start;\r\n\t\tint result = 0;\r\n\t\t\r\n\t\t//Some end cases (error, out of scope, etc)\r\n\t\tif(end-start<0||target<ary[0]||target>ary[ary.length-1])\r\n\t\t\t\r\n\t\t\t//If element is not in the array display \r\n\t\t\treturn -1;\r\n\r\n\r\n\t\t//Recursive case 1: If target is less than, the next search occurs within start and middle-1\r\n\r\n\t\tif (target < ary[middle]) {\r\n\t\t\tresult = binarySearch(ary, target, start, middle-1 );\r\n\t\t}\r\n\t\t\r\n\t\t//Recursive case 2: If target is greater than, the next search occurs within middle+1 and end \r\n\t\telse if(target > ary[middle]) {\r\n\t\t\tresult = binarySearch(ary, target, middle+1, end);\r\n\t\t\r\n\t\t//End cases: If target is equal, done.\r\n\t\t}\r\n\t\telse if (target == ary[middle]) {\r\n\t\t\tresult = middle;\r\n\t\t}\r\n\r\n\t\t//Return results\r\n\t\treturn result;\r\n\t}", "public static int binarySearch(int[] elements, int start, int end, int findMe) {\n if (start > end) {\n return -1;\n }\n Integer mid = (start + end) / 2;\n Integer midElement = elements[mid];\n //is mid the element we are looking?\n if (findMe == midElement) {\n return mid;\n }\n if (findMe < midElement) {\n //its in left half\n return binarySearch(elements, start, mid - 1, findMe);\n } else {\n //in right half of array\n return binarySearch(elements, mid + 1, end, findMe);\n }\n }", "private static int search(int[] nums, int target, int start, int end)\r\n\t{\n\t\tif (end == start)\r\n\t\t\treturn nums[start] == target ? start : -1;\r\n\t\t\r\n\t\tif(end - start == 1)\r\n\t\t{\r\n\t\t\tif(nums[start] == target)\r\n\t\t\t\treturn start;\r\n\t\t\tif(nums[end] == target)\r\n\t\t\t\treturn end;\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t\t\r\n\t\t// If there are more than two elements\r\n\t\tint mid = (start + end) / 2;\r\n\t\tif (nums[mid] == target)\r\n\t\t\treturn mid;\r\n\t\telse if (nums[mid] > target)\r\n\t\t\treturn search(nums, target, start, mid - 1);\r\n\t\telse\r\n\t\t\treturn search(nums, target, mid + 1, end);\r\n\t}", "private static boolean binarySearch(int[] data, int target, int low, int high) {\n if (low > high) {\n return false;\n } else {\n int mid = (low + high) / 2;\n if (target == data[mid]) {\n return true;\n } else if (target < data[mid]) {\n return binarySearch(data, target, low, mid - 1);\n } else {\n return binarySearch(data, target, mid + 1, high);\n }\n }\n }", "public static int binarySearch(int[] num, int target) {\n\t\tint left = 0;\n\t\tint right = num.length - 1;\n\t\twhile (left <= right) {\n\t\t\tint middle = (left+right)/2;\n\t\t\tif (num[middle] == target) {\n\t\t\t\treturn middle;\n\t\t\t} else if (num[middle] < target) {\n\t\t\t\tleft = middle + 1;\n\t\t\t} else {\n\t\t\t\tright = middle - 1;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn -1;\n\t}", "public int binarySearch(ArrayList<Integer> a, int val){\n int low = 0;\n int high = a.size() - 1;\n \n while(high - low > 3){\n int mid = (low + high)/2;\n if(a.get(mid) > val){\n high = mid - 1;\n }\n else{\n low = mid; \n }\n }\n int i;\n for(i=low; i<=high; ++i){\n if(a.get(i) > val)\n return i;\n }\n return i;\n }", "public static int binarySearch(int[] arr, int target){\n\t\tint start = 0;\n\t\tint end = arr.length - 1;\n\n\t\twhile (start <= end){\n\t\t\tint mid = (end + start) / 2;\n\t\t\tif(arr[mid] == target){\n\t\t\t\treturn mid;\n\t\t\t} else if(target < arr[mid]){\n\t\t\t\tend = mid - 1;\n\t\t\t} else if(target > arr[mid]){\n\t\t\t\tstart = mid + 1;\n\t\t\t}\n\t\t}\n\n\t\treturn -1;\n\t}", "public int binarySearch(int[] numbers, int numToSearch){\n\n QuickSort quickSort = new QuickSort();\n quickSort.sort(numbers);\n\n //Above code is tightly coupled with either of the algo to be used, we can not manage using sort algo dynamically.\n\n\n // Login to search\n\n //Return the number found\n\n return 5; //returning any hypothetical number\n }", "public static int binSearch(int[] a, int x) {\r\n int l = 0;\r\n int r = a.length;\r\n while (l != r) {\r\n // inv: l <= res <= r\r\n int m = (l + r) / 2;\r\n if (a[m] >= x) {\r\n r = m;\r\n }\r\n else {\r\n l = m + 1;\r\n }\r\n }\r\n return r;\r\n }", "public int search(int[] A, int target) {\n // write your code here\n if (A == null || A.length == 0) return -1;\n int start = 0, end = A.length - 1;\n while (start + 1 < end) {\n int mid = start + (end - start) / 2;\n if (A[mid] == target) return mid;\n if (A[mid] < A[start]) {\n if (target <= A[end] && target > A[mid]){\n start = mid;\n }\n else {\n end = mid;\n }\n }\n else {\n if (target >= A[start] && target < A[mid]) {\n end = mid;\n }\n else {\n start = mid;\n }\n }\n }\n if (A[start] == target) return start;\n if (A[end] == target) return end;\n return -1;\n }", "@Test\n public void testBinarySearch() {\n int actualResult = binarySearch.BinarySearch(new int[]{2,4,5}, 5);\n // check if the value is correct\n assertEquals(5, actualResult);\n }", "public int binarySearch(String searchKey) {\r\n\t\tint low = 0;\r\n\t\tint high = size -1;\r\n\t\tint middle;\r\n\t\t\r\n\t\twhile (low <= high) {\r\n\t\t\tmiddle = (high + low)/2;\r\n\t\t\tif (searchKey.equalsIgnoreCase(list[middle].getStudentName())) {\r\n\t\t\t\treturn middle; // Element was found\r\n\t\t\t}\r\n\t\t\telse if (searchKey.compareToIgnoreCase(list[middle].getStudentName())<0) {\r\n\t\t\t\thigh = middle -1;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tlow = middle +1;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn -1; // Element was not found\r\n\t}", "public void binSearch(int current, int first, int last) {\r\n long average2 = 0, timeB = 0, stanDev = 0;\r\n System.out.println(\"\\nBINARY SEARCH\\n\");\r\n for (int i = 0; i < 10; i++) {\r\n long start = System.nanoTime();\r\n while (last >= first) {\r\n int mid = (last + first) / 2;//FINDS THE MID WAY POINT IN ORDER TO KEEP HALF-ING THE SEARCH RESULTS.\r\n if (A[mid] == current) {\r\n long stop = System.nanoTime();\r\n long timelength = (stop - start);\r\n timeB += timelength; // USED FOR GETTING AVERAGE. \r\n bin[k][i] = timelength;//USED FOR STORING THE TIME IT TOOK FOR EACH TEST, IT IS USED LATER ON TO DISPLAY IN THE CHART.\r\n binary[i] = timelength;//USED FOR FINDING STANDARD DEVIATION.\r\n System.out.println(\"The number: \" + current + \" was found in the array index: \" + A[mid]\r\n + \"\\nIt took: \" + timelength + \" nanoseconds.\");\r\n break;\r\n\r\n } else if (A[mid] < current) {\r\n first = mid + 1;\r\n } else {\r\n last = mid - 1;\r\n }\r\n }\r\n }\r\n average2 = (timeB / 10);\r\n linAvAndDev[h][0] = average2;\r\n for (int j = 0; j < 10; j++) {\r\n stanDev += Math.pow((binary[j] - average2), 2.0);\r\n }\r\n stanDev /= 10;\r\n stanDev = (long) Math.sqrt(stanDev);\r\n linAvAndDev[h][1] = stanDev;\r\n System.out.println(\"The Avearge time for the Binary Search was: \" + average2 + \" nanoseconds.\"\r\n + \"\\nThe Standard Deviation time for the Binary Search was: \" + stanDev + \" nanoseconds.\");\r\n h += 1;\r\n k += 1;\r\n }", "private static boolean binarySearch(int[] arr, int num, int start, int end) {\n\t\tif(arr==null || arr.length==0){\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tint mid;\r\n\t\t\r\n\t\twhile(start<=end){\r\n\t\t\t\r\n\t\t\tmid= start+ (end-start)/2;\r\n\t\t\t\r\n\t\t\tif(arr[mid]==num){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\telse if(num < arr[mid]){\r\n\t\t\t\tend=mid-1;\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tstart=mid+1;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public int binarySearchRotated(int [] nums) {\n\t\tint n = nums.length;\n\t\tint low = 0;\n\t\tint high = n -1;\n\t\twhile(low <= high) {\n\t\t\tif(nums[low] <= nums[high]) return low;\n\t\t\tint mid = (low + high) >> 1;\n\t\t\tint next = (mid + 1) % n;\n\t\t\tint prev = (mid - 1) % n;\n\t\t\tif(nums[mid] <= nums[next] && nums[mid] <= nums[prev]) return mid;\n\t\t\telse if(nums[mid] <= nums[high]) high = mid-1;\n\t\t\telse if(nums[mid] >= nums[low]) low = mid+1;\n\t\t}\n\t\t\n\t\treturn -1;\n\t\t\n\t}", "public static int search(int[] nums, int target) {\n\n int length = nums.length;\n int i = 0;\n int j = length - 1;\n if (length == 0) return -1;\n\n while (true) {\n int index = (i + j) / 2;\n\n int value = nums[index];\n if (value == target) return index;\n\n //Using the invariant that either i - mid OR mid-j has\n //to be sorted at any point of the computation\n if (nums[j] >= value) {\n if (target > value && target <= nums[j]) i = index;\n else if (target > value && target > nums[j]) j = index;\n else j = index;\n }\n else {\n if (target < value && target >= nums[i]) j = index;\n else if (target < value && target < nums[i]) i = index;\n else i = index;\n }\n\n if (i + 1 == j) {\n if (nums[i] == target) return i;\n if (nums[j] == target) return j;\n return -1;\n }\n\n if (i == j || i >= length || j >= length) return -1;\n }\n\n }", "private static int binarySearch0(float[] a, int fromIndex, int toIndex,\n\t\t\tfloat key) {\n\t\tint low = fromIndex;\n\t\tint high = toIndex - 1;\n\n\t\twhile (low <= high) {\n\t\t\tint mid = (low + high) >>> 1;\n\t\tfloat midVal = a[mid];\n\n\t\tint cmp;\n\t\tif (midVal < key) {\n\t\t\tcmp = -1; // Neither val is NaN, thisVal is smaller\n\t\t} else if (midVal > key) {\n\t\t\tcmp = 1; // Neither val is NaN, thisVal is larger\n\t\t} else {\n\t\t\tint midBits = Float.floatToIntBits(midVal);\n\t\t\tint keyBits = Float.floatToIntBits(key);\n\t\t\tcmp = (midBits == keyBits ? 0 : // Values are equal\n\t\t\t\t(midBits < keyBits ? -1 : // (-0.0, 0.0) or (!NaN, NaN)\n\t\t\t\t\t1)); // (0.0, -0.0) or (NaN, !NaN)\n\t\t}\n\n\t\tif (cmp < 0)\n\t\t\tlow = mid + 1;\n\t\telse if (cmp > 0)\n\t\t\thigh = mid - 1;\n\t\telse\n\t\t\treturn mid; // key found\n\t\t}\n\t\treturn -(low + 1); // key not found.\n\t}", "public int binarySearchAlgo(int a[], int low, int high, int x) {\n\t\tint mid = (low + high) / 2;\n\t\t// If mid is x simply return the value\n\t\tif (a[mid] == x) {\n\t\t\treturn mid;\n\t\t}\n\t\t// If we didn't find any element simply return -1\n\t\tif (low == high) {\n\t\t\treturn -1;\n\t\t}\n\t\t// If mid element value is less then x go search higher(right) indices\n\t\tif (a[mid] < x) {\n\t\t\treturn binarySearchAlgo(a, mid + 1, high, x);\n\t\t}\n\t\t// If mid element value is less then x go search lower(left) indices\n\t\telse /* if (a[mid] > x) */ {\n\t\t\treturn binarySearchAlgo(a, low, mid - 1, x);\n\t\t}\n\n\t}", "private void BinarySearch(Node node, int index) {\n Node left, right;\n left = node.left;\n right = node.right;\n\n int leftIndex = (2 * index) + 1;\n int rightIndex = (2 * index) + 2;\n if (left != null) {\n ArrayTree[leftIndex] = left.key;\n BinarySearch(left, leftIndex);\n lastIndex = Math.max(leftIndex, lastIndex);\n } else {\n if (leftIndex < ArrayTree.length - 1) {\n ArrayTree[leftIndex] = 0;\n }\n }\n\n if (right != null) {\n ArrayTree[rightIndex] = right.key;\n BinarySearch(right, rightIndex);\n lastIndex = Math.max(rightIndex, lastIndex);\n } else {\n if (rightIndex < ArrayTree.length - 1) {\n ArrayTree[rightIndex] = 0;\n }\n }\n }", "public static int binarySearch(java.util.List arg0, java.lang.Object arg1, java.util.Comparator arg2)\n { return 0; }", "public int search(int[] nums, int target) {\n int left = 0;\n int right = nums.length - 1;\n while (left < right) {\n int mid = (left + right) / 2;\n if (nums[mid] > nums[right]) {\n left = mid + 1;\n } else {\n right = mid;\n }\n }\n int pivot = left;\n left = 0;\n right = nums.length - 1;\n while (left <= right) {\n int mid = (left + right) / 2;\n int realmid = (mid + pivot) % nums.length;\n if (nums[realmid] == target) {\n return realmid;\n } else if (nums[realmid] < target) {\n left = mid + 1;\n } else {\n right = mid - 1;\n }\n }\n return -1;\n }", "public boolean search(int[] nums, int target) {\n if (nums == null || nums.length == 0) return false;\n int l = 0;\n int r = nums.length - 1;\n int m;\n while (l <= r) {\n m = (l + r) / 2; \n if (nums[m] == target) return true;\n int low, high;\n if (nums[m] >=nums[l]) {\n if(nums[m] == nums[l]){\n l++;\n }\n else{\n if (nums[l] <= target && target < nums[m]) {\n r = m - 1;\n }\n else {\n l = m + 1;\n }\n }\n }\n else {\n if (nums[m] == nums[r]){\n r--;\n } \n else{\n if (nums[m] < target && target <= nums[r]) {\n l = m + 1;\n }\n else {\n r = m - 1;\n }\n }\n }\n }\n return false;\n }", "protected int search(double value) {\n int n = sequence.size();\n int left = 0, right = n - 1, index = 0;\n while (left != right) {\n index = (right - left) / 2 + left;\n if (value >= sequence.get(index == left ? index + 1 : index)) {\n left = index == left ? index + 1 : index;\n } else {\n right = index;\n }\n }\n while (left > 0 && value == sequence.get(left - 1)) {\n left -= 1;\n }\n return left;\n }", "private int binaryFind(K key) {\n int sortedCount = this.sortedCount.get();\n // if there are no sorted keys, or the first item is already larger than key -\n // return the head node for a regular linear search\n if ((sortedCount == 0) || comparator.compareKeyAndSerializedKey(key, readKey(FIRST_ITEM)) <= 0) {\n return HEAD_NODE;\n }\n\n // optimization: compare with last key to avoid binary search\n if (comparator.compareKeyAndSerializedKey(key, readKey((sortedCount - 1) * FIELDS + FIRST_ITEM)) > 0) {\n return (sortedCount - 1) * FIELDS + FIRST_ITEM;\n }\n\n int start = 0;\n int end = sortedCount;\n\n while (end - start > 1) {\n int curr = start + (end - start) / 2;\n\n if (comparator.compareKeyAndSerializedKey(key, readKey(curr * FIELDS + FIRST_ITEM)) <= 0) {\n end = curr;\n } else {\n start = curr;\n }\n }\n\n return start * FIELDS + FIRST_ITEM;\n }", "public static int iterativeBinarySearch(ArrayList<Pets> inputList, int targetId){\n\t\tint startIndex = 0;\n\t\tint endIndex = inputList.size()-1;\n\t\t\n\t\t// while the startIndex does not exceed the endIndex\n\t\twhile (startIndex <= endIndex){\n\t\t\t//calculate the midpoint\n\t\t\tint midpoint = (startIndex + endIndex)/2;\n\t\t\tif (targetId < inputList.get(midpoint).getId()){\n\t\t\t\t// if the targetId is smaller than the midpoint id, set the new endIndex to be the midpoint minus one.\n\t\t\t\tendIndex = midpoint-1;\n\t\t\t} else if (targetId > inputList.get(midpoint).getId()){\n\t\t\t\t// if the target Id is larger than the midpoint id, set the new startIndex to be the midpoint plus one.\n\t\t\t\tstartIndex = midpoint+1;\n\t\t\t} else {\n\t\t\t\t// last option is if the target id is equal to the midpoint id, we return our found result.\n\t\t\t\treturn midpoint;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// if we do not find the id within the input list, return -1.\n\t\treturn -1;\n\t}", "static Integer BinarySearchRec(Integer[] tablica, int value, int low, int high) {\n if (high < low) {\n return -1;\n }\n\n int mid = (low + high) / 2;\n\n if (tablica[mid] > value) {\n return BinarySearchRec(tablica, value, low, mid - 1);\n } else if (tablica[mid] < value) {\n return BinarySearchRec(tablica, value, mid + 1, high);\n } else {\n return mid;\n }\n }", "public static int binarySearch(int[] array, int value, int start, int end){\n if(start <= end){\n int mid = (start+end)/2;\n if (array[mid] == value) return mid;\n else if(array[mid] < value) start = mid+1;\n else end = mid-1;\n return binarySearch(array, value, start, end);\n }\n return -1;\n }", "private int search(int key,int start,int end)\n\t{\n\t\tint position=start+(end-start)/2;\n\t\t\n\t\t// if element is not present in the list\n\t\tif(start >= end)\n\t\t{\n\t\t\tif ((start == end) && (data[start] == key))\n\t\t\t\treturn start;\n\t\t\telse\n\t\t\t\treturn -1;\n\t\t}\n\t\t\n\t\tif(key==data[position])\n\t\t\treturn position;\n\t\t\n\t\telse if(key < data[position])\n\t\t\treturn search(key,start,position-1);\n\t\t\n\t\telse if(key > data[position])\n\t\t\treturn search(key,position+1,end);\n\t\t\n\t\treturn -1;\n\t\t\n\t}", "private int binarySearch(List<Span> spans, int line) {\n int left = 0,right = spans.size() - 1,mid,row;\n int max = right;\n while(left <= right){\n mid = (left + right) / 2;\n if(mid < 0) return 0;\n if(mid > max) return max;\n row = spans.get(mid).getLine();\n if(row == line) {\n return mid;\n }else if(row < line){\n left = mid + 1;\n }else{\n right = mid - 1;\n }\n }\n return Math.max(0,Math.min(left,max));\n }", "public static void main(String args[])\n {\n BinarySerach ob = new BinarySerach();\n int arr[] = { 2, 5, 3, 1, 7, 4 };\n\n\n // Arrays.binarySearch(arr,5);\nArrays.sort(arr);\n System.out.println(Arrays.binarySearch(arr,5));\n Arrays.sort(arr);\n int n = arr.length;\n int x = 5;\n int result = ob.binarySearch(arr, x);\n if (result == -1)\n System.out.println(\"Element not present\");\n else\n System.out.println(\"Element found at \"\n + \"index \" + result);\n }", "public int binarySearchInteger(int[] arr,int start,int end,int search){\r\n\t\tint found=0;\r\n\t\tif(start>end){\r\n\t\t\tfound=-1;\r\n\t\t}else{\r\n\t\t\tint mid=(start+end)/2;\r\n\t\t\tif(search==arr[mid]){\r\n\t\t\t\tfound=mid;\r\n\t\t\t}else if(search>arr[mid]){\r\n\t\t\t\tfound=binarySearchInteger(arr, mid+1, end, search);\r\n\t\t\t}else if(search<arr[mid]){\r\n\t\t\t\tfound=binarySearchInteger(arr, start, mid, search);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn found;\r\n\t}", "public static int binarySearch(int[] numbers, int target) {\n int min = 0;\n int max = numbers.length - 1;\n \n while (min <= max) {\n int mid = (max + min) / 2;\n if (numbers[mid] == target) {\n return mid; // found it!\n } else if (numbers[mid] < target) {\n min = mid + 1; // too small\n } else { // numbers[mid] > target\n max = mid - 1; // too large\n }\n }\n \n return -1; // not found\n }", "public static int binaryFind(int []A, int s, int e, int key) {\n\tif(s>e) return -1;\n\tint mid = (s+e)/2;\n\tif(A[mid] == key) return mid;\n if(A[mid] < key) return binaryFind(A, mid+1, e, key);\n else return binaryFind(A, s, mid-1, key); //(A[mid] > key)\n }", "public static int binarySearch(int[] A, int x) {\n int low = 0;\n int high = A.length - 1;\n int mid = -1;\n while (low <= high) {\n mid = low + (high-low)/2;\n if (x >= A[mid]) {\n high = mid - 1;\n } else {\n low = mid + 1;\n }\n }\n if (mid >= 0 && x == A[mid]) {\n return mid;\n }\n return -1;\n }", "public static void searchRange(int[] nums, int target){\n int index = binarySearch(nums, target);\n System.out.println(index);\n\n }", "public int BinarySearch(Object[] a, int size, Object key) {\n int start = 0;\n int end = size - 1;\n while (start < end) {\n int mid = (start + size) / 2;\n if (key.equals(a[mid])) {\n return mid;\n } else if (((Comparable) key).compareTo(a[mid]) > 0) {\n start = mid + 1;\n } else {\n end = mid - 1;\n }\n }\n return -1;\n }", "public static int search(int[] nums, int target) {\n int low=0;\n int high=nums.length-1;\n int middle=(high+low)>>1;\n\n for(int i=0;i<nums.length;i++){\n int num = nums[middle];\n if(target>num){\n low=middle+1;\n middle=(high+low)>>1;\n }else if(target<num){\n high=middle-1;\n middle=(high+low)>>1;\n } else{\n return middle;\n }\n\n }\n\n return -1;\n }", "public int binarySearchAlgo(int a[], int x) {\n\t\tint low = 0;\n\t\tint high = a.length - 1;\n\n\t\twhile (low <= high) {\n\t\t\tint mid = (low + high) / 2;\n\t\t\tif (a[mid] == x) {\n\t\t\t\treturn mid;\n\t\t\t}\n\t\t\tif (x > a[mid]) {\n\t\t\t\tlow = mid + 1;\n\t\t\t} else /* if(a[mid] < x) */ {\n\t\t\t\thigh = mid - 1;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}", "public static double binSearchT(int s, Integer[] a){\n Random rand = new Random();\n int searchVar;\n Stopwatch timer = new Stopwatch();\n Arrays.sort(a);\n for (int i = 0; i < s; i++){\n searchVar = (int)(rand.nextDouble()*a.length);\n Arrays.binarySearch(a, searchVar);\n }\n return timer.elapsedTime(); // the method returns the elapsed time\n }", "public static void main(String[] args) {\n\n Scanner sc = new Scanner(System.in);\n System.out.println(\"Enter number of elements\");\n int i = sc.nextInt();\n int[] array = new int[i];\n\n\n System.out.println(\"Enter \" + i + \" integers\");\n\n for (int c = 0; c < i; c++) {\n array[c] = sc.nextInt();\n }\n\n System.out.println(\"Enter value to find\");\n int search = sc.nextInt();\n\n MyBinarySearch mbs = new MyBinarySearch();\n Arrays.sort(array);\n System.out.println(search + \" was found at index \" + mbs.binarySearch(array, search) + \" in array \" + Arrays.toString(array));\n\n\n// MyBinarySearch mbs = new MyBinarySearch();\n// int[] arr = {2, 4, 6, 8, 10, 12, 14, 16};\n// System.out.println(\"Key 14's position: \"+mbs.binarySearch(arr, 14));\n// int[] arr1 = {6,34,78,123,432,900};\n// System.out.println(\"Key 432's position: \"+mbs.binarySearch(arr1, 432));\n }", "public static void main(String[] args) {\n\n List<Integer> integers = new ArrayList<>();\n for (int i = 0; i < 49; i++) {\n integers.add(i);\n }\n int i = Collections.binarySearch(integers, 20);\n System.out.println(i);\n System.out.println(integers.get(i));\n\n }", "static int findFirstPosition(int[] nums, int target,int left,int right){\n while(left<=right){\n int mid=left+(right-left)/2;\n\n //If the target found\n if(nums[mid]==target){\n //if this is the first target from left\n if(mid==0 ||nums[mid-1]<nums[mid])\n return mid;\n else{\n //there are more targets available at left\n right=mid-1;\n }\n }\n if(target<nums[mid]){\n right=mid-1;\n }else if(target>nums[mid]){\n left=mid+1;\n }\n\n }\n return -1;\n }", "private static boolean checkHalfway(int[] arr, int searchValue, int begin, int end) {\r\n\t\treturn searchValue < arr[(begin+end+1)/2];\r\n\t}", "public static int binarySearch(List<Integer> values,\r\n int target) {\r\n /**\r\n * comparing with linear search, binarySearch is \r\n * more effective, and this method is also used to \r\n * find a certain number in the list of integers \r\n */\r\n int result = -1;\r\n /**\r\n * @return -1 if there is not exist a number which we find in\r\n * the list \r\n */\r\n\r\n int lo = 0;\r\n int hi = values.size() - 1;\r\n /**\r\n * declard two variables lo and hi and save the first and the last \r\n * position into these two variables \r\n */\r\n\r\n while (lo < hi && result < 0) {\r\n int mid = (lo + hi) / 2;\r\n if (target == values.get(lo)) {\r\n result = lo;\r\n } // if\r\n else if (target == values.get(mid)) {\r\n result = mid;\r\n } // else if\r\n else if (target == values.get(hi)) {\r\n result = hi;\r\n } // else if\r\n else if (target < values.get(mid)) {\r\n hi = mid - 1;\r\n } // else if\r\n else {\r\n lo = mid + 1;\r\n } // else\r\n } // while\r\n\r\n return result;\r\n }", "public int binarySearch(Long[] keys,Long target){\n\t\tif(keys ==null || keys.length ==0){\n\t\t\treturn -1;\n\t\t}\n\t\tint l = 0;\n\t\tint r = keys.length-1;\n\t\twhile(l<r){\n\t\t\tint mid = l + (r-l)/2;\n\t\t\tif(keys[mid] == target)\n\t\t\t\treturn mid;\n\t\t\tif(keys[mid]<target)\n\t\t\t\tl = mid+1;\n\t\t\telse\n\t\t\t\tr = mid-1;\n\t\t}\n\t\treturn l;\n\t\t\n\t}" ]
[ "0.7350325", "0.72134", "0.7085227", "0.7058102", "0.7029579", "0.70146394", "0.7008919", "0.70034033", "0.6980041", "0.697629", "0.69752634", "0.6962465", "0.6934485", "0.6926648", "0.69064194", "0.68980336", "0.6892363", "0.6869719", "0.6860575", "0.68521893", "0.6849912", "0.6807194", "0.6800304", "0.676737", "0.67659175", "0.6761156", "0.67229414", "0.6719611", "0.66895765", "0.66729426", "0.6645056", "0.6643333", "0.6643116", "0.66193134", "0.6607009", "0.65992534", "0.6592511", "0.65894914", "0.6561976", "0.6558717", "0.65369225", "0.65285707", "0.6511967", "0.65109855", "0.65092736", "0.6489162", "0.648798", "0.6481573", "0.6481406", "0.64790225", "0.6477484", "0.6473492", "0.64670575", "0.6463073", "0.6460826", "0.6457505", "0.645388", "0.6447127", "0.64352286", "0.64230585", "0.6417781", "0.6414759", "0.63931715", "0.63890576", "0.6388085", "0.63772535", "0.6376698", "0.6353274", "0.6353225", "0.6345942", "0.6342354", "0.6337028", "0.6336034", "0.6329559", "0.63233453", "0.6322058", "0.6321719", "0.63202345", "0.6319453", "0.6314198", "0.63093597", "0.6307287", "0.63067305", "0.6306387", "0.6305881", "0.6294359", "0.62847656", "0.62787855", "0.62715334", "0.62588876", "0.62479967", "0.6238315", "0.62377685", "0.6235055", "0.62324595", "0.6223897", "0.6200318", "0.6198829", "0.61944646", "0.61901593" ]
0.7487786
0
TIME COMPLEXITY FOR BINARY SEARCH IS O(log3n)
public int ternarySearch(int[] array,int target) { return 1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static double binSearchT(int s, Integer[] a){\n Random rand = new Random();\n int searchVar;\n Stopwatch timer = new Stopwatch();\n Arrays.sort(a);\n for (int i = 0; i < s; i++){\n searchVar = (int)(rand.nextDouble()*a.length);\n Arrays.binarySearch(a, searchVar);\n }\n return timer.elapsedTime(); // the method returns the elapsed time\n }", "private static void task2(int nUMS, BinarySearchTree<Integer> t) {\n\t\tSystem.out.println(\"Binary Search Started...\");\n\t double search_start = 0, search_end = 0;\n\t int totalkeymatched = 0;\n\n\t search_start = System.nanoTime();\n\t \n\t for (int z = 0; z < nUMS; z++) {\n\t \tint checker= GenerateInt.generateNumber();\n\t \t\n//\t \tSystem.out.println(GenerateStrings.getAlphaNumericString(limit));\n\t if (t.contains(checker)) {\n\t\n//\t System.out.println(\"Key Matches\");\n\t totalkeymatched++;\n\t \t }\n\t }\n\t search_end = System.nanoTime();\n\t System.out.println(\"Average time for each search: \" + (search_end - search_start) / nUMS + \" nanoseconds\");\n\t System.out.println(\"TOTAL MATCHES \" + totalkeymatched);\n\t\t\n\t}", "public static void searchTest() {\n\t\t//linear tests\n\t\tStopWatch1 timer;\n\t\tint[] array = generateArray(5000000,1,5000000);\n\t\tSystem.out.printf(\"%15s%10s%10s%10s%10s%10s%n\",\"Size\",\"Sort Type\",\"Pre-sort\",\"Value\",\"Index\",\"Time\");\n\t\tfor(int i = 0; i< 5; i++) {\n\t\t\ttimer = new StopWatch1();\n\t\t\tint temp = (int)(Math.random() * (5000000)) +1;\n\t\t\tSystem.out.printf(\"%15d%10s%10s%10d\",5000000,\"Linear\",\"Random\",temp);\n\t\t\ttimer.start();\n\t\t\tint result = Search.linearSearch(array, temp);\n\t\t\ttimer.stop();\n\t\t\tif(result>0) {\n\t\t\t\tSystem.out.printf(\"%10d\",result);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tSystem.out.printf(\"%10s\",\"Not Found\");\n\t\t\t}\n\t\t\tSystem.out.printf(\"%10d%n\", timer.getElapsedTime());\n\t\t\t\n\t\t}\n\t\tSort.mergeSort(array);\n\t\tfor(int i = 0; i< 5; i++) {\n\t\t\ttimer = new StopWatch1();\n\t\t\tint temp = (int)(Math.random() * (5000000)) +1;\n\t\t\tSystem.out.printf(\"%15d%10s%10s%10d\",5000000,\"Linear\",\"Sorted\",temp);\n\t\t\tint result = Search.linearSearch(array, temp);\n\t\t\tif(result>0) {\n\t\t\t\tSystem.out.printf(\"%10d\",result);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tSystem.out.printf(\"%10s\",\"Not Found\");\n\t\t\t}\n\t\t\tSystem.out.printf(\"%10d%n\", timer.getElapsedTime());\n\t\t}\n\t\tfor(int i =0; i< 5; i++) {\n\t\t\ttimer = new StopWatch1();\n\t\t\tint temp = (int)(Math.random() * (5000000)) +1;\n\t\t\tSystem.out.printf(\"%15d%10s%10s%10d\",5000000,\"Binary\",\"Sorted\",temp);\n\t\t\tint result = Search.binarySearch(array, temp);\n\t\t\tif(result>0) {\n\t\t\t\tSystem.out.printf(\"%10d\",result);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tSystem.out.printf(\"%10s\",\"Not Found\");\n\t\t\t}\n\t\t\tSystem.out.printf(\"%10d%n\", timer.getElapsedTime());\n\t\t}\n\t}", "public static void main(String[] args){\n int s = 80;\n int n = (int) Math.pow(10, 7);\n Integer[] a = new Integer[n];\n Random rand = new Random();\n for (int i = 0; i < n; i++){\n a[i] = (int) (n*rand.nextDouble());\n }\n double binTime = binSearchT(s, a);\n double linTime = linSearchT(s, a);\n System.out.println(\"binTime: \"+ binTime);\n System.out.println(\"linTime: \"+ linTime);\n\n }", "public static double linSearchT(int s, Integer[] a){\n Random rand = new Random();\n int searchVar;\n Stopwatch timer = new Stopwatch();\n for (int i = 0; i < s; i++){\n searchVar = (int)(rand.nextDouble()*a.length);\n for (int j = 0; j < a.length; j++){\n if (a[j] == searchVar)\n break;\n }\n }\n return timer.elapsedTime(); // the method returns the elapsed time\n }", "private static void task222(int nUMS, RedBlackBST<Integer, Integer> i) {\n\t\tSystem.out.println(\"RED BLAST BST Started Search...\");\n\t double search_start = 0, search_end = 0;\n\t int totalkeymatched = 0;\n\n\t search_start = System.nanoTime();\n\t \n\t for (int z = 0; z < nUMS; z++) {\n\t \tint checker= GenerateInt.generateNumber();\n\t \t\n//\t \tSystem.out.println(GenerateStrings.getAlphaNumericString(limit));\n\t if (i.contains(checker)) {\n\t\n//\t System.out.println(\"Key Matches\");\n\t totalkeymatched++;\n\t \t }\n\t }\n\t search_end = System.nanoTime();\n\t System.out.println(\"Average time for each search: \" + (search_end - search_start) / nUMS + \" nanoseconds\");\n\t System.out.println(\"TOTAL MATCHES \" + totalkeymatched);\n\n\t}", "static int binarySearch(long[] paramArrayOflong, int paramInt, long paramLong) {\n }", "private static void task2222(int nUMS, SplayTree<Integer> j) {\n\t\tSystem.out.println(\"SPLAY Started Search...\");\n\t double search_start = 0, search_end = 0;\n\t int totalkeymatched = 0;\n\n\t search_start = System.nanoTime();\n\t \n\t for (int z = 0; z < nUMS; z++) {\n\t \tint checker= GenerateInt.generateNumber();\n\t \t\n//\t \tSystem.out.println(GenerateStrings.getAlphaNumericString(limit));\n\t if (j.contains(checker)) {\n\t\n//\t System.out.println(\"Key Matches\");\n\t totalkeymatched++;\n\t \t }\n\t }\n\t search_end = System.nanoTime();\n\t System.out.println(\"Average time for each search: \" + (search_end - search_start) / nUMS + \" nanoseconds\");\n\t System.out.println(\"TOTAL MATCHES \" + totalkeymatched);\n\n\t}", "@Test\n\tpublic void testBinarySearch() {\n\t\tint[] arr0 = {0, 1, 2, 3, 4, 5};\n\t\tassertEquals(0, _01_BinarySearch.binarySearch(arr0, 0, arr0.length - 1, 0));\n\t\tassertEquals(1, _01_BinarySearch.binarySearch(arr0, 0, arr0.length - 1, 1));\n\t\tassertEquals(2, _01_BinarySearch.binarySearch(arr0, 0, arr0.length - 1, 2));\n\t\tassertEquals(3, _01_BinarySearch.binarySearch(arr0, 0, arr0.length - 1, 3));\n\t\t\n\t\tassertEquals(-1, _01_BinarySearch.binarySearch(arr0, 0, arr0.length - 1, 99));\n\t\t\n\t\tint[] arr1 = {0, 43, 209, 388, 401, 599};\n\t\tassertEquals(2, _01_BinarySearch.binarySearch(arr1, 0, arr0.length - 1, 209));\n\t\tassertEquals(-1, _01_BinarySearch.binarySearch(arr1, 0, arr0.length - 1, 45));\n\t}", "public void search(IndexShort < O > index, short range, short k)\n throws Exception {\n // assertEquals(index.aDB.count(), index.bDB.count());\n // assertEquals(index.aDB.count(), index.bDB.count());\n // index.stats();\n index.resetStats();\n // it is time to Search\n int querySize = 1000; // amount of elements to read from the query\n String re = null;\n logger.info(\"Matching begins...\");\n File query = new File(testProperties.getProperty(\"test.query.input\"));\n File dbFolder = new File(testProperties.getProperty(\"test.db.path\"));\n BufferedReader r = new BufferedReader(new FileReader(query));\n List < OBPriorityQueueShort < O >> result = new LinkedList < OBPriorityQueueShort < O >>();\n re = r.readLine();\n int i = 0;\n long realIndex = index.databaseSize();\n\n while (re != null) {\n String line = parseLine(re);\n if (line != null) {\n OBPriorityQueueShort < O > x = new OBPriorityQueueShort < O >(\n k);\n if (i % 100 == 0) {\n logger.info(\"Matching \" + i);\n }\n\n O s = factory.create(line);\n if (factory.shouldProcess(s)) {\n if(i == 279){\n System.out.println(\"hey\");\n }\n index.searchOB(s, range, x);\n result.add(x);\n i++;\n }\n }\n if (i == querySize) {\n logger.warn(\"Finishing test at i : \" + i);\n break;\n }\n re = r.readLine();\n }\n \n logger.info(index.getStats().toString());\n \n int maxQuery = i;\n // logger.info(\"Matching ends... Stats follow:\");\n // index.stats();\n\n // now we compare the results we got with the sequential search\n Iterator < OBPriorityQueueShort < O >> it = result.iterator();\n r.close();\n r = new BufferedReader(new FileReader(query));\n re = r.readLine();\n i = 0;\n while (re != null) {\n String line = parseLine(re);\n if (line != null) {\n if (i % 300 == 0) {\n logger.info(\"Matching \" + i + \" of \" + maxQuery);\n }\n O s = factory.create(line);\n if (factory.shouldProcess(s)) {\n OBPriorityQueueShort < O > x2 = new OBPriorityQueueShort < O >(\n k);\n searchSequential(realIndex, s, x2, index, range);\n OBPriorityQueueShort < O > x1 = it.next();\n //assertEquals(\"Error in query line: \" + i + \" slice: \"\n // + line, x2, x1); \n \n assertEquals(\"Error in query line: \" + i + \" \" + index.debug(s) + \"\\n slice: \"\n + line + \" \" + debug(x2,index ) + \"\\n\" + debug(x1,index), x2, x1);\n\n i++;\n }\n \n }\n if (i == querySize) {\n logger.warn(\"Finishing test at i : \" + i);\n break;\n }\n re = r.readLine();\n }\n r.close();\n logger.info(\"Finished matching validation.\");\n assertFalse(it.hasNext());\n }", "public void binSearch(int current, int first, int last) {\r\n long average2 = 0, timeB = 0, stanDev = 0;\r\n System.out.println(\"\\nBINARY SEARCH\\n\");\r\n for (int i = 0; i < 10; i++) {\r\n long start = System.nanoTime();\r\n while (last >= first) {\r\n int mid = (last + first) / 2;//FINDS THE MID WAY POINT IN ORDER TO KEEP HALF-ING THE SEARCH RESULTS.\r\n if (A[mid] == current) {\r\n long stop = System.nanoTime();\r\n long timelength = (stop - start);\r\n timeB += timelength; // USED FOR GETTING AVERAGE. \r\n bin[k][i] = timelength;//USED FOR STORING THE TIME IT TOOK FOR EACH TEST, IT IS USED LATER ON TO DISPLAY IN THE CHART.\r\n binary[i] = timelength;//USED FOR FINDING STANDARD DEVIATION.\r\n System.out.println(\"The number: \" + current + \" was found in the array index: \" + A[mid]\r\n + \"\\nIt took: \" + timelength + \" nanoseconds.\");\r\n break;\r\n\r\n } else if (A[mid] < current) {\r\n first = mid + 1;\r\n } else {\r\n last = mid - 1;\r\n }\r\n }\r\n }\r\n average2 = (timeB / 10);\r\n linAvAndDev[h][0] = average2;\r\n for (int j = 0; j < 10; j++) {\r\n stanDev += Math.pow((binary[j] - average2), 2.0);\r\n }\r\n stanDev /= 10;\r\n stanDev = (long) Math.sqrt(stanDev);\r\n linAvAndDev[h][1] = stanDev;\r\n System.out.println(\"The Avearge time for the Binary Search was: \" + average2 + \" nanoseconds.\"\r\n + \"\\nThe Standard Deviation time for the Binary Search was: \" + stanDev + \" nanoseconds.\");\r\n h += 1;\r\n k += 1;\r\n }", "private static void task22(int nUMS, AVLTree<Integer> h) {\n\t\t\n\t\tSystem.out.println(\"AVL Started...\");\n\t double search_start = 0, search_end = 0;\n\t int totalkeymatched = 0;\n\n\t search_start = System.nanoTime();\n\t \n\t for (int z = 0; z < nUMS; z++) {\n\t \tint checker= GenerateInt.generateNumber();\n\t \t\n//\t \tSystem.out.println(GenerateStrings.getAlphaNumericString(limit));\n\t if (h.contains(checker)) {\n\t\n//\t System.out.println(\"Key Matches\");\n\t totalkeymatched++;\n\t \t }\n\t }\n\t search_end = System.nanoTime();\n\t System.out.println(\"Average time for each search: \" + (search_end - search_start) / nUMS + \" nanoseconds\");\n\t System.out.println(\"TOTAL MATCHES \" + totalkeymatched);\n\t\t\n\t\t\n\t}", "public static void ThreeSum_binsearch(int[] a, int k)\r\n\t{\r\n\t // sort the array\r\n\t Arrays.sort(a);\r\n\t for (int i = 0; i < a.length; ++i)\r\n\t {\r\n\t for (int j = i+1; j < a.length; ++j)\r\n\t {\r\n\t int diff = k - (a[i] + a[j]);\r\n\t int idx = Arrays.binarySearch(a, j+1, a.length, diff);\r\n\t if (idx > 0)\r\n\t {\r\n\t System.out.println(\"[\" + a[i] + \",\" + a[j] + \",\" + a[idx] + \"]\");\r\n\t }\r\n\t }\r\n\t }\r\n\t}", "abstract int binSearch(int[] array, int num, int left, int right);", "public static void main(String[] args){\n int MIN = Integer.parseInt(args[0]);\n MAX = Integer.parseInt(args[1]);\n cutoffs = new int[args.length - 2];\n cache = new ArrayList<IndexedArrayList<SuperSavvyTrieHelper2>>();\n for (int i = 2; i < args.length; i++){\n cutoffs[i - 2] = Integer.parseInt(args[i]);\n cache.add(new IndexedArrayList<SuperSavvyTrieHelper2>());\n }\n for (int i = 0; i < cutoffs.length / 2; i++){\n int temp = cutoffs[i];\n cutoffs[i] = cutoffs[cutoffs.length - 1 - i];\n cutoffs[cutoffs.length - 1 - i] = temp;\n }\n multiplicitiesUsed = new boolean[MAX + 1];\n basesUsed = new DoublyLinkedArray(MAX + 1);\n SuperSavvyTrieHelper2.setCorrespondance(basesUsed);\n /*\n long count1 = lowerRecursion(MAX, 0);\n long count2 = middleRecursion(MAX, 0);\n long count3 = upperRecursion(MAX, 0);\n long total = count1 + count2 + count3;\n System.out.printf(\"%d + %d + %d = %d\\n\", count1, count2, count3, total);\n */\n hitCounts = new long[cutoffs.length];\n missCounts = new long[cutoffs.length];\n statCollector = new StatCollector(cutoffs);\n\n long startTime = System.nanoTime();\n long[] values = new long[MAX - MIN + 1];\n for (int i = MIN; i <= MAX; i++) {\n values[i - MIN] = upperRecursionWrapper(i);\n }\n //long[] testValues = new long[] {1752443,1911046, 2067456,2249444,2429337, 2647532,2852449,3101167,3350292,3632299,3916575};\n for (int i = 0; i < values.length; i++){\n //if (testValues[i] != values[i]){\n System.out.printf(\"%d: %d\\n\", i + MIN, values[i]);\n //}\n }\n long endTime = System.nanoTime();\n System.out.printf(\"%f,\", (double)(endTime - startTime) / 1000000000.0);\n long totalMissCounts = 0;\n long totalMissWeight1 = 0;\n long totalMissWeight2 = 0;\n long totalMissWeight3 = 0;\n /*\n for (int i = 0; i < cutoffs.length; i++){\n long totalCounts = hitCounts[i] + missCounts[i];\n totalMissCounts += missCounts[i];\n totalMissWeight1 += missCounts[i] * cutoffs[i];\n totalMissWeight2 += (hitCounts[i] / missCounts[i]) * cutoffs[i];\n totalMissWeight3 += (hitCounts[i] - missCounts[i]) * cutoffs[i] * cutoffs[i];\n System.out.printf(\"\\tCache %d: %d/%d/%d (%.5f%%)\", cutoffs[i], hitCounts[i], missCounts[i], totalCounts, (double) hitCounts[i] / totalCounts);\n }\n System.out.printf(\"\\t\\tMissCounts: %d, weighted: %d, ratio: %d, diff^2: %d\\n\", totalMissCounts, totalMissWeight1, totalMissWeight2, totalMissWeight3);\n */\n statCollector.printAll();\n }", "protected int find_among_b(Among v[])\n {\n\tint i = 0;\n\tint j = v.length;\n\n\tint c = cursor;\n\tint lb = limit_backward;\n\n\tint common_i = 0;\n\tint common_j = 0;\n\n\tboolean first_key_inspected = false;\n\n\twhile (true) {\n\t int k = i + ((j - i) >> 1);\n\t int diff = 0;\n\t int common = common_i < common_j ? common_i : common_j;\n\t Among w = v[k];\n\t int i2;\n\t for (i2 = w.s.length - 1 - common; i2 >= 0; i2--) {\n\t\tif (c - common == lb) {\n\t\t diff = -1;\n\t\t break;\n\t\t}\n\t\tdiff = current.charAt(c - 1 - common) - w.s[i2];\n\t\tif (diff != 0) break;\n\t\tcommon++;\n\t }\n\t if (diff < 0) {\n\t\tj = k;\n\t\tcommon_j = common;\n\t } else {\n\t\ti = k;\n\t\tcommon_i = common;\n\t }\n\t if (j - i <= 1) {\n\t\tif (i > 0) break;\n\t\tif (j == i) break;\n\t\tif (first_key_inspected) break;\n\t\tfirst_key_inspected = true;\n\t }\n\t}\n\twhile (true) {\n\t Among w = v[i];\n\t if (common_i >= w.s.length) {\n\t\tcursor = c - w.s.length;\n\t\tif (w.method == null) return w.result;\n\n\t\tboolean res;\n\t\ttry {\n\t\t Object resobj = w.method.invoke(this);\n\t\t res = resobj.toString().equals(\"true\");\n\t\t} catch (InvocationTargetException e) {\n\t\t res = false;\n\t\t // FIXME - debug message\n\t\t} catch (IllegalAccessException e) {\n\t\t res = false;\n\t\t // FIXME - debug message\n\t\t}\n\t\tcursor = c - w.s.length;\n\t\tif (res) return w.result;\n\t }\n\t i = w.substring_i;\n\t if (i < 0) return 0;\n\t}\n }", "public static void main(String[] args) {\n\t\tint size = 600_000_000;\n\t\tint[] mas = new int[size];\n\t\tfor (int i = 0; i < size; i++) {\n\t\t\tmas[i] = i;\n\t\t}\n\n\t\t// positive test\n\t\tint target = size - 1;\n\n\t\tlong start = System.currentTimeMillis();\n\t\tlinearSearchTestPositive(mas, target, target);\n\t\tlong end = System.currentTimeMillis();\n\t\tSystem.out.println(end - start);\n\n\n\t\tlong start1 = System.currentTimeMillis();\n\t\tbinarySearchTestPositive(mas, target, target);\n\t\tlong end1 = System.currentTimeMillis();\n\t\tSystem.out.println(end1 - start1);\n\t}", "Long[] searchSolution(int timeLimit, Graph g);", "void compareSearch();", "private int LinearSearchAfterBinary(String filename, ArrayList<Integer> matchingPositions, String wordToBeSearched, int linesToSkip, boolean reverseFile)\n {\n try\n {\n //Try to open the index file using a Scanner\n Scanner indexFileFileScanner = new Scanner(new File(filename + \".ndx\"));\n\n //Counter for the data page accesses\n int dataPageCounter = 0;\n\n //Flag for the search process status\n boolean searchStatus = true;\n\n //Counter of the word matching\n int wordOccurrences = matchingPositions.size();\n\n //Check whether to search the top or the bottom part of the file\n if(reverseFile)\n {\n //Create an ArrayList object to store the part of the file to continue the search\n ArrayList<String> fileLines = new ArrayList<>();\n\n //Get the necessary lines from the file\n for(int index = 0; index < linesToSkip; index++)\n {\n fileLines.add(indexFileFileScanner.nextLine());\n }\n\n //If the word to be searched length is valid, scan every data page in the ArrayList, in reverse order\n while(fileLines.size() != dataPageCounter && searchStatus)\n {\n //Fetch the data page into the ByteBuffer\n ByteBuffer bytePageBuffer = ByteBuffer.wrap(StringToByteArrayTranslator(fileLines.get(fileLines.size() - dataPageCounter - 1), SizeConstants.getBufferSize()));\n\n //Search for the word to be searched in the data page\n searchStatus = LinearSearchBytePage(wordToBeSearched,bytePageBuffer.array(), matchingPositions);\n\n //Count the data page access\n dataPageCounter++;\n\n //Check if there no more occurrences of the word to be searched\n if(!matchingPositions.isEmpty())\n {\n //If there are continue the search\n if(wordOccurrences != matchingPositions.size())\n {\n wordOccurrences = matchingPositions.size();\n }\n else\n {\n //Stop the search\n searchStatus = false;\n }\n }\n }\n }\n else\n {\n //Skip lines of the file\n SkipLines(indexFileFileScanner, linesToSkip);\n\n //If the word to be searched length is valid, scan every data page in the file\n while(indexFileFileScanner.hasNext() && searchStatus)\n {\n //Fetch the data page into the ByteBuffer\n ByteBuffer bytePageBuffer = ByteBuffer.wrap(StringToByteArrayTranslator(indexFileFileScanner.nextLine(), SizeConstants.getBufferSize()));\n\n //Search for the word to be searched in the data page\n searchStatus = LinearSearchBytePage(wordToBeSearched,bytePageBuffer.array(), matchingPositions);\n\n //Count the data page access\n dataPageCounter++;\n\n //Check if there no more occurrences of the word to be searched\n if(!matchingPositions.isEmpty())\n {\n //If there are continue the search\n if(wordOccurrences != matchingPositions.size())\n {\n wordOccurrences = matchingPositions.size();\n }\n else\n {\n //Stop the search\n searchStatus = false;\n }\n }\n }\n }\n\n //Close the FileScanner\n indexFileFileScanner.close();\n\n //Return the number of data page accesses\n return dataPageCounter;\n }\n catch (FileNotFoundException e)\n {\n //Catch the FileNotFoundException and inform the user\n System.out.println(\"File: \" + this.Filename + \" cannot be opened.\");\n e.printStackTrace();\n return 0;\n }\n }", "@Test\n\tpublic void testBinarySearch() {\n\t\tint[] numbers = {0, 1, 2, 3, 4, 5, 6};\n\t\tint r1 = _01_BinarySearch.binarySearch(numbers, 0, numbers.length - 1, 4);\n\t\tassertEquals(4, r1);\n\t\t\n\t\tint[] numbers2 = {2, 4, 7, 9, 14};\n\t\tint r2 = _01_BinarySearch.binarySearch(numbers2, 0, numbers2.length - 1, 8);\n\t\tassertEquals(-1, r2);\n\t\t\n\t\tint[] numbers3 = {3, 5, 10, 16, 25};\n\t\tint r3 = _01_BinarySearch.binarySearch(numbers3, 0, numbers3.length - 1, 25);\n\t\tassertEquals(4, r3);\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\n\t\tint a[] = {2,1,3,-4,-2};\n\t\t//int a[] = {1 ,2, 3, 7, 5};\n\t\tboolean found = false;\n\t\t\n\t\t//this will solve in o n^2\n\t\tfor(int i = 0 ; i < a.length ; i++){\n\t\t\tint sum = 0;\n\t\t\tfor(int j = i ; j< a.length ; j++){\n\t\t\t\tsum += a[j] ;\n\t\t\t\tif(sum == 0){\n\t\t\t\t\tfound = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tif(found)\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\t\n\t\t// link : https://www.youtube.com/watch?v=PSpuM9cimxA&list=PLKKfKV1b9e8ps6dD3QA5KFfHdiWj9cB1s&index=49\n\t\tSystem.out.println(found + \" found\");\n\t\tfound = false;\n\t\t//solving with O of N with the help sets\n\t\t// x + 0 = y\n\t\tSet<Integer> set = new HashSet<>();\n\t\tint sum = 0;\n\t\tfor(int element : a){\n\t\t\tset.add(sum);\n\t\t\tsum += element;\n\t\t\tif(set.contains(sum)){\n\t\t\t\tfound = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println();\n\t\tSystem.out.println(set);\n\t\t\n\t\tSystem.out.println(found + \" found\");\n\t\t\n\t\t\n\t\tfound = false;\n\t\t// when the sum of subarray is K\n\t\t\n\t\t//solving with O of N with the help sets\n\t\t//x + k = y >>>\n\t\tSet<Integer> set1 = new HashSet<>();\n\t\tint k = 12;\n\t\tint summ = 0;\n\t\tfor(int element : a){\n\t\t\tset1.add(summ);\n\t\t\tsumm += element;\n\t\t\tif(set1.contains(summ - k)){ // y - k = x(alredy presnt or not)\n\t\t\t\tfound = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(set1);\n\t\tSystem.out.println();\n\t\tSystem.out.println(found + \" found\");\n\t\t\n\t\t\n\t}", "static int binarySearch(int[] paramArrayOfint, int paramInt1, int paramInt2) {\n }", "static double binarySearchForBuckets (double[] splits, double feature, boolean keepInvalid) { throw new RuntimeException(); }", "@Test\n public void testBinarySearch() {\n System.out.println(\"binarySearch\");\n int[] index = {10, 11, 12, 13, 14};\n int key = 12;\n int begin = 0;\n int end = 5;\n int expResult = 2;\n int result = Utils.binarySearch(index, key, begin, end);\n assertEquals(expResult, result);\n }", "private int binarySearch(T element) {\n int start = 0, end = sortedArray.size(), mid = 0;\n while (start < end) {\n mid = (end + start) / 2;\n int cmp = sortedArray.get(mid).compareTo(element);\n if (cmp == 0) {\n start = end = mid;\n }\n else if (cmp < 0) {\n start = mid + 1;\n }\n else {\n end = mid;\n }\n }\n return start;\n }", "private Integer serialSearch() {\n int currentIndex = startIndex;\n for (int i = start; i < end; i++) {\n if (this.searchIndex == currentIndex) {\n return currentIndex;\n }\n currentIndex++;\n }\n return 0;\n }", "private int recFind(int searchKey, int lowerbound, int upperbound) {\n\t\tint curIn = (lowerbound + upperbound) / 2;\n\t\tif (arr[curIn] == searchKey)\n\t\t\treturn curIn;\n\t\telse if (lowerbound > upperbound)\n\t\t\treturn n;\n\t\telse {\n\t\t\tif (arr[curIn] < searchKey)\n\t\t\t\treturn recFind(searchKey, curIn + 1, upperbound);\n\t\t\telse\n\t\t\t\treturn recFind(searchKey, lowerbound, curIn - 1);\n\t\t}\n\t}", "public abstract Solution<T> search(Searchable<T> s);", "public int binarySearch(Long[] keys,Long target){\n\t\tif(keys ==null || keys.length ==0){\n\t\t\treturn -1;\n\t\t}\n\t\tint l = 0;\n\t\tint r = keys.length-1;\n\t\twhile(l<r){\n\t\t\tint mid = l + (r-l)/2;\n\t\t\tif(keys[mid] == target)\n\t\t\t\treturn mid;\n\t\t\tif(keys[mid]<target)\n\t\t\t\tl = mid+1;\n\t\t\telse\n\t\t\t\tr = mid-1;\n\t\t}\n\t\treturn l;\n\t\t\n\t}", "private static int bSearch(int[] elements, int key) {\n int left = 0, right = elements.length - 1, mid = 0;\n while (left <= right) {\n mid = (left + right) / 2;\n\n if (key < elements[mid]) {\n right = mid - 1;\n } else if (key == elements[mid]) {\n return mid;\n } else {\n left = mid + 1;\n }\n }\n return -1;\n }", "public static int binSearch(int[] a, int x) {\r\n int l = 0;\r\n int r = a.length;\r\n while (l != r) {\r\n // inv: l <= res <= r\r\n int m = (l + r) / 2;\r\n if (a[m] >= x) {\r\n r = m;\r\n }\r\n else {\r\n l = m + 1;\r\n }\r\n }\r\n return r;\r\n }", "@SuppressWarnings(\"unchecked\") // stops Java complaining about the call to compare\n private int findIndexOf(Comparable<E> item) {\n if (count == 0) { //this is where the binary search happens that reduces the time and computational power it takes to search the collection\n return count; // if count == 0 it returns the count variable to break the loop and show that the collection is empty\n }\n int low = 0; //Sets up three variables to keep track of the start and end values of index and the middle of the collection, this helps\n int high = count - 1; //the search algorithm becase the array always knows where the middle is and so the collection can contnually half using the three\n int mid; //variables to find a single value, while the low is less or equal to the high variable,\n while (low <= high) {\n\n mid = (low + high) / 2;\n\n int compareValue = item.compareTo(data[mid]); // the value we are trying to find\n if (compareValue == 0) return mid; //returns the middle value,\n if (compareValue > 0) low = mid + 1; //if greater than it changes low value to equal the middle, plus one(as mid is already checked)\n else high = mid - 1; //else it changes to the lower half of the collecton to search there.\n }\n return low; //Hopefully if found it will then return low,\n }", "public static void main(String[] args) throws java.lang.Exception {\n\n Scanner scn = new Scanner(System.in);\n\n int t = scn.nextInt();\n\n while (t != 0) {\n int n = scn.nextInt();\n\n int arr[] = new int[n];\n\n for (int i = 0; i < n; i++) {\n\n arr[i] = scn.nextInt();\n\n }\n int pos = scn.nextInt();\n long element = arr[pos-1];\n\n Arrays.sort(arr);\n \n for(int i=0;i<n;i++)\n System.out.print(arr[i]+\" \");\n \n System.out.println();\n System.out.println(bsearch(arr, element) +1 );\n t--;\n }\n\n }", "private static int binarySearch0_BranchFreeUnrolledStatic16(int[] a, int key) {\n\t\tint low = 8;\n\t\tint midVal;\n\t\tint highMask;\n\n\t\tmidVal = a[low];\n\t\tlow += 4;\n\t\thighMask = (int) (((long) key - midVal) >> 63);\n\t\tlow -= 8 & highMask;\n\n\t\tmidVal = a[low];\n\t\tlow += 2;\n\t\thighMask = (int) (((long) key - midVal) >> 63);\n\t\tlow -= 4 & highMask;\n\n\t\tmidVal = a[low];\n\t\tlow += 1;\n\t\thighMask = (int) (((long) key - midVal) >> 63);\n\t\tlow -= 2 & highMask;\n\n\t\tmidVal = a[low];\n\t\thighMask = (int) (((long) key - midVal) >> 63);\n\t\tlow -= 1 & highMask;\n\n\t\treturn a[low] == key ? low : -(low + 1);\n\n\t}", "static int binarySearchHelp(int[] array, int searched) {\n\t\tint mid = array.length / 2;\r\n\t\tint first = 0;\r\n\t\tint last = array.length - 1;\r\n\r\n\t\twhile (array[mid] != searched && first <= last) {\r\n\t\t\tmid = (first + last) / 2;\r\n\t\t\tif (searched == array[mid]) {\r\n\t\t\t\treturn mid;\r\n\t\t\t}\r\n\t\t\tif (searched < array[mid]) {\r\n\t\t\t\tlast = mid - 1;\r\n\r\n\t\t\t}\r\n\t\t\tif (searched > array[mid]) {\r\n\t\t\t\tfirst = mid + 1;\r\n\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn -1;\r\n\t}", "public int binarySearch(ArrayList<Integer> a, int val){\n int low = 0;\n int high = a.size() - 1;\n \n while(high - low > 3){\n int mid = (low + high)/2;\n if(a.get(mid) > val){\n high = mid - 1;\n }\n else{\n low = mid; \n }\n }\n int i;\n for(i=low; i<=high; ++i){\n if(a.get(i) > val)\n return i;\n }\n return i;\n }", "private void BinarySearch(Node node, int index) {\n Node left, right;\n left = node.left;\n right = node.right;\n\n int leftIndex = (2 * index) + 1;\n int rightIndex = (2 * index) + 2;\n if (left != null) {\n ArrayTree[leftIndex] = left.key;\n BinarySearch(left, leftIndex);\n lastIndex = Math.max(leftIndex, lastIndex);\n } else {\n if (leftIndex < ArrayTree.length - 1) {\n ArrayTree[leftIndex] = 0;\n }\n }\n\n if (right != null) {\n ArrayTree[rightIndex] = right.key;\n BinarySearch(right, rightIndex);\n lastIndex = Math.max(rightIndex, lastIndex);\n } else {\n if (rightIndex < ArrayTree.length - 1) {\n ArrayTree[rightIndex] = 0;\n }\n }\n }", "private int binarySearchQ7(int first, int last, K key)\n {\n int index;\n \n if (first > last)\n index = first; \n else \n {\n int mid = first + (last - first) / 2;\n K midKey = dictionary[mid].getKey(); \n if (key.equals(midKey))\n index = mid; \n else if (key.compareTo(midKey) < 0)\n index = binarySearchQ7(first, mid - 1, key);\n else\n index = binarySearchQ7(mid + 1, last, key);\n } \n return index;\n }", "public static Boolean binarySearch(int[] arr, int n){\r\n if(arr.length == 0) return false;\r\n if(arr.length == 1 && arr[0] != n) return false; \r\n if(arr.length == 1 && arr[0] == n) return true; \r\n int start = 0;\r\n int mid = arr.length/2;\r\n int end = arr.length;\r\n int pos = mid;\r\n while(arr[pos] != n){\r\n if(n > arr[pos]){\r\n start = mid;\r\n mid = (end-start)/2+start;\r\n } else if(n < arr[pos]){\r\n end = mid;\r\n mid = (end-start)/2+start;\r\n System.out.println(\"here \" + start+ \" \" + mid + \" \" + end + \" pos= \" + pos);\r\n }\r\n pos = mid;\r\n if(arr[pos] == n) return true;\r\n if(start+1 == end){\r\n System.out.println(start+ \" \" + mid + \" \" + end + \" pos= \" + pos);\r\n return false;\r\n }\r\n }\r\n return true;\r\n}", "public static native int Find(long lpjFbxArrayVector2, long pElement, int pStartIndex);", "protected int search(double value) {\n int n = sequence.size();\n int left = 0, right = n - 1, index = 0;\n while (left != right) {\n index = (right - left) / 2 + left;\n if (value >= sequence.get(index == left ? index + 1 : index)) {\n left = index == left ? index + 1 : index;\n } else {\n right = index;\n }\n }\n while (left > 0 && value == sequence.get(left - 1)) {\n left -= 1;\n }\n return left;\n }", "private static int binarySearch0(double[] a, int fromIndex, int toIndex,\n\t\t\tdouble key) {\n\t\tint low = fromIndex;\n\t\tint high = toIndex - 1;\n\n\t\twhile (low <= high) {\n\t\t\tint mid = (low + high) >>> 1;\n\t\t\t\tdouble midVal = a[mid];\n\n\t\t\t\tint cmp;\n\t\t\t\tif (midVal < key) {\n\t\t\t\t\tcmp = -1; // Neither val is NaN, thisVal is smaller\n\t\t\t\t} else if (midVal > key) {\n\t\t\t\t\tcmp = 1; // Neither val is NaN, thisVal is larger\n\t\t\t\t} else {\n\t\t\t\t\tlong midBits = Double.doubleToLongBits(midVal);\n\t\t\t\t\tlong keyBits = Double.doubleToLongBits(key);\n\t\t\t\t\tcmp = (midBits == keyBits ? 0 : // Values are equal\n\t\t\t\t\t\t(midBits < keyBits ? -1 : // (-0.0, 0.0) or (!NaN, NaN)\n\t\t\t\t\t\t\t1)); // (0.0, -0.0) or (NaN, !NaN)\n\t\t\t\t}\n\n\t\t\t\tif (cmp < 0)\n\t\t\t\t\tlow = mid + 1;\n\t\t\t\telse if (cmp > 0)\n\t\t\t\t\thigh = mid - 1;\n\t\t\t\telse\n\t\t\t\t\treturn mid; // key found\n\t\t}\n\t\treturn -(low + 1); // key not found.\n\t}", "static int binSearch(int []arr,int key) {\n\t\tint start=0;\n\t\tint end=arr.length-1;\n\t\tdo {\n\t\t\tint pc=(start+end)/2;\n\t\t\tif(arr[pc]==key) {\n\t\t\t\treturn pc;\n\t\t\t}else if(arr[pc]<key) {\n\t\t\t\tstart=pc+1;\n\t\t\t}else\n\t\t\t\tend=pc-1;\n\t\t}while(start<=end);\n\t\t\n\t\treturn -1;\n\t}", "private static int binarySearch0(float[] a, int fromIndex, int toIndex,\n\t\t\tfloat key) {\n\t\tint low = fromIndex;\n\t\tint high = toIndex - 1;\n\n\t\twhile (low <= high) {\n\t\t\tint mid = (low + high) >>> 1;\n\t\tfloat midVal = a[mid];\n\n\t\tint cmp;\n\t\tif (midVal < key) {\n\t\t\tcmp = -1; // Neither val is NaN, thisVal is smaller\n\t\t} else if (midVal > key) {\n\t\t\tcmp = 1; // Neither val is NaN, thisVal is larger\n\t\t} else {\n\t\t\tint midBits = Float.floatToIntBits(midVal);\n\t\t\tint keyBits = Float.floatToIntBits(key);\n\t\t\tcmp = (midBits == keyBits ? 0 : // Values are equal\n\t\t\t\t(midBits < keyBits ? -1 : // (-0.0, 0.0) or (!NaN, NaN)\n\t\t\t\t\t1)); // (0.0, -0.0) or (NaN, !NaN)\n\t\t}\n\n\t\tif (cmp < 0)\n\t\t\tlow = mid + 1;\n\t\telse if (cmp > 0)\n\t\t\thigh = mid - 1;\n\t\telse\n\t\t\treturn mid; // key found\n\t\t}\n\t\treturn -(low + 1); // key not found.\n\t}", "public int binarySearch(int[] numbers, int numToSearch){\n\n QuickSort quickSort = new QuickSort();\n quickSort.sort(numbers);\n\n //Above code is tightly coupled with either of the algo to be used, we can not manage using sort algo dynamically.\n\n\n // Login to search\n\n //Return the number found\n\n return 5; //returning any hypothetical number\n }", "public static void main(String[] args) \n\t{\n\t \n\t\tlong startTimer = System.currentTimeMillis();\n\t\t//mrethod 1\n\t\tint res=Utility.binarySearchWord();\n\t\tif(res==-1)\n\t\t\tSystem.out.println(\"your word not found\");\n\t\t else\n\t\t System.out.println(\"your word found at index:\"+res);\n\t\tlong first=System.currentTimeMillis();\n\t\tSystem.out.println((first-startTimer)/1000+\"seconds\");\n\t \n\t\t//method 2\n\t\tint res1=Utility.binarySearchForInteger();\n\t\tif(res1==-1)\n\t\t\tSystem.out.println(\"your no. not found\");\n\t\t else\n\t\t System.out.println(\"your no.found at index:\"+res1);\n\t\tlong second=System.currentTimeMillis();\n\t\tSystem.out.println((second-first)/1000+\"seconds\");\n\t\t\n\t\t//method 3\n\t\tint res3[]=Utility.bubbleSortForIntegers();\n\t\tfor(int i=0;i<res3.length;i++)\n\t\t\tSystem.out.println(res3[i]);\n\t\tlong third=System.currentTimeMillis();\n\t\tSystem.out.println((third-second)/1000+\"seconds\");\n\t\t\n\t\t//method 4\n\t\tString res4[]=Utility.bubbleSortForStrings();\n\t\tfor(int i=0;i<res4.length;i++)\n\t\t\tSystem.out.println(res4[i]);\n\t\tlong fourth=System.currentTimeMillis();\n\t\tSystem.out.println((fourth-third)/1000+\"seconds\");\n\t\t\n\t\t//method 5\n\t\tint res5[]=Utility.insertionSortForInteger();\n\t\tfor(int i=0;i<res5.length;i++)\n\t\t\tSystem.out.println(res5[i]);\n\t\tlong fifth=System.currentTimeMillis();\n\t\tSystem.out.println((fifth-fourth)/1000+\"seconds\");\n\t\t\n\t\t//method 6\n\t\tString res6[]=Utility.insertionSortForString();\n\t\tfor(int i=0;i<res6.length;i++)\n\t\t\tSystem.out.println(res6[i]);\n\t\tlong sixth=System.currentTimeMillis();\n\t\tSystem.out.println((sixth-fifth)/1000+\"seconds\");\n\t}", "public int binarySearchIterative(int[] array,int target) {\n var left = 0;\n var right = array.length -1;\n while (left <= right) {\n int middle = (left + right) / 2;\n if (array[middle] == target)\n return middle;\n if (array[middle] < target)\n left = middle + 1;\n else\n right = middle - 1;\n }\n return -1;\n }", "static int find(int[] arr){\n\t\tif(arr.length==1) return -1;\n\t\tint slow = arr[0] , fast = arr[arr[0]];\n\t\twhile(slow!=fast){\n\t\t\tslow = arr[slow];\n\t\t\tfast = arr[arr[fast]];\n\t\t}\n\t\tslow = 0;\n\t\twhile(slow!=fast){\n\t\t\tslow = arr[slow];\n\t\t\tfast = arr[fast];\n\t\t}\n\t\treturn slow;\n\n\t}", "public static void main(String args[])\n {\n BinarySerach ob = new BinarySerach();\n int arr[] = { 2, 5, 3, 1, 7, 4 };\n\n\n // Arrays.binarySearch(arr,5);\nArrays.sort(arr);\n System.out.println(Arrays.binarySearch(arr,5));\n Arrays.sort(arr);\n int n = arr.length;\n int x = 5;\n int result = ob.binarySearch(arr, x);\n if (result == -1)\n System.out.println(\"Element not present\");\n else\n System.out.println(\"Element found at \"\n + \"index \" + result);\n }", "public int Search(int key)\n {\n for(int i=0; i<n; i++)\n {\n if(a[i]==key)\n return 1;\n }\n return 0;\n }", "public int binarySearch(int[] nums, int searchFor) {\n\t\tint[] sortedNo = this.sortAlgo.sort(nums);\n\t\treturn 3;\n\t}", "static void binarySearch(int mat[][], int i, int j_low, int j_high, int x){\n\t\t\n\t\twhile(j_low < j_high){\n\t\t\t\n\t\t}\n\t}", "private int searchR(Searching[] array, int start, int half, int end, int value) {\n if (value > array[end].getValue() || value < array[start].getValue()) {\n return -1;\n }\n int a = end - start;\n int b = array[end].getValue() - array[start].getValue();\n int c = value - array[start].getValue();\n int d = (c * a) / b;\n int slide = d + start;\n if (slide > end || slide < start) {\n return -1;\n }\n if (array[slide].getValue() == value) {\n return slide;\n }\n if (value < array[slide].getValue()) {\n end = slide;\n return searchR(array, start, half, end, value);\n } else {\n start = slide;\n return searchR(array, start, half, end, value);\n }\n }", "private int d(@Nullable K ☃) {\r\n/* 127 */ return (xq.f(System.identityHashCode(☃)) & Integer.MAX_VALUE) % this.b.length;\r\n/* */ }\r\n/* */ private int b(@Nullable K ☃, int i) {\r\n/* */ int j;\r\n/* 131 */ for (j = i; j < this.b.length; j++) {\r\n/* 132 */ if (this.b[j] == ☃) {\r\n/* 133 */ return j;\r\n/* */ }\r\n/* 135 */ if (this.b[j] == a) {\r\n/* 136 */ return -1;\r\n/* */ }\r\n/* */ }", "public static int search(int[] nums, int target) {\n\n int length = nums.length;\n int i = 0;\n int j = length - 1;\n if (length == 0) return -1;\n\n while (true) {\n int index = (i + j) / 2;\n\n int value = nums[index];\n if (value == target) return index;\n\n //Using the invariant that either i - mid OR mid-j has\n //to be sorted at any point of the computation\n if (nums[j] >= value) {\n if (target > value && target <= nums[j]) i = index;\n else if (target > value && target > nums[j]) j = index;\n else j = index;\n }\n else {\n if (target < value && target >= nums[i]) j = index;\n else if (target < value && target < nums[i]) i = index;\n else i = index;\n }\n\n if (i + 1 == j) {\n if (nums[i] == target) return i;\n if (nums[j] == target) return j;\n return -1;\n }\n\n if (i == j || i >= length || j >= length) return -1;\n }\n\n }", "public HashMap<String, Double> search(String query) {\n // ===================================================\n // 1. Fetch all inverted lists corresponding to terms\n // in the query.\n // ===================================================\n String[] terms = query.split(\" \");\n HashMap<String, Integer> qf = new HashMap<String, Integer>();\n // Calculate term frequencies in the query\n for (String term : terms) {\n if (qf.containsKey(term))\n qf.put(term, qf.get(term) + 1);\n else\n qf.put(term, 1);\n }\n HashMap<String, Double> docScore = new HashMap<String, Double>();\n for (Entry<String, Integer> termEntry : qf.entrySet()) {\n String term = termEntry.getKey();\n int qfi = termEntry.getValue();\n\n // ===================================================\n // 2. Compute BM25 scores for documents in the lists.\n // Make a score list for documents in the inverted\n // lists. Assume that no relevance information is \n // available. For parameters, use k1=1.2, b=0.75, \n // k2=100.\n // ===================================================\n double k1 = 1.2;\n double b = 0.75;\n double k2 = 100;\n int ni = invIndex.get(term).size();\n\n\n for (Entry<String, IndexEntry> invListEntry : invIndex.get(term).entrySet()) {\n String docID = invListEntry.getKey();\n double bm25Score;\n if (docScore.containsKey(docID))\n bm25Score = docScore.get(docID);\n else\n bm25Score = 0;\n\n // length of the document\n int dl = docStat.get(docID);\n // frequency of the term in the document\n int fi = invListEntry.getValue().getTf();\n double K = k1 * ((1 - b) + b * ((double) dl / avdl));\n\n // ===================================================\n // 3. Accumulate scores for each term in a query\n // on the score list.\n // ===================================================\n bm25Score += Math.log((N - ni + 0.5) / (ni + 0.5))\n * (((k1 + 1) * fi * (k2 + 1) * qfi) / ((K + fi) * (k2 + qfi)));\n docScore.put(docID, bm25Score);\n }\n }\n\n return docScore;\n }", "private int findPos( AnyType x )\n {\n int offset = 1;\n int currentPos = myhash( x );\n \n while( array[ currentPos ] != null &&\n !array[ currentPos ].key.equals( x ) )\n {\n currentPos += offset; // Linear probing.\n if( currentPos >= array.length )\n currentPos -= array.length;\n }\n \n return currentPos;\n }", "private int binarySearch(int[] r6, int r7, boolean r8) {\n /*\n r5 = this;\n int r0 = r6.length\n int r0 = r0 + -1\n r1 = 0\n r2 = r0\n r0 = 0\n L_0x0006:\n if (r0 > r2) goto L_0x001d\n int r3 = r0 + r2\n int r3 = r3 / 2\n r4 = r6[r3]\n if (r7 != r4) goto L_0x0011\n return r3\n L_0x0011:\n r4 = r6[r3]\n if (r7 >= r4) goto L_0x0019\n int r3 = r3 + -1\n r2 = r3\n goto L_0x0006\n L_0x0019:\n int r3 = r3 + 1\n r0 = r3\n goto L_0x0006\n L_0x001d:\n if (r2 >= 0) goto L_0x0020\n return r1\n L_0x0020:\n if (r8 == 0) goto L_0x002a\n int r7 = r2 + 1\n int r6 = r6.length\n int r6 = r6 + -1\n if (r7 > r6) goto L_0x002a\n goto L_0x002b\n L_0x002a:\n r7 = r2\n L_0x002b:\n return r7\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.taobao.tao.util.TaobaoImageUrlStrategy.binarySearch(int[], int, boolean):int\");\n }", "public static int[] binaryearch(int[] nums, int left, int right, int target) {\n int[] indexs = {-1, -1};\n if (left > right) {\n return indexs;\n }\n int middle = (right - left) / 2 + left;\n if (nums[middle] == target) {\n int[] results = new int[]{middle, middle};\n if (middle > left && nums[middle - 1] == nums[middle]) {\n //左侧还有\n int[] indexs2 = binaryearch(nums, left, middle - 1, target);\n if (indexs2[0] != -1) {\n results[0] = indexs2[0];\n }\n }\n if (middle < right && nums[middle + 1] == nums[middle]) {\n // //右侧还有\n int[] indexs2 = binaryearch(nums, middle + 1, right, target);\n if (indexs2[1] != -1) {\n results[1] = indexs2[1];\n }\n }\n return results;\n } else if (nums[middle] < target) {\n indexs = binaryearch(nums, middle + 1, right, target);\n\n } else {\n indexs = binaryearch(nums, left, middle - 1, target);\n }\n return indexs;\n\n }", "private static int search(int[] arr, int n, int x, int k) {\n\t\tint i = 0;\n\t\twhile (i < n) {\n\n\t\t\t// If x is found at index i\n\t\t\tif (arr[i] == x)\n\t\t\t\treturn i;\n\n\t\t\t// Jump the difference between\n\t\t\t// current array element and x\n\t\t\t// divided by k We use max here\n\t\t\t// to make sure that i moves\n\t\t\t// at-least one step ahead.\n\t\t\ti = i + Math.max(1, Math.abs(arr[i] - x) / k);\n\n\t\t}\n\n\t\tSystem.out.println(\"number is not\" + \" present!\");\n\n\t\treturn -1;\n\t}", "private int BinaryReadIndexFile(String filename, ArrayList<Integer> matchingPositions, String wordToBeSearched)\n {\n try\n {\n //Initialize the file object\n File LocalInputFile = new File(filename + \".ndx\");\n\n //Try to open the index file using a Scanner\n Scanner indexFileFileScanner = new Scanner(LocalInputFile);\n\n //Get the files lines number\n int mMaxFileLines = 0;\n while(indexFileFileScanner.hasNext())\n {\n //Read every line in the file\n indexFileFileScanner.nextLine();\n mMaxFileLines++;\n }\n\n //Index to the bottom part of the search area of the file\n int bottomFilePageIndex = 0;\n \n //Index to the top part of the search area of the file\n int topFilePageIndex = mMaxFileLines;\n\n //Index to the middle data page of the search area of the file\n int middleFilePageIndex;\n \n //Counter for the data page accesses\n int dataPageAccessesCounter = 0;\n \n //Status of the search process\n int searchStatus;\n\n //Search while there are data pages to access, if topFilePageIndex is greater than bottomFilePageIndex, the search fails automatically\n while (bottomFilePageIndex <= topFilePageIndex)\n {\n //Reinitialize the FileScanner object\n indexFileFileScanner = new Scanner(LocalInputFile);\n \n //Find the middle data page index\n middleFilePageIndex = (bottomFilePageIndex + topFilePageIndex)/2;\n\n //Skip the lines until the middle point\n SkipLines(indexFileFileScanner, middleFilePageIndex);\n\n //Fetch the data page from the file\n ByteBuffer bytePageBuffer = ByteBuffer.wrap(StringToByteArrayTranslator(indexFileFileScanner.nextLine(), SizeConstants.getBufferSize()));\n\n //Execute the binary search in the page\n searchStatus = BinarySearchBytePage(wordToBeSearched,bytePageBuffer.array(), matchingPositions, filename, middleFilePageIndex);\n\n //Count the data page access\n dataPageAccessesCounter++;\n\n //If the word's to be searched length is invalid or the word is found in the page, but is neither the first or the last word in the page\n if (searchStatus == -2 || searchStatus == -1)\n {\n //Complete the binary search\n break;\n }\n else if (searchStatus == -3)\n {\n //If the search must be continued in the top part of the search area of the file\n bottomFilePageIndex = middleFilePageIndex + 1;\n }\n else if (searchStatus == -4)\n {\n //If the search must be continued in the bottom part of the search area of the file\n topFilePageIndex = middleFilePageIndex - 1;\n }\n else\n {\n //Add the new data page accesses\n dataPageAccessesCounter += searchStatus;\n\n //Complete the binary search\n break;\n }\n }\n //Close the FileScanner object\n indexFileFileScanner.close();\n\n //Return the number of the data page file accesses\n return dataPageAccessesCounter;\n }\n catch (FileNotFoundException e)\n {\n //Catch the FileNotFoundException and inform the user\n System.out.println(\"File: \" + this.Filename + \" cannot be opened.\");\n e.printStackTrace();\n return 0;\n }\n }", "public boolean linearIn(int[] outer, int[] inner) {\r\n int comp=0; // O(1)\r\n int count=0; // O(1)\r\n if(inner.length==0) // O(1)\r\n return true; // O(1)\r\n for(int i=0; i<outer.length; i++) { // O(n)\r\n if(outer[i]==inner[count]) { // O(1)\r\n comp++; // O(1)\r\n count++; // O(1)\r\n } else if(outer[i]>inner[count]) // O(1)\r\n return false; // O(1)\r\n if (comp==inner.length) // O(1)\r\n return true; // O(1)\r\n }\r\n return false; // O(1)\r\n}", "public static void main(String[] args) {\n\n Scanner sc = new Scanner(System.in);\n System.out.println(\"Enter number of elements\");\n int i = sc.nextInt();\n int[] array = new int[i];\n\n\n System.out.println(\"Enter \" + i + \" integers\");\n\n for (int c = 0; c < i; c++) {\n array[c] = sc.nextInt();\n }\n\n System.out.println(\"Enter value to find\");\n int search = sc.nextInt();\n\n MyBinarySearch mbs = new MyBinarySearch();\n Arrays.sort(array);\n System.out.println(search + \" was found at index \" + mbs.binarySearch(array, search) + \" in array \" + Arrays.toString(array));\n\n\n// MyBinarySearch mbs = new MyBinarySearch();\n// int[] arr = {2, 4, 6, 8, 10, 12, 14, 16};\n// System.out.println(\"Key 14's position: \"+mbs.binarySearch(arr, 14));\n// int[] arr1 = {6,34,78,123,432,900};\n// System.out.println(\"Key 432's position: \"+mbs.binarySearch(arr1, 432));\n }", "public static int findCommon2(int[] in1, int[] in2) {\r\n\t\tint common = 0;\r\n\t\t//iterate through the shorter array and do a binary search for every element of short array in big array\r\n\t\tif (in2.length > in1.length) {\r\n\t\t\tfindCommon2(in2, in1);\r\n\t\t}\r\n\t\t//nlogn\r\n\t\tArrays.sort(in2);\r\n\t\t//mlogn\r\n\t\tfor (int i = 0; i < in1.length; i++) {\r\n\t\t\tif(Arrays.binarySearch(in2, in1[i]) > 0) {\r\n\t\t\t\t++common;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn common;\r\n\t}", "public static void useBinarySearch1() {\n int[] numbers = {-3, 2, 8, 12, 17, 29, 44, 58, 79};\n int index = Arrays.binarySearch(numbers, 29);\n System.out.println(\"29 is found at index \" + index);\n }", "public int linSearch(Comparable c){\n\tfor (int i = 0; i < _size;i++){\n\t if (c.compareTo(_data[i]) == 0){\n\t\treturn i;\n\t }\n\t}\n\treturn -1;\n }", "public boolean search(int[] nums, int target) {\n if (nums == null || nums.length == 0) return false;\n int l = 0;\n int r = nums.length - 1;\n int m;\n while (l <= r) {\n m = (l + r) / 2; \n if (nums[m] == target) return true;\n int low, high;\n if (nums[m] >=nums[l]) {\n if(nums[m] == nums[l]){\n l++;\n }\n else{\n if (nums[l] <= target && target < nums[m]) {\n r = m - 1;\n }\n else {\n l = m + 1;\n }\n }\n }\n else {\n if (nums[m] == nums[r]){\n r--;\n } \n else{\n if (nums[m] < target && target <= nums[r]) {\n l = m + 1;\n }\n else {\n r = m - 1;\n }\n }\n }\n }\n return false;\n }", "public abstract ParameterVector searchVector();", "public boolean containsNearbyDuplicate2(int[] nums, int k) {\n\n int max = Integer.MIN_VALUE;\n for (int i = 0; i < nums.length; i++) {\n max=Math.max(max,nums[i]);\n }\n Integer[] map = new Integer[max+1];\n for (int i = 0; i < nums.length; i++) {\n Integer c = map[nums[i]];\n if(c!=null && i-c<=k){\n return true;\n }else {\n map[nums[i]]=i;\n }\n }\n return false;\n }", "abstract public void search();", "@Test\n public void test2(){\n times = new ArrayList<Long>();\n for(int i = 0; i<threadnums.length; i++){\n BSTInterface tree = new LockFreeBST();\n makeThread2(tree, threadnums[i]);\n\n\n System.out.println( \"When there are \"+threadnums[i] + \"threads, there are \"+tree.getNum() + \" nodes\");\n\n long startTime=System.currentTimeMillis();\n for(int k = 0; k<100; k++)\n tree.search(totalnum/2);\n long endTime=System.currentTimeMillis();\n System.out.println( \"When there are \"+threadnums[i] + \"threads, the search takes \"+ (endTime-startTime) + \" ms\");\n }\n for(int i = 0; i<threadnums.length; i++){\n System.out.println(\"When there are \"+threadnums[i]+\" threads, \"+\"it takes \"+times.get(i)+\" ms\");\n }\n }", "private int binarySearchByIndex(List<Span> spans, int index){\n int left = 0,right = spans.size() - 1,mid,row;\n int max = right;\n while(left <= right){\n mid = (left + right) / 2;\n if(mid < 0) return 0;\n if(mid > max) return max;\n row = spans.get(mid).startIndex;\n if(row == index) {\n return mid;\n }else if(row < index){\n left = mid + 1;\n }else{\n right = mid - 1;\n }\n }\n int result = Math.max(0,Math.min(left,max));\n while(result > 0) {\n if(spans.get(result).startIndex > index) {\n result--;\n }else{\n break;\n }\n }\n while(result < right) {\n if(getSpanEnd(result,spans) < index) {\n result++;\n }else{\n break;\n }\n }\n return result;\n }", "public int search(T t) {\n \tint bucket = hash(t);\n \tif (Table.get(bucket).linearSearch(t) != -1) {\n \t\treturn bucket;\n \t}\n \treturn -1;\n }", "@SuppressWarnings(\"unchecked\")\n\tpublic JSONArray findMatches(String query){\n\t\t\n\t\t// Increment the search tasks counter\n\t\t++numOfSearchTasks;\n\t\t\n\t\t// Start the timer for this task\n\t\tTimer.start();\n\t\t\n\t\t// Number of needed matches\n\t\tresultsToBeFound = 10;\n\t\t\n\t\t// Clear the matches list\n\t\tsetForTypeahead.clear();\n\t\t\n\t\t// The returned JSON array\n\t\tJSONArray arrayObj = new JSONArray();\n\t\t\n\t\t// Search in all predicates\n\t\tfor(int i = 0; i < predicatesList.size(); ++i){\n\t\t\tif(predicatesList.get(i).toLowerCase().contains(query.toLowerCase())){\n\t\t\t\tarrayObj.add(predicatesList.get(i));\n\t\t\t}\n\t\t\tArrayList<String> semanticRelations = semanticRelationsMap.get(query.toLowerCase());\n\t\t\tif(semanticRelations != null) {\n\t\t\t\tfor(String s : semanticRelations) {\n\t\t\t\t\tif(predicatesList.get(i).toLowerCase().contains(s.toLowerCase())){\n\t\t\t\t\t\tarrayObj.add(predicatesList.get(i));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Start the timer for this task\n\t\tTimer.start();\n\t\t\n\t\t// Search in index first\n\t\tCollection<Integer> list = in.search(query.toLowerCase());\n\t\tHashSet<Integer> output = null;\n\t\tif(list.size() > 0) {\n\t\t\toutput = (HashSet<Integer>) list;\n\t\t}\n\t\telse {\n\t\t\toutput = new HashSet<Integer>();\n\t\t}\n\n\t\t// If found a match, that's a hit\n\t\tif(output.size() > 0) {\n\t\t\t++numOfIndexHits;\n\t\t}\n\t\t\n\t\tfor(Integer index : output) {\n\t\t\tarrayObj.add(frequentLiteralsList.get(index));\n \t\t--resultsToBeFound;\n \t}\n\t\tdouble tempStopTime;\n\t\t// If all results were found in suffix tree\n\t\tif(resultsToBeFound < 0) {\n\t\t\tTimer.stop();\n\t\t\tsuffixTreeTime += Timer.getTimeInSeconds();\n\t\t\ttotalTime += Timer.getTimeInSeconds();\n\t\t\twriteStatsToFile();\n\t\t\treturn arrayObj;\n\t\t}\n\t\t\n\t\tTimer.stop();\n\t\tsuffixTreeTime += Timer.getTimeInSeconds();\n\t\ttempStopTime = Timer.getTimeInSeconds();\n\t\tTimer.start();\n\t\t// In length bins\n\t\t// Search in bins with a minimum length of the query\n\t\t// and a maximum of the query length + 10\n\t\tint minLength = query.length()-1;\n\t\tint maxLength = query.length() + 9;\n\t\t\n\t\tint minIndex = Integer.MAX_VALUE;\n\t\tint maxIndex = -1;\n\t\t\n\t\t// Determine which indices of the literals array\n\t\t// to search within\n\t\tfor(int i = 0; i < lengths.size(); ++i){\n\t\t\tif(lengths.get(i) > maxLength) {\n\t\t\t\tmaxIndex = indexes.get(i);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif(minLength >= lengths.get(i)) {\n\t\t\t\tminIndex = indexes.get(i);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpruningPercentage += 1 - (1.0 * (maxIndex - minIndex) / literalsList.size());\n\t\ttry{\n\t\tSystem.out.println(\"Searching for \" + query + \" between indeces: \" + minIndex + \n\t\t\t\t\" corresponding to length \" + (literalsList.get(minIndex).length()-5) +\n\t\t\t\t\" and \" + maxIndex + \" corresponding to length \" + \n\t\t\t\t(literalsList.get(maxIndex).length()-5));\n\t\t}\n\t\tcatch(IndexOutOfBoundsException e) {\n\t\t\tSystem.out.println(\"query = \" + query);\n\t\t\tSystem.out.println(\"minIndex = \" + minIndex);\n\t\t\tSystem.out.println(\"maxIndex = \" + maxIndex);\n\t\t}\n\t\t\n\t\t// Assign threads to search tasks\n\t\tint indexesPerThread = (maxIndex - minIndex) / (numOfCores);\n\t\t\n\t\t// Arraylist to keep track of threads\n\t\tArrayList<Thread> threads = new ArrayList<Thread>();\n\t\t\n\t\tfor(int i = minIndex; i < maxIndex; i += indexesPerThread) {\n\t\t\tthreads.add(new Thread(new SearchTask(i, i + indexesPerThread, query)));\n\t\t}\n\t\t\n\t\t// Start threads\n\t\tfor(int i = 0; i < threads.size(); ++i) {\n\t\t\tthreads.get(i).start();\n\t\t}\n\t\t\n\t\t// Join threads before continue\n\t\tfor(int i = 0; i < threads.size(); ++i) {\n\t\t\ttry {\n\t\t\t\tthreads.get(i).join();\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Stop timer\n\t\tTimer.stop();\n\t\ttotalTime += tempStopTime + Timer.getTimeInSeconds();\n\t\t\n\t\t// Sort by length\n\t\tArrayList<String> tempList = new ArrayList<String>();\n\t\tfor(String string : setForTypeahead) {\n\t\t\tif(!arrayObj.contains(string))\n\t\t\t\ttempList.add(string);\n\t\t}\n\t\tjava.util.Collections.sort(tempList, new LengthComparator());\n\t\t\n\t\t// Fill the array\n\t\tfor(int i = 0; i < tempList.size() && resultsToBeFound > 0; ++i, --resultsToBeFound) {\n\t\t\tarrayObj.add(tempList.get(i));\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t// Update the stats file with number of tasks and hits\n\t\twriteStatsToFile();\n\t\t\n\t\treturn arrayObj;\n\t}", "static int search(int[] in, int j, int start, int end) {\n\t\tint k=start;\n\t\twhile(k<end) {\n\t\t\tif(in[k]== j) {\n\t\t\t\treturn k;\n\t\t\t}\n\t\t\tk++;\n\t\t}\n\t\treturn 0;\n\t}", "public void search(String word)\r\n\t{\r\n\t\tHashtable<String, Integer> hashtable = new Hashtable<String, Integer>();\r\n\t\tFile dir = new File(\"C:\\\\Users\\\\jayad\\\\eclipse-workspace\\\\Search Engine\\\\src\\\\Webpages\\\\Text\\\\\");\r\n\t\tFile[] fileArray = dir.listFiles();\r\n\t\tint repeats = 0; // No. of times the searched word repeated in a same file\r\n\t\tint numofFiles = 0; // No. of files that contains the Searched word\r\n\t\ttry\r\n\t\t{\r\n\t\t\tdouble startTime = System.nanoTime();\r\n\t\t\tdouble startTimesearch = System.nanoTime();\r\n\t\t\tfor (int i = 1; i < fileArray.length; i++)\r\n\t\t\t{\r\n\t\t\t\trepeats = searchWord(fileArray[i], word);\r\n\t\t\t\thashtable.put(fileArray[i].getName(), repeats);\r\n\t\t\t\tif (repeats != 0)\r\n\t\t\t\t{\r\n\t\t\t\t\tnumofFiles++;\r\n\t\t\t\t\tif (fileArray[i].getName().toString().substring(0, 3) == \"null\")\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tfileArray[i].getName().toString();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"\\nNumber of files containing the word '\" + word + \"' is = \" + numofFiles);\r\n\t\t\tlong endTimesearch = System.nanoTime();\r\n\t\t\tdouble srchtime = endTimesearch - startTimesearch;\r\n\t\t\tSystem.out.println(\"\\nSeacrh Result execution time: \" + srchtime/1000000 + \" Milli Seconds\");\r\n\t\t\tif (numofFiles == 0)\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"\\nSearching closely related words\");\r\n\t\t\t\tsuggestword(word);\r\n\t\t\t}\r\n//\t\t\tSystem.out.println(\"\\nFor Synonyms of the word \"+ p+\" enter yes or no\");\r\n//\t\t\tString o =s1.nextLine();\r\n//\t\t\tif(o.equals(\"yes\")) {\r\n//\t\t\t\t\r\n//\t\t System.out.println(\"\\nSearching synonyms\");\r\n//\t\t \r\n//\t\t\t\twebsearch.suggestions(word);\t\r\n//\t\t\t\t\r\n//\t\t\t}\r\n\t\t\t\tdouble rankstart = System.nanoTime();\r\n\t\t\t\t\trank(hashtable, numofFiles);\r\n\t\t\t\tdouble rankend = System.nanoTime();\r\n\t\t\t\tdouble rankingTime = rankend - rankstart;\r\n\t\t\tSystem.out.println(\"\\nRanking Algorithm time: \" + rankingTime + \" nano Seconds\");\r\n\t\t\t\r\n\t\t\tdouble endTime = System.nanoTime();\r\n\t\t\tSystem.out.println(\"\\nTotal Execution Time: \" + (endTime - startTime)/1000000 + \" Milli Seconds\");\r\n\t\t}\r\n\t\tcatch (Exception e)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Exception:\" + e);\r\n\t\t}\r\n\t}", "public int searchCyc(int[] nums) {\n int lo = 0;\n int hi = nums.length - 1;\n\n while (lo < hi) {\n int mid = (lo + hi) / 2;\n if (nums[mid] > nums[hi]) {\n lo = mid + 1;\n } else { //\n hi = mid;\n }\n }\n\n //Loop ends when left == right\n return lo;\n}", "public static void main(String[] args) {\n SearchTree search = new SearchTree(new Node(INITIAL_STATE), GOAL_STATE);\n long startTime = System.currentTimeMillis();\n\n search.breadthFirstSearch();\n// search.depthFirstSearch();\n// search.iterativeDeepening(10);\n\n long finishTime = System.currentTimeMillis();\n long totalTime = finishTime - startTime;\n System.out.println(\"\\n[Elapsed time: \" + totalTime + \" milliseconds]\");\n System.out.println(\"========================================================\");\n }", "public int[] findAnyPairIndexesWhileLCMMinimized() {\n if (seq.length < 2) {\n return null;\n }\n int size = 0;\n for (int i = 1; i <= m; i++) {\n size += m / i;\n }\n\n IntegerMultiWayDeque deque = new IntegerMultiWayDeque(m + 1, size);\n for (int i = 1; i <= m; i++) {\n for (int j = i; j <= m; j += i) {\n if (!indexesOfSeq.isEmpty(j)) {\n deque.addLast(i, j / i);\n }\n }\n }\n\n long lcm = INF;\n int v1 = 0;\n int v2 = 0;\n\n for (int i = 1; i <= m; i++) {\n if (!indexesOfSeq.isEmpty(i) && indexesOfSeq.peekFirst(i) != indexesOfSeq.peekLast(i)) {\n lcm = v1 = v2 = i;\n break;\n }\n }\n\n IntegerVersionArray iva = new IntegerVersionArray(m + 1);\n IntegerDequeImpl stack = new IntegerDequeImpl(m);\n for (int i = 1; i <= m; i++) {\n iva.clear();\n stack.clear();\n while (!deque.isEmpty(i)) {\n int last = deque.removeFirst(i);\n factorize(last);\n int total = ie(iva, allFactors.size() - 1, 1, 0);\n if (total > 0) {\n int pop = 0;\n while (total > 0) {\n pop = stack.removeLast();\n if (GCDs.gcd(pop, last) == 1) {\n total--;\n }\n add(iva, pop, -1);\n }\n long l = LCMs.lcm(last, pop) * i;\n if (l < lcm) {\n lcm = l;\n v1 = last * i;\n v2 = pop * i;\n }\n }\n add(iva, last, 1);\n stack.addLast(last);\n }\n }\n\n return new int[]{indexesOfSeq.peekFirst(v1), indexesOfSeq.peekLast(v2)};\n }", "public static int binSearchRotatedIter(int src[], int lo, int hi, int target){\n\n while(lo<=hi){\n int mid = lo + (hi-lo)/2;\n if(src[mid]==target) return mid;\n //if bottom half is sorted\n if(src[lo]<=src[mid]){\n \n if(src[lo]<=target && target<src[mid]){\n hi=mid-1;\n }else{\n lo=mid+1;\n }\n }\n //if upper half is sorted\n else{\n if(src[mid]<target && target<=src[hi]){\n lo=mid+1;\n }else{\n hi=mid-1;\n }\n }\n }\n return -1;\n}", "public int binarySearch(int[] nums, int target) {\n // write your code here\n if (nums == null || nums.length == 0) return -1;\n int start = 0, end = nums.length - 1;\n while (start + 1 < end) {\n int mid = start + (end - start) / 2;\n if (nums[mid] == target) {\n end = mid;\n }\n else if (nums[mid] < target) {\n start = mid;\n }\n else {\n end = mid;\n }\n }\n if (nums[start] == target) return start;\n if (nums[end] == target) return end;\n return -1;\n }", "static int countCollinearFast(int[] a1, int[] a2, int[] a3)\n {\n //TODO: implement this method\n \tsort(a3);\n \tint count = 0;\n \tint search;\n \t\n \tfor (int i=0; i<a1.length; i++)\n \t\tfor (int j=0; j<a2.length; j++)\n \t\t{\n \t\t\tsearch = 2*a2[j] - a1[i];\n \t\t\tif (binarySearch(a3, search))\n \t\t\t\tcount++;\n \t\t}\n \t\n \treturn count;\n }", "void search();", "void search();", "private static int binary_Search(int[] arr, int target) {\n\n\t\tint low = 0;\n\t\tint high = arr.length - 1;\n\n\t\twhile (low <= high) {\n\n\t\t\tint mid = low + (high - low) / 2;\n\t\t\tSystem.out.println(\"low = \" + low + \" mid = \" + mid + \" high =\" + high);\n\t\t\tif (arr[mid] == target) {\n\t\t\t\treturn mid;\n\t\t\t}\n\t\t\tif (arr[mid] < target) {\n\t\t\t\tlow = mid + 1;\n\n\t\t\t} else {\n\t\t\t\thigh = mid - 1;\n\t\t\t}\n\n\t\t\t// System.out.println(\"low = \" + low + \" high =\" + high);\n\t\t}\n\t\treturn -1;\n\t}", "@Test\n public void test1(){\n times = new ArrayList<Long>();\n for(int i = 0; i<threadnums.length; i++){\n BSTInterface tree = new LockFreeBST();\n makeThread1(tree, threadnums[i]);\n\n System.out.println( \"When there are \"+threadnums[i] + \" threads, there are \"+tree.getNum() + \" nodes\");\n\n long startTime=System.currentTimeMillis();\n for(int k = 0; k<100; k++)\n tree.search(totalnum/2);\n long endTime=System.currentTimeMillis();\n System.out.println( \"When there are \"+threadnums[i] + \"threads, the search takes \"+ (endTime-startTime) + \" ms\");\n }\n for(int i = 0; i<threadnums.length; i++){\n System.out.println(\"When there are \"+threadnums[i]+\" threads, \"+\"it takes \"+times.get(i)+\" ms\");\n }\n }", "public void linSearch(int current) {\r\n long average1 = 0, timeA = 0, stanDev = 0;\r\n System.out.println(\"\\nLINEAR SEARCH\\n\");\r\n for (int i = 0; i < 10; i++) {\r\n long start = System.nanoTime();\r\n for (int j = 10000000; A[j] >= current; j--) {\r\n if (current == A[j]) {\r\n long stop = System.nanoTime();\r\n long timelength = (stop - start);\r\n timeA += timelength;// USED FOR GETTING AVERAGE. \r\n lin[g][i] = timelength;//USED FOR STORING THE TIME IT TOOK FOR EACH TEST, IT IS USED LATER ON TO DISPLAY IN THE CHART.\r\n linear[i] = timelength;//USED FOR FINDING STANDARD DEVIATION.\r\n System.out.println(\"The number: \" + current + \" was found at index: \" + A[j] + \".\\n\"\r\n + \"It took: \" + timelength + \" nanoseconds.\");\r\n }\r\n }\r\n }\r\n average1 = (timeA / 10);\r\n linAvAndDev[h][0] = average1;//STORES THE AVEARGE FOR THE TESTS RUNS AND USED FOR THE CHART.\r\n for (int i = 0; i < 10; i++) {\r\n stanDev += Math.pow((linear[i] - average1), 2.0);\r\n }\r\n stanDev /= 10;\r\n stanDev = (long) Math.sqrt(stanDev);\r\n linAvAndDev[h][1] = stanDev;//STORES THE STANDARD DEVIATION AND IS USED FOR THE CHART. MIGHT NOT BE WORKING CORRECTLY.\r\n System.out.println(\"The Avearge time for the Linear Search was: \" + average1 + \" nanoseconds.\"\r\n + \"\\nThe Standard Deviation time for the Linear Search was: \" + stanDev + \" nanoseconds.\");\r\n g += 1;//USED FOR GOING THROUGH THE OBJECT ARRAY TO STORE INFORMATION.\r\n h += 1;\r\n }", "public static int binary_search(int[] array, int n, int value)\n {\n int low = 0;\n while (low <= n) {\n int middle = (low + n) / 2;\n if (value == array[middle]) {\n return middle;\n }\n else if (value < array[middle]) {\n n = middle - 1;\n }\n else {\n low = middle + 1;\n }\n }\n return -1;\n \n }", "public static void main(String[] args) {\n\t\tint a[] = { 2, 3, 5, 6, 9, 10 };\n\t\tBinarySearch bs = new BinarySearch();\n\t\tint indexOne = bs.binarySearchAlgo(a, 0, a.length - 1, 11);\n\t\tSystem.out.println(indexOne);\n\n\t\tint indexTwo = bs.binarySearchAlgo(a, 11);\n\t\tSystem.out.println(indexTwo);\n\n\t\tint array[] = { 0, 3, 10, 10, 10, 10, 20, 25, 26 };\n\t\tint firstOccurrence = bs.firstOccurrence(array, 10);\n\t\tint lastOccurrence = bs.lastOccurrence(array, 10);\n\t\tSystem.out.println(\"First Occurrence \" + firstOccurrence + \" Last Occurrence \" + lastOccurrence);\n\n\t\tint count = bs.countDuplicateNo(array, 10);\n\t\tSystem.out.println(\"Duplicate No \" + count);\n\n\t\tint arratTwo[] = { 11, 20, 25, 30, 40, 45, 10 };\n\t\tint countRotation = bs.countRotation(arratTwo);\n\t\tSystem.out.println(\"count rotation \" + countRotation);\n\t\t\n\t\tint arrayThree[]={8,9,10,11,12,3,4,5};\n\t\tint index = bs.findElement(arrayThree,9);\n\t\tSystem.out.println(\"Element found at \"+index);\n\t}", "public static boolean find3Numbers(int A[], int n, int X) { \n \n // Your code \n for(int i=0;i<n-2;i++)\n {\n HashSet<Integer> set = new HashSet<>();\n int toFind=X-A[i];\n for(int j=i+1;j<n;j++)\n {\n if(set.contains(toFind-A[j]))\n {\n return true;\n }\n set.add(A[j]);\n }\n }\n return false;\n }", "protected static int branchyUnsignedBinarySearch(final CharBuffer array, final int begin,\n final int end, final char k) {\n if ((end > 0) && ((array.get(end - 1)) < (int) (k))) {\n return -end - 1;\n }\n int low = begin;\n int high = end - 1;\n while (low <= high) {\n final int middleIndex = (low + high) >>> 1;\n final int middleValue = (array.get(middleIndex));\n\n if (middleValue < (int) (k)) {\n low = middleIndex + 1;\n } else if (middleValue > (int) (k)) {\n high = middleIndex - 1;\n } else {\n return middleIndex;\n }\n }\n return -(low + 1);\n }", "@Test\n public void testBinarySearch() {\n int actualResult = binarySearch.BinarySearch(new int[]{2,4,5}, 5);\n // check if the value is correct\n assertEquals(5, actualResult);\n }", "public int search(int[] A, int target) {\n\n\t\tint s = 0;\n\t\tint e = A.length - 1;\n\n\t\twhile (s <= e) {\n\t\t\tint m = (s + e) / 2;\n\n\t\t\tif (target == A[m])\n\t\t\t\treturn m;\n\t\t\telse if (A[s] <= A[m]) {\n\t\t\t\tif (A[s] <= target && target < A[m])\n\t\t\t\t\te = m;\n\t\t\t\telse\n\t\t\t\t\ts = m + 1;\n\t\t\t} else {\n\t\t\t\tif (A[m] < target && target <= A[e])\n\t\t\t\t\ts = m + 1;\n\t\t\t\telse\n\t\t\t\t\te = m;\n\t\t\t}\n\t\t}\n\n\t\treturn -1;\n\t}", "public int binarySearch(int[] nums, int target, int left, int right) {\n int res = left - 1;\n while (left <= right) {\n int mid = left + (right - left) / 2;\n if (nums[mid] <= target) {\n right = mid - 1;\n } else {\n res = mid;\n left = mid + 1;\n }\n }\n return res;\n }", "public Integer binSearch(Integer target, Integer[] data, Integer left, Integer right) {\n if (right - left == 1) {\n if (data[left] == target) return left;\n if (data[right] == target) return right;\n }\n if (right - left == 0) {\n if (data[left] == target) return left;\n }\n Integer midpt = (right + left) / 2 ;\n if (target == data[midpt]) return midpt ;\n if (target > data[midpt] ) return binSearch(target, data, midpt, right) ;\n if (target < data[midpt] ) return binSearch(target, data, left, midpt) ;\n\n return -1;\n }", "public int search(int[] A, int target) {\n // write your code here\n if (A == null || A.length == 0) return -1;\n int start = 0, end = A.length - 1;\n while (start + 1 < end) {\n int mid = start + (end - start) / 2;\n if (A[mid] == target) return mid;\n if (A[mid] < A[start]) {\n if (target <= A[end] && target > A[mid]){\n start = mid;\n }\n else {\n end = mid;\n }\n }\n else {\n if (target >= A[start] && target < A[mid]) {\n end = mid;\n }\n else {\n start = mid;\n }\n }\n }\n if (A[start] == target) return start;\n if (A[end] == target) return end;\n return -1;\n }", "public static int search(int[] nums, int target) {\n int low=0;\n int high=nums.length-1;\n int middle=(high+low)>>1;\n\n for(int i=0;i<nums.length;i++){\n int num = nums[middle];\n if(target>num){\n low=middle+1;\n middle=(high+low)>>1;\n }else if(target<num){\n high=middle-1;\n middle=(high+low)>>1;\n } else{\n return middle;\n }\n\n }\n\n return -1;\n }", "protected int binarySearch(int x) {\n if (arr.length == 0) {\n return -1;\n }\n\n int left = 0;\n int right = count - 1;\n\n while (left <= right) {\n int mid = (right + left) >>> 1;\n int val = arr[mid];\n\n if (val < x) {\n left = mid + 1;\n } else if (val > x) {\n right = mid - 1;\n }\n else {\n return mid;\n }\n }\n\n return -1;\n }", "public boolean containsNearbyAlmostDuplicate(int[] nums, int k, int t) {\n if (t < 0) return false;\n long sz = (long)t + 1;\n Map<Long, Long> map = new HashMap<>();\n for (int i = 0; i < nums.length; ++i) {\n long bucket = getBucket(nums[i], sz);\n if (map.containsKey(bucket)) return true;\n if (map.containsKey(bucket + 1) && Math.abs(nums[i] - map.get(bucket + 1)) < sz) return true;\n if (map.containsKey(bucket - 1) && Math.abs(nums[i] - map.get(bucket - 1)) < sz) return true;\n map.put(bucket, (long)nums[i]);\n if (i >= k) map.remove(getBucket(nums[i - k], sz));\n }\n return false;\n}", "public int search(int[] nums, int target) {\n int left = 0;\n int right = nums.length - 1;\n while (left < right) {\n int mid = (left + right) / 2;\n if (nums[mid] > nums[right]) {\n left = mid + 1;\n } else {\n right = mid;\n }\n }\n int pivot = left;\n left = 0;\n right = nums.length - 1;\n while (left <= right) {\n int mid = (left + right) / 2;\n int realmid = (mid + pivot) % nums.length;\n if (nums[realmid] == target) {\n return realmid;\n } else if (nums[realmid] < target) {\n left = mid + 1;\n } else {\n right = mid - 1;\n }\n }\n return -1;\n }" ]
[ "0.68956864", "0.6768776", "0.66550064", "0.6539936", "0.63978857", "0.6319619", "0.6239706", "0.62136614", "0.61409456", "0.60687524", "0.6054223", "0.60495853", "0.60243887", "0.600157", "0.59788626", "0.5965885", "0.5964883", "0.5958752", "0.5897584", "0.5889406", "0.5880467", "0.57896894", "0.57815325", "0.57590896", "0.5747413", "0.5736709", "0.57278585", "0.5712382", "0.57048905", "0.5693799", "0.56867504", "0.5684227", "0.56785905", "0.56767887", "0.56556684", "0.56496984", "0.5637858", "0.56181365", "0.56136113", "0.5588143", "0.5582738", "0.557959", "0.5576181", "0.55759203", "0.5574991", "0.5567332", "0.55673295", "0.55667824", "0.55589885", "0.5545399", "0.5536907", "0.5536115", "0.5525416", "0.55168474", "0.55104744", "0.55059385", "0.5500726", "0.5498098", "0.5494566", "0.54928935", "0.5479137", "0.5467153", "0.5466484", "0.5458598", "0.5455034", "0.545445", "0.54542774", "0.5451313", "0.54498464", "0.5446069", "0.54455626", "0.5444373", "0.54302496", "0.54239464", "0.541751", "0.54124224", "0.5411796", "0.5404702", "0.5399402", "0.5398731", "0.53872275", "0.5386214", "0.53855807", "0.5384402", "0.5384402", "0.5378483", "0.53632236", "0.5359169", "0.5356071", "0.5353341", "0.53522927", "0.5346533", "0.53422934", "0.53419006", "0.53393817", "0.53392386", "0.5329445", "0.53265446", "0.5325093", "0.5318177", "0.5318003" ]
0.0
-1
Manipulates the map once available. This callback is triggered when the map is ready to be used. This is where we can add markers or lines, add listeners or move the camera. In this case, we just add a marker near Sydney, Australia. If Google Play services is not installed on the device, the user will be prompted to install it inside the SupportMapFragment. This method will only be triggered once the user has installed Google Play services and returned to the app.
@Override public void onMapReady(GoogleMap googleMap) { mMap = googleMap; // Add a marker in Sydney and move the camera LatLng place = new LatLng(Double.parseDouble(lat),Double.parseDouble(longitude)); mMap.addMarker(new MarkerOptions().position(place)); moveToCurrentLocation(place); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void onMapReady(GoogleMap googleMap) {\n Geocoder geoCoder = new Geocoder(getActivity(), Locale.getDefault());\n double lat, lng;\n try {\n List<Address> addresses = geoCoder.getFromLocationName(\"Western Sydney Paramatta, NSW\", 5);\n lat = addresses.get(0).getLatitude();\n lng = addresses.get(0).getLongitude();\n } catch (Exception e) {\n lat = -34;\n lng = 151;\n }\n\n LatLng sydney = new LatLng(lat, lng);\n googleMap.addMarker(new MarkerOptions().position(sydney).title(\"WSU Paramatta\"));\n googleMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));\n if (ActivityCompat.checkSelfPermission(getContext(), Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(getContext(), Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n // TODO: Consider calling\n // ActivityCompat#requestPermissions\n // here to request the missing permissions, and then overriding\n // public void onRequestPermissionsResult(int requestCode, String[] permissions,\n // int[] grantResults)\n // to handle the case where the user grants the permission. See the documentation\n // for ActivityCompat#requestPermissions for more details.\n return;\n }\n googleMap.setMyLocationEnabled(true);\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n // Add a marker in Sydney, Australia, and move the camera.\n LatLng sydney = new LatLng(-34, 151);\n mMap.addMarker(new MarkerOptions().position(sydney).title(\"Marker in Sydney\"));\n mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n // Add a marker in Sydney and move the camera\n LatLng sydney = new LatLng(17.2231, 78.2827);\n marker = mMap.addMarker(new MarkerOptions().position(sydney).title(\"Marker in Hyderbbad\"));\n mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));\n initializeMap();\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n if (ContextCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_FINE_LOCATION)\n == PackageManager.PERMISSION_GRANTED) {\n mMap.setMyLocationEnabled(true);\n } else {\n ActivityCompat.requestPermissions(this,new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION}, 1);\n }\n // Add a marker in Sydney and move the camera\n if (loc != -1 && loc != 0) {\n locationManager.removeUpdates(this);\n mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(MainActivity.locations.get(loc), 10));\n\n mMap.addMarker(new MarkerOptions().position(MainActivity.locations.get(loc)).title(MainActivity.places.get(loc)));\n } else {\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n // TODO: Consider calling\n // ActivityCompat#requestPermissions\n // here to request the missing permissions, and then overriding\n // public void onRequestPermissionsResult(int requestCode, String[] permissions,\n // int[] grantResults)\n // to handle the case where the user grants the permission. See the documentation\n // for ActivityCompat#requestPermissions for more details.\n return;\n }\n locationManager.requestLocationUpdates(provider, 400, 1, this);\n\n }\n mMap.setOnMapLongClickListener(this);\n }", "@SuppressLint(\"MissingPermission\")\n @Override\n public void onMapReady(GoogleMap googleMap) {\n Log.d(\"MAP_FRAG\", \"MapCallback\");\n\n mMap = googleMap;\n\n Log.d(\"MAP\", mMap.toString());\n\n mMap.setPadding(0, 0, 0, 300);\n\n mMap.setMyLocationEnabled(true);\n mMap.setTrafficEnabled(true);\n mMap.getUiSettings().setCompassEnabled(true);\n mMap.getUiSettings().setMyLocationButtonEnabled(false);\n mMap.getUiSettings().setMapToolbarEnabled(false);\n\n mMap.addMarker(new MarkerOptions().position(new LatLng(Common.latitude, Common.longitude))\n .icon(BitmapDescriptorFactory.fromResource(R.mipmap.ic_mark_red)));\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(Common.latitude, Common.longitude), 15.0f));\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n getMarkers();\n\n // Add a marker in Sydney and move the camera\n LatLng penn = new LatLng(39.952290, -75.197060);\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(penn, 15));\n mMap.setMyLocationEnabled(true);\n UiSettings uiSettings = mMap.getUiSettings();\n uiSettings.setZoomControlsEnabled(true);\n uiSettings.setCompassEnabled(true);\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n // Add a marker in Sydney and move the camera\n LatLng sydney = new LatLng(-34, 151);\n mMap.addMarker(new MarkerOptions().position(sydney).title(\"Marker in Sydney\")\n //below line is use to add custom marker on our map.\n .icon(BitmapFromVector(getApplicationContext(), R.drawable.ic_flag)));\n mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mapReady = true;\n mMap = googleMap;\n // Add a marker in Sydney and move the camera\n LatLng Bangalore = new LatLng(12.972442, 77.580643);\n CameraPosition cameraPosition = new CameraPosition.Builder()\n .target(Bangalore)\n .zoom(17)\n .bearing(90)\n .tilt(30)\n .build();\n mMap.addMarker(new MarkerOptions().position(Bangalore).title(\"Marker in Bangalore\"));\n mMap.animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition));\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n mMap.setMapType(GoogleMap.MAP_TYPE_NORMAL);\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n // TODO: Consider calling\n // ActivityCompat#requestPermissions\n // here to request the missing permissions, and then overriding\n // public void onRequestPermissionsResult(int requestCode, String[] permissions,\n // int[] grantResults)\n // to handle the case where the user grants the permission. See the documentation\n // for ActivityCompat#requestPermissions for more details.\n return;\n }\n mMap.setMyLocationEnabled(true);\n mMap.setTrafficEnabled(true);\n mMap.setIndoorEnabled(true);\n mMap.setBuildingsEnabled(true);\n mMap.getUiSettings().setZoomControlsEnabled(true);\n\n // Add a marker in Sydney and move the camera\n LatLng sydney = new LatLng(43.777365,-79.3406);\n LatLng loc22=new LatLng(43.775748,-79.336674);\n LatLng loc3=new LatLng(43.769240,-79.360010);\n LatLng loc4=new LatLng(43.769290,-79.400101);\n LatLng loc5=new LatLng(43.769552,-79.601201);\n mMap.addMarker(new MarkerOptions().position(sydney).title(values[0]));\n mMap.addMarker(new MarkerOptions().position(loc22).title(values[1]));\n mMap.addMarker(new MarkerOptions().position(loc3).title(values[2]));\n mMap.addMarker(new MarkerOptions().position(loc4).title(values[3]));\n mMap.addMarker(new MarkerOptions().position(loc5).title(values[4]));\n\n //mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n LatLng position = new LatLng(latitude, longitude);\n\n // centre the map around the specified location\n mMap.animateCamera(CameraUpdateFactory.newLatLng(position));\n\n // add a marker at the specified location\n MarkerOptions options = new MarkerOptions();\n mMap.addMarker(options.position(position).title(locationName));\n\n // configure the map settings\n mMap.setTrafficEnabled(true);\n mMap.setBuildingsEnabled(true);\n mMap.setMapType(GoogleMap.MAP_TYPE_HYBRID);\n\n // enable the zoom controls\n mMap.getUiSettings().setZoomControlsEnabled(true);\n mMap.getUiSettings().setZoomGesturesEnabled(true);\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n if (ActivityCompat.checkSelfPermission(getContext(), Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(getContext(), Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n ActivityCompat.requestPermissions(getActivity(), new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, LOCATION_REQUEST_CODE);\n\n } else {\n buildGoogleApiClient();\n mMap.setMyLocationEnabled(true);\n }\n\n /* // Add a marker in Sydney and move the camera\n LatLng sydney = new LatLng(-34, 151);\n mMap.addMarker(new MarkerOptions().position(sydney).title(\"Marker in Sydney\"));\n mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));*/\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n // Add a marker in city and move the camera\n LatLng cityCoord = new LatLng(lat, lng);\n float zoom = (float) 9.0;\n mMap.addMarker(new MarkerOptions().position(cityCoord).title(cityAddr));\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(cityCoord, zoom));\n }", "public static void onMapReady() {\n mMap.addMarker(new MarkerOptions().position(new LatLng(latitude, longitude)).title(\"My Home\").snippet(\"Home Address\"));\n // For zooming automatically to the Dropped PIN Location\n mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(latitude,\n longitude), 12.0f));\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n // Add a marker in Sydney, Australia,\n // and move the map's camera to the same location.\n LatLng singapore = new LatLng(1.338709, 103.819519);\n googleMap.addMarker(new MarkerOptions().position(singapore)\n .title(\"Marker in Singapore\"));\n googleMap.moveCamera(CameraUpdateFactory.newLatLng(singapore));\n googleMap.animateCamera(CameraUpdateFactory.zoomTo(11),3000,null);\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n // Add a marker in Sydney and move the camera\n\n\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n // Add a marker in Sydney and move the camera\n LatLng sydney = new LatLng(-34, 151);\n mMap.addMarker(new MarkerOptions().position(sydney).title(\"Marker in Sydney\"));\n mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n // Add a marker in Sydney and move the camera\n LatLng sydney = new LatLng(-34, 151);\n mMap.addMarker(new MarkerOptions().position(sydney).title(\"Marker in Sydney\"));\n mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n // Add a marker in Sydney and move the camera\n LatLng sydney = new LatLng(-34, 151);\n mMap.addMarker(new MarkerOptions().position(sydney).title(\"Marker in Sydney\"));\n mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n // Add a marker in Sydney and move the camera\n LatLng sydney = new LatLng(-34, 151);\n mMap.addMarker(new MarkerOptions().position(sydney).title(\"Marker in Sydney\"));\n mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n mMap.getUiSettings().setMyLocationButtonEnabled(true);\n\n if (ActivityCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED\n && ActivityCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n return;\n }\n mMap.setMyLocationEnabled(true);\n\n addMarkers();\n\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n\n // Add a marker in Sydney and move the camera\n LatLng sydney = new LatLng(-34, 151);\n marker = mMap.addMarker(new MarkerOptions().position(sydney).title(\"Marker in Sydney\"));\n mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));\n }", "@Override\r\n public void onMapReady(GoogleMap googleMap) {\r\n if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED) {\r\n googleMap.setMyLocationEnabled(true);\r\n\r\n LocationManager locationManager = (LocationManager)\r\n getSystemService(Context.LOCATION_SERVICE);\r\n Criteria criteria = new Criteria();\r\n\r\n Location currentLocation = locationManager.getLastKnownLocation(locationManager.getBestProvider(criteria, false));\r\n\r\n LatLng sydney = new LatLng(currentLocation.getLatitude(), currentLocation.getLongitude());\r\n\r\n googleMap.moveCamera(CameraUpdateFactory.newLatLngZoom(sydney, 13));\r\n\r\n } else {\r\n PermissionUtils.requestPermission(this, LOCATION_PERMISSION_REQUEST_CODE, Manifest.permission.ACCESS_FINE_LOCATION, true);\r\n }\r\n\r\n updateMarkersData(googleMap);\r\n\r\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n CameraUpdate cUpdate = CameraUpdateFactory.newLatLngZoom(new LatLng(35.68, 139.76), 12);\n //mMap.addMarker(new MarkerOptions().position(new LatLng(35.68, 139.76)).title(\"Marker in Tokyo\"));\n mMap.moveCamera(cUpdate);\n if (ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n // TODO: Consider calling\n // ActivityCompat#requestPermissions\n // here to request the missing permissions, and then overriding\n // public void onRequestPermissionsResult(int requestCode, String[] permissions,\n // int[] grantResults)\n // to handle the case where the user grants the permission. See the documentation\n // for ActivityCompat#requestPermissions for more details.\n return;\n }\n mMap.setMyLocationEnabled(true);\n mMap.setTrafficEnabled(true);\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n // Add a marker in Sydney and move the camera\n LatLng wroclaw = new LatLng(51.110, 17.034);\n mMap.addMarker(new MarkerOptions().position(wroclaw));\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(wroclaw, 12));\n mMap.clear();\n // Setting a click event handler for the map\n mMap.setOnMapClickListener(new GoogleMap.OnMapClickListener() {\n\n @Override\n public void onMapClick(LatLng latLng) {\n bSelect.setEnabled(true);\n // Creating a marker\n MarkerOptions markerOptions = new MarkerOptions();\n\n // Setting the position for the marker\n markerOptions.position(latLng);\n\n // Setting the title for the marker.\n // This will be displayed on taping the marker\n markerOptions.title(\"NOWY: \" + latLng.latitude + \" : \" + latLng.longitude);\n\n markerOptions.alpha(0.6f);\n // Clears the previously touched position\n mMap.clear();\n\n // Animating to the touched position\n mMap.animateCamera(CameraUpdateFactory.newLatLng(latLng));\n\n // Placing a marker on the touched position\n mMap.addMarker(markerOptions);\n\n location = latLng.latitude + \" \" + latLng.longitude;\n\n setupMarker();\n }\n });\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n // Add a marker in Sydney and move the camera\n LatLng sydney = new LatLng(-34, 151);\n mMap.addMarker(new MarkerOptions().position(sydney).title(\"Marker in Sydney\"));\n mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));\n mLocationRequest = LocationRequest.create()\n .setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY)\n .setInterval(1*1000)\n .setFastestInterval(5 * 100);\n if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION)\n == PackageManager.PERMISSION_GRANTED) {\n mMap.setMyLocationEnabled(true);\n } else {\n // Show rationale and request permission.\n }\n }", "@Override\r\n public void onMapReady(GoogleMap googleMap) {\r\n Log.i(TAG, \"map is ready\");\r\n mMap = googleMap;\r\n\r\n mMap.setMyLocationEnabled(true);\r\n mMap.setOnMyLocationButtonClickListener(this);\r\n mMap.setOnMyLocationClickListener(this);\r\n\r\n startLocationUpdates();\r\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n frLatLng = new LatLng(getLatitude, getLongitude);\n\n map = googleMap;\n map.getUiSettings().setMyLocationButtonEnabled(false);\n\n if (ActivityCompat.checkSelfPermission(getContext()\n , Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED\n && ActivityCompat.checkSelfPermission(getContext(),\n Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n\n return;\n }\n\n map.addMarker(new MarkerOptions().position(frLatLng)).setTitle(getString(R.string.my_location));\n googleMap.getUiSettings().setMyLocationButtonEnabled(true);\n map.animateCamera(CameraUpdateFactory.newLatLngZoom(frLatLng, 520));\n\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n // Add a marker in Sydney and move the camera\n LatLng montesson = new LatLng(48.9190286,2.1380955);\n mMap.addMarker(new MarkerOptions().position(montesson).title(\"Marker in Montesson\"));\n mMap.moveCamera(CameraUpdateFactory.newLatLng(montesson));\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n // Add a marker in Sydney and move the camera\n LatLng sydney = new LatLng(-34, 151);\n mMap.addMarker(new MarkerOptions().position(sydney).title(\"Marker in Sydney\"));\n mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));\n\n if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION)\n == PackageManager.PERMISSION_GRANTED) {\n mMap.setMyLocationEnabled(true);\n } else {\n // Show rationale and request permission.\n int i = 12;\n ActivityCompat.requestPermissions(this,\n new String[]{Manifest.permission.ACCESS_FINE_LOCATION},\n i);\n\n }\n mMap.setMyLocationEnabled(true); //when location changed call line. loaction manager\n\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n // Add a marker in Sydney and move the camera\n LatLng myLocation = new LatLng(latitude, longitude);\n addMarker(myLocation, name);\n moveCamera(myLocation, 3);\n\n //search a place\n /*searchInput = (EditText) findViewById(R.id.map_search_input);\n searchInput.setOnEditorActionListener(new TextView.OnEditorActionListener() {\n @Override\n public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {\n if(actionId == EditorInfo.IME_ACTION_SEARCH\n || actionId == EditorInfo.IME_ACTION_DONE\n || actionId == KeyEvent.ACTION_DOWN\n || actionId == KeyEvent.KEYCODE_ENTER)\n //search location\n geoLocate();\n return false;\n }\n });*/\n\n //add location\n addButton = findViewById(R.id.map_add_button);\n addButton.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n Intent intent = new Intent();\n intent.putExtra(\"latitude\", marker.getPosition().latitude);\n intent.putExtra(\"longitude\", marker.getPosition().longitude);\n intent.putExtra(\"name\", marker.getTitle());\n setResult(4, intent);\n finish();\n }\n });\n\n //long tap to add a marker\n mMap.setOnMapLongClickListener(new GoogleMap.OnMapLongClickListener() {\n @Override\n public void onMapLongClick(@NonNull LatLng latLng) {\n addMarker(latLng, name);\n }\n });\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n // TODO: Consider calling\n // ActivityCompat#requestPermissions\n // here to request the missing permissions, and then overriding\n // public void onRequestPermissionsResult(int requestCode, String[] permissions,\n // int[] grantResults)\n // to handle the case where the user grants the permission. See the documentation\n // for ActivityCompat#requestPermissions for more details.\n return;\n }\n mMap.setMyLocationEnabled(true);\n mMap.setOnMyLocationChangeListener(this);\n markerIconBitmapDescriptor = BitmapDescriptorFactory.fromResource(R.mipmap.ic_driver_check_in);\n\n mFillColor = Color.HSVToColor(50, new float[]{0, 1, 1});\n mStrokeColor = Color.BLACK;\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n updateLocationUI();\n getDeviceLocation();\n // Add a marker in Sydney and move the camera\n //float zoom = 15;\n //LatLng gbc = new LatLng(43.676209, -79.410703);\n //mMap.addMarker(new MarkerOptions().position(gbc).title(\"Marker in GBC\"));\n //mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(gbc, zoom));\n\n }", "@Override\n public void onMapReady(final GoogleMap map) {\n map.moveCamera(CameraUpdateFactory.zoomTo(14));\n //map.moveCamera(CameraUpdateFactory.newLatLng(sydney));\n map.setMyLocationEnabled(true);\n map.setOnMyLocationButtonClickListener(new GoogleMap.OnMyLocationButtonClickListener() {\n @Override\n public boolean onMyLocationButtonClick() {\n\n return true;\n }\n });\n map.setOnMyLocationChangeListener(new GoogleMap.OnMyLocationChangeListener() {\n @Override\n public void onMyLocationChange(Location location) {\n Log.d(\"map\", \"onMyLocationChange\");\n if (!isinit) {\n isinit = true;\n if (now_Location == null ||\n now_Location.getLatitude() != location.getLatitude() ||\n now_Location.getLongitude() != location.getLongitude()) {\n now_Location = location;\n initStreetView();\n }\n }\n LatLng sydney = new LatLng(location.getLatitude(), location.getLongitude());\n map.moveCamera(CameraUpdateFactory.newLatLng(sydney));\n }\n });\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n // Add a marker in Sydney and move the camera\n LatLng sydney = new LatLng(121.5729889, 25.0776557);\n mMap.addMarker(new MarkerOptions().position(sydney).title(\"This is my first Maker\"));\n mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n // Add a marker in Sydney and move the camera\n LatLng CSN = new LatLng(51.87, -8.481);\n mMap.setMapType(MAP_TYPE_HYBRID);\n mMap.addMarker(new MarkerOptions().position(CSN).title(\"Marker at CSN college\"));\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(CSN, 15F));\n mMap.getUiSettings().setZoomControlsEnabled(true);\n }", "private void setUpMapIfNeeded() {\n if (mGoogleMap != null) {\n if (checkPermission()) {\n mGoogleMap.setMyLocationEnabled(true);\n }\n // Check if we were successful in obtaining the map.\n if (mMapView != null) {\n\n mGoogleMap.setOnMyLocationChangeListener(new GoogleMap.OnMyLocationChangeListener() {\n @Override\n public void onMyLocationChange(Location location) {\n mGoogleMap.addMarker(new MarkerOptions().position(new LatLng(location.getLatitude(), location.getLongitude())).title(\"It's Me!\"));\n mGoogleMap.moveCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(location.getLatitude(), location.getLongitude()), 10));\n }\n });\n\n }\n }\n }", "@Override\r\n public void onMapReady(GoogleMap googleMap) {\r\n mMap = googleMap;\r\n\r\n // Add a marker in Sydney and move the camera\r\n LatLng charlotte = new LatLng(35.22, -80.84);\r\n //currentMarker = mMap.addMarker(new MarkerOptions().position(charlotte).title(\"Charlotte, NC\"));\r\n mMap.moveCamera(CameraUpdateFactory.newLatLng(charlotte));\r\n //currentMarker.setTag(0);\r\n\r\n mMap.setOnMapLongClickListener(this);\r\n\r\n\r\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED\r\n //&& ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED\r\n ) {\r\n // TODO: Consider calling\r\n\r\n return;\r\n }\r\n mMap.setMyLocationEnabled(true);\r\n mMap.setOnMyLocationButtonClickListener(new GoogleMap.OnMyLocationButtonClickListener() {\r\n @Override\r\n public boolean onMyLocationButtonClick() {\r\n Log.d(\"maps\", \"On my location button click\");\r\n return false;\r\n }\r\n });\r\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n Log.d(\"TEST\", \"MAP READY\");\n mMap = googleMap;\n\n // Add a marker in Sydney and move the camera\n mMap.setMapType(GoogleMap.MAP_TYPE_NORMAL);\n\n LatLng curLocation = new LatLng(latitude,longitude);\n CameraUpdate cameraUpdate = CameraUpdateFactory.newLatLngZoom(curLocation,15.0f);\n setPin(latitude,longitude, null);\n mMap.moveCamera(cameraUpdate);\n for(int i = 0; i < restaurantList.size(); i++){\n double lat = restaurantList.get(i).getLatitude();\n double lng = restaurantList.get(i).getLongitude();\n setPin(lat, lng, restaurantList.get(i));\n }\n //Check we have the users permission to access their location\n // if we dont have it, we have to request it\n if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION)== PackageManager.PERMISSION_GRANTED){\n mMap.setMyLocationEnabled(true);\n\n } else {\n //we dont have permission, so we have to ask for it\n ActivityCompat.requestPermissions(this,\n new String[]{Manifest.permission.ACCESS_FINE_LOCATION},\n MY_LOCATION_REQUEST_CODE);\n //run asychronously.. show an alert dialog\n //user can choose allow or deny\n }\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n mMap.setTrafficEnabled(true);\n googleMap.setMyLocationEnabled(true);\n mMap.setOnMyLocationChangeListener(onMyLocationChangeListener);\n\n // mMap.setPadding(0, 0, 0, 100);\n UiSettings uiSettings = mMap.getUiSettings();\n uiSettings.setZoomControlsEnabled(true);\n\n mMap.addMarker(new MarkerOptions()\n .position(new LatLng(65.9667, -18.5333))\n .title(\"Hello world\"));\n\n\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n // Add a marker in Sydney and move the camera\n LatLng loc = new LatLng(v, v1);\n mMap.addMarker(new\n MarkerOptions().position(loc).title(\"0000000000\"));\n mMap.moveCamera(CameraUpdateFactory.newLatLng(loc));\n }", "private void setUpMapIfNeeded() {\n if (mMap == null) {\n // Try to obtain the map from the SupportMapFragment.\n mMapFragment = ((SupportMapFragment)getSupportFragmentManager().findFragmentById(R.id.fragment_show_place_info_map));\n mMap = mMapFragment.getMap();\n // Check if we were successful in obtaining the map.\n if (mMap != null) {\n setUpMap();\n }\n }\n }", "@Override\n public void onMapReady(GoogleMap map) {\n mMap = map;\n\n // Use a custom info window adapter to handle multiple lines of text in the\n // info window contents.\n mMap.setInfoWindowAdapter(new GoogleMap.InfoWindowAdapter() {\n\n @Override\n // Return null here, so that getInfoContents() is called next.\n public View getInfoWindow(Marker arg0) {\n return null;\n }\n\n @Override\n public View getInfoContents(Marker marker) {\n // Inflate the layouts for the info window, title and snippet.\n View infoWindow = getLayoutInflater().inflate(R.layout.custom_info_contents,\n (FrameLayout) findViewById(R.id.map), false);\n\n TextView title = ((TextView) infoWindow.findViewById(R.id.title));\n title.setText(marker.getTitle());\n\n TextView snippet = ((TextView) infoWindow.findViewById(R.id.snippet));\n snippet.setText(marker.getSnippet());\n\n return infoWindow;\n }\n });\n\n // Turn on the My Location layer and the related control on the map.\n updateLocationUI();\n\n // Get the current location of the device and set the position of the map.\n getDeviceLocation();\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n\n mMap = googleMap;\n\n // Add a marker in Sydney and move the camera\n LatLng sydney = new LatLng(-34, 151);\n mMap.addMarker(new MarkerOptions().position(sydney).title(\"you are in sydney\").draggable(true));\n mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));\n mMap.setOnMarkerDragListener(this);\n mMap.setOnMapLongClickListener(this);\n\n }", "private void setUpMapIfNeeded() {\n if (mMap == null) {\n // Try to obtain the map from the SupportMapFragment.\n mMap = mMapFragment.getMap();\n // Check if we were successful in obtaining the map.\n if (mMap != null) {\n mMap.setMapType(GoogleMap.MAP_TYPE_NORMAL);\n mMap.setMyLocationEnabled(false);\n mMap.getUiSettings().setCompassEnabled(true);\n mMap.getUiSettings().setZoomControlsEnabled(true);\n mMap.getUiSettings().setMyLocationButtonEnabled(true);\n final LatLng update = getLastKnownLocation();\n if (update != null) {\n mMap.moveCamera(CameraUpdateFactory.newCameraPosition(CameraPosition.fromLatLngZoom(update, 11.0f)));\n }\n\n mMap.setOnMapClickListener(new GoogleMap.OnMapClickListener() {\n\n @Override\n public void onMapClick(LatLng latLng) {\n mIsNeedLocationUpdate = false;\n moveToLocation(latLng, false);\n }\n\n });\n\n }\n }\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n // Add a marker in Sydney and move the camera\n LatLng sydney = new LatLng(-34, 151);\n // Home Mark\n LatLng home = new LatLng(41.374736, 2.168308);\n float zoom = 13;\n\n // Inicialitzem mapa\n mMap.setMapType(GoogleMap.MAP_TYPE_TERRAIN); //Tipus de mapa\n mMap.addMarker(new MarkerOptions().position(home).title(\"IOC\")); //Marcador inicial\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(home, zoom)); //Centrem mapa en el marcador inicial\n\n this.setMapLongClick(mMap);\n this.enableMyLocation();\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n // TODO: Consider calling\n // ActivityCompat#requestPermissions\n // here to request the missing permissions, and then overriding\n\n // to handle the case where the user grants the permission. See the documentation\n // for ActivityCompat#requestPermissions for more details.\n return;\n }\n\n final LatLng[] myLoc = {new LatLng(1, 1)};\n mMap.setMyLocationEnabled(true);\n// mMap.setOnMyLocationChangeListener(new GoogleMap.OnMyLocationChangeListener() {\n// @Override\n// public void onMyLocationChange(Location location) {\n// myLoc[0] = new LatLng(location.getLatitude(), location.getLongitude());\n// mMap.addCircle(new CircleOptions().center(myLoc[0]));\n// mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(myLoc[0], 15));\n// }\n// });\n\n mMap.addCircle(new CircleOptions().center(new LatLng(lat, lng)));\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(lat, lng), 18));\n\n mMap.setOnPoiClickListener(new GoogleMap.OnPoiClickListener() {\n @Override\n public void onPoiClick(PointOfInterest poi) {\n\n }\n });\n\n mMap.getUiSettings().setMapToolbarEnabled(true);\n\n // Add a marker in Sydney and move the camera\n\n\n showItems(lat, lng, radius);\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n LatLng posini = new LatLng(3.4,-76.5);\n myMarker = mMap.addMarker(new MarkerOptions().position(posini));\n\n requestLocation();\n\n googleMap.setOnCameraMoveListener(new GoogleMap.OnCameraMoveListener() {\n @Override\n public void onCameraMove() {\n if (!flag) {\n\n addMarker();\n flag = true;\n }\n }\n });\n\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n Log.d(logTag,\"4\");\n mMap = googleMap;\n mMap.getUiSettings().setZoomControlsEnabled(true);\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, LOCATION_REQUEST);\n return;\n }\n mMap.setOnMapLongClickListener(this);\n mMap.setOnInfoWindowClickListener( this );\n mMap.setOnMapClickListener(this);\n mMap.setMyLocationEnabled(true);\n ll=new LatLng(currentLocation.getLatitude(),currentLocation.getLongitude());\n MarkerOptions options = new MarkerOptions().position(ll);\n options.title(getAddressFromLatLng(ll));\n\n Log.d(logTag,\"5\");\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n // Add a marker in Sydney and move the camera\n LatLng hn = new LatLng(14.079526, -87.180662);\n mMap.moveCamera(CameraUpdateFactory.newLatLng(hn));\n mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(hn,7));\n helperFacturacion = new FacturacionHelper(MapListClientesActivity.this);\n\n\n addMarkers();\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n // Add a marker in Sydney and move the camera\n setInitialLocation(VehicleData.getLatitude(), VehicleData.getLongitude());\n }", "@Override\r\n public void onMapReady(GoogleMap googleMap) {\r\n mMap = googleMap;\r\n if(ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION)!= PackageManager.PERMISSION_GRANTED){\r\n ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.ACCESS_FINE_LOCATION},101);\r\n }\r\n loc = lm.getLastKnownLocation(LocationManager.GPS_PROVIDER);\r\n populateMap(loc);\r\n try {\r\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(lm.getLastKnownLocation(LocationManager.GPS_PROVIDER).getLatitude(), lm.getLastKnownLocation(LocationManager.GPS_PROVIDER).getLongitude()), 15.0f));\r\n }catch(Exception blyat){\r\n AlertDialog.Builder builder = new AlertDialog.Builder(this);\r\n builder.setMessage(\"No hemos podido acceder a tu localización, revisa el estado de GPS y reinicia la app\");\r\n builder.show();\r\n }\r\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n try{\n Geocoder geo = new Geocoder(this);\n\n //Get address provided for location as Address object\n List<Address> foundAddresses = geo.getFromLocationName(location.getAddress(),1);\n Address address = geo.getFromLocationName(location.getAddress(),1).get(0);\n\n LatLng position= new LatLng(address.getLatitude(),address.getLongitude());\n\n googleMap.addMarker(new MarkerOptions().position(position)\n .title(location.getTitle()));\n googleMap.setMinZoomPreference(12);\n googleMap.setMaxZoomPreference(15);\n googleMap.moveCamera(CameraUpdateFactory.newLatLng(position));\n }\n catch (IOException e){\n e.printStackTrace();\n }\n catch(IndexOutOfBoundsException e){\n e.printStackTrace();\n }\n }", "private void setUpMapIfNeeded() {\n if (mMap == null) {\n // Try to obtain the map from the SupportMapFragment.\n mMap = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map))\n .getMap();\n // Check if we were successful in obtaining the map.\n if (mMap != null) {\n mMap.setOnMapLoadedCallback(new GoogleMap.OnMapLoadedCallback() {\n @Override\n public void onMapLoaded() {\n\n setUpMap();\n\n }\n });\n }\n }\n }", "@Override\n @SuppressWarnings({\"MissingPermission\"})\n public void onMapReady(GoogleMap googleMap) {\n\n Log.d(TAG, \"Map is ready.\");\n mMap = googleMap;\n\n mMap.setMyLocationEnabled(true);\n mLastLocation = LocationServices.FusedLocationApi.getLastLocation(\n mGoogleApiClient);\n\n setMarkerToCurrentLocation();\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n// updateMap(new LocationModel(41.806363, 44.768531, \"Agmasheneblis Xeivani\"));\n if (shoppingList.getLocationReminder() != null) {\n updateMap(shoppingList.getLocationReminder());\n } else {\n updateMap(null);\n }\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n // Add a marker in Sydney and move the camera\n LatLng sydney = new LatLng(LocationStorage.getInstance().getLocation().getLatitude(), LocationStorage.getInstance().getLocation().getLongitude());\n// BitmapDescriptor icon = BitmapDescriptorFactory.fromResource(R.drawable.ic_large_marker);\n Marker marker = mMap.addMarker(new MarkerOptions().position(sydney).title(\"Current Location\").snippet(\"Hold and drag to your desired location\"));\n marker.showInfoWindow();\n mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));\n CameraUpdate cameraUpdate = CameraUpdateFactory.newLatLngZoom(sydney, 15);\n mMap.animateCamera(cameraUpdate);\n marker.setDraggable(true);\n mMap.setOnMarkerDragListener(new GoogleMap.OnMarkerDragListener() {\n @Override\n public void onMarkerDragStart(Marker marker) {\n\n }\n\n @Override\n public void onMarkerDrag(Marker marker) {\n\n }\n\n @Override\n public void onMarkerDragEnd(Marker marker) {\n LatLng latLng=marker.getPosition();\n Location temp = new Location(LocationManager.GPS_PROVIDER);\n temp.setLatitude(latLng.latitude);\n temp.setLongitude(latLng.longitude);\n LocationStorage.getInstance().setLocation(temp);\n }\n });\n// mMap.setOnMarkerClickListener(new GoogleMap.OnMarkerClickListener() {\n// @Override\n// public boolean onMarkerClick(Marker marker) {\n//\n// return true;\n// }\n// });\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n uiSettings = mMap.getUiSettings();\n uiSettings.setZoomControlsEnabled(false);\n // Add a marker in Sydney and move the camera\n LatLng sydney = new LatLng(-34, 151);\n mMap.addMarker(new MarkerOptions().position(sydney).title(\"Marker in Sydney\"));\n mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));\n mcircleOptions = mcircleOptions.center(sydney);\n mcircleOptions = mcircleOptions.radius(500);\n mcircleOptions = mcircleOptions.strokeWidth(2);\n mcircleOptions = mcircleOptions.strokeColor(Color.argb(100, 255, 73, 73));\n mcircleOptions = mcircleOptions.fillColor(Color.argb(100, 255, 73, 73));\n mMap.addCircle(mcircleOptions);\n if (ActivityCompat.checkSelfPermission(this,\n android.Manifest.permission.ACCESS_FINE_LOCATION)\n !=\n PackageManager.PERMISSION_GRANTED\n &&\n ActivityCompat.checkSelfPermission(this,\n android.Manifest.permission.ACCESS_COARSE_LOCATION)\n != PackageManager.PERMISSION_GRANTED) {\n // TODO: Consider calling\n // ActivityCompat#requestPermissions\n // here to request the missing permissions, and then overriding\n // public void onRequestPermissionsResult(int requestCode, String[] permissions,\n // int[] grantResults)\n // to handle the case where the user grants the permission. See the documentation\n // for ActivityCompat#requestPermissions for more details.\n return;\n }\n mMap.setMyLocationEnabled(true);\n\n mMap.setOnMapLongClickListener(new GoogleMap.OnMapLongClickListener() {\n @Override\n public void onMapLongClick(LatLng latLng) {\n mlatLng = latLng;\n mMap.clear();\n mMap.addMarker(new MarkerOptions().position(mlatLng));\n mcircleOptions = mcircleOptions.center(mlatLng);\n mMap.addCircle(mcircleOptions);\n mMap.animateCamera(CameraUpdateFactory.newLatLng(latLng));\n geocoder = new Geocoder(Maps.this, Locale.getDefault());\n try {\n List<Address> addresses = geocoder.getFromLocation(mlatLng.latitude, mlatLng.longitude, 1);\n for (int i=0; i < addresses.get(0).getMaxAddressLineIndex(); i++) {\n Log.e(\"Address\", addresses.get(0).getAddressLine(i) + \"\");\n caddress = addresses.get(0).getAddressLine(i);\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n loc_data = getSharedPreferences(\"loc_data\", MODE_PRIVATE);\n SharedPreferences.Editor loc_data_editor = loc_data.edit();\n loc_data_editor.putString(\"lat\", Double.toString(mlatLng.latitude));\n loc_data_editor.putString(\"lng\", Double.toString(mlatLng.longitude));\n loc_data_editor.putString(\"add\", caddress + \"\");\n loc_data_editor.commit();\n }\n });\n }", "@Override\r\n public void onMapReady(GoogleMap googleMap) {\r\n mMap = googleMap;\r\n mMap.setMapType(GoogleMap.MAP_TYPE_NORMAL);\r\n\r\n //Initialize Google Play Services\r\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\r\n if (ContextCompat.checkSelfPermission(this,\r\n Manifest.permission.ACCESS_FINE_LOCATION)\r\n == PackageManager.PERMISSION_GRANTED) {\r\n buildGoogleApiClient();\r\n mMap.setMyLocationEnabled(true);\r\n }\r\n }\r\n else {\r\n buildGoogleApiClient();\r\n mMap.setMyLocationEnabled(true);\r\n }\r\n }", "@Override\n public void onMapReady(GoogleMap map) {\n mMap = map;\n\n // Use a custom info window adapter to handle multiple lines of text in the\n // info window contents.\n mMap.setInfoWindowAdapter(new GoogleMap.InfoWindowAdapter() {\n\n @Override\n // Return null here, so that getInfoContents() is called next.\n public View getInfoWindow(Marker arg0) {\n return null;\n }\n\n @Override\n public View getInfoContents(Marker marker) {\n // Inflate the layouts for the info window, title and snippet.\n View infoWindow = getLayoutInflater().inflate(R.layout.custom_info_contents,\n (FrameLayout) findViewById(R.id.map), false);\n\n TextView title = ((TextView) infoWindow.findViewById(R.id.title));\n title.setText(marker.getTitle());\n\n TextView snippet = ((TextView) infoWindow.findViewById(R.id.snippet));\n snippet.setText(marker.getSnippet());\n\n return infoWindow;\n }\n });\n\n // Turn on the My Location layer and the related control on the map.\n updateLocationUI();\n\n // Get the current location of the device and set the position of the map.\n getDeviceLocation();\n\n initializeOtherSettlements(new LatLng(mLastKnownLocation.getLatitude(), mLastKnownLocation.getLongitude()));\n initializeQuestLocations(new LatLng(mLastKnownLocation.getLatitude(), mLastKnownLocation.getLongitude()));\n\n mMap.setOnMarkerClickListener(this);\n mMap.setOnMapClickListener(this);\n mMap.setOnPoiClickListener(this);\n mMap.setOnInfoWindowClickListener(this);\n\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(\n new LatLng(mLastKnownLocation.getLatitude(),\n mLastKnownLocation.getLongitude()), 9));\n\n final PlaceAutocompleteFragment autocompleteFragment = (PlaceAutocompleteFragment)\n getFragmentManager().findFragmentById(R.id.place_autocomplete_fragment);\n\n autocompleteFragment.getView().setBackgroundColor(Color.WHITE);\n autocompleteFragment.getView().setVisibility(View.GONE);\n autocompleteFragment.setOnPlaceSelectedListener(new PlaceSelectionListener() {\n @Override\n public void onPlaceSelected(Place place) {\n //Bias results towards the user's current location\n /*autocompleteFragment.setBoundsBias(new LatLngBounds(\n new LatLng(place.getLatLng().latitude, place.getLatLng().longitude),\n new LatLng(place.getLatLng().latitude, place.getLatLng().longitude)));*/\n\n //Get info about the selected place.\n //Log.i(TAG, \"Place: \" + place.getName());\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(\n new LatLng(place.getLatLng().latitude,\n place.getLatLng().longitude), mMap.getCameraPosition().zoom));\n\n addMarkerAtPoi(place);\n }\n\n @Override\n public void onError(Status status) {\n // TODO: Handle the error.\n Log.i(TAG, \"An error occurred: \" + status);\n }\n });\n\n updateMapHistory();\n updateCustomTimeUI();\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n enableMyLocation();\n buildGoogleApiClient();\n\n }", "public void setUpMapIfNeeded() {\n if (mMap == null) {\n // Try to obtain the map from the SupportMapFragment.\n mMap = ((SupportMapFragment) getChildFragmentManager()\n .findFragmentById(R.id.location_map)).getMap();\n MapsInitializer.initialize(getActivity().getApplicationContext());\n // Check if we were successful in obtaining the map.\n if (mMap != null)\n setUpMap();\n }\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n String info = sTitle;\n // Add a marker in Sydney and move the camera\n LatLng pos = new LatLng(latitude, longitude);\n mMap.addMarker(new MarkerOptions().position(pos).title(info));\n mMap.moveCamera(CameraUpdateFactory.newLatLng(pos));\n mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(pos, 8));\n\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n gpsTracker = new GPSTracker(this);\n\n // TODO Cek Permission >= Marshmellow\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION)\n != PackageManager.PERMISSION_GRANTED\n &&\n ActivityCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M &&\n checkSelfPermission(Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED\n && checkSelfPermission(Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n requestPermissions(new String[]{\n Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION\n }, 110);\n return;\n }\n }\n\n if (gpsTracker.canGetLocation()) {\n latawal = gpsTracker.getLatitude();\n lonawal = gpsTracker.getLongitude();\n namelocationawal = myLocation(latawal, lonawal);\n }\n\n // Add a marker in Sydney and move the camera\n LatLng myLocation = new LatLng(latawal, lonawal);\n locawal.setText(namelocationawal);\n mMap.addMarker(new MarkerOptions().position(myLocation).title(namelocationawal));\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(myLocation, 14));\n mMap.getUiSettings().setMyLocationButtonEnabled(true);\n mMap.setPadding(30, 80, 30, 80);\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n LatLng oregon = new LatLng(45.3, -122);\n mMap.addMarker(new MarkerOptions().position(oregon).title(\"Marker in Oregon\"));\n mMap.moveCamera(CameraUpdateFactory.newLatLng(oregon));\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n /* mMap = googleMap;\n\n // Add a marker in Sydney and move the camera\n LatLng sydney = new LatLng(-34, 151);\n //mMap.setMapType(GoogleMap.MAP_TYPE_SATELLITE);\n mMap.addMarker(new MarkerOptions().position(sydney).title(\"Marker in Sydney\"));\n mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));*/\n LatLng ifto = new LatLng(-10.199202218157746, -48.31158433109522);\n mMap = googleMap;\n mMap.setOnCameraIdleListener(this);\n mMap.addMarker(new MarkerOptions().position(ifto).title(\"IFTO Campus Palmas\"));\n }", "private void setupMap() {\n if (googleMap == null) {\n SupportMapFragment mapFrag = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map);\n mapFrag.getMapAsync(this);\n mLocationProvider = new LocationProvider(this, this);\n }\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n Log.d(TAG, \"onMapReady: map is ready\");\n mMap = googleMap;\n\n if (mLocationPermissionsGranted) {\n\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION)\n != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n return;\n }\n mMap.setMyLocationEnabled(true);\n mMap.getUiSettings().setMyLocationButtonEnabled(false);\n\n\n mMap.getUiSettings().setCompassEnabled(true);\n// mMap.getUiSettings().setZoomControlsEnabled(true);\n mMap.getUiSettings().setCompassEnabled(true);\n mMap.getUiSettings().setIndoorLevelPickerEnabled(true);\n mMap.getUiSettings().setMapToolbarEnabled(true);\n\n mMap.getUiSettings().setAllGesturesEnabled(true);\n getDeviceLocation();\n mMap.setOnMarkerDragListener(this);\n\n }\n }", "public void onMapReady(GoogleMap googleMap , double lati, double longi) {\n mMap = googleMap;\n\n // Add a marker in Sydney and move the camera\n LatLng sydney = new LatLng(lati, longi);\n mMap.addMarker(new MarkerOptions().position(sydney).title(\"Your Current Location\"));\n mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));\n }", "@Override\n public void onMapReady(GoogleMap map) {\n mGoogleMap = map;\n mGoogleMap.setMyLocationEnabled(true);\n Log.d(TAG, \"Map Ready\");\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n\n\n mMap = googleMap;\n\n attachLocationListener();\n\n\n mMap.setOnMarkerDragListener(this);\n\n }", "public void onMapReady(GoogleMap googleMap) {\r\n mMap = googleMap;\r\n\r\n mMap.moveCamera(CameraUpdateFactory.zoomTo(1));\r\n\r\n\r\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\r\n // TODO: Consider calling\r\n // ActivityCompat#requestPermissions\r\n // here to request the missing permissions, and then overriding\r\n // public void onRequestPermissionsResult(int requestCode, String[] permissions,\r\n // int[] grantResults)\r\n // to handle the case where the user grants the permission. See the documentation\r\n // for ActivityCompat#requestPermissions for more details.\r\n return;\r\n }\r\n mMap.setMyLocationEnabled(true);\r\n\r\n /// This allows the user to zoom in and out of the map\r\n mMap.getUiSettings().setZoomControlsEnabled(true);\r\n mMap.getUiSettings().setMyLocationButtonEnabled(true);\r\n mMap.getUiSettings().isMyLocationButtonEnabled();\r\n mMap.getUiSettings().setMyLocationButtonEnabled(true);\r\n\r\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n\n mMap = googleMap;\n //Agafar la localitzacio actual per mostrar-ho al mapa\n LocationManager locationManager = (LocationManager)\n getSystemService(Context.LOCATION_SERVICE);\n Criteria criteria = new Criteria();\n\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n // TODO: Consider calling\n // ActivityCompat#requestPermissions\n // here to request the missing permissions, and then overriding\n // public void onRequestPermissionsResult(int requestCode, String[] permissions,\n // int[] grantResults)\n // to handle the case where the user grants the permission. See the documentation\n // for ActivityCompat#requestPermissions for more details.\n return;\n }\n Location location = locationManager.getLastKnownLocation(locationManager.getBestProvider(criteria, false));\n LatLng actual = new LatLng((location.getLatitude()),location.getLongitude());\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(actual,13));\n }", "@RequiresApi(api = Build.VERSION_CODES.M)\n @Override\n public void onMapReady(GoogleMap googleMap) {\n MapsInitializer.initialize(getContext());\n mMap = googleMap;\n mMap.setMinZoomPreference(13.0f);\n mMap.setMaxZoomPreference(20.0f);\n mMap.setOnMapClickListener(this);\n mMap.setInfoWindowAdapter(this);\n mMap.setOnInfoWindowClickListener(MyOnInfoWindowClickListener);\n\n if (ActivityCompat.checkSelfPermission(getContext(), Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(getActivity(), Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n requestPermissions(new String[]{Manifest.permission.\n ACCESS_FINE_LOCATION}, 1);\n } else {\n mMap.setMyLocationEnabled(true);\n }\n }\n\n mMap.setMyLocationEnabled(true);\n\n buildGoogleApiClient();\n mGoogleApiClient.connect();\n\n }", "@Override\n public void onMapReady(final GoogleMap map) {\n mMap = map;\n\n mMap.setInfoWindowAdapter(new GoogleMap.InfoWindowAdapter() {\n\n @Override\n // Return null here, so that getInfoContents() is called next.\n public View getInfoWindow(Marker arg0) {\n return null;\n }\n\n @Override\n public View getInfoContents(Marker marker) {\n // Inflate the layouts for the info window, title and snippet.\n @SuppressLint(\"InflateParams\") View infoWindow = getLayoutInflater().inflate(R.layout.custom_info_contents, null);\n\n TextView title = infoWindow.findViewById(R.id.title);\n title.setText(marker.getTitle());\n\n TextView snippet = infoWindow.findViewById(R.id.snippet);\n snippet.setText(marker.getSnippet());\n\n return infoWindow;\n }\n });\n\n mMap.setOnMapLongClickListener(new GoogleMap.OnMapLongClickListener() {\n @Override\n public void onMapLongClick(LatLng point) {\n mMap.clear();\n buildMarker(\"User Tap\", \"This is snippet\", point, true);\n @SuppressLint(\"DefaultLocale\") String latLong = String.format(\"%f,%f\", point.latitude, point.longitude);\n String endPoint = String.format(placesURL,latLong, String.valueOf(distance), BuildConfig.API_KEY);\n Location locationSelected = new Location(mLastKnownLocation);\n locationSelected.setLatitude(point.latitude);\n locationSelected.setLongitude(point.longitude);\n showPlacesNearby(locationSelected, endPoint);\n }\n });\n\n mMap.setOnMapClickListener(new GoogleMap.OnMapClickListener() {\n @Override\n public void onMapClick(LatLng latLng) {\n mMap.clear();\n }\n });\n\n mMap.setOnMyLocationButtonClickListener(new GoogleMap.OnMyLocationButtonClickListener() {\n @Override\n public boolean onMyLocationButtonClick() {\n mMap.clear();\n updateLocationUI();\n getDeviceLocation();\n return true;\n }\n });\n\n\n // Prompt the user for permission.\n getLocationPermission();\n\n // Turn on the My Location layer and the related control on the map.\n updateLocationUI();\n\n // Get the current location of the device and set the position of the map.\n getDeviceLocation();\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n mUiSettings = mMap.getUiSettings();\n mUiSettings.setAllGesturesEnabled(mLock);\n\n mMap.setOnMyLocationButtonClickListener(this);\n mMap.setOnMapClickListener(this);\n mMap.setOnMapLongClickListener(this);\n mMap.setOnMarkerDragListener(this);\n\n enableMyLocation();\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n riderLat = getIntent().getDoubleExtra(DriverActivity.RIDER_LATITUDE_EXTRA, 0.0);\n riderLong = getIntent().getDoubleExtra(DriverActivity.RIDER_LONGITUDE_EXTRA, 0.0);\n LatLng rider = new LatLng(riderLat, riderLong);\n riderMarker = mMap.addMarker(new MarkerOptions()\n .position(rider)\n .title(\"Rider\")\n .icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_RED)));\n\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION)\n != PackageManager.PERMISSION_GRANTED\n\n && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION)\n != PackageManager.PERMISSION_GRANTED) {\n\n Toast.makeText(this, \"You don't have location permission\", Toast.LENGTH_LONG).show();\n return;\n }\n\n Location hereNow = mLocationManager.getLastKnownLocation(mBestProvider);\n if (hereNow != null) {\n onLocationChanged(hereNow);\n }\n\n mLocationManager.requestLocationUpdates(mBestProvider, 400, 1, this);\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n //Enable Current location\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.\n PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.\n ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n // TODO: Consider calling\n // ActivityCompat#requestPermissions\n // here to request the missing permissions, and then overriding\n // public void onRequestPermissionsResult(int requestCode, String[] permissions,\n // int[] grantResults)\n // to handle the case where the user grants the permission. See the documentation\n // for ActivityCompat#\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n\n requestPermissions(new String[]{Manifest.permission.ACCESS_COARSE_LOCATION,\n Manifest.permission.ACCESS_FINE_LOCATION}, MY_REQUEST_INT);\n\n }\n\n\n return;\n\n } else {\n mMap.setMyLocationEnabled(true);\n\n\n }\n\n\n // Add a marker in Sydney and move the camera\n //LatLng sydney = new LatLng(-34, 151);\n //mMap.addMarker(new MarkerOptions().position(sydney).title(\"Marker in Sydney\")\n // .icon(BitmapDescriptorFactory.fromResource(R.drawable.blackspot))\n // );\n //mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));\n //mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(sydney,16),5000,null);\n //new MarkerOptions().icon(BitmapDescriptorFactory.fromResource(R.drawable.blackspot));\n\n //LatLng latLng = new LatLng(-1.2652560778411037, 36.81265354156495);\n //mMap.addMarker(new MarkerOptions().position(latLng).title(\"Marker in Parklands\"));\n //mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(latLng,16),5000,null);\n //mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));\n\n //BitmapDescriptor icon = BitmapDescriptorFactory.fromResource(R.drawable.blackspot);\n ////LatLng harmbug = new LatLng(-37, 120);\n //mMap.addMarker(new MarkerOptions().position(harmbug).title(\"Marker in Harmbug\")\n //.icon(icon));\n //mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(harmbug,16),5000,null);\n //mMap.moveCamera(CameraUpdateFactory.newLatLng(harmbug));\n\n //LatLng kenya = new LatLng(-2.456, 37);\n //mMap.addMarker(new MarkerOptions().position(kenya).title(\"Marker in Kenya\"));\n //mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(kenya,16),5000,null);\n //mMap.moveCamera(CameraUpdateFactory.newLatLng(kenya));\n\n LatLng sydney = new LatLng(-0.8041213212075744, 36.53117179870606);\n mMap.addMarker(new MarkerOptions().position(sydney).title(\"Blackspot at Kinungi\"));\n mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));\n mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(sydney, 18), 5000, null);\n\n LatLng gilgil = new LatLng(-0.2167, 36.2667);\n mMap.addMarker(new MarkerOptions().position(gilgil).title(\"Blackspot at Gilgil\"));\n mMap.moveCamera(CameraUpdateFactory.newLatLng(gilgil));\n mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(gilgil, 18), 5000, null);\n\n LatLng njoro = new LatLng(-0.3290, 35.9440);\n mMap.addMarker(new MarkerOptions().position(njoro).title(\"Blackspot at Njoro\"));\n mMap.moveCamera(CameraUpdateFactory.newLatLng(njoro));\n mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(njoro, 18), 5000, null);\n\n LatLng bluepost = new LatLng(-1.0226988092777693, 37.06806957721711);\n mMap.addMarker(new MarkerOptions().position(bluepost).title(\"Blackspot at Bluepost Bridge\"));\n mMap.moveCamera(CameraUpdateFactory.newLatLng(bluepost));\n mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(bluepost, 18), 5000, null);\n\n LatLng Nithi = new LatLng(-0.26649259802107667, 37.66248464584351);\n mMap.addMarker(new MarkerOptions().position(Nithi).title(\"Blackspot at Nithi Bridge\"));\n mMap.moveCamera(CameraUpdateFactory.newLatLng(Nithi));\n mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(bluepost, 18), 5000, null);\n\n LatLng Maungu = new LatLng(-3.558353542362671, 38.74993801116944);\n mMap.addMarker(new MarkerOptions().position(Maungu).title(\"Blackspot at Maungu Area\"));\n mMap.moveCamera(CameraUpdateFactory.newLatLng(Maungu));\n mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(Maungu, 18), 5000, null);\n\n LatLng Misikhu = new LatLng(0.6662027919912484, 34.75215911865235);\n mMap.addMarker(new MarkerOptions().position(Misikhu).title(\"Blackspot at Misikhu\"));\n mMap.moveCamera(CameraUpdateFactory.newLatLng(Misikhu));\n mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(Maungu, 18), 5000, null);\n\n LatLng Muthaiga = new LatLng(-1.2614375406469367, 36.840720176696784);\n mMap.addMarker(new MarkerOptions().position(Muthaiga).title(\"Blackspot at Muthaiga Road\"));\n mMap.moveCamera(CameraUpdateFactory.newLatLng(Muthaiga));\n mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(Maungu, 18), 5000, null);\n\n LatLng Pangani = new LatLng(-1.2665003190843396, 36.834239959716804);\n mMap.addMarker(new MarkerOptions().position(Muthaiga).title(\"Blackspot at Pangani\"));\n mMap.moveCamera(CameraUpdateFactory.newLatLng(Pangani));\n mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(Pangani, 18), 5000, null);\n\n LatLng KU = new LatLng(-1.1823303731373749, 36.93703293800355);\n mMap.addMarker(new MarkerOptions().position(KU).title(\"Blackspot at KU\"));\n mMap.moveCamera(CameraUpdateFactory.newLatLng(KU));\n mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(KU, 18), 5000, null);\n\n\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n Toast.makeText(this, \"Map is Ready\", Toast.LENGTH_SHORT).show();\n Log.d(TAG, \"onMapReady: map is ready\");\n mMap = googleMap;\n\n if (mLocationPermissionsGranted) {\n getDeviceLocation();\n\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION)\n != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n return;\n }\n mMap.setMyLocationEnabled(true);\n mMap.getUiSettings().setMyLocationButtonEnabled(false);\n\n init();\n }\n\n }", "@Override\n public void onMapReady(GoogleMap googleMap)\n {\n // This method is called AFTER the map is loaded from Google Play services\n // At this point the map is ready\n\n // Store the reference to the Google Map in our member variable\n mMap = googleMap;\n // Custom marker (Big Blue one - mymarker.png)\n LatLng myPosition = new LatLng(33.671028, -117.911305);\n\n // Add a custom marker at \"myPosition\"\n mMap.addMarker(new MarkerOptions().position(myPosition).title(\"My Location\").icon(BitmapDescriptorFactory.fromResource(R.drawable.my_marker)));\n\n // Center the camera over myPosition\n CameraPosition cameraPosition = new CameraPosition.Builder().target(myPosition).zoom(15.0f).build();\n CameraUpdate cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition);\n // Move map to our cameraUpdate\n mMap.moveCamera(cameraUpdate);\n\n // Then add normal markers for all the caffeine locations from the allLocationsList.\n // Set the zoom level of the map to 15.0f\n\n // Now, let's plot each Location form the list with a standard marker\n for (Location location : allLocationsList)\n {\n LatLng caffeineLocation = new LatLng(location.getLatitude(), location.getLongitude());\n mMap.addMarker(new MarkerOptions().position(caffeineLocation).title(location.getName()));\n }\n\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n LatLng location = new LatLng(mLat, mLng);\n moveCamera(location, DEFAUT_ZOOM);\n if (ActivityCompat.checkSelfPermission(this,\n android.Manifest.permission.ACCESS_FINE_LOCATION)\n != PackageManager.PERMISSION_GRANTED\n && ActivityCompat.checkSelfPermission(\n this,\n android.Manifest.permission.ACCESS_COARSE_LOCATION)\n != PackageManager.PERMISSION_GRANTED) {\n return;\n }\n mMap.setMyLocationEnabled(true);\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n // Add a marker in Pula and move the camera\n LatLng pula = new LatLng(44.86726450096342, 13.850460687162476);\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(pula, 13));\n\n if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION)\n != PackageManager.PERMISSION_GRANTED) {\n enableUserLocation();\n zoomTooUserLocation();\n } else {\n if (ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission\n .ACCESS_FINE_LOCATION)) {\n //we can show user dialog why this permission is necessery\n\n ActivityCompat.requestPermissions(this, new String[]{Manifest.permission\n .ACCESS_FINE_LOCATION}, LOCATION_REQUEST_CODE);\n\n } else {\n ActivityCompat.requestPermissions(this, new String[]{Manifest.permission\n .ACCESS_FINE_LOCATION}, LOCATION_REQUEST_CODE);\n }\n }\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n MapStyleOptions style = MapStyleOptions.loadRawResourceStyle(getContext(), R.raw.mapstyle_day);\n mMap.setMapStyle(style);\n\n if (locationProvider != null) {\n enableLocationBullet();\n if (lastpos != null) {\n mMap.moveCamera(CameraUpdateFactory.newCameraPosition(lastpos));\n }\n }\n // Start clustermanager and add markers\n setUpClusterManager();\n\n mMap.setOnMapLoadedCallback(new GoogleMap.OnMapLoadedCallback() {\n @Override\n public void onMapLoaded() {\n mapReady = true;\n if (searchedRestaurants != null) {\n addRestaurants(searchedRestaurants, false);\n }\n\n Location loc = locationProvider.getLastLocation();\n if (!init) {\n zoomMapToPosition(loc, MY_LOCATION_ZOOM);\n init = true;\n }\n\n }\n });\n\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n mMap.setMapType(GoogleMap.MAP_TYPE_NORMAL);\n\n ////run with it to check what is happening and remove it to see\n\n\n //Initialize Google Play Services\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED) {\n buildGoogleApiClient();\n mMap.setMyLocationEnabled(true);\n }\n } else {\n buildGoogleApiClient();\n mMap.setMyLocationEnabled(true);\n }\n }", "@Override\r\n public void onMapReady(GoogleMap googleMap) {\r\n mMap = googleMap;\r\n mMap.setMapType(GoogleMap.MAP_TYPE_HYBRID);\r\n\r\n //Initialize Google Play Services\r\n if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\r\n if (ContextCompat.checkSelfPermission(this,\r\n Manifest.permission.ACCESS_FINE_LOCATION)\r\n == PackageManager.PERMISSION_GRANTED) {\r\n buildGoogleApiClient();\r\n mMap.setMyLocationEnabled(true);\r\n }\r\n }\r\n else {\r\n buildGoogleApiClient();\r\n mMap.setMyLocationEnabled(true);\r\n }\r\n\r\n\r\n }", "@Override\n public void onMapReady(GoogleMap map) {\n mMap = map;\n mUiSettings = mMap.getUiSettings();\n mUiSettings.setCompassEnabled(false);\n mUiSettings.setMapToolbarEnabled(false);\n mUiSettings.setZoomControlsEnabled(false);\n mUiSettings.setScrollGesturesEnabled(false);\n mUiSettings.setTiltGesturesEnabled(false);\n mUiSettings.setRotateGesturesEnabled(false);\n\n // Add a marker in Sydney and move the camera\n final LatLng airport = new LatLng(listAirport.get(index).getLatitude(), listAirport.get(index).getLongitude());\n mMap.moveCamera(CameraUpdateFactory.newLatLng(airport));\n mMap.setMinZoomPreference(10.0f);\n mMap.setMaxZoomPreference(10.0f);\n mMap.setMapType(GoogleMap.MAP_TYPE_HYBRID);\n\n map.setOnMapClickListener(new GoogleMap.OnMapClickListener() {\n @Override\n public void onMapClick(LatLng latLng) {\n onClick(index, MapsActivity.class);\n }\n });\n\n }", "private void setUpMapIfNeeded() {\n if (mMap == null) {\n // Try to obtain the map from the SupportMapFragment.\n SupportMapFragment mapFragment = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map));\n mapFragment.getMapAsync(this);\n mMap = mapFragment.getMap();\n\n }\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n LatLng latlong = new LatLng(29.375859, 47.977405);\n googleMap.addMarker(new MarkerOptions().position(latlong).title(\"\"));\n googleMap.moveCamera(CameraUpdateFactory.newLatLngZoom(latlong, 9.0f));\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n // Add a marker in Sydney and move the camera\n LatLng livraria = new LatLng(maps.getLatitude(), maps.getLongitude());\n if(this.maps.getId() == 1){\n mMap.addMarker(new MarkerOptions().position(livraria).title(\"Livraria Saraiva - Praia de Belas\"));\n } else if(this.maps.getId() == 2){\n mMap.addMarker(new MarkerOptions().position(livraria).title(\"Livraria Cultura - Bourbon Country\"));\n } else if(this.maps.getId() == 3){\n mMap.addMarker(new MarkerOptions().position(livraria).title(\"Livraria Cameron\"));\n } else if(this.maps.getId() == 4){\n mMap.addMarker(new MarkerOptions().position(livraria).title(\"Livraria Siciliano\"));\n }\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(livraria, 15f));\n mMap.getUiSettings().setZoomControlsEnabled(true);\n\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n Log.d(LOG_TAG, \"called onMapReady()\");\n mMap = googleMap;\n\n // Set up UI for map\n mMap.setMyLocationEnabled(true);\n mMap.setBuildingsEnabled(true);\n mUiSettings = mMap.getUiSettings(); // https://developers.google.com/maps/documentation/android-sdk/controls\n mUiSettings.setMyLocationButtonEnabled(false);\n mUiSettings.setCompassEnabled(true);\n mUiSettings.setTiltGesturesEnabled(true);\n mUiSettings.setRotateGesturesEnabled(true);\n mUiSettings.setScrollGesturesEnabled(true);\n mUiSettings.setZoomGesturesEnabled(true);\n\n\n // Move the camera to last known user location\n fusedLocationClient.getLastLocation().addOnSuccessListener(this, new OnSuccessListener<Location>() { // this -> getActivity()??\n @Override\n public void onSuccess(Location location) {\n // Got last known location. In some rare situations this can be null.\n if (location != null) {\n double latitude = location.getLatitude();\n double longitude = location.getLongitude();\n LatLng startingLocation = new LatLng(latitude, longitude);\n\n CameraPosition cameraPosition = new CameraPosition.Builder()\n .target(startingLocation) // Sets the center of the map\n .zoom(16) // Sets the zoom\n .build(); // Creates a CameraPosition from the builder\n mMap.animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition), 250, null);\n Log.d(LOG_TAG, \" > moved map to last known location\");\n }\n }\n });\n addZoneHolesToMap(shiftZones);\n }", "private void setUpMapIfNeeded() {\n if (mMap == null) {\n // Try to obtain the map from the SupportMapFragment.\n mMap = ((MapFragment) getFragmentManager().findFragmentById(R.id.map))\n .getMap();\n // Check if we were successful in obtaining the map.\n if (mMap != null) {\n Intent info = getIntent();\n setUpMap(new LatLng(info.getDoubleExtra(\"latitude\", 0), info.getDoubleExtra(\"longitude\", 0)), info.getStringExtra(\"name\"));\n }\n }\n }", "private void setUpMapIfNeeded() {\n if (mMap == null) {\n SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()\n .findFragmentById(R.id.map);\n mapFragment.getMapAsync(this);\n }\n }", "private void setUpMapIfNeeded() {\n if (mMap == null) {\n // Try to obtain the map from the SupportMapFragment.\n mMap = mMapFragment.getMap();\n // Check if we were successful in obtaining the map.\n if (mMap != null) {\n Log.i(TAG, \"Yes, we have a google map...\");\n setUpMap();\n } else {\n // means that Google Service is not available\n form.dispatchErrorOccurredEvent(this, \"setUpMapIfNeeded\",\n ErrorMessages.ERROR_GOOGLE_PLAY_NOT_INSTALLED);\n }\n\n }\n }", "private void setupMap() {\n int status = GooglePlayServicesUtil.isGooglePlayServicesAvailable(getBaseContext());\n \t\tif ( status != ConnectionResult.SUCCESS ) {\n \t\t\t// Google Play Services are not available.\n \t\t\tint requestCode = 10;\n \t\t\tGooglePlayServicesUtil.getErrorDialog( status, this, requestCode ).show();\n \t\t} else {\n \t\t\t// Google Play Services are available.\n \t\t\tif ( this.googleMap == null ) {\n \t\t\t\tFragmentManager fragManager = this.getSupportFragmentManager();\n \t\t\t\tSupportMapFragment mapFrag = (SupportMapFragment) fragManager.findFragmentById( R.id.edit_gpsfilter_area_google_map );\n \t\t\t\tthis.googleMap = mapFrag.getMap();\n \n \t\t\t\tif ( this.googleMap != null ) {\n \t\t\t\t\t// The Map is verified. It is now safe to manipulate the map.\n \t\t\t\t\tthis.configMap();\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t}", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n // Add a marker in Sydney and move the camera\n LatLng liege = new LatLng(50.620552, 5.581177);\n LatLng victime = new LatLng(50.620957, 5.582263);\n mMap.addMarker(new MarkerOptions()\n .position(liege)\n .title(\"You are here !\")\n .icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_YELLOW)));\n mMap.addMarker(new MarkerOptions()\n .position(victime)\n .title(\"Aurélie\")\n .icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_RED)));\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(liege,17));\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n // Add a marker in Sydney and move the camera\n LatLng parque = new LatLng(latitud, longitud);\n mMap.addMarker(new MarkerOptions().position(parque).title(lugar).icon(BitmapDescriptorFactory.fromResource(R.drawable.icons8_terraria_48)));\n mMap.moveCamera(CameraUpdateFactory.newLatLng(parque));\n mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(latitud, longitud),16.0f));\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n this.googleMap = googleMap;\n marker = googleMap.addMarker(markerOptions);\n googleMap.animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition));\n\n }", "private void setUpMapIfNeeded() {\n // Do a null check to confirm that we have not already instantiated the map.\n if (mMap == null) {\n // Try to obtain the map from the SupportMapFragment.\n mMap = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map))\n .getMap();\n mMap.setOnMarkerDragListener(this);\n // Check if we were successful in obtaining the map.\n if (mMap != null) {\n setUpMap();\n }\n }\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n buildGoogleApiClient();\n mMap.setMyLocationEnabled(true);\n\n }", "private void setUpMapIfNeeded() {\r\n if (map == null) {\r\n SupportMapFragment smf = null;\r\n smf = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map);\r\n\r\n if (smf != null) {\r\n map = smf.getMap();\r\n if (map != null) {\r\n map.setMyLocationEnabled(true);\r\n }\r\n }\r\n }\r\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n mMap.setOnMapLoadedCallback(new GoogleMap.OnMapLoadedCallback() {\n @Override\n public void onMapLoaded() {\n mapLoaded = true;\n waitForMapPlease();\n }\n });\n }" ]
[ "0.81884885", "0.8042996", "0.80369604", "0.8033771", "0.7998488", "0.79770344", "0.7957945", "0.7957621", "0.7954723", "0.79429656", "0.7936834", "0.79301476", "0.7915297", "0.79048723", "0.7888234", "0.7885085", "0.7885085", "0.7885085", "0.7885085", "0.7878164", "0.78446823", "0.7820209", "0.781347", "0.77963114", "0.7792471", "0.77872795", "0.7786649", "0.77632064", "0.77445674", "0.7742489", "0.77364564", "0.7729635", "0.76863027", "0.7673587", "0.7666516", "0.7666381", "0.7660542", "0.7660032", "0.7658027", "0.7656693", "0.764701", "0.7640233", "0.76333576", "0.76280946", "0.7621821", "0.7620966", "0.7618586", "0.76174897", "0.7608421", "0.76047516", "0.75995344", "0.7598638", "0.7593479", "0.75854367", "0.7585161", "0.75797725", "0.7571025", "0.7568314", "0.7563941", "0.7563395", "0.7554277", "0.7551052", "0.75451434", "0.75433755", "0.75384784", "0.75305945", "0.7527021", "0.7520158", "0.75182885", "0.75154966", "0.7492834", "0.74907964", "0.749", "0.74861366", "0.74739647", "0.7467611", "0.74626285", "0.7457827", "0.7457491", "0.7452213", "0.74507207", "0.7448966", "0.74479777", "0.74376386", "0.7429154", "0.7425011", "0.7417805", "0.74167794", "0.7416", "0.7411618", "0.7410149", "0.7408731", "0.7399689", "0.73954254", "0.7393991", "0.7389341", "0.73889375", "0.7377822", "0.7369343", "0.73593694" ]
0.7827953
21
/ renamed from: a
public static <T> T m23767a(T t) { if (t != null) { return t; } throw new NullPointerException("null reference"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface C4521a {\n /* renamed from: a */\n void mo12348a();\n }", "public interface C1423a {\n /* renamed from: a */\n void mo6888a(int i);\n }", "interface bxc {\n /* renamed from: a */\n void mo2508a(bxb bxb);\n}", "interface C33292a {\n /* renamed from: a */\n void mo85415a(String str);\n }", "interface C10331b {\n /* renamed from: a */\n void mo26876a(int i);\n }", "public interface C0779a {\n /* renamed from: a */\n void mo2311a();\n}", "public interface C6788a {\n /* renamed from: a */\n void mo20141a();\n }", "public interface C0237a {\n /* renamed from: a */\n void mo1791a(String str);\n }", "public interface C35013b {\n /* renamed from: a */\n void mo88773a(int i);\n}", "public interface C11112n {\n /* renamed from: a */\n void mo38026a();\n }", "@Override\n\t\t\t\tpublic void a() {\n\n\t\t\t\t}", "public interface C23407b {\n /* renamed from: a */\n void mo60892a();\n\n /* renamed from: b */\n void mo60893b();\n }", "interface C0312e {\n /* renamed from: a */\n void mo4671a(View view, int i, int i2, int i3, int i4);\n }", "public interface C34379a {\n /* renamed from: a */\n void mo46242a(bmc bmc);\n }", "public interface C32456b<T> {\n /* renamed from: a */\n void mo83696a(T t);\n }", "private String convertir(String a) {\n StringBuilder atributo = new StringBuilder(a);\n atributo.insert(0, Character.toUpperCase(atributo.charAt(0)));\n return atributo.deleteCharAt(1).toString();\n }", "protected m a(String name) {\n/* 42 */ return this.a.get(name);\n/* */ }", "public interface AbstractC23925a {\n /* renamed from: a */\n void mo105476a();\n }", "private interface C0257a {\n /* renamed from: a */\n float mo196a(ViewGroup viewGroup, View view);\n\n /* renamed from: b */\n float mo195b(ViewGroup viewGroup, View view);\n }", "public interface C3598a {\n /* renamed from: a */\n void mo11024a(int i, int i2, String str);\n }", "public interface C2459d {\n /* renamed from: a */\n C2451d mo3408a(C2457e c2457e);\n}", "public interface am extends ak {\r\n /* renamed from: a */\r\n void mo194a(int i) throws RemoteException;\r\n\r\n /* renamed from: a */\r\n void mo195a(List<LatLng> list) throws RemoteException;\r\n\r\n /* renamed from: b */\r\n void mo196b(float f) throws RemoteException;\r\n\r\n /* renamed from: b */\r\n void mo197b(boolean z);\r\n\r\n /* renamed from: c */\r\n void mo198c(boolean z) throws RemoteException;\r\n\r\n /* renamed from: g */\r\n float mo199g() throws RemoteException;\r\n\r\n /* renamed from: h */\r\n int mo200h() throws RemoteException;\r\n\r\n /* renamed from: i */\r\n List<LatLng> mo201i() throws RemoteException;\r\n\r\n /* renamed from: j */\r\n boolean mo202j();\r\n\r\n /* renamed from: k */\r\n boolean mo203k();\r\n}", "public interface C32459e<T> {\n /* renamed from: a */\n void mo83698a(T t);\n }", "public interface C32458d<T> {\n /* renamed from: a */\n void mo83695a(T t);\n }", "public interface C5482b {\n /* renamed from: a */\n void mo27575a();\n\n /* renamed from: a */\n void mo27576a(int i);\n }", "public interface C27084a {\n /* renamed from: a */\n void mo69874a();\n\n /* renamed from: a */\n void mo69875a(List<Aweme> list, boolean z);\n }", "public void a() {\n ((a) this.a).a();\n }", "public interface C1153a {\n /* renamed from: a */\n void mo4520a(byte[] bArr);\n }", "public interface C13373b {\n /* renamed from: a */\n void mo32681a(String str, int i, boolean z);\n}", "public interface C40453c {\n /* renamed from: a */\n void mo100442a(C40429b bVar);\n\n /* renamed from: a */\n void mo100443a(List<String> list);\n\n /* renamed from: b */\n void mo100444b(List<C40429b> list);\n}", "public interface AbstractC17367b {\n /* renamed from: a */\n void mo84655a();\n }", "@Override\r\n\tpublic void a() {\n\t\t\r\n\t}", "public interface C43270a {\n /* renamed from: a */\n void mo64942a(String str, long j, long j2);\n}", "public interface C18928d {\n /* renamed from: a */\n void mo50320a(C18924b bVar);\n\n /* renamed from: b */\n void mo50321b(C18924b bVar);\n}", "public interface C0087c {\n /* renamed from: a */\n String mo150a(String str);\n}", "public interface C1529m {\n /* renamed from: a */\n void mo3767a(int i);\n\n /* renamed from: a */\n void mo3768a(String str);\n}", "interface C4483e {\n /* renamed from: a */\n boolean mo34114a();\n}", "public interface C1234b {\r\n /* renamed from: a */\r\n void m8367a();\r\n\r\n /* renamed from: b */\r\n void m8368b();\r\n}", "public interface C10965j<T> {\n /* renamed from: a */\n T mo26439a();\n}", "public interface C28772a {\n /* renamed from: a */\n View mo73990a(View view);\n }", "@Override\n\tpublic void a() {\n\t\t\n\t}", "public interface C8326b {\n /* renamed from: a */\n C8325a mo21498a(String str);\n\n /* renamed from: a */\n void mo21499a(C8325a aVar);\n}", "void metodo1(int a, int[] b) {\r\n\t\ta += 5;//Par\\u00e1metro con el mismo nombre que el campo de la clase.\r\n\t\tb[0] += 7;//se produce un env\\u00edo por referencia, apunta a una copia de un objeto, que se asigna aqu\\u00ed.\r\n\t}", "public interface C2367a {\n /* renamed from: a */\n C2368d mo1698a();\n }", "interface C30585a {\n /* renamed from: b */\n void mo27952b(C5379a c5379a, int i, C46650a c46650a, C7620bi c7620bi);\n }", "public interface C4211a {\n\n /* renamed from: com.iab.omid.library.oguryco.c.a$a */\n public interface C4212a {\n /* renamed from: a */\n void mo28760a(View view, C4211a aVar, JSONObject jSONObject);\n }\n\n /* renamed from: a */\n JSONObject mo28758a(View view);\n\n /* renamed from: a */\n void mo28759a(View view, JSONObject jSONObject, C4212a aVar, boolean z);\n}", "public interface C4697a extends C5595at {\n /* renamed from: a */\n void mo12634a();\n\n /* renamed from: a */\n void mo12635a(String str);\n\n /* renamed from: a */\n void mo12636a(boolean z);\n\n /* renamed from: b */\n void mo12637b();\n\n /* renamed from: c */\n void mo12638c();\n }", "public interface C4773c {\n /* renamed from: a */\n void m15858a(int i);\n\n /* renamed from: a */\n void m15859a(int i, int i2);\n\n /* renamed from: a */\n void m15860a(int i, int i2, int i3);\n\n /* renamed from: b */\n void m15861b(int i, int i2);\n}", "public interface C4869f {\n /* renamed from: a */\n C4865b mo6249a();\n}", "public interface C1799a {\n /* renamed from: b */\n void mo3314b(String str);\n }", "public interface C43499b {\n /* renamed from: a */\n void mo8445a(int i, String str, int i2, byte[] bArr);\n}", "public interface C0601aq {\n /* renamed from: a */\n void mo9148a(int i, ArrayList<C0889x> arrayList);\n}", "public interface C45101e {\n /* renamed from: b */\n void mo3796b(int i);\n}", "public interface AbstractC6461g {\n /* renamed from: a */\n String mo42332a();\n}", "public interface AbstractC1645a {\n /* renamed from: a */\n String mo17375a();\n }", "public interface C6178c {\n /* renamed from: a */\n Map<String, String> mo14888a();\n}", "public interface C5101b {\n /* renamed from: a */\n void mo5289a(C5102c c5102c);\n\n /* renamed from: b */\n void mo5290b(C5102c c5102c);\n}", "public interface C19045k {\n /* renamed from: a */\n void mo50368a(int i, Object obj);\n\n /* renamed from: b */\n void mo50369b(int i, Object obj);\n}", "public b a()\r\n/* 12: */ {\r\n/* 13:13 */ return this.a;\r\n/* 14: */ }", "public interface C7720a {\n /* renamed from: a */\n long mo20406a();\n}", "public String a()\r\n/* 25: */ {\r\n/* 26:171 */ return \"dig.\" + this.a;\r\n/* 27: */ }", "public interface ayt {\n /* renamed from: a */\n int mo1635a(long j, List list);\n\n /* renamed from: a */\n long mo1636a(long j, alb alb);\n\n /* renamed from: a */\n void mo1637a();\n\n /* renamed from: a */\n void mo1638a(long j, long j2, List list, ayp ayp);\n\n /* renamed from: a */\n void mo1639a(ayl ayl);\n\n /* renamed from: a */\n boolean mo1640a(ayl ayl, boolean z, Exception exc, long j);\n}", "public interface C24221b extends C28343z<C28318an> {\n /* renamed from: a */\n void mo62991a(int i);\n\n String aw_();\n\n /* renamed from: e */\n Aweme mo62993e();\n}", "public interface C4051c {\n /* renamed from: a */\n boolean mo23707a();\n}", "public interface C45112b {\n /* renamed from: a */\n List<C45111a> mo107674a(Integer num);\n\n /* renamed from: a */\n List<C45111a> mo107675a(Integer num, Integer num2);\n\n /* renamed from: a */\n void mo107676a(C45111a aVar);\n\n /* renamed from: b */\n void mo107677b(Integer num);\n\n /* renamed from: c */\n long mo107678c(Integer num);\n}", "public void acionou(int a){\n\t\t\tb=a;\n\t\t}", "public interface C44963i {\n /* renamed from: a */\n void mo63037a(int i, int i2);\n\n void aA_();\n\n /* renamed from: b */\n void mo63039b(int i, int i2);\n}", "public interface C32457c<T> {\n /* renamed from: a */\n void mo83699a(T t, int i, int i2, String str);\n }", "public interface C5861g {\n /* renamed from: a */\n void mo18320a(C7251a aVar);\n\n @Deprecated\n /* renamed from: a */\n void mo18321a(C7251a aVar, String str);\n\n /* renamed from: a */\n void mo18322a(C7252b bVar);\n\n /* renamed from: a */\n void mo18323a(C7253c cVar);\n\n /* renamed from: a */\n void mo18324a(C7260j jVar);\n}", "public interface C0937a {\n /* renamed from: a */\n void mo3807a(C0985po[] poVarArr);\n }", "public interface C8466a {\n /* renamed from: a */\n void mo25956a(int i);\n\n /* renamed from: a */\n void mo25957a(long j, long j2);\n }", "public interface C39684b {\n /* renamed from: a */\n void mo98969a();\n\n /* renamed from: a */\n void mo98970a(C29296g gVar);\n\n /* renamed from: a */\n void mo98971a(C29296g gVar, int i);\n }", "public interface C43470b {\n /* renamed from: a */\n void mo61496a(C43469a aVar, C43471c cVar);\n }", "public interface AbstractC18255a {\n /* renamed from: a */\n void mo88521a();\n\n /* renamed from: a */\n void mo88522a(String str);\n\n /* renamed from: b */\n void mo88523b();\n\n /* renamed from: c */\n void mo88524c();\n }", "public interface C1436d {\n /* renamed from: a */\n C1435c mo1754a(C1433a c1433a, C1434b c1434b);\n}", "public interface C4150sl {\n /* renamed from: a */\n void mo15005a(C4143se seVar);\n}", "public void a(nm paramnm)\r\n/* 28: */ {\r\n/* 29:45 */ paramnm.a(this);\r\n/* 30: */ }", "public interface C19351a {\n /* renamed from: b */\n void mo30633b(int i, String str, byte[] bArr);\n }", "public interface C11113o {\n /* renamed from: a */\n void mo37759a(String str);\n }", "public interface C39504az {\n /* renamed from: a */\n int mo98207a();\n\n /* renamed from: a */\n void mo98208a(boolean z);\n\n /* renamed from: b */\n int mo98209b();\n\n /* renamed from: c */\n int mo98355c();\n\n /* renamed from: d */\n int mo98356d();\n\n /* renamed from: e */\n int mo98357e();\n\n /* renamed from: f */\n int mo98358f();\n}", "protected a<T> a(Tag.e<T> var0) {\n/* 80 */ Tag.a var1 = b(var0);\n/* 81 */ return new a<>(var1, this.c, \"vanilla\");\n/* */ }", "public interface C35565a {\n /* renamed from: a */\n C45321i mo90380a();\n }", "public interface C21298a {\n /* renamed from: a */\n void mo57275a();\n\n /* renamed from: a */\n void mo57276a(Exception exc);\n\n /* renamed from: b */\n void mo57277b();\n\n /* renamed from: c */\n void mo57278c();\n }", "public interface C40108b {\n /* renamed from: a */\n void mo99838a(boolean z);\n }", "public interface C0456a {\n /* renamed from: a */\n void mo2090a(C0455b bVar);\n\n /* renamed from: a */\n boolean mo2091a(C0455b bVar, Menu menu);\n\n /* renamed from: a */\n boolean mo2092a(C0455b bVar, MenuItem menuItem);\n\n /* renamed from: b */\n boolean mo2093b(C0455b bVar, Menu menu);\n }", "public interface C4724o {\n /* renamed from: a */\n void mo4872a(int i, String str);\n\n /* renamed from: a */\n void mo4873a(C4718l c4718l);\n\n /* renamed from: b */\n void mo4874b(C4718l c4718l);\n}", "public interface C7654b {\n /* renamed from: a */\n C7904c mo24084a();\n\n /* renamed from: b */\n C7716a mo24085b();\n }", "public interface C2603a {\n /* renamed from: a */\n String mo1889a(String str, String str2, String str3, String str4);\n }", "public interface afp {\n /* renamed from: a */\n C0512sx mo169a(C0497si siVar, afj afj, afr afr, Context context);\n}", "public interface C0615ja extends b<HomeFragment> {\n\n /* renamed from: c.c.a.h.b.ja$a */\n /* compiled from: FragmentModule_HomeFragment$app_bazaarRelease */\n public static abstract class a extends b.a<HomeFragment> {\n }\n}", "public interface a {\n\n /* renamed from: c.b.a.c.b.b.a$a reason: collision with other inner class name */\n /* compiled from: DiskCache */\n public interface C0054a {\n a build();\n }\n\n /* compiled from: DiskCache */\n public interface b {\n boolean a(File file);\n }\n\n File a(c cVar);\n\n void a(c cVar, b bVar);\n}", "public interface C0940d {\n /* renamed from: a */\n void mo3305a(boolean z);\n }", "public interface AbstractC17368c {\n /* renamed from: a */\n void mo84656a(float f);\n }", "interface C0932a {\n /* renamed from: a */\n void mo7438a(int i, int i2);\n\n /* renamed from: b */\n void mo7439b(C0933b bVar);\n\n /* renamed from: c */\n void mo7440c(int i, int i2, Object obj);\n\n /* renamed from: d */\n void mo7441d(C0933b bVar);\n\n /* renamed from: e */\n RecyclerView.ViewHolder mo7442e(int i);\n\n /* renamed from: f */\n void mo7443f(int i, int i2);\n\n /* renamed from: g */\n void mo7444g(int i, int i2);\n\n /* renamed from: h */\n void mo7445h(int i, int i2);\n }", "public interface C10330c {\n /* renamed from: a */\n C7562b<C10403b, C10328a> mo25041a();\n}", "public interface C3819a {\n /* renamed from: a */\n void mo23214a(Message message);\n }", "private Proof atoAImpl(Expression a) {\n Proof where = axm2(a, arrow(a, a), a); //a->(a->a) -> (a->(a->a)->a) -> (a -> a)\n Proof one = axm1(a, a); //a->a->a\n Proof two = axm1(a, arrow(a, a)); //a->(a->a)->A\n return mpTwice(where, one, two);\n }", "interface C1939a {\n /* renamed from: a */\n Bitmap mo1406a(Bitmap bitmap, float f);\n}", "public interface a extends com.bankeen.d.b.b.a {\n void a();\n\n void b();\n }", "public b[] a() {\n/* 95 */ return this.a;\n/* */ }", "interface C8361a {\n /* renamed from: b */\n float mo18284b(ViewGroup viewGroup, View view);\n\n /* renamed from: c */\n float mo18281c(ViewGroup viewGroup, View view);\n }" ]
[ "0.62497115", "0.6242887", "0.61394435", "0.61176854", "0.6114027", "0.60893", "0.6046901", "0.6024682", "0.60201293", "0.5975212", "0.59482527", "0.59121317", "0.5883635", "0.587841", "0.58703005", "0.5868436", "0.5864884", "0.5857492", "0.58306104", "0.5827752", "0.58272064", "0.5794689", "0.57890314", "0.57838726", "0.5775679", "0.57694733", "0.5769128", "0.57526815", "0.56907034", "0.5677874", "0.5670547", "0.56666386", "0.56592244", "0.5658682", "0.56574154", "0.5654324", "0.5644676", "0.56399715", "0.5638734", "0.5630582", "0.56183887", "0.5615435", "0.56069666", "0.5605207", "0.56005067", "0.559501", "0.55910283", "0.5590222", "0.55736613", "0.5556682", "0.5554544", "0.5550076", "0.55493855", "0.55446684", "0.5538079", "0.5529058", "0.5528109", "0.552641", "0.5525864", "0.552186", "0.5519972", "0.5509587", "0.5507195", "0.54881203", "0.5485328", "0.54826045", "0.5482066", "0.5481586", "0.5479751", "0.54776895", "0.54671466", "0.5463307", "0.54505056", "0.54436916", "0.5440517", "0.5439747", "0.5431944", "0.5422869", "0.54217863", "0.5417556", "0.5403905", "0.5400223", "0.53998446", "0.5394735", "0.5388649", "0.5388258", "0.5374842", "0.5368887", "0.53591394", "0.5357029", "0.5355688", "0.535506", "0.5355034", "0.53494394", "0.5341044", "0.5326166", "0.53236824", "0.53199095", "0.53177035", "0.53112453", "0.5298229" ]
0.0
-1
/ renamed from: a
public static <T> T m23768a(T t, Object obj) { if (t != null) { return t; } throw new NullPointerException(String.valueOf(obj)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface C4521a {\n /* renamed from: a */\n void mo12348a();\n }", "public interface C1423a {\n /* renamed from: a */\n void mo6888a(int i);\n }", "interface bxc {\n /* renamed from: a */\n void mo2508a(bxb bxb);\n}", "interface C33292a {\n /* renamed from: a */\n void mo85415a(String str);\n }", "interface C10331b {\n /* renamed from: a */\n void mo26876a(int i);\n }", "public interface C0779a {\n /* renamed from: a */\n void mo2311a();\n}", "public interface C6788a {\n /* renamed from: a */\n void mo20141a();\n }", "public interface C0237a {\n /* renamed from: a */\n void mo1791a(String str);\n }", "public interface C35013b {\n /* renamed from: a */\n void mo88773a(int i);\n}", "public interface C11112n {\n /* renamed from: a */\n void mo38026a();\n }", "@Override\n\t\t\t\tpublic void a() {\n\n\t\t\t\t}", "public interface C23407b {\n /* renamed from: a */\n void mo60892a();\n\n /* renamed from: b */\n void mo60893b();\n }", "interface C0312e {\n /* renamed from: a */\n void mo4671a(View view, int i, int i2, int i3, int i4);\n }", "public interface C34379a {\n /* renamed from: a */\n void mo46242a(bmc bmc);\n }", "public interface C32456b<T> {\n /* renamed from: a */\n void mo83696a(T t);\n }", "private String convertir(String a) {\n StringBuilder atributo = new StringBuilder(a);\n atributo.insert(0, Character.toUpperCase(atributo.charAt(0)));\n return atributo.deleteCharAt(1).toString();\n }", "protected m a(String name) {\n/* 42 */ return this.a.get(name);\n/* */ }", "public interface AbstractC23925a {\n /* renamed from: a */\n void mo105476a();\n }", "private interface C0257a {\n /* renamed from: a */\n float mo196a(ViewGroup viewGroup, View view);\n\n /* renamed from: b */\n float mo195b(ViewGroup viewGroup, View view);\n }", "public interface C3598a {\n /* renamed from: a */\n void mo11024a(int i, int i2, String str);\n }", "public interface C2459d {\n /* renamed from: a */\n C2451d mo3408a(C2457e c2457e);\n}", "public interface am extends ak {\r\n /* renamed from: a */\r\n void mo194a(int i) throws RemoteException;\r\n\r\n /* renamed from: a */\r\n void mo195a(List<LatLng> list) throws RemoteException;\r\n\r\n /* renamed from: b */\r\n void mo196b(float f) throws RemoteException;\r\n\r\n /* renamed from: b */\r\n void mo197b(boolean z);\r\n\r\n /* renamed from: c */\r\n void mo198c(boolean z) throws RemoteException;\r\n\r\n /* renamed from: g */\r\n float mo199g() throws RemoteException;\r\n\r\n /* renamed from: h */\r\n int mo200h() throws RemoteException;\r\n\r\n /* renamed from: i */\r\n List<LatLng> mo201i() throws RemoteException;\r\n\r\n /* renamed from: j */\r\n boolean mo202j();\r\n\r\n /* renamed from: k */\r\n boolean mo203k();\r\n}", "public interface C32459e<T> {\n /* renamed from: a */\n void mo83698a(T t);\n }", "public interface C32458d<T> {\n /* renamed from: a */\n void mo83695a(T t);\n }", "public interface C5482b {\n /* renamed from: a */\n void mo27575a();\n\n /* renamed from: a */\n void mo27576a(int i);\n }", "public interface C27084a {\n /* renamed from: a */\n void mo69874a();\n\n /* renamed from: a */\n void mo69875a(List<Aweme> list, boolean z);\n }", "public void a() {\n ((a) this.a).a();\n }", "public interface C1153a {\n /* renamed from: a */\n void mo4520a(byte[] bArr);\n }", "public interface C13373b {\n /* renamed from: a */\n void mo32681a(String str, int i, boolean z);\n}", "public interface C40453c {\n /* renamed from: a */\n void mo100442a(C40429b bVar);\n\n /* renamed from: a */\n void mo100443a(List<String> list);\n\n /* renamed from: b */\n void mo100444b(List<C40429b> list);\n}", "public interface AbstractC17367b {\n /* renamed from: a */\n void mo84655a();\n }", "@Override\r\n\tpublic void a() {\n\t\t\r\n\t}", "public interface C43270a {\n /* renamed from: a */\n void mo64942a(String str, long j, long j2);\n}", "public interface C18928d {\n /* renamed from: a */\n void mo50320a(C18924b bVar);\n\n /* renamed from: b */\n void mo50321b(C18924b bVar);\n}", "public interface C0087c {\n /* renamed from: a */\n String mo150a(String str);\n}", "public interface C1529m {\n /* renamed from: a */\n void mo3767a(int i);\n\n /* renamed from: a */\n void mo3768a(String str);\n}", "interface C4483e {\n /* renamed from: a */\n boolean mo34114a();\n}", "public interface C1234b {\r\n /* renamed from: a */\r\n void m8367a();\r\n\r\n /* renamed from: b */\r\n void m8368b();\r\n}", "public interface C10965j<T> {\n /* renamed from: a */\n T mo26439a();\n}", "public interface C28772a {\n /* renamed from: a */\n View mo73990a(View view);\n }", "@Override\n\tpublic void a() {\n\t\t\n\t}", "public interface C8326b {\n /* renamed from: a */\n C8325a mo21498a(String str);\n\n /* renamed from: a */\n void mo21499a(C8325a aVar);\n}", "void metodo1(int a, int[] b) {\r\n\t\ta += 5;//Par\\u00e1metro con el mismo nombre que el campo de la clase.\r\n\t\tb[0] += 7;//se produce un env\\u00edo por referencia, apunta a una copia de un objeto, que se asigna aqu\\u00ed.\r\n\t}", "public interface C2367a {\n /* renamed from: a */\n C2368d mo1698a();\n }", "interface C30585a {\n /* renamed from: b */\n void mo27952b(C5379a c5379a, int i, C46650a c46650a, C7620bi c7620bi);\n }", "public interface C4211a {\n\n /* renamed from: com.iab.omid.library.oguryco.c.a$a */\n public interface C4212a {\n /* renamed from: a */\n void mo28760a(View view, C4211a aVar, JSONObject jSONObject);\n }\n\n /* renamed from: a */\n JSONObject mo28758a(View view);\n\n /* renamed from: a */\n void mo28759a(View view, JSONObject jSONObject, C4212a aVar, boolean z);\n}", "public interface C4697a extends C5595at {\n /* renamed from: a */\n void mo12634a();\n\n /* renamed from: a */\n void mo12635a(String str);\n\n /* renamed from: a */\n void mo12636a(boolean z);\n\n /* renamed from: b */\n void mo12637b();\n\n /* renamed from: c */\n void mo12638c();\n }", "public interface C4773c {\n /* renamed from: a */\n void m15858a(int i);\n\n /* renamed from: a */\n void m15859a(int i, int i2);\n\n /* renamed from: a */\n void m15860a(int i, int i2, int i3);\n\n /* renamed from: b */\n void m15861b(int i, int i2);\n}", "public interface C4869f {\n /* renamed from: a */\n C4865b mo6249a();\n}", "public interface C1799a {\n /* renamed from: b */\n void mo3314b(String str);\n }", "public interface C43499b {\n /* renamed from: a */\n void mo8445a(int i, String str, int i2, byte[] bArr);\n}", "public interface C0601aq {\n /* renamed from: a */\n void mo9148a(int i, ArrayList<C0889x> arrayList);\n}", "public interface C45101e {\n /* renamed from: b */\n void mo3796b(int i);\n}", "public interface AbstractC6461g {\n /* renamed from: a */\n String mo42332a();\n}", "public interface AbstractC1645a {\n /* renamed from: a */\n String mo17375a();\n }", "public interface C6178c {\n /* renamed from: a */\n Map<String, String> mo14888a();\n}", "public interface C5101b {\n /* renamed from: a */\n void mo5289a(C5102c c5102c);\n\n /* renamed from: b */\n void mo5290b(C5102c c5102c);\n}", "public interface C19045k {\n /* renamed from: a */\n void mo50368a(int i, Object obj);\n\n /* renamed from: b */\n void mo50369b(int i, Object obj);\n}", "public b a()\r\n/* 12: */ {\r\n/* 13:13 */ return this.a;\r\n/* 14: */ }", "public interface C7720a {\n /* renamed from: a */\n long mo20406a();\n}", "public String a()\r\n/* 25: */ {\r\n/* 26:171 */ return \"dig.\" + this.a;\r\n/* 27: */ }", "public interface ayt {\n /* renamed from: a */\n int mo1635a(long j, List list);\n\n /* renamed from: a */\n long mo1636a(long j, alb alb);\n\n /* renamed from: a */\n void mo1637a();\n\n /* renamed from: a */\n void mo1638a(long j, long j2, List list, ayp ayp);\n\n /* renamed from: a */\n void mo1639a(ayl ayl);\n\n /* renamed from: a */\n boolean mo1640a(ayl ayl, boolean z, Exception exc, long j);\n}", "public interface C24221b extends C28343z<C28318an> {\n /* renamed from: a */\n void mo62991a(int i);\n\n String aw_();\n\n /* renamed from: e */\n Aweme mo62993e();\n}", "public interface C4051c {\n /* renamed from: a */\n boolean mo23707a();\n}", "public interface C45112b {\n /* renamed from: a */\n List<C45111a> mo107674a(Integer num);\n\n /* renamed from: a */\n List<C45111a> mo107675a(Integer num, Integer num2);\n\n /* renamed from: a */\n void mo107676a(C45111a aVar);\n\n /* renamed from: b */\n void mo107677b(Integer num);\n\n /* renamed from: c */\n long mo107678c(Integer num);\n}", "public void acionou(int a){\n\t\t\tb=a;\n\t\t}", "public interface C44963i {\n /* renamed from: a */\n void mo63037a(int i, int i2);\n\n void aA_();\n\n /* renamed from: b */\n void mo63039b(int i, int i2);\n}", "public interface C32457c<T> {\n /* renamed from: a */\n void mo83699a(T t, int i, int i2, String str);\n }", "public interface C5861g {\n /* renamed from: a */\n void mo18320a(C7251a aVar);\n\n @Deprecated\n /* renamed from: a */\n void mo18321a(C7251a aVar, String str);\n\n /* renamed from: a */\n void mo18322a(C7252b bVar);\n\n /* renamed from: a */\n void mo18323a(C7253c cVar);\n\n /* renamed from: a */\n void mo18324a(C7260j jVar);\n}", "public interface C0937a {\n /* renamed from: a */\n void mo3807a(C0985po[] poVarArr);\n }", "public interface C8466a {\n /* renamed from: a */\n void mo25956a(int i);\n\n /* renamed from: a */\n void mo25957a(long j, long j2);\n }", "public interface C39684b {\n /* renamed from: a */\n void mo98969a();\n\n /* renamed from: a */\n void mo98970a(C29296g gVar);\n\n /* renamed from: a */\n void mo98971a(C29296g gVar, int i);\n }", "public interface C43470b {\n /* renamed from: a */\n void mo61496a(C43469a aVar, C43471c cVar);\n }", "public interface AbstractC18255a {\n /* renamed from: a */\n void mo88521a();\n\n /* renamed from: a */\n void mo88522a(String str);\n\n /* renamed from: b */\n void mo88523b();\n\n /* renamed from: c */\n void mo88524c();\n }", "public interface C1436d {\n /* renamed from: a */\n C1435c mo1754a(C1433a c1433a, C1434b c1434b);\n}", "public interface C4150sl {\n /* renamed from: a */\n void mo15005a(C4143se seVar);\n}", "public void a(nm paramnm)\r\n/* 28: */ {\r\n/* 29:45 */ paramnm.a(this);\r\n/* 30: */ }", "public interface C19351a {\n /* renamed from: b */\n void mo30633b(int i, String str, byte[] bArr);\n }", "public interface C11113o {\n /* renamed from: a */\n void mo37759a(String str);\n }", "public interface C39504az {\n /* renamed from: a */\n int mo98207a();\n\n /* renamed from: a */\n void mo98208a(boolean z);\n\n /* renamed from: b */\n int mo98209b();\n\n /* renamed from: c */\n int mo98355c();\n\n /* renamed from: d */\n int mo98356d();\n\n /* renamed from: e */\n int mo98357e();\n\n /* renamed from: f */\n int mo98358f();\n}", "protected a<T> a(Tag.e<T> var0) {\n/* 80 */ Tag.a var1 = b(var0);\n/* 81 */ return new a<>(var1, this.c, \"vanilla\");\n/* */ }", "public interface C35565a {\n /* renamed from: a */\n C45321i mo90380a();\n }", "public interface C21298a {\n /* renamed from: a */\n void mo57275a();\n\n /* renamed from: a */\n void mo57276a(Exception exc);\n\n /* renamed from: b */\n void mo57277b();\n\n /* renamed from: c */\n void mo57278c();\n }", "public interface C40108b {\n /* renamed from: a */\n void mo99838a(boolean z);\n }", "public interface C0456a {\n /* renamed from: a */\n void mo2090a(C0455b bVar);\n\n /* renamed from: a */\n boolean mo2091a(C0455b bVar, Menu menu);\n\n /* renamed from: a */\n boolean mo2092a(C0455b bVar, MenuItem menuItem);\n\n /* renamed from: b */\n boolean mo2093b(C0455b bVar, Menu menu);\n }", "public interface C4724o {\n /* renamed from: a */\n void mo4872a(int i, String str);\n\n /* renamed from: a */\n void mo4873a(C4718l c4718l);\n\n /* renamed from: b */\n void mo4874b(C4718l c4718l);\n}", "public interface C7654b {\n /* renamed from: a */\n C7904c mo24084a();\n\n /* renamed from: b */\n C7716a mo24085b();\n }", "public interface C2603a {\n /* renamed from: a */\n String mo1889a(String str, String str2, String str3, String str4);\n }", "public interface afp {\n /* renamed from: a */\n C0512sx mo169a(C0497si siVar, afj afj, afr afr, Context context);\n}", "public interface C0615ja extends b<HomeFragment> {\n\n /* renamed from: c.c.a.h.b.ja$a */\n /* compiled from: FragmentModule_HomeFragment$app_bazaarRelease */\n public static abstract class a extends b.a<HomeFragment> {\n }\n}", "public interface a {\n\n /* renamed from: c.b.a.c.b.b.a$a reason: collision with other inner class name */\n /* compiled from: DiskCache */\n public interface C0054a {\n a build();\n }\n\n /* compiled from: DiskCache */\n public interface b {\n boolean a(File file);\n }\n\n File a(c cVar);\n\n void a(c cVar, b bVar);\n}", "public interface C0940d {\n /* renamed from: a */\n void mo3305a(boolean z);\n }", "public interface AbstractC17368c {\n /* renamed from: a */\n void mo84656a(float f);\n }", "interface C0932a {\n /* renamed from: a */\n void mo7438a(int i, int i2);\n\n /* renamed from: b */\n void mo7439b(C0933b bVar);\n\n /* renamed from: c */\n void mo7440c(int i, int i2, Object obj);\n\n /* renamed from: d */\n void mo7441d(C0933b bVar);\n\n /* renamed from: e */\n RecyclerView.ViewHolder mo7442e(int i);\n\n /* renamed from: f */\n void mo7443f(int i, int i2);\n\n /* renamed from: g */\n void mo7444g(int i, int i2);\n\n /* renamed from: h */\n void mo7445h(int i, int i2);\n }", "public interface C10330c {\n /* renamed from: a */\n C7562b<C10403b, C10328a> mo25041a();\n}", "public interface C3819a {\n /* renamed from: a */\n void mo23214a(Message message);\n }", "private Proof atoAImpl(Expression a) {\n Proof where = axm2(a, arrow(a, a), a); //a->(a->a) -> (a->(a->a)->a) -> (a -> a)\n Proof one = axm1(a, a); //a->a->a\n Proof two = axm1(a, arrow(a, a)); //a->(a->a)->A\n return mpTwice(where, one, two);\n }", "interface C1939a {\n /* renamed from: a */\n Bitmap mo1406a(Bitmap bitmap, float f);\n}", "public interface a extends com.bankeen.d.b.b.a {\n void a();\n\n void b();\n }", "public b[] a() {\n/* 95 */ return this.a;\n/* */ }", "interface C8361a {\n /* renamed from: b */\n float mo18284b(ViewGroup viewGroup, View view);\n\n /* renamed from: c */\n float mo18281c(ViewGroup viewGroup, View view);\n }" ]
[ "0.62497115", "0.6242887", "0.61394435", "0.61176854", "0.6114027", "0.60893", "0.6046901", "0.6024682", "0.60201293", "0.5975212", "0.59482527", "0.59121317", "0.5883635", "0.587841", "0.58703005", "0.5868436", "0.5864884", "0.5857492", "0.58306104", "0.5827752", "0.58272064", "0.5794689", "0.57890314", "0.57838726", "0.5775679", "0.57694733", "0.5769128", "0.57526815", "0.56907034", "0.5677874", "0.5670547", "0.56666386", "0.56592244", "0.5658682", "0.56574154", "0.5654324", "0.5644676", "0.56399715", "0.5638734", "0.5630582", "0.56183887", "0.5615435", "0.56069666", "0.5605207", "0.56005067", "0.559501", "0.55910283", "0.5590222", "0.55736613", "0.5556682", "0.5554544", "0.5550076", "0.55493855", "0.55446684", "0.5538079", "0.5529058", "0.5528109", "0.552641", "0.5525864", "0.552186", "0.5519972", "0.5509587", "0.5507195", "0.54881203", "0.5485328", "0.54826045", "0.5482066", "0.5481586", "0.5479751", "0.54776895", "0.54671466", "0.5463307", "0.54505056", "0.54436916", "0.5440517", "0.5439747", "0.5431944", "0.5422869", "0.54217863", "0.5417556", "0.5403905", "0.5400223", "0.53998446", "0.5394735", "0.5388649", "0.5388258", "0.5374842", "0.5368887", "0.53591394", "0.5357029", "0.5355688", "0.535506", "0.5355034", "0.53494394", "0.5341044", "0.5326166", "0.53236824", "0.53199095", "0.53177035", "0.53112453", "0.5298229" ]
0.0
-1
/ renamed from: a
public static void m23770a(boolean z) { if (!z) { throw new IllegalStateException(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface C4521a {\n /* renamed from: a */\n void mo12348a();\n }", "public interface C1423a {\n /* renamed from: a */\n void mo6888a(int i);\n }", "interface bxc {\n /* renamed from: a */\n void mo2508a(bxb bxb);\n}", "interface C33292a {\n /* renamed from: a */\n void mo85415a(String str);\n }", "interface C10331b {\n /* renamed from: a */\n void mo26876a(int i);\n }", "public interface C0779a {\n /* renamed from: a */\n void mo2311a();\n}", "public interface C6788a {\n /* renamed from: a */\n void mo20141a();\n }", "public interface C0237a {\n /* renamed from: a */\n void mo1791a(String str);\n }", "public interface C35013b {\n /* renamed from: a */\n void mo88773a(int i);\n}", "public interface C11112n {\n /* renamed from: a */\n void mo38026a();\n }", "@Override\n\t\t\t\tpublic void a() {\n\n\t\t\t\t}", "public interface C23407b {\n /* renamed from: a */\n void mo60892a();\n\n /* renamed from: b */\n void mo60893b();\n }", "interface C0312e {\n /* renamed from: a */\n void mo4671a(View view, int i, int i2, int i3, int i4);\n }", "public interface C34379a {\n /* renamed from: a */\n void mo46242a(bmc bmc);\n }", "public interface C32456b<T> {\n /* renamed from: a */\n void mo83696a(T t);\n }", "private String convertir(String a) {\n StringBuilder atributo = new StringBuilder(a);\n atributo.insert(0, Character.toUpperCase(atributo.charAt(0)));\n return atributo.deleteCharAt(1).toString();\n }", "protected m a(String name) {\n/* 42 */ return this.a.get(name);\n/* */ }", "public interface AbstractC23925a {\n /* renamed from: a */\n void mo105476a();\n }", "private interface C0257a {\n /* renamed from: a */\n float mo196a(ViewGroup viewGroup, View view);\n\n /* renamed from: b */\n float mo195b(ViewGroup viewGroup, View view);\n }", "public interface C3598a {\n /* renamed from: a */\n void mo11024a(int i, int i2, String str);\n }", "public interface C2459d {\n /* renamed from: a */\n C2451d mo3408a(C2457e c2457e);\n}", "public interface am extends ak {\r\n /* renamed from: a */\r\n void mo194a(int i) throws RemoteException;\r\n\r\n /* renamed from: a */\r\n void mo195a(List<LatLng> list) throws RemoteException;\r\n\r\n /* renamed from: b */\r\n void mo196b(float f) throws RemoteException;\r\n\r\n /* renamed from: b */\r\n void mo197b(boolean z);\r\n\r\n /* renamed from: c */\r\n void mo198c(boolean z) throws RemoteException;\r\n\r\n /* renamed from: g */\r\n float mo199g() throws RemoteException;\r\n\r\n /* renamed from: h */\r\n int mo200h() throws RemoteException;\r\n\r\n /* renamed from: i */\r\n List<LatLng> mo201i() throws RemoteException;\r\n\r\n /* renamed from: j */\r\n boolean mo202j();\r\n\r\n /* renamed from: k */\r\n boolean mo203k();\r\n}", "public interface C32459e<T> {\n /* renamed from: a */\n void mo83698a(T t);\n }", "public interface C32458d<T> {\n /* renamed from: a */\n void mo83695a(T t);\n }", "public interface C5482b {\n /* renamed from: a */\n void mo27575a();\n\n /* renamed from: a */\n void mo27576a(int i);\n }", "public interface C27084a {\n /* renamed from: a */\n void mo69874a();\n\n /* renamed from: a */\n void mo69875a(List<Aweme> list, boolean z);\n }", "public void a() {\n ((a) this.a).a();\n }", "public interface C1153a {\n /* renamed from: a */\n void mo4520a(byte[] bArr);\n }", "public interface C13373b {\n /* renamed from: a */\n void mo32681a(String str, int i, boolean z);\n}", "public interface C40453c {\n /* renamed from: a */\n void mo100442a(C40429b bVar);\n\n /* renamed from: a */\n void mo100443a(List<String> list);\n\n /* renamed from: b */\n void mo100444b(List<C40429b> list);\n}", "public interface AbstractC17367b {\n /* renamed from: a */\n void mo84655a();\n }", "@Override\r\n\tpublic void a() {\n\t\t\r\n\t}", "public interface C43270a {\n /* renamed from: a */\n void mo64942a(String str, long j, long j2);\n}", "public interface C18928d {\n /* renamed from: a */\n void mo50320a(C18924b bVar);\n\n /* renamed from: b */\n void mo50321b(C18924b bVar);\n}", "public interface C0087c {\n /* renamed from: a */\n String mo150a(String str);\n}", "public interface C1529m {\n /* renamed from: a */\n void mo3767a(int i);\n\n /* renamed from: a */\n void mo3768a(String str);\n}", "interface C4483e {\n /* renamed from: a */\n boolean mo34114a();\n}", "public interface C1234b {\r\n /* renamed from: a */\r\n void m8367a();\r\n\r\n /* renamed from: b */\r\n void m8368b();\r\n}", "public interface C10965j<T> {\n /* renamed from: a */\n T mo26439a();\n}", "public interface C28772a {\n /* renamed from: a */\n View mo73990a(View view);\n }", "@Override\n\tpublic void a() {\n\t\t\n\t}", "public interface C8326b {\n /* renamed from: a */\n C8325a mo21498a(String str);\n\n /* renamed from: a */\n void mo21499a(C8325a aVar);\n}", "void metodo1(int a, int[] b) {\r\n\t\ta += 5;//Par\\u00e1metro con el mismo nombre que el campo de la clase.\r\n\t\tb[0] += 7;//se produce un env\\u00edo por referencia, apunta a una copia de un objeto, que se asigna aqu\\u00ed.\r\n\t}", "public interface C2367a {\n /* renamed from: a */\n C2368d mo1698a();\n }", "interface C30585a {\n /* renamed from: b */\n void mo27952b(C5379a c5379a, int i, C46650a c46650a, C7620bi c7620bi);\n }", "public interface C4211a {\n\n /* renamed from: com.iab.omid.library.oguryco.c.a$a */\n public interface C4212a {\n /* renamed from: a */\n void mo28760a(View view, C4211a aVar, JSONObject jSONObject);\n }\n\n /* renamed from: a */\n JSONObject mo28758a(View view);\n\n /* renamed from: a */\n void mo28759a(View view, JSONObject jSONObject, C4212a aVar, boolean z);\n}", "public interface C4697a extends C5595at {\n /* renamed from: a */\n void mo12634a();\n\n /* renamed from: a */\n void mo12635a(String str);\n\n /* renamed from: a */\n void mo12636a(boolean z);\n\n /* renamed from: b */\n void mo12637b();\n\n /* renamed from: c */\n void mo12638c();\n }", "public interface C4773c {\n /* renamed from: a */\n void m15858a(int i);\n\n /* renamed from: a */\n void m15859a(int i, int i2);\n\n /* renamed from: a */\n void m15860a(int i, int i2, int i3);\n\n /* renamed from: b */\n void m15861b(int i, int i2);\n}", "public interface C4869f {\n /* renamed from: a */\n C4865b mo6249a();\n}", "public interface C1799a {\n /* renamed from: b */\n void mo3314b(String str);\n }", "public interface C43499b {\n /* renamed from: a */\n void mo8445a(int i, String str, int i2, byte[] bArr);\n}", "public interface C0601aq {\n /* renamed from: a */\n void mo9148a(int i, ArrayList<C0889x> arrayList);\n}", "public interface C45101e {\n /* renamed from: b */\n void mo3796b(int i);\n}", "public interface AbstractC6461g {\n /* renamed from: a */\n String mo42332a();\n}", "public interface AbstractC1645a {\n /* renamed from: a */\n String mo17375a();\n }", "public interface C6178c {\n /* renamed from: a */\n Map<String, String> mo14888a();\n}", "public interface C5101b {\n /* renamed from: a */\n void mo5289a(C5102c c5102c);\n\n /* renamed from: b */\n void mo5290b(C5102c c5102c);\n}", "public interface C19045k {\n /* renamed from: a */\n void mo50368a(int i, Object obj);\n\n /* renamed from: b */\n void mo50369b(int i, Object obj);\n}", "public b a()\r\n/* 12: */ {\r\n/* 13:13 */ return this.a;\r\n/* 14: */ }", "public interface C7720a {\n /* renamed from: a */\n long mo20406a();\n}", "public String a()\r\n/* 25: */ {\r\n/* 26:171 */ return \"dig.\" + this.a;\r\n/* 27: */ }", "public interface ayt {\n /* renamed from: a */\n int mo1635a(long j, List list);\n\n /* renamed from: a */\n long mo1636a(long j, alb alb);\n\n /* renamed from: a */\n void mo1637a();\n\n /* renamed from: a */\n void mo1638a(long j, long j2, List list, ayp ayp);\n\n /* renamed from: a */\n void mo1639a(ayl ayl);\n\n /* renamed from: a */\n boolean mo1640a(ayl ayl, boolean z, Exception exc, long j);\n}", "public interface C24221b extends C28343z<C28318an> {\n /* renamed from: a */\n void mo62991a(int i);\n\n String aw_();\n\n /* renamed from: e */\n Aweme mo62993e();\n}", "public interface C4051c {\n /* renamed from: a */\n boolean mo23707a();\n}", "public interface C45112b {\n /* renamed from: a */\n List<C45111a> mo107674a(Integer num);\n\n /* renamed from: a */\n List<C45111a> mo107675a(Integer num, Integer num2);\n\n /* renamed from: a */\n void mo107676a(C45111a aVar);\n\n /* renamed from: b */\n void mo107677b(Integer num);\n\n /* renamed from: c */\n long mo107678c(Integer num);\n}", "public void acionou(int a){\n\t\t\tb=a;\n\t\t}", "public interface C44963i {\n /* renamed from: a */\n void mo63037a(int i, int i2);\n\n void aA_();\n\n /* renamed from: b */\n void mo63039b(int i, int i2);\n}", "public interface C32457c<T> {\n /* renamed from: a */\n void mo83699a(T t, int i, int i2, String str);\n }", "public interface C5861g {\n /* renamed from: a */\n void mo18320a(C7251a aVar);\n\n @Deprecated\n /* renamed from: a */\n void mo18321a(C7251a aVar, String str);\n\n /* renamed from: a */\n void mo18322a(C7252b bVar);\n\n /* renamed from: a */\n void mo18323a(C7253c cVar);\n\n /* renamed from: a */\n void mo18324a(C7260j jVar);\n}", "public interface C0937a {\n /* renamed from: a */\n void mo3807a(C0985po[] poVarArr);\n }", "public interface C8466a {\n /* renamed from: a */\n void mo25956a(int i);\n\n /* renamed from: a */\n void mo25957a(long j, long j2);\n }", "public interface C39684b {\n /* renamed from: a */\n void mo98969a();\n\n /* renamed from: a */\n void mo98970a(C29296g gVar);\n\n /* renamed from: a */\n void mo98971a(C29296g gVar, int i);\n }", "public interface C43470b {\n /* renamed from: a */\n void mo61496a(C43469a aVar, C43471c cVar);\n }", "public interface AbstractC18255a {\n /* renamed from: a */\n void mo88521a();\n\n /* renamed from: a */\n void mo88522a(String str);\n\n /* renamed from: b */\n void mo88523b();\n\n /* renamed from: c */\n void mo88524c();\n }", "public interface C1436d {\n /* renamed from: a */\n C1435c mo1754a(C1433a c1433a, C1434b c1434b);\n}", "public interface C4150sl {\n /* renamed from: a */\n void mo15005a(C4143se seVar);\n}", "public void a(nm paramnm)\r\n/* 28: */ {\r\n/* 29:45 */ paramnm.a(this);\r\n/* 30: */ }", "public interface C19351a {\n /* renamed from: b */\n void mo30633b(int i, String str, byte[] bArr);\n }", "public interface C11113o {\n /* renamed from: a */\n void mo37759a(String str);\n }", "public interface C39504az {\n /* renamed from: a */\n int mo98207a();\n\n /* renamed from: a */\n void mo98208a(boolean z);\n\n /* renamed from: b */\n int mo98209b();\n\n /* renamed from: c */\n int mo98355c();\n\n /* renamed from: d */\n int mo98356d();\n\n /* renamed from: e */\n int mo98357e();\n\n /* renamed from: f */\n int mo98358f();\n}", "protected a<T> a(Tag.e<T> var0) {\n/* 80 */ Tag.a var1 = b(var0);\n/* 81 */ return new a<>(var1, this.c, \"vanilla\");\n/* */ }", "public interface C35565a {\n /* renamed from: a */\n C45321i mo90380a();\n }", "public interface C21298a {\n /* renamed from: a */\n void mo57275a();\n\n /* renamed from: a */\n void mo57276a(Exception exc);\n\n /* renamed from: b */\n void mo57277b();\n\n /* renamed from: c */\n void mo57278c();\n }", "public interface C40108b {\n /* renamed from: a */\n void mo99838a(boolean z);\n }", "public interface C0456a {\n /* renamed from: a */\n void mo2090a(C0455b bVar);\n\n /* renamed from: a */\n boolean mo2091a(C0455b bVar, Menu menu);\n\n /* renamed from: a */\n boolean mo2092a(C0455b bVar, MenuItem menuItem);\n\n /* renamed from: b */\n boolean mo2093b(C0455b bVar, Menu menu);\n }", "public interface C4724o {\n /* renamed from: a */\n void mo4872a(int i, String str);\n\n /* renamed from: a */\n void mo4873a(C4718l c4718l);\n\n /* renamed from: b */\n void mo4874b(C4718l c4718l);\n}", "public interface C7654b {\n /* renamed from: a */\n C7904c mo24084a();\n\n /* renamed from: b */\n C7716a mo24085b();\n }", "public interface C2603a {\n /* renamed from: a */\n String mo1889a(String str, String str2, String str3, String str4);\n }", "public interface afp {\n /* renamed from: a */\n C0512sx mo169a(C0497si siVar, afj afj, afr afr, Context context);\n}", "public interface C0615ja extends b<HomeFragment> {\n\n /* renamed from: c.c.a.h.b.ja$a */\n /* compiled from: FragmentModule_HomeFragment$app_bazaarRelease */\n public static abstract class a extends b.a<HomeFragment> {\n }\n}", "public interface a {\n\n /* renamed from: c.b.a.c.b.b.a$a reason: collision with other inner class name */\n /* compiled from: DiskCache */\n public interface C0054a {\n a build();\n }\n\n /* compiled from: DiskCache */\n public interface b {\n boolean a(File file);\n }\n\n File a(c cVar);\n\n void a(c cVar, b bVar);\n}", "public interface C0940d {\n /* renamed from: a */\n void mo3305a(boolean z);\n }", "public interface AbstractC17368c {\n /* renamed from: a */\n void mo84656a(float f);\n }", "interface C0932a {\n /* renamed from: a */\n void mo7438a(int i, int i2);\n\n /* renamed from: b */\n void mo7439b(C0933b bVar);\n\n /* renamed from: c */\n void mo7440c(int i, int i2, Object obj);\n\n /* renamed from: d */\n void mo7441d(C0933b bVar);\n\n /* renamed from: e */\n RecyclerView.ViewHolder mo7442e(int i);\n\n /* renamed from: f */\n void mo7443f(int i, int i2);\n\n /* renamed from: g */\n void mo7444g(int i, int i2);\n\n /* renamed from: h */\n void mo7445h(int i, int i2);\n }", "public interface C10330c {\n /* renamed from: a */\n C7562b<C10403b, C10328a> mo25041a();\n}", "public interface C3819a {\n /* renamed from: a */\n void mo23214a(Message message);\n }", "private Proof atoAImpl(Expression a) {\n Proof where = axm2(a, arrow(a, a), a); //a->(a->a) -> (a->(a->a)->a) -> (a -> a)\n Proof one = axm1(a, a); //a->a->a\n Proof two = axm1(a, arrow(a, a)); //a->(a->a)->A\n return mpTwice(where, one, two);\n }", "interface C1939a {\n /* renamed from: a */\n Bitmap mo1406a(Bitmap bitmap, float f);\n}", "public interface a extends com.bankeen.d.b.b.a {\n void a();\n\n void b();\n }", "public b[] a() {\n/* 95 */ return this.a;\n/* */ }", "interface C8361a {\n /* renamed from: b */\n float mo18284b(ViewGroup viewGroup, View view);\n\n /* renamed from: c */\n float mo18281c(ViewGroup viewGroup, View view);\n }" ]
[ "0.62497115", "0.6242887", "0.61394435", "0.61176854", "0.6114027", "0.60893", "0.6046901", "0.6024682", "0.60201293", "0.5975212", "0.59482527", "0.59121317", "0.5883635", "0.587841", "0.58703005", "0.5868436", "0.5864884", "0.5857492", "0.58306104", "0.5827752", "0.58272064", "0.5794689", "0.57890314", "0.57838726", "0.5775679", "0.57694733", "0.5769128", "0.57526815", "0.56907034", "0.5677874", "0.5670547", "0.56666386", "0.56592244", "0.5658682", "0.56574154", "0.5654324", "0.5644676", "0.56399715", "0.5638734", "0.5630582", "0.56183887", "0.5615435", "0.56069666", "0.5605207", "0.56005067", "0.559501", "0.55910283", "0.5590222", "0.55736613", "0.5556682", "0.5554544", "0.5550076", "0.55493855", "0.55446684", "0.5538079", "0.5529058", "0.5528109", "0.552641", "0.5525864", "0.552186", "0.5519972", "0.5509587", "0.5507195", "0.54881203", "0.5485328", "0.54826045", "0.5482066", "0.5481586", "0.5479751", "0.54776895", "0.54671466", "0.5463307", "0.54505056", "0.54436916", "0.5440517", "0.5439747", "0.5431944", "0.5422869", "0.54217863", "0.5417556", "0.5403905", "0.5400223", "0.53998446", "0.5394735", "0.5388649", "0.5388258", "0.5374842", "0.5368887", "0.53591394", "0.5357029", "0.5355688", "0.535506", "0.5355034", "0.53494394", "0.5341044", "0.5326166", "0.53236824", "0.53199095", "0.53177035", "0.53112453", "0.5298229" ]
0.0
-1
/ renamed from: a
public static void m23771a(boolean z, Object obj) { if (!z) { throw new IllegalStateException(String.valueOf(obj)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface C4521a {\n /* renamed from: a */\n void mo12348a();\n }", "public interface C1423a {\n /* renamed from: a */\n void mo6888a(int i);\n }", "interface bxc {\n /* renamed from: a */\n void mo2508a(bxb bxb);\n}", "interface C33292a {\n /* renamed from: a */\n void mo85415a(String str);\n }", "interface C10331b {\n /* renamed from: a */\n void mo26876a(int i);\n }", "public interface C0779a {\n /* renamed from: a */\n void mo2311a();\n}", "public interface C6788a {\n /* renamed from: a */\n void mo20141a();\n }", "public interface C0237a {\n /* renamed from: a */\n void mo1791a(String str);\n }", "public interface C35013b {\n /* renamed from: a */\n void mo88773a(int i);\n}", "public interface C11112n {\n /* renamed from: a */\n void mo38026a();\n }", "@Override\n\t\t\t\tpublic void a() {\n\n\t\t\t\t}", "public interface C23407b {\n /* renamed from: a */\n void mo60892a();\n\n /* renamed from: b */\n void mo60893b();\n }", "interface C0312e {\n /* renamed from: a */\n void mo4671a(View view, int i, int i2, int i3, int i4);\n }", "public interface C34379a {\n /* renamed from: a */\n void mo46242a(bmc bmc);\n }", "public interface C32456b<T> {\n /* renamed from: a */\n void mo83696a(T t);\n }", "private String convertir(String a) {\n StringBuilder atributo = new StringBuilder(a);\n atributo.insert(0, Character.toUpperCase(atributo.charAt(0)));\n return atributo.deleteCharAt(1).toString();\n }", "protected m a(String name) {\n/* 42 */ return this.a.get(name);\n/* */ }", "public interface AbstractC23925a {\n /* renamed from: a */\n void mo105476a();\n }", "private interface C0257a {\n /* renamed from: a */\n float mo196a(ViewGroup viewGroup, View view);\n\n /* renamed from: b */\n float mo195b(ViewGroup viewGroup, View view);\n }", "public interface C3598a {\n /* renamed from: a */\n void mo11024a(int i, int i2, String str);\n }", "public interface C2459d {\n /* renamed from: a */\n C2451d mo3408a(C2457e c2457e);\n}", "public interface am extends ak {\r\n /* renamed from: a */\r\n void mo194a(int i) throws RemoteException;\r\n\r\n /* renamed from: a */\r\n void mo195a(List<LatLng> list) throws RemoteException;\r\n\r\n /* renamed from: b */\r\n void mo196b(float f) throws RemoteException;\r\n\r\n /* renamed from: b */\r\n void mo197b(boolean z);\r\n\r\n /* renamed from: c */\r\n void mo198c(boolean z) throws RemoteException;\r\n\r\n /* renamed from: g */\r\n float mo199g() throws RemoteException;\r\n\r\n /* renamed from: h */\r\n int mo200h() throws RemoteException;\r\n\r\n /* renamed from: i */\r\n List<LatLng> mo201i() throws RemoteException;\r\n\r\n /* renamed from: j */\r\n boolean mo202j();\r\n\r\n /* renamed from: k */\r\n boolean mo203k();\r\n}", "public interface C32459e<T> {\n /* renamed from: a */\n void mo83698a(T t);\n }", "public interface C32458d<T> {\n /* renamed from: a */\n void mo83695a(T t);\n }", "public interface C5482b {\n /* renamed from: a */\n void mo27575a();\n\n /* renamed from: a */\n void mo27576a(int i);\n }", "public interface C27084a {\n /* renamed from: a */\n void mo69874a();\n\n /* renamed from: a */\n void mo69875a(List<Aweme> list, boolean z);\n }", "public void a() {\n ((a) this.a).a();\n }", "public interface C1153a {\n /* renamed from: a */\n void mo4520a(byte[] bArr);\n }", "public interface C13373b {\n /* renamed from: a */\n void mo32681a(String str, int i, boolean z);\n}", "public interface C40453c {\n /* renamed from: a */\n void mo100442a(C40429b bVar);\n\n /* renamed from: a */\n void mo100443a(List<String> list);\n\n /* renamed from: b */\n void mo100444b(List<C40429b> list);\n}", "public interface AbstractC17367b {\n /* renamed from: a */\n void mo84655a();\n }", "@Override\r\n\tpublic void a() {\n\t\t\r\n\t}", "public interface C43270a {\n /* renamed from: a */\n void mo64942a(String str, long j, long j2);\n}", "public interface C18928d {\n /* renamed from: a */\n void mo50320a(C18924b bVar);\n\n /* renamed from: b */\n void mo50321b(C18924b bVar);\n}", "public interface C0087c {\n /* renamed from: a */\n String mo150a(String str);\n}", "public interface C1529m {\n /* renamed from: a */\n void mo3767a(int i);\n\n /* renamed from: a */\n void mo3768a(String str);\n}", "interface C4483e {\n /* renamed from: a */\n boolean mo34114a();\n}", "public interface C1234b {\r\n /* renamed from: a */\r\n void m8367a();\r\n\r\n /* renamed from: b */\r\n void m8368b();\r\n}", "public interface C10965j<T> {\n /* renamed from: a */\n T mo26439a();\n}", "public interface C28772a {\n /* renamed from: a */\n View mo73990a(View view);\n }", "@Override\n\tpublic void a() {\n\t\t\n\t}", "public interface C8326b {\n /* renamed from: a */\n C8325a mo21498a(String str);\n\n /* renamed from: a */\n void mo21499a(C8325a aVar);\n}", "void metodo1(int a, int[] b) {\r\n\t\ta += 5;//Par\\u00e1metro con el mismo nombre que el campo de la clase.\r\n\t\tb[0] += 7;//se produce un env\\u00edo por referencia, apunta a una copia de un objeto, que se asigna aqu\\u00ed.\r\n\t}", "public interface C2367a {\n /* renamed from: a */\n C2368d mo1698a();\n }", "interface C30585a {\n /* renamed from: b */\n void mo27952b(C5379a c5379a, int i, C46650a c46650a, C7620bi c7620bi);\n }", "public interface C4211a {\n\n /* renamed from: com.iab.omid.library.oguryco.c.a$a */\n public interface C4212a {\n /* renamed from: a */\n void mo28760a(View view, C4211a aVar, JSONObject jSONObject);\n }\n\n /* renamed from: a */\n JSONObject mo28758a(View view);\n\n /* renamed from: a */\n void mo28759a(View view, JSONObject jSONObject, C4212a aVar, boolean z);\n}", "public interface C4697a extends C5595at {\n /* renamed from: a */\n void mo12634a();\n\n /* renamed from: a */\n void mo12635a(String str);\n\n /* renamed from: a */\n void mo12636a(boolean z);\n\n /* renamed from: b */\n void mo12637b();\n\n /* renamed from: c */\n void mo12638c();\n }", "public interface C4773c {\n /* renamed from: a */\n void m15858a(int i);\n\n /* renamed from: a */\n void m15859a(int i, int i2);\n\n /* renamed from: a */\n void m15860a(int i, int i2, int i3);\n\n /* renamed from: b */\n void m15861b(int i, int i2);\n}", "public interface C4869f {\n /* renamed from: a */\n C4865b mo6249a();\n}", "public interface C1799a {\n /* renamed from: b */\n void mo3314b(String str);\n }", "public interface C43499b {\n /* renamed from: a */\n void mo8445a(int i, String str, int i2, byte[] bArr);\n}", "public interface C0601aq {\n /* renamed from: a */\n void mo9148a(int i, ArrayList<C0889x> arrayList);\n}", "public interface C45101e {\n /* renamed from: b */\n void mo3796b(int i);\n}", "public interface AbstractC6461g {\n /* renamed from: a */\n String mo42332a();\n}", "public interface AbstractC1645a {\n /* renamed from: a */\n String mo17375a();\n }", "public interface C6178c {\n /* renamed from: a */\n Map<String, String> mo14888a();\n}", "public interface C5101b {\n /* renamed from: a */\n void mo5289a(C5102c c5102c);\n\n /* renamed from: b */\n void mo5290b(C5102c c5102c);\n}", "public interface C19045k {\n /* renamed from: a */\n void mo50368a(int i, Object obj);\n\n /* renamed from: b */\n void mo50369b(int i, Object obj);\n}", "public b a()\r\n/* 12: */ {\r\n/* 13:13 */ return this.a;\r\n/* 14: */ }", "public interface C7720a {\n /* renamed from: a */\n long mo20406a();\n}", "public String a()\r\n/* 25: */ {\r\n/* 26:171 */ return \"dig.\" + this.a;\r\n/* 27: */ }", "public interface ayt {\n /* renamed from: a */\n int mo1635a(long j, List list);\n\n /* renamed from: a */\n long mo1636a(long j, alb alb);\n\n /* renamed from: a */\n void mo1637a();\n\n /* renamed from: a */\n void mo1638a(long j, long j2, List list, ayp ayp);\n\n /* renamed from: a */\n void mo1639a(ayl ayl);\n\n /* renamed from: a */\n boolean mo1640a(ayl ayl, boolean z, Exception exc, long j);\n}", "public interface C24221b extends C28343z<C28318an> {\n /* renamed from: a */\n void mo62991a(int i);\n\n String aw_();\n\n /* renamed from: e */\n Aweme mo62993e();\n}", "public interface C4051c {\n /* renamed from: a */\n boolean mo23707a();\n}", "public interface C45112b {\n /* renamed from: a */\n List<C45111a> mo107674a(Integer num);\n\n /* renamed from: a */\n List<C45111a> mo107675a(Integer num, Integer num2);\n\n /* renamed from: a */\n void mo107676a(C45111a aVar);\n\n /* renamed from: b */\n void mo107677b(Integer num);\n\n /* renamed from: c */\n long mo107678c(Integer num);\n}", "public void acionou(int a){\n\t\t\tb=a;\n\t\t}", "public interface C44963i {\n /* renamed from: a */\n void mo63037a(int i, int i2);\n\n void aA_();\n\n /* renamed from: b */\n void mo63039b(int i, int i2);\n}", "public interface C32457c<T> {\n /* renamed from: a */\n void mo83699a(T t, int i, int i2, String str);\n }", "public interface C5861g {\n /* renamed from: a */\n void mo18320a(C7251a aVar);\n\n @Deprecated\n /* renamed from: a */\n void mo18321a(C7251a aVar, String str);\n\n /* renamed from: a */\n void mo18322a(C7252b bVar);\n\n /* renamed from: a */\n void mo18323a(C7253c cVar);\n\n /* renamed from: a */\n void mo18324a(C7260j jVar);\n}", "public interface C0937a {\n /* renamed from: a */\n void mo3807a(C0985po[] poVarArr);\n }", "public interface C8466a {\n /* renamed from: a */\n void mo25956a(int i);\n\n /* renamed from: a */\n void mo25957a(long j, long j2);\n }", "public interface C39684b {\n /* renamed from: a */\n void mo98969a();\n\n /* renamed from: a */\n void mo98970a(C29296g gVar);\n\n /* renamed from: a */\n void mo98971a(C29296g gVar, int i);\n }", "public interface C43470b {\n /* renamed from: a */\n void mo61496a(C43469a aVar, C43471c cVar);\n }", "public interface AbstractC18255a {\n /* renamed from: a */\n void mo88521a();\n\n /* renamed from: a */\n void mo88522a(String str);\n\n /* renamed from: b */\n void mo88523b();\n\n /* renamed from: c */\n void mo88524c();\n }", "public interface C1436d {\n /* renamed from: a */\n C1435c mo1754a(C1433a c1433a, C1434b c1434b);\n}", "public interface C4150sl {\n /* renamed from: a */\n void mo15005a(C4143se seVar);\n}", "public void a(nm paramnm)\r\n/* 28: */ {\r\n/* 29:45 */ paramnm.a(this);\r\n/* 30: */ }", "public interface C19351a {\n /* renamed from: b */\n void mo30633b(int i, String str, byte[] bArr);\n }", "public interface C11113o {\n /* renamed from: a */\n void mo37759a(String str);\n }", "public interface C39504az {\n /* renamed from: a */\n int mo98207a();\n\n /* renamed from: a */\n void mo98208a(boolean z);\n\n /* renamed from: b */\n int mo98209b();\n\n /* renamed from: c */\n int mo98355c();\n\n /* renamed from: d */\n int mo98356d();\n\n /* renamed from: e */\n int mo98357e();\n\n /* renamed from: f */\n int mo98358f();\n}", "protected a<T> a(Tag.e<T> var0) {\n/* 80 */ Tag.a var1 = b(var0);\n/* 81 */ return new a<>(var1, this.c, \"vanilla\");\n/* */ }", "public interface C35565a {\n /* renamed from: a */\n C45321i mo90380a();\n }", "public interface C21298a {\n /* renamed from: a */\n void mo57275a();\n\n /* renamed from: a */\n void mo57276a(Exception exc);\n\n /* renamed from: b */\n void mo57277b();\n\n /* renamed from: c */\n void mo57278c();\n }", "public interface C40108b {\n /* renamed from: a */\n void mo99838a(boolean z);\n }", "public interface C0456a {\n /* renamed from: a */\n void mo2090a(C0455b bVar);\n\n /* renamed from: a */\n boolean mo2091a(C0455b bVar, Menu menu);\n\n /* renamed from: a */\n boolean mo2092a(C0455b bVar, MenuItem menuItem);\n\n /* renamed from: b */\n boolean mo2093b(C0455b bVar, Menu menu);\n }", "public interface C4724o {\n /* renamed from: a */\n void mo4872a(int i, String str);\n\n /* renamed from: a */\n void mo4873a(C4718l c4718l);\n\n /* renamed from: b */\n void mo4874b(C4718l c4718l);\n}", "public interface C7654b {\n /* renamed from: a */\n C7904c mo24084a();\n\n /* renamed from: b */\n C7716a mo24085b();\n }", "public interface C2603a {\n /* renamed from: a */\n String mo1889a(String str, String str2, String str3, String str4);\n }", "public interface afp {\n /* renamed from: a */\n C0512sx mo169a(C0497si siVar, afj afj, afr afr, Context context);\n}", "public interface C0615ja extends b<HomeFragment> {\n\n /* renamed from: c.c.a.h.b.ja$a */\n /* compiled from: FragmentModule_HomeFragment$app_bazaarRelease */\n public static abstract class a extends b.a<HomeFragment> {\n }\n}", "public interface a {\n\n /* renamed from: c.b.a.c.b.b.a$a reason: collision with other inner class name */\n /* compiled from: DiskCache */\n public interface C0054a {\n a build();\n }\n\n /* compiled from: DiskCache */\n public interface b {\n boolean a(File file);\n }\n\n File a(c cVar);\n\n void a(c cVar, b bVar);\n}", "public interface C0940d {\n /* renamed from: a */\n void mo3305a(boolean z);\n }", "public interface AbstractC17368c {\n /* renamed from: a */\n void mo84656a(float f);\n }", "interface C0932a {\n /* renamed from: a */\n void mo7438a(int i, int i2);\n\n /* renamed from: b */\n void mo7439b(C0933b bVar);\n\n /* renamed from: c */\n void mo7440c(int i, int i2, Object obj);\n\n /* renamed from: d */\n void mo7441d(C0933b bVar);\n\n /* renamed from: e */\n RecyclerView.ViewHolder mo7442e(int i);\n\n /* renamed from: f */\n void mo7443f(int i, int i2);\n\n /* renamed from: g */\n void mo7444g(int i, int i2);\n\n /* renamed from: h */\n void mo7445h(int i, int i2);\n }", "public interface C10330c {\n /* renamed from: a */\n C7562b<C10403b, C10328a> mo25041a();\n}", "public interface C3819a {\n /* renamed from: a */\n void mo23214a(Message message);\n }", "private Proof atoAImpl(Expression a) {\n Proof where = axm2(a, arrow(a, a), a); //a->(a->a) -> (a->(a->a)->a) -> (a -> a)\n Proof one = axm1(a, a); //a->a->a\n Proof two = axm1(a, arrow(a, a)); //a->(a->a)->A\n return mpTwice(where, one, two);\n }", "interface C1939a {\n /* renamed from: a */\n Bitmap mo1406a(Bitmap bitmap, float f);\n}", "public interface a extends com.bankeen.d.b.b.a {\n void a();\n\n void b();\n }", "public b[] a() {\n/* 95 */ return this.a;\n/* */ }", "interface C8361a {\n /* renamed from: b */\n float mo18284b(ViewGroup viewGroup, View view);\n\n /* renamed from: c */\n float mo18281c(ViewGroup viewGroup, View view);\n }" ]
[ "0.62497115", "0.6242887", "0.61394435", "0.61176854", "0.6114027", "0.60893", "0.6046901", "0.6024682", "0.60201293", "0.5975212", "0.59482527", "0.59121317", "0.5883635", "0.587841", "0.58703005", "0.5868436", "0.5864884", "0.5857492", "0.58306104", "0.5827752", "0.58272064", "0.5794689", "0.57890314", "0.57838726", "0.5775679", "0.57694733", "0.5769128", "0.57526815", "0.56907034", "0.5677874", "0.5670547", "0.56666386", "0.56592244", "0.5658682", "0.56574154", "0.5654324", "0.5644676", "0.56399715", "0.5638734", "0.5630582", "0.56183887", "0.5615435", "0.56069666", "0.5605207", "0.56005067", "0.559501", "0.55910283", "0.5590222", "0.55736613", "0.5556682", "0.5554544", "0.5550076", "0.55493855", "0.55446684", "0.5538079", "0.5529058", "0.5528109", "0.552641", "0.5525864", "0.552186", "0.5519972", "0.5509587", "0.5507195", "0.54881203", "0.5485328", "0.54826045", "0.5482066", "0.5481586", "0.5479751", "0.54776895", "0.54671466", "0.5463307", "0.54505056", "0.54436916", "0.5440517", "0.5439747", "0.5431944", "0.5422869", "0.54217863", "0.5417556", "0.5403905", "0.5400223", "0.53998446", "0.5394735", "0.5388649", "0.5388258", "0.5374842", "0.5368887", "0.53591394", "0.5357029", "0.5355688", "0.535506", "0.5355034", "0.53494394", "0.5341044", "0.5326166", "0.53236824", "0.53199095", "0.53177035", "0.53112453", "0.5298229" ]
0.0
-1
/ renamed from: b
public static void m23773b(boolean z, Object obj) { if (!z) { throw new IllegalArgumentException(String.valueOf(obj)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void mo2508a(bxb bxb);", "@Override\n public void func_104112_b() {\n \n }", "@Override\n public void b() {\n }", "public interface C19351a {\n /* renamed from: b */\n void mo30633b(int i, String str, byte[] bArr);\n }", "@Override\n\tpublic void b2() {\n\t\t\n\t}", "void metodo1(int a, int[] b) {\r\n\t\ta += 5;//Par\\u00e1metro con el mismo nombre que el campo de la clase.\r\n\t\tb[0] += 7;//se produce un env\\u00edo por referencia, apunta a una copia de un objeto, que se asigna aqu\\u00ed.\r\n\t}", "interface bxc {\n /* renamed from: a */\n void mo2508a(bxb bxb);\n}", "@Override\n\tpublic void b() {\n\n\t}", "interface C30585a {\n /* renamed from: b */\n void mo27952b(C5379a c5379a, int i, C46650a c46650a, C7620bi c7620bi);\n }", "public bb b() {\n return a(this.a);\n }", "@Override\n\tpublic void b1() {\n\t\t\n\t}", "public void b() {\r\n }", "@Override\n\tpublic void bbb() {\n\t\t\n\t}", "public interface C34379a {\n /* renamed from: a */\n void mo46242a(bmc bmc);\n }", "public abstract void b(StringBuilder sb);", "public void b() {\n }", "public void b() {\n }", "protected b(int mb) {\n/* 87 */ this.b = mb;\n/* */ }", "public u(b paramb)\r\n/* 7: */ {\r\n/* 8: 9 */ this.a = paramb;\r\n/* 9: */ }", "public interface b {\n void H_();\n\n void I_();\n\n void J_();\n\n void a(C0063d dVar);\n\n void a(byte[] bArr);\n\n void b(boolean z);\n }", "public b[] a() {\n/* 95 */ return this.a;\n/* */ }", "public interface C7654b {\n /* renamed from: a */\n C7904c mo24084a();\n\n /* renamed from: b */\n C7716a mo24085b();\n }", "public interface C1153a {\n /* renamed from: a */\n void mo4520a(byte[] bArr);\n }", "public interface C43499b {\n /* renamed from: a */\n void mo8445a(int i, String str, int i2, byte[] bArr);\n}", "public void b() {\n ((a) this.a).b();\n }", "public np a()\r\n/* 33: */ {\r\n/* 34:49 */ return this.b;\r\n/* 35: */ }", "b(a aVar) {\n super(0);\n this.this$0 = aVar;\n }", "public t b() {\n return a(this.a);\n }", "public interface C32456b<T> {\n /* renamed from: a */\n void mo83696a(T t);\n }", "public static String a(int c) {\n/* 89 */ return b.a(c);\n/* */ }", "private void m678b(byte b) {\n byte[] bArr = this.f523r;\n bArr[0] = b;\n this.f552g.mo502b(bArr);\n }", "public interface C23407b {\n /* renamed from: a */\n void mo60892a();\n\n /* renamed from: b */\n void mo60893b();\n }", "public abstract T zzm(B b);", "public b a()\r\n/* 12: */ {\r\n/* 13:13 */ return this.a;\r\n/* 14: */ }", "public void b(World paramaqu, BlockPosition paramdt, Block parambec)\r\n/* 27: */ {\r\n/* 28: 47 */ bcm localbcm = paramaqu.s(paramdt);\r\n/* 29: 48 */ if ((localbcm instanceof bdv)) {\r\n/* 30: 49 */ ((bdv)localbcm).h();\r\n/* 31: */ } else {\r\n/* 32: 51 */ super.b(paramaqu, paramdt, parambec);\r\n/* 33: */ }\r\n/* 34: */ }", "public abstract void zzc(B b, int i, int i2);", "public interface b {\n}", "public interface b {\n}", "private void m10263b(byte b) throws cf {\r\n this.f6483r[0] = b;\r\n this.g.m10347b(this.f6483r);\r\n }", "BSubstitution createBSubstitution();", "public void b(ahd paramahd) {}", "void b();", "public interface C18928d {\n /* renamed from: a */\n void mo50320a(C18924b bVar);\n\n /* renamed from: b */\n void mo50321b(C18924b bVar);\n}", "B database(S database);", "public interface C0615ja extends b<HomeFragment> {\n\n /* renamed from: c.c.a.h.b.ja$a */\n /* compiled from: FragmentModule_HomeFragment$app_bazaarRelease */\n public static abstract class a extends b.a<HomeFragment> {\n }\n}", "public abstract C0631bt mo9227aB();", "public an b() {\n return a(this.a);\n }", "protected abstract void a(bru parambru);", "static void go(Base b) {\n\t\tb.add(8);\n\t}", "void mo46242a(bmc bmc);", "public interface b extends c {\n void a(Float f);\n\n void a(Integer num);\n\n void b(Float f);\n\n void c(Float f);\n\n String d();\n\n void d(Float f);\n\n void d(String str);\n\n void e(Float f);\n\n void e(String str);\n\n void f(String str);\n\n void g(String str);\n\n Long j();\n\n LineChart k();\n }", "public interface bca extends bbn {\n bca a();\n\n bca a(String str);\n\n bca b(String str);\n\n bca c(String str);\n}", "public interface a extends com.bankeen.d.b.b.a {\n void a();\n\n void b();\n }", "public abstract BoundType b();", "public void b(amj paramamj)\r\n/* 538: */ {\r\n/* 539:579 */ this.f = paramamj;\r\n/* 540: */ }", "b(a aVar, com.bytedance.jedi.model.h.a aVar2) {\n super(aVar2);\n this.f21531a = aVar;\n this.f21532b = new com.bytedance.jedi.model.h.f(aVar);\n }", "private void b(int paramInt)\r\n/* 193: */ {\r\n/* 194:203 */ this.h.a(a(paramInt));\r\n/* 195: */ }", "public void b(ahb paramahb)\r\n/* 583: */ {\r\n/* 584:625 */ for (int i = 0; i < this.a.length; i++) {\r\n/* 585:626 */ this.a[i] = amj.b(paramahb.a[i]);\r\n/* 586: */ }\r\n/* 587:628 */ for (i = 0; i < this.b.length; i++) {\r\n/* 588:629 */ this.b[i] = amj.b(paramahb.b[i]);\r\n/* 589: */ }\r\n/* 590:631 */ this.c = paramahb.c;\r\n/* 591: */ }", "interface b {\n\n /* compiled from: CreditAccountContract */\n public interface a extends com.bankeen.d.b.b.a {\n void a();\n\n void b();\n }\n\n /* compiled from: CreditAccountContract */\n public interface b extends c {\n void a(Float f);\n\n void a(Integer num);\n\n void b(Float f);\n\n void c(Float f);\n\n String d();\n\n void d(Float f);\n\n void d(String str);\n\n void e(Float f);\n\n void e(String str);\n\n void f(String str);\n\n void g(String str);\n\n Long j();\n\n LineChart k();\n }\n}", "@Override\n\tpublic void visit(PartB partB) {\n\n\t}", "public abstract void zzb(B b, int i, long j);", "public abstract void zza(B b, int i, zzeh zzeh);", "int metodo2(int a, int b) {\r\n\r\n\t\tthis.a += 5; // se modifica el campo del objeto, el uso de la palabra reservada this se utiliza para referenciar al campo.\r\n\t\tb += 7;\r\n\t\treturn a; // modifica en la asignaci\\u00f3n\r\n\t}", "private void internalCopy(Board b) {\n for (int i = 0; i < SIDE * SIDE; i += 1) {\n set(i, b.get(i));\n }\n\n _directions = b._directions;\n _whoseMove = b._whoseMove;\n _history = b._history;\n }", "public int b()\r\n/* 69: */ {\r\n/* 70:74 */ return this.b;\r\n/* 71: */ }", "public void b(StringBuilder sb) {\n sb.append(this.a);\n sb.append(')');\n }", "public void b() {\n e$a e$a;\n try {\n e$a = this.b;\n }\n catch (IOException iOException) {\n return;\n }\n Object object = this.c;\n e$a.b(object);\n }", "public abstract void a(StringBuilder sb);", "public interface C45101e {\n /* renamed from: b */\n void mo3796b(int i);\n}", "public abstract void zzf(Object obj, B b);", "public interface bdp {\n\n /* renamed from: a */\n public static final bdp f3422a = new bdo();\n\n /* renamed from: a */\n bdm mo1784a(akh akh);\n}", "@Override\n\tpublic void parse(Buffer b) {\n\t\t\n\t}", "@Override\n\t\t\t\tpublic void a() {\n\n\t\t\t\t}", "public abstract void a(b paramb, int paramInt1, int paramInt2);", "public void mo1945a(byte b) throws cf {\r\n m10263b(b);\r\n }", "void mo83703a(C32456b<T> bVar);", "public void a(String str) {\n ((b.b) this.b).d(str);\n }", "public void selectB() { }", "BOperation createBOperation();", "void metodo1(int a, int b) {\r\n\t\ta += 5;//par\\u00e1metro con el mismo nombre que el campo.\r\n\t\tb += 7;\r\n\t}", "private static void m2196a(StringBuffer stringBuffer, byte b) {\n stringBuffer.append(\"0123456789ABCDEF\".charAt((b >> 4) & 15)).append(\"0123456789ABCDEF\".charAt(b & 15));\n }", "public interface C1799a {\n /* renamed from: b */\n void mo3314b(String str);\n }", "public void b(fv paramfv)\r\n/* 408: */ {\r\n/* 409:423 */ this.a = new amj[36];\r\n/* 410:424 */ this.b = new amj[4];\r\n/* 411:425 */ for (int i = 0; i < paramfv.c(); i++)\r\n/* 412: */ {\r\n/* 413:426 */ fn localfn = paramfv.b(i);\r\n/* 414:427 */ int j = localfn.d(\"Slot\") & 0xFF;\r\n/* 415:428 */ amj localamj = amj.a(localfn);\r\n/* 416:429 */ if (localamj != null)\r\n/* 417: */ {\r\n/* 418:430 */ if ((j >= 0) && (j < this.a.length)) {\r\n/* 419:431 */ this.a[j] = localamj;\r\n/* 420: */ }\r\n/* 421:433 */ if ((j >= 100) && (j < this.b.length + 100)) {\r\n/* 422:434 */ this.b[(j - 100)] = localamj;\r\n/* 423: */ }\r\n/* 424: */ }\r\n/* 425: */ }\r\n/* 426: */ }", "public void b(String str) {\n ((b.b) this.b).e(str);\n }", "public String b()\r\n/* 35: */ {\r\n/* 36:179 */ return a();\r\n/* 37: */ }", "public abstract void zza(B b, int i, T t);", "public Item b(World paramaqu, BlockPosition paramdt)\r\n/* 189: */ {\r\n/* 190:220 */ return null;\r\n/* 191: */ }", "public abstract void zza(B b, int i, long j);", "public interface C5101b {\n /* renamed from: a */\n void mo5289a(C5102c c5102c);\n\n /* renamed from: b */\n void mo5290b(C5102c c5102c);\n}", "private interface C0257a {\n /* renamed from: a */\n float mo196a(ViewGroup viewGroup, View view);\n\n /* renamed from: b */\n float mo195b(ViewGroup viewGroup, View view);\n }", "public abstract void mo9798a(byte b);", "public void mo9798a(byte b) {\n if (this.f9108f == this.f9107e) {\n mo9827i();\n }\n byte[] bArr = this.f9106d;\n int i = this.f9108f;\n this.f9108f = i + 1;\n bArr[i] = b;\n this.f9109g++;\n }", "public interface C1234b {\r\n /* renamed from: a */\r\n void m8367a();\r\n\r\n /* renamed from: b */\r\n void m8368b();\r\n}", "private void m676a(TField bkVar, byte b) {\n if (b == -1) {\n b = m687e(bkVar.f538b);\n }\n short s = bkVar.f539c;\n short s2 = this.f519n;\n if (s <= s2 || s - s2 > 15) {\n m678b(b);\n mo446a(bkVar.f539c);\n } else {\n m686d(b | ((s - s2) << 4));\n }\n this.f519n = bkVar.f539c;\n }", "private static void m831a(C0741g<?> gVar, C0747b bVar) {\n gVar.mo9477a(C0743i.f718b, (C0739e<? super Object>) bVar);\n gVar.mo9476a(C0743i.f718b, (C0738d) bVar);\n gVar.mo9474a(C0743i.f718b, (C0736b) bVar);\n }", "public interface C40453c {\n /* renamed from: a */\n void mo100442a(C40429b bVar);\n\n /* renamed from: a */\n void mo100443a(List<String> list);\n\n /* renamed from: b */\n void mo100444b(List<C40429b> list);\n}", "private void j()\n/* */ {\n/* 223 */ c localc = this.b;\n/* 224 */ this.b = this.c;\n/* 225 */ this.c = localc;\n/* 226 */ this.c.b();\n/* */ }", "public lj ar(byte b) {\n throw new Runtime(\"d2j fail translate: java.lang.RuntimeException: can not merge I and Z\\r\\n\\tat com.googlecode.dex2jar.ir.TypeClass.merge(TypeClass.java:100)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeRef.updateTypeClass(TypeTransformer.java:174)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeAnalyze.provideAs(TypeTransformer.java:780)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeAnalyze.e1expr(TypeTransformer.java:496)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeAnalyze.exExpr(TypeTransformer.java:713)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeAnalyze.exExpr(TypeTransformer.java:703)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeAnalyze.enexpr(TypeTransformer.java:698)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeAnalyze.exExpr(TypeTransformer.java:719)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeAnalyze.exExpr(TypeTransformer.java:703)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeAnalyze.s1stmt(TypeTransformer.java:810)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeAnalyze.sxStmt(TypeTransformer.java:840)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeAnalyze.analyze(TypeTransformer.java:206)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer.transform(TypeTransformer.java:44)\\r\\n\\tat com.googlecode.d2j.dex.Dex2jar$2.optimize(Dex2jar.java:162)\\r\\n\\tat com.googlecode.d2j.dex.Dex2Asm.convertCode(Dex2Asm.java:414)\\r\\n\\tat com.googlecode.d2j.dex.ExDex2Asm.convertCode(ExDex2Asm.java:42)\\r\\n\\tat com.googlecode.d2j.dex.Dex2jar$2.convertCode(Dex2jar.java:128)\\r\\n\\tat com.googlecode.d2j.dex.Dex2Asm.convertMethod(Dex2Asm.java:509)\\r\\n\\tat com.googlecode.d2j.dex.Dex2Asm.convertClass(Dex2Asm.java:406)\\r\\n\\tat com.googlecode.d2j.dex.Dex2Asm.convertDex(Dex2Asm.java:422)\\r\\n\\tat com.googlecode.d2j.dex.Dex2jar.doTranslate(Dex2jar.java:172)\\r\\n\\tat com.googlecode.d2j.dex.Dex2jar.to(Dex2jar.java:272)\\r\\n\\tat com.googlecode.dex2jar.tools.Dex2jarCmd.doCommandLine(Dex2jarCmd.java:108)\\r\\n\\tat com.googlecode.dex2jar.tools.BaseCmd.doMain(BaseCmd.java:288)\\r\\n\\tat com.googlecode.dex2jar.tools.Dex2jarCmd.main(Dex2jarCmd.java:32)\\r\\n\");\n }", "public interface AbstractC10485b {\n /* renamed from: a */\n void mo64153a(boolean z);\n }", "public interface C40108b {\n /* renamed from: a */\n void mo99838a(boolean z);\n }", "interface C8361a {\n /* renamed from: b */\n float mo18284b(ViewGroup viewGroup, View view);\n\n /* renamed from: c */\n float mo18281c(ViewGroup viewGroup, View view);\n }" ]
[ "0.64558864", "0.6283203", "0.6252635", "0.6250949", "0.6244743", "0.6216273", "0.6194491", "0.6193556", "0.61641675", "0.6140157", "0.60993093", "0.60974354", "0.6077849", "0.6001867", "0.5997364", "0.59737104", "0.59737104", "0.5905105", "0.5904295", "0.58908087", "0.5886636", "0.58828026", "0.5855491", "0.584618", "0.5842517", "0.5824137", "0.5824071", "0.58097327", "0.5802052", "0.58012927", "0.579443", "0.5792392", "0.57902914", "0.5785124", "0.57718205", "0.57589084", "0.5735892", "0.5735892", "0.5734873", "0.5727929", "0.5720821", "0.5712531", "0.5706813", "0.56896514", "0.56543154", "0.5651059", "0.5649904", "0.56496733", "0.5647035", "0.5640965", "0.5640109", "0.563993", "0.5631903", "0.5597427", "0.55843794", "0.5583287", "0.557783", "0.55734867", "0.55733293", "0.5572254", "0.55683887", "0.55624336", "0.55540246", "0.5553985", "0.55480546", "0.554261", "0.5535739", "0.5529958", "0.5519634", "0.5517503", "0.55160624", "0.5511545", "0.5505353", "0.5500533", "0.5491741", "0.5486198", "0.5481978", "0.547701", "0.54725856", "0.5471632", "0.5463497", "0.5460805", "0.5454913", "0.5454885", "0.54519916", "0.5441594", "0.5436747", "0.5432453", "0.5425923", "0.5424724", "0.54189867", "0.54162544", "0.54051477", "0.53998184", "0.53945845", "0.53887725", "0.5388146", "0.5387678", "0.53858143", "0.53850687", "0.5384439" ]
0.0
-1
/ renamed from: a
public static void m23772a(boolean z, String str, Object... objArr) { if (!z) { throw new IllegalArgumentException(String.format(str, objArr)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface C4521a {\n /* renamed from: a */\n void mo12348a();\n }", "public interface C1423a {\n /* renamed from: a */\n void mo6888a(int i);\n }", "interface bxc {\n /* renamed from: a */\n void mo2508a(bxb bxb);\n}", "interface C33292a {\n /* renamed from: a */\n void mo85415a(String str);\n }", "interface C10331b {\n /* renamed from: a */\n void mo26876a(int i);\n }", "public interface C0779a {\n /* renamed from: a */\n void mo2311a();\n}", "public interface C6788a {\n /* renamed from: a */\n void mo20141a();\n }", "public interface C0237a {\n /* renamed from: a */\n void mo1791a(String str);\n }", "public interface C35013b {\n /* renamed from: a */\n void mo88773a(int i);\n}", "public interface C11112n {\n /* renamed from: a */\n void mo38026a();\n }", "@Override\n\t\t\t\tpublic void a() {\n\n\t\t\t\t}", "public interface C23407b {\n /* renamed from: a */\n void mo60892a();\n\n /* renamed from: b */\n void mo60893b();\n }", "interface C0312e {\n /* renamed from: a */\n void mo4671a(View view, int i, int i2, int i3, int i4);\n }", "public interface C34379a {\n /* renamed from: a */\n void mo46242a(bmc bmc);\n }", "public interface C32456b<T> {\n /* renamed from: a */\n void mo83696a(T t);\n }", "private String convertir(String a) {\n StringBuilder atributo = new StringBuilder(a);\n atributo.insert(0, Character.toUpperCase(atributo.charAt(0)));\n return atributo.deleteCharAt(1).toString();\n }", "protected m a(String name) {\n/* 42 */ return this.a.get(name);\n/* */ }", "public interface AbstractC23925a {\n /* renamed from: a */\n void mo105476a();\n }", "private interface C0257a {\n /* renamed from: a */\n float mo196a(ViewGroup viewGroup, View view);\n\n /* renamed from: b */\n float mo195b(ViewGroup viewGroup, View view);\n }", "public interface C3598a {\n /* renamed from: a */\n void mo11024a(int i, int i2, String str);\n }", "public interface C2459d {\n /* renamed from: a */\n C2451d mo3408a(C2457e c2457e);\n}", "public interface am extends ak {\r\n /* renamed from: a */\r\n void mo194a(int i) throws RemoteException;\r\n\r\n /* renamed from: a */\r\n void mo195a(List<LatLng> list) throws RemoteException;\r\n\r\n /* renamed from: b */\r\n void mo196b(float f) throws RemoteException;\r\n\r\n /* renamed from: b */\r\n void mo197b(boolean z);\r\n\r\n /* renamed from: c */\r\n void mo198c(boolean z) throws RemoteException;\r\n\r\n /* renamed from: g */\r\n float mo199g() throws RemoteException;\r\n\r\n /* renamed from: h */\r\n int mo200h() throws RemoteException;\r\n\r\n /* renamed from: i */\r\n List<LatLng> mo201i() throws RemoteException;\r\n\r\n /* renamed from: j */\r\n boolean mo202j();\r\n\r\n /* renamed from: k */\r\n boolean mo203k();\r\n}", "public interface C32459e<T> {\n /* renamed from: a */\n void mo83698a(T t);\n }", "public interface C32458d<T> {\n /* renamed from: a */\n void mo83695a(T t);\n }", "public interface C5482b {\n /* renamed from: a */\n void mo27575a();\n\n /* renamed from: a */\n void mo27576a(int i);\n }", "public interface C27084a {\n /* renamed from: a */\n void mo69874a();\n\n /* renamed from: a */\n void mo69875a(List<Aweme> list, boolean z);\n }", "public void a() {\n ((a) this.a).a();\n }", "public interface C1153a {\n /* renamed from: a */\n void mo4520a(byte[] bArr);\n }", "public interface C13373b {\n /* renamed from: a */\n void mo32681a(String str, int i, boolean z);\n}", "public interface C40453c {\n /* renamed from: a */\n void mo100442a(C40429b bVar);\n\n /* renamed from: a */\n void mo100443a(List<String> list);\n\n /* renamed from: b */\n void mo100444b(List<C40429b> list);\n}", "public interface AbstractC17367b {\n /* renamed from: a */\n void mo84655a();\n }", "@Override\r\n\tpublic void a() {\n\t\t\r\n\t}", "public interface C43270a {\n /* renamed from: a */\n void mo64942a(String str, long j, long j2);\n}", "public interface C18928d {\n /* renamed from: a */\n void mo50320a(C18924b bVar);\n\n /* renamed from: b */\n void mo50321b(C18924b bVar);\n}", "public interface C0087c {\n /* renamed from: a */\n String mo150a(String str);\n}", "public interface C1529m {\n /* renamed from: a */\n void mo3767a(int i);\n\n /* renamed from: a */\n void mo3768a(String str);\n}", "interface C4483e {\n /* renamed from: a */\n boolean mo34114a();\n}", "public interface C1234b {\r\n /* renamed from: a */\r\n void m8367a();\r\n\r\n /* renamed from: b */\r\n void m8368b();\r\n}", "public interface C10965j<T> {\n /* renamed from: a */\n T mo26439a();\n}", "public interface C28772a {\n /* renamed from: a */\n View mo73990a(View view);\n }", "@Override\n\tpublic void a() {\n\t\t\n\t}", "public interface C8326b {\n /* renamed from: a */\n C8325a mo21498a(String str);\n\n /* renamed from: a */\n void mo21499a(C8325a aVar);\n}", "void metodo1(int a, int[] b) {\r\n\t\ta += 5;//Par\\u00e1metro con el mismo nombre que el campo de la clase.\r\n\t\tb[0] += 7;//se produce un env\\u00edo por referencia, apunta a una copia de un objeto, que se asigna aqu\\u00ed.\r\n\t}", "public interface C2367a {\n /* renamed from: a */\n C2368d mo1698a();\n }", "interface C30585a {\n /* renamed from: b */\n void mo27952b(C5379a c5379a, int i, C46650a c46650a, C7620bi c7620bi);\n }", "public interface C4211a {\n\n /* renamed from: com.iab.omid.library.oguryco.c.a$a */\n public interface C4212a {\n /* renamed from: a */\n void mo28760a(View view, C4211a aVar, JSONObject jSONObject);\n }\n\n /* renamed from: a */\n JSONObject mo28758a(View view);\n\n /* renamed from: a */\n void mo28759a(View view, JSONObject jSONObject, C4212a aVar, boolean z);\n}", "public interface C4697a extends C5595at {\n /* renamed from: a */\n void mo12634a();\n\n /* renamed from: a */\n void mo12635a(String str);\n\n /* renamed from: a */\n void mo12636a(boolean z);\n\n /* renamed from: b */\n void mo12637b();\n\n /* renamed from: c */\n void mo12638c();\n }", "public interface C4773c {\n /* renamed from: a */\n void m15858a(int i);\n\n /* renamed from: a */\n void m15859a(int i, int i2);\n\n /* renamed from: a */\n void m15860a(int i, int i2, int i3);\n\n /* renamed from: b */\n void m15861b(int i, int i2);\n}", "public interface C4869f {\n /* renamed from: a */\n C4865b mo6249a();\n}", "public interface C1799a {\n /* renamed from: b */\n void mo3314b(String str);\n }", "public interface C43499b {\n /* renamed from: a */\n void mo8445a(int i, String str, int i2, byte[] bArr);\n}", "public interface C0601aq {\n /* renamed from: a */\n void mo9148a(int i, ArrayList<C0889x> arrayList);\n}", "public interface C45101e {\n /* renamed from: b */\n void mo3796b(int i);\n}", "public interface AbstractC6461g {\n /* renamed from: a */\n String mo42332a();\n}", "public interface AbstractC1645a {\n /* renamed from: a */\n String mo17375a();\n }", "public interface C6178c {\n /* renamed from: a */\n Map<String, String> mo14888a();\n}", "public interface C5101b {\n /* renamed from: a */\n void mo5289a(C5102c c5102c);\n\n /* renamed from: b */\n void mo5290b(C5102c c5102c);\n}", "public interface C19045k {\n /* renamed from: a */\n void mo50368a(int i, Object obj);\n\n /* renamed from: b */\n void mo50369b(int i, Object obj);\n}", "public b a()\r\n/* 12: */ {\r\n/* 13:13 */ return this.a;\r\n/* 14: */ }", "public interface C7720a {\n /* renamed from: a */\n long mo20406a();\n}", "public String a()\r\n/* 25: */ {\r\n/* 26:171 */ return \"dig.\" + this.a;\r\n/* 27: */ }", "public interface ayt {\n /* renamed from: a */\n int mo1635a(long j, List list);\n\n /* renamed from: a */\n long mo1636a(long j, alb alb);\n\n /* renamed from: a */\n void mo1637a();\n\n /* renamed from: a */\n void mo1638a(long j, long j2, List list, ayp ayp);\n\n /* renamed from: a */\n void mo1639a(ayl ayl);\n\n /* renamed from: a */\n boolean mo1640a(ayl ayl, boolean z, Exception exc, long j);\n}", "public interface C24221b extends C28343z<C28318an> {\n /* renamed from: a */\n void mo62991a(int i);\n\n String aw_();\n\n /* renamed from: e */\n Aweme mo62993e();\n}", "public interface C4051c {\n /* renamed from: a */\n boolean mo23707a();\n}", "public interface C45112b {\n /* renamed from: a */\n List<C45111a> mo107674a(Integer num);\n\n /* renamed from: a */\n List<C45111a> mo107675a(Integer num, Integer num2);\n\n /* renamed from: a */\n void mo107676a(C45111a aVar);\n\n /* renamed from: b */\n void mo107677b(Integer num);\n\n /* renamed from: c */\n long mo107678c(Integer num);\n}", "public void acionou(int a){\n\t\t\tb=a;\n\t\t}", "public interface C44963i {\n /* renamed from: a */\n void mo63037a(int i, int i2);\n\n void aA_();\n\n /* renamed from: b */\n void mo63039b(int i, int i2);\n}", "public interface C32457c<T> {\n /* renamed from: a */\n void mo83699a(T t, int i, int i2, String str);\n }", "public interface C5861g {\n /* renamed from: a */\n void mo18320a(C7251a aVar);\n\n @Deprecated\n /* renamed from: a */\n void mo18321a(C7251a aVar, String str);\n\n /* renamed from: a */\n void mo18322a(C7252b bVar);\n\n /* renamed from: a */\n void mo18323a(C7253c cVar);\n\n /* renamed from: a */\n void mo18324a(C7260j jVar);\n}", "public interface C0937a {\n /* renamed from: a */\n void mo3807a(C0985po[] poVarArr);\n }", "public interface C8466a {\n /* renamed from: a */\n void mo25956a(int i);\n\n /* renamed from: a */\n void mo25957a(long j, long j2);\n }", "public interface C39684b {\n /* renamed from: a */\n void mo98969a();\n\n /* renamed from: a */\n void mo98970a(C29296g gVar);\n\n /* renamed from: a */\n void mo98971a(C29296g gVar, int i);\n }", "public interface C43470b {\n /* renamed from: a */\n void mo61496a(C43469a aVar, C43471c cVar);\n }", "public interface AbstractC18255a {\n /* renamed from: a */\n void mo88521a();\n\n /* renamed from: a */\n void mo88522a(String str);\n\n /* renamed from: b */\n void mo88523b();\n\n /* renamed from: c */\n void mo88524c();\n }", "public interface C1436d {\n /* renamed from: a */\n C1435c mo1754a(C1433a c1433a, C1434b c1434b);\n}", "public interface C4150sl {\n /* renamed from: a */\n void mo15005a(C4143se seVar);\n}", "public void a(nm paramnm)\r\n/* 28: */ {\r\n/* 29:45 */ paramnm.a(this);\r\n/* 30: */ }", "public interface C19351a {\n /* renamed from: b */\n void mo30633b(int i, String str, byte[] bArr);\n }", "public interface C11113o {\n /* renamed from: a */\n void mo37759a(String str);\n }", "public interface C39504az {\n /* renamed from: a */\n int mo98207a();\n\n /* renamed from: a */\n void mo98208a(boolean z);\n\n /* renamed from: b */\n int mo98209b();\n\n /* renamed from: c */\n int mo98355c();\n\n /* renamed from: d */\n int mo98356d();\n\n /* renamed from: e */\n int mo98357e();\n\n /* renamed from: f */\n int mo98358f();\n}", "protected a<T> a(Tag.e<T> var0) {\n/* 80 */ Tag.a var1 = b(var0);\n/* 81 */ return new a<>(var1, this.c, \"vanilla\");\n/* */ }", "public interface C35565a {\n /* renamed from: a */\n C45321i mo90380a();\n }", "public interface C21298a {\n /* renamed from: a */\n void mo57275a();\n\n /* renamed from: a */\n void mo57276a(Exception exc);\n\n /* renamed from: b */\n void mo57277b();\n\n /* renamed from: c */\n void mo57278c();\n }", "public interface C40108b {\n /* renamed from: a */\n void mo99838a(boolean z);\n }", "public interface C0456a {\n /* renamed from: a */\n void mo2090a(C0455b bVar);\n\n /* renamed from: a */\n boolean mo2091a(C0455b bVar, Menu menu);\n\n /* renamed from: a */\n boolean mo2092a(C0455b bVar, MenuItem menuItem);\n\n /* renamed from: b */\n boolean mo2093b(C0455b bVar, Menu menu);\n }", "public interface C4724o {\n /* renamed from: a */\n void mo4872a(int i, String str);\n\n /* renamed from: a */\n void mo4873a(C4718l c4718l);\n\n /* renamed from: b */\n void mo4874b(C4718l c4718l);\n}", "public interface C7654b {\n /* renamed from: a */\n C7904c mo24084a();\n\n /* renamed from: b */\n C7716a mo24085b();\n }", "public interface C2603a {\n /* renamed from: a */\n String mo1889a(String str, String str2, String str3, String str4);\n }", "public interface afp {\n /* renamed from: a */\n C0512sx mo169a(C0497si siVar, afj afj, afr afr, Context context);\n}", "public interface C0615ja extends b<HomeFragment> {\n\n /* renamed from: c.c.a.h.b.ja$a */\n /* compiled from: FragmentModule_HomeFragment$app_bazaarRelease */\n public static abstract class a extends b.a<HomeFragment> {\n }\n}", "public interface a {\n\n /* renamed from: c.b.a.c.b.b.a$a reason: collision with other inner class name */\n /* compiled from: DiskCache */\n public interface C0054a {\n a build();\n }\n\n /* compiled from: DiskCache */\n public interface b {\n boolean a(File file);\n }\n\n File a(c cVar);\n\n void a(c cVar, b bVar);\n}", "public interface C0940d {\n /* renamed from: a */\n void mo3305a(boolean z);\n }", "public interface AbstractC17368c {\n /* renamed from: a */\n void mo84656a(float f);\n }", "interface C0932a {\n /* renamed from: a */\n void mo7438a(int i, int i2);\n\n /* renamed from: b */\n void mo7439b(C0933b bVar);\n\n /* renamed from: c */\n void mo7440c(int i, int i2, Object obj);\n\n /* renamed from: d */\n void mo7441d(C0933b bVar);\n\n /* renamed from: e */\n RecyclerView.ViewHolder mo7442e(int i);\n\n /* renamed from: f */\n void mo7443f(int i, int i2);\n\n /* renamed from: g */\n void mo7444g(int i, int i2);\n\n /* renamed from: h */\n void mo7445h(int i, int i2);\n }", "public interface C10330c {\n /* renamed from: a */\n C7562b<C10403b, C10328a> mo25041a();\n}", "public interface C3819a {\n /* renamed from: a */\n void mo23214a(Message message);\n }", "private Proof atoAImpl(Expression a) {\n Proof where = axm2(a, arrow(a, a), a); //a->(a->a) -> (a->(a->a)->a) -> (a -> a)\n Proof one = axm1(a, a); //a->a->a\n Proof two = axm1(a, arrow(a, a)); //a->(a->a)->A\n return mpTwice(where, one, two);\n }", "interface C1939a {\n /* renamed from: a */\n Bitmap mo1406a(Bitmap bitmap, float f);\n}", "public interface a extends com.bankeen.d.b.b.a {\n void a();\n\n void b();\n }", "public b[] a() {\n/* 95 */ return this.a;\n/* */ }", "interface C8361a {\n /* renamed from: b */\n float mo18284b(ViewGroup viewGroup, View view);\n\n /* renamed from: c */\n float mo18281c(ViewGroup viewGroup, View view);\n }" ]
[ "0.62497115", "0.6242887", "0.61394435", "0.61176854", "0.6114027", "0.60893", "0.6046901", "0.6024682", "0.60201293", "0.5975212", "0.59482527", "0.59121317", "0.5883635", "0.587841", "0.58703005", "0.5868436", "0.5864884", "0.5857492", "0.58306104", "0.5827752", "0.58272064", "0.5794689", "0.57890314", "0.57838726", "0.5775679", "0.57694733", "0.5769128", "0.57526815", "0.56907034", "0.5677874", "0.5670547", "0.56666386", "0.56592244", "0.5658682", "0.56574154", "0.5654324", "0.5644676", "0.56399715", "0.5638734", "0.5630582", "0.56183887", "0.5615435", "0.56069666", "0.5605207", "0.56005067", "0.559501", "0.55910283", "0.5590222", "0.55736613", "0.5556682", "0.5554544", "0.5550076", "0.55493855", "0.55446684", "0.5538079", "0.5529058", "0.5528109", "0.552641", "0.5525864", "0.552186", "0.5519972", "0.5509587", "0.5507195", "0.54881203", "0.5485328", "0.54826045", "0.5482066", "0.5481586", "0.5479751", "0.54776895", "0.54671466", "0.5463307", "0.54505056", "0.54436916", "0.5440517", "0.5439747", "0.5431944", "0.5422869", "0.54217863", "0.5417556", "0.5403905", "0.5400223", "0.53998446", "0.5394735", "0.5388649", "0.5388258", "0.5374842", "0.5368887", "0.53591394", "0.5357029", "0.5355688", "0.535506", "0.5355034", "0.53494394", "0.5341044", "0.5326166", "0.53236824", "0.53199095", "0.53177035", "0.53112453", "0.5298229" ]
0.0
-1
/ renamed from: a
public static void m23769a(String str) { if (Looper.myLooper() != Looper.getMainLooper()) { throw new IllegalStateException(str); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface C4521a {\n /* renamed from: a */\n void mo12348a();\n }", "public interface C1423a {\n /* renamed from: a */\n void mo6888a(int i);\n }", "interface bxc {\n /* renamed from: a */\n void mo2508a(bxb bxb);\n}", "interface C33292a {\n /* renamed from: a */\n void mo85415a(String str);\n }", "interface C10331b {\n /* renamed from: a */\n void mo26876a(int i);\n }", "public interface C0779a {\n /* renamed from: a */\n void mo2311a();\n}", "public interface C6788a {\n /* renamed from: a */\n void mo20141a();\n }", "public interface C0237a {\n /* renamed from: a */\n void mo1791a(String str);\n }", "public interface C35013b {\n /* renamed from: a */\n void mo88773a(int i);\n}", "public interface C11112n {\n /* renamed from: a */\n void mo38026a();\n }", "@Override\n\t\t\t\tpublic void a() {\n\n\t\t\t\t}", "public interface C23407b {\n /* renamed from: a */\n void mo60892a();\n\n /* renamed from: b */\n void mo60893b();\n }", "interface C0312e {\n /* renamed from: a */\n void mo4671a(View view, int i, int i2, int i3, int i4);\n }", "public interface C34379a {\n /* renamed from: a */\n void mo46242a(bmc bmc);\n }", "public interface C32456b<T> {\n /* renamed from: a */\n void mo83696a(T t);\n }", "private String convertir(String a) {\n StringBuilder atributo = new StringBuilder(a);\n atributo.insert(0, Character.toUpperCase(atributo.charAt(0)));\n return atributo.deleteCharAt(1).toString();\n }", "protected m a(String name) {\n/* 42 */ return this.a.get(name);\n/* */ }", "public interface AbstractC23925a {\n /* renamed from: a */\n void mo105476a();\n }", "private interface C0257a {\n /* renamed from: a */\n float mo196a(ViewGroup viewGroup, View view);\n\n /* renamed from: b */\n float mo195b(ViewGroup viewGroup, View view);\n }", "public interface C3598a {\n /* renamed from: a */\n void mo11024a(int i, int i2, String str);\n }", "public interface C2459d {\n /* renamed from: a */\n C2451d mo3408a(C2457e c2457e);\n}", "public interface am extends ak {\r\n /* renamed from: a */\r\n void mo194a(int i) throws RemoteException;\r\n\r\n /* renamed from: a */\r\n void mo195a(List<LatLng> list) throws RemoteException;\r\n\r\n /* renamed from: b */\r\n void mo196b(float f) throws RemoteException;\r\n\r\n /* renamed from: b */\r\n void mo197b(boolean z);\r\n\r\n /* renamed from: c */\r\n void mo198c(boolean z) throws RemoteException;\r\n\r\n /* renamed from: g */\r\n float mo199g() throws RemoteException;\r\n\r\n /* renamed from: h */\r\n int mo200h() throws RemoteException;\r\n\r\n /* renamed from: i */\r\n List<LatLng> mo201i() throws RemoteException;\r\n\r\n /* renamed from: j */\r\n boolean mo202j();\r\n\r\n /* renamed from: k */\r\n boolean mo203k();\r\n}", "public interface C32459e<T> {\n /* renamed from: a */\n void mo83698a(T t);\n }", "public interface C32458d<T> {\n /* renamed from: a */\n void mo83695a(T t);\n }", "public interface C5482b {\n /* renamed from: a */\n void mo27575a();\n\n /* renamed from: a */\n void mo27576a(int i);\n }", "public interface C27084a {\n /* renamed from: a */\n void mo69874a();\n\n /* renamed from: a */\n void mo69875a(List<Aweme> list, boolean z);\n }", "public void a() {\n ((a) this.a).a();\n }", "public interface C1153a {\n /* renamed from: a */\n void mo4520a(byte[] bArr);\n }", "public interface C13373b {\n /* renamed from: a */\n void mo32681a(String str, int i, boolean z);\n}", "public interface C40453c {\n /* renamed from: a */\n void mo100442a(C40429b bVar);\n\n /* renamed from: a */\n void mo100443a(List<String> list);\n\n /* renamed from: b */\n void mo100444b(List<C40429b> list);\n}", "public interface AbstractC17367b {\n /* renamed from: a */\n void mo84655a();\n }", "@Override\r\n\tpublic void a() {\n\t\t\r\n\t}", "public interface C43270a {\n /* renamed from: a */\n void mo64942a(String str, long j, long j2);\n}", "public interface C18928d {\n /* renamed from: a */\n void mo50320a(C18924b bVar);\n\n /* renamed from: b */\n void mo50321b(C18924b bVar);\n}", "public interface C0087c {\n /* renamed from: a */\n String mo150a(String str);\n}", "public interface C1529m {\n /* renamed from: a */\n void mo3767a(int i);\n\n /* renamed from: a */\n void mo3768a(String str);\n}", "interface C4483e {\n /* renamed from: a */\n boolean mo34114a();\n}", "public interface C1234b {\r\n /* renamed from: a */\r\n void m8367a();\r\n\r\n /* renamed from: b */\r\n void m8368b();\r\n}", "public interface C10965j<T> {\n /* renamed from: a */\n T mo26439a();\n}", "public interface C28772a {\n /* renamed from: a */\n View mo73990a(View view);\n }", "@Override\n\tpublic void a() {\n\t\t\n\t}", "public interface C8326b {\n /* renamed from: a */\n C8325a mo21498a(String str);\n\n /* renamed from: a */\n void mo21499a(C8325a aVar);\n}", "void metodo1(int a, int[] b) {\r\n\t\ta += 5;//Par\\u00e1metro con el mismo nombre que el campo de la clase.\r\n\t\tb[0] += 7;//se produce un env\\u00edo por referencia, apunta a una copia de un objeto, que se asigna aqu\\u00ed.\r\n\t}", "public interface C2367a {\n /* renamed from: a */\n C2368d mo1698a();\n }", "interface C30585a {\n /* renamed from: b */\n void mo27952b(C5379a c5379a, int i, C46650a c46650a, C7620bi c7620bi);\n }", "public interface C4211a {\n\n /* renamed from: com.iab.omid.library.oguryco.c.a$a */\n public interface C4212a {\n /* renamed from: a */\n void mo28760a(View view, C4211a aVar, JSONObject jSONObject);\n }\n\n /* renamed from: a */\n JSONObject mo28758a(View view);\n\n /* renamed from: a */\n void mo28759a(View view, JSONObject jSONObject, C4212a aVar, boolean z);\n}", "public interface C4697a extends C5595at {\n /* renamed from: a */\n void mo12634a();\n\n /* renamed from: a */\n void mo12635a(String str);\n\n /* renamed from: a */\n void mo12636a(boolean z);\n\n /* renamed from: b */\n void mo12637b();\n\n /* renamed from: c */\n void mo12638c();\n }", "public interface C4773c {\n /* renamed from: a */\n void m15858a(int i);\n\n /* renamed from: a */\n void m15859a(int i, int i2);\n\n /* renamed from: a */\n void m15860a(int i, int i2, int i3);\n\n /* renamed from: b */\n void m15861b(int i, int i2);\n}", "public interface C4869f {\n /* renamed from: a */\n C4865b mo6249a();\n}", "public interface C1799a {\n /* renamed from: b */\n void mo3314b(String str);\n }", "public interface C43499b {\n /* renamed from: a */\n void mo8445a(int i, String str, int i2, byte[] bArr);\n}", "public interface C0601aq {\n /* renamed from: a */\n void mo9148a(int i, ArrayList<C0889x> arrayList);\n}", "public interface C45101e {\n /* renamed from: b */\n void mo3796b(int i);\n}", "public interface AbstractC6461g {\n /* renamed from: a */\n String mo42332a();\n}", "public interface AbstractC1645a {\n /* renamed from: a */\n String mo17375a();\n }", "public interface C6178c {\n /* renamed from: a */\n Map<String, String> mo14888a();\n}", "public interface C5101b {\n /* renamed from: a */\n void mo5289a(C5102c c5102c);\n\n /* renamed from: b */\n void mo5290b(C5102c c5102c);\n}", "public interface C19045k {\n /* renamed from: a */\n void mo50368a(int i, Object obj);\n\n /* renamed from: b */\n void mo50369b(int i, Object obj);\n}", "public b a()\r\n/* 12: */ {\r\n/* 13:13 */ return this.a;\r\n/* 14: */ }", "public interface C7720a {\n /* renamed from: a */\n long mo20406a();\n}", "public String a()\r\n/* 25: */ {\r\n/* 26:171 */ return \"dig.\" + this.a;\r\n/* 27: */ }", "public interface ayt {\n /* renamed from: a */\n int mo1635a(long j, List list);\n\n /* renamed from: a */\n long mo1636a(long j, alb alb);\n\n /* renamed from: a */\n void mo1637a();\n\n /* renamed from: a */\n void mo1638a(long j, long j2, List list, ayp ayp);\n\n /* renamed from: a */\n void mo1639a(ayl ayl);\n\n /* renamed from: a */\n boolean mo1640a(ayl ayl, boolean z, Exception exc, long j);\n}", "public interface C24221b extends C28343z<C28318an> {\n /* renamed from: a */\n void mo62991a(int i);\n\n String aw_();\n\n /* renamed from: e */\n Aweme mo62993e();\n}", "public interface C4051c {\n /* renamed from: a */\n boolean mo23707a();\n}", "public interface C45112b {\n /* renamed from: a */\n List<C45111a> mo107674a(Integer num);\n\n /* renamed from: a */\n List<C45111a> mo107675a(Integer num, Integer num2);\n\n /* renamed from: a */\n void mo107676a(C45111a aVar);\n\n /* renamed from: b */\n void mo107677b(Integer num);\n\n /* renamed from: c */\n long mo107678c(Integer num);\n}", "public void acionou(int a){\n\t\t\tb=a;\n\t\t}", "public interface C44963i {\n /* renamed from: a */\n void mo63037a(int i, int i2);\n\n void aA_();\n\n /* renamed from: b */\n void mo63039b(int i, int i2);\n}", "public interface C32457c<T> {\n /* renamed from: a */\n void mo83699a(T t, int i, int i2, String str);\n }", "public interface C5861g {\n /* renamed from: a */\n void mo18320a(C7251a aVar);\n\n @Deprecated\n /* renamed from: a */\n void mo18321a(C7251a aVar, String str);\n\n /* renamed from: a */\n void mo18322a(C7252b bVar);\n\n /* renamed from: a */\n void mo18323a(C7253c cVar);\n\n /* renamed from: a */\n void mo18324a(C7260j jVar);\n}", "public interface C0937a {\n /* renamed from: a */\n void mo3807a(C0985po[] poVarArr);\n }", "public interface C8466a {\n /* renamed from: a */\n void mo25956a(int i);\n\n /* renamed from: a */\n void mo25957a(long j, long j2);\n }", "public interface C39684b {\n /* renamed from: a */\n void mo98969a();\n\n /* renamed from: a */\n void mo98970a(C29296g gVar);\n\n /* renamed from: a */\n void mo98971a(C29296g gVar, int i);\n }", "public interface C43470b {\n /* renamed from: a */\n void mo61496a(C43469a aVar, C43471c cVar);\n }", "public interface AbstractC18255a {\n /* renamed from: a */\n void mo88521a();\n\n /* renamed from: a */\n void mo88522a(String str);\n\n /* renamed from: b */\n void mo88523b();\n\n /* renamed from: c */\n void mo88524c();\n }", "public interface C1436d {\n /* renamed from: a */\n C1435c mo1754a(C1433a c1433a, C1434b c1434b);\n}", "public interface C4150sl {\n /* renamed from: a */\n void mo15005a(C4143se seVar);\n}", "public void a(nm paramnm)\r\n/* 28: */ {\r\n/* 29:45 */ paramnm.a(this);\r\n/* 30: */ }", "public interface C19351a {\n /* renamed from: b */\n void mo30633b(int i, String str, byte[] bArr);\n }", "public interface C11113o {\n /* renamed from: a */\n void mo37759a(String str);\n }", "public interface C39504az {\n /* renamed from: a */\n int mo98207a();\n\n /* renamed from: a */\n void mo98208a(boolean z);\n\n /* renamed from: b */\n int mo98209b();\n\n /* renamed from: c */\n int mo98355c();\n\n /* renamed from: d */\n int mo98356d();\n\n /* renamed from: e */\n int mo98357e();\n\n /* renamed from: f */\n int mo98358f();\n}", "protected a<T> a(Tag.e<T> var0) {\n/* 80 */ Tag.a var1 = b(var0);\n/* 81 */ return new a<>(var1, this.c, \"vanilla\");\n/* */ }", "public interface C35565a {\n /* renamed from: a */\n C45321i mo90380a();\n }", "public interface C21298a {\n /* renamed from: a */\n void mo57275a();\n\n /* renamed from: a */\n void mo57276a(Exception exc);\n\n /* renamed from: b */\n void mo57277b();\n\n /* renamed from: c */\n void mo57278c();\n }", "public interface C40108b {\n /* renamed from: a */\n void mo99838a(boolean z);\n }", "public interface C0456a {\n /* renamed from: a */\n void mo2090a(C0455b bVar);\n\n /* renamed from: a */\n boolean mo2091a(C0455b bVar, Menu menu);\n\n /* renamed from: a */\n boolean mo2092a(C0455b bVar, MenuItem menuItem);\n\n /* renamed from: b */\n boolean mo2093b(C0455b bVar, Menu menu);\n }", "public interface C4724o {\n /* renamed from: a */\n void mo4872a(int i, String str);\n\n /* renamed from: a */\n void mo4873a(C4718l c4718l);\n\n /* renamed from: b */\n void mo4874b(C4718l c4718l);\n}", "public interface C7654b {\n /* renamed from: a */\n C7904c mo24084a();\n\n /* renamed from: b */\n C7716a mo24085b();\n }", "public interface C2603a {\n /* renamed from: a */\n String mo1889a(String str, String str2, String str3, String str4);\n }", "public interface afp {\n /* renamed from: a */\n C0512sx mo169a(C0497si siVar, afj afj, afr afr, Context context);\n}", "public interface C0615ja extends b<HomeFragment> {\n\n /* renamed from: c.c.a.h.b.ja$a */\n /* compiled from: FragmentModule_HomeFragment$app_bazaarRelease */\n public static abstract class a extends b.a<HomeFragment> {\n }\n}", "public interface a {\n\n /* renamed from: c.b.a.c.b.b.a$a reason: collision with other inner class name */\n /* compiled from: DiskCache */\n public interface C0054a {\n a build();\n }\n\n /* compiled from: DiskCache */\n public interface b {\n boolean a(File file);\n }\n\n File a(c cVar);\n\n void a(c cVar, b bVar);\n}", "public interface C0940d {\n /* renamed from: a */\n void mo3305a(boolean z);\n }", "public interface AbstractC17368c {\n /* renamed from: a */\n void mo84656a(float f);\n }", "interface C0932a {\n /* renamed from: a */\n void mo7438a(int i, int i2);\n\n /* renamed from: b */\n void mo7439b(C0933b bVar);\n\n /* renamed from: c */\n void mo7440c(int i, int i2, Object obj);\n\n /* renamed from: d */\n void mo7441d(C0933b bVar);\n\n /* renamed from: e */\n RecyclerView.ViewHolder mo7442e(int i);\n\n /* renamed from: f */\n void mo7443f(int i, int i2);\n\n /* renamed from: g */\n void mo7444g(int i, int i2);\n\n /* renamed from: h */\n void mo7445h(int i, int i2);\n }", "public interface C10330c {\n /* renamed from: a */\n C7562b<C10403b, C10328a> mo25041a();\n}", "public interface C3819a {\n /* renamed from: a */\n void mo23214a(Message message);\n }", "private Proof atoAImpl(Expression a) {\n Proof where = axm2(a, arrow(a, a), a); //a->(a->a) -> (a->(a->a)->a) -> (a -> a)\n Proof one = axm1(a, a); //a->a->a\n Proof two = axm1(a, arrow(a, a)); //a->(a->a)->A\n return mpTwice(where, one, two);\n }", "interface C1939a {\n /* renamed from: a */\n Bitmap mo1406a(Bitmap bitmap, float f);\n}", "public interface a extends com.bankeen.d.b.b.a {\n void a();\n\n void b();\n }", "public b[] a() {\n/* 95 */ return this.a;\n/* */ }", "interface C8361a {\n /* renamed from: b */\n float mo18284b(ViewGroup viewGroup, View view);\n\n /* renamed from: c */\n float mo18281c(ViewGroup viewGroup, View view);\n }" ]
[ "0.62497115", "0.6242887", "0.61394435", "0.61176854", "0.6114027", "0.60893", "0.6046901", "0.6024682", "0.60201293", "0.5975212", "0.59482527", "0.59121317", "0.5883635", "0.587841", "0.58703005", "0.5868436", "0.5864884", "0.5857492", "0.58306104", "0.5827752", "0.58272064", "0.5794689", "0.57890314", "0.57838726", "0.5775679", "0.57694733", "0.5769128", "0.57526815", "0.56907034", "0.5677874", "0.5670547", "0.56666386", "0.56592244", "0.5658682", "0.56574154", "0.5654324", "0.5644676", "0.56399715", "0.5638734", "0.5630582", "0.56183887", "0.5615435", "0.56069666", "0.5605207", "0.56005067", "0.559501", "0.55910283", "0.5590222", "0.55736613", "0.5556682", "0.5554544", "0.5550076", "0.55493855", "0.55446684", "0.5538079", "0.5529058", "0.5528109", "0.552641", "0.5525864", "0.552186", "0.5519972", "0.5509587", "0.5507195", "0.54881203", "0.5485328", "0.54826045", "0.5482066", "0.5481586", "0.5479751", "0.54776895", "0.54671466", "0.5463307", "0.54505056", "0.54436916", "0.5440517", "0.5439747", "0.5431944", "0.5422869", "0.54217863", "0.5417556", "0.5403905", "0.5400223", "0.53998446", "0.5394735", "0.5388649", "0.5388258", "0.5374842", "0.5368887", "0.53591394", "0.5357029", "0.5355688", "0.535506", "0.5355034", "0.53494394", "0.5341044", "0.5326166", "0.53236824", "0.53199095", "0.53177035", "0.53112453", "0.5298229" ]
0.0
-1
TODO Autogenerated method stub
public static void main(String[] args) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
/ It provides list of employees in model object
@RequestMapping("/viewRoute") public String viewShip(Model m){ List<Route> list=dao.getRoute(); m.addAttribute("list",list); return "viewRoute"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public List<Employees> getEmployeesList()\n {\n return employeesRepo.findAll();\n }", "public List<Employee> getEmployees();", "@RequestMapping(value = \"/listEmployees\", method = RequestMethod.GET)\r\n\tpublic Employee employees() {\r\n System.out.println(\"---BEGIN\");\r\n List<Employee> allEmployees = employeeData.findAll();\r\n \r\n System.out.println(\"size of emp == \"+allEmployees.size());\r\n System.out.println(\"---END\");\r\n Employee oneEmployee = allEmployees.get(0);\r\n\t\treturn oneEmployee;\r\n }", "public List<Employee> getAllEmployees() {\n return employeeRepository.findAll();\n }", "@ModelAttribute(\"allEmployees\")\n public List<EmployeeEntity> populateEmployees() \n {\n List<EmployeeEntity> employees = manager.getAllEmployees();\n return employees;\n }", "@GetMapping(value=\"/searchEmpData\")\n\tpublic List<Employee> getAllEmployees()\n\t{\n\t\treturn this.integrationClient.getAllEmployees();\n\t}", "@Override\n\tpublic List<Employee> getEmpleados() {\n\t\treturn repositorioEmployee.findAll();\n\t}", "@RequestMapping(value = \"/getAllEmployees\", method = RequestMethod.GET, produces = { MediaType.APPLICATION_JSON_VALUE })\r\n\tpublic List<Employee> getAllEmpoyees(){\r\n\t\treturn repository.getAllEmpoyees();\r\n\t}", "List<Employee> allEmpInfo();", "public List<EmployeeDetails> getEmployeeDetails();", "@Override\n\tpublic List<Employee> getAllEmployees() {\n\t\ttry {\n\t\t\tList<Employee> empList = new ArrayList<Employee>();\n\t\t\tList<Map<String, Object>> rows = template.queryForList(\"select * from employee\");\n\t\t\tfor(Map<?, ?> rowNum : rows) {\n\t\t\t\tEmployee emp = new Employee();\n\t\t\t\temp.setEmployeeId((Integer)rowNum.get(\"empid\"));\n\t\t\t\temp.setFirstName((String)rowNum.get(\"fname\"));\n\t\t\t\temp.setLastName((String)rowNum.get(\"lname\"));\n\t\t\t\temp.setEmail((String)rowNum.get(\"email\"));\n\t\t\t\temp.setDesignation((String)rowNum.get(\"desig\"));\n\t\t\t\temp.setLocation((String)rowNum.get(\"location\"));\n\t\t\t\temp.setSalary((Integer)rowNum.get(\"salary\"));\n\t\t\t\tempList.add(emp);\n\t\t\t}\n\t\t\treturn empList;\n\t\t} catch (DataAccessException excep) {\n\t\t\treturn null;\n\t\t}\n\t}", "@RequestMapping(path = \"/employee\", method = RequestMethod.GET)\r\n\t@ResponseBody\r\n\tpublic List<Employee> displayEmployee() {\r\n\t\treturn er.findAll();\r\n\t}", "@GetMapping(\"/employees\")\r\n\tpublic List<Employee> getEmployees(){\r\n\t\t\r\n\t\treturn employeeService.getEmployees();\r\n\t\t\r\n\t}", "@Override\r\n\tpublic List<Employee> getAllEmployee() {\n\t\treturn employees;\r\n\t}", "public List<Employee> list() {\n\t\t\treturn employees;\n\t\t}", "public List<Employee> listAll(){\n return employeeRepository.findAll();\n }", "@RequestMapping(method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)\n public final List<EmployeeDTO> findAllEmployees() {\n LOGGER.info(\"getting all employees\");\n return employeeFacade.findAllEmployees();\n }", "@Override\n\tpublic List<Employee> findAllEmployees() {\n\t\treturn employeeRepository.findAllEmployess();\n\t}", "public String getEmployees(){\n return employees;\n }", "@RequestMapping(\"/employee\")\n\tpublic List<Employee> getAllEmplyee() {\n\t\treturn service.getAllEmplyee();\n\t}", "@Override\n\tpublic List<Employee> viewAllEmployees() {\n\t\t CriteriaBuilder cb = em.getCriteriaBuilder();\n\t\t CriteriaQuery<Employee> cq = cb.createQuery(Employee.class);\n\t\t Root<Employee> rootEntry = cq.from(Employee.class);\n\t\t CriteriaQuery<Employee> all = cq.select(rootEntry);\n\t \n\t\t TypedQuery<Employee> allQuery = em.createQuery(all);\n\t\t return allQuery.getResultList();\n\t}", "@GetMapping(\"/employees\")\npublic List <Employee> findAlll(){\n\treturn employeeService.findAll();\n\t}", "public List<Employee> getAllEmployees() {\n\t\tList<Employee> list = new ArrayList<Employee>();\n\t\tlist = template.loadAll(Employee.class);\n\t\treturn list;\n\t}", "@GetMapping(value=\"/employes\")\n\tpublic List<Employee> getEmployeeDetails(){\n\t\t\n\t\tList<Employee> employeeList = employeeService.fetchEmployeeDetails();\n\t\treturn employeeList;\t\t\t\t\t\t\n\t}", "@Override\n\tpublic List<Employee> getAllEmployees() {\n\t\t\n\t\tlog.debug(\"EmplyeeService.getAllEmployee() return list of employees\");\n\t\treturn repositary.findAll();\n\t}", "@GetMapping(\"/employees\")\r\n\tpublic List<Employee> list() {\r\n\t return empService.listAll();\r\n\t}", "public List<Employee> getListOfAllEmployees() {\n\t\tlista = employeeDao.findAll();\r\n\r\n\t\treturn lista;\r\n\t}", "@Override\r\n\tpublic List<Employee> getAllEmployeeList() throws Exception {\n\t\t\r\n\t\treturn (List<Employee>) employeeRepository.findAll();\r\n\t}", "@GetMapping(\"/employee\")\r\n\tpublic List<Employee> getAllEmployees()\r\n\t{\r\n\t\treturn empdao.findAll();\r\n\t}", "public List<Employee> getAllEmployee(){\n List<Employee> employee = new ArrayList<Employee>();\n employeeRepository.findAll().forEach(employee::add);\n return employee;\n }", "public List<Employee> getAllEmployees(){\n\t\tFaker faker = new Faker();\n\t\tList<Employee> employeeList = new ArrayList<Employee>();\n\t\tfor(int i=101; i<=110; i++) {\n\t\t\tEmployee myEmployee = new Employee();\n\t\t\tmyEmployee.setId(i);\n\t\t\tmyEmployee.setName(faker.name().fullName());\n\t\t\tmyEmployee.setMobile(faker.phoneNumber().cellPhone());\n\t\t\tmyEmployee.setAddress(faker.address().streetAddress());\n\t\t\tmyEmployee.setCompanyLogo(faker.company().logo());\n\t\t\temployeeList.add(myEmployee);\n\t\t}\n\t\treturn employeeList;\n\t}", "@RequestMapping(value = \"/v2/employees\", method = RequestMethod.GET)\r\n\tpublic List<Employee> employeev2() {\r\n JPAQuery<?> query = new JPAQuery<Void>(em);\r\n QEmployee qemployee = QEmployee.employee;\r\n List<Employee> employees = (List<Employee>) query.from(qemployee).fetch();\r\n // Employee oneEmp = employees.get(0);\r\n\t\treturn employees;\r\n }", "public List<Employee> findAll() {\n return employeeRepository.findAll();\n }", "@Override\n\tpublic List<EmployeeBean> getEmployeeList() throws Exception {\n\t\treturn employeeDao.getEmployeeList();\n\t}", "@GetMapping(\"/GetAllEmployees\")\r\n public List<Employee> viewAllEmployees() {\r\n return admin.viewAllEmployees();\r\n }", "@RequestMapping(value = { \"/list\" }, method = RequestMethod.GET)\r\n public String listEmployees(ModelMap model) {\r\n \r\n List<Employee> employees = service.findAllEmployees();\r\n model.addAttribute(\"employees\", employees);\r\n return \"allemployees\";\r\n }", "@Override\r\n\tpublic List<Employee> findAllEMployees() {\n\t\tList<Employee> employees = new ArrayList<Employee>();\r\n\t\tString findData = \"select * from employee\";\r\n\r\n\t\ttry {\r\n\t\t\tStatement s = dataSource.getConnection().createStatement();\r\n\r\n\t\t\tResultSet set = s.executeQuery(findData);\r\n\r\n\t\t\twhile (set.next()) {\r\n\t\t\t\tString name = set.getString(1);\r\n\t\t\t\tint id = set.getInt(\"empId\");\r\n\t\t\t\tint sal = set.getInt(\"salary\");\r\n\t\t\t\tString tech = set.getString(\"technology\");\r\n\t\t\t\tEmployee employee = new Employee(id, sal, name, tech);\r\n\t\t\t\temployees.add(employee);\r\n\r\n\t\t\t}\r\n\r\n\t\t} catch (SQLException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn employees;\r\n\r\n\t}", "@ResponseBody\n\t@GetMapping(\"/employees\")\n\tpublic List<Employee> listEmployees() {\n\t\tList<Employee> theEmployees = employeeDAO.getEmployees();\n\t\t\n\t\treturn theEmployees;\n\t}", "public List<EmployeeTO> getAllEmployees() {\n\t\t\r\n\t\treturn EmployeeService.getInstance().getAllEmployees();\r\n\t}", "public ResponseEntity<List<Employee>> getAllEmployees() {\n \tList<Employee> emplist=empService.getAllEmployees();\n\t\t\n\t\tif(emplist==null) {\n\t\t\tthrow new ResourceNotFoundException(\"No Employee Details found\");\n\t\t}\n\t\t\n\t\treturn new ResponseEntity<>(emplist,HttpStatus.OK);\t\t\n }", "public void listEmployees()\n\t{\n\t\tString str = \"Name\\tSurname\\tMail\\tPassword\\tBranchId\\tId\\n\";\n\t\t\n\t\tList<Employee> employees = this.company.getEmployees();\n\n\t\tfor(int i=0; i<employees.length(); i++)\n\t\t{\n\t\t\tstr += employees.get(i).getName() + \"\\t\" + employees.get(i).getSurname() + \"\\t\" + employees.get(i).getMail() + \"\\t\" + employees.get(i).getPassword() + \"\\t\\t\" + employees.get(i).getBranchId() + \"\\t\\t\" + employees.get(i).getId() + \"\\n\";\n\t\t}\n\n\t\tSystem.out.println(str);\n\n\t}", "@Override\r\n\tpublic List<Employee> getAllEmployees() {\n\t\treturn null;\r\n\t}", "public List<Employee> getAllEmployees(){\n\t\tList<Employee> employees = employeeDao.findAll();\n\t\tif(employees != null)\n\t\t\treturn employees;\n\t\treturn null;\n\t}", "public List<Employe> findAllEmployees() {\n\t\treturn null;\n\t}", "List<Employee> findAll();", "@Override\n public List<Employee> getAllEmployees() {\n return null;\n }", "@GetMapping(\"/getEmployees\")\n\t@ResponseBody\n\tpublic List<Employee> getAllEmployees(){\n\t\treturn employeeService.getEmployees();\n\t}", "public List<Employee> getAll() {\n\t\treturn edao.listEmploye();\n\t}", "@Override\n @Transactional\n public List<Employee> getlistEmployee() {\n \tList<Employee> employees = entityManager.createQuery(\"SELECT e FROM Employee e\", Employee.class).getResultList();\n \tfor(Employee p : employees)\n \t\tLOGGER.info(\"employee list::\" + p);\n \treturn employees;\n }", "@GetMapping(\"/emloyees\")\n public List<Employee> all() {\n return employeeRepository.findAll();\n }", "@Override\n\tpublic List<Employee> getAllEmployees() {\n\t\treturn employeeDao.getAllEmployees();\n\t}", "public List<EmployeeDto> retrieveEmployees();", "public List<Employee> getAllEmployeeDetail() {\n\t\treturn dao.getAllEmployeeDetail();\n\t}", "public ViewObjectImpl getEmployees() {\n return (ViewObjectImpl)findViewObject(\"Employees\");\n }", "@Override\n\tpublic List<Employee> getAllEmployees() {\n\t\treturn null;\n\t}", "@Override\n\tpublic List<Employee> getAllEmployees() {\n\t\treturn null;\n\t}", "@Override\r\n\tpublic List<Employee> getAllEmployee() {\n\t\treturn employeeDao.getAllEmployee();\r\n\t}", "@Override\n\tpublic List<EmployeeBean> getAllEmployees() {\n\t\tLOGGER.info(\"starts getAllEmployees method\");\n\t\tLOGGER.info(\"Ends getAllEmployees method\");\n\t\t\n\t\treturn adminEmployeeDao.getAllEmployees();\n\t}", "@SuppressWarnings(\"unchecked\")\n\t\t\n\t\tpublic List<Employee> listEmployee() throws SQLException {\n\t\t\treturn (List<Employee>) employeeDAO.listEmployee();\n\t\t}", "@RequestMapping(value=\"/listEmployees\", method=RequestMethod.GET)\n /* Show list of employees */\n public String listEmployees(Model model) {\n \tList<Employee> employeeList = employeeservice.listAllEmployees();\n\n model.addAttribute(\"employees\", employeeList);\n\n return \"showListEmployees\";\n }", "@Override\r\n\tpublic List<Employe> getEmployes() {\n\t\treturn dao.getEmployes();\r\n\t}", "@Override\r\n\tpublic List<Employee> getdetails() {\n\t\treturn empdao.findAll();\r\n\t}", "@GetMapping(\"/findAllEmployees\")\n\tpublic List<Employee> getAll() {\n\t\treturn testService.getAll();\n\t}", "@Override\n\tpublic List<Emp> findAll() {\n\t\treturn eb.findAll();\n\t}", "@Override\n\tpublic List<Employee> findAllEmployee() {\n\t\treturn null;\n\t}", "public Employee[] getEmployeesList() {\n\t\treturn employees;\n\t}", "@RequestMapping(value=\"/employees/all\", method = RequestMethod.GET)\npublic @ResponseBody List<Employee> employeeListRest(){\n\treturn (List<Employee>) employeerepository.findAll();\n}", "@Override\n\tpublic List<Employee> getAllEmployee() {\n\t\treturn null;\n\t}", "public List<Employee> getEmployees() {\n\n\t\tList<Employee> employees = new ArrayList<Employee>();\n\t\t\n\t\t/*Sample data begins\n\t\tfor (int i = 0; i < 10; i++) {\n\t\t\tEmployee employee = new Employee();\n\t\t\temployee.setEmail(\"[email protected]\");\n\t\t\temployee.setFirstName(\"Shiyong\");\n\t\t\temployee.setLastName(\"Lu\");\n\t\t\temployee.setAddress(\"123 Success Street\");\n\t\t\temployee.setCity(\"Stony Brook\");\n\t\t\temployee.setStartDate(\"2006-10-17\");\n\t\t\temployee.setState(\"NY\");\n\t\t\temployee.setZipCode(11790);\n\t\t\temployee.setTelephone(\"5166328959\");\n\t\t\temployee.setEmployeeID(\"631-413-5555\");\n\t\t\temployee.setHourlyRate(100);\n\t\t\temployees.add(employee);\n\t\t}\n\t\tSample data ends*/\n\t\ttry {\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n\t\t\tConnection con = DriverManager.getConnection(\"jdbc:mysql://mysql3.cs.stonybrook.edu:3306/mwcoulter?useSSL=false\",\"mwcoulter\",\"111030721\");\n\t\t\tStatement st = con.createStatement();\n\t\t\tResultSet rs = st.executeQuery(\"SELECT P.*, E.StartDate, E.HourlyRate, E.Email, E.ID, L.* \"\n\t\t\t\t\t+ \"FROM Employee E, Person P, Location L\"\n\t\t\t\t\t+ \" WHERE P.SSN = E.SSN AND L.ZipCode = P.ZipCode\");\n\t\t\twhile(rs.next()) {\n\t\t\t\tEmployee employee = new Employee();\n\t\t\t\temployee.setEmail(rs.getString(\"Email\"));\n\t\t\t\temployee.setFirstName(rs.getString(\"FirstName\"));\n\t\t\t\temployee.setLastName(rs.getString(\"LastName\"));\n\t\t\t\temployee.setAddress(rs.getString(\"Address\"));\n\t\t\t\temployee.setCity(rs.getString(\"City\"));\n\t\t\t\temployee.setStartDate(String.valueOf(rs.getDate(\"StartDate\")));\n\t\t\t\temployee.setState(rs.getString(\"State\"));\n\t\t\t\temployee.setZipCode(rs.getInt(\"ZipCode\"));\n\t\t\t\temployee.setTelephone(String.valueOf(rs.getLong(\"Telephone\")));\n\t\t\t\temployee.setEmployeeID(String.valueOf(rs.getInt(\"SSN\")));\n\t\t\t\temployee.setHourlyRate(rs.getInt(\"HourlyRate\"));\n\t\t\t\temployees.add(employee);\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(e);\n\t\t}\n\t\t\n\t\treturn employees;\n\t}", "@RequestMapping(value = \"/employeesList\", method = RequestMethod.GET, produces = {\"application/xml\", \"application/json\" })\n\t@ResponseStatus(HttpStatus.OK)\n\tpublic @ResponseBody\n\tEmployeeListVO getListOfAllEmployees() {\n\t\tlog.info(\"ENTERING METHOD :: getListOfAllEmployees\");\n\t\t\n\t\tList<EmployeeVO> employeeVOs = employeeService.getListOfAllEmployees();\n\t\tEmployeeListVO employeeListVO = null;\n\t\tStatusVO statusVO = new StatusVO();\n\t\t\n\t\tif(employeeVOs.size()!=0){\n\t\t\tstatusVO.setCode(AccountantConstants.ERROR_CODE_0);\n\t\t\tstatusVO.setMessage(AccountantConstants.SUCCESS);\n\t\t}else{\n\t\t\tstatusVO.setCode(AccountantConstants.ERROR_CODE_1);\n\t\t\tstatusVO.setMessage(AccountantConstants.NO_RECORDS_FOUND);\n\t\t}\n\t\t\n\t\temployeeListVO = new EmployeeListVO(employeeVOs, statusVO);\n\t\t\n\t\tlog.info(\"EXITING METHOD :: getListOfAllEmployees\");\n\t\treturn employeeListVO;\n\t}", "@GetMapping(\"/all\")\n\tpublic ResponseEntity<List<Employee>> getAllEmployees() {\n\t\tList<Employee> list = service.getAllEmployees();\n\t\treturn new ResponseEntity<List<Employee>>(list, HttpStatus.OK);\n\t}", "@Override\r\n\tpublic List<Employee> findAll() {\n\t\treturn null;\r\n\t}", "public void listEmployees() {\n\t\tSession session = factory.openSession();\n\t\tTransaction transaction = null;\n\t\ttry {\n\t\t\ttransaction = session.beginTransaction();\n\t\t\t@SuppressWarnings(\"rawtypes\")\n\t\t\tList employees = session.createQuery(\"FROM Employee\").list();\n\t\t\tfor (@SuppressWarnings(\"rawtypes\")\n\t\t\tIterator iterator = employees.iterator(); iterator.hasNext();) {\n\t\t\t\tEmployee employee = (Employee) iterator.next();\n\t\t\t\tSystem.out.print(\"First Name: \" + employee.getFirstName());\n\t\t\t\tSystem.out.print(\" Last Name: \" + employee.getLastName());\n\t\t\t\tSystem.out.println(\" Salary: \" + employee.getSalary());\n\t\t\t}\n\t\t\ttransaction.commit();\n\t\t} catch (HibernateException e) {\n\t\t\tif (transaction != null)\n\t\t\t\ttransaction.rollback();\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\tsession.close();\n\t\t}\n\t}", "@Override\r\n\tpublic List<Employee> selectAllEmployee() {\n\t\treturn null;\r\n\t}", "@Override\n\tpublic ResponseEntity<Collection<Employee>> findAll() {\n\t\treturn new ResponseEntity<Collection<Employee>>(empService.findAll(),HttpStatus.OK);\n\t}", "@Transactional(readOnly = true)\r\n\t@SuppressWarnings(\"unchecked\")\r\n\tpublic List<Employee> getAllEmployees() {\r\n\t\treturn em.createQuery(\"select e from Employee e order by e.office_idoffice\").getResultList();\r\n\t}", "@Override\n\tpublic com.ssaga.human.service.List<EmployeeDto> empList() {\n\t\treturn null;\n\t}", "@Override\n\tpublic ArrayList<Employee> getEmpList() throws HrExceptions {\n\t\tSystem.out.println(\"In getEmpList() of Dao\");\n\t\treturn null;\n\t}", "public List<User> getAllEmployees(String companyShortName);", "@SuppressWarnings(\"unchecked\")\r\n\tpublic List<Employee> getAllEmployees() {\r\n\t\tfinal Session session = sessionFactory.getCurrentSession();\t\t\r\n\t\tfinal Query query = session.createQuery(\"from Employee e order by id desc\");\r\n\t\t//Query q = session.createQuery(\"select NAME from Customer\");\r\n\t\t//final List<Employee> employeeList = query.list(); \r\n\t\treturn (List<Employee>) query.list();\r\n\t}", "public List<Employee> getEmployeesOnly() {\n\t\treturn edao.listEmployeOnly();\n\t}", "@Override\n\tpublic List<Employee> getAllEmployee() {\n\t\tList<Employee> employee = new ArrayList<>();\n\t\tlogger.info(\"Getting all employee\");\n\t\ttry {\n\t\t\temployee = employeeDao.getAllEmployee();\n\t\t\tlogger.info(\"Getting all employee = {}\",employee.toString());\n\t\t} catch (Exception exception) {\n\t\t\tlogger.error(exception.getMessage());\n\t\t}\n\t\treturn employee;\n\t}", "public ArrayList<Employee> getEmployeeList()\r\n\t{\r\n\t\treturn new ArrayList<Employee>(empList);\r\n\t}", "Collection<EmployeeDTO> getAll();", "@Override\n\tpublic List<Employee> queryEmp() {\n\t\treturn null;\n\t}", "@Override\n\tpublic void getAllEmployee() {\n\t\t\n\t}", "public List<Employee> listAllCrud(){\n return employeeCrudRepository.findAll();\n }", "@Override\n\tpublic List<Employee> getEmpList() throws EmpException {\n\t\treturn dao.getEmpList();\n\t}", "@Override\n\t@Transactional\n\tpublic List<Employee> getAllEmployees() {\n\t\treturn employeeDao.getAllEmployees();\n\t}", "public List<Empleado> getAll();", "@Override\r\n\tpublic List<Emp> getAll() {\n\t\treturn null;\r\n\t}", "@Override\n\tpublic List<Empdetails> getemplist() {\n\t\treturn empDAO.getemplist();\n\t}", "@GetMapping(\"/get_all_employees\")\n public String getAllEmployees(){\n\n Gson gsonBuilder = new GsonBuilder().create();\n List<Employee> initial_employee_list = employeeService.get_all_employees();\n String jsonFromJavaArray = gsonBuilder.toJson(initial_employee_list);\n\n return jsonFromJavaArray;\n }", "public Vector<Employees> getEmployees() {\n\t\t\tVector<Employees> v = new Vector<Employees>();\n\t\t\ttry {\n\t\t\t\tStatement stmt = conn.createStatement();\n\t\t\t\tResultSet rs = stmt\n\t\t\t\t\t\t.executeQuery(\"select * from employees_details order by employees_pf\");\n\t\t\t\twhile (rs.next()) {\n\t\t\t\t\tint file_num = rs.getInt(1);\n\t\t\t\t\tString name = rs.getString(2);\n\t\t\t\t\tint drive = rs.getInt(3);\n\t\t\t\t\tEmployees employee = new Employees(file_num, name, drive);\n//\t\t\t\t\tCars cars = new Truck(reg, model, drive);\n\t\t\t\t\tv.add(employee);\n\t\t\t\t}\n\t\t\t}\n\t\tcatch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn v;\n\t}", "public List<Employees>getEMPMenaning() {\n\tString sql = \"SELECT Id_employees, Name_and_surname, Password, Work_role FROM employees \";\n\t\n\tList<Employees>list = new ArrayList<Employees>();\n\t\n\ttry {\n\t\tPreparedStatement preparedStatement = ConnectionToTheBase.getConnectionToTheBase().getConnection().prepareStatement(sql);\n\t\tResultSet resultSet = preparedStatement.executeQuery();\n\t\t\n\t\twhile(resultSet.next()) {\n\t\t\tEmployees getEMPMenaning = new Employees();\n\t\t\tgetEMPMenaning.setIdEmployees(resultSet.getInt(\"Id_employees\"));\n\t\t getEMPMenaning.setNameAndSurname(resultSet.getString(\"Name_and_surname\"));\n\t\t getEMPMenaning.setPassword(resultSet.getString(\"Password\"));\n\t\t getEMPMenaning.setWorkRole(resultSet.getInt(\"Work_role\"));\n\t\t \n\t\t\tlist.add(getEMPMenaning);\n\t\t}\n\t} catch (SQLException e) {\n\t\t// TODO Auto-generated catch block\n\t\te.printStackTrace();\n\t}\n\t\n\treturn list;\n\n\n\t\n}", "@GetMapping(value=\"/searchEmpData/{fname}\")\n\tpublic List<Employee> getEmployeeByName(@PathVariable (value = \"fname\") String fname)\n\t{\n\t\treturn integrationClient.getEmployees(fname);\n\t}", "@Override\r\n\tpublic List<EmployeeBean> getAllData() {\n\r\n\t\tEntityManager manager = entityManagerFactory.createEntityManager();\r\n\r\n\t\tString query = \"from EmployeeBean\";\r\n\r\n\t\tjavax.persistence.Query query2 = manager.createQuery(query);\r\n\r\n\t\tList<EmployeeBean> list = query2.getResultList();\r\n\t\tif (list != null) {\r\n\t\t\treturn list;\r\n\t\t} else {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}", "@Transactional\n\tpublic List<Employee> getAllEmployee() {\n\t\treturn accountDao.getAllEmployee();\n\t}", "public List<Employee> selectAllEmployee() {\n\n\t\t// using try-with-resources to avoid closing resources (boiler plate code)\n\t\tList<Employee> emp = new ArrayList<>();\n\t\t// Step 1: Establishing a Connection\n\t\ttry (Connection connection = dbconnection.getConnection();\n\n\t\t\t\t// Step 2:Create a statement using connection object\n\t\t\t\tPreparedStatement preparedStatement = connection.prepareStatement(SELECT_ALL_employe);) {\n\t\t\tSystem.out.println(preparedStatement);\n\t\t\t// Step 3: Execute the query or update query\n\t\t\tResultSet rs = preparedStatement.executeQuery();\n\n\t\t\t// Step 4: Process the ResultSet object.\n\t\t\twhile (rs.next()) {\n\t\t\t\tint id = rs.getInt(\"id\");\n\t\t\t\tString employeename = rs.getString(\"employeename\");\n\t\t\t\tString address = rs.getString(\"address\");\n\t\t\t\tint mobile = rs.getInt(\"mobile\");\n\t\t\t\tString position = rs.getString(\"position\");\n\t\t\t\tint Salary = rs.getInt(\"Salary\");\n\t\t\t\tString joineddate = rs.getString(\"joineddate\");\n\t\t\t\tString filename =rs.getString(\"filename\");\n\t\t\t\tString path = rs.getString(\"path\");\n\t\t\t\temp.add(new Employee(id, employeename, address, mobile, position, Salary, joineddate,filename,path));\n\t\t\t}\n\t\t} catch (SQLException e) {\n\t\t\tdbconnection.printSQLException(e);\n\t\t}\n\t\treturn emp;\n\t}", "public ObservableList<EmployeeEntity> select(){\n return EmployeeDB.getInstance().select();\n }", "@Override\r\n\t\r\n\tpublic List<Employee> getAllDetails()\r\n\t{\r\n\t\t\r\n\t\tList<Employee> empList =hibernateTemplate.loadAll(Employee.class);\r\n\t\t\r\n\t\treturn empList;\r\n\t}" ]
[ "0.831933", "0.8216493", "0.7949293", "0.79490376", "0.79466176", "0.7894043", "0.7852578", "0.78388333", "0.78355175", "0.78196836", "0.7807921", "0.7797291", "0.779688", "0.77910143", "0.77869165", "0.7781991", "0.77559423", "0.77515364", "0.7730138", "0.77196926", "0.7718126", "0.771482", "0.7713571", "0.7700294", "0.7700238", "0.7692558", "0.7675182", "0.7670658", "0.7649215", "0.76302785", "0.76180756", "0.7602783", "0.7600445", "0.7598283", "0.758987", "0.75817966", "0.75729066", "0.7566067", "0.7554249", "0.7531068", "0.7524026", "0.7520804", "0.75143325", "0.7511722", "0.7506795", "0.750614", "0.7501139", "0.74902076", "0.74481255", "0.7444428", "0.74417484", "0.74351734", "0.74136806", "0.7412229", "0.7408455", "0.7408455", "0.7408194", "0.7391941", "0.73769075", "0.7367528", "0.73658186", "0.7357226", "0.7353155", "0.7347519", "0.7340205", "0.73392254", "0.7337801", "0.7327472", "0.73258686", "0.7321124", "0.7318385", "0.7296258", "0.7285983", "0.7276559", "0.7274796", "0.72619486", "0.7259431", "0.7245906", "0.7242145", "0.72303367", "0.72275037", "0.7227408", "0.7211378", "0.72095615", "0.7200619", "0.71832246", "0.7149139", "0.7141882", "0.71231574", "0.70712715", "0.7070418", "0.70625484", "0.7061984", "0.7055192", "0.7048879", "0.7026449", "0.701311", "0.70113033", "0.7002824", "0.6988079", "0.69846416" ]
0.0
-1
=========================================================================================================================== This test case will validate if clicking on School Computed Values link, user navigates to Computed Values Page. Step1 : Click on School Computed Values link visible under the Net Price Tab in home page. Expected Result : Computed Values Page should show up.
@Test(priority = 5) public void TC_05_Validate_SchoolComputedValues_Link_Navigation() { String ScreenshotName = new Object(){}.getClass().getEnclosingMethod().getName(); Reporter.log(cm.ReporterText("TestCase : " + ScreenshotName)); co.click(homePage.schoolComputedValuesLink, "Clicking on School Computed Value Link in Home Page."); String actualText=co.getText(homePage.pageTitle,"Extracting the PageTitle"); cm.captureElementScreenShot(driver, homePage.pageTitle, ScreenshotName, cm.basepath()); Reporter.log(cm.ReporterLink(ScreenshotName)); System.out.println("Asserting the test case"); Assert.assertEquals(actualText, "Computed Values", "The page did not navigate to Computed Values Page."); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test(priority = 99)\r\n@Epic(\"BILLS PAYMENT\")\r\n@Features(value = { @Feature(value = \"SCHOOL FEES PAYMENTS\") })\r\n@Step (\"Verify that system is able to search and display correct school Name school code and Bank branch when user click on search for school functionality\")\r\npublic void Verify_that_system_is_able_to_search_and_display_correct_school_name_school_code_and_Bank_branch_when_user_click_on_search_for_school_functionality() {\n\tdriver.findElement(By.xpath(\"//a[contains(.,'Home')]\")).click();\r\n\tWebDriverWait wait = new WebDriverWait(driver, 15);\r\n\twait.until(ExpectedConditions.visibilityOfElementLocated(By.linkText(\"Bill Payment\")));\r\n\tdriver.findElement(By.linkText(\"Bill Payment\")).click();\r\n\tWebDriverWait wait1 = new WebDriverWait(driver, 15);\r\n\twait1.until(\r\n\t\tExpectedConditions.visibilityOfElementLocated(By.xpath(\"//div[text()=' Institutional Payments ']\")));\r\n\tdriver.findElement(By.xpath(\"//div[text()=' Institutional Payments ']\")).click();\r\n\tdriver.findElement(By.xpath(\"//div[@class='col-in schoolFee']\")).click();\r\n\tdriver.findElement(By.id(\"FORM_SF_SCHOOL_INFO-SEARCH_SCHOOL_BY\")).click();\r\n\t{\r\n\t WebElement dropdown = driver.findElement(By.id(\"FORM_SF_SCHOOL_INFO-SEARCH_SCHOOL_BY\"));\r\n\t dropdown.findElement(By.xpath(\"//option[. = 'Account Number']\")).click();\r\n\t}\r\n\tdriver.findElement(By.id(\"FORM_SF_SCHOOL_INFO-SEARCH_SCHOOL_BY\")).click();\r\n\tdriver.findElement(By.id(\"FORM_SF_SCHOOL_INFO-SF_ACCOUNT_NUMBER\")).click();\r\n\tdriver.findElement(By.id(\"FORM_SF_SCHOOL_INFO-SF_ACCOUNT_NUMBER\")).sendKeys(\"01129080146300\");\r\n\tdriver.findElement(By.id(\"FORM_SF_SCHOOL_INFO-SEARCH_SCHOOL\")).click();\r\n\tdriver.findElement(By.cssSelector(\".ct-formlayout-SCHOOL_NAME .ct-form__ip\")).click();\r\n\tdriver.findElement(By.cssSelector(\".ct-formlayout-SCHOOL_CODE .ct-form__ip\")).click();\r\n\tSystem.out.println(\"TC13 Verify_that_system_is_able_to_search_and_display_correct_school_name_school_code_and_Bank_branch_when_user_click_on_search_for_school_functionality |Success:\");\r\n\r\n\t}", "@Test\n\tpublic void verifycustomerSupportlink() {\n\t\tKeywords.clickOnElement(PropertiesFile.getLocator(\"Spportlink\")[0],PropertiesFile.getLocator(\"Spportlink\")[1]);\n\t\tSystem.out.println(\"24*7 goCare Support link is Displayed on Header\");\n\t\tConstants.driver.manage().timeouts().implicitlyWait(60,TimeUnit.SECONDS) ;\n\t\tKeywords.terminateBrowser();\n\n\t}", "@Test(dataProviderClass = DataProviderUtils.class, dataProvider = \"excelDataReader\", groups = { \"Sprint54\", \"Get Hyperlink\"}, \r\n\t\t\tdescription = \"Listing pane and properties pane only layout will be displayed for hyperlink url on selecting Listing pane and properties pane only layout in configuration and default in hyperlink dialog - Context menu.\")\r\n\tpublic void SprintTest54_1_30_6A_1(HashMap<String,String> dataValues, String driverType) throws Exception {\r\n\r\n\t\tdriver = null; \r\n\r\n\t\ttry {\r\n\r\n\r\n\r\n\r\n\t\t\tdriver = WebDriverUtils.getDriver();\r\n\r\n\t\t\tConcurrentHashMap <String, String> dataPool = new ConcurrentHashMap <String, String>(dataValues);\r\n\t\t\tHomePage homePage = LoginPage.launchDriverAndLogin(driver, true);\r\n\r\n\r\n\t\t\tConfigurationPage configurationPage = LoginPage.launchDriverAndLoginToConfig(driver, true); //Launched driver and logged in\r\n\r\n\t\t\t//Step-1 : Navigate to Vault in tree view\r\n\t\t\t//---------------------------------------\r\n\t\t\tconfigurationPage.treeView.clickTreeViewItem(Caption.ConfigSettings.VaultSpecificSettings.Value + \">>\" + testVault); //Clicks tree view item\r\n\r\n\r\n\t\t\tif (!configurationPage.configurationPanel.getPageName().toUpperCase().equalsIgnoreCase(testVault.toUpperCase())) //Checks if navigated to vault settings page\r\n\t\t\t\tthrow new Exception(\"Vault settings page in configuration is not opened.\");\r\n\r\n\t\t\tLog.message(\"1. Navigated to Vault settings page.\");\r\n\r\n\t\t\t//Step-2 : Select Listing pane and properties pane layout layout and save the settings\r\n\t\t\t//------------------------------------------------------------------------------------------------------------\r\n\t\t\tconfigurationPage.configurationPanel.setLayout(Caption.ConfigSettings.Config_ListingPropertiesPaneOnly.Value); //Sets as Listing pane and properties pane layout\r\n\r\n\t\t\tif (!configurationPage.configurationPanel.getLayout().equalsIgnoreCase(Caption.ConfigSettings.Config_ListingPropertiesPaneOnly.Value)) //Verifies if Listing pane and properties pane layout is selected\r\n\t\t\t\tthrow new Exception(Caption.ConfigSettings.Config_ListingPropertiesPaneOnly.Value + \" layout is not selected.\");\r\n\r\n\t\t\tif (!configurationPage.configurationPanel.saveSettings()) //Saves the settings\r\n\t\t\t\tthrow new Exception(\"Settings are not saved properly.\");\r\n\r\n\t\t\tif (!configurationPage.logOut()) //Logs out from configuration page\r\n\t\t\t\tthrow new Exception(\"Log out is not successful after saving the settings in configuration page.\");\r\n\r\n\t\t\tLog.message(\"2. \" + Caption.ConfigSettings.Config_ListingPropertiesPaneOnly.Value + \" layout is selected and settings are saved.\");\r\n\r\n\t\t\t//Step-3 : Login to the default page and navigate to any view\r\n\t\t\t//-------------------------------------------------------------\r\n\t\t\thomePage = LoginPage.launchDriverAndLogin(driver, false); //Launches and logs into the default page\r\n\r\n\t\t\tString viewToNavigate = SearchPanel.searchOrNavigatetoView(driver, dataPool.get(\"NavigateToView\"), dataPool.get(\"ObjectName\"));\r\n\r\n\t\t\tLog.message(\"3. Logged into the default page and navigated to '\" + viewToNavigate + \"' view.\");\r\n\r\n\t\t\t//Step-4 : Open Get Hyperlink dialog for the object from context menu\r\n\t\t\t//-------------------------------------------------------------------\r\n\t\t\tif (!homePage.listView.rightClickItem(dataPool.get(\"ObjectName\"))) //Selects the Object in the list\r\n\t\t\t\tthrow new Exception(\"Object (\" + dataPool.get(\"ObjectName\") + \") is not got selected.\");\r\n\r\n\t\t\thomePage.listView.clickContextMenuItem(Caption.MenuItems.GetMFilesWebURL.Value); //Selects Get Hyperlink from context menu\r\n\r\n\t\t\tMFilesDialog mfilesDialog = new MFilesDialog(driver); //Instantiating MFilesDialog wrapper class\r\n\r\n\t\t\tif (!mfilesDialog.isGetMFilesWebURLDialogOpened()) //Checks for MFiles dialog title\r\n\t\t\t\tthrow new Exception(\"M-Files dialog with 'Get Hyperlink' title is not opened.\");\r\n\r\n\t\t\tLog.message(\"4. Hyperlink dialog of an object (\" + dataPool.get(\"ObjectName\") + \") is opened through context menu.\");\r\n\r\n\t\t\t//Step-5 : Copy the link from text box and close the Get Hyperlink dialog\r\n\t\t\t//-----------------------------------------------------------------------\r\n\t\t\tString hyperlinkText = mfilesDialog.getHyperlink(); //Gets the hyperlink\r\n\t\t\tmfilesDialog.close(); //Closes the Get Hyperlink dialog\r\n\r\n\t\t\tLog.message(\"5. Hyperlink is copied and Get Hyperlink dialog is closed.\");\r\n\r\n\t\t\t//Step-6 : Open the copied Hyperlink in the browser\r\n\t\t\t//-------------------------------------------------\r\n\t\t\thomePage = Utility.navigateToPage(driver, hyperlinkText, userName, password, \"\"); //Navigates to the hyperlink url\r\n\r\n\r\n\t\t\tif (!driver.getCurrentUrl().equalsIgnoreCase(hyperlinkText))\r\n\t\t\t\tthrow new Exception (\"Browser is not opened with copied object Hyperlink.[Expected URL: \"+hyperlinkText+\" & Current URL : \"+ driver.getCurrentUrl() +\"]\");\r\n\r\n\t\t\tLog.message(\"6. Object Hyperlink is opened in the browser.\");\r\n\r\n\t\t\t//Verification : Verify if default layout is displayed\r\n\t\t\t//----------------------------------------------------\r\n\t\t\tString unAvailableLayouts = \"\";\r\n\r\n\t\t\tif (homePage.isSearchbarPresent()) //Checks if Search bar present\r\n\t\t\t\tunAvailableLayouts = \"Search Bar is available;\";\r\n\r\n\t\t\tif (homePage.isTaskPaneDisplayed()) //Checks if Task Pane present\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Task Pane is available;\";\r\n\r\n\t\t\tif (!homePage.previewPane.isTabExists(Caption.PreviewPane.MetadataTab.Value))\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Properties Pane is not available;\";\r\n\r\n\t\t\tif (homePage.menuBar.isMenuInMenubarDisplayed()) //Checks if Menu Bar present\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Menu Bar is available;\";\r\n\r\n\t\t\tif (homePage.menuBar.isBreadCrumbDisplayed()) //Checks if Breadcrumb present\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Breadcrumb is available;\";\r\n\r\n\t\t\tif (homePage.taskPanel.isAppletEnabled())\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Java Applet is available;\";\r\n\r\n\t\t\tif (!homePage.isListViewDisplayed())\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"List View is not available;\";\r\n\r\n\t\t\tif (homePage.isTreeViewDisplayed())\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Tree View is available;\";\r\n\r\n\t\t\tif (unAvailableLayouts.equals(\"\")) //Verifies default layout have selected default custom layout\r\n\t\t\t\tLog.pass(\"Test case Passed. Hyperlink URL page is displayed as .\" + Caption.ConfigSettings.Config_ListingPropertiesPaneOnly.Value);\r\n\t\t\telse\r\n\t\t\t\tLog.fail(\"Test case Failed. Few layots are not as expected on selecting \" + Caption.ConfigSettings.Config_ListingPropertiesPaneOnly.Value + \". Refer additional information : \" \r\n\t\t\t\t\t\t+ unAvailableLayouts, driver);\r\n\t\t}\r\n\t\tcatch (Exception e) {\r\n\t\t\tLog.exception(e, driver);\r\n\t\t} //End catch\r\n\r\n\t\tfinally {\r\n\r\n\t\t\tif(driver != null){\r\n\t\t\t\ttry\r\n\t\t\t\t{\r\n\t\t\t\t\tdriver.get(configURL);\r\n\r\n\t\t\t\t\tConfigurationPage configurationPage = new ConfigurationPage(driver);\r\n\t\t\t\t\tconfigurationPage.treeView.clickTreeViewItem(Caption.ConfigSettings.VaultSpecificSettings.Value + \">>\" + testVault); //Clicks tree view item\r\n\r\n\t\t\t\t\tconfigurationPage.configurationPanel.setLayout(Caption.ConfigSettings.Config_Default.Value);\r\n\r\n\t\t\t\t\tif (!configurationPage.configurationPanel.saveSettings())\r\n\t\t\t\t\t\tthrow new Exception(\"Configuration settings are not saved.\");\r\n\t\t\t\t}\r\n\t\t\t\tcatch(Exception e0)\r\n\t\t\t\t{\r\n\t\t\t\t\tLog.exception(e0, driver);\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t\tUtility.quitDriver(driver);\r\n\r\n\t\t} //End finally\r\n\r\n\t}", "public void VerifyHomepage(){\r\n\t\t//String username = getValue(Email);\r\n\t//\tString password = getValue(Password);\r\n\r\n\t//\tclass Local {};\r\n\t\t/*Reporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- My Account should be clicked and user should get logged in\");*/\r\n\t\ttry{\r\n\t\t\tsleep(3000);\r\n\t\t\t//driver.findElement(locator_split(\"btn_privacyok\")).click();\r\n\t\tclick(locator_split(\"btn_privacyok\"));\r\n\t\t\t\r\n\t\t\t/*Reporter.log(\"PASS_MESSAGE:- My Account is clicked and user is logged in\");*/\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- User is not logged in\");\r\n\t\t\tthrow new NoSuchElementException(\"The element with\"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"LoginLogout\")\r\n\t\t\t\t\t+ \" not found\");\r\n\r\n\t\t}\r\n\r\n\t}", "@Test(dataProviderClass = DataProviderUtils.class, dataProvider = \"excelDataReader\", groups = { \"Sprint54\", \"Get Hyperlink\"}, \r\n\t\t\tdescription = \"No Java applet and no task area (but show 'Go To' shortcuts) layout will be displayed for hyperlink url on selecting No Java applet and no task area (but show 'Go To' shortcuts) layout in configuration and default in hyperlink dialog - Context menu.\")\r\n\tpublic void SprintTest54_1_30_5A_1A(HashMap<String,String> dataValues, String driverType) throws Exception {\r\n\r\n\t\tdriver = null; \r\n\r\n\t\ttry {\r\n\r\n\r\n\r\n\r\n\t\t\tdriver = WebDriverUtils.getDriver();\r\n\r\n\t\t\tConcurrentHashMap <String, String> dataPool = new ConcurrentHashMap <String, String>(dataValues);\r\n\t\t\tHomePage homePage = LoginPage.launchDriverAndLogin(driver, true);\r\n\r\n\r\n\t\t\tConfigurationPage configurationPage = LoginPage.launchDriverAndLoginToConfig(driver, true); //Launched driver and logged in\r\n\r\n\t\t\t//Step-1 : Navigate to Vault in tree view\r\n\t\t\t//---------------------------------------\r\n\t\t\tconfigurationPage.treeView.clickTreeViewItem(Caption.ConfigSettings.VaultSpecificSettings.Value + \">>\" + testVault); //Clicks tree view item\r\n\r\n\r\n\t\t\tif (!configurationPage.configurationPanel.getPageName().toUpperCase().equalsIgnoreCase(testVault.toUpperCase())) //Checks if navigated to vault settings page\r\n\t\t\t\tthrow new Exception(\"Vault settings page in configuration is not opened.\");\r\n\r\n\t\t\tLog.message(\"1. Navigated to Vault settings page.\");\r\n\r\n\t\t\t//Step-2 : Select No Java applet and No task area but show Go to shortcuts layout layout and save the settings\r\n\t\t\t//------------------------------------------------------------------------------------------------------------\r\n\t\t\tconfigurationPage.configurationPanel.setJavaApplet(Caption.ConfigSettings.Config_Disable.Value);\r\n\r\n\t\t\tif(configurationPage.configurationPanel.isJavaAppletEnabled())\r\n\t\t\t\tthrow new Exception(\"Java applet is enabled\");\r\n\r\n\t\t\tconfigurationPage.configurationPanel.setLayout(Caption.ConfigSettings.Config_TaskAreaWithShowGoTo.Value);\r\n\r\n\t\t\tif (!configurationPage.configurationPanel.saveSettings()) //Save the settings\r\n\t\t\t\tthrow new Exception(\"Configuration settings are not saved after changing its layout.\");\r\n\r\n\t\t\tLog.message(\"2. No java applet with task area with go to layout is selected and saved.\");\r\n\r\n\t\t\tif (!configurationPage.logOut()) //Logs out from configuration page\r\n\t\t\t\tthrow new Exception(\"Log out is not successful after saving the settings in configuration page.\");\r\n\r\n\t\t\tLog.message(\"2. \" + Caption.ConfigSettings.Config_TaskAreaWithShowGoTo.Value + \" layout is selected and settings are saved.\");\r\n\r\n\t\t\t//Step-3 : Login to the default page and navigate to any view\r\n\t\t\t//-------------------------------------------------------------\r\n\t\t\thomePage = LoginPage.launchDriverAndLogin(driver, false); //Launches and logs into the default page\r\n\r\n\t\t\tString viewToNavigate = SearchPanel.searchOrNavigatetoView(driver, dataPool.get(\"NavigateToView\"), dataPool.get(\"ObjectName\"));\r\n\r\n\t\t\tLog.message(\"3. Logged into the default page and navigated to '\" + viewToNavigate + \"' view.\");\r\n\r\n\t\t\t//Step-4 : Open Get Hyperlink dialog for the object from context menu\r\n\t\t\t//-------------------------------------------------------------------\r\n\t\t\tif (!homePage.listView.rightClickItem(dataPool.get(\"ObjectName\"))) //Selects the Object in the list\r\n\t\t\t\tthrow new Exception(\"Object (\" + dataPool.get(\"ObjectName\") + \") is not got selected.\");\r\n\r\n\t\t\thomePage.listView.clickContextMenuItem(Caption.MenuItems.GetMFilesWebURL.Value); //Selects Get Hyperlink from context menu\r\n\r\n\t\t\tMFilesDialog mfilesDialog = new MFilesDialog(driver); //Instantiating MFilesDialog wrapper class\r\n\r\n\t\t\tif (!mfilesDialog.isGetMFilesWebURLDialogOpened()) //Checks for MFiles dialog title\r\n\t\t\t\tthrow new Exception(\"M-Files dialog with 'Get Hyperlink' title is not opened.\");\r\n\r\n\t\t\tLog.message(\"4. Hyperlink dialog of an object (\" + dataPool.get(\"ObjectName\") + \") is opened through context menu.\");\r\n\r\n\t\t\t//Step-5 : Copy the link from text box and close the Get Hyperlink dialog\r\n\t\t\t//-----------------------------------------------------------------------\r\n\t\t\tString hyperlinkText = mfilesDialog.getHyperlink(); //Gets the hyperlink\r\n\t\t\tmfilesDialog.close(); //Closes the Get Hyperlink dialog\r\n\r\n\t\t\tLog.message(\"5. Hyperlink is copied and Get Hyperlink dialog is closed.\");\r\n\r\n\t\t\t//Step-6 : Open the copied Hyperlink in the browser\r\n\t\t\t//-------------------------------------------------\r\n\t\t\thomePage = Utility.navigateToPage(driver, hyperlinkText, userName, password, \"\"); //Navigates to the hyperlink url\r\n\r\n\r\n\t\t\tif (!driver.getCurrentUrl().equalsIgnoreCase(hyperlinkText))\r\n\t\t\t\tthrow new Exception (\"Browser is not opened with copied object Hyperlink.[Expected URL: \"+hyperlinkText+\" & Current URL : \"+ driver.getCurrentUrl() +\"]\");\r\n\r\n\t\t\tLog.message(\"6. Object Hyperlink is opened in the browser.\");\r\n\r\n\t\t\t//Verification : Verify if default layout is displayed\r\n\t\t\t//----------------------------------------------------\r\n\t\t\tString unAvailableLayouts = \"\";\r\n\r\n\t\t\tif (!homePage.isSearchbarPresent()) //Checks if Search bar present\r\n\t\t\t\tunAvailableLayouts = \"Search Bar is not available;\";\r\n\r\n\t\t\tif (homePage.isTaskPaneDisplayed()) //Checks if Task Pane present\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Task Pane is available;\";\r\n\r\n\t\t\tif (!homePage.taskPanel.isTaskPaneGoToDisplayed()) //Checks if Task Pane GoTo present\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Task Pane GoTo is not available;\";\r\n\r\n\t\t\tif (!homePage.previewPane.isTabExists(Caption.PreviewPane.MetadataTab.Value))\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Properties Pane is not available;\";\r\n\r\n\t\t\tif (!homePage.menuBar.isMenuInMenubarDisplayed()) //Checks if Menu Bar present\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Menu Bar is not available;\";\r\n\r\n\t\t\tif (!homePage.menuBar.isBreadCrumbDisplayed()) //Checks if Breadcrumb present\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Breadcrumb is not available;\";\r\n\r\n\t\t\tif (homePage.taskPanel.isAppletEnabled())\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Java Applet is available;\";\r\n\r\n\t\t\tif (!homePage.isListViewDisplayed())\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"List View is not available;\";\r\n\r\n\t\t\tif (homePage.isTreeViewDisplayed())\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Tree View is available;\";\r\n\r\n\t\t\tif (unAvailableLayouts.equals(\"\")) //Verifies default layout have selected default custom layout\r\n\t\t\t\tLog.pass(\"Test case Passed. Hyperlink URL page is displayed as .\" + Caption.ConfigSettings.Config_TaskAreaWithShowGoTo.Value);\r\n\t\t\telse\r\n\t\t\t\tLog.fail(\"Test case Failed. Few layots are not as expected on selecting \" + Caption.ConfigSettings.Config_TaskAreaWithShowGoTo.Value + \". Refer additional information : \" \r\n\t\t\t\t\t\t+ unAvailableLayouts, driver);\r\n\t\t}\r\n\t\tcatch (Exception e) {\r\n\t\t\tLog.exception(e, driver);\r\n\t\t} //End catch\r\n\r\n\t\tfinally {\r\n\r\n\t\t\tif(driver != null){\r\n\t\t\t\ttry\r\n\t\t\t\t{\r\n\t\t\t\t\tdriver.get(configURL);\r\n\r\n\t\t\t\t\tConfigurationPage configurationPage = new ConfigurationPage(driver);\r\n\t\t\t\t\tconfigurationPage.treeView.clickTreeViewItem(Caption.ConfigSettings.VaultSpecificSettings.Value + \">>\" + testVault); //Clicks tree view item\r\n\r\n\t\t\t\t\tconfigurationPage.configurationPanel.setLayout(Caption.ConfigSettings.Config_Default.Value);\r\n\r\n\t\t\t\t\tif (!configurationPage.configurationPanel.saveSettings())\r\n\t\t\t\t\t\tthrow new Exception(\"Configuration settings are not saved.\");\r\n\t\t\t\t}\r\n\t\t\t\tcatch(Exception e0)\r\n\t\t\t\t{\r\n\t\t\t\t\tLog.exception(e0, driver);\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t\tUtility.quitDriver(driver);\r\n\r\n\t\t} //End finally\r\n\r\n\t}", "@Test(dataProviderClass = DataProviderUtils.class, dataProvider = \"excelDataReader\", groups = { \"Sprint54\", \"Get Hyperlink\"}, \r\n\t\t\tdescription = \"No Java applet and no task area layout will be displayed for hyperlink url on selecting No Java applet and no task area layout in configuration and default in hyperlink dialog - Context menu.\")\r\n\tpublic void SprintTest54_1_30_4A_1A(HashMap<String,String> dataValues, String driverType) throws Exception {\r\n\r\n\t\tdriver = null; \r\n\r\n\t\ttry {\r\n\r\n\r\n\r\n\t\t\tdriver = WebDriverUtils.getDriver();\r\n\r\n\t\t\tConcurrentHashMap <String, String> dataPool = new ConcurrentHashMap <String, String>(dataValues);\r\n\t\t\tHomePage homePage = LoginPage.launchDriverAndLogin(driver, true);\r\n\r\n\r\n\t\t\tConfigurationPage configurationPage = LoginPage.launchDriverAndLoginToConfig(driver, true); //Launched driver and logged in\r\n\r\n\t\t\t//Step-1 : Navigate to Vault in tree view\r\n\t\t\t//---------------------------------------\r\n\t\t\tconfigurationPage.treeView.clickTreeViewItem(Caption.ConfigSettings.VaultSpecificSettings.Value + \">>\" + testVault); //Clicks tree view item\r\n\r\n\r\n\t\t\tif (!configurationPage.configurationPanel.getPageName().toUpperCase().equalsIgnoreCase(testVault.toUpperCase())) //Checks if navigated to vault settings page\r\n\t\t\t\tthrow new Exception(\"Vault settings page in configuration is not opened.\");\r\n\r\n\t\t\tLog.message(\"1. Navigated to Vault settings page.\");\r\n\r\n\t\t\t//Step-2 : Select No Java applet and No task area layout layout and save the settings\r\n\t\t\t//--------------------------------------------------------------------\r\n\t\t\tconfigurationPage.configurationPanel.setJavaApplet(Caption.ConfigSettings.Config_Disable.Value);\r\n\r\n\t\t\tif(configurationPage.configurationPanel.isJavaAppletEnabled())\r\n\t\t\t\tthrow new Exception(\"Java applet is enabled\");\r\n\r\n\t\t\tconfigurationPage.configurationPanel.setLayout(Caption.ConfigSettings.Config_NoTaskArea.Value);\r\n\r\n\t\t\tif (!configurationPage.configurationPanel.saveSettings()) //Save the settings\r\n\t\t\t\tthrow new Exception(\"Configuration settings are not saved after changing its layout.\");\r\n\r\n\t\t\tLog.message(\"1. No java applet and no task area layout is selected and saved.\");\r\n\r\n\t\t\tif (!configurationPage.logOut()) //Logs out from configuration page\r\n\t\t\t\tthrow new Exception(\"Log out is not successful after saving the settings in configuration page.\");\r\n\r\n\t\t\tLog.message(\"2. Logout from the configuration page.\");\r\n\r\n\t\t\t//Step-3 : Login to the default page and navigate to any view\r\n\t\t\t//--------------------------------------------------------------------------\r\n\t\t\thomePage = LoginPage.launchDriverAndLogin(driver, false); //Launches and logs into the default page\r\n\r\n\t\t\tString viewToNavigate = SearchPanel.searchOrNavigatetoView(driver, dataPool.get(\"NavigateToView\"), dataPool.get(\"ObjectName\"));\r\n\r\n\t\t\tLog.message(\"3. Logged into the default page and navigated to '\" + viewToNavigate + \"' view.\");\r\n\r\n\t\t\t//Step-4 : Open Get Hyperlink dialog for the object from context menu\r\n\t\t\t//-------------------------------------------------------------------\r\n\t\t\tif (!homePage.listView.rightClickItem(dataPool.get(\"ObjectName\"))) //Selects the Object in the list\r\n\t\t\t\tthrow new Exception(\"Object (\" + dataPool.get(\"ObjectName\") + \") is not got selected.\");\r\n\r\n\t\t\thomePage.listView.clickContextMenuItem(Caption.MenuItems.GetMFilesWebURL.Value); //Selects Get Hyperlink from context menu\r\n\r\n\t\t\tMFilesDialog mfilesDialog = new MFilesDialog(driver); //Instantiating MFilesDialog wrapper class\r\n\r\n\t\t\tif (!mfilesDialog.isGetMFilesWebURLDialogOpened()) //Checks for MFiles dialog title\r\n\t\t\t\tthrow new Exception(\"M-Files dialog with 'Get Hyperlink' title is not opened.\");\r\n\r\n\t\t\tLog.message(\"4. Hyperlink dialog of an object (\" + dataPool.get(\"ObjectName\") + \") is opened through context menu.\");\r\n\r\n\t\t\t//Step-5 : Copy the link from text box and close the Get Hyperlink dialog\r\n\t\t\t//-----------------------------------------------------------------------\r\n\t\t\tString hyperlinkText = mfilesDialog.getHyperlink(); //Gets the hyperlink\r\n\t\t\tmfilesDialog.close(); //Closes the Get Hyperlink dialog\r\n\r\n\t\t\tLog.message(\"5. Hyperlink is copied and Get Hyperlink dialog is closed.\");\r\n\r\n\t\t\t//Step-6 : Open the copied Hyperlink in the browser\r\n\t\t\t//-------------------------------------------------\r\n\t\t\thomePage = Utility.navigateToPage(driver, hyperlinkText, userName, password, \"\"); //Navigates to the hyperlink url\r\n\r\n\r\n\t\t\tif (!driver.getCurrentUrl().equalsIgnoreCase(hyperlinkText))\r\n\t\t\t\tthrow new Exception (\"Browser is not opened with copied object Hyperlink.[Expected URL: \"+hyperlinkText+\" & Current URL : \"+ driver.getCurrentUrl() +\"]\");\r\n\r\n\t\t\tLog.message(\"6. Object Hyperlink is opened in the browser.\");\r\n\r\n\t\t\t//Verification : Verify if default layout is displayed\r\n\t\t\t//----------------------------------------------------\r\n\t\t\tString unAvailableLayouts = \"\";\r\n\r\n\t\t\tif (!homePage.isSearchbarPresent()) //Checks if Search bar present\r\n\t\t\t\tunAvailableLayouts = \"Search Bar is not available;\";\r\n\r\n\t\t\tif (homePage.isTaskPaneDisplayed()) //Checks if Task Pane present\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Task Pane is available;\";\r\n\r\n\t\t\tif (!homePage.previewPane.isTabExists(Caption.PreviewPane.MetadataTab.Value))\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Properties Pane is not available;\";\r\n\r\n\t\t\tif (!homePage.menuBar.isMenuInMenubarDisplayed()) //Checks if Menu Bar present\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Menu Bar is not available;\";\r\n\r\n\t\t\tif (!homePage.menuBar.isBreadCrumbDisplayed()) //Checks if Breadcrumb present\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Breadcrumb is not available;\";\r\n\r\n\t\t\tif (homePage.taskPanel.isAppletEnabled())\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Java Applet is available;\";\r\n\r\n\t\t\tif (!homePage.isListViewDisplayed())\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"List View is not available;\";\r\n\r\n\t\t\tif (homePage.isTreeViewDisplayed())\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Tree View is available;\";\r\n\r\n\t\t\tif (unAvailableLayouts.equals(\"\")) //Verifies default layout have selected default custom layout\r\n\t\t\t\tLog.pass(\"Test case Passed. Hyperlink URL page is displayed as No java applet and No task area layout\");\r\n\t\t\telse\r\n\t\t\t\tLog.fail(\"Test case Failed. Few layots are not as expected on selecting No java applet and No task area layout\"\r\n\t\t\t\t\t\t+ unAvailableLayouts, driver);\r\n\t\t}\r\n\t\tcatch (Exception e) {\r\n\t\t\tLog.exception(e, driver);\r\n\t\t} //End catch\r\n\r\n\t\tfinally {\r\n\r\n\t\t\tif(driver != null){\r\n\t\t\t\ttry\r\n\t\t\t\t{\r\n\t\t\t\t\tdriver.get(configURL);\r\n\r\n\t\t\t\t\tConfigurationPage configurationPage = new ConfigurationPage(driver);\r\n\t\t\t\t\tconfigurationPage.treeView.clickTreeViewItem(Caption.ConfigSettings.VaultSpecificSettings.Value + \">>\" + testVault); //Clicks tree view item\r\n\r\n\t\t\t\t\tconfigurationPage.configurationPanel.setLayout(Caption.ConfigSettings.Config_Default.Value);\r\n\r\n\t\t\t\t\tif (!configurationPage.configurationPanel.saveSettings())\r\n\t\t\t\t\t\tthrow new Exception(\"Configuration settings are not saved.\");\r\n\t\t\t\t}\r\n\t\t\t\tcatch(Exception e0)\r\n\t\t\t\t{\r\n\t\t\t\t\tLog.exception(e0, driver);\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t\tUtility.quitDriver(driver);\r\n\r\n\t\t} //End finally\r\n\r\n\t}", "@Test(priority = 1, description = \"Test case to verify Test Scenario 1\")\n\tpublic void testScenario1() {\n\t\tw.findElement(By.id(\"amount\")).sendKeys(\"100000\");\n\n\t\t// 2. Rate of Interest (%) as \"9\"\n\t\tw.findElement(By.id(\"rate\")).sendKeys(\"9\");\n\n\t\t// 3. Period (Years) as \"2\"\n\t\tw.findElement(By.id(\"years\")).sendKeys(\"2\");\n\n\t\t// Click on \"Submit\" button\n\t\tw.findElement(By.cssSelector(\"input[name='calculate']\")).click();\n\n\t\t// Verify / Validate below value under \"EMI CALCULATOR REPORT”:\n\n\t\tString emiCalReport1 = w.findElement(By.xpath(\"//*[@id=\\\"hpcontentbox\\\"]/div[5]/div[1]/div[1]/div[4]/div/div[1]\")).getText();\n\t\tAssert.assertTrue(true);\n\t\tSystem.out.println(\"\\n\");\n\t\tSystem.out.println(\"EMI CALCULATOR REPORT 1: \" + \"\\n\" + emiCalReport1);\n\n\t}", "public void cashondelivery_submit(){\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- shopping cart link should be clicked\");\r\n\t\ttry{\r\n\r\n\t\t\twaitforElementVisible(locator_split(\"cashondelivery\"));\r\n\t\t\tclick(locator_split(\"cashondelivery\"));\r\n\t\t\twaitForPageToLoad(100);\r\n\t\t\twaitforElementVisible(locator_split(\"submitorder\"));\r\n\t\t\tclick(locator_split(\"submitorder\"));\r\n\t\t\twaitForPageToLoad(20);\r\n\t\t\tSystem.out.println(\"shopping cart link is clicked.\");\r\n\t\t\tReporter.log(\"PASS_MESSAGE:- shopping cart link is clicked\");\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- shopping cart link is not clicked \");\r\n\t\t\tthrow new NoSuchElementException(\"The element with\"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"submitorder\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ \" not found\");\r\n\t\t}\r\n\r\n\t}", "@Test(description = \"Test to validate the EMI feature with different tenure and interest rate\", priority = 0)\n\tpublic void UserStory2() throws HeadlessException, AWTException, IOException, InterruptedException\n\t{\n\t\tLoanCalculatorPage loan_cal = new LoanCalculatorPage();\n\t\tloan_cal.validateCalHomePage();\n\t\t//testLog.log(Status.INFO, \"Loan calculator page launched\");\n\n\t\t\n\t\tint testCaseID = 3;\n\t\t\n\t\t//Enter the values in calculator and validate output\n\t\tloan_cal.ValidateDetails(loan_cal.GetEMI(testCaseID));\n\t\t\n\t}", "@Test(dataProviderClass = DataProviderUtils.class, dataProvider = \"excelDataReader\", groups = { \"Sprint54\", \"Get Hyperlink\"}, \r\n\t\t\tdescription = \"No Java applet and no task area (but show 'Go To' shortcuts) layout will be displayed for hyperlink url on selecting No Java applet and no task area (but show 'Go To' shortcuts) layout in configuration and default in hyperlink dialog - Operations menu.\")\r\n\tpublic void SprintTest54_1_30_5A_1B(HashMap<String,String> dataValues, String driverType) throws Exception {\r\n\r\n\t\tdriver = null; \r\n\r\n\t\ttry {\r\n\r\n\r\n\r\n\r\n\t\t\tdriver = WebDriverUtils.getDriver();\r\n\r\n\r\n\t\t\tConcurrentHashMap <String, String> dataPool = new ConcurrentHashMap <String, String>(dataValues);\r\n\t\t\tConfigurationPage configurationPage = LoginPage.launchDriverAndLoginToConfig(driver, true); //Launched driver and logged in\r\n\r\n\t\t\t//Step-1 : Navigate to Vault in tree view\r\n\t\t\t//---------------------------------------\r\n\t\t\tconfigurationPage.treeView.clickTreeViewItem(Caption.ConfigSettings.VaultSpecificSettings.Value + \">>\" + testVault); //Clicks tree view item\r\n\r\n\r\n\t\t\tif (!configurationPage.configurationPanel.getPageName().toUpperCase().equalsIgnoreCase(testVault.toUpperCase())) //Checks if navigated to vault settings page\r\n\t\t\t\tthrow new Exception(\"Vault settings page in configuration is not opened.\");\r\n\r\n\t\t\tLog.message(\"1. Navigated to Vault settings page.\");\r\n\r\n\t\t\t//Step-2 : Select No Java applet and No task area but show Go to shortcuts layout layout and save the settings\r\n\t\t\t//------------------------------------------------------------------------------------------------------------\r\n\t\t\tconfigurationPage.configurationPanel.setJavaApplet(Caption.ConfigSettings.Config_Disable.Value);\r\n\r\n\t\t\tif(configurationPage.configurationPanel.isJavaAppletEnabled())\r\n\t\t\t\tthrow new Exception(\"Java applet is enabled\");\r\n\r\n\t\t\tconfigurationPage.configurationPanel.setLayout(Caption.ConfigSettings.Config_TaskAreaWithShowGoTo.Value);\r\n\r\n\t\t\tif (!configurationPage.configurationPanel.saveSettings()) //Save the settings\r\n\t\t\t\tthrow new Exception(\"Configuration settings are not saved after changing its layout.\");\r\n\r\n\t\t\tLog.message(\"1. No java applet with task area with go to layout is selected and saved.\");\r\n\r\n\t\t\tif (!configurationPage.logOut()) //Logs out from configuration page\r\n\t\t\t\tthrow new Exception(\"Log out is not successful after saving the settings in configuration page.\");\r\n\r\n\t\t\tLog.message(\"2. \" + Caption.ConfigSettings.Config_TaskAreaWithShowGoTo.Value + \" layout is selected and settings are saved.\");\r\n\r\n\t\t\t//Step-3 : Login to the default page and navigate to any view\r\n\t\t\t//-------------------------------------------------------------\r\n\t\t\tHomePage homePage = LoginPage.launchDriverAndLogin(driver, false); //Launches and logs into the default page\r\n\r\n\t\t\tString viewToNavigate = SearchPanel.searchOrNavigatetoView(driver, dataPool.get(\"NavigateToView\"), dataPool.get(\"ObjectName\"));\r\n\r\n\t\t\tLog.message(\"3. Logged into the default page and navigated to '\" + viewToNavigate + \"' view.\");\r\n\r\n\t\t\t//Step-4 : Open Get Hyperlink dialog for the object from operations menu\r\n\t\t\t//-----------------------------------------------------------------------\r\n\t\t\tif (!homePage.listView.clickItem(dataPool.get(\"ObjectName\"))) //Selects the Object in the list\r\n\t\t\t\tthrow new Exception(\"Object (\" + dataPool.get(\"ObjectName\") + \") is not got selected.\");\r\n\r\n\t\t\thomePage.menuBar.ClickOperationsMenu(Caption.MenuItems.GetMFilesWebURL.Value); //Selects Get Hyperlink from operations menu\r\n\r\n\t\t\tMFilesDialog mfilesDialog = new MFilesDialog(driver); //Instantiating MFilesDialog wrapper class\r\n\r\n\t\t\tif (!mfilesDialog.isGetMFilesWebURLDialogOpened()) //Checks for MFiles dialog title\r\n\t\t\t\tthrow new Exception(\"M-Files dialog with 'Get Hyperlink' title is not opened.\");\r\n\r\n\t\t\tLog.message(\"4. Hyperlink dialog of an object (\" + dataPool.get(\"ObjectName\") + \") is opened through operations menu.\");\r\n\r\n\t\t\t//Step-5 : Copy the link from text box and close the Get Hyperlink dialog\r\n\t\t\t//-----------------------------------------------------------------------\r\n\t\t\tString hyperlinkText = mfilesDialog.getHyperlink(); //Gets the hyperlink\r\n\t\t\tmfilesDialog.close(); //Closes the Get Hyperlink dialog\r\n\r\n\t\t\tLog.message(\"5. Hyperlink is copied and Get Hyperlink dialog is closed.\");\r\n\r\n\t\t\t//Step-6 : Open the copied Hyperlink in the browser\r\n\t\t\t//-------------------------------------------------\r\n\t\t\thomePage = Utility.navigateToPage(driver, hyperlinkText, userName, password, \"\"); //Navigates to the hyperlink url\r\n\r\n\r\n\t\t\tif (!driver.getCurrentUrl().equalsIgnoreCase(hyperlinkText))\r\n\t\t\t\tthrow new Exception (\"Browser is not opened with copied object Hyperlink.[Expected URL: \"+hyperlinkText+\" & Current URL : \"+ driver.getCurrentUrl() +\"]\");\r\n\r\n\t\t\tLog.message(\"6. Object Hyperlink is opened in the browser.\");\r\n\r\n\t\t\t//Verification : Verify if default layout is displayed\r\n\t\t\t//----------------------------------------------------\r\n\t\t\tString unAvailableLayouts = \"\";\r\n\r\n\t\t\tif (!homePage.isSearchbarPresent()) //Checks if Search bar present\r\n\t\t\t\tunAvailableLayouts = \"Search Bar is not available;\";\r\n\r\n\t\t\tif (homePage.isTaskPaneDisplayed()) //Checks if Task Pane present\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Task Pane is available;\";\r\n\r\n\t\t\tif (!homePage.taskPanel.isTaskPaneGoToDisplayed()) //Checks if Task Pane GoTo present\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Task Pane GoTo is not available;\";\r\n\r\n\t\t\tif (!homePage.previewPane.isTabExists(Caption.PreviewPane.MetadataTab.Value))\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Properties Pane is not available;\";\r\n\r\n\t\t\tif (!homePage.menuBar.isMenuInMenubarDisplayed()) //Checks if Menu Bar present\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Menu Bar is not available;\";\r\n\r\n\t\t\tif (!homePage.menuBar.isBreadCrumbDisplayed()) //Checks if Breadcrumb present\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Breadcrumb is not available;\";\r\n\r\n\t\t\tif (homePage.taskPanel.isAppletEnabled())\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Java Applet is available;\";\r\n\r\n\t\t\tif (!homePage.isListViewDisplayed())\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"List View is not available;\";\r\n\r\n\t\t\tif (homePage.isTreeViewDisplayed())\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Tree View is available;\";\r\n\r\n\t\t\tif (unAvailableLayouts.equals(\"\")) //Verifies default layout have selected default custom layout\r\n\t\t\t\tLog.pass(\"Test case Passed. Hyperlink URL page is displayed as .\" + Caption.ConfigSettings.Config_TaskAreaWithShowGoTo.Value);\r\n\t\t\telse\r\n\t\t\t\tLog.fail(\"Test case Failed. Few layots are not as expected on selecting \" + Caption.ConfigSettings.Config_TaskAreaWithShowGoTo.Value + \". Refer additional information : \" \r\n\t\t\t\t\t\t+ unAvailableLayouts, driver);\r\n\t\t}\r\n\t\tcatch (Exception e) {\r\n\t\t\tLog.exception(e, driver);\r\n\t\t} //End catch\r\n\r\n\t\tfinally {\r\n\r\n\t\t\tif(driver != null){\r\n\t\t\t\ttry\r\n\t\t\t\t{\r\n\t\t\t\t\tdriver.get(configURL);\r\n\r\n\t\t\t\t\tConfigurationPage configurationPage = new ConfigurationPage(driver);\r\n\t\t\t\t\tconfigurationPage.treeView.clickTreeViewItem(Caption.ConfigSettings.VaultSpecificSettings.Value + \">>\" + testVault); //Clicks tree view item\r\n\r\n\t\t\t\t\tconfigurationPage.configurationPanel.setLayout(Caption.ConfigSettings.Config_Default.Value);\r\n\r\n\t\t\t\t\tif (!configurationPage.configurationPanel.saveSettings())\r\n\t\t\t\t\t\tthrow new Exception(\"Configuration settings are not saved.\");\r\n\t\t\t\t}\r\n\t\t\t\tcatch(Exception e0)\r\n\t\t\t\t{\r\n\t\t\t\t\tLog.exception(e0, driver);\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t\tUtility.quitDriver(driver);\r\n\r\n\t\t} //End finally\r\n\r\n\t}", "@Test(dataProviderClass = DataProviderUtils.class, dataProvider = \"excelDataReader\", groups = { \"Sprint54\", \"Get Hyperlink\", \"SKIP_JavaApplet\"}, \r\n\t\t\tdescription = \"Default layout will be displayed for hyperlink url on selecting default layout in configuration and in hyperlink dialog - Operations menu.\")\r\n\tpublic void SprintTest54_1_30_1A_1B(HashMap<String,String> dataValues, String driverType) throws Exception {\r\n\r\n\t\tdriver = null; \r\n\r\n\t\ttry {\r\n\r\n\r\n\r\n\r\n\t\t\tdriver = WebDriverUtils.getDriver();\r\n\r\n\t\t\tConcurrentHashMap <String, String> dataPool = new ConcurrentHashMap <String, String>(dataValues);\r\n\t\t\tHomePage homePage = LoginPage.launchDriverAndLogin(driver, true);\r\n\r\n\r\n\t\t\tConfigurationPage configurationPage = LoginPage.launchDriverAndLoginToConfig(driver, true); //Launched driver and logged in\r\n\r\n\t\t\t//Step-1 : Navigate to Vault in tree view\r\n\t\t\t//-----------------------------------------\r\n\t\t\tconfigurationPage.treeView.clickTreeViewItem(Caption.ConfigSettings.VaultSpecificSettings.Value + \">>\" + testVault); //Clicks tree view item\r\n\r\n\r\n\t\t\tif (!configurationPage.configurationPanel.getPageName().toUpperCase().equalsIgnoreCase(testVault.toUpperCase())) //Checks if navigated to vault settings page\r\n\t\t\t\tthrow new Exception(\"Vault settings page in configuration is not opened.\");\r\n\r\n\t\t\tLog.message(\"1. Navigated to Vault settings page.\");\r\n\r\n\t\t\t//Step-2 : Select Default layout and save the settings\r\n\t\t\t//----------------------------------------------------\r\n\t\t\tconfigurationPage.configurationPanel.setLayout(Caption.ConfigSettings.Config_Default.Value); //Sets as default layout\r\n\r\n\t\t\tif (!configurationPage.configurationPanel.getLayout().equalsIgnoreCase(Caption.ConfigSettings.Config_Default.Value)) //Verifies if default layout is selected\r\n\t\t\t\tthrow new Exception(\"Default layout is not selected.\");\r\n\r\n\t\t\tif (!configurationPage.configurationPanel.saveSettings()) //Saves the settings\r\n\t\t\t\tthrow new Exception(\"Settings are not saved properly.\");\r\n\r\n\t\t\tif (!configurationPage.logOut()) //Logs out from configuration page\r\n\t\t\t\tthrow new Exception(\"Log out is not successful after saving the settings in configuration page.\");\r\n\r\n\t\t\tLog.message(\"2. Default layout is selected and settings are saved.\");\r\n\r\n\t\t\t//Step-3 : Login to the default page and navigate to any view\r\n\t\t\t//--------------------------------------------------------------------------\r\n\t\t\thomePage = LoginPage.launchDriverAndLogin(driver, false); //Launches and logs into the default page\r\n\r\n\t\t\tString viewToNavigate = SearchPanel.searchOrNavigatetoView(driver, dataPool.get(\"NavigateToView\"), dataPool.get(\"ObjectName\"));\r\n\r\n\t\t\tLog.message(\"3. Logged into the default page and navigated to '\" + viewToNavigate + \"' view.\");\r\n\r\n\t\t\t//Step-4 : Open Get Hyperlink dialog for the object from operations menu\r\n\t\t\t//-----------------------------------------------------------------------\r\n\t\t\tif (!homePage.listView.clickItem(dataPool.get(\"ObjectName\"))) //Selects the Object in the list\r\n\t\t\t\tthrow new Exception(\"Object (\" + dataPool.get(\"ObjectName\") + \") is not got selected.\");\r\n\r\n\t\t\thomePage.menuBar.ClickOperationsMenu(Caption.MenuItems.GetMFilesWebURL.Value); //Selects Get Hyperlink from operations menu\r\n\r\n\t\t\tMFilesDialog mfilesDialog = new MFilesDialog(driver); //Instantiating MFilesDialog wrapper class\r\n\r\n\t\t\tif (!mfilesDialog.isGetMFilesWebURLDialogOpened()) //Checks for MFiles dialog title\r\n\t\t\t\tthrow new Exception(\"M-Files dialog with 'Get Hyperlink' title is not opened.\");\r\n\r\n\t\t\tLog.message(\"4. Hyperlink dialog of an object (\" + dataPool.get(\"ObjectName\") + \") is opened through operations menu.\");\r\n\r\n\t\t\t//Step-5 : Copy the link from text box and close the Get Hyperlink dialog\r\n\t\t\t//-----------------------------------------------------------------------\r\n\t\t\tString hyperlinkText = mfilesDialog.getHyperlink(); //Gets the hyperlink\r\n\t\t\tmfilesDialog.close(); //Closes the Get Hyperlink dialog\r\n\r\n\t\t\tLog.message(\"5. Hyperlink is copied and Get Hyperlink dialog is closed.\");\r\n\r\n\t\t\t//Step-6 : Open the copied Hyperlink in the browser\r\n\t\t\t//-------------------------------------------------\r\n\t\t\thomePage = Utility.navigateToPage(driver, hyperlinkText, userName, password, \"\"); //Navigates to the hyperlink url\r\n\r\n\t\t\tif (!driver.getCurrentUrl().equalsIgnoreCase(hyperlinkText))\r\n\t\t\t\tthrow new Exception (\"Browser is not opened with copied object Hyperlink.[Expected URL: \"+hyperlinkText+\" & Current URL : \"+ driver.getCurrentUrl() +\"]\");\r\n\r\n\t\t\tLog.message(\"6. Object Hyperlink is opened in the browser.\");\r\n\r\n\t\t\t//Verification : Verify if default layout is displayed\r\n\t\t\t//----------------------------------------------------\r\n\t\t\tString unAvailableLayouts = \"\";\r\n\r\n\t\t\tif (!homePage.isSearchbarPresent()) //Checks if Search bar present\r\n\t\t\t\tunAvailableLayouts = \"Search Bar\";\r\n\r\n\t\t\tif (!homePage.isTaskPaneDisplayed()) //Checks if Task Pane present\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Task Pane;\";\r\n\r\n\t\t\tif (!homePage.previewPane.isTabExists(Caption.PreviewPane.MetadataTab.Value))\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Properties Pane;\";\r\n\r\n\t\t\tif (!homePage.menuBar.isMenuInMenubarDisplayed()) //Checks if Menu Bar present\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Menu Bar;\";\r\n\r\n\t\t\tif (!homePage.menuBar.isBreadCrumbDisplayed()) //Checks if Breadcrumb present\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Breadcrumb;\";\r\n\r\n\t\t\tif (!homePage.taskPanel.isAppletEnabled())\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Java Applet;\";\r\n\r\n\t\t\tif (!homePage.isListViewDisplayed())\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Metadatacard;\";\r\n\r\n\t\t\tif (unAvailableLayouts.equals(\"\")) //Verifies default layout have selected default custom layout\r\n\t\t\t\tLog.pass(\"Test case Passed. Hyperlink URL page is displayed as Default layout.\");\r\n\t\t\telse\r\n\t\t\t\tLog.fail(\"Test case Failed. Few layots are missing on selecting 'Default' custom layout. Missed layots : \" \r\n\t\t\t\t\t\t+ unAvailableLayouts, driver);\r\n\r\n\t\t}\r\n\t\tcatch (Exception e) {\r\n\t\t\tLog.exception(e, driver);\r\n\t\t} //End catch\r\n\r\n\t\tfinally {\r\n\t\t\tUtility.quitDriver(driver);\r\n\t\t} //End finally\r\n\r\n\t}", "public void LossEstimates(){\r\n\t\r\n\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- My Account should be clicked and user should get logged in\");\r\n\t\ttry{\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t/*driver.switchTo().defaultContent();\r\n\t\t\t\t\tsleep(3000);\r\n\t\t\t System.out.println(\"switched frame\"+ switchframe(\"PegaGadget2Ifr\"));\r\n\t\t\t click(locator_split(\"tabLocationAssesment\"));\r\n\t\t\t click(locator_split(\"linkclickLocation\"));*/\r\n\t\t\t // driver.findElement(By.xpath(\"//*[@tabindex='4']/a/span\")).click();\r\n\t\t\t // driver.findElement(By.xpath(\"//a[@title='Click here to open Location Assessment']\")).click();\r\n\t\t\tsleep(5000);\r\n\t\t\tif(getValue(\"Account\").equals(\"EEA\")){\r\n\t\t\t driver.switchTo().defaultContent();\r\n\t\t\t System.out.println(\"switched frame\"+ switchframe(\"PegaGadget3Ifr\"));\r\n\t\t\t click(locator_split(\"tablossestimates\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t click(locator_split(\"tabeml\"));\r\n\t\t\t sleep(5000);\r\n\t\t\t click(locator_split(\"linkexpandpdlossestimates\"));\r\n\t\t\t sleep(3000);\r\n\t\t\t if (getValue(\"Radiobutton\").contains(\"Value\")){\r\n\t\t\t \tClickRadiobutton(locator_split(\"radiovalue\"));\r\n\t\t\t \t\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamage\"));\r\n\t\t\t \tsleep(3000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtbuildingdamage\"), getValue(\"BuildingDamage\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtmeDamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtmeDamage\"), getValue(\"MEDamage\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtcontentdamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtcontentdamage\"), getValue(\"ContentDamage\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtstockdamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtstockdamage\"), getValue(\"StockDamage\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtotherpddamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtotherpddamage\"), getValue(\"OtherPDDamage\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \t\r\n\t\t\t }else{\r\n\t\t\t \tClickRadiobutton(locator_split(\"radiopercentage\"));\r\n\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtbuildingdamagepc\"), getValue(\"BuildingDamagePC\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtmedamagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtmedamagepc\"), getValue(\"MEDamagePC\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtcontentdamagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtcontentdamagepc\"), getValue(\"ContentDamagePC\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtstockdamagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtstockdamagepc\"), getValue(\"StockDamagePC\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtotherpddmagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtotherpddmagepc\"), getValue(\"OtherPDDamagePC\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \t\r\n\t\t\t }\r\n\t\t\t \r\n\t\t\t click(locator_split(\"linkexpandbilossestimates\"));\r\n\t\t\t sleep(3000);\r\n\t\t\t // click(locator_split(\"linkaddroweml\"));\r\n\t\t\t // sleep(3000);\r\n\t\t\t // click(locator_split(\"linkaddroweml\"));\r\n\t\t\t// sleep(3000);\r\n\t\t\t \r\n\t\t\t selectListValue(locator_split(\"listbidowntime\"), getValue(\"BIDownTime\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t clearWebEdit(locator_split(\"txtbiaffected\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t sendKeys(locator_split(\"txtbiaffected\"), getValue(\"BIAffected\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t clearWebEdit(locator_split(\"txtbidowntime\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t sendKeys(locator_split(\"txtbidowntime\"), getValue(\"BIDownTimeValue\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t //if (driver.findElement(By.xpath(\".//*[@id='LECompletedFlag']\")).isSelected()== true ){\r\n\t\t\t \t\r\n\t\t\t //}\r\n\t\t\t // click(locator_split(\"checklecompleted\"));\r\n\t\t\t// driver.findElement(By.xpath(\".//*[@id='LECompletedFlag']\")).click();\r\n\t\t\t driver.findElement(By.xpath(\"//input[@id='LECompletedFlag']\")).click();\r\n\t\t\t //sendkeys(driver.findElement(By.xpath(\"//input[@name='USER']\")),\"jkdkd\");\r\n\t\t\t sleep(2000);\r\n\t\t\t \r\n/////////////////////////////PML flag\r\n\t\t\t click(locator_split(\"tabpml\"));\r\n\t\t\t sleep(5000);\r\n\t\t\r\n\t\t\t // click(locator_split(\"linkexpandpdlossestimates\"));\r\n\t\t\t sleep(3000);\r\n\t\t\t if (getValue(\"Radiobutton\").contains(\"Value\")){\r\n\t\t\t \tSystem.out.println(\"inside if loop\");\r\n\t\t\t \tClickRadiobutton(locator_split(\"radiovalue\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tSystem.out.println(\"inside pml tab\");\r\n\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtbuildingdamage\"), getValue(\"BuildingDamage1\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtmeDamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtmeDamage\"), getValue(\"MEDamage1\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtcontentdamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtcontentdamage\"), getValue(\"ContentDamage1\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtstockdamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtstockdamage\"), getValue(\"StockDamage1\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtotherpddamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtotherpddamage\"), getValue(\"OtherPDDamage1\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \t\r\n\t\t\t }else{\r\n\t\t\t \tClickRadiobutton(locator_split(\"radiopercentage\"));\r\n\t\t\t \t\r\n\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \t\r\n\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtbuildingdamagepc\"), getValue(\"BuildingDamagePC1\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtmedamagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtmedamagepc\"), getValue(\"MEDamagePC1\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtcontentdamagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtcontentdamagepc\"), getValue(\"ContentDamagePC1\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtstockdamagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtstockdamagepc\"), getValue(\"StockDamagePC1\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtotherpddmagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtotherpddmagepc\"), getValue(\"OtherPDDamagePC1\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \t\r\n\t\t\t }\r\n\t\t\t \r\n\t\t\t // click(locator_split(\"linkexpandbilossestimates\"));\r\n\t\t\t sleep(3000);\r\n\t\t\t selectListValue(locator_split(\"listbidowntime\"), getValue(\"BIDownTime1\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t clearWebEdit(locator_split(\"txtbiaffected\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t sendKeys(locator_split(\"txtbiaffected\"), getValue(\"BIAffected1\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t clearWebEdit(locator_split(\"txtbidowntime\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t sendKeys(locator_split(\"txtbidowntime\"), getValue(\"BIDownTimeValue1\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t //if (driver.findElement(By.xpath(\".//*[@id='LECompletedFlag']\")).isSelected()== true ){\r\n\t\t\t \t\r\n\t\t\t //}\r\n\t\t\t // driver.findElement(By.xpath(\".//*[@id='LECompletedFlag']\")).click();\r\n\t\t\t driver.findElement(By.xpath(\"//input[@id='LECompletedFlag']\")).click();\r\n\t\t\t sleep(2000);\r\n\t\t\t //////////////////////////////////////////////\r\n\t\t\t \r\n\t\t\t \r\n\t\t //////////NLE///////////////////////////\r\n\t\t\t click(locator_split(\"tabnle\"));\r\n\t\t\t sleep(5000);\r\n\t\t\r\n\t\t\t // click(locator_split(\"linkexpandpdlossestimates\"));\r\n\t\t\t sleep(3000);\r\n\t\t\t if (getValue(\"Radiobutton\").contains(\"Value\")){\r\n\t\t\t \t\r\n\t\t\t \tClickRadiobutton(locator_split(\"radiovalue\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtbuildingdamage\"), getValue(\"BuildingDamage2\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtmeDamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtmeDamage\"), getValue(\"MEDamage2\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtcontentdamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtcontentdamage\"), getValue(\"ContentDamage2\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtstockdamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtstockdamage\"), getValue(\"StockDamage2\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtotherpddamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtotherpddamage\"), getValue(\"OtherPDDamage2\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \t\r\n\t\t\t }else{\r\n\t\t\t \tClickRadiobutton(locator_split(\"radiopercentage1\"));\r\n\t\t\t \t\r\n\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtbuildingdamagepc\"), getValue(\"BuildingDamagePC2\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtmedamagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtmedamagepc\"), getValue(\"MEDamagePC2\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtcontentdamagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtcontentdamagepc\"), getValue(\"ContentDamagePC2\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtstockdamagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtstockdamagepc\"), getValue(\"StockDamagePC2\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtotherpddmagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtotherpddmagepc\"), getValue(\"OtherPDDamagePC2\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \t\r\n\t\t\t }\r\n\t\t\t \r\n\t\t\t // click(locator_split(\"linkexpandbilossestimates\"));\r\n\t\t\t sleep(3000);\r\n\t\t\t selectListValue(locator_split(\"listbidowntime\"), getValue(\"BIDownTime2\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t clearWebEdit(locator_split(\"txtbiaffected\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t sendKeys(locator_split(\"txtbiaffected\"), getValue(\"BIAffected2\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t clearWebEdit(locator_split(\"txtbidowntime\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t sendKeys(locator_split(\"txtbidowntime\"), getValue(\"BIDownTimeValue2\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t //if (driver.findElement(By.xpath(\".//*[@id='LECompletedFlag']\")).isSelected()== true ){\r\n\t\t\t \t\r\n\t\t\t //}\r\n\t\t\t if (driver.findElement(By.xpath(\".//*[@id='NLEScenarioComplete']\")).isSelected()== true ){\r\n\t\t\t\t driver.findElement(By.xpath(\"//*[@id='NLEScenarioComplete']\")).click();\r\n\t\t\t\t sleep(2000); \r\n\t\t\t }\r\n\t\t\t driver.findElement(By.xpath(\"//*[@id='NLEScenarioComplete']\")).click();\r\n\t\t\t sleep(2000); \r\n\t\t\t //////////////////////////////////////////////////////\r\n\t\t\t \r\n\t\t\t click(locator_split(\"tabnleprotected\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t if (driver.findElement(By.xpath(\".//*[@id='NLEScenarioComplete']\")).isSelected()== true ){\r\n\t\t\t\t driver.findElement(By.xpath(\"//*[@id='NLEScenarioComplete']\")).click();\r\n\t\t\t\t sleep(2000);\r\n\t\t\t }\r\n\t\t\t driver.findElement(By.xpath(\"//*[@id='NLEScenarioComplete']\")).click();\r\n\t\t\t sleep(2000);\r\n\t\t\t \r\n\t\tclick(locator_split(\"tabnleprotectednonstorage\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t// driver.findElement(By.xpath(\".//*[@id='NLEScenarioComplete']\")).click();\r\n\t\t\tsleep(2000);\r\n\t\t\tclick(locator_split(\"tabnlesummary\"));\r\n\t\t//\tdriver.findElement(By.xpath(\"tabnlesummary\")).click();\r\n\t\t\tsleep(2000);\r\n\t\t\t if (driver.findElement(By.xpath(\".//*[@id='LECompletedFlag']\")).isSelected()== true ){\r\n\t\t\t\t driver.findElement(By.xpath(\"//input[@id='LECompletedFlag']\")).click();\r\n\t\t\t\t\tsleep(2000);\r\n\t\t\t }\r\n\t\t\tdriver.findElement(By.xpath(\"//input[@id='LECompletedFlag']\")).click();\r\n\t\t\tsleep(2000);\r\n\t\t\t if (driver.findElement(By.xpath(\".//*[@id='SectionCompleted']\")).isSelected()== true ){\r\n\t\t\t\t driver.findElement(By.xpath(\"//input[@id='SectionCompleted']\")).click();\r\n\t\t\t\t sleep(2000);\r\n\t\t\t }\r\n\t\t\tdriver.findElement(By.xpath(\"//input[@id='SectionCompleted']\")).click();\r\n\t\t\tsleep(2000);\r\n\t\t//switchframe(\"PegaGadget2Ifr\");\r\n\t\t//\tsleep(3000);\r\n\t\t//clickbylinktext(\"No\");\r\n\t\t\t\r\n\t\t\t}else{\r\n\r\n\t\t\t driver.switchTo().defaultContent();\r\n\t\t\t System.out.println(\"switched frame\"+ switchframe(\"PegaGadget3Ifr\"));\r\n\t\t\t click(locator_split(\"tablossestimates\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t click(locator_split(\"tabmas\"));\r\n\t\t\t sleep(5000);\r\n\t\t\t click(locator_split(\"linkexpandpdlossestimates\"));\r\n\t\t\t sleep(3000);\r\n\t\t\t if (getValue(\"Radiobutton\").contains(\"Value\")){\r\n\t\t\t \tClickRadiobutton(locator_split(\"radiovalue\"));\r\n\t\t\t \t\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamage\"));\r\n\t\t\t \tsleep(3000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtbuildingdamage\"), getValue(\"BuildingDamageMas\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \t\r\n\t\t\t \tclearWebEdit(locator_split(\"txtmeDamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtmeDamage\"), getValue(\"MEDamageMas\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtcontentdamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtcontentdamage\"), getValue(\"ContentDamageMas\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtstockdamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtstockdamage\"), getValue(\"StockDamageMas\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtotherpddamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtotherpddamage\"), getValue(\"OtherPDDamageMas\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \t\r\n\t\t\t }else{\r\n\t\t\t \tClickRadiobutton(locator_split(\"radiopercentage\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamagepc\"));\r\n\t\t\t \tsleep(3000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \t\r\n\t\t\t \tsendKeys(locator_split(\"txtbuildingdamagepc\"), getValue(\"BuildingDamagePCMas\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \t\r\n\t\t\t \tsendKeys(locator_split(\"txtbuildingdamagepc\"), getValue(\"BuildingDamagePCMas\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtmedamagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtmedamagepc\"), getValue(\"MEDamagePCMas\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtcontentdamagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtcontentdamagepc\"), getValue(\"ContentDamagePCMas\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtstockdamagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtstockdamagepc\"), getValue(\"StockDamagePCMas\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtotherpddmagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtotherpddmagepc\"), getValue(\"OtherPDDamagePCMas\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \t\r\n\t\t\t }\r\n\t\t\t \r\n\t\t\t click(locator_split(\"linkexpandbilossestimates\"));\r\n\t\t\t sleep(3000);\r\n\t\t\t // click(locator_split(\"linkaddroweml\"));\r\n\t\t\t // sleep(3000);\r\n\t\t\t // click(locator_split(\"linkaddroweml\"));\r\n\t\t\t// sleep(3000);\r\n\t\t\t \r\n\t\t\t selectListValue(locator_split(\"listbidowntime\"), getValue(\"BIDownTimeMas\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t clearWebEdit(locator_split(\"txtbiaffected\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t sendKeys(locator_split(\"txtbiaffected\"), getValue(\"BIAffectedMas\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t clearWebEdit(locator_split(\"txtbidowntime\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t sendKeys(locator_split(\"txtbidowntime\"), getValue(\"BIDownTimeValueMas\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t click(locator_split(\"linkexpandothertecobverage\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t if (getValue(\"Radiobutton\").contains(\"Value\")){\r\n\t\t\t \tClickRadiobutton(locator_split(\"radiovalue2\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txteeloss\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t sendKeys(locator_split(\"txteeloss\"), getValue(\"EELoss1\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtothertecoverageloss\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t sendKeys(locator_split(\"txtothertecoverageloss\"), getValue(\"OtherTE1CoverageLoss1\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtothertecoverage2loss\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t sendKeys(locator_split(\"txtothertecoverage2loss\"), getValue(\"OtherTE2CoverageLoss1\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtothertecoverage3loss\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t sendKeys(locator_split(\"txtothertecoverage3loss\"), getValue(\"OtherTE3CoverageLoss1\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtibiloss\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t sendKeys(locator_split(\"txtibiloss\"), getValue(\"IBILoss1\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtcbiloss\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t sendKeys(locator_split(\"txtcbiloss\"), getValue(\"CBILoss1\"));\r\n\t\t\t\t \r\n\t\t\t //if (driver.findElement(By.xpath(\".//*[@id='LECompletedFlag']\")).isSelected()== true ){\r\n\t\t\t \t\r\n\t\t\t //}\r\n\t\t\t // click(locator_split(\"checklecompleted\"));\r\n\t\t\t// driver.findElement(By.xpath(\".//*[@id='LECompletedFlag']\")).click();\r\n\t\t\t \t\r\n\t\t\t }else{\r\n\t\t\t \t\r\n\t\t\t \tClickRadiobutton(locator_split(\"radiopercentage2\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txteelosspc\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t sendKeys(locator_split(\"txteelosspc\"), getValue(\"EELoss1PC\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtothertecoveragelosspc\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t sendKeys(locator_split(\"txtothertecoveragelosspc\"), getValue(\"OtherTE1CoverageLoss1PC\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtothertecoverage2losspc\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t sendKeys(locator_split(\"txtothertecoverage2losspc\"), getValue(\"OtherTE2CoverageLoss1PC\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtothertecoverage3losspc\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t sendKeys(locator_split(\"txtothertecoverage3losspc\"), getValue(\"OtherTE3CoverageLoss1PC\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtibilosspc\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t sendKeys(locator_split(\"txtibilosspc\"), getValue(\"IBILoss1PC\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtcbilosspc\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t sendKeys(locator_split(\"txtcbilosspc\"), getValue(\"CBILoss1PC\"));\r\n\t\t\t }\r\n\t\t\t if (driver.findElement(By.xpath(\".//*[@id='LECompletedFlag']\")).isSelected()== true ){\r\n\t\t\t\t\t driver.findElement(By.xpath(\"//input[@id='LECompletedFlag']\")).click();\r\n\t\t\t\t\t\tsleep(2000);\r\n\t\t\t\t }\r\n\t\t\t\tdriver.findElement(By.xpath(\"//input[@id='LECompletedFlag']\")).click();\r\n\t\t\t\tsleep(2000);\r\n\t\t\t// driver.findElement(By.xpath(\"//input[@id='LECompletedFlag']\")).click();\r\n\t\t\t //sendkeys(driver.findElement(By.xpath(\"//input[@name='USER']\")),\"jkdkd\");\r\n\t\t\t // sleep(2000);\r\n\t\t\t \r\n\t\t\t \r\n\t\t\t \r\n\t\t\t \r\n\t\t\t \r\n\t\t\t \r\n\t\t\t /////////////MFL/////////////////////\r\n\t\t\t \r\n\t\t\t click(locator_split(\"tabmfl\"));\r\n\t\t\t sleep(5000);\r\n\t\t\t // click(locator_split(\"linkexpandpdlossestimates\"));\r\n\t\t\t sleep(3000);\r\n\t\t\t if (getValue(\"Radiobutton\").contains(\"Value\")){\r\n\t\t\t \tClickRadiobutton(locator_split(\"radiovalue\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tSystem.out.println(\"After clicking Radio button\");\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamage\"));\r\n\t\t\t \tsleep(3000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtbuildingdamage\"), getValue(\"BuildingDamageMfl1\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtmeDamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtmeDamage\"), getValue(\"MEDamageMfl1\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtcontentdamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtcontentdamage\"), getValue(\"ContentDamageMfl1\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtstockdamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtstockdamage\"), getValue(\"StockDamageMfl1\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtotherpddamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtotherpddamage\"), getValue(\"OtherPDDamageMfl1\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \t\r\n\t\t\t }else{\r\n\t\t\t \tClickRadiobutton(locator_split(\"radiopercentage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtbuildingdamagepc\"), getValue(\"BuildingDamageMflPC1\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtmedamagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtmedamagepc\"), getValue(\"MEDamageMflPC1\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtcontentdamagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtcontentdamagepc\"), getValue(\"ContentDamageMflPC1\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtstockdamagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtstockdamagepc\"), getValue(\"StockDamageMflPC1\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtotherpddmagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtotherpddmagepc\"), getValue(\"OtherPDDamageMflPC1\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \t\r\n\t\t\t }\r\n\t\t\t \r\n\t\t\t // click(locator_split(\"linkexpandbilossestimates\"));\r\n\t\t\t sleep(3000);\r\n\t\t\t /* click(locator_split(\"linkaddroweml\"));\r\n\t\t\t sleep(3000);\r\n\t\t\t click(locator_split(\"linkaddroweml\"));\r\n\t\t\t sleep(3000);*/\r\n\t\t\t \r\n\t\t\t selectListValue(locator_split(\"listbidowntime\"), getValue(\"BIDownTimeMfl1\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t clearWebEdit(locator_split(\"txtbiaffected\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t sendKeys(locator_split(\"txtbiaffected\"), getValue(\"BIAffectedMfl1\"));\r\n\t\t\t sleep(5000);\r\n\t\t\t clearWebEdit(locator_split(\"txtbidowntime\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t sendKeys(locator_split(\"txtbidowntime\"), getValue(\"BIDownTimeValueMfl1\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t // click(locator_split(\"linkexpandothertecobverage\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t if (getValue(\"Radiobutton\").contains(\"Value\")){\r\n\t\t\t \tClickRadiobutton(locator_split(\"radiovaluemfs\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txteeloss\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t sendKeys(locator_split(\"txteeloss\"), getValue(\"EELossMfl\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtothertecoverageloss\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t sendKeys(locator_split(\"txtothertecoverageloss\"), getValue(\"OtherTE1CoverageLossMfl\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtothertecoverage2loss\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t sendKeys(locator_split(\"txtothertecoverage2loss\"), getValue(\"OtherTE2CoverageLossMfl\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtothertecoverage3loss\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t sendKeys(locator_split(\"txtothertecoverage3loss\"), getValue(\"OtherTE3CoverageLossMfl\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtibiloss\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t sendKeys(locator_split(\"txtibiloss\"), getValue(\"IBILossMfl\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtcbiloss\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t sendKeys(locator_split(\"txtcbiloss\"), getValue(\"CBILossMfl\"));\r\n\t\t\t\t \r\n\t\t\t //if (driver.findElement(By.xpath(\".//*[@id='LECompletedFlag']\")).isSelected()== true ){\r\n\t\t\t \t\r\n\t\t\t //}\r\n\t\t\t // click(locator_split(\"checklecompleted\"));\r\n\t\t\t// driver.findElement(By.xpath(\".//*[@id='LECompletedFlag']\")).click();\r\n\t\t\t \t\r\n\t\t\t }else{\r\n\t\t\t \t\r\n\t\t\t \tClickRadiobutton(locator_split(\"radiopercentagemfl\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txteelosspc\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t sendKeys(locator_split(\"txteelosspc\"), getValue(\"EELossMflPC\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtothertecoveragelosspc\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t sendKeys(locator_split(\"txtothertecoveragelosspc\"), getValue(\"OtherTE1CoverageLossMflPC\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtothertecoverage2losspc\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t sendKeys(locator_split(\"txtothertecoverage2losspc\"), getValue(\"OtherTE2CoverageLossMflPC\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtothertecoverage3losspc\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t sendKeys(locator_split(\"txtothertecoverage3losspc\"), getValue(\"OtherTE3CoverageLossMflPC\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtibilosspc\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t sendKeys(locator_split(\"txtibilosspc\"), getValue(\"IBILossMflPC\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtcbilosspc\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t sendKeys(locator_split(\"txtcbilosspc\"), getValue(\"CBILossMfPC\"));\r\n\t\t\t }\r\n\t\t\t if (driver.findElement(By.xpath(\".//*[@id='LECompletedFlag']\")).isSelected()== true ){\r\n\t\t\t\t\t driver.findElement(By.xpath(\"//input[@id='LECompletedFlag']\")).click();\r\n\t\t\t\t\t\tsleep(2000);\r\n\t\t\t\t }\r\n\t\t\t\tdriver.findElement(By.xpath(\"//input[@id='LECompletedFlag']\")).click();\r\n\t\t\t\tsleep(2000);\r\n\t\t\t // driver.findElement(By.xpath(\"//input[@id='LECompletedFlag']\")).click();\r\n\t\t\t //sendkeys(driver.findElement(By.xpath(\"//input[@name='USER']\")),\"jkdkd\");\r\n\t\t\t // sleep(2000);\r\n\t\t\t ///////////////MFL/////////////\r\n\t/////////////PML/////////////////////\r\n\t\t\t\t \r\n\t\t\t\t click(locator_split(\"tabpml\"));\r\n\t\t\t\t sleep(5000);\r\n\t\t\t\t // click(locator_split(\"linkexpandpdlossestimates\"));\r\n\t\t\t\t sleep(3000);\r\n\t\t\t\t if (getValue(\"Radiobutton\").contains(\"Value\")){\r\n\t\t\t\t \tClickRadiobutton(locator_split(\"radiovalue\"));\r\n\t\t\t\t \tsleep(2000);\r\n\t\t\t\t \tSystem.out.println(\"After clicking Radio button\");\r\n\t\t\t\t \tsleep(1000);\r\n\t\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamage\"));\r\n\t\t\t\t \tsleep(3000);\r\n\t\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamage\"));\r\n\t\t\t\t \tsleep(2000);\r\n\t\t\t\t \tsendKeys(locator_split(\"txtbuildingdamage\"), getValue(\"BuildingDamageMfl1\"));\r\n\t\t\t\t \tsleep(1000);\r\n\t\t\t\t \tclearWebEdit(locator_split(\"txtmeDamage\"));\r\n\t\t\t\t \tsleep(2000);\r\n\t\t\t\t \tsendKeys(locator_split(\"txtmeDamage\"), getValue(\"MEDamageMfl1\"));\r\n\t\t\t\t \tsleep(1000);\r\n\t\t\t\t \tclearWebEdit(locator_split(\"txtcontentdamage\"));\r\n\t\t\t\t \tsleep(2000);\r\n\t\t\t\t \tsendKeys(locator_split(\"txtcontentdamage\"), getValue(\"ContentDamageMfl1\"));\r\n\t\t\t\t \tsleep(1000);\r\n\t\t\t\t \tclearWebEdit(locator_split(\"txtstockdamage\"));\r\n\t\t\t\t \tsleep(2000);\r\n\t\t\t\t \tsendKeys(locator_split(\"txtstockdamage\"), getValue(\"StockDamageMfl1\"));\r\n\t\t\t\t \tsleep(1000);\r\n\t\t\t\t \tclearWebEdit(locator_split(\"txtotherpddamage\"));\r\n\t\t\t\t \tsleep(2000);\r\n\t\t\t\t \tsendKeys(locator_split(\"txtotherpddamage\"), getValue(\"OtherPDDamageMfl1\"));\r\n\t\t\t\t \tsleep(1000);\r\n\t\t\t\t \t\r\n\t\t\t\t }else{\r\n\t\t\t\t \tClickRadiobutton(locator_split(\"radiopercentage\"));\r\n\t\t\t\t \tsleep(2000);\r\n\t\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamagepc\"));\r\n\t\t\t\t \tsleep(2000);\r\n\t\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamagepc\"));\r\n\t\t\t\t \tsleep(2000);\r\n\t\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamagepc\"));\r\n\t\t\t\t \tsleep(2000);\r\n\t\t\t\t \tsendKeys(locator_split(\"txtbuildingdamagepc\"), getValue(\"BuildingDamageMflPC1\"));\r\n\t\t\t\t \tsleep(1000);\r\n\t\t\t\t \tclearWebEdit(locator_split(\"txtmedamagepc\"));\r\n\t\t\t\t \tsleep(2000);\r\n\t\t\t\t \tsendKeys(locator_split(\"txtmedamagepc\"), getValue(\"MEDamageMflPC1\"));\r\n\t\t\t\t \tsleep(1000);\r\n\t\t\t\t \tclearWebEdit(locator_split(\"txtcontentdamagepc\"));\r\n\t\t\t\t \tsleep(2000);\r\n\t\t\t\t \tsendKeys(locator_split(\"txtcontentdamagepc\"), getValue(\"ContentDamageMflPC1\"));\r\n\t\t\t\t \tsleep(1000);\r\n\t\t\t\t \tclearWebEdit(locator_split(\"txtstockdamagepc\"));\r\n\t\t\t\t \tsleep(2000);\r\n\t\t\t\t \tsendKeys(locator_split(\"txtstockdamagepc\"), getValue(\"StockDamageMflPC1\"));\r\n\t\t\t\t \tsleep(1000);\r\n\t\t\t\t \tclearWebEdit(locator_split(\"txtotherpddmagepc\"));\r\n\t\t\t\t \tsleep(2000);\r\n\t\t\t\t \tsendKeys(locator_split(\"txtotherpddmagepc\"), getValue(\"OtherPDDamageMflPC1\"));\r\n\t\t\t\t \tsleep(1000);\r\n\t\t\t\t \t\r\n\t\t\t\t }\r\n\t\t\t\t \r\n\t\t\t\t // click(locator_split(\"linkexpandbilossestimates\"));\r\n\t\t\t\t /* sleep(3000);\r\n\t\t\t\t click(locator_split(\"linkaddroweml\"));\r\n\t\t\t\t sleep(3000);\r\n\t\t\t\t click(locator_split(\"linkaddroweml\"));\r\n\t\t\t\t sleep(3000);*/\r\n\t\t\t\t sleep(3000);\r\n\t\t\t\t selectListValue(locator_split(\"listbidowntime\"), getValue(\"BIDownTimeMfl1\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t clearWebEdit(locator_split(\"txtbiaffected\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t sendKeys(locator_split(\"txtbiaffected\"), getValue(\"BIAffectedMfl1\"));\r\n\t\t\t\t sleep(5000);\r\n\t\t\t\t clearWebEdit(locator_split(\"txtbidowntime\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t sendKeys(locator_split(\"txtbidowntime\"), getValue(\"BIDownTimeValueMfl1\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t // click(locator_split(\"linkexpandothertecobverage\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t if (getValue(\"Radiobutton\").contains(\"Value\")){\r\n\t\t\t\t \tSystem.out.println(\"Inside If Loop\");\r\n\t\t\t\t \t//ClickRadiobutton(locator_split(\"radiovaluepml\"));\r\n\t\t\t\t \tsleep(5000);\r\n\t\t\t\t \tclearWebEdit(locator_split(\"txteeloss\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t sendKeys(locator_split(\"txteeloss\"), getValue(\"EELossMfl\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t \tclearWebEdit(locator_split(\"txtothertecoverageloss\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t sendKeys(locator_split(\"txtothertecoverageloss\"), getValue(\"OtherTE1CoverageLossMfl\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t \tclearWebEdit(locator_split(\"txtothertecoverage2loss\"));\r\n\t\t\t\t\t sleep(3000);\r\n\t\t\t\t\t sendKeys(locator_split(\"txtothertecoverage2loss\"), getValue(\"OtherTE2CoverageLossMfl\"));\r\n\t\t\t\t\t sleep(3000);\r\n\t\t\t\t \tclearWebEdit(locator_split(\"txtothertecoverage3loss\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t sendKeys(locator_split(\"txtothertecoverage3loss\"), getValue(\"OtherTE3CoverageLossMfl\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t \tclearWebEdit(locator_split(\"txtibiloss\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t sendKeys(locator_split(\"txtibiloss\"), getValue(\"IBILossPML\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t \tclearWebEdit(locator_split(\"txtcbiloss\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t sendKeys(locator_split(\"txtcbiloss\"), getValue(\"CBILossPML\"));\r\n\t\t\t\t\t \r\n\t\t\t\t //if (driver.findElement(By.xpath(\".//*[@id='LECompletedFlag']\")).isSelected()== true ){\r\n\t\t\t\t \t\r\n\t\t\t\t //}\r\n\t\t\t\t // click(locator_split(\"checklecompleted\"));\r\n\t\t\t\t// driver.findElement(By.xpath(\".//*[@id='LECompletedFlag']\")).click();\r\n\t\t\t\t \t\r\n\t\t\t\t }else{\r\n\t\t\t\t \t\r\n\t\t\t\t \tClickRadiobutton(locator_split(\"radiopercentage3\"));\r\n\t\t\t\t \tsleep(2000);\r\n\t\t\t\t \tclearWebEdit(locator_split(\"txteelosspc\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t sendKeys(locator_split(\"txteelosspc\"), getValue(\"EELossPML1\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t \tclearWebEdit(locator_split(\"txtothertecoveragelosspc\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t sendKeys(locator_split(\"txtothertecoveragelosspc\"), getValue(\"OtherTE1CoverageLossPMLPC\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t \tclearWebEdit(locator_split(\"txtothertecoverage2losspc\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t sendKeys(locator_split(\"txtothertecoverage2losspc\"), getValue(\"OtherTE2CoverageLossPMLPC\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t \tclearWebEdit(locator_split(\"txtothertecoverage3losspc\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t sendKeys(locator_split(\"txtothertecoverage3losspc\"), getValue(\"OtherTE3CoverageLossPMLPC\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t \tclearWebEdit(locator_split(\"txtibilosspc\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t sendKeys(locator_split(\"txtibilosspc\"), getValue(\"IBILossPMLPC\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t \tclearWebEdit(locator_split(\"txtcbilosspc\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t sendKeys(locator_split(\"txtcbilosspc\"), getValue(\"CBILossPMLPC\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t }\r\n\t\t\t\t if (driver.findElement(By.xpath(\".//*[@id='LECompletedFlag']\")).isSelected()== true ){\r\n\t\t\t\t\t\t driver.findElement(By.xpath(\"//input[@id='LECompletedFlag']\")).click();\r\n\t\t\t\t\t\t\tsleep(2000);\r\n\t\t\t\t\t }\r\n\t\t\t\t\tdriver.findElement(By.xpath(\"//input[@id='LECompletedFlag']\")).click();\r\n\t\t\t\t\tsleep(2000);\r\n\t\t\t\t // driver.findElement(By.xpath(\"//input[@id='LECompletedFlag']\")).click();\r\n\t\t\t\t //sendkeys(driver.findElement(By.xpath(\"//input[@name='USER']\")),\"jkdkd\");\r\n\t\t\t\t // sleep(2000);\r\n\t\t\t\t ///////////////PML/////////////\r\n\t\t\t\t //////////////NLE Manual////////////////\r\n\t\r\n\t\t\t\t\t \r\n\t\t\t\t\t click(locator_split(\"tabnlemanual\"));\r\n\t\t\t\t\t sleep(5000);\r\n\t\t\t\t\t // click(locator_split(\"linkexpandpdlossestimates\"));\r\n\t\t\t\t\t sleep(3000);\r\n\t\t\t\t\t if (getValue(\"Radiobutton\").contains(\"Value\")){\r\n\t\t\t\t\t \tClickRadiobutton(locator_split(\"radiovalue\"));\r\n\t\t\t\t\t \tsleep(2000);\r\n\t\t\t\t\t \tSystem.out.println(\"After clicking Radio button\");\r\n\t\t\t\t\t \tsleep(1000);\r\n\t\t\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamage\"));\r\n\t\t\t\t\t \tsleep(3000);\r\n\t\t\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamage\"));\r\n\t\t\t\t\t \tsleep(2000);\r\n\t\t\t\t\t \tsendKeys(locator_split(\"txtbuildingdamage\"), getValue(\"BuildingDamageNLE1\"));\r\n\t\t\t\t\t \tsleep(1000);\r\n\t\t\t\t\t \tclearWebEdit(locator_split(\"txtmeDamage\"));\r\n\t\t\t\t\t \tsleep(2000);\r\n\t\t\t\t\t \tsendKeys(locator_split(\"txtmeDamage\"), getValue(\"MEDamageNLE1\"));\r\n\t\t\t\t\t \tsleep(1000);\r\n\t\t\t\t\t \tclearWebEdit(locator_split(\"txtcontentdamage\"));\r\n\t\t\t\t\t \tsleep(2000);\r\n\t\t\t\t\t \tsendKeys(locator_split(\"txtcontentdamage\"), getValue(\"ContentDamageNLE1\"));\r\n\t\t\t\t\t \tsleep(1000);\r\n\t\t\t\t\t \tclearWebEdit(locator_split(\"txtstockdamage\"));\r\n\t\t\t\t\t \tsleep(2000);\r\n\t\t\t\t\t \tsendKeys(locator_split(\"txtstockdamage\"), getValue(\"StockDamageNLE1\"));\r\n\t\t\t\t\t \tsleep(1000);\r\n\t\t\t\t\t \tclearWebEdit(locator_split(\"txtotherpddamage\"));\r\n\t\t\t\t\t \tsleep(2000);\r\n\t\t\t\t\t \tsendKeys(locator_split(\"txtotherpddamage\"), getValue(\"OtherPDDamageNLE1\"));\r\n\t\t\t\t\t \tsleep(1000);\r\n\t\t\t\t\t \t\r\n\t\t\t\t\t }else{\r\n\t\t\t\t\t \tClickRadiobutton(locator_split(\"radiopercentage\"));\r\n\t\t\t\t\t \tsleep(2000);\r\n\t\t\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamagepc\"));\r\n\t\t\t\t\t \tsleep(2000);\r\n\t\t\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamagepc\"));\r\n\t\t\t\t\t \tsleep(2000);\r\n\t\t\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamagepc\"));\r\n\t\t\t\t\t \tsleep(2000);\r\n\t\t\t\t\t \tsendKeys(locator_split(\"txtbuildingdamagepc\"), getValue(\"BuildingDamageNLEPC1\"));\r\n\t\t\t\t\t \tsleep(1000);\r\n\t\t\t\t\t \tclearWebEdit(locator_split(\"txtmedamagepc\"));\r\n\t\t\t\t\t \tsleep(2000);\r\n\t\t\t\t\t \tsendKeys(locator_split(\"txtmedamagepc\"), getValue(\"MEDamageNLEPC1\"));\r\n\t\t\t\t\t \tsleep(1000);\r\n\t\t\t\t\t \tclearWebEdit(locator_split(\"txtcontentdamagepc\"));\r\n\t\t\t\t\t \tsleep(2000);\r\n\t\t\t\t\t \tsendKeys(locator_split(\"txtcontentdamagepc\"), getValue(\"ContentDamageNLEPC1\"));\r\n\t\t\t\t\t \tsleep(1000);\r\n\t\t\t\t\t \tclearWebEdit(locator_split(\"txtstockdamagepc\"));\r\n\t\t\t\t\t \tsleep(2000);\r\n\t\t\t\t\t \tsendKeys(locator_split(\"txtstockdamagepc\"), getValue(\"StockDamageNLEPC1\"));\r\n\t\t\t\t\t \tsleep(1000);\r\n\t\t\t\t\t \tclearWebEdit(locator_split(\"txtotherpddmagepc\"));\r\n\t\t\t\t\t \tsleep(2000);\r\n\t\t\t\t\t \tsendKeys(locator_split(\"txtotherpddmagepc\"), getValue(\"OtherPDDamageNLEPC1\"));\r\n\t\t\t\t\t \tsleep(1000);\r\n\t\t\t\t\t \t\r\n\t\t\t\t\t }\r\n\t\t\t\t\t \r\n\t\t\t\t\t // click(locator_split(\"linkexpandbilossestimates\"));\r\n\t\t\t\t\t /* sleep(3000);\r\n\t\t\t\t\t click(locator_split(\"linkaddroweml\"));\r\n\t\t\t\t\t sleep(3000);\r\n\t\t\t\t\t click(locator_split(\"linkaddroweml\"));\r\n\t\t\t\t\t sleep(3000);*/\r\n\t\t\t\t\t sleep(3000);\r\n\t\t\t\t\t selectListValue(locator_split(\"listbidowntime\"), getValue(\"BIDownTimeNLE1\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t clearWebEdit(locator_split(\"txtbiaffected\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t sendKeys(locator_split(\"txtbiaffected\"), getValue(\"BIAffectedNLE1\"));\r\n\t\t\t\t\t sleep(5000);\r\n\t\t\t\t\t clearWebEdit(locator_split(\"txtbidowntime\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t sendKeys(locator_split(\"txtbidowntime\"), getValue(\"BIDownTimeValueNLE1\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t // click(locator_split(\"linkexpandothertecobverage\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t if (getValue(\"Radiobutton\").contains(\"Value\")){\r\n\t\t\t\t\t \tSystem.out.println(\"Inside If Loop\");\r\n\t\t\t\t\t \t//ClickRadiobutton(locator_split(\"radiovaluepml\"));\r\n\t\t\t\t\t \tsleep(5000);\r\n\t\t\t\t\t \tclearWebEdit(locator_split(\"txteeloss\"));\r\n\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t\t sendKeys(locator_split(\"txteeloss\"), getValue(\"EELossNLE\"));\r\n\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t \tclearWebEdit(locator_split(\"txtothertecoverageloss\"));\r\n\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t\t sendKeys(locator_split(\"txtothertecoverageloss\"), getValue(\"OtherTE1CoverageLossNLE\"));\r\n\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t \tclearWebEdit(locator_split(\"txtothertecoverage2loss\"));\r\n\t\t\t\t\t\t sleep(3000);\r\n\t\t\t\t\t\t sendKeys(locator_split(\"txtothertecoverage2loss\"), getValue(\"OtherTE2CoverageLossNLE\"));\r\n\t\t\t\t\t\t sleep(3000);\r\n\t\t\t\t\t \tclearWebEdit(locator_split(\"txtothertecoverage3loss\"));\r\n\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t\t sendKeys(locator_split(\"txtothertecoverage3loss\"), getValue(\"OtherTE3CoverageLossNLE\"));\r\n\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t \tclearWebEdit(locator_split(\"txtibiloss\"));\r\n\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t\t sendKeys(locator_split(\"txtibiloss\"), getValue(\"IBILossNLE\"));\r\n\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t \tclearWebEdit(locator_split(\"txtcbiloss\"));\r\n\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t\t sendKeys(locator_split(\"txtcbiloss\"), getValue(\"CBILossNLE\"));\r\n\t\t\t\t\t\t \r\n\t\t\t\t\t //if (driver.findElement(By.xpath(\".//*[@id='LECompletedFlag']\")).isSelected()== true ){\r\n\t\t\t\t\t \t\r\n\t\t\t\t\t //}\r\n\t\t\t\t\t // click(locator_split(\"checklecompleted\"));\r\n\t\t\t\t\t// driver.findElement(By.xpath(\".//*[@id='LECompletedFlag']\")).click();\r\n\t\t\t\t\t \t\r\n\t\t\t\t\t }else{\r\n\t\t\t\t\t \t\r\n\t\t\t\t\t \tClickRadiobutton(locator_split(\"radiopercentagenlemanual\"));\r\n\t\t\t\t\t \tsleep(2000);\r\n\t\t\t\t\t \tclearWebEdit(locator_split(\"txteelosspc\"));\r\n\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t\t sendKeys(locator_split(\"txteelosspc\"), getValue(\"EELossNLEPC\"));\r\n\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t \tclearWebEdit(locator_split(\"txtothertecoveragelosspc\"));\r\n\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t\t sendKeys(locator_split(\"txtothertecoveragelosspc\"), getValue(\"OtherTE1CoverageLossNLEPC\"));\r\n\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t \tclearWebEdit(locator_split(\"txtothertecoverage2losspc\"));\r\n\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t\t sendKeys(locator_split(\"txtothertecoverage2losspc\"), getValue(\"OtherTE2CoverageLossNLEPC\"));\r\n\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t \tclearWebEdit(locator_split(\"txtothertecoverage3losspc\"));\r\n\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t\t sendKeys(locator_split(\"txtothertecoverage3losspc\"), getValue(\"OtherTE3CoverageLossNLEPC\"));\r\n\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t \tclearWebEdit(locator_split(\"txtibilosspc\"));\r\n\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t\t sendKeys(locator_split(\"txtibilosspc\"), getValue(\"IBILossNLEPC\"));\r\n\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t \tclearWebEdit(locator_split(\"txtcbilosspc\"));\r\n\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t\t sendKeys(locator_split(\"txtcbilosspc\"), getValue(\"CBILossNLEPC\"));\r\n\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t }\r\n\t\t\t\t\t // driver.findElement(By.xpath(\"//input[@id='LECompletedFlag']\")).click();\r\n\t\t\t\t\t if (driver.findElement(By.xpath(\".//*[@id='NLEScenarioComplete']\")).isSelected()== true ){\r\n\t\t\t\t\t\t driver.findElement(By.xpath(\"//*[@id='NLEScenarioComplete']\")).click();\r\n\t\t\t\t\t\t sleep(2000); \r\n\t\t\t\t\t }\r\n\t\t\t\t\t driver.findElement(By.xpath(\"//*[@id='NLEScenarioComplete']\")).click();\r\n\t\t\t\t\t sleep(2000); \r\n\t\t\t\t\t //sendkeys(driver.findElement(By.xpath(\"//input[@name='USER']\")),\"jkdkd\");\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t \r\n\t\t\t\t /////////////NLE Manual/////////////\r\n\t\t\t\t\t ////////////////////Remaining tabs/////////////\r\n\t\t\t\t\t \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t \r\n\t\t\t\t\t\t click(locator_split(\"tabnleprotected\"));\r\n\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t\t if (driver.findElement(By.xpath(\".//*[@id='NLEScenarioComplete']\")).isSelected()== true ){\r\n\t\t\t\t\t\t\t driver.findElement(By.xpath(\"//*[@id='NLEScenarioComplete']\")).click();\r\n\t\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t\t }\r\n\t\t\t\t\t\t driver.findElement(By.xpath(\"//*[@id='NLEScenarioComplete']\")).click();\r\n\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t\t \r\n\t\t\t\t\tclick(locator_split(\"tabnleprotectednonstorage\"));\r\n\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t\t if (driver.findElement(By.xpath(\".//*[@id='NLEScenarioComplete']\")).isSelected()== true ){\r\n\t\t\t\t\t\t\t driver.findElement(By.xpath(\"//*[@id='NLEScenarioComplete']\")).click();\r\n\t\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t\t }\r\n\t\t\t\t\t\t driver.findElement(By.xpath(\"//*[@id='NLEScenarioComplete']\")).click();\r\n\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t\t \r\n\t\t\t\t\t\t// driver.findElement(By.xpath(\".//*[@id='NLEScenarioComplete']\")).click();\r\n\t\t\t\t\t\tsleep(2000);\r\n\t\t\t\t\t\tclick(locator_split(\"tabnlesummary\"));\r\n\t\t\t\t\t//\tdriver.findElement(By.xpath(\"tabnlesummary\")).click();\r\n\t\t\t\t\t\tsleep(2000);\r\n\t\t\t\t\t\t if (driver.findElement(By.xpath(\".//*[@id='LECompletedFlag']\")).isSelected()== true ){\r\n\t\t\t\t\t\t\t driver.findElement(By.xpath(\"//input[@id='LECompletedFlag']\")).click();\r\n\t\t\t\t\t\t\t\tsleep(2000);\r\n\t\t\t\t\t\t }\r\n\t\t\t\t\t\tdriver.findElement(By.xpath(\"//input[@id='LECompletedFlag']\")).click();\r\n\t\t\t\t\t\tsleep(2000);\r\n\t\t\t\t\t\t if (driver.findElement(By.xpath(\".//*[@id='SectionCompleted']\")).isSelected()== true ){\r\n\t\t\t\t\t\t\t driver.findElement(By.xpath(\"//input[@id='SectionCompleted']\")).click();\r\n\t\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t\t }\r\n\t\t\t\t\t\tdriver.findElement(By.xpath(\"//input[@id='SectionCompleted']\")).click();\r\n\t\t\t\t\t\tsleep(2000);\r\n\t\t\t\t\t ///////////////Remaining tabs///////////////\r\n\t\t\t\t\t \r\n\t\t\t\t\t \r\n\t\t\t}\r\n////////////\r\n\t\r\n\t\t\tReporter.log(\"PASS_MESSAGE:- Report tab is clicked and user is logged in\");\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Report tab is not clicked in\");\r\n\t\t\tthrow new NoSuchElementException(\"The element with\"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"LoginLogout\")\r\n\t\t\t\t\t+ \" not found\");\r\n\r\n\t\t}\r\n\r\n\t}", "@Test(dataProviderClass = DataProviderUtils.class, dataProvider = \"excelDataReader\", groups = { \"Sprint54\", \"Get Hyperlink\"}, \r\n\t\t\tdescription = \"Listing pane only layout will be displayed for hyperlink url on selecting Listing pane only layout in configuration and default in hyperlink dialog - Context menu.\")\r\n\tpublic void SprintTest54_1_30_7A_1(HashMap<String,String> dataValues, String driverType) throws Exception {\r\n\r\n\t\tdriver = null; \r\n\r\n\t\ttry {\r\n\r\n\r\n\r\n\r\n\t\t\tdriver = WebDriverUtils.getDriver();\r\n\r\n\t\t\tConcurrentHashMap <String, String> dataPool = new ConcurrentHashMap <String, String>(dataValues);\r\n\t\t\tConfigurationPage configurationPage = LoginPage.launchDriverAndLoginToConfig(driver, true); //Launched driver and logged in\r\n\r\n\t\t\t//Step-1 : Navigate to Vault in tree view\r\n\t\t\t//---------------------------------------\r\n\t\t\tconfigurationPage.treeView.clickTreeViewItem(Caption.ConfigSettings.VaultSpecificSettings.Value + \">>\" + testVault); //Clicks tree view item\r\n\r\n\r\n\t\t\tif (!configurationPage.configurationPanel.getPageName().toUpperCase().equalsIgnoreCase(testVault.toUpperCase())) //Checks if navigated to vault settings page\r\n\t\t\t\tthrow new Exception(\"Vault settings page in configuration is not opened.\");\r\n\r\n\t\t\tLog.message(\"1. Navigated to Vault settings page.\");\r\n\r\n\t\t\t//Step-2 : Select Listing pane layout layout and save the settings\r\n\t\t\t//--------------------------------------------------------------------------------------\r\n\t\t\tconfigurationPage.configurationPanel.setLayout(Caption.ConfigSettings.Config_ListingPaneOnly.Value); //Sets as Listing pane layout\r\n\r\n\t\t\tif (!configurationPage.configurationPanel.getLayout().equalsIgnoreCase(Caption.ConfigSettings.Config_ListingPaneOnly.Value)) //Verifies if Listing pane and properties pane layout is selected\r\n\t\t\t\tthrow new Exception(Caption.ConfigSettings.Config_ListingPaneOnly.Value + \" layout is not selected.\");\r\n\r\n\t\t\tif (!configurationPage.configurationPanel.saveSettings()) //Saves the settings\r\n\t\t\t\tthrow new Exception(\"Settings are not saved properly.\");\r\n\r\n\t\t\tif (!configurationPage.logOut()) //Logs out from configuration page\r\n\t\t\t\tthrow new Exception(\"Log out is not successful after saving the settings in configuration page.\");\r\n\r\n\t\t\tLog.message(\"2. \" + Caption.ConfigSettings.Config_ListingPaneOnly.Value + \" layout is selected and settings are saved.\");\r\n\r\n\t\t\t//Step-3 : Login to the default page and navigate to any view\r\n\t\t\t//-------------------------------------------------------------\r\n\t\t\tHomePage homePage = LoginPage.launchDriverAndLogin(driver, false); //Launches and logs into the default page\r\n\r\n\t\t\tString viewToNavigate = SearchPanel.searchOrNavigatetoView(driver, dataPool.get(\"NavigateToView\"), dataPool.get(\"ObjectName\"));\r\n\r\n\t\t\tLog.message(\"3. Logged into the default page and navigated to '\" + viewToNavigate + \"' view.\");\r\n\r\n\t\t\t//Step-4 : Open Get Hyperlink dialog for the object from context menu\r\n\t\t\t//-------------------------------------------------------------------\r\n\t\t\tif (!homePage.listView.rightClickItem(dataPool.get(\"ObjectName\"))) //Selects the Object in the list\r\n\t\t\t\tthrow new Exception(\"Object (\" + dataPool.get(\"ObjectName\") + \") is not got selected.\");\r\n\r\n\t\t\thomePage.listView.clickContextMenuItem(Caption.MenuItems.GetMFilesWebURL.Value); //Selects Get Hyperlink from context menu\r\n\r\n\t\t\tMFilesDialog mfilesDialog = new MFilesDialog(driver); //Instantiating MFilesDialog wrapper class\r\n\r\n\t\t\tif (!mfilesDialog.isGetMFilesWebURLDialogOpened()) //Checks for MFiles dialog title\r\n\t\t\t\tthrow new Exception(\"M-Files dialog with 'Get Hyperlink' title is not opened.\");\r\n\r\n\t\t\tLog.message(\"4. Hyperlink dialog of an object (\" + dataPool.get(\"ObjectName\") + \") is opened through context menu.\");\r\n\r\n\t\t\t//Step-5 : Copy the link from text box and close the Get Hyperlink dialog\r\n\t\t\t//-----------------------------------------------------------------------\r\n\t\t\tString hyperlinkText = mfilesDialog.getHyperlink(); //Gets the hyperlink\r\n\t\t\tmfilesDialog.close(); //Closes the Get Hyperlink dialog\r\n\r\n\t\t\tLog.message(\"5. Hyperlink is copied and Get Hyperlink dialog is closed.\");\r\n\r\n\t\t\t//Step-6 : Open the copied Hyperlink in the browser\r\n\t\t\t//-------------------------------------------------\r\n\t\t\thomePage = Utility.navigateToPage(driver, hyperlinkText, userName, password, \"\"); //Navigates to the hyperlink url\r\n\r\n\r\n\t\t\tif (!driver.getCurrentUrl().equalsIgnoreCase(hyperlinkText))\r\n\t\t\t\tthrow new Exception (\"Browser is not opened with copied object Hyperlink.[Expected URL: \"+hyperlinkText+\" & Current URL : \"+ driver.getCurrentUrl() +\"]\");\r\n\r\n\t\t\tLog.message(\"6. Object Hyperlink is opened in the browser.\");\r\n\r\n\t\t\t//Verification : Verify if default layout is displayed\r\n\t\t\t//----------------------------------------------------\r\n\t\t\tString unAvailableLayouts = \"\";\r\n\r\n\t\t\tif (homePage.isSearchbarPresent()) //Checks if Search bar present\r\n\t\t\t\tunAvailableLayouts = \"Search Bar is available;\";\r\n\r\n\t\t\tif (homePage.isTaskPaneDisplayed()) //Checks if Task Pane present\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Task Pane is available;\";\r\n\r\n\t\t\tif (homePage.previewPane.isTabExists(Caption.PreviewPane.MetadataTab.Value))\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Properties Pane is available;\";\r\n\r\n\t\t\tif (homePage.menuBar.isMenuInMenubarDisplayed()) //Checks if Menu Bar present\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Menu Bar is available;\";\r\n\r\n\t\t\tif (homePage.menuBar.isBreadCrumbDisplayed()) //Checks if Breadcrumb present\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Breadcrumb is available;\";\r\n\r\n\t\t\tif (homePage.taskPanel.isAppletEnabled())\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Java Applet is available;\";\r\n\r\n\t\t\tif (!homePage.isListViewDisplayed())\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"List View is not available;\";\r\n\r\n\t\t\tif (homePage.isTreeViewDisplayed())\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Tree View is available;\";\r\n\r\n\t\t\tif (unAvailableLayouts.equals(\"\")) //Verifies default layout have selected default custom layout\r\n\t\t\t\tLog.pass(\"Test case Passed. Hyperlink URL page is displayed as .\" + Caption.ConfigSettings.Config_ListingPaneOnly.Value);\r\n\t\t\telse\r\n\t\t\t\tLog.fail(\"Test case Failed. Few layots are not as expected on selecting \" + Caption.ConfigSettings.Config_ListingPaneOnly.Value + \". Refer additional information : \" \r\n\t\t\t\t\t\t+ unAvailableLayouts, driver);\r\n\t\t}\r\n\t\tcatch (Exception e) {\r\n\t\t\tLog.exception(e, driver);\r\n\t\t} //End catch\r\n\r\n\t\tfinally {\r\n\r\n\t\t\tif(driver != null){\r\n\t\t\t\ttry\r\n\t\t\t\t{\r\n\t\t\t\t\tdriver.get(configURL);\r\n\r\n\t\t\t\t\tConfigurationPage configurationPage = new ConfigurationPage(driver);\r\n\t\t\t\t\tconfigurationPage.treeView.clickTreeViewItem(Caption.ConfigSettings.VaultSpecificSettings.Value + \">>\" + testVault); //Clicks tree view item\r\n\r\n\t\t\t\t\tconfigurationPage.configurationPanel.setLayout(Caption.ConfigSettings.Config_Default.Value);\r\n\r\n\t\t\t\t\tif (!configurationPage.configurationPanel.saveSettings())\r\n\t\t\t\t\t\tthrow new Exception(\"Configuration settings are not saved.\");\r\n\t\t\t\t}\r\n\t\t\t\tcatch(Exception e0)\r\n\t\t\t\t{\r\n\t\t\t\t\tLog.exception(e0, driver);\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t\tUtility.quitDriver(driver);\r\n\r\n\t\t} //End finally\r\n\r\n\t}", "@Test(dataProviderClass = DataProviderUtils.class, dataProvider = \"excelDataReader\", groups = { \"Sprint54\", \"Get Hyperlink\"}, \r\n\t\t\tdescription = \"No Java applet and no task area layout will be displayed for hyperlink url on selecting No Java applet and no task area layout in configuration and default in hyperlink dialog - Operations menu.\")\r\n\tpublic void SprintTest54_1_30_4A_1B(HashMap<String,String> dataValues, String driverType) throws Exception {\r\n\r\n\t\tdriver = null; \r\n\r\n\t\ttry {\r\n\r\n\r\n\r\n\r\n\r\n\t\t\tdriver = WebDriverUtils.getDriver();\r\n\r\n\r\n\t\t\tConcurrentHashMap <String, String> dataPool = new ConcurrentHashMap <String, String>(dataValues);\r\n\t\t\tConfigurationPage configurationPage = LoginPage.launchDriverAndLoginToConfig(driver, true); //Launched driver and logged in\r\n\r\n\t\t\t//Step-1 : Navigate to Vault in tree view\r\n\t\t\t//---------------------------------------\r\n\t\t\tconfigurationPage.treeView.clickTreeViewItem(Caption.ConfigSettings.VaultSpecificSettings.Value + \">>\" + testVault); //Clicks tree view item\r\n\r\n\r\n\t\t\tif (!configurationPage.configurationPanel.getPageName().toUpperCase().equalsIgnoreCase(testVault.toUpperCase())) //Checks if navigated to vault settings page\r\n\t\t\t\tthrow new Exception(\"Vault settings page in configuration is not opened.\");\r\n\r\n\t\t\tLog.message(\"1. Navigated to Vault settings page.\");\r\n\r\n\t\t\t//Step-2 : Select No Java applet and No task area layout layout and save the settings\r\n\t\t\t//--------------------------------------------------------------------\r\n\t\t\tconfigurationPage.configurationPanel.setJavaApplet(Caption.ConfigSettings.Config_Disable.Value);\r\n\r\n\t\t\tif(configurationPage.configurationPanel.isJavaAppletEnabled())\r\n\t\t\t\tthrow new Exception(\"Java applet is enabled\");\r\n\r\n\t\t\tconfigurationPage.configurationPanel.setLayout(Caption.ConfigSettings.Config_NoTaskArea.Value);\r\n\r\n\t\t\tif (!configurationPage.configurationPanel.saveSettings()) //Save the settings\r\n\t\t\t\tthrow new Exception(\"Configuration settings are not saved after changing its layout.\");\r\n\r\n\t\t\tLog.message(\"1. No java applet and no task area layout is selected and saved.\");\r\n\r\n\t\t\tif (!configurationPage.logOut()) //Logs out from configuration page\r\n\t\t\t\tthrow new Exception(\"Log out is not successful after saving the settings in configuration page.\");\r\n\r\n\t\t\tLog.message(\"2. No Java applet and no task area layout is selected and settings are saved in configuration page & log out from the configuration page.\");\r\n\r\n\t\t\t//Step-3 : Login to the default page and navigate to any view\r\n\t\t\t//--------------------------------------------------------------------------\r\n\t\t\tHomePage homePage = LoginPage.launchDriverAndLogin(driver, false); //Launches and logs into the default page\r\n\r\n\t\t\tString viewToNavigate = SearchPanel.searchOrNavigatetoView(driver, dataPool.get(\"NavigateToView\"), dataPool.get(\"ObjectName\"));\r\n\r\n\t\t\tLog.message(\"3. Logged into the default page and navigated to '\" + viewToNavigate + \"' view.\");\r\n\r\n\t\t\t//Step-4 : Open Get Hyperlink dialog for the object from operations menu\r\n\t\t\t//-----------------------------------------------------------------------\r\n\t\t\tif (!homePage.listView.clickItem(dataPool.get(\"ObjectName\"))) //Selects the Object in the list\r\n\t\t\t\tthrow new Exception(\"Object (\" + dataPool.get(\"ObjectName\") + \") is not got selected.\");\r\n\r\n\t\t\thomePage.menuBar.ClickOperationsMenu(Caption.MenuItems.GetMFilesWebURL.Value); //Selects Get Hyperlink from operations menu\r\n\r\n\t\t\tMFilesDialog mfilesDialog = new MFilesDialog(driver); //Instantiating MFilesDialog wrapper class\r\n\r\n\t\t\tif (!mfilesDialog.isGetMFilesWebURLDialogOpened()) //Checks for MFiles dialog title\r\n\t\t\t\tthrow new Exception(\"M-Files dialog with 'Get Hyperlink' title is not opened.\");\r\n\r\n\t\t\tLog.message(\"4. Hyperlink dialog of an object (\" + dataPool.get(\"ObjectName\") + \") is opened through operations menu.\");\r\n\r\n\t\t\t//Step-5 : Copy the link from text box and close the Get Hyperlink dialog\r\n\t\t\t//-----------------------------------------------------------------------\r\n\t\t\tString hyperlinkText = mfilesDialog.getHyperlink(); //Gets the hyperlink\r\n\t\t\tmfilesDialog.close(); //Closes the Get Hyperlink dialog\r\n\r\n\t\t\tLog.message(\"5. Hyperlink is copied and Get Hyperlink dialog is closed.\");\r\n\r\n\t\t\t//Step-6 : Open the copied Hyperlink in the browser\r\n\t\t\t//-------------------------------------------------\r\n\t\t\thomePage = Utility.navigateToPage(driver, hyperlinkText, userName, password, \"\"); //Navigates to the hyperlink url\r\n\r\n\r\n\t\t\tif (!driver.getCurrentUrl().equalsIgnoreCase(hyperlinkText))\r\n\t\t\t\tthrow new Exception (\"Browser is not opened with copied object Hyperlink.[Expected URL: \"+hyperlinkText+\" & Current URL : \"+ driver.getCurrentUrl() +\"]\");\r\n\r\n\t\t\tLog.message(\"6. Object Hyperlink is opened in the browser.\");\r\n\r\n\t\t\t//Verification : Verify if default layout is displayed\r\n\t\t\t//----------------------------------------------------\r\n\t\t\tString unAvailableLayouts = \"\";\r\n\r\n\t\t\tif (!homePage.isSearchbarPresent()) //Checks if Search bar present\r\n\t\t\t\tunAvailableLayouts = \"Search Bar is not available;\";\r\n\r\n\t\t\tif (homePage.isTaskPaneDisplayed()) //Checks if Task Pane present\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Task Pane is available;\";\r\n\r\n\t\t\tif (!homePage.previewPane.isTabExists(Caption.PreviewPane.MetadataTab.Value))\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Properties Pane is not available;\";\r\n\r\n\t\t\tif (!homePage.menuBar.isMenuInMenubarDisplayed()) //Checks if Menu Bar present\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Menu Bar is not available;\";\r\n\r\n\t\t\tif (!homePage.menuBar.isBreadCrumbDisplayed()) //Checks if Breadcrumb present\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Breadcrumb is not available;\";\r\n\r\n\t\t\tif (homePage.taskPanel.isAppletEnabled())\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Java Applet is available;\";\r\n\r\n\t\t\tif (!homePage.isListViewDisplayed())\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"List View is not available;\";\r\n\r\n\t\t\tif (homePage.isTreeViewDisplayed())\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Tree View is available;\";\r\n\r\n\t\t\tif (unAvailableLayouts.equals(\"\")) //Verifies default layout have selected default custom layout\r\n\t\t\t\tLog.pass(\"Test case Passed. Hyperlink URL page is displayed as No java applet and No task area layout.\");\r\n\t\t\telse\r\n\t\t\t\tLog.fail(\"Test case Failed. Few layots are not as expected on selecting No java applet and No task area layout.\"\r\n\t\t\t\t\t\t+ unAvailableLayouts, driver);\r\n\t\t}\r\n\t\tcatch (Exception e) {\r\n\t\t\tLog.exception(e, driver);\r\n\t\t} //End catch\r\n\r\n\t\tfinally {\r\n\r\n\t\t\tif(driver != null){\r\n\t\t\t\ttry\r\n\t\t\t\t{\r\n\t\t\t\t\tdriver.get(configURL);\r\n\r\n\t\t\t\t\tConfigurationPage configurationPage = new ConfigurationPage(driver);\r\n\t\t\t\t\tconfigurationPage.treeView.clickTreeViewItem(Caption.ConfigSettings.VaultSpecificSettings.Value + \">>\" + testVault); //Clicks tree view item\r\n\r\n\t\t\t\t\tconfigurationPage.configurationPanel.setLayout(Caption.ConfigSettings.Config_Default.Value);\r\n\r\n\t\t\t\t\tif (!configurationPage.configurationPanel.saveSettings())\r\n\t\t\t\t\t\tthrow new Exception(\"Configuration settings are not saved.\");\r\n\t\t\t\t}\r\n\t\t\t\tcatch(Exception e0)\r\n\t\t\t\t{\r\n\t\t\t\t\tLog.exception(e0, driver);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tUtility.quitDriver(driver);\r\n\r\n\t\t} //End finally\r\n\r\n\t}", "@Test(dataProviderClass = DataProviderUtils.class, dataProvider = \"excelDataReader\", groups = { \"Sprint54\", \"Get Hyperlink\", \"SKIP_JavaApplet\"}, \r\n\t\t\tdescription = \"Default layout with navigation pane will be displayed for hyperlink url on selecting Default layout with navigation pane layout in configuration and default in hyperlink dialog - Context menu.\")\r\n\tpublic void SprintTest54_1_30_2A_1A(HashMap<String,String> dataValues, String driverType) throws Exception {\r\n\r\n\t\tdriver = null; \r\n\r\n\t\ttry {\r\n\r\n\r\n\r\n\r\n\t\t\tdriver = WebDriverUtils.getDriver();\r\n\r\n\r\n\t\t\tConcurrentHashMap <String, String> dataPool = new ConcurrentHashMap <String, String>(dataValues);\r\n\t\t\tConfigurationPage configurationPage = LoginPage.launchDriverAndLoginToConfig(driver, true); //Launched driver and logged in\r\n\r\n\t\t\t//Step-1 : Navigate to Vault in tree view\r\n\t\t\t//-----------------------------------------\r\n\t\t\tconfigurationPage.treeView.clickTreeViewItem(Caption.ConfigSettings.VaultSpecificSettings.Value + \">>\" + testVault); //Clicks tree view item\r\n\r\n\r\n\t\t\tif (!configurationPage.configurationPanel.getPageName().toUpperCase().equalsIgnoreCase(testVault.toUpperCase())) //Checks if navigated to vault settings page\r\n\t\t\t\tthrow new Exception(\"Vault settings page in configuration is not opened.\");\r\n\r\n\t\t\tLog.message(\"1. Navigated to Vault settings page.\");\r\n\r\n\t\t\t//Step-2 : Select Default and navigate pane layout and save the settings\r\n\t\t\t//--------------------------------------------------------------------\r\n\t\t\tconfigurationPage.configurationPanel.setLayout(Caption.ConfigSettings.Config_DefaultAndNavigation.Value); //Sets as Default layout with navigation pane layout\r\n\r\n\t\t\tif (!configurationPage.configurationPanel.getLayout().equalsIgnoreCase(Caption.ConfigSettings.Config_DefaultAndNavigation.Value)) //Verifies if Default layout with navigation pane is selected\r\n\t\t\t\tthrow new Exception(Caption.ConfigSettings.Config_DefaultAndNavigation.Value + \" layout is not selected.\");\r\n\r\n\t\t\tif (!configurationPage.configurationPanel.saveSettings()) //Saves the settings\r\n\t\t\t\tthrow new Exception(\"Settings are not saved properly.\");\r\n\r\n\t\t\tif (!configurationPage.logOut()) //Logs out from configuration page\r\n\t\t\t\tthrow new Exception(\"Log out is not successful after saving the settings in configuration page.\");\r\n\r\n\t\t\tLog.message(\"2. \" + Caption.ConfigSettings.Config_DefaultAndNavigation.Value + \" layout is selected and settings are saved.\");\r\n\r\n\t\t\t//Step-3 : Login to the default page and navigate to any view\r\n\t\t\t//--------------------------------------------------------------------------\r\n\t\t\tHomePage homePage = LoginPage.launchDriverAndLogin(driver, false); //Launches and logs into the default page\r\n\r\n\t\t\tString viewToNavigate = SearchPanel.searchOrNavigatetoView(driver, dataPool.get(\"NavigateToView\"), dataPool.get(\"ObjectName\"));\r\n\r\n\t\t\tLog.message(\"3. Logged into the default page and navigated to '\" + viewToNavigate + \"' view.\");\r\n\r\n\t\t\t//Step-4 : Open Get Hyperlink dialog for the object from context menu\r\n\t\t\t//-------------------------------------------------------------------\r\n\t\t\tif (!homePage.listView.rightClickItem(dataPool.get(\"ObjectName\"))) //Selects the Object in the list\r\n\t\t\t\tthrow new Exception(\"Object (\" + dataPool.get(\"ObjectName\") + \") is not got selected.\");\r\n\r\n\t\t\thomePage.listView.clickContextMenuItem(Caption.MenuItems.GetMFilesWebURL.Value); //Selects Get Hyperlink from context menu\r\n\r\n\t\t\tMFilesDialog mfilesDialog = new MFilesDialog(driver); //Instantiating MFilesDialog wrapper class\r\n\r\n\t\t\tif (!mfilesDialog.isGetMFilesWebURLDialogOpened()) //Checks for MFiles dialog title\r\n\t\t\t\tthrow new Exception(\"M-Files dialog with 'Get Hyperlink' title is not opened.\");\r\n\r\n\t\t\tLog.message(\"4. Hyperlink dialog of an object (\" + dataPool.get(\"ObjectName\") + \") is opened through context menu.\");\r\n\r\n\t\t\t//Step-5 : Copy the link from text box and close the Get Hyperlink dialog\r\n\t\t\t//-----------------------------------------------------------------------\r\n\t\t\tString hyperlinkText = mfilesDialog.getHyperlink(); //Gets the hyperlink\r\n\t\t\tmfilesDialog.close(); //Closes the Get Hyperlink dialog\r\n\r\n\t\t\tLog.message(\"5. Hyperlink is copied and Get Hyperlink dialog is closed.\");\r\n\r\n\t\t\t//Step-6 : Open the copied Hyperlink in the browser\r\n\t\t\t//-------------------------------------------------\r\n\t\t\thomePage = Utility.navigateToPage(driver, hyperlinkText, userName, password, \"\"); //Navigates to the hyperlink url\r\n\r\n\t\t\tif (!driver.getCurrentUrl().equalsIgnoreCase(hyperlinkText))\r\n\t\t\t\tthrow new Exception (\"Browser is not opened with copied object Hyperlink.[Expected URL: \"+hyperlinkText+\" & Current URL : \"+ driver.getCurrentUrl() +\"]\");\r\n\r\n\t\t\tLog.message(\"6. Object Hyperlink is opened in the browser.\");\r\n\r\n\t\t\t//Verification : Verify if default layout is displayed\r\n\t\t\t//----------------------------------------------------\r\n\t\t\tString unAvailableLayouts = \"\";\r\n\r\n\t\t\tif (!homePage.isSearchbarPresent()) //Checks if Search bar present\r\n\t\t\t\tunAvailableLayouts = \"Search Bar\";\r\n\r\n\t\t\tif (!homePage.isTaskPaneDisplayed()) //Checks if Task Pane present\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Task Pane;\";\r\n\r\n\t\t\tif (!homePage.previewPane.isTabExists(Caption.PreviewPane.MetadataTab.Value))\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Properties Pane;\";\r\n\r\n\t\t\tif (!homePage.menuBar.isMenuInMenubarDisplayed()) //Checks if Menu Bar present\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Menu Bar;\";\r\n\r\n\t\t\tif (!homePage.menuBar.isBreadCrumbDisplayed()) //Checks if Breadcrumb present\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Breadcrumb;\";\r\n\r\n\t\t\tif (!homePage.taskPanel.isAppletEnabled())\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Java Applet;\";\r\n\r\n\t\t\tif (!homePage.isListViewDisplayed())\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Metadatacard;\";\r\n\r\n\t\t\tif (!homePage.isTreeViewDisplayed())\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Tree View;\";\r\n\r\n\t\t\tif (unAvailableLayouts.equals(\"\")) //Verifies default layout have selected default custom layout\r\n\t\t\t\tLog.pass(\"Test case Passed. Hyperlink URL page is displayed as Default layout with Navigation pane.\");\r\n\t\t\telse\r\n\t\t\t\tLog.fail(\"Test case Failed. Few layots are missing on selecting 'Default layout and navigation pane' layout. Missed layots : \" \r\n\t\t\t\t\t\t+ unAvailableLayouts, driver);\r\n\r\n\t\t}\r\n\t\tcatch (Exception e) {\r\n\t\t\tLog.exception(e, driver);\r\n\t\t} //End catch\r\n\r\n\t\tfinally {\r\n\r\n\t\t\tif(driver != null){\r\n\t\t\t\ttry\r\n\t\t\t\t{\r\n\t\t\t\t\tdriver.get(configURL);\r\n\r\n\t\t\t\t\tConfigurationPage configurationPage = new ConfigurationPage(driver);\r\n\t\t\t\t\tconfigurationPage.treeView.clickTreeViewItem(Caption.ConfigSettings.VaultSpecificSettings.Value + \">>\" + testVault); //Clicks tree view item\r\n\r\n\t\t\t\t\tconfigurationPage.configurationPanel.setLayout(Caption.ConfigSettings.Config_Default.Value);\r\n\r\n\t\t\t\t\tif (!configurationPage.configurationPanel.saveSettings())\r\n\t\t\t\t\t\tthrow new Exception(\"Configuration settings are not saved.\");\r\n\t\t\t\t}\r\n\t\t\t\tcatch(Exception e0)\r\n\t\t\t\t{\r\n\t\t\t\t\tLog.exception(e0, driver);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tUtility.quitDriver(driver);\r\n\r\n\t\t} //End finally\r\n\r\n\t}", "public static void viewPage(WebDriver driver, String sTestCaseName) throws Exception{\r\n\t\r\n\t\t//Check that all of the elements of that are expected are displayed\r\n\t\tObjects_Job_Completion_Summary_Page.lbl_Summary(driver).isDisplayed();{\r\n\t\tLog.info(sTestCaseName + \" | Summary label displayed as expected\");\r\n\t\t}\r\n\r\n\t\tif (\"Exchange_1_End_To_End_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t||\"INST_14_End_To_End_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t||\"Exchange_19_End_To_End_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t||\"Exchange_1_End_To_End_Spark_Chrome\".equals(sTestCaseName))\r\n\t\t{ \r\n\t\t\tObjects_Job_Completion_Summary_Page.lbl_Gas_Meter_Mprn(driver).isDisplayed();{\r\n\t\t\tLog.info(sTestCaseName + \" | Gas Meter MPRN label displayed as expected\");\r\n\t\t\t}\t\t\r\n\t\t}\r\n\t\telse if (\"Exchange_2_End_To_End_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"NMEX_5_End_To_End_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"INST_15_End_To_End_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"Exchange_20_End_To_End_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"Exchange_11_End_To_End_Spark_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"Exchange_2_End_To_End_Spark_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"Exchange_5_End_To_End_Spark_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"FLTY_2_End_To_End_Spark_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"INST_5_End_To_End_Spark_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"INST_8_End_To_End_ECOT_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"NMEX_5_End_To_End_Spark_Chrome\".equals(sTestCaseName))\r\n\t\t{ \r\n\t\t\tObjects_Job_Completion_Summary_Page.lbl_Electricity_Meter_Mpan(driver).isDisplayed();{\r\n\t\t\tLog.info(sTestCaseName + \" | Electricity Meter MPAN label displayed as expected\");\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"Doing the elseif\"); \r\n\t\t}\r\n\t\telse if (\"Exchange_3_End_To_End_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"Exchange_9_End_To_End_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"Exchange_3_Elec_HAN_WAN_Checks_Page_Abort_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"Exchange_3_Gas_Meter_Post_Installation_Gas_Tightness_Test_Abort_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"Exchange_3_Gas_Meter_Pre_Installation_Gas_Tightness_Test_Failed_Test_Abort_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"Exchange_3_Gas_Meter_Pre_Installation_Gas_Tightness_Test_Low_Pressure_Abort_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"Exchange_3_Gas_Risk_Assessment_Gas_Abort_Low_Pressure_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"Exchange_3_Gas_Risk_Assessment_Gas_Abort_Med_Pressure_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"Exchange_3_Gas_SMeter_Post_Installation_Pressure_Drop_Abort_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"Exchange_9_Elec_HAN_WAN_Checks_Page_Abort_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"Exchange_9_Gas_Meter_Initial_Risk_Assessment_Gas_Abort_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"Exchange_9_Gas_Meter_Post_Installation_Gas_Tightness_Test_Abort_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"Exchange_9_Gas_Meter_Pre_Installation_Gas_Tightness_Test_Failed_Test_Abort_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"Exchange_9_Gas_Meter_Pre_Installation_Gas_Tightness_Test_Low_Pressure_Abort_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"Exchange_9_Gas_Risk_Assessment_Gas_Abort_Low_Pressure_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"Exchange_9_Gas_Risk_Assessment_Gas_Abort_Med_Pressure_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"FLTY_17_Gas_Meter_Post_Installation_Gas_Tightness_Test_Abort_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"FLTY_17_Gas_Meter_Pre_Installation_Gas_Tightness_Test_Failed_Test_Abort_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"FLTY_17_Gas_Meter_Pre_Installation_Gas_Tightness_Test_Low_Pressure_Abort_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"FLTY_17_Gas_Risk_Assessment_Gas_Abort_Low_Pressure_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"FLTY_17_Gas_Risk_Assessment_Gas_Abort_Med_Pressure_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"FLTY_17_Gas_Suitable_For_Smart_Installation_Abort_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"Exchange_21_End_To_End_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"INST_16_End_To_End_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"Exchange_9_End_To_End_Spark_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"FLTY_17_End_To_End_Spark_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"INST_3_End_To_End_ECOT_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"INST_12_End_To_End_ECOT_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"INST_12_Elec_HAN_WAN_Checks_Page_Abort_ECOT_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"INST_12_Elec_Initial_Polarity_Check_At_Meter_Page_Abort_ECOT_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"INST_12_Elec_Initial_Risk_Assessment_Page_Abort_ECOT_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"INST_12_Elec_Risk_Assessment_Page_Abort_ECOT_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"INST_12_Elec_Suitable_For_Smart_Installation_Page_Abort_ECOT_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"INST_12_End_To_End_Found_Meter_ECOT_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"INST_3_Elec_HAN_WAN_Checks_Page_Abort_ECOT_Chrome\".equals(sTestCaseName))\r\n\t\t{ \r\n\t\t\tObjects_Job_Completion_Summary_Page.lbl_Electricity_Meter_Mpan(driver).isDisplayed();{\r\n\t\t\tLog.info(sTestCaseName + \" | Electricity Meter MPAN label displayed as expected\");\r\n\t\t\t}\r\n\t\t \r\n\t\t\tObjects_Job_Completion_Summary_Page.lbl_Gas_Meter_Mprn(driver).isDisplayed();{\r\n\t\t\tLog.info(sTestCaseName + \" | Gas Meter MPRN label displayed as expected\");\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"Doing the elseif\"); \r\n\t\t} \r\n\t\telse \t\t\r\n\t\t{ \r\n\t\t\tSystem.out.println(\"Doing the else \"); \r\n\t\t}\t\t\t\t\t\t\r\n\t\tObjects_Job_Completion_Summary_Page.btn_Potential_Customer_Vulnerability_Identified_Yes(driver).isDisplayed();{\r\n\t\tLog.info(sTestCaseName + \" | Potential Customer Vulnerability Identified - Yes radio button displayed as expected\");\r\n\t\t}\r\n\t\t\r\n\t\tObjects_Job_Completion_Summary_Page.txt_Additional_Notes(driver).isDisplayed();{\r\n\t\tLog.info(sTestCaseName + \" | Additional notes textbox displayed as expected\");\r\n\t\t}\r\n\t\t\r\n\t\tObjects_Job_Completion_Summary_Page.btn_Customer_Agreement_Yes(driver).isDisplayed();{\r\n\t\tLog.info(sTestCaseName + \" | Customer Agreement - Yes radio button displayed as expected\");\r\n\t\t}\r\n\t\t\r\n\t\tObjects_Job_Completion_Summary_Page.btn_Customer_Agreement_No(driver).isDisplayed();{\r\n\t\tLog.info(sTestCaseName + \" | Customer Agreement - No radio button displayed as expected\");\r\n\t\t}\r\n\t\t\r\n\t\t\t\r\n\t\t//Take a screenshot to show what we've done\r\n\t\tUtils.takeScreenshot(driver, sTestCaseName + \"-viewPage\");\r\n\t\t\r\n\t//END OF VIEW PAGE METHOD\r\n\t}", "@Test(dataProviderClass = DataProviderUtils.class, dataProvider = \"excelDataReader\", groups = { \"Sprint54\", \"Get Hyperlink\", \"SKIP_JavaApplet\"}, \r\n\t\t\tdescription = \"Default layout with navigation pane will be displayed for hyperlink url on selecting Default layout with navigation pane layout in configuration and default in hyperlink dialog - Operations menu.\")\r\n\tpublic void SprintTest54_1_30_2A_1B(HashMap<String,String> dataValues, String driverType) throws Exception {\r\n\r\n\t\tdriver = null; \r\n\r\n\t\ttry {\r\n\r\n\r\n\r\n\t\t\tdriver = WebDriverUtils.getDriver();\r\n\r\n\t\t\tConcurrentHashMap <String, String> dataPool = new ConcurrentHashMap <String, String>(dataValues);\r\n\r\n\t\t\tConfigurationPage configurationPage = LoginPage.launchDriverAndLoginToConfig(driver, true); //Launched driver and logged in\r\n\r\n\t\t\t//Step-1 : Navigate to Vault in tree view\r\n\t\t\t//-----------------------------------------\r\n\t\t\tconfigurationPage.treeView.clickTreeViewItem(Caption.ConfigSettings.VaultSpecificSettings.Value + \">>\" + testVault); //Clicks tree view item\r\n\r\n\r\n\t\t\tif (!configurationPage.configurationPanel.getPageName().toUpperCase().equalsIgnoreCase(testVault.toUpperCase())) //Checks if navigated to vault settings page\r\n\t\t\t\tthrow new Exception(\"Vault settings page in configuration is not opened.\");\r\n\r\n\t\t\tLog.message(\"1. Navigated to Vault settings page.\");\r\n\r\n\t\t\t//Step-2 : Select Default and navigate pane layout and save the settings\r\n\t\t\t//--------------------------------------------------------------------\r\n\t\t\tconfigurationPage.configurationPanel.setLayout(Caption.ConfigSettings.Config_DefaultAndNavigation.Value); //Sets as Default and navigate pane layout\r\n\r\n\t\t\tif (!configurationPage.configurationPanel.getLayout().equalsIgnoreCase(Caption.ConfigSettings.Config_DefaultAndNavigation.Value)) //Verifies if Default and navigate pane layout is selected\r\n\t\t\t\tthrow new Exception(Caption.ConfigSettings.Config_DefaultAndNavigation.Value + \" layout is not selected.\");\r\n\r\n\t\t\tif (!configurationPage.configurationPanel.saveSettings()) //Saves the settings\r\n\t\t\t\tthrow new Exception(\"Settings are not saved properly.\");\r\n\r\n\t\t\tif (!configurationPage.logOut()) //Logs out from configuration page\r\n\t\t\t\tthrow new Exception(\"Log out is not successful after saving the settings in configuration page.\");\r\n\r\n\t\t\tLog.message(\"2. \" + Caption.ConfigSettings.Config_DefaultAndNavigation.Value + \" layout is selected and settings are saved.\");\r\n\r\n\t\t\t//Step-3 : Login to the default page and navigate to any view\r\n\t\t\t//--------------------------------------------------------------------------\r\n\t\t\tHomePage homePage = LoginPage.launchDriverAndLogin(driver, false); //Launches and logs into the default page\r\n\r\n\t\t\tString viewToNavigate = SearchPanel.searchOrNavigatetoView(driver, dataPool.get(\"NavigateToView\"), dataPool.get(\"ObjectName\"));\r\n\r\n\t\t\tLog.message(\"3. Logged into the default page and navigated to '\" + viewToNavigate + \"' view.\");\r\n\r\n\t\t\t//Step-4 : Open Get Hyperlink dialog for the object from operations menu\r\n\t\t\t//-----------------------------------------------------------------------\r\n\t\t\tif (!homePage.listView.clickItem(dataPool.get(\"ObjectName\"))) //Selects the Object in the list\r\n\t\t\t\tthrow new Exception(\"Object (\" + dataPool.get(\"ObjectName\") + \") is not got selected.\");\r\n\r\n\t\t\thomePage.menuBar.ClickOperationsMenu(Caption.MenuItems.GetMFilesWebURL.Value); //Selects Get Hyperlink from operations menu\r\n\r\n\t\t\tMFilesDialog mfilesDialog = new MFilesDialog(driver); //Instantiating MFilesDialog wrapper class\r\n\r\n\t\t\tif (!mfilesDialog.isGetMFilesWebURLDialogOpened()) //Checks for MFiles dialog title\r\n\t\t\t\tthrow new Exception(\"M-Files dialog with 'Get Hyperlink' title is not opened.\");\r\n\r\n\t\t\tLog.message(\"4. Hyperlink dialog of an object (\" + dataPool.get(\"ObjectName\") + \") is opened through operations menu.\");\r\n\r\n\t\t\t//Step-5 : Copy the link from text box and close the Get Hyperlink dialog\r\n\t\t\t//-----------------------------------------------------------------------\r\n\t\t\tString hyperlinkText = mfilesDialog.getHyperlink(); //Gets the hyperlink\r\n\t\t\tmfilesDialog.close(); //Closes the Get Hyperlink dialog\r\n\r\n\t\t\tLog.message(\"5. Hyperlink is copied and Get Hyperlink dialog is closed.\");\r\n\r\n\t\t\t//Step-6 : Open the copied Hyperlink in the browser\r\n\t\t\t//-------------------------------------------------\r\n\t\t\thomePage = Utility.navigateToPage(driver, hyperlinkText, userName, password, \"\"); //Navigates to the hyperlink url\r\n\r\n\t\t\tif (!driver.getCurrentUrl().equalsIgnoreCase(hyperlinkText))\r\n\t\t\t\tthrow new Exception (\"Browser is not opened with copied object Hyperlink.[Expected URL: \"+hyperlinkText+\" & Current URL : \"+ driver.getCurrentUrl() +\"]\");\r\n\r\n\t\t\tLog.message(\"6. Object Hyperlink is opened in the browser.\");\r\n\r\n\t\t\t//Verification : Verify if default layout is displayed\r\n\t\t\t//----------------------------------------------------\r\n\t\t\tString unAvailableLayouts = \"\";\r\n\r\n\t\t\tif (!homePage.isSearchbarPresent()) //Checks if Search bar present\r\n\t\t\t\tunAvailableLayouts = \"Search Bar\";\r\n\r\n\t\t\tif (!homePage.isTaskPaneDisplayed()) //Checks if Task Pane present\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Task Pane;\";\r\n\r\n\t\t\tif (!homePage.previewPane.isTabExists(Caption.PreviewPane.MetadataTab.Value))\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Properties Pane;\";\r\n\r\n\t\t\tif (!homePage.menuBar.isMenuInMenubarDisplayed()) //Checks if Menu Bar present\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Menu Bar;\";\r\n\r\n\t\t\tif (!homePage.menuBar.isBreadCrumbDisplayed()) //Checks if Breadcrumb present\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Breadcrumb;\";\r\n\r\n\t\t\tif (!homePage.taskPanel.isAppletEnabled())\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Java Applet;\";\r\n\r\n\t\t\tif (!homePage.isListViewDisplayed())\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Metadatacard;\";\r\n\r\n\t\t\tif (!homePage.isTreeViewDisplayed())\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Tree View;\";\r\n\r\n\t\t\tif(!homePage.isNavigationPaneDisplayed())\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Navigation Pane;\";\r\n\r\n\t\t\tif (unAvailableLayouts.equals(\"\")) //Verifies default layout have selected default custom layout\r\n\t\t\t\tLog.pass(\"Test case Passed. Hyperlink URL page is displayed as Default layout with Navigation pane.\");\r\n\t\t\telse\r\n\t\t\t\tLog.fail(\"Test case Failed. Few layots are missing on selecting 'Default layout and navigation pane' layout. Missed layots : \" \r\n\t\t\t\t\t\t+ unAvailableLayouts, driver);\r\n\r\n\t\t}\r\n\t\tcatch (Exception e) {\r\n\t\t\tLog.exception(e, driver);\r\n\t\t} //End catch\r\n\r\n\t\tfinally {\r\n\r\n\t\t\tif(driver != null){\r\n\t\t\t\ttry\r\n\t\t\t\t{\r\n\t\t\t\t\tdriver.get(configURL);\r\n\r\n\t\t\t\t\tConfigurationPage configurationPage = new ConfigurationPage(driver);\r\n\t\t\t\t\tconfigurationPage.treeView.clickTreeViewItem(Caption.ConfigSettings.VaultSpecificSettings.Value + \">>\" + testVault); //Clicks tree view item\r\n\r\n\t\t\t\t\tconfigurationPage.configurationPanel.setLayout(Caption.ConfigSettings.Config_Default.Value);\r\n\t\t\t\t\tconfigurationPage.configurationPanel.setJavaApplet(Caption.ConfigSettings.Config_Disable.Value);\r\n\r\n\t\t\t\t\tif (!configurationPage.configurationPanel.saveSettings())\r\n\t\t\t\t\t\tthrow new Exception(\"Configuration settings are not saved.\");\r\n\t\t\t\t}\r\n\t\t\t\tcatch(Exception e0)\r\n\t\t\t\t{\r\n\t\t\t\t\tLog.exception(e0, driver);\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t\tUtility.quitDriver(driver);\r\n\r\n\t\t} //End finally\r\n\r\n\t}", "@Test(dataProviderClass = DataProviderUtils.class, dataProvider = \"excelDataReader\", groups = { \"Sprint54\", \"Get Hyperlink\", \"SKIP_JavaApplet\"}, \r\n\t\t\tdescription = \"Default layout will be displayed for hyperlink url on selecting default layout in configuration and in hyperlink dialog - Context menu.\")\r\n\tpublic void SprintTest54_1_30_1A_1A(HashMap<String,String> dataValues, String driverType) throws Exception {\r\n\r\n\t\tdriver = null; \r\n\r\n\t\ttry {\r\n\r\n\r\n\r\n\t\t\tdriver = WebDriverUtils.getDriver();\r\n\r\n\t\t\tConcurrentHashMap <String, String> dataPool = new ConcurrentHashMap <String, String>(dataValues);\r\n\t\t\tHomePage homePage = LoginPage.launchDriverAndLogin(driver, true);\r\n\r\n\t\t\tConfigurationPage configurationPage = LoginPage.launchDriverAndLoginToConfig(driver, true); //Launched driver and logged in\r\n\r\n\t\t\t//Step-1 : Navigate to Vault in tree view\r\n\t\t\t//-----------------------------------------\r\n\t\t\tconfigurationPage.treeView.clickTreeViewItem(Caption.ConfigSettings.VaultSpecificSettings.Value + \">>\" + testVault); //Clicks tree view item\r\n\r\n\r\n\t\t\tif (!configurationPage.configurationPanel.getPageName().toUpperCase().equalsIgnoreCase(testVault.toUpperCase())) //Checks if navigated to vault settings page\r\n\t\t\t\tthrow new Exception(\"Vault settings page in configuration is not opened.\");\r\n\r\n\t\t\tLog.message(\"1. Navigated to Vault settings page.\");\r\n\r\n\t\t\t//Step-2 : Select Default layout and save the settings\r\n\t\t\t//----------------------------------------------------\r\n\t\t\tconfigurationPage.configurationPanel.setLayout(Caption.ConfigSettings.Config_Default.Value); //Sets as default layout\r\n\r\n\t\t\tconfigurationPage.configurationPanel.setJavaApplet(Caption.ConfigSettings.Config_Enable.Value);\r\n\r\n\r\n\t\t\tif (!configurationPage.configurationPanel.getLayout().equalsIgnoreCase(Caption.ConfigSettings.Config_Default.Value)) //Verifies if default layout is selected\r\n\t\t\t\tthrow new Exception(\"Default layout is not selected.\");\r\n\r\n\t\t\tif (!configurationPage.configurationPanel.saveSettings()) //Saves the settings\r\n\t\t\t\tthrow new Exception(\"Settings are not saved properly.\");\r\n\r\n\t\t\tif (!configurationPage.logOut()) //Logs out from configuration page\r\n\t\t\t\tthrow new Exception(\"Log out is not successful after saving the settings in configuration page.\");\r\n\r\n\t\t\tLog.message(\"2. Default layout is selected and settings are saved.\");\r\n\r\n\t\t\t//Step-3 : Login to the default page and navigate to any view\r\n\t\t\t//--------------------------------------------------------------------------\r\n\t\t\thomePage = LoginPage.launchDriverAndLogin(driver, false); //Launches and logs into the default page\r\n\r\n\t\t\tString viewToNavigate = SearchPanel.searchOrNavigatetoView(driver, dataPool.get(\"NavigateToView\"), dataPool.get(\"ObjectName\"));\r\n\r\n\t\t\tLog.message(\"3. Logged into the default page and navigated to '\" + viewToNavigate + \"' view.\");\r\n\r\n\t\t\t//Step-4 : Open Get Hyperlink dialog for the object from context menu\r\n\t\t\t//-------------------------------------------------------------------\r\n\t\t\tif (!homePage.listView.rightClickItem(dataPool.get(\"ObjectName\"))) //Selects the Object in the list\r\n\t\t\t\tthrow new Exception(\"Object (\" + dataPool.get(\"ObjectName\") + \") is not got selected.\");\r\n\r\n\t\t\thomePage.listView.clickContextMenuItem(Caption.MenuItems.GetMFilesWebURL.Value); //Selects Get Hyperlink from context menu\r\n\r\n\t\t\tMFilesDialog mfilesDialog = new MFilesDialog(driver); //Instantiating MFilesDialog wrapper class\r\n\r\n\t\t\tif (!mfilesDialog.isGetMFilesWebURLDialogOpened()) //Checks for MFiles dialog title\r\n\t\t\t\tthrow new Exception(\"M-Files dialog with 'Get Hyperlink' title is not opened.\");\r\n\r\n\t\t\tLog.message(\"4. Hyperlink dialog of an object (\" + dataPool.get(\"ObjectName\") + \") is opened through context menu.\");\r\n\r\n\t\t\t//Step-5 : Copy the link from text box and close the Get Hyperlink dialog\r\n\t\t\t//-----------------------------------------------------------------------\r\n\t\t\tString hyperlinkText = mfilesDialog.getHyperlink(); //Gets the hyperlink\r\n\t\t\tmfilesDialog.close(); //Closes the Get Hyperlink dialog\r\n\r\n\t\t\tLog.message(\"5. Hyperlink is copied and Get Hyperlink dialog is closed.\");\r\n\r\n\t\t\t//Step-6 : Open the copied Hyperlink in the browser\r\n\t\t\t//-------------------------------------------------\r\n\t\t\thomePage = Utility.navigateToPage(driver, hyperlinkText, userName, password, \"\"); //Navigates to the hyperlink url\r\n\r\n\t\t\tif (!driver.getCurrentUrl().equalsIgnoreCase(hyperlinkText))\r\n\t\t\t\tthrow new Exception (\"Browser is not opened with copied object Hyperlink.[Expected URL: \"+hyperlinkText+\" & Current URL : \"+ driver.getCurrentUrl() +\"]\");\r\n\r\n\t\t\tLog.message(\"6. Object Hyperlink is opened in the browser.\");\r\n\r\n\t\t\t//Verification : Verify if default layout is displayed\r\n\t\t\t//----------------------------------------------------\r\n\t\t\tString unAvailableLayouts = \"\";\r\n\r\n\t\t\tif (!homePage.isSearchbarPresent()) //Checks if Search bar present\r\n\t\t\t\tunAvailableLayouts = \"Search Bar\";\r\n\r\n\t\t\tif (!homePage.isTaskPaneDisplayed()) //Checks if Task Pane present\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Task Pane;\";\r\n\r\n\t\t\tif (!homePage.previewPane.isTabExists(Caption.PreviewPane.MetadataTab.Value))\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Properties Pane;\";\r\n\r\n\t\t\tif (!homePage.menuBar.isMenuInMenubarDisplayed()) //Checks if Menu Bar present\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Menu Bar;\";\r\n\r\n\t\t\tif (!homePage.menuBar.isBreadCrumbDisplayed()) //Checks if Breadcrumb present\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Breadcrumb;\";\r\n\r\n\t\t\tif (!homePage.taskPanel.isAppletEnabled())\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Java Applet;\";\r\n\r\n\t\t\tif (!homePage.isListViewDisplayed())\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Metadatacard;\";\r\n\r\n\t\t\tif (unAvailableLayouts.equals(\"\")) //Verifies default layout have selected default custom layout\r\n\t\t\t\tLog.pass(\"Test case Passed. Hyperlink URL page is displayed as Default layout.\");\r\n\t\t\telse\r\n\t\t\t\tLog.fail(\"Test case Failed. Few layots are missing on selecting 'Default' custom layout. Missed layots : \" \r\n\t\t\t\t\t\t+ unAvailableLayouts, driver);\r\n\r\n\t\t}\r\n\t\tcatch (Exception e) {\r\n\t\t\tLog.exception(e, driver);\r\n\t\t} //End catch\r\n\r\n\t\tfinally {\r\n\t\t\tUtility.quitDriver(driver);\r\n\t\t} //End finally\r\n\r\n\t}", "public void clickPresselGermany(){\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- PresselGermany link should be clicked\");\r\n\t\ttry{\r\n\r\n\t\t\tclick(locator_split(\"lnkPresselGermany\"));\r\n\t\t\tReporter.log(\"PASS_MESSAGE:- PresselGermany link is clicked\");\r\n\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- PresselGermany link is not clicked\");\r\n\t\t\tthrow new NoSuchElementException(\"The element with\"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"lnkPresselGermany\")\r\n\t\t\t\t\t+ \" not found\");\r\n\r\n\t\t}\r\n\r\n\t}", "public void clickCashondeliveryradiobutton(){\r\n\r\n\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- Cashondelivery Radio button clicked\");\r\n\t\ttry{\r\n\r\n\t\t\twaitforElementVisible(locator_split(\"Cashondelivery_Spain\"));\r\n\t\t\tclick(locator_split(\"Cashondelivery_Spain\"));\r\n\t\t\tThread.sleep(3000);\r\n\t\t\twaitforElementVisible(locator_split(\"Submitorder_Spain\"));\r\n\t\t\tclick(locator_split(\"Submitorder_Spain\"));\r\n\t\t\tReporter.log(\"PASS_MESSAGE:- Cashondelivery radio button clicked \");\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Cashondelivery Radio button is not clicked \"+elementProperties.getProperty(\"Cashondelivery_Spain\"));\r\n\t\t\tthrow new NoSuchElementException(\"The element with \"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"Cashondelivery_Spain\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ \" not found\");\r\n\r\n\t\t}\r\n\r\n\t}", "@Test(dataProviderClass = DataProviderUtils.class, dataProvider = \"excelDataReader\", groups = { \"Sprint54\", \"Get Hyperlink\"}, \r\n\t\t\tdescription = \"No Java applet layout will be displayed for hyperlink url on selecting No Java applet in configuration and default in hyperlink dialog - Operations menu.\")\r\n\tpublic void SprintTest54_1_30_3A_1B(HashMap<String,String> dataValues, String driverType) throws Exception {\r\n\r\n\t\tdriver = null; \r\n\r\n\t\ttry {\r\n\r\n\r\n\r\n\r\n\t\t\tdriver = WebDriverUtils.getDriver();\r\n\r\n\r\n\t\t\tConcurrentHashMap <String, String> dataPool = new ConcurrentHashMap <String, String>(dataValues);\r\n\t\t\tConfigurationPage configurationPage = LoginPage.launchDriverAndLoginToConfig(driver, true); //Launched driver and logged in\r\n\r\n\t\t\t//Step-1 : Navigate to Vault in tree view\r\n\t\t\t//-----------------------------------------\r\n\t\t\tconfigurationPage.treeView.clickTreeViewItem(Caption.ConfigSettings.VaultSpecificSettings.Value + \">>\" + testVault); //Clicks tree view item\r\n\r\n\r\n\t\t\tif (!configurationPage.configurationPanel.getPageName().toUpperCase().equalsIgnoreCase(testVault.toUpperCase())) //Checks if navigated to vault settings page\r\n\t\t\t\tthrow new Exception(\"Vault settings page in configuration is not opened.\");\r\n\r\n\t\t\tLog.message(\"1. Navigated to Vault settings page.\");\r\n\r\n\t\t\t//Step-2 : Select No Java applet layout layout and save the settings\r\n\t\t\t//--------------------------------------------------------------------\r\n\t\t\tconfigurationPage.configurationPanel.setJavaApplet(Caption.ConfigSettings.Config_Disable.Value);//Disabled the java applet in configuration page\r\n\r\n\t\t\tif(configurationPage.configurationPanel.isJavaAppletEnabled())//Verify if java applet is disabled or not\r\n\t\t\t\tthrow new Exception(\"Java applet is enabled.\");\r\n\r\n\t\t\tif (!configurationPage.configurationPanel.saveSettings()) //Save the settings in configuration page\r\n\t\t\t\tthrow new Exception(\"Configuration settings are not saved after changing its layout.\");\r\n\r\n\t\t\tLog.message(\"1. Java applet is disabled and Configuration settings are saved.\");\r\n\r\n\t\t\tif (!configurationPage.logOut()) //Logs out from configuration page\r\n\t\t\t\tthrow new Exception(\"Log out is not successful after saving the settings in configuration page.\");\r\n\r\n\t\t\tLog.message(\"2. No java applet layout is selected and settings are saved.\");\r\n\r\n\t\t\t//Step-3 : Login to the default page and navigate to any view\r\n\t\t\t//--------------------------------------------------------------------------\r\n\t\t\tHomePage homePage = LoginPage.launchDriverAndLogin(driver, false); //Launches and logs into the default page\r\n\r\n\t\t\tString viewToNavigate = SearchPanel.searchOrNavigatetoView(driver, dataPool.get(\"NavigateToView\"), dataPool.get(\"ObjectName\"));\r\n\r\n\t\t\tLog.message(\"3. Logged into the default page and navigated to '\" + viewToNavigate + \"' view.\");\r\n\r\n\t\t\t//Step-4 : Open Get Hyperlink dialog for the object from operations menu\r\n\t\t\t//-----------------------------------------------------------------------\r\n\t\t\tif (!homePage.listView.clickItem(dataPool.get(\"ObjectName\"))) //Selects the Object in the list\r\n\t\t\t\tthrow new Exception(\"Object (\" + dataPool.get(\"ObjectName\") + \") is not got selected.\");\r\n\r\n\t\t\thomePage.menuBar.ClickOperationsMenu(Caption.MenuItems.GetMFilesWebURL.Value); //Selects Get Hyperlink from operations menu\r\n\r\n\t\t\tMFilesDialog mfilesDialog = new MFilesDialog(driver); //Instantiating MFilesDialog wrapper class\r\n\r\n\t\t\tif (!mfilesDialog.isGetMFilesWebURLDialogOpened()) //Checks for MFiles dialog title\r\n\t\t\t\tthrow new Exception(\"M-Files dialog with 'Get Hyperlink' title is not opened.\");\r\n\r\n\t\t\tLog.message(\"4. Hyperlink dialog of an object (\" + dataPool.get(\"ObjectName\") + \") is opened through operations menu.\");\r\n\r\n\t\t\t//Step-5 : Copy the link from text box and close the Get Hyperlink dialog\r\n\t\t\t//-----------------------------------------------------------------------\r\n\t\t\tString hyperlinkText = mfilesDialog.getHyperlink(); //Gets the hyperlink\r\n\t\t\tmfilesDialog.close(); //Closes the Get Hyperlink dialog\r\n\r\n\t\t\tLog.message(\"5. Hyperlink is copied and Get Hyperlink dialog is closed.\");\r\n\r\n\t\t\t//Step-6 : Open the copied Hyperlink in the browser\r\n\t\t\t//-------------------------------------------------\r\n\t\t\thomePage = Utility.navigateToPage(driver, hyperlinkText, userName, password, \"\"); //Navigates to the hyperlink url\r\n\r\n\r\n\t\t\tif (!driver.getCurrentUrl().equalsIgnoreCase(hyperlinkText))\r\n\t\t\t\tthrow new Exception (\"Browser is not opened with copied object Hyperlink.[Expected URL: \"+hyperlinkText+\" & Current URL : \"+ driver.getCurrentUrl() +\"]\");\r\n\r\n\t\t\tLog.message(\"6. Object Hyperlink is opened in the browser.\");\r\n\r\n\t\t\t//Verification : Verify if default layout is displayed\r\n\t\t\t//----------------------------------------------------\r\n\t\t\tString unAvailableLayouts = \"\";\r\n\r\n\t\t\tif (!homePage.isSearchbarPresent()) //Checks if Search bar present\r\n\t\t\t\tunAvailableLayouts = \"Search Bar is not available;\";\r\n\r\n\t\t\tif (!homePage.isTaskPaneDisplayed()) //Checks if Task Pane present\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Task Pane is not available;\";\r\n\r\n\t\t\tif (!homePage.previewPane.isTabExists(Caption.PreviewPane.MetadataTab.Value))\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Properties Pane is not available;\";\r\n\r\n\t\t\tif (!homePage.menuBar.isMenuInMenubarDisplayed()) //Checks if Menu Bar present\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Menu Bar is not available;\";\r\n\r\n\t\t\tif (!homePage.menuBar.isBreadCrumbDisplayed()) //Checks if Breadcrumb present\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Breadcrumb is not available;\";\r\n\r\n\t\t\tif (homePage.taskPanel.isAppletEnabled())\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Java Applet is available;\";\r\n\r\n\t\t\tif (!homePage.isListViewDisplayed())\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"List View is not available;\";\r\n\r\n\t\t\tif (homePage.isTreeViewDisplayed())\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Tree View is available;\";\r\n\r\n\t\t\tif (unAvailableLayouts.equals(\"\")) //Verifies default layout have selected default custom layout\r\n\t\t\t\tLog.pass(\"Test case Passed. Hyperlink URL page is displayed as No Java Applet layout.\");\r\n\t\t\telse\r\n\t\t\t\tLog.fail(\"Test case Failed. Few layots are not as expected on selecting 'No Java Applet layout'. Refer additional information : \" \r\n\t\t\t\t\t\t+ unAvailableLayouts, driver);\r\n\r\n\t\t}\r\n\t\tcatch (Exception e) {\r\n\t\t\tLog.exception(e, driver);\r\n\t\t} //End catch\r\n\r\n\t\tfinally {\r\n\r\n\t\t\tif(driver != null){\r\n\t\t\t\ttry\r\n\t\t\t\t{\r\n\t\t\t\t\tdriver.get(configURL);\r\n\r\n\t\t\t\t\tConfigurationPage configurationPage = new ConfigurationPage(driver);\r\n\t\t\t\t\tconfigurationPage.treeView.clickTreeViewItem(Caption.ConfigSettings.VaultSpecificSettings.Value + \">>\" + testVault); //Clicks tree view item\r\n\r\n\t\t\t\t\tconfigurationPage.configurationPanel.setLayout(Caption.ConfigSettings.Config_Default.Value);\r\n\r\n\t\t\t\t\tif (!configurationPage.configurationPanel.saveSettings())\r\n\t\t\t\t\t\tthrow new Exception(\"Configuration settings are not saved.\");\r\n\t\t\t\t}\r\n\t\t\t\tcatch(Exception e0)\r\n\t\t\t\t{\r\n\t\t\t\t\tLog.exception(e0, driver);\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t\tUtility.quitDriver(driver);\r\n\r\n\t\t} //End finally\r\n\r\n\t}", "@Test(priority = 0, description = \"Test case to verify Test Scenario 2\")\n\tpublic void testScenario2() {\n\t\tw.findElement(By.id(\"amount\")).sendKeys(\"400000\");\n\n\t\t// 2. Rate of Interest (%) as \"6\"\n\t\tw.findElement(By.id(\"rate\")).sendKeys(\"6\");\n\n\t\t// 3. Period (Years) as \"4\"\n\t\tw.findElement(By.id(\"years\")).sendKeys(\"4\");\n\n\t\t// Click on \"Submit\" button\n\t\tw.findElement(By.cssSelector(\"input[name='calculate']\")).click();\n\n\t\t// Verify / Validate below value under \"EMI CALCULATOR REPORT”:\n\n\t\tString emiCalReport2 = w.findElement(By.xpath(\"//*[@id=\\\"hpcontentbox\\\"]/div[5]/div[1]/div[1]/div[4]/div/div[1]\")).getText();\n\t\tAssert.assertTrue(true);\n\t\tSystem.out.println(\"\\n\");\n\t\tSystem.out.println(\"EMI CALCULATOR REPORT 2: \" + \"\\n\" + emiCalReport2);\n\n\t}", "@Test(priority = 2, description = \"Test case to verify Test Scenario 3\")\n\tpublic void testScenario3() {\n\t\tw.findElement(By.id(\"amount\")).sendKeys(\"800000\");\n\n\t\t// 2. Rate of Interest (%) as \"10\"\n\t\tw.findElement(By.id(\"rate\")).sendKeys(\"10\");\n\n\t\t// 3. Period (Years) as \"2\"\n\t\tw.findElement(By.id(\"years\")).sendKeys(\"2\");\n\n\t\t// Click on \"Submit\" button\n\t\tw.findElement(By.cssSelector(\"input[name='calculate']\")).click();\n\n\t\t// Verify / Validate below value under \"EMI CALCULATOR REPORT”:\n\n\t\tString emiCalReport3 = w.findElement(By.xpath(\"//*[@id=\\\"hpcontentbox\\\"]/div[5]/div[1]/div[1]/div[4]/div/div[1]\")).getText();\n\t\tAssert.assertTrue(true);\n\t\tSystem.out.println(\"\\n\");\n\t\tSystem.out.println(\"EMI CALCULATOR REPORT 3: \" + \"\\n\" + emiCalReport3);\n\t\tSystem.out.println(\"\\n\");\n\n\t}", "@Test\n\tpublic void creditEntrySEPA() throws Exception {\n\t\ttry {\n\t\t\t// Launch the browser and load the default URL\n\t\t\tUtility.initConfiguration();\n\t\t\tThread.sleep(3000);\n\t\t\t// Login to back end and check payment method is enabled or disabled\n\t\t\tUtility.wooCommerceBackEndLogin();\n\t\t\tThread.sleep(3000);\n\t\t\tElementLocators element = PageFactory.initElements(driver, ElementLocators.class);\n\t\t\t// Title for HTML report\n\t\t\ttest = extend.createTest(\"Vendor script execution for 'CREDIT_ENTRY_SEPA'\");\n\t\t\t// Steps\n\t\t\tActions actions = new Actions(driver);\n\t\t\tactions.moveToElement(element.WooCommerce).perform();\n\t\t\tThread.sleep(3000);\n\t\t\telement.WooCommerce_Settings.click();\n\t\t\telement.Payment_Tab.click();\n\t\t\tThread.sleep(2000);\n\t\t\telement.Sepa_Payment_Display.click();\n\t\t\t// Checking payment method enabled or disabled\n\t\t\tif (!element.Sepa_Enable_Payment_Method_Checkbox.isSelected()) {\n\t\t\t\telement.Sepa_Enable_Payment_Method_Checkbox.click();\n\t\t\t\tThread.sleep(3000);\n\t\t\t}\n\t\t\t// Checking Guarantee payment enabled or disabled\n\t\t\tif (element.Sepa_Enable_Payment_Guarantee_CheckBox.isSelected()) {\n\t\t\t\telement.Sepa_Enable_Payment_Guarantee_CheckBox.click();\n\t\t\t\tThread.sleep(3000);\n\t\t\t}\n\t\t\telement.Sepa_Payment_Save_Changes.click();\n\t\t\tThread.sleep(3000);\n\t\t\tdriver.navigate().to(Constant.shopfrontendurl);\n\t\t\tThread.sleep(3000);\n\t\t\tUtility.wooCommerceCheckOutProcess();\n\t\t\tThread.sleep(4000);\n\t\t\t// Read the datafrom excel sheet\n\t\t\tMap<String, String> UserData = new HashMap<String, String>();\n\t\t\tUserData = Data.ExcelReader_PaymentMethods();\n\t\t\t// Check whether payment method is displayed in checkout page\n\t\t\tif (element.Sepa_Label.isDisplayed()) {\n\t\t\t\tif (element.Sepa_Radio_button.isDisplayed() == true) {\n\t\t\t\t\telement.Sepa_Radio_button.click();\n\t\t\t\t}\n\t\t\t\tdriver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);\n\t\t\t\telement.Sepa_Iban_TextBox.sendKeys(UserData.get(\"SEPAIBAN\"));\n\t\t\t\telement.Place_Order.click();\n\t\t\t\tdriver.manage().timeouts().implicitlyWait(25, TimeUnit.SECONDS);\n\t\t\t\t// After order placed successfully verify Thank you message displayed\n\t\t\t\tString thankyoumessage = element.FE_Thank_You_Page_Text.getText();\n\t\t\t\tif (thankyoumessage.equals(\"Thank you. Your order has been received.\")) {\n\t\t\t\t\tSystem.out.println(\"Order placed successfully using Direct Debit SEPA\");\n\t\t\t\t\ttest.log(Status.INFO, \"Order placed successfully using Direct Debit SEPA\");\n\t\t\t\t\tThread.sleep(3000); // Get the amount from order success page front end\n\t\t\t\t\tString totalOrderAmount = element.OrderDetails_TotalAmount.getText().replaceAll(\"[^0-9]\", \"\");\n\t\t\t\t\tString TID = element.OrderDetails_Note_TID.getText().replaceAll(\"[^0-9]\", \"\");\n\t\t\t\t\tdriver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);\n\t\t\t\t\t// Go to callback execution site and enter vendor script URL\n\t\t\t\t\tdriver.navigate().to(Constant.vendorscripturl);\n\t\t\t\t\tThread.sleep(4000);\n\t\t\t\t\telement.Vendor_Script_Url.sendKeys((Constant.shopfrontendurl) + \"?wc-api=novalnet_callback\");\n\t\t\t\t\telement.Vendor_Id.clear();\n\t\t\t\t\telement.Vendor_Id.sendKeys(\"4\");\n\t\t\t\t\telement.Vendor_Auth_Code.clear();\n\t\t\t\t\telement.Vendor_Auth_Code.sendKeys(\"JyEtHUjjbHNJwVztW6JrafIMHQvici\");\n\t\t\t\t\telement.Product_Id.clear();\n\t\t\t\t\telement.Product_Id.sendKeys(\"14\");\n\t\t\t\t\telement.Tariff_Id.clear();\n\t\t\t\t\telement.Tariff_Id.sendKeys(\"30\");\n\t\t\t\t\telement.Payment_Type_Edit_Button.click();\n\t\t\t\t\tSelect selectpaymenttype = new Select(element.Payment_Type_Selectbox);\n\t\t\t\t\tselectpaymenttype.selectByVisibleText(\"CREDIT_ENTRY_SEPA\");\n\t\t\t\t\telement.Test_Mode.clear();\n\t\t\t\t\telement.Test_Mode.sendKeys(\"1\");\n\t\t\t\t\telement.Tid_Payment.clear();\n\t\t\t\t\telement.Tid_Payment.sendKeys(TID);\n\t\t\t\t\telement.Amount.clear();\n\t\t\t\t\telement.Amount.sendKeys(totalOrderAmount);\n\t\t\t\t\telement.Currency.clear();\n\t\t\t\t\telement.Currency.sendKeys(\"EUR\");\n\t\t\t\t\telement.Status.clear();\n\t\t\t\t\telement.Status.sendKeys(\"100\");\n\t\t\t\t\telement.Tid_Status.clear();\n\t\t\t\t\telement.Tid_Status.sendKeys(\"100\");\n\t\t\t\t\telement.Tid.clear();\n\t\t\t\t\telement.Tid.sendKeys(\"13245678945612345\");\n\t\t\t\t\telement.Execute_Button.click();\n\t\t\t\t\tString callback_message = element.callback_message.getText();\t\t\t\t\t\n\t\t\t\t\tString callback_message_updated = callback_message.substring(9, callback_message.length());\n\t\t\t\t\tSystem.out.println(\"Callback execution message: \" + callback_message_updated);\n\t\t\t\t\tif (callback_message.contains(\"Novalnet Callback Script executed successfully for the TID:\")) {\n\t\t\t\t\t\tThread.sleep(2000);\n\t\t\t\t\t\tdriver.navigate().to(Constant.shopbackendurl);\n\t\t\t\t\t\tThread.sleep(1000);\n\t\t\t\t\t\tactions.moveToElement(element.WooCommerce).perform();\n\t\t\t\t\t\tThread.sleep(1500);\n\t\t\t\t\t\telement.WooCommerce_Orders.click();\n\t\t\t\t\t\telement.Backend_Order_Number.click();\n\t\t\t\t\t\tString BEOrderNotesMessage = element.BE_OrderNotes_Message.getText();\n\t\t\t\t\t\tSystem.out.println(\"Back end order note: \" + BEOrderNotesMessage);\n\t\t\t\t\t\tif (callback_message_updated.equals(BEOrderNotesMessage)) {\n\t\t\t\t\t\t\tSystem.out.println(\n\t\t\t\t\t\t\t\t\t\"TC PASSED: CREDIT_ENTRY_SEPA execution message and back end order note message text was matched successfully\");\n\t\t\t\t\t\t\ttest.log(Status.PASS,\n\t\t\t\t\t\t\t\t\t\"TC PASSED: CREDIT_ENTRY_SEPA execution message and back end order note message text was matched successfully\");\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tSystem.out.println(\n\t\t\t\t\t\t\t\t\t\"TC FAILED: CREDIT_ENTRY_SEPA execution message and back end order note message text was not matched\");\n\t\t\t\t\t\t\ttest.log(Status.FAIL,\n\t\t\t\t\t\t\t\t\t\"TC FAILED: CREDIT_ENTRY_SEPA execution message and back end order note message text was not matched\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.out.println(\"ERROR: Callback response message is displayed wrongly\");\n\t\t\t\t\t\ttest.log(Status.ERROR, \"ERROR: Callback response message is displayed wrongly\");\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(\"TC FAILED: Order was not placed successfully using Direct Debit SEPA\");\n\t\t\t\t\ttest.log(Status.FAIL, \"TC FAILED: Order was not placed successfully using Direct Debit SEPA\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Close browser\n\t\t\tUtility.closeBrowser();\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"ERROR: Unexpected error from 'creditEntrySEPA' method\");\n\t\t\ttest.log(Status.ERROR, \"ERROR: Unexpected error from 'creditEntrySEPA' method\");\n\t\t}\n\t}", "@Test\n\tpublic void verifyNavigationonClickingLinksfromSideMenu() throws Exception {\n\t\tOverviewTradusPROPage overviewObj=new OverviewTradusPROPage(driver);\n\t\tif(!driver.getCurrentUrl().equals(\"https://pro.tradus.com/lms\")) {\n\t\t\toverviewObj.doLogIn(userName,pwd);\n\t\t}\n\t\texplicitWaitFortheElementTobeVisible(driver,overviewObj.overviewPageVerificationElement);\n\t\ttry {\n\t\tclick(overviewObj.overviewOptioninSiderBar);\n\t\t}catch(Exception e) {\n\t\t\tjsClick(driver,overviewObj.overviewOptioninSiderBar);\n\t\t}\n\t\texplicitWaitFortheElementTobeVisible(driver,overviewObj.overviewPageVerificationElement);\n\t\tAssert.assertTrue(driver.getCurrentUrl().equals(\"https://pro.tradus.com/lms\"), \n\t\t\t\t\"Overview page not displayed\");\n\t\ttry {\n\t\tclick(overviewObj.leadsOptioninSiderBar);\n\t\t}catch(Exception e) {\n\t\t\tjsClick(driver,overviewObj.leadsOptioninSiderBar);\n\t\t}\n\t\texplicitWaitFortheElementTobeVisible(driver,overviewObj.leadsPageVerificationElement);\n\t\tAssert.assertTrue(driver.getCurrentUrl().equals(\"https://pro.tradus.com/lms/leads\"), \n\t\t\t\t\"Leads page not displayed\");\n\t\ttry {\n\t\tclick(overviewObj.myStockOptioninSiderBar);\n\t\t}catch(Exception e) {\n\t\t\tjsClick(driver,overviewObj.myStockOptioninSiderBar);\n\t\t}\n\t\texplicitWaitFortheElementTobeVisible(driver,overviewObj.allMyStockOptioninSiderBar);\n\t\ttry {\n\t\tclick(overviewObj.createMyStockOptioninSiderBar);\n\t\t}catch(Exception e) {\n\t\t\tjsClick(driver,overviewObj.createMyStockOptioninSiderBar);\n\t\t}\n\t\t\n\t\texplicitWaitFortheElementTobeVisible(driver,overviewObj.createStockPageVerificationElement);\n\t\tAssert.assertTrue(driver.getCurrentUrl().equals(\"https://pro.tradus.com/lms/ads/create\"), \n\t\t\t\t\"Create stock page not displayed\");\n\t\ttry {\n\t\tclick(overviewObj.allMyStockOptioninSiderBar);\n\t\t}catch(Exception e) {\n\t\t\tjsClick(driver,overviewObj.allMyStockOptioninSiderBar);\n\t\t}\n\t\texplicitWaitFortheElementTobeVisible(driver,overviewObj.allStockPageVerificationElement);\n\t\tAssert.assertTrue(driver.getCurrentUrl().equals(\"https://pro.tradus.com/lms/ads\"), \n\t\t\t\t\"All stock page not displayed\");\n\t\ttry {\n\t\tclick(overviewObj.marketInsightOptioninSiderBar);\n\t\t}catch(Exception e) {\n\t\t\tjsClick(driver,overviewObj.marketInsightOptioninSiderBar);\n\t\t}\n\t\texplicitWaitFortheElementTobeVisible(driver,overviewObj.marketInsightpageVerificationElement);\n\t\tAssert.assertTrue(driver.getCurrentUrl().equals(\"https://pro.tradus.com/lms/market-insights\"), \n\t\t\t\t\"Market insight page is not displaying\");\n\t\ttry {\n\t\tclick(overviewObj.profileOptioninSiderBar);\n\t\t}catch(Exception e) {\n\t\t\tjsClick(driver,overviewObj.profileOptioninSiderBar);\n\t\t}\n\t\texplicitWaitFortheElementTobeVisible(driver,overviewObj.profilePageVerificationElement);\n\t\tAssert.assertTrue(driver.getCurrentUrl().equals(\"https://pro.tradus.com/lms/profile\"), \n\t\t\t\t\"Profile page is not displaying\");\n\t\t\n\t\ttry {\n\t\tclick(overviewObj.subscriptionDetailsinSiderBar);\n\t\t}catch(Exception e) {\n\t\t\tjsClick(driver,overviewObj.subscriptionDetailsinSiderBar);\n\t\t}\n\t\texplicitWaitFortheElementTobeVisible(driver,overviewObj.monthlyPackageOptioninSiderBar);\n\t\ttry {\n\t\t\tclick(overviewObj.monthlyPackageOptioninSiderBar);\n\t\t\t}catch(Exception e) {\n\t\t\t\tjsClick(driver,overviewObj.monthlyPackageOptioninSiderBar);\n\t\t\t}\n\t\t\texplicitWaitFortheElementTobeVisible(driver,overviewObj.monthlyPackagePageVerificationElement);\n\t\t\tAssert.assertTrue(driver.getCurrentUrl().equals(\"https://pro.tradus.com/lms/subscription-details\"), \n\t\t\t\t\t\"Monthly package page is not displaying\");\n\t\texplicitWaitFortheElementTobeVisible(driver,overviewObj.billingButtonunderMonthlyPackage);\n\t\ttry {\n\t\tclick(overviewObj.billingButtonunderMonthlyPackage);\n\t\t}catch(Exception e) {\n\t\t\tjsClick(driver,overviewObj.billingButtonunderMonthlyPackage);\n\t\t}\n\t\texplicitWaitFortheElementTobeVisible(driver,overviewObj.billingPageverificationElement);\n\t\tAssert.assertTrue(driver.getCurrentUrl().equals(\"https://pro.tradus.com/lms/billing\"), \n\t\t\t\t\"Billing page is not displaying\");\n\t\t\n\t\texplicitWaitFortheElementTobeVisible(driver,overviewObj.contactsLinkUnderSubscriptionDetails);\n\t\ttry {\n\t\tclick(overviewObj.contactsLinkUnderSubscriptionDetails);\n\t\t}catch(Exception e) {\n\t\t\tjsClick(driver,overviewObj.contactsLinkUnderSubscriptionDetails);\n\t\t}\n\t\texplicitWaitFortheElementTobeVisible(driver,overviewObj.contactsLinkVerificationElement);\n\t\tAssert.assertTrue(driver.getCurrentUrl().equals(\"https://pro.tradus.com/lms/contracts\"), \n\t\t\t\t\"Contacts page under Subscription Details is not displaying\");\n\t\t/*try {\n\t\t\tclick(overviewObj.monthlyPackageOptioninSiderBar);\n\t\t\t}catch(Exception e) {\n\t\t\t\tjsClick(driver,overviewObj.monthlyPackageOptioninSiderBar);\n\t\t\t}\n\t\t\texplicitWaitFortheElementTobeVisible(driver,overviewObj.monthlyPackagePageVerificationElement);\n\t\t\tAssert.assertTrue(driver.getCurrentUrl().equals(\"https://pro.tradus.com/lms/subscription-details\"), \n\t\t\t\t\t\"Monthly package page is not displaying\");*/\n\t\ttry {\n\t\tclick(overviewObj.contactOptioninSiderBar);\n\t\t}catch(Exception e) {\n\t\t\tjsClick(driver,overviewObj.contactOptioninSiderBar);\n\t\t}\n\t\texplicitWaitFortheElementTobeVisible(driver,overviewObj.privacyOptionunderContactlinkSiderBar);\n\t\tString parentWindow=driver.getWindowHandle();\n\t\ttry {\n\t\tclick(overviewObj.termsOptionunderContactlinkSiderBar);\n\t\t}catch(Exception e) {\n\t\t\tjsClick(driver,overviewObj.termsOptionunderContactlinkSiderBar);\n\t\t}\n\t\tswitchWindow(driver, parentWindow);\n\t\tAssert.assertTrue(verifyElementPresent(overviewObj.termsPageVerificationElement), \n\t\t\t\t\"Terms page is not displaying\");\n\t\tdriver.close();\n\t\tdriver.switchTo().window(parentWindow);\n\t\ttry {\n\t\tclick(overviewObj.privacyOptionunderContactlinkSiderBar);\n\t\t}catch(Exception e) {\n\t\t\tjsClick(driver,overviewObj.privacyOptionunderContactlinkSiderBar);\n\t\t}\n\t\tswitchWindow(driver, parentWindow);\n\t\tAssert.assertTrue(verifyElementPresent(overviewObj.privacyPolicayPageVerificationElement), \n\t\t\t\t\"Privacy page is not displaying\");\n\t\tdriver.close();\n\t\tdriver.switchTo().window(parentWindow);\n\t\ttry {\n\t\tclick(overviewObj.contactOptionunderContactlinkSiderBar);\n\t\t}catch(Exception e) {\n\t\t\tjsClick(driver,overviewObj.contactOptionunderContactlinkSiderBar);\n\t\t}\n\t\tswitchWindow(driver, parentWindow);\n\t\tAssert.assertTrue(verifyElementPresent(overviewObj.conatctPageVerificationElement), \n\t\t\t\t\"Contact page is not displaying\");\n\t\tdriver.close();\n\t\tdriver.switchTo().window(parentWindow);\n\t}", "public void assertProductPrice() throws ParseException {\n wait.until(ExpectedConditions.visibilityOfElementLocated(_productPrice));\n\n\n // scroll down to get visibility for every element\n JavascriptExecutor jse = (JavascriptExecutor) driver;\n jse.executeScript(\"window.scrollBy(0,5000)\", \"\");\n\n // Check the number of pages for agination\n List <WebElement> pagination = driver.findElements(_pagination);\n System.out.println(\"Total number of pages are \" + pagination.size());\n\n\n /* First for loop to get pagination so that once the products are\n asserted in the next loop than this loop will look for next page\n and click on page 2\n */\n for(int i=0; i<pagination .size(); i++){\n // common element for product price\n java.util.List<WebElement> price = driver.findElements(_productPrice);\n\n // loop to get product price and assert that price is in price range searched\n for (int j = 0; j < price.size(); j = j + 1) {\n\n // get the text of the product price eg:£20.00\n String productPrice = price.get(j).getText();\n\n // Number format inbuilt class in Java to split currency sign and number\n NumberFormat priceFormat = NumberFormat.getCurrencyInstance();\n\n // parse function which passes the format of price without decimal and pound sign\n Number number = priceFormat.parse(productPrice);\n System.out.println(number.toString());\n\n // Assert product price is greater than or equal to £20\n Assert.assertTrue(number.intValue() >= 20);\n System.out.println(\"This product price is greater then £20\");\n\n // Assert product price is less than or equal to £39\n Assert.assertTrue(number.intValue() <= 39);\n System.out.println(\"This product price is less then £39\");\n }\n // if block to paginate and go to next page\n if(pagination .size()>0){\n System.out.println(\"pagination exists\");\n\n // Scroll to page 2 link at the bottom of the page\n WebElement element = driver.findElement(_pageTwoLink);\n jse.executeScript(\"arguments[0].scrollIntoView(true);\", element);\n\n // scroll up as the above sctoll to view method scrolls right at the bottom of page\n jse.executeScript(\"window.scrollBy(0,-500)\");\n\n Boolean nextButton = driver.findElement(_pageTwoLink).isEnabled();\n if (nextButton) {\n // click on page 2\n driver.findElement(_pageTwoLink).click();\n\n // implicit wait to wait until all the elements are loaded\n implicitWait(5);\n }\n else {\n System.out.println(nextButton + \" is not clickable\");\n }\n }\n else {\n System.out.println(\"pagination does not exists\");\n }\n }\n }", "@Test(dataProviderClass = DataProviderUtils.class, dataProvider = \"excelDataReader\", groups = { \"Sprint54\", \"Get Hyperlink\"}, \r\n\t\t\tdescription = \"No Java applet layout will be displayed for hyperlink url on selecting No Java applet in configuration and default in hyperlink dialog - Context menu.\")\r\n\tpublic void SprintTest54_1_30_3A_1A(HashMap<String,String> dataValues, String driverType) throws Exception {\r\n\r\n\t\tdriver = null; \r\n\r\n\t\ttry {\r\n\r\n\r\n\r\n\r\n\t\t\tdriver = WebDriverUtils.getDriver();\r\n\r\n\t\t\tConcurrentHashMap <String, String> dataPool = new ConcurrentHashMap <String, String>(dataValues);\r\n\r\n\t\t\tConfigurationPage configurationPage = LoginPage.launchDriverAndLoginToConfig(driver, true); //Launched driver and logged in\r\n\r\n\t\t\t//Step-1 : Navigate to Vault in tree view\r\n\t\t\t//-----------------------------------------\r\n\t\t\tconfigurationPage.treeView.clickTreeViewItem(Caption.ConfigSettings.VaultSpecificSettings.Value + \">>\" + testVault); //Clicks tree view item\r\n\r\n\r\n\t\t\tif (!configurationPage.configurationPanel.getPageName().toUpperCase().equalsIgnoreCase(testVault.toUpperCase())) //Checks if navigated to vault settings page\r\n\t\t\t\tthrow new Exception(\"Vault settings page in configuration is not opened.\");\r\n\r\n\t\t\tLog.message(\"1. Navigated to Vault settings page.\");\r\n\r\n\t\t\t//Step-2 : Select No Java applet layout layout and save the settings\r\n\t\t\t//--------------------------------------------------------------------\r\n\t\t\tconfigurationPage.configurationPanel.setJavaApplet(Caption.ConfigSettings.Config_Disable.Value);//Disabled the java applet in configuration page\r\n\r\n\t\t\tif(configurationPage.configurationPanel.isJavaAppletEnabled())//Verify if java applet is disabled or not\r\n\t\t\t\tthrow new Exception(\"Java applet is enabled.\");\r\n\r\n\t\t\tif (!configurationPage.configurationPanel.saveSettings()) //Save the settings in configuration page\r\n\t\t\t\tthrow new Exception(\"Configuration settings are not saved after changing its layout.\");\r\n\r\n\t\t\tLog.message(\"1. Java applet is disabled and Configuration settings are saved.\");\r\n\r\n\t\t\tif (!configurationPage.logOut()) //Logs out from configuration page\r\n\t\t\t\tthrow new Exception(\"Log out is not successful after saving the settings in configuration page.\");\r\n\r\n\t\t\tLog.message(\"2. No java applet layout is selected and settings are saved.\");\r\n\r\n\t\t\t//Step-3 : Login to the default page and navigate to any view\r\n\t\t\t//--------------------------------------------------------------------------\r\n\t\t\tHomePage homePage = LoginPage.launchDriverAndLogin(driver, false); //Launches and logs into the default page\r\n\r\n\t\t\tString viewToNavigate = SearchPanel.searchOrNavigatetoView(driver, dataPool.get(\"NavigateToView\"), dataPool.get(\"ObjectName\"));\r\n\r\n\t\t\tLog.message(\"3. Logged into the default page and navigated to '\" + viewToNavigate + \"' view.\");\r\n\r\n\t\t\t//Step-4 : Open Get Hyperlink dialog for the object from context menu\r\n\t\t\t//-------------------------------------------------------------------\r\n\t\t\tif (!homePage.listView.rightClickItem(dataPool.get(\"ObjectName\"))) //Selects the Object in the list\r\n\t\t\t\tthrow new Exception(\"Object (\" + dataPool.get(\"ObjectName\") + \") is not got selected.\");\r\n\r\n\t\t\thomePage.listView.clickContextMenuItem(Caption.MenuItems.GetMFilesWebURL.Value); //Selects Get Hyperlink from context menu\r\n\r\n\t\t\tMFilesDialog mfilesDialog = new MFilesDialog(driver); //Instantiating MFilesDialog wrapper class\r\n\r\n\t\t\tif (!mfilesDialog.isGetMFilesWebURLDialogOpened()) //Checks for MFiles dialog title\r\n\t\t\t\tthrow new Exception(\"M-Files dialog with 'Get Hyperlink' title is not opened.\");\r\n\r\n\t\t\tLog.message(\"4. Hyperlink dialog of an object (\" + dataPool.get(\"ObjectName\") + \") is opened through context menu.\");\r\n\r\n\t\t\t//Step-5 : Copy the link from text box and close the Get Hyperlink dialog\r\n\t\t\t//-----------------------------------------------------------------------\r\n\t\t\tString hyperlinkText = mfilesDialog.getHyperlink(); //Gets the hyperlink\r\n\t\t\tmfilesDialog.close(); //Closes the Get Hyperlink dialog\r\n\r\n\t\t\tLog.message(\"5. Hyperlink is copied and Get Hyperlink dialog is closed.\");\r\n\r\n\t\t\t//Step-6 : Open the copied Hyperlink in the browser\r\n\t\t\t//-------------------------------------------------\r\n\t\t\thomePage = Utility.navigateToPage(driver, hyperlinkText, userName, password, \"\"); //Navigates to the hyperlink url\r\n\r\n\r\n\t\t\tif (!driver.getCurrentUrl().equalsIgnoreCase(hyperlinkText))\r\n\t\t\t\tthrow new Exception (\"Browser is not opened with copied object Hyperlink.[Expected URL: \"+hyperlinkText+\" & Current URL : \"+ driver.getCurrentUrl() +\"]\");\r\n\r\n\t\t\tLog.message(\"6. Object Hyperlink is opened in the browser.\");\r\n\r\n\t\t\t//Verification : Verify if default layout is displayed\r\n\t\t\t//----------------------------------------------------\r\n\t\t\tString unAvailableLayouts = \"\";\r\n\r\n\t\t\tif (!homePage.isSearchbarPresent()) //Checks if Search bar present\r\n\t\t\t\tunAvailableLayouts = \"Search Bar is not available;\";\r\n\r\n\t\t\tif (!homePage.isTaskPaneDisplayed()) //Checks if Task Pane present\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Task Pane is not available;\";\r\n\r\n\t\t\tif (!homePage.previewPane.isTabExists(Caption.PreviewPane.MetadataTab.Value))\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Properties Pane is not available;\";\r\n\r\n\t\t\tif (!homePage.menuBar.isMenuInMenubarDisplayed()) //Checks if Menu Bar present\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Menu Bar is not available;\";\r\n\r\n\t\t\tif (!homePage.menuBar.isBreadCrumbDisplayed()) //Checks if Breadcrumb present\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Breadcrumb is not available;\";\r\n\r\n\t\t\tif (homePage.taskPanel.isAppletEnabled())\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Java Applet is available;\";\r\n\r\n\t\t\tif (!homePage.isListViewDisplayed())\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"List View is not available;\";\r\n\r\n\t\t\tif (homePage.isTreeViewDisplayed())\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Tree View is available;\";\r\n\r\n\t\t\tif (unAvailableLayouts.equals(\"\")) //Verifies default layout have selected default custom layout\r\n\t\t\t\tLog.pass(\"Test case Passed. Hyperlink URL page is displayed as No Java Applet layout.\");\r\n\t\t\telse\r\n\t\t\t\tLog.fail(\"Test case Failed. Few layots are not as expected on selecting 'No Java Applet layout'. Refer additional information : \" \r\n\t\t\t\t\t\t+ unAvailableLayouts, driver);\r\n\r\n\t\t}\r\n\t\tcatch (Exception e) {\r\n\t\t\tLog.exception(e, driver);\r\n\t\t} //End catch\r\n\r\n\t\tfinally {\r\n\r\n\t\t\tif(driver != null){\r\n\t\t\t\ttry\r\n\t\t\t\t{\r\n\r\n\t\t\t\t\tdriver.get(configURL);\r\n\r\n\t\t\t\t\tConfigurationPage configurationPage = new ConfigurationPage(driver);\r\n\t\t\t\t\tconfigurationPage.treeView.clickTreeViewItem(Caption.ConfigSettings.VaultSpecificSettings.Value + \">>\" + testVault); //Clicks tree view item\r\n\r\n\t\t\t\t\tconfigurationPage.configurationPanel.setLayout(Caption.ConfigSettings.Config_Default.Value);\r\n\r\n\t\t\t\t\tif (!configurationPage.configurationPanel.saveSettings())\r\n\t\t\t\t\t\tthrow new Exception(\"Configuration settings are not saved.\");\r\n\t\t\t\t}\r\n\t\t\t\tcatch(Exception e0)\r\n\t\t\t\t{\r\n\t\t\t\t\tLog.exception(e0, driver);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tUtility.quitDriver(driver);\r\n\r\n\t\t} //End finally\r\n\r\n\t}", "@Test(groups ={Slingshot,Regression,SubmitMeterRead})\npublic void verifyElectricityYourdetailsPageNavigationLink()\t\n{\t\n\tReport.createTestLogHeader(\"Anonymous Submit meter read\", \"Verifies the Your details Electricity Page Navigation Links\");\n\n\t\tnew SubmitMeterReadAction()\n\t\t.openSMRpage(\"Electricity\")\t\t\n\t\t.verifyElectricNavigationLinks();\n\t\t\n}", "@Test\n public void testDAM31304001() {\n\n // Data preparation\n {\n clearAndCreateTestDataForBook();\n }\n\n {\n webDriverOperations.click(id(\"dam31304001\"));\n }\n\n {\n assertThat(webDriverOperations.getText(id(\"getDateResult\")), is(\n \"2016-12-29\"));\n assertThat(webDriverOperations.getText(id(\"getDateClassResult\")),\n is(\"java.time.LocalDate\"));\n assertThat(webDriverOperations.getText(id(\n \"getObjectCertification\")), is(\"true\"));\n }\n }", "@Test\n @When(\"I navigate to Market\")\n public void s04_MarketOpen(){\n WebElement marketLink = driver.findElementByLinkText(\"Маркет\");\n marketLink.click();\n System.out.println(\"Step04 PASSED\");\n }", "public void WaterSupplyDetail(){\r\n\t\r\n\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- My Account should be clicked and user should get logged in\");\r\n\t\ttry{\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t/*driver.switchTo().defaultContent();\r\n\t\t\t\t\tsleep(3000);\r\n\t\t\t System.out.println(\"switched frame\"+ switchframe(\"PegaGadget2Ifr\"));\r\n\t\t\t click(locator_split(\"tabLocationAssesment\"));\r\n\t\t\t click(locator_split(\"linkclickLocation\"));*/\r\n\t\t\t // driver.findElement(By.xpath(\"//*[@tabindex='4']/a/span\")).click();\r\n\t\t\t // driver.findElement(By.xpath(\"//a[@title='Click here to open Location Assessment']\")).click();\r\n\t\t\tsleep(5000);\r\n\t\t\t driver.switchTo().defaultContent();\r\n\t\t\t System.out.println(\"switched frame\"+ switchframe(\"PegaGadget3Ifr\"));\r\n\t\t\t click(locator_split(\"tabwatersupply\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t click(locator_split(\"btnaddwatersupply\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t selectListValue(locator_split(\"listwatersupplytype\"), getValue(\"WaterSupplyType\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t selectListValue(locator_split(\"listpumpsassociated\"), getValue(\"PumpsAssociated\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t selectListValue(locator_split(\"listwateradequecy\"), getValue(\"Adequecy\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t click(locator_split(\"expandwatersupplydata\"));\r\n\t\t\t sleep(5000);\r\n\t\t\t click(locator_split(\"linkaddrow\"));\r\n\t\t\t sleep(5000);\r\n\t\t\t click(locator_split(\"linkaddrow\"));\r\n\t\t\t sleep(5000);\r\n \t\t\t \r\n\t\t\t sendKeys(locator_split(\"txtwatersupplytstname\"), getValue(\"WaterSupplyTestName\"));\r\n\t\t\t \r\n\t\t\t sleep(3000);\r\n\t\t\t sendKeys(locator_split(\"txtwatersupplytestdate\"),getValue(\"TestDate\"));\r\n\t\t\t //select[@id='WATER_SUPPLY_TYPE_CD']\r\n\t\t\t \r\n\t\t\t sleep(3000);\r\n\t\t\t sendKeys(locator_split(\"txtwatersupplytestedby\"),getValue(\"Testedby\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t \r\n\t\t\t sendKeys(locator_split(\"txtstatipressure\"), getValue(\"StaticPressure\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t \r\n\t\t\t sendKeys(locator_split(\"txtresidualpressure\"), getValue(\"ResidualPressure\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t sendKeys(locator_split(\"txtresidualflowrate\"), getValue(\"ResidualFlowRate\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t sendKeys(locator_split(\"txtpressureloss\"), getValue(\"PressureLoss\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t sendKeys(locator_split(\"txtlocationpressurereadings\"), getValue(\"PressureReadings\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t sendKeys(locator_split(\"txtlocationflowreading\"), getValue(\"FlowReadings\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t click(locator_split(\"btnwatersupplysave\"));\r\n\t\t\t sleep(5000);\r\n\t\t\t click(locator_split(\"checkboxclick\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t click(locator_split(\"expandwatersupplygraph\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t selectListValue(locator_split(\"listwatersupplygraph\"), getValue(\"GraphType\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t click(locator_split(\"btnwatersupplysaveall\"));\r\n\t\t\t \r\n\t\t\t// click(locator_split(\"btncopesave\"));\r\n\t\t\t sleep(5000);\r\n\t\t\t \r\n\t\t\t \r\n\t\t\t\t//clickbylinktext(\"No\");\r\n\t\t\t\r\n\t\t//switchframe(\"PegaGadget2Ifr\");\r\n\t\t//\tsleep(3000);\r\n\t\t//clickbylinktext(\"No\");\r\n\t\t\t\r\n\t\t\t\r\n\t\r\n\t\t\tReporter.log(\"PASS_MESSAGE:- Report tab is clicked and user is logged in\");\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Report tab is not clicked in\");\r\n\t\t\tthrow new NoSuchElementException(\"The element with\"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"LoginLogout\")\r\n\t\t\t\t\t+ \" not found\");\r\n\r\n\t\t}\r\n\r\n\t}", "public void LocationAssesment_Location(){\r\n\t\t//String RFSID = getValue(\"RFSName\");\r\n\t//\tString password = getValue(Password);\r\n\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- My Account should be clicked and user should get logged in\");\r\n\t\ttry{\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tdriver.switchTo().defaultContent();\r\n\t\t\t\t\tsleep(3000);\r\n\t\t\t System.out.println(\"switched frame\"+ switchframe(\"PegaGadget2Ifr\"));\r\n\t\t\t click(locator_split(\"tabLocationAssesment\"));\r\n\t\t\t click(locator_split(\"linkclickLocation\"));\r\n\t\t\t // driver.findElement(By.xpath(\"//*[@tabindex='4']/a/span\")).click();\r\n\t\t\t // driver.findElement(By.xpath(\"//a[@title='Click here to open Location Assessment']\")).click();\r\n\t\t\t driver.switchTo().defaultContent();\r\n\t\t\t System.out.println(\"switched frame\"+ switchframe(\"PegaGadget3Ifr\"));\r\n\t\t\t click(locator_split(\"tabLocation\"));\r\n\t\t\t //driver.findElement(By.xpath(\"//li[@tabindex='0']/a/span\")).click();\r\n\t\t\t System.out.println(\"verification\");\r\n\t\t\t sleep(1000);\r\n\t\t\t\t System.out.println(driver.findElement(By.id(\"GRASP_LOCATION_NM\")).getAttribute(\"value\"));\r\nsleep(2000);\r\n\t\t\t \r\n\t\t\t // verifyTextPresent(locator_split(\"txtLocation\"), getValue(\"Locationname\"),\"Location Name\");\r\n\t\t\t if(getAndVerifyTextvalue(locator_split(\"txtLocation\"), getValue(\"Locationname\")) == false){\r\n\t\t\t \r\n\t\t\t \tclearWebEdit(locator_split(\"txtLocation\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tsendKeys((locator_split(\"txtLocation\")), getValue(\"Locationname\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t }\r\n\t\t\t \r\n\t\t\t \t\r\n\t\t\t \r\n\t\t\t \t\r\n\t\t\t // getAndVerifyTextvalue(locator_split(\"txtCity\"), getValue(\"CityName\"),\"city\");\r\n\t\t\t // System.out.println(driver.findElement(By.id(\"GRASP_LOCATION_NM\")).getText());\r\n\t\t\t \r\n\t\t\t if(getAndVerifyTextvalue(locator_split(\"txtCity\"), getValue(\"CityName\"))==false){\r\n\t\t\t\t \r\n\t\t\t \tclearWebEdit(locator_split(\"txtCity\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tsendKeys((locator_split(\"txtCity\")), getValue(\"CityName\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t }\r\n\t\t\t // verifyTextPresent(locator_split(\"ListCountry\"), getValue(\"Country\"),\"Country\");\r\n\t\t\t if(getAndVerifyTextvalue(locator_split(\"ListCountry\"), getValue(\"Country\"))==false){\r\n\t\t\t\t \r\n\t\t\t \t//clearWebEdit(locator_split(\"ListCountry\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tselectListValue((locator_split(\"ListCountry\")), getValue(\"Country\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t }\r\n\t\t\t // verifyTextPresent(locator_split(\"txtBIvalue\"),getValue(\"BIValue\"),\"BI Value\");\r\n\t\t\t if(getAndVerifyTextvalue(locator_split(\"txtBIvalue\"), getValue(\"BIValue\"))==false){\r\n\t\t\t\t \r\n\t\t\t \tclearWebEdit(locator_split(\"txtBIvalue\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tsendKeys((locator_split(\"txtBIvalue\")), getValue(\"BIValue\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t }\r\n\t\t\t // verifyTextPresent(locator_split(\"txtBIindemnityperiod\"), getValue(\"BIIndemnityperiod\"),\"BI Indemnity period\");\r\n\t\t\t if(getAndVerifyTextvalue(locator_split(\"txtBIindemnityperiod\"), getValue(\"BIIndemnityperiod\"))==false){\r\n\t\t\t\t \r\n\t\t\t \tclearWebEdit(locator_split(\"txtBIindemnityperiod\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tsendKeys((locator_split(\"txtBIindemnityperiod\")), getValue(\"BIIndemnityperiod\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t }\r\n\t\t\t // verifyTextPresent(locator_split(\"txtBuildingValue\"), getValue(\"BuildingValue\"),\"Building\");\r\n\t\t\t if(getAndVerifyTextvalue(locator_split(\"txtBuildingValue\"), getValue(\"BuildingValue\"))==false){\r\n\t\t\t\t \r\n\t\t\t \tclearWebEdit(locator_split(\"txtBuildingValue\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tsendKeys((locator_split(\"txtBuildingValue\")), getValue(\"BuildingValue\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t }\r\n\t\t\t // verifyTextPresent(locator_split(\"txtMEvalue\"), getValue(\"MandEvalue\"),\"M+EValue\");\r\n\t\t\t if(getAndVerifyTextvalue(locator_split(\"txtMEvalue\"), getValue(\"MandEvalue\"))==false){\r\n\t\t\t\t \r\n\t\t\t \tclearWebEdit(locator_split(\"txtMEvalue\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tsendKeys((locator_split(\"txtMEvalue\")), getValue(\"MandEvalue\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t }\r\n\t\t\t // verifyTextPresent(locator_split(\"txtcontentvalue\"), getValue(\"Contentvalue\"),\"Content value\");\r\n\t\t\t if(getAndVerifyTextvalue(locator_split(\"txtcontentvalue\"), getValue(\"Contentvalue\"))==false){\r\n\t\t\t\t \r\n\t\t\t \tclearWebEdit(locator_split(\"txtcontentvalue\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tsendKeys((locator_split(\"txtcontentvalue\")), getValue(\"Contentvalue\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t }\r\n\t\t\t //verifyTextPresent(locator_split(\"txtstockinventory\"), getValue(\"Stockvalue\"),\"Stock inventory\");\r\n\t\t\t if(getAndVerifyTextvalue(locator_split(\"txtstockinventory\"), getValue(\"Stockvalue\"))==false){\r\n\t\t\t\t \r\n\t\t\t \tclearWebEdit(locator_split(\"txtstockinventory\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tsendKeys((locator_split(\"txtstockinventory\")), getValue(\"Stockvalue\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t }\r\n\t\t\t // verifyTextPresent(locator_split(\"txtotherPD\"), getValue(\"OtherPD\"),\"Other PD\");\r\n\t\t\t if(getAndVerifyTextvalue(locator_split(\"txtotherPD\"), getValue(\"OtherPD\"))==false){\r\n\t\t\t\t \r\n\t\t\t \tclearWebEdit(locator_split(\"txtotherPD\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tsendKeys((locator_split(\"txtotherPD\")), getValue(\"OtherPD\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t }\r\n\t\t\t //click(locator_split(\"txtLocationnext\"));\r\n\t\t\t\t//clickbylinktext(\"No\");\r\n\t\t\t\r\n\t\t//switchframe(\"PegaGadget2Ifr\");\r\n\t\tsleep(3000);\r\n\t\t//clickbylinktext(\"No\");*/\r\n\t\t\tif(driver.findElement(By.id(\"SectionCompleted\")).isSelected()==true)\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"Check Box alresy selected\");\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"Check box is not selected\");\r\n\t\t\t\tdriver.findElement(By.id(\"SectionCompleted\")).click();\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\r\n\t\t\tReporter.log(\"PASS_MESSAGE:- Report tab is clicked and user is logged in\");\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Report tab is not clicked in\");\r\n\t\t\tthrow new NoSuchElementException(\"The element with\"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"LoginLogout\")\r\n\t\t\t\t\t+ \" not found\");\r\n\r\n\t\t}\r\n\r\n\t}", "public void VerifyDeliveryLinkPopup(String title){\r\n\t\tString Title = getValue(title);\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- Pop up should come when delivery link is clicked in order summary\");\r\n\r\n\t\ttry{\r\n\t\t\tclick(locator_split(\"lnkDeliverylinkinOrderSummary\"));\r\n\t\t\tHashMap<String, String> windowids=getWindowID();\r\n\t\t\tdriver.switchTo().window(windowids.get(\"childID\"));\r\n\t\t\tverifyPage(Title);\r\n\t\t\tcloseBrowser();\r\n\t\t\t\r\n\t\t}catch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Ship to Store image is not present for country -\"+countries.get(countrycount));\r\n\t\t\tthrow new NoSuchElementException(\"The element with\"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"imgShiptoStoreinCartinCheckout\")\r\n\t\t\t\t\t+ \" not found\");\r\n\t\t}\r\n\r\n\t}", "public void VerifyRecapBillinfo(){\r\n\t\tString BillingName = getValue(\"FirstName\")+\" \"+getValue(\"LastName\");\r\n\t\tString Companyname = getValue(\"CompanyName\");\r\n\t\tString Address = getValue(\"Address\");\r\n\t\tString ZipCity = getValue(\"Zip\")+\" , \"+getValue(\"City\");\r\n\t\tString CardType= getValue(\"CardType\");\r\n\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- shopping cart image link should be clicked\");\r\n\r\n\r\n\t\ttry{\r\n\t\t\tString[] BD=getWebTableData(locator_split(\"txtRecapBillinfo\"), locator_split(\"txtRecapBillinfodata\"));\r\n\t\t\tif(BD[1].equalsIgnoreCase(BillingName)&&BD[2].equalsIgnoreCase(Companyname)\r\n\t\t\t\t\t&&BD[3].equalsIgnoreCase(Address)&&BD[5].equalsIgnoreCase(ZipCity)\r\n\t\t\t\t\t&&BD[6].contains(CardType)){\r\n\t\t\t\tSystem.out.println(\"The data from Web matches with Excel Registration data\");\r\n\t\t\t\tReporter.log(\"PASS_MESSAGE:- The data from Web matches with Excel Registration data\");\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tReporter.log(\"FAIL_MESSAGE:- The data from Web dosent match with Excel Registration data\");\r\n\t\t\t\tthrow new Exception(\"The data from Web dosent match with Excel Registration data\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- shopping cart image link is not clicked \");\r\n\t\t\tthrow new NoSuchElementException(\"The element with\"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtRecapBillinfo\")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtRecapBillinfodata\")\r\n\t\t\t\t\t+ \" not found\");\r\n\t\t}\r\n\r\n\t}", "@Test(groups ={Slingshot,Regression,SubmitMeterRead})\npublic void verifyGasYourdetailsPageNavigationLink()\t\n{\t\n\tReport.createTestLogHeader(\"Anonymous Submit meter read\", \"Verifies the Your details Gas Page Navigation Links\");\n\t\tnew SubmitMeterReadAction()\n\t\t.openSMRpage(\"Gas\")\t\t\n\t\t.verifyGasNavigationLinks();\n}", "@Test(dataProviderClass = DataProviderUtils.class, dataProvider = \"excelDataReader\",testName=\"Test1_6_3\",description=\"Test1_6_3 : State transition prompt \")\r\n\tpublic void Test1_6_3(HashMap<String,String> dataValues,String currentDriver,ITestContext context) throws Exception {\r\n\r\n\t\t//Variable Declaration\r\n\t\tdriver = WebDriverUtils.getDriver();\r\n\t\t\r\n\r\n\t\tConcurrentHashMap <String, String> testData = new ConcurrentHashMap <String, String>(dataValues);\r\n\t\tLoginPage loginPage=null;\r\n\r\n\t\tConfigurationPage configPage=null;\r\n\t\tHomePage homepage=null;\r\n\t\ttry {\r\n\r\n\t\t\t//Step-1: Login to Configuration Page\r\n\t\t\tloginPage=new LoginPage(driver);\r\n\t\t\tloginPage.navigateToApplication(configSite,userName,password,\"\");\t\r\n\t\t\tLog.message(\"1. Logged in to Configuration Page\", driver);\r\n\r\n\t\t\t//Step-2: Click Vault from left panel of Configuration Page\r\n\t\t\tconfigPage=new ConfigurationPage(driver);\r\n\t\t\tconfigPage.clickVaultFolder(testData.get(\"VaultName\"));\r\n\t\t\tLog.message(\"2. Clicked 'Sample vault' from left panel of Configuration Page\", driver);\r\n\r\n\r\n\t\t\t//Step-3 : Set value for Maximum number of search results\r\n\r\n\t\t\tif (!configPage.configurationPanel.getVaultAccess()) {\r\n\t\t\t\tconfigPage.configurationPanel.setVaultAccess(true); //Allows access to this vault\r\n\t\t\t}\r\n\r\n\t\t\tconfigPage.expandVaultFolder(documentVault);\r\n\t\t\tLog.message(\"3. Clicked '\"+documentVault+\"' from left panel of Configuration Page\", driver);\r\n\r\n\t\t\t//Step-4 : Set the control values\r\n\r\n\t\t\tconfigPage.clickSettingsFolder(\"Controls\");\r\n\t\t\tif (configPage.configurationPanel.getVaultCommands(testData.get(\"Control\")).equalsIgnoreCase(\"Hide\")) {\r\n\t\t\t\tconfigPage.chooseConfigurationVaultSettings(driver, testData.get(\"Control\"),\"controls\",\"Show\");\r\n\t\t\t\tconfigPage.clickSaveButton();\r\n\r\n\t\t\t\t// Check any warning dialog displayed\r\n\t\t\t\tif(configPage.isWarningDialogDisplayed())\r\n\t\t\t\t{\r\n\t\t\t\t\tconfigPage.clickResetButton();\r\n\t\t\t\t\tconfigPage.chooseConfigurationVaultSettings(driver, testData.get(\"Control\"),\"controls\",\"Show\");\r\n\t\t\t\t\tconfigPage.clickSaveButton();\r\n\t\t\t\t\tconfigPage.clickOKBtnOnSaveDialog(); \r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t\tconfigPage.clickOKBtnOnSaveDialog();\r\n\t\t\t}\r\n\t\t\tLog.message(\"4. Show \" + testData.get(\"Control\") + \" is enabled and settings are saved.\", driver);\r\n\t\t\t//Step-3 : Login to the vault\r\n\t\t\tconfigPage.clickLogOut(); //Logs out from the Configuration page\r\n\t\t\tLog.message(\"5. LoggedOut from configuration page.\", driver);\r\n\r\n\t\t\t//Step-5: Login to Web Access Vault\r\n\t\t\tloginPage.navigateToApplication(webSite,userName,password,testData.get(\"VaultName\"));\r\n\t\t\tUtils.waitForPageLoad(driver);\r\n\t\t\thomepage=new HomePage(driver);\r\n\r\n\t\t\tif (!homepage.isLoggedIn(userName))\r\n\t\t\t\tthrow new Exception(\"Some Error encountered while logging..check testdata..\");\r\n\t\t\tLog.message(\"6. Logged in to the vault (\" + testData.get(\"VaultName\") + \").\", driver);\r\n\r\n\t\t\t//Step-6 : To perform all object search\r\n\t\t\t//---------------------------------------\r\n\t\t\tSearchPanel searchpanel = new SearchPanel(driver);\r\n\t\t\tsearchpanel.clickSearchBtn(driver);\r\n\r\n\t\t\tLog.message(\"7. Perform all object search.\", driver); \r\n\r\n\t\t\t//Step-7 : Select any existing object\r\n\t\t\t//-------------------------------------\r\n\t\t\thomepage.listView.clickItemByIndex(0);\r\n\t\t\tUtils.fluentWait(driver);\r\n\t\t\tString selecteddocument = homepage.listView.getItemNameByItemIndex(0);\r\n\t\t\tUtils.fluentWait(driver);\r\n\t\t\tLog.message(\"8. Select any existing object.\" + selecteddocument, driver);\r\n\r\n\t\t\t//Step-8 : Click workflow option from operation menu\r\n\t\t\t//------------------------------------------\r\n\t\t\thomepage.menuBar.ClickOperationsMenu(\"Workflow\");\r\n\t\t\tUtils.fluentWait(driver);\r\n\t\t\tLog.message(\"9 : Click Workflow option from operation menu.\", driver);\r\n\r\n\t\t\t//Step-9: Verify number of objects displayed in listing view\r\n\t\t\tif (homepage.isWorkflowdialogDisplayed())\r\n\t\t\t\tLog.pass(\"Test Passed. Workflow dialog is Displayed in MFWA.\");\r\n\t\t\telse\r\n\t\t\t\tLog.fail(\"Test Failed. Workflow dialog is not Displayed in MFWA.\", driver);\r\n\r\n\t\t} //End try\r\n\r\n\t\tcatch (Exception e) {\r\n\t\t\tLog.exception(e, driver);\r\n\t\t} //End catch\r\n\r\n\t\tfinally {\r\n\r\n\t\t\tdriver.quit();\t\r\n\t\t} //End finally\r\n\t}", "public void LocationAssesment_COPE(){\r\n\t\tString Tradeoccupancy = getValue(\"TradeOccupancy\");\r\n\tString Account = getValue(\"Account\");\r\n\t boolean flag=false;\r\n\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- My Account should be clicked and user should get logged in\");\r\n\t\ttry{\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t/*driver.switchTo().defaultContent();\r\n\t\t\t\t\tsleep(3000);\r\n\t\t\t System.out.println(\"switched frame\"+ switchframe(\"PegaGadget2Ifr\"));\r\n\t\t\t click(locator_split(\"tabLocationAssesment\"));\r\n\t\t\t click(locator_split(\"linkclickLocation\"));*/\r\n\t\t\t // driver.findElement(By.xpath(\"//*[@tabindex='4']/a/span\")).click();\r\n\t\t\t // driver.findElement(By.xpath(\"//a[@title='Click here to open Location Assessment']\")).click();\r\n\t\t\t driver.switchTo().defaultContent();\r\n\t\t\t System.out.println(\"switched frame\"+ switchframe(\"PegaGadget3Ifr\"));\r\n\t\t\t click(locator_split(\"tabcope\"));\r\n\t\t\t //driver.findElement(By.xpath(\"//li[@tabindex='0']/a/span\")).click();\r\n\t\t\t clearWebEdit(locator_split(\"txtStoreyscope\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t sendKeys(locator_split(\"txtStoreyscope\"), getValue(\"Numberofstories\"));\r\n\t\t\t clearWebEdit(locator_split(\"txtbuildingheightcope\"));\r\n\t\t\t sleep(3000);\r\n\t\t\t sendKeys(locator_split(\"txtbuildingheightcope\"),getValue(\"Buildingheight\"));\r\n\t\t\t \r\n\t\t\t selectListValue(locator_split(\"listbasementcope\"), getValue(\"Basement\"));\r\n\t\t\t sleep(3000);\r\n\t\t\t clearWebEdit(locator_split(\"txtyearbuildcope\"));\r\n\t\t\t sleep(3000);\r\n\t\t\t sendKeys(locator_split(\"txtyearbuildcope\"), getValue(\"YearBuild\"));\r\n\t\t\t sleep(3000);\r\n\t\t\t clearWebEdit(locator_split(\"txtyearlastupgradecope\"));\r\n\t\t\t sleep(3000);\r\n\t\t\t sendKeys(locator_split(\"txtyearlastupgradecope\"), getValue(\"LastUpgradeyear\"));\r\n\t\t\t clearWebEdit(locator_split(\"txtbasementfloorelevationcope\"));\r\n\t\t\t sleep(3000);\r\n\t\t\t sendKeys(locator_split(\"txtbasementfloorelevationcope\"), getValue(\"FloorElevation\"));\r\n\t\t\t sleep(3000);\r\n\t\t\t System.out.println(\"Account is\"+Account);\r\n\t\t\t if(Account.equals(\"EEA\"))\r\n\t\t\t {\r\n\t\t\t clearWebEdit(locator_split(\"txttotalareacope\"));\r\n\t\t\t sleep(3000);\r\n\t\t\t sendKeys(locator_split(\"txttotalareacope\"), getValue(\"TotalAreaSqft\"));\r\n\t\t\t clearWebEdit(locator_split(\"txtfireareacope\"));\r\n\t\t\t sleep(3000);\r\n\t\t\t sendKeys(locator_split(\"txtfireareacope\"),getValue(\"FireArea\"));\r\n\t\t\t sleep(3000);\r\n\t\t\t selectListValue(locator_split(\"listroofcondition\"),getValue(\"Roofcondition\"));\r\n\t\t\t sleep(3000);\r\n\t\t\t \r\n\t\t\t }\r\n\t\t\t if(Account.equals(\"CP\")){\r\n\t\t\t \tSystem.out.println(\"inside CP\");\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tselectListValue(locator_split(\"listpredominantcope\"), getValue(\"Predominantconstruction\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtis06AA\"));\r\n\t\t\t\t sleep(5000);\r\n\t\t\t\t sendKeys(locator_split(\"txtis06AA\"),getValue(\"ClassAA\"));\r\n\t\t\t\t\tsleep(2000);\r\n\t\t\t\t\t System.out.println(\"Value entered in AA\");\r\n\t\t\t\t\t click(locator_split(\"txtis05A\"));\r\n\t\t\t\t\t sleep(10000);\r\n\t\t\t\t clearWebEdit(locator_split(\"txtis05A\"));\r\n\t\t\t\t sleep(5000);\r\n\t\t\t\t sendKeys(locator_split(\"txtis05A\"),getValue(\"ClassA\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t click(locator_split(\"txtis04\"));\r\n\t\t\t\t sleep(10000);\r\n\t\t\t\t clearWebEdit(locator_split(\"txtis04\"));\r\n\t\t\t\t sleep(5000);\r\n\t\t\t\t sendKeys(locator_split(\"txtis04\"),getValue(\"ClassB\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t click(locator_split(\"txtcmd04\"));\r\n\t\t\t\t sleep(10000);\r\n\t\t\t\t clearWebEdit(locator_split(\"txtcmd04\"));\r\n\t\t\t\t sleep(5000);\r\n\t\t\t\t sendKeys(locator_split(\"txtcmd04\"),getValue(\"ClassC\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t click(locator_split(\"txtis03\"));\r\n\t\t\t\t sleep(10000);\r\n\t\t\t\t clearWebEdit(locator_split(\"txtis03\"));\r\n\t\t\t\t sleep(5000);\r\n\t\t\t\t sendKeys(locator_split(\"txtis03\"),getValue(\"IS03ClassB\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t click(locator_split(\"txtcmd03\"));\r\n\t\t\t\t sleep(10000);\r\n\t\t\t\t clearWebEdit(locator_split(\"txtcmd03\"));\r\n\t\t\t\t sleep(5000);\r\n\t\t\t\t sendKeys(locator_split(\"txtcmd03\"),getValue(\"CMDISO3ClassC\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t click(locator_split(\"txtis02\"));\r\n\t\t\t\t sleep(10000);\r\n\t\t\t\t clearWebEdit(locator_split(\"txtis02\"));\r\n\t\t\t\t sleep(5000);\r\n\t\t\t\t sendKeys(locator_split(\"txtis02\"),getValue(\"IS02ClassC\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t click(locator_split(\"txtis01\"));\r\n\t\t\t\t sleep(10000);\r\n\t\t\t\t clearWebEdit(locator_split(\"txtis01\"));\r\n\t\t\t\t sleep(5000);\r\n\t\t\t\t sendKeys(locator_split(\"txtis01\"),getValue(\"IS01\"));\r\n\t\t\t \t\tsleep(5000);\t \r\n\t\t\t \r\n\t\t\t }\r\n\t\t\t selectListValue(locator_split(\"listtradeoccupancy\"), getValue(\"TradeOccupancy\"));\r\n\t\t\t sleep(3000);\r\n\t\t\t selectListValue(locator_split(\"listhazardgrade\"), getValue(\"Hazardgrade\"));\r\n\t\t\t sleep(3000);\r\n\t\t\t \r\n\t\t\t if (Tradeoccupancy.equals(\"Oil & Chemical\")&& (Account.equals(\"EEA\")))\r\n\t\t\t {\r\n\t\t\t \t sleep(1000);\r\n\t\t\t selectListValue(locator_split(\"listfireindex\"), getValue(\"Fireindex\"));\r\n\t\t\t sleep(1000);\r\n\t\t\t selectListValue(locator_split(\"listexplosionindex\"),getValue(\"Explosionindex\"));\r\n\t\t\t \t\t\r\n\t\t\t sleep(1000);\r\n\t\t\t }\r\n\t\t\t \r\n\t\t\t\tsleep(3000);\r\n\t\t\t clearWebEdit(locator_split(\"txtoperatinghours\"));\r\n\t\t\t sleep(3000);\r\n\t\t\t sendKeys(locator_split(\"txtoperatinghours\"), getValue(\"Operatinghours\"));\r\n\t\t\t sleep(1000);\r\n\t\t\t clearWebEdit(locator_split(\"txtoperatingdays\"));\r\n\t\t\t sleep(3000);\r\n\t\t\t sendKeys(locator_split(\"txtoperatingdays\"), getValue(\"Operatingdays\"));\r\n\t\t\t sleep(3000);\r\n\t\t\t clearWebEdit(locator_split(\"txtautosprinkler\"));\r\n\t\t\t sleep(3000);\r\n\t\t\t sendKeys(locator_split(\"txtautosprinkler\"), getValue(\"Autosprinkler\"));\r\n\t\t\t\tsleep(3000);\r\n\t\t\t clearWebEdit(locator_split(\"txtadequate\"));\r\n\t\t\t sleep(3000);\r\n\t\t\t sendKeys(locator_split(\"txtadequate\"), getValue(\"Adequate\"));\r\n\t\t\t\tsleep(3000);\r\n\t\t\t clearWebEdit(locator_split(\"txtasn\"));\r\n\t\t\t sleep(3000);\r\n\t\t\t sendKeys(locator_split(\"txtasn\"), getValue(\"ASN\"));\r\n\t\t\t\tsleep(3000);\r\n\t\t\t clearWebEdit(locator_split(\"txtdeduction\"));\r\n\t\t\t sleep(3000);\r\n\t\t\t sendKeys(locator_split(\"txtdeduction\"), getValue(\"Deduction\"));\r\n\t\t\t sleep(5000);\r\n\t\t\t click(locator_split(\"txtyearbuildcope\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t \r\n/*WebElement checkbox=driver.findElement(By.xpath(\"//img[contains(@name,'SaveButtonsForCOPE_pyWorkPage')]\")).\r\nsleep(2000);\r\nhighlight(checkbox);*/\r\nSystem.out.println(\"Checkbox status\");\r\nsleep(2000);\r\n/*System.out.println(driver.findElement(By.xpath(\"//img[@src='webwb/lv_unchecked_12144257304.gif!!.gif']\")).isDisplayed());\r\nsleep(2000);\r\nif(driver.findElement(By.xpath(\"//img[@src='webwb/lv_unchecked_12144257304.gif!!.gif']\")).isDisplayed()== true)\r\n{\r\n\tsleep(2000);\r\n\tclick(locator_split(\"checkboxsavecope\"));\r\n\tsleep(2000);\r\n\t//driver.findElement(By.xpath(\"//img[@src='webwb/lv_unchecked_12144257304.gif!!.gif']\")).click();\r\n}else{\r\n\tSystem.out.println(\"Check box already checked\");\r\n}*/\r\n//System.out.println(checkbox.getAttribute(arg0)());\r\n\t\t\t // System.out.println(verifyCheckboxChecked(locator_split(\"checkboxsavecope\")));\r\n\t\t//\tflag=verifyCheckboxChecked(locator_split(\"xpath-//img[contains(@name,'SaveButtonsForCOPE_pyWorkPage')]\"));\r\n\t\t/*\t sleep(2000);\r\n\t\t\t if(!checkbox.isSelected()){\r\n\t\t\t\t System.out.println(\"inside if loop\");\r\n\t\t\t\t checkbox.click();\r\n\t\t\t\t sleep(2000);\r\n\t\t\t }\r\n\t\t\t else{\r\n\t\t\t\t checkbox.click();\r\n\t\t\t\t System.out.println(\"inside else loop\");\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t \r\n\t\t\t\t \r\n\t\t\t\t checkbox.click();\r\n\t\t\t\t sleep(2000);\r\n\t\t\t }*/\r\n\t\t\t \r\n\t\t\t /* driver.findElement(By.xpath(\"//label[contains(.,'Click here if the Screen is Completed')]\")).click();\r\n\t\t\t Robot r=new Robot();\r\n\t\t\t r.keyPress(java.awt.event.KeyEvent.VK_TAB);\r\n\t\t\t sleep(1000);\r\n\t\t\t r.keyPress(java.awt.event.KeyEvent.VK_ENTER);\r\n\t\t\t sleep(2000);*/\r\n\t\t/*if (flag==true){\r\n\t\t\t System.out.println(\"flag\"+flag);\r\n\t\t\t System.out.println(\"Checked Already\");\r\n\t\t\t sleep(2000);\r\n\t\t\t click(locator_split(\"checkboxsavecope\"));\r\n\t\t\t //sleep(2000);\r\n\t\t\t \t//\t\t click(locator_split(\"checkboxsavecope\"));\r\n\t\t click(locator_split(\"btncopesave\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t }else{\r\n\t\t\t\t\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t click(locator_split(\"checkboxsavecope\"));\r\n\t\t\t\t sleep(3000);\r\n\t\t\t }\r\n\t\t\t */\r\n\t\t\t \r\n\t\t\t sleep(5000);\r\n\t\t\t if(getValue(\"BROWSER\").equalsIgnoreCase(\"InternetExplorer\")){\r\n\t\t\t System.out.println(\"inside iE loop\");\r\n\t\t\t \tclick(locator_split(\"btncopesave_ie\"));\t\r\n\t\t\t }else{\r\n\t\t\t \tclick(locator_split(\"btncopesave_ie\"));\r\n\t\t\t }\r\n\t\t\r\n\t\t\t sleep(5000);\r\n\t\t\t click(locator_split(\"txtLocationnext\"));\r\n\t\t\t sleep(3000);\r\n\t\t\t\t//clickbylinktext(\"No\");\r\n\t\t\t\r\n\t\t//switchframe(\"PegaGadget2Ifr\");\r\n\t\t//\tsleep(3000);\r\n\t\t//clickbylinktext(\"No\");\r\n\t\t\t\r\n\t\t\t\r\n\t\r\n\t\t\tReporter.log(\"PASS_MESSAGE:- Report tab is clicked and user is logged in\");\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Report tab is not clicked in\");\r\n\t\t\tthrow new NoSuchElementException(\"The element with\"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"LoginLogout\")\r\n\t\t\t\t\t+ \" not found\");\r\n\r\n\t\t}\r\n\r\n\t}", "@Test(dataProviderClass = DataProviderUtils.class, dataProvider = \"excelDataReader\",testName=\"Test1_6_4\",description=\"Test1_6_3 : State transition prompt \")\r\n\tpublic void Test1_6_4(HashMap<String,String> dataValues,String currentDriver,ITestContext context) throws Exception {\r\n\r\n\t\t//Variable Declaration\r\n\t\tdriver = WebDriverUtils.getDriver();\r\n\t\t\r\n\r\n\t\tConcurrentHashMap <String, String> testData = new ConcurrentHashMap <String, String>(dataValues);\r\n\t\tLoginPage loginPage=null;\r\n\r\n\t\tConfigurationPage configPage=null;\r\n\t\tHomePage homepage=null;\r\n\t\ttry {\r\n\r\n\t\t\t//Step-1: Login to Configuration Page\r\n\t\t\tloginPage=new LoginPage(driver);\r\n\t\t\tloginPage.navigateToApplication(configSite,userName,password,\"\");\t\r\n\t\t\tLog.message(\"1. Logged in to Configuration Page\", driver);\r\n\r\n\t\t\t//Step-2: Click Vault from left panel of Configuration Page\r\n\t\t\tconfigPage=new ConfigurationPage(driver);\r\n\t\t\tconfigPage.clickVaultFolder(testData.get(\"VaultName\"));\r\n\t\t\tLog.message(\"2. Select 'Sample vault' from left panel of Configuration Page\", driver);\r\n\r\n\r\n\t\t\t//Step-3 : Set value for Maximum number of search results\r\n\r\n\t\t\tif (!configPage.configurationPanel.getVaultAccess()) {\r\n\t\t\t\tconfigPage.configurationPanel.setVaultAccess(true); //Allows access to this vault\r\n\t\t\t}\r\n\r\n\t\t\tconfigPage.expandVaultFolder(documentVault);\r\n\t\t\tLog.message(\"3. Clicked '\"+documentVault+\"' from left panel of Configuration Page\", driver);\r\n\r\n\t\t\t//Step-4 : Set the control values\r\n\r\n\t\t\tconfigPage.setUTCdate(true); \r\n\t\t\tconfigPage.clickSaveButton();\r\n\t\t\t// Check any warning dialog displayed\r\n\t\t\tif(configPage.isWarningDialogDisplayed())\r\n\t\t\t{\r\n\t\t\t\tconfigPage.clickResetButton();\r\n\t\t\t\tconfigPage.setUTCdate(true); \r\n\t\t\t\tconfigPage.clickSaveButton();\r\n\t\t\t\tconfigPage.clickOKBtnOnSaveDialog(); \r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\tconfigPage.clickOKBtnOnSaveDialog();\r\n\r\n\t\t\tLog.message(\"4. UTC date option is enabled and settings are saved.\", driver);\r\n\t\t\t//Step-3 : Login to the vault\r\n\t\t\tconfigPage.clickLogOut(); //Logs out from the Configuration page\r\n\t\t\tLog.message(\"5. LoggedOut from configuration page.\", driver);\r\n\r\n\t\t\t//Step-5: Login to Web Access Vault\r\n\t\t\tloginPage.navigateToApplication(webSite,userName,password,testData.get(\"VaultName\"));\r\n\t\t\tUtils.waitForPageLoad(driver);\r\n\t\t\thomepage=new HomePage(driver);\r\n\r\n\t\t\tif (!homepage.isLoggedIn(userName))\r\n\t\t\t\tthrow new Exception(\"Some Error encountered while logging..check testdata..\");\r\n\t\t\tLog.message(\"6. Logged in to the vault (\" + testData.get(\"VaultName\") + \").\", driver);\r\n\r\n\t\t\t//Step-6 : To perform all object search\r\n\t\t\t//---------------------------------------\r\n\t\t\tSearchPanel searchpanel = new SearchPanel(driver);\r\n\t\t\tsearchpanel.clickSearchBtn(driver);\r\n\r\n\t\t\tLog.message(\"7. Perform all object search.\", driver); \r\n\r\n\t\t\t//Step-7 : Select any existing object\r\n\t\t\t//-------------------------------------\r\n\t\t\thomepage.listView.clickItemByIndex(0);\r\n\t\t\tUtils.fluentWait(driver);\r\n\t\t\tString selecteddocument = homepage.listView.getItemNameByItemIndex(0);\r\n\t\t\tUtils.fluentWait(driver);\r\n\t\t\tLog.message(\"8. Select any existing object.\" + selecteddocument, driver);\r\n\r\n\t\t\t//Step-8 : Click workflow option from task pane area\r\n\t\t\t//------------------------------------------\r\n\r\n\t\t\tMetadataCard metadata = new MetadataCard(driver, true);\r\n\t\t\tString createddate = metadata.getCreatedDate();\r\n\r\n\t\t\t//Step-9: Verify number of objects displayed in listing view\r\n\t\t\tif (createddate.contains(\"GMT\"))\r\n\t\t\t\tLog.pass(\"Test Passed. Created date displayed in UTC format.\");\r\n\t\t\telse\r\n\t\t\t\tLog.fail(\"Test Failed. Created date is not displayed in UTC format.\", driver);\r\n\r\n\t\t} //End try\r\n\r\n\t\tcatch (Exception e) {\r\n\t\t\tLog.exception(e, driver);\r\n\t\t} //End catch\r\n\r\n\t\tfinally {\r\n\r\n\t\t\tdriver.quit();\t\r\n\t\t} //End finally\r\n\t}", "public void ClickOrderByItemLink(){\r\n\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- OrderByItem Link should be clicked\");\r\n\t\ttry{\r\n\t\t\tsleep(1000);\r\n\t\t\twaitforElementVisible(returnByValue(getValue(\"OrderbyItemLinkText\")));\r\n\t\t\tclick(returnByValue(getValue(\"OrderbyItemLinkText\")));\r\n\t\t\twaitForPageToLoad(100);\r\n\t\t\tSystem.out.println(\"OrderByItem Link is clicked\");\r\n\t\t\tReporter.log(\"PASS_MESSAGE:- OrderByItem is clicked\");\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- OrderByItem Link is not clicked\");\r\n\t\t\tthrow new NoSuchElementException(\"The element with \"\r\n\t\t\t\t\t+ elementProperties.getProperty(getValue(\"OrderbyItemLinkText\")).toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ \" not found\");\r\n\r\n\t\t}\r\n\r\n\t}", "@Then(\"User should be navigated to Conditions page on clicking conditions tab\")\n\tpublic static void services_positive_tc_003() throws IOException {\n\t\ttry {\n\t\t\tclick(\"conditions\");\n\t\t\tpage_wait(60);\n\t\t\tstr=driver.findElement(By.xpath(OR_reader(\"Object Locator\",\"conditions_title\"))).isDisplayed();\n\t\t\tAssert.assertEquals(str, true);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\ttakeScreenShot(\"services_positive_tc_003\");\n\t\t}\n\t}", "@Test(groups ={Slingshot,Regression,SubmitMeterRead})\npublic void verifyYourdetailsElectricityOverLayLink()\t\n{\t\n\tReport.createTestLogHeader(\"Anonymous Submit meter read\", \"Verifies the Your details Electricity Page Overlay Links\");\n\t\tnew SubmitMeterReadAction()\n\t\t.openSMRpage(\"Electricity\")\t\t\n\t\t.verifyElectricWhyWeNeedThisLink()\n\t\t.verifyElectricAcctnoWhereCanIfindthisLink()\n\t\t.verifyElectricMeterPointWhereCanIfindthisLink()\n\t\t.verifyElectricMeterIDWhereCanIfindthisLink();\n}", "@Test()\n\tpublic static void Homep1() {\n\t\t\n\t\tdriver= CallingChrome();\ndriver.navigate().to(\"https://www.spicejet.com/\");\n\t\t\n\n\t\t\n\t\tSystem.out.println(driver.findElement(By.xpath(\"//a[text()='Book']\")).getText());\t\n\t}", "@Test(dataProviderClass = DataProviderUtils.class, dataProvider = \"excelDataReader\", groups = {\"Sprint36\", \"Breadcrumb\"}, \r\n\t\t\tdescription = \"Navigation to Parent View through breadcrumb ['Prevent navigation outside of the default view' - Checked].\")\r\n\tpublic void SprintTest36_1_12C(HashMap<String,String> dataValues, String driverType) throws Exception {\r\n\r\n\t\tdriver = null; \r\n\t\tLoginPage loginPage = null;\r\n\t\tConfigurationPage configurationPage = null;\r\n\t\tConfigurationPanel configSettingsPanel = null;\r\n\r\n\t\ttry {\r\n\r\n\r\n\r\n\t\t\tdriver = WebDriverUtils.getDriver();\r\n\r\n\t\t\tConcurrentHashMap <String, String> dataPool = new ConcurrentHashMap <String, String>(dataValues);\r\n\r\n\t\t\t//1. Login to Configuration\r\n\t\t\t//--------------------------\r\n\t\t\tdriver.get(configURL);\r\n\r\n\t\t\tloginPage = new LoginPage(driver);\r\n\t\t\tconfigurationPage = loginPage.loginToConfigurationUI(userName, password);\r\n\r\n\t\t\tLog.message(\"1. Logged in to Configuiration\");\r\n\r\n\t\t\t//2. Click the Vault folder \r\n\t\t\t//--------------------------\r\n\t\t\tconfigurationPage.treeView.clickTreeViewItem(\"Vault-specific settings>>\" + testVault);\r\n\r\n\t\t\tLog.message(\"2. Clicked the Vault folder.\");\r\n\r\n\t\t\t//3. Select the Default View\r\n\t\t\t//------------------------------\r\n\t\t\tconfigSettingsPanel = new ConfigurationPanel(driver);\r\n\t\t\tconfigSettingsPanel.setDefaultView(dataPool.get(\"View\"));\r\n\r\n\t\t\tLog.message(\"3. Selected the Default View.\");\r\n\r\n\t\t\t//4. Check the Prevent Navigation check box\r\n\t\t\t//------------------------------------------\r\n\t\t\tconfigSettingsPanel.setPreventNavigation(true);\r\n\r\n\t\t\tLog.message(\"4. Checked the Prevent Navigation check box.\");\r\n\r\n\t\t\t//5. Save the changes\r\n\t\t\t//--------------------\r\n\t\t\tif (!configurationPage.configurationPanel.saveSettings())\r\n\t\t\t\tthrow new Exception(\"Configuration settings are not saved.\");\r\n\r\n\t\t\tconfigurationPage.logOut();\r\n\r\n\t\t\tLog.message(\"5. Saved the changes.\");\r\n\r\n\t\t\t//6. Login to the Vault\r\n\t\t\t//----------------------\r\n\r\n\t\t\tdriver.get(loginURL);\r\n\r\n\t\t\tHomePage homePage = loginPage.loginToWebApplication(userName, password, testVault);\r\n\r\n\t\t\tLog.message(\"6. logged in to the vault.\");\r\n\r\n\t\t\t//7. Click on the parent view breadcrumb item\r\n\t\t\t//--------------------------------------------\r\n\t\t\tString expectedURL = driver.getCurrentUrl();\r\n\t\t\thomePage.menuBar.clickBreadcrumbItem(testVault);\r\n\r\n\t\t\tLog.message(\"7. Clicked on the parent view breadcrumb item\");\r\n\r\n\t\t\t//Verification: To verify if the Breadcrumb show the right path to the default view\r\n\t\t\t//----------------------------------------------------------------------------------\r\n\t\t\tif(expectedURL.equals(driver.getCurrentUrl()))\r\n\t\t\t\tLog.pass(\"Test case Passed. Navigation to previous view was not possible as expected.\"); \r\n\t\t\telse\r\n\t\t\t\tLog.fail(\"Test Case Failed. The URL showed '\" + driver.getCurrentUrl() + \"' instead of '\" + expectedURL + \"'\", driver);\r\n\r\n\r\n\t\t} //End try\r\n\r\n\t\tcatch(Exception e) \t{\r\n\t\t\tLog.exception(e, driver);\r\n\t\t} //End catch\r\n\r\n\t\tfinally {\r\n\t\t\tif(driver != null){\r\n\t\t\t\ttry\r\n\t\t\t\t{\r\n\t\t\t\t\tdriver.get(configURL);\r\n\r\n\t\t\t\t\tconfigurationPage = new ConfigurationPage(driver);\r\n\t\t\t\t\tconfigurationPage.treeView.clickTreeViewItem(\"Vault-specific settings>>\" + testVault);\r\n\r\n\t\t\t\t\tconfigSettingsPanel.setDefaultView(Caption.MenuItems.Home.Value);\r\n\t\t\t\t\tconfigSettingsPanel.setPreventNavigation(false);\r\n\r\n\t\t\t\t\tif (!configurationPage.configurationPanel.saveSettings())\r\n\t\t\t\t\t\tthrow new Exception(\"Configuration settings are not saved.\");\r\n\t\t\t\t}\r\n\t\t\t\tcatch(Exception e0)\r\n\t\t\t\t{\r\n\t\t\t\t\tLog.exception(e0, driver);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tUtility.quitDriver(driver);\r\n\t\t} //End finally\r\n\r\n\t}", "@Test (groups = {\"Regression\",\"Smoke\"})\n public void verifyClickOnServicesBtn() {\n homePage.clickOnServicesBtn();\n }", "@Test(dataProviderClass = DataProviderUtils.class, dataProvider = \"excelDataReader\", groups = {\"Sprint36\", \"Breadcrumb\"}, \r\n\t\t\tdescription = \"Navigation to Parent View through TaskPanel ['Prevent navigation outside of the default view' - Checked, Other View(ID)].\")\r\n\tpublic void SprintTest36_1_12F(HashMap<String,String> dataValues, String driverType) throws Exception {\r\n\r\n\t\tdriver = null; \r\n\t\tLoginPage loginPage = null;\r\n\t\tConfigurationPage configurationPage = null;\r\n\t\tConfigurationPanel configSettingsPanel = null;\r\n\r\n\t\ttry {\r\n\r\n\r\n\r\n\t\t\tdriver = WebDriverUtils.getDriver();\r\n\r\n\t\t\tConcurrentHashMap <String, String> dataPool = new ConcurrentHashMap <String, String>(dataValues);\r\n\r\n\t\t\t//1. Login to Configuration\r\n\t\t\t//--------------------------\r\n\t\t\tdriver.get(configURL);\r\n\r\n\t\t\tloginPage = new LoginPage(driver);\r\n\t\t\tconfigurationPage = loginPage.loginToConfigurationUI(userName, password);\r\n\r\n\t\t\tLog.message(\"1. Logged in to Configuiration\");\r\n\r\n\t\t\t//2. Click the Vault folder \r\n\t\t\t//--------------------------\r\n\t\t\tconfigurationPage.treeView.clickTreeViewItem(\"Vault-specific settings>>\" + testVault);\r\n\r\n\r\n\t\t\tLog.message(\"2. Clicked the Vault folder.\");\r\n\r\n\t\t\t//3. Select the Default View\r\n\t\t\t//------------------------------\r\n\r\n\t\t\tconfigSettingsPanel = new ConfigurationPanel(driver);\r\n\t\t\tconfigSettingsPanel.setDefaultView(dataPool.get(\"ViewID\"));\r\n\r\n\t\t\tLog.message(\"3. Selected the Default View.\");\r\n\r\n\t\t\t//4. Check the Prevent Navigation check box\r\n\t\t\t//------------------------------------------\r\n\t\t\tconfigSettingsPanel.setPreventNavigation(true);\r\n\r\n\t\t\tLog.message(\"4. Checked the Prevent Navigation check box.\");\r\n\r\n\t\t\t//5. Save the changes\r\n\t\t\t//--------------------\r\n\t\t\tif (!configurationPage.configurationPanel.saveSettings())\r\n\t\t\t\tthrow new Exception(\"Configuration settings are not saved.\");\r\n\r\n\t\t\tconfigurationPage.logOut();\r\n\r\n\t\t\tLog.message(\"5. Saved the changes.\");\r\n\r\n\t\t\t//6. Login to the Vault\r\n\t\t\t//----------------------\r\n\t\t\tdriver.get(loginURL);\r\n\t\t\tHomePage homePage = loginPage.loginToWebApplication(userName, password, testVault);\r\n\r\n\t\t\tLog.message(\"6. logged in to the vault.\");\r\n\r\n\t\t\t//7. Navigate to Home View using the Task Panel\r\n\t\t\t//--------------------------------------------\r\n\t\t\tString expectedURL = driver.getCurrentUrl();\r\n\t\t\thomePage.taskPanel.clickItem(Caption.MenuItems.Home.Value);\r\n\r\n\t\t\tLog.message(\"7. Navigated to Home View using the Task Panel\");\r\n\r\n\t\t\t//Verification: To verify if the Breadcrumb show the right path to the default view\r\n\t\t\t//----------------------------------------------------------------------------------\r\n\t\t\tif(expectedURL.equals(driver.getCurrentUrl()) && driver.getCurrentUrl().endsWith(dataPool.get(\"ViewID\")))\r\n\t\t\t\tLog.pass(\"Test case Passed. Navigation to previous view was not possible as expected.\"); \r\n\t\t\telse\r\n\t\t\t\tLog.fail(\"Test Case Failed. The URL showed '\" + driver.getCurrentUrl() + \"' instead of '\" + expectedURL + \"'\", driver);\r\n\r\n\r\n\t\t} //End try\r\n\r\n\t\tcatch(Exception e) \t{\r\n\t\t\tLog.exception(e, driver);\r\n\t\t} //End catch\r\n\r\n\t\tfinally {\r\n\t\t\tif(driver != null){\r\n\t\t\t\ttry\r\n\t\t\t\t{\r\n\t\t\t\t\tdriver.get(configURL);\r\n\r\n\t\t\t\t\tconfigurationPage = new ConfigurationPage(driver);\r\n\t\t\t\t\tconfigurationPage.treeView.clickTreeViewItem(\"Vault-specific settings>>\" + testVault);\r\n\r\n\t\t\t\t\tconfigSettingsPanel.setDefaultView(Caption.MenuItems.Home.Value);\r\n\t\t\t\t\tconfigSettingsPanel.setPreventNavigation(false);\r\n\r\n\t\t\t\t\tif (!configurationPage.configurationPanel.saveSettings())\r\n\t\t\t\t\t\tthrow new Exception(\"Configuration settings are not saved.\");\r\n\t\t\t\t}\r\n\t\t\t\tcatch(Exception e0)\r\n\t\t\t\t{\r\n\t\t\t\t\tLog.exception(e0, driver);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tUtility.quitDriver(driver);\r\n\t\t} //End finally\r\n\r\n\t}", "@Test(dataProviderClass = DataProviderUtils.class, dataProvider = \"excelDataReader\", groups = {\"Sprint36\", \"Breadcrumb\"}, \r\n\t\t\tdescription = \"Check the view path displayed in the breadcrumb .\")\r\n\tpublic void SprintTest36_1_7B(HashMap<String,String> dataValues, String driverType) throws Exception {\r\n\r\n\t\tdriver = null; \r\n\t\tLoginPage loginPage = null;\r\n\t\tConfigurationPage configurationPage = null;\r\n\t\tConfigurationPanel configSettingsPanel = null;\r\n\r\n\t\ttry {\r\n\r\n\r\n\r\n\r\n\t\t\tdriver = WebDriverUtils.getDriver();\r\n\r\n\t\t\tConcurrentHashMap <String, String> dataPool = new ConcurrentHashMap <String, String>(dataValues);\r\n\r\n\t\t\t//1. Login to Configuration\r\n\t\t\t//--------------------------\r\n\t\t\tdriver.get(configURL);\r\n\r\n\t\t\tloginPage = new LoginPage(driver);\r\n\t\t\tconfigurationPage = loginPage.loginToConfigurationUI(userName, password);\r\n\r\n\t\t\tLog.message(\"1. Logged in to Configuiration\");\r\n\r\n\t\t\t//2. Click the Vault folder \r\n\t\t\t//--------------------------\r\n\t\t\tconfigurationPage.treeView.clickTreeViewItem(\"Vault-specific settings>>\" + testVault);\r\n\r\n\t\t\tLog.message(\"2. Clicked the Vault folder.\");\r\n\r\n\t\t\t//4. Check the Prevent Navigation check box\r\n\t\t\t//------------------------------------------\r\n\t\t\tconfigSettingsPanel = new ConfigurationPanel(driver);\r\n\t\t\tconfigSettingsPanel.setPreventNavigation(true);\r\n\r\n\r\n\t\t\tLog.message(\"4. Checked the Prevent Navigation check box.\");\r\n\r\n\t\t\t//5. Save the changes\r\n\t\t\t//--------------------\r\n\t\t\tif (!configurationPage.configurationPanel.saveSettings())\r\n\t\t\t\tthrow new Exception(\"Configuration settings are not saved.\");\r\n\r\n\t\t\tconfigurationPage.logOut();\r\n\r\n\t\t\tLog.message(\"5. Saved the changes.\");\r\n\r\n\t\t\t//6. Login to the Test vault\r\n\t\t\t//---------------------------\r\n\t\t\tdriver.get(loginURL);\r\n\t\t\tHomePage homePage = loginPage.loginToWebApplication(userName, password, testVault);\r\n\r\n\t\t\tLog.message(\"6. Login to the Test Vault.\");\r\n\r\n\t\t\t//7. Navigate to the specified view\r\n\t\t\t//----------------------------------\r\n\t\t\thomePage.listView.navigateThroughView(dataPool.get(\"View\"));\r\n\r\n\t\t\tLog.message(\"7. Navigate to the specified view\");\r\n\r\n\t\t\t//8. Click the Parent view in the breadcrumb\r\n\t\t\t//--------------------------------------------\r\n\t\t\tif(!homePage.menuBar.clickBreadcrumbItem(dataPool.get(\"ParentView\")))\r\n\t\t\t\tthrow new Exception(\"Unable to click the Parent View in the breadcrumb.\");\r\n\r\n\r\n\t\t\tLog.message(\"8. Clicked the Parent view in the breadcrumb.\");\r\n\r\n\t\t\t//Verification: To verify if navigated to the parent view\r\n\t\t\t//--------------------------------------------------------\r\n\t\t\tif(driver.getCurrentUrl().endsWith(dataPool.get(\"ViewID\")))\r\n\t\t\t\tthrow new Exception(\"Navigation to parent view through breadcrumb failed.\");\r\n\r\n\t\t\tif(!homePage.menuBar.GetBreadCrumbItem().equals(testVault+\">\"+dataPool.get(\"ExpectedPath\")))\r\n\t\t\t\tthrow new Exception(\"The Expected Breadcrumb text was not displayed after navigating to the parent view.\");\r\n\r\n\t\t\tif(homePage.listView.isItemExists(dataPool.get(\"ChildView\")))\r\n\t\t\t\tLog.pass(\"Test case Passed. Navigation to parent view through breadcrumb was successful.\"); \r\n\t\t\telse\r\n\t\t\t\tLog.fail(\"Test Case Failed. Navigation to parent view through breadcrumb was not successful.\", driver);\r\n\r\n\r\n\t\t} //End try\r\n\r\n\t\tcatch(Exception e) \t{\r\n\t\t\tLog.exception(e, driver);\r\n\t\t} //End catch\r\n\r\n\t\tfinally {\r\n\r\n\t\t\tif(driver != null){\r\n\t\t\t\ttry\r\n\t\t\t\t{\r\n\t\t\t\t\tdriver.get(configURL);\r\n\r\n\t\t\t\t\tconfigurationPage = new ConfigurationPage(driver);\r\n\t\t\t\t\tconfigurationPage.treeView.clickTreeViewItem(\"Vault-specific settings>>\" + testVault);\r\n\r\n\t\t\t\t\tconfigSettingsPanel.setPreventNavigation(false);\r\n\r\n\t\t\t\t\tif (!configurationPage.configurationPanel.saveSettings())\r\n\t\t\t\t\t\tthrow new Exception(\"Configuration settings are not saved.\");\r\n\t\t\t\t}\r\n\t\t\t\tcatch(Exception e0)\r\n\t\t\t\t{\r\n\t\t\t\t\tLog.exception(e0, driver);\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t\tUtility.quitDriver(driver);\r\n\t\t} //End finally\r\n\r\n\t}", "@Test\r\n public void Test3() throws InterruptedException {\n driver.navigate().to(\"http://webstrar99.fulton.asu.edu/page2/\");\r\n driver.findElement(By.id(\"number1\")).sendKeys(\"10\");\r\n driver.findElement(By.id(\"number2\")).sendKeys(\"5\");\r\n driver.findElement(By.id(\"mul\")).click();\r\n driver.findElement(By.id(\"calc\")).click();\r\n Assert.assertEquals(\"50\", driver.findElement(By.id(\"res\")).getText());\r\n driver.quit();\r\n }", "public void ClickMyAccount( ){\r\n\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- My Account Link clicked\");\r\n\t\ttry{\r\n\r\n\t\t\twaitforElementVisible(locator_split(\"LoginLogout\"));\r\n\t\t\tclick(locator_split(\"LoginLogout\"));\r\n\r\n\t\t\tReporter.log(\"PASS_MESSAGE:- My Account Link clicked\");\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- My Account Link is not clicked \"+elementProperties.getProperty(\"LoginLogout\"));\r\n\t\t\tthrow new NoSuchElementException(\"The element with \"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"LoginLogout\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ \" not found\");\r\n\r\n\t\t}\r\n\r\n\r\n\t}", "@Test (groups = {\"Regression\"})\n public void verifyElementsOnHarrowWebsiteHomePageAreDisplayed() {\n homePage.isDisplayedServicesBtn();\n }", "@Test(enabled = true)\n public void checkLink() {\n System.out.println(\"We Are Now Testing 20 Test Cases On: \" + driver.getCurrentUrl());\n System.out.println(\"*****************************************************************\");\n\n String expectedLink = \"https://www.expedia.com/\";\n String actualLink = driver.getCurrentUrl();\n\n //Validate Links\n Assert.assertEquals(actualLink, expectedLink, \"Test Failed, Link Does Not Match\");\n\n }", "@Test\n public void shopDemoQA() {\n\n\n WebDriverManager.chromedriver().setup();\n WebDriver driver = new ChromeDriver();\n driver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\n driver.manage().window().maximize();\n\n String targetURL = \"http://shop.demoqa.com/\";\n\n driver.get(targetURL);\n String pageTitle = driver.getTitle();\n int titleLength = pageTitle.length();\n System.out.println(\"Web page title: \" + pageTitle +\", title length: \" + titleLength);\n\n String currentPageURL = driver.getCurrentUrl();\n System.out.println(\"Current URL: \" + currentPageURL);\n\n if (targetURL.replace(\"http://\", \"\").equals\n (currentPageURL.replace(\"http://\", \"\"))) {\n System.out.println(\">>> Target URL corresponds to current URL\");\n } else System.out.println(\">>> Target URL does not correspond to current URL\");\n\n String pageLength = driver.getPageSource();\n System.out.println(\"Page source length is: \" + pageLength.length());\n\n driver.quit();\n }", "public void ClickDescinShoppinginsight(String Linktext){\r\n\t\tString LinkText = getValue(Linktext);\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- Description link should be clicked in shopping insight\");\r\n\t\ttry{\r\n\t\t\tclickbylinktext(LinkText);\r\n\t\t\tSystem.out.println(LinkText+\" is clicked in shopping insight\");\r\n\t\t\tReporter.log(\"PASS_MESSAGE:- \"+LinkText+\" is clicked in shopping insight\");\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- \"+LinkText+\" link is not clicked in shopping insight\");\r\n\t\t\tthrow new NoSuchElementException(\"The link text with\"\r\n\t\t\t\t\t+ LinkText\r\n\t\t\t\t\t+ \" not found\");\r\n\r\n\t\t}\r\n\r\n\t}", "public void ClickAddtoCartiteminCustomersalsoViewed(){\r\n\t\tString[] ExpText = getValue(\"CustomeralsoViewedtitle\").split(\",\", 2);\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- Add to Cart button should be clicked in CustomeralsoViewed table\");\r\n\t\ttry{\r\n\t\t\tList<WebElement> ele = listofelements(locator_split(\"imgitemCustomeralsoOrderedViewed\"));\r\n\t\t\t((JavascriptExecutor) driver).executeScript(\"arguments[0].click();\", ele.get(Integer.valueOf(ExpText[0])-1));\r\n\t\t\tSystem.out.println(\"Add to Cart button is clicked in CustomeralsoOrdered table\");\r\n\t\t\tReporter.log(\"PASS_MESSAGE:- Add to Cart button is clicked in CustomeralsoOrdered table\");\r\n\r\n\t\t}\r\n\t\tcatch(NoSuchElementException e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Add to Cart button is not clicked in CustomeralsoViewed table\");\r\n\t\t\tthrow new NoSuchElementException(\"The element with \"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"imgitemCustomeralsoOrderedViewed\").toString()\r\n\t\t\t\t\t+ \" not found\");\r\n\t\t}\r\n\t}", "@Test(dataProviderClass = DataProviderUtils.class, dataProvider = \"excelDataReader\", groups = {\"Sprint36\", \"Breadcrumb\"}, \r\n\t\t\tdescription = \"Check the view path displayed in the breadcrumb .\")\r\n\tpublic void SprintTest36_1_10A(HashMap<String,String> dataValues, String driverType) throws Exception {\r\n\r\n\t\tdriver = null; \r\n\t\tLoginPage loginPage = null;\r\n\t\tConfigurationPage configurationPage = null;\r\n\t\tConfigurationPanel configSettingsPanel = null;\r\n\r\n\t\ttry {\r\n\r\n\r\n\r\n\r\n\t\t\tdriver = WebDriverUtils.getDriver();\r\n\r\n\t\t\tConcurrentHashMap <String, String> dataPool = new ConcurrentHashMap <String, String>(dataValues);\r\n\r\n\t\t\t//1. Login to Configuration\r\n\t\t\t//--------------------------\r\n\t\t\tdriver.get(configURL);\r\n\r\n\t\t\tloginPage = new LoginPage(driver);\r\n\t\t\tconfigurationPage = loginPage.loginToConfigurationUI(userName, password);\r\n\r\n\t\t\tLog.message(\"1. Logged in to Configuiration\");\r\n\r\n\t\t\t//2. Click the Vault folder \r\n\t\t\t//--------------------------\r\n\t\t\tconfigurationPage.treeView.clickTreeViewItem(\"Vault-specific settings>>\" + testVault);\r\n\r\n\t\t\tLog.message(\"2. Clicked the Vault folder.\");\r\n\r\n\t\t\t//3. Set the view in configuration page\r\n\t\t\t//------------------------------------------\r\n\t\t\tconfigSettingsPanel = new ConfigurationPanel(driver);\r\n\t\t\tconfigSettingsPanel.setDefaultView(dataPool.get(\"ViewID\"));\r\n\r\n\t\t\tLog.message(\"3. The view was specified in the configuration page.\");\r\n\r\n\t\t\t//4. Uncheck the Prevent Navigation check box\r\n\t\t\t//------------------------------------------\r\n\t\t\tconfigSettingsPanel = new ConfigurationPanel(driver);\r\n\t\t\tconfigSettingsPanel.setPreventNavigation(false);\r\n\r\n\r\n\t\t\tLog.message(\"4. Unchecked the Prevent Navigation check box.\");\r\n\r\n\t\t\t//5. Save the changes\r\n\t\t\t//--------------------\r\n\t\t\tif (!configurationPage.configurationPanel.saveSettings())\r\n\t\t\t\tthrow new Exception(\"Configuration settings are not saved.\");\r\n\r\n\t\t\tconfigurationPage.logOut();\r\n\r\n\t\t\tLog.message(\"5. Saved the changes.\");\r\n\r\n\t\t\t//6. Login to the Test vault\r\n\t\t\t//---------------------------\r\n\t\t\tdriver.get(loginURL);\r\n\t\t\tHomePage homePage = loginPage.loginToWebApplication(userName, password, testVault);\r\n\r\n\t\t\tLog.message(\"7. Login to the Test Vault.\");\r\n\r\n\t\t\t//Verification: To verify if the Breadcrumb shows the right path\r\n\t\t\t//---------------------------------------------------------------\r\n\t\t\tif(homePage.menuBar.GetBreadCrumbItem().equals(testVault+\">\"+dataPool.get(\"ExpectedPath\")))\r\n\t\t\t\tLog.pass(\"Test case Passed. The breadcrumb showed the right path when logged in to a different default view.\"); \r\n\t\t\telse\r\n\t\t\t\tLog.fail(\"Test Case Failed. The breadcrumb did not show the right path when logged in to a different default view.\", driver);\r\n\r\n\r\n\t\t} //End try\r\n\r\n\t\tcatch(Exception e) \t{\r\n\t\t\tLog.exception(e, driver);\r\n\t\t} //End catch\r\n\r\n\t\tfinally {\r\n\t\t\tif(driver != null){\r\n\t\t\t\ttry\r\n\t\t\t\t{\t\t\t\t\t\r\n\t\t\t\t\tdriver.get(configURL);\r\n\r\n\t\t\t\t\tconfigurationPage = new ConfigurationPage(driver);\r\n\t\t\t\t\tconfigurationPage.treeView.clickTreeViewItem(\"Vault-specific settings>>\" + testVault);\r\n\r\n\t\t\t\t\tconfigSettingsPanel.setDefaultView(Caption.MenuItems.Home.Value);\r\n\r\n\t\t\t\t\tif (!configurationPage.configurationPanel.saveSettings())\r\n\t\t\t\t\t\tthrow new Exception(\"Configuration settings are not saved.\");\r\n\t\t\t\t}\r\n\t\t\t\tcatch(Exception e0)\r\n\t\t\t\t{\r\n\t\t\t\t\tLog.exception(e0, driver);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tUtility.quitDriver(driver);\r\n\t\t} //End finally\r\n\r\n\t}", "@Test(dataProviderClass = DataProviderUtils.class, dataProvider = \"excelDataReader\", groups = {\"Sprint36\", \"Breadcrumb\"}, \r\n\t\t\tdescription = \"Check the view path displayed in the breadcrumb .\")\r\n\tpublic void SprintTest36_1_7A(HashMap<String,String> dataValues, String driverType) throws Exception {\r\n\r\n\t\tdriver = null; \r\n\t\tLoginPage loginPage = null;\r\n\t\tConfigurationPage configurationPage = null;\r\n\t\tConfigurationPanel configSettingsPanel = null;\r\n\r\n\t\ttry {\r\n\r\n\r\n\r\n\t\t\tdriver = WebDriverUtils.getDriver();\r\n\r\n\t\t\tConcurrentHashMap <String, String> dataPool = new ConcurrentHashMap <String, String>(dataValues);\r\n\r\n\t\t\t//1. Login to Configuration\r\n\t\t\t//--------------------------\r\n\t\t\tdriver.get(configURL);\r\n\r\n\t\t\tloginPage = new LoginPage(driver);\r\n\t\t\tconfigurationPage = loginPage.loginToConfigurationUI(userName, password);\r\n\r\n\t\t\tLog.message(\"1. Logged in to Configuiration\");\r\n\r\n\t\t\t//2. Click the Vault folder \r\n\t\t\t//--------------------------\r\n\t\t\tconfigurationPage.treeView.clickTreeViewItem(\"Vault-specific settings>>\" + testVault);\r\n\r\n\r\n\t\t\tLog.message(\"2. Clicked the Vault folder.\");\r\n\r\n\t\t\t//4. Check the Prevent Navigation check box\r\n\t\t\t//------------------------------------------\r\n\t\t\tconfigSettingsPanel = new ConfigurationPanel(driver);\r\n\t\t\tconfigSettingsPanel.setPreventNavigation(true);\r\n\r\n\r\n\t\t\tLog.message(\"4. Checked the Prevent Navigation check box.\");\r\n\r\n\t\t\t//5. Save the changes\r\n\t\t\t//--------------------\r\n\t\t\tif (!configurationPage.configurationPanel.saveSettings())\r\n\t\t\t\tthrow new Exception(\"Configuration settings are not saved.\");\r\n\r\n\t\t\tconfigurationPage.logOut();\r\n\r\n\t\t\tLog.message(\"5. Saved the changes.\");\r\n\r\n\t\t\t//6. Login to the Test vault\r\n\t\t\t//---------------------------\r\n\t\t\tdriver.get(loginURL);\r\n\t\t\tHomePage homePage = loginPage.loginToWebApplication(userName, password, testVault);\r\n\r\n\t\t\tLog.message(\"6. Login to the Test Vault.\");\r\n\r\n\t\t\t//7. Navigate to the specified view\r\n\t\t\t//----------------------------------\r\n\t\t\thomePage.listView.navigateThroughView(dataPool.get(\"View\"));\r\n\r\n\r\n\t\t\tLog.message(\"7. Navigate to the specified view\");\r\n\r\n\t\t\t//Verification: To verify if the Breadcrumb shows the right path\r\n\t\t\t//---------------------------------------------------------------\r\n\t\t\tif(homePage.menuBar.GetBreadCrumbItem().equals(testVault+\">\"+dataPool.get(\"View\").replace(\">>\", \">\")))\r\n\t\t\t\tLog.pass(\"Test case Passed. The Prevent Navigation Check box remains checked after clicking the save button.\"); \r\n\t\t\telse\r\n\t\t\t\tLog.fail(\"Test Case Failed. The Prevent Navigation Check box does not remain checked after clicking the save button.\", driver);\r\n\r\n\r\n\t\t} //End try\r\n\r\n\t\tcatch(Exception e) \t{\r\n\t\t\tLog.exception(e, driver);\r\n\t\t} //End catch\r\n\r\n\t\tfinally {\r\n\t\t\tif(driver != null){\r\n\t\t\t\ttry\r\n\t\t\t\t{\r\n\t\t\t\t\tdriver.get(configURL);\r\n\r\n\t\t\t\t\tconfigurationPage = new ConfigurationPage(driver);\r\n\t\t\t\t\tconfigurationPage.treeView.clickTreeViewItem(\"Vault-specific settings>>\" + testVault);\r\n\r\n\t\t\t\t\tconfigSettingsPanel.setPreventNavigation(false);\r\n\r\n\t\t\t\t\tif (!configurationPage.configurationPanel.saveSettings())\r\n\t\t\t\t\t\tthrow new Exception(\"Configuration settings are not saved.\");\r\n\t\t\t\t}\r\n\t\t\t\tcatch(Exception e0)\r\n\t\t\t\t{\r\n\t\t\t\t\tLog.exception(e0, driver);\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t\tUtility.quitDriver(driver);\r\n\t\t} //End finally\r\n\r\n\t}", "@Test(description = \"Test to validate price reminder when no price is entered\", priority = 0)\n\tpublic void UserStory1() throws HeadlessException, AWTException, IOException, InterruptedException\n\t{\n\t\tLoanCalculatorPage loan_cal = new LoanCalculatorPage();\t\t\n\t\tloan_cal.validateCalHomePage();\n\t\t//testLog.log(Status.INFO, \"Loan calculator page launched\");\n\t\tint testCaseID = 1;\n\t\t\n\t\t\n\t\t//Validate the error message when no amount is input\t\t\n\t\tloan_cal.validateNoPrice(testCaseID);\n\t}", "@Test\n\tpublic void verifyAdIdPriceTMVVisitsEmailsAndStatusDetailsAreDisplaying() throws Exception {\n\t\tAllStockTradusPROPage AllStockPage= new AllStockTradusPROPage(driver);\n\t\twaitTill(2000);\n\t\tLoginTradusPROPage loginPage = new LoginTradusPROPage(driver);\n\t\tloginPage.setAccountEmailAndPassword(userName, pwd);\n\t\tjsClick(driver, loginPage.LoginButton);\n\t\texplicitWaitFortheElementTobeVisible(driver, AllStockPage.myStockOptioninSiderBar);\n\t\tjsClick(driver, AllStockPage.myStockOptioninSiderBar);\n\t\texplicitWaitFortheElementTobeVisible(driver, AllStockPage.allMyStockOptioninSiderBar);\n\t\tjsClick(driver, AllStockPage.allMyStockOptioninSiderBar);\n\t\texplicitWaitFortheElementTobeVisible(driver, AllStockPage.MyStockText);\n\t\twaitTill(3000);\n\t\twhile(!verifyElementPresent(AllStockPage.tradusLinkforMANtires)) {\n\t\t\tdriver.navigate().refresh();\n\t\t\twaitTill(3000);\n\t\t}\n\t\tfor(int i=0; i<AllStockPage.PostedAds.size();i++)\n\t\t{\n\t\t\t/*switch(i) {\n\t\t\tcase 0: Assert.assertTrue(getText(AllStockPage.PostedAdsAdIds.get(i)).equals(\"Ad ID: 2986865\"),\n\t\t\t\t \"Expected Ad id is not displaying for 1st ad in All stock page\");\n\t\t\tAssert.assertTrue(getText(AllStockPage.PostedAdsCurrencyAndPrices.get(i)).equals(\"EUR 0\"),\n\t\t\t\t \"Given currency & price are not displaying for 1st ad in All stock page\");\n\t\t\tAssert.assertTrue(getText(AllStockPage.PostedAdsTMV.get(i)).equals(\"No price rating\"),\n\t\t\t\t \"Tradus market value is not displaying as no price rating for 1st ad in all stock page\");\n\t\t\tAssert.assertTrue(verifyElementPresent(AllStockPage.PostedAdsTMV.get(i)),\n\t\t\t\t \"Visits are not displaying for 1st ad in all stock page\");\n\t\t\tAssert.assertTrue(verifyElementPresent(AllStockPage.PostedAdsEmails.get(i)),\n\t\t\t\t \"Emails are not displaying for 1st ad in all stock page\");\n\t\t\tAssert.assertTrue(getText(AllStockPage.PostedAdsStatus.get(i)).equals(\"Tradus\"),\n\t\t\t\t \"Status is not displaying as active on tradus for 1st ad in All stock page\");break;\n\t\t\t\t \n\t\t\tcase 1: Assert.assertTrue(getText(AllStockPage.PostedAdsAdIds.get(i)).equals(\"Ad ID: 2986861\"),\n\t\t\t\t \"Expected Ad id is not displaying for 2nd ad in All stock page\");\n\t\t\tAssert.assertTrue(getText(AllStockPage.PostedAdsCurrencyAndPrices.get(i)).equals(\"EUR 100\"),\n\t\t\t\t \"Given currency & price are not displaying for 2nd ad in All stock page\");\n\t\t\tAssert.assertTrue(getText(AllStockPage.PostedAdsTMV.get(i)).equals(\"No price rating\"),\n\t\t\t\t \"Tradus market value is not displaying as no price rating for 2nd ad in all stock page\");\n\t\t\tAssert.assertTrue(verifyElementPresent(AllStockPage.PostedAdsTMV.get(i)),\n\t\t\t\t \"Visits are not displaying for 2nd ad in all stock page\");\n\t\t\tAssert.assertTrue(verifyElementPresent(AllStockPage.PostedAdsEmails.get(i)),\n\t\t\t\t \"Emails are not displaying for 2nd ad in all stock page\");\n\t\t\tAssert.assertTrue(getText(AllStockPage.PostedAdsStatus.get(i)).equals(\"Tradus\"),\n\t\t\t\t \"Status is not displaying as active on tradus for 2nd ad in All stock page\");\n\t\t\t}*/\n\t\t\t Assert.assertTrue(verifyElementPresent(AllStockPage.PostedAdsAdIds.get(i)),\n\t\t\t\t\t \"Expected Ad id is not displaying for \"+i+ \" ad in All stock page\");\n\t\t Assert.assertTrue(verifyElementPresent(AllStockPage.PostedAdsCurrencyAndPrices.get(i)),\n\t\t \t\t\"Given currency & price are not displaying for \"+i+ \" ad in All stock page\");\n\t\t Assert.assertTrue(verifyElementPresent(AllStockPage.PostedAdsTMV.get(i)),\n\t\t \t\t\"Tradus market value is not displaying as no price rating for \"+i+ \" ad in all stock page\");\n\t\t Assert.assertTrue(verifyElementPresent(AllStockPage.PostedAdsVisits.get(i)),\n\t\t \t\t\"Visits are not displaying for \"+i+ \" ad in all stock page\");\n\t\t Assert.assertTrue(verifyElementPresent(AllStockPage.PostedAdsEmails.get(i)),\n\t\t \t\t\"Emails are not displaying for \"+i+ \" ad in all stock page\");\n\t\t Assert.assertTrue(verifyElementPresent(AllStockPage.PostedAdsStatus.get(i)),\n\t\t \t\t\"Status is not displaying as active on tradus for \"+i+ \" ad in All stock page\");\n\t\t}\n\t}", "@Test(dataProviderClass = DataProviderUtils.class, dataProvider = \"excelDataReader\", groups = {\"Sprint33\", \"Breadcrumb\"}, \r\n\t\t\tdescription = \"Verify to Hiding GOTO items.\")\r\n\tpublic void SprintTest33_1_5(HashMap<String,String> dataValues, String driverType) throws Exception {\r\n\r\n\t\tdriver = null; \r\n\t\tLoginPage loginPage = null;\r\n\t\tConfigurationPage configurationPage = null;\r\n\t\tString[] options = null;\r\n\r\n\t\ttry {\r\n\r\n\r\n\r\n\t\t\tdriver = WebDriverUtils.getDriver();\r\n\r\n\t\t\tConcurrentHashMap <String, String> dataPool = new ConcurrentHashMap <String, String>(dataValues);\r\n\r\n\t\t\t//1. Login to Configuration\r\n\t\t\t//--------------------------\r\n\t\t\tdriver.get(configURL);\r\n\r\n\t\t\tloginPage = new LoginPage(driver);\r\n\t\t\tconfigurationPage = loginPage.loginToConfigurationUI(userName, password);\r\n\r\n\r\n\t\t\tLog.message(\"1. Logged in to Configuiration\");\r\n\r\n\t\t\t//2. Click the Task area link \r\n\t\t\t//----------------------------\r\n\t\t\tconfigurationPage.treeView.clickTreeViewItem(Caption.ConfigSettings.VaultSpecificSettings.Value + \">>\" + testVault + \">>\" + Caption.ConfigSettings.Config_TaskArea.Value);\r\n\r\n\r\n\t\t\tLog.message(\"2. Clicked the Task area link.\");\r\n\r\n\t\t\t//3. Hide all GoTo shortcuts\r\n\t\t\t//---------------------------\r\n\t\t\toptions = dataPool.get(\"Options\").split(\"\\n\");\r\n\r\n\r\n\t\t\tfor(int count = 0; count < options.length; count++) \r\n\t\t\t\tconfigurationPage.configurationPanel.setVaultCommands(options[count],\"Hide\");\r\n\r\n\t\t\tif (!configurationPage.configurationPanel.saveSettings())\r\n\t\t\t\tthrow new Exception(\"Configuration settings are not saved.\");\r\n\r\n\t\t\tconfigurationPage.logOut();\r\n\r\n\r\n\t\t\tLog.message(\"3. Hide all GoTo shortcuts\");\r\n\r\n\t\t\t//Step-4: Login to the vault\r\n\t\t\t//---------------------------\r\n\t\t\tdriver.get(loginURL);\r\n\r\n\t\t\tloginPage = new LoginPage(driver);\r\n\t\t\tHomePage homePage = loginPage.loginToWebApplication(userName, password, testVault);\r\n\r\n\r\n\t\t\tLog.message(\"Step-4: Login to the vault.\");\r\n\r\n\t\t\t//Verification: To verify if GoTo option is not displayed in the task pane\r\n\t\t\t//------------------------------------------------------------------------\r\n\r\n\t\t\tif(!homePage.taskPanel.isItemExists(dataPool.get(\"MenuItem\")))\r\n\t\t\t\tLog.pass(\"Test case Passed. The Task Panel item \" + dataPool.get(\"MenuItem\") + \" did not exist.\");\r\n\t\t\telse\r\n\t\t\t\tLog.fail(\"Test Case Failed. The Task Panel item \" + dataPool.get(\"MenuItem\") + \" still exists\", driver);\r\n\r\n\r\n\t\t} //End try\r\n\r\n\t\tcatch(Exception e) \t{\r\n\t\t\tLog.exception(e, driver);\r\n\t\t} //End catch\r\n\r\n\t\tfinally {\r\n\t\t\tif(driver != null){\r\n\t\t\t\ttry\r\n\t\t\t\t{\r\n\t\t\t\t\tdriver.get(configURL);\r\n\r\n\t\t\t\t\tconfigurationPage = new ConfigurationPage(driver);\r\n\t\t\t\t\tconfigurationPage.treeView.clickTreeViewItem(Caption.ConfigSettings.VaultSpecificSettings.Value + \">>\" + testVault + \">>\" + Caption.ConfigSettings.Config_TaskArea.Value);\r\n\r\n\t\t\t\t\tfor(int count = 0; count < options.length; count++) \r\n\t\t\t\t\t\tconfigurationPage.configurationPanel.setVaultCommands(options[count],\"Show\");\r\n\r\n\t\t\t\t\tif (!configurationPage.configurationPanel.saveSettings())\r\n\t\t\t\t\t\tthrow new Exception(\"Configuration settings are not saved.\");\r\n\t\t\t\t}\r\n\t\t\t\tcatch(Exception e0)\r\n\t\t\t\t{\r\n\t\t\t\t\tLog.exception(e0, driver);\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t\tUtility.quitDriver(driver);\r\n\t\t} //End finally\r\n\r\n\t}", "@Test\n\tpublic void defaultValues() {\n\t\tWebElement new_page = wdriver.findElement(By.name(\"payment_form\"));\n\t\t\n\t\tdouble dwnpymnt = Double.valueOf(new_page.findElement(By.name(\"downpayment\")).getAttribute(\"value\"));\n\t\tdouble interest = Double.valueOf(new_page.findElement(By.name(\"interest\")).getAttribute(\"value\"));\n\t\tint year = Integer.valueOf(new_page.findElement(By.name(\"year\")).getAttribute(\"value\"));\n\t\tdouble price_tax = Double.valueOf(new_page.findElement(By.name(\"price_with_taxes\")).getAttribute(\"value\"));\n\t\t\n\t\tdouble price_interest = priceWithInterest(price_tax, dwnpymnt, interest, year);\n\t\tint nMnths = numMonths(year);\n\t\tdouble ttl = totalPrice(price_interest, dwnpymnt);\n\t\tdouble ttl_per_mnth = totalPricePerMonth(price_interest, nMnths);\n\t\t\n\t\t// click calculate button\n\t\tnew_page.findElement(By.name(\"calculate_payment_button\")).click();\n\t\twait(2);\n\t\t\n\t\tWebElement solutions = wdriver.findElement(By.name(\"payment_form\"));\n\t\t\n\t\tDecimalFormat twoDForm = new DecimalFormat(\"#.##\");\n\t\t\n\t\tassertEquals(Double.valueOf(twoDForm.format(dwnpymnt)), Double.valueOf(solutions.findElement(By.id(\"total_downpayment\")).getAttribute(\"value\")));\n\t\tassertEquals(Double.valueOf(twoDForm.format(ttl_per_mnth)), Double.valueOf(solutions.findElement(By.id(\"total_price_per_month\")).getAttribute(\"value\")));\n\t\tassertEquals(Integer.valueOf(nMnths), Integer.valueOf(solutions.findElement(By.id(\"n_of_months\")).getAttribute(\"value\")));\n\t\tassertEquals(Double.valueOf(twoDForm.format(ttl)), Double.valueOf(solutions.findElement(By.id(\"total_price\")).getAttribute(\"value\")));\n\t}", "@Test\r\n\tpublic void runACME () throws InterruptedException {\n\t\tSystem.setProperty(\"webdriver.chrome.driver\", \"./drivers/Chromedriver/chromedriver.exe\");// in order to establish the connection between the browser and the software\r\n\t\tChromeDriver driver = new ChromeDriver();\r\n\t\tdriver.get(\"https://acme-test.uipath.com/account/login\");// window to be opened\r\n\t\tdriver.manage().window().maximize();//to open window and maximize the screen\r\n\t\tdriver.findElementById(\"email\").sendKeys(\"[email protected]\",Keys.TAB);\r\n\t\tdriver.findElementById(\"password\").sendKeys(\"leaf@12\");\r\n\t\tdriver.findElementByXPath(\"//button[@id='buttonLogin']\").click();\r\n\t\tActions builder=new Actions(driver);\r\n\t\tThread.sleep(3000);\r\n\t\tWebElement Invoices = driver.findElementByXPath(\"//button[text()[normalize-space()='Invoices']]\");\r\n\t\tbuilder.moveToElement(Invoices).perform();\r\n\t\tdriver.findElementByXPath(\"//a[@href='/invoices/search']\").click();\r\n\t\tdriver.findElementById(\"vendorTaxID\").sendKeys(\"DE763212\");\r\n\t\tdriver.findElementByXPath(\"//button[@class='btn btn-primary']\").click();\r\n\t\tWebElement table = driver.findElementByClassName(\"table\");\r\n\t\tList<WebElement> rows = table.findElements(By.tagName(\"tr\"));\r\n\t\tint InvoiceSize = rows.size();\r\n\t\t//System.out.println(InvoiceSize);\r\n\t\t//Map<String, Integer> InvoiceDetails = new HashMap<String,Integer>();\r\n\t\tfor(int i=2;i<InvoiceSize;i++) {\r\n\t\t//String InvoiceItem = driver.findElementByXPath(\"(//td[text()='IT Support'])[\"+i+\"]\").getText();\r\n\t\tString InvoiceItem = driver.findElementByXPath(\"//table[@class='table']//tr[\"+i+\"]/td[3]\").getText();\r\n\t\tif(InvoiceItem.equals(\"IT Support\")) {\r\n\t\t\tString invoiceNumber = driver.findElementByXPath(\"//table[@class='table']/tbody[1]/tr[\"+i+\"]/td[1]\").getText();\r\n\t\t\tSystem.out.println(invoiceNumber);\r\n\t\t}\r\n\t\t\r\n\t\t\t\r\n\t\t}\r\n\t/*\tif((Country.equals(\"France\"))&&(VendorName.equals(\"Blue Lagoon\"))) {\r\n\t\t\tSystem.out.println(\"Text match\");\r\n\t\t}else{\r\n\t\t\tSystem.out.println(\"Text Not match\");\r\n\t\t}*/\r\n\t\t\r\n\t\tdriver.findElementByXPath(\"//a[@href='/account/logout/']\").click();\r\n\t\tdriver.close();\r\n\t}", "public void VerifyViewCartandPrintinCheckout(){\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- View Cart and Print Cart should be present\");\r\n\r\n\t\ttry{\r\n\t\t\tList<WebElement> ele = listofelements(locator_split(\"lnkViewPrintCart\"));\r\n\t\t\tif(ele.size()==2){\r\n\t\t\t\tSystem.out.println(\"View Cart -\"+ele.get(1).getText()+\" and print Cart -\"+ele.get(0).getText()+\" is present\");\r\n\t\t\t\tReporter.log(\"PASS_MESSAGE:- View Cart \"+ele.get(1).getText()+\" and print Cart \"+ele.get(0).getText()+\" is present\");\r\n\t\t\t}else{\r\n\t\t\t\tthrow new Exception(\"View cart or Print or both is not present\");\r\n\t\t\t}\r\n\r\n\t\t}catch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- View cart or Print or both is not present\");\r\n\t\t\tthrow new NoSuchElementException(\"The element with\"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"lnkViewPrintCart\")\r\n\t\t\t\t\t+ \" not found\");\r\n\r\n\t\t}\r\n\r\n\t}", "@Test(dataProviderClass = DataProviderUtils.class, dataProvider = \"excelDataReader\", groups = {\"Sprint16-2015\", \"Password\"}, \r\n\t\t\tdescription = \"Verify Vault/Logout link is displayed in task pane while selecting Show in configuration page for Vault option.\")\r\n\tpublic void SprintTest162015_18_1B(HashMap<String,String> dataValues, String driverType) throws Exception {\r\n\r\n\t\tdriver = null; \r\n\t\tString menuItem = null;\r\n\t\tString prevCommand = null;\r\n\t\tConfigurationPage configurationPage = null;\r\n\r\n\t\ttry {\r\n\r\n\r\n\r\n\t\t\tdriver = WebDriverUtils.getDriver();\r\n\r\n\t\t\tConcurrentHashMap <String, String> dataPool = new ConcurrentHashMap <String, String>(dataValues);\r\n\r\n\r\n\t\t\t//1. Click the Task area link \r\n\t\t\t//----------------------------\r\n\t\t\tconfigurationPage = LoginPage.launchDriverAndLoginToConfig(driver, true); //Launched driver and logged in\r\n\t\t\tconfigurationPage.treeView.clickTreeViewItem(Caption.ConfigSettings.VaultSpecificSettings.Value + \">>\" + testVault + \">>\" + Caption.ConfigSettings.Config_TaskArea.Value);\r\n\r\n\r\n\t\t\tLog.message(\"1. Navigated to task specific settings\");\r\n\r\n\t\t\t//2. Hide \"Vault\" shortcut in task area\r\n\r\n\t\t\tmenuItem = dataPool.get(\"MenuItem\");\r\n\r\n\r\n\t\t\tprevCommand = configurationPage.configurationPanel.getVaultCommands(menuItem);\r\n\t\t\tconfigurationPage.configurationPanel.setVaultCommands(menuItem,\"Show\");\r\n\r\n\t\t\tif (!configurationPage.configurationPanel.saveSettings())\r\n\t\t\t\tthrow new Exception(\"Configuration settings are not saved.\");\r\n\r\n\t\t\tLog.message(\"2. Vault option is hided from task area and settings are saved in configuration page\");\r\n\r\n\t\t\t//3. Logging out from configuration page and lauch the default webpage\r\n\r\n\t\t\tconfigurationPage.logOut();\r\n\r\n\t\t\tLoginPage loginPage = new LoginPage(driver);\r\n\t\t\tHomePage homePage = loginPage.loginToWebApplication(userName, password, testVault);\r\n\r\n\r\n\t\t\tLog.message(\"3. Logged out from configuration page and Default webpage is launched\");\r\n\r\n\t\t\t//Verification: To verify if Vault option is not displayed in the task pane\r\n\t\t\t//------------------------------------------------------------------------\r\n\t\t\tboolean result = homePage.taskPanel.isItemExists(dataPool.get(\"MenuItem\"));\r\n\r\n\t\t\tString passMsg = \"Test case Passed. The Task Panel item \" + dataPool.get(\"MenuItem\") + \" is displayed while selecting show in configuration page.\";\r\n\r\n\t\t\tif(dataPool.get(\"MenuItem\").contains(\"Vaults\") && result == false)\r\n\t\t\t{\r\n\t\t\t\tresult = true;\r\n\t\t\t\tpassMsg = \"Test case Passed. The Task Panel item \" + dataPool.get(\"MenuItem\") + \" is not displayed when user account exist in single vault, even though show selected in the configuration page.\";\r\n\t\t\t}\r\n\r\n\t\t\tif(result)\r\n\t\t\t\tLog.pass(passMsg, driver);\r\n\t\t\telse\r\n\t\t\t\tLog.fail(\"Test Case Failed. The Task Panel item \" + dataPool.get(\"MenuItem\") + \" is not displayed while selecting show in configuration page.\", driver);\r\n\r\n\t\t}//End Try\r\n\t\tcatch (Exception e) {\r\n\t\t\tLog.exception(e, driver);\r\n\t\t} //End catch\r\n\r\n\t\tfinally {\r\n\t\t\tif (driver != null)\r\n\t\t\t{\r\n\t\t\t\ttry\r\n\t\t\t\t{\r\n\t\t\t\t\tconfigurationPage.configurationPanel.resetVaultCommands(menuItem, prevCommand, testVault);\r\n\t\t\t\t}\r\n\t\t\t\tcatch(Exception e0)\r\n\t\t\t\t{\r\n\t\t\t\t\tLog.exception(e0, driver);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tUtility.quitDriver(driver);\r\n\r\n\t\t}//End Finally\r\n\r\n\t}", "public void AddSingleLocation(){\r\n\t\t\r\n\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- My Account should be clicked and user should get logged in\");\r\n\t\ttry{\r\n\t\t\tsleep(3000);\r\n\t\t\t\r\n\t\t\tclick(locator_split(\"btnAddSingleLocation\"));\r\n\t\t\r\n\t\t\tsendKeys(locator_split(\"txtlocationname\"), getValue(\"Locationname\"));\r\n\t\t\tsendKeys(locator_split(\"txtlocationCurrency\"), getValue(\"LocationCurrency\"));\r\n\t\t\tsendKeys(locator_split(\"txtCityname\"), getValue(\"CityName\"));\r\n\t\t\tsendKeys(locator_split(\"txtcountryname\"), getValue(\"Country\"));\r\n\t\t\tsendKeys(locator_split(\"txtstate\"), getValue(\"State\"));\r\n\t\t\tsleep(3000);\r\n\t\t\tsendKeys(locator_split(\"txtbuildingvalue\"), getValue(\"BuildingValueCurrency\"));\r\n\t\t\tsendKeys(locator_split(\"txtmandevalue\"), getValue(\"MandEvaluecurrency\"));\r\n\t\t\tsendKeys(locator_split(\"txtcontentvalue\"), getValue(\"ContentvalueCurrency\"));\r\n\t\t\tsendKeys(locator_split(\"txtotherpd\"), getValue(\"Stockvaluecurrency\"));\r\n\t\t\tsendKeys(locator_split(\"txtstockvalue\"), getValue(\"OtherPDcurrency\"));\r\n\t\t\tsendKeys(locator_split(\"txtBIValue\"), getValue(\"BIValueCurrency\"));\r\n\t\t\tsendKeys(locator_split(\"txtindemnityperiod\"), getValue(\"BIIndemnityperiod\"));\r\n\t\t\r\n\t\t\tclick(locator_split(\"btnSaveLocation\"));\r\n\t\t\tsleep(5000);\r\n\t\t\tReporter.log(\"PASS_MESSAGE:- Report tab is clicked and user is logged in\");\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Report tab is not clicked in\");\r\n\t\t\tthrow new NoSuchElementException(\"The element with\"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"LoginLogout\")\r\n\t\t\t\t\t+ \" not found\");\r\n\r\n\t\t}\r\n\r\n\t}", "@Test(dataProviderClass = DataProviderUtils.class, dataProvider = \"excelDataReader\", groups = {\"Sprint36\", \"Breadcrumb\"}, \r\n\t\t\tdescription = \"Check the view path displayed in the breadcrumb.\")\r\n\tpublic void SprintTest36_1_11A(HashMap<String,String> dataValues, String driverType) throws Exception {\r\n\r\n\t\tdriver = null; \r\n\t\tLoginPage loginPage = null;\r\n\t\tConfigurationPage configurationPage = null;\r\n\t\tConfigurationPanel configSettingsPanel = null;\r\n\r\n\t\ttry {\r\n\r\n\r\n\r\n\r\n\t\t\tdriver = WebDriverUtils.getDriver();\r\n\r\n\t\t\tConcurrentHashMap <String, String> dataPool = new ConcurrentHashMap <String, String>(dataValues);\r\n\r\n\t\t\t//1. Login to Configuration\r\n\t\t\t//--------------------------\r\n\t\t\tdriver.get(configURL);\r\n\r\n\t\t\tloginPage = new LoginPage(driver);\r\n\t\t\tconfigurationPage = loginPage.loginToConfigurationUI(userName, password);\r\n\r\n\t\t\tLog.message(\"1. Logged in to Configuiration\");\r\n\r\n\t\t\t//2. Click the Vault folder \r\n\t\t\t//--------------------------\r\n\t\t\tconfigurationPage.treeView.clickTreeViewItem(\"Vault-specific settings>>\" + testVault);\r\n\r\n\r\n\t\t\tLog.message(\"2. Clicked the Vault folder.\");\r\n\r\n\t\t\t//3. Check the Prevent Navigation check box\r\n\t\t\t//------------------------------------------\r\n\t\t\tconfigSettingsPanel = new ConfigurationPanel(driver);\r\n\t\t\tconfigSettingsPanel.setLayout(dataPool.get(\"Layout\"));\r\n\r\n\t\t\tLog.message(\"3. Layout is selected\");\r\n\r\n\t\t\t//4. Save the changes\r\n\t\t\t//--------------------\r\n\t\t\tif (!configurationPage.configurationPanel.saveSettings())\r\n\t\t\t\tthrow new Exception(\"Configuration settings are not saved.\");\r\n\r\n\t\t\tconfigurationPage.logOut();\r\n\r\n\t\t\tLog.message(\"4. Saved the changes.\");\r\n\r\n\t\t\t//5. Login to the Test vault\r\n\t\t\t//---------------------------\r\n\t\t\tdriver.get(loginURL);\r\n\t\t\tHomePage homePage = loginPage.loginToWebApplication(userName, password, testVault);\r\n\r\n\t\t\tLog.message(\"5. Login to the Test Vault.\");\r\n\r\n\t\t\t//6. Navigate to the View\r\n\t\t\t//------------------------\r\n\t\t\thomePage.listView.navigateThroughView(dataPool.get(\"ExpectedPath\").replace(\">\", \">>\"));\r\n\r\n\t\t\tLog.message(\"6. Navigated to the View\");\r\n\r\n\t\t\t//Verification: To verify if the Breadcrumb shows the right path\r\n\t\t\t//---------------------------------------------------------------\r\n\t\t\tif(homePage.menuBar.GetBreadCrumbItem().equals(testVault+\">\"+dataPool.get(\"ExpectedPath\")) && driver.getCurrentUrl().endsWith(dataPool.get(\"ViewID\")))\r\n\t\t\t\tLog.pass(\"Test case Passed. The breadcrumb showed the right path when the layout was set as \" + dataPool.get(\"Layout\")); \r\n\t\t\telse\r\n\t\t\t\tLog.fail(\"Test Case Failed. The breadcrumb did not show the right path when the layout was set as \" + dataPool.get(\"Layout\"), driver);\r\n\r\n\r\n\t\t} //End try\r\n\r\n\t\tcatch(Exception e) \t{\r\n\t\t\tLog.exception(e, driver);\r\n\t\t} //End catch\r\n\r\n\t\tfinally {\r\n\t\t\tif(driver != null){\r\n\t\t\t\ttry\r\n\t\t\t\t{\r\n\t\t\t\t\tdriver.get(configURL);\r\n\r\n\t\t\t\t\tconfigurationPage = new ConfigurationPage(driver);\r\n\t\t\t\t\tconfigurationPage.treeView.clickTreeViewItem(\"Vault-specific settings>>\" + testVault);\r\n\r\n\t\t\t\t\tconfigSettingsPanel.setLayout(Caption.ConfigSettings.Config_Default.Value);\r\n\r\n\t\t\t\t\tif (!configurationPage.configurationPanel.saveSettings())\r\n\t\t\t\t\t\tthrow new Exception(\"Configuration settings are not saved.\");\r\n\t\t\t\t}\r\n\t\t\t\tcatch(Exception e0)\r\n\t\t\t\t{\r\n\t\t\t\t\tLog.exception(e0, driver);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tUtility.quitDriver(driver);\r\n\t\t} //End finally\r\n\r\n\t}", "@Test(enabled = true)\n public void navigateToCarRental() {\n driver.findElement(By.cssSelector(\"a[href='?pwaLob=wizard-car-pwa']\")).click();\n driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);\n WebElement rentalCar = driver.findElement(By.xpath(\"//button[@aria-label='Pick-up']\"));\n rentalCar.sendKeys(\"SBN\");\n rentalCar.sendKeys(Keys.ARROW_DOWN);\n rentalCar.sendKeys(Keys.ENTER);\n rentalCar.sendKeys(Keys.TAB);\n driver.findElement(By.xpath(\"//button[contains(text(),'Search')]\")).click();\n driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);\n\n String expectedLocation = \"South Bend, IN (SBN-South Bend Intl.)\";\n String actualLocation = driver.findElement(By.linkText(\"South Bend, IN (SBN-South Bend Intl.)\")).getText();\n\n Assert.assertEquals(actualLocation, expectedLocation, \"Test Failed.\");\n\n }", "@Test //Test to see you are able to buy policy and confirmation page is displayed\n public void policyConfirmationTest() throws InterruptedException {\n \t WebElement submitPolicy=driver.findElement(By.xpath(\"/html/body/center/form/center[3]/pre/input[3]\"));\n \t submitPolicy.click();\n \t assertTrue(driver.findElement(By.xpath(\"/html/body/center[2]/h3\")).isDisplayed()); \n\t Thread.sleep(3000);\n\t driver.close();\n\n}", "@Test\r\n\tpublic void smr142() {\r\n\t\ttry{\r\n\t\t\tfinal String firstName=testDataOR.get(\"superuser_first_name\"),lastName=testDataOR.get(\"superuser_last_name\");\r\n\t\t\tlogin(\"URLEverest\",testDataOR.get(\"superuser\"),firstName,lastName);\r\n\t\t\tlogger.info(\"SMR142 execution started\");\r\n\t\t\tfinal String numComm=testDataOR.get(\"num_comm\"),cust=testDataOR.get(\"customer\")\r\n\t\t\t\t\t,posNum=testDataOR.get(\"pos_number\"),dbEportal=testDataOR.get(\"databaseEportal\"),dbAxis=testDataOR.get(\"databaseAxis\")\r\n\t\t\t\t\t,pos,numptv,numcom;\r\n\t\t\tfinal String[] posLoc={\"posrefund_xpath\",\"posforcing_xpath\",\"posvoid_xpath\",\"posnumcomm_xpath\"},\r\n\t\t\t\t\tposVal={testDataOR.get(\"refund_option\"),testDataOR.get(\"forcing_option\"),testDataOR.get(\"void_option\"),numComm};\r\n\t\t\t\r\n\t\t\t//Access Everest with the Everest superuser\r\n\t\t\t//Navigate to Card Payment-Customer Provisioning and select the \r\n\t\t\t//customer\r\n\t\t\taddProfToCust(cust);\r\n\r\n\t\t\t//Select 'Manual localization',pos and click Next\t\r\n\t\t\tlogger.info(\"Step 6:\");\r\n\t\t\tselUtils.selectItem(selUtils.getObject(\"operationorder_id\"), MANUALLOCALZTION);\r\n\t\t\tlogger.info(\"Selected \"+MANUALLOCALZTION);\r\n\t\t\tselUtils.clickOnWebElement(selUtils.getObject(\"pos_radiobttn_xpath\"));\r\n\t\t\tselUtils.clickOnWebElement(selUtils.getObject(\"orderopenext_id\"));\r\n\r\n\t\t\t//Select a lowest level zone and click Next\r\n\t\t\tlogger.info(\"Step 7:\");\r\n\t\t\tselUtils.selectItem(selUtils.getObject(\"localization_id\"), testDataOR.get(\"lowest_level_zone_a\"));\r\n\t\t\tselUtils.clickOnWebElement(selUtils.getObject(\"localizationnext_xpath\"));\r\n\t\t\tlogger.info(\"Selected a lowest level zone and next button\");\r\n\t\t\t\r\n\t\t\t//Select the <num_comm> from the dropdown list,click 'Next' button\r\n\t\t\tlogger.info(\"Step 8:\");\r\n\t\t\tselUtils.selectItem(selUtils.getObject(\"numcomm_selection_id\"), numComm);\r\n\t\t\t((JavascriptExecutor) driver).executeScript(\"arguments[0].click();\", selUtils.getObject(\"locnext_id\"));\r\n\t\t\tlogger.info(\"Selected numcomm zone and next button\");\r\n\r\n\t\t\t\r\n\t\t\t//select manual pos,and add pos details\r\n\t\t\tlogger.info(\"Step 9:\");\r\n\t\t\tselUtils.slctChkBoxOrRadio(selUtils.getObject(\"enterposanual_xpath\"));\r\n\t\t\tselUtils.clickOnWebElement(selUtils.getObject(\"addpos_xpath\"));\r\n\t\t\tselUtils.getObject(\"posnumber_id\").sendKeys(posNum);\r\n\t\t\taddPOSval(posLoc, posVal);\r\n\t\t\t\r\n\t\t\t//Edit projectname and deploy\r\n\t\t\teditPNameNDeply();\r\n\t\t\t\r\n\t\t\tif(dbCheck){\r\n\t\t\t\t//validating data with database,validate data in Eportal database\r\n\t\t\t\tsqlQuery = \"SELECT * FROM pos WHERE pos='\"+posNum+\"'\";\r\n\t\t\t\tresSet = dbMethods.getDataBaseVal(dbEportal,sqlQuery,CommonConstants.ONEMIN);\r\n\t\t\t\tpos=resSet.getString(\"pos\");\r\n\t\t\t\tAssert.assertTrue(pos.equals(posNum), \"Table data does not exist \");\r\n\t\t\t\tlogger.info(\"pos number \"+posNum+ \" exists in table\");\r\n\r\n\t\t\t\t//Validating the results in Axis database\r\n\t\t\t\tsqlQuery=\"SELECT numtpv,numcomm FROM emv.tpvemv WHERE numtpv='\"+posNum+\"' AND numcomm='\"+numComm+\"';\";\r\n\t\t\t\tresSet = dbMethods.getDataBaseVal(dbAxis,sqlQuery,CommonConstants.ONEMIN);\r\n\t\t\t\tnumptv=resSet.getString(\"numtpv\");\r\n\t\t\t\tnumcom=resSet.getString(\"numcomm\");\r\n\t\t\t\tAssert.assertTrue(numptv.equals(posNum)&&numcom.equals(numComm), \"Table data does not exist \");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tlogger.info(\"SMR142 executed successfully\");\r\n\t\t}\r\n\t\tcatch (Throwable t) {\r\n\t\t\thandleException(t);\r\n\t\t}\r\n\t}", "public void VerifyCouponfieldsinCheckout(){\r\n\t\tString countriess1 = \"Denmark,France,PresselSwitzerland,Norway,Spain,BernardFrance,,BernardBelgium,PresselAustria,UK,PresselGermany\";\r\n\t\tString countriess2 = \"Germany,Spain\";\r\n\t\tString countriess3 = \"Netherland,Italy\";\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- Cupon Input txt box and Apply button should be present\");\r\n\r\n\t\ttry{\r\n\t\t\tif(countriess1.contains(countries.get(countrycount))){\r\n\t\t\t\tif(isElementPresent(locator_split(\"txtCouponinput1inCheckout\")) &\r\n\t\t\t\t\t\tisElementPresent(locator_split(\"txtCouponinput2inCheckout\")) &\r\n\t\t\t\t\t\tisElementPresent(locator_split(\"txtCouponinput3inCheckout\")) &\r\n\t\t\t\t\t\tisElementPresent(locator_split(\"btnCuponApplybuttoninCheckout\"))){\r\n\t\t\t\t\tSystem.out.println(\"3 cupon input box and apply button is present for -\"+countries.get(countrycount));\r\n\t\t\t\t}else{\r\n\t\t\t\t\tSystem.out.println(\"3 cupon or apply buttons is not present for -\"+countries.get(countrycount));\r\n\t\t\t\t\tthrow new Error();\r\n\t\t\t\t}\r\n\t\t\t}else if(countriess2.contains(countries.get(countrycount))){\r\n\t\t\t\tif(isElementPresent(locator_split(\"txtCouponinput1inCheckout\")) &\r\n\t\t\t\t\t\tisElementPresent(locator_split(\"btnCuponApplybuttoninCheckout\"))){\r\n\t\t\t\t\tSystem.out.println(\"1 cupon input box and apply button is present for -\"+countries.get(countrycount));\r\n\t\t\t\t}else{\r\n\t\t\t\t\tSystem.out.println(\"1 cupon or apply buttons is not present for -\"+countries.get(countrycount));\r\n\t\t\t\t\tthrow new Error();\r\n\t\t\t\t}\r\n\t\t\t}else if(countriess3.contains(countries.get(countrycount))){\r\n\t\t\t\tif(isElementPresent(locator_split(\"txtCouponinput1inCheckout\")) &\r\n\t\t\t\t\t\tisElementPresent(locator_split(\"txtCouponinput2inCheckout\")) &\r\n\t\t\t\t\t\tisElementPresent(locator_split(\"btnCuponApplybuttoninCheckout\"))){\r\n\t\t\t\t\tSystem.out.println(\"2 cupon input box and apply button is present for -\"+countries.get(countrycount));\r\n\t\t\t\t}else{\r\n\t\t\t\t\tSystem.out.println(\"2 cupon or apply buttons is not present for -\"+countries.get(countrycount));\r\n\t\t\t\t\tthrow new Error();\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tSystem.out.println(\"incorret country is entered in method for -\"+countries.get(countrycount));\r\n\t\t\t\tthrow new Exception();\r\n\t\t\t}\r\n\t\t}catch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Incorrect country is entered in method for -\"+countries.get(countrycount)+\" or\"\r\n\t\t\t\t\t+ \" Element not found\");\r\n\t\t\tthrow new NoSuchElementException(\"The element with\"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"imgShiptoStoreinCartinCheckout\")\r\n\t\t\t\t\t+ \" not found\");\r\n\t\t}\r\n\t\tcatch(Error e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Number of cupons is not matching for country or Apply button not present for-\"+countries.get(countrycount));\r\n\t\t\tthrow new Error(\"Number of cupons is not matching for country or Apply button not present for-\"+countries.get(countrycount));\r\n\t\t}\r\n\r\n\t}", "@Test\n public void testAdvancedSearchCategoryResult() throws InterruptedException {\n log.info(\"Go to Homepage \" );\n log.info(\"Click on Advanced Search link in footer \" );\n WebElement advancedSearchButton = driver.findElement(By.partialLinkText(\"Advanced Search\"));\n advancedSearchButton.click();\n WebElement searchCassette = driver.findElement(By.id(\"AdvancedSearchResults\")).findElement(By.tagName(\"input\"));\n WebElement searchButton = driver.findElement(By.id(\"AdvancedSearchResults\")).findElement(By.tagName(\"button\"));\n searchCassette.click();\n searchCassette.sendKeys(\"sculpture\");\n log.info(\"Click on search Button \" );\n searchButton.click();\n log.info(\"Identify the Category Card list in results\" );\n List<WebElement> productGrid = driver.findElements(By.tagName(\"a\"));\n List<WebElement> categoryItems = new ArrayList<WebElement>();\n for (WebElement prod : productGrid)\n if (prod.getAttribute(\"class\").contains(\"category-item\"))\n categoryItems.add(prod);\n TestCase.assertTrue(categoryItems.size() != 0);\n log.info(\"Click first Category Card in results\" );\n categoryItems.get(0).click();\n log.info(\"Confirm category type page is displayed in browser\" );\n TestCase.assertTrue(driver.getCurrentUrl().contains(\"-c-\"));\n }", "@Test\n public void test10020ATS001ValidationofDatefieldsinPayHistory() throws Exception {\n driver.get(\"http://Clarity\");\n driver.findElement(By.id(\"ctl00_ContentPlaceHolder_UserNameTextBox\")).clear();\n driver.findElement(By.id(\"ctl00_ContentPlaceHolder_UserNameTextBox\")).sendKeys(\"02.08.09\");\n driver.findElement(By.id(\"ctl00_ContentPlaceHolder_PasswordTextBox\")).clear();\n driver.findElement(By.id(\"ctl00_ContentPlaceHolder_PasswordTextBox\")).sendKeys(\"password\");\n driver.findElement(By.id(\"ctl00_ContentPlaceHolder_LoginButton\")).click();\n driver.findElement(By.id(\"ctl00_ContentPlaceHolder_btnLogin\")).click();\n //driver.findElement(By.linkText(\"Select\")).click();\n Thread.sleep(1000);\n driver.findElement(By.xpath(\".//*[@id='navigation']/li[3]/span/a\")).click();\n driver.findElement(By.linkText(\"How much is my pension?\")).click();\n Thread.sleep(1000);\n // Warning: verifyTextPresent may require manual changes\n try {\n assertTrue(driver.findElement(By.cssSelector(\"BODY\")).getText().matches(\"^[\\\\s\\\\S]*How much is my pension[\\\\s\\\\S][\\\\s\\\\S]*$\"));\n } catch (Error e) {\n verificationErrors.append(e.toString());\n }\n driver.findElement(By.id(\"ctl01_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_StartDate\")).clear();\n driver.findElement(By.id(\"ctl01_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_StartDate\")).sendKeys(\"02/10/20\");\n driver.findElement(By.id(\"ctl01_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_goButton\")).click();\n Thread.sleep(1000);\n // Warning: verifyTextPresent may require manual changes\n try {\n assertTrue(driver.findElement(By.cssSelector(\"BODY\")).getText().matches(\"^[\\\\s\\\\S]*Start date is later than end date\\\\.[\\\\s\\\\S]*$\"));\n } catch (Error e) {\n verificationErrors.append(e.toString());\n }\n Thread.sleep(1000);\n driver.findElement(By.xpath(\".//*[@id='navigation']/li[3]/span/a\")).click();\n driver.findElement(By.linkText(\"How much is my pension?\")).click();\n Thread.sleep(1000);\n driver.findElement(By.id(\"ctl01_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_StartDate\")).clear();\n driver.findElement(By.id(\"ctl01_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_StartDate\")).sendKeys(\"25/07/2017\");\n Thread.sleep(1000);\n driver.findElement(By.xpath(\".//*[@id='ctl01_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_EndDate']\")).clear();\n //driver.findElement(By.id(\"ctl00_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_EndDate\")).clear();\n //driver.findElement(By.id(\"ctl00_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_EndDate\")).sendKeys(\"02/10/2\");\n driver.findElement(By.xpath(\".//*[@id='ctl01_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_EndDate']\")).sendKeys(\"02/10/2\");\n //driver.findElement(By.id(\"ctl00_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_goButton\")).click();\n driver.findElement(By.xpath(\".//*[@id='ctl01_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_goButton']\")).click();\n Thread.sleep(1000);\n // Warning: verifyTextPresent may require manual changes\n try {\n assertTrue(driver.findElement(By.cssSelector(\"BODY\")).getText().matches(\"^[\\\\s\\\\S]*End Date is not recognized as a valid date\\\\.[\\\\s\\\\S]*$\"));\n } catch (Error e) {\n verificationErrors.append(e.toString());\n }\n Thread.sleep(1000);\n driver.findElement(By.xpath(\".//*[@id='navigation']/li[3]/span/a\")).click();\n driver.findElement(By.linkText(\"How much is my pension?\")).click();\n Thread.sleep(1000);\n driver.findElement(By.xpath(\".//*[@id='ctl01_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_StartDate']\")).clear();\n driver.findElement(By.xpath(\".//*[@id='ctl01_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_StartDate']\")).sendKeys(\"21221\\\"\\\"\\\"\");\n Thread.sleep(1000);\n driver.findElement(By.xpath(\".//*[@id='ctl01_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_EndDate']\")).clear();\n driver.findElement(By.xpath(\".//*[@id='ctl01_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_EndDate']\")).sendKeys(\"wewe\\\"\\\"\\\"\");\n driver.findElement(By.xpath(\".//*[@id='ctl01_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_goButton']\")).click();\n Thread.sleep(1000);\n //try {\n //assertTrue(driver.findElement(By.id(\"ctl00_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_StartDateTypeValidator\")).getText().matches(\"^exact:[\\\\s\\\\S]*$\"));\n //} catch (Error e) {\n // verificationErrors.append(e.toString());\n //}\n // ERROR: Caught exception [Error: locator strategy either id or name must be specified explicitly.]\n driver.findElement(By.id(\"ctl00_ctl00_BaseContentPlaceHolder_LoginStatus\")).click();\n }", "@Test(dataProviderClass = DataProviderUtils.class, dataProvider = \"excelDataReader\", groups = {\"Sprint36\", \"Breadcrumb\"}, \r\n\t\t\tdescription = \"Check the view path displayed in the breadcrumb .\")\r\n\tpublic void SprintTest36_1_11B(HashMap<String,String> dataValues, String driverType) throws Exception {\r\n\r\n\t\tdriver = null; \r\n\t\tLoginPage loginPage = null;\r\n\t\tConfigurationPage configurationPage = null;\r\n\t\tConfigurationPanel configSettingsPanel = null;\r\n\r\n\t\ttry {\r\n\r\n\r\n\r\n\t\t\tdriver = WebDriverUtils.getDriver();\r\n\r\n\t\t\tConcurrentHashMap <String, String> dataPool = new ConcurrentHashMap <String, String>(dataValues);\r\n\r\n\t\t\t//1. Login to Configuration\r\n\t\t\t//--------------------------\r\n\t\t\tdriver.get(configURL);\r\n\r\n\t\t\tloginPage = new LoginPage(driver);\r\n\t\t\tconfigurationPage = loginPage.loginToConfigurationUI(userName, password);\r\n\r\n\t\t\tLog.message(\"1. Logged in to Configuiration\");\r\n\r\n\t\t\t//2. Click the Vault folder \r\n\t\t\t//--------------------------\r\n\t\t\tconfigurationPage.treeView.clickTreeViewItem(\"Vault-specific settings>>\" + testVault);\r\n\r\n\r\n\t\t\tLog.message(\"2. Clicked the Vault folder.\");\r\n\r\n\t\t\t//3. Check the Prevent Navigation check box\r\n\t\t\t//------------------------------------------\r\n\t\t\tconfigSettingsPanel = new ConfigurationPanel(driver);\r\n\t\t\tconfigSettingsPanel.setLayout(dataPool.get(\"Layout\"));\r\n\r\n\t\t\tLog.message(\"3. Layout is selected\");\r\n\r\n\t\t\t//4. Save the changes\r\n\t\t\t//--------------------\r\n\t\t\tif (!configurationPage.configurationPanel.saveSettings())\r\n\t\t\t\tthrow new Exception(\"Configuration settings are not saved.\");\r\n\r\n\t\t\tconfigurationPage.logOut();\r\n\r\n\t\t\tLog.message(\"4. Saved the changes.\");\r\n\r\n\t\t\t//5. Login to the Test vault and navigate to a view\r\n\t\t\t//--------------------------------------------------\r\n\t\t\tdriver.get(loginURL);\r\n\t\t\tHomePage homePage = loginPage.loginToWebApplication(userName, password, testVault);\r\n\r\n\t\t\thomePage.listView.navigateThroughView(dataPool.get(\"View\"));\r\n\r\n\r\n\t\t\tLog.message(\"5. Logged in to the Test vault and navigated to a view.\");\r\n\r\n\t\t\t//6. Navigate back to the parent vault though breadcrumb\r\n\t\t\t//-------------------------------------------------------\r\n\t\t\thomePage.menuBar.clickBreadcrumbItem(dataPool.get(\"ExpectedPath\"));\r\n\r\n\r\n\t\t\tLog.message(\"6. Navigate back to the parent vault though breadcrumb.\");\r\n\r\n\t\t\t//Verification: To verify if the Breadcrumb shows the right path\r\n\t\t\t//---------------------------------------------------------------\r\n\t\t\tif(driver.getCurrentUrl().endsWith(dataPool.get(\"ExpectedID\")))\r\n\t\t\t\tthrow new Exception(\"Navigation to parent view through breadcrumb failed.\");\r\n\r\n\t\t\tif(!homePage.menuBar.GetBreadCrumbItem().equals(testVault+\">\"+dataPool.get(\"ExpectedPath\")))\r\n\t\t\t\tthrow new Exception(\"The Expected Breadcrumb text was not displayed after navigating to the parent view.\");\r\n\r\n\t\t\tif(homePage.listView.isItemExists(dataPool.get(\"ChildItem\")))\r\n\t\t\t\tLog.pass(\"Test case Passed. Navigation to Parent View through Breadcrumb was successful.\"); \r\n\t\t\telse\r\n\t\t\t\tLog.fail(\"Test Case Failed. Navigation to parent view through breadcrumb failed.\", driver);\r\n\r\n\r\n\t\t} //End try\r\n\r\n\t\tcatch(Exception e) \t{\r\n\t\t\tLog.exception(e, driver);\r\n\t\t} //End catch\r\n\r\n\t\tfinally {\r\n\t\t\tif(driver != null){\r\n\t\t\t\ttry\r\n\t\t\t\t{\r\n\t\t\t\t\tdriver.get(configURL);\r\n\r\n\t\t\t\t\tconfigurationPage = new ConfigurationPage(driver);\r\n\t\t\t\t\tconfigurationPage.treeView.clickTreeViewItem(\"Vault-specific settings>>\" + testVault);\r\n\r\n\t\t\t\t\tconfigSettingsPanel.setLayout(Caption.ConfigSettings.Config_Default.Value);\r\n\r\n\t\t\t\t\tif (!configurationPage.configurationPanel.saveSettings())\r\n\t\t\t\t\t\tthrow new Exception(\"Configuration settings are not saved.\");\r\n\t\t\t\t}\r\n\t\t\t\tcatch(Exception e0)\r\n\t\t\t\t{\r\n\t\t\t\t\tLog.exception(e0, driver);\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t\tUtility.quitDriver(driver);\r\n\t\t} //End finally\r\n\r\n\t}", "@Test(groups ={Slingshot,Regression,SubmitMeterRead})\npublic void verifySubmitMeterReadingLandingPageLink()\t\n{\t\n\tReport.createTestLogHeader(\"Anonymous Submit meter read\", \"Verify the link navigations of Submit meter read landing page\");\n\t\tnew SubmitMeterReadAction()\n\t\t.openSMRpage1()\n\t\t.verifySubmitMeterreadLandingPageNavigationLinks();\n}", "@Test(dataProviderClass = DataProviderUtils.class, dataProvider = \"excelDataReader\", groups = {\"Sprint36\", \"Breadcrumb\"}, \r\n\t\t\tdescription = \"Navigation to Parent View through TaskPanel ['Prevent navigation outside of the default view' - Checked].\")\r\n\tpublic void SprintTest36_1_12E(HashMap<String,String> dataValues, String driverType) throws Exception {\r\n\r\n\t\tdriver = null; \r\n\t\tLoginPage loginPage = null;\r\n\t\tConfigurationPage configurationPage = null;\r\n\t\tConfigurationPanel configSettingsPanel = null;\r\n\r\n\t\ttry {\r\n\r\n\r\n\r\n\t\t\tdriver = WebDriverUtils.getDriver();\r\n\r\n\t\t\tConcurrentHashMap <String, String> dataPool = new ConcurrentHashMap <String, String>(dataValues);\r\n\r\n\t\t\t//1. Login to Configuration\r\n\t\t\t//--------------------------\r\n\t\t\tdriver.get(configURL);\r\n\r\n\t\t\tloginPage = new LoginPage(driver);\r\n\t\t\tconfigurationPage = loginPage.loginToConfigurationUI(userName, password);\r\n\r\n\t\t\tLog.message(\"1. Logged in to Configuiration\");\r\n\r\n\t\t\t//2. Click the Vault folder \r\n\t\t\t//--------------------------\r\n\t\t\tconfigurationPage.treeView.clickTreeViewItem(\"Vault-specific settings>>\" + testVault);\r\n\r\n\t\t\tLog.message(\"2. Clicked the Vault folder.\");\r\n\r\n\t\t\t//3. Select the Default View\r\n\t\t\t//------------------------------\r\n\t\t\tconfigSettingsPanel = new ConfigurationPanel(driver);\r\n\t\t\tconfigSettingsPanel.setDefaultView(dataPool.get(\"View\"));\r\n\r\n\t\t\tLog.message(\"3. Selected the Default View.\");\r\n\r\n\t\t\t//4. Check the Prevent Navigation check box\r\n\t\t\t//------------------------------------------\r\n\t\t\tconfigSettingsPanel.setPreventNavigation(true);\r\n\r\n\t\t\tLog.message(\"4. Checked the Prevent Navigation check box.\");\r\n\r\n\t\t\t//5. Save the changes\r\n\t\t\t//--------------------\r\n\t\t\tif (!configurationPage.configurationPanel.saveSettings())\r\n\t\t\t\tthrow new Exception(\"Configuration settings are not saved.\");\r\n\r\n\t\t\tconfigurationPage.logOut();\r\n\r\n\t\t\tLog.message(\"5. Saved the changes.\");\r\n\r\n\t\t\t//6. Login to the Vault\r\n\t\t\t//----------------------\r\n\t\t\tdriver.get(loginURL);\r\n\t\t\tHomePage homePage = loginPage.loginToWebApplication(userName, password, testVault);\r\n\r\n\t\t\tLog.message(\"6. logged in to the vault.\");\r\n\r\n\t\t\t//7. Navigate to Home View using the Task Panel\r\n\t\t\t//--------------------------------------------\r\n\t\t\tString expectedURL = driver.getCurrentUrl();\r\n\t\t\thomePage.taskPanel.clickItem(Caption.MenuItems.Home.Value);\r\n\r\n\t\t\tLog.message(\"7. Navigated to Home View using the Task Panel\");\r\n\r\n\t\t\t//Verification: To verify if the Breadcrumb show the right path to the default view\r\n\t\t\t//----------------------------------------------------------------------------------\r\n\t\t\tif(expectedURL.equals(driver.getCurrentUrl()))\r\n\t\t\t\tLog.pass(\"Test case Passed. Navigation to previous view was not possible as expected.\"); \r\n\t\t\telse\r\n\t\t\t\tLog.fail(\"Test Case Failed. The URL showed '\" + driver.getCurrentUrl() + \"' instead of '\" + expectedURL + \"'\", driver);\r\n\r\n\r\n\t\t} //End try\r\n\r\n\t\tcatch(Exception e) \t{\r\n\t\t\tLog.exception(e, driver);\r\n\t\t} //End catch\r\n\r\n\t\tfinally {\r\n\t\t\tif(driver != null){\r\n\t\t\t\ttry\r\n\t\t\t\t{\r\n\r\n\t\t\t\t\tdriver.get(configURL);\r\n\r\n\t\t\t\t\tconfigurationPage = new ConfigurationPage(driver);\r\n\t\t\t\t\tconfigurationPage.treeView.clickTreeViewItem(\"Vault-specific settings>>\" + testVault);\r\n\r\n\t\t\t\t\tconfigSettingsPanel.setDefaultView(Caption.MenuItems.Home.Value);\r\n\t\t\t\t\tconfigSettingsPanel.setPreventNavigation(false);\r\n\r\n\t\t\t\t\tif (!configurationPage.configurationPanel.saveSettings())\r\n\t\t\t\t\t\tthrow new Exception(\"Configuration settings are not saved.\");\r\n\t\t\t\t}\r\n\t\t\t\tcatch(Exception e0)\r\n\t\t\t\t{\r\n\t\t\t\t\tLog.exception(e0, driver);\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t\tUtility.quitDriver(driver);\r\n\t\t} //End finally\r\n\r\n\t}", "@Test(priority =3)\n\t public void validatehomepage() throws InterruptedException \n\t {\n\t\t\n\t\tdriver.findElement(By.linkText(\"Unit and Extension test\")).isDisplayed(); \n\t\t\n\t }", "@Test(groups ={Slingshot,Regression,SubmitMeterRead})\npublic void verifyYourdetailsGasOverLayLink()\t\n{\t\n\tReport.createTestLogHeader(\"Anonymous Submit meter read\", \"verify the Gas OverLay Link's In Your details\");\n\n\t\tnew SubmitMeterReadAction()\n\t\t.openSMRpage(\"Gas\")\t\t\n\t\t.verifyGasWhyWeNeedThisLink()\n\t\t.verifyGasAcctnoWhereCanIfindthisLink()\n\t\t.verifyGasMeterPointWhereCanIfindthisLink()\n\t\t.verifyGasMeterIDWhereCanIfindthisLink();\n}", "@Test (enabled = false, groups = {\"smokeTest\"})\n public void testVerifyInternationalCountryOfOrigin() throws Exception {\n test = extent.createTest(\"Verify International Facts Country Of Origin\");\n driver.manage().timeouts().implicitlyWait(time_to_wait, TimeUnit.SECONDS);//this is global so no need to mention multiple times\n try {\n login.doLogin(test);\n WebElement helpButton = driver.findElement(By.cssSelector(\".explore-quiries-inner\"));\n helpButton.click();\n test.log(Status.INFO, \"Help button Clicked\");\n test.createNode(\"Help Button clicked\");\n Thread.sleep(5 * 1000);\n\n test.log(Status.INFO, \"Sunburst Shown\");\n WebElement International = driver.findElement(By.id(\"mainArc-0b981a1b-32dc-43b1-b257-70c8c5a6cc6d\"));\n International.click();\n test.log(Status.INFO, \"International Cluster Clicked on the Sunburst\");\n test.createNode(\"International cluster clicked\");\n Thread.sleep(5 * 1000);\n\n WebElement Countryoforigin = driver.findElement(By.id(\"mainArc-71ef3c15-be01-454d-bd1e-c59d13904a65\"));\n Countryoforigin.click();\n Thread.sleep(5 * 1000);\n test.log(Status.INFO, \"Country of Origin Element Clicked on the Sunburst\");\n test.createNode(\"Country of Origin clicked\");\n\n WebElement helpButtoncountry = driver.findElement(By.id(\"mainArc-466ed1b9-526b-45c7-a02c-e6d419ef606f\"));\n helpButtoncountry.click();\n Thread.sleep(5 * 1000);\n\n WebElement TabularView = driver.findElement(By.id(\"simple-tab-0\"));\n TabularView.click();\n Thread.sleep(4*1000);\n\n /// VALIDATION ///\n WebElement tr = driver.findElement(By.id(\"total-records-count\"));\n String value = tr.getText();\n System.out.println(\"total record->\"+value);\n if (Integer.parseInt(value) == 0) {\n test.log(Status.INFO, \"No Table should appear since no data fetched for given query\");\n Assert.assertEquals(0, 0);\n Assert.assertFalse(Integer.parseInt(value) == 0); // to fail, parameter has to be true (0 == 0) => so true; assertFalse(true) means failed test\n } else {\n test.log(Status.INFO, \"Table is shown with records since table records != 0\");\n Assert.assertEquals(Integer.parseInt(value) > 0, true); //setting to true since if it comes into this else, it is greater than 0 (can be any num greater than 0 so can't put set value for expected)\n Assert.assertTrue(Integer.parseInt(value) > 0);\n\n\n driver.findElement(By.xpath(\"//*[text()=' Total Records']\"));\n test.log(Status.INFO, \"Total Records found and table shown\");\n Thread.sleep(2 * 1000);\n test.createNode(\"Verified the table information is displayed when Country of origin is selected. \");\n\n WebElement Graphicalview = driver.findElement(By.id(\"simple-tab-1\"));\n Graphicalview.click(); // Clicks on Graphical View\n test.createNode(\"Grahical view clicked\");\n Thread.sleep(2 * 1000);\n\n WebElement Ograph = driver.findElement(By.id(\"simple-tab-2\"));\n Ograph.click(); // Clicks on Other Graphical View old one\n test.createNode(\"Other Graphical view clicked\");\n Thread.sleep(2 * 1000);\n\n WebElement Axis1 = driver.findElement(By.className(\"other-graph-axis-1-value\"));\n Axis1.click(); // Click Axis 1\n Thread.sleep(3 * 1000);\n test.createNode(\"clciked on Axis1\");\n driver.findElement(By.id(\"react-select-2-option-0\")).click(); // Click origin country\n Thread.sleep(2 * 1000);\n\n WebElement Axis2 = driver.findElement(By.className(\"other-graph-axis-2-value\"));\n Axis2.click(); // Click Axis 2\n test.createNode(\"clciked on Axis2\");\n Thread.sleep(3 * 1000);\n WebElement count = driver.findElement(By.id(\"react-select-3-option-0\"));\n count.click(); // Click count\n Thread.sleep(5 * 1000);\n\n WebElement Graph = driver.findElement(By.className(\"other-graph-type\"));\n Graph.click(); //Click graph\n test.createNode(\"clicked on graph\");\n Thread.sleep(3 * 1000);\n\n WebElement bubblegraph = driver.findElement(By.id(\"react-select-4-option-4\"));\n bubblegraph.click(); // Click bubble Graph\n Thread.sleep(4 * 1000);\n\n WebElement Show = driver.findElement(By.className(\"MuiButton-label\")); // Click Show\n test.createNode(\"clicked ON Show button \");\n Show.click();\n }\n\n\n } catch(\n Exception e)\n\n {\n test.createNode(\"Exception (\" + e.toString() + \") found\").fail(e);\n // e.printStackTrace();\n }\n\n }", "@Test(priority = 4, dependsOnMethods = { \"verifyUrlOfSubscription\" }, groups = { \"Smoke\" })\n\tpublic static void verifySubscriptionPageComponents() throws InterruptedException \n\t{\n\n\t\ttest = report.startTest(\"Verify Components of Subscription Page\");\n \n\t\t\n\t\t //verify Select Service Principal\n\t\t WebElement selectServicePrincipal=driver.findElement(By.xpath(xpathSelectServicePrincipal));\n\t\t Assert.assertTrue(selectServicePrincipal.isDisplayed());\n\t\t test.log(LogStatus.PASS, \"Select Service Principal\",\"Select Service Principal is displaying\");\n\t\t \n\t\t //Verify Select Service Principal Field WaterMark\n\t\t String selectServicePrincipalWM = driver.findElement(By.xpath(xpathSelectServicePrincipalWM)).getText();\n Assert.assertEquals(selectServicePrincipalWM,\"Select Service Principal *\",\"select Service Principal WaterMark is not Displaying \");\n test.log(LogStatus.PASS,\"Select Service Principal WM\", \"select Service Principal WaterMark is Displaying\");\n\t\t\n\t\t\n\t\t// Verify Name Field\n\t\tWebElement name = driver.findElement(By.id(idName));\n\t\tAssert.assertTrue(name.isDisplayed());\n\t\ttest.log(LogStatus.PASS, \"Name Field\", \"Name Field is displaying\");\n\n\t\t// Verify Name Field WaterMark\n\t\tString nameWaterMark = driver.findElement(By.xpath(xpathNameWaterMark)).getText();\n\t\tAssert.assertEquals(nameWaterMark, \"Name *\", \"Name * WaterAmrk is not Displaying \");\n\t\ttest.log(LogStatus.PASS, \"Name Field WaterMark\", \"Name * WaterMark is Displaying\");\n\n\t\t// Verify Subscription Id Field\n\t\tWebElement subScription = driver.findElement(By.id(idSubScription));\n\t\tAssert.assertTrue(subScription.isDisplayed());\n\t\ttest.log(LogStatus.PASS, \"SubScription Field\", \"SubScription Field is displaying\");\n\n\t\t// Verify Subscription Id Field WaterMark\n\t\tString subscriptionIdWaterMark = driver.findElement(By.xpath(xpathSubscriptionIdWaterMark)).getText();\n\t\tAssert.assertEquals(subscriptionIdWaterMark, \"Subscription ID *\",\n\t\t\t\t\"Subscription ID * WaterMark is not Displaying \");\n\t\ttest.log(LogStatus.PASS, \"SubScription Field WaterMark\", \"Subscription ID * WaterMark is Displaying\");\n\n\t\t// Verify Description Field\n\t\tWebElement description = driver.findElement(By.id(idDescription));\n\t\tAssert.assertTrue(description.isDisplayed());\n\t\ttest.log(LogStatus.PASS, \"Description Field\", \"Description Field is displaying\");\n\n\t\t// Verify Description Field WaterMark\n\t\tString descriptionWaterMark = driver.findElement(By.xpath(xpathDescriptionWaterMark)).getText();\n\t\tAssert.assertEquals(descriptionWaterMark, \"Description\", \"Description WaterMark is not Displaying \");\n\t\ttest.log(LogStatus.PASS, \"Description Field WaterMark\", \"Description WaterMark is Displaying\");\n\n\t\t// Verify and Validate Submit Button\n\t\tWebElement submitBtn = driver.findElement(By.id(idSubmitBtn));\n\t\tAssert.assertTrue(submitBtn.isEnabled());\n\t\ttest.log(LogStatus.PASS, \"Submit Button\", \"Submit Button is displaying and Enabled\");\n\n\t\t// Verify and Validate Submit Button Text\n\t\tString submitText = driver.findElement(By.id(idSubmitBtn)).getText();\n\t\tAssert.assertEquals(submitText, \"Submit\", \"Submit Text is not Displaying \");\n\t\ttest.log(LogStatus.PASS, \"Submit Button Text\", \"Submit Text is Displaying\");\n\n\t\t// Verify and Validate Cancel Button\n\t\tWebElement cancelButton = driver.findElement(By.xpath(xpathCancelButton));\n\t\tAssert.assertTrue(cancelButton.isEnabled());\n\t\ttest.log(LogStatus.PASS, \"cancel Button\", \"cancel Button is displaying and Enabled\");\n\n\t\t// Verify and Validate Cancel Button Text\n\t\tString cancelButtonText = driver.findElement(By.xpath(xpathCancelButton)).getText();\n\t\tAssert.assertEquals(cancelButtonText, \"Cancel\", \"Cancel Text is not Displaying \");\n\t\ttest.log(LogStatus.PASS, \"Cancel Button Text\", \"Cancel Text is Displaying\");\n\n\t\t// Verify and Validate Grid or contents Container\n\t\tWebElement gridOfSubscription = driver.findElement(By.xpath(xpathOfGridOfSubscription));\n\t\tAssert.assertTrue(gridOfSubscription.isDisplayed());\n\t\ttest.log(LogStatus.PASS, \"Grid Of Subscription\", \"Grid Of Subscription is displaying\");\n\n\t}", "@Test(dataProviderClass = DataProviderUtils.class, dataProvider = \"excelDataReader\", groups = {\"Sprint36\", \"Breadcrumb\"}, \r\n\t\t\tdescription = \"Navigation to Parent View through breadcrumb ['Prevent navigation outside of the default view' - Checked, Other View(ID)].\")\r\n\tpublic void SprintTest36_1_12D(HashMap<String,String> dataValues, String driverType) throws Exception {\r\n\r\n\t\tdriver = null; \r\n\t\tLoginPage loginPage = null;\r\n\t\tConfigurationPage configurationPage = null;\r\n\t\tConfigurationPanel configSettingsPanel = null;\r\n\r\n\t\ttry {\r\n\r\n\r\n\r\n\t\t\tdriver = WebDriverUtils.getDriver();\r\n\r\n\t\t\tConcurrentHashMap <String, String> dataPool = new ConcurrentHashMap <String, String>(dataValues);\r\n\r\n\t\t\t//1. Login to Configuration\r\n\t\t\t//--------------------------\r\n\t\t\tdriver.get(configURL);\r\n\r\n\t\t\tloginPage = new LoginPage(driver);\r\n\t\t\tconfigurationPage = loginPage.loginToConfigurationUI(userName, password);\r\n\r\n\t\t\tLog.message(\"1. Logged in to Configuiration\");\r\n\r\n\t\t\t//2. Click the Vault folder \r\n\t\t\t//--------------------------\r\n\t\t\tconfigurationPage.treeView.clickTreeViewItem(\"Vault-specific settings>>\" + testVault);\r\n\r\n\t\t\tLog.message(\"2. Clicked the Vault folder.\");\r\n\r\n\t\t\t//3. Select the Default View\r\n\t\t\t//------------------------------\r\n\t\t\tconfigSettingsPanel = new ConfigurationPanel(driver);\r\n\t\t\tconfigSettingsPanel.setDefaultView(dataPool.get(\"ViewID\"));\r\n\r\n\t\t\tLog.message(\"3. Selected the Default View.\");\r\n\r\n\t\t\t//4. Check the Prevent Navigation check box\r\n\t\t\t//------------------------------------------\r\n\t\t\tconfigSettingsPanel.setPreventNavigation(true);\r\n\r\n\t\t\tLog.message(\"4. Checked the Prevent Navigation check box.\");\r\n\r\n\t\t\t//5. Save the changes\r\n\t\t\t//--------------------\r\n\t\t\tif (!configurationPage.configurationPanel.saveSettings())\r\n\t\t\t\tthrow new Exception(\"Configuration settings are not saved.\");\r\n\r\n\t\t\tconfigurationPage.logOut();\r\n\r\n\t\t\tLog.message(\"5. Saved the changes.\");\r\n\r\n\t\t\t//6. Login to the Vault\r\n\t\t\t//----------------------\r\n\t\t\tdriver.get(loginURL);\r\n\t\t\tHomePage homePage = loginPage.loginToWebApplication(userName, password, testVault);\r\n\r\n\t\t\tLog.message(\"6. logged in to the vault.\");\r\n\r\n\t\t\t//7. Click on the parent view breadcrumb item\r\n\t\t\t//--------------------------------------------\r\n\t\t\tString expectedURL = driver.getCurrentUrl();\r\n\t\t\thomePage.menuBar.clickBreadcrumbItem(testVault);\r\n\r\n\t\t\tLog.message(\"7. Clicked on the parent view breadcrumb item\");\r\n\r\n\t\t\t//Verification: To verify if the Breadcrumb show the right path to the default view\r\n\t\t\t//----------------------------------------------------------------------------------\r\n\t\t\tif(expectedURL.equals(driver.getCurrentUrl()) && driver.getCurrentUrl().endsWith(dataPool.get(\"ViewID\")))\r\n\t\t\t\tLog.pass(\"Test case Passed. Navigation to previous view was not possible as expected.\"); \r\n\t\t\telse\r\n\t\t\t\tLog.fail(\"Test Case Failed. The URL showed '\" + driver.getCurrentUrl() + \"' instead of '\" + expectedURL + \"'\", driver);\r\n\r\n\r\n\t\t} //End try\r\n\r\n\t\tcatch(Exception e) \t{\r\n\t\t\tLog.exception(e, driver);\r\n\t\t} //End catch\r\n\r\n\t\tfinally {\r\n\t\t\tif(driver != null){\r\n\t\t\t\ttry\r\n\t\t\t\t{\r\n\t\t\t\t\tdriver.get(configURL);\r\n\r\n\t\t\t\t\tconfigurationPage = new ConfigurationPage(driver);\r\n\t\t\t\t\tconfigurationPage.treeView.clickTreeViewItem(\"Vault-specific settings>>\" + testVault);\r\n\r\n\t\t\t\t\tconfigSettingsPanel.setDefaultView(Caption.MenuItems.Home.Value);\r\n\t\t\t\t\tconfigSettingsPanel.setPreventNavigation(false);\r\n\r\n\t\t\t\t\tif (!configurationPage.configurationPanel.saveSettings())\r\n\t\t\t\t\t\tthrow new Exception(\"Configuration settings are not saved.\");\r\n\t\t\t\t}\r\n\t\t\t\tcatch(Exception e0)\r\n\t\t\t\t{\r\n\t\t\t\t\tLog.exception(e0, driver);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tUtility.quitDriver(driver);\r\n\t\t} //End finally\r\n\r\n\t}", "@Test(dataProviderClass = DataProviderUtils.class, dataProvider = \"excelDataReader\", groups = {\"Sprint36\", \"Breadcrumb\"}, \r\n\t\t\tdescription = \"Navigation to Parent View through breadcrumb After Navigating to any other view['Prevent navigation outside of the default view' - Checked].\")\r\n\tpublic void SprintTest36_1_12G(HashMap<String,String> dataValues, String driverType) throws Exception {\r\n\r\n\t\tdriver = null; \r\n\t\tLoginPage loginPage = null;\r\n\t\tConfigurationPage configurationPage = null;\r\n\t\tConfigurationPanel configSettingsPanel = null;\r\n\r\n\t\ttry {\r\n\r\n\r\n\r\n\t\t\tdriver = WebDriverUtils.getDriver();\r\n\r\n\t\t\tConcurrentHashMap <String, String> dataPool = new ConcurrentHashMap <String, String>(dataValues);\r\n\r\n\t\t\t//1. Login to Configuration\r\n\t\t\t//--------------------------\r\n\t\t\tdriver.get(configURL);\r\n\r\n\t\t\tloginPage = new LoginPage(driver);\r\n\t\t\tconfigurationPage = loginPage.loginToConfigurationUI(userName, password);\r\n\r\n\t\t\tLog.message(\"1. Logged in to Configuiration\");\r\n\r\n\t\t\t//2. Click the Vault folder \r\n\t\t\t//--------------------------\r\n\t\t\tconfigurationPage.treeView.clickTreeViewItem(\"Vault-specific settings>>\" + testVault);\r\n\r\n\r\n\t\t\tLog.message(\"2. Clicked the Vault folder.\");\r\n\r\n\t\t\t//3. Select the Default View\r\n\t\t\t//------------------------------\r\n\t\t\tconfigSettingsPanel = new ConfigurationPanel(driver);\r\n\t\t\tconfigSettingsPanel.setDefaultView(dataPool.get(\"View\"));\r\n\r\n\t\t\tLog.message(\"3. Selected the Default View.\");\r\n\r\n\t\t\t//4. Check the Prevent Navigation check box\r\n\t\t\t//------------------------------------------\r\n\t\t\tconfigSettingsPanel.setPreventNavigation(true);\r\n\r\n\t\t\tLog.message(\"4. Checked the Prevent Navigation check box.\");\r\n\r\n\t\t\t//5. Save the changes\r\n\t\t\t//--------------------\r\n\t\t\tif (!configurationPage.configurationPanel.saveSettings())\r\n\t\t\t\tthrow new Exception(\"Configuration settings are not saved.\");\r\n\r\n\t\t\tconfigurationPage.logOut();\r\n\r\n\t\t\tLog.message(\"5. Saved the changes.\");\r\n\r\n\t\t\t//6. Login to the Vault\r\n\t\t\t//----------------------\r\n\t\t\tdriver.get(loginURL);\r\n\t\t\tHomePage homePage = loginPage.loginToWebApplication(userName, password, testVault);\r\n\r\n\t\t\tLog.message(\"6. logged in to the vault.\");\r\n\r\n\t\t\t//7. Navigate to any other view\r\n\t\t\t//------------------------------\r\n\t\t\tString expectedURL = driver.getCurrentUrl();\r\n\t\t\thomePage.taskPanel.clickItem(dataPool.get(\"NewView\"));\r\n\r\n\t\t\tLog.message(\"7. Navigated to any other view.\");\r\n\r\n\t\t\t//8. Click on the Home view breadcrumb item\r\n\t\t\t//--------------------------------------------\r\n\t\t\tif (!homePage.menuBar.clickBreadcrumbItem(testVault))\r\n\t\t\t\tthrow new Exception(testVault + \" is not clicked in the breadcrumb\");\r\n\r\n\t\t\tLog.message(\"8. Clicked on the Home view breadcrumb item\");\r\n\r\n\t\t\t//Verification: To verify if the Breadcrumb show the right path to the default view\r\n\t\t\t//----------------------------------------------------------------------------------\r\n\t\t\tif(expectedURL.equals(driver.getCurrentUrl()))\r\n\t\t\t\tLog.pass(\"Test case Passed. Navigation to previous view was not possible as expected.\"); \r\n\t\t\telse\r\n\t\t\t\tLog.fail(\"Test Case Failed. The URL showed '\" + driver.getCurrentUrl() + \"' instead of '\" + expectedURL + \"'\", driver);\r\n\r\n\r\n\t\t} //End try\r\n\r\n\t\tcatch(Exception e) \t{\r\n\t\t\tLog.exception(e, driver);\r\n\t\t} //End catch\r\n\r\n\t\tfinally {\r\n\t\t\tif(driver != null){\r\n\t\t\t\ttry\r\n\t\t\t\t{\r\n\t\t\t\t\tdriver.get(configURL);\r\n\r\n\t\t\t\t\tconfigurationPage = new ConfigurationPage(driver);\r\n\t\t\t\t\tconfigurationPage.treeView.clickTreeViewItem(\"Vault-specific settings>>\" + testVault);\r\n\r\n\t\t\t\t\tconfigSettingsPanel.setDefaultView(Caption.MenuItems.Home.Value);\r\n\t\t\t\t\tconfigSettingsPanel.setPreventNavigation(false);\r\n\r\n\t\t\t\t\tif (!configurationPage.configurationPanel.saveSettings())\r\n\t\t\t\t\t\tthrow new Exception(\"Configuration settings are not saved.\");\r\n\t\t\t\t}\r\n\t\t\t\tcatch(Exception e0)\r\n\t\t\t\t{\r\n\t\t\t\t\tLog.exception(e0, driver);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tUtility.quitDriver(driver);\r\n\t\t} //End finally\r\n\r\n\t}", "@Test(priority=1)\n\tpublic void validateContestInHomePage()\n\t{\n\t\tPickRightHomePage p = new PickRightHomePage(driver);\n\t\tp.getJoinAsinvestor();\n\n\t\tLoginOrSignUpPage l = new LoginOrSignUpPage(driver);\n\t\tl.getUseMobileNumber();\n\t\tl.getDropDown();\n\t\tl.setSearchField(\"India\");\n\t\tl.getCountry();\n\t\tl.setMobileNumberField(number);\n\t\tl.getNextButton();\n\t\te = new EnterOtpPage(driver);\n\t\te.setOtp();\n\t\te.getCheckBox();\n\t\te.getNextButton();\n\t\th=new HomePage(driver);\n\t\tJavascriptExecutor j=(JavascriptExecutor)driver;\n\t\tj.executeScript(\"arguments[0].scrollIntoView(true)\",h.contest);\n\t\tAssert.assertTrue(h.contest.isDisplayed());\n\t\tAssert.assertTrue(h.participateButtonInTopStock.getText().equalsIgnoreCase(\"Participate\"));\n\t\tAssert.assertTrue(h.participateButtonPredictNifty.getText().equalsIgnoreCase(\"Participate\"));\n\t\t\n\t}", "@Test(priority=3)\n\tpublic void validatePredictNiftyInContestPage2()\n\t{\n\t\tAssert.assertTrue(c.todaysNiftyValue.isDisplayed());\n\t}", "@Test(dataProviderClass = DataProviderUtils.class, dataProvider = \"excelDataReader\", groups = {\"Sprint36\", \"Breadcrumb\"}, \r\n\t\t\tdescription = \"Check the view path displayed in the breadcrumb ['Prevent navigation outside of the default view' - Checked].\")\r\n\tpublic void SprintTest36_1_12A(HashMap<String,String> dataValues, String driverType) throws Exception {\r\n\r\n\t\tdriver = null; \r\n\t\tLoginPage loginPage = null;\r\n\t\tConfigurationPage configurationPage = null;\r\n\t\tConfigurationPanel configSettingsPanel = null;\r\n\r\n\t\ttry {\r\n\r\n\r\n\r\n\t\t\tdriver = WebDriverUtils.getDriver();\r\n\r\n\t\t\tConcurrentHashMap <String, String> dataPool = new ConcurrentHashMap <String, String>(dataValues);\r\n\r\n\t\t\t//1. Login to Configuration\r\n\t\t\t//--------------------------\r\n\t\t\tdriver.get(configURL);\r\n\r\n\t\t\tloginPage = new LoginPage(driver);\r\n\t\t\tconfigurationPage = loginPage.loginToConfigurationUI(userName, password);\r\n\r\n\t\t\tLog.message(\"1. Logged in to Configuiration\");\r\n\r\n\t\t\t//2. Click the Vault folder \r\n\t\t\t//--------------------------\r\n\t\t\tconfigurationPage.treeView.clickTreeViewItem(\"Vault-specific settings>>\" + testVault);\r\n\r\n\r\n\t\t\tLog.message(\"2. Clicked the Vault folder.\");\r\n\r\n\t\t\t//3. Select the Default View\r\n\t\t\t//------------------------------\r\n\r\n\t\t\tconfigSettingsPanel = new ConfigurationPanel(driver);\r\n\t\t\tconfigSettingsPanel.setDefaultView(dataPool.get(\"View\"));\r\n\r\n\t\t\tLog.message(\"3. Selected the Default View.\");\r\n\r\n\t\t\t//4. Check the Prevent Navigation check box\r\n\t\t\t//------------------------------------------\r\n\t\t\tconfigSettingsPanel.setPreventNavigation(true);\r\n\r\n\t\t\tLog.message(\"4. Checked the Prevent Navigation check box.\");\r\n\r\n\t\t\t//5. Save the changes\r\n\t\t\t//--------------------\r\n\t\t\tif (!configurationPage.configurationPanel.saveSettings())\r\n\t\t\t\tthrow new Exception(\"Configuration settings are not saved.\");\r\n\r\n\t\t\tconfigurationPage.logOut();\r\n\r\n\t\t\tLog.message(\"5. Saved the changes.\");\r\n\r\n\t\t\t//6. Login to the Vault\r\n\t\t\t//----------------------\r\n\t\t\tdriver.get(loginURL);\r\n\t\t\tHomePage homePage = loginPage.loginToWebApplication(userName, password, testVault);\r\n\r\n\t\t\tLog.message(\"6. logged in to the vault.\");\r\n\r\n\t\t\t//Verification: To verify if the Breadcrumb show the right path to the default view\r\n\t\t\t//----------------------------------------------------------------------------------\r\n\t\t\tif(homePage.menuBar.GetBreadCrumbItem().equals(testVault+\">\"+dataPool.get(\"View\")))\r\n\t\t\t\tLog.pass(\"Test case Passed. The Bread crumb showed the correct path to the default view.\"); \r\n\t\t\telse\r\n\t\t\t\tLog.fail(\"Test Case Failed. The Bread crumb showed '\" + homePage.menuBar.GetBreadCrumbItem() + \"' instead of '\" + testVault+\">\"+dataPool.get(\"View\") + \"'\", driver);\r\n\r\n\r\n\t\t} //End try\r\n\r\n\t\tcatch(Exception e) \t{\r\n\t\t\tLog.exception(e, driver);\r\n\t\t} //End catch\r\n\r\n\t\tfinally {\r\n\t\t\tif(driver != null){\r\n\t\t\t\ttry\r\n\t\t\t\t{\t\t\t\t\t\r\n\t\t\t\t\tdriver.get(configURL);\r\n\r\n\t\t\t\t\tconfigurationPage = new ConfigurationPage(driver);\r\n\t\t\t\t\tconfigurationPage.treeView.clickTreeViewItem(\"Vault-specific settings>>\" + testVault);\r\n\r\n\t\t\t\t\tconfigSettingsPanel.setDefaultView(Caption.MenuItems.Home.Value);\r\n\t\t\t\t\tconfigSettingsPanel.setPreventNavigation(false);\r\n\r\n\t\t\t\t\tif (!configurationPage.configurationPanel.saveSettings())\r\n\t\t\t\t\t\tthrow new Exception(\"Configuration settings are not saved.\");\r\n\t\t\t\t}\r\n\t\t\t\tcatch(Exception e0)\r\n\t\t\t\t{\r\n\t\t\t\t\tLog.exception(e0, driver);\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t\tUtility.quitDriver(driver);\r\n\t\t} //End finally\r\n\r\n\t}", "@Test\r\n public void Test2() throws InterruptedException {\n driver.navigate().to(\"http://webstrar99.fulton.asu.edu/page2/\");\r\n driver.findElement(By.id(\"number1\")).sendKeys(\"10\");\r\n driver.findElement(By.id(\"number2\")).sendKeys(\"5\");\r\n driver.findElement(By.id(\"sub\")).click();\r\n driver.findElement(By.id(\"calc\")).click();\r\n Assert.assertEquals(\"5\", driver.findElement(By.id(\"res\")).getText());\r\n driver.quit();\r\n }", "@Test\r\n public void Test4() throws InterruptedException {\n driver.navigate().to(\"http://webstrar99.fulton.asu.edu/page2/\");\r\n driver.findElement(By.id(\"number1\")).sendKeys(\"10\");\r\n driver.findElement(By.id(\"number2\")).sendKeys(\"5\");\r\n driver.findElement(By.id(\"div\")).click();\r\n driver.findElement(By.id(\"calc\")).click();\r\n Assert.assertEquals(\"2\", driver.findElement(By.id(\"res\")).getText());\r\n driver.quit();\r\n }", "@Test\n public void validateHomePageTest() {\n HomePage homePage = new HomePage(getDriver());\n log.info(\"RUN AUTOTEST TO VALIDATE HOMEPAGE\");\n homePage\n .goToHomePage_method()\n .validateHomePage();\n }", "public void Hazards(){\r\n\t\r\n\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- My Account should be clicked and user should get logged in\");\r\n\t\ttry{\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t/*driver.switchTo().defaultContent();\r\n\t\t\t\t\tsleep(3000);\r\n\t\t\t System.out.println(\"switched frame\"+ switchframe(\"PegaGadget2Ifr\"));\r\n\t\t\t click(locator_split(\"tabLocationAssesment\"));\r\n\t\t\t click(locator_split(\"linkclickLocation\"));*/\r\n\t\t\t // driver.findElement(By.xpath(\"//*[@tabindex='4']/a/span\")).click();\r\n\t\t\t // driver.findElement(By.xpath(\"//a[@title='Click here to open Location Assessment']\")).click();\r\n\t\t\tsleep(5000);\r\n\t\t\t driver.switchTo().defaultContent();\r\n\t\t\t System.out.println(\"switched frame\"+ switchframe(\"PegaGadget3Ifr\"));\r\n\t\t\t click(locator_split(\"tabhazards\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t click(locator_split(\"btnaddrowhazards\"));\r\n\t\t\t sleep(5000);\r\n\t\t\t Robot r1=new Robot();\r\n\t\t\t\t // r.keyPress(java.awt.event.KeyEvent.);\r\n\t\t\t\t sleep(1000);\r\n\t\t\t\t // Press Enter\r\n\t\t\t\t r1.keyPress(java.awt.event.KeyEvent.VK_ENTER);\r\n\t\t\t\t sleep(1000);\r\n\t\t\t sleep(5000);\r\n\t\t\t \t\r\n\t\t\t\t selectListValue(locator_split(\"listhazardsmaintype\"), getValue(\"HazardsMainType\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t \r\n\t\t\t selectListValue(locator_split(\"listhazardtype\"), getValue(\"HazardsType\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t if(getValue(\"HazardsType\").equals(\"Storage\")){\r\n\t\t\t \t\r\n\t\t\t \tclearWebEdit(locator_split(\"txtcustomhazardtype\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtcustomhazardtype\"), getValue(\"CustomHazardType\"));\r\n\t\t\t \t\r\n\t\t\t\t sleep(2000);\r\n\t\t\t \t\r\n\t\t\t }\r\n\t\t\t \r\n\t\t\t \r\n\t\t\t \r\n\t\t\t selectListValue(locator_split(\"lsthazardcategory\"), getValue(\"HazardCategory\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t clearWebEdit(locator_split(\"txthazardareasize\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t sendKeys(locator_split(\"txthazardareasize\"), getValue(\"HazardAreaSize\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t selectListValue(locator_split(\"lsthazardclass\"), getValue(\"HazardClass\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t clearWebEdit(locator_split(\"txtspecificlocationname\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t sendKeys(locator_split(\"txtspecificlocationname\"), getValue(\"SpecificLocationName\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t selectListValue(locator_split(\"lstdeficiencies\"), getValue(\"Deficiencies\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t clearWebEdit(locator_split(\"txtareadeficienciesdescription\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t sendKeys(locator_split(\"txtareadeficienciesdescription\"), getValue(\"DeficienciesDescription\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t if (getValue(\"HazardsMainType\").equals(\"Storage\")){\r\n\t\t\t \t clearWebEdit(locator_split(\"txtstorageheight\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t sendKeys(locator_split(\"txtstorageheight\"), getValue(\"StorageHeight\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\tclearWebEdit(locator_split(\"txtceilingheight\"));\r\n\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t\t sendKeys(locator_split(\"txtceilingheight\"), getValue(\"CeilingHeight\"));\r\n\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\tselectListValue(locator_split(\"lstpredominantclass\"), getValue(\"PredominantClass\"));\r\n\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t\t selectListValue(locator_split(\"lststoragearrangement\"), getValue(\"StorageArrangement\"));\r\n\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t\t \r\n\t\t\t }\r\n\t\t\t sleep(2000);\r\n\t\t\t \t\t\t click(locator_split(\"btnuploadphotos\"));\r\n\t\t\t sleep(5000);\r\n\t\t\t \r\n \t\t\t \r\n\t\t\t sendKeys(locator_split(\"txtphotocaption\"), getValue(\"PhotoCaption\"));\r\n\t\t\t \r\n\t\t\t sleep(3000);\r\n\t\t\t \r\n\t\t\t \r\n\t\t\t click(locator_split(\"btnbrowse\"));\r\n\t\t\t sleep(5000);\r\n\t\t\t Runtime.getRuntime().exec(\"D:\\\\Grasp\\\\AutoIT\\\\UploadFile.exe\");\r\n\t\t\t // click(locator_split(\"btnbrowse\"));\r\n\t\t\t /* StringSelection sel = new StringSelection(\"C:\\\\Users\\\\Public\\\\Pictures\\\\Sample Pictures\\\\Penguins.jpg\");\r\n\t\t\t Toolkit.getDefaultToolkit().getSystemClipboard().setContents(sel,null);\r\n\t\t\t System.out.println(\"selection\" +sel);\r\n\t\t\t \r\n\t\t\t sleep(2000);\r\n\t\t\t Robot r=new Robot();\r\n\t\t\t\t // r.keyPress(java.awt.event.KeyEvent.);\r\n\t\t\t\t sleep(3000);\r\n\t\t\t\t // Press Enter\r\n\t\t\t\t r.keyPress(java.awt.event.KeyEvent.VK_ENTER);\r\n\t\t\t\t sleep(1000);\r\n\t\t\t\t // Release Enter\r\n\t\t\t\t r.keyRelease(java.awt.event.KeyEvent.VK_ENTER);\r\n\t\t\t\t sleep(1000);\r\n\t\t\t\t // Press CTRL+V\r\n\t\t\t\t r.keyRelease(java.awt.event.KeyEvent.VK_CONTROL);\r\n\t\t\t\t sleep(1000);\r\n\t\t\t\t //r.keyPress(KeyEvent.VK_CONTROL);\r\n\t\t\t\t r.keyRelease(java.awt.event.KeyEvent.VK_V);\r\n\t\t\t\t //r.keyPress(KeyEvent.VK_V);\r\n\t\t\t\t sleep(1000);\r\n\t\t\t\t // Release CTRL+V\r\n\t\t\t\t r.keyRelease(java.awt.event.KeyEvent.VK_CONTROL);\r\n\t\t\t\t sleep(1000);\r\n\t\t\t\t// r.keyRelease(KeyEvent.VK_CONTROL);\r\n\t\t\t\t r.keyRelease(java.awt.event.KeyEvent.VK_V);\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t r.keyPress(java.awt.event.KeyEvent.VK_TAB);\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t r.keyPress(java.awt.event.KeyEvent.VK_TAB);\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t r.keyPress(java.awt.event.KeyEvent.VK_ENTER);\r\n\t\t\t\t sleep(2000);*/\r\n\t\t\t \r\n\t\t\t \r\n\t\t\t\r\n\t\t\t sleep(10000);\r\n\t\t\tclick(locator_split(\"btnsavebrowse\"));\r\n\t\t\t sleep(4000);\r\n\t\t\t click(locator_split(\"btnclose\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t\t//clickbylinktext(\"No\");\r\n\t\t\t click(locator_split(\"btnhazardclose\"));\r\n\t\t\t sleep(3000);\r\n\t\t\t \r\n\t\t\t \r\n\t\t\t if (driver.findElement(By.xpath(\"//input[contains(@class,'checkbox chkBxCtl')]\")).isSelected()== true ){\r\n\t\t\t\t System.out.println(\"inside if loop\");\r\n\t\t\t\t \r\n\t\t\t }else{\r\n\t\t\t\t System.out.println(\"checkbox not checked\");\r\n\t\t\t\t sleep(2000);\r\n\t\t\t click(locator_split(\"inputcheckhazard\"));\r\n\t\t\t sleep(3000);\r\n\t\t\t }\r\n\t\t\t \r\n\t\t\t sleep(3000);\r\n\t\t\t\r\n\t\t//switchframe(\"PegaGadget2Ifr\");\r\n\t\t//\tsleep(3000);\r\n\t\t//clickbylinktext(\"No\");\r\n\t\t\t\r\n\t\t\t\r\n\t\r\n\t\t\tReporter.log(\"PASS_MESSAGE:- Report tab is clicked and user is logged in\");\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Report tab is not clicked in\");\r\n\t\t\tthrow new NoSuchElementException(\"The element with\"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"LoginLogout\")\r\n\t\t\t\t\t+ \" not found\");\r\n\r\n\t\t}\r\n\r\n\t}", "@Test(groups=\"SMR1137\")\r\n\tpublic void smr1137(){\r\n\t\ttry {\r\n\t\t\t//final String firstName=testDataOR.get(\"mono_first_name\"),lastName=testDataOR.get(\"mono_last_name\"); \r\n\t\t\t//login(\"URLEportal\",testDataOR.get(\"mono_user_login\"),firstName,lastName);\r\n\t\t\teportalCust=testDataOR.get(\"customer\");\r\n\t\t\tfinal String firstName=testDataOR.get(\"superuser_first_name\"),lastName=testDataOR.get(\"superuser_last_name\");\r\n\t\t\tlogin(\"URLEportal\",testDataOR.get(\"superuser\"),firstName,lastName);\r\n\t\t\t//login(\"URLEverest\",testDataOR.get(\"superuser\"),firstName,lastName);\r\n\t\t\t/*logger.info(\"SMR1137 execution started\");\r\n\t\t\tfinal String customerName=testDataOR.get(\"customer\");\r\n\r\n\t\t\t//Access ePortal and 'In Store Payment' menu should be available\r\n\t\t\tlogger.info(\"Step 1 :\");\r\n\t\t\tlogger.info(\"Access eportal with superuser\");\r\n\t\t\tselUtils.verifyElementDisp(selUtils.getCommonObject(\"instorepay_tab_xpath\"), INSTOREPAY);\r\n\r\n\t\t\t//logout from eportal and login everest, select customer in eportal\r\n\t\t\tlogger.info(\"Step 2,3,4:\");\r\n\t\t\tlogoutNEvselCust(customerName);\r\n\t\t\t\r\n\t\t\t//Disable ‘ePayment’ module and validate\r\n\t\t\tlogger.info(\"Step 5:\");\r\n\t\t\tdisableModNVal(\"ep_ckbx_id\", EPAYMENT);\r\n\t\t\t\t\t\t\r\n\t\t\t//Disable 'Card Payment' module and validate\r\n\t\t\tlogger.info(\"Step 6:\");\r\n\t\t\tdisableModNVal(\"cp_ckbx_id\", CARDPAYMENT);\r\n\t\t\t\t\t\t\r\n\t\t\t//Access ePortal with a superuser and select customer\r\n\t\t\t//In Store Payment menu should not be available\r\n\t\t\tlogger.info(\"Step 7:\");\r\n\t\t\tlogoutEpSelCust(customerName);\r\n\t\t\tAssert.assertFalse(selUtils.isElementPresentCommon(\"instorepay_tab_xpath\"),INSTOREPAY+\" menu is available\");\r\n\t\t\tlogger.info(\"In store payment menu is not available\");\r\n\r\n\t\t\t//logout from eportal and login everest, select customer in eportal\r\n\t\t\tlogger.info(\"Step 8,9:\");\r\n\t\t\tlogoutNEvselCust(customerName);\r\n\t\t\t\r\n\t\t\t//Enable 'Card Payment' module and validate\r\n\t\t\tlogger.info(\"Step 10\");\r\n\t\t\tenableModNVal(\"cp_ckbx_id\", CARDPAYMENT);\r\n\t\t\r\n\t\t\t\r\n\t\t\t//Access ePortal and 'In Store Payment' menu should be available\r\n\t\t\tlogger.info(\"Step 11\");\r\n\t\t\tlogoutEpSelCust(customerName);\r\n\t\t\tselUtils.verifyElementDisp(selUtils.getCommonObject(\"instorepay_tab_xpath\"), INSTOREPAY);*/\r\n\t\t\tlogger.info(\"SMR1137 execution started\");\r\n\t\t}catch (Throwable t) {\r\n\t\t\thandleException(t);\r\n\t\t}\r\n\t}", "@Test(dataProviderClass = DataProviderUtils.class, dataProvider = \"excelDataReader\", groups = {\"Sprint36\", \"Breadcrumb\"}, \r\n\t\t\tdescription = \"Check the view path displayed in the breadcrumb .\")\r\n\tpublic void SprintTest36_1_10B(HashMap<String,String> dataValues, String driverType) throws Exception {\r\n\r\n\t\tdriver = null; \r\n\t\tConfigurationPage configurationPage = null;\r\n\t\tConfigurationPanel configSettingsPanel = null;\r\n\r\n\t\ttry {\r\n\r\n\r\n\r\n\r\n\t\t\tdriver = WebDriverUtils.getDriver();\r\n\r\n\t\t\tConcurrentHashMap <String, String> dataPool = new ConcurrentHashMap <String, String>(dataValues);\r\n\r\n\t\t\tconfigurationPage = LoginPage.launchDriverAndLoginToConfig(driver, true);\r\n\r\n\t\t\t//1. Click the Vault folder \r\n\t\t\t//--------------------------\r\n\t\t\tconfigurationPage.treeView.clickTreeViewItem(\"Vault-specific settings>>\" + testVault);\r\n\r\n\t\t\tLog.message(\"1. Clicked the Vault folder.\");\r\n\r\n\t\t\t//2. Set the ViewID in Default View\r\n\t\t\t//------------------------------------------\r\n\t\t\tconfigurationPage.configurationPanel.setDefaultView(dataPool.get(\"ViewID\"));\r\n\r\n\t\t\tLog.message(\"2. View ID was specified in the Defauly view.\");\r\n\r\n\t\t\t//3. Uncheck the Prevent Navigation check box\r\n\t\t\t//------------------------------------------\r\n\t\t\tconfigSettingsPanel = new ConfigurationPanel(driver);\r\n\t\t\tconfigSettingsPanel.setPreventNavigation(false);\r\n\r\n\t\t\tLog.message(\"3. Unchecked the Prevent Navigation check box.\");\r\n\r\n\t\t\t//4. Save the changes\r\n\t\t\t//--------------------\r\n\t\t\tif (!configurationPage.configurationPanel.saveSettings())\r\n\t\t\t\tthrow new Exception(\"Configuration settings are not saved.\");\r\n\r\n\t\t\tif (!configurationPage.logOut())\r\n\t\t\t\tthrow new Exception(\"Logout is not successful.\");\r\n\r\n\t\t\tLog.message(\"4. Saved the changes.\");\r\n\r\n\t\t\t//5. Login to the Test vault\r\n\t\t\t//---------------------------\r\n\t\t\tHomePage homePage = LoginPage.launchDriverAndLogin(driver, false);\r\n\r\n\t\t\tLog.message(\"5. Login to the Test Vault.\");\r\n\r\n\t\t\t//6. Navigate back to the parent vault though breadcrumb\r\n\t\t\t//-------------------------------------------------------\r\n\t\t\thomePage.menuBar.clickBreadcrumbItem(dataPool.get(\"ExpectedPath\"));\r\n\r\n\r\n\t\t\tLog.message(\"6. Navigate back to the parent vault though breadcrumb.\");\r\n\r\n\t\t\t//Verification: To verify if the Breadcrumb shows the right path\r\n\t\t\t//---------------------------------------------------------------\r\n\t\t\tif(driver.getCurrentUrl().endsWith(dataPool.get(\"ExpectedID\")))\r\n\t\t\t\tthrow new Exception(\"Navigation to parent view through breadcrumb failed.\");\r\n\r\n\t\t\tif(!homePage.menuBar.GetBreadCrumbItem().equals(testVault+\">\"+dataPool.get(\"ExpectedPath\")))\r\n\t\t\t\tthrow new Exception(\"The Expected Breadcrumb text was not displayed after navigating to the parent view.\");\r\n\r\n\t\t\tif(homePage.listView.isItemExists(dataPool.get(\"ChildItem\")))\r\n\t\t\t\tLog.pass(\"Test case Passed. Navigation to Parent View through Breadcrumb was successful.\"); \r\n\t\t\telse\r\n\t\t\t\tLog.fail(\"Test Case Failed. Navigation to parent view through breadcrumb failed.\", driver);\r\n\r\n\r\n\t\t} //End try\r\n\r\n\t\tcatch(Exception e) \t{\r\n\t\t\tLog.exception(e, driver);\r\n\t\t} //End catch\r\n\r\n\t\tfinally {\r\n\t\t\tif(driver != null){\r\n\t\t\t\ttry\r\n\t\t\t\t{\r\n\t\t\t\t\tdriver.get(configURL);\r\n\t\t\t\t\tUtils.fluentWait(driver);\r\n\t\t\t\t\tconfigurationPage = new ConfigurationPage(driver);\r\n\t\t\t\t\tconfigurationPage.treeView.clickTreeViewItem(\"Vault-specific settings>>\" + testVault);\r\n\r\n\t\t\t\t\tconfigurationPage.configurationPanel.setDefaultView(Caption.MenuItems.Home.Value);\r\n\r\n\t\t\t\t\tif (!configurationPage.configurationPanel.saveSettings())\r\n\t\t\t\t\t\tthrow new Exception(\"Configuration settings are not saved.\");\r\n\t\t\t\t}\r\n\t\t\t\tcatch(Exception e0)\r\n\t\t\t\t{\r\n\t\t\t\t\tLog.exception(e0, driver);\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t\tUtility.quitDriver(driver);\r\n\t\t} //End finally\r\n\r\n\t}", "public void clickshoppingcart(){\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- shopping cart link should be clicked\");\r\n\t\ttry{\r\n\t\t\twaitForElement(locator_split(\"lnkShoppingCart\"));\r\n\t\t\tclick(locator_split(\"lnkShoppingCart\"));\r\n\t\t\twaitForPageToLoad(20);\r\n\t\t\tSystem.out.println(\"shopping cart link is clicked\");\r\n\t\t\tReporter.log(\"PASS_MESSAGE:- shopping cart link is clicked\");\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- shopping cart link is not clicked \");\r\n\t\t\tthrow new NoSuchElementException(\"The element with\"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"lnkShoppingCart\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ \" not found\");\r\n\t\t}\r\n\r\n\t}", "public static void main(String[] args) {\n\t\tSystem.setProperty(\"webdriver.chrome.driver\",\"C:/chromedriver_win32/chromedriver.exe\");\n\t\tChromeOptions chromeOptions = new ChromeOptions();\n\t\tchromeOptions.addArguments(\"--start-maximized\");\n\t\tWebDriver driver= new ChromeDriver(chromeOptions);\n\t\tdriver.get(\"http://www.makemytrip.com\");\n\t\t/*\n\t\tSystem.out.println(\"before clicking on multicity radio button\");\n\t\tSystem.out.println(driver.findElement(By.xpath(\".//*[@mt-id='returnDate']\")).isDisplayed());\n\t\tdriver.findElement(By.xpath(\".//*[@id='multicity']\")).click();\n\t\tSystem.out.println(\"After Clicking on Radion button multicity\");\n\t\tSystem.out.println(driver.findElement(By.xpath(\".//*[@mt-id='returnDate']\")).isDisplayed());\n\t\t\n\t\t//Again click on the another radio button\n\t\t//driver.findElement(By.cssSelector(\"#switch__input_2\")).click();\n\t\t\n\t\tint count=driver.findElements(By.xpath(\".//*[@id='mulcity']\")).size();\n\t\tif(count==0) {\n\t\tSystem.out.println(\"Verified\");\n\t\t}\n\t\t\t\n\t\t\t*/\n\t\t//To select the calendar Date\n\t\tdriver.findElement(By.xpath(\"//*[@id='hp-widget__depart']\")).click();\n\t\tdriver.findElement(By.xpath(\"//*[@id='dp1514555220096']']/div[2]/table/tbody/tr[5]/td[3]/a\")).click();\n\t\t\n\t\t// To Increment/Decrement the Count by + or - Sign\n\t\t//int i= 0;\n\t\t//while(i<5);\n\t\t//{\n\t\t//driver.findElement(By.xpath(\"Take the xpath of + or - Button\")).click();\n\t\t//i++;\n\t\t}", "@Test(dataProviderClass = DataProviderUtils.class, dataProvider = \"excelDataReader\", groups = {\"Sprint36\", \"Breadcrumb\"}, \r\n\t\t\tdescription = \"Navigation to Parent View through TaskPanel After Navigating to any other view ['Prevent navigation outside of the default view' - Checked].\")\r\n\tpublic void SprintTest36_1_12H(HashMap<String,String> dataValues, String driverType) throws Exception {\r\n\r\n\t\tdriver = null; \r\n\t\tLoginPage loginPage = null;\r\n\t\tConfigurationPage configurationPage = null;\r\n\t\tConfigurationPanel configSettingsPanel = null;\r\n\r\n\t\ttry {\r\n\r\n\r\n\r\n\t\t\tdriver = WebDriverUtils.getDriver();\r\n\r\n\t\t\tConcurrentHashMap <String, String> dataPool = new ConcurrentHashMap <String, String>(dataValues);\r\n\r\n\t\t\t//1. Login to Configuration\r\n\t\t\t//--------------------------\r\n\t\t\tdriver.get(configURL);\r\n\r\n\t\t\tloginPage = new LoginPage(driver);\r\n\t\t\tconfigurationPage = loginPage.loginToConfigurationUI(userName, password);\r\n\r\n\t\t\tLog.message(\"1. Logged in to Configuiration\");\r\n\r\n\t\t\t//2. Click the Vault folder \r\n\t\t\t//--------------------------\r\n\t\t\tconfigurationPage.treeView.clickTreeViewItem(\"Vault-specific settings>>\" + testVault);\r\n\r\n\r\n\t\t\tLog.message(\"2. Clicked the Vault folder.\");\r\n\r\n\t\t\t//3. Select the Default View\r\n\t\t\t//------------------------------\r\n\t\t\tconfigSettingsPanel = new ConfigurationPanel(driver);\r\n\t\t\tconfigSettingsPanel.setDefaultView(dataPool.get(\"View\"));\r\n\r\n\t\t\tLog.message(\"3. Selected the Default View.\");\r\n\r\n\t\t\t//4. Check the Prevent Navigation check box\r\n\t\t\t//------------------------------------------\r\n\t\t\tconfigSettingsPanel.setPreventNavigation(true);\r\n\r\n\t\t\tLog.message(\"4. Checked the Prevent Navigation check box.\");\r\n\r\n\t\t\t//5. Save the changes\r\n\t\t\t//--------------------\r\n\t\t\tif (!configurationPage.configurationPanel.saveSettings())\r\n\t\t\t\tthrow new Exception(\"Configuration settings are not saved.\");\r\n\r\n\t\t\tconfigurationPage.logOut();\r\n\r\n\t\t\tLog.message(\"5. Saved the changes.\");\r\n\r\n\t\t\t//6. Login to the Vault\r\n\t\t\t//----------------------\r\n\t\t\tdriver.get(loginURL);\r\n\t\t\tHomePage homePage = loginPage.loginToWebApplication(userName, password, testVault);\r\n\r\n\t\t\tLog.message(\"6. logged in to the vault.\");\r\n\r\n\t\t\t//7. Navigate to any other view\r\n\t\t\t//------------------------------\r\n\t\t\tString expectedURL = driver.getCurrentUrl();\r\n\t\t\thomePage.taskPanel.clickItem(dataPool.get(\"NewView\"));\r\n\r\n\t\t\tLog.message(\"7. Navigated to any other view.\");\r\n\r\n\t\t\t//8. Click on the Home link in Task Panel\r\n\t\t\t//--------------------------------------------\r\n\t\t\thomePage.taskPanel.clickItem(Caption.MenuItems.Home.Value);\r\n\r\n\t\t\tLog.message(\"7. Clicked on the Home link in Task Panel.\");\r\n\r\n\t\t\t//Verification: To verify if the Breadcrumb show the right path to the default view\r\n\t\t\t//----------------------------------------------------------------------------------\r\n\t\t\tif(expectedURL.equals(driver.getCurrentUrl()))\r\n\t\t\t\tLog.pass(\"Test case Passed. Navigation to previous view was not possible as expected.\"); \r\n\t\t\telse\r\n\t\t\t\tLog.fail(\"Test Case Failed. The URL showed '\" + driver.getCurrentUrl() + \"' instead of '\" + expectedURL + \"'\", driver);\r\n\r\n\r\n\t\t} //End try\r\n\r\n\t\tcatch(Exception e) \t{\r\n\t\t\tLog.exception(e, driver);\r\n\t\t} //End catch\r\n\r\n\t\tfinally {\r\n\t\t\tif(driver != null){\r\n\t\t\t\ttry\r\n\t\t\t\t{\r\n\t\t\t\t\tdriver.get(configURL);\r\n\r\n\t\t\t\t\tconfigurationPage = new ConfigurationPage(driver);\r\n\t\t\t\t\tconfigurationPage.treeView.clickTreeViewItem(\"Vault-specific settings>>\" + testVault);\r\n\r\n\t\t\t\t\tconfigSettingsPanel.setDefaultView(Caption.MenuItems.Home.Value);\r\n\t\t\t\t\tconfigSettingsPanel.setPreventNavigation(false);\r\n\r\n\t\t\t\t\tif (!configurationPage.configurationPanel.saveSettings())\r\n\t\t\t\t\t\tthrow new Exception(\"Configuration settings are not saved.\");\r\n\t\t\t\t}\r\n\t\t\t\tcatch(Exception e0)\r\n\t\t\t\t{\r\n\t\t\t\t\tLog.exception(e0, driver);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tUtility.quitDriver(driver);\r\n\t\t} //End finally\r\n\r\n\t}", "@Test(priority=2)\n\tpublic void verifyPresenceOfLinksinLeftsideMenu() throws Exception {\n\t\t\n\t\tOverviewTradusPROPage overviewObj=new OverviewTradusPROPage(driver);\n\t\texplicitWaitFortheElementTobeVisible(driver,overviewObj.overviewPageVerificationElement);\n\t\tAssert.assertTrue(verifyElementPresent(overviewObj.overviewOptioninSiderBar),\n\t\t\t\t\"Overview option is not present in side bar\");\n\t\tAssert.assertTrue(verifyElementPresent(overviewObj.leadsOptioninSiderBar),\n\t\t\t\t\"Leads option is not present in side bar\");\n\t\tAssert.assertTrue(verifyElementPresent(overviewObj.myStockOptioninSiderBar),\n\t\t\t\t\"My stock option is not present in side bar\");\n\t\tclick(overviewObj.myStockOptioninSiderBar);\n\t\twaitTill(1000);\n\t\texplicitWaitFortheElementTobeVisible(driver,overviewObj.allMyStockOptioninSiderBar);\n\t\tAssert.assertTrue(verifyElementPresent(overviewObj.createMyStockOptioninSiderBar),\n\t\t\t\t\"Create my stock option is not present in side bar\");\n\t\tAssert.assertTrue(verifyElementPresent(overviewObj.allMyStockOptioninSiderBar),\n\t\t\t\t\"All my stock option is not present in side bar\");\n\t\tAssert.assertTrue(verifyElementPresent(overviewObj.marketInsightOptioninSiderBar),\n\t\t\t\t\"Market insight option is not present in side bar\");\n\t\tAssert.assertTrue(verifyElementPresent(overviewObj.profileOptioninSiderBar),\n\t\t\t\t\"Profile option is not present in side bar\");\n\t\tAssert.assertTrue(verifyElementPresent(overviewObj.monthlyPackageOptioninSiderBar),\n\t\t\t\t\"Monthly package option is not present in side bar\");\n\t\tAssert.assertTrue(verifyElementPresent(overviewObj.contactOptioninSiderBar),\n\t\t\t\t\"Contact option is not present in side bar\");\n\t\tclick(overviewObj.contactOptioninSiderBar);\n\t\twaitTill(1000);\n\t\texplicitWaitFortheElementTobeVisible(driver,overviewObj.privacyOptionunderContactlinkSiderBar);\n\t\tAssert.assertTrue(verifyElementPresent(overviewObj.termsOptionunderContactlinkSiderBar),\n\t\t\t\t\"Terms link under Contact option is not present in side bar\");\n\t\tAssert.assertTrue(verifyElementPresent(overviewObj.privacyOptionunderContactlinkSiderBar),\n\t\t\t\t\"Privacy link under Contact option is not present in side bar\");\n\t\tAssert.assertTrue(verifyElementPresent(overviewObj.contactOptionunderContactlinkSiderBar),\n\t\t\t\t\"Contact link under Contact option is not present in side bar\");\n\t}", "@Given(\"^user visit homepage$\")\n\tpublic void user_visit_homepage() throws Throwable {\n\t\tSystem.setProperty(\"webdriver.chrome.driver\",\"C:\\\\Program Files\\\\chromedriver_win32\\\\chromedriver.exe\");\n\t\t//\"key\",\"value\"\n\t\t//\"driver name\",\"path of driver\"\n\t\tdriver= new ChromeDriver();\n\t\t\n\t\t//driver.manage().timeouts().implicitlyWait(20,TimeUnit.SECONDS);\n\t\t\n\t\t\n\t\t//open URL\n\t\tdriver.get(\"https://demo.oscommerce.com/\");\n\t\t\n\t\t//driver.get(\"https://www.amazon.com/\");\n\t\t}", "@Test\n public void testAdvancedSearchPage() throws InterruptedException {\n log.info(\"Go to Homepage \" );\n log.info(\"Click on Advanced Search link in footer \" );\n WebElement advancedSearchButton = driver.findElement(By.partialLinkText(\"Advanced Search\"));\n advancedSearchButton.click();\n log.info(\"Confirm Adavanced Search Page is displayed in browser\" );\n assertTrue(driver.getCurrentUrl().contains(\"search-advanced\"));\n }", "@Test\n public void articleSingleView()throws Exception{\n ChromeDriver driver = openChromeDriver();\n try {\n driver.get(\"https://www.knjizare-vulkan.rs\");\n clearCookies(driver);\n\n WebElement schoolProgram = driver.findElement(By.xpath(\"//a[@href='https://www.knjizare-vulkan.rs/program-za-skolu']\"));\n schoolProgram.click();\n\n WebElement childPencilBox = driver.findElement(By.xpath(\"/html/body/div[4]/div[1]/div/div/div/div[5]/div/div[2]/div/div/div[7]/div[1]/div[1]/a[2]\"));\n childPencilBox.click();\n\n\n\n Thread.sleep(3000);\n\n } finally {\n\n driver.quit();\n\n }\n\n }", "public void clickloginlink(){\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- Loginlink should be clicked from Home Page\");\r\n\t\ttry{\r\n\t\t\twaitForElement(locator_split(\"lnkLogin\"));\r\n\t\t\tclick(locator_split(\"lnkLogin\"));\r\n\t\t\twaitForPageToLoad(200);\r\n\t\t\tSystem.out.println(\"Login link clicked\");\r\n\t\t\tReporter.log(\"PASS_MESSAGE:-Login link is clicked from home page\");\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Login link is not clicked\");\r\n\r\n\t\t}\r\n\r\n\r\n\t}", "public void AddItemFavList( ){\r\n\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- Favourite List Link should be clicked\");\r\n\t\ttry{\r\n\r\n\t\t\tsleep(1000);\r\n\t\t\twaitforElementVisible(returnByValue(getValue(\"FavouriteListLink\")));\r\n\t\t\tclick(returnByValue(getValue(\"FavouriteListLink\")));\r\n\t\t\twaitForPageToLoad(100);\r\n\r\n\t\t\twaitforElementVisible(locator_split(\"btnAdditemtocart\"));\r\n\t\t\tclick(locator_split(\"btnAdditemtocart\"));\r\n\t\t\twaitForPageToLoad(20);\r\n\r\n\t\t\tReporter.log(\"PASS_MESSAGE:- Favourite List and Add Item button clicked\");\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- FavList Link is not clicked \"+elementProperties.getProperty(\"FavouriteListLink\"));\r\n\t\t\tthrow new NoSuchElementException(\"The element with \"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"FavouriteListLink\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"btnAdditemtocart\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ \" not found\");\r\n\r\n\t\t}\r\n\r\n\r\n\t}", "@Test\n public void exerciseTwoTest() {\n driver.get(properties.getProperty(\"URL\"));\n\n // 2. Assert Browser title\n homePageAsserts.shouldReturnPageTitle();\n\n // 3. Perform login\n homePageSteps.login(properties.getProperty(\"username\"), properties.getProperty(\"password\"));\n\n // 4. Assert User name in the left-top side of screen that user is loggined\n homePageAsserts.shouldReturnUsernameText();\n\n // 5. Open through the header menu Service -> Different Elements Page\n homePageSteps.clickServiceButton();\n homePageSteps.openDifferentElementsPage();\n\n // 6. Select checkboxes\n differentElementsPageSteps.selectCheckbox(WATER.getValue());\n differentElementsPageSteps.selectCheckbox(WIND.getValue());\n\n // 7. Select radio\n differentElementsPageSteps.selectRadioButton(SELEN.getValue());\n\n // 8. Select in dropdown\n differentElementsPageSteps.selectDropdown(YELLOW.getValue());\n\n // 9.1 Assert that for each checkbox there is an individual log row\n // and value is corresponded to the status of checkbox\n differentElementsAsserts.shouldReturnSelectedCheckbox();\n differentElementsAsserts.shouldReturnLogRowText(WATER.getValue(), \"true\");\n differentElementsAsserts.shouldReturnLogRowText(WIND.getValue(), \"true\");\n\n // 9.2 Assert that for radio button there is a log row and value is corresponded to the status of radio button\n differentElementsAsserts.shouldReturnSelectedRadioButton();\n differentElementsAsserts.shouldReturnLogRowText(METAL.getValue(), SELEN.getValue());\n\n // 9.3 Assert that for dropdown there is a log row and value is corresponded to the selected value\n differentElementsAsserts.shouldReturnSelectedDropdown();\n differentElementsAsserts.shouldReturnLogRowText(COLORS.getValue(), YELLOW.getValue());\n }", "public static void main(String[] args) throws Exception {\n\t\tWebDriver driver=new FirefoxDriver();\r\n\t\tdriver.manage().window().maximize();\r\n\t\t\r\n\t\t// open website\r\n\t\tdriver.get(\"https://adminfrontend.b2b-staging.thebestagent.pro/\");\r\n\t\tThread.sleep(2500);\r\n\r\n\t\t// log in\r\n\t driver.findElement(By.id(\"login-email\")).sendKeys(\"[email protected]\");\r\n\t driver.findElement(By.id(\"login-password\")).sendKeys(\"cba321\");\r\n\t\tdriver.findElement(By.cssSelector(\".auth__login .button\")).click();\r\n\t\tThread.sleep(5000);\r\n\t\t\r\n\t\t// open Agencies page\r\n\t\tdriver.findElement(By.linkText(\"Agencies\")).click();\r\n\t\tThread.sleep(1500);\r\n\t\t\r\n\t\t// looking for the ticketing fee preset link and clicking it\r\n\t driver.findElement(By.xpath(\"/html/body/div[2]/section[2]/div/div/table/tbody/tr[2]/td[2]/span/a\")).click();\r\n\t Thread.sleep(2500);\r\n\t \r\n\t\t// Looking for H1 \"Rules\" when clicked link page is opened\r\n\t\ttry {\r\n\t\t\tWebDriverWait h1title = new WebDriverWait(driver,3);\r\n\t\t\th1title.until(ExpectedConditions.textToBePresentInElementLocated(By.className(\"Index__title\"), \"Rules\"));\r\n\t\t\tSystem.out.println(\"H1 title 'Rules' found. As expected. PASS\");\r\n\t\t\t}\r\n\t\t \r\n\t\t catch(Exception fieldname) {\r\n\t\t\t System.out.println(\"H1 title not found. FAIL\");\r\n\t\t }\r\n\r\n\t // Following code captures the screenshot and place it in specified location\r\n\t TakesScreenshot ts = (TakesScreenshot)driver;\r\n\t\tFile scrFile = ts.getScreenshotAs(OutputType.FILE);\r\n\t\t\r\n\t\tString desiredName = \"D:/AlexP/Trash/TicketingFeeNameAsLinkOpensFeePage.png\";\r\n\t\tFile dstFile = new File(desiredName);\r\n\t int i = 0;\r\n\t\twhile (dstFile.exists ()) {\r\n\t\t i += 1;\r\n\t\t desiredName = \"D:/AlexP/Trash/TicketingFeeNameAsLinkOpensFeePage(\" + i + \").png\";\r\n\t\t dstFile = new File(desiredName);\r\n\t\t \r\n\t\t \t}\r\n\t\tSystem.out.println(\"Screenshot is taken, please check the folder D:/AlexP/Trash/\");\r\n\t\tFiles.copy(scrFile, dstFile); \r\n\t \r\n }", "public void SearchRFS(){\r\n\t//\tString RFSID = getValue(\"RFSName\");\r\n\t//\tString password = getValue(Password);\r\n\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- My Account should be clicked and user should get logged in\");\r\n\t\ttry{\r\n\t\t\tsleep(3000);\r\n\t\t\tclick(locator_split(\"RFStab\"));\r\n\t\t\tsleep(3000);\r\n\t\t\tswitchframe(\"PegaGadget1Ifr\");\r\n\t\t\tsleep(3000);\r\n\t\t\t//click(locator_split(subtab));\r\n\t\t\t//sleep(3000);\r\n\t\t\t//selectList(locator_split(\"LstLineofBusiness\"),1);\r\n\t\t\tString RFSID=ExcelRetrieve(6, 1);\r\n\t\t\tsendKeys(locator_split(\"RFSName\"),RFSID);\r\n\t\t\tsleep(3000);\r\n\t\t\tclick(locator_split(\"btnRFSSearch\"));\r\n\t\t\tsleep(3000);\r\n\t\t\tclickbylinktext(RFSID);\r\n\t\t\t\r\n\t\t\t\t//clickbylinktext(\"No\");\r\n\t\t\t\r\n\t\t//switchframe(\"PegaGadget2Ifr\");\r\n\t\t//\tsleep(3000);\r\n\t\t//clickbylinktext(\"No\");\r\n\t\t\t\r\n\t\t\t//sleep(2000);\r\n\t\r\n\t\t\tReporter.log(\"PASS_MESSAGE:- Report tab is clicked and user is logged in\");\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Report tab is not clicked in\");\r\n\t\t\tthrow new NoSuchElementException(\"The element with\"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"LoginLogout\")\r\n\t\t\t\t\t+ \" not found\");\r\n\r\n\t\t}\r\n\r\n\t}" ]
[ "0.6947687", "0.68058217", "0.6648371", "0.6617749", "0.6582747", "0.65717983", "0.6565173", "0.65498394", "0.64982384", "0.6494499", "0.64704716", "0.6457013", "0.6446115", "0.6437776", "0.64222306", "0.64102113", "0.6391493", "0.6382741", "0.6381185", "0.638077", "0.63440174", "0.63388807", "0.6336331", "0.6329949", "0.6324783", "0.6321962", "0.6308906", "0.6292544", "0.6285672", "0.6272536", "0.6263052", "0.6256731", "0.6249284", "0.62301195", "0.62216294", "0.6219795", "0.6215494", "0.61876", "0.618497", "0.61822516", "0.6179558", "0.6178371", "0.617816", "0.617522", "0.61732626", "0.6167296", "0.61665297", "0.6160814", "0.61567724", "0.6154742", "0.61494994", "0.6146694", "0.6134", "0.612763", "0.6127106", "0.6123877", "0.6121005", "0.6114082", "0.61111957", "0.6110103", "0.61083156", "0.61062783", "0.6102132", "0.61020285", "0.6099592", "0.609625", "0.60945", "0.6093618", "0.60933316", "0.6093225", "0.6091894", "0.6091743", "0.6087639", "0.6086462", "0.6083679", "0.60830796", "0.6080348", "0.6080156", "0.6079517", "0.60761964", "0.6074994", "0.6070124", "0.606959", "0.6068203", "0.60634273", "0.60611707", "0.6050226", "0.60497284", "0.60493207", "0.60385376", "0.60362387", "0.6032322", "0.6030746", "0.60235196", "0.60187006", "0.6016165", "0.6016046", "0.6015197", "0.60121876", "0.6008688" ]
0.76469326
0
TODO Autogenerated method stub /BinTree leftTree2=new BinTree(); BinTree leftTree=new BinTree(leftTree2,null); BinTree t=new BinTree(null,leftTree); System.out.println(leftTree2.height());
public static void main(String[] args) { String[] a={"111","1101","1100","0","10"}; BinTree t; try{ t=new BinTree(a); System.out.println("Print tree:"); t.printTree(); System.out.println("\n***************"); System.out.println("Print tree in level order:"); t.printLevelOrder(); System.out.println("\n***************"); System.out.println("Get Codewords:"); System.out.println(t.getCodewords()); System.out.println("\n***************"); System.out.println("Convert to array"); t.convert(); System.out.println("\n***************"); System.out.println("Decode 1111011011010:"); System.out.println(t.decode("1111011011010")); System.out.println("\n***************"); }catch(IllegalArgumentException e){ System.out.println(e); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int treeHeight() {\n return height(root);\n }", "@Test\n public void getHeight() {\n Node node = new Node(150);\n node.setLeft(new Node(120));\n node.setRight(new Node(40));\n Node root = new Node(110);\n root.setLeft(new Node(80));\n root.setRight(node);\n assertEquals(2, BinarySearchTree.getHeight(root));\n }", "private static int heightOfTree(Tree tree) {\n\n if(tree == null){\n return 0;\n }\n int leftHeight = 0;\n if(tree.left!=null){\n leftHeight = heightOfTree(tree.left);\n }\n int rightHeight = 0;\n if(tree.right!=null){\n rightHeight = heightOfTree(tree.right);\n }\n return (Math.max(leftHeight, rightHeight))+1;\n\n }", "private int heightBST(Node tree) {\n if (tree == null) {\n return 0;\n }\n return tree.height;\n }", "public int height()\r\n {\r\n if(this.isLeaf())\r\n {\r\n return 0;\r\n }\r\n else if (this.getLeft()!=null&&this.getRight()==null)\r\n {\r\n return this.getLeft().height()+1;\r\n }\r\n else if(this.getLeft()==null&&this.getRight()!=null)\r\n {\r\n return this.getRight().height()+1;\r\n }\r\n else\r\n {\r\n return Math.max(this.getLeft().height(),this.getRight().height())+1;\r\n }\r\n }", "@Override\r\n\tpublic int height() {\r\n\t\tif (this.root == null) {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\t// TODO Auto-generated method stub\r\n\t\treturn height_sub(this.root);\r\n\t}", "public int height(){\n return height(root);\n }", "@Override\n public int height() {\n \treturn height(root);\n }", "@Override\n\tpublic int height() {\n\t\tif(root == null) {\n\t\t\treturn -1;\n\t\t} else {\n\t\t\tNode tempRoot = root;\n\t\t\treturn heightHelper(tempRoot);\n\t\t}\n\t}", "public int height() { return height(root); }", "public int getHeight(){\n\tif (root == null) {\n\t return 0;\n\t}\n\treturn root.height();\n }", "public int height(){\n int level=0;\n \n //if is empty, we finish\n if(this.isEmpty()){\n return level;\n \n \n }else{\n //count this level and check the level under its childs recursively\n int levelSubTree1,levelSubTree2;\n \n levelSubTree1=1 + this.right.height();\n levelSubTree2=1 + this.left.height();\n \n //get the higher height\n if(levelSubTree1> levelSubTree2){\n level=levelSubTree1;\n }else{\n level=levelSubTree2;\n }\n }\n return level;\n }", "public int getHeight (BinaryTreeNode<T> treeNode) {\n if (treeNode == null) {\n return 0;\n }\n return 1 + Math.max(getHeight(treeNode.left), getHeight(treeNode.right));\n }", "public int height(Node tree){\n\t\tif(tree == null){\n\t\t\treturn 0;\n\t\t}\n\t\telse{\n\t\t\tint lheight = height(tree.getLeft());\n\t\t\tint rheight = height(tree.getRight());\n\t\t\t\n\t\t\t//take the branch which is longer\n\t\t\tif(lheight>rheight){\n\t\t\t\treturn (lheight+1);\n\t\t\t}\n\t\t\telse{\n\t\t\t\treturn(rheight+1);\n\t\t\t}\n\t\t}\n\t}", "@Test\r\n public void testHeightFullTree(){\r\n \t\r\n \tBinarySearchTree<Integer> treeInt = new BinarySearchTree<Integer>();\r\n \t\r\n \ttreeInt.add(31);\r\n \ttreeInt.add(5);\r\n \ttreeInt.add(44);\r\n \t\r\n \tassertEquals(treeInt.height(), 1);\r\n \t\r\n \ttree.add(\"deer\");\r\n \ttree.add(\"bar\"); //adding as child to left\r\n \ttree.add(\"jar\"); //add as child to right \r\n \tassertEquals(tree.height(), 1); //height is now 1\r\n }", "public int height() {\r\n\t\t\tif (this.leaf) \t\r\n\t\t\t\treturn 0;\r\n\t\t\telse {\r\n\t\t\t\treturn 1 + Math.max( this.lowChild.height(), this.highChild.height());\r\n\t\t\t}\r\n\t\t}", "public int height() \n\t{\n\t\treturn height(root); //call recursive height method, starting at root\n\t}", "public int height() {\n\t\t// TODO\n return height(root);\n\t}", "public int height() {\n\t\tif (root == null) {\n\t\t\treturn 0;\n\t\t} else {\n\t\t\tBSTNode<K,V> temp = root;\n\t\t\treturn getHeight(temp);\n\t\t}\n\t}", "public int getHeight(){ \n\t if (left == null && right == null){\n\t\treturn 1;\n\t }else if (left == null){\n\t\treturn 1 + right.getHeight();\n\t }else if (right == null){\n\t\treturn 1 + left.getHeight();\n\t }else{\n\t\tif (right.getHeight() >= left.getHeight()){\n\t\t return 1 + right.getHeight();\n\t\t}else{\n\t\t return 1 + left.getHeight();\n\t\t}\n\t }\n\t}", "public int height() {\n return getHeight(root);\n }", "public int getHeight() {\r\n\t\treturn getHeight(rootNode);\r\n\t}", "public int height() {\n return height(root);\n }", "public int height() {\n return height(root);\n }", "public int height() {\n return height(root);\n }", "public int height() {\n if (left == null && right == null) return 0;\n int leftHeight = left == null ? 0 : left.height();\n int rightHeight = right == null ? 0 : right.height();\n return 1 + (leftHeight < rightHeight ? rightHeight : leftHeight);\n }", "public int getHeight(){\n\t\tint h=maxDepth(root);\n\t\treturn h;\n\t}", "public int height() { return root == null ? 0 : root.height(); }", "public int height() {\r\n\t\tint height = 0;\r\n\t\tif (left != null)\r\n\t\t\theight = Math.max(height, left.height() + 1);\r\n\t\tif (right != null)\r\n\t\t\theight = Math.max(height, right.height() + 1);\r\n\r\n\t\treturn height;\r\n\t}", "public int height() {\n return heightNodes(root);\n }", "public int getHeight() {\n return huffTree.getHeight(huffTree.root, 0); \n }", "@Test\r\n public void testHeightCompleteTree(){\r\n \ttree.add(\"deer\");\r\n \ttree.add(\"bar\"); //adding as child to left\r\n \ttree.add(\"jar\"); //add as child to right \r\n \ttree.add(\"apple\"); //adding to right side of right node\r\n \tassertEquals(tree.height(), 2); \r\n }", "public int height()\n {\n return _root.height();\n }", "public int height() {\n if (root == null) {\n return -1;\n } else {\n return getHeight(root, 0);\n }\n }", "public int height() {\n if (root == null) {\n return -1;\n }\n else return height(root);\n }", "public int getHeight() {\n return nodeHeight(overallRoot);\n }", "private int height( BinaryNode<AnyType> t )\r\n\t{\r\n\t\tif( t == null )\r\n\t\t\treturn -1;\r\n\t\telse\r\n\t\t\treturn 1 + Math.max( height( t.left ), height( t.right ) ); \r\n\t}", "private int height(BinaryNode<AnyType> t) {\r\n\t\tif (t == null)\r\n\t\t\treturn -1;\r\n\t\telse\r\n\t\t\treturn 1 + Math.max(height(t.left), height(t.right));\r\n\t}", "public int calcHeight(){\n\t\t\t\treturn calcNodeHeight(this.root);\n\t\t}", "@Override\n public int getHeight() {\n int height = 0;\n\n if (!isEmpty()) {\n height = root.getHeight();\n }\n\n return height;\n }", "public int height(){\r\n \r\n // call the recursive method with the root\r\n return height(root);\r\n }", "int get_height(Node node) {\n\t\tif (node == null) \n\t\t\treturn 0;\n\t\telse if (node.leftChild == null && node.rightChild == null)\n\t\t\treturn 0;\t\t\n\t\telse return 1 + max(get_height(node.leftChild), get_height(node.rightChild));\n\t}", "public int height()\n {\n return Math.max(left, right);\n }", "int computeHeight() {\n Node<Integer>[] nodes = new Node[parent.length];\n for (int i = 0; i < parent.length; i++) {\n nodes[i] = new Node<Integer>();\n }\n int rootIndex = 0;\n for (int childIndex = 0; childIndex < parent.length; childIndex++) {\n if (parent[childIndex] == -1) {\n rootIndex = childIndex;\n } else {\n nodes[parent[childIndex]].addChild(nodes[childIndex]);\n }\n }\n return getDepth(nodes[rootIndex]);\n }", "private static int height(TreeNode n){\n\t\tif(n==null)\n\t\t\treturn 0;\n\t\treturn 1+Math.max(height(n.left), height(n.right));\n\t}", "private int height(Node<T> node){\n if(node == null){\n return 0;\n }else{\n int leftHight = height(node.left) + 1;\n int rightHight = height(node.right) + 1;\n if(leftHight > rightHight){\n return leftHight;\n }else{\n return rightHight;\n }\n }\n }", "public int getHeight(){\n\n if(mRight != null){\n startValRight++;\n mRight.getHeight();\n }//End if Right not null\n else if(mLeft != null){\n startValLeft++;\n mLeft.getHeight();\n }//End if left not null\n if (startValLeft > startValRight) {\n return startValLeft;\n }//End if Left is greater than right\n return startValRight;\n }", "int height(TreeNode root) \n { \n if (root == null) \n return 0; \n else\n { \n /* compute height of each subtree */\n int lheight = height(root.left); \n int rheight = height(root.right); \n \n /* use the larger one */\n if (lheight > rheight) \n return(lheight+1); \n else return(rheight+1); \n } \n }", "@Override\r\n\tpublic int getNodeHeight() {\n\t\treturn getNodeHeight(this);\r\n\t}", "private int height(Node<T> node){\n if(node == null)\n return 0;\n // get height of left and right side\n int left = height(node.left);\n int right = height(node.right);\n\n // height will be Max of height of left and right + 1 (Own level)\n return 1 + Math.max(left, right );\n\n }", "private int calcNodeHeight(Node t) {\n\t\t\tif(t == null) return 0; //Base case of an empty tree. Has a height of zero. T is the root!\n\n\t\t\treturn (Math.max(calcNodeHeight(t.left), calcNodeHeight(t.right)) + 1); //The height of a binary tree is the height of the root's largest subtree + 1 for the root\n\t\t}", "private int height(TreeNode<E> node) {\n\t\tif(isEmpty()) //if tree is empty\n\t\t\treturn 0; //height is 0 for empty tree\n\t\tif(node.right == null && node.left == null) //current node has no children\n\t\t\treturn 1; //return 1\n\t\tif(node.left == null) //current node has only a right child\n\t\t\treturn 1 + height(node.right); //return 1 + height of right subtree\n\t\tif(node.right == null) //current node has only a left child\n\t\t\treturn 1 + height(node.left); //return 1 + height of left subtree\n\t\t//The below cases are for when the current node has two children\n\t\tif(height(node.left) > height(node.right)) //if left height is greater than right height\n\t\t\treturn 1 + height(node.left); //return 1 + height of left subtree\n\t\telse //if right height is greater than left height\n\t\t\treturn 1 + height(node.right); //return 1 + height of right subtree\n\t}", "public int findHeight(Node temp) {\n\t\t\n\t\t\n\t\t//check whether tree is empty\n\t\tif(root==null) {\n\t\t\t\n\t\t\tSystem.out.println(\"Tree is Empty\");\n\t\t\treturn 0;\n\t\t}\n\t\telse {\n\t\t\t\n\t\t\tint leftHeight=0; int rightHeight=0;\n\t\t//Calculate height of left subtree\n\t\t\tif(temp.left !=null) \n\t\t\t\t\n\t\t\t\tleftHeight = findHeight(temp.left);\n\t\t\tif(temp.right !=null) \n\t\t\t\t\n\t\t\t\trightHeight = findHeight(temp.right);\n\t\t\t\t\n\t\t\tint max = (leftHeight > rightHeight)? leftHeight: rightHeight;\n\t\t\t\n\t\t\treturn (max+1);\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t}", "int height(Node N) { \n if (N == null) \n return 0; \n return N.height; \n }", "public int height() {\n return this.root.height();\n }", "int height(Node N) \n { \n if (N == null) \n return 0; \n return N.height; \n }", "public int depth(){\n if(root!=null){ // มี node ใน tree\n return height(root);\n }\n else {return -1;}\n }", "public static void main(String[] args) \n { \n BinaryTree tree = new BinaryTree(); \n \n tree.root = new Node(1); \n tree.root.left = new Node(2); \n tree.root.right = new Node(3); \n tree.root.left.left = new Node(4); \n tree.root.left.right = new Node(5); \n \n System.out.println(\"Height of tree is : \" + \n tree.maxDepth(tree.root));\n System.out.println(\"Height of tree is by recur : \" + \n tree.heigth(tree.root));\n System.out.println(\"Diameter of tree is : \" + \n tree.getdiameter(tree.root));\n }", "private int height(BSTNode root) {\r\n \r\n // if the root is null, return 0\r\n if (null == root) {\r\n \r\n return 0;\r\n }\r\n \r\n // find the height of the left subtree\r\n int heightLeftSub = height(root.left);\r\n \r\n // find the height of the right subtree\r\n int heightRightSub = height(root.right);\r\n \r\n // return the greatest subtree value plus 1 for the height\r\n return Math.max(heightLeftSub, heightRightSub) + 1; \r\n }", "public int getHeight(){\n \treturn height;\n }", "int height(Node root) { return (root != null) ? Math.max(height(root.left), height(root.right)) + 1 : 0;}", "private int height(AvlTreeNode<?, ?> n) {\n if (n == null) return -1;\n return n.height;\n }", "public int minDepth() {\r\n\t\tint height = Integer.MAX_VALUE;\r\n\t\tif (left != null)\r\n\t\t\theight = Math.min(height, left.height() + 1);\r\n\t\tif (right != null)\r\n\t\t\theight = Math.min(height, right.height() + 1);\r\n\t\tif (left == null && right == null)\r\n\t\t\theight = 0;\r\n\t\treturn height;\r\n\t}", "public int height(Node<T> n) \n\t { \n\t if (n == null) \n\t return 0; \n\t else \n\t { \n\t int lheight = height(n.left); \n\t int rheight = height(n.right); \n\t if (lheight > rheight) \n\t return (lheight + 1); \n\t else \n\t return (rheight + 1); \n\t } \n\t }", "public int getHeight()\n {\n \treturn height;\n }", "public int getTreeHeight(int i) {\n\t\treturn this.treeHeight[i];\n\t}", "public double getBaseHeight();", "public void update_height() {\r\n int tmp_height = 0;\r\n int tmp_left = -1;\r\n int tmp_right = -1;\r\n\r\n // set height of null children to -1\r\n if (leftChild != null) {\r\n tmp_left = leftChild.height;\r\n }\r\n if (rightChild != null) {\r\n tmp_right = rightChild.height;\r\n }\r\n\r\n // find highest child\r\n if (tmp_left > tmp_right) {\r\n tmp_height = tmp_left;\r\n }\r\n else {\r\n tmp_height = tmp_right;\r\n }\r\n\r\n // update this node's height\r\n height = tmp_height + 1;\r\n }", "int height(Node n)\n\t{\n\t\tif(n==null)\n\t\t\treturn 0;\n\t\telse\n\t\t\treturn n.height;\n\t}", "int height(Node N) {\n if (N == null) {\n return 0;\n }\n return N.height;\n }", "public int height(Node n)\r\n\t{\r\n\t\tif(n==null)\r\n\t\t{\r\n\t\t\treturn -1;//empy node height is -1\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn n.height;\r\n\t\t}\r\n\t}", "public int height()\r\n {\r\n return head.height; //Should return log base 2 of n or the height of our head node. \r\n }", "public int getHeight() \n\t{\n\t\treturn height;\n\t}", "public int getHeight()\r\n\t{\r\n\t\treturn height;\r\n\t}", "public double getHeight() {\n\treturn height;\n }", "public int getHeight()\n\t{\n\t\treturn height;\n\t}", "public int getHeight()\n\t{\n\t\treturn height;\n\t}", "int height(TreeNode root) {\n return root == null ? -1 : 1 + height(root.left);\n }", "public int getHeight(){\n return this.height;\n }", "public static void main(String args[]) {\n \n BST tree = new BST(); \n \n tree.root = new Node(50); \n tree.root.left = new Node(10); \n tree.root.right = new Node(60); \n tree.root.left.left = new Node(5); \n tree.root.left.right = new Node(20); \n tree.root.right.left = new Node(55); \n tree.root.right.left.left = new Node(45); \n tree.root.right.right = new Node(70); \n tree.root.right.right.left = new Node(65); \n tree.root.right.right.right = new Node(80); \n \n /* The complete tree is not BST as 45 is in right subtree of 50. \n The following subtree is the largest BST \n 60 \n / \\ \n 55 70 \n / / \\ \n 45 65 80 \n */\n tree.largestBST(root);\n System.out.println(\"Size of largest BST is \" + res); \n }", "public double getHeight() {\n\t\t\treturn height.get();\n\t\t}", "public int getHeight() {\n\treturn height;\n}", "private int getHeightDifference(long addr) throws IOException {\n Node current = new Node(addr);\r\n Node left = new Node(current.left);\r\n Node right = new Node(current.right);\r\n\r\n if (current.left == 0) {\r\n left.height = -1;\r\n }\r\n if (current.right == 0) {\r\n right.height = -1;\r\n }\r\n return left.height - right.height;\r\n }", "public int getHeight(){\n return height;\n }", "public int getHeight() {\r\n\t\t\r\n\t\treturn height;\r\n\t}", "public int getHeight() {\n\t\treturn height;\n\t}", "public int getHeight() {\n\t\treturn height;\n\t}", "public int getHeight() {\n\t\treturn height;\n\t}", "public int getHeight() {\n\t\treturn height;\n\t}", "public int getHeight() {\n\t\treturn height;\n\t}", "public int getHeight() {\n\t\treturn height;\n\t}", "public int getHeight() {\n\t\treturn height;\n\t}", "public int getHeight() {\n\t\treturn height;\n\t}", "public int getHeight() {\n\t\treturn height;\n\t}", "public int getHeight() {\n\t\treturn height;\n\t}", "public int getHeight() {\n\t\treturn height;\n\t}", "public int height()\n\t{\n\t\treturn height;\n\t}", "public double getHeight() {\n\t\treturn height;\n\t}", "public double getHeight() {\n\t\treturn height;\n\t}", "public double getHeight() {\n\t\treturn height;\n\t}", "public double getHeight() {\n\t\treturn height;\n\t}" ]
[ "0.7389926", "0.7339731", "0.7337957", "0.7303968", "0.726681", "0.7219369", "0.7184787", "0.7164541", "0.7074356", "0.70697296", "0.7058506", "0.70278454", "0.70277894", "0.7002692", "0.6992184", "0.69815755", "0.69812304", "0.69770706", "0.6974186", "0.6972647", "0.692508", "0.69216114", "0.6862662", "0.6862662", "0.6862662", "0.68587863", "0.68512356", "0.68294334", "0.68114245", "0.6798665", "0.6783316", "0.6744114", "0.67432773", "0.67302436", "0.6721212", "0.6712342", "0.667487", "0.6670305", "0.66560364", "0.6641467", "0.6574745", "0.65720695", "0.6564827", "0.65205956", "0.6514502", "0.6511706", "0.6504509", "0.6504461", "0.6504232", "0.6473882", "0.6467844", "0.64518255", "0.64418465", "0.64365596", "0.6428099", "0.6422829", "0.63785636", "0.63727677", "0.63628954", "0.6331954", "0.630744", "0.629755", "0.6285716", "0.6285416", "0.6258202", "0.62554985", "0.62551475", "0.62517244", "0.62418514", "0.6241386", "0.62282073", "0.6201465", "0.619564", "0.61932015", "0.6192708", "0.61885804", "0.61885804", "0.6188313", "0.618734", "0.6181183", "0.61751693", "0.6173886", "0.6164985", "0.6159483", "0.6156383", "0.61491805", "0.61491805", "0.61491805", "0.61491805", "0.61491805", "0.61491805", "0.61491805", "0.61491805", "0.61491805", "0.61491805", "0.61491805", "0.6148865", "0.61442983", "0.61442983", "0.61442983", "0.61442983" ]
0.0
-1
ESTO ES PARA DEVOLVERSE
@Override public boolean onKeyDown(int keyCode, KeyEvent event) { // TODO Auto-generated method stub if (keyCode == event.KEYCODE_BACK) { Intent i = new Intent(Detalles_pedido.this, Pedido.class); i.putExtra("tecnico",tecnico.toString()); i.putExtra("nomtecnico",nombretec.toString()); startActivity(i); //return true; } return super.onKeyDown(keyCode, event); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void devolver() {\r\n \t\r\n \tif (raiz == null)\r\n \t\tSystem.out.println(\"No hay datos en la pila\");\r\n else\r\n \t System.out.println(\"Devolvemos el dato de la cima: \"+raiz.dato);\r\n }", "public void leerPlanesDietas();", "public static void dodavanjePutnickogVozila() {\n\t\tString vrstaVozila = \"Putnicko Vozilo\";\n\t\tString regBr = UtillMethod.unosRegBroj();\n\t\tGorivo gorivo = UtillMethod.izabirGoriva();\n\t\tGorivo gorivo2 = UtillMethod.izabirGorivaOpet(gorivo);\n\t\tint brServisa = 1;\n\t\tdouble potrosnja100 = UtillMethod.unesiteDoublePotrosnja();\n\t\tSystem.out.println(\"Unesite broj km koje je vozilo preslo:\");\n\t\tdouble predjeno = UtillMethod.unesiteBroj();\n\t\tdouble preServisa = 10000;\n\t\tdouble cenaServisa = 8000;\n\t\tSystem.out.println(\"Unesite cenu vozila za jedan dan:\");\n\t\tdouble cenaDan = UtillMethod.unesiteBroj();\n\t\tSystem.out.println(\"Unesite broj sedista u vozilu:\");\n\t\tint brSedist = UtillMethod.unesiteInt();\n\t\tSystem.out.println(\"Unesite broj vrata vozila:\");\n\t\tint brVrata = UtillMethod.unesiteInt();\n\t\tboolean vozObrisano = false;\n\t\tArrayList<Gorivo> gorivaVozila = new ArrayList<Gorivo>();\n\t\tgorivaVozila.add(gorivo);\n\t\tif(gorivo2!=Main.nista) {\n\t\t\tgorivaVozila.add(gorivo2);\n\t\t}\n\t\tArrayList<Servis> servisiNadVozilom = new ArrayList<Servis>();\n\t\tPutnickoVozilo vozilo = new PutnickoVozilo(vrstaVozila, regBr, gorivaVozila, brServisa, potrosnja100, predjeno,\n\t\t\t\tpreServisa, cenaServisa, cenaDan, brSedist, brVrata, vozObrisano, servisiNadVozilom);\n\t\tUtillMethod.prviServis(vozilo, predjeno);\n\t\tMain.getVozilaAll().add(vozilo);\n\t\tSystem.out.println(\"Novo vozilo je uspesno dodato u sistem!\");\n\t\tSystem.out.println(\"---------------------------------------\");\n\t}", "private static void VeureVendes (BaseDades bd) {\n ArrayList <Venda> llista = new ArrayList <Venda>();\n llista = bd.consultaVen(\"SELECT * FROM VENDES\");\n if (llista != null)\n for (int i = 0; i<llista.size(); i++) {\n Venda p = (Venda) llista.get(i);\n Producte prod = bd.consultarUnProducte(p.getIdproducte());\n System.out.println(\"ID Venda =>\"+p.getNumvenda()+\"* Producte: \"\n +prod.getDescripcio()+\"* Quantitat: \"+p.getQuantitat()\n +\"* Data: \"+p.getDatavenda());\n }\n }", "public static void dodavanjeTeretnogVozila() {\n\t\tString vrstaVozila = \"Teretno Vozilo\";\n\t\tString regBr = UtillMethod.unosRegBroj();\n\t\tGorivo gorivo = UtillMethod.izabirGoriva();\n\t\tGorivo gorivo2 = UtillMethod.izabirGorivaOpet(gorivo);\n\t\tint brServisa = 1;\n\t\tdouble potrosnja = UtillMethod.unesiteDoublePotrosnja();\n\t\tSystem.out.println(\"Unesite broj km koje je vozilo preslo:\");\n\t\tdouble predjeno = UtillMethod.unesiteBroj();\n\t\tdouble preServisa = 20000;\n\t\tdouble cenaServisa = 10000;\n\t\tSystem.out.println(\"Unesite cenu vozila za jedan dan:\");\n\t\tdouble cenaDan = UtillMethod.unesiteBroj();\n\t\tSystem.out.println(\"Unesite broj sedista u vozilu:\");\n\t\tint brSedista = UtillMethod.unesiteInt();\n\t\tSystem.out.println(\"Unesite broj vrata vozila:\");\n\t\tint brVrata = UtillMethod.unesiteInt();\n\t\tboolean vozObrisano = false;\n\t\tArrayList<Gorivo> gorivaVozila = new ArrayList<Gorivo>();\n\t\tgorivaVozila.add(gorivo);\n\t\tif(gorivo2!=Main.nista) {\n\t\t\tgorivaVozila.add(gorivo2);\n\t\t}\n\t\tArrayList<Servis> servisiNadVozilom = new ArrayList<Servis>();\n\t\tSystem.out.println(\"Unesite maximalnu masu koje vozilo moze da prenosi u KG !!\");\n\t\tint maxMasauKg = UtillMethod.unesiteInt();\n\t\tSystem.out.println(\"Unesite maximalnu visinu u m:\");\n\t\tdouble visinauM = UtillMethod.unesiteBroj();\n\t\tTeretnaVozila vozilo = new TeretnaVozila(vrstaVozila, regBr, gorivaVozila, brServisa, potrosnja, predjeno, preServisa,\n\t\t\t\tcenaServisa, cenaDan, brSedista, brVrata, vozObrisano, servisiNadVozilom, maxMasauKg, visinauM);\n\t\tUtillMethod.prviServis(vozilo, predjeno);\n\t\tMain.getVozilaAll().add(vozilo);\n\t\tSystem.out.println(\"Novo vozilo je uspesno dodato u sistem!\");\n\t\tSystem.out.println(\"--------------------------------------\");\n\t}", "void evoluer()\n {\n int taille = grille.length;\n int nbVivantes = 0;\n for(int i=-1; i<2; i++)\n {\n int xx = ((x+i)+taille)%taille; // si x+i=-1, xx=taille-1. si x+i=taille, xx=0\n for(int j=-1; j<2; j++)\n {\n if (i==0 && j==0) continue;\n int yy = ((y+j)+taille)%taille;\n if (grille[xx][yy].vivante) nbVivantes++;\n }\n }\n if (nbVivantes<=1 || nbVivantes>=4) {vientDeChanger = (vivante==true); vivante = false;}\n if (nbVivantes==3) {vientDeChanger = (vivante==false); vivante = true;}\n }", "public static void EjecutaEjercicio1PD(String entrada) {\n\t\tEjercicio1.iniDatos(entrada);\n\t\t\n\t\t// Declarar vértice de inicio para el grafo:\n\t\tVerticeAlumno verticeInicial = VerticeAlumno.verticeInicial();\n\t\n\t\t// Inicializar el grafo virtual:\n\t\t/*\n\t\t * 2 vías:\n\t\t * \t· Con peso en el vértice.\n\t\t * \t· Con peso en las aristas. \n\t\t*/ \n\t\t\n\t\t// Inicializa un grafo virtual de tipo simpleVirtualGraph a partir del vértice inicial con peso:\n\t\tEGraph<VerticeAlumno, AristaAlumno> grafoVirtual = Graphs2.simpleVirtualGraph(verticeInicial, x -> x.getEdgeWeight());\t\n\t\t\n\t\t// Invocar el algoritmo de Programación Dinámica: \n\t\t/*\n\t\t * 2 vías: \n\t\t * · Expresando el vértice final de destino.\n\t\t * · Mediante un predicado objetivo.\n\t\t*/\n\t\tDynamicProgrammingReduction<VerticeAlumno, AristaAlumno> algoritmoPD = DPR.dynamicProgrammingReductionGoal(\n\t\t\t\t\t\tgrafoVirtual,\n\t\t\t\t\t\tVerticeAlumno.objetivo(),\n\t\t\t\t\t\tHeuristicaAlumno::heuristica,\n\t\t\t\t\t\tPDType.Max\n\t\t\t\t\t\t);\n\t\t\n\t\t// Proporciona un camino devuelto por PD desde el vértice inicial al objetivo:\n\t\tGraphPath<VerticeAlumno, AristaAlumno> caminoPD = algoritmoPD.search().get();\n\t\t\n\t\t// Solución: lista de aristas recorridos del grafo: \n\t\tList<AristaAlumno> aristas = caminoPD.getEdgeList();\n\t\tSystem.out.println(\"$$$$$$$$$$$$$$$$$ PROGRAMACIÓN DINÁMICA $$$$$$$$$$$$$$$$$$\");\n\t\tSolucion1.solucion(aristas, entrada);\n\t\t\n\t\t// DEBUG:\n\t\t/*\n\t\t * List<VerticeAlumno> vertices = caminoA.getVertexList();\n\t\t * System.out.println(vertices);\n\t\t*/\n\t\t\n\t}", "public static void main(String[] args) {\n\t\tnew Ventana();\n/*\n\t\tCollection<MuroDeEnergia> muros = new ArrayList<MuroDeEnergia>();\n\t\tCollection<NaveInvasora> naves = new ArrayList<NaveInvasora>();\n\t\tBateria jugador = new Bateria();\n\t\t\n\t\tJuego.getInstancia();\n\t\tmuros = Juego.getInstancia().getMuros();\n\t\tnaves = Juego.getInstancia().getEnemigos();\n\t\tjugador = Juego.getInstancia().getJugador();\n\t\t\n\t\tIterator<MuroDeEnergia> i;\n\t\tfor (i = muros.iterator(); i.hasNext();) {\n\t\t\tMuroDeEnergia act = i.next();\n\t\t\tSystem.out.println(\"El muro \" + act.getCodigoMuro() + \" esta ubicado en: (\" + act.getCoordenadaX() + \", \" + act.getCoordenadaY() + \")\");\n\t\t}\n\t\t\n\t\tIterator<NaveInvasora> j;\n\t\tfor (j = naves.iterator(); j.hasNext();) {\n\t\t\tNaveInvasora act = j.next();\n\t\t\tSystem.out.println(\"El enemigo \" + act.getCodigoNave() + \" esta ubicado en: (\" + act.getCoordenadaX() + \", \" + act.getCoordenadaY() + \")\");\n\t\t}\n\t\t\n\t\tSystem.out.println(\"El jugador esta ubicado en (\" + jugador.getCoordenadaX() + \", \" + jugador.getCoordenadaY() + \")\" );\n\n\t\tSystem.out.println(\"Hay \" + muros.size() + \" muros de energia.\");\n\t\tJuego.getInstancia().destruirMuro(1);\n\t\tSystem.out.println(\"El muro 1 fue destruido.\");\n\t\tmuros = Juego.getInstancia().getMuros();\n\t\tSystem.out.println(\"Hay \" + muros.size() + \" muros de energia.\");\n\t\t\n\t\tSystem.out.println(\"Hay \" + naves.size() + \" enemigos. El jugador tiene \" + jugador.getPuntos() + \" puntos.\");\n\t\tJuego.getInstancia().destruirNave(9);\n\t\tSystem.out.println(\"La nave 9 fue destruida.\");\n\t\tnaves = Juego.getInstancia().getEnemigos();\n\t\tSystem.out.println(\"Hay \" + naves.size() + \" enemigos. El jugador tiene \" + jugador.getPuntos() + \" puntos.\");\n\t\tSystem.out.println(\"Usted esta en el nivel \" + Juego.getInstancia().getDificultad());\n\t\tSystem.out.println(\"Destruyendo naves...\");\n\t\tint idNave = 0;\n\t\twhile(idNave < 15) {\n\n\t\t\tJuego.getInstancia().destruirNave(idNave);\n\n\t\t\tidNave++;\n\n\t\t}\n\t\tSystem.out.println(\"Todas las naves fueron destruidas. Usted esta en el nivel \" + Juego.getInstancia().getDificultad() + \".\");\n\n\t\tSystem.out.println(\"El jugador esta ubicado en (\" + jugador.getCoordenadaX() + \", \" + jugador.getCoordenadaY() + \")\" );\n\t\t\n\t\tSystem.out.println(\"El jugador se mueve a la izquierda\");\n\t\tJuego.getInstancia().presionaFlechaIzq();\n\t\tSystem.out.println(\"El jugador esta ubicado en (\" + jugador.getCoordenadaX() + \", \" + jugador.getCoordenadaY() + \")\" );\n\t\t\n\t\tSystem.out.println(\"El jugador se mueve a la izquierda\");\n\t\tJuego.getInstancia().presionaFlechaIzq();\n\t\tSystem.out.println(\"El jugador esta ubicado en (\" + jugador.getCoordenadaX() + \", \" + jugador.getCoordenadaY() + \")\" );\n\n\t\tSystem.out.println(\"El jugador se mueve a la derecha\");\n\t\tJuego.getInstancia().presionaFlechaDer();\n\t\tSystem.out.println(\"El jugador esta ubicado en (\" + jugador.getCoordenadaX() + \", \" + jugador.getCoordenadaY() + \")\" );\n\n\t\tSystem.out.println(\"Se termina el juego:\");\n\t\tJuego.getInstancia().finalizarJuego();\n\t\t\n*/\n\t}", "public void vivir(){\r\n\t\r\n\tAtacable algo42tmp;\r\n\t\r\n\tif (!(this.muerto)){\r\n\t\tfor(int i = 0; i <= this.velY; i++){\r\n\t\t\tthis.mover();\r\n\t\t}\r\n\t\t\r\n\t\talgo42tmp = zonaDeCombate.comprobarColisionAlgo42(this);\r\n\t\tif (algo42tmp != null){\r\n\t\t\talgo42tmp.recibirDanio(20); /**hacer q se muera*/\r\n\t\t\tthis.muerto = true;\r\n\t\t}\r\n\t\t\r\n\r\n\t\t}\r\n\t}", "public void mostraDados() {\n System.out.println(\"O canal atual é: \" + tv.getCanal());\n System.out.println(\"O volume atual é: \" + tv.getVolume());\n System.out.println(\"--------------------------------------\");\n }", "private void devolverLivro() throws Exception {\n try {\n long DAY_IN_MS = 1000 * 60 * 60 * 24; // formatar data entrega\n int codigo = Console.scanInt(\"Informe o código da retirada do livro: \");\n retiradaDao = new RetiradaDaoBd();\n Retirada retirada = retiradaDao.procurarPorId(codigo);\n try {\n devolucaoNegocio.salvar(retirada);\n System.out.println(\"Devolucao cadastrado com sucesso!\");\n } catch (Exception ex) {\n UIUtil.mostrarErro(ex.getMessage());\n }\n\n System.out.println(\"Livro \" + retirada.getLivro().getNome() + \" devolvido por \" + retirada.getCliente().getNome());\n } catch (InputMismatchException e) {\n System.err.println(\"ERRO! O ISBN deve ser numérico!\");\n }\n }", "public void obtener() {\r\n \t\r\n \tif (raiz!=null)\r\n {\r\n int informacion = raiz.dato;\r\n raiz = raiz.sig;\r\n end = raiz;\r\n System.out.println(\"Obtenemos el dato de la cima: \"+informacion);\r\n }\r\n else\r\n {\r\n System.out.println(\"No hay datos en la pila\");\r\n }\r\n }", "public void volar() {\n }", "boolean estVide();", "@Override\n public void paso0() {\n n = graph.getNodeIndices().indexOf(actual);\n nodo = graph.getNodes().get(n);\n nodo.setEstado(Node.State.CURRENT);\n nodo.pintarNodo(g);\n // comprueba si es objetivo\n if (nodo.getEsObjetivo()) {\n // establece el objetivo encontrado\n miObjetivo = nodo.toString();\n // termina con exito\n Step = 4;\n } else {\n // se prepara para explorar los sucesores\n m = nodo.maxSucesores();\n j = 0;\n // siguiente paso\n Step = 1;\n }\n }", "public Vector<MakhlukHidup> get_daftar();", "public void decida(){\n int vecinasVivas=vecinos();\n if(vecinasVivas==3 && estadoActual=='m'){\n estadoSiguiente='v';\n }else if((estadoActual=='v' && vecinasVivas==2) || (estadoActual=='v' && vecinasVivas==3)){\n estadoSiguiente='v';\n }else if(vecinasVivas<2 || vecinasVivas>3){\n estadoSiguiente='m';\n }\n }", "public CapteurVitesse() {\n super();\n vitesseDetecte = 0;\n }", "public void calcularPesos(){\r\n StructursDecisors.weightsDecisors=new ArrayList();\r\n double [][] matrizEigenvectors=createMatriz();\r\n for(int i=0; i<Structurs.names.size();i++)\r\n for(int j=0; j<StructursDecisors.names.size(); j++)\r\n System.out.println(\"MatrizEigenvector[\"+i+\"][\"+j+\"]\"+\"=\"+matrizEigenvectors[i][j]);\r\n double eigenvectorCriterios[]=new double[Structurs.eigenvector.size()];\r\n for(int i=0; i<Structurs.eigenvector.size(); i++)\r\n eigenvectorCriterios[i]=(double) Structurs.eigenvector.get(i);\r\n double []vectorPesos=createArrayPesos(matrizEigenvectors, eigenvectorCriterios);\r\n \r\n }", "public ConversorVelocidad() {\n //setTemperaturaConvertida(0);\n }", "@Override\n\tpublic void hacerDevolucion() {\n\t\tSystem.out.println(\"Hacer Devolucion pantalon\");\n\t}", "public void vincular() {\n\n\t\ttry {\n\t\t\tList<Veiculo> veiculos = Deserializador.deserializar(\"conteudo/veiculos\", Veiculo.class);\n\t\t\tList<Motorista> motoristas = Deserializador.deserializar(\"conteudo/motoristas\", Motorista.class);\n\n\t\t\tScanner entrada = new Scanner(System.in);\n\t\t\tMotorista motorista = null;\n\t\t\tVeiculo veiculo = null;\n\t\t\tSystem.out.println(\"Digite o numero da CNH do motorista que deseja vincular.\");\n\t\t\tint cnh = entrada.nextInt();\n\t\t\tif (motoristas != null) {\n\t\t\t\tif (veiculos != null) {\n\t\t\t\t\tfor (Motorista motor : motoristas) {\n\t\t\t\t\t\tif (cnh == motor.getNumero_Carteira()) {\n\t\t\t\t\t\t\tSystem.out.println(\"Motorista encontrado: \" + motor.getNome());\n\t\t\t\t\t\t\tmotorista = motor;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (motorista == null) {\n\t\t\t\t\t\tSystem.out.println(\"Motorista nao encontrado!\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (motorista.getVeiculo() == null) {\n\t\t\t\t\t\t\tSystem.out.println(\"Motorista selecionado com sucesso.\");\n\n\t\t\t\t\t\t\tSystem.out.println(\"Digite a placa do veiculo que deseja vincular ao motorista \"\n\t\t\t\t\t\t\t\t\t+ motorista.getNome());\n\t\t\t\t\t\t\tString placa = entrada.next();\n\t\t\t\t\t\t\tfor (Veiculo veic : veiculos) {\n\t\t\t\t\t\t\t\tif (veic.getPlaca().equals(placa)) {\n\t\t\t\t\t\t\t\t\tSystem.out.println(\"Veiculo encontrado.\");\n\t\t\t\t\t\t\t\t\tveiculo = veic;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (veiculo == null) {\n\t\t\t\t\t\t\t\tSystem.out.println(\"Veiculo nao encontrado!\");\n\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// RN004\n\t\t\t\t\t\t\t\tif (veiculo.getMotorista() == null) {\n\t\t\t\t\t\t\t\t\t// RN001\n\t\t\t\t\t\t\t\t\tif (Character.toLowerCase(motorista.getCategoria_Habilitacao()) == 'c') {\n\t\t\t\t\t\t\t\t\t\tveiculo.setMotorista(motorista);\n\t\t\t\t\t\t\t\t\t\tmotorista.setVeiculo(veiculo);\n\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"Motorista registrado com sucesso.\");\n\n\t\t\t\t\t\t\t\t\t} else if (veiculo.getCarga() == 1\n\t\t\t\t\t\t\t\t\t\t\t&& Character.toLowerCase(motorista.getCategoria_Habilitacao()) == 'b') {\n\t\t\t\t\t\t\t\t\t\tveiculo.setMotorista(motorista);\n\t\t\t\t\t\t\t\t\t\tmotorista.setVeiculo(veiculo);\n\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"Motorista registrado com sucesso.\");\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"Tipo da CNH do motorista invalida.\");\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tSystem.out.println(\"O veiculo desejado ja esta vinculado a um motorista.\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tSystem.out.println(\"Motorista ja esta vinculado a um veiculo.\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(\"A lista de veiculos esta vazia.\");\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"A lista de motoristas esta vazia.\");\n\t\t\t}\n\n\t\t\tSerializador s = new Serializador();\n\t\t\ts.serializar(\"conteudo/motoristas\", motoristas);\n\t\t\ts.serializar(\"conteudo/veiculos\", veiculos);\n\t\t} catch (Exception ex) {\n\t\t\tSystem.err.println(\"Falha ao serializar ou deserializar! - \" + ex.toString());\n\t\t}\n\t}", "int getEvd();", "private void devolver100() {\n cambio = cambio - 100;\n de100--;\n cambio100++;\n }", "private void EstablecerVistas(TipoGestion tGestion){\n\t\tCantEjecutada=Utilitarios.round(activ.getCantidadEjecutada(),4);\n\t\n\t\tcantContratada=Utilitarios.round(activ.getCantidadContratada(),4);\n\t\t\n\t\t//CantPendienteDeEjecutar = Utilitarios.round((activ.getCantidadContratada()-activ.getCantidadEjecutada()),4);\n\n\n\t\tif ( activ.getCantidadEjecutada() > activ.getCantidadContratada()){\n\t\t\tCantPendienteDeEjecutar = 0;\n\t\t\tCantExcendete = Utilitarios.round((activ.getCantidadEjecutada()-activ.getCantidadContratada()),4);\n\t\t\tPorcExcedente = Utilitarios.round((CantExcendete / cantContratada * 100),2);\n\t\t\t((TextView) getActivity().findViewById(R.id.tv_fragAgregarAvancesRenglon_PorcCantidadExcedente)).setTextColor(getResources().getColorStateList(R.color.graphRed));\n\t\t}\n\t\telse{\n\t\t\tCantPendienteDeEjecutar = Utilitarios.round((activ.getCantidadContratada()-activ.getCantidadEjecutada()),4);\n\t\t\t((TextView) getActivity().findViewById(R.id.tv_fragAgregarAvancesRenglon_PorcCantidadExcedente)).setTextColor(getResources().getColorStateList(R.color.graphGreen));\n\t\t}\n\n\t\t\n\t\tif ( activ.getCantidadContratada() > 0){\n\t\t\t\tPorcEjecutado=Utilitarios.round((activ.getCantidadEjecutada()/cantContratada) * 100,2);\n\t\t\t\tPorcPendienteDeEjecutar = Utilitarios.round((CantPendienteDeEjecutar / cantContratada * 100),2);\n\t\t\t}\n\t\telse{\n\t\t\tPorcPendienteDeEjecutar\t= 0.00;\n\t\t\tPorcPendienteDeEjecutar = 0.00;\n\t\t}\n\n\t\t((TextView) getActivity()\n\t\t\t\t.findViewById(R.id.tv_fragAgregarAvancesRenglon_Actividad))\n\t\t\t\t.setText(String.valueOf(cantContratada));\n\n\t\t((TextView) getActivity()\n \t\t\t.findViewById(R.id.tv_fragAgregarAvancesRenglon_CantidadContratada))\n \t\t\t.setText(String.valueOf(cantContratada));\n\n \t((TextView) getActivity()\n \t\t\t.findViewById(R.id.tv_fragAgregarAvancesRenglon_CantidadEjecutada))\n \t\t\t.setText(String.valueOf(CantEjecutada));\n\n \t((TextView) getActivity()\n \t\t\t.findViewById(R.id.tv_fragAgregarAvancesRenglon_PorcCantidadEjecutada))\n \t\t\t.setText( String.valueOf(PorcEjecutado) + \"%\");\n\n\n \ttvEtiquetaAgregarAvances.setText(getActivity().getString(R.string.fragment_agregar_avances_renglon_4));\n\n\t\tdesActividad.setText(\"[\" + activ.getCodigoInstitucional() + \"] - \" + activ.getDescripcion());\n \t\n\t\tif(tGestion == TipoGestion.Por_Cantidades){\n\t\t\t((TextView) getActivity()\n \t\t\t.findViewById(R.id.et_fragAgregarAvancesEtiquetaPorc))\n \t\t\t.setVisibility(0);\n \t}\n \telse{\n \t\t\n \t\t((TextView) getActivity()\n \t\t\t.findViewById(R.id.et_fragAgregarAvancesEtiquetaPorc))\n \t\t\t.setText(\"%\");\n\n \t}\n\n\t\t\n\t\t//Se deshabilitara el widget de ingreso del avance para cuando la cantidad\n\t\t//pendiente de ejecutar sea igual o menor a 0\n\t\t/*if (CantPendienteDeEjecutar>0){\n \t((TextView) getActivity()\n \t\t\t.findViewById(R.id.tv_fragAgregarAvancesRenglon_FechaActualizo))\n \t\t\t.setText(getActivity().getResources().getString(R.string.fragment_agregar_avances_renglon_2)\n \t\t\t\t\t+ \" \" + String.valueOf(activ.getFechaActualizacion()));\n \t}\n \telse\n \t{\n \t\tToast.makeText(getActivity(), getActivity().getString(R.string.fragment_agregar_avances_renglon_5), Toast.LENGTH_LONG).show();\n \t\tetNuevoAvance.setText(\"0.00\");\n \t\tetNuevoAvance.setEnabled(false);\n \t}*/\n \t\n \t((TextView) getActivity()\n \t\t\t.findViewById(R.id.tv_fragAgregarAvancesRenglon_CantidadPorEjecutar))\n \t\t\t.setText(String.valueOf(Utilitarios.round(CantPendienteDeEjecutar, 4)));\n \t((TextView) getActivity()\n \t\t\t.findViewById(R.id.tv_fragAgregarAvancesRenglon_PorcCantidadPorEjecutar))\n \t\t\t.setText(String.valueOf(Utilitarios.round(PorcPendienteDeEjecutar, 2)) + \"%\");\n\n\t\t((TextView) getActivity()\n\t\t\t\t.findViewById(R.id.tv_fragAgregarAvancesRenglon_CantidadExcedente))\n\t\t\t\t.setText(String.valueOf(Utilitarios.round(CantExcendete, 4)));\n\n\t\t((TextView) getActivity()\n\t\t\t\t.findViewById(R.id.tv_fragAgregarAvancesRenglon_PorcCantidadExcedente))\n\t\t\t\t.setText(String.valueOf(Utilitarios.round(PorcExcedente, 2)) + \"%\");\n\n\t\tvalidarAvance(String.valueOf(etNuevoAvance.getText()));\n \t\n \tetNuevoAvance.addTextChangedListener(new TextWatcher() {\n \t\t\n\t\t\t@Override\n\t\t\tpublic void beforeTextChanged(CharSequence s, int start,\n\t\t\t\t\tint count, int after) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void onTextChanged(CharSequence s, int start,\n\t\t\t\t\tint before, int count) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void afterTextChanged(Editable s) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tvalidarAvance(s.toString());\n\t\t\t\t\t\t\t\t\t\n\t\t\t}\n \t});\n\t\t\n\t}", "public void pierdeUnaVida() {\n numeroDeVidas--;\n }", "public void vincula(){\n for (Nodo n : exps)\n n.vincula();\n }", "public static void main(String[] args) {\n\n int longitud;\n int contador = 0;\n int valor;\n Scanner entrada = new Scanner(System.in);\n System.out.print(\"Ingrese la longitud del vector: \");\n longitud = entrada.nextInt();\n int numeros[] = new int [longitud];\n for ( int i = 0; i<numeros.length; i++ ) {\n System.out.print(\"Ingrese el valor \" + (i+1) + \": \");\n valor = entrada.nextInt();\n numeros[i] = valor;\n }\n\n System.out.println(\"Valores invertidos del vector\");\n for ( int i = numeros.length -1; i>=0; i-- ) {\n System.out.println(\"Posición \" + (i+1) + \": \" + numeros[i]);\n }\n }", "@Override\n\tpublic void devolucao(Livros livro) {\n\t\t\n\t}", "private void devolverSolicitud(HttpPresentationComms comms, int numeroSolicitud, String justificacion) throws HttpPresentationException, KeywordValueException {\n/* 127 */ VSolicitudesDAO rsVSol = new VSolicitudesDAO();\n/* 128 */ VSolicitudesDTO regSol = rsVSol.getSolicitud(numeroSolicitud);\n/* 129 */ rsVSol.close();\n/* */ \n/* 131 */ String sPagina = \"CambiarEstadoSolicitud.po?solicitud=\" + numeroSolicitud + \"&observacion=\" + justificacion + \"&nuevoestado=\" + regSol.getEstadoAnterior() + \"&devuelta=1\";\n/* */ \n/* */ \n/* */ \n/* 135 */ throw new ClientPageRedirectException(comms.request.getAppFileURIPath(sPagina));\n/* */ }", "public double darVelocidadMedia( )\n {\n return velocidadOrbitalMedia;\n }", "public Fund hentArtikel(String u) {\n\t\tp(\"hentArtikel(\"+u+\")\");\n\t\tString vUrl = \"\";\n\t\tArrayList <String> beskrivelser = new ArrayList<>();\n\n\n\t\ttry {\n\t\t\tInputStream is = new URL(\"http://m.tegnsprog.dk/artikler/\"+u+\".html\").openStream();\n\t\t\tis = new BufferedInputStream(is);\n\t\t\tis.mark(1);\n\t\t\tif (is.read() == 0xef) {\n\t\t\t\tis.read();\n\t\t\t\tis.read();\n\n\t\t\t} else {\n\t\t\t\tis.reset();\n\t\t\t}\n\t\t\tp(\"#=#=#=#=#=#=#=#= hentArtikel() =#=#=#=#=#=#=#=#=#=#=#\");\n\t\t\tbyte[] contents = new byte[1024];\n\t\t\tString heleIndholdet = \"\";\n\t\t\tint bytesRead = 0;\n\t\t\t//bytesRead = is.read(contents); //skipper første linie\n\t\t\t//bytesRead = is.read(contents); //skipper anden linie\n\n\t\t\twhile((bytesRead = is.read(contents)) != -1) {\n\t\t\t\tString linie = new String(contents, 0, bytesRead);\n\t\t\t\theleIndholdet += linie;\n\n\n\n\t\t\t}\n\t\t\t\n\t\t\t//p(\"\\nArtikel_______________________________: \"+heleIndholdet);\n\n\n\n\t\t\t//-- Vi finder video-urlen\n\n\t\t\tint startindeks = heleIndholdet.indexOf(\"src=\\\"\");\n\t\t\tString tempUrl = heleIndholdet.substring(startindeks+5);\n\t\t\tint slutIndeks= tempUrl.indexOf(\"\\\" type='video/mp4'>Your browser does not support the video tag.\");\n\t\t\tvUrl = tempUrl.substring(0,slutIndeks);\n\t\t\tp(\"videourl::::::::::::::::::::::::::::::::\"+vUrl);\n\n\t\t\tif (webm) {\n\t\t\t\tint underscore = vUrl.lastIndexOf(\"_\") + 1;\n\t\t\t\tint sidstepunktum = vUrl.lastIndexOf(\".\");\n\n\t\t\t\tString indeksnr = vUrl.substring(underscore, sidstepunktum);\n\t\t\t\tp(\"indeksnr: \" + indeksnr);\n\t\t\t\tvUrl = \"http://m.tegnsprog.dk/video/mobil/t-webm/t_\" + indeksnr + \".webm\";\n\t\t\t\tp(vUrl);\n\t\t\t}\n\n\n\n\t\t\t//-- Vi finder de danske ord\n\n\t\t\tstartindeks = tempUrl.indexOf(\"<TABLE>\");\n\t\t\tslutIndeks = tempUrl.indexOf(\"<TABLE width=\\\"100%\\\">\");\n\t\t\tString tabelDKOrd = tempUrl.substring(startindeks, slutIndeks);\n\t\t\t//p(\"__________min html:\");\n\t\t\t//p(tabelDKOrd);\n\t\t\t//p(\"----------\");\n\t\t\t//dKOrd = tabelDKOrd.replaceAll(\"\\\\/TR><TR\", \"</TR><BR><TR>\").replaceAll(\"\\\\&middot\\\\;\", \" , \");\n\t\t\tString dKOrd = tabelDKOrd\n\t\t\t\t\t.replaceAll(\"<TABLE>\", \"\")\n\t\t\t\t\t.replaceAll(\"</TD><TD>\", \" \")\n\t\t\t\t\t.replaceAll(\"\\\\&middot\\\\;\", \" , \")\n\t\t\t\t\t.replaceAll(\"<TABLE/>\", \"\")\n\t\t\t\t\t.replaceAll(\"</TABLE>\", \"\")\n\t\t\t\t\t.replaceAll(\"&nbsp;\", \"\")\n\t\t\t\t\t.replaceAll(\"<TR>\", \"\")\n\t\t\t\t\t.replaceAll(\"<TR style=\\\"vertical-align:top;\\\">\", \"\")\n\t\t\t\t\t.replaceAll(\"</TR>\", \"\")\n\t\t\t\t\t.replaceAll(\"</TD>\", \"ønskernylinie\")\n\t\t\t\t\t.replaceAll(\"<TD>\", \"\")\n\t\t\t\t\t.replaceAll(\"<BR>\",\"\\n\")\n\t\t\t\t.replaceAll(\"<BR/>\",\"\\n\");\n\n\t\t\t//Erstat html-koder for danske vokaler\n\t\t\t//æ: &aelig;\n\t\t\t//ø: &oslash;\n\t\t\t//å: &aring;\n\n\t\t\tdKOrd = dKOrd\n\t\t\t\t\t.replaceAll(\"&aelig;\", \"æ\")\n\t\t\t\t\t.replaceAll(\"&oslash;\", \"ø\")\n\t\t\t\t\t.replaceAll(\"&aring;\", \"å\");\n\n\n\n\n\n\t\t\tbeskrivelser = new ArrayList<String>(Arrays.asList(dKOrd.split(\"ønskernylinie\")));\n\n\n\t\t\tp(\"Efter rens\");\n\t\t\tp(beskrivelser.toString());\n\n\n\n/*\n\t\t\t<HTML>\n\t\t\t\t<video width=\"100%\" autoplay>\n\t\t\t \t\t<source src=\"http://www.tegnsprog.dk/video/t/t_317.mp4\" type='video/mp4'>\n\t\t\t \t\tYour browser does not support the video tag.\n\t\t\t \t</video>\n\t\t\t\t<TABLE>\n\t\t\t\t\t<TR style=\"vertical-align:top;\">\n\t\t\t\t\t\t<TD>1. </TD>\n\t\t\t\t\t\t<TD>brun</TD>\n\t\t\t\t\t</TR>\n\t\t\t\t\t<TR style=\"vertical-align:top;\">\n\t\t\t\t\t\t<TD>2. </TD>\n\t\t\t\t\t\t<TD>kaffe</TD>\n\t\t\t\t\t</TR>\n\t\t\t\t</TABLE>\n\t\t\t\t<TABLE width=\"100%\">\n\t\t\t\t\t<TR>\n\t\t\t\t\t\t<TD>\n\t\t\t\t\t\t\t<A TITLE=\"&Aring;bn den fulde ordbogsartikel i browseren\" href=\"#\" onclick=\"var ref = window.open('http://www.tegnsprog.dk/#|soeg|tegn|386', '_system');\">\n\t\t\t\t\t\t\t<IMG SRC=\"http://www.tegnsprog.dk/billeder/web/logo-mini.png\"/>\n\t\t\t\t\t\t\t\tVis p&aring; tegnsprog.dk</A></TD><TD style=\"text-align: right;\">\n\t\t\t\t\t\t\t<A TITLE=\"G&aring; til toppen\" href=\"#0\">\n\t\t\t\t\t\t\t\t&#8679;\n\t\t\t\t\t\t\t</A>\n\t\t\t\t\t\t</TD></TR></TABLE></HTML>\n\n\n\t\t\t\t\t\tANDEN VERSION______________________________\n\n\t\t\t\t<TABLE>\n\t\t\t\t\t<TR>\n\t\t\t\t\t\t<TD>\n\t\t\t\t\t\t\t&nbsp;\n\t\t\t\t\t\t</TD>\n\t\t\t\t\t\t<TD>\n\t\t\t\t\t\t\tforan &middot; forrest &middot; f&oslash;re &middot; komme f&oslash;rst\n\t\t\t\t\t\t</TD>\n\t\t\t\t\t</TR>\n\t\t\t\t</TABLE>\n\t\t\t\t<TABLE width=\"100%\"><TR><TD><A TITLE=\"&Aring;bn den fulde ordbogsartikel i browseren\" href=\"#\" onclick=\"var ref = window.open('http://www.tegnsprog.dk/#|soeg|tegn|1000', '_system');\"><IMG SRC=\"http://www.tegnsprog.dk/billeder/web/logo-mini.png\"/>Vis p&aring; tegnsprog.dk</A></TD><TD style=\"text-align: right;\"><A TITLE=\"G&aring; til toppen\" href=\"#0\">&#8679;</A></TD></TR></TABLE></HTML>\n\n*/\n\t\t} catch (Exception ex) {\n\t\t\tex.printStackTrace();\n\t\t\tp(ex);\n\t\t\tp(ex.getMessage());\n\t\t\tnulNetBeskedFraBraggrund();\n\n\t\t}\n\t\tp(\"hentArtikel færdig\");\n\t\treturn new Fund(Uri.parse(vUrl), beskrivelser);\n\t}", "public void desvincular() {\n\t\tList<Motorista> motoristas = new ArrayList<>();\n\t\tList<Veiculo> veiculos = new ArrayList<>();\n\t\ttry {\n\t\t\tveiculos = Deserializador.deserializar(\"conteudo/veiculos\", Veiculo.class);\n\t\t\tmotoristas = Deserializador.deserializar(\"conteudo/motoristas\", Motorista.class);\n\n\t\t\tScanner entrada = new Scanner(System.in);\n\t\t\tMotorista motorista = null;\n\t\t\tVeiculo veiculo = null;\n\t\t\tSystem.out.println(\"Digite o numero da CNH do motorista que deseja desvincular.\");\n\t\t\tint cnh = entrada.nextInt();\n\t\t\tif (motoristas != null) {\n\t\t\t\tif (veiculos != null) {\n\t\t\t\t\tfor (Motorista motor : motoristas) {\n\t\t\t\t\t\tif (cnh == motor.getNumero_Carteira()) {\n\t\t\t\t\t\t\tSystem.out.println(\"Motorista encontrado: \" + motor.getNome());\n\t\t\t\t\t\t\tmotorista = motor;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (motorista == null) {\n\t\t\t\t\t\tSystem.out.println(\"Motorista nao encontrado!\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfor (Veiculo veic : veiculos) {\n\t\t\t\t\t\t\tif (veic.getPlaca().equals(motorista.getVeiculo().getPlaca())) {\n\t\t\t\t\t\t\t\tSystem.out.println(\"Veiculo encontrado.\");\n\t\t\t\t\t\t\t\tveiculo = veic;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (motorista.getVeiculo() != null) {\n\t\t\t\t\t\t\tveiculo.setMotorista(null);\n\t\t\t\t\t\t\tmotorista.setVeiculo(null);\n\n\t\t\t\t\t\t\tSystem.out.println(\"Motorista desvinculado com sucesso.\");\n\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tSystem.out.println(\"Motorista nao esta vinculado a nenhum veiculo.\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(\"A lista de veiculos esta vazia.\");\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"A lista de motoristas esta vazia.\");\n\t\t\t}\n\n\t\t\tSerializador s = new Serializador();\n\t\t\ts.serializar(\"conteudo/motoristas\", motoristas);\n\t\t\ts.serializar(\"conteudo/veiculos\", veiculos);\n\t\t} catch (Exception ex) {\n\t\t\tSystem.err.println(\"Falha ao serializar ou deserializar! - \" + ex.toString());\n\t\t}\n\t}", "public void aplicarDescuento();", "public void provocarEvolucion(Tribu tribuJugador, Tribu tribuDerrotada){\r\n System.out.println(\"\\n\");\r\n System.out.println(\"-------------------Fase de evolución ----------------------\");\r\n int indiceAtributo;\r\n int indiceAtributo2;\r\n double golpeViejo = determinarGolpe(tribuJugador);\r\n for(int i = 1; i <= 10 ; i++){\r\n System.out.println(\"Iteración número: \" + i);\r\n indiceAtributo = (int)(Math.random() * 8);\r\n indiceAtributo2 = (int)(Math.random() * 8);\r\n String nombreAtributo1 = determinarNombrePosicion(indiceAtributo);\r\n String nombreAtributo2 = determinarNombrePosicion(indiceAtributo2);\r\n if((tribuJugador.getArray()[indiceAtributo] < tribuDerrotada.getArray()[indiceAtributo] \r\n && (tribuJugador.getArray()[indiceAtributo2] < tribuDerrotada.getArray()[indiceAtributo2]))){\r\n System.out.println(\"Se cambió el atributo \" + nombreAtributo1 + \" de la tribu del jugador porque\"\r\n + \" el valor era \" + tribuJugador.getArray()[indiceAtributo] + \" y el de la tribu enemeiga era de \"\r\n + tribuDerrotada.getArray()[indiceAtributo] + \" esto permite hacer más fuerte la tribu del jugador.\");\r\n \r\n tribuJugador.getArray()[indiceAtributo] = tribuDerrotada.getArray()[indiceAtributo];\r\n \r\n System.out.println(\"Se cambió el atributo \" + nombreAtributo2 + \" de la tribu del jugador porque\"\r\n + \" el valor era \" + tribuJugador.getArray()[indiceAtributo2] + \" y el de la tribu enemeiga era de \"\r\n + tribuDerrotada.getArray()[indiceAtributo2] + \" esto permite hacer más fuerte la tribu del jugador.\");\r\n \r\n tribuJugador.getArray()[indiceAtributo2] = tribuDerrotada.getArray()[indiceAtributo2];\r\n }\r\n }\r\n double golpeNuevo = determinarGolpe(tribuJugador);\r\n if(golpeNuevo > golpeViejo){\r\n tribus.replace(tribuJugador.getNombre(), determinarGolpe(tribuJugador));\r\n System.out.println(\"\\nTribu evolucionada\");\r\n imprimirAtributos(tribuJugador);\r\n System.out.println(\"\\n\");\r\n System.out.println(tribus);\r\n }\r\n else{\r\n System.out.println(\"\\nTribu sin evolucionar\");\r\n System.out.println(\"La tribu no evolucionó porque no se encontraron atributos\"\r\n + \" que permitiesen crecer su golpe\");\r\n imprimirAtributos(tribuJugador);\r\n System.out.println(\"\\n\");\r\n System.out.println(tribus);\r\n }\r\n }", "public String mostrarVentas() {\n String ventas = \"\";\n for (int i = 0; i < posicionActual; i++) { //Recorre el vector hasra la poscion actual, y almacena toda la informacion de estos en una variable String la cual se retornara \n ventas += mostrarCliente(i);\n }\n return ventas;\n }", "public void disparar(){}", "public static void main(String[] args) {\n\t\tVeturi veturi = Veturi.getInstance();\n\t\t\n\t\tveturi.junanPituus();\n\t\tveturi.lisaaVaunu(\"matkustajia\");\n\t\tveturi.lisaaVaunu(\"puuta\");\n\t\tveturi.junanPituus();\n\t\tveturi.junanSisalto();\n\t\t\n\t\tSystem.out.print(\"\\nuudelleen kutsuttuna getInstance() palauttaa saman veturin joka oli jo käytössä\");\n\t\tVeturi veturi2 = Veturi.getInstance();\n\t\tSystem.out.println(\"\");\n\t\tveturi2.junanSisalto();\n\t\t\n\t\tveturi.poistaVaunu(0);\t\n\t\tveturi2.junanSisalto();\n\t}", "public static void proveraServisa() {\n\t\tSystem.out.println(\"Unesite redni broj vozila za koje racunate vreme sledeceg servisa:\");\n\t\tUtillMethod.izlistavanjeVozila();\n\t\tint redniBroj = UtillMethod.unesiteInt();\n\t\tif (redniBroj < Main.getVozilaAll().size()) {\n\t\t\tif (!Main.getVozilaAll().get(redniBroj).isVozObrisano()) {\n\t\t\t\tUtillMethod.proveraServisaVozila(Main.getVozilaAll().get(redniBroj));\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"Ovo vozilo je obrisano i ne moze da se koristi!\");\n\t\t\t}\n\t\t} else {\n\t\t\tSystem.out.println(\"Uneli ste pogresan redni broj!\");\n\t\t}\n\t}", "public void preguntarDespegue(){\n String respuesta = this.mediador.preguntarDespegue(this);\n System.out.println(respuesta);\n if (respuesta==\"SI\"){\n this.setPosicion(1);\n this.indicarEstado(\"Preparando para el despegue\");\n }\n }", "public static void main(String[] args) {\n \n //Joueur zidane=new Joueur(\"zidane\",\"zinedine\",\"zizou\", \"12/07/1995\",\"marseille\",\"francais\",75.5f,1.82f, Sexe.HOMME,Pied.AMBIDEXTRE,Tenue.SHORT,34,Sponsor.FLY_EMIRATES);\n // Attaquant messi=new Attaquant(\"zidane\",\"zinedine\",\"zizou\", \"12/07/1995\",\"marseille\",\"francais\",75.5f,1.82f, Sexe.HOMME,Pied.AMBIDEXTRE,Tenue.SHORT,10,Sponsor.FLY_EMIRATES,PosteJoueur.DEFENSEUR);\n //Milieu xavi=new Milieu(\"xavi\",\"xava\",\"go\", \"12/07/1990\",\"barcelone\",\"espagnol\",78.5f,1.85f, Sexe.HOMME,Pied.DROIT,Tenue.JOGGING,15,Sponsor.FLY_EMIRATES,PosteJoueur.DEFENSEUR);\n //Defenseur ramos=new Defenseur(\"xavi\",\"ramos\",\"ifjiej\", \"18/07/1990\",\"madrid\",\"espagnol\",78.5f,1.88f, Sexe.HOMME,Pied.GAUCHE,Tenue.SHORT,15,Sponsor.FLY_EMIRATES,PosteJoueur.MILIEU);\n //ramos.celebrer();\n //ramos.defendre();\n //Gardien neuer=new Gardien(\"neuer\",\"manuel\",\"ifjiej\", \"18/07/1991\",\"Bayern\",\"bayern\",88.5f,1.95f, Sexe.HOMME,Pied.GAUCHE,Tenue.SHORT,15,Sponsor.FLY_EMIRATES);\n //neuer.sortir();\n //Spectateur paul=new Spectateur(\"bollart\",12,false,false);\n //Arbitre guillaume=new Arbitre(\"ovigneur\",\"guillaume\",\"guigou\",\"12/07/1676\",\"Lille\", \"France\", 1.98f,1.67f,Sexe.HOMME,Pied.DROIT,Tenue.SHORT,48,Sponsor.MORELLE);\n Equipe marseille= new Equipe (NomEquipe.OM);\n Equipe paris= new Equipe (NomEquipe.PSG);\n Match match=new Match(TypeTerrain.GAZON,marseille,paris);\n match.simulerMatch();\n System.out.println(match.equipeGagnante);\n System.out.println(marseille.attaquants[2].getStatTir());\n \n Tournoi tournoi = new Tournoi(); \n tournoi.qualificaionsTournoi();\n tournoi.huitiemes();\n tournoi.quarts();\n tournoi.demi();\n tournoi.finale();\n \n System.out.println(tournoi.getEquipeEnLis());\n System.out.println(tournoi.getEquipeQualifie());\n System.out.println(tournoi.getEquipePerdanteHuit());\n System.out.println(tournoi.getEquipeGagnanteHuit());\n System.out.println(tournoi.getEquipePerdanteQuarts());\n System.out.println(tournoi.getEquipeGagnanteQuarts());\n System.out.println(tournoi.getEquipePerdanteDemi());\n System.out.println(tournoi.getEquipeGagnanteDemi());\n System.out.println(tournoi.getEquipeFinale());\n\n \n \n //Mise en place de \"l'interface\"\n Scanner sc = new Scanner(System.in);\n \n //Choix du mode de jeu\n System.out.println(\"\\n *** Choix du mode de jeu *** \\n\\t| tournoi : taper 1|\\n\\t| mode solo : taper 2|\");\n int modeDeJeu = sc.nextInt();\n sc.nextLine(); //On vide la ligne\n \n //AJOUTER UNE EXCEPTION POUR LE MODE DE JEU\n \n \n \n //Choix de l'equipe a l'aide d'un scanner\n// System.out.println(\"Choisissez votre équipe :\");\n// NomEquipe equipe;\n// Equipe equipeChoisit = new Equipe(nomEquipe);\n \n\n\n /*Scanner sc = new Scanner(System.in);\n System.out.println(\"Voulez vous disputer un match ? Oui=1 ou NON=2 \");\n int i = sc.nextInt();\n System.out.println(\"Saisissez le numéro de l'equipe avec laquelle vous voulez Jouez \"\n + \"PSG :1\"\n + \"MARSEILLE:2 \");\n //On vide la ligne avant d'en lire une autre\n sc.nextLine();\n int equipe = sc.nextInt(); \n System.out.println(\"FIN ! \");\n \n switch(equipe) {\n case 1:\n Equipe paris= new Equipe (NomEquipe.PSG);\n System.out.println(paris.stade);\n break;\n case 2 :\n Equipe marseille= new Equipe (NomEquipe.OM);\n System.out.println(marseille.stade);\n \n }*/\n }", "public static void main(String [] agrs){\n\r\n\r\n Kaczka gumowa = new GumowaKaczka();\r\n gumowa.ustawKwakanieInterfejs(2);\r\n gumowa.ustawLatanieInterfejs(new SzybkieLatanie());\r\n gumowa.wyswietl();\r\n System.out.println(gumowa.kwacz());\r\n System.out.println(gumowa.lec());\r\n Kaczka dzika = new DzikaKaczka();\r\n // dzika.ustawLatanieInterfejs(1);\r\n dzika.wyswietl();\r\n System.out.println(dzika.lec());\r\n System.out.println(dzika.kwacz());\r\n\r\n\r\n// Polecenie[] polecenieWlacz;\r\n// Polecenie[] polecanieWylacz;\r\n// Polecenie polecenieWycofaj;\r\n//\r\n// polecanieWylacz = new Polecenie[7];\r\n// polecenieWlacz = new Polecenie[7];\r\n//\r\n// Swiatlo swiatlo = new Swiatlo();\r\n// polecanieWylacz[0] = new PolecenieWylaczSwiatlo(swiatlo);\r\n// polecenieWlacz[0] = new PolecenieWlaczSwiatlo(swiatlo);\r\n//\r\n//\r\n//\r\n//\r\n// polecenieWlacz[0].wykonaj();\r\n// polecanieWylacz[0].wykonaj();\r\n// polecenieWlacz[0].wykonaj();\r\n// polecenieWycofaj = polecanieWylacz[0];\r\n//// polecenieWycofaj = polecenieWlacz[0];\r\n// polecenieWycofaj.wykonaj();\r\n// polecenieWycofaj.wykonaj();\r\n//// polecenieWycofaj.wycofaj();\r\n//\r\n// WiezaStereo wiezaStereo = new WiezaStereo();\r\n//\r\n// polecenieWlacz[1] = new PolecenieWiezaStereoWlaczCD(wiezaStereo);\r\n//\r\n// polecenieWlacz[1].wykonaj();\r\n\r\n\r\n\r\n }", "public void mostraDevolucao(List<Devolucao> lista) {\n System.out.println(\"--------------------------------------\\n\");\n System.out.println(String.format(\"%-10s\", \"ID\") + \"\\t\"\n + String.format(\"%-40s\", \"|LIVRO\") + \"\\t\"\n + String.format(\"%-20s\", \"|DISP\") + \"\\t\"\n + String.format(\"%-20s\", \"|CLIENTE\") + \"\\t\"\n + String.format(\"%-20s\", \"|RETIRADA\") + \"\\t\"\n + String.format(\"%-20s\", \"|ENTREGA\") + \"\\t\"\n + String.format(\"%-20s\", \"|DEVOLVIDO\")\n );\n for (Devolucao dev : lista) {\n String disponivel = dev.getRetirada().getLivroDevolvido() ? \"Sim\" : \"Não\";\n System.out.println(String.format(\"%-10s\", dev.getId()) + \"\\t\"\n + String.format(\"%-40s\", \"|\" + dev.getRetirada().getLivro().getNome()) + \"\\t\"\n + String.format(\"%-20s\", \"|\" + disponivel) + \"\\t\"\n + String.format(\"%-20s\", \"|\" + dev.getRetirada().getCliente().getNome()) + \"\\t\"\n + String.format(\"%-20s\", \"|\" + dev.getRetirada().getRetiradaFormatada()) + \"\\t\"\n + String.format(\"%-20s\", \"|\" + dev.getRetirada().getEntregaFormatada()) + \"\\t\"\n + String.format(\"%-20s\", \"|\" + dev.getRetirada().getDevolvidoFormatada())\n );\n }\n }", "public void mostrarDetalle(String texto) {\n\t\n\t\tif((texto.equals(\"0\"))||(texto.equals(\"-1\"))){// si ya no hay elementos u ordenes o si solamente borro una orden pero todavía hay más en espera\n\t\t\tlistas.CreaListadePlatillos(texto);\n\t\t\tDetalleOrden Noelementos=new DetalleOrden();\n\t\t\tNoelementos.setmKeyOrden(\"0\");\n\t\t\tNoelementos.setmCantidad(\"\");\n\t\t\tNoelementos.setmKeyOrden(\"\");\n\t\t\tNoelementos.setmKeyPlatillo(\"\");\n\t\t\tNoelementos.setmNombrePlatillo(\"No hay más Ordenes\");\n\t\t\tNoelementos.setmNotaEspecial(\"\");\n\t\t\tNoelementos.setmNotaPromocion(\"\");\n\n\t\t\tif(texto.equals(\"0\")){ // si ya no hay elementos u ordenes\n\t\t\t\tdatos=new ArrayList<DetalleOrden>();\n\t\t datos.add(Noelementos);\n\t\t\t}\n\t\t\tif(texto.equals(\"-1\")){//si solamente borro una orden pero todavía hay más en espera\n\t\t\t\tdatos=new ArrayList<DetalleOrden>();\n\t\t\t}\n\t\t\t\n\t\t\n\t //txtDetalle.setText(texto);\n\t\t\tListaPlatillos = (ListView)getView().findViewById(R.id.Listado_Platillos); //Listado_Platillos es en el fragment_listado y hace referencia a ListaOrdenes\n\t\t\t\n\t\t\t// Al adapter personalizado le pasamos el contexto y la lista que contiene\t\n\t AdaptadorListaPlatillos adapter=new AdaptadorListaPlatillos(this,datos);\n\t // Añadimos el adapter al listview\n\t ListaPlatillos.setAdapter(adapter);//se ejecuta el montaje final ya con los datoss\n\t\t}\n\t\telse{\n\t\t\t\n\t\t\tlistas.CreaListadePlatillos(texto);\n\t datos=listas.getListaconPlatillos();\n\t\t\n\t //txtDetalle.setText(texto);\n\t\t\tListaPlatillos = (ListView)getView().findViewById(R.id.Listado_Platillos); //Listado_Platillos es en el fragment_listado y hace referencia a ListaOrdenes\n\t\t\t\n\t\t\t// Al adapter personalizado le pasamos el contexto y la lista que contiene\t\n\t AdaptadorListaPlatillos adapter=new AdaptadorListaPlatillos(this,datos);\n\t // Añadimos el adapter al listview\n\t ListaPlatillos.setAdapter(adapter);//se ejecuta el montaje final ya con los datoss\n\t\t}\n }", "public static void main(String[] args) throws Exception {\n float p = (float) 1.2;\n int numero = 4;\n DigraphAM grafo = leerArchivo(numero, p);\n // grafo.printCodeForGraphViz();\n /*\n * LinkedList<LinkedList<Integer>> l = new LinkedList<>(); LinkedList<Integer>\n * l1 = new LinkedList<>();// organizarDistancias(grafo); permutaciones(grafo,\n * 3, l1, l, 3, 0, grafo.getWeight(3, 0) * p); System.out.println(l);\n * System.out.println(\"1\" + organizarDistancias(grafo));\n * System.out.println(laPermutacionMasLarga(l));\n */\n\n System.out.println(asignarVehiculos(grafo, (float)1.7));\n }", "public static void main(String[] args) {\n System.out.println(\"Test de la partie 1:\");\n System.out.println(\"--------------------\");\n\n Position position1 = new Position(0, 1);\n Position position2 = new Position(1, 0);\n Position position3 = new Position(1, 1);\n\n Neurone neuron1 = new Neurone(position1, 0.5);\n Neurone neuron2 = new Neurone(position2, 1.0);\n Neurone neuron3 = new Neurone(position3, 2.0);\n\n neuron1.connexion(neuron2);\n neuron2.connexion(neuron3);\n neuron1.recoitStimulus(10);\n\n System.out.println(\"Signaux : \");\n System.out.println(neuron1.getSignal());\n System.out.println(neuron2.getSignal());\n System.out.println(neuron3.getSignal());\n\n System.out.println();\n System.out.println(\"Premiere connexion du neurone 1\");\n System.out.println(neuron1.getConnexion(0));\n\n\n // FIN TEST DE LA PARTIE 1\n\n // TEST DE LA PARTIE 2\n System.out.println(\"Test de la partie 2:\");\n System.out.println(\"--------------------\");\n\n Position position5 = new Position(0, 0);\n NeuroneCumulatif neuron5 = new NeuroneCumulatif(position5, 0.5);\n neuron5.recoitStimulus(10);\n neuron5.recoitStimulus(10);\n System.out.println(\"Signal du neurone cumulatif -> \" + neuron5.getSignal());\n\n // FIN TEST DE LA PARTIE 2\n\n // TEST DE LA PARTIE 3\n System.out.println();\n System.out.println(\"Test de la partie 3:\");\n System.out.println(\"--------------------\");\n Cerveau cerveau = new Cerveau();\n\n // parametres de construction du neurone:\n // la position et le facteur d'attenuation\n cerveau.ajouterNeurone(new Position(0,0), 0.5);\n cerveau.ajouterNeurone(new Position(0,1), 0.2);\n cerveau.ajouterNeurone(new Position(1,0), 1.0);\n\n // parametres de construction du neurone cumulatif:\n // la position et le facteur d'attenuation\n cerveau.ajouterNeuroneCumulatif(new Position(1,1), 0.8);\n cerveau.creerConnexions();\n cerveau.stimuler(0, 10);\n\n System.out.println(\"Signal du 3eme neurone -> \" + cerveau.sonder(3));\n System.out.println(cerveau);\n // FIN TEST DE LA PARTIE 3\n }", "@Override\n public synchronized void demarrer(){\n if(modele.getQuiterJeu()){return;}\n modele.getMoteurJeu().setEtapeJeu(this);\n // apercu dans le termial pour debuger\n System.out.println(\"-----------------nom joueur: \"+modele.getJoueurCourant().getNom());\n System.out.print(\" humain: \"+modele.getJoueurCourant().estHumain());\n System.out.print(\" stand: \"+modele.getJoueurCourant().getMainCourant().getStand());\n System.out.print(\" perdu: \"+modele.getJoueurCourant().getMainCourant().estPerdu());\n System.out.print(\" blackjack: \"+modele.getJoueurCourant().getMainCourant().estBlackJack());\n System.out.println(\" jeu: \"+modele.getJoueurCourant().getMainCourant().getJeu().toString());\n //-------------------------------------------------\n // On ne fait pas une boucle ici pour que l'observer\n // puisse acceder a son observé et se mettre a jour\n //-------------------------------------------------\n new Thread(){\n @Override\n public void run() {\n try {\n // si plus de carte\n if(modele.getPioche().getCartes().size() < 1){\n for(Carte carte:modele.getDefausse().getCartes()){\n carte.setFaceCarte(Face.VERSO);\n modele.getPioche().ajouterDessous(carte);\n }\n modele.getDefausse().vider();\n modele.getPioche().melanger();\n }\n \n \n // si il peut plus jouer\n if(modele.getJoueurCourant().getMainCourant().estBlackJack() || modele.getJoueurCourant().getMainCourant().estPerdu() \n || modele.getJoueurCourant().getMainCourant().getStand() || modele.getJoueurCourant().getMainCourant().est21()\n || modele.getJoueurCourant().getMainCourant().getAAbandonner() || modele.getJoueurCourant().getAPerduJeu()){\n \n // si le joueur a une autre main\n if(modele.getJoueurCourant().mainSuivant()){\n Thread.sleep(2000);\n demarrer();\n \n }\n // sinon si il y a un joueur suivant on fait joueur suivant\n else if(modele.joueurSuivant()){\n Thread.sleep(2000);\n demarrer();\n }else{\n modele.getMoteurJeu().setEtapeJeu(etapeSuivant);\n Thread.sleep(2000);\n modele.setMessage(modele.getCroupier().getNom()+\" plays\");\n // on affiche les carte du croupier\n for(Carte carte: modele.getCroupier().getMainCourant().getJeu().getCartes()){\n carte.setFaceCarte(Face.RECTO);\n }\n System.out.println(\"+++++++++++++++++++++++++++++++++++++++++++++++++\");\n Thread.sleep(3000);\n demarrerEtapeSuivant();\n\n }\n\n }\n // sinon\n else{\n modele.setMessage(modele.getJoueurCourant().getNom()+\" plays\");\n if(!modele.getJoueurCourant().estHumain()){\n modele.getJoueurCourant().jouer(modele.getPioche(),modele.getDefausse());\n Thread.sleep(3000);\n demarrer();\n }\n \n\n }\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }\n }.start();\n \n }", "private void cazaFantasma(Vertice<T> v){\n\tif(v.padre == null){\n\t if(v == this.raiz){\n\t\tthis.raiz = null;\n\t\treturn;\n\t }\n\t return;\n\t}else{\n\t Vertice<T> padre = v.padre;\n\t if(v == padre.izquierdo){\n\t\tif(v.hayIzquierdo()){\n\t\t padre.izquierdo = v.izquierdo;\n\t\t v.izquierdo.padre = padre;\n\t\t}else if(v.hayDerecho()){\n\t\t padre.izquierdo = v.derecho;\n\t\t v.derecho.padre = padre;\n\t\t}else{\n\t\t padre.izquierdo = null;\n\t\t}\t\t\n\t }else{\n\t\tif(v.hayIzquierdo()){\n\t\t padre.derecho = v.izquierdo;\n\t\t v.izquierdo.padre = padre;\n\t\t}else if(v.hayDerecho()){\n\t\t padre.derecho = v.derecho;\n\t\t v.derecho.padre = padre;\n\t\t}else{\n\t\t padre.derecho = null;\n\t\t}\n\t }\n\t}\n }", "@Override\n public void runOpMode() {\n leftDrive = hardwareMap.get(DcMotor.class, \"left_drive\");\n rightDrive = hardwareMap.get(DcMotor.class, \"right_drive\");\n intake = hardwareMap.get (DcMotor.class, \"intake\");\n dropServo = hardwareMap.get(Servo.class, \"drop_Servo\");\n leftDrive.setDirection(DcMotor.Direction.REVERSE);\n rightDrive.setDirection(DcMotor.Direction.FORWARD);\n\n dropServo.setPosition(1.0);\n waitForStart();\n dropServo.setPosition(0.6);\n sleep(500);\n VuforiaOrientator();\n encoderSequence(\"dumbDrive\");\n\n\n }", "public FaseDescartes faseJuego();", "public void testOctaedre() {\n\t\t\t\n\t\t\tSolide i = Octaedre.octaedre();\n\t\t\t\n\t\t\t/* creation de points qui ont les memes coordonnees que ceux qui \n\t\t\t * constituent notre solide (car octaedre() n'a pas de parametres)\n\t\t\t */\n\t\t\t\n\t\t\tPoint p1 = new Point(-25, 0,-25);\n\t\t\tPoint p2 = new Point(-25, 0,25);\n\t\t\tPoint p3 = new Point(25, 0,-25);\n\t\t\tPoint p4 = new Point(25,0,25);\n\t\t\tfloat hauteur = (float) (50/Math.sqrt(2));\n\t\t\t// on se sert de la hauteur pour donnee les coordonees des sommets manquant\n\t\t\tPoint p5 = new Point(0, hauteur,0);\n\t\t\tPoint p6 = new Point(0,-hauteur,0);\n\t\t\t\n\t\t\t//On teste si les points de l'octaedre i sont bien les memes que ceux créés\n\t\t\t\n\t\t\tassertTrue(i.getPoint().get(4).getAbscisse()==(p1.getAbscisse()));\n\t\t\tassertTrue(i.getPoint().get(1).getAbscisse()==(p2.getAbscisse()));\n\t\t\tassertTrue(i.getPoint().get(5).getAbscisse()==(p3.getAbscisse()));\n\t\t\tassertTrue(i.getPoint().get(3).getAbscisse()==(p4.getAbscisse()));\n\t\t\tassertTrue(i.getPoint().get(2).getAbscisse()==(p5.getAbscisse()));\n\t\t\tassertTrue(i.getPoint().get(0).getAbscisse()==(p6.getAbscisse()));\n\t\t\t\n\t\t\tassertTrue(i.getPoint().get(4).getOrdonnee()==(p1.getOrdonnee()));\n\t\t\tassertTrue(i.getPoint().get(1).getOrdonnee()==(p2.getOrdonnee()));\n\t\t\tassertTrue(i.getPoint().get(5).getOrdonnee()==(p3.getOrdonnee()));\n\t\t\tassertTrue(i.getPoint().get(3).getOrdonnee()==(p4.getOrdonnee()));\n\t\t\tassertTrue(i.getPoint().get(2).getOrdonnee()==(p5.getOrdonnee()));\n\t\t\tassertTrue(i.getPoint().get(0).getOrdonnee()==(p6.getOrdonnee()));\n\t\t\t\n\t\t\tassertTrue(i.getPoint().get(4).getProfondeur()==(p1.getProfondeur()));\n\t\t\tassertTrue(i.getPoint().get(1).getProfondeur()==(p2.getProfondeur()));\n\t\t\tassertTrue(i.getPoint().get(5).getProfondeur()==(p3.getProfondeur()));\n\t\t\tassertTrue(i.getPoint().get(3).getProfondeur()==(p4.getProfondeur()));\n\t\t\tassertTrue(i.getPoint().get(2).getProfondeur()==(p5.getProfondeur()));\n\t\t\tassertTrue(i.getPoint().get(0).getProfondeur()==(p6.getProfondeur()));\n\t\t\t\n\t\t\t//On teste si les faces de l'octaedre contiennent bien les points créés\n\t\t\t\n\t\t\tassertTrue(i.getFaces().get(0).contient(p1));\n\t\t\tassertTrue(i.getFaces().get(0).contient(p2));\n\t\t\tassertTrue(i.getFaces().get(0).contient(p5));\n\t\t\t\n\t\t\tassertTrue(i.getFaces().get(1).contient(p1));\n\t\t\tassertTrue(i.getFaces().get(1).contient(p2));\n\t\t\tassertTrue(i.getFaces().get(1).contient(p6));\n\t\t\t\n\t\t\tassertTrue(i.getFaces().get(2).contient(p1));\n\t\t\tassertTrue(i.getFaces().get(2).contient(p3));\n\t\t\tassertTrue(i.getFaces().get(2).contient(p5));\n\t\t\t\n\t\t\tassertTrue(i.getFaces().get(3).contient(p1));\n\t\t\tassertTrue(i.getFaces().get(3).contient(p3));\n\t\t\tassertTrue(i.getFaces().get(3).contient(p6));\n\t\t\n\t\t\tassertTrue(i.getFaces().get(4).contient(p3));\n\t\t\tassertTrue(i.getFaces().get(4).contient(p4));\n\t\t\tassertTrue(i.getFaces().get(4).contient(p5));\n\t\t\t\n\t\t\tassertTrue(i.getFaces().get(5).contient(p3));\n\t\t\tassertTrue(i.getFaces().get(5).contient(p4));\n\t\t\tassertTrue(i.getFaces().get(5).contient(p6));\n\t\t\t\n\t\t\tassertTrue(i.getFaces().get(6).contient(p2));\n\t\t\tassertTrue(i.getFaces().get(6).contient(p4));\n\t\t\tassertTrue(i.getFaces().get(6).contient(p5));\n\t\t\t\n\t\t\tassertTrue(i.getFaces().get(7).contient(p2));\n\t\t\tassertTrue(i.getFaces().get(7).contient(p4));\n\t\t\tassertTrue(i.getFaces().get(7).contient(p6));\n\t\t\t\n\t\t\t\n\t\t\t\n\t}", "@Override\r\n\tprotected void initVentajas() {\n\r\n\t}", "public void decida(){\r\n int f=this.getFila();\r\n int c=this.getColumna();\r\n int cont=alRededor(f,c);\r\n if(this.isVivo()){\r\n if(cont==2 || cont==3){\r\n estadoSiguiente=VIVA;\r\n }else/* if(cont==1 || cont>3)*/{\r\n estadoSiguiente=MUERTA;\r\n }\r\n }else{\r\n if(cont==3){\r\n estadoSiguiente=VIVA;\r\n }else if(cont==1 || cont>3){\r\n estadoSiguiente=MUERTA;\r\n }\r\n }\r\n }", "public static void main(String[] args) {\r\n\r\n System.out.println(\"\\n INICIANDO SISTEMA\");\r\n \r\n Vendas venda = new Vendas();\r\n Projeto projeto = new Projeto();\r\n Producao producao = new Producao();\r\n Rh rh = new Rh();\r\n Cliente cliente = new Cliente();\r\n ItensPedido itens = new ItensPedido();\r\n Pedido pedido = new Pedido(0,cliente,itens);\r\n int controle =0;\r\n \r\n while (controle ==0){\r\n int decisao = 1;\r\n System.out.println(\" Para realizar vendas digite 1 e 2 para sair do sistema:\");\r\n Scanner teclado = new Scanner(System.in);\r\n decisao = teclado.nextInt();\r\n switch (decisao){\r\n case 1:\r\n // TODO code application logic here\r\n \r\n \r\n System.out.println(\" ABRINDO VENDA\\n \");\r\n \r\n \r\n \r\n rh.liberarFuncionarios(producao.contruir(rh.verificaFuncionario(producao.adicionaProjeto(projeto.recebePedido(venda.fazerVenda(pedido))))));\r\n \r\n // aloca recursos no estoque e finaliza com a liberacao do financeiro\r\n\r\n //compara se ja existe um projeto existente\r\n \r\n \r\n\r\n //chamadada estoque \r\n \r\n \r\n // realizar o teste no setor de teste no projeto\r\n Teste teste = new Teste();\r\n if (teste.realizarTeste()== true){\r\n // libera os funcionarios para modo de espera \r\n\r\n //rh.liberarFuncionarios(listaprojeto.get(entrada));\r\n }\r\n \r\n System.out.println(\" \");\r\n System.out.println(\"************ ENCERRADA VENDA ************\");\r\n \r\n break;\r\n case 2:\r\n controle = 1;\r\n break;\r\n default:\r\n System.out.println(\"OPCAO INVALIDA \\n\");\r\n }}\r\n }", "public String getvDesregpen() {\n return vDesregpen;\n }", "public void despegar(){\n if(this.posicion == 1){\n this.setPosicion(2);\n this.indicarEstado(\"Volando\");\n } else{\n System.out.println(\"No estoy preparado para el despegue\");\n }\n }", "public void getVentasdeUNVendedor(int v) {\r\n double vVendedor[] = new double[nm];\r\n int j;\r\n for (j = 0; j < nm; j++) {\r\n vVendedor[j] = ventas[v][j];\r\n }\r\n getMostrarVec(vVendedor);\r\n }", "private void limpiarDatos() {\n\t\t\n\t}", "@Override\n public void affiche(){\n System.out.println(\"Loup : \\n points de vie : \"+this.ptVie+\"\\n pourcentage d'attaque : \"+this.pourcentageAtt+\n \"\\n dégâts d'attaque : \"+this.degAtt+\"\\n pourcentage de parade :\"+this.pourcentagePar+\n \"\\n position : \"+this.pos.toString());\n\n }", "static public void verificaParametros()\r\n \r\n {\r\n SynthesizerModeDesc synthesizerModeDescTemp = (SynthesizerModeDesc)synthesizer.getEngineModeDesc();\r\n System.out.println(\"Nome do engine utilizado: \"+synthesizerModeDescTemp.getEngineName());\r\n System.out.println(\"Nome do modo de funcionamento utilizado: \"+synthesizerModeDescTemp.getModeName());\r\n \tSystem.out.println(\"Nome da localidade utilizada: \"+synthesizerModeDescTemp.getLocale().toString());\r\n \t\t//verifica a flag de controle\r\n if(synthesizerModeDescTemp.getRunning()!=null)\r\n if(synthesizerModeDescTemp.getRunning().booleanValue())\r\n System.out.println(\"Engine rodando.\");\r\n else\r\n System.out.println(\"Engine parado.\");\r\n else\r\n System.out.println(\"A flag de controle não foi setada e tem valor nulo.\");\r\n \t\t//mostra as vozes suportadas\r\n Voice[] VoiceTemp = synthesizerModeDescTemp.getVoices();\r\n for(int i=0;i<VoiceTemp.length;i++)\r\n {\r\n System.out.println(\"Voz numero \"+(i+1)+\" : \"+VoiceTemp[i].getName());\r\n }\r\n }", "public static void main(String[] args) {\n int[] vet = new int[5];\n \n populaVet(vet);\n \n for (int i = 0; i < vet.length; i++) {\n System.out.print(vet[i] + \" \"); \n }\n }", "public static void main(String[] args) {\n\t\t\r\n\t\tVozac v1 = new Vozac(\"Petar Petrovic\", \"vozac\");\r\n\t\tVozac v2 = new Vozac(\"Marko Markovic\", \"visi vozac\");\r\n\t\t\r\n\t\tPutnik p1 = new Putnik(\"Mara Maric\", 1000);\r\n\t\tPutnik p2 = new Putnik(\"Zora Zoric\", 1520);\r\n\t\tPutnik p3 = new Putnik(\"Rade Radic\", 854);\r\n\t\tPutnik p4 = new Putnik(\"Mile Milic\", 3150);\r\n\t\tPutnik p5 = new Putnik(\"Joka Jokic\", 2100);\r\n\t\t\r\n\t\tAutobus a1 = new Autobus(\"Novi Sad - Beograd\", 700);\r\n\t\t\r\n\t\ta1.postaviVozaca(v1);\r\n\t\ta1.dodajPutnika(p1);\r\n\t\ta1.dodajPutnika(p2);\r\n\t\ta1.dodajPutnika(p3);\r\n\t\ta1.dodajPutnika(p4);\r\n\t\ta1.dodajPutnika(p5);\r\n\t\t\r\n\t\tSystem.out.println(\"Autobus na relaciji: \" + a1.getNaziv() + \" vozi \" + a1.getVozac().getImeIPrezime() + \", a cena karte je: \" + a1.getCenaKarte() + \" dinara\");\r\n\t\tSystem.out.println(\"\");\r\n\t\tSystem.out.println(\"Lista putnika koju putuju autobusom: \");\r\n\t\tfor (int i = 0; i < a1.getListaPutnika().size(); i++) {\r\n\t\t\ta1.getListaPutnika().get(i).oduzmiNovac(a1.getCenaKarte());\r\n\t\t\tSystem.out.println(a1.getListaPutnika().get(i).getImeIPrezime() + \", a preostala svota novca je \" + a1.getListaPutnika().get(i).getSvotaNovca());\t\t\t\t\t\t\t\t\r\n\t\t}\r\n\t\t\r\n\r\n\t}", "private void hienThiDichVu() {\n DichVuService dichVuService = new DichVuService();\n dichVuModels = dichVuService.layToanBoDichVu();\n \n modelDichVu.setRowCount(0);\n if (dichVuModels != null){\n for (DichVuModel dichVuModel : dichVuModels) {\n Vector vtRow = new Vector();\n vtRow.add(dichVuModel.getMaDV());\n vtRow.add(dichVuModel.getTenDV());\n modelDichVu.addRow(vtRow);\n }\n }else{\n return;\n }\n }", "private void skrivOversikt() {\n System.out.println(\"\\n- Leger -\\n\");\n for (Lege lege : leger){\n System.out.println(lege);\n }\n\n System.out.println(\"\\n- Pasienter -\");\n for (Pasient pasient : pasienter){\n System.out.println(\"\\n\" + pasient);\n }\n\n System.out.println(\"\\n- Legemidler -\");\n for (Legemiddel legemiddel : legemidler){\n System.out.println(\"\\n\" + legemiddel);\n }\n\n System.out.println(\"\\n- Resepter -\");\n for (Resept resept : resepter){\n System.out.println(\"\\n\" + resept);\n }\n }", "public void mostrarVagon() {\n\t\tSystem.out.println(\"Estado actual del vagon\");\n\t\tfor (int i = 0; i < getNumeroAsientosFila(); i++) {\n\t\t\tfor (int j = 0; j < getNumeroAsientosColumna(); j++) {\n\t\t\t\tSystem.out.print(vagonVacio[i][j]);\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "public void run() {\n\n\t// DecimalFormat df = new DecimalFormat(\"#.###\");\n\tint frecuencia = 0;\n\n\twhile (true) {\n\n\t if (rearmarAne) {\n\t\tlogger.warn(\"Termino el hilo de Anemometro porque se ha rearmado Irrisoft\");\n\t\treturn;\n\t }\n\t tiempoini = (System.nanoTime());\n\t // Cojo los datos a enviar por el puerto serie.\n\t churro = datosInicio();\n\n\t // Duermo el tiempo requerido\n\t logger.info(\"La freceuncia de lectura de Anemometro es: \"\n\t\t + sens.getFrec_lect());\n\n\t // Duermo el sensor el un tiempo, para recibir otra lectura.\n\t dormirSensor();\n\n\t try {\n\t\tserialcon.cogesemaforo(sens.getNum_placa());\n\t\t// Purgo el puerto\n\t\tserialcon.serialPort.purgePort(SerialPort.PURGE_RXCLEAR\n\t\t\t| SerialPort.PURGE_TXCLEAR);\n\n\t\tif (serialcon.serialPort.writeBytes(churro)) {\n\n\t\t if (logger.isInfoEnabled()) {\n\t\t\tlogger.info(\"Comando mandado al puerto serie !\"\n\t\t\t\t+ Arrays.toString(churro));\n\t\t }\n\t\t} else {\n\t\t if (logger.isErrorEnabled()) {\n\t\t\tlogger.error(\"Fallo en mandar comando al puerto serie! \"\n\t\t\t\t+ Arrays.toString(churro));\n\t\t }\n\t\t // RECONECTO\n\t\t // serialcon.purga_puerto(sens.getNum_placa(),\n\t\t // serialcon.serialPort.getPortName());\n\t\t}\n\n\t\t// Leo la respuesta\n\t\tbufferResp = serialcon.serialPort.readBytes(6, 4000);\n\t\t//Trato las lecturas para tener el dato.\n\t\tlectura = sacarLecturas(bufferResp);\n\t\t\n\t\t// Escribo en el panel la lectura\n\t\t// ponelecturas(sens);\n\n\t\t// Irrisoft.window.panelecturasens.getLblectane().setText(medicion+\" pulsos , velocidad \"+velocidad+\n\t\t// \" m/s\");\n\t\tfrecuencia = (int) (frecuencia + ((System.nanoTime() - tiempoini) / Math\n\t\t\t.pow(10, 9)));\n\t\tif (logger.isWarnEnabled()) {\n\t\t logger.warn(\"Tiempo pasado bucle hiloAnemometro: \"\n\t\t\t + frecuencia);\n\t\t}\n\n\t\t// Insertar registro en la pasarela\n\t\tif (frecuencia >= sens.getFrec_env()) {\n\t\t // Creo la lectura para enviar a GIS.\n\t\t LecturasSensor lecturaFinal = cogerLectura(lectura);\n\t\t // Envio la lectura a GIS.\n\t\t enviarLecturasGIS(lecturaFinal);\n\n\t\t frecuencia = 0;\n\t\t}\n\n\t } catch (SerialPortTimeoutException | SerialPortException e) {\n\t\tif (logger.isErrorEnabled()) {\n\t\t if (e instanceof SerialPortTimeoutException)\n\t\t\tlogger.error(\"TIMEOUUUUUT en la lectura del buffer serie: \"\n\t\t\t\t+ e.getMessage());\n\t\t else if (e instanceof SerialPortException)\n\t\t\tlogger.error(e.getMessage());\n\t\t}\n\t\tserialcon.sueltasemaforo(sens.getNum_placa());\n\t }\n\t serialcon.sueltasemaforo(sens.getNum_placa());\n\t}\n\n }", "public void somaVezes(){\n qtVezes++;\n }", "public void init() {\n\n\n verdiend = 133;\n\n verdeling = verdiend / 4;\n }", "public static void main(String[] args) throws ArgumentInvalideException, PartieFinieException {\n if(args.length == 1) {\n if(args[0].equals(\"-tests\")) {\n System.out.println(\"Lancement des tests\");\n PrincipaleTests.lancerTests();\n if(PrincipaleTests.succes_tests)\n System.out.println(\"\\nTous les tests se sont bien passés.\");\n return;\n } else {\n System.out.println(\"option '\"+args[0]+\"' inconnue\");\n return;\n }\n }\n\n Partie p= null;\n Scanner scan = new Scanner(System.in);\n System.out.println(\"Voulez-vous reprendre votre sauvegarde ? (O/N)\");\n String reponse = scan.nextLine();\n\n if (reponse.toUpperCase().equals(\"O\")) {\n try {\n p = Sauvegarde.recuperer(\"Sauvegarde.txt\");\n } catch (FileNotFoundException e) {\n System.out.println(\"Le fichier de lecture n'existe pas \");\n } catch (ClassNotFoundException e) {\n System.out.println(\"Impossible de convertir la sauvegarde\");\n } catch (IOException e) {\n System.out.println(\"Probleme lors de la lecture\");\n }\n }\n\n if(p == null) { // Si on veut creer un partie ou si on a pas pu récupérer la sauvegarde\n System.out.println(\"\\nCréation de la partie\");\n int nb_colonnes, nb_joueurs, nb_ordinateurs;\n // Grille\n System.out.println(\"Grille :\\nCombien de colonnes ?\");\n nb_colonnes = demanderEntier(1, 50);\n\n // Joueurs\n System.out.println(\"Combien y a-t-il de joueurs ?\");\n nb_joueurs = demanderEntier(0, null);\n System.out.println(\"Combien y a-t-il d'ordinateurs ?\");\n nb_ordinateurs = demanderEntier(0, nb_joueurs);\n\n Joueur[] joueurs = new Joueur[nb_joueurs];\n\n for(int i=0; i<nb_joueurs-nb_ordinateurs; i++)\n joueurs[i] = new JoueurReel();\n\n for(int i=nb_joueurs-nb_ordinateurs; i<nb_joueurs; i++)\n joueurs[i] = new JoueurOrdinateur();\n\n p=new Partie(new Grille(nb_colonnes), joueurs);\n\n }\n // On lance la partie\n int nb_colonnes;\n boolean nouvelle_partie = false; // S'il faut creer une\n reponse = \"O\";\n while(reponse.toUpperCase().equals(\"O\")){\n if(nouvelle_partie) {\n System.out.println(\"Grille :\\nCombien de colonnes ?\");\n nb_colonnes = demanderEntier(1, 50);\n p.rejouer(nb_colonnes);\n } else {\n nouvelle_partie = true;\n }\n\n if(lancerPartie(p) == CODE_FIN_JOUEUR_A_GAGNE) {\n System.out.println(\"Voulez-vous rejouer ? (O/N)\");\n reponse = scan.nextLine();\n } else {\n break;\n }\n }\n }", "public Vediotape getVedio () {\n\t\treturn vedio;\n\t}", "public void asignarVida();", "public ArcReversalSV() {\n\n results = new Vector();\n resultsForPolicies = new Vector();\n crono = new Crono();\n statistics = new PropagationStatisticsID();\n }", "public static void EjecutaEjercicio2A(String entrada) {\n\t\tEjercicio2.iniDatos(entrada);\n\t\t\n\t\t// Declarar vértice de inicio para el grafo:\n\t\tVerticeAbogado verticeInicial = VerticeAbogado.verticeInicial();\n\t\t\n\t\t// Inicializar el grafo virtual:\n\t\t/*\n\t\t * 2 vías: \n\t\t * \t· Con peso en el vértice. \n\t\t * \t· Con peso en las aristas.\n\t\t*/\n\t\t\t\t\n\t\t// Inicializa un grafo virtual de tipo simpleVirtualGraph a partir del vértice inicial con peso:\n\t\tEGraph<VerticeAbogado, AristaAbogado> grafoVirtual = Graphs2.simpleVirtualGraph(verticeInicial, x -> x.getEdgeWeight());\n\n\t\t// Invocar el algoritmo de A*: \n\t\t/*\n\t\t * 2 vías: \n\t\t * · Expresando el vértice final de destino.\n\t\t * · Mediante un predicado objetivo.\n\t\t */\n\t\tAStar<VerticeAbogado, AristaAbogado> algoritmoA = GraphAlg.aStarGoal(\n\t\t\t\tgrafoVirtual,\n\t\t\t\tVerticeAbogado.objetivo(),\n\t\t\t\tHeuristicaAbogado::heuristica\n\t\t\t\t);\n\n\t\t// Proporciona un camino devuelto por A* desde el vértice inicial al objetivo:\n\t\tGraphPath<VerticeAbogado, AristaAbogado> caminoA = algoritmoA.search().get();\n\t\t\n\t\t// Solución: lista de aristas recorridos del grafo: \n\t\tList<AristaAbogado> aristas = caminoA.getEdgeList();\n\t\tSystem.out.println(\"$$$$$$$$$$$$$$$$$$$$$$$ A ESTRELLA $$$$$$$$$$$$$$$$$$$$$$$\");\n\t\tSolucion2.solucion(aristas, entrada);\n\t\t\n\t\t// DEBUG!\n\t\t/*\n\t\t * List<VerticeAbogado> vertices = caminoA.getVertexList();\n\t\t * System.out.println(vertices);\n\t\t*/\n\t\t\n\t}", "public static void main(String[] args) {\n\t\tString[] horasSesiones = {};\r\n\t\tSala sala = new Sala(\"Tiburon\", horasSesiones, 9, 5);\r\n\r\n\t\tsala.incluirSesion(\"20:00\");\r\n\r\n\t\t/*for (String hora : sala.getHorasDeSesionesDeSala())\r\n\t\t\tSystem.out.println(hora);*/\r\n\t//\tsala.borrarSesion(\"15:00\"); // no hace nada\r\n\t\t//sala.borrarSesion(\"20:00\");\r\n\r\n\t\tfor (String hora : sala.getHorasDeSesionesDeSala())\r\n\t\t\tSystem.out.println(hora);\r\n\r\n\t\t// necesitamos la ventanilla para mostrar el estado de la sesion\r\n\t\tVentanillaVirtualUsuario ventanilla = new VentanillaVirtualUsuario(null, true);\r\nSystem.out.println(sala.sesiones.size());\r\nSystem.out.print(sala.getEstadoSesion(1));\r\n\t\tsala.comprarEntrada(1, 2, 1);\r\n\t\tsala.comprarEntrada(1, 9, 3);\r\n\r\n\t\tint idVenta = sala.getIdEntrada(1, 9, 3);\r\n\r\n\t\tSystem.out.println(\"Id de venta es:\" + idVenta);\r\n\r\n\t\tButacasContiguas butacas = sala.recomendarButacasContiguas(1, 1);\r\n\r\n\t\tsala.comprarEntradasRecomendadas(1, butacas);\r\n\r\n\t\tint idVenta1 = sala.getIdEntrada(1, butacas.getFila(), butacas.getColumna());\r\n\r\n\t\tsala.recogerEntradas(idVenta1, 1);\r\n\r\n\t\tventanilla.mostrarEstadoSesion(sala.getEstadoSesion(1));\r\n\r\n\t\tSystem.out.println(\"No. de butacas disponibles: \" + sala.getButacasDisponiblesSesion(1));\r\n\r\n\t\tSystem.out.println(\"Tickets :\" + sala.recogerEntradas(idVenta, 1));\r\n\r\n\t\tSystem.out.println(\"Tickets recomendados:\" + sala.recogerEntradas(idVenta1, 1));\r\n\t\t//System.out.println(sala.sesiones.size());\r\n\t\t//sala.incluirSesion(\"10:56\");\r\n\t\t//sala.incluirSesion(\"10:57\");\r\n\t\t//System.out.println(sala.sesiones.size());\r\n\t\t/*{\r\n\t\t\tfor (int i = 0; i < sala.getHorasDeSesionesDeSala().length; i++) {\r\n\t\t\t\tSystem.out.println(sala.getHorasDeSesionesDeSala()[i]);\r\n\t\t\t}\r\n\t\t}\r\n\t}*/\r\n\t\t\r\n\t}", "@Override\n\tpublic void voler() {\n\t\tSystem.out.println(\"JE SAIS PAS VOLER\");\n\t}", "public VotacaoSegundoDia() {\n\n\t}", "private void calc_e_v_dens() {\n\t\tint i,il,max_steps = 10;\n\t\tdouble[] lel = new double[2], onel = new double[2];\n\t\tdouble store_dens;\n\t\t\n\t\tstore_dens = density;\n\t\t\n\t\ttry {\n\t\t\tPrintStream out = new PrintStream(new FileOutputStream(\"Ediff.v.dens.out\"));\n\t\t\tout.println(\"# density Elhcp Elfcc Ehcp Efcc dEl dE\");\n\t\t\t\n\t\t\tfor (i=0; i<max_steps; i++) {\n\t\t\t\tdensity= 2.0*(double)(i+1)/(double)max_steps;\n\t\t\t\tdiameter = Math.pow(density,1.0/3.0);\n\t\t\t\tdiameter2 = diameter*diameter;\n\t\t\t\tout.println(density+\" \");\n\t\t\t\tfor (il=0; il<2; il++) {\n\t\t\t\t\tlel[il] = calc_local_energy(0,il,CUR_POS);\n\t\t\t\t\tonel[il] = calc_e_order_n(il);\n\t\t\t\t}\n\t\t\t\tout.println(lel[0]+\" \"+lel[1]+\" \"+onel[0]+\" \"+onel[1]+\" \"+(lel[1]-lel[0])+\" \"+(onel[1]-onel[0]));\n\t\t\t}\n\t\t\tout.close();\n\t\t} catch( Exception e ) {\n\t\t\tSystem.err.println(\"calc_e_v_dens failed while writing file with exception: \"+e);\n\t\t}\n\t\t\n\t\tdensity= store_dens;\n\t\tdiameter = Math.pow(density,1.0/3.0);\n\t\tdiameter2 = diameter*diameter;\n\t}", "public static void testVecteur(){\n\t\tVecteur u = new Vecteur(1,0);\n\t\tSystem.out.println(u);\n\t\tu = u.rotation(Math.PI/2);\n\t\tSystem.out.println(u);\n\t\tu = u.rotation(Math.PI/2);\n\t\tSystem.out.println(u);\n\t\t\n\t}", "public void updateVisibility(Camera cam) {\n int i = 0;\n \n for(WE_Face face : listaDeFaces){\n WE_Aresta arestaFace = face.getArestaDaFace();\n \n Vertice third = null;\n searchForAnyArestaParaEsquerda:\n for (WE_Aresta aresta : listaDeArestas){\n if (!aresta.equals(arestaFace)){\n if (face.ID == aresta.getFaceEsquerda().ID){\n third = aresta.getvFinal();\n break searchForAnyArestaParaEsquerda;\n } else if (face.ID == aresta.getFaceDireita().ID){\n third = aresta.getvInicial();\n break searchForAnyArestaParaEsquerda;\n }\n }\n }\n \n Vertice normal = VMath.obterNormal(arestaFace.getvFinal(), arestaFace.getvInicial(), third);\n VMath.normalizar(normal);\n double mult = VMath.produtoEscalar(cam.getVetorN(), normal);\n System.out.println(\"Normal: \" + normal + \" Mult: \" + mult);\n visibilidade_faces[i] = mult > 0; //Se mult>0, face[i] é visível\n i++;\n }\n throw new UnsupportedOperationException(\"This doesn't work and programmer should feel bad. :(\");\n //<editor-fold defaultstate=\"collapsed\" desc=\"Testes que não funcionaram\">\n /*System.out.println(\"Lista vertices: \" + listaDeVertices);\n System.out.println(\"Lista arestas: \" + listaDeArestas);\n System.out.println(\"Lista faces: \" + listaDeFaces);\n\n for (WE_Face face : listaDeFaces){\n WE_Aresta arestaFace = face.getArestaDaFace();\n System.out.println(\"ARESTA FACE: \" + arestaFace);\n WE_Aresta next;\n Vertice third;\n if (arestaFace.getFaceEsquerda().ID == face.ID){\n next = arestaFace.getEsquerdaPredecessora();\n } else {\n next = arestaFace.getDireitaSucessora();\n }\n\n if (next.getvInicial().equals(arestaFace.getvInicial())\n ||next.getvInicial().equals(arestaFace.getvFinal ()))\n third = next.getvFinal();\n else\n third = next.getvInicial();\n\n System.out.println(\"POINTS (\" + face.ID + \"): \");\n System.out.println(\"One: \" + arestaFace.getvFinal());\n System.out.println(\"Two: \" + arestaFace.getvInicial());\n System.out.println(\"Thr: \" + third);\n\n Vertice normal = VMath.obterNormal(arestaFace.getvFinal(), arestaFace.getvInicial(), third);\n VMath.normalizar(normal);\n double mult = VMath.produtoEscalar(cam.getVetorN(), normal);\n System.out.println(\"Normal: \" + normal + \" Mult: \" + mult);\n visibilidade_faces[i] = mult > 0; //Se mult>0, face[i] é visível\n\n i++;\n }*/\n\n /*for (WE_Face face : listaDeFaces){\n WE_Aresta arestaFace = null;\n\n searchForAnyArestaParaEsquerda:\n for (WE_Aresta aresta : listaDeArestas){\n if (face.ID == aresta.getFaceEsquerda().ID){\n arestaFace = aresta;\n break searchForAnyArestaParaEsquerda;\n }\n }\n\n Vertice one = arestaFace.getvInicial();\n Vertice two = arestaFace.getvFinal();\n Vertice three;\n\n arestaFace = arestaFace.getEsquerdaSucessora();\n if (arestaFace.getvInicial().equals(two)){\n three = arestaFace.getvFinal();\n } else {\n three = arestaFace.getvInicial();\n }\n\n Vertice normal = VMath.obterNormal(two, one, three);\n VMath.normalizar(normal);\n double mult = VMath.produtoEscalar(cam.getVetorN(), normal);\n System.out.println(\"Normal: \" + normal + \" Mult: \" + mult);\n visibilidade_faces[i] = mult > 0; //Se mult>0, face[i] é visível\n }*/\n //</editor-fold>\n }", "private void cargarFichaLepra_convivientes() {\r\n\r\n\t\tMap<String, Object> parameters = new HashMap<String, Object>();\r\n\t\tparameters.put(\"codigo_empresa\", codigo_empresa);\r\n\t\tparameters.put(\"codigo_sucursal\", codigo_sucursal);\r\n\t\tparameters.put(\"nro_identificacion\", tbxNro_identificacion.getValue());\r\n\t\tparameters.put(\"fecha_actual\", new Date());\r\n\r\n\t\t// log.info(\"parameters\" + parameters);\r\n\t\tseguimiento_control_pqtService.setLimit(\"limit 25 offset 0\");\r\n\r\n\t\t// log.info(\"parameters>>>>\" + parameters);\r\n\t\tBoolean fecha_tratamiento = seguimiento_control_pqtService\r\n\t\t\t\t.existe_fecha_fin_tratamiento(parameters);\r\n\t\t// log.info(\"fecha_tratamiento>>>>\" + fecha_tratamiento);\r\n\r\n\t\tif (fecha_tratamiento) {\r\n\t\t\tMap<String, Object> parametros = new HashMap<String, Object>();\r\n\t\t\tparametros.put(\"nro_identificacion\",\r\n\t\t\t\t\tadmision_seleccionada.getNro_identificacion());\r\n\t\t\tparametros.put(\"nro_ingreso\",\r\n\t\t\t\t\tadmision_seleccionada.getNro_ingreso());\r\n\t\t\tparametros.put(\"estado\", admision_seleccionada.getEstado());\r\n\t\t\tparametros.put(\"codigo_administradora\",\r\n\t\t\t\t\tadmision_seleccionada.getCodigo_administradora());\r\n\t\t\tparametros.put(\"id_plan\", admision_seleccionada.getId_plan());\r\n\t\t\tparametros.put(IVias_ingreso.ADMISION_PACIENTE,\r\n\t\t\t\t\tadmision_seleccionada);\r\n\t\t\tparametros.put(IVias_ingreso.OPCION_VIA_INGRESO,\r\n\t\t\t\t\tOpciones_via_ingreso.REGISTRAR);\r\n\t\t\ttabboxContendor.abrirPaginaTabDemanda(false,\r\n\t\t\t\t\tIRutas_historia.PAGINA_CONTROL_CONVIVIENTES_LEPRA,\r\n\t\t\t\t\tIRutas_historia.LABEL_CONTROL_CONVIVIENTES_LEPRA,\r\n\t\t\t\t\tparametros);\r\n\t\t}\r\n\t}", "private void doVels() {\n\t\tthis.launchPerVel = Math.sqrt((2d * body.getGm() * this.launchApoAlt) / (this.launchPerAlt * this.a));\n\t\tthis.launchApoVel = Math.sqrt((2d * body.getGm() * this.launchPerAlt) / (this.launchApoAlt * this.a));\n\t}", "public static void main(String[] args) {\n int v1[] = new int[50];\r\n int v2[] = new int[50];\r\n int posicao_v2 = 0;\r\n int quantidade_divisores = 0;\r\n //preenche o vetor de 1 a 50 \r\n for (int i = 0; i < 50; i++) {\r\n v1[i] = i + 1;\r\n\r\n }\r\n \r\n \r\n //procura numero primos no vetor\r\n for (int i = 0; i < v1.length; i++) {\r\n //testar se v1[i] e um numero primo\r\n //Um número é divisível por outro quando o resto da divisão entre os dois é igual a zero\r\n quantidade_divisores = 0;\r\n //calcula a quatidade de divisores\r\n for (int j = 0; j < v1[i]; j++) {\r\n if (v1[i] % v1[j] == 0) {\r\n quantidade_divisores++;\r\n //sera divisivel\r\n }\r\n }\r\n if (quantidade_divisores == 2 ){\r\n //e primo \r\n v2[posicao_v2] = v1[i];\r\n posicao_v2++;\r\n }\r\n \r\n \r\n \r\n\r\n }\r\n for (int i = 0; i < 50; i++) {\r\n System.out.print(v1[i]+\" \");\r\n \r\n }\r\n System.out.println();\r\n for (int i = 0; i < 50; i++) {\r\n if (v2[i] > 0) {\r\n System.out.print(\"v1{\");\r\n System.out.print(v2[i]+\" , }\");\r\n }\r\n \r\n \r\n \r\n }\r\n \r\n System.out.println();\r\n }", "public List<Vendedor> listarVendedor();", "public interface IGestorFaseDescartes {\n\t\n\t/**\n\t * Devuelve el jugador al que le toca jugar respecto\n\t * a su posición en la mesa de juego.\n\t * @return posición\n\t */\n\tpublic int getTurnoJuego();\n\n\t/**\n\t * Devuelve la fase de juego en la que se encuentra la mano\n\t * @return Fase del Juego (MUS, DESCARTE, REPARTO, GRANDE)\n\t */\n\tpublic FaseDescartes faseJuego();\n\t\n\t/**\n\t * Controla si se puede pedir mus o no.\n\t * @param j\n\t * @return boolean\n\t */\n\tpublic boolean pedirMus(Jugador j);\n\t\n\t/**\n\t * Controla si se ha cortado el mus o no para determinar\n\t * si se puede iniciar el descarte.\n\t * @param j\n\t * @return boolean\n\t */\n\tpublic boolean cortarMus(Jugador j);\n\t\n\t/**\n\t * Controla los descartes (nº de cartas y cuales) del jugador\n\t * \n\t * @param j\n\t * @param cartas\n\t * @return boolean\n\t */\n\tpublic boolean pedirDescarte(Jugador j, Carta... cartas);\n\n\t/**\n\t * Una vez que todos han solicitado su descarte utiliza la\n\t * interface de descartes para que lo haga efectivo.\n\n\t * @return\n\t */\n\tpublic boolean ejecutarDescartar();\n\t\n\t/**\n\t * Se encarga de controlar el reparto de cargas teniendo en cuenta los\n\t * descartes realizados.\n\t * @param j\n\t * @return El número de cartas recibidas o -1 en caso de error\n\t */\n\tpublic int reparte(Jugador j);\n\n\t/**\n\t * Inicializa los contadores del gestor\n\t */\n\tpublic void inicializar();\n\t\n}", "public void vaciar(){\r\n\t\t//Monto un iterador de vertices del grafo\r\n\t\tIterator iteradorVertices = vertices.iterator();\r\n\t\tArista aristaAux;\r\n\t\tVertice verticeAux;\r\n\t\t//obtengo todos los vertices del grafo\r\n\t\twhile (iteradorVertices.hasNext()){\r\n\t\t\tverticeAux = (Vertice) iteradorVertices.next();\r\n\t\t\t//por cada vertice obtengo sus aristas salientes\r\n\t\t\tIterator iteradorAristas = verticeAux.getAristasSalientes().iterator();\r\n\t\t\t//mientras tenga aristas salientes\r\n\t\t\twhile(iteradorAristas.hasNext()){\r\n\t\t\t\t//Elimino cada arista\r\n\t\t\t\taristaAux = (Arista)iteradorAristas.next(); \r\n\t\t\t\tverticeAux.elimiarAristaSaliente(aristaAux);\r\n\t\t\t}\r\n\t\t\t//Elimino el vertice\r\n\t\t\tthis.eliminarVertice(verticeAux);\r\n\t\t}\r\n\t}", "public void renovarBolsa() {\n\t\tSystem.out.println(\"Bolsa renovada com suceso!\");\n\t}", "public static void main(String[] args) {\n\t\t// apresentando informações em tela, salario e VR.\n\t\tSystem.out.println(\" SALARIO: R$ 1641,00\");\n\t\tSystem.out.println(\" VALE-REFEIÇÃO: R$ 409,00\");\n\t\t\n//fim\n\t}", "protected String elaboraTemplateAvviso() {\n String testo = VUOTA;\n String dataCorrente = date.get();\n String personeTxt = \"\";\n personeTxt = text.format(numVoci);\n\n if (usaHeadTemplateAvviso) {\n testo += tagHeadTemplateAvviso;\n testo += \"|bio=\";\n testo += personeTxt;\n testo += \"|data=\";\n testo += dataCorrente.trim();\n testo += \"|progetto=\";\n testo += tagHeadTemplateProgetto;\n testo = LibWiki.setGraffe(testo);\n }// end of if cycle\n\n return testo;\n }", "private static void verifPayement(){\n\t\tint x,y, dime;\n\t\tx=jeu.getAssam().getXPion()-1;\n\t\ty=jeu.getAssam().getYPion()-1;\n\t\tint caseInfoTapis = jeu.cases[x][y].getCouleurTapis();\n\t\tif(caseInfoTapis == tour || caseInfoTapis == 0){\n\t\t\treturn;\n\t\t}\n\t\telse{\n\t\t\tdime = jeu.payerDime(caseInfoTapis,x,y,0,new boolean[7][7]);\n\t\t\tJoueur payeur = jeu.getJoueurs()[tour-1];\n\t\t\tJoueur paye = jeu.getJoueurs()[caseInfoTapis-1];\n\t\t\tif(jeu.payerVraimentDime(payeur,paye,dime)){\n\t\t\t\tjoueurElimine++;\n\t\t\t}\n\t\t\tconsole.afficherPayeurPaye(payeur, paye, dime);\n\t\t}\n\t}", "public double getStockFinal(long pv) {\n float entree = 0 ;\n float sortie = 0 ;\n\n ArrayList<Produit> produits = null ;\n if (pv==0) produits = produitDAO.getAll();\n else produits = produitDAO.getAllByPv(pv) ;\n\n ArrayList<Mouvement> mouvements = null;\n\n double valeur = 0 ;\n double total = 0 ;\n double quantite = 0 ;\n double cmpu = 0 ;\n double restant = 0 ;\n double qsortie = 0 ;\n double qentree = 0 ;\n // Vente par produit\n Mouvement mouvement = null ;\n Operation operation = null ;\n\n for (int i = 0; i < produits.size(); i++) {\n try {\n mouvements = mouvementDAO.getManyByProductInterval(produits.get(i).getId_externe(),DAOBase.formatter2.parse(datedebut),DAOBase.formatter2.parse(datefin)) ;\n } catch (ParseException e) {\n e.printStackTrace();\n }\n\n if (mouvements != null){\n valeur = 0 ;\n quantite = 0 ;\n restant = 0 ;\n qentree = 0 ;\n cmpu = 0 ;\n qsortie = 0 ;\n\n for (int j = 0; j < mouvements.size(); j++) {\n mouvement = mouvements.get(j) ;\n operation = operationDAO.getOne(mouvement.getOperation_id()) ;\n if (operation==null || (operation.getAnnuler()==1 && operation.getDateannulation().before(new Date())) || operation.getTypeOperation_id().startsWith(OperationDAO.CMD)) continue;\n\n //if (pv!=0 && caisseDAO.getOne(operation.getCaisse_id()).getPointVente_id()!=pv) continue;\n if (j==0)\n if (mouvement.getRestant()==mouvement.getQuantite() && mouvement.getEntree()==0){\n restant = 0 ;\n }\n else restant = mouvement.getRestant() ;\n\n if (mouvement.getEntree()==0) {\n valeur -= mouvement.getPrixA() * mouvement.getQuantite() ;\n qentree += mouvement.getQuantite() ;\n cmpu = mouvement.getPrixA() ;\n }\n else {\n valeur += mouvement.getCmup() * mouvement.getQuantite() ;\n qsortie += mouvement.getQuantite() ;\n }\n /*\n if (restant!=0) cmpu = valeur / restant ;\n else cmpu = mouvement.getCmup() ;\n */\n }\n\n quantite = restant + qentree - qsortie ;\n total+=Math.abs(valeur) ;\n }\n }\n\n return total;\n }", "private Vertice<T> getHermano(Vertice<T> v){\n\tif(v.padre == null)\n\t return null;\n\tif(v.padre.derecho == v){\n\t if(v.padre.izquierdo == null)\n\t\treturn null;\n\t else\n\t\treturn v.padre.izquierdo;\n\t}else{\n\t if(v.padre.derecho == null)\n\t\treturn null;\n\t else\n\t\treturn v.padre.derecho;\n\t}\n }", "public void postOrden(nodoArbolAVL r){\n if(r != null){\n postOrden(r.hijoIzquierdo);\n postOrden(r.hijoDerecho);\n //System.out.print(r.dato + \" , \");\n for (int i = 1; i<=7;i++) {\n if(r.nivel==i)\n {\n //vector[i]=r.dato;\n System.out.println(r.dato + \" NIVEL: \"+i);\n }\n }\n \n } \n \n }", "teledon.network.protobuffprotocol.TeledonProtobufs.Voluntar getVoluntar();", "public static Documento calcularExcento(Documento doc, List<DocumentoDetalleVo> productos) {\n\t\tDouble totalReal = 0.0, exectoReal = 0.0;\n\t\tDouble gravado = 0.0;\n\t\tDouble ivatotal = 0.0;\n\t\tDouble peso = 0.0;\n\t\tDouble iva5 = 0.0;\n\t\tDouble iva19 = 0.0;\n\t\tDouble base5 = 0.0;\n\t\tDouble base19 = 0.0;\n\t\tDouble costoTotal =0.0;\n\t\t//este campo es para retencion del hotel\n\t\tDouble retencion =0.0;\n\t\t// aqui voy toca poner a sumar las variables nuebas para que se reflejen\n\t\t// en el info diario\n\t\tfor (DocumentoDetalleVo dDV : productos) {\n\t\t\tLong productoId = dDV.getProductoId().getProductoId();\n\t\t\tDouble costoPublico = dDV.getParcial();\n\t\t\tDouble costo = (dDV.getProductoId().getCosto()==null?0.0:dDV.getProductoId().getCosto())*dDV.getCantidad();\n\t\t\tDouble iva1 = dDV.getProductoId().getIva().doubleValue() / 100;\n\t\t\tDouble peso1 = dDV.getProductoId().getPeso() == null ? 0.0 : dDV.getProductoId().getPeso();//\n\t\t\tpeso1 = peso1 * dDV.getCantidad();\n\t\t\ttotalReal += costoPublico;\n\t\t\tcostoTotal+=costo;\n\t\t\tdouble temp;\n\t\t\tivatotal = ivatotal + ((costoPublico / (1 + iva1)) * iva1);\n\t\t\tpeso = peso + peso1;\n\t\t\t// si es iva del 19 se agrega al documento junto con la base\n\t\t\tif (iva1 == 0.19) {\n\t\t\t\tiva19 = iva19 + ((costoPublico / (1 + iva1)) * iva1);\n\t\t\t\tbase19 = base19 + (costoPublico / (1 + iva1));\n\t\t\t}\n\t\t\t// si es iva del 5 se agrega al documento junto con la base\n\t\t\tif (iva1 == 0.05) {\n\t\t\t\tiva5 = iva5 + ((costoPublico / (1 + iva1)) * iva1);\n\t\t\t\tbase5 = base5 + (costoPublico / (1 + iva1));\n\t\t\t}\n\t\t\tif (iva1 > 0.0) {\n\t\t\t\ttemp = costoPublico / (1 + iva1);\n\t\t\t\tgravado += temp;\n\n\t\t\t} else {\n\t\t\t\ttemp = costoPublico;\n\t\t\t\t//no suma el excento si es producto retencion\n\t\t\t\tif( productoId!=6l && productoId!=7l) {\n\t\t\t\t\texectoReal += temp;\n\t\t\t\t}else {\n\t\t\t\t\tretencion+= temp;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\tdoc.setTotal(totalReal);\n\t\tdoc.setSaldo(totalReal);\n\t\tdoc.setExcento(exectoReal);\n\t\tdoc.setGravado(gravado);\n\t\tdoc.setIva(ivatotal);\n\t\tdoc.setPesoTotal(peso);\n\t\tdoc.setIva5(iva5);\n\t\tdoc.setIva19(iva19);\n\t\tdoc.setBase5(base5);\n\t\tdoc.setBase19(base19);\n\t\tdoc.setTotalCosto(costoTotal);\n\t\tdoc.setRetefuente(retencion);\n\t\treturn doc;\n\t}", "@Test\n public void testVerser2() {\n\n //Arrange\n CompteBancaire cpt = new CompteBancaire(6500.0);\n double montant_a_verser = -2000.0;\n double excepted = 6500.0;\n\n //Act\n assertEquals(false, cpt.verser(montant_a_verser));\n\n //Assert\n assertEquals(excepted, cpt.getSolde(), 0);\n\n }", "@Override\n\tpublic void dirigir() {\n\t\tSystem.out.println(\"Dirige al Equipo\");\n\t\t\n\t}", "public void view(){\r\n System.out.println(\"\tNombre: \"+name);\r\n\t\tSystem.out.println(\"\tTipo: \"+type.id);\r\n\t\tSystem.out.println(\"\tVal: \"+((Integer)val).intValue());\r\n\t\tif(block==true){\r\n\t\t\tSystem.out.println(\"\tBLOQUEADA\");\r\n\t\t}else{\r\n\t\t\tSystem.out.println(\"\tDESBLOQUEADO\");\r\n\t\t}\r\n //System.out.println(\"\tTipo2: \"+kind);\r\n //System.out.println(\"\tAnidamiento: \"+level);\r\n //System.out.println(\"\tSigDireccion: \"+nextAdr);\r\n System.out.println(\"\t*********************\");\r\n\t\tSystem.out.println();\r\n }", "SpaceInvaderTest_VaisseauAvance_DeplacerVaisseauVersLaGauche createSpaceInvaderTest_VaisseauAvance_DeplacerVaisseauVersLaGauche();", "@Test\r\n public void testDesvioPadrao() {\r\n EstatisticasUmidade e = new EstatisticasUmidade();\r\n e.setValor(5.2);\r\n e.setValor(7.0);\r\n e.setValor(1.3);\r\n e.setValor(6);\r\n e.setValor(0.87); \r\n \r\n double result= e.media(1);\r\n assertArrayEquals(\"ESPERA RESULTADO\", 5.2 , result, 1.2);\r\n }", "public void duerme() {\n System.out.println(\"Duerme profundamentZzZzZz...\");\n }", "@Test\n\tvoid calcularSalarioSinVentasPagoPositivoTest() {\n\t\tEmpleadoPorComision empleadoPorComision = new EmpleadoPorComision(\"Hiromu Arakawa\", \"p24\", 400000, 0);\n\t\tdouble salarioEsperado = 400000;\n\t\tdouble salarioEmpleadoPorComision = empleadoPorComision.calcularSalario();\n\t\tassertEquals(salarioEsperado, salarioEmpleadoPorComision);\n\n\t}" ]
[ "0.64029145", "0.6114054", "0.6091824", "0.6074686", "0.6058876", "0.6042365", "0.58607626", "0.58301646", "0.5756731", "0.5753298", "0.56621623", "0.5606556", "0.55664724", "0.5561201", "0.5548368", "0.5535463", "0.5522724", "0.5493097", "0.5485876", "0.546465", "0.5449584", "0.5447921", "0.54283607", "0.5396916", "0.53791136", "0.5370495", "0.53671306", "0.53667605", "0.53667295", "0.5366398", "0.53645957", "0.5362525", "0.536137", "0.53154224", "0.5308538", "0.5296554", "0.52913606", "0.52873725", "0.52791876", "0.5274407", "0.5272821", "0.52706", "0.52691823", "0.52535737", "0.5250916", "0.52395326", "0.52394223", "0.5235612", "0.5230211", "0.5218512", "0.5216782", "0.52158463", "0.52116424", "0.5210956", "0.5206802", "0.52026457", "0.51999944", "0.5199662", "0.5199488", "0.5196573", "0.5191029", "0.51876616", "0.51861924", "0.51860917", "0.5185714", "0.5185367", "0.51837677", "0.51813555", "0.51762795", "0.51678175", "0.5167811", "0.5161047", "0.51513857", "0.51452225", "0.5144166", "0.5144005", "0.51377654", "0.51367366", "0.5133899", "0.5128472", "0.5127101", "0.51225793", "0.51223856", "0.51222485", "0.5120007", "0.511992", "0.5101308", "0.5096497", "0.50932366", "0.5086084", "0.50854594", "0.5083153", "0.50770247", "0.5064405", "0.5061481", "0.5060108", "0.50573045", "0.5056167", "0.505263", "0.50511074", "0.50480074" ]
0.0
-1
After completing background task Dismiss the progress dialog
protected void onPostExecute(String file_url) { // dismiss the dialog after getting all products pDialog.dismiss(); // updating UI from Background Thread Emp = (TextView) findViewById(R.id.empresa); cal = (TextView) findViewById(R.id.calle); num = (TextView) findViewById(R.id.Numero); ciu = (TextView) findViewById(R.id.ciudad); prov = (TextView) findViewById(R.id.provincia); prob = (TextView) findViewById(R.id.problema); Emp.setText(empresa); cal.setText(calle); num.setText(numero); ciu.setText(ciudad); prov.setText(provincia); prob.setText(problema); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\t\t\t\t protected void onPostExecute(Void result)\n\t\t\t\t {\n\t\t\t\t\t\t\t\t\t\tif (progressDialog != null)\n\t\t\t\t\t\t\t\t\t\t\tprogressDialog.dismiss();\n\t\t\t\t }", "@Override\n\t\t\t protected void onPostExecute(Void result)\n\t\t\t {\n\t\t\t\t\t\t\t\t\tif (progressDialog != null)\n\t\t\t\t\t\t\t\t\t\tprogressDialog.dismiss();\n\t\t\t }", "@Override\n \t\tprotected void onPostExecute(Void result) \n \t\t{\n\t\t\t//close the progress dialog\n\t\t\tprogressDialog.dismiss();\n\t\t\tprogressDialog = null;\n \t\t}", "private void dismissProgress() {\n \n \t\tnew Handler(getMainLooper()).post(new Runnable() {\n \n \t\t\t@Override\n \t\t\tpublic void run() {\n \t\t\t\tif (progressDialog == null)\n \t\t\t\t\tprogressDialog = (ProgressDialogFragment) getSupportFragmentManager()\n \t\t\t\t\t\t\t.findFragmentByTag(\n \t\t\t\t\t\t\t\t\tProgressDialogFragment.FRAGMENT_TAG);\n \n \t\t\t\tif (progressDialog != null && progressDialog.getShowsDialog()) {\n \t\t\t\t\tprogressDialog.dismiss();\n \n \t\t\t\t\tprogressDialog = null;\n \t\t\t\t}\n \t\t\t}\n \t\t});\n \t}", "public void run() {\n progressDialog.dismiss();\n }", "public void run() {\n progressDialog.dismiss();\n }", "public void offProgressDialog(){\n if(dialogProgresIndeterminate != null && dialogProgresIndeterminate.isShowing()){\n dialogProgresIndeterminate.dismiss();\n }\n }", "@Override\n\tprotected void onCancelled(BackgroundTaskResult result)\n\t{\n\t\ttaskCompleted = true;\n\t\tdismissProgressDialog();\n\t\tnotifyTaskCancelled(result);\n\t}", "@Override\n protected void onPostExecute(String file_url) {\n dismissDialog(progress_bar_type);\n //pDialog.dismiss();\n }", "@Override\n protected void onPostExecute(BackgroundTaskResult result)\n {\n taskCompleted = true;\n dismissProgressDialog();\n notifyTaskCompletion(result);\n }", "@Override\n protected void onPreExecute() {\n dialog= ProgressDialog.show(DetailsActivity.this, \"Please wait...\",\"Your connection speed is bad\", true);\n dialog.setCancelable(true);\n dialog.setOnCancelListener(new DialogInterface.OnCancelListener(){\n public void onCancel(DialogInterface dialog) {\n task.cancel(true);\n finish();\n }\n });\n }", "@Override\r\n protected void onPostExecute(Void result) {\n mProgressDialog.dismiss();\r\n }", "@Override\n protected void onPostExecute(String temp) {\n\n progressDialog.dismiss();\n }", "private void dismissDialog() {\n if (progressDialog != null) {\n progressDialog.dismiss();\n }\n }", "private void dismissProgressIndication() {\n if (mProgressDialog != null && mProgressDialog.isShowing()) {\n try{\n mProgressDialog.dismiss(); // safe even if already dismissed\n }catch(Exception e){\n Log.i(TAG, \"dismiss exception: \" + e);\t\n }\n mProgressDialog = null;\n }\n }", "void dismissProgressDialog();", "void dismissProgressDialog();", "void dismissProgressDialog();", "@Override\n public void onComplete(@NonNull Task<Void> task) {\n if (progressDialog.isShowing()) {\n progressDialog.dismiss();\n }\n\n // Finish this activity.\n finish();\n\n }", "public void dismissProgressDialog() {\r\n if (progressDialog.isShowing()) {\r\n progressDialog.dismiss();\r\n }\r\n }", "public void dismissProgress() {\n if (mProgressDialog != null) {\n mProgressDialog.dismiss();\n mProgressDialog = null;\n }\n }", "private void dismissProgressDialog()\n {\n \tif (null != dialog && dialog.isShowing()) {\n \t\tdialog.dismiss();\n \t}\n }", "@Override\r\n\t\t\tpublic void onCancelledDoInUI(String result) {\n\t\t\t\ttry {\r\n\t\t\t\t\tMyProgressDialog.Dismiss();\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t// TODO: handle exception\r\n\t\t\t\t\tLog.i(\"it is cancle error\", e.getMessage());\r\n\t\t\t\t}\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void onCancelledDoInUI(String result) {\n\t\t\t\ttry {\r\n\t\t\t\t\tMyProgressDialog.Dismiss();\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t// TODO: handle exception\r\n\t\t\t\t\tLog.i(\"it is cancle error\", e.getMessage());\r\n\t\t\t\t}\r\n\t\t\t}", "@Override\r\n protected void onPostExecute(String message) {\n this.progressDialog.dismiss();\r\n Toast.makeText(getApplicationContext(),\r\n message, Toast.LENGTH_LONG).show();\r\n }", "public void dissMissDialog(){\r\n if (dialog != null && dialog.isShowing()\r\n && dialog.getContext() != null) {\r\n try {\r\n dialog.dismiss();\r\n\r\n if(mCallback != null){\r\n mCallback.onProgressDissmiss();\r\n }\r\n\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n }\r\n }\r\n }", "public void dismissProgressDialog(){\n if(progressDialog != null)\n progressDialog.dismiss();\n }", "@Override\r\n\tprotected void onPostExecute(String result)\r\n\t{\r\n\t\tprogress.dismiss();\r\n\t\tsuper.onPostExecute(result);\r\n\t}", "@Override\n\t\tprotected void onPostExecute(Void result) {\n\t\t\td.dismiss();\n\t\t}", "void dismissProgressLoading() {\n if (progressDialog != null) {\n progressDialog.dismiss();\n }\n }", "@Override\n protected void onPostExecute(Void result) {\n // This is where we would process the results if needed.\n this.progressDialog.dismiss();\n }", "private void dismissProgressDialog() {\n if (mProgressDialog != null && mProgressDialog.isShowing()) {\n mProgressDialog.dismiss();\n }\n }", "protected void onStop() { //멈추었을때 다이어로그를 제거해주는 메서드\n super.onStop();\n if (progressDialog != null)\n progressDialog.dismiss(); //다이어로그가 켜져있을경우 (!null) 종료시켜준다\n }", "public void dismissDialog(){\n\t if(pd != null){\n\t\t pd_progress = pd.getProgress();\n\t\t pd.dismiss();\n\t }\n }", "@Override\n protected void onPreExecute() {\n pd = ProgressDialog. show(Evento.this, \"Eliminar Evento\", \"ESPERE UN MOMENTO\");\n pd.setCancelable( false);\n }", "@Override\n public void run() {\n if (!AddClient.this.isFinishing() && progressDialog != null) {\n progressDialog.dismiss();\n }\n }", "@Override\n public void onClick(DialogInterface dialog, int which) {\n // dismiss the progress dialog\n MyTask.this.cancel(true);\n finish();\n pDialog.dismiss();\n // Tell the system about cancellation\n\n }", "public void run() {\n dialog.dismiss();\n }", "public void run() {\n dialog.dismiss();\n }", "@Override\n protected void onPreExecute()\n {\n taskCompleted = false;\n\n //display the progress dialog\n showProgressDialog();\n }", "@Override\n protected void onPreExecute() {\n String msg = \"Please Wait....\";\n cd.showProgressDialog(msg);\n\n }", "@Override\n\t\t\tprotected void onPostExecute(JSONObject result) {\n\t\t\t\tsuper.onPostExecute(result);\n\t\t\t\t\n\t\t\t\tmProgressDialog.dismiss();\n\t\t\t\t\n\t\t\t}", "public void onPreExecute() {\n progressDialog.show();\n }", "@Override\r\n public void run() {\n dialog.dismiss();\r\n }", "@Override\n\t\t\tprotected void onPostExecute(JSONObject result) {\n\t\t\t\tsuper.onPostExecute(result);\n\t\t\t\tmProgressDialog.dismiss();\n\t\t\t}", "public void hideProgressDialog() {\r\n\t\trunOnUiThread(new Runnable() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void run() {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tif (progress.isShowing())\r\n\t\t\t\t\t\tprogress.dismiss();\r\n\t\t\t\t} catch (Throwable e) {\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}", "@Override\n public void onClick(DialogInterface dialog, int which) {\n task.cancel(true); //meng- cancel AsincTask\n pd.dismiss(); //menghilangkan progress dialog\n }", "@Override\n public void run() {\n pDialog.dismiss();\n finish();\n }", "public void dismissProgressDialog() {\n if (this.pDialog != null && this.pDialog.isShowing()) {\n this.pDialog.dismiss();\n }\n }", "@Override\n protected void onPreExecute() {\n Dialog.setMessage(\"Downloading Pending Delivery Status..\");\n Dialog.setCancelable(false);\n Dialog.show();\n }", "@Override\r\n\t\t\tpublic void onFinish() {\n\t\t\t\tsuper.onFinish();\r\n\t\t\t\tLog.i(\"finish\", \"finish\");\r\n\t\t\t\tdismissProgress();\r\n\t\t\t}", "public void dismissProgressDialog() {\n if (this.progressDialog != null) {\n this.progressDialog.dismiss();\n this.progressDialog = null;\n }\n }", "private void stopProgressDialog() {\n try {\n if (mProgressDialog != null && mProgressDialog.isShowing()) {\n mProgressDialog.dismiss();\n }\n } catch (Exception e) {\n LogWriter.err(e);\n } finally {\n mProgressDialog = null;\n }\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tDialog.setMessage(\"Downloading Delivery Data..\");\n\t\t\tDialog.setCancelable(false);\n\t\t\tDialog.show();\n\t\t}", "protected void dismissLoading()\n {\n progressBar.dismiss();\n }", "public void onDismissDialog() {\n Log.i(this, \"Dialog dismissed\");\n if (mInCallState == InCallState.NO_CALLS) {\n attemptFinishActivity();\n attemptCleanup();\n }\n }", "@Override\n\t\t\t\tpublic void onDismiss() {\n\t\t\t\t\tsleep_time.setText(\"无操作\" + getTimeOut(context.getContentResolver())\n\t\t\t\t\t\t\t+ \"后休眠\");\n\t\t\t\t\tdialog.dismiss();\n\t\t\t\t}", "@Override\r\n\tprotected void onPostExecute(String result) {\r\n\t\tprogressDialog.setMessage(\"Finalizado!\");\r\n\t\t// fecha o dialog\r\n\t\tprogressDialog.dismiss();\r\n\t\tsuper.onPostExecute(result);\r\n\t}", "@Override\n protected void onPreExecute() {\n Dialog.setMessage(\"Downloading Outlet Inventory..\");\n Dialog.setCancelable(false);\n Dialog.show();\n }", "@Override\n protected void onPostExecute(Void aVoid) {\n super.onPostExecute(aVoid);\n progressDialog.dismiss();\n Toast.makeText(context,\"下载完成!\",Toast.LENGTH_SHORT).show();\n }", "protected void onPostExecute(Void aVoid) {\n progressDialog.dismiss();\n //Showing a success message\n Toast.makeText(context, R.string.toast_complete, Toast.LENGTH_SHORT).show();\n act.finish();\n }", "@Override\n protected void onPreExecute() {\n progressDialog.setProgress(0);\n //progressBar.setProgress(0);\n super.onPreExecute();\n }", "@Override\n\t\tprotected void onPostExecute(Object result) {\n\t\t\tView rootView =(View)result;\n\t\t\ttry {\n\t\t\t\tThread.sleep(400);\n\t\t\t} catch (InterruptedException e) {\t\t\t\t\n\t\t\t}\n\t\t\tsetContentView(rootView);\t\t\t\n\t\t\tgetProgressDialog().hide();\n\t\t}", "@Override\n\tpublic void hideProgress() {\n\t\twaitDialog(false);\n\t}", "@Override\n protected void onPreExecute() {\n\n this.dialog.setMessage(\"Please wait ...\");\n this.dialog.show();\n }", "private void hideDialog() {\n if (progressDialog.isShowing())\n progressDialog.dismiss();\n }", "@Override\n \tprotected final void onPostExecute(final Boolean result) {\n \t\tAndGMXsms.dialogString = null;\n \t\tif (AndGMXsms.dialog != null) {\n \t\t\ttry {\n \t\t\t\tAndGMXsms.dialog.dismiss();\n \t\t\t\tAndGMXsms.dialog = null;\n \t\t\t} catch (Exception e) {\n \t\t\t\t// nothing to do\n \t\t\t}\n \t\t}\n \t}", "@Override\n\tprotected void onPreExecute() {\n\t\t\n\t\t pDialog = new ProgressDialog(context);\n\t\t\ttry{\n\t\t\t\tthis.pDialog.setMessage(\"Please wait ...\");\n\t\t this.pDialog.setIndeterminateDrawable(context.getResources().getDrawable(R.drawable.red_progress));\n\t\t this.pDialog.setIndeterminate(false);\n\t\t this.pDialog.setCancelable(false);\n\t\t this.pDialog.show();\n\t\t\t}\n\t\t\tcatch(Exception e)\n\t\t\t{\n\t\t\t\te.getMessage();\n\t\t\t}\n\t}", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tprogressDialog = ProgressDialog.show(SearchView.this, \"Espere...\", \"Recebendo dados\", true, true);\n\t\t\tprogressDialog.setOnCancelListener(new CancelTaskOnCancelListener(this));\n\t\t}", "protected void onPostExecute(String message) {\n // dismiss the dialog once done\n super.onPostExecute(message);\n\n progressDialog.dismiss();\n jumpToMainActivity();\n //message 为接收doInbackground的返回值\n }", "@Override\n\tprotected void onPostExecute(String result) {\n\t\tsuper.onPostExecute(result);\n\t\tmDialog.dismiss();\n\t}", "@Override\n\t\tprotected void onCancelled() {\n\t\t\tsuper.onCancelled();\n\t\t\tdialog.dismiss();\n\t\t}", "@Override\n\t\tprotected void onCancelled() {\n\t\t\tsuper.onCancelled();\n\t\t\tdialog.dismiss();\n\t\t}", "@Override\n protected void onPreExecute() {\n if (mProgressDialog != null) {\n mProgressDialog.show();\n }\n }", "@Override\n\t\tpublic void onCancel(DialogInterface dialog) {\n\t\t\tmProgressHUD.dismiss();\t\n\t\t}", "@Override\r\n\t\tpublic void onCancel(DialogInterface dialog) {\n\t\t\tmProgressHUD.dismiss();\r\n\t\t}", "@Override\r\n\t\tpublic void onCancel(DialogInterface dialog) {\n\t\t\tmProgressHUD.dismiss();\r\n\t\t}", "@Override\n\t\t\tprotected void onPreExecute() {\n\t\t\t\tsuper.onPreExecute();\n\t\t\t\tmProgressDialog = new ProgressDialog(getActivity());\n\t\t\t\tmProgressDialog.setCanceledOnTouchOutside(false);\n\t\t\t\tmProgressDialog.setCancelable(false);\n\t\t\t\tmProgressDialog.show();\n\t\t\t}", "@Override\n protected void onPreExecute() {\n\n pd.setMessage(\"Please Wait....\");\n pd.show();\n pd.setCancelable(false);\n\n }", "@Override\n\t\tpublic void onCancel(DialogInterface dialog) {\n\t\t\tmProgressHUD.dismiss();\n\t\t}", "@Override\n\t\tpublic void onCancel(DialogInterface dialog) {\n\t\t\tmProgressHUD.dismiss();\n\t\t}", "@Override\n\t\tpublic void onCancel(DialogInterface dialog) {\n\t\t\tmProgressHUD.dismiss();\n\t\t}", "@Override\n protected void onPreExecute() {\n Dialog.setMessage(\"Downloading Stock Adjustment..\");\n Dialog.setCancelable(false);\n Dialog.show();\n }", "@Override\n public void onDetach() {\n if (progressDialog != null && progressDialog.isShowing()) {\n progressDialog.dismiss();\n }\n super.onDetach();\n }", "public void dismissSavingHint() {\n if (this.mProgressDialog != null && this.mProgressDialog.isShowing()) {\n this.mProgressDialog.dismiss();\n }\n }", "private void hideProgress() {\n if (dialogProgress != null) {\n dialogProgress.dismiss();\n dialogProgress = null;\n }\n }", "@Override\n protected void callAfterDataBack(HemaNetTask netTask) {\n cancelProgressDialog();\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n showProgressDialog(R.string.please_wait);\n //showDialog(progress_bar_type);\n }", "protected void onPreExecute() {\n // Display the progress dialog on async task start\n // mProgressDialog.show();\n }", "@Override\n public void run() {\n waitDialog.dismiss();\n\n //show an error dialog\n\n\n }", "@Override\n\t\tpublic void onCancel(DialogInterface dialog) {\n\t\t\n\t\t\tmProgressHUD.dismiss();\n\t\t\t\n\t\t}", "@Override\n public void onDestroy() {\n dismissProgressDialog();\n super.onDestroy();\n }", "@Override\n protected void onPreExecute() {\n\n dialog = new ProgressDialog(AddFoodAdvActivity.this);\n dialog.setMessage(\"Please Wait...!\");\n dialog.show();\n super.onPreExecute();\n }", "@Override\n protected void onPostExecute(String s) {\n super.onPostExecute(s);\n dialog.dismiss(); // to stop showing the progressbar After process is completed\n tvResult.setText(s);\n tvResult.setVisibility(View.VISIBLE);\n Toast.makeText(MainActivity.this, \"Process Done\", Toast.LENGTH_SHORT).show();\n\n }", "protected void onPreExecute(){\n // Display the progress dialog on async task start\n // mProgressDialog.show();\n }", "public static void hideProgressDialog() {\n try {\n if (PROGRESS_DIALOG != null) {\n PROGRESS_DIALOG.dismiss();\n }\n } catch(Exception ignored) {}\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n\n /* mProgress.setMessage(\"Please Wait\");\n mProgress.setCancelable(false);\n mProgress.show();*/\n String msg = \"Please Wait....\";\n cd.showProgressDialog(msg);\n }", "@SuppressLint(\"NewApi\") @Override\n\t\t\t\t\tprotected void onPreExecute() {\n\t\t\t\t\t\tsuper.onPreExecute();\n\t\t\t\t\t\t// Shows Progress Bar Dialog and then call doInBackground method\n\t\t\t\t\t\tshowDialog(progress_bar_type);\n\t\t\t\t\t\t\n\t\t\t\t\t\tprgDialog.setProgress(0);\n\t\t\t\t\t\t\n\t\t\t\t\t\t// \n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t// ===============================================\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t}", "protected void onPostExecute(String file_url) {\n // dismiss the dialog once done\n pDialog.dismiss();\n }", "@Override\n protected void onPreExecute() {\n// mProgressDialog = new ProgressDialog(DeviceConnectActivity.this);\n// mProgressDialog\n// .setMessage(\"Esptouch is configuring, please wait for a moment...\");\n// mProgressDialog.setCanceledOnTouchOutside(false);\n// mProgressDialog.setOnCancelListener(new DialogInterface.OnCancelListener() {\n// @Override\n// public void onCancel(DialogInterface dialog) {\n// synchronized (mLock) {\n// if (__IEsptouchTask.DEBUG) {\n// Log.i(TAG, \"progress dialog is canceled\");\n// }\n// if (mEsptouchTask != null) {\n// mEsptouchTask.interrupt();\n// }\n// }\n// }\n// });\n// mProgressDialog.setButton(DialogInterface.BUTTON_POSITIVE,\n// \"Waiting...\", new DialogInterface.OnClickListener() {\n// @Override\n// public void onClick(DialogInterface dialog, int which) {\n// }\n// });\n// mProgressDialog.show();\n// mProgressDialog.getButton(DialogInterface.BUTTON_POSITIVE)\n// .setEnabled(false);\n }", "protected void onPostExecute(String file_url) {\r\n\t\t\t// dismiss the dialog once done\r\n\t\t\tpDialog.dismiss();\r\n\t\t}" ]
[ "0.7633279", "0.7601489", "0.7586698", "0.754777", "0.7509033", "0.7509033", "0.7443056", "0.7425983", "0.73980045", "0.73965484", "0.7380501", "0.7345959", "0.7341082", "0.7321036", "0.7312464", "0.73121625", "0.73121625", "0.73121625", "0.72893476", "0.7242116", "0.7210768", "0.7194336", "0.71744865", "0.71744865", "0.71677476", "0.71613663", "0.7143775", "0.71222955", "0.7096281", "0.70756304", "0.70693576", "0.7062955", "0.70554155", "0.69773656", "0.69622326", "0.6931291", "0.6927898", "0.6926343", "0.6926343", "0.690871", "0.6877102", "0.6870339", "0.6869772", "0.6860131", "0.68534005", "0.68245614", "0.6796521", "0.6792541", "0.67854553", "0.6781766", "0.67761856", "0.67521286", "0.673769", "0.6726813", "0.67208725", "0.6717228", "0.67014885", "0.67005116", "0.6684799", "0.6672408", "0.6657144", "0.665707", "0.6646932", "0.6642557", "0.6642525", "0.661583", "0.66150475", "0.6612711", "0.66057205", "0.66015035", "0.6601433", "0.6597073", "0.6597073", "0.6592354", "0.65637374", "0.6535263", "0.6535263", "0.6532281", "0.65297896", "0.6520676", "0.6520676", "0.6520676", "0.6519782", "0.65188843", "0.6514936", "0.6504127", "0.65026873", "0.6498122", "0.6495968", "0.64933074", "0.64927447", "0.64884746", "0.64856154", "0.6480857", "0.64802957", "0.6473947", "0.6469109", "0.6468756", "0.6467531", "0.646724", "0.6466224" ]
0.0
-1
We won't be able to run more then a single test in the same JVM instance unless we do some tidying and unregister a logging mbean added by Dropwizard.
private void unRegisterLoggingMBean() throws Exception { MBeanServer server = ManagementFactory.getPlatformMBeanServer(); ObjectName loggerObjectName = new ObjectName("com.yammer:type=Logging"); if (server.isRegistered(loggerObjectName)) { server.unregisterMBean(loggerObjectName); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void tearDown() {\n getLocalLogService().clear(); \n }", "@AfterClass\n public static void stop() {\n }", "@BeforeClass\n\tpublic static void setup() {\n\t\tgetLogManager().init();\n\t}", "protected void runAfterTest() {}", "@Override\n protected void runTest() throws Throwable {\n TestHelper.annotationMockSupportSetup(getClass(), getName(), mockSupport);\n\n // The deployment of processes denoted by @Deployment should\n // be done after the setup(). After all, the mockups must be\n // configured in the engine before the actual deployment happens\n deploymentId = TestHelper.annotationDeploymentSetUp(processEngine, getClass(), getName());\n\n super.runTest();\n\n // Remove deployment\n TestHelper.annotationDeploymentTearDown(processEngine, deploymentId, getClass(), getName());\n\n // Reset mocks\n TestHelper.annotationMockSupportTeardown(mockSupport);\n }", "protected void tearDown() throws Exception {\r\n super.tearDown();\r\n // remove the namespace\r\n ConfigManager cm = ConfigManager.getInstance();\r\n for (Iterator <?> iter = cm.getAllNamespaces(); iter.hasNext();) {\r\n String nameSpace = (String) iter.next();\r\n if (nameSpace.equals(\"com.topcoder.util.log\")) {\r\n continue;\r\n }\r\n cm.removeNamespace(nameSpace);\r\n }\r\n processor = null;\r\n }", "@After\n public void tearDown() {\n Configurator.setLevel(Main.class.getPackage().getName(), Level.INFO);\n }", "@Before\n public void setUp() {\n Log.getFindings().clear();\n Log.enableFailQuick(false);\n }", "@After\r\n public void tearDown() throws Exception {\r\n org.apache.log4j.LogManager.shutdown();\r\n new File(TestsHelper.LOG_FILE).delete();\r\n }", "@After\n public void assertNoUnexpectedLog() {\n loggings.assertNoUnexpectedLog();\n }", "@After\n public void assertNoUnexpectedLog() {\n loggings.assertNoUnexpectedLog();\n }", "@After\n\tpublic void reset() {\n\t\tWhitebox.setInternalState(TinylogLogger.class, ProviderRegistry.getLoggingProvider());\n\t}", "@BeforeAll\n public static void init() {\n LogStub.init();\n Log.enableFailQuick(false);\n }", "@After\r\n public void tearDown() throws Exception {\r\n super.tearDown();\r\n TestHelper.cleanupEnvironment();\r\n instance = null;\r\n }", "protected void setUp() throws Exception {\n\t\tTestUtils.configureLogging();\r\n\r\n\t\t// delete all tmp files ...\r\n\t\tthis.tmpDir = new TmpDirectory(\"howllogger\");\r\n\t\tthis.tmpDir.clear();\r\n\r\n\t\tthis.tmpDir = new TmpDirectory(\"howllogger\");\r\n\t\tSystem.getProperties().setProperty(\"howl.log.logFileDir\",\r\n\t\t\t\tthis.tmpDir.getDirectory().getCanonicalPath());\r\n\r\n\t}", "@AfterSuite\n public static void teardown() {\n Reporter.loadXMLConfig(new File(\"src/main/resources/extent-config.xml\"));\n Reporter.setSystemInfo(\"user\", System.getProperty(\"user.name\"));\n Reporter.setSystemInfo(\"os\", System.getProperty(\"os.name\"));\n Reporter.setSystemInfo(\"Selenium\", \"3.4.0\");\n Reporter.setSystemInfo(\"Cucumber\", \"1.2.5\");\n }", "@AfterClass\n public static void tearDownClass() {\n ApplicationSessionManager.getInstance().stopSession();\n }", "public void setUp() {\n threadName = Thread.currentThread().getName();\n }", "@Override\n public void tearDown() {\n setName(caseLabel + '-' + getName());\n\n if (env != null) {\n try {\n closeAll();\n } catch (Throwable e) {\n System.out.println(\"During tearDown: \" + e);\n }\n }\n envHome = null;\n env = null;\n store = null;\n caseCls = null;\n caseObj = null;\n caseLabel = null;\n\n /* Do not delete log files so they can be used by 2nd phase of test. */\n }", "@AfterEach\n public void tearDown() throws Exception\n {\n\n application = null;\n config = null;\n externalContext = null;\n if (facesContext != null)\n {\n facesContext.release();\n }\n facesContext = null;\n lifecycle = null;\n lifecycleFactory = null;\n renderKit = null;\n request = null;\n response = null;\n servletContext = null;\n session = null;\n FactoryFinder.releaseFactories();\n ResourceBundleVarNames.resetNames();\n\n tearDownClassloader();\n }", "@AfterClass\n public static void afterClass() throws Exception\n {\n Ejb3McRegistrarTestCase.setBootstrap(null);\n }", "@After\n\tpublic void tearDown() throws Exception {\n\t\tSystem.setOut(null);\n\t\tSystem.setErr(null);\n\n\t}", "@AfterClass\n public static void shutdown()\n {\n }", "@AfterClass(alwaysRun = true)\n public void stopEnvironment() {\n \ttry {\n al.closeMongoDbConnection();\n \t} catch (Exception e) {\n\t\t\tfail(e.toString());\n\t\t\t}\n }", "public void tearDown() {\n System.setProperty(\"java.class.version\", jvmVersion);\n System.setProperty(\"java.vendor\", vendor);\n }", "@After\n public void tearDown() throws Exception {\n processEngineConfiguration.setHistoryEventHandler(originalHistoryEventHandler);\n }", "@AfterSuite\n public void afterSuite() throws IOException {\n for (ObjectName mbean : _server.queryNames(null, null)) {\n try {\n _server.unregisterMBean(mbean);\n } catch (Exception e) {\n // OK\n }\n }\n\n synchronized (ZkTestBase.class) {\n // Close all ZK resources\n _baseDataAccessorMap.values().forEach(BaseDataAccessor::close);\n _clusterSetupMap.values().forEach(ClusterSetup::close);\n _helixZkClientMap.values().forEach(HelixZkClient::close);\n _zkServerMap.values().forEach(TestHelper::stopZkServer);\n }\n }", "@AfterClass\n public static void tear() {\n System.out.println(\"*** After class ***\");\n }", "public void tearDown() throws Exception {\n\n super.tearDown();\n\n Thread.currentThread().setName(threadName);\n }", "@AfterClass\n public static void tearDownClass() throws Exception {\n if (!RunningOnGithubAction.isRunningOnGithubAction()) {\n Connection connection = getSnowflakeAdminConnection();\n connection\n .createStatement()\n .execute(\n \"alter system set\"\n + \" master_token_validity=default\"\n + \",session_token_validity=default\"\n + \",SESSION_RECORD_ACCESS_INTERVAL_SECS=default\");\n connection.close();\n }\n }", "@BeforeClass\n\tpublic static void setup() {\n\t\tLogger root = (Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME);\n\t\troot.setLevel(Level.INFO);\n\t}", "@AfterClass\n public void cleanUp() {\n }", "@Test\npublic void testAppend() throws Exception { \n Syslog.Append(\"SylogTest\",\"testAppend\",\"Test ok\");\n}", "@Override\n public final void preTearDown() throws Exception {\n Invoke.invokeInEveryVM(() -> ConcurrentIndexUpdateWithoutWLDUnitTest.destroyRegions());\n Invoke.invokeInEveryVM(CacheTestCase::closeCache);\n }", "@AfterClass\r\n public static void tearDown() throws Exception {\r\n instance = null;\r\n }", "@After\n public void tearDown() throws Exception {\n testInstance = null;\n }", "@BeforeClass\n public static void startup()\n {\n _shutdown();\n }", "protected void tearDown() throws Exception {\n TestHelper.clearConfig();\n super.tearDown();\n }", "@Override\r\n public void tearDown() throws Exception {\r\n super.tearDown();\r\n clearSqlLogHandler();\r\n }", "protected void setUp() throws Exception {\r\n instance = new LoggingInterceptor();\r\n }", "@Test\n public void testStopListening() {\n System.out.println(\"stopListening\");\n instance.stopListening();\n }", "@After\n public void tearDown() {\n System.out.flush();\n System.setOut(originalPrintStream);\n log.log(Level.INFO, \"\\n\" + bout.toString());\n }", "@Before\n public void setup() {\n mServerContext = mock(ServerContext.class);\n mServerRouter = mock(IServerRouter.class);\n mChannelHandlerContext = mock(ChannelHandlerContext.class);\n mBatchProcessor = mock(BatchProcessor.class);\n mStreamLog = mock(StreamLog.class);\n mCache = mock(LogUnitServerCache.class);\n\n // Initialize with newDirectExecutorService to execute the server RPC\n // handler methods on the calling thread.\n when(mServerContext.getExecutorService(anyInt(), anyString()))\n .thenReturn(MoreExecutors.newDirectExecutorService());\n\n // Initialize basic LogUnit server parameters.\n when(mServerContext.getServerConfig())\n .thenReturn(ImmutableMap.of(\n \"--cache-heap-ratio\", \"0.5\",\n \"--memory\", false,\n \"--no-sync\", false));\n\n // Prepare the LogUnitServerInitializer.\n LogUnitServer.LogUnitServerInitializer mLUSI = mock(LogUnitServer.LogUnitServerInitializer.class);\n when(mLUSI.buildStreamLog(\n any(LogUnitServerConfig.class),\n eq(mServerContext),\n any(BatchProcessorContext.class)\n )).thenReturn(mStreamLog);\n\n when(mLUSI.buildLogUnitServerCache(any(LogUnitServerConfig.class), eq(mStreamLog))).thenReturn(mCache);\n when(mLUSI.buildStreamLogCompaction(mStreamLog)).thenReturn(mock(StreamLogCompaction.class));\n when(mLUSI.buildBatchProcessor(\n any(LogUnitServerConfig.class),\n eq(mStreamLog),\n eq(mServerContext),\n any(BatchProcessorContext.class)\n )).thenReturn(mBatchProcessor);\n\n logUnitServer = new LogUnitServer(mServerContext, mLUSI);\n }", "private HeaderBrandingTest()\n\t{\n\t\tBaseTest.classLogger = LoggerFactory.getLogger( HeaderBrandingTest.class );\n\t}", "void start() throws TestFailed\n {\n this.startSkeletons();\n }", "@Before public void setUp() {\n\t\tsetUp(new ParallelLogger());\n\t}", "@After\n\t// named differently than tearDown(), so subclasses do not override it\n\tpublic void dockingTearDown() {\n\t\tConcurrentTestExceptionHandler.disable();\n\t}", "@AfterSuite(alwaysRun = true)\n public static void finishSuite() {\n /*\n The following instruction is used to tell log4j which file the log will be written to depending\n on the thread name. The thread name is used as the value threadId that is used as the routing\n key in the routing appender. Check the log4j2.xml config file.\n For more info check here:\n https://stackoverflow.com/questions/8355847/how-to-log-multiple-threads-in-different-log-files\n http://logging.apache.org/log4j/2.x/faq.html#separate_log_files\n */\n ThreadContext.put(THREAD_ID, Thread.currentThread().getName());\n\n int index = 0;\n for (DriverFactory webDriverThread : webDriverThreadPool) {\n logger.trace(\"Quit WebDriver {}\", index);\n index++;\n webDriverThread.quitDriver();\n }\n logger.trace(\"Remove WebDriver from ThreadLocal\");\n driverThread.remove();\n }", "@After\n public void tearDown() {\n System.out.flush();\n }", "@Test\n public void testShutdownHook() {\n JVMUtils.closeAtShutdown(() -> {\n });\n }", "protected void tearDown() {\n config = null;\n }", "@Test\n public void configure()\n {\n String message = \"This message should be logged\";\n \n LoggingBean loggingBean = new LoggingBean();\n loggingBean.log(message);\n assertTrue(SYSTEM_OUT_REDIRECT.toString().contains(message));\n }", "@BeforeEach\n\tpublic void initDbManagerThreadInstance() throws Exception {\n\t\tDbManager.setThreadInstance(dbManager);\n\t}", "@AfterAll\n public static void tearDownClass() {\n }", "@AfterAll\n public static void tearDownClass() {\n }", "@AfterAll\n public static void tearDownClass() {\n }", "@AfterAll\n public static void tearDownClass() {\n }", "@AfterAll\n public static void tearDownClass() {\n }", "@AfterAll\n public static void tearDownClass() {\n }", "@AfterAll\n public static void tearDownClass() {\n }", "@AfterAll\n public static void tearDownClass() {\n }", "@AfterAll\n public static void tearDownClass() {\n }", "@AfterAll\n public static void tearDownClass() {\n }", "@AfterMethod(alwaysRun = true)\n public void cleanupTest() throws Exception {\n busService.getBus().unregister(testListener);\n busService.getBus().stop();\n \n // STOP NOTIFICATION QUEUE\n ((Engine)entitlementService).stop();\n\n log.warn(\"DONE WITH TEST\\n\");\n }", "@Override\n\t@Ignore\n\t@Test\n\tpublic void testLaunchThenKill() throws Throwable {\n\t}", "@AfterClass\n public static void shutDown() {\n // \"override\" parent shutDown\n }", "@After\n public void tearDown() throws MalformedObjectNameException {\n mBeanServerRegistrationUtility.dispose();\n cacheManager.shutdown();\n }", "@BeforeClass\npublic static void setLogger() {\n System.setProperty(\"log4j.configurationFile\",\"./src/test/resources/log4j2-testing.xml\");\n log = LogManager.getLogger(LocalArtistIndexTest.class);\n}", "@AfterClass\n public static void teardown() {\n app = null;\n\n }", "@AfterClass\r\n\tpublic static void testCleanup() {\r\n\t\tConfig.teardown();\r\n\t}", "protected void tearDown() throws Exception {\r\n super.tearDown();\r\n FailureTestHelper.unloadConfig();\r\n }", "@Before\n public void setUp() {\n start(fakeApplication(inMemoryDatabase(), fakeGlobal()));\n }", "public void tearDown() {\n instance = null;\n }", "@After\n public void performanceTearDown() {\n try {\n Thread.sleep(300);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }", "@AfterClass\n\tpublic static void testCleanup() {\n\t}", "protected void tearDown() throws Exception {\n actionManager = null;\n TestHelper.clearConfig();\n super.tearDown();\n }", "public void setUp() {\n instance = new LogMessage(type, id, operator, message, error);\n }", "@After\n public void tearDown()\n throws Exception\n {\n cronTaskEventListenerRegistry.removeListener(this);\n }", "@AfterSuite\r\n\tpublic void tearDown() {\r\n\t\tSystem.out.println(\"Driver teared down\");\r\n\t}", "protected void forceMockUpMode(){\n teardown();\n }", "@AfterClass\n public static void tearDownClass() {\n System.out.println(\"Acabant tests\");\n }", "@Test\r\n public void oneMoreTest() {\n ConfigureAppender.configureFileAppender(\"oneMoreTest\");\r\n LOG.info(\"Other test\");\r\n LOG.debug(\"Checking the configuration of the file appender\");\r\n\r\n byte[] biteArray;\r\n try {\r\n// biteArray = FileUtils.readFileToByteArray(new File(System.getProperty(\"user.dir\") + \"/Log4j/oneMoreTest1.log\"));\r\n biteArray = FileUtils.readFileToByteArray(new File(System.getProperty(\"user.dir\") + \"/Log4j/oneMoreTest.log\"));\r\n } catch (IOException ex){\r\n biteArray = null;\r\n }\r\n Allure.getLifecycle().addAttachment(\"Other Test logs\", \"text/plain\", \"log\", biteArray);\r\n }", "@BeforeClass\n public static void beforeClass()\n throws Exception\n {\n LoggerConfiguration.logSetup();\n }", "@AfterClass\n static public void tearDownClass() {\n logger.info(\"Completed Example Code Unit Tests.\\n\");\n }", "protected void tearDown() {\n testEnv.close();\n }", "@Override\n public void afterEach(ExtensionContext context) throws Exception {\n if (!failedBoot) {\n RestAssuredURLManager.clearURL();\n TestScopeManager.tearDown(true);\n }\n }", "@AfterClass\n public static void tearDownClass() {\n }", "@AfterClass\n public static void tearDownClass() {\n }", "public void testCheckAndRestoreIfNeeded_failure()\n {\n // SETUP\n String host = \"localhost\";\n int port = 1234;\n String service = \"doesn'texist\";\n MockCacheEventLogger cacheEventLogger = new MockCacheEventLogger();\n\n RegistryKeepAliveRunner runner = new RegistryKeepAliveRunner( host, port, service );\n runner.setCacheEventLogger( cacheEventLogger );\n\n // DO WORK\n runner.checkAndRestoreIfNeeded();\n\n // VERIFY\n // 1 for the lookup, one for the rebind since the server isn't created yet\n assertEquals( \"error tally\", 2, cacheEventLogger.errorEventCalls );\n //System.out.println( cacheEventLogger.errorMessages );\n }", "@BeforeSuite\n public void beforeSuite() throws Exception {\n java.util.logging.Logger topJavaLogger = java.util.logging.Logger.getLogger(\"\");\n topJavaLogger.setLevel(Level.WARNING);\n\n // Due to ZOOKEEPER-2693 fix, we need to specify whitelist for execute zk commends\n System.setProperty(\"zookeeper.4lw.commands.whitelist\", \"*\");\n System.setProperty(SystemPropertyKeys.CONTROLLER_MESSAGE_PURGE_DELAY, \"3000\");\n\n // Start in-memory ZooKeepers\n // If multi-ZooKeeper is enabled, start more ZKs. Otherwise, just set up one ZK\n int numZkToStart = 1;\n String multiZkConfig = System.getProperty(MULTI_ZK_PROPERTY_KEY);\n if (multiZkConfig != null && multiZkConfig.equalsIgnoreCase(Boolean.TRUE.toString())) {\n String numZkFromConfig = System.getProperty(NUM_ZK_PROPERTY_KEY);\n if (numZkFromConfig != null) {\n try {\n numZkToStart = Math.max(Integer.parseInt(numZkFromConfig), numZkToStart);\n } catch (Exception e) {\n Assert.fail(\"Failed to parse the number of ZKs from config!\");\n }\n } else {\n Assert.fail(\"multiZk config is set but numZk config is missing!\");\n }\n }\n\n // Start \"numZkFromConfigInt\" ZooKeepers\n for (int i = 0; i < numZkToStart; i++) {\n startZooKeeper(i);\n }\n\n // Set the references for backward-compatibility with a single ZK environment\n _zkServer = _zkServerMap.get(ZK_ADDR);\n _gZkClient = _helixZkClientMap.get(ZK_ADDR);\n _gSetupTool = _clusterSetupMap.get(ZK_ADDR);\n _baseAccessor = _baseDataAccessorMap.get(ZK_ADDR);\n\n // Clean up all JMX objects\n for (ObjectName mbean : _server.queryNames(null, null)) {\n try {\n _server.unregisterMBean(mbean);\n } catch (Exception e) {\n // OK\n }\n }\n }", "@AfterClass\n\tpublic static void tearDownClass() {\n\t\tTEST_ENVIRONMENT.stopServer();\n\t\tTEST_ENVIRONMENT.tearDownDb();\n\t}", "@Test\n public void testStartup() {}", "@Test\n public void shouldStartupIfGlobalShutdownDisabledAndReuseDisabledAndCloseOnFailEnabled() {\n when(this.config.shutDownWebdriver()).thenReturn(false);\n when(this.config.reuseWebDriver()).thenReturn(false);\n when(this.config.closeVisualWebDriveronFail()).thenReturn(true);\n\n this.context.setFailed();\n this.std.basePreScenarioSetup();\n\n verify(this.factory).createWebDriver();\n }", "@AfterClass\n public void stop() throws Exception {\n super.finalize();\n }", "@Before\r\n public void init() throws Exception {\r\n // Create a test listener that traces the test execution, and make sure it is used by the tests to\r\n // record their calls\r\n tracingTestListener = new TracingTestListener(originalTestListener);\r\n\r\n UnitilsJUnit3TestBase.setTracingTestListener(tracingTestListener);\r\n SpringUnitilsJUnit38TestBase.setTracingTestListener(tracingTestListener);\r\n\r\n UnitilsJUnit4TestBase.setTracingTestListener(tracingTestListener);\r\n SpringUnitilsJUnit4TestBase.setTracingTestListener(tracingTestListener);\r\n\r\n InjectionUtils.injectInto(tracingTestListener, Unitils.getInstance(), \"testListener\");\r\n }", "@Test\r\n\tpublic void logTest() {\r\n\t\tlogger.info(\"Testando info\");\r\n\t\tlogger.debug(\"nao sera logado\" + \"Nice\");\r\n\t\tlogger.error(\"This is Error message\", new Exception(\"Testing\"));\r\n\t}", "@BeforeClass\r\n\tpublic static void setupSystem() {\r\n\t\tSystemActions.logSystemInfo();\r\n\t\tSystemActions.updateSettings();\r\n\t}", "@AfterClass\n public static void tearDownClass() throws Exception {\n TestHelper.stopServer(serverSyncObject);\n TestHelper.deleteViewStore();\n TestHelper.removeArchiveFiles();\n LOGGER.log(Level.INFO, \"Ending test class\");\n }", "@Override\n @Before\n public void setUp() throws Exception {\n System.setProperty(\"org.apache.activemq.transport.AbstractInactivityMonitor.keepAliveTime\", \"2\");\n this.realStore = true;\n super.setUp();\n }", "@Test (timeout=180000)\n public void testErrorReporter() throws Exception {\n try {\n MockErrorReporter.calledCount = 0;\n doFsck(conf, false);\n assertEquals(MockErrorReporter.calledCount, 0);\n\n conf.set(\"hbasefsck.errorreporter\", MockErrorReporter.class.getName());\n doFsck(conf, false);\n assertTrue(MockErrorReporter.calledCount > 20);\n } finally {\n conf.set(\"hbasefsck.errorreporter\",\n PrintingErrorReporter.class.getName());\n MockErrorReporter.calledCount = 0;\n }\n }" ]
[ "0.64213866", "0.616278", "0.5937899", "0.5936695", "0.5916012", "0.5898709", "0.58901626", "0.58670855", "0.58637327", "0.58565104", "0.58565104", "0.5785071", "0.57608", "0.57216245", "0.57126486", "0.56874317", "0.56836784", "0.56711525", "0.5668021", "0.5663358", "0.5659116", "0.5638993", "0.56345505", "0.5632251", "0.5623425", "0.5611354", "0.5610956", "0.5594358", "0.5588285", "0.5573881", "0.5569713", "0.55625653", "0.5557968", "0.5552026", "0.55488515", "0.5547738", "0.5543861", "0.5543656", "0.554334", "0.55312407", "0.5524746", "0.5523499", "0.55222446", "0.55211186", "0.5516937", "0.5509646", "0.5508901", "0.55069596", "0.55068654", "0.55061644", "0.55004746", "0.55002445", "0.5500126", "0.5496485", "0.5496485", "0.5496485", "0.5496485", "0.5496485", "0.5496485", "0.5496485", "0.5496485", "0.5496485", "0.5496485", "0.54909414", "0.5490881", "0.54862857", "0.54705536", "0.54601306", "0.5458561", "0.54566044", "0.5447388", "0.5444446", "0.5438669", "0.5417795", "0.5415582", "0.5414997", "0.54072666", "0.53887486", "0.53778774", "0.5374126", "0.5368893", "0.53591007", "0.53528064", "0.5350612", "0.5345561", "0.5341681", "0.5337492", "0.5337492", "0.53370243", "0.5336441", "0.53222364", "0.5321708", "0.53174585", "0.5316527", "0.5315032", "0.5314509", "0.5305301", "0.5298766", "0.529629", "0.5287348" ]
0.62056375
1
Segment an image based on color ranges.
private void rgbThreshold(Mat input, double[] red, double[] green, double[] blue, Mat out) { Imgproc.cvtColor(input, out, Imgproc.COLOR_BGR2RGB); Core.inRange(out, new Scalar(red[0], green[0], blue[0]), new Scalar(red[1], green[1], blue[1]), out); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private Mat segmentRedColor(Mat bgr) {\n Mat mask1 = new Mat();\n Mat mask2 = new Mat();\n Mat normal = new Mat();\n Mat hsv = new Mat();\n Imgproc.cvtColor(bgr, hsv, Imgproc.COLOR_BGR2HSV, 3);\n inRange(hsv, new Scalar(0, 120, 50), new Scalar(MAX_COLOR_CHANNEL_OFFSET, 255, 255), mask1);\n inRange(hsv, new Scalar(170, 120, 50), new Scalar(180, 255, 255), mask2);\n Core.bitwise_or(mask1, mask2, normal);\n return mask1;\n }", "public static Image segmentarImagen(Image imagen, int u1, int u2){\n BufferedImage bi = AbrirImagen.toBufferedImage(imagen);\n Color color, colorFondo;\n colorFondo = new Color(255,255,255);\n for(int x=0; x<bi.getWidth();x++)\n for(int y=0; y<bi.getHeight();y++){\n color = new Color(bi.getRGB(x, y));\n int prom = (color.getRed()+ color.getGreen()+color.getBlue())/3;\n if (!(prom>= u1 && prom<=u2)){\n bi.setRGB(x,y,colorFondo.getRGB());\n }\n\n }\n return AbrirImagen.toImage(bi);\n }", "public abstract Color getRegionColor(double[] offset, double[] size);", "@Override\n public Color getRegionColor(double[] offset, double[] size) {\n double[] sums = new double[4];\n double area = 0;\n\n int leftIntInside = (int)offset[0];\n if (leftIntInside < offset[0]) leftIntInside++;\n int topIntInside = (int)offset[1];\n if (topIntInside < offset[1]) topIntInside++;\n int rightIntInside = (int)(size[0] + offset[0]);\n int botIntInside = (int)(size[1] + offset[1]);\n \n // Whole internal pixels\n for (int y = topIntInside; y < botIntInside; y++) {\n for (int x = leftIntInside; x < rightIntInside; x++) {\n int[] pix = MeUtils.intToARGB(getPixel(x, y));\n for (int i = 0; i < 4; i++) {\n sums[i] += pix[i];\n }\n }\n }\n // Assuming non-negative area....\n area += (rightIntInside - leftIntInside) * (botIntInside - topIntInside);\n \n // Left edge\n for (int y = topIntInside; y < botIntInside; y++) {\n double x = offset[0];\n double width = leftIntInside - x;\n int[] pix = MeUtils.intToARGB(getPixel((int)x, y));\n for (int i = 0; i < 4; i++) {\n sums[i] += (pix[i] * width);\n }\n } \n // Assuming non-negative area....\n area += (leftIntInside - offset[0]) * (botIntInside - topIntInside);\n\n // Right edge\n for (int y = topIntInside; y < botIntInside; y++) {\n double x = rightIntInside;\n double width = (offset[0] + size[0]) - x;\n int[] pix = MeUtils.intToARGB(getPixel((int)x, y));\n for (int i = 0; i < 4; i++) {\n sums[i] += (pix[i] * width);\n }\n } \n // Assuming non-negative area....\n area += (offset[0] + size[0] - rightIntInside) * (botIntInside - topIntInside);\n\n // Top edge\n for (int x = leftIntInside; x < rightIntInside; x++) {\n double y = offset[1];\n double height = topIntInside - y;\n int[] pix = MeUtils.intToARGB(getPixel(x, (int)y));\n for (int i = 0; i < 4; i++) {\n sums[i] += (pix[i] * height);\n }\n } \n // Assuming non-negative area....\n area += (rightIntInside - leftIntInside) * (topIntInside - offset[1]);\n\n // Bottom edge\n for (int x = leftIntInside; x < rightIntInside; x++) {\n double y = botIntInside;\n double height = (offset[1] + size[1]) - y;\n int[] pix = MeUtils.intToARGB(getPixel(x, (int)y));\n for (int i = 0; i < 4; i++) {\n sums[i] += (pix[i] * height);\n }\n } \n // Assuming non-negative area....\n area += (rightIntInside - leftIntInside) * (offset[1] + size[1] - botIntInside);\n \n // Top left corner\n {\n double x = offset[0];\n double y = offset[1];\n double width = leftIntInside - x;\n double height = topIntInside - y;\n int[] pix = MeUtils.intToARGB(getPixel((int)x, (int)y));\n for (int i = 0; i < 4; i++) {\n sums[i] += (pix[i] * width * height);\n }\n }\n // Assuming non-negative area....\n area += (leftIntInside - offset[0]) * (topIntInside - offset[1]);\n\n // Top right corner\n {\n double x = rightIntInside;\n double y = offset[1];\n double width = (offset[0] + size[0]) - x;\n double height = topIntInside - y;\n int[] pix = MeUtils.intToARGB(getPixel((int)x, (int)y));\n for (int i = 0; i < 4; i++) {\n sums[i] += (pix[i] * width * height);\n }\n }\n // Assuming non-negative area....\n area += (offset[0] + size[0] - rightIntInside) * (topIntInside - offset[1]);\n \n // Bottom left corner\n {\n double x = offset[0];\n double y = botIntInside;\n double width = leftIntInside - x;\n double height = (offset[1] + size[1]) - y;\n int[] pix = MeUtils.intToARGB(getPixel((int)x, (int)y));\n for (int i = 0; i < 4; i++) {\n sums[i] += (pix[i] * width * height);\n }\n }\n // Assuming non-negative area....\n area += (leftIntInside - offset[0]) * (offset[1] + size[1] - botIntInside);\n\n // Bottom right corner\n {\n double x = rightIntInside;\n double y = botIntInside;\n double width = (offset[0] + size[0]) - x;\n double height = (offset[1] + size[1]) - y;\n int[] pix = MeUtils.intToARGB(getPixel((int)x, (int)y));\n for (int i = 0; i < 4; i++) {\n sums[i] += (pix[i] * width * height);\n }\n }\n // Assuming non-negative area....\n area += (offset[0] + size[0] - rightIntInside) * (offset[1] + size[1] - botIntInside);\n \n float[] avg = new float[sums.length];\n for (int i = 0; i < 4; i++) {\n // Also scaling to [0,1]\n avg[i] = (float)((sums[i] / area) / 0xFF);\n }\n \n return new Color(MeMath.bound(avg[1], 0, 1), MeMath.bound(avg[2], 0, 1), MeMath.bound(avg[3], 0, 1), MeMath.bound(avg[0], 0, 1));\n }", "public void sepia(BufferedImage img, int startX, int startY, int endX, int endY) throws IOException{\r\n\r\n int pixels[] = new int[3];\r\n double ww[]=new double[3];\r\n WritableRaster raster = img.getRaster();\r\n \r\n for(int i=startX;i<endX;i++) {\r\n \r\n for(int j=startY;j<endY;j++){\r\n \r\n raster.getPixel(i, j, pixels);\r\n \r\n ww[0]=(0.393*pixels[0]+0.769*pixels[1]+0.189*pixels[2])/1.351;\r\n ww[1]=(0.349*pixels[0]+0.686*pixels[1]+0.186*pixels[2])/1.203;\r\n ww[2]=(0.272*pixels[0]+0.534*pixels[1]+0.131*pixels[2])/2.140;\r\n \r\n raster.setPixel(i, j, ww);\r\n \r\n }\r\n \r\n }\r\n\r\n\r\n }", "private Mat segmentRedColorViaInverting(Mat bgr) {\n Mat bgrInverted = new Mat();\n Mat hsvInverted = new Mat();\n Mat maskInv = new Mat();\n Core.bitwise_not(bgr, bgrInverted);\n Imgproc.cvtColor(bgrInverted, hsvInverted, Imgproc.COLOR_BGR2HSV);\n inRange(hsvInverted, new Scalar(90 - MAX_COLOR_CHANNEL_OFFSET, 70, 50), new Scalar(90 + MAX_COLOR_CHANNEL_OFFSET, 255, 255), maskInv);\n return maskInv;\n }", "public void toBlue(BufferedImage img, int startX, int startY, int endX, int endY) throws IOException{\r\n int pixels[] = new int[3];\r\n double ww[]=new double[3];\r\n WritableRaster raster = img.getRaster();\r\n \r\n for(int i=startX;i<endX;i++) {\r\n \r\n for(int j=startY;j<endY;j++){\r\n \r\n raster.getPixel(i, j, pixels);\r\n \r\n ww[0] = 0*pixels[0];\r\n ww[1] = 0*pixels[1];\r\n ww[2] = pixels[2];\r\n \r\n raster.setPixel(i, j, ww);\r\n \r\n }\r\n \r\n }\r\n\r\n \r\n\r\n }", "public void toGreen(BufferedImage img, int startX, int startY, int endX, int endY) throws IOException{\r\n int pixels[] = new int[3];\r\n double ww[]=new double[3];\r\n WritableRaster raster = img.getRaster();\r\n \r\n for(int i=startX;i<endX;i++) {\r\n \r\n for(int j=startY;j<endY;j++){\r\n \r\n raster.getPixel(i, j, pixels);\r\n \r\n ww[0] = 0*pixels[0];\r\n ww[1] = pixels[1];\r\n ww[2] = 0*pixels[2];\r\n \r\n raster.setPixel(i, j, ww);\r\n \r\n }\r\n \r\n }\r\n\r\n \r\n\r\n }", "public void grayScale(BufferedImage img, int startX, int startY, int endX, int endY) throws IOException{\r\n\r\n int pixels[] = new int[3];\r\n double ww[]=new double[3];\r\n WritableRaster raster = img.getRaster();\r\n \r\n \r\n for(int i=startX;i<endX;i++) {\r\n for(int j=startY;j<endY;j++){\r\n \r\n \r\n raster.getPixel(i, j, pixels);\r\n \r\n ww[0] = 0.299*pixels[0]+0.587*pixels[1]+0.114*pixels[2];\r\n ww[1] = 0.299*pixels[0]+0.587*pixels[1]+0.114*pixels[2];\r\n ww[2] = 0.299*pixels[0]+0.587*pixels[1]+0.114*pixels[2];\r\n \r\n raster.setPixel(i, j, ww);\r\n \r\n }\r\n \r\n }\r\n\r\n \r\n }", "public RGBImage makeRGBImage()\r\n {\r\n\tint rows = getHeight();\r\n\tint cols = getWidth();\r\n \r\n\tshort[][] red = new short[rows][cols]; \r\n\tshort[][] green = new short[rows][cols]; \r\n\tshort[][] blue = new short[getHeight()][getWidth()]; \r\n \r\n\t@SuppressWarnings(\"unused\")\r\n\tdouble H, S, I;\r\n\tshort v1, v2, v3, h, h0, sat, intens;\r\n\tint sector;\r\n\r\n\tfor (int row = 0; row < rows; row++)\r\n\t{\r\n\t for (int col = 0; col < cols; col++)\r\n\t {\r\n\r\n\t\tif (saturation[row][col] == 0)\r\n\t\t{\r\n\t\t red[row][col] = intensity[row][col];\r\n\t\t green[row][col] = intensity[row][col];\r\n\t\t blue[row][col] = intensity[row][col];\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t h0 = hue[row][col];\r\n\r\n\t\t if (h0 <= (L-1)/3)\r\n\t\t {\r\n\t\t\th = (short)h0;\r\n\t\t\tsector = 1;\r\n\t\t }\r\n\t\t else if (h0 <= 2*(L-1)/3)\r\n\t\t {\r\n\t\t\th = (short)(h0 - (L-1)/3);\r\n\t\t\tsector = 2;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\th = (short)(h0 - 2*(L-1)/3);\r\n\t\t\tsector = 3;\r\n\t\t }\r\n\r\n\t\t H = h * 2 * Math.PI / (L-1);\r\n\r\n\t\t sat = saturation[row][col];\r\n\t\t S = (double)sat / (L-1);\r\n\r\n\t\t intens = intensity[row][col]; \r\n\t\t I = (double)intens / (L-1);\r\n\r\n\t\t v1 = (short)Math.round(intens * (1 - S));\r\n\t\t v1 = checkInterval (v1);\r\n\r\n\t\t v2 = (short)Math.round(intens * (1 + S * Math.cos(H)/\r\n\t\t\t\t\t\t Math.cos(Math.PI/3 - H) ));\r\n\t\t v2 = checkInterval (v2);\r\n \r\n\t\t v3 = (short)Math.round(3 * intens - (v1 + v2));\r\n\t\t v3 = checkInterval (v3);\r\n \r\n\t\t if (sector == 1)\r\n\t\t {\r\n\t\t\tblue[row][col] = v1;\r\n\t\t\tred[row][col] = v2;\r\n\t\t\tgreen[row][col] = v3;\r\n\t\t }\r\n\t\t else if (sector == 2)\r\n\t\t {\r\n\t\t\tred[row][col] = v1;\r\n\t\t\tgreen[row][col] = v2;\r\n\t\t\tblue[row][col] = v3;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\tgreen[row][col] = v1;\r\n\t\t\tblue[row][col] = v2;\r\n\t\t\tred[row][col] = v3;\r\n\t\t }\r\n\t\t}\r\n\t }\r\n\t}\r\n \r\n\treturn new RGBImage (red, green, blue);\r\n }", "public void grayscale(int start, int end)\n {\n Pixel[] originPixel = this.getPixels();\n int colorIntensity =0;\n //loop through all pixels in the calling object and parameter \n for(int index=start;index<=end;index++){\n colorIntensity = (int) ((originPixel[index].getRed() + originPixel[index].getGreen() \n +originPixel[index].getBlue()) / 3);\n originPixel[index].setGreen(colorIntensity);\n originPixel[index].setBlue(colorIntensity);\n originPixel[index].setRed(colorIntensity); \n }\n \n }", "void handlePixelStart(int x, int y, int color);", "public void toRed(BufferedImage img, int startX, int startY, int endX, int endY) throws IOException{\r\n int pixels[] = new int[3];\r\n double ww[]=new double[3];\r\n WritableRaster raster = img.getRaster();\r\n \r\n for(int i=startX;i<endX;i++) {\r\n for(int j=startY;j<endY;j++){\r\n \r\n \r\n raster.getPixel(i, j, pixels);\r\n \r\n ww[0] = pixels[0];\r\n ww[1] = 0*pixels[1];\r\n ww[2] = 0*pixels[2];\r\n \r\n raster.setPixel(i, j, ww);\r\n \r\n }\r\n \r\n }\r\n\r\n \r\n\r\n }", "protected void reduceBitmapMode(BufferedImage img, int xoffs, int yoffs) {\n \t\t@SuppressWarnings(\"unchecked\")\n \t\tMap<Integer, Integer>[] histograms = new Map[(img.getWidth() + 7) / 8];\n \t\t@SuppressWarnings(\"unchecked\")\n \t\tMap<Integer, Integer>[] histogramSides = new Map[(img.getWidth() + 7) / 8];\n \t\t\n \t\t// be sure we select the 8 pixel groups sensibly\n \t\tif ((xoffs & 7) > 3)\n \t\t\txoffs = (xoffs + 7) & ~7;\n \t\telse\n \t\t\txoffs = xoffs & ~7;\n \t\t\n \t\tint width = img.getWidth();\n \t\tfor (int y = 0; y < img.getHeight(); y++) {\n \t\t\t// first scan: get histogram for each range\n \t\t\t\n \t\t\tfor (int x = 0; x < width; x += 8) {\n \t\t\t\tMap<Integer, Integer> histogram = new HashMap<Integer, Integer>();\n \t\t\t\tMap<Integer, Integer> histogramSide = new HashMap<Integer, Integer>();\n \t\t\t\t\n \t\t\t\thistograms[x / 8] = histogram;\n \t\t\t\thistogramSides[x / 8] = histogramSide;\n \t\t\t\t\n \t\t\t\tint maxx = x + 8 < width ? x + 8 : width;\n \t\t\t\t\n \t\t\t\tint scmx;\n \t\t\t\tint scmn;\n \t\t\t\t\n \t\t\t\t// scan outside the 8 pixels to get a broader\n \t\t\t\t// idea of what colors are important\n \t\t\t\tscmn = Math.max(0, x - 4);\n \t\t\t\tscmx = Math.min(width, maxx + 4);\n \t\t\t\t\n \t\t\t\tint pixel = 0;\n \t\t\t\tfor (int xd = scmn; xd < scmx; xd++) {\n \t\t\t\t\tif (xd < width)\n \t\t\t\t\t\tpixel = img.getRGB(xd, y);\n \t\t\t\t\t\n \t\t\t\t\tMap<Integer, Integer> hist = (xd >= x && xd < maxx) ? histogram : histogramSide;\n \t\t\t\t\t\n \t\t\t\t\tInteger cnt = hist.get(pixel);\n \t\t\t\t\tif (cnt == null)\n \t\t\t\t\t\tcnt = 1;\n \t\t\t\t\telse\n \t\t\t\t\t\tcnt++;\n \t\t\t\t\t\n \t\t\t\t\thist.put(pixel, cnt);\n \t\t\t\t}\n \t\t\t}\n \t\t\t\n \t\n \t\t\tfor (int x = 0; x < width; x += 8) {\n \t\t\t\tMap<Integer, Integer> histogram = histograms[x / 8];\n \t\t\t\tMap<Integer, Integer> histogramSide = histogramSides[x / 8];\n \t\t\t\t\n \t\t\t\tint maxx = x + 8 < width ? x + 8 : width;\n \t\t\t\t\n \t\t\t\t// get prominent colors, weighing colors that also\n \t\t\t\t// appear in surrounding pixels higher \n \t\t\t\tList<Pair<Integer, Integer>> sorted = new ArrayList<Pair<Integer,Integer>>();\n \t\t\t\tfor (Map.Entry<Integer, Integer> entry : histogram.entrySet()) {\n \t\t\t\t\tInteger c = entry.getKey();\n \t\t\t\t\tint cnt = entry.getValue() * 2;\n \t\t\t\t\tInteger scnt = histogramSide.get(c);\n \t\t\t\t\tif (scnt != null)\n \t\t\t\t\t\tcnt += scnt;\n \t\t\t\t\tsorted.add(new Pair<Integer, Integer>(c, cnt));\n \t\t\t\t}\n \t\t\t\tCollections.sort(sorted, new Comparator<Pair<Integer, Integer>>() {\n \t\n \t\t\t\t\t@Override\n \t\t\t\t\tpublic int compare(Pair<Integer, Integer> o1,\n \t\t\t\t\t\t\tPair<Integer, Integer> o2) {\n \t\t\t\t\t\treturn o2.second - o1.second;\n \t\t\t\t\t}\n \t\t\t\t\t\n \t\t\t\t});\n \t\n \t\t\t\tint fpixel, bpixel;\n \t\t\t\tif (sorted.size() >= 2) {\n \t\t\t\t\tfpixel = sorted.get(0).first;\n \t\t\t\t\tbpixel = sorted.get(1).first;\n \t\t\t\t} else {\n \t\t\t\t\tfpixel = bpixel = sorted.get(0).first;\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\tint newPixel = 0;\n \t\t\t\tfor (int xd = x; xd < maxx; xd++) {\n \t\t\t\t\tif (xd < width)\n \t\t\t\t\t\tnewPixel = img.getRGB(xd, y);\n \t\t\t\t\t\n \t\t\t\t\tif (newPixel != fpixel && newPixel != bpixel) {\n \t\t\t\t\t\tif (fpixel < bpixel) {\n \t\t\t\t\t\t\tnewPixel = newPixel <= fpixel ? fpixel : bpixel;\n \t\t\t\t\t\t} else {\n \t\t\t\t\t\t\tnewPixel = newPixel < bpixel ? fpixel : bpixel;\n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t\t\t\n \t\t\t\t\timageData.setPixel(xd + xoffs, y + yoffs, newPixel);\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t}", "private static void normalizeColor(BufferedImage image) {\n\t\tHashMap<Integer, Integer> counts = colorHistogram(image);\r\n\t\tInteger[] a=sortmap(counts); // sorting the map\r\n\t\tInteger minFreq = 1000;\r\n\t\tfor (Integer i: counts.keySet()) {\r\n\t\t\tif (counts.get(i) < minFreq) {\r\n\t\t\t\tminFreq = counts.get(i);\r\n\t\t\t}\r\n\t\t}\r\n\t\t/*\r\n\t\t*\r\n\t\t*Main logic to normalise the code\r\n\t\t* Assumption: all the colors which start from edges are the noise to the captcha or background.\r\n\t\t*/\r\n\t\tArrayList<Integer> topValues = new ArrayList<>();\r\n\t\tfor (Integer i: counts.keySet()) {\r\n\t\t\ttopValues.add(i); // adding all the colors into the the array list topValues without any condition\r\n\t\t}\r\n\t\tInteger[] out=findEdgecolors(image); // findEdgecolors function returns the array of RGB values of colors which are at the edges of the picture\r\n\t\tfor(int i=0;i<out.length;i++)\r\n\t\t{\r\n\t\t\tif(out[i]!=null)\r\n\t\t\t\ttopValues.remove(out[i]); // remove the colours from topValues list if the color exist in the array returned by the findEdgecolors funciton (removing the colors which start from edges)\r\n\t\t}\r\n\t\t/*\r\n\t\t*Now topvalues consists of colors which are not in the edges of the clipped image\r\n\t\t*/\r\n\t\tint white_rgb = Color.YELLOW.getRGB();\r\n\t\tint black_rgb = Color.BLACK.getRGB();\r\n\r\n\t\tfor (int x=0; x<image.getWidth(); x++) {\r\n\t\t\tfor (int y=0; y<image.getHeight(); y++) {\r\n\t\t\t\tint pixelVal = image.getRGB(x, y);\r\n\r\n\t\t\t\tif (!topValues.contains(pixelVal)) {\r\n\t\t\t\t\timage.setRGB(x, y, white_rgb); //replacing the colors in topvalue with black\r\n\t\t\t\t} else {\r\n\t\t\t\t\timage.setRGB(x, y, black_rgb); // rest is colored with yellow (background)\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif (debug) {\r\n\t\t\ttry {\r\n\t\t\t\tImageIO.write(image, \"gif\", new File(\"colorNormalized.gif\"));\r\n\t\t\t} catch (Exception e) {e.printStackTrace();}\r\n\t\t}\r\n\t}", "@Override\n public void process(int lower, int upper) {\n ImgProcessing.sepia(lower, upper);\n }", "private static BufferedImage highlightBlock(BufferedImage img, int x, int y, int height, int width, int color) {\n\n for (int i = (int) (x); i <= x + width; i++) {\n for (int j = (int) (y); j <= y + height; j++) {\n try {\n if (i == x + width || j == y + height || j == y || i == x) {\n img.setRGB(i, j, 0x000000);\n } else {\n img.setRGB(i, j, (int) (color ^ img.getRGB(i, j)));\n }\n\n } //if there was an out of bounds its because of the size doubling, ignore it\n catch (ArrayIndexOutOfBoundsException e) {\n }\n }\n }\n\n return img;\n }", "void handlePixelEnd(int x, int y, int color);", "int[] getEndRGB();", "@SuppressWarnings(\"unused\")\r\n private void JCATsegmentSubcutaneousFat2D() {\r\n \r\n // a buffer to store a slice from the source Image\r\n short[] srcBuffer;\r\n try {\r\n srcBuffer = new short [sliceSize];\r\n } catch (OutOfMemoryError error) {\r\n System.gc();\r\n MipavUtil.displayError(\"JCATsegmentVisceralFat2D(): Can NOT allocate srcBuffer\");\r\n return;\r\n }\r\n \r\n // get the data from the segmented abdomenImage and the srcImage\r\n try {\r\n abdomenImage.exportData(0, sliceSize, sliceBuffer);\r\n srcImage.exportData(0, sliceSize, srcBuffer);\r\n } catch (IOException ex) {\r\n// System.err.println(\"JCATsegmentVisceralFat2D(): Error exporting data\");\r\n MipavUtil.displayError(\"JCATsegmentVisceralFat2D(): Error exporting data\");\r\n return;\r\n }\r\n \r\n // find the center of mass of the single label object in the sliceBuffer (abdomenImage)\r\n findAbdomenCM();\r\n\r\n // Use the CM, the abdomenImage, and the srcImage to define points on the\r\n // abdomen and visceral VOI's\r\n ArrayList<Integer> xArrAbdom = new ArrayList<Integer>();\r\n ArrayList<Integer> yArrAbdom = new ArrayList<Integer>();\r\n ArrayList<Integer> xArrVis = new ArrayList<Integer>();\r\n ArrayList<Integer> yArrVis = new ArrayList<Integer>();\r\n findVOIs(centerOfMass, xArrAbdom, yArrAbdom, srcBuffer, xArrVis, yArrVis);\r\n \r\n int[] x1 = new int[xArrAbdom.size()];\r\n int[] y1 = new int[xArrAbdom.size()];\r\n int[] z1 = new int[xArrAbdom.size()];\r\n for(int idx = 0; idx < xArrAbdom.size(); idx++) {\r\n x1[idx] = xArrAbdom.get(idx);\r\n y1[idx] = yArrAbdom.get(idx);\r\n z1[idx] = 0;\r\n }\r\n\r\n // make the VOI's and add the points to them\r\n abdomenVOI = new VOI((short)0, \"Abdomen\");\r\n abdomenVOI.importCurve(x1, y1, z1);\r\n \r\n\r\n for(int idx = 0; idx < xArrVis.size(); idx++) {\r\n x1[idx] = xArrVis.get(idx);\r\n y1[idx] = yArrVis.get(idx);\r\n }\r\n\r\n subcutaneousVOI = new VOI((short)0, \"Subcutaneous area\");\r\n subcutaneousVOI.importCurve(x1, y1, z1);\r\n \r\n/*\r\n ViewUserInterface.getReference().getMessageFrame().append(\"Xcm: \" +xcm +\" Ycm: \" +ycm);\r\n sliceBuffer[ycm * xDim + xcm] = 20;\r\n for (int idx = 0; idx < xArr.size(); idx++) {\r\n sliceBuffer[yArr.get(idx) * xDim + xArr.get(idx)] = 20;\r\n sliceBuffer[yArrVis.get(idx) * xDim + xArrVis.get(idx)] = 30;\r\n }\r\n // save the sliceBuffer into the abdomenImage\r\n try {\r\n abdomenImage.importData(0, sliceBuffer, false);\r\n } catch (IOException ex) {\r\n System.err.println(\"segmentThighTissue(): Error importing data\");\r\n }\r\n*/\r\n// ShowImage(srcImage, \"Segmented Abdomen\");\r\n\r\n\r\n// ViewUserInterface.getReference().getMessageFrame().append(\"Abdomen VOI points:\");\r\n// for (int idx = 0; idx < xArr.size(); idx++) {\r\n// ViewUserInterface.getReference().getMessageFrame().append(xArr.get(idx) +\" \" + yArr.get(idx));\r\n// }\r\n\r\n }", "private void traverseBayeredPatternHalfSizeRGB(){\n int originalPositionX = 0;\n int originalPositionY = 1;\n\n for (int newX = 0; originalPositionX < originalImageHeight -1; newX++){\n for (int newY = 0; originalPositionY < originalImageWidth -1; newY++){\n Point newPosition = new Point(newX,newY);\n int newAbsoultPosition = getAbsolutPixelPosition(newPosition, originalImageHeight / 2, originalImageWidth / 2);\n halfSizePixRGB[newAbsoultPosition] = getAverageRGB(new Point(originalPositionX,originalPositionY));\n originalPositionY += 2;\n }\n originalPositionY = 0;\n originalPositionX += 2;\n }\n }", "int[] getStartRGB();", "@Override\npublic Image operate (Image source)\n{\n final Image thresholdImage = NIVision\n .imaqCreateImage(ImageType.IMAGE_U8, 0);\n\n // @TODO: Store NIVision.Range instead of integers so we don't make a\n // new one every time.\n NIVision.imaqColorThreshold(thresholdImage, source, 255,\n NIVision.ColorMode.HSL, this.hueRange, this.satRange,\n this.lumRange);\n source.free();\n return thresholdImage;\n}", "@Override\r\n public void draw(final BufferedImage image) {\r\n for (int i = xStart; i < xStart + length; i++) {\r\n for (int j = yStart; j < yStart + height; j++) {\r\n if (i >= image.getWidth()) {\r\n break;\r\n } else if (j >= image.getHeight()) {\r\n break;\r\n }\r\n if (i == xStart) {\r\n image.setRGB(i, j, rgbaLat.getRGB());\r\n continue;\r\n } else if (j == yStart) {\r\n image.setRGB(i, j, rgbaLat.getRGB());\r\n continue;\r\n } else if (i == xStart + length - 1) {\r\n image.setRGB(i, j, rgbaLat.getRGB());\r\n continue;\r\n } else if (j == yStart + height - 1) {\r\n image.setRGB(i, j, rgbaLat.getRGB());\r\n continue;\r\n }\r\n image.setRGB(i, j, rgbaInt.getRGB());\r\n }\r\n }\r\n }", "public void myFilter(int start, int end)\n {\n Pixel[] originPixel = this.getPixels();\n //loop through all pixels in the calling object and parameter \n for(int index=start;index<=end;index++){\n originPixel[index].setGreen(originPixel[index].getBlue());\n originPixel[index].setBlue(originPixel[index].getRed());\n originPixel[index].setRed(originPixel[index].getGreen()); \n }\n }", "private int reduceColorSize(int oldColor, int colorRange) {\n return (int) Math.floor((oldColor / colorRange)) * colorRange;\n }", "public native int getColorspace() throws MagickException;", "protected ColorHistogram processColorHistogram(int[] imageData, int height, int width, int numBands) {\r\n\r\n\t\t// The color histogram\r\n\t\tColorHistogram colorHistogram = new ColorHistogram();\r\n\t\t// A single pixel value\r\n\t\tfloat[] pixel = new float[numBands];\r\n\t\t\r\n\t\t// For each pixel in the image...\r\n\t\tfor(int h=0;h<height;h++) {\r\n\t\t\tfor(int w=0;w<width;w++) {\r\n\t\t\t\t// Get a pixel (as a single array).\r\n\t\t\t\tint index = (h*width+w)*numBands;\r\n\t\t\t\tfor(int b=0;b<numBands;b++) {\r\n\t\t\t\t\tpixel[b] = imageData[index+b];\r\n\t\t\t\t}\r\n\t\t\t\tColor colorPixel = new Color(pixel);\r\n\t \r\n\t\t\t\t// Tally the pixel inforation\r\n\t\t\t\tcolorHistogram.countPixel(colorPixel);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn colorHistogram;\r\n\t}", "public void segment(int K) //K is the number of desired segments\n {\n if(K<2)\n {\n throw new IllegalArgumentException(new String(\"! Error: K should be greater than 1, current K=\"+K));\n }\n\n int width = this.image.getWidth();\n int height = this.image.getHeight();\n\n //Todo: Your code here (remove this line)\n \n //Hint: the algorithm is not fast and you are processing many pixels \n // (e.g., 10,000 pixel for a small 100 by 100 image)\n // output a \".\" every 100 unions so you get some progress updates.\n }", "public void paintNormalized(){\n\t\t\n\t\tint min = 99999;\n\t\tint max = 0;\n\t\t\n\t\tfor (int i=0; i < ranges.size(); i++){\n\t\t\tif ((ranges.elementAt(i).getMin()) < min){\n\t\t\t\tmin = ranges.elementAt(i).getMin();\n\t\t\t}\n\t\t\tif ((ranges.elementAt(i).getMax()) > max){\n\t\t\t\tmax = ranges.elementAt(i).getMax();\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Once I've got them, the paint is simple, because Positioner.getAssociatedPosition() returns\n\t\t// the exact pixel where the color has to be painted\n\t\t\n\t\tPositioner positions = new Positioner(drawingPanel.getHeight(), min, max);\n\t\t\n\t\tint i = 1;\n\t\tBufferedImage img = new BufferedImage(drawingPanel.getWidth(), drawingPanel.getHeight(), BufferedImage.TYPE_INT_ARGB);\n\t\t\t\t\n\t\twhile (i <= ranges.size()){\n\t\t\tpaintBufferedSolid(ranges.elementAt(ranges.size()-i).getColor(),positions.getAssociatedPosition(ranges.elementAt(ranges.size()-i).getMax()) , positions.getAssociatedPosition(ranges.elementAt(ranges.size()-i).getMin()), img);\n\t\t\ti++;\n\t\t}\n\n\t\t\t\n\t\t\n\t\tdrawingPanel.getGraphics().drawImage(img, 0, 0, img.getWidth(), img.getHeight(), null);\n\t\t\n\t\t// Painting the ranges\n\t\t\n\t\trangesPanel.removeAll();\t\t\t// Clears rangePanel\n\t\t\n\t\tJLabel currentRange;\n\t\t\n\t\tcurrentRange = new JLabel(Integer.toString(ranges.elementAt(0).getMin()));\n\t\tcurrentRange.setHorizontalAlignment(SwingConstants.RIGHT);\n\t\tcurrentRange.setBounds(35, rangesPanel.getHeight()-16, 60, 16);\n\t\t\n\t\t\n\t\trangesPanel.add(currentRange);\n\t\tint last = rangesPanel.getHeight()-16;\n\t\tint aux;\n\t\tfor (int j = 0; j < ranges.size(); j++){\n\t\t\taux = positions.getAssociatedPosition(ranges.elementAt(j).getMax());\n\t\t\tcurrentRange = new JLabel(Integer.toString(ranges.elementAt(j).getMax()));\n\t\t\tcurrentRange.setHorizontalAlignment(SwingConstants.RIGHT);\n\t\t\tif (aux+16 < last){\n\t\t\t\tcurrentRange.setBounds(35, aux, 60, 16);\n\t\t\t\tlast = aux;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tcurrentRange.setBounds(35, last-16, 60, 16);\n\t\t\t\tlast = last - 16;\n\t\t\t}\n\t\t\t\t\n\t\t\trangesPanel.add(currentRange);\n\t\t}\n\t\t\n\t\trangesPanel.repaint();\n\t}", "@Override\n protected List<Segment> getSegments() {\n return Arrays.asList(\n new Segment(55.2, 55.8, Color.rgb(238, 23, 104)),\n new Segment(56.2, 56.6, Color.rgb(238, 23, 104)),\n new Segment(58.4, 59.9, Color.rgb(184, 92, 184)));\n }", "void draw() {\n\n // SeamInfo lowestSeam = this.lowestSeamVert();\n // lowestSeam.changeColor();\n\n ComputedPixelImage seamRemovedImg = new ComputedPixelImage(this.newImg.width,\n this.newImg.height);\n int countRow = 0;\n int countCol = 0;\n\n Pixel current = this.curPixel;\n Pixel temp;\n\n while (current.down != null) {\n temp = current.down;\n while (current.right != null) {\n Color c = Color.MAGENTA;\n if (current.highlighted) {\n c = Color.RED;\n }\n else {\n c = current.color;\n }\n if (this.showType.equals(\"e\")) {\n int energy = (int) (current.energy * 100);\n if (energy > 255) {\n System.out.println(\"energy: \" + energy + \" to 255\");\n energy = 255;\n }\n c = new Color(energy, energy, energy);\n }\n else if (this.showType.equals(\"w\")) {\n int weight = (int) (current.seam.totalWeight);\n if (weight > 255) {\n System.out.println(\"weight: \" + weight + \" to 255\");\n weight = 255;\n }\n c = new Color(weight, weight, weight);\n }\n\n seamRemovedImg.setColorAt(countCol, countRow, c);\n countCol += 1;\n current = current.right;\n }\n countCol = 0;\n countRow += 1;\n current = temp;\n }\n countCol = 0;\n\n this.newImg = seamRemovedImg;\n\n }", "public void fromRGBImage(RGBImage image)\r\n {\r\n\tshort[][] red = image.getRed();\r\n\tshort[][] green = image.getGreen();\r\n\tshort[][] blue = image.getBlue();\r\n\r\n\tint rows = image.getHeight();\r\n\tint cols = image.getWidth();\r\n\r\n\tthis.hue = new short[rows][cols];\r\n\tthis.saturation = new short[rows][cols];\r\n\tthis.intensity = new short[rows][cols];\r\n \r\n\t@SuppressWarnings(\"unused\")\r\n\tdouble H, S, I;\r\n\t@SuppressWarnings(\"unused\")\r\n\tshort sector, r, g, b, h, t;\r\n\tdouble sum, t1, t2, theta, minrgb;\r\n\r\n\tfor (int row = 0; row < rows; row++)\r\n\t{\r\n\t for (int col = 0; col < cols; col++)\r\n\t {\r\n\t\tr = red[row][col];\r\n\t\tg = green[row][col];\r\n\t\tb = blue[row][col];\r\n\t\tsum = r + g + b;\r\n\r\n\t\tif (r == g && r == b)\r\n\t\t{\r\n\t\t // black, gray or white\r\n\t\t hue[row][col] = (short)0;\r\n\t\t saturation[row][col] = (short)0;\r\n\t\t intensity[row][col] = (short)((r + g + b)/3);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n \r\n\t\t if (g == 0 && b == 0)\r\n\t\t {\r\n\t\t\t// only red\r\n\t\t\tt = 0;\r\n\t\t }\r\n\t\t else if ((r == 0 && b == 0) || (b == 0 && g == 0))\r\n\t\t {\r\n\t\t\t// only green or blue\r\n\t\t\tt = (L-1)/3;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\tt1 = 0.5 * ((r-g) + (r-b));\r\n\t\t\tt2 = Math.sqrt((r-g)*(r-g) + (r-b)*(g-b));\r\n\t\t\ttheta = Math.acos (t1/t2);\r\n\t\t\tt = (short)((L-1) * theta/(2*Math.PI));\r\n\t\t }\r\n\r\n\t\t if (b <= g)\r\n\t\t\thue[row][col] = t;\r\n\t\t else\r\n\t\t\thue[row][col] = (short)((L-1) - t);\r\n\r\n\t\t minrgb = r;\r\n\t\t if (g < minrgb)\r\n\t\t\tminrgb = g;\r\n\t\t if (b < minrgb)\r\n\t\t\tminrgb = b;\r\n \r\n\t\t saturation[row][col] = (short)\r\n\t\t\t((L-1)*(1 - minrgb*3.0/sum));\r\n\t\t intensity[row][col] = (short)(sum / 3.0);\r\n\t\t}\r\n\t }\r\n\t}\r\n\r\n }", "private native int grayToRgb(byte src[],int dst[]);", "public void divideImage() {\n\n int chunkWidth = 70;\n int chunkHeight = 70;\n int count = 0;\n imgs = new BufferedImage[100];\n for (int x = 0; x < 10; x++)\n for (int y = 0; y < 10; y++) {\n\n try{\n\n imgs[count] = new BufferedImage(chunkWidth, chunkHeight, img.getType());\n Graphics2D gr = imgs[count++].createGraphics();\n gr.drawImage(img, 0, 0, chunkWidth, chunkHeight, chunkWidth * y, chunkHeight * x, chunkWidth * y + chunkWidth, chunkHeight * x + chunkHeight, null);\n gr.dispose();\n\n } catch (Exception e){\n\n // e.printStackTrace();\n\n }\n\n }\n\n }", "@SuppressWarnings(\"unused\")\r\n private void JCATsegmentVisceralFat2D01() {\r\n \r\n // get the VOI for the external boundary of the abdomen\r\n VOIVector vois = abdomenImage.getVOIs();\r\n if(vois.size() != 1) {\r\n System.err.println(\"segmentVisceralFat2D() Error, did not get 1 VOI\");\r\n return;\r\n }\r\n\r\n // abdomenImage has one VOI, lets get it\r\n VOI theVOI = vois.get(0);\r\n \r\n // find the center-of-mass of the contour\r\n VOIContour maxContour = ((VOIContour)theVOI.getCurves().get(0));\r\n int[] xVals = new int [maxContour.size()];\r\n int[] yVals = new int [maxContour.size()];\r\n int[] zVals = new int [maxContour.size()];\r\n maxContour.exportArrays(xVals, yVals, zVals);\r\n \r\n int xcm = 0, ycm = 0, zcm = 0;\r\n for (int idx = 0; idx < maxContour.size(); idx++) {\r\n xcm += xVals[idx];\r\n ycm += yVals[idx];\r\n zcm += zVals[idx];\r\n }\r\n \r\n xcm /= maxContour.size();\r\n ycm /= maxContour.size();\r\n zcm /= maxContour.size();\r\n \r\n ViewUserInterface.getReference().getMessageFrame().append(\"Xcm: \" +xcm +\" Ycm: \" +ycm +\" Zcm: \" +zcm+\"\\n\", ViewJFrameMessage.DEBUG);\r\n \r\n // This point should be inside the abdomen\r\n // walk right until you find the external border of the abdomen\r\n \r\n // update the volumeBitSet to match the closed abdomenImage\r\n short[] srcSliceBuffer = new short[sliceSize];\r\n short[] profile = new short[xDim];\r\n try {\r\n abdomenImage.exportData(0, sliceSize, sliceBuffer);\r\n srcImage.exportData(0, sliceSize, srcSliceBuffer);\r\n } catch (IOException ex) {\r\n System.err.println(\"Error exporting data\");\r\n return;\r\n }\r\n\r\n int x = xcm;\r\n int elementCount = 0;\r\n int yOffset = ycm * xDim;\r\n while (x < xDim && sliceBuffer[x + yOffset] == abdomenTissueLabel) {\r\n profile[elementCount] = srcSliceBuffer[x + yOffset];\r\n x++;\r\n elementCount++;\r\n } // end while(...)\r\n \r\n // profile has an intensity profile of the pixels along the ray from the \r\n // contour CM to the external skin boundary. \r\n \r\n \r\n }", "public void contrast(BufferedImage img, int startX, int startY, int endX, int endY) throws IOException{\r\n int pixels[] = new int[3];\r\n double ww[]=new double[3];\r\n WritableRaster raster = img.getRaster();\r\n double c = 1.1;\r\n \r\n for(int i=startX;i<endX;i++) {\r\n \r\n for(int j=startY;j<endY;j++){\r\n \r\n raster.getPixel(i, j, pixels);\r\n \r\n ww[0]=pixels[0];\r\n ww[1]=pixels[1];\r\n ww[2]=pixels[2];\r\n \r\n ww[0]=ww[0]-128;\r\n ww[1]=ww[1]-128;\r\n ww[2]=ww[2]-128;\r\n \r\n ww[0]=ww[0]*c;\r\n ww[1]=ww[1]*c;\r\n ww[2]=ww[2]*c;\r\n \r\n \r\n \r\n \r\n raster.setPixel(i, j, ww);\r\n \r\n }\r\n \r\n }\r\n\r\n }", "private void writeImage(final byte[] data, final int length)\n {\n final int size = this.colorIndexes.length;\n\n for (int i = 0; (i < length) && (this.pix < size); i++)\n {\n this.colorIndexes[this.pix] = data[i] & 0xFF;\n\n this.xx++;\n this.pix++;\n\n if (this.xx >= this.width)\n {\n this.xx = 0;\n\n if (this.interlaced)\n {\n this.yy += ImageDescriptorBlock.passJump[this.passIndex];\n\n if (this.yy >= this.height)\n {\n this.passIndex = Math.min(3, this.passIndex + 1);\n this.yy = ImageDescriptorBlock.passStart[this.passIndex];\n }\n\n this.pix = this.yy * this.width;\n }\n else\n {\n this.yy++;\n }\n }\n }\n }", "void imageData(int width, int height, int[] rgba);", "protected abstract void toSpace( float[] rgb );", "public ColorField(int rStart, int gStart, int bStart, int alphaStart, int rEnd, int gEnd, int bEnd, int alphaEnd) {\n this.rStart = rStart;\n this.gStart = gStart;\n this.bStart = bStart;\n this.alphaStart = alphaStart;\n this.rEnd = rEnd;\n this.gEnd = gEnd;\n this.bEnd = bEnd;\n this.alphaEnd = alphaEnd;\n int r = Math.abs(rStart - rEnd) / (colors.length);\n int g = Math.abs(gStart - gEnd) / (colors.length);\n int b = Math.abs(bStart - bEnd) / (colors.length);\n int alpha = Math.abs(alphaStart - alphaEnd) / (colors.length);\n for (int i = 0; i < colors.length; i++) {\n colors[i] = new Color(rStart + r * i, gStart + g * i, bStart + b * i, alphaStart + alpha * i);\n // System.out.println(colors[i].alpha);\n }\n }", "private void bufferImageGrey()\n {\n int col = 0;\n int[][] heightmap = parent.normaliseMap(parent.getPreviewMap(), 255);\n \n bufferedImage = createImage(heightmap.length, heightmap[0].length);\n Graphics bg = bufferedImage.getGraphics();\n for(int i = 0; i < heightmap.length; i ++) {\n for(int j = 0; j < heightmap[i].length - 1; j++) {\n col = heightmap[i][j];\n if(col > 255)\n col = 255;\n bg.setColor(new Color(col, col, col));\n bg.drawLine(i, j, i, j);\n }\n }\n }", "public void setColorRange(Color color, \r\n\t\t\t\t\t\t\t int minPercentValue, int maxPercentValue) {\r\n\r\n\t\tint minBarIndex = round(meterGranularity * minPercentValue);\r\n\t\tint maxBarIndex = round(meterGranularity * maxPercentValue);\r\n\r\n\t\tfor (int index=Math.max(minBarIndex - 1, 0); index < maxBarIndex; index++) {\r\n\t\t\tint barOffset = (numberOfSections - 1) - index;\r\n\t\t\tbarColors[barOffset] = color;\r\n\t\t}\r\n\t}", "public static void plotSnappedSegments(Grid g, Segment[] segs,\n Color segColor, Color hotPixelColor, Color listColor) {\n// vp vp = TestBed.view();\n IPoint2[] hp = extractSnapPoints(segs, null);\n if (segColor != null) {\n V.pushColor(segColor);\n if (Main.highDetail()) {\n for (int i = 0; i < hp.length; i++) {\n FPoint2 worldPt2 = g.toView(hp[i]);\n SnapUtils.render(worldPt2);\n }\n }\n\n for (int i = 0; i < segs.length; i++) {\n Segment s = segs[i];\n FPoint2 prev = null;\n for (int j = 0; j < s.nSnapPoints(); j++) {\n FPoint2 next = g.toView(s.getSnapPoint(j));\n if (prev != null)\n V.drawLine(prev, next);\n prev = next;\n }\n }\n V.popColor();\n }\n\n if (hotPixelColor != null) {\n V.pushColor(hotPixelColor);\n for (int i = 0; i < hp.length; i++) {\n g.highlightCell(hp[i]);\n }\n V.popColor();\n }\n\n if (listColor != null) {\n StringBuilder sb = new StringBuilder();\n V.pushScale(.7);\n V.pushColor(listColor);\n for (int i = 0; i < segs.length; i++) {\n Segment s = segs[i];\n sb.append(s.id() + \":\");\n for (int j = 0; j < s.nSnapPoints(); j++) {\n IPoint2 pt = s.getSnapPoint(j);\n sb.append(\" \");\n sb.append(Tools.f(pt.x, 2) + \",\" + Tools.f(pt.y, 2));\n }\n sb.append('\\n');\n }\n V.draw(sb.toString(), 20, 90, Globals.TX_CLAMP | Globals.TX_BGND | 30);\n V.popColor();\n V.popScale();\n }\n\n }", "private void drawsegment_gouraud_alpha(float leftadd,\n float rghtadd,\n int ytop,\n int ybottom) {\n ytop *= SCREEN_WIDTH;\n ybottom *= SCREEN_WIDTH;\n // int p = m_index;\n \n float irf = iradd;\n float igf = igadd;\n float ibf = ibadd;\n float iaf = iaadd;\n \n while (ytop < ybottom) {\n int xstart = (int) (xleft + PIXEL_CENTER);\n if (xstart < 0)\n xstart = 0;\n int xend = (int) (xrght + PIXEL_CENTER);\n if (xend > SCREEN_WIDTH)\n xend = SCREEN_WIDTH;\n float xdiff = (xstart + PIXEL_CENTER) - xleft;\n \n int ir = (int) (irf * xdiff + rleft);\n int ig = (int) (igf * xdiff + gleft);\n int ib = (int) (ibf * xdiff + bleft);\n int ia = (int) (iaf * xdiff + aleft);\n float iz = izadd * xdiff + zleft;\n \n xstart+=ytop;\n xend+=ytop;\n \n for ( ; xstart < xend; xstart++ ) {\n if (noDepthTest || (iz <= m_zbuffer[xstart])) {\n //m_zbuffer[xstart] = iz;\n \n //\n int red = (ir & 0xFF0000);\n int grn = (ig >> 8) & 0xFF00;\n int blu = (ib >> 16);\n \n // get buffer pixels\n int bb = m_pixels[xstart];\n int br = (bb & 0xFF0000); // 0x00FF0000\n int bg = (bb & 0xFF00); // 0x0000FF00\n bb = (bb & 0xFF); // 0x000000FF\n \n // blend alpha\n int al = ia >> 16;\n \n //\n m_pixels[xstart] = 0xFF000000 | \n ((br + (((red - br) * al) >> 8)) & 0xFF0000) | \n ((bg + (((grn - bg) * al) >> 8)) & 0xFF00) | \n ((bb + (((blu - bb) * al) >> 8)) & 0xFF);\n // m_stencil[xstart] = p;\n }\n \n //\n ir+=iradd;\n ig+=igadd;\n ib+=ibadd;\n ia+=iaadd;\n iz+=izadd;\n }\n \n ytop+=SCREEN_WIDTH;\n xleft+=leftadd;\n xrght+=rghtadd;\n rleft+=rleftadd;\n gleft+=gleftadd;\n bleft+=bleftadd;\n aleft+=aleftadd;\n zleft+=zleftadd;\n }\n }", "public void drawSkinColorSampler(Mat sourceMat){\n\n int frameWidth = sourceBitmap.getWidth();\n int frameHeight = sourceBitmap.getHeight();\n int rectangleSize = 30;\n Scalar rectangleColor = new Scalar(255,0,255);\n skinColorSamplerRectangle1 = new Rect(frameWidth / 5, frameHeight / 2, rectangleSize, rectangleSize);\n skinColorSamplerRectangle2 = new Rect(frameWidth / 5, frameHeight / 3, rectangleSize, rectangleSize);\n // function rectangle has to be mentioned here:\n // draw rectangle: Imgproc.rectangle(SrcMat, new Point(rect.x, rect.y), new Point(rect.x + rect.width, rect.y + rect.height), Detect_Color, 5);\n Imgproc.rectangle(sourceMat,skinColorSamplerRectangle1,rectangleColor);\n Imgproc.rectangle(sourceMat,skinColorSamplerRectangle2,rectangleColor);\n }", "public void rangeRGB(int min, int number, int r, int g, int b) {\n int max = min + number;\n for (int i = min; i < (max); i++) {\n m_ledBuffer.setRGB(i, r, g, b);\n }\n m_led.setData(m_ledBuffer);\n }", "public void process5(Mat rgbaImage) {\n\n\n\n Imgproc.cvtColor(rgbaImage,mPyrDownMat,Imgproc.COLOR_RGBA2GRAY);\n //Imgproc.medianBlur(rgbaImage,rgbaImage,9);\n\n //Imgproc.cvtColor(rgbaImage, rgbaImage, Imgproc.COLOR_RGBA2GRAY);\n //Imgproc.blur(mPyrDownMat,mPyrDownMat,temp_size);\n Imgproc.GaussianBlur(mPyrDownMat, mPyrDownMat,new Size(5,5), 0);\n //Imgproc.threshold(mPyrDownMat,mPyrDownMat,0,maxTreshold,Imgproc.THRESH_OTSU);\n //Imgproc.threshold(mPyrDownMat,mPyrDownMat,minTreshold,maxTreshold,Imgproc.THRESH_BINARY_INV);\n\n Imgproc.adaptiveThreshold(mPyrDownMat,mPyrDownMat,maxTreshold,Imgproc.ADAPTIVE_THRESH_MEAN_C,Imgproc.THRESH_BINARY_INV,75,10);\n\n //Imgproc.Canny(rgbaImage,rgbaImage,minTreshold,maxTreshold,3,true);\n //Imgproc.dilate(rgbaImage, rgbaImage, new Mat());\n //Imgproc.erode(rgbaImage,rgbaImage,new Mat());\n\n\n\n //Imgproc.Canny(mPyrDownMat,mPyrDownMat,10,100,3,true);\n\n //Imgproc.pyrDown(rgbaImage, mPyrDownMat);\n //Imgproc.pyrDown(mPyrDownMat, mPyrDownMat);\n\n\n //Imgproc.cvtColor(mPyrDownMat, mHsvMat, Imgproc.COLOR_RGB2HSV_FULL);\n\n //Core.inRange(mHsvMat, mLowerBound, mUpperBound, mMask);\n //Imgproc.dilate(mMask, mDilatedMask, new Mat());\n\n List<MatOfPoint> contours = new ArrayList<MatOfPoint>();\n\n //Imgproc.findContours(mDilatedMask, contours, mHierarchy, Imgproc.RETR_EXTERNAL, Imgproc.CHAIN_APPROX_SIMPLE);\n\n //Imgproc.findContours(rgbaImage, contours, new Mat(), Imgproc.RETR_TREE, Imgproc.CHAIN_APPROX_SIMPLE);\n\n /*\n // Find max contour area\n double maxArea = 0;\n Iterator<MatOfPoint> each = contours.iterator();\n while (each.hasNext()) {\n MatOfPoint wrapper = each.next();\n double area = Imgproc.contourArea(wrapper);\n if (area > maxArea){\n maxArea = area;\n //Log.e(\"Max Area\", \"wtf.. \" + maxArea);\n }\n\n }*/\n/*\n Iterator<MatOfPoint> each = contours.iterator();\n // Filter contours by area and resize to fit the original image size\n mContours.clear();\n each = contours.iterator();\n\n\n //Center Calculation init\n meanCenterX = 0;\n SameCenterContour = 0;\n Point temp_point = new Point(0,0);\n\n int temp_point_y = 0;\n\n\n\n while (each.hasNext()) {\n MatOfPoint contour = each.next();\n\n //Log.e(TAG, \"Sizes: \" + Imgproc.contourArea(contour) + \" Max: \" + mMinContourArea*maxArea);\n if (Imgproc.contourArea(contour) > 0) {\n mContours.add(contour);\n\n\n //Change image view to show what is founded\n Mat m = new Mat();\n\n //Draw bounding rect\n Rect temp_rec = Imgproc.boundingRect(contour);\n Imgproc.rectangle(rgbaImage,temp_rec.tl(),temp_rec.br(),ColorBlobDetectionActivity.CONTOUR_COLOR,6);\n\n //Log.e(TAG, \"temprec x: \" + temp_rec.tl().x + \" temrec width: \" + temp_rec.width);\n //Log.e(TAG, \"temprec : \" + temp_rec.tl().y + \" temrec width: \" + temp_rec.height);\n\n MatOfPoint2f mMOP2f1 = new MatOfPoint2f();\n MatOfPoint2f approx = new MatOfPoint2f();\n*/\n\n /*contour.convertTo(mMOP2f1,CvType.CV_32FC2);\n Imgproc.approxPolyDP(mMOP2f1,approx,Imgproc.arcLength(mMOP2f1,true)*0.02,true);\n\n if (approx.rows() >= 4){\n Point tr = approx.toList().get(0);\n Point br = approx.toList().get(1);\n Point bl = approx.toList().get(2);\n Point tl = approx.toList().get(3);\n\n //temp_rec.tl().x -= temp_rec.width;\n //temp_rec.tl().y -= temp_rec.height;\n Imgproc.circle(rgbaImage,tr,1,new Scalar(255,0,0,255),4);\n Imgproc.circle(rgbaImage,br,1,new Scalar(255,100,0,255),4);\n Imgproc.circle(rgbaImage,bl,1,new Scalar(255,100,250,255),4);\n Imgproc.circle(rgbaImage,tl,1,new Scalar(255,100,100,255),4);\n\n }*/\n/*\n Point tr = new Point(temp_rec.tl().x+temp_rec.size().width,temp_rec.tl().y);\n Point bl = new Point(temp_rec.br().x-temp_rec.size().width,temp_rec.br().y);\n\n Imgproc.circle(rgbaImage,temp_rec.tl(),1,new Scalar(0,0,255,255),4);\n Imgproc.circle(rgbaImage,tr,1,new Scalar(255,255,0,255),4);\n Imgproc.circle(rgbaImage,temp_rec.br(),1,new Scalar(255,0,0,255),4);\n Imgproc.circle(rgbaImage,bl,1,new Scalar(255,0,255,255),4);\n\n //Draw mid\n\n Moments p = Imgproc.moments(contour, false);\n int x = (int) (p.get_m10() / p.get_m00());\n int y = (int) (p.get_m01() / p.get_m00());\n\n\n //Check if they are in the same vertical line\n\n meanCenterX += x;\n*/\n /*\n if (contours.size() > 14) {\n if (temp_point.x == x)\n SameCenterContour++;\n\n }*/\n/*\n Imgproc.circle(rgbaImage, new Point(x, y), 1, new Scalar(255,49,0,255),4);\n Imgproc.line(rgbaImage,new Point(x,y), new Point(x,0),new Scalar(255,49,0,255),4);\n centers.add(x);\n /*\n //set preview\n m = rgbaImage.submat(temp_rec);\n mBitmap = Bitmap.createBitmap(m.width(),m.height(),Bitmap.Config.ARGB_8888);\n Utils.matToBitmap(m,mBitmap);*//*\n }\n }//end while all contours*/\n\n\n\n\n /*mContours.clear();\n each = contours.iterator();\n MatOfPoint2f approx = new MatOfPoint2f();\n MatOfPoint2f mMOP2f1 = new MatOfPoint2f();\n MatOfPoint mMOP = new MatOfPoint();\n while (each.hasNext()) {\n\n MatOfPoint contour = each.next();\n contour.convertTo(mMOP2f1,CvType.CV_32FC2);\n Imgproc.approxPolyDP(mMOP2f1,approx,Imgproc.arcLength(mMOP2f1,true)*0.02,true);\n approx.convertTo(mMOP, CvType.CV_32S);\n\n if(approx.rows()==4 && Imgproc.isContourConvex(mMOP) ){\n //Log.e(\"contour\", \"Contour area\" + Imgproc.contourArea(contour) + \"Max Area\");\n if (Imgproc.contourArea(contour) > maxArea){\n MatOfPoint temp = new MatOfPoint();\n approx.convertTo(temp,CvType.CV_32S);\n Core.multiply(temp, new Scalar(4,4), temp);\n mContours.add(temp);\n\n\n Rect temp_rec = Imgproc.boundingRect(temp);\n\n Imgproc.rectangle(rgbaImage,temp_rec.tl(),temp_rec.br(),ColorBlobDetectionActivity.CONTOUR_COLOR,6);\n\n\n /*Core.multiply(approx,new Scalar(4,4),approx);\n Mat src = new Mat(4,1, CvType.CV_32FC2);\n\n Log.e(TAG,\"\" + (int)approx.toList().get(0).y + (int)approx.toList().get(0).x + \"\\n\" +\n (int)approx.toList().get(1).y +(int)approx.toList().get(1).x + \"\\n\" +\n (int)approx.toList().get(2).y + (int)approx.toList().get(2).x + \"\\n\" +\n (int)approx.toList().get(3).y + (int)approx.toList().get(3).x);\n\n src.put((int)approx.toList().get(0).y, (int)approx.toList().get(0).x,\n (int)approx.toList().get(1).y, (int)approx.toList().get(1).x,\n (int)approx.toList().get(2).y, (int)approx.toList().get(2).x,\n (int)approx.toList().get(3).y, (int)approx.toList().get(3).x\n );\n\n Mat dst = new Mat(4,1,CvType.CV_32FC2);\n dst.put(0,0,0,temp.width(),temp.height(),temp.width(),temp.height(),0);\n\n Mat perspectiveTransform = Imgproc.getPerspectiveTransform(src,dst);\n Imgproc.warpPerspective(temp,temp,perspectiveTransform, new Size(temp.cols(), temp.rows()));\n\n Mat m = new Mat();\n\n temp_rec = Imgproc.boundingRect(temp);\n m = rgbaImage.submat(temp_rec);\n mBitmap = Bitmap.createBitmap(m.width(),m.height(),Bitmap.Config.ARGB_8888);\n Utils.matToBitmap(m,mBitmap);\n\n }\n\n }\n\n }*/\n Mat circles = new Mat();\n\n\n Imgproc.HoughCircles(mPyrDownMat,circles,Imgproc.CV_HOUGH_GRADIENT,dp,minDist,param1,param2,minRadius,maxRadius);\n\n //Imgproc.HoughCircles(rgbaImage,circles,Imgproc.CV_HOUGH_GRADIENT,1,20,23,46,0,0);\n Log.e(\"Circles\", \"Total circle count:\" + circles.cols());\n Mat circleBoundRect = new Mat();\n for (int i = 0; i < circles.cols(); i++) {\n double mCircle[] = circles.get(0,i);\n\n int x = (int) Math.round(mCircle[0]);\n int y = (int) Math.round(mCircle[1]);\n int r = (int) Math.round(mCircle[2]);\n\n Point center = new Point(x ,y);\n\n Point tl = new Point(x-r,y-r);\n Point br = new Point(x+r,y+r);\n\n Rect circleBoundRect_temp = new Rect(tl,br);\n Log.e(\"Circles\",\"x: \"+ x + \"y: \"+y + \"r: \"+r);\n\n try {\n circleBoundRect = mPyrDownMat.submat(circleBoundRect_temp);\n }\n catch (Exception e){\n Log.e(\"Circles Exception\",e.toString());\n }\n double percentage = Core.countNonZero(circleBoundRect)/(circleBoundRect.size().width*circleBoundRect.size().height);\n if (percentage> 0.6){\n Imgproc.rectangle(rgbaImage,tl,br,new Scalar(247,0,255),3);\n }\n\n else if (percentage < 0.6 && percentage>0.3){\n Imgproc.rectangle(rgbaImage,tl,br,new Scalar(0,255,0),3);\n }\n\n //Log.e(\"Circles\",\"\"+Core.countNonZero(circleBoundRect)/(circleBoundRect.size().width*circleBoundRect.size().height));\n //draw circle\n //Imgproc.circle(rgbaImage,center,r,new Scalar(57,58,153),4);\n //draw center\n //Imgproc.circle(rgbaImage,center,3,new Scalar(57,58,153),5);\n\n\n\n }\n\n mBitmap = Bitmap.createBitmap(rgbaImage.width(),rgbaImage.height(),Bitmap.Config.ARGB_8888);\n Utils.matToBitmap(rgbaImage,mBitmap);\n\n }", "private void drawsegment_plain_alpha(float leftadd,\n float rghtadd,\n int ytop,\n int ybottom) {\n ytop *= SCREEN_WIDTH;\n ybottom *= SCREEN_WIDTH;\n \n int pr = m_fill & 0xFF0000;\n int pg = m_fill & 0xFF00;\n int pb = m_fill & 0xFF;\n \n // int p = m_index;\n float iaf = iaadd;\n \n while (ytop < ybottom) {\n int xstart = (int) (xleft + PIXEL_CENTER);\n if (xstart < 0)\n xstart = 0;\n \n int xend = (int) (xrght + PIXEL_CENTER);\n if (xend > SCREEN_WIDTH)\n xend = SCREEN_WIDTH;\n \n float xdiff = (xstart + PIXEL_CENTER) - xleft;\n float iz = izadd * xdiff + zleft;\n int ia = (int) (iaf * xdiff + aleft);\n xstart += ytop;\n xend += ytop;\n \n //int ma0 = 0xFF000000;\n \n for ( ; xstart < xend; xstart++ ) {\n if (noDepthTest || (iz <= m_zbuffer[xstart])) {\n // don't set zbuffer when not fully opaque\n //m_zbuffer[xstart] = iz;\n \n int alpha = ia >> 16;\n int mr0 = m_pixels[xstart];\n /*\n if (argbSurface) {\n ma0 = (((mr0 >>> 24) * alpha) << 16) & 0xFF000000;\n if (ma0 == 0) ma0 = alpha << 24;\n }\n */\n int mg0 = mr0 & 0xFF00;\n int mb0 = mr0 & 0xFF;\n mr0 &= 0xFF0000;\n \n mr0 = mr0 + (((pr - mr0) * alpha) >> 8);\n mg0 = mg0 + (((pg - mg0) * alpha) >> 8);\n mb0 = mb0 + (((pb - mb0) * alpha) >> 8);\n \n m_pixels[xstart] = 0xFF000000 | \n (mr0 & 0xFF0000) | (mg0 & 0xFF00) | (mb0 & 0xFF);\n \n // m_stencil[xstart] = p;\n }\n iz += izadd;\n ia += iaadd;\n }\n ytop += SCREEN_WIDTH;\n xleft += leftadd;\n xrght += rghtadd;\n zleft += zleftadd;\n }\n }", "public static IPoint2[] calcHotPixels(Segment[] s, BlackBox blackBox,\n DArray hpList) {\n Map m = new HashMap();\n\n final boolean db = false;\n\n if (db && T.update())\n T.msg(\"calcHotPixels for \" + s.length + \" segments\");\n blackBox.setOrientation(0);\n\n if (hpList != null) {\n hpList.clear();\n for (int i0 = 0; i0 < s.length; i0++)\n hpList.add(new DArray());\n }\n\n for (int i0 = 0; i0 < s.length; i0++) {\n\n Segment a = s[i0];\n\n IPoint2 e0 = a.pt(0), e1 = a.pt(1);\n\n m.put(e0, Boolean.TRUE);\n m.put(e1, Boolean.TRUE);\n\n DArray lst = null;\n if (hpList != null) {\n lst = hpList.getDArray(i0);\n lst.add(e0);\n lst.add(e1);\n }\n\n if (db && T.update())\n T.msg(\" adding endpoints \" + e0 + \", \" + e1);\n\n for (int i1 = i0 + 1; i1 < s.length; i1++) {\n Segment b = s[i1];\n IPoint2 pt;\n\n BlackBox bb = blackBox.construct(a, b);\n if (db && T.update())\n T.msg(\"\" + bb);\n if (!bb.abWithinSegments())\n continue;\n if (db && T.update())\n T.msg(\" adding intersection pixel \" + bb.getIntersectionPixel(false));\n pt = bb.getIntersectionPixel(false);\n m.put(pt, Boolean.TRUE);\n\n if (hpList != null) {\n hpList.getDArray(i1).add(pt);\n lst.add(pt);\n }\n }\n }\n\n // sort hot pixels for segments into order, and remove duplicates\n if (hpList != null) {\n for (int i = 0; i < s.length; i++) {\n DArray a = hpList.getDArray(i);\n a.sort(IPoint2.comparator);\n IPoint2 prev = null;\n for (int j = a.size() - 1; j >= 0; j--) {\n IPoint2 th = (IPoint2) a.get(j);\n if (prev != null && prev.equals(th)) {\n a.remove(j);\n }\n prev = th;\n }\n }\n }\n\n DArray jpts = new DArray();\n jpts.addAll(m.keySet());\n jpts.sort(IPoint2.comparator);\n return (IPoint2[]) jpts.toArray(IPoint2.class);\n }", "public void paintGradientNormalized(){\n\t\t\n\t\tint min = 99999;\n\t\tint max = 0;\n\t\t\n\t\tfor (int i=0; i < ranges.size(); i++){\n\t\t\tif ((ranges.elementAt(i).getMin()) < min){\n\t\t\t\tmin = ranges.elementAt(i).getMin();\n\t\t\t}\n\t\t\tif ((ranges.elementAt(i).getMax()) > max){\n\t\t\t\tmax = ranges.elementAt(i).getMax();\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Once I've got them, the paint is simple, because Positioner.getAssociatedPosition() returns\n\t\t// the exact pixel where the color has to be painted\n\t\t\n\t\tPositioner positions = new Positioner(drawingPanel.getHeight(), min, max);\n\t\t\n\t\tint i = 1;\n\t\tBufferedImage img = new BufferedImage(drawingPanel.getWidth(), drawingPanel.getHeight(), BufferedImage.TYPE_INT_ARGB);\n\t\t\t\t\n\t\twhile (i < ranges.size()){\n\t\t\tpaintBufferedGradient(ranges.elementAt(ranges.size()-i).getColor(), ranges.elementAt(ranges.size()-i-1).getColor(), positions.getAssociatedPosition(ranges.elementAt(ranges.size()-i).getMax()) , positions.getAssociatedPosition(ranges.elementAt(ranges.size()-i).getMin()) , img);\n\t\t\ti++;\n\t\t}\n\t\tpaintBufferedGradient(ranges.elementAt(0).getColor(), ranges.elementAt(0).getColor(), positions.getAssociatedPosition(ranges.elementAt(0).getMax()), positions.getAssociatedPosition(ranges.elementAt(0).getMin()), img);\n\n\t\t\t\n\t\t\n\t\tdrawingPanel.getGraphics().drawImage(img, 0, 0, img.getWidth(), img.getHeight(), null);\n\t\t\n\t\t// Painting the ranges\n\t\t\n\t\trangesPanel.removeAll();\t\t\t// Clears rangePanel\n\t\t\n\t\tJLabel currentRange;\n\t\t\n\t\tcurrentRange = new JLabel(Integer.toString(ranges.elementAt(0).getMin()));\n\t\tcurrentRange.setHorizontalAlignment(SwingConstants.RIGHT);\n\t\tcurrentRange.setBounds(35, rangesPanel.getHeight()-16, 60, 16);\n\t\t\n\t\t\n\t\trangesPanel.add(currentRange);\n\t\tint last = rangesPanel.getHeight()-16;\n\t\tint aux;\n\t\tfor (int j = 0; j < ranges.size(); j++){\n\t\t\taux = positions.getAssociatedPosition(ranges.elementAt(j).getMax());\n\t\t\tcurrentRange = new JLabel(Integer.toString(ranges.elementAt(j).getMax()));\n\t\t\tcurrentRange.setHorizontalAlignment(SwingConstants.RIGHT);\n\t\t\tif (aux+16 < last){\n\t\t\t\tcurrentRange.setBounds(35, aux, 60, 16);\n\t\t\t\tlast = aux;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tcurrentRange.setBounds(35, last-16, 60, 16);\n\t\t\t\tlast = last - 16;\n\t\t\t}\n\t\t\t\t\n\t\t\trangesPanel.add(currentRange);\n\t\t}\n\t\t\n\t\trangesPanel.repaint();\n\t}", "private ArrayList<Point> extractCC(Point r, Image img)\r\n/* 55: */ {\r\n/* 56: 58 */ this.s.clear();\r\n/* 57: 59 */ this.s.add(r);\r\n/* 58: 60 */ this.temp.setXYBoolean(r.x, r.y, true);\r\n/* 59: 61 */ this.list2.add(r);\r\n/* 60: */ \r\n/* 61: 63 */ Point[] N = { new Point(1, 0), new Point(0, 1), new Point(-1, 0), new Point(0, -1), \r\n/* 62: 64 */ new Point(1, 1), new Point(-1, -1), new Point(-1, 1), new Point(1, -1) };\r\n/* 63: */ \r\n/* 64: 66 */ ArrayList<Point> pixels = new ArrayList();\r\n/* 65: */ int x;\r\n/* 66: */ int i;\r\n/* 67: 68 */ for (; !this.s.isEmpty(); i < N.length)\r\n/* 68: */ {\r\n/* 69: 70 */ Point tmp = (Point)this.s.pop();\r\n/* 70: */ \r\n/* 71: 72 */ x = tmp.x;\r\n/* 72: 73 */ int y = tmp.y;\r\n/* 73: 74 */ pixels.add(tmp);\r\n/* 74: */ \r\n/* 75: 76 */ this.temp2.setXYBoolean(x, y, true);\r\n/* 76: */ \r\n/* 77: 78 */ i = 0; continue;\r\n/* 78: 79 */ int _x = x + N[i].x;\r\n/* 79: 80 */ int _y = y + N[i].y;\r\n/* 80: 82 */ if ((_x >= 0) && (_x < this.xdim) && (_y >= 0) && (_y < this.ydim)) {\r\n/* 81: 84 */ if (!this.temp.getXYBoolean(_x, _y))\r\n/* 82: */ {\r\n/* 83: 86 */ boolean q = img.getXYBoolean(_x, _y);\r\n/* 84: 88 */ if (q)\r\n/* 85: */ {\r\n/* 86: 90 */ Point t = new Point(_x, _y);\r\n/* 87: 91 */ this.s.add(t);\r\n/* 88: */ \r\n/* 89: 93 */ this.temp.setXYBoolean(t.x, t.y, true);\r\n/* 90: 94 */ this.list2.add(t);\r\n/* 91: */ }\r\n/* 92: */ }\r\n/* 93: */ }\r\n/* 94: 78 */ i++;\r\n/* 95: */ }\r\n/* 96: 99 */ for (Point t : this.list2) {\r\n/* 97:100 */ this.temp.setXYBoolean(t.x, t.y, false);\r\n/* 98: */ }\r\n/* 99:101 */ this.list2.clear();\r\n/* 100: */ \r\n/* 101:103 */ return pixels;\r\n/* 102: */ }", "private TailoredImage doProcess(BufferedImage sourceImg) throws IOException {\n\t\tint width = sourceImg.getWidth();\n\t\tint height = sourceImg.getHeight();\n\t\t// Check maximum effective width height\n\t\tisTrue((width <= sourceMaxWidth && height <= sourceMaxHeight),\n\t\t\t\tString.format(\"Source image is too big, max limits: %d*%d\", sourceMaxWidth, sourceMaxHeight));\n\t\tisTrue((width >= sourceMinWidth && height >= sourceMinHeight),\n\t\t\t\tString.format(\"Source image is too small, min limits: %d*%d\", sourceMinWidth, sourceMinHeight));\n\n\t\t// 创建背景图,TYPE_4BYTE_ABGR表示具有8位RGBA颜色分量的图像(支持透明的BufferedImage),正常取bufImg.getType()\n\t\tBufferedImage primaryImg = new BufferedImage(sourceImg.getWidth(), sourceImg.getHeight(), BufferedImage.TYPE_4BYTE_ABGR);\n\t\t// 创建滑块图\n\t\tBufferedImage blockImg = new BufferedImage(sourceImg.getWidth(), sourceImg.getHeight(), BufferedImage.TYPE_4BYTE_ABGR);\n\t\t// 随机截取的坐标\n\t\tint maxX0 = width - blockWidth - (circleR + circleOffset);\n\t\tint maxY0 = height - blockHeight;\n\t\tint blockX0 = current().nextInt((int) (maxX0 * 0.25), maxX0); // *0.25防止x坐标太靠左\n\t\tint blockY0 = current().nextInt(circleR, maxY0); // 从circleR开始是为了防止上边的耳朵显示不全\n\t\t// Setup block borders position.\n\t\tinitBorderPositions(blockX0, blockY0, blockWidth, blockHeight);\n\n\t\t// 绘制生成新图(图片大小是固定,位置是随机)\n\t\tdrawing(sourceImg, blockImg, primaryImg, blockX0, blockY0, blockWidth, blockHeight);\n\t\t// 裁剪可用区\n\t\tint cutX0 = blockX0;\n\t\tint cutY0 = Math.max((blockY0 - circleR - circleOffset), 0);\n\t\tint cutWidth = blockWidth + circleR + circleOffset;\n\t\tint cutHeight = blockHeight + circleR + circleOffset;\n\t\tblockImg = blockImg.getSubimage(cutX0, cutY0, cutWidth, cutHeight);\n\n\t\t// Add watermark string.\n\t\taddWatermarkIfNecessary(primaryImg);\n\n\t\t// 输出图像数据\n\t\tTailoredImage img = new TailoredImage();\n\t\t// Primary image.\n\t\tByteArrayOutputStream primaryData = new ByteArrayOutputStream();\n\t\tImageIO.write(primaryImg, \"PNG\", primaryData);\n\t\timg.setPrimaryImg(primaryData.toByteArray());\n\n\t\t// Block image.\n\t\tByteArrayOutputStream blockData = new ByteArrayOutputStream();\n\t\tImageIO.write(blockImg, \"PNG\", blockData);\n\t\timg.setBlockImg(blockData.toByteArray());\n\n\t\t// Position\n\t\timg.setX(blockX0);\n\t\timg.setY(blockY0 - circleR >= 0 ? blockY0 - circleR : 0);\n\t\treturn img;\n\t}", "private void createEdges() {\n int edgeSize = windowSize - 1;\n BufferedImage edgedImage = new BufferedImage(image.getWidth() + edgeSize, image.getHeight() + edgeSize, BufferedImage.TYPE_INT_ARGB);\n int[] edgeData = ((DataBufferInt) edgedImage.getRaster().getDataBuffer()).getData();\n\n // set every pixels in edged image to -1 to use for checking unassigned pixels when filling edges\n for (int i = 0; i < edgeData.length; i++) {\n edgeData[i] = -1;\n }\n\n // draw original image onto center of edged image\n edgedImage.getGraphics().drawImage(image, edgeSize/2, edgeSize/2, null);\n edgedImage.getGraphics().dispose();\n\n\n //TODO - get this working after program works to improve speed\n// byte[] edgedData = ((DataBufferByte) edgedImage.getRaster().getDataBuffer()).getData();\n// byte[] originalData = ((DataBufferByte) image.getRaster().getDataBuffer()).getData();\n//\n // copy image into larger, edged image. currently not working,\n// for (int i = windowSize / 2 * 3, originalI = 0; i < image.getHeight() - windowSize / 2; i++, originalI++) {\n// for (int j = windowSize / 2 * 3, originalJ = 0; j < image.getWidth() - windowSize / 2; j++, originalJ++) {\n// edgedData[i + j * edgedImage.getWidth()] = originalData[originalI + originalJ * image.getWidth()];\n// }\n// }\n\n image = edgedImage;\n fillEdges();\n }", "public void ToImage(){\n\t\tint row=SL.length;\n\t\tint col=SL[0].length;\n\t\tint cr=0;\n\t\tint cb=0;\n\t\t// System.out.println(row+\" \"+col);\n\t\tint[] intArray = new int[3*row*col];\n\t\tint w=row;\n\t int h=col;\n\t BufferedImage image = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);\n\t\tint pixel = 0;\n\t\tfor(int x=0;x<row;x++){\n\t\t\tfor(int y=0;y<col;y++){\n\t\t\t\tint rByte = (int)(SL[x][y]);\n\t\t int gByte = (int)(SL[x][y]);\n\t\t int bByte = (int)(SL[x][y]);\n\t\t \n\t\t // int rByte = (int)(SL[x][y]+1.402*(cr-128));\n\t\t // int gByte = (int)(SL[x][y]-0.3414*(cb-128)-0.71414*(cr-128));\n\t\t // int bByte = (int)(SL[x][y]+1.772*(cb-128));\n\t\t int rgb = (rByte *65536) + (gByte * 256) + bByte;\n\t\t image.setRGB(x,y,rgb);\n\t \t}\n\t\t}\n\t try {\n\t ImageIO.write(image, \"bmp\", new File(\"\"+picture_num+\".png\"));\n\t } catch (Exception e) {\n\t e.printStackTrace();\n\t }\n\t}", "private Mat getHSVThreshold(Mat image) {\r\n\t\t\r\n\t\t// convert BGR values to HSV values\r\n\t\tMat hsv = new Mat();\r\n\t\tImgproc.cvtColor(image, hsv, Imgproc.COLOR_BGR2HSV);\r\n\t\t\r\n\t\t\r\n\t\tMat inRange = new Mat();\r\n\t\tCore.inRange(\r\n\t\t\t\thsv, \r\n\t\t\t\tnew Scalar(Double.parseDouble(theProperties.getProperty(\"lowHue\")), \r\n\t\t\t\t\tDouble.parseDouble(theProperties.getProperty(\"lowSat\")),\r\n\t\t\t\t\tDouble.parseDouble(theProperties.getProperty(\"lowVal\"))),\r\n\t\t\t\tnew Scalar(Double.parseDouble(theProperties.getProperty(\"highHue\")),\r\n\t\t\t\t\t\t\tDouble.parseDouble(theProperties.getProperty(\"highSat\")),\r\n\t\t\t\t\t\t\tDouble.parseDouble(theProperties.getProperty(\"highVal\"))), \r\n\t\t\t\tinRange);\r\n\t\t\r\n\t\tMat grey = new Mat();\r\n\t\tImgproc.cvtColor(image, grey, Imgproc.COLOR_BGR2GRAY);\r\n\t\tCore.bitwise_and(grey, inRange, grey);\r\n\r\n Imgcodecs.imwrite(rootFolder + \"/1_Post_inRange\" + \".png\", grey);\r\n\t\t\r\n\t\treturn grey;\r\n\t}", "private static int[] findMiddles(int width, int height, BufferedImage oldImage)\n {\n // Stores the heighest up most and left most pixels that are black\n int firstX = width;\n int firstY = -1;\n\n // Stores the heighest down most and right most pixels that are black\n int lastX = 0;\n int lastY = 0;\n\n // For every pixel in the original image\n for(int y = 0; y < height; y++)\n {\n for(int x = 0; x < width; x++)\n {\n // If the pixel is black\n if(oldImage.getRGB(x, y) != 0xFF000000)\n {\n // If the up most pixel hasn't been found yet (the first one\n // has to be the upmost because of the way the image is parsed)\n if(firstY == -1)\n {\n firstY = y;\n }\n\n // The down most pixel has to be the last black pixel found\n // because of the way the image is parsd\n lastY = y;\n\n // If the current pixel is to the left of the current left\n // most pixel found\n if(firstX > x)\n {\n firstX = x;\n }\n\n // If the current pixel is to the right of the current right\n // most pixel found\n if(lastX < x)\n {\n lastX = x;\n }\n }\n }\n }\n\n // Computes the center of the rectangle found above, this should be about\n // the center of the digit as long as there are no random black pixels\n int middleX = (lastX - firstX) / 2 + firstX;\n int middleY = (lastY - firstY) / 2 + firstY;\n int middle[] = { middleX, middleY };\n return middle;\n }", "public static OptionalInt getFirstSliceWithColor(final Image img, final Color color, final int startValue,\n\t\t\t\t\t\t\t\t\t\t\t\t\t final Direction direction) {\n\t\tswitch (direction) {\n\t\t\tcase NEGATIVE_X:\n\t\t\t\treturn IntStream.iterate(startValue, i -> i - 1).limit(startValue + 1)\n\t\t\t\t\t\t.filter((x) -> OptimizedArea.forColumn(img, x).containsColor(color))\n\t\t\t\t\t\t.findFirst();\n\t\t\tcase POSITIVE_X:\n\t\t\t\treturn IntStream.range(startValue, (int) img.getWidth())\n\t\t\t\t\t\t.filter((x) -> OptimizedArea.forColumn(img, x).containsColor(color))\n\t\t\t\t\t\t.findFirst();\n\t\t\tcase NEGATIVE_Y:\n\t\t\t\treturn IntStream.iterate(startValue, i -> i - 1).limit(startValue + 1)\n\t\t\t\t\t\t.filter((y) -> OptimizedArea.forLine(img, y).containsColor(color))\n\t\t\t\t\t\t.findFirst();\n\t\t\tcase POSITIVE_Y:\n\t\t\t\treturn IntStream.range(startValue, (int) img.getHeight())\n\t\t\t\t\t\t.filter((y) -> OptimizedArea.forLine(img, y).containsColor(color))\n\t\t\t\t\t\t.findFirst();\n\t\t}\n\t\t// can never happen\n\t\treturn OptionalInt.empty();\n\t}", "public void rangeHSV(int min, int number, int h, int s, int v) {\n int max = min + number;\n\n for (int i = min; i < (max); i++) {\n m_ledBuffer.setHSV(i, h, s, v);\n }\n\n m_led.setData(m_ledBuffer);\n }", "int[][][] sharpenImage(int[][][] imageArray, int height, int width);", "public void renderImage() {\n Camera camera = scene.getCamera();//fot the function thats in the camera.constr.. to build the rays.\n Intersectable geometries = scene.getGeometries();//list of geomertries for the functon in geometries.findinter..\n java.awt.Color background = scene.getBackground().getColor();\n double distance = scene.getDistance();\n\n\n int width = (int) imageWriter.getWidth(); //width of the view plane\n int height = (int) imageWriter.getHeight();//height of the view plane\n int Nx = imageWriter.getNx(); // number of squares in the Row (shura). we need it for the for\n int Ny = imageWriter.getNy(); //number of squares in the column.(amuda). we need it for the for\n\n /**for each pixel we will send ray, and with the function findIntersection\n * we will get the Geo points(point 3d, color).\n * if we got nothing so we will color with the back round color\n * if we got the GeoPoints We will send to the function getClosestPoint and color*/\n Color pixelColor;\n for (int row = 0; row < Ny; ++row) {\n for (int column = 0; column < Nx; ++column) {\n if (amountRays > 1) { //if there is superSampling\n List<Ray> rays = camera.constructNRaysThroughPixel(Nx, Ny, column, row, distance, width, height,superSamplingRate, amountRays);\n Color averageColor;\n pixelColor = scene.getBackground();\n for (Ray ray : rays) {//for each ray from the list give the list of intersection geo-points.\n List<GeoPoint> intersectionPoints = geometries.findGeoIntersections(ray);\n averageColor = scene.getBackground();\n if (intersectionPoints != null) {\n GeoPoint closestPoint = getClosestPoint(intersectionPoints);//get the closest point for each ray.\n averageColor = calcColor(closestPoint, ray);//calculate the color and put in averageColor\n }\n pixelColor = pixelColor.add(averageColor);//befor we go to the next ray we add the averageColor to pixelColor.\n }\n pixelColor = pixelColor.reduce(rays.size());//we are doing the (memuza) and that is the color of that pixel.\n }\n else {//if there is no supersampling\n Ray ray = camera.constructRayThroughPixel(Nx, Ny, column, row, distance, width, height);\n List<GeoPoint> intersectionPoints = geometries.findGeoIntersections(ray);\n pixelColor = scene.getBackground();\n if (intersectionPoints != null) {\n GeoPoint closestPoint = getClosestPoint(intersectionPoints);\n pixelColor = calcColor(closestPoint, ray);\n }\n }\n imageWriter.writePixel(column, row, pixelColor.getColor());\n }\n }\n }", "public void outputResults(int K)\n {\n //collect all sets\n int region_counter=1;\n ArrayList<Pair<Integer>> sorted_regions = new ArrayList<Pair<Integer>>();\n\n int width = this.image.getWidth();\n int height = this.image.getHeight();\n for(int h=0; h<height; h++){\n for(int w=0; w<width; w++){\n int id=getID(new Pixel(w,h));\n int setid=ds.find(id);\n if(id!=setid) continue;\n sorted_regions.add(new Pair<Integer>(ds.get(setid).size(),setid));\n }//end for w\n }//end for h\n\n //sort the regions\n Collections.sort(sorted_regions, new Comparator<Pair<Integer>>(){\n @Override\n public int compare(Pair<Integer> a, Pair<Integer> b) {\n if(a.p!=b.p) return b.p-a.p;\n else return b.q-a.q;\n }\n });\n\n //recolor and output region info\n\t\t\n //Todo: Your code here (remove this line)\n //Hint: Use image.setRGB(x,y,c.getRGB()) to change the color of a pixel (x,y) to the given color \"c\"\n\n //save output image\n String out_filename = img_filename+\"_seg_\"+K+\".png\";\n try\n {\n File ouptut = new File(out_filename);\n ImageIO.write(this.image, \"png\", ouptut);\n System.err.println(\"- Saved result to \"+out_filename);\n }\n catch (Exception e) {\n System.err.println(\"! Error: Failed to save image to \"+out_filename);\n }\n }", "void drawRegion (double b, double e) {\n begT = b; endT = e;\n drawStuff (img.getGraphics ());\n }", "private void drawSelectedToolArea (IEditableByTool imageModel, Point<Integer> endPoint, int maxWidth, int maxHeight){\n List<Pixel> arrayList = new ArrayList<>();\n\n int minX = Math.max((startPoint.getX() < endPoint.getX()) ? startPoint.getX() : endPoint.getX(),0);\n int maxX = Math.min((startPoint.getX() > endPoint.getX()) ? startPoint.getX() : endPoint.getX(),maxWidth - 1);\n int minY = Math.max((startPoint.getY() < endPoint.getY()) ? startPoint.getY() : endPoint.getY(),0);\n int maxY = Math.min((startPoint.getY() > endPoint.getY()) ? startPoint.getY() : endPoint.getY(),maxHeight - 1);\n\n for(int i = minX; i <= maxX; i++){\n if (i % 5 == 0){\n arrayList.add(new Pixel(i, minY, paintColor));\n arrayList.add(new Pixel(i, maxY, paintColor));\n }\n\n }\n for(int j = minY + 1; j < maxY; j++){\n if (j % 5 == 0) {\n arrayList.add(new Pixel(minX, j, paintColor));\n arrayList.add(new Pixel(maxX, j, paintColor));\n }\n }\n\n imageModel.addToSelectOverlay(arrayList);\n\n }", "private void sliceSetColor(int colorPosition) {\n ArrayList<Integer> newPattern = new ArrayList<>(Collections.nCopies(slice.size(), colorPosition)); // Build a new pattern based on this color\n\n // Save the new color\n patternBasic = colorPosition;\n\n // Set the new pattern to slice\n setSlice(newPattern);\n }", "public ColorRgb getColorRgbBiLinear(double x, double y)\n {\n //-----------------------------------------------------------------\n double u = x - Math.floor(x);\n double v = y - Math.floor(y);\n double U = u * ((double)(getXSize()-2));\n double V = v * ((double)(getYSize()-2));\n int i = (int)Math.floor(U);\n int j = (int)Math.floor(V);\n double du = U - (double)i;\n double dv = V - (double)j;\n RGBPixel p;\n\n //-----------------------------------------------------------------\n p = getPixelRgb(i, j);\n ColorRgb F00 = new ColorRgb();\n F00.r = ((double)VSDK.signedByte2unsignedInteger(p.r)) / 255.0;\n F00.g = ((double)VSDK.signedByte2unsignedInteger(p.g)) / 255.0;\n F00.b = ((double)VSDK.signedByte2unsignedInteger(p.b)) / 255.0;\n\n p = getPixelRgb(i+1, j);\n ColorRgb F10 = new ColorRgb();\n F10.r = ((double)VSDK.signedByte2unsignedInteger(p.r)) / 255.0;\n F10.g = ((double)VSDK.signedByte2unsignedInteger(p.g)) / 255.0;\n F10.b = ((double)VSDK.signedByte2unsignedInteger(p.b)) / 255.0;\n\n p = getPixelRgb(i, j+1);\n ColorRgb F01 = new ColorRgb();\n F01.r = ((double)VSDK.signedByte2unsignedInteger(p.r)) / 255.0;\n F01.g = ((double)VSDK.signedByte2unsignedInteger(p.g)) / 255.0;\n F01.b = ((double)VSDK.signedByte2unsignedInteger(p.b)) / 255.0;\n\n p = getPixelRgb(i+1, j+1);\n ColorRgb F11 = new ColorRgb();\n F11.r = ((double)VSDK.signedByte2unsignedInteger(p.r)) / 255.0;\n F11.g = ((double)VSDK.signedByte2unsignedInteger(p.g)) / 255.0;\n F11.b = ((double)VSDK.signedByte2unsignedInteger(p.b)) / 255.0;\n\n //-----------------------------------------------------------------\n ColorRgb FU0 = new ColorRgb();\n FU0.r = F00.r + du * (F10.r-F00.r);\n FU0.g = F00.g + du * (F10.g-F00.g);\n FU0.b = F00.b + du * (F10.b-F00.b);\n\n ColorRgb FU1 = new ColorRgb();\n FU1.r = F01.r + du * (F11.r-F01.r);\n FU1.g = F01.g + du * (F11.g-F01.g);\n FU1.b = F01.b + du * (F11.b-F01.b);\n\n ColorRgb FVAL = new ColorRgb();\n FVAL.r = FU0.r + dv * (FU1.r-FU0.r);\n FVAL.g = FU0.g + dv * (FU1.g-FU0.g);\n FVAL.b = FU0.b + dv * (FU1.b-FU0.b);\n\n return FVAL;\n }", "private static BufferedImage colorImage(BufferedImage image, Color color) {\n int width = image.getWidth();\n int height = image.getHeight();\n WritableRaster raster = image.getRaster();\n\n for (int xx = 0; xx < width; xx++) {\n for (int yy = 0; yy < height; yy++) {\n int[] pixels = raster.getPixel(xx, yy, (int[]) null);\n\n //colorize the pixels only if the pixel is opaque and white\n if (pixels[0] > 50 && pixels[1] > 50 && pixels[2] > 50) {\n pixels[0] = (int) (color.getRed()*255);\n pixels[1] = (int) (color.getGreen()*255);\n pixels[2] = (int) (color.getBlue()*255);\n raster.setPixel(xx, yy, pixels);\n }\n\n }\n }\n return image;\n }", "public void initColors() {\n\n int i;\n float j;\n\n int start;\n int numShades = 5;\n float shadeInc = 1 / (float) numShades;\n\n\n aColors = new Color[glb.MAXCOLORS]; /* set array size */\n\n\n /* White to Black */\n start = 0;\n for (i = start, j = 1; i < start + 6; j -= shadeInc, i++) {\n aColors[i] = new Color(j, j, j);\n }\n\n start = 6;\n /* Red to almost Magenta */\n for (i = start, j = 0; i < start + 5; j += shadeInc, i++) {\n aColors[i] = new Color((float) 1, (float) 0, j);\n }\n\n\n /* Magenta to almost Blue */\n start += 5;\n for (i = start, j = 1; i < start + 5; j -= shadeInc, i++) {\n aColors[i] = new Color(j, (float) 0, (float) 1);\n }\n\n\n /* Blue to almost Cyan */\n start += 5;\n for (i = start, j = 0; i < start + 5; j += shadeInc, i++) {\n aColors[i] = new Color((float) 0, j, (float) 1);\n }\n\n /* Cyan to almost Green */\n start += 5;\n for (i = start, j = 1; i < start + 5; j -= shadeInc, i++) {\n aColors[i] = new Color((float) 0, (float) 1, j);\n }\n\n\n\n /* Green to almost Yellow */\n start += 5;\n for (i = start, j = 0; i < start + 5; j += shadeInc, i++) {\n aColors[i] = new Color(j, (float) 1, (float) 0);\n }\n\n /* Yellow to almost Red */\n start += 5;\n for (i = start, j = 1; i < start + 5; j -= shadeInc, i++) {\n aColors[i] = new Color((float) 1, j, (float) 0);\n }\n\n }", "int[][][] sepiaToneImage(int[][][] imageArray, int height, int width);", "public float[] is_In_Ranges(int r, int g, int b){\n float cur_smallest_center_diff = -1;\n float cur_center_diff;\n float[] cur_centers = {-1.0f,-1.0f,-1.0f}; // 0 = red, 1 = green, 2 = blue\n for(Range cur_range: this.range_vector){\n if(cur_range.is_in_range(r, g, b)){\n cur_center_diff = ((r - cur_range.r_center)*(r - cur_range.r_center) + (g - cur_range.g_center)*(g - cur_range.g_center) + (b - cur_range.b_center)*(b - cur_range.b_center));\n if(cur_smallest_center_diff == -1) {\n cur_smallest_center_diff = cur_center_diff;\n cur_centers[0] = cur_range.r_center;\n cur_centers[1] = cur_range.g_center;\n cur_centers[2] = cur_range.b_center;\n }\n else if (cur_center_diff <= cur_smallest_center_diff) {\n cur_smallest_center_diff = cur_center_diff;\n cur_centers[0] = cur_range.r_center;\n cur_centers[1] = cur_range.g_center;\n cur_centers[2] = cur_range.b_center;\n }\n }\n }\n return cur_centers;\n }", "void deriveImage()\n\t{\n\n\t\t//img = new BufferedImage(dimx, dimy, BufferedImage.TYPE_INT_ARGB);\n\t\timg = null;\n\t\ttry{\n\t\t\timg = ImageIO.read(new File(\"src/input/World.png\"));\n\n\t\t}catch (IOException e){\n\t\t\tSystem.out.println(\"world image file error\");\n\t\t}\n\t\t//System.out.println(img.getHeight());\n\t\t//System.out.println(img.getWidth());\n//\t\tfloat maxh = -10000.0f, minh = 10000.0f;\n//\n//\t\t// determine range of tempVals s\n//\t\tfor(int x=0; x < dimx; x++)\n//\t\t\tfor(int y=0; y < dimy; y++) {\n//\t\t\t\tfloat h = tempVals [x][y];\n//\t\t\t\tif(h > maxh)\n//\t\t\t\t\tmaxh = h;\n//\t\t\t\tif(h < minh)\n//\t\t\t\t\tminh = h;\n//\t\t\t}\n\t\t\n\t\tfor(int x=0; x < dimx; x++)\n\t\t\tfor(int y=0; y < dimy; y++) {\n\t\t\t\t \t\n\t\t\t\t// find normalized tempVals value in range\n\t\t\t\t//float val = (tempVals [x][y] - minh) / (maxh - minh);\n\t\t\t\tfloat val = tempVals[x][y];\n\n\t\t\t\t//System.out.println(val);\n\n\t\t\t\tColor c = new Color(img.getRGB(x,y));\n\n\t\t\t\tif((c.getRed() > 50 && c.getGreen() > 100 && c.getBlue() < 200)) {\n\n\t\t\t\t\tif (val != 0.0f) {\n\t\t\t\t\t\tColor col = new Color(val, 0, 0);\n\t\t\t\t\t\timg.setRGB(x, y, col.getRGB());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\n\t\t\t\n\t}", "public char identifyColor(Mat in)\r\n\t{\r\n\t\t//Mat blue = new Mat(in.rows(), in.cols(), CvType.CV_8UC1);\r\n\t\t//Mat green = new Mat(in.rows(), in.cols(), CvType.CV_8UC1);\r\n\t\t//Mat red = new Mat(in.rows(), in.cols(), CvType.CV_8UC1);\r\n\t\t\r\n\t\t//split the channels of the image\r\n\t\tMat blue = new Mat(); // default is CV_8UC3\r\n\t\tMat green = new Mat();\r\n\t\tMat red = new Mat();\r\n\t\tList<Mat> channels = new ArrayList<Mat>(3);\r\n\t\tCore.split(in, channels);\r\n\t\tblue = channels.get(0); // makes all 3 CV_8UC1\r\n\t\tgreen = channels.get(1);\r\n\t\tred = channels.get(2);\r\n\t\t//System.out.println(blue.toString());\r\n\t\t\r\n\t\t// add the intensities\r\n\t\tMat intensity = new Mat(in.rows(), in.cols(), CvType.CV_32F);\r\n\t\t//Mat mask = new Mat();\r\n\t\tCore.add(blue, green, intensity);//, mask, CvType.CV_32F);\r\n\t\tCore.add(intensity, red, intensity);//, mask, CvType.CV_32F);\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t// not sure if correct from here to ...\r\n\t\t\r\n\t\t\r\n\t\tMat inten = new Mat();\r\n\t\tCore.divide(intensity, Scalar.all(3.0), inten);\r\n\t\t//System.out.println(intensity.toString());\r\n\t\t//Core.divide(3.0, intensity, inten);\r\n\t\t// if intensity = intensity / 3.0; means element-wise division\r\n\t\t// use intensity.muls(Mat m)\r\n\t\t// so make new Mat m of same size that has each element of 1/3\r\n\t\t\r\n\t\t/*\r\n\t\t * or\r\n\t\t * About per-element division you can use Core.divide()\r\n\r\n\t\t\tCore.divide(A,Scalar.all(d), B);\r\n\t\t\t\r\n\t\t\tIt's equivalent to B=A/d\r\n\t\t */\r\n\t\t\r\n\t\t// find normalized values\r\n\t\tMat bnorm = new Mat();\r\n\t\tMat gnorm = new Mat();\r\n\t\tMat rnorm = new Mat();\r\n\t\t//blue.convertTo(blue, CvType.CV_32F);\r\n\t\t//green.convertTo(green, CvType.CV_32F);\r\n\t\t//red.convertTo(red, CvType.CV_32F);\r\n\t\t\r\n\t\tCore.divide(blue, inten, bnorm);\r\n\t\tCore.divide(green, inten, gnorm);\r\n\t\tCore.divide(red, inten, rnorm);\r\n\t\t\r\n\t\t\r\n\t\t// find average norm values\r\n\t\tScalar val = new Scalar(0);\r\n\t\tval = Core.mean(bnorm);\r\n\t\tString value[] = val.toString().split(\",\");\r\n\t\tString s = value[0].substring(1);\r\n\t\tdouble bavg = Double.parseDouble(s);\r\n\t\tval = Core.mean(gnorm);\r\n\t\tString value1[] = val.toString().split(\",\");\r\n\t\tString s1 = value1[0].substring(1);\r\n\t\tdouble gavg = Double.parseDouble(s1);\r\n\t\tval = Core.mean(rnorm);\r\n\t\tString value2[] = val.toString().split(\",\");\r\n\t\tString s2 = value2[0].substring(1);\r\n\t\tdouble ravg = Double.parseDouble(s2);\r\n\t\t\r\n\t\t\r\n\t\t// ... here\r\n\t\t\r\n\t\t\r\n\t\t//original values\r\n\t\t/*\r\n\t\t// define the reference color values\r\n\t\t//double RED[] = {0.4, 0.5, 1.8};\r\n\t\t//double GREEN[] = {1.0, 1.2, 1.0};\r\n\t\tdouble BLUE[] = {1.75, 1.0, 0.5};\r\n\t\t//double YELLOW[] = {0.82, 1.7, 1.7};\r\n\t\tdouble ORANGE[] = {0.2, 1.0, 2.0};\r\n\t\tdouble WHITE[] = {2.0, 1.7, 1.7};\r\n\t\t//double BLACK[] = {0.0, 0.3, 0.3};\r\n\t\t*/\r\n\t\t\r\n\t\t\r\n\t\t// define the reference color values\r\n\t\t//double RED[] = {0.4, 0.5, 1.8};\r\n\t\t//double GREEN[] = {1.0, 1.2, 1.0};\r\n\t\tdouble BLUE[] = {1.75, 1.0, 0.5};\r\n\t\t//double YELLOW[] = {0.82, 1.7, 1.7};\r\n\t\tdouble ORANGE[] = {0.2, 1.0, 2.0};\r\n\t\tdouble WHITE[] = {2.0, 1.7, 1.7};\r\n\t\t//double BLACK[] = {0.0, 0.3, 0.3};\r\n\t\t\r\n\t\t// compute the square error relative to the reference color values\r\n\t\t//double minError = 3.0;\r\n\t\tdouble minError = 2.0;\r\n\t\tdouble errorSqr;\r\n\t\tchar bestFit = 'x';\r\n\t\t\r\n\t\t\r\n\t\t//test++;\r\n\t\t//System.out.print(\"\\n\\n\" + test + \"\\n\\n\");\r\n\t\t\r\n\t\t\r\n\t\t// check BLUE fitness\r\n\t\terrorSqr = normSqr(BLUE[0], BLUE[1], BLUE[2], bavg, gavg, ravg);\r\n\t\tSystem.out.println(\"Blue: \" + errorSqr);\r\n\t\tif(errorSqr < minError)\r\n\t\t{\r\n\t\t\tminError = errorSqr;\r\n\t\t\tbestFit = COLOR_BLUE;\r\n\t\t}\r\n\t\t// check ORANGE fitness\r\n\t\terrorSqr = normSqr(ORANGE[0], ORANGE[1], ORANGE[2], bavg, gavg, ravg);\r\n\t\tSystem.out.println(\"Orange: \" + errorSqr);\r\n\t\tif(errorSqr < minError)\r\n\t\t{\r\n\t\t\tminError = errorSqr;\r\n\t\t\tbestFit = COLOR_ORANGE;\r\n\t\t}\r\n\t\t// check WHITE fitness\r\n\t\terrorSqr = normSqr(WHITE[0], WHITE[1], WHITE[2], bavg, gavg, ravg);\r\n\t\tSystem.out.println(\"White: \" + errorSqr);\r\n\t\tif(errorSqr < minError)\r\n\t\t{\r\n\t\t\tminError = errorSqr;\r\n\t\t\tbestFit = COLOR_WHITE;\r\n\t\t}\r\n\t\t// check BLACK fitness\r\n\t\t/*errorSqr = normSqr(BLACK[0], BLACK[1], BLACK[2], bavg, gavg, ravg);\r\n\t\tSystem.out.println(\"Black: \" + errorSqr);\r\n\t\tif(errorSqr < minError)\r\n\t\t{\r\n\t\t\tminError = errorSqr;\r\n\t\t\tbestFit = COLOR_BLACK;\r\n\t\t}*/\r\n\t\t\r\n\t\t// return the best fit color label\r\n\t\treturn bestFit;\r\n\t}", "private static int getMiddleColor(int stColor, int edColor, int stRatio, int edRatio, int split) {\r\n int ratio = (100 * (split - stRatio)) / (edRatio - stRatio);\r\n int stR = getColorR(stColor), edR = getColorR(edColor);\r\n int stG = getColorG(stColor), edG = getColorG(edColor);\r\n int stB = getColorB(stColor), edB = getColorB(edColor);\r\n int mR = mixSigColor(stR, edR, ratio), mG = mixSigColor(stG, edG, ratio), mB = mixSigColor(stB, edB, ratio);\r\n return getColor(mR, mG, mB);\r\n }", "public void renderSectionF(Output output, int start, int end) {\n\t\t\n\t\t//Vector point = camera.position;\n\t\tVector point = new Vector(0.0, 3.8, 8.0);\n\t\tVector point2 = camera.position;\n\n\t\tfor(int x = start; x < end; x++) {\n\t\t\tfor(int y = 0; y < output.height; y++) {\n\t\t\t\t\n\t\t\t\toutput.writePixel(x, y, new Vector(0.0, 255.0, 0.0));\n\t\t\t\t\n\t\t\t\tdouble worldX = ((double)x - output.width / 2.0) / output.width;\n\t\t\t\tdouble worldY = ((double)y - output.height / 2.0) / output.width;\n\t\t\t\t\t\t\n\t\t\t\tVector locDirection = new Vector(worldX, worldY, camera.focalLength);\n\t\t\t\t\n\t\t\t\tVector w = camera.lookingAt;\n\t\t\t\tVector u = camera.lookingAt.cross(camera.up);\n\t\t\t\tVector v = camera.up;\n\t\t\t\t\n\t\t\t\tVector direction = Transforms.localToWorldCoords(locDirection, u, v, w);\n\t\t\t\tRay primaryRay = new Ray(camera.position, direction);\n\t\t\t\t\n\t\t\t\tVector color = new Vector(0.0, 0.0, 0.0);\n\t\t\t\t\n\t\t\t\tObjectHit hit = getHit(primaryRay);\n\t\t\t\t\n\t\t\t\tif(hit.hit) {\n\t\t\t\t\tVector vec = point.minus(hit.hitPoint).normalized();\n\t\t\t\t\tVector vec2 = point2.minus(hit.hitPoint).normalized();\n\t\t\t\t\t\n\t\t\t\t\tdouble factor = 255 * vec.dot(hit.normal) + 255 * vec2.dot(hit.normal);\n\t\t\t\t\t\n\t\t\t\t\tcolor = color.plus(hit.material.getColor(hit.textureCoordinates.x, hit.textureCoordinates.y).times(factor));\n\t\t\t\t\t//color = new Vector(hit.textureCoordinates.x, hit.textureCoordinates.y, 1 - hit.textureCoordinates.x - hit.textureCoordinates.y).times(255);\n\t\t\t\t}\n\t\t\t\n\t\t\t\toutput.writePixel(x, y, color);\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t}", "public void complement(int start, int end)\n {\n Pixel[] originPixel = this.getPixels();\n //loop through all pixels in the calling object and parameter \n for(int index=start;index<=end;index++){\n originPixel[index].setGreen(255-originPixel[index].getGreen());\n originPixel[index].setBlue(255-originPixel[index].getBlue());\n originPixel[index].setRed(255-originPixel[index].getRed()); \n }\n \n \n \n }", "private void run2DC(int numImages) {\r\n\r\n this.buildProgressBar();\r\n int totalComputation = numImages * numIterations;\r\n int computationCount = 0;\r\n\r\n // OK, here is where the meat of the algorithm goes\r\n\r\n int length;\r\n int i;\r\n int extents[] = new int[2];\r\n extents[0] = srcImage.getExtents()[0];\r\n extents[1] = srcImage.getExtents()[1];\r\n xDim = extents[0];\r\n yDim = extents[1];\r\n length = xDim * yDim;\r\n\r\n // buffers for the image data\r\n float sourceBufferR[] = null;\r\n float sourceBufferG[] = null;\r\n float sourceBufferB[] = null;\r\n float resultBufferR[] = null;\r\n float resultBufferG[] = null;\r\n float resultBufferB[] = null;\r\n float gaussianBufferR[] = null;\r\n float gaussianBufferG[] = null;\r\n float gaussianBufferB[] = null;\r\n float gradientBuffer[];\r\n float gradientBufferR[] = null;\r\n float gradientBufferG[] = null;\r\n float gradientBufferB[] = null;\r\n\r\n boolean useRed = true;\r\n boolean useGreen = true;\r\n boolean useBlue = true;\r\n int colorsPresent = 3;\r\n srcImage.calcMinMax();\r\n if (srcImage.getMinR() == srcImage.getMaxR()) {\r\n useRed = false;\r\n colorsPresent--;\r\n }\r\n if (srcImage.getMinG() == srcImage.getMaxG()) {\r\n useGreen = false;\r\n colorsPresent--;\r\n }\r\n if (srcImage.getMinB() == srcImage.getMaxB()) {\r\n useBlue = false;\r\n colorsPresent--;\r\n }\r\n\r\n // copy the image data into the sourceBuffer so we can access it\r\n try {\r\n if (useRed) {\r\n sourceBufferR = new float[length];\r\n resultBufferR = new float[length];\r\n gaussianBufferR = new float[length];\r\n gradientBufferR = new float[length];\r\n }\r\n if (useGreen) {\r\n sourceBufferG = new float[length];\r\n resultBufferG = new float[length];\r\n gaussianBufferG = new float[length];\r\n gradientBufferG = new float[length];\r\n }\r\n if (useBlue) {\r\n sourceBufferB = new float[length];\r\n resultBufferB = new float[length];\r\n gaussianBufferB = new float[length];\r\n gradientBufferB = new float[length];\r\n }\r\n gradientBuffer = new float[length];\r\n for (i = 0; i < length; i++) {\r\n gradientBuffer[i] = 0.0f;\r\n }\r\n } catch (OutOfMemoryError e){\r\n sourceBufferR = sourceBufferG = sourceBufferB = null;\r\n resultBufferR = resultBufferG = resultBufferB = null;\r\n gaussianBufferR = gaussianBufferG = gaussianBufferB = null;\r\n gradientBuffer = gradientBufferR = gradientBufferG = gradientBufferB = null;\r\n errorCleanUp(\"AlgorithmRegularizedIsotropicDiffusion: Out of memory when creating image buffer\", true);\r\n return;\r\n } // catch{}\r\n\r\n // Gaussian blur the input image as a 2.5D image set\r\n sigmas = new float[2];\r\n sigmas[0] = sigmas[1] = stdDev;\r\n\r\n makeKernels1D(false);\r\n\r\n // source image is in sourceBuffer, gaussian smoothed image is in gaussianBuffer\r\n\r\n\r\n\r\n int startIndex;\r\n for (int imgNumber = 0; imgNumber < numImages; imgNumber++) {\r\n startIndex = 4 * imgNumber * length;\r\n try {\r\n if (useRed) {\r\n srcImage.exportRGBData(1, startIndex, length, sourceBufferR);\r\n }\r\n if (useGreen) {\r\n srcImage.exportRGBData(2, startIndex, length, sourceBufferG);\r\n }\r\n if (useBlue) {\r\n srcImage.exportRGBData(3, startIndex, length, sourceBufferB);\r\n }\r\n } catch (IOException error) {\r\n sourceBufferR = sourceBufferG = sourceBufferB = null;\r\n resultBufferR = resultBufferG = resultBufferB = null;\r\n gaussianBufferR = gaussianBufferG = gaussianBufferB = null;\r\n gradientBuffer = gradientBufferR = gradientBufferG = gradientBufferB = null;\r\n errorCleanUp(\"AlgorithmRegularizedIsotropicDiffusion: could NOT export source image\", true);\r\n return;\r\n } // catch()\r\n // make the magnitude of the gradient image of the gaussian smoothed source image\r\n if (useRed) {\r\n algoSepConvolverR = new AlgorithmSeparableConvolver(gaussianBufferR, sourceBufferR,\r\n extents, xDataRound, yDataRound, false);\r\n }\r\n if (useGreen) {\r\n algoSepConvolverG = new AlgorithmSeparableConvolver(gaussianBufferG, sourceBufferG,\r\n extents, xDataRound, yDataRound, false);\r\n }\r\n if (useBlue) {\r\n algoSepConvolverB = new AlgorithmSeparableConvolver(gaussianBufferB, sourceBufferB,\r\n extents, xDataRound, yDataRound, false);\r\n }\r\n\r\n for(int iterNum = 0; iterNum < numIterations; iterNum++) {\r\n if (isProgressBarVisible()) {\r\n progressBar.updateValue(Math.round( ( (float) (computationCount) /\r\n (totalComputation - 1) * 100)),\r\n activeImage);\r\n }\r\n\r\n if (useRed) {\r\n algoSepConvolverR.run();\r\n gradientMagnitude(gaussianBufferR, gradientBufferR);\r\n for (i = 0; i < length; i++) {\r\n gradientBuffer[i] = gradientBufferR[i];\r\n }\r\n }\r\n if (useGreen) {\r\n algoSepConvolverG.run();\r\n gradientMagnitude(gaussianBufferG, gradientBufferG);\r\n for (i = 0; i < length; i++) {\r\n gradientBuffer[i] += gradientBufferG[i];\r\n }\r\n }\r\n if (useBlue) {\r\n algoSepConvolverB.run();\r\n gradientMagnitude(gaussianBufferB, gradientBufferB);\r\n for (i = 0; i < length; i++) {\r\n gradientBuffer[i] += gradientBufferB[i];\r\n }\r\n }\r\n for (i = 0; i < length; i++) {\r\n gradientBuffer[i] /= colorsPresent;\r\n }\r\n if (useRed) {\r\n upDateImage(resultBufferR, sourceBufferR, gradientBuffer);\r\n }\r\n if (useGreen) {\r\n upDateImage(resultBufferG, sourceBufferG, gradientBuffer);\r\n }\r\n if (useBlue) {\r\n upDateImage(resultBufferB, sourceBufferB, gradientBuffer);\r\n }\r\n\r\n // copy resultBuffer to sourceBuffer for the next iteration\r\n if (iterNum < (numIterations - 1)) {\r\n if (useRed) {\r\n for (i = 0; i < length; i++) {\r\n sourceBufferR[i] = resultBufferR[i];\r\n }\r\n } // if (useRed)\r\n if (useGreen) {\r\n for (i = 0; i < length; i++) {\r\n sourceBufferG[i] = resultBufferG[i];\r\n }\r\n } // if (useGreen)\r\n if (useBlue) {\r\n for (i = 0; i < length; i++) {\r\n sourceBufferB[i] = resultBufferB[i];\r\n }\r\n } // if (useBlue)\r\n } // if (iterNum < (numIterations - 1))\r\n\r\n computationCount++;\r\n } // end for (int iterNum = 0; ...)\r\n\r\n if (useRed) {\r\n algoSepConvolverR.finalize();\r\n algoSepConvolverR = null;\r\n }\r\n if (useGreen) {\r\n algoSepConvolverG.finalize();\r\n algoSepConvolverG = null;\r\n }\r\n if (useBlue) {\r\n algoSepConvolverB.finalize();\r\n algoSepConvolverB = null;\r\n }\r\n\r\n // OK, the resultBuffer is filled with the results of the algorithm,\r\n // put this data into the destination image so it will be displayed in\r\n // in the ViewJFrameWizard\r\n try {\r\n if (useRed) {\r\n for (i = 0; i < length; i++) {\r\n if ((resultBufferR[i] > 255.0f) &&\r\n (destImage.getType() == ModelStorageBase.ARGB)) {\r\n resultBufferR[i] = 255.0f;\r\n }\r\n else if (resultBufferR[i] < 0.0f) {\r\n resultBufferR[i] = 0.0f;\r\n }\r\n }\r\n destImage.importRGBData(1,startIndex, resultBufferR, false);\r\n }\r\n if (useGreen) {\r\n for (i = 0; i < length; i++) {\r\n if ((resultBufferG[i] > 255.0f) &&\r\n (destImage.getType() == ModelStorageBase.ARGB)) {\r\n resultBufferG[i] = 255.0f;\r\n }\r\n else if (resultBufferG[i] < 0.0f) {\r\n resultBufferG[i] = 0.0f;\r\n }\r\n }\r\n destImage.importRGBData(2,startIndex, resultBufferG, false);\r\n }\r\n if (useBlue) {\r\n for (i = 0; i < length; i++) {\r\n if ((resultBufferB[i] > 255.0f) &&\r\n (destImage.getType() == ModelStorageBase.ARGB)) {\r\n resultBufferB[i] = 255.0f;\r\n }\r\n else if (resultBufferB[i] < 0.0f) {\r\n resultBufferB[i] = 0.0f;\r\n }\r\n }\r\n destImage.importRGBData(3,startIndex, resultBufferB, false);\r\n }\r\n } catch (IOException error) {\r\n sourceBufferR = sourceBufferG = sourceBufferB = null;\r\n resultBufferR = resultBufferG = resultBufferB = null;\r\n gaussianBufferR = gaussianBufferG = gaussianBufferB = null;\r\n gradientBuffer = gradientBufferR = gradientBufferG = gradientBufferB = null;\r\n errorCleanUp(\"AlgorithmRegularizedIsotropicDiffusion: Could NOT import resultBuffer to the image\", true);\r\n return;\r\n } // end try{}-catch{}\r\n\r\n } // end for (imgNumber = 0; ...)\r\n destImage.calcMinMax();\r\n\r\n disposeProgressBar();\r\n if (threadStopped) { finalize(); return; }\r\n\r\n setCompleted(true);\r\n }", "private List<int[]> separateColorChannels(RGBImage image) {\n\t\tList<int[]> outList = new ArrayList<int[]>(3);\n\t\tint[] data = (int[]) image.getValue();\n\t\tint[] rch = new int[data.length];\n\t\tint[] gch = new int[data.length];\n\t\tint[] bch = new int[data.length];\n\t\tfor (int i = 0; i < data.length && start; i++) {\n\t\t\trch[i] = (data[i] >> 16) & MASK;\n\t\t\tgch[i] = (data[i] >> 8) & MASK;\n\t\t\tbch[i] = data[i] & MASK;\n\t\t}\n\t\toutList.add(0, rch);\n\t\toutList.add(1, gch);\n\t\toutList.add(2, bch);\n\t\treturn outList;\n\t}", "@Test\n public void testGray8BitIntoRGB() {\n BufferedImage im8bit = new BufferedImage(100, 100, BufferedImage.TYPE_BYTE_GRAY);\n WritableRaster raster8bit = im8bit.getRaster();\n int[] fill = new int[50 * 100];\n Arrays.fill(fill, 10);\n raster8bit.setSamples(0, 0, 50, 100, 0, fill);\n Arrays.fill(fill, 50);\n raster8bit.setSamples(50, 0, 50, 100, 0, fill);\n\n BufferedImage yellow = buildBGR(Color.YELLOW);\n\n // mosaic setting the nodata\n Range noData10 = RangeFactory.create((byte) 10, (byte) 10);\n RenderedOp mosaic = MosaicDescriptor.create(new RenderedImage[] { im8bit, yellow },\n javax.media.jai.operator.MosaicDescriptor.MOSAIC_TYPE_OVERLAY, null, null, null,\n new double[] { 0 }, new Range[] { noData10, null }, null);\n\n assertRGB(mosaic, false);\n\n // check top left quadrant, should be yellow\n int[] pixel = new int[3];\n mosaic.getData().getPixel(10, 10, pixel);\n assertArrayEquals(new int[] { 255, 255, 0 }, pixel);\n // check top right quadrant, should be 50 expanded to RGB\n mosaic.getData().getPixel(75, 10, pixel);\n assertArrayEquals(new int[] { 50, 50, 50 }, pixel);\n // check bottom left quadrant, should be yellow\n mosaic.getData().getPixel(25, 75, pixel);\n assertArrayEquals(new int[] { 255, 255, 0 }, pixel);\n // check bottom right quadrant, should be 50 expanded to RGB\n mosaic.getData().getPixel(75, 75, pixel);\n assertArrayEquals(new int[] { 50, 50, 50 }, pixel);\n }", "public void negative(BufferedImage img, int startX, int startY, int endX, int endY) throws IOException{\r\n int pixels[] = new int[3];\r\n double ww[]=new double[3];\r\n WritableRaster raster = img.getRaster();\r\n \r\n for(int i=startX;i<endX;i++) {\r\n for(int j=startY;j<endY;j++){\r\n \r\n \r\n raster.getPixel(i, j, pixels);\r\n \r\n ww[0] = 255-pixels[0];\r\n ww[1] = 255-pixels[1];\r\n ww[2] = 255-pixels[2];\r\n \r\n raster.setPixel(i, j, ww);\r\n \r\n }\r\n \r\n }\r\n\r\n \r\n\r\n }", "public static BufferedImage average(BufferedImage image, int value) {\n //3-position array where we store R,G,B values of every pixel\n int[] colors;\n //3-position array where we will store the mean value of every pixel of every channel\n int[] meanColor = new int[3];\n //mean values for every channel\n double meanRed, meanGreen, meanBlue;\n //Create a tessela form the original image so we can modify its pixels\n WritableRaster bitmap = (WritableRaster) image.getData();\n WritableRaster tesela = bitmap.createWritableChild(image.getMinX(), image.getMinY(), image.getWidth(), image.getHeight(), 0,0, null);\n //Image iteration\n for (int x = 0; x < image.getWidth()-1; x++){\n for (int y = 0; y < image.getHeight()-1; y++) {\n int red = 0, green=0, blue = 0;\n //Window iteration\n for (int f =-value; f <= value; f++) {\n for (int k = -value; k <= value; k++) {\n //Get every window coordinate, but first check if they actually exist (not out of bounds)\n if (y+(f)>=0 && x+(k)>=0 && y+(f) < image.getHeight() && x+(k)<image.getWidth()) {\n //Temporal store of the value of every channel so then we can compute the mean\n colors = getPixelColor(image,x+k,y+f);\n red += colors[0];\n green += colors[1];\n blue += colors[2];\n }\n }\n }\n //To compute the mean of every color we have to compute the 'distance'+1\n int distance = (value - (-value)+1)*(value - (-value)+1);\n //For every channel, compute the new pixel value\n meanRed = red / distance;\n meanColor[0] = (int) meanRed; \n meanGreen = green / distance;\n meanColor[1] = (int) meanGreen;\n meanBlue = blue / distance;\n meanColor[2] = (int) meanBlue;\n bitmap.setPixel(x,y,meanColor);\n }\n }\n //Create the averaged image and return it\n BufferedImage subImage = new BufferedImage(image.getColorModel(),tesela,image.isAlphaPremultiplied(),null);\n return subImage;\n }", "private void updateRaster (Color minColor, Color maxColor) {\n\t\tRectangle bounds = new Rectangle (0, 0, 100, 1);\n\t\tGradientPaint gp = new GradientPaint (0.0f, 0.0f, minColor, 100.0f, 0.0f, maxColor);\n\t\tColorModel cm = Toolkit.getDefaultToolkit().getColorModel();\n\t\tPaintContext pc = gp.createContext(cm, bounds, bounds, new AffineTransform (), null);\n\t\traster = pc.getRaster(0,0,100,1);\n\t}", "public void generateGradient(int startX, int startY, int endX, int endY, int startSat, int endSat, int hueSat, int brightnessSat) {\n colorMode(HSB,360,100,100);\n int dX = Math.abs(endX-startX);\n int dY = Math.abs(endY-startY);\n double changePerPixel = (endSat-startSat)/(double)dY;\n strokeWeight(2);\n int changePerFrameY = endY > startY ? 1 : -1;\n for(int i=0;i<Math.abs(dY);i++){\n stroke((int)(startSat+changePerPixel*i),hueSat,brightnessSat);\n line(startX, i*changePerFrameY+startY, endX, i*changePerFrameY+startY);\n }\n}", "int interpolateColor(int[] arr, float step) {\n int sz = arr.length;\n\n if (sz == 1 || step <= 0.0) {\n return arr[0];\n } else if (step >= 1.0) {\n return arr[sz - 1];\n }\n\n float scl = step * (sz - 1);\n int i = (int) scl;\n\n return lerpColor(arr[i], arr[i + 1], scl - i);\n }", "private void traverseBayeredPatternFullSizeRGB() {\n\n for (int x = 0; x < originalImageHeight -1; x++){\n for (int y = 1; y < originalImageWidth -1; y++){\n Point position = new Point(x,y);\n int absolutePosition = getAbsolutPixelPosition(position);\n\n PixelType pixelType = null;\n\n if (x%2 == 0 && y%2 == 0) pixelType = PixelType.GREEN_TOPRED;\n if (x%2 == 0 && y%2 == 1) pixelType = PixelType.BLUE;\n if (x%2 == 1 && y%2 == 0) pixelType = PixelType.RED;\n if (x%2 == 1 && y%2 == 1) pixelType = PixelType.GREEN_TOPBLUE;\n\n fullSizePixRGB[absolutePosition] = getFullSizeRGB(new Point(x,y),pixelType);\n }\n }\n }", "private void equalize(BufferedImage img) {\n \t\tfloat minSat = Float.MAX_VALUE, maxSat = Float.MIN_VALUE;\n \t\tfloat minVal = Float.MAX_VALUE, maxVal = Float.MIN_VALUE;\n \t\t\n \t\tint[] prgb = { 0, 0, 0 };\n \t\tfloat[] hsv = { 0, 0, 0 };\n \t\t\n \t\tint[] valCount = new int[16];\n \t\t\n \t\tfor (int y = 0; y < img.getHeight(); y++) {\n \t\t\tfor (int x = 0; x < img.getWidth(); x++) {\n \t\t\t\tint pixel = img.getRGB(x, y);\n \t\t\t\tpixelToRGB(pixel, prgb);\n \t\t\t\trgbToHsv(prgb[0], prgb[1], prgb[2], hsv);\n \t\t\t\tminSat = Math.min(hsv[1], minSat);\n \t\t\t\tmaxSat = Math.max(hsv[1], maxSat);\n \t\t\t\tminVal = Math.min(hsv[2], minVal);\n \t\t\t\tmaxVal = Math.max(hsv[2], maxVal);\n \t\t\t\tvalCount[(int) (hsv[2] / 16)]++;\n \t\t\t}\n \t\t}\n \t\t\n \t\tint maxPt = -1;\n \t\tfor (int i = 1; i < 15; i++) {\n \t\t\tif (maxPt == -1 || valCount[i] >= valCount[maxPt]) {\n \t\t\t\tmaxPt = i;\n \t\t\t}\n \t\t}\n \t\t\n \t\tint valueMidpoint = maxPt * 16;\n \t\t\n \t\tSystem.out.println(\"Equalize: sat = \"+minSat+\" to \" +maxSat+\"; val = \" + minVal + \" to \" + maxVal+\"; value midpoint = \" + valueMidpoint);\n \t\tfloat satScale = 1.0f - minSat;\n \t\tfloat valScale = 255 - minVal;\n \t\tfloat satDiff = maxSat - minSat;\n \t\tfloat valDiff = maxVal - minVal;\n \t\t\n \t\tfor (int y = 0; y < img.getHeight(); y++) {\n \t\t\tfor (int x = 0; x < img.getWidth(); x++) {\n \t\t\t\tint pixel = img.getRGB(x, y);\n \t\t\t\tpixelToRGB(pixel, prgb);\n \t\t\t\trgbToHsv(prgb[0], prgb[1], prgb[2], hsv);\n \t\t\t\t\n \t\t\t\tif (satDiff < 0.5)\n \t\t\t\t\thsv[1] = ((hsv[1] - minSat) / satDiff) * satScale + minSat;\n \t\t\t\tif (valDiff < 128)\n \t\t\t\t\thsv[2] = ((hsv[2] - minVal) / valDiff) * valScale + minVal;\n \n \t\t\t\thsvToRgb(hsv[0], hsv[1], hsv[2], prgb);\n \t\t\t\t\n \t\t\t\timg.setRGB(x, y, rgb8ToPixel(prgb) | (pixel & 0xff000000));\n \t\t\t}\n \t\t}\n \t}", "void fill(int rgb);", "private void colorByGroup(Pixel[] pixels, int image) {\n for(int i = 0; i < pixels.length; i++) {\n Pixel recolor = pixels[i];\n Pixel head = recolor.findHead();\n // if(head != lastHead) {\n // System.out.println(head);\n // lastHead = head;\n // }\n if(head.roundAssignedColor != 1) {\n head.randomRGB(1);\n }\n int color = head.groupRGB;\n setRGB(recolor.x, recolor.y, color, image);\n }\n }", "public void colorBarrenRectangles() {\n\n ListIterator<Integer[]> iterator = allRectangles.listIterator();\n while (iterator.hasNext()) {\n\n Integer[] rectangle = iterator.next();\n\n for (int i = rectangle[0]; i <= rectangle[2]; i++) {\n for (int j = rectangle[1]; j <= rectangle[3]; j++) {\n mColor[i][j] = 1;\n }\n }\n }\n }", "private void setPixels() {\n\t\t\tfinal byte[] dest = new byte[(int) (getMetadata().get(0).getAxisLength(\n\t\t\t\tAxes.X) * getMetadata().get(0).getAxisLength(Axes.Y))];\n\t\t\tlong lastImage = -1;\n\n\t\t\t// fill in starting image contents based on last image's dispose\n\t\t\t// code\n\t\t\tif (getMetadata().getLastDispose() > 0) {\n\t\t\t\tif (getMetadata().getLastDispose() == 3) { // use image before last\n\t\t\t\t\tfinal long n = getMetadata().get(0).getPlaneCount() - 2;\n\t\t\t\t\tif (n > 0) lastImage = n - 1;\n\t\t\t\t}\n\n\t\t\t\tif (lastImage != -1) {\n\t\t\t\t\tfinal byte[] prev = getMetadata().getImages().get((int) lastImage);\n\t\t\t\t\tSystem.arraycopy(prev, 0, dest, 0, (int) (getMetadata().get(0)\n\t\t\t\t\t\t.getAxisLength(Axes.X) * getMetadata().get(0).getAxisLength(\n\t\t\t\t\t\t\tAxes.Y)));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// copy each source line to the appropriate place in the destination\n\n\t\t\tint pass = 1;\n\t\t\tint inc = 8;\n\t\t\tint iline = 0;\n\t\t\tfor (int i = 0; i < getMetadata().getIh(); i++) {\n\t\t\t\tint line = i;\n\t\t\t\tif (getMetadata().isInterlace()) {\n\t\t\t\t\tif (iline >= getMetadata().getIh()) {\n\t\t\t\t\t\tpass++;\n\t\t\t\t\t\tswitch (pass) {\n\t\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\t\tiline = 4;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\t\tiline = 2;\n\t\t\t\t\t\t\t\tinc = 4;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 4:\n\t\t\t\t\t\t\t\tiline = 1;\n\t\t\t\t\t\t\t\tinc = 2;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tline = iline;\n\t\t\t\t\tiline += inc;\n\t\t\t\t}\n\t\t\t\tline += getMetadata().getIy();\n\t\t\t\tif (line < getMetadata().get(0).getAxisLength(Axes.Y)) {\n\t\t\t\t\tfinal int k = line * (int) getMetadata().get(0).getAxisLength(Axes.X);\n\t\t\t\t\tint dx = k + getMetadata().getIx(); // start of line in dest\n\t\t\t\t\tint dlim = dx + getMetadata().getIw(); // end of dest line\n\t\t\t\t\tif ((k + getMetadata().get(0).getAxisLength(Axes.X)) < dlim) dlim =\n\t\t\t\t\t\tk + (int) getMetadata().get(0).getAxisLength(Axes.X);\n\t\t\t\t\tint sx = i * getMetadata().getIw(); // start of line in\n\t\t\t\t\t// source\n\t\t\t\t\twhile (dx < dlim) {\n\t\t\t\t\t\t// map color and insert in destination\n\t\t\t\t\t\tfinal int index = getMetadata().getPixels()[sx++] & 0xff;\n\t\t\t\t\t\tdest[dx++] = (byte) index;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tgetMetadata().getColorTables().add(getMetadata().getAct());\n\t\t\tgetMetadata().getImages().add(dest);\n\t\t}", "private static int mixSigColor(int c1, int c2, int ratio) {//0~100\r\n return 0xff & (((c2 * ratio) + (c1 * (100 - ratio))) / 100);\r\n }", "@Test\n public void testGray16BitIntoRGB() {\n BufferedImage im16bit = new BufferedImage(100, 100, BufferedImage.TYPE_USHORT_GRAY);\n WritableRaster raster16bit = im16bit.getRaster();\n int[] fill = new int[50 * 100];\n Arrays.fill(fill, 1000);\n raster16bit.setSamples(0, 0, 100, 50, 0, fill);\n Arrays.fill(fill, 30000);\n raster16bit.setSamples(0, 50, 100, 50, 0, fill);\n\n // mosaic setting the nodata\n\n BufferedImage yellow = buildBGR(Color.YELLOW);\n\n // mosaic setting the nodata\n Range noData1000 = RangeFactory.create(1000, 1000);\n RenderedOp mosaic = MosaicDescriptor.create(new RenderedImage[] { im16bit, yellow },\n javax.media.jai.operator.MosaicDescriptor.MOSAIC_TYPE_OVERLAY, null, null, null,\n new double[] { 0 }, new Range[] { noData1000, null }, null);\n\n // RenderedImageBrowser.showChain(mosaic);\n\n assertRGB(mosaic, false);\n\n // check top left quadrant, should be yellow (nodata in the gray one)\n int[] pixel = new int[3];\n mosaic.getData().getPixel(10, 10, pixel);\n assertArrayEquals(new int[] { 255, 255, 0 }, pixel);\n // check top right quadrant, should be yellow (nodata in the gray one)\n mosaic.getData().getPixel(75, 10, pixel);\n assertArrayEquals(new int[] { 255, 255, 0 }, pixel);\n // check bottom left quadrant, should be 30000 scaled down to byte\n mosaic.getData().getPixel(25, 75, pixel);\n assertArrayEquals(new int[] { 117, 117, 117 }, pixel);\n // check bottom right quadrant, should be 30000 scaled down to byte\n mosaic.getData().getPixel(75, 75, pixel);\n assertArrayEquals(new int[] { 117, 117, 117 }, pixel);\n }", "public native void cycleColormapImage(int amount) throws MagickException;", "private static native long createSuperpixelSLIC_0(long image_nativeObj, int algorithm, int region_size, float ruler);", "private static int[][] copyRegiontoArray(int[] dim, ArrayList<PositionAndColor> region) {\n\t\tint[][] res = new int[(dim[1] - dim[0]) + 1][(dim[3] - dim[2]) + 1];\n\t\tImageOperation.fillArray(res, ImageOperation.BACKGROUND_COLORint);\n\t\tfor (Iterator<PositionAndColor> i = region.iterator(); i.hasNext();) {\n\t\t\tPositionAndColor temp = i.next();\n\t\t\tres[temp.x - dim[0]][temp.y - dim[2]] = temp.intensityInt;\n\t\t}\n\t\treturn res;\n\t}", "public static Image filtroGris(Image img){\n WritableImage resultImg = new WritableImage((int)img.getWidth(),(int)img.getHeight());\n PixelReader pixelr = img.getPixelReader();\n PixelWriter pixelw = resultImg.getPixelWriter();\n \n for (int i = 0; i < img.getHeight(); i++) {\n for (int j = 0; j < img.getWidth(); j++) {\n Color color = pixelr.getColor(j, i);\n double red, green, blue;\n red = color.getRed();\n green = color.getGreen();\n blue = color.getBlue();\n red *= 255;\n green *= 255;\n blue *= 255;\n double gris = (red + green + blue)/3;\n pixelw.setColor(j, i, Color.rgb((int)gris, (int)gris, (int)gris));\n }\n }\n \n return resultImg;\n }", "protected void computeRect(Raster[] sources,\n WritableRaster dest,\n Rectangle destRect) {\n Raster source = sources[0];\n Rectangle srcRect = mapDestRect(destRect, 0);\n \n int formatTag = MediaLibAccessor.findCompatibleTag(sources,dest);\n \n MediaLibAccessor srcAccessor =\n new MediaLibAccessor(source,srcRect,formatTag);\n MediaLibAccessor dstAccessor =\n new MediaLibAccessor(dest,destRect,formatTag);\n int numBands = getSampleModel().getNumBands();\n \n\n int cmask = (1 << numBands) -1; \n mediaLibImage[] srcML = srcAccessor.getMediaLibImages();\n mediaLibImage[] dstML = dstAccessor.getMediaLibImages();\n for (int i = 0; i < dstML.length; i++) {\n switch (dstAccessor.getDataType()) {\n case DataBuffer.TYPE_BYTE:\n case DataBuffer.TYPE_USHORT:\n case DataBuffer.TYPE_SHORT:\n case DataBuffer.TYPE_INT:\n if (maskSize == 3) {\n // Call appropriate Medialib accelerated function\n Image.MinFilter3x3(dstML[i], srcML[i]);\n } else if (maskSize == 5) {\n // Call appropriate Medialib accelerated function\n Image.MinFilter5x5(dstML[i], srcML[i]);\n } else if (maskSize == 7) {\n // Call appropriate Medialib accelerated function\n Image.MinFilter7x7(dstML[i], srcML[i]);\n } \n\n break;\n case DataBuffer.TYPE_FLOAT:\n case DataBuffer.TYPE_DOUBLE:\n if (maskSize == 3) {\n // Call appropriate Medialib accelerated function\n Image.MinFilter3x3_Fp(dstML[i], srcML[i]);\n } else if (maskSize == 5) {\n // Call appropriate Medialib accelerated function\n Image.MinFilter5x5_Fp(dstML[i], srcML[i]);\n } else if (maskSize == 7) {\n // Call appropriate Medialib accelerated function\n Image.MinFilter7x7_Fp(dstML[i], srcML[i]);\n } \n break;\n default:\n String className = this.getClass().getName();\n throw new RuntimeException(JaiI18N.getString(\"Generic2\"));\n }\n }\n \n if (dstAccessor.isDataCopy()) {\n dstAccessor.copyDataToRaster();\n }\n }", "public static Integer[] findEdgecolors(BufferedImage image)\r\n\t{\r\n\t\t// try to clean up the image by removing stray marks\r\n\t\t\t\tInteger[] colors=new Integer[10]; \r\n\t\t\t\tint[] width={0,image.getWidth()-1}; // horizontal comparision array\r\n\t\t\t\tint[] heigth={0,image.getHeight()-1}; // vertical comparision array\r\n\t\t\t\tint i=0;\r\n\t\t\t\tfor(int x=0;x<=1;x++){ \r\n\t\t\t\t\tfor (int y=0; y<image.getHeight(); y++) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tint pixelVal = image.getRGB(width[x], y);//getting the edge color in RGB value\r\n\t\t\t\t\t\tif(!Arrays.asList(colors).contains(pixelVal)) // checking if the color already exists if yes do nothing if no add the color to array\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tcolors[i]=pixelVal;\r\n\t\t\t\t\t\t\ti++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t i=0;\r\n\t\t\t\t\tfor(int x=0;x<image.getWidth();x++){\r\n\t\t\t\t\t\tfor (int y=0; y<=1; y++) {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tint pixelVal = image.getRGB(x, width[y]);//getting the edge color in RGB value\r\n\t\t\t\t\t\t\tif(!Arrays.asList(colors).contains(pixelVal))// checking if the color already exists if yes do nothing if no add the color to array\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tcolors[i]=pixelVal;\r\n\t\t\t\t\t\t\t\ti++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\r\n\t\treturn colors;\r\n\t}", "public native MagickImage spreadImage(int radius) throws MagickException;", "public void filterImage()\r\n {\r\n\t if (!isInverted && !isBlured )\r\n {\r\n cropedEdited = cropedPart;\r\n }\r\n\t float[] elements = {0.0f, 1.0f, 0.0f, -1.0f,brightnessLevel,1.0f,0.0f,0.0f,0.0f}; \r\n\t Kernel kernel = new Kernel(3, 3, elements); \r\n\t BufferedImageOp change = new ConvolveOp(kernel); \r\n\t cropedEdited = change.filter(cropedEdited, null);\r\n repaint();\r\n }", "private void run3DC() {\r\n\r\n this.buildProgressBar();\r\n\r\n // OK, here is where the meat of the algorithm goes\r\n\r\n int length;\r\n int i;\r\n int extents[] = srcImage.getExtents();\r\n xDim = extents[0];\r\n yDim = extents[1];\r\n zDim = extents[2];\r\n length = xDim * yDim * zDim;\r\n\r\n // buffers for the image data\r\n float sourceBufferR[] = null;\r\n float sourceBufferG[] = null;\r\n float sourceBufferB[] = null;\r\n float resultBufferR[] = null;\r\n float resultBufferG[] = null;\r\n float resultBufferB[] = null;\r\n float gaussianBufferR[] = null;\r\n float gaussianBufferG[] = null;\r\n float gaussianBufferB[] = null;\r\n float gradientBuffer[];\r\n float gradientBufferR[] = null;\r\n float gradientBufferG[] = null;\r\n float gradientBufferB[] = null;\r\n\r\n boolean useRed = true;\r\n boolean useGreen = true;\r\n boolean useBlue = true;\r\n int colorsPresent = 3;\r\n srcImage.calcMinMax();\r\n if (srcImage.getMinR() == srcImage.getMaxR()) {\r\n useRed = false;\r\n colorsPresent--;\r\n }\r\n if (srcImage.getMinG() == srcImage.getMaxG()) {\r\n useGreen = false;\r\n colorsPresent--;\r\n }\r\n if (srcImage.getMinB() == srcImage.getMaxB()) {\r\n useBlue = false;\r\n colorsPresent--;\r\n }\r\n\r\n // copy the image data into the sourceBuffer so we can access it\r\n try {\r\n if (useRed) {\r\n sourceBufferR = new float[length];\r\n resultBufferR = new float[length];\r\n gaussianBufferR = new float[length];\r\n gradientBufferR = new float[length];\r\n }\r\n if (useGreen) {\r\n sourceBufferG = new float[length];\r\n resultBufferG = new float[length];\r\n gaussianBufferG = new float[length];\r\n gradientBufferG = new float[length];\r\n }\r\n if (useBlue) {\r\n sourceBufferB = new float[length];\r\n resultBufferB = new float[length];\r\n gaussianBufferB = new float[length];\r\n gradientBufferB = new float[length];\r\n }\r\n gradientBuffer = new float[length];\r\n for (i = 0; i < length; i++) {\r\n gradientBuffer[i] = 0.0f;\r\n }\r\n } catch (OutOfMemoryError e){\r\n sourceBufferR = sourceBufferG = sourceBufferB = null;\r\n resultBufferR = resultBufferG = resultBufferB = null;\r\n gaussianBufferR = gaussianBufferG = gaussianBufferB = null;\r\n gradientBuffer = gradientBufferR = gradientBufferG = gradientBufferB = null;\r\n errorCleanUp(\"AlgorithmRegularizedIsotropicDiffusion: Out of memory when creating image buffer\", true);\r\n return;\r\n } // catch{}\r\n\r\n // Gaussian blur the input image as a 3D image\r\n sigmas = new float[3];\r\n sigmas[0] = sigmas[1] = sigmas[2] = stdDev;\r\n\r\n makeKernels1D(true);\r\n\r\n // source image is in sourceBuffer, gaussian smoothed image is in gaussianBuffer\r\n\r\n\r\n try {\r\n if (useRed) {\r\n srcImage.exportRGBData(1, 0, length, sourceBufferR);\r\n }\r\n if (useGreen) {\r\n srcImage.exportRGBData(2, 0, length, sourceBufferG);\r\n }\r\n if (useBlue) {\r\n srcImage.exportRGBData(3, 0, length, sourceBufferB);\r\n }\r\n } catch (IOException error) {\r\n sourceBufferR = sourceBufferG = sourceBufferB = null;\r\n resultBufferR = resultBufferG = resultBufferB = null;\r\n gaussianBufferR = gaussianBufferG = gaussianBufferB = null;\r\n gradientBuffer = gradientBufferR = gradientBufferG = gradientBufferB = null;\r\n errorCleanUp(\"AlgorithmRegularizedIsotropicDiffusion: could NOT export source image\", true);\r\n return;\r\n } // catch()\r\n // make the magnitude of the gradient image of the gaussian smoothed source image\r\n if (useRed) {\r\n algoSepConvolverR = new AlgorithmSeparableConvolver(gaussianBufferR, sourceBufferR,\r\n extents, xDataRound, yDataRound, zDataRound, false);\r\n }\r\n if (useGreen) {\r\n algoSepConvolverG = new AlgorithmSeparableConvolver(gaussianBufferG, sourceBufferG,\r\n extents, xDataRound, yDataRound, zDataRound, false);\r\n }\r\n if (useBlue) {\r\n algoSepConvolverB = new AlgorithmSeparableConvolver(gaussianBufferB, sourceBufferB,\r\n extents, xDataRound, yDataRound, zDataRound, false);\r\n }\r\n\r\n for(int iterNum = 0; iterNum < numIterations; iterNum++) {\r\n if (isProgressBarVisible()) {\r\n progressBar.updateValue(Math.round( ( (float) (iterNum) /\r\n (numIterations - 1) * 100)),\r\n activeImage);\r\n }\r\n\r\n if (useRed) {\r\n algoSepConvolverR.run();\r\n gradientMagnitude3D(gaussianBufferR, gradientBufferR);\r\n for (i = 0; i < length; i++) {\r\n gradientBuffer[i] = gradientBufferR[i];\r\n }\r\n }\r\n if (useGreen) {\r\n algoSepConvolverG.run();\r\n gradientMagnitude3D(gaussianBufferG, gradientBufferG);\r\n for (i = 0; i < length; i++) {\r\n gradientBuffer[i] += gradientBufferG[i];\r\n }\r\n }\r\n if (useBlue) {\r\n algoSepConvolverB.run();\r\n gradientMagnitude3D(gaussianBufferB, gradientBufferB);\r\n for (i = 0; i < length; i++) {\r\n gradientBuffer[i] += gradientBufferB[i];\r\n }\r\n }\r\n for (i = 0; i < length; i++) {\r\n gradientBuffer[i] /= colorsPresent;\r\n }\r\n if (useRed) {\r\n upDateImage3D(resultBufferR, sourceBufferR, gradientBuffer);\r\n }\r\n if (useGreen) {\r\n upDateImage3D(resultBufferG, sourceBufferG, gradientBuffer);\r\n }\r\n if (useBlue) {\r\n upDateImage3D(resultBufferB, sourceBufferB, gradientBuffer);\r\n }\r\n\r\n // copy resultBuffer to sourceBuffer for the next iteration\r\n if (iterNum < (numIterations - 1)) {\r\n if (useRed) {\r\n for (i = 0; i < length; i++) {\r\n sourceBufferR[i] = resultBufferR[i];\r\n }\r\n } // if (useRed)\r\n if (useGreen) {\r\n for (i = 0; i < length; i++) {\r\n sourceBufferG[i] = resultBufferG[i];\r\n }\r\n } // if (useGreen)\r\n if (useBlue) {\r\n for (i = 0; i < length; i++) {\r\n sourceBufferB[i] = resultBufferB[i];\r\n }\r\n } // if (useBlue)\r\n } // if (iterNum < (numIterations - 1))\r\n\r\n } // end for (int iterNum = 0; ...)\r\n\r\n if (useRed) {\r\n algoSepConvolverR.finalize();\r\n algoSepConvolverR = null;\r\n }\r\n if (useGreen) {\r\n algoSepConvolverG.finalize();\r\n algoSepConvolverG = null;\r\n }\r\n if (useBlue) {\r\n algoSepConvolverB.finalize();\r\n algoSepConvolverB = null;\r\n }\r\n\r\n // OK, the resultBuffer is filled with the results of the algorithm,\r\n // put this data into the destination image so it will be displayed in\r\n // in the ViewJFrameWizard\r\n try {\r\n if (useRed) {\r\n for (i = 0; i < length; i++) {\r\n if ((resultBufferR[i] > 255.0f) &&\r\n (destImage.getType() == ModelStorageBase.ARGB)) {\r\n resultBufferR[i] = 255.0f;\r\n }\r\n else if (resultBufferR[i] < 0.0f) {\r\n resultBufferR[i] = 0.0f;\r\n }\r\n }\r\n destImage.importRGBData(1, 0, resultBufferR, false);\r\n }\r\n if (useGreen) {\r\n for (i = 0; i < length; i++) {\r\n if ((resultBufferG[i] > 255.0f) &&\r\n (destImage.getType() == ModelStorageBase.ARGB)) {\r\n resultBufferG[i] = 255.0f;\r\n }\r\n else if (resultBufferG[i] < 0.0f) {\r\n resultBufferG[i] = 0.0f;\r\n }\r\n }\r\n destImage.importRGBData(2, 0, resultBufferG, false);\r\n }\r\n if (useBlue) {\r\n for (i = 0; i < length; i++) {\r\n if ((resultBufferB[i] > 255.0f) &&\r\n (destImage.getType() == ModelStorageBase.ARGB)) {\r\n resultBufferB[i] = 255.0f;\r\n }\r\n else if (resultBufferB[i] < 0.0f) {\r\n resultBufferB[i] = 0.0f;\r\n }\r\n }\r\n destImage.importRGBData(3, 0, resultBufferB, false);\r\n }\r\n } catch (IOException error) {\r\n sourceBufferR = sourceBufferG = sourceBufferB = null;\r\n resultBufferR = resultBufferG = resultBufferB = null;\r\n gaussianBufferR = gaussianBufferG = gaussianBufferB = null;\r\n gradientBuffer = gradientBufferR = gradientBufferG = gradientBufferB = null;\r\n errorCleanUp(\"AlgorithmRegularizedIsotropicDiffusion: Could NOT import resultBuffer to the image\", true);\r\n return;\r\n } // end try{}-catch{}\r\n\r\n destImage.calcMinMax();\r\n disposeProgressBar();\r\n if (threadStopped) { finalize(); return; }\r\n\r\n setCompleted(true);\r\n }" ]
[ "0.6248604", "0.5919599", "0.58582926", "0.58539194", "0.57738984", "0.5635956", "0.5590761", "0.5538546", "0.5532095", "0.54535204", "0.54134977", "0.5401622", "0.53968495", "0.5383105", "0.53502536", "0.53046715", "0.5277062", "0.52641124", "0.52534854", "0.5242781", "0.5227997", "0.5206863", "0.5201606", "0.5154538", "0.51314557", "0.5113162", "0.50853735", "0.50206196", "0.50180143", "0.5012035", "0.50039357", "0.49980643", "0.49896798", "0.4986985", "0.49869686", "0.49852422", "0.49687287", "0.4963941", "0.49581128", "0.49430013", "0.49296194", "0.49064952", "0.48969102", "0.48908746", "0.48751524", "0.48586094", "0.48539463", "0.48401612", "0.4837735", "0.48366442", "0.48279995", "0.48232028", "0.48193076", "0.48088205", "0.4798915", "0.4791788", "0.47798657", "0.47738916", "0.47540423", "0.47502515", "0.4743546", "0.47428387", "0.4741532", "0.4739879", "0.47380483", "0.47336406", "0.47306427", "0.47300568", "0.47264558", "0.47218275", "0.47162515", "0.47160882", "0.47059408", "0.4703903", "0.46963462", "0.46942976", "0.4694252", "0.4693463", "0.46903908", "0.46903166", "0.46770513", "0.46668008", "0.4641851", "0.46337092", "0.46150464", "0.46068662", "0.46044868", "0.4599179", "0.4594137", "0.459056", "0.4584897", "0.45770878", "0.4575559", "0.45711157", "0.4568256", "0.45638216", "0.455571", "0.45530537", "0.4548761", "0.4546346" ]
0.48365366
50
Sets the values of pixels in a binary image to their distance to the nearest black pixel.
private void findContours(Mat input, boolean externalOnly, List<MatOfPoint> contours) { Mat hierarchy = new Mat(); contours.clear(); int mode; if (externalOnly) { mode = Imgproc.RETR_EXTERNAL; } else { mode = Imgproc.RETR_LIST; } int method = Imgproc.CHAIN_APPROX_SIMPLE; Imgproc.findContours(input, contours, hierarchy, mode, method); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private float distancePixels(int nX1, int nY1, int nX2, int nY2)\n {\n\t return FloatMath.sqrt((nX2-nX1)^2 + (nY2-nY1)^2);\n }", "public ShortProcessor distanceMap(ImageProcessor mask) {\n\n\t\t// size of image\n\t\twidth = mask.getWidth();\n\t\theight = mask.getHeight();\n\t\t\n\t\t// update mask\n\t\tthis.maskProc = mask;\n\n\t\t// create new empty image, and fill it with black\n\t\tbuffer = new ShortProcessor(width, height);\n\t\tbuffer.setValue(0);\n\t\tbuffer.fill();\n\t\t\n\t\t// initialize empty image with either 0 (background) or Inf (foreground)\n\t\tfor (int i = 0; i < width; i++) {\n\t\t\tfor (int j = 0; j < height; j++) {\n\t\t\t\tint val = mask.get(i, j) & 0x00ff;\n\t\t\t\tbuffer.set(i, j, val == 0 ? 0 : backgroundValue);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Two iterations are enough to compute distance map to boundary\n\t\tforwardIteration();\n\t\tbackwardIteration();\n\n\t\t// Normalize values by the first weight\n\t\tif (this.normalizeMap) {\n\t\t\tfor (int i = 0; i < width; i++) {\n\t\t\t\tfor (int j = 0; j < height; j++) {\n\t\t\t\t\tif (maskProc.getPixel(i, j) != 0) {\n\t\t\t\t\t\tbuffer.set(i, j, buffer.get(i, j) / weights[0]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Compute max value within the mask\n\t\tshort maxVal = 0;\n\t\tfor (int i = 0; i < width; i++)\n\t\t\tfor (int j = 0; j < height; j++) {\n\t\t\t\tif (maskProc.getPixel(i, j) != 0)\n\t\t\t\t\tmaxVal = (short) Math.max(maxVal, buffer.get(i, j));\n\t\t\t}\n\n\t\t// calibrate min and max values of result imaeg processor\n\t\tbuffer.setMinAndMax(0, maxVal);\n\n\t\t// Forces the display to non-inverted LUT\n\t\tif (buffer.isInvertedLut())\n\t\t\tbuffer.invertLut();\n\t\t\n\t\treturn buffer;\n\t}", "public void negative(BufferedImage img, int startX, int startY, int endX, int endY) throws IOException{\r\n int pixels[] = new int[3];\r\n double ww[]=new double[3];\r\n WritableRaster raster = img.getRaster();\r\n \r\n for(int i=startX;i<endX;i++) {\r\n for(int j=startY;j<endY;j++){\r\n \r\n \r\n raster.getPixel(i, j, pixels);\r\n \r\n ww[0] = 255-pixels[0];\r\n ww[1] = 255-pixels[1];\r\n ww[2] = 255-pixels[2];\r\n \r\n raster.setPixel(i, j, ww);\r\n \r\n }\r\n \r\n }\r\n\r\n \r\n\r\n }", "private void setPixels() {\n\t\t\tfinal byte[] dest = new byte[(int) (getMetadata().get(0).getAxisLength(\n\t\t\t\tAxes.X) * getMetadata().get(0).getAxisLength(Axes.Y))];\n\t\t\tlong lastImage = -1;\n\n\t\t\t// fill in starting image contents based on last image's dispose\n\t\t\t// code\n\t\t\tif (getMetadata().getLastDispose() > 0) {\n\t\t\t\tif (getMetadata().getLastDispose() == 3) { // use image before last\n\t\t\t\t\tfinal long n = getMetadata().get(0).getPlaneCount() - 2;\n\t\t\t\t\tif (n > 0) lastImage = n - 1;\n\t\t\t\t}\n\n\t\t\t\tif (lastImage != -1) {\n\t\t\t\t\tfinal byte[] prev = getMetadata().getImages().get((int) lastImage);\n\t\t\t\t\tSystem.arraycopy(prev, 0, dest, 0, (int) (getMetadata().get(0)\n\t\t\t\t\t\t.getAxisLength(Axes.X) * getMetadata().get(0).getAxisLength(\n\t\t\t\t\t\t\tAxes.Y)));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// copy each source line to the appropriate place in the destination\n\n\t\t\tint pass = 1;\n\t\t\tint inc = 8;\n\t\t\tint iline = 0;\n\t\t\tfor (int i = 0; i < getMetadata().getIh(); i++) {\n\t\t\t\tint line = i;\n\t\t\t\tif (getMetadata().isInterlace()) {\n\t\t\t\t\tif (iline >= getMetadata().getIh()) {\n\t\t\t\t\t\tpass++;\n\t\t\t\t\t\tswitch (pass) {\n\t\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\t\tiline = 4;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\t\tiline = 2;\n\t\t\t\t\t\t\t\tinc = 4;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 4:\n\t\t\t\t\t\t\t\tiline = 1;\n\t\t\t\t\t\t\t\tinc = 2;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tline = iline;\n\t\t\t\t\tiline += inc;\n\t\t\t\t}\n\t\t\t\tline += getMetadata().getIy();\n\t\t\t\tif (line < getMetadata().get(0).getAxisLength(Axes.Y)) {\n\t\t\t\t\tfinal int k = line * (int) getMetadata().get(0).getAxisLength(Axes.X);\n\t\t\t\t\tint dx = k + getMetadata().getIx(); // start of line in dest\n\t\t\t\t\tint dlim = dx + getMetadata().getIw(); // end of dest line\n\t\t\t\t\tif ((k + getMetadata().get(0).getAxisLength(Axes.X)) < dlim) dlim =\n\t\t\t\t\t\tk + (int) getMetadata().get(0).getAxisLength(Axes.X);\n\t\t\t\t\tint sx = i * getMetadata().getIw(); // start of line in\n\t\t\t\t\t// source\n\t\t\t\t\twhile (dx < dlim) {\n\t\t\t\t\t\t// map color and insert in destination\n\t\t\t\t\t\tfinal int index = getMetadata().getPixels()[sx++] & 0xff;\n\t\t\t\t\t\tdest[dx++] = (byte) index;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tgetMetadata().getColorTables().add(getMetadata().getAct());\n\t\t\tgetMetadata().getImages().add(dest);\n\t\t}", "public static void useAbsDiff(Mat average_image, Mat current_image, Mat binary_image, int binary_threshold)\n {\n for (int i = 0; i < average_image.width(); i++) { // Go through each pixel in the image\n for (int j = 0; j < average_image.height(); j++) {\n double[] first = average_image.get(j, i); // Retrieve pixel values\n double[] second = current_image.get(j, i);\n int sum = Math.abs((int) (first[0] - second[0])); // Calculate absolute difference\n binary_image.put(j, i, sum); // Put difference value in the result image\n }\n }\n //Turn the images to black and white, where white is movement and black is none movment\n Imgproc.threshold(binary_image, binary_image, binary_threshold, 255, Imgproc.THRESH_BINARY);\n }", "public void setPixel(int x, int y, short red, short green, short blue) {\n // Your solution here, but you should probably leave the following line\n // at the end.\n\t //if setPixel at the first location.\n\t if((x==0) && (y==0)) {\n\t\t if(red!=runs.getFirst().item[1]) {\n\t\t\t if(runs.getFirst().item[0]!=1) {\n\t\t\t\t int[] item= new int[] {1,red,green,blue};\n\t\t\t\t runs.getFirst().item[0]=runs.getFirst().item[0]-1;\n\t\t\t\t runs.addFirst(item);\n\t\t\t }\n\t\t\t else {\n\t\t\t\t if(red!=runs.getFirst().next.item[1]) {\n\t\t\t\t runs.remove(runs.nth(1));\n\t\t\t\t int[] item= new int[] {1,red,green,blue};\n\t\t\t\t runs.addFirst(item);\n\t\t\t\t System.out.println(runs.toString());\n\t\t\t\t }\n\t\t\t\t else {\n\t\t\t\t\t runs.remove(runs.nth(1));\n\t\t\t\t\t runs.getFirst().item[0]=runs.getFirst().item[0]+1;\n\t\t\t\t }\n\t\t\t }\n\t\t }\n\t }\n\t \n\t //if setPixel at the last location.\n\t else if((x==(width-1)) && (y==(height-1))) {\n\t\t if(runs.getLast().item[0]==1) {\n\t\t\t if(red!=runs.getLast().prev.item[1]) {\n\t\t\t\t int[] item= new int[] {1,red,green,blue}; \n\t\t\t\t runs.remove(runs.getLast());\n\t\t\t\t runs.addLast(item);\n\t\t }\n\t\t \n\t\t\t else {\n\t\t\t\t runs.remove(runs.getLast());\n\t\t\t\t runs.getLast().item[0]=runs.getLast().item[0]+1;\n\t\t\t }\n\t\t\t \n\t\t }\n\t\t else {\n\t\t\t int[] item= new int[] {1,red,green,blue};\n\t\t\t runs.addLast(item);\n\t\t\t runs.getLast().prev.item[0]=runs.getLast().prev.item[0]-1;\n\t\t }\n\t }\n\t \n\t //if Pixel is at a random location.\n//\t if(((x>0) && (y>0)) && ((x!=(width-1)) && (y!=(height-1))) ) {\n//\t if((x>0)&&(x!=(width-1))){\n\t else {\n\t int loc=y*(width)+x+1; \n\t int count=0;\n\t for(int i=0;i<runs.length();i++) {\n\t\t \n\t\tloc=loc-runs.nth(i+1).item[0] ;\n\t\tcount++;\n\t\tif (loc<=0) {\n\t\t\tbreak;\n\t\t}\n\t }\n\t if((loc==0) && (runs.nth(count).item[0]==1)){\n\t\t if((red!=runs.nth(count).next.item[1])&&(red!=runs.nth(count).prev.item[1])) { \n\t\t\t int[] item= new int[] {1,red,green,blue};\n\t\t\t runs.addAfter(runs.nth(count), item);\n\t\t\t runs.remove(runs.nth(count));\n\t\t }\n\t\t if((red==(runs.nth(count).next).item[1])&& (red!=runs.nth(count).prev.item[1])){\n\t\t\t runs.remove(runs.nth(count));\n\t\t\t runs.nth(count).item[0]=runs.nth(count).item[0]+1;\n\t\t }\t\n\t\t if((red==(runs.nth(count).prev).item[1])&&(red!=runs.nth(count).next.item[1])) {\n\t\t\t runs.remove(runs.nth(count));\n\t\t\t runs.nth(count).prev.item[0]=runs.nth(count).prev.item[0]+1;\n\t\t }\t\n\t\t if((red==(runs.nth(count).prev).item[1])&&(red==runs.nth(count).next.item[1])) {\n\t\t\t runs.nth(count).prev.item[0]=runs.nth(count).prev.item[0]+1+runs.nth(count).next.item[0];\n\t\t\t runs.remove(runs.nth(count));\n\t\t\t runs.remove(runs.nth(count));\n\t\t }\n\t }\n\t else if((loc==0) && (runs.nth(count).item[0]!=1)) {\n\t\t if(red!=runs.nth(count).next.item[1]) {\n\t\t\t runs.nth(count).item[0]=runs.nth(count).item[0]-1;\n\t\t\t int[] item= new int[] {1,red,green,blue};\n\t\t\t runs.addAfter(runs.nth(count), item);\t \n\t\t }\n\t\t else {\n\t\t\t runs.nth(count+1).item[0]=runs.nth(count+1).item[0]+1;\n\t\t }\t\t \n\t } \n\t else if(loc!=0) {\n\t\t \n\t\t int[] item= new int[] {1,red,green,blue};\n\n//\t\t DListNode<int[]> dup=runs.nth(count);\n//\t\t System.out.println(\"This is dup\"+dup.item[0]+\" \"+dup.item[1]+\" \"+dup.item[2]+\" \"+dup.item[0]);\t\t \n\t\t runs.addAfter(runs.nth(count), item);\n\t\t int[] dup=new int[] {runs.nth(count).item[0],runs.nth(count).item[1],runs.nth(count).item[2],runs.nth(count).item[3]};\n\t\t runs.addAfter(runs.nth(count).next, dup);\n\t\t System.out.println(runs.nth(count).item[0]+\"This is loc \"+loc+\"THis is count \"+count);\n\t\t runs.nth(count).item[0]=runs.nth(count).item[0]+loc-1;\n\t\t System.out.println(runs.nth(count).next.next.item[0]+\"This is loc \"+loc+\"THis is count \"+count);\n\t\t runs.nth(count).next.next.item[0]=runs.nth(count).next.next.item[0]+loc-1;\t\n\t\t }\n\t\t \n\t \n\t }\n check();\n}", "public int move (int pixels) {\n int pixelsToMove = pixels;\n // ensure that moveRecursiveHelper doesn't take a negative argument\n if (Math.abs(pixels) != pixels) {\n pixelsToMove = -pixelsToMove;\n turn(HALF_TURN_DEGREES);\n }\n moveRecursiveHelper(pixelsToMove);\n if (Math.abs(pixels) != pixels) {\n turn(HALF_TURN_DEGREES);\n }\n return Math.abs(pixels);\n }", "private int mediePixeli(int pixel1, int pixel2) {\n\t return (int) (((((pixel1) ^ (pixel2)) & 0xfffefefeL) >> 1) + ((pixel1) & (pixel2)));\n\t }", "public void adjustIntensity()\r\n {\r\n\tint rows = getHeight();\r\n\tint cols = getWidth();\r\n\tdouble dbL = (double)(L-1);\r\n\tshort maxI;\r\n\tfor (int row = 0; row < rows; row++)\r\n\t{\r\n\t for (int col = 0; col < cols; col++)\r\n\t {\r\n\t\tmaxI = (short)Math.min(L-1, \r\n\t\t Math.round((L-1) * maxIntensity(hue[row][col]/dbL,\r\n\t\t saturation[row][col]/dbL)));\r\n\t\tintensity[row][col] =\r\n\t\t (short)Math.min(intensity[row][col], maxI);\r\n\t }\r\n\t}\r\n }", "@Override\r\n\tpublic void extractFeature() {\n\t\tint numOfBins = 64;\r\n\r\n\t\t// Quantise the image into the specified amount of bins\r\n\t\tint[][] quantizedImage = new int[imageRaster.getWidth()][imageRaster\r\n\t\t\t\t.getHeight()];\r\n\t\tint[] pixel = new int[3];\r\n\t\tfor (int i = 0; i != imageRaster.getWidth(); i++) {\r\n\t\t\tfor (int j = 0; j != imageRaster.getHeight(); j++) {\r\n\t\t\t\tpixel = imageRaster.getPixel(i, j, pixel);\r\n\t\t\t\tquantizedImage[i][j] = getPixelBin(pixel);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Builds a histogram based on the 64 quantised values which is used for\r\n\t\t// normalisation\r\n\t\tint[] histogram = new int[numOfBins];\r\n\t\tfor (int x = 0; x < imageRaster.getWidth(); x++)\r\n\t\t\tfor (int y = 0; y < imageRaster.getHeight(); y++) {\r\n\t\t\t\thistogram[quantizedImage[x][y]]++;\r\n\t\t\t}\r\n\r\n\t\tautoCorrelogram = new double[numOfBins][distanceSet.length];\r\n\r\n\t\tint imageWidth = imageRaster.getWidth();\r\n\t\tint imageHeight = imageRaster.getHeight();\r\n\r\n\t\t// Chebyshev distance\r\n\t\tfor (int x = 0; x != imageWidth; x++) {\r\n\t\t\tfor (int y = 0; y != imageHeight; y++) {\r\n\t\t\t\tint pColour = quantizedImage[x][y];\r\n\t\t\t\tfor (int distIndex = 0; distIndex != distanceSet.length; distIndex++) {\r\n\t\t\t\t\tint dist = distanceSet[distIndex];\r\n\r\n\t\t\t\t\t// move horizontally across pixel grid on top and bottom\r\n\t\t\t\t\tfor (int localX = -dist; localX <= dist; localX++) {\r\n\t\t\t\t\t\t// Top\r\n\t\t\t\t\t\tint globalX = x + localX;\r\n\t\t\t\t\t\tint globalY = y - dist;\r\n\t\t\t\t\t\t// Bounds checking\r\n\t\t\t\t\t\tif (globalX >= 0 && globalX < imageWidth\r\n\t\t\t\t\t\t\t\t&& globalY >= 0 && globalY < imageHeight) {\r\n\t\t\t\t\t\t\t// If the colours are the same, update the\r\n\t\t\t\t\t\t\t// autocorrelogram\r\n\t\t\t\t\t\t\tif (quantizedImage[globalX][globalY] == pColour) {\r\n\t\t\t\t\t\t\t\tautoCorrelogram[pColour][distIndex]++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t// Bottom\r\n\t\t\t\t\t\t\tglobalY = y + dist;\r\n\t\t\t\t\t\t\t// Bounds checking\r\n\t\t\t\t\t\t\tif (globalX >= 0 && globalX < imageWidth\r\n\t\t\t\t\t\t\t\t\t&& globalY >= 0 && globalY < imageHeight) {\r\n\t\t\t\t\t\t\t\t// If the colours are the same, update the\r\n\t\t\t\t\t\t\t\t// autocorrelogram\r\n\t\t\t\t\t\t\t\tif (quantizedImage[globalX][globalY] == pColour) {\r\n\t\t\t\t\t\t\t\t\tautoCorrelogram[pColour][distIndex]++;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// move vertically through pixel grid on left and right\r\n\t\t\t\t\tfor (int localY = -dist + 1; localY <= dist - 1; localY++) {\r\n\t\t\t\t\t\t// Left\r\n\t\t\t\t\t\tint globalX = x - dist;\r\n\t\t\t\t\t\tint globalY = y + localY;\r\n\t\t\t\t\t\t// Bounds checking\r\n\t\t\t\t\t\tif (globalX >= 0 && globalX < imageWidth\r\n\t\t\t\t\t\t\t\t&& globalY >= 0 && globalY < imageHeight) {\r\n\t\t\t\t\t\t\t// If the colours are the same, update the\r\n\t\t\t\t\t\t\t// autocorrelogram\r\n\t\t\t\t\t\t\tif (quantizedImage[globalX][globalY] == pColour) {\r\n\t\t\t\t\t\t\t\tautoCorrelogram[pColour][distIndex]++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t// Right\r\n\t\t\t\t\t\tglobalX = x + dist;\r\n\t\t\t\t\t\t// Bounds checking\r\n\t\t\t\t\t\tif (globalX >= 0 && globalX < imageWidth\r\n\t\t\t\t\t\t\t\t&& globalY >= 0 && globalY < imageHeight) {\r\n\t\t\t\t\t\t\t// If the colours are the same, update the\r\n\t\t\t\t\t\t\t// autocorrelogram\r\n\t\t\t\t\t\t\tif (quantizedImage[globalX][globalY] == pColour) {\r\n\t\t\t\t\t\t\t\tautoCorrelogram[pColour][distIndex]++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// normalize the feature vector\r\n\t\tfor (int c = 0; c != numOfBins; c++) {\r\n\t\t\tfor (int d = 0; d != distanceSet.length; d++)\r\n\t\t\t\tif (histogram[c] > 0)\r\n\t\t\t\t\tautoCorrelogram[c][d] = (float) Math\r\n\t\t\t\t\t\t\t.floor(16d * (autoCorrelogram[c][d] / (((float) histogram[c]) * 8.0f * distanceSet[d])));\r\n\t\t}\r\n\t}", "public static double fix(double pixel)\n\t{\n\t\treturn 0.5 + (int) pixel;\n\t}", "private void setPixelInfo(Stroke theStroke)\n\t{\n\t\t// get the data from the stroke in the required format\n\t\tVector ptList = theStroke.getM_ptList();\n\t\t//double [][] strokeMat = theStroke.getPointsAs2DMatrix_Double();\n\t\tint stkLen = ptList.size();\n\t\t// init local variables\n\t\tPixelInfo prevPixel = null;\n\t\tPixelInfo currPixel = null;\n\t\tint winSize_speed = 0;\n\t\tint winSize_slope = 0;\n\t\tdouble cummDist_speed = 0.0;\n\t\t\n\t\tIterator iter = ptList.iterator();\n\t\t// set the pixel properties for the first pixel of the stroke.\n\t\tif(iter.hasNext())\n\t\t{\n\t\t\t// init the curvature and curvature of first pixel, set them to 0\n\t\t\tprevPixel = (PixelInfo)iter.next();\n\t\t\tprevPixel.setCurvature(0);\n\t\t\tprevPixel.setSpeed(0);\n\t\t\tprevPixel.setSlope(0);\n\t\t\t// System.out.println(\"i = 0: \"+prevPixel);\n\t\t}\n\n\t\t// set the pixel property values for the remaining pixels\n\t\tint index=0;\n\t\twhile(iter.hasNext())\n\t\t{\n\t\t\tindex++;\n\n\t\t\t// get the second pixel\n\t\t\tcurrPixel = (PixelInfo)iter.next();\n\n\t\t\t// increment the counter for speed\n\t\t\tif(winSize_speed < SpeedBasedDetection.DEF_WIN_SIZE_SPEED) \n\t\t\t{\n\t\t\t\twinSize_speed++;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// remove the distance of the last pixel in the window\n\t\t\t\tPoint a = ((PixelInfo) ptList.get(index - winSize_speed -1));\n\t\t\t\tPoint b = ((PixelInfo)ptList.get(index - winSize_speed));\n\t\t\t\t// System.out.println(\"prev dist: \"+a.distance(b));\n\t\t\t\tcummDist_speed -= a.distance(b); \n\t\t\t}\n\t\t\t// System.out.println(\"Speed: \"+winSize_speed);\n\t\t\t\n\t\t\t// add the distance of current pixel in the window\n\t\t\tdouble thisDist = prevPixel.distance(currPixel);\n\t\t\t//System.out.println(\"this dist: \"+thisDist);\n\t\t\tcummDist_speed += thisDist;\n\t\t\t//System.out.println(\"summ distance: \"+cummDist_speed);\n\t\t\t\n\t\t\t// do speed calculations for this pixel\n\t\t\tPixelInfo a = (PixelInfo) ptList.get(index - winSize_speed);\n\t\t\tdouble cummTime_speed = currPixel.getTime() - a.getTime();\n\t\t\tcurrPixel.setSpeed(cummDist_speed/cummTime_speed);\n\t\t\t\n\t\t\t// set slope for the current pixel\n\t\t\tif(winSize_slope < CurvatureBasedDetection.DEF_WIN_SIZE_SLOPE)\n\t\t\t{\n\t\t\t\twinSize_slope++;\n\t\t\t}\n\n\t\t\t// calculate the actual window size\n\t\t\tint start = index - winSize_slope;\n\t\t\tint end = index + winSize_slope;\n\t\t\t\n\t\t\t// incase the window is running out of the stroke length, adjust the window size to fit the stroke\n\t\t\tif(end > (stkLen-1))\n\t\t\t{\n\t\t\t\tend = stkLen-1;\n\t\t\t\tstart = index - (end-index);\n\t\t\t}\n\t\t\t\n\t\t\t// TODO: check for this code\n\t\t\t//System.out.println(\"Slope :start: \"+start+\" end: \"+end);\n\t\t\tdouble[][] winElem = theStroke.getWindowElemAs2DMatrix_Double(start, end);\n\t\t\tif(winElem!=null)\n\t\t\t{\n\t\t\t\tdouble[] odr = Maths.performODR(winElem);\n\t\t\t\tcurrPixel.setSlope(odr[0]);\n\t\t\t\t\n\t\t\t\t//ISHWAR\n\t\t\t\t//System.out.println(Maths.angle(currPixel.getSlope(), 1) + \" \" + Maths.angle(prevPixel.getSlope(), 1) + \"\\n\");\n\t\t\t\t// calculate the curvature information\n\t\t\t\tdouble slopeChange = Maths.angle(currPixel.getSlope(), 1) - Maths.angle(prevPixel.getSlope(), 1);\n\t\t\t\t\n\t\t\t\t//ISHWAR\n/*\t\t\t\tif( (Maths.angle(currPixel.getSlope(), 1) < 0 && Maths.angle(prevPixel.getSlope(), 1) >0) || ( Maths.angle(currPixel.getSlope(), 1) > 0 && Maths.angle(prevPixel.getSlope(), 1) <0) )\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"Slope Changed\");\n\t\t\t\t\tslopeChange=0.0001;\n\t\t\t\t}*/\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t// System.out.println(\"slopeChange \"+slopeChange);\n\t\t\t\tif(slopeChange == 0.0 && thisDist == 0.0){\n\t\t\t\t\tcurrPixel.setCurvature(prevPixel.getCurvature());\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\tcurrPixel.setCurvature(slopeChange/thisDist);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// NOTE: TODO this should not happen\n\t\t\t}\n\t\t\tSystem.out.println(\"i = \"+index+\": \"+currPixel);\n\t\t\t\n\t\t\tprevPixel = currPixel;\n\t\t\tcurrPixel = null;\n\t\t}\t\t\n/*\t\t\n\t\tif(iter.hasNext())\n\t\t{\n\t\t\t// get the second point\n\t\t\tcurrPixel = (PixelInfo)iter.next();\n\t\t\t\n\t\t\tprevCurrDist = prevPixel.distance(currPixel);\n\t\t\tprevCurrAngle = GlobalMethods.angle(prevPixel, currPixel);\n\t\t\t// System.out.println(prevCurrAngle);\n\t\t\t// no need to check for divide by zero error points are not sampled until the mouse moves \n\t\t\t// and when the mouse moves time will be different due to the sampling rate.\n\t\t\tdouble speed = prevCurrDist / (currPixel.getTime() - prevPixel.getTime());\n\t\t\t//System.out.println(\"speed: \"+ speed);\n\t\t\tcurrPixel.setSpeed(speed);\n\t\t}\n\n\t\twhile (iter.hasNext())\n\t\t{\n\t\t\tPixelInfo nextPixel = (PixelInfo) iter.next();\n\t\t\t\n\t\t\t// calculate curvature at this pixel\n\t\t\tdouble currNextDist = currPixel.distance(nextPixel);\n\t\t\tdouble currNextAngle = GlobalMethods.angle(currPixel, nextPixel);\n\t\t\t// System.out.println(currNextAngle);\n\t\t\t\n\t\t\t// no need to check for divide by zero error points are not sampled until the mouse moves \n\t\t\t// and when the mouse moves time will be different due to the sampling rate.\n\t\t\tdouble speed = currNextDist / (nextPixel.getTime() - currPixel.getTime());\n\t\t\t//System.out.println(\"speed: \"+ speed);\n\t\t\tnextPixel.setSpeed(speed);\n\t\t\t\n\t\t\t// curvature is the change of slope divided by change of distance \n\t\t\t// double curvature = (currNextAngle-prevCurrAngle)/(currNextDist+prevCurrDist);\n\t\t\tdouble curvature = (currNextAngle-prevCurrAngle)/prevCurrDist;\n\t \t\n\t \t// set the value of curvature for this pixel\n\t \tcurrPixel.setCurvature(Math.abs(curvature));\n\t \t\n\t \t// transfer values\n\t \tprevPixel = currPixel;\n\t \tcurrPixel = nextPixel;\n\t \tprevCurrDist = currNextDist;\n\t \tprevCurrAngle = currNextAngle;\n\t\t}\n*/\t\t\n\t\t// set the curvature of the last pixel to 0, the last pixel is stored in currPixel\n\t\tif(currPixel != null) currPixel.setCurvature(0);\n\t\t\n\t\tfor(int i=0;i<ptList.size();i++)\n\t\t{\n\t\t\tPixelInfo pi = (PixelInfo)ptList.get(i);\n//ISHWAR\t\t\tSystem.out.println(i + \". (\" + pi.x + \",\" + pi.y + \") \" +pi.getCurvature() + \" \" + pi.getTime() + \" \" + pi.getSpeed());\n\t\t}\n\t}", "public void drive(double distance)\n {\n int pixelsPerMile = 10;\n pic.translate(distance * pixelsPerMile, 0);\n }", "public static GrayImage toGray(BinaryImage img) {\n\t\tint X = img.X();\n\t\tint Y = img.Y();\n\t\tGrayImage newimg = new GrayImage(X, Y);\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tif ((int) img.get(x, y) == 0)\n\t\t\t\t\tnewimg.set(x, y, 0);\n\t\t\t\telse\n\t\t\t\t\tnewimg.set(x, y, 255);\n\t\t\t}\n\t\t}\n\t\treturn newimg;\n\t}", "public void setNeighbors(){\t\t\t\t\n\t\tint row = position[0];\n\t\tint column = position[1];\t\t\n\t\tif(column+1 < RatMap.SIDELENGTH){\n\t\t\teastCell = RatMap.getMapCell(row,column+1);\t\t\t\n\t\t}else{\n\t\t\teastCell = null;\n\t\t}\t\n\t\tif(row+1 < RatMap.SIDELENGTH){\n\t\t\tnorthCell = RatMap.getMapCell(row+1,column);\n\t\t}else{\n\t\t\tnorthCell = null;\n\t\t}\t\n\t\tif(column-1 > -1){\n\t\t\twestCell = RatMap.getMapCell(row, column-1);\t\t\t\n\t\t}else{\n\t\t\twestCell = null;\n\t\t}\n\t\tif(row-1 > -1){\n\t\t\tsouthCell = RatMap.getMapCell(row-1, column);\n\t\t}else{\n\t\t\tsouthCell = null;\n\t\t}\n\t}", "void removeNearbyPixels(Stroke theStroke){\n\t\tint index;\n\t\tint CurvIndex;\n\t\tint SpeedIndex;\n\t\tVector ptList = theStroke.getM_ptList();\n\t\tfor(index=0; index < CommonSegmentPts.size(); index++){\n\t\t\tPoint CommonPt = (PixelInfo)ptList.get((Integer)CommonSegmentPts.get(index));\n\t\t\tfor(CurvIndex = 0; CurvIndex < CurvVector.size(); CurvIndex++){\n\t\t\t\tPoint CurvPt = (PixelInfo)ptList.get((Integer)CurvVector.get(CurvIndex));\n\t\t\t\tif(CommonPt.distance(CurvPt) <= TolerantDistance){\n\t\t\t\t\tCurvVector.remove(CurvIndex--);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(SpeedIndex = 0; SpeedIndex < SpeedVector.size(); SpeedIndex++){\n\t\t\t\tPoint SpeedPt = (PixelInfo)ptList.get((Integer)SpeedVector.get(SpeedIndex));\n\t\t\t\tif(CommonPt.distance(SpeedPt) <= TolerantDistance){\n\t\t\t\t\tSpeedVector.remove(SpeedIndex--);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private void setNeighbors()\r\n {\r\n for (int x = 0; x < length+2; ++x)\r\n {\r\n for (int y = 0; y < width+2; ++y)\r\n {\r\n // North\r\n if (!this.board[x][y].northwall)\r\n {\r\n this.board[x][y].neighbors.add(this.board[x][y-1]);\r\n }\r\n // South\r\n if (!this.board[x][y].southwall)\r\n {\r\n this.board[x][y].neighbors.add(this.board[x][y+1]);\r\n }\r\n // East\r\n if (!this.board[x][y].eastwall)\r\n {\r\n this.board[x][y].neighbors.add(this.board[x+1][y]);\r\n }\r\n // West\r\n if (!this.board[x][y].westwall)\r\n {\r\n this.board[x][y].neighbors.add(this.board[x-1][y]);\r\n }\r\n }\r\n }\r\n }", "public static int offsetBits_dest() {\n return 0;\n }", "public void dilation(RasterImage src, RasterImage dst, boolean[][] kernel) {\n\t\tArrays.fill(dst.argb, 0xffffffff);\n\t\tint radius = kernel.length / 2;\n\t\tfor (int picY = 0; picY < src.height; picY++) {\n\t\t\tfor (int picX = 0; picX < src.width; picX++) {\n\t\t\t\tint[] colour = src.getRGB(src.argb[picY * src.width + picX]);\n\t\t\t\tif (colour[0] == 0) {\n\t\t\t\t\tfor (int j = 0; j < kernel.length; j++) {\n\t\t\t\t\t\tfor (int k = 0; k < kernel[j].length; k++) {\n\t\t\t\t\t\t\tint stampY = picY;\n\t\t\t\t\t\t\tint stampX = picX;\n\t\t\t\t\t\t\tif (kernel[j][k]) {\n\t\t\t\t\t\t\t\tstampX = picX - radius + k;\n\t\t\t\t\t\t\t\tstampY = picY - radius + j;\n\t\t\t\t\t\t\t\tif (stampX >= 0 && stampX < dst.width && stampY >= 0 && stampY < dst.height) {\n\t\t\t\t\t\t\t\t\tdst.argb[stampY * dst.width + stampX] = 0xff000000;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t}", "public int findLonelyPixel(char[][] picture) {\n return 0;\n }", "protected void setValues() {\n values = new double[size];\n int pi = 0; // pixelIndex\n int siz = size - nanW - negW - posW;\n int biw = min < max ? negW : posW;\n int tiw = min < max ? posW : negW;\n double bv = min < max ? Double.NEGATIVE_INFINITY : Double.POSITIVE_INFINITY;\n double tv = min < max ? Double.POSITIVE_INFINITY : Double.NEGATIVE_INFINITY;\n double f = siz > 1 ? (max - min) / (siz - 1.) : 0.;\n for (int i = 0; i < biw && pi < size; i++,pi++) {\n values[pi] = bv;\n }\n for (int i = 0; i < siz && pi < size; i++,pi++) {\n double v = min + i * f;\n values[pi] = v;\n }\n for (int i = 0; i < tiw && pi < size; i++,pi++) {\n values[pi] = tv;\n }\n for (int i = 0; i < nanW && pi < size; i++,pi++) {\n values[pi] = Double.NaN;\n }\n }", "void setCollideBits (long bits);", "public void reset(int initValue) {\n\t\tfor (int col = 0; col < this.width; col++) {\n\t\t\tfor (int row = 0; row < this.height; row++) {\n\t\t\t\tthis.bitmap[col][row] = initValue;\n\t\t\t}\n\t\t}\n\t}", "private void equalize(BufferedImage img) {\n \t\tfloat minSat = Float.MAX_VALUE, maxSat = Float.MIN_VALUE;\n \t\tfloat minVal = Float.MAX_VALUE, maxVal = Float.MIN_VALUE;\n \t\t\n \t\tint[] prgb = { 0, 0, 0 };\n \t\tfloat[] hsv = { 0, 0, 0 };\n \t\t\n \t\tint[] valCount = new int[16];\n \t\t\n \t\tfor (int y = 0; y < img.getHeight(); y++) {\n \t\t\tfor (int x = 0; x < img.getWidth(); x++) {\n \t\t\t\tint pixel = img.getRGB(x, y);\n \t\t\t\tpixelToRGB(pixel, prgb);\n \t\t\t\trgbToHsv(prgb[0], prgb[1], prgb[2], hsv);\n \t\t\t\tminSat = Math.min(hsv[1], minSat);\n \t\t\t\tmaxSat = Math.max(hsv[1], maxSat);\n \t\t\t\tminVal = Math.min(hsv[2], minVal);\n \t\t\t\tmaxVal = Math.max(hsv[2], maxVal);\n \t\t\t\tvalCount[(int) (hsv[2] / 16)]++;\n \t\t\t}\n \t\t}\n \t\t\n \t\tint maxPt = -1;\n \t\tfor (int i = 1; i < 15; i++) {\n \t\t\tif (maxPt == -1 || valCount[i] >= valCount[maxPt]) {\n \t\t\t\tmaxPt = i;\n \t\t\t}\n \t\t}\n \t\t\n \t\tint valueMidpoint = maxPt * 16;\n \t\t\n \t\tSystem.out.println(\"Equalize: sat = \"+minSat+\" to \" +maxSat+\"; val = \" + minVal + \" to \" + maxVal+\"; value midpoint = \" + valueMidpoint);\n \t\tfloat satScale = 1.0f - minSat;\n \t\tfloat valScale = 255 - minVal;\n \t\tfloat satDiff = maxSat - minSat;\n \t\tfloat valDiff = maxVal - minVal;\n \t\t\n \t\tfor (int y = 0; y < img.getHeight(); y++) {\n \t\t\tfor (int x = 0; x < img.getWidth(); x++) {\n \t\t\t\tint pixel = img.getRGB(x, y);\n \t\t\t\tpixelToRGB(pixel, prgb);\n \t\t\t\trgbToHsv(prgb[0], prgb[1], prgb[2], hsv);\n \t\t\t\t\n \t\t\t\tif (satDiff < 0.5)\n \t\t\t\t\thsv[1] = ((hsv[1] - minSat) / satDiff) * satScale + minSat;\n \t\t\t\tif (valDiff < 128)\n \t\t\t\t\thsv[2] = ((hsv[2] - minVal) / valDiff) * valScale + minVal;\n \n \t\t\t\thsvToRgb(hsv[0], hsv[1], hsv[2], prgb);\n \t\t\t\t\n \t\t\t\timg.setRGB(x, y, rgb8ToPixel(prgb) | (pixel & 0xff000000));\n \t\t\t}\n \t\t}\n \t}", "public void setDistance(int value) {\n this.distance = value;\n }", "private void changePixelValues(ImageProcessor ip) {\n\t\t\tint[] pixels = (int[])ip.getPixels();\r\n\t\t\t\r\n\t\t\tfor (int y=0; y<height; y++) {\r\n\t\t\t\tfor (int x=0; x<width; x++) {\r\n\t\t\t\t\tint pos = y*width + x;\r\n\t\t\t\t\tint argb = origPixels[pos]; // Lesen der Originalwerte \r\n\t\t\t\t\t\r\n\t\t\t\t\tint r = (argb >> 16) & 0xff;\r\n\t\t\t\t\tint g = (argb >> 8) & 0xff;\r\n\t\t\t\t\tint b = argb & 0xff;\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t// anstelle dieser drei Zeilen später hier die Farbtransformation durchführen,\r\n\t\t\t\t\t// die Y Cb Cr -Werte verändern und dann wieder zurücktransformieren\r\n\t\t\t\t\t\r\n\t\t\t\t\tYUV c = new YUV(r, g, b);\r\n\t\t\t\t\t\r\n\t\t\t\t\tc.changeBrightness(brightness).changeContrast(contrast).changeSaturation(saturation).changeHue(hue);\r\n\t\t\t\t\t\r\n\t\t\t\t\tint[] rgbNew = c.toRGB();\r\n\r\n\t\t\t\t\t// Hier muessen die neuen RGB-Werte wieder auf den Bereich von 0 bis 255 begrenzt werden\r\n\t\t\t\t\t\r\n\t\t\t\t\tpixels[pos] = (0xFF<<24) | (rgbNew[0]<<16) | (rgbNew[1]<<8) | rgbNew[2];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}", "private int randomValue(int value, int distance)\n {\n int pos = rand.nextInt(2) > 0 ? 1 : -1;\n int newValue = value + pos * rand.nextInt(distance);\n\n if(newValue > 255 || newValue < 0)\n {\n return randomValue(value, distance);\n }\n\n return newValue;\n }", "public void update() {\n\t\t//Start updting the image\n\t\timg.loadPixels();\n\t\t\n\t\t//for every cell apply a color\n\t\tGridCell[] cells = grid.getCells();\n\t\tfor(int i = 0 ; i < cells.length; i++) {\n\t\t\timg.pixels[i] = cells[i].getMiniMapColor(ignoreDiscovered);\n\t\t}\n\t\t\n\t\t//Now update the image\n\t\timg.updatePixels();\n\t}", "public final void setMinPointPixelDistance(final int minPixelDistance) {\n minPointPixelDistanceProperty().setValue(minPixelDistance);\n }", "@Override\n protected void operateValue(Grid src, Grid dst, int col, int row) {\n // Zevenbergen-Thorne method using left and right neighbors\n dst.setValue(src.getXGradient(col, row), col, row);\n }", "public void fuzzify() {\n ImageArray newCopy = currentIm.copy();\n \n int rows= currentIm.getRows();\n int cols= currentIm.getCols();\n \n for(int rr = 1; rr < rows-1; rr++){\n \n for(int cc = 1; cc < cols-1; cc++){\n fuzPixel(rr,cc,newCopy);\n \n }\n \n }\n \n currentIm = newCopy.copy();\n \n \n }", "public void setDistance(float dist);", "public void setDistance( float distance )\n {\n distance = Math.abs(distance);\n if ( distance == 0 )\n distance = 1;\n distance_slider.setValue( (int)(DISTANCE_SCALE_FACTOR * distance) );\n }", "public void maximizeIntensity()\r\n {\r\n\tint rows = getHeight();\r\n\tint cols = getWidth();\r\n\tdouble dbL = (double)(L-1);\r\n\tfor (int row = 0; row < rows; row++)\r\n\t{\r\n\t for (int col = 0; col < cols; col++)\r\n\t {\r\n\t\tintensity[row][col] = (short)Math.min(L-1, \r\n\t\t Math.round((L-1) * maxIntensity(hue[row][col]/dbL,\r\n\t\t saturation[row][col]/dbL)));\r\n\t }\r\n\t}\r\n }", "public void infectfirstpixel() {\r\n randompixel = r.nextInt(100);\r\n pixellist.get(randompixel).setBackground(Color.red);\r\n count++;\r\n storage.add(randompixel);\r\n\r\n }", "public ArrayList<Cell> fillNeighbors(Biochip grid, Cell cell, double value, int dest_x, int dest_y){\n\t\tint i = grid.findRow(cell); \n\t\tint j = grid.findColumn(cell); \n\t\tArrayList<Cell> new_filled_cells = new ArrayList<Cell>();\n\t\t//System.out.println(\"fill for : \" + i + \" \" + j); \n\n\t\t// right neighbor - only if it has one \n\t\tif (j+1<grid.width){\n\t\t\tCell right_n = grid.getCell(i, j+1);\n\t\t\tif (right_n.isFaulty==false && right_n.value<0){\n\t\t\t\t\tright_n.value = value; \n\t\t\t\t\tif (grid.findColumn(right_n)==dest_y && grid.findRow(right_n)==dest_x){\n\t\t\t\t\t\treturn new ArrayList<Cell>();\n\t\t\t\t\t}\n\t\t\t\t\telse new_filled_cells.add(right_n);\n\t\t\t}\n\t\t}\n\t\t// left neighbor - only if it has one\n\t\tif (j-1>=0){\n\t\t\tCell left_n = grid.getCell(i, j-1);\n\t\t\tif (left_n.isFaulty==false && left_n.value<0){\n\t\t\t\tleft_n.value = value; \n\t\t\t\tif (grid.findColumn(left_n)==dest_y && grid.findRow(left_n)==dest_x){\n\t\t\t\t\treturn new ArrayList<Cell>();\n\t\t\t\t}\n\t\t\t\telse new_filled_cells.add(left_n);\n\t\t\t}\n\t\t}\n\t\t// up neighbor\n\t\tif (i-1>=0){\n\t\t\tCell up_n = grid.getCell(i-1, j);\n\t\t\tif (up_n.isFaulty==false && up_n.value<0){\n\t\t\t\tup_n.value = value;\n\t\t\t\tif (grid.findColumn(up_n)==dest_y && grid.findRow(up_n)==dest_x){\n\t\t\t\t\treturn new ArrayList<Cell>();\n\t\t\t\t}\n\t\t\t\telse new_filled_cells.add(up_n);\n\t\t\t}\n\t\t}\n\t\t// down neighbor\n\t\tif (i+1<grid.height){\n\t\t\tCell down_n = grid.getCell(i+1, j);\n\t\t\tif (down_n.isFaulty==false && down_n.value<0){\n\t\t\t\tdown_n.value = value; \n\t\t\t\tif (grid.findColumn(down_n)==dest_y && grid.findRow(down_n)==dest_x){\n\t\t\t\t\treturn new ArrayList<Cell>();\n\t\t\t\t}\n\t\t\t\telse new_filled_cells.add(down_n);\n\t\t\t}\n\t\t}\n\t\t\n\t//\tthis.printGrid(grid);\n\t\treturn new_filled_cells; \n\n\t}", "public void toBlue(BufferedImage img, int startX, int startY, int endX, int endY) throws IOException{\r\n int pixels[] = new int[3];\r\n double ww[]=new double[3];\r\n WritableRaster raster = img.getRaster();\r\n \r\n for(int i=startX;i<endX;i++) {\r\n \r\n for(int j=startY;j<endY;j++){\r\n \r\n raster.getPixel(i, j, pixels);\r\n \r\n ww[0] = 0*pixels[0];\r\n ww[1] = 0*pixels[1];\r\n ww[2] = pixels[2];\r\n \r\n raster.setPixel(i, j, ww);\r\n \r\n }\r\n \r\n }\r\n\r\n \r\n\r\n }", "static int getPixValue(int x, int y) {\n return pgmInf.img[y][x];\n }", "private static native void niBlackThreshold_0(long _src_nativeObj, long _dst_nativeObj, double maxValue, int type, int blockSize, double k, int binarizationMethod);", "public static void lukisImej(BufferedImage image_dest) {\n int w = image_dest.getWidth();\n int h = image_dest.getHeight();\n\n//\t\tfor(int y=0; y<h;y++)\n//\t\t{\n//\t\t\tfor(int x =0 ; x<w; x++)\n//\t\t\t{\n//\t\t\t\tif(image_dest.getRGB(x, y)==-1)\n//\t\t\t\t\tSystem.out.print(\"1\");\n//\t\t\t\telse\n//\t\t\t\t{\n//\t\t\t\t\t//System.err.print(\"X\"+x+\" Y : \"+y);\n//\t\t\t\t\t//return;\n//\t\t\t\t\tSystem.out.print(\"0\");\n//\t\t\t\t}\n//\t\t\t}\n//\t\t\tSystem.out.println(\"\");\n//\t\t}\n\n }", "public ThresholdDataPoint(int label, PixelPos pixelPos){\n\t\tthis.label = label;\n\t\tthis.pixelPos = pixelPos;\n\t\tthis.cellBody = 0;\n\t\tthis.neighbourCellBodies = new HashSet<Integer>();\n\t}", "public BufferedImage getThresh(BufferedImage img, int left, int right, int top, int bottom) { // Method to get thresholded image \n\t\t//Vision.logger.debug(\"Starting thresholding\");\n\n\t\t//stops it fucking up the locations before we've given it the thresholds\n\t\tif (worldState.isClickingDone()){\n\n\t\t\tnewBluePixels = new ArrayList<Point>();\n\t\t\tnewYellowPixels = new ArrayList<Point>();\n\t\t\tArrayList<Point> bluePixels = new ArrayList<Point>();\n\t\t\tArrayList<Point> yellowPixels = new ArrayList<Point>();\n\t\t\t/*pitch = worldState.getRoom();\n\t\t\twidth = right-left;\n\t\t\theight = top-bottom;*/\n\n\t\t\t/*\n Initialising to one to stop java dividing by 0 when it shouldn't\n\t\t\t */\n\t\t\tredCountA = 0;\n\t\t\tredCountB = 0;\n\t\t\tredCountC = 0;\n\t\t\tredCountD = 0;\n\t\t\tredCountE = 0;\n\t\t\tredCentroidA.setLocation(0,0);\n\t\t\tredCentroidB.setLocation(0,0);\n\t\t\tredCentroidC.setLocation(0,0);\n\t\t\tredCentroidD.setLocation(0,0);\n\t\t\tredCentroidE.setLocation(0,0);\n\n\t\t\tblueCountA = 0;\n\t\t\tblueCountB = 0;\n\t\t\tblueCountC = 0;\n\t\t\tblueCountD = 0;\n\t\t\tblueCountE = 0;\n\t\t\tblueCentroidA.setLocation(0,0);\n\t\t\tblueCentroidB.setLocation(0,0);\n\t\t\tblueCentroidC.setLocation(0,0);\n\t\t\tblueCentroidD.setLocation(0,0);\n\t\t\tblueCentroidE.setLocation(0,0);\n\n\t\t\tyellowCountA = 0;\n\t\t\tyellowCountB = 0;\n\t\t\tyellowCountC = 0;\n\t\t\tyellowCountD = 0;\n\t\t\tyellowCountE = 0;\n\t\t\tyellowCentroidA.setLocation(0,0);\n\t\t\tyellowCentroidB.setLocation(0,0);\n\t\t\tyellowCentroidC.setLocation(0,0);\n\t\t\tyellowCentroidD.setLocation(0,0);\n\t\t\tyellowCentroidE.setLocation(0,0);\n\n\t\t\t//Vision.logger.debug(\"Iterating image\");\n\t\t\tfor (int i = left; i < right; i++) {\n\t\t\t\tfor (int j = top; j < bottom; j++) {\n\t\t\t\t\t//Vision.logger.debug(\"Oh dear (i,j) = \" + Integer.toString(i) + \",\" + Integer.toString(j) + \")\");\n\t\t\t\t\tc = new Color(img.getRGB(i,j));\n\n\t\t\t\t\tGB = Math.abs((c.getBlue() - c.getGreen()));\n\t\t\t\t\tRG = Math.abs((c.getRed() - c.getGreen()));\n\t\t\t\t\t//RB = Math.abs((c.getRed() - c.getBlue()));\n\n\t\t\t\t\tif(isRed(c, GB)){ // was inside RB > 50 && RG > 50\n\t\t\t\t\t\timg.setRGB(i, j, Color.red.getRGB()); //Red Ball\n\t\t\t\t\t\trandy = Math.random();\n\t\t\t\t\t\tif (randy > 0 && randy <= 0.2){\t\t\t\t\t\t \n\t\t\t\t\t\t\tredCountA++;\n\t\t\t\t\t\t\tredCentroidA.setLocation(redCentroidA.getX() + i, redCentroidA.getY() + j);\n\t\t\t\t\t\t}else if (randy > 0.2 && randy <= 0.4){\n\t\t\t\t\t\t\tredCountB++;\n\t\t\t\t\t\t\tredCentroidB.setLocation(redCentroidB.getX() + i, redCentroidB.getY() + j);\n\t\t\t\t\t\t}else if (randy > 0.4 && randy <= 0.6){\n\t\t\t\t\t\t\tredCountC++;\n\t\t\t\t\t\t\tredCentroidC.setLocation(redCentroidC.getX() + i, redCentroidC.getY() + j);\n\t\t\t\t\t\t}else if (randy > 0.6 && randy <= 0.8){\n\t\t\t\t\t\t\tredCountD++;\n\t\t\t\t\t\t\tredCentroidD.setLocation(redCentroidD.getX() + i, redCentroidD.getY() + j);\n\t\t\t\t\t\t}else if (randy > 0.8 && randy <= 1){\n\t\t\t\t\t\t\tredCountE++;\n\t\t\t\t\t\t\tredCentroidE.setLocation(redCentroidE.getX() + i, redCentroidE.getY() + j);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\telse if (isYellow(c)) {\n\t\t\t\t\t\tsetCs(i,j,right,left,top,bottom, img);\n\t\t\t\t\t\tif (isYellow(cS) && isYellow(cE) && isYellow(cEE) && isYellow(cEN) && isYellow(cSS) && isYellow(cSW) ){\n\t\t\t\t\t\t\timg.setRGB(i, j, Color.yellow.getRGB()); // Yellow robot\n\t\t\t\t\t\t\tyellowRobotX.add(i);\n\t\t\t\t\t\t\tyellowRobotY.add(j);\n\t\t\t\t\t\t\trandy = Math.random();\n\t\t\t\t\t\t\tif (randy > 0 && randy <= 0.2){\t\t\t\t\t\t \n\t\t\t\t\t\t\t\tyellowCountA++;\n\t\t\t\t\t\t\t\tyellowCentroidA.setLocation(yellowCentroidA.getX() + i, yellowCentroidA.getY() + j);\n\t\t\t\t\t\t\t}else if (randy > 0.2 && randy <= 0.4){\n\t\t\t\t\t\t\t\tyellowCountB++;\n\t\t\t\t\t\t\t\tyellowCentroidB.setLocation(yellowCentroidB.getX() + i, yellowCentroidB.getY() + j);\n\t\t\t\t\t\t\t}else if (randy > 0.4 && randy <= 0.6){\n\t\t\t\t\t\t\t\tyellowCountC++;\n\t\t\t\t\t\t\t\tyellowCentroidC.setLocation(yellowCentroidC.getX() + i, yellowCentroidC.getY() + j);\n\t\t\t\t\t\t\t}else if (randy > 0.6 && randy <= 0.8){\n\t\t\t\t\t\t\t\tyellowCountD++;\n\t\t\t\t\t\t\t\tyellowCentroidD.setLocation(yellowCentroidD.getX() + i, yellowCentroidD.getY() + j);\n\t\t\t\t\t\t\t}else if (randy > 0.8 && randy <= 1){\n\t\t\t\t\t\t\t\tyellowCountE++;\n\t\t\t\t\t\t\t\tyellowCentroidE.setLocation(yellowCentroidE.getX() + i, yellowCentroidE.getY() + j);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tyellowPixels.add(new Point(i,j));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if (isBlue(c)){\n\t\t\t\t\t\tsetCs(i,j,right,left,top,bottom, img);\n\t\t\t\t\t\tif (isBlue(cS) && isBlue(cE) && isBlue(cEE) && isBlue(cEN) && isBlue(cSS) && isBlue(cSW) ){\n\t\t\t\t\t\t\timg.setRGB(i, j, Color.blue.getRGB()); // Blue robot \n\t\t\t\t\t\t\tblueRobotX.add(i);\n\t\t\t\t\t\t\tblueRobotY.add(j);\n\t\t\t\t\t\t\trandy = Math.random();\n\t\t\t\t\t\t\tif (randy > 0 && randy <= 0.2){\t\t\t\t\t\t \n\t\t\t\t\t\t\t\tblueCountA++;\n\t\t\t\t\t\t\t\tblueCentroidA.setLocation(blueCentroidA.getX() + i, blueCentroidA.getY() + j);\n\t\t\t\t\t\t\t}else if (randy > 0.2 && randy <= 0.4){\n\t\t\t\t\t\t\t\tblueCountB++;\n\t\t\t\t\t\t\t\tblueCentroidB.setLocation(blueCentroidB.getX() + i, blueCentroidB.getY() + j);\n\t\t\t\t\t\t\t}else if (randy > 0.4 && randy <= 0.6){\n\t\t\t\t\t\t\t\tblueCountC++;\n\t\t\t\t\t\t\t\tblueCentroidC.setLocation(blueCentroidC.getX() + i, blueCentroidC.getY() + j);\n\t\t\t\t\t\t\t}else if (randy > 0.6 && randy <= 0.8){\n\t\t\t\t\t\t\t\tblueCountD++;\n\t\t\t\t\t\t\t\tblueCentroidD.setLocation(blueCentroidD.getX() + i, blueCentroidD.getY() + j);\n\t\t\t\t\t\t\t}else if (randy > 0.8 && randy <= 1){\n\t\t\t\t\t\t\t\tblueCountE++;\n\t\t\t\t\t\t\t\tblueCentroidE.setLocation(blueCentroidE.getX() + i, blueCentroidE.getY() + j);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbluePixels.add(new Point(i,j));\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//make blue thresholds for the different pitches in that [pitch][x] style\n\t\t\t\t\t}\n\t\t\t\t\telse if (isGreen(c,GB,RG)) {\n\t\t\t\t\t\timg.setRGB(i,j, Color.green.getRGB()); // GreenPlates \n\t\t\t\t\t\tif (Point.distance(\tworldState.getBlueRobot().getPosition().getCentre().x,\n\t\t\t\t\t\t\t\tworldState.getBlueRobot().getPosition().getCentre().y,\n\t\t\t\t\t\t\t\ti,j) < 34) {\n\t\t\t\t\t\t\tblueGreenPlate.add(new Point(i,j));\n\t\t\t\t\t\t} \n\t\t\t\t\t\tif (Point.distance(\tworldState.getYellowRobot().getPosition().getCentre().x,\n\t\t\t\t\t\t\t\tworldState.getYellowRobot().getPosition().getCentre().y,\n\t\t\t\t\t\t\t\ti,j) < 34){\n\t\t\t\t\t\t\tyellowGreenPlate.add(new Point(i,j));\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (redCountA == 0) redCountA++;\n\t\t\tif (redCountB == 0) redCountB++;\n\t\t\tif (redCountC == 0) redCountC++;\n\t\t\tif (redCountD == 0) redCountD++;\n\t\t\tif (redCountE == 0) redCountE++;\n\t\t\tif (blueCountA == 0) blueCountA++;\n\t\t\tif (blueCountB == 0) blueCountB++;\n\t\t\tif (blueCountC == 0) blueCountC++;\n\t\t\tif (blueCountD == 0) blueCountD++;\n\t\t\tif (blueCountE == 0) blueCountE++;\n\t\t\tif (yellowCountA == 0) yellowCountA++;\n\t\t\tif (yellowCountB == 0) yellowCountB++;\n\t\t\tif (yellowCountC == 0) yellowCountC++;\n\t\t\tif (yellowCountD == 0) yellowCountD++;\n\t\t\tif (yellowCountE == 0) yellowCountE++;\n\n\n\t\t\t//TODO: Run these points through the parralax fix\n\t\t\ttotalRedX = 0;\n\t\t\ttotalRedY = 0;\n\t\t\tnumRedCentroids = 0;\n\n\n\t\t\tredCentroidA.setLocation(redCentroidA.getX()/redCountA, redCentroidA.getY()/redCountA);\n\t\t\tredCentroidB.setLocation(redCentroidB.getX()/redCountB, redCentroidB.getY()/redCountB);\n\t\t\tredCentroidC.setLocation(redCentroidC.getX()/redCountC, redCentroidC.getY()/redCountC);\n\t\t\tredCentroidD.setLocation(redCentroidD.getX()/redCountD, redCentroidD.getY()/redCountD);\n\t\t\tredCentroidE.setLocation(redCentroidE.getX()/redCountE, redCentroidE.getY()/redCountE);\n\n\t\t\ttotalYellowX = 0;\n\t\t\ttotalYellowY = 0;\n\t\t\tnumYellowCentroids = 0;\n\n\n\t\t\tyellowCentroidA.setLocation(yellowCentroidA.getX()/yellowCountA, yellowCentroidA.getY()/yellowCountA);\n\t\t\tyellowCentroidB.setLocation(yellowCentroidB.getX()/yellowCountB, yellowCentroidB.getY()/yellowCountB);\n\t\t\tyellowCentroidC.setLocation(yellowCentroidC.getX()/yellowCountC, yellowCentroidC.getY()/yellowCountC);\n\t\t\tyellowCentroidD.setLocation(yellowCentroidD.getX()/yellowCountD, yellowCentroidD.getY()/yellowCountD);\n\t\t\tyellowCentroidE.setLocation(yellowCentroidE.getX()/yellowCountE, yellowCentroidE.getY()/yellowCountE);\n\n\t\t\ttotalBlueX = 0;\n\t\t\ttotalBlueY = 0;\n\t\t\tnumBlueCentroids = 0;\n\n\n\t\t\tblueCentroidA.setLocation(blueCentroidA.getX()/blueCountA, blueCentroidA.getY()/blueCountA);\n\t\t\tblueCentroidB.setLocation(blueCentroidB.getX()/blueCountB, blueCentroidB.getY()/blueCountB);\n\t\t\tblueCentroidC.setLocation(blueCentroidC.getX()/blueCountC, blueCentroidC.getY()/blueCountC);\n\t\t\tblueCentroidD.setLocation(blueCentroidD.getX()/blueCountD, blueCentroidD.getY()/blueCountD);\n\t\t\tblueCentroidE.setLocation(blueCentroidE.getX()/blueCountE, blueCentroidE.getY()/blueCountE);\n\n\t\t\tc = new Color(img.getRGB((int)redCentroidA.getX(), (int)redCentroidA.getY()));\n\t\t\tif (isRed(c, GB)) {\n\t\t\t\ttotalRedX += redCentroidA.getX();\n\t\t\t\ttotalRedY += redCentroidA.getY();\n\t\t\t\tnumRedCentroids++;\n\t\t\t}\n\t\t\tc = new Color(img.getRGB((int)redCentroidB.getX(), (int)redCentroidB.getY()));\n\t\t\tif (isRed(c, GB)) {\n\t\t\t\ttotalRedX += redCentroidB.getX();\n\t\t\t\ttotalRedY += redCentroidB.getY();\n\t\t\t\tnumRedCentroids++;\n\t\t\t}\n\t\t\tc = new Color(img.getRGB((int)redCentroidC.getX(), (int)redCentroidC.getY()));\n\t\t\tif (isRed(c, GB)) {\n\t\t\t\ttotalRedX += redCentroidC.getX();\n\t\t\t\ttotalRedY += redCentroidC.getY();\n\t\t\t\tnumRedCentroids++;\n\t\t\t}\n\t\t\tc = new Color(img.getRGB((int)redCentroidD.getX(), (int)redCentroidD.getY()));\n\t\t\tif (isRed(c, GB)) {\n\t\t\t\ttotalRedX += redCentroidD.getX();\n\t\t\t\ttotalRedY += redCentroidD.getY();\n\t\t\t\tnumRedCentroids++;\n\t\t\t}\n\t\t\tc = new Color(img.getRGB((int)redCentroidE.getX(), (int)redCentroidE.getY()));\n\t\t\tif (isRed(c, GB)) {\n\t\t\t\ttotalRedX += redCentroidE.getX();\n\t\t\t\ttotalRedY += redCentroidE.getY();\n\t\t\t\tnumRedCentroids++;\n\t\t\t}\n\n\t\t\tif (numRedCentroids == 0){\n\t\t\t\tnumRedCentroids++;\n\t\t\t}\n\n\t\t\tredX = (int)(totalRedX/numRedCentroids);\n\t\t\tredY = (int)(totalRedY/numRedCentroids);\n\n\t\t\tc = new Color(img.getRGB((int)yellowCentroidA.getX(), (int)yellowCentroidA.getY()));\n\t\t\tif (isYellow(c)) {\n\t\t\t\ttotalYellowX += yellowCentroidA.getX();\n\t\t\t\ttotalYellowY += yellowCentroidA.getY();\n\t\t\t\tnumYellowCentroids++;\n\t\t\t}\n\t\t\tc = new Color(img.getRGB((int)yellowCentroidB.getX(), (int)yellowCentroidB.getY()));\n\t\t\tif (isYellow(c)) {\n\t\t\t\ttotalYellowX += yellowCentroidB.getX();\n\t\t\t\ttotalYellowY += yellowCentroidB.getY();\n\t\t\t\tnumYellowCentroids++;\n\t\t\t}\n\t\t\tc = new Color(img.getRGB((int)yellowCentroidC.getX(), (int)yellowCentroidC.getY()));\n\t\t\tif (isYellow(c)) {\n\t\t\t\ttotalYellowX += yellowCentroidC.getX();\n\t\t\t\ttotalYellowY += yellowCentroidC.getY();\n\t\t\t\tnumYellowCentroids++;\n\t\t\t}\n\t\t\tc = new Color(img.getRGB((int)yellowCentroidD.getX(), (int)yellowCentroidD.getY()));\n\t\t\tif (isYellow(c)) {\n\t\t\t\ttotalYellowX += yellowCentroidD.getX();\n\t\t\t\ttotalYellowY += yellowCentroidD.getY();\n\t\t\t\tnumYellowCentroids++;\n\t\t\t}\n\t\t\tc = new Color(img.getRGB((int)yellowCentroidE.getX(), (int)yellowCentroidE.getY()));\n\t\t\tif (isYellow(c)) {\n\t\t\t\ttotalYellowX += yellowCentroidE.getX();\n\t\t\t\ttotalYellowY += yellowCentroidE.getY();\n\t\t\t\tnumYellowCentroids++;\n\t\t\t}\n\n\t\t\tif (numYellowCentroids == 0){\n\t\t\t\tnumYellowCentroids++;\n\t\t\t}\n\n\t\t\tyellowX = (int)(totalYellowX/numYellowCentroids);\n\t\t\tyellowY = (int)(totalYellowY/numYellowCentroids);\n\n\t\t\tc = new Color(img.getRGB((int)blueCentroidA.getX(), (int)blueCentroidA.getY()));\n\t\t\tif (isBlue(c)) {\n\t\t\t\ttotalBlueX += blueCentroidA.getX();\n\t\t\t\ttotalBlueY += blueCentroidA.getY();\n\t\t\t\tnumBlueCentroids++;\n\t\t\t}\n\t\t\tc = new Color(img.getRGB((int)blueCentroidB.getX(), (int)blueCentroidB.getY()));\n\t\t\tif (isBlue(c)) {\n\t\t\t\ttotalBlueX += blueCentroidB.getX();\n\t\t\t\ttotalBlueY += blueCentroidB.getY();\n\t\t\t\tnumBlueCentroids++;\n\t\t\t}\n\t\t\tc = new Color(img.getRGB((int)blueCentroidC.getX(), (int)blueCentroidC.getY()));\n\t\t\tif (isBlue(c)) {\n\t\t\t\ttotalBlueX += blueCentroidC.getX();\n\t\t\t\ttotalBlueY += blueCentroidC.getY();\n\t\t\t\tnumBlueCentroids++;\n\t\t\t}\n\t\t\tc = new Color(img.getRGB((int)blueCentroidD.getX(), (int)blueCentroidD.getY()));\n\t\t\tif (isBlue(c)) {\n\t\t\t\ttotalBlueX += blueCentroidD.getX();\n\t\t\t\ttotalBlueY += blueCentroidD.getY();\n\t\t\t\tnumBlueCentroids++;\n\t\t\t}\n\t\t\tc = new Color(img.getRGB((int)blueCentroidE.getX(), (int)blueCentroidE.getY()));\n\t\t\tif (isBlue(c)) {\n\t\t\t\ttotalBlueX += blueCentroidE.getX();\n\t\t\t\ttotalBlueY += blueCentroidE.getY();\n\t\t\t\tnumBlueCentroids++;\n\t\t\t}\n\n\t\t\tif (numBlueCentroids == 0){\n\t\t\t\tnumBlueCentroids++;\n\t\t\t}\n\n\t\t\tblueX = (int)(totalBlueX/numBlueCentroids);\n\t\t\tblueY = (int)(totalBlueY/numBlueCentroids);\n\n\t\t\tblueGreenPlate4Points = plate.getCorners(blueGreenPlate);\n\t\t\tyellowGreenPlate4Points = plate.getCorners(yellowGreenPlate);\n\n\t\t\tworldState.getBlueRobot().getPosition().setCorners(blueGreenPlate4Points);\n\t\t\tworldState.getYellowRobot().getPosition().setCorners(yellowGreenPlate4Points);\n\n\t\t\tPoint fixBall = new Point(redX,redY);\n\t\t\tif ((redX != 0) && (redY != 0)) {\n\t\t\t\tif (worldState.getBarrelFix()){\n\t\t\t\t\tworldState.setBallPosition(fixBall);\n\t\t\t\t}else{ \n\t\t\t\t\tworldState.setBallPosition(DistortionFix.barrelCorrected(fixBall));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tPoint fixBlue = new Point(blueX,blueY);\n\t\t\tif ((blueX != 0) && (blueY != 0)) {\n\t\t\t\tif (worldState.getBarrelFix()){\n\t\t\t\t\tworldState.setBlueRobotPosition(fixParallax(fixBlue,worldState.getBlueRobot()));\n\t\t\t\t}else{\n\t\t\t\t\tworldState.setBlueRobotPosition(fixParallax(DistortionFix.barrelCorrected(fixBlue),worldState.getBlueRobot()));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tPoint fixYell = new Point(yellowX,yellowY);\n\t\t\tif ((yellowX != 0) && (yellowY != 0)) {\n\t\t\t\tif (worldState.getBarrelFix()){\n\t\t\t\t\tworldState.setYellowRobotPosition(fixParallax(fixYell,worldState.getYellowRobot()));\n\t\t\t\t}else{\n\t\t\t\t\tworldState.setYellowRobotPosition(fixParallax(DistortionFix.barrelCorrected(fixYell),worldState.getYellowRobot()));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor(Point p : bluePixels){\n\n\t\t\t\tif( plate.isInRectangle(p,blueGreenPlate4Points) ){\n\t\t\t\t\tif (worldState.getBarrelFix()){\n\t\t\t\t\t\tnewBluePixels.add(fixParallax(p,worldState.getBlueRobot()));\n\t\t\t\t\t}else{\n\t\t\t\t\t\tnewBluePixels.add(fixParallax(DistortionFix.barrelCorrected(p),worldState.getBlueRobot()));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(Point p : yellowPixels){\n\n\t\t\t\tif( plate.isInRectangle(p,yellowGreenPlate4Points) ){\n\t\t\t\t\tif (worldState.getBarrelFix()){\n\t\t\t\t\t\tnewYellowPixels.add(fixParallax(p,worldState.getYellowRobot()));\n\t\t\t\t\t}else{\n\t\t\t\t\t\tnewYellowPixels.add(fixParallax(DistortionFix.barrelCorrected(p),worldState.getYellowRobot()));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tworldState.setBluePixels(newBluePixels);\n\t\t\tworldState.setYellowPixels(newYellowPixels);\n\n\t\t\t//The above is supposed to filter the pixels and pick up only the T pixels, but the orientation then is always with the (0,0) point \n\n\n\t\t\tblueGreenPlate.clear();\n\t\t\tyellowGreenPlate.clear();\n\n\t\t}\n\n\t\treturn img;\n\n\t}", "void deriveImage()\n\t{\n\n\t\t//img = new BufferedImage(dimx, dimy, BufferedImage.TYPE_INT_ARGB);\n\t\timg = null;\n\t\ttry{\n\t\t\timg = ImageIO.read(new File(\"src/input/World.png\"));\n\n\t\t}catch (IOException e){\n\t\t\tSystem.out.println(\"world image file error\");\n\t\t}\n\t\t//System.out.println(img.getHeight());\n\t\t//System.out.println(img.getWidth());\n//\t\tfloat maxh = -10000.0f, minh = 10000.0f;\n//\n//\t\t// determine range of tempVals s\n//\t\tfor(int x=0; x < dimx; x++)\n//\t\t\tfor(int y=0; y < dimy; y++) {\n//\t\t\t\tfloat h = tempVals [x][y];\n//\t\t\t\tif(h > maxh)\n//\t\t\t\t\tmaxh = h;\n//\t\t\t\tif(h < minh)\n//\t\t\t\t\tminh = h;\n//\t\t\t}\n\t\t\n\t\tfor(int x=0; x < dimx; x++)\n\t\t\tfor(int y=0; y < dimy; y++) {\n\t\t\t\t \t\n\t\t\t\t// find normalized tempVals value in range\n\t\t\t\t//float val = (tempVals [x][y] - minh) / (maxh - minh);\n\t\t\t\tfloat val = tempVals[x][y];\n\n\t\t\t\t//System.out.println(val);\n\n\t\t\t\tColor c = new Color(img.getRGB(x,y));\n\n\t\t\t\tif((c.getRed() > 50 && c.getGreen() > 100 && c.getBlue() < 200)) {\n\n\t\t\t\t\tif (val != 0.0f) {\n\t\t\t\t\t\tColor col = new Color(val, 0, 0);\n\t\t\t\t\t\timg.setRGB(x, y, col.getRGB());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\n\t\t\t\n\t}", "private ArrayList<Pixel> getNeightbors(Pixel pixel)\n {\n ArrayList<Pixel> neighbors = new ArrayList<Pixel>();\n\n for(int i=-1;i<=1;i++)\n {\n int n_w=pixel.p+i;\n if(n_w<0 || n_w==this.image.getWidth()) continue;\n for(int j=-1;j<=1;j++)\n {\n int n_h=pixel.q+j;\n if(n_h<0 || n_h==this.image.getHeight()) continue;\n if(i==0 && j==0) continue;\n neighbors.add( new Pixel(n_w, n_h) );\n }//end for j\n }//end for i\n\n return neighbors;\n }", "public Image drawOnImage(Mat binary, Mat image) {\n Raster binaryRaster = toBufferedImage(binary).getData();\n int radius = 6;\n int diameter = radius * 2;\n\n BufferedImage imageBI = toBufferedImage(image);\n int width = imageBI.getWidth();\n int height = imageBI.getHeight();\n Graphics2D g2d = (Graphics2D) imageBI.getGraphics();\n g2d.setColor(Color.WHITE);\n\n for (int y = 0; y < height; y++) {\n for (int x = 0; x < width; x++) {\n int v = binaryRaster.getSample(x, y, 0);\n if (v == 0) {\n g2d.draw(new Ellipse2D.Double(x - radius, y - radius, diameter, diameter));\n }\n }\n }\n\n return imageBI;\n }", "public double distancia(Pixel pixel) {\r\n\t\tdouble distX = this.xDouble - pixel.xDouble;\r\n\t\tdouble distY = this.yDouble - pixel.yDouble;\r\n\t\tdouble val = distX * distX + distY * distY;\r\n\t\tif (val != 0)\r\n\t\t\treturn Math.sqrt(val);\r\n\t\treturn 0;\r\n\t}", "public StrictImageFinder(BufferedImage area) {\n bigWidth = area.getWidth();\n bigHeight = area.getHeight();\n bigPixels = new int[bigWidth][bigHeight];\n for(int x = 0; x < bigWidth; x++) {\n for(int y = 0; y < bigHeight; y++) {\n bigPixels[x][y] = area.getRGB(x, y);\n }\n }\n }", "public void update()\n {\n if(x + image.getWidth(null) < 0)\n {\n x = 0;\n }\n else\n {\n x--;\n }\n }", "public void updateValue (BufferedImage bi)\n {\n String text = bi.getWidth()+ \" x \"+ bi.getHeight();\n GreenfootImage tempTextImage = new GreenfootImage (text, 20, Color.RED, null);\n myImage = new GreenfootImage (tempTextImage.getWidth() + 8, tempTextImage.getHeight() + 8); \n myImage.drawImage (tempTextImage, 4, 4);\n\n setImage(myImage);\n }", "private void traverseBayeredPatternHalfSizeRGB(){\n int originalPositionX = 0;\n int originalPositionY = 1;\n\n for (int newX = 0; originalPositionX < originalImageHeight -1; newX++){\n for (int newY = 0; originalPositionY < originalImageWidth -1; newY++){\n Point newPosition = new Point(newX,newY);\n int newAbsoultPosition = getAbsolutPixelPosition(newPosition, originalImageHeight / 2, originalImageWidth / 2);\n halfSizePixRGB[newAbsoultPosition] = getAverageRGB(new Point(originalPositionX,originalPositionY));\n originalPositionY += 2;\n }\n originalPositionY = 0;\n originalPositionX += 2;\n }\n }", "public void toGreen(BufferedImage img, int startX, int startY, int endX, int endY) throws IOException{\r\n int pixels[] = new int[3];\r\n double ww[]=new double[3];\r\n WritableRaster raster = img.getRaster();\r\n \r\n for(int i=startX;i<endX;i++) {\r\n \r\n for(int j=startY;j<endY;j++){\r\n \r\n raster.getPixel(i, j, pixels);\r\n \r\n ww[0] = 0*pixels[0];\r\n ww[1] = pixels[1];\r\n ww[2] = 0*pixels[2];\r\n \r\n raster.setPixel(i, j, ww);\r\n \r\n }\r\n \r\n }\r\n\r\n \r\n\r\n }", "@Override\n\tpublic double distance(Instance first, Instance second, double cutOffValue) {\n\t\treturn 0;\n\t}", "private void setNeighboringMines(){\n\t\t//cycle the board\n\t\tfor (int r = 0; r < board.length; r++)\n\t\t\tfor (int c = 0; c < board[r].length; c++){\n\t\t\t\tint neighborCount = 0;\n\t\t\t\tif(!board[r][c].isMine()) {\n\t\t\t\t\t//checks if there is mines touching\n\t\t\t\t\tneighborCount = neighboringMines(r, c);\n\t\t\t\t\tif (neighborCount > 0) {\n\t\t\t\t\t\tboard[r][c].setIsNeighboringMine(true);\n\t\t\t\t\t\tboard[r][c].setNumNeighboringMines\n\t\t\t\t\t\t\t\t(neighborCount);\n\t\t\t\t\t} else if (neighborCount == 0) {\n\t\t\t\t\t\tboard[r][c].setNumNeighboringMines(0);\n\t\t\t\t\t\tboard[r][c].setIsNeighboringMine(false);\n\t\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void pixave(int x1, int y1, int x2, int y2) {\n float sumr,sumg,sumb;\n int pix;\n int r,g,b;\n int n;\n\n if(x1<0) x1=0;\n if(x2>=kWidth) x2=kWidth-1;\n if(y1<0) y1=0;\n if(y2>=kHeight) y2=kHeight-1;\n\n sumr=sumg=sumb=0.0f;\n for(int y=y1; y<=y2; y++) {\n for(int i=kWidth*y+x1; i<=kWidth*y+x2; i++) {\n pix= kinecter.depthImg.pixels[i];\n b=pix & 0xFF; // blue\n pix = pix >> 8;\n g=pix & 0xFF; // green\n pix = pix >> 8;\n r=pix & 0xFF; // red\n //if( random(0, 150000) > 149000 && r > 0) println(\"r \" + r + \" b \" + b + \" g \" + g);\n // averaging the values\n sumr += b;//r;//g;//r;\n sumg += b;//r;//g;\n sumb += b;//r;//g;//b;\n }\n }\n n = (x2-x1+1)*(y2-y1+1); // number of pixels\n // the results are stored in static variables\n ar = sumr/n; \n ag=sumg/n; \n ab=sumb/n;\n }", "protected float getDistance(float distance) {\r\n\t\treturn distance * parent.pixelsPerUnit;\r\n\t}", "@Test\n public void testSmallDist() throws Exception {\n assertTrue(\n new ImageSimilarity(getFile(\"imageSimilarity/with.png\"))\n .calcDistance(ImageIO.read(getFile(\"imageSimilarity/without.png\")))\n > 0);\n }", "public void setValue(float value)\n {\n \tPixelVal = value;\n }", "private void computeDirect() {\n\t\t\tif (startY > 0) {\n\t\t\t\toffset = (startY - 1) * width;\n\t\t\t} else {\n\t\t\t\toffset = 0;\n\t\t\t}\n\n\t\t\tendY = endY == height ? endY - 1 : endY;\n\n\t\t\tfor (int y = startY; y <= endY; y++) {\n\t\t\t\tfor (int x = 0; x < width; x++) {\n\t\t\t\t\tfinal Point3D moveX = xAxis.scalarMultiply(x * horizontal / (width - 1));\n\t\t\t\t\tfinal Point3D moveY = yAxis.scalarMultiply(y * vertical / (height - 1));\n\t\t\t\t\tfinal Point3D screenPoint = screenCorner.add(moveX).sub(moveY);\n\n\t\t\t\t\tfinal Ray ray = Ray.fromPoints(eye, screenPoint);\n\n\t\t\t\t\tRayCasterUtil.tracer(scene, ray, rgb);\n\t\t\t\t\tred[offset] = rgb[0] > 255 ? 255 : rgb[0];\n\t\t\t\t\tgreen[offset] = rgb[1] > 255 ? 255 : rgb[1];\n\t\t\t\t\tblue[offset] = rgb[2] > 255 ? 255 : rgb[2];\n\n\t\t\t\t\toffset++;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "private void setNeighbors() {\n\t\tfor (int i = 0; i < getNumRows(); i++) {\n\t\t\tfor (int j = 0; j < getNumCols(); j++) {\n\t\t\t\tCell c = getCurrentGrid()[i][j];\n\t\t\t\tsetNeighborsForCell(c);\n\t\t\t}\n\t\t}\n\t}", "public int binaryDistance(DataValue<T>value1, DataValue<T>value2)\r\n\t{\n\t\treturn value1.compareTo(value2);\t\t\r\n\t}", "private void traverseBayeredPatternFullSizeRGB() {\n\n for (int x = 0; x < originalImageHeight -1; x++){\n for (int y = 1; y < originalImageWidth -1; y++){\n Point position = new Point(x,y);\n int absolutePosition = getAbsolutPixelPosition(position);\n\n PixelType pixelType = null;\n\n if (x%2 == 0 && y%2 == 0) pixelType = PixelType.GREEN_TOPRED;\n if (x%2 == 0 && y%2 == 1) pixelType = PixelType.BLUE;\n if (x%2 == 1 && y%2 == 0) pixelType = PixelType.RED;\n if (x%2 == 1 && y%2 == 1) pixelType = PixelType.GREEN_TOPBLUE;\n\n fullSizePixRGB[absolutePosition] = getFullSizeRGB(new Point(x,y),pixelType);\n }\n }\n }", "public boolean test(MyList<Point> pixels, Image img)\r\n/* 19: */ {\r\n/* 20:33 */ int volume = 0;\r\n/* 21:35 */ for (MyListNode<Point> n = pixels.getHead(); n != null; n = n.getNext())\r\n/* 22: */ {\r\n/* 23:36 */ Point p = (Point)n.getDatum();\r\n/* 24: */ \r\n/* 25:38 */ int[] val = img.getVXYByte(p.x, p.y);\r\n/* 26:40 */ for (int c = 0; c < val.length; c++) {\r\n/* 27:41 */ volume += img.getXYCByte(p.x, p.y, c);\r\n/* 28: */ }\r\n/* 29: */ }\r\n/* 30:44 */ if (volume < this.threshold) {\r\n/* 31:44 */ return false;\r\n/* 32: */ }\r\n/* 33:45 */ return true;\r\n/* 34: */ }", "public void pixaveGreyscale(int x1, int y1, int x2, int y2) {\n //float sumr,sumg,sumb;\n float sumg;\n int pix;\n //int r,g,b;\n float g;\n int n;\n\n if(x1<0) x1=0;\n if(x2>=kWidth) x2=kWidth-1;\n if(y1<0) y1=0;\n if(y2>=kHeight) y2=kHeight-1;\n\n //sumr=sumg=sumb=0.0;\n sumg = 0.0f;\n for(int y=y1; y<=y2; y++) {\n for(int i=kWidth*y+x1; i<=kWidth*y+x2; i++) {\n \n // old method use depth image\n //pix= kinecter.depthImg.pixels[i];\n //g = pix & 0xFF; // grey\n //sumg += g;\n \n //b=pix & 0xFF; // blue\n // pix = pix >> 8;\n //g=pix & 0xFF; // green\n //pix = pix >> 8;\n //r=pix & 0xFF; // red\n //if( random(0, 150000) > 149000 && r > 0) println(\"r \" + r + \" b \" + b + \" g \" + g);\n // averaging the values\n //sumr += b;//r;//g;//r;\n //sumg += b;//r;//g;\n //sumb += b;//r;//g;//b;\n \n // WORK WITH RAW DEPTH INSTEAD\n sumg += kinecter.rawDepth[i];\n\n \n }\n }\n n = (x2-x1+1)*(y2-y1+1); // number of pixels\n // the results are stored in static variables\n //ar = sumr/n; \n //ag = sumg/n; \n //ab = sumb/n;\n\n ar = sumg/n; \n ag = ar; \n ab = ar;\n }", "private void overexposure(Bitmap bmp) {\n int w = bmp.getWidth();\n int h = bmp.getHeight();\n int[] pixels = new int[w*h];\n bmp.getPixels(pixels, 0, w, 0, 0, w, h);\n for (int i = 0; i < w*h; i++) {\n float[] hsv = new float[3];\n Color.RGBToHSV(Color.red(pixels[i]), Color.green(pixels[i]), Color.blue(pixels[i]), hsv);\n hsv[2] *= 1.5;\n pixels[i] = Color.HSVToColor(hsv);\n }\n bmp.setPixels(pixels, 0, w, 0, 0, w, h);\n }", "public void setNeighborsWall(String neighbor, int value){\n\t\ttry{\t\t\t\t\n\t\t\tif(neighbor.equalsIgnoreCase(\"east\") && (value == 0 || value == 1)){\t\t\t\t\n\t\t\t\teastCell.westWall = value;\n\t\t\t}else if(neighbor.equalsIgnoreCase(\"north\") && (value == 0 || value == 1)){\t\t\t\t\n\t\t\t\tnorthCell.southWall = value;\n\t\t\t}else if(neighbor.equalsIgnoreCase(\"west\") && (value == 0 || value == 1)){\t\t\t\t\n\t\t\t\twestCell.eastWall = value;\n\t\t\t}else if(neighbor.equalsIgnoreCase(\"south\") && (value == 0 || value == 1)){\t\t\t\t\n\t\t\t\tsouthCell.northWall = value;\n\t\t\t}\n\t\t}catch(NullPointerException np){\n\t\t\treturn;\n\t\t}catch(Exception e){\n\t\t\treturn;\n\t\t}\n\t}", "public Pic blackAndWhite() {\n Pic output = image.deepCopy();\n Pixel[][] outputPixels = output.getPixels();\n for (int row = 0; row < output.getHeight(); row++) {\n for (int col = 0; col < output.getWidth(); col++) {\n Pixel current = outputPixels[row][col];\n int average = (current.getRed() + current.getGreen()\n + current.getBlue()) / 3;\n if (average > 127) {\n current.setRed(255);\n current.setGreen(255);\n current.setBlue(255);\n } else {\n current.setRed(0);\n current.setGreen(0);\n current.setBlue(0);\n }\n }\n }\n return output;\n }", "protected int normalizePixelValue(double unitResult) {\r\n\t\treturn (int) unitResult;\r\n\t}", "public SimilarityMatrix<T> makeBinary(double threshold) {\n \n for(T first : getFirstDimension()) {\n \n for(T second : getMatches(first)) {\n \n if(get(first, second)>threshold) {\n set(first, second, 1.0);\n } else {\n set(first, second, 0.0);\n }\n \n }\n \n }\n \n return this;\n }", "private void setNumbers() {\n\t\tint w = worldWidth;\n\t\tint h = worldHeight;\n\t\tfor (int x = 0; x <= w - 1; x++) {\n\t\t\tfor (int y = 0; y <= h - 1; y++) {\n\t\t\t\tint numbers = 0;\n\n\t\t\t\tint right = x + 1;\n\t\t\t\tint left = x - 1;\n\t\t\t\tint up = y - 1;\n\t\t\t\tint down = y + 1;\n\n\t\t\t\tif (left < 0) {\n\t\t\t\t\tleft = 0;\n\t\t\t\t}\n\t\t\t\tif (up < 0) {\n\t\t\t\t\tup = 0;\n\t\t\t\t}\n\t\t\t\tif (down >= h) {\n\t\t\t\t\tdown = h - 1;\n\t\t\t\t}\n\t\t\t\tif (right >= w) {\n\t\t\t\t\tright = w - 1;\n\t\t\t\t}\n\n\t\t\t\tfor (int m = left; m <= right; m++) {\n\t\t\t\t\tfor (int n = up; n <= down; n++) {\n\t\t\t\t\t\tif (!(m == x && n == y)) {\n\t\t\t\t\t\t\tif (tileArr[m][n].hasBomb()) {\n\t\t\t\t\t\t\t\tnumbers++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttileArr[x][y].setNeighbors(numbers);\n\t\t\t}\n\n\t\t}\n\n\t}", "public pixelNode(int x, int y) {\r\n this.parent = null;\r\n this.x = x;\r\n this.y = y;\r\n this.terrain = null;\r\n this.elevation = 0.0;\r\n this.speed = 0.0f;\r\n double distance = 0;\r\n this.cost = Double.POSITIVE_INFINITY; //Initially assigned as infinity\r\n }", "public void setPixels(int x, int y, int w, int h, int iArray[], DataBuffer data) {\n int x1 = x + w;\n int y1 = y + h;\n\n if (x < 0 || x >= width || w > width || x1 < 0 || x1 > width || y < 0 || y >= height || h > height\n || y1 < 0 || y1 > height) {\n throw new ArrayIndexOutOfBoundsException(\"Coordinate out of bounds!\");\n }\n\n int lineOffset = y * scanlineStride + x * pixelStride;\n int srcOffset = 0;\n\n for (int i = 0; i < h; i++) {\n int pixelOffset = lineOffset;\n for (int j = 0; j < w; j++) {\n for (int k = 0; k < numBands; k++) {\n data.setElem(bankIndices[k], pixelOffset + bandOffsets[k], iArray[srcOffset++]);\n }\n pixelOffset += pixelStride;\n }\n lineOffset += scanlineStride;\n }\n }", "private void recalculateNeighbours(int x, int y) {\r\n\t\tTile t = map.getTile(x, y + 1, 0);\r\n\t\tif (t != null) {\r\n\t\t\tt.toMap(this, x, y + 1, false);\r\n\t\t}\r\n\t\tt = map.getTile(x + 1, y, 0);\r\n\t\tif (t != null) {\r\n\t\t\tt.toMap(this, x + 1, y, false);\r\n\t\t}\r\n\t\tt = map.getTile(x, y - 1, 0);\r\n\t\tif (t != null) {\r\n\t\t\tt.toMap(this, x, y - 1, false);\r\n\t\t}\r\n\t\tt = map.getTile(x - 1, y, 0);\r\n\t\tif (t != null) {\r\n\t\t\tt.toMap(this, x - 1, y, false);\r\n\t\t}\r\n\t}", "long getCollideBits();", "private float calculateSidePixel(double straightDist, double sideDist) {\n double angleToObject = Math.toDegrees(atan(sideDist/straightDist));\n double pixelsToObject = cameraType.hPPA * angleToObject;\n // calculate px\n return (float)((CameraType.imageWidth/2) - pixelsToObject);\n }", "public void filterImage()\r\n {\r\n\t if (!isInverted && !isBlured )\r\n {\r\n cropedEdited = cropedPart;\r\n }\r\n\t float[] elements = {0.0f, 1.0f, 0.0f, -1.0f,brightnessLevel,1.0f,0.0f,0.0f,0.0f}; \r\n\t Kernel kernel = new Kernel(3, 3, elements); \r\n\t BufferedImageOp change = new ConvolveOp(kernel); \r\n\t cropedEdited = change.filter(cropedEdited, null);\r\n repaint();\r\n }", "public void setInitialPixel(Position initialPixel) {\n\t\tthis.initialPixel = initialPixel;\n\t}", "public static int binaryToGray(int num) { return (num >>> 1) ^ num; }", "private int getPixelBin(int[] pixel) {\r\n\t\treturn (int) ((int) (pixel[0] / redValues) * (binsPerColour)\r\n\t\t\t\t* (binsPerColour) + (int) (pixel[1] / greenValues)\r\n\t\t\t\t* (binsPerColour) + (int) (pixel[2] / blueValues));\r\n\t}", "int distanceCheb(Coord other) {\n\t\tint deltaX = abs(x - other.x);\n\t\tint deltaY = abs(y - other.y);\n\t\treturn max(deltaX, deltaY);\n\t}", "public void updatePixel(int[] location, double[] parameters);", "void setPixels (int x, int y, int w, int h,\n \t\t ColorModel model, byte[] pixels,\n \t\t int off, int scansize) {\n\t\n \tint dst = HEADER_SIZE + lineLength * y;\n \n \t// ignore x, model, off, scansize;\n \tint i = 0;\n \n \tif (depth == 1) {\n \t int val;\n \t while (i < w) {\n \t\tval = 0;\n \t\tfor (int j = 15; j >= 0; j--)\n \t\t val |= pixels [i++] << j;\n \t\tdata [dst++] = (short) val;\n \t }\n \t}\n \telse if (depth == 4) {\n \t while (i < w) {\n \t\tdata [dst++] = (short)\n \t\t ((pixels [i] << 12)\n \t\t + (pixels [i+1] << 8)\n \t\t + (pixels [i+2] << 4)\n \t\t + (pixels [i+3]));\n \n \t\ti += 4;\n \t }\n \t}\n \telse if (depth == 8) {\n \t while(i < w) {\n \t\tdata [dst++] = (short)\n \t\t (((((int) pixels [i]) & 255) << 8)\n \t\t + ((((int) pixels [i+1]) & 255)));\n \n \t\ti += 2;\n \t }\n \t}\n \telse throw new RuntimeException (\"depth currently unsupported!\");\n }", "void updateDistance(int distance);", "double distance (double px, double py);", "public void apply(OFImage image)\n {\n int height = image.getHeight();\n int width = image.getWidth();\n OFImage original = new OFImage(image);\n \n for(int y = 0; y < height; y++) {\n for(int x = 0; x < width; x++) {\n Color currentPixel = original.getPixel(x,y);\n int grn,blu,red;\n grn = 255 - currentPixel.getGreen();\n red = 255 - currentPixel.getRed();\n blu = 255 - currentPixel.getBlue();\n image.setPixel(x, y, new Color(red,blu,grn));\n }\n }\n }", "private void updateChildesValues(int value){\n\n for (int i = 0; i < mDataSize; i++) {\n\n if(((value >> i) & 1) == 1){\n mChildTags.get(i).setValue(true);}\n else {mChildTags.get(i).setValue(false);}\n }\n }", "@Test void compareToNaive() {\n\t\tfor (var type : new ImageType[]{ImageType.SB_U8, ImageType.SB_U16, ImageType.SB_F32, ImageType.SB_F64}) {\n\t\t\tvar src = (ImageGray)type.createImage(width, height);\n\t\t\tvar dst = (ImageGray)type.createImage(1, 1);\n\n\t\t\tGImageMiscOps.fillUniform(src, rand, 0, 100);\n\n\t\t\tdouble mean = GImageStatistics.mean(src);\n\t\t\tGeometricMeanFilter.filter(src, radiusX, radiusY, mean, dst);\n\n\t\t\tassertEquals(width, dst.width);\n\t\t\tassertEquals(height, dst.height);\n\n\t\t\tfor (int y = 0; y < dst.height; y++) {\n\t\t\t\tfor (int x = 0; x < dst.width; x++) {\n\t\t\t\t\tdouble found = GeneralizedImageOps.get(dst, x, y);\n\t\t\t\t\tassertEquals(naiveMean(src, x, y, radiusX, radiusY), found, 1.0);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void filterImage() {\n\n if (opIndex == lastOp) {\n return;\n }\n\n lastOp = opIndex;\n switch (opIndex) {\n case 0:\n biFiltered = bi; /* original */\n return;\n case 1:\n biFiltered = ImageNegative(bi); /* Image Negative */\n return;\n\n case 2:\n biFiltered = RescaleImage(bi);\n return;\n\n case 3:\n biFiltered = ShiftImage(bi);\n return;\n\n case 4:\n biFiltered = RescaleShiftImage(bi);\n return;\n\n case 5:\n biFiltered = Add(bi, bi1);\n return;\n\n case 6:\n biFiltered = Subtract(bi, bi1);\n return;\n\n case 7:\n biFiltered = Multiply(bi, bi1);\n return;\n\n case 8:\n biFiltered = Divide(bi, bi1);\n return;\n\n case 9:\n biFiltered = NOT(bi);\n return;\n\n case 10:\n biFiltered = AND(bi, bi1);\n return;\n\n case 11:\n biFiltered = OR(bi, bi1);\n return;\n\n case 12:\n biFiltered = XOR(bi, bi1);\n return;\n\n case 13:\n biFiltered = ROI(bi);\n return;\n\n case 14:\n biFiltered = Negative_Linear(bi);\n return;\n\n case 15:\n biFiltered= Logarithmic_function(bi);\n return;\n\n case 16:\n biFiltered = Power_Law(bi);\n return;\n\n case 17:\n biFiltered = LUT(bi);\n return;\n\n case 18:\n biFiltered = Bit_planeSlicing(bi);\n return;\n\n case 19:\n biFiltered = Histogram(bi1,bi2);\n return;\n\n case 20:\n biFiltered = HistogramEqualisation(bi,bi3);\n return;\n\n case 21:\n biFiltered = Averaging(bi1);\n return;\n\n case 22:\n biFiltered = WeightedAveraging(bi1);\n return;\n\n case 23:\n biFiltered = fourNeighbourLaplacian(bi1);\n return;\n\n case 24:\n biFiltered= eightNeighbourLaplacian(bi1);\n return;\n\n case 25:\n biFiltered = fourNeighbourLaplacianEnhancement(bi1);\n return;\n\n case 26:\n biFiltered = eightNeighbourLaplacianEnhancement(bi1);\n return;\n\n case 27:\n biFiltered = Roberts(bi1);\n return;\n\n case 28:\n biFiltered = SobelX(bi1);\n return;\n\n case 29:\n biFiltered = SobelY(bi1);\n return;\n\n case 30:\n biFiltered = Gaussian(bi1);\n return;\n\n case 31:\n biFiltered = LoG (bi1);\n return;\n\n case 32:\n biFiltered = saltnpepper(bi4);\n return;\n\n case 33:\n biFiltered = minFiltering(bi4);\n return;\n\n case 34:\n biFiltered = maxFiltering(bi4);\n return;\n\n case 35:\n biFiltered = maidpointFiltering(bi4);\n return;\n\n case 36:\n biFiltered = medianFiltering(bi4);\n return;\n\n case 37:\n biFiltered = simpleThresholding(bi5);\n return;\n\n case 38:\n biFiltered = automatedThresholding(bi6);\n return;\n\n case 39:\n biFiltered = adaptiveThresholding(bi7);\n return;\n }\n }", "public double distance(Coordinate other, Layout layout) {\n\t\tif (Layout.HEXAGONAL.equals(layout)) {//Odd numbered rows are right-shifted by .5\n\t\t\tdouble myX = y % 2 == 0 ? x : x + .5;\n\t\t\tdouble yourX = other.y % 2 == 0 ? other.x : other.x + .5;\n\t\t\t//squash tiles along y axis so neighboring tiles are always 1 unit away\n\t\t\treturn distance(myX - yourX, (y - other.y) * HEX_RATIO);\n\t\t}\n\t\treturn distance(x - other.x, y - other.y);\n\t}", "int getMinimalPaletteDistance();", "private void updateHammingScore(int i, int j) {\n // if not free cell\n if (!(i == dimension() - 1 && j == dimension() - 1)) {\n // calculate goal value for this cell\n int goal = i * dimension() + j + 1;\n if (blocks[i][j] != goal) {\n hamming_score ++;\n }\n\n if (verbose) {\n // System.out.println(i + \",\" + j + \" \" + block + \" is \" + goal + \"?\" );\n }\n }\n }", "public void setValue(int column, int row, int newValue) {\n\t\tint goodValue = newValue;\n\t\tif (goodValue < 0) {\n\t\t\tgoodValue = 0;\n\t\t}\n\t\tif (this.hasMaximumValue) {\n\t\t\tif (goodValue > this.maximumValue) {\n\t\t\t\tgoodValue = this.maximumValue;\n\t\t\t}\n\t\t}\n\n\t\tthis.bitmap[column][row] = goodValue;\n\t}", "public void contrast(BufferedImage img, int startX, int startY, int endX, int endY) throws IOException{\r\n int pixels[] = new int[3];\r\n double ww[]=new double[3];\r\n WritableRaster raster = img.getRaster();\r\n double c = 1.1;\r\n \r\n for(int i=startX;i<endX;i++) {\r\n \r\n for(int j=startY;j<endY;j++){\r\n \r\n raster.getPixel(i, j, pixels);\r\n \r\n ww[0]=pixels[0];\r\n ww[1]=pixels[1];\r\n ww[2]=pixels[2];\r\n \r\n ww[0]=ww[0]-128;\r\n ww[1]=ww[1]-128;\r\n ww[2]=ww[2]-128;\r\n \r\n ww[0]=ww[0]*c;\r\n ww[1]=ww[1]*c;\r\n ww[2]=ww[2]*c;\r\n \r\n \r\n \r\n \r\n raster.setPixel(i, j, ww);\r\n \r\n }\r\n \r\n }\r\n\r\n }", "public void setPixels( int x, int y, int w, int h,\n ColorModel model, int pixels[], int off,\n\t\t\t int scansize )\n {\n if ( h == srcHeight ) {\n setPixels2( x, y, w, h, model, pixels, off, scansize ) ;\n }\n\n if ( intImgBuf == null ) {\n intImgBuf = new int[ srcHeight * srcWidth ] ;\n }\n\n //System.out.println( \"setPixels: x: \" + x + \" y: \" + y + \", w: \" + w + \", h: \" + h\n // + \", offset: \" + off + \", scansize \" + scansize ) ;\n\n int tindex = x + scansize * y ;\n for (int i=0;i<h;i++) {\n System.arraycopy( pixels, 0, intImgBuf, tindex, w ) ;\n tindex += scansize ;\n }\n\n if ( y + h >= srcHeight ) {\n setPixels2( 0, 0, srcWidth, srcHeight, model, intImgBuf, 0, scansize ) ;\n }\n }", "public int distTo(final int one) {\n return distace[one];\n }", "public static void initialiseKnightLookupTable() {\n\t\tfor (int square = 0; square < 64; square++) {\n\t\t\tlong target = 1L << square;\n\t\t\t// Each direction of the knight moves considered\n\t\t\t// The AND operator is used to stop moves from wrapping around the\n\t\t\t// board\n\t\t\tlong NNE = (target << 17) & ~CoreConstants.FILE_A;\n\t\t\tlong NEE = (target << 10) & ~CoreConstants.FILE_A & ~CoreConstants.FILE_B;\n\t\t\tlong SEE = (target >>> 6) & ~CoreConstants.FILE_A & ~CoreConstants.FILE_B;\n\t\t\tlong SSE = (target >>> 15) & ~CoreConstants.FILE_A;\n\t\t\tlong NNW = (target << 15) & ~CoreConstants.FILE_H;\n\t\t\tlong NWW = (target << 6) & ~CoreConstants.FILE_G & ~CoreConstants.FILE_H;\n\t\t\tlong SWW = (target >>> 10) & ~CoreConstants.FILE_G & ~CoreConstants.FILE_H;\n\t\t\tlong SSW = (target >>> 17) & ~CoreConstants.FILE_H;\n\n\t\t\tCoreConstants.KNIGHT_TABLE[square] = NNE | NEE | SEE | SSE | NNW | NWW | SWW | SSW;\n\t\t}\n\t}", "public int hammingDistance(int x, int y) {\n int count =0;\n while (x != 0 || y != 0) {\n count += (x & 1) ^ (y & 1);\n x = x >>> 1;\n y = y >>> 1;\n }\n return count;\n\t}", "static int filter(int distance) {\n if (distance >= MAX_SENSOR_DIST && invalidSampleCount < INVALID_SAMPLE_LIMIT) {\n // bad value, increment the filter value and return the distance remembered from before\n invalidSampleCount++;\n return prevDistance;\n } else {\n if (distance < MAX_SENSOR_DIST) {\n invalidSampleCount = 0; // reset filter and remember the input distance.\n }\n prevDistance = distance;\n return distance;\n }\n }", "private void populateFromSprite() {\n long start = System.currentTimeMillis();\n int bitSetIndex = 0;\n BufferedImage bImage = (BufferedImage) sprite.m_image;\n //BufferedImage img = ImageIO.read(new File(\"assets/LoopBitmap.bmp\"));\n int color;\n // Loop through image according to scale\n for(int i = 0; i < sprite.getWidth(); i+=scale) {\n for(int j = 0; j < sprite.getHeight(); j+= scale) {\n // Get color at pixel i, j, if black set Bitmap index to true.\n color = bImage.getRGB(i, j);\n if(color == Color.BLACK.getRGB()) { //tempColor.equals(Color.black)) {\n this.set(bitSetIndex, true);\n //System.out.println(\"'BLACK' Color = \"+color + \" i=\"+ i + \", j=\"+j);\n }\n bitSetIndex++;\n }\n }\n long end = System.currentTimeMillis();\n// System.out.println(\">>>>>>>>>>>>>>>>>>>>>>>>>>>>\");\n// System.out.println(\"BITMAP DONE :)\");\n// System.out.println(\"Time to build = \"+(end-start)+\"ms\");\n// System.out.println(\">>>>>>>>>>>>>>>>>>>>>>>>>>>>\");\n }", "private int manhattanMoves(int val,int curr_row,int curr_col)\n\t{\n\t\tint correct_row = (int)Math.ceil((double) val/(double)this.dimension)-1;\n\t\tint mod_val = val%this.dimension;\n\t\tint correct_col = 0;\n\t\t// make corrections\n\t\tif (mod_val == 0)\n\t\t\tcorrect_col = this.dimension -1;\n\t\telse\n\t\t\tcorrect_col = mod_val -1;\n\t\tint vertical_moves = Math.abs(correct_row - curr_row);\n\t\tint horizontal_moves = Math.abs(correct_col - curr_col);\n\t\t\n\t\treturn vertical_moves+horizontal_moves;\n\t}", "@Override\n public BufferedImage filter(BufferedImage image) {\n int width = image.getWidth();\n int height = image.getHeight();\n int imageType = image.getType();\n BufferedImage newImage = new BufferedImage(width, height, imageType);\n \n // Process each pixel in column-major order\n for (int column = 0; column < newImage.getWidth(); column++) {\n for (int row = 0; row < newImage.getHeight(); row++) {\n \n try {\n // Compare the pixel at (column, row) in this image to the pixel\n // at (column, row) in the other image, and visualize the results\n // accordingly.\n int thisRGB = image.getRGB(column, row);\n int otherRGB = this.other.getRGB(column, row);\n int difference = otherRGB - thisRGB;\n if (difference == 0) {\n newImage.setRGB(column, row, MATCH_COLOR);\n } else {\n newImage.setRGB(column, row, NO_MATCH_COLOR);\n }\n } \n \n // If the other image is narrower or shorter than this one, and this \n // pixel lies out of the range of the smaller image, then visualize\n // this pixel as \"out of bounds\"\n catch (IndexOutOfBoundsException e) {\n newImage.setRGB(column, row, OUT_OF_BOUNDS_COLOR);\n } \n }\n }\n \n return newImage;\n }", "private void updateManhattanScore(int i, int j) {\n int value = blocks[i][j];\n if (value == 0) {\n // save MatrixIndex of free square\n free = new MatrixIndex(i, j);\n } else {\n // calculate goal position for this value\n int goal_i = (value - 1) / dimension();\n int goal_j = (value - 1) % dimension();\n\n // calculate vertical and horizontal distances\n int distance = Math.abs(i - goal_i) + Math.abs(j - goal_j);\n\n // update manhattan_score\n manhattan_score += distance;\n\n if (verbose) {\n // System.out.println(value + \" from \" + i + \",\" + j + \" to \" + goal_i + \",\" + goal_j + \" = \" + distance);\n }\n }\n }" ]
[ "0.5401955", "0.53385097", "0.51504326", "0.50754803", "0.5033792", "0.49677452", "0.4951203", "0.49241227", "0.48888242", "0.4863637", "0.48548365", "0.48318073", "0.48223454", "0.48162428", "0.4805616", "0.48000756", "0.47665265", "0.47576776", "0.47343537", "0.47158766", "0.4706022", "0.46999764", "0.46965742", "0.4693549", "0.46855512", "0.46788955", "0.4674514", "0.4669875", "0.46566296", "0.46475407", "0.46475083", "0.46301702", "0.46160722", "0.4606565", "0.46005297", "0.4598213", "0.45937854", "0.45785356", "0.45604533", "0.45571575", "0.45532796", "0.45486644", "0.45409316", "0.4534655", "0.45201516", "0.4513075", "0.45119795", "0.45022756", "0.44955954", "0.44932187", "0.4492649", "0.44879854", "0.44778737", "0.44734195", "0.44603166", "0.44563907", "0.44539827", "0.44533396", "0.4451601", "0.44462723", "0.4439182", "0.44339043", "0.44303706", "0.44222352", "0.44193444", "0.43984652", "0.439753", "0.43890405", "0.43845415", "0.43802148", "0.43735", "0.43718848", "0.43698555", "0.43494686", "0.43463713", "0.43423027", "0.4341129", "0.43407607", "0.4323556", "0.4322677", "0.43218344", "0.4316612", "0.43163425", "0.43070427", "0.4306071", "0.4305229", "0.43046027", "0.43026322", "0.42987204", "0.4296192", "0.4290024", "0.42812163", "0.42803472", "0.42796075", "0.42793283", "0.42775503", "0.4273969", "0.42729574", "0.42709836", "0.4269045", "0.42669487" ]
0.0
-1
Creates the default factory implementation.
public static ControlFactory init() { try { ControlFactory theControlFactory = (ControlFactory)EPackage.Registry.INSTANCE.getEFactory("http://opaeum.org/uimetamodel/control/1.0"); if (theControlFactory != null) { return theControlFactory; } } catch (Exception exception) { EcorePlugin.INSTANCE.log(exception); } return new ControlFactoryImpl(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Factory() {\n\t\tsuper();\n\t}", "public BuiltinFactoryImpl() {\n\t\tsuper();\n\t}", "public ObjectifyFactory factory() {\n return ofy().factory();\n }", "private ConcreteFactory() {}", "public static StaticFactoryInsteadOfConstructors create(){\n return new StaticFactoryInsteadOfConstructors();\n }", "public static Factory factory() {\n return ext_h::new;\n }", "public EsoFactoryImpl()\r\n {\r\n super();\r\n }", "public XCanopusFactoryImpl()\r\n {\r\n super();\r\n }", "public CommonsFactoryImpl() {\n\t\tsuper();\n\t}", "public Factory() {\n this(getInternalClient());\n }", "public EcoreFactoryImpl() {\r\n\t\tsuper();\r\n\t}", "public PiviFactoryImpl() {\r\n\t\tsuper();\r\n\t}", "public EcoreFactoryImpl() {\n super();\n }", "public ServiceFactoryImpl() {\n\t\tsuper();\n\t}", "public static StaticFactoryInsteadOfConstructors newInstance() {\n return new StaticFactoryInsteadOfConstructors();\n }", "public interface Factory {\r\n}", "public EcoreFactoryImpl()\n {\n super();\n }", "public ProyectoFactoryImpl() {\r\n\t\tsuper();\r\n\t}", "public PedidoFactoryImpl() {\n\t\tsuper();\n\t}", "default Factory<T> toFactory() {\n throw new UnsupportedOperationException();\n }", "private ServiceFactory() {}", "protected abstract S createDefault();", "public ObjectFactory() {}", "public ObjectFactory() {}", "public ObjectFactory() {}", "public CoreFactoryImpl() {\n\t\tsuper();\n\t}", "public LanterneFactoryImpl() {\n\t\tsuper();\n\t}", "public static BuiltinFactory init() {\n\t\ttry {\n\t\t\tBuiltinFactory theBuiltinFactory = (BuiltinFactory)EPackage.Registry.INSTANCE.getEFactory(\"http://www.soluvas.com/schema/story.builtin/1.0\"); \n\t\t\tif (theBuiltinFactory != null) {\n\t\t\t\treturn theBuiltinFactory;\n\t\t\t}\n\t\t}\n\t\tcatch (Exception exception) {\n\t\t\tEcorePlugin.INSTANCE.log(exception);\n\t\t}\n\t\treturn new BuiltinFactoryImpl();\n\t}", "public FvFactoryImpl() {\n\t\tsuper();\n\t}", "public GpflFactoryImpl()\n {\n super();\n }", "public Testing2FactoryImpl() {\n\t\tsuper();\n\t}", "public static Factory factory() {\n return ext_dbf::new;\n }", "public PascalFactoryImpl()\n {\n super();\n }", "public ObjectFactory() {\r\n\t}", "public ObjectFactory() {\n\t}", "public MystFactoryImpl()\r\n {\r\n super();\r\n }", "public borFactoryImpl() {\n\t\tsuper();\n\t}", "public Factory() {\n\t\tclassMap = new TreeMap<String,Class<T> >();\n\t}", "public interface AbstractFactory {\n /**\n * Create cpu cpu.\n *\n * @return the cpu\n */\n Cpu createCpu();\n\n /**\n * Create main board main board.\n *\n * @return the main board\n */\n MainBoard createMainBoard();\n}", "public BasicSafetyCaseFactoryImpl() {\n\t\tsuper();\n\t}", "public interface Factory<T> {\n T create();\n}", "public static Factory factory() {\n return Document_print::new;\n }", "public ParameterizedInstantiateFactory() {\r\n super();\r\n }", "public interface Factory {\n LeiFeng createLeiFeng();\n}", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public static PedidoFactory init() {\n\t\ttry {\n\t\t\tPedidoFactory thePedidoFactory = (PedidoFactory) EPackage.Registry.INSTANCE\n\t\t\t\t\t.getEFactory(PedidoPackage.eNS_URI);\n\t\t\tif (thePedidoFactory != null) {\n\t\t\t\treturn thePedidoFactory;\n\t\t\t}\n\t\t} catch (Exception exception) {\n\t\t\tEcorePlugin.INSTANCE.log(exception);\n\t\t}\n\t\treturn new PedidoFactoryImpl();\n\t}", "public WdlFactoryImpl() {\n\t\tsuper();\n\t}", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }" ]
[ "0.77731436", "0.76486766", "0.74667984", "0.7430188", "0.7425205", "0.7364157", "0.72402287", "0.7239365", "0.71722776", "0.7160405", "0.71596897", "0.7150511", "0.71012115", "0.7100998", "0.7089295", "0.70861953", "0.7084425", "0.7056558", "0.70475817", "0.70462054", "0.7032594", "0.7027336", "0.70211387", "0.70211387", "0.70211387", "0.7005747", "0.69869524", "0.6978728", "0.6977554", "0.69731724", "0.69722575", "0.69408", "0.68847215", "0.6878918", "0.68729496", "0.68370944", "0.6811484", "0.6809534", "0.6806006", "0.68028957", "0.6800011", "0.67854184", "0.6762015", "0.67484313", "0.6740896", "0.6740896", "0.6740896", "0.6740896", "0.6740896", "0.6740896", "0.6740896", "0.6740896", "0.6740896", "0.6740896", "0.6740896", "0.6740896", "0.6740896", "0.6740896", "0.6740896", "0.6740896", "0.6740896", "0.6740896", "0.6740896", "0.6740896", "0.6740896", "0.6740896", "0.6740896", "0.6740896", "0.6740896", "0.6740896", "0.6740896", "0.6740896", "0.6740896", "0.6740896", "0.6740896", "0.6740896", "0.6740896", "0.6740896", "0.6740896", "0.6740896", "0.6740896", "0.6740896", "0.6740896", "0.6740896", "0.6740896", "0.6740896", "0.6740896", "0.6740896", "0.6740896", "0.6740896", "0.6740896", "0.6740896", "0.6738694", "0.6737374", "0.67329735", "0.67329735", "0.67329735", "0.67329735", "0.67329735", "0.67329735", "0.67329735" ]
0.0
-1
Creates an instance of the factory.
public ControlFactoryImpl() { super(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Factory() {\n\t\tsuper();\n\t}", "public Factory() {\n this(getInternalClient());\n }", "public static StaticFactoryInsteadOfConstructors create(){\n return new StaticFactoryInsteadOfConstructors();\n }", "public ObjectifyFactory factory() {\n return ofy().factory();\n }", "Instance createInstance();", "public static StaticFactoryInsteadOfConstructors newInstance() {\n return new StaticFactoryInsteadOfConstructors();\n }", "private ConcreteFactory() {}", "public ObjectFactory() {}", "public ObjectFactory() {}", "public ObjectFactory() {}", "public static Factory factory() {\n return ext_h::new;\n }", "public XCanopusFactoryImpl()\r\n {\r\n super();\r\n }", "private EntityFactory() {}", "public PedidoFactoryImpl() {\n\t\tsuper();\n\t}", "public static Factory factory() {\n return ext_dbf::new;\n }", "public void create(){}", "private ServiceFactory() {}", "public static BookFactory getInstance()\r\n {\r\n \r\n if(bookFactoryInstance == null)\r\n {\r\n bookFactoryInstance = new BookFactory();\r\n }\r\n \r\n return bookFactoryInstance;\r\n }", "private Object createInstance() throws InstantiationException, IllegalAccessException {\n\t\treturn classType.newInstance();\n\t}", "public EsoFactoryImpl()\r\n {\r\n super();\r\n }", "public ProyectoFactoryImpl() {\r\n\t\tsuper();\r\n\t}", "public ParameterizedInstantiateFactory() {\r\n super();\r\n }", "public ObjectFactory() {\r\n\t}", "public ObjectFactory() {\n\t}", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }" ]
[ "0.73933536", "0.7212417", "0.72005916", "0.6975247", "0.6974846", "0.68345267", "0.67098427", "0.66718435", "0.66718435", "0.66718435", "0.66642797", "0.6616401", "0.6614854", "0.66146886", "0.6589288", "0.6569264", "0.6534342", "0.65325534", "0.6525314", "0.6516507", "0.64746517", "0.64742935", "0.6472291", "0.6471961", "0.6460334", "0.6460334", "0.6460334", "0.6460334", "0.6460334", "0.6460334", "0.6460334", "0.6460334", "0.6460334", "0.6460334", "0.6460334", "0.6460334", "0.6460334", "0.6460334", "0.6460334", "0.6460334", "0.6460334", "0.6460334", "0.6460334", "0.6460334", "0.6460334", "0.6460334", "0.6460334", "0.6460334", "0.6460334", "0.6460334", "0.6460334", "0.6460334", "0.6460334", "0.6460334", "0.6460334", "0.6460334", "0.6460334", "0.6460334", "0.6460334", "0.6460334", "0.6460334", "0.6460334", "0.6460334", "0.6460334", "0.6460334", "0.6460334", "0.6460334", "0.6460334", "0.6460334", "0.6460334", "0.6460334", "0.6460334", "0.6460334", "0.6460334", "0.6460334", "0.6460334", "0.6460334", "0.6460334", "0.6460334", "0.6460334", "0.6460334", "0.6460334", "0.6460334", "0.6460334", "0.6460334", "0.6460334", "0.6460334", "0.6460334", "0.6460334", "0.6460334", "0.6460334", "0.6460334", "0.6460334", "0.6460334", "0.6460334", "0.6460334", "0.6460334", "0.6460334", "0.6460334", "0.6460334", "0.6460334" ]
0.0
-1
TODO Autogenerated method stub
@Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
@Override public void afterTextChanged(Editable s) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
Inflate the menu; this adds items to the action bar if it is present.
@Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.search, menu); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n \tMenuInflater inflater = getMenuInflater();\n \tinflater.inflate(R.menu.main_activity_actions, menu);\n \treturn super.onCreateOptionsMenu(menu);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n inflater.inflate(R.menu.actions, menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n \tgetMenuInflater().inflate(R.menu.actions, menu);\n \treturn super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.actions_bar, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main_actions, menu);\n\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\r\n\t\tinflater.inflate(R.menu.action_bar_menu, menu);\r\n\t\tmMenu = menu;\r\n\t\treturn super.onCreateOptionsMenu(menu);\r\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.act_bar_menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\r\n inflater.inflate(R.menu.main_actions, menu);\r\n\t\treturn true;\r\n //return super.onCreateOptionsMenu(menu);\r\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t MenuInflater inflater = getMenuInflater();\r\n\t inflater.inflate(R.menu.action_bar_all, menu);\r\n\t return super.onCreateOptionsMenu(menu);\r\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(android.view.Menu menu) {\n\t\t super.onCreateOptionsMenu(menu);\n\t\tMenuInflater muu= getMenuInflater();\n\t\tmuu.inflate(R.menu.cool_menu, menu);\n\t\treturn true;\n\t\t\n\t\t\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.adventure_archive, menu);\r\n\t\treturn true;\r\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.archive_menu, menu);\r\n\t\treturn true;\r\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n \tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n \t\tinflater.inflate(R.menu.main, menu);\n \t\tsuper.onCreateOptionsMenu(menu, inflater);\n \t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t MenuInflater inflater = getMenuInflater();\n\t inflater.inflate(R.menu.action_menu, menu);\n\t return super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tsuper.onCreateOptionsMenu(menu);\n\t\tMenuInflater bow=getMenuInflater();\n\t\tbow.inflate(R.menu.menu, menu);\n\t\treturn true;\n\t\t}", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n inflater.inflate(R.menu.action_menu, menu);\n super.onCreateOptionsMenu(menu, inflater);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\t\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\t\t\n\t\t/* Inflate the menu; this adds items to the action bar if it is present */\n\t\tgetMenuInflater().inflate(R.menu.act_main, menu);\t\t\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflate = getMenuInflater();\n inflate.inflate(R.menu.menu, ApplicationData.amvMenu.getMenu());\n return true;\n }", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.menu, menu);\n\t\t\treturn true; \n\t\t\t\t\t\n\t\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tinflater.inflate(R.menu.main, menu);\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) \n {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu_bar, menu);\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);//Menu Resource, Menu\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);//Menu Resource, Menu\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu_item, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tinflater.inflate(R.menu.menu, menu);\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t MenuInflater inflater = getMenuInflater();\n\t inflater.inflate(R.menu.menu, menu);\n\t return super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t inflater.inflate(R.menu.menu, menu);\n\t \n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t\t//menu.clear();\n\t\tinflater.inflate(R.menu.soon_to_be, menu);\n\t\t//getActivity().getActionBar().show();\n\t\t//getActivity().getActionBar().setBackgroundDrawable(\n\t\t\t\t//new ColorDrawable(Color.rgb(223, 160, 23)));\n\t\t//return true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n this.getMenuInflater().inflate(R.menu.main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n inflater.inflate(R.menu.main, menu);\n }", "@Override\n\tpublic void onCreateOptionsMenu( Menu menu, MenuInflater inflater )\n\t{\n\t\tsuper.onCreateOptionsMenu( menu, inflater );\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\r\n\t\treturn super.onCreateOptionsMenu(menu);\r\n\t}", "@Override\r\n public boolean onCreateOptionsMenu(Menu menu) {\r\n \t// We must call through to the base implementation.\r\n \tsuper.onCreateOptionsMenu(menu);\r\n \t\r\n MenuInflater inflater = getMenuInflater();\r\n inflater.inflate(R.menu.main_menu, menu);\r\n\r\n return true;\r\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main, menu);//Menu Resource, Menu\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main, menu);//Menu Resource, Menu\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater= getMenuInflater();\n inflater.inflate(R.menu.menu_main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n inflater.inflate(R.menu.inter_main, menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.action, menu);\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu (Menu menu){\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu_main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.custom_action_bar, menu);\n\t\treturn true;\n\t}", "public void initMenubar() {\n\t\tremoveAll();\n\n\t\t// \"File\"\n\t\tfileMenu = new FileMenuD(app);\n\t\tadd(fileMenu);\n\n\t\t// \"Edit\"\n\t\teditMenu = new EditMenuD(app);\n\t\tadd(editMenu);\n\n\t\t// \"View\"\n\t\t// #3711 viewMenu = app.isApplet()? new ViewMenu(app, layout) : new\n\t\t// ViewMenuApplicationD(app, layout);\n\t\tviewMenu = new ViewMenuApplicationD(app, layout);\n\t\tadd(viewMenu);\n\n\t\t// \"Perspectives\"\n\t\t// if(!app.isApplet()) {\n\t\t// perspectivesMenu = new PerspectivesMenu(app, layout);\n\t\t// add(perspectivesMenu);\n\t\t// }\n\n\t\t// \"Options\"\n\t\toptionsMenu = new OptionsMenuD(app);\n\t\tadd(optionsMenu);\n\n\t\t// \"Tools\"\n\t\ttoolsMenu = new ToolsMenuD(app);\n\t\tadd(toolsMenu);\n\n\t\t// \"Window\"\n\t\twindowMenu = new WindowMenuD(app);\n\n\t\tadd(windowMenu);\n\n\t\t// \"Help\"\n\t\thelpMenu = new HelpMenuD(app);\n\t\tadd(helpMenu);\n\n\t\t// support for right-to-left languages\n\t\tapp.setComponentOrientation(this);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tsuper.onCreateOptionsMenu(menu);\n\t\tMenuInflater blowUp=getMenuInflater();\n\t\tblowUp.inflate(R.menu.welcome_menu, menu);\n\t\treturn true;\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.listing, menu);\r\n\t\treturn true;\r\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.item, menu);\n return true;\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.resource, menu);\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater= getMenuInflater();\n inflater.inflate(R.menu.menu,menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.home_action_bar, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.template, menu);\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n Log.d(\"onCreateOptionsMenu\", \"create menu\");\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.socket_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main_menu, menu);//Menu Resource, Menu\n\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.actionbar, menu);\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(toolbar_res, menu);\n updateMenuItemsVisibility(menu);\n return true;\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t// \n\t\tMenuInflater mi = getMenuInflater();\n\t\tmi.inflate(R.menu.thumb_actv_menu, menu);\n\t\t\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n }", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t\t}", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t\t}", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.swag_list_activity_menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(android.view.Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\n\t\treturn true;\n\t}", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.jarvi, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "public void onCreateOptionsMenu(Menu menu, MenuInflater inflater){\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater menuInflater) {\n menuInflater.inflate(R.menu.main, menu);\n\n }", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.add__listing, menu);\r\n\t\treturn true;\r\n\t}", "@Override\r\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.actmain, menu);\r\n return true;\r\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.buat_menu, menu);\n\t\treturn true;\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.layout.menu, menu);\n\t\treturn true;\n\t}", "@Override\npublic boolean onCreateOptionsMenu(Menu menu) {\n\n\t\n\t\n\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\n\treturn super.onCreateOptionsMenu(menu);\n}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.ichat, menu);\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater)\n\t{\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t\tinflater.inflate(R.menu.expenses_menu, menu);\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.action_bar, menu);\n return true;\n }", "@Override\n \tpublic boolean onCreateOptionsMenu(Menu menu) {\n \t\tgetMenuInflater().inflate(R.menu.main, menu);\n \t\treturn true;\n \t}", "@Override\n \tpublic boolean onCreateOptionsMenu(Menu menu) {\n \t\tgetMenuInflater().inflate(R.menu.main, menu);\n \t\treturn true;\n \t}", "@Override\n \tpublic boolean onCreateOptionsMenu(Menu menu) {\n \t\tgetMenuInflater().inflate(R.menu.main, menu);\n \t\treturn true;\n \t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tsuper.onCreateOptionsMenu(menu);\n\t\tMenuInflater blowUp = getMenuInflater();\n\t\tblowUp.inflate(R.menu.status, menu);\n\t\treturn true;\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.menu, menu);\r\n\t\treturn true;\r\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn true;\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.ui_main, menu);\r\n\t\treturn true;\r\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main_activity_actions, menu);\n return true;\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n inflater.inflate(R.menu.menu_main, menu);\n super.onCreateOptionsMenu(menu, inflater);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n inflater.inflate(R.menu.menu_main, menu);\n super.onCreateOptionsMenu(menu, inflater);\n }" ]
[ "0.72473437", "0.7202402", "0.71960324", "0.7177793", "0.7108265", "0.7040525", "0.70388484", "0.70126176", "0.70101976", "0.6981143", "0.69461405", "0.694", "0.69346833", "0.69183874", "0.69183874", "0.6891571", "0.6884306", "0.68758994", "0.687534", "0.68627334", "0.68627334", "0.68627334", "0.68627334", "0.6853258", "0.6847784", "0.6820167", "0.68177783", "0.68134266", "0.68132955", "0.68132955", "0.6806282", "0.68011856", "0.6798178", "0.67916524", "0.67897713", "0.6788724", "0.6783952", "0.6759952", "0.6757919", "0.6748738", "0.67445415", "0.67445415", "0.6741439", "0.67401767", "0.6726359", "0.6724678", "0.6723058", "0.6723058", "0.6721303", "0.67123276", "0.670777", "0.67050874", "0.670039", "0.66992784", "0.6697299", "0.6695259", "0.6686728", "0.668404", "0.668404", "0.6683142", "0.668091", "0.66799283", "0.6677784", "0.6669004", "0.66677624", "0.66630834", "0.66577506", "0.66577506", "0.66577506", "0.6656902", "0.66553235", "0.66553235", "0.66553235", "0.66530025", "0.66522014", "0.6650771", "0.66497517", "0.6647805", "0.66470283", "0.66469866", "0.6646818", "0.6645723", "0.66454786", "0.66439635", "0.66434425", "0.6642393", "0.6639529", "0.6635146", "0.6634077", "0.6632954", "0.66327274", "0.66327274", "0.66327274", "0.66297686", "0.66288346", "0.66275346", "0.66271275", "0.6625066", "0.6621276", "0.6619167", "0.6619167" ]
0.0
-1
Push element x to the back of queue.
public void push(int x) { this.stack1.add(x); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void push(int x) {\n queue.addLast(x);\n }", "public void push(int x) {\n queue.addLast(x);\n }", "public void push(int x) {\n if (!reverseQueue.isEmpty()) {\n normalQueue.offer(reverseQueue.poll());\n }\n normalQueue.offer(x);\n }", "public void push(int x) {\n queue.add(x);\n for (int i = 0; i < queue.size()-1; i++) {\n queue.add(queue.poll());\n }\n }", "public void push(int x) {\n int n = queue.size();\n queue.offer(x);\n for (int i = 0; i < n; i++) {\n queue.offer(queue.poll());\n }\n }", "public void push(int x) {\n\t int size=q.size();\n\t q.offer(x);\n\t for(int i=0;i<size;i++){\n\t q.offer(q.poll());\n\t }\n\t \n\t }", "public void push(int x) {\n queue.offer(x);\n }", "public void push(int x) {\n q.add(x);\n for (int i = 0; i < q.size() - 1; ++i) {\n q.add(q.poll());\n }\n }", "public void push(int x) {\n while (!forReverse.isEmpty()) {\n queue.add(forReverse.poll());\n }\n queue.add(x);\n }", "public void push(int x) {\n Queue<Integer> tmp = new LinkedList<>();\n while (!queue.isEmpty()) {\n tmp.add(queue.remove());\n }\n queue.add(x);\n \n while (!tmp.isEmpty()) {\n queue.add(tmp.remove());\n }\n }", "public void push(int x) {\n q.offer(x);\n }", "public void push(int x) {\n // 第一步先 push\n queue.offer(x);\n // 第二步把前面的变量重新倒腾一遍\n // 这一部分代码很关键,在树的层序遍历中也用到了\n int size = queue.size() - 1;\n for (int i = 0; i < size; i++) {\n queue.offer(queue.poll());\n }\n }", "public void push(int x) {\n Integer elem = x;\n queue.offer(elem);\n topElem = elem;\n }", "public void push(int x) {\n q1.push(x);\n if (q2.size() > 0){\n q2.remove();\n }\n }", "public void push(int x) {\r\n this.queueMain.offer(x);\r\n }", "public void push(int x) {\n one.add(x);\n for(int i=0;i<one.size()-1;i++)\n {\n one.add(one.poll());\n }\n \n }", "public void push(int x) {\n queue.add(x);\n }", "public void push(int x) {\n queue.add(x);\n }", "public void push(int x) {\n queue.push(x);\n }", "public void push(int x) {\n q1.add(x);\n int n = q1.size();\n for (int i = 1; i < n; i++) {\n q1.add(q1.poll());\n }\n }", "public void push(int x) {\n // for pop(), so prepare\n // 要想 pop 省事 push到 queue tail 的 x 要 想办法放到队列第一位\n // how 只要不空 移到另外一个 放好 x 再移回来\n while (!One.isEmpty()) {\n Two.add(One.poll());\n }\n One.add(x);\n while (!Two.isEmpty()) {\n One.add(Two.poll());\n }\n }", "public void push(int x) {\n queue2.offer(x);\n while (!queue1.isEmpty()) {\n queue2.offer(queue1.poll());\n }\n Queue<Integer> temp = queue1;\n queue1 = queue2;\n queue2 = temp;\n\n\n }", "public void push(int x) {\n \n q2.offer(x);\n \n while(!q1.isEmpty()) {\n q2.offer(q1.poll());\n }\n \n Queue tmp = q1;\n q1 = q2;\n q2 = tmp;\n \n }", "public void push(int x) {\n if (queue1.isEmpty() && queue2.isEmpty()){\n queue1.offer(x);\n }else {\n if (!queue1.isEmpty()){\n queue1.offer(x);\n }\n if (!queue2.isEmpty()){\n queue2.offer(x);\n }\n }\n }", "public void push(int x) {\r\n queue1.add(x);\r\n top = x;\r\n }", "public void push(int x) {\r\n queue1.add(x);\r\n top = x;\r\n }", "public void push(int x) {\n temp.push(x);\n }", "public void push(int x) {\r\n stack.offer(x);\r\n }", "public void push(int x) {\r\n stack.offer(x);\r\n }", "private void enqueue(E x) {\n final Object[] items = this.items;\n items[putIndex] = x;\n if (++putIndex == items.length) putIndex = 0;\n count++;\n notEmpty.signal();\n }", "public void push(int x) {\n if(q1.isEmpty()) {\n q1.add(x);\n while(q2.size() > 0) {\n q1.add(q2.poll());\n }\n } else {\n q2.add(x);\n while(q1.size() > 0){\n q2.add(q1.poll());\n }\n }\n }", "public void push(int x) {\n rearStack.push(x);\n }", "public void push(int x) {\n if(!queueA.isEmpty()){\n queueA.add(x);\n }else if(!queueB.isEmpty()){\n queueB.add(x);\n }else{\n queueA.add(x);\n }\n }", "public void push(int x) {\n if(q1.isEmpty()) {\n q1.add(x);\n while(q2.size() > 0) {\n q1.add(q2.poll());\n }\n }\n else {\n q2.add(x);\n while(q1.size() > 0) {\n q2.add(q1.poll());\n }\n }\n }", "public void push(int x) {\n // Write your code here\n if (queue1.isEmpty() && queue2.isEmpty()) {\n queue1.offer(x);\n } else if (!queue1.isEmpty()) {\n queue1.offer(x);\n } else {\n queue2.offer(x);\n }\n }", "public void push(int x) {\n\t\tif (size() == capacity()) {\n\t\t\tdoubleSize();\n\t\t}\n\t\tarr[end] = x;\n\t\t++end;\n\t}", "public void push(int x) { //全部放到第一个\n temp1.push(x);\n }", "public void push(int x) {\n helper.add(x);\n helper.addAll(objects);\n\n tmp = objects;\n tmp.clear();\n objects = helper;\n helper = tmp;\n }", "public void push(T x) {\n\t\tl.push(x);\n\t}", "static void enQueue(Queue q, int x) {\r\n push(q.stack1, x);\r\n }", "public void push(int x) {\n push.push(x);\n }", "public void push(int x) {\n inSt.push(x);\n\n }", "public void push(int x) {\n\n if (list.isEmpty()) {\n head = x;\n }\n\n list2.add(x);\n while (!(list.isEmpty())) {\n list2.add(list.poll());\n }\n\n while (!(list2.isEmpty())) {\n list.add(list2.poll());\n }\n\n\n }", "public void push(int x) {\n \tint size = s2.size();\n \tfor(int i = 0; i < size; i++) {\n \t\ts.push(s2.pop());\n \t}\n \ts.push(x);\n }", "public void push(int x) {\n\t\tlist.add(x);\n\t}", "public void push(int x) {\n \tlist.add(x);\n }", "public void push(T x);", "public void push(int x) {\n data.add(x);\n }", "@Override\n\tpublic void push(Object x) {\n\t\tlist.addFirst(x);\n\t}", "public void push(int x) {\n left.push(x);\n }", "public void push(int x) {\n Node node = new Node(x);\n top.next = node;\n node.pre = top;\n top = node;\n size++;\n }", "@Override\n\tpublic void push(Object x) {\n\t\tthis.vector.add(x);\n\t}", "public void push(int x) {\n\t if(first == null){\n\t first = x;\n\t }\n\t s.push(x);\n\t}", "public void push(int x) {\n\t\tinput.push(x);\n\t}", "public static void pushQueue(MyQueue q, int x) {\n push(q.stack1, x);\n }", "public void push(int x) {\n if (storeStack.isEmpty()) {\n storeStack.push(x);\n return;\n }\n\n int[] ints = new int[storeStack.size()];\n int i =0;\n while (!storeStack.isEmpty()) {\n ints[i++] = storeStack.pop();\n }\n storeStack.push(x);\n for (int i1 = ints.length - 1; i1 >= 0; i1--) {\n storeStack.push(ints[i1]);\n\n }\n }", "public void push(E x) {\n\t\t\n\t\taddBefore(mHead.next, x);\n\n\t\tmSize++;\n\t\tmodCount++;\n\t}", "public void push(int x) {\n /**\n * 将otherStack中所有元素还原到stack中后在栈顶加入新元素\n */\n while (!otherStack.isEmpty()) {\n stack.push(otherStack.pop());\n }\n stack.push(x);\n }", "@Override\n public void insertBack(Item x) {\n if (size == items.length) {\n //dynamic array\n //resize array\n resize(size * RFACTOR);\n }\n items[size] = x;\n size += 1;\n }", "public void insert(int x)\n\t{\n//\t\treturns if queue is full\n\t\tif(isFull())\n\t\t{\n\t\t\tSystem.out.println(\"Queue Overflow\\n\");\n\t\t\treturn;\n\t\t}\n\t\tif(front==-1)\n\t\t\tfront=0;\n//\t\tif rear = last index of array\n\t\tif(rear==queueArray.length-1)\n\t\t\trear=0;\n\t\telse\n//\t\t\tincrements rear\n\t\t\trear=rear+1;\n//\t\tinserts new element in rear of array\n\t\tqueueArray[rear]=x;\n\t}", "void push(int x) {\n\t\tif (stack.size() == 0) {\n\t\t\tstack.push(x);\n\t\t\tminEle = x;\n\t\t} else if (x >= minEle) {\n\t\t\tstack.push(x);\n\t\t} else if (x < minEle) {\n\t\t\t// Push something smaller than original value\n\t\t\t// At any time when we pop , we will see if the value\n\t\t\t// of the peek is less then min or not\n\t\t\tstack.push(2 * x - minEle);\n\t\t\tminEle = x;\n\t\t}\n\t}", "public void enqueue(AnyType x) {\n\t\tNode<AnyType> newNode = new Node<AnyType>(x, null);\n\t\tback.next = newNode;\n\t\tback = newNode;\n\t\t// Running time is θ(1) because it's a constant operation.\n\t}", "public void push(int x) {\n load();\n stack.push(x);\n unload();\n }", "void push(int x) \n\t{ \n\t\tif(isEmpty() == true) \n\t\t{ \n\t\t\tsuper.push(x); \n\t\t\tmin.push(x); \n\t\t} \n\t\telse\n\t\t{ \n\t\t\tsuper.push(x); \n\t\t\tint y = min.pop(); \n\t\t\tmin.push(y); \n\t\t\tif(x < y) \n\t\t\t\tmin.push(x); \n\t\t\telse\n\t\t\t\tmin.push(y); \n\t\t} \n\t}", "public void enqueue(T x) {\n //Enqueue the item. Don't forget to increase fillCount and update last.\n if (isFull()) {\n throw new RuntimeException(\"Ring Buffer Overflow\");\n }\n rb[last] = x;\n fillCount += 1;\n last = (last + 1) % capacity;\n }", "void push(T x);", "public void push(ExParValue x) {\r\n\t\t// System.out.println(\"ExPar.push() currently on top \" +\r\n\t\t// value.toString() + \" pushing \" + x.toString());\r\n\t\tExParValue v = x.isUndefined() ? (ExParValue) value.clone()\r\n\t\t\t\t: (ExParValue) x.clone();\r\n\t\tv.next = value;\r\n\t\tvalue = v;\r\n\t\t// System.out.println(\"ExPar.push() New value: \" + value);\r\n\t}", "void enqueue(int x)\n\t{\n\t\tif(isFull())\n\t\t{\n\t\t\tSystem.out.println(\"Queue is full!\");\n\t\t\treturn;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif(isEmpty())\n\t\t\t\tfront++;\n\t\t\tqueue[++rear] = x;\n\t\t}\n\t}", "public void push(int x) {\n storeStack.push(x);\n }", "public void push(int x) {\n if(afterRotate){\n rotate();\n afterRotate = false;\n }\n stack.push(x);\n }", "void push(Integer x) {\n if (s.isEmpty()) {\n minEle = x;\n s.push(x);\n System.out.println(\"Number Inserted: \" + x);\n return;\n }\n // if new number is less than original minEle\n if (x < minEle) {\n s.push(2 * x - minEle);\n minEle = x;\n } else {\n s.push(x);\n }\n System.out.println(\"Number Inserted: \" + x);\n }", "@Override\n public void enqueue(T x) {\n if(fillCount==Buffer_num){\n throw new RuntimeException(\"Ring buffer overflow\");\n }\n rb[last] = x;\n last = adjust_L_ring_position(last);\n fillCount = fillCount+1;\n return;\n }", "public void push(int x) {\r\n inStack.push(x);\r\n }", "public void push(double x) \n {\n if (top == s.length) \n {\n \tthrow new IllegalArgumentException(\"full stack!\");\n }\n \n \n else\n {\n s[++top] = x;\n \n } \n }", "public void push(int x) {\n s1.push(x);\n }", "public void push(int x) {\r\n Stack<Integer> newStack = new Stack<>();\r\n newStack.push(x);\r\n\r\n Stack<Integer> tmp = new Stack<>();\r\n while (!this.stack.isEmpty()) {\r\n tmp.push(this.stack.pop());\r\n }\r\n\r\n while (!tmp.isEmpty()) {\r\n newStack.push(tmp.pop());\r\n }\r\n\r\n\r\n this.stack = newStack;\r\n }", "void push(Integer x) {\n\n\t\tif (isEmpty()) {\n\t\t\ttop = new Node(x);\n\t\t\tmid = top;\n\t\t\ttotalNodes++;\n\t\t} else {\n\t\t\tNode n = new Node(x);\n\t\t\tn.next = top;\n\t\t\ttop.prev = n;\n\t\t\ttop = n;\n\t\t\ttotalNodes++;\n\t\t\tif (totalNodes % 2 != 0) {\n\t\t\t\tmid = mid.prev;\n\t\t\t}\n\t\t}\n\t}", "public void push(int x) {\n if (isIn) {\n stackIn.push(x);\n } else {\n while (!stackOut.empty()) {\n stackIn.push(stackOut.pop());\n }\n stackIn.push(x);\n isIn = true;\n }\n\n }", "public void push(int x) {\n s1.push(x);\n }", "public void push(int x) {\n s1.push(x);\n }", "public void push(int x) {\n s1.push(x);\n }", "public void push(int x) {\n stack.add(x);\n }", "public void push(int x) {\n\t\tNode t = new Node();\n\t\tt.data = x;\n\t\tt.next = top;\n\t\ttop = t;\n\t}", "@Override\n\tpublic void incrementPop(int x) {\n\t\t\n\t}", "void push(int element);", "public void push(T x)\n\t{\n\t\t// If the head is null, set the head equal\n\t\t// to the new node.\n\t\tif(head == null)\n\t\t\thead = new Node<T>(x);\n\t\telse\n\t\t{\n\t\t\t// Loop through the list and add the new node\n\t\t\t// on to the back of the list.\n\t\t\tNode<T> curr = head;\n\t\t\twhile(curr.getNext() != null)\n\t\t\t\tcurr = curr.getNext();\n\n\t\t\tNode<T> last = new Node<T>(x);\n\t\t\tcurr.setNext(last);\n\t\t}\t\n\t}", "public void uncheckedPushBack(IClause c) {\n back++;\n if (back >= tab.length)\n back = 0;\n tab[back] = c;\n\n assert back + 1 != front\n && (front != 0 || back != tab.length - 1) : \"Deque is full !\";\n }", "public void push(int x) {\n pushStack.add(x);\n }", "public void push(E item) {\n if (!isFull()) {\n this.stack[top] = item;\n top++;\n } else {\n Class<?> classType = this.queue.getClass().getComponentType();\n E[] newArray = (E[]) Array.newInstance(classType, this.stack.length*2);\n System.arraycopy(stack, 0, newArray, 0, this.stack.length);\n this.stack = newArray;\n\n this.stack[top] = item;\n top++;\n }\n }", "public void push(E value) {\n list.addLast(value);\n index++;\n }", "public void enqueue(Object value)\n {\n queue.insertLast(value);\n }", "public void push(int x) {\n if (head == null) {\n head = new Node1(x, x);\n } else {\n head = new Node1(x, Math.min(x, head.min), head);\n }\n }", "public void push(int x) {\n Stack<Integer> tmp = new Stack<>();\n while(!s.isEmpty()) {\n tmp.push(s.pop());\n }\n tmp.push(x);\n while(!tmp.isEmpty()) {\n s.push(tmp.pop());\n }\n }", "public void push(int x) {\n\t\tstack.push(x);\n\t}", "public void pop() {\n move();\n reverseQueue.poll();\n }", "@Override\n public Object enqueue(Object x) {\n if (!isFull() && x != null){ // Pré-condição\n if (++tail >= MAX){\n tail = 0; // MAX-1 é a ultima posição do vetor\n }\n \n if (head == -1){\n head = tail;\n }\n \n memo[tail] = x;\n total++;\n return x;\n }\n else{ // Não pode inserir elemento nulo (x == null)\n return null; // Ou se a FILA estiver cheia\n }\n }", "public void push (T element)\r\n {\r\n if (size() == stack.length) \r\n expandCapacity();\r\n\r\n stack[top] = element;\r\n top++;\r\n }", "public void push(int x) {\n if(x <= min){\n stack.push(min);\n min=x;\n }\n stack.push(x);\n }", "public void push(int x) {\n if (storeStack.isEmpty()) {\n storeStack.push(x);\n return;\n }\n\n Stack<Integer> assistStack = new Stack<>();\n while (!storeStack.isEmpty()) {\n assistStack.push(storeStack.pop());\n }\n assistStack.push(x);\n while (!assistStack.isEmpty()) {\n storeStack.push(assistStack.pop());\n }\n }", "public void push(int x) {\n stk1.push(x);\n }" ]
[ "0.82624036", "0.8259673", "0.81935894", "0.81571823", "0.80487853", "0.8009802", "0.7990561", "0.79842633", "0.79804295", "0.7975267", "0.7919498", "0.78962463", "0.7856843", "0.78444326", "0.7841012", "0.77275115", "0.7722426", "0.7722426", "0.76359296", "0.76308316", "0.7613451", "0.7593293", "0.7580426", "0.7526367", "0.7500378", "0.7500378", "0.7471206", "0.74355227", "0.7423393", "0.7411367", "0.73738754", "0.73693335", "0.7356771", "0.73520994", "0.72848165", "0.72730684", "0.72014064", "0.71783143", "0.71159905", "0.7084847", "0.70662844", "0.69853604", "0.6980971", "0.69796485", "0.69779855", "0.6962277", "0.69543", "0.6942443", "0.6935219", "0.69181216", "0.6898908", "0.68950903", "0.6879799", "0.6856291", "0.6820406", "0.68158275", "0.6796318", "0.6776699", "0.6775979", "0.6746227", "0.674423", "0.6739258", "0.6725424", "0.6715741", "0.6676491", "0.6666506", "0.66493016", "0.66318727", "0.6620178", "0.65975296", "0.65939325", "0.6592974", "0.6589431", "0.65864205", "0.65776247", "0.657313", "0.6567979", "0.65448636", "0.65409696", "0.65409696", "0.65409696", "0.6540937", "0.65357685", "0.6530563", "0.6527506", "0.6507796", "0.64867747", "0.64852667", "0.64778817", "0.6466511", "0.6462241", "0.6458599", "0.6457872", "0.6450086", "0.64464265", "0.64434254", "0.6430324", "0.642537", "0.64232147", "0.6417516" ]
0.6579515
74