Josh
Native console access wrapper for Java

com.yifanlu.Josh
Class ConsoleSelectionInfo

java.lang.Object
  extended by com.yifanlu.Josh.ConsoleSelectionInfo

public class ConsoleSelectionInfo
extends java.lang.Object

Contains information for a console selection. Objects created from this class are immutable.

Since:
0.1
Version:
1.3, 05/29/10
Author:
Yifan Lu
See Also:
Josh.getConsoleSelectionInfo()

Field Summary
static int CONSOLE_MOUSE_DOWN
          The flag of the selection.
static int CONSOLE_MOUSE_SELECTION
          The flag of the selection.
static int CONSOLE_NO_SELECTION
          The flag of the selection.
static int CONSOLE_SELECTION_IN_PROGRESS
          The flag of the selection.
static int CONSOLE_SELECTION_NOT_EMPTY
          The flag of the selection.
 
Constructor Summary
ConsoleSelectionInfo(int flags, ConsoleCoord selectionAnchor, ConsoleSmallRect selection)
          Creates a new console selection infomation.
 
Method Summary
 boolean equals(java.lang.Object anObject)
          Compares two Objects, if both are ConsoleSelectionInfo and have the same values, they are equal.
 int getFlags()
          Gets the flags of the selection.
 ConsoleSmallRect getSelection()
          Gets the size of the selection.
 ConsoleCoord getSelectionAnchor()
          Gets the anchor coordinates for the selection.
 int hashCode()
          Returns a hash code.
 java.lang.String toString()
          A String representation of this object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

CONSOLE_MOUSE_DOWN

public static final int CONSOLE_MOUSE_DOWN
The flag of the selection.

See Also:
Constant Field Values

CONSOLE_MOUSE_SELECTION

public static final int CONSOLE_MOUSE_SELECTION
The flag of the selection.

See Also:
Constant Field Values

CONSOLE_NO_SELECTION

public static final int CONSOLE_NO_SELECTION
The flag of the selection.

See Also:
Constant Field Values

CONSOLE_SELECTION_IN_PROGRESS

public static final int CONSOLE_SELECTION_IN_PROGRESS
The flag of the selection.

See Also:
Constant Field Values

CONSOLE_SELECTION_NOT_EMPTY

public static final int CONSOLE_SELECTION_NOT_EMPTY
The flag of the selection.

See Also:
Constant Field Values
Constructor Detail

ConsoleSelectionInfo

public ConsoleSelectionInfo(int flags,
                            ConsoleCoord selectionAnchor,
                            ConsoleSmallRect selection)
Creates a new console selection infomation.

Parameters:
flags - The selection indicator. Mix and match constants from this class with the OR operator.
selectionAnchor - A ConsoleCoord that specifies the selection anchor, in characters.
selection - A ConsoleSmallRect that specifies the selection rectangle.
Method Detail

getFlags

public int getFlags()
Gets the flags of the selection.

Returns:
The selection indicator. Mix and match constants from this class with the OR operator.

getSelectionAnchor

public ConsoleCoord getSelectionAnchor()
Gets the anchor coordinates for the selection.

Returns:
The selection anchor, in characters.

getSelection

public ConsoleSmallRect getSelection()
Gets the size of the selection.

Returns:
The selection rectangle.

equals

public boolean equals(java.lang.Object anObject)
Compares two Objects, if both are ConsoleSelectionInfo and have the same values, they are equal.

Overrides:
equals in class java.lang.Object
Parameters:
anObject - Another ConsoleSelectionInfo object.
Returns:
true if all values are equal.

hashCode

public int hashCode()
Returns a hash code.

Overrides:
hashCode in class java.lang.Object
Returns:
a hash code value for this object.

toString

public java.lang.String toString()
A String representation of this object.

Overrides:
toString in class java.lang.Object
Returns:
The flag, the selection anchor location, and the selection box.

Copyright © 2010 Yifan Lu