Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Eclipse Platform Release 3.0
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.eclipse.jface.text
Class TypedPosition

    java.lang.Object
      org.eclipse.jface.text.Position
          org.eclipse.jface.text.TypedPosition

public class TypedPosition
extends Position

Convenience class for positions that have a type, similar to `ITypedRegion`.

As `Position`,`TypedPosition` can not be used as key in hash tables as it overrides `equals` and `hashCode` as it would be a value object.

Field Summary

Fields inherited from class org.eclipse.jface.text.Position
`isDeleted, length, offset`

Constructor Summary
`TypedPosition(int offset, int length, String type)` Creates a position along the given specification.
`TypedPosition(ITypedRegion region)` Creates a position based on the typed region.

Method Summary
`boolean` | `equals(Object o)`
`String` | `getType()` Returns the type of the position
`int` | `hashCode()`

Methods inherited from class org.eclipse.jface.text.Position
`delete, getLength, getOffset, includes, isDeleted, overlapsWith, setLength, setOffset, undelete`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### TypedPosition

    public TypedPosition(int offset,
                         int length,
                         String type)

  Creates a position along the given specification.

Parameters:
  `offset` - the offset of this position
  `length` - the length of this position
  `type` - the type of this position

### TypedPosition

    public TypedPosition(ITypedRegion region)

  Creates a position based on the typed region.

Parameters:
  `region` - the typed region

Method Detail

### getType

    public String getType()

  Returns the type of the position

  Returns:
    the type of this position

### equals

    public boolean equals(Object o)

  Overrides:
    `equals` in class `Position`

### hashCode

    public int hashCode()

  Overrides:
    `hashCode` in class `Position`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Eclipse Platform Release 3.0
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2000, 2004. All rights reserved.